From: <chr...@us...> - 2006-12-23 22:27:39
|
Revision: 1245 http://svn.sourceforge.net/gridarta/?rev=1245&view=rev Author: christianhujer Date: 2006-12-23 14:27:35 -0800 (Sat, 23 Dec 2006) Log Message: ----------- Added several performance issues to the error policy. Improved some code regarding performance. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CFArchType.java trunk/crossfire/src/cfeditor/CFArchTypeList.java trunk/crossfire/src/cfeditor/CFJavaEditor.java trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CPickmapPanel.java trunk/crossfire/src/cfeditor/CResourceLoader.java trunk/crossfire/src/cfeditor/JarResources.java trunk/crossfire/src/cfeditor/ScriptArchData.java trunk/crossfire/src/cfeditor/Spells.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/crossfire/src/cfeditor/io/CMapWriter.java trunk/daimonin/src/daieditor/CFArchType.java trunk/daimonin/src/daieditor/CFArchTypeList.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/CMainView.java trunk/daimonin/src/daieditor/CPickmapPanel.java trunk/daimonin/src/daieditor/CopyBuffer.java trunk/daimonin/src/daieditor/Spells.java trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointChecker.java trunk/gridarta.ipr trunk/src/app/net/sf/gridarta/UndoAndRedo.java Modified: trunk/crossfire/src/cfeditor/CFArchType.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/CFArchType.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -371,7 +371,7 @@ // parse attribute if (attrib.load(elem, tlist, typeName)) { // add this attribute to the list: - if (attrList.size() > 0) { + if (!attrList.isEmpty()) { attrList.get(attrList.size() - 1).setNext(attrib); } attrList.add(attrib); Modified: trunk/crossfire/src/cfeditor/CFArchTypeList.java =================================================================== --- trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/CFArchTypeList.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -197,7 +197,7 @@ throw new RuntimeException("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); } else { final List<?> list = parseListFromElement(elem); - if (list != null && list.size() > 0) { + if (list != null && !list.isEmpty()) { listTable.put(elem.getAttribute("name"), list); } } @@ -242,7 +242,7 @@ } } // now add the list vector to the ignoreListTable: - if (content.size() > 0) { + if (!content.isEmpty()) { ignoreListTable.put(lname, content); } } @@ -383,7 +383,7 @@ * @return <code>true</code> if this typelist contains no data, otherwise <code>false</code>. */ public boolean isEmpty() { - return archTypeList.size() == 0; + return archTypeList.isEmpty(); } /** Modified: trunk/crossfire/src/cfeditor/CFJavaEditor.java =================================================================== --- trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/CFJavaEditor.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -109,7 +109,7 @@ return; } } - if (inlist != null && infiles.size() > 0) { + if (inlist != null && !infiles.isEmpty()) { System.err.println("-filelist option and loading maps are mutually exclusive"); System.exit(1); } Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -650,7 +650,7 @@ SwingUtilities.updateComponentTreeUI(mainView); // update the look and feel for all open map views - if (levels.size() > 0) { + if (!levels.isEmpty()) { for (final MapControl level : levels) { level.getMapViewFrame().updateLookAndFeel(); if (log.isDebugEnabled()) { @@ -752,7 +752,7 @@ * @return <code>true</code> if all levels closed, <code>false</code> if user cancelled */ public boolean closeAll() { - while (levels.size() > 0) { + while (!levels.isEmpty()) { final MapControl mapToClose; if (currentMap == null) { mapToClose = levels.get(levels.size() - 1); @@ -846,7 +846,7 @@ mainView.removeLevelView(level.getMapViewFrame()); levels.remove(level); - if (levels.size() > 0) { + if (!levels.isEmpty()) { // get next open map we can find and set it to currentMap setCurrentLevel(levels.get(levels.size() - 1)); } else { Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -545,7 +545,7 @@ * @return All level windows */ @Nullable List<MapViewIFrame> getAllLevelWindows() { - if (mapViews != null && mapViews.size() > 0) { + if (mapViews != null && !mapViews.isEmpty()) { return Collections.unmodifiableList(mapViews); } @@ -736,7 +736,7 @@ final JMenu menuWindow = (JMenu) ACTION_FACTORY.find(getJMenuBar(), "window"); menuWindow.removeAll(); menuWindow.add(aCloseAll); - if (mapViews.size() != 0) { + if (!mapViews.isEmpty()) { menuWindow.addSeparator(); } int index = 0; Modified: trunk/crossfire/src/cfeditor/CPickmapPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/CPickmapPanel.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -280,7 +280,7 @@ return; // for safety, shouldn't happen } - if (pickmaps.size() == 0) { + if (pickmaps.isEmpty()) { currentPickMap = null; return; } Modified: trunk/crossfire/src/cfeditor/CResourceLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/CResourceLoader.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/CResourceLoader.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -177,7 +177,7 @@ * application dir and the filename. */ public static String getHomeFileName(final String filename) { - final StringBuffer buf = new StringBuffer(128); + final StringBuilder buf = new StringBuilder(128); final String home = System.getProperty("user.home"); buf.append(home); buf.append(File.separator).append(IGUIConstants.APP_SETTINGS_DIR); Modified: trunk/crossfire/src/cfeditor/JarResources.java =================================================================== --- trunk/crossfire/src/cfeditor/JarResources.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/JarResources.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -167,7 +167,7 @@ * @return String with information on the supplied ZipEntry. */ private String dumpZipEntry(final ZipEntry ze) { - final StringBuffer sb = new StringBuffer(); + final StringBuilder sb = new StringBuilder(); if (ze.isDirectory()) { sb.append("d "); } else { Modified: trunk/crossfire/src/cfeditor/ScriptArchData.java =================================================================== --- trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/ScriptArchData.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -170,7 +170,7 @@ * @return index of ScriptedEvent in 'eventList' if found, -1 if not found */ private int getScriptedEvent(final String eventType) { - if (eventList != null && eventList.size() > 0) { + if (eventList != null && !eventList.isEmpty()) { for (int i = 0; i < eventList.size(); i++) { final ScriptedEvent se = eventList.get(i); if (se.getEventType().equalsIgnoreCase(eventType)) { @@ -191,7 +191,7 @@ * events were invalid (and deleted) */ public boolean validateAllEvents() { - if (eventList != null && eventList.size() > 0) { + if (eventList != null && !eventList.isEmpty()) { int numEvents = eventList.size(); for (int i = 0; i < numEvents; i++) { @@ -208,7 +208,7 @@ } } - if (eventList.size() > 0) { + if (!eventList.isEmpty()) { return true; // there is at least one remaining valid event } } @@ -223,7 +223,7 @@ public String getMapArchEventData() { final StringBuilder buff = new StringBuilder(); - if (eventList != null && eventList.size() > 0) { + if (eventList != null && !eventList.isEmpty()) { for (final ScriptedEvent se : eventList) { buff.append(se.getMapArchText()); } @@ -252,7 +252,7 @@ * @return a cloned instance of this ScriptArchData object */ @Nullable public ScriptArchData getClone() { - if (eventList != null && eventList.size() > 0) { + if (eventList != null && !eventList.isEmpty()) { final ScriptArchData clone = new ScriptArchData(); // new instance for (int i = 0; i < eventList.size(); i++) { @@ -601,7 +601,7 @@ * @return <code>true</code> if this ScriptArchData contains no events, otherwise <code>false</code>. */ public boolean isEmpty() { - return eventList == null || eventList.size() == 0; + return eventList == null || eventList.isEmpty(); } /** Inner class which stores information about one scripted event. */ Modified: trunk/crossfire/src/cfeditor/Spells.java =================================================================== --- trunk/crossfire/src/cfeditor/Spells.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/Spells.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -161,7 +161,7 @@ } // --------- now write the "spells.def" file --------- - if (list != null && list.size() > 0) { + if (list != null && !list.isEmpty()) { final File dfile; // create new file for writing (replaces old one if existent) if (IGUIConstants.CONFIG_DIR != null && IGUIConstants.CONFIG_DIR.length() > 0) { @@ -260,7 +260,7 @@ // loading successful log.info("Loaded " + tmpSpellNames.size() + " defined spells from '" + IGUIConstants.SPELL_FILE + "'"); - if (tmpSpellNames.size() == 0) { + if (tmpSpellNames.isEmpty()) { log.warn("File '" + IGUIConstants.SPELL_FILE + "' has no content."); } else { tmpSpellNames.add(0, "<none>"); Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -283,7 +283,7 @@ } final String elevation = arch.getAttributeString("elevation", false); - if (!elevation.equals("")) { + if (elevation.length() != 0) { setAttributeString("elevation", elevation); arch.removeAttribute("elevation"); } Modified: trunk/crossfire/src/cfeditor/io/CMapWriter.java =================================================================== --- trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/crossfire/src/cfeditor/io/CMapWriter.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -87,7 +87,7 @@ if (gameObject.isScripted()) { final String events = gameObject.getMapArchEventData(); - if (!events.equals("")) { + if (events.length() != 0) { final String[] tmp = events.split("\n"); for (final String aTmp : tmp) { final String[] line = aTmp.split(" +", 2); @@ -152,7 +152,7 @@ } final String text = gameObject.getObjectText(); - if (!text.equals("")) { + if (text.length() != 0) { final String[] tmp = text.split("\n"); for (final String aTmp : tmp) { final String[] line = aTmp.split(" +", 2); Modified: trunk/daimonin/src/daieditor/CFArchType.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchType.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/CFArchType.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -362,7 +362,7 @@ // parse attribute if (attrib.load(elem, tlist, typeName)) { // add this attribute to the list: - if (attrList.size() > 0) { + if (!attrList.isEmpty()) { attrList.get(attrList.size() - 1).setNext(attrib); } attrList.add(attrib); Modified: trunk/daimonin/src/daieditor/CFArchTypeList.java =================================================================== --- trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/CFArchTypeList.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -201,7 +201,7 @@ throw new RuntimeException("In file '" + IGUIConstants.TYPEDEF_FILE + "': cannot load list element without 'name'."); } else { final List<?> list = parseListFromElement(elem); - if (list != null && list.size() > 0) { + if (list != null && !list.isEmpty()) { listTable.put(elem.getAttribute("name"), list); } } @@ -246,7 +246,7 @@ } } // now add the list vector to the ignoreListTable: - if (content.size() > 0) { + if (!content.isEmpty()) { ignoreListTable.put(lname, content); } } @@ -412,7 +412,7 @@ * @return <code>true</code> if this typelist contains no data, otherwise <code>false</code>. */ public boolean isEmpty() { - return archTypeList.size() == 0; + return archTypeList.isEmpty(); } /** Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/CMainControl.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -925,7 +925,7 @@ * @return <code>true</code> if all levels closed, <code>false</code> if user cancelled */ public boolean closeAll() { - while (levels.size() > 0) { + while (!levels.isEmpty()) { final MapControl mapToClose; if (currentMap == null) { mapToClose = levels.get(levels.size() - 1); @@ -1022,7 +1022,7 @@ } levels.remove(level); - if (levels.size() > 0) { + if (!levels.isEmpty()) { // get next open map we can find and set it to currentMap setCurrentLevel(levels.get(levels.size() - 1)); } else { @@ -1928,7 +1928,7 @@ /** Update wanted. */ public void update() { - if (levels.size() > 0) { + if (!levels.isEmpty()) { ACTION_FACTORY.showMessageDialog(mainView, "updateCloseMaps"); } else { Updater.update(mainView); Modified: trunk/daimonin/src/daieditor/CMainView.java =================================================================== --- trunk/daimonin/src/daieditor/CMainView.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/CMainView.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -691,7 +691,7 @@ final JMenu menuWindow = (JMenu) ACTION_FACTORY.find(getJMenuBar(), "window"); menuWindow.removeAll(); menuWindow.add(aCloseAll); - if (mapViews.size() != 0) { + if (!mapViews.isEmpty()) { menuWindow.addSeparator(); } int index = 0; Modified: trunk/daimonin/src/daieditor/CPickmapPanel.java =================================================================== --- trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/CPickmapPanel.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -306,7 +306,7 @@ return; // for safety, shouldn't happen } - if (pickmaps.size() == 0) { + if (pickmaps.isEmpty()) { currentPickMap = null; return; } Modified: trunk/daimonin/src/daieditor/CopyBuffer.java =================================================================== --- trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/CopyBuffer.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -243,7 +243,7 @@ final List<GameObject> archList; if (seed == null) { final List<GameObject> archPanelSelection = mainControl.getArchPanelSelection(); - if (archPanelSelection == null || archPanelSelection.size() == 0) { + if (archPanelSelection == null || archPanelSelection.isEmpty()) { return; } archList = archPanelSelection; @@ -254,7 +254,7 @@ } archList = getMapArchList(seed, seedSize); } - if (archList == null || archList.size() == 0) { + if (archList == null || archList.isEmpty()) { return; } @@ -332,7 +332,7 @@ mapSquares = mapControl.getAllSquares(); } else { final List<MapSquare<GameObject>> selectedMapSquares = mapViewIFrame.getView().getSelectedSquares(); - if (selectedMapSquares.size() == 0) { + if (selectedMapSquares.isEmpty()) { mapSquares = mapControl.getAllSquares(); } else { mapSquares = selectedMapSquares; @@ -346,7 +346,7 @@ } } } - return objects.size() == 0 ? null : objects; + return objects.isEmpty() ? null : objects; } /** @@ -365,7 +365,7 @@ } final List<GameObject> archList = mainControl.getArchPanelSelection(); - if (archList == null || archList.size() == 0) { + if (archList == null || archList.isEmpty()) { return; } Modified: trunk/daimonin/src/daieditor/Spells.java =================================================================== --- trunk/daimonin/src/daieditor/Spells.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/Spells.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -135,7 +135,7 @@ } // --------- now write the "spells.def" file --------- - if (spells.size() > 0) { + if (!spells.isEmpty()) { // FIXME: This should use DOM for writing the file. final File dfile; // create new file for writing (replaces old one if existent) @@ -231,7 +231,7 @@ // loading successful log.info("Loaded " + tmpSpellNames.size() + " defined spells from '" + IGUIConstants.SPELL_FILE + "'"); - if (tmpSpellNames.size() == 0) { + if (tmpSpellNames.isEmpty()) { log.warn("File '" + IGUIConstants.SPELL_FILE + "' has no content."); } else { tmpSpellNames.add(0, "<none>"); Modified: trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/gameobject/match/MutableOrGameObjectMatcher.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -50,7 +50,7 @@ /** {@inheritDoc} */ public boolean isMatching(final GameObject arch) { - if (gameObjectMatchers.size() == 0) { + if (gameObjectMatchers.isEmpty()) { return true; } for (final GameObjectMatcher gameObjectMatcher : gameObjectMatchers) { Modified: trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointChecker.java =================================================================== --- trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointChecker.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/daimonin/src/daieditor/map/validation/checks/BlockedMobOrSpawnPointChecker.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -51,7 +51,7 @@ blockers.add(gameObject); } } - if (blockers.size() > 0 && mobsOrSpawnPoints.size() > 0) { + if (!blockers.isEmpty() && !mobsOrSpawnPoints.isEmpty()) { errorCollector.collect(new BlockedMobOrSpawnPointError(mapSquare, new ArrayList<GameObject>(blockers), new ArrayList<GameObject>(mobsOrSpawnPoints))); } blockers.clear(); Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/gridarta.ipr 2006-12-23 22:27:35 UTC (rev 1245) @@ -494,7 +494,7 @@ <option name="m_ignoreExpressionsContainingConstants" value="false" /> </inspection_tool> <inspection_tool class="GwtInconsistentI18nInterface" level="ERROR" enabled="false" /> - <inspection_tool class="StringToString" level="WARNING" enabled="false" /> + <inspection_tool class="StringToString" level="ERROR" enabled="true" /> <inspection_tool class="AnalyzingStaticVariables" level="ERROR" enabled="true"> <option name="CHECKED_TYPES" value="javax.servlet.http.HttpSession;com.ulcjava.base.application.ULCProxy" /> </inspection_tool> @@ -529,7 +529,7 @@ </inspection_tool> <inspection_tool class="NoScrollPane" level="WARNING" enabled="false" /> <inspection_tool class="JSUnresolvedFunction" level="INFO" enabled="false" /> - <inspection_tool class="InstantiatingObjectToGetClassObject" level="WARNING" enabled="false" /> + <inspection_tool class="InstantiatingObjectToGetClassObject" level="ERROR" enabled="true" /> <inspection_tool class="ReturnFromFinallyBlockJS" level="WARNING" enabled="false" /> <inspection_tool class="UnusedAssignment" level="WARNING" enabled="true"> <option name="REPORT_PREFIX_EXPRESSIONS" value="true" /> @@ -546,7 +546,7 @@ <inspection_tool class="WebProperties" level="ERROR" enabled="false" /> <inspection_tool class="PointlessArithmeticExpressionJS" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessaryConditionalExpression" level="WARNING" enabled="false" /> - <inspection_tool class="StringConcatenationInsideStringBufferAppend" level="WARNING" enabled="false" /> + <inspection_tool class="StringConcatenationInsideStringBufferAppend" level="ERROR" enabled="true" /> <inspection_tool class="AnalyzingJLSModifierOrder" level="WARNING" enabled="false" /> <inspection_tool class="AntDuplicateImportedTargetsInspection" level="WARNING" enabled="false" /> <inspection_tool class="UNUSED_SYMBOL" level="WARNING" enabled="false"> @@ -577,7 +577,7 @@ <inspection_tool class="PointlessArithmeticExpression" level="WARNING" enabled="false"> <option name="m_ignoreExpressionsContainingConstants" value="false" /> </inspection_tool> - <inspection_tool class="UnnecessaryTemporaryOnConversionToString" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryTemporaryOnConversionToString" level="ERROR" enabled="true" /> <inspection_tool class="UnnecessaryContinue" level="WARNING" enabled="false" /> <inspection_tool class="SameReturnValue" level="WARNING" enabled="false" /> <inspection_tool class="UnusedLabel" level="WARNING" enabled="false" /> @@ -588,7 +588,7 @@ <inspection_tool class="ReturnFromFinallyBlock" level="WARNING" enabled="false" /> <inspection_tool class="UnreachableCodeJS" level="WARNING" enabled="false" /> <inspection_tool class="CheckValidXmlInScriptTagBody" level="ERROR" enabled="false" /> - <inspection_tool class="ManualArrayCopy" level="WARNING" enabled="false" /> + <inspection_tool class="ManualArrayCopy" level="ERROR" enabled="true" /> <inspection_tool class="Weblogic" level="ERROR" enabled="false" /> <inspection_tool class="PersistenceDataSourceORMDomInspection" level="ERROR" enabled="false" /> <inspection_tool class="FallthroughInSwitchStatementJS" level="WARNING" enabled="false" /> @@ -672,7 +672,7 @@ <option name="m_ignoreImmediatelyReturnedVariables" value="false" /> <option name="m_ignoreAnnotatedVariables" value="false" /> </inspection_tool> - <inspection_tool class="UnnecessaryTemporaryOnConversionFromString" level="WARNING" enabled="false" /> + <inspection_tool class="UnnecessaryTemporaryOnConversionFromString" level="ERROR" enabled="true" /> <inspection_tool class="EmptyStatementBodyJS" level="WARNING" enabled="false"> <option name="m_reportEmptyBlocks" value="false" /> </inspection_tool> @@ -696,7 +696,7 @@ <option name="m_ignoreExpressionsContainingConstants" value="false" /> </inspection_tool> <inspection_tool class="SimplifiableIfStatement" level="WARNING" enabled="false" /> - <inspection_tool class="BooleanConstructor" level="WARNING" enabled="false" /> + <inspection_tool class="BooleanConstructor" level="ERROR" enabled="true" /> <inspection_tool class="ExtendsObject" level="WARNING" enabled="false" /> <inspection_tool class="RedundantArrayCreation" level="WARNING" enabled="false" /> <inspection_tool class="PersistenceQlInspection" level="ERROR" enabled="false" /> @@ -727,7 +727,7 @@ <inspection_tool class="AccessStaticViaInstance" level="WARNING" enabled="false" /> <inspection_tool class="UnusedParameters" level="WARNING" enabled="false" /> <inspection_tool class="DuplicateMnemonic" level="WARNING" enabled="false" /> - <inspection_tool class="StringConstructor" level="WARNING" enabled="false"> + <inspection_tool class="StringConstructor" level="ERROR" enabled="true"> <option name="ignoreSubstringArguments" value="false" /> </inspection_tool> <inspection_tool class="GWTRemoteServiceAsyncCheck" level="ERROR" enabled="false" /> @@ -942,10 +942,10 @@ <option name="ignoreSystemErrs" value="false" /> </inspection_tool> <inspection_tool class="AssertsWithoutMessages" level="WARNING" enabled="false" /> - <inspection_tool class="RandomDoubleForRandomInteger" level="WARNING" enabled="false" /> + <inspection_tool class="RandomDoubleForRandomInteger" level="ERROR" enabled="true" /> <inspection_tool class="TestMethodWithoutAssertion" level="WARNING" enabled="false" /> <inspection_tool class="SerialPersistentFieldsWithWrongSignature" level="WARNING" enabled="false" /> - <inspection_tool class="StringBufferReplaceableByStringBuilder" level="WARNING" enabled="false" /> + <inspection_tool class="StringBufferReplaceableByStringBuilder" level="ERROR" enabled="true" /> <inspection_tool class="UnterminatedStatementJS" level="WARNING" enabled="false" /> <inspection_tool class="CastToConcreteClass" level="WARNING" enabled="false" /> <inspection_tool class="EmptyFinallyBlockJS" level="WARNING" enabled="false" /> @@ -1223,7 +1223,7 @@ <inspection_tool class="StaticNonFinalField" level="WARNING" enabled="false" /> <inspection_tool class="DynamicallyGeneratedCodeJS" level="WARNING" enabled="false" /> <inspection_tool class="TimeToString" level="WARNING" enabled="false" /> - <inspection_tool class="SubstringZero" level="WARNING" enabled="false" /> + <inspection_tool class="SubstringZero" level="ERROR" enabled="true" /> <inspection_tool class="ObsoleteCollection" level="WARNING" enabled="false" /> <inspection_tool class="ClassWithoutNoArgConstructor" level="WARNING" enabled="false"> <option name="m_ignoreClassesWithNoConstructors" value="true" /> @@ -1281,7 +1281,7 @@ <inspection_tool class="AnnotationClass" level="WARNING" enabled="false" /> <inspection_tool class="TailRecursionJS" level="WARNING" enabled="false" /> <inspection_tool class="StringBufferMustHaveInitialCapacity" level="WARNING" enabled="false" /> - <inspection_tool class="MethodMayBeStatic" level="WARNING" enabled="false"> + <inspection_tool class="MethodMayBeStatic" level="WARNING" enabled="true"> <option name="m_onlyPrivateOrFinal" value="false" /> <option name="m_ignoreEmptyMethods" value="true" /> </inspection_tool> @@ -1354,11 +1354,11 @@ <inspection_tool class="AnonymousClassComplexity" level="WARNING" enabled="false"> <option name="m_limit" value="3" /> </inspection_tool> - <inspection_tool class="InnerClassMayBeStatic" level="WARNING" enabled="false" /> + <inspection_tool class="InnerClassMayBeStatic" level="WARNING" enabled="true" /> <inspection_tool class="RedundantFieldInitialization" level="WARNING" enabled="false" /> <inspection_tool class="StaticSuite" level="WARNING" enabled="false" /> - <inspection_tool class="StringBufferToStringInConcatenation" level="WARNING" enabled="false" /> - <inspection_tool class="ConstantStringIntern" level="WARNING" enabled="false" /> + <inspection_tool class="StringBufferToStringInConcatenation" level="ERROR" enabled="true" /> + <inspection_tool class="ConstantStringIntern" level="ERROR" enabled="true" /> <inspection_tool class="DuplicateBooleanBranch" level="WARNING" enabled="false" /> <inspection_tool class="MethodOverridesStaticMethod" level="WARNING" enabled="false" /> <inspection_tool class="DesignForExtension" level="WARNING" enabled="false" /> @@ -1399,7 +1399,7 @@ <inspection_tool class="MisorderedAssertEqualsParameters" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessaryConstructor" level="WARNING" enabled="false" /> <inspection_tool class="MethodNameSameAsParentName" level="WARNING" enabled="false" /> - <inspection_tool class="JavaLangReflect" level="WARNING" enabled="false" /> + <inspection_tool class="JavaLangReflect" level="ERROR" enabled="true" /> <inspection_tool class="NestedAssignment" level="WARNING" enabled="false" /> <inspection_tool class="ThisEscapedInConstructor" level="WARNING" enabled="false" /> <inspection_tool class="WaitNotInSynchronizedContext" level="WARNING" enabled="false" /> @@ -1442,7 +1442,7 @@ <inspection_tool class="ChainedMethodCall" level="WARNING" enabled="false"> <option name="m_ignoreFieldInitializations" value="true" /> </inspection_tool> - <inspection_tool class="UseOfSunClasses" level="WARNING" enabled="false" /> + <inspection_tool class="UseOfSunClasses" level="WARNING" enabled="true" /> <inspection_tool class="PublicInnerClass" level="WARNING" enabled="false" /> <inspection_tool class="NotifyNotInSynchronizedContext" level="WARNING" enabled="false" /> <inspection_tool class="ForLoopReplaceableByWhileJS" level="WARNING" enabled="false"> @@ -1477,7 +1477,7 @@ <inspection_tool class="DoubleCheckedLocking" level="WARNING" enabled="false" /> <inspection_tool class="ContinueStatementJS" level="WARNING" enabled="false" /> <inspection_tool class="InstanceofChain" level="WARNING" enabled="false" /> - <inspection_tool class="StringBufferReplaceableByString" level="WARNING" enabled="false" /> + <inspection_tool class="StringBufferReplaceableByString" level="ERROR" enabled="true" /> <inspection_tool class="BooleanMethodNameMustStartWithQuestion" level="WARNING" enabled="false"> <option name="nameCheckString" value="is,can,has,should,could,will,shall,check,contains,equals,add,put,remove,startsWith,endsWith" /> </inspection_tool> @@ -1500,7 +1500,7 @@ <option name="m_minLength" value="4" /> <option name="m_maxLength" value="32" /> </inspection_tool> - <inspection_tool class="TrivialStringConcatenation" level="WARNING" enabled="false" /> + <inspection_tool class="TrivialStringConcatenation" level="WARNING" enabled="true" /> <inspection_tool class="EmptySynchronizedStatement" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessaryDefault" level="WARNING" enabled="false" /> <inspection_tool class="UnnecessarySuperConstructor" level="WARNING" enabled="false" /> @@ -1558,7 +1558,7 @@ <inspection_tool class="AssignmentToMethodParameter" level="WARNING" enabled="false"> <option name="ignoreTransformationOfOriginalParameter" value="false" /> </inspection_tool> - <inspection_tool class="StringEqualsEmptyString" level="WARNING" enabled="false" /> + <inspection_tool class="StringEqualsEmptyString" level="ERROR" enabled="true" /> <inspection_tool class="MagicCharacter" level="WARNING" enabled="false" /> <inspection_tool class="ConnectionResource" level="WARNING" enabled="false" /> <inspection_tool class="StaticVariableInitialization" level="WARNING" enabled="false"> @@ -1576,7 +1576,7 @@ <option name="m_limit" value="30" /> </inspection_tool> <inspection_tool class="SynchronizeOnLock" level="WARNING" enabled="false" /> - <inspection_tool class="FieldMayBeStatic" level="WARNING" enabled="false" /> + <inspection_tool class="FieldMayBeStatic" level="WARNING" enabled="true" /> <inspection_tool class="ClassMayBeInterface" level="WARNING" enabled="false" /> <inspection_tool class="AbstractClassWithoutAbstractMethods" level="WARNING" enabled="false" /> <inspection_tool class="DefaultNotLastCaseInSwitch" level="WARNING" enabled="false" /> @@ -1595,7 +1595,7 @@ <inspection_tool class="PlatformDetectionJS" level="WARNING" enabled="false" /> <inspection_tool class="PublicFieldAccessedInSynchronizedContext" level="WARNING" enabled="false" /> <inspection_tool class="StaticMethodOnlyUsedInOneClass" level="WARNING" enabled="false" /> - <inspection_tool class="StringReplaceableByStringBuffer" level="WARNING" enabled="false" /> + <inspection_tool class="StringReplaceableByStringBuffer" level="WARNING" enabled="true" /> <inspection_tool class="JUnitTestClassNamingConvention" level="WARNING" enabled="false"> <option name="m_regex" value="[A-Z][A-Za-z\d]*Test" /> <option name="m_minLength" value="8" /> @@ -1630,7 +1630,7 @@ <inspection_tool class="EnumClass" level="WARNING" enabled="false" /> <inspection_tool class="FeatureEnvy" level="WARNING" enabled="false" /> <inspection_tool class="EmptyTryBlockJS" level="WARNING" enabled="false" /> - <inspection_tool class="SetReplaceableByEnumSet" level="WARNING" enabled="false" /> + <inspection_tool class="SetReplaceableByEnumSet" level="ERROR" enabled="true" /> <inspection_tool class="PublicMethodNotExposedInInterface" level="WARNING" enabled="false" /> <inspection_tool class="NonFinalStaticVariableUsedInClassInitialization" level="WARNING" enabled="false" /> <inspection_tool class="UnusedCatchParameterJS" level="WARNING" enabled="false"> @@ -1649,7 +1649,7 @@ </inspection_tool> <inspection_tool class="ArithmeticOnVolatileField" level="WARNING" enabled="false" /> <inspection_tool class="PublicStaticCollectionField" level="WARNING" enabled="false" /> - <inspection_tool class="SizeReplaceableByIsEmpty" level="WARNING" enabled="false" /> + <inspection_tool class="SizeReplaceableByIsEmpty" level="ERROR" enabled="true" /> <inspection_tool class="JavadocReference" level="ERROR" enabled="true" /> <inspection_tool class="UnaryPlus" level="WARNING" enabled="false" /> <inspection_tool class="IOResource" level="WARNING" enabled="false" /> @@ -1680,7 +1680,7 @@ </inspection_tool> <inspection_tool class="StandardVariableNames" level="WARNING" enabled="false" /> <inspection_tool class="UnusedProperty" level="WARNING" enabled="false" /> - <inspection_tool class="MapReplaceableByEnumMap" level="WARNING" enabled="false" /> + <inspection_tool class="MapReplaceableByEnumMap" level="ERROR" enabled="true" /> <inspection_tool class="IfStatementWithTooManyBranchesJS" level="WARNING" enabled="false"> <option name="m_limit" value="3" /> </inspection_tool> Modified: trunk/src/app/net/sf/gridarta/UndoAndRedo.java =================================================================== --- trunk/src/app/net/sf/gridarta/UndoAndRedo.java 2006-12-23 22:26:57 UTC (rev 1244) +++ trunk/src/app/net/sf/gridarta/UndoAndRedo.java 2006-12-23 22:27:35 UTC (rev 1245) @@ -101,7 +101,7 @@ * undone, <code>false</code> if not */ public boolean canUndo() { - return currentStack.undoStack.size() > 0 && currentStack.undoStack.get(currentStack.undoStack.size() - 1).isUndoable(); + return !currentStack.undoStack.isEmpty() && currentStack.undoStack.get(currentStack.undoStack.size() - 1).isUndoable(); } @@ -129,7 +129,7 @@ * redone, <code>false</code> if not */ public boolean canRedo() { - return currentStack.redoStack.size() > 0 && currentStack.redoStack.get(currentStack.redoStack.size() - 1).isRedoable(); + return !currentStack.redoStack.isEmpty() && currentStack.redoStack.get(currentStack.redoStack.size() - 1).isRedoable(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |