Strange Formatting in 10.5

Haven't updated yet, as I got pulled into a non-java project.  However, I came back to my trustworthy IDEA to do some quick java work and my world changed.

I have something simple like this:


    double values[] = {1, 2, 3, 4, 5};
    double newValues[] = new double[values.length];

I type my 'itar' live template key to generate a for look for the values array, and I get back this:

   for(
    int i = 0;
    i<values.length;i++)

    {
        double value = values[i];
        
    }

Any idea why this for loop is broken up over 7 lines instead of what I was expecting:

     for(int i=0; i<values.length; i++{
          double value = values[i];
     }

I checked out the settings for Wrapping and Braces under the 'for90' section, and everthing seems set correctly.  and I don't remember making any changes.

Thanks for any help you can provide.

"Look away for just a little while...."


Thanks,

Eric

---
Original message URL: http://devnet.jetbrains.net/message/5460026#5460026

0
3 comments
Avatar
Permanently deleted user

Hi Eric,

Please check if the template definition contains those unexpected line feeds - IDE Settings | Live Templates | Iteration | itar

Denis

0

Denis,

     My apologies.  I thought I successfully deleted this thread shortly after creating it.  I was not paying attention.  It formatted that way because I was within a class but outside of any method when I typed my 'itar'.  I was asleep at the wheel.

Good:


public class Main {

    public static void main(String[] args) {
        double values[] = {1, 2, 3, 4, 5};
        double newValues[] = new double[values.length];


        for (int i = 0; i < newValues.length; i++) {
            double newValue = newValues[i];
        }
    }
}


Bad:

public class Main {

    
    double values[] = {1, 2, 3, 4, 5};


    for(
    int i = 0;
    i<values.length;i++)


    {
        double value = values[i];
        
    }


}


Duh!

0
Avatar
Permanently deleted user

Ok, thanks for the update.

Denis

0

Please sign in to leave a comment.