I am a little stunned:
I wrote some code for my application and I made a typo. I added square brackets, not p. Smart Eclipse added another bracket for me. To my surprise, there were no warnings about any syntax errors.
System.setProperty("apple.laf.useScreenMenuBar", "true");[] // No Warnings or Errors?!?!? this.initalize();
I can add them anywhere in the constructors and methods, but not somewhere outside of this. I continued to experiment:
this.initalize();[][][] // this.parent.setJMenuBar(this); this.setVisible(true);
I can have multiple arrays ...
this.initalize();[[]] // Syntax Error, delete this token //this.parent.setJMenuBar(this); this.setVisible(true);
But nothing is invested.
I tried a little more ... I get errors in certain places.
JMenuItem help_about = new JMenuItem("About the Developers..."); []
Half-columns make these errors vulnerable:
[];
It seems that I can put these brackets anywhere as long as there is a reserved keyword that follows it.
[] return view;
Nothing changes when you save the code, restart Eclipse or something else. Some information about my system:
- Eclipse Luna 4.4.2
- Compliance Level 1.6.
- Java 7 (I think) No! Java Version 1.6.0_65
So here is my question ...
- Is this an eclipse bug?
- Is this something unintentional with java syntax?
- Or that...
This is not a mistake ... This is a feature !!!
source share