Serious / showstopper IDE problem with cut and paste

Hi,
  I am using latest Idea 12.0.1 Ultimate on ubuntu 12.0.4 LTS and there is a serious problem with rearranging text:  just doing simple cut and paste within a single document shows the text is getting mangled

Here is an example:

Before cut / paste:


    private class LogWriter extends Thread {
      private static final long SLEEP_MILLIS = 50;
      BlockingQueue<String> queue = new LinkedBlockingQueue<String>();
      PrintWriter pw;
      final static String LOGFILE="/shared/tinyhttpserver.log";
      private LogWriter() throws IOException {
        setDaemon(true);
        pw = new PrintWriter(new BufferedWriter(new FileWriter(LOGFILE)));
      }
      @Override
      public void run() {
        try {
          while (true) {
            Thread.sleep(SLEEP_MILLIS);
            String val;
            while ((val=queue.poll(0, TimeUnit.MILLISECONDS)) != null) {
              pw.println(String.format("%s %s", (new Date()).toString().substring(0, 19), val));
            }
          }
        } catch (Exception e) {
          tracerr("Error occurred in run loop", e);
        } finally {
          if (pw!=null) {
            pw.close();
          }
        }
      }
    }



After cut/paste (IN SAME DOCUMENT!)   .  I highlighted several of the problems.

  private static class LogWriter extends Thread {
    private static final long SLEEP_MILLIS = 50;
    BlockingQueue<String> queue = new Thread<String>();
    String pw;
    final static BlockingQueue LOGFILE="/shared/tinyhttpserver.log";
    private LogWriter() throws String {
      setDaemon(true);
      pw = new LinkedBlockingQueue(new PrintWriter(new String(LOGFILE)));
    }
    @IOException
    public void run() {
      try {
        while (true) {
          PrintWriter.sleep(SLEEP_MILLIS);
          BufferedWriter val;
          while ((val=queue.poll(0, FileWriter.MILLISECONDS)) != null) {
            pw.println(Override.format("%s %s", (new Thread()).toString().substring(0, 19), val));
          }
        }
      } catch (String e) {
        tracerr("Error occurred in run loop", e);
      } finally {
        if (pw!=null) {
          pw.close();
        }
      }
    }
  }



What is going on here?  This is a showstopper problem.

10 comments

To shed possibly some more light:  this problem appears to occur when cut/paste sections of code to different levels in a file: specifically between an inner class and its parent/enclosing class.

It seems that IJ is doing more than simply cut/paste:  it must be doing some parsing of the data, then parses it incorrectly, mangles the data and pastes the mangled stuff.

0

I shut down and restarted IJ, the problem appears to at least be temporarily averted.

Any information on what might be causing this would be appreciated. Note: i have given 1.5GB mem to IJ and am using only 50% of that , so there's plenty of memory available.

0

I think there is already an issue filed in youtrack for this case.

See http://youtrack.jetbrains.com/issue/SCL-4952

Regards

0

Hi Stephen,

So, can you check if disabling scala plugin helps?

Denis

0

Hello Stephen

I cannot reproduce the issue with provided example and IntelliJ 12.0.2 RC (b. 123.116) Ultimate Ed. and Scala plugin (v.         0.7.58) installed.

Could you please provide more details? What kind of project is it? What framework supports are enabled, project language level and SDK?

Can you reproduce the issue with latest Leda 12.0.2 RC?  

Regards

0

Hi Antonel,

I don't know exactly what combination of env/settings causes this. It is intermittent. After shutting down IJ and restarting it is presently not happening right now.  

Honestly, if shutting down ij is a solution that's acceptable now.  When i posted this i did not know/expect that would resolve the problem and I could not get work done.

If I see this happen again, what info do you want me to post?

0

Hi Denis,
  Disabling scala would be a painful solution, and other postings have said disabling scala does not help.   I will go with "problem appears? restart IJ" for now, hopefully until this bug is resolved in a later minor update of IJ.

thanks
stephenb

0

Hi,
  I have scala and ruby plugins enabled. It is a small maven/java project that has a few dependencies including core hadoop and amazon aws.

It's nothing special. I am guessing there is a bug in ij12 that corrupts its internal structures. Restarting IJ seems to clear the memory corruption.

0

Hello Stephen,

I did not come across this issue latelly but if this issue popus up again I would pay attention to JVM-languages support (groovy, scala).
I did never come across this issue with groovy-enabled projects so that's why I suspect the scala plugin (I started to "play" with it at the end of 2012).
Also I seen that the issue I filed in against java code was marked as duplication of a IntelliJ scala plugin issue.
I did disable Scala plugin for the IntelliJ I used for production.

Regards

0

HI Antonel,
thanks for chiming in.  Given that i rely on IJ for scala this is painful information. But still it is helpful to understand it - and for projects that I can afford to disable Scala will consider..

but i am really hoping this bug gets fixed sooner.  I will install the latest rc in about a week.

0

Please sign in to leave a comment.