@@ -1161,15 +1161,15 @@ private static abstract class ClassNameAndPackageEntry implements Comparable<Cla
11611161
11621162 public int compareTo (ClassNameAndPackageEntry other ) {
11631163 int res = getClassName ().toLowerCase ().compareTo (other .getClassName ().toLowerCase ());
1164- if (res != 0 ) { return res ; }
1164+ if (res != 0 ) { return res ; }
11651165 return getFullPackage ().toLowerCase ().compareTo (other .getFullPackage ().toLowerCase ());
11661166 }
1167+ // WARNING: this relation is finer grained that the equivalance relation induced by compareTo above
11671168 public boolean equals (Object other ) {
1168- if (other == null ) { return false ; }
1169+ if (other == null ) { return false ; }
11691170 if (! (other instanceof ClassNameAndPackageEntry )) return false ;
11701171 ClassNameAndPackageEntry o = (ClassNameAndPackageEntry )other ;
1171- return ((getClassName ().equals (o .getClassName ())) &&
1172- (getFullPackage ().equals (o .getFullPackage ())));
1172+ return (getClassName ().equals (o .getClassName ()) && getFullPackage ().equals (o .getFullPackage ()));
11731173 }
11741174 public int hashCode () { return hash (getClassName ().hashCode (), getFullPackage ().hashCode ()); }
11751175 }
@@ -1187,12 +1187,12 @@ public GoToFileListEntry(OpenDefinitionsDocument d, String s) {
11871187 str = s ;
11881188 }
11891189 public String getFullPackage () {
1190- if (fullPackage != null ) { return fullPackage ; }
1190+ if (fullPackage != null ) { return fullPackage ; }
11911191 fullPackage = "" ;
11921192 if (doc !=null ) {
11931193 try {
11941194 fullPackage = doc .getPackageName ();
1195- if (fullPackage .length ()> 0 ) { fullPackage += '.' ; }
1195+ if (fullPackage .length () > 0 ) { fullPackage += '.' ; }
11961196 }
11971197 catch (Exception e ) { fullPackage = "" ; }
11981198 }
@@ -4817,12 +4817,10 @@ private void _printDefDocPreview() {
48174817 _showFileMovedError (fme );
48184818 }
48194819 catch (BadLocationException e ) {
4820- _showError (e , "Print Error" ,
4821- "An error occured while preparing the print preview." );
4820+ _showError (e , "Print Error" , "An error occured while preparing the print preview." );
48224821 }
48234822 catch (IllegalStateException e ) {
4824- _showError (e , "Print Error" ,
4825- "An error occured while preparing the print preview." );
4823+ _showError (e , "Print Error" , "An error occured while preparing the print preview." );
48264824 }
48274825 }
48284826
@@ -4832,8 +4830,7 @@ private void _printConsolePreview() {
48324830 new PreviewConsoleFrame (_model , this , false );
48334831 }
48344832 catch (IllegalStateException e ) {
4835- _showError (e , "Print Error" ,
4836- "An error occured while preparing the print preview." );
4833+ _showError (e , "Print Error" , "An error occured while preparing the print preview." );
48374834 }
48384835 }
48394836
@@ -4843,8 +4840,7 @@ private void _printInteractionsPreview() {
48434840 new PreviewConsoleFrame (_model , this , true );
48444841 }
48454842 catch (IllegalStateException e ) {
4846- _showError (e , "Print Error" ,
4847- "An error occured while preparing the print preview." );
4843+ _showError (e , "Print Error" , "An error occured while preparing the print preview." );
48484844 }
48494845 }
48504846
@@ -4858,8 +4854,7 @@ private void _pageSetup() {
48584854
48594855 private void _closeAll () {
48604856 updateStatusField ("Closing All Files" );
4861- if (!_model .isProjectActive () || _model .isProjectActive () && _closeProject ())
4862- _model .closeAllFiles ();
4857+ if (!_model .isProjectActive () || _model .isProjectActive () && _closeProject ()) _model .closeAllFiles ();
48634858 }
48644859
48654860 private boolean _save () {
@@ -4898,8 +4893,7 @@ private boolean _saveAs() {
48984893 updateStatusField ("Saving File Under New Name" );
48994894 try {
49004895 boolean toReturn = _model .getActiveDocument ().saveFileAs (_saveAsSelector );
4901- /** this highlights the document in the navigator */
4902- _model .setActiveDocument (_model .getActiveDocument ());
4896+ _model .setActiveDocument (_model .getActiveDocument ()); // highlights the document in the navigator
49034897 return toReturn ;
49044898 }
49054899 catch (IOException ioe ) {
@@ -4913,9 +4907,7 @@ private boolean _rename() {
49134907 if (!_model .getActiveDocument ().fileExists ()) return _saveAs ();
49144908 else {
49154909 File fileToDelete ;
4916- try {
4917- fileToDelete = _model .getActiveDocument ().getFile ();
4918- }
4910+ try { fileToDelete = _model .getActiveDocument ().getFile (); }
49194911 catch (FileMovedException fme ) { return _saveAs (); }
49204912 boolean toReturn = _model .getActiveDocument ().saveFileAs (_saveAsSelector );
49214913 /** Delete the old file if save was successful. */
0 commit comments