From: <chr...@us...> - 2006-12-23 22:29:52
|
Revision: 1246 http://svn.sourceforge.net/gridarta/?rev=1246&view=rev Author: christianhujer Date: 2006-12-23 14:29:52 -0800 (Sat, 23 Dec 2006) Log Message: ----------- Hardened policy: No empty Strings for toString() conversion. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainView.java trunk/crossfire/src/cfeditor/CMapArchPanel.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java trunk/gridarta.ipr Modified: trunk/crossfire/src/cfeditor/CMainView.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainView.java 2006-12-23 22:27:35 UTC (rev 1245) +++ trunk/crossfire/src/cfeditor/CMainView.java 2006-12-23 22:29:52 UTC (rev 1246) @@ -197,15 +197,15 @@ final int defheight = (int) (0.9 * screen.getHeight()); // define divider locations - final int divLocationRight = Integer.parseInt(settings.getProperty(DIVIDER_LOCATION_KEY3, "" + (int) (defwidth * 0.62))); - final int divLocationDown = Integer.parseInt(settings.getProperty(DIVIDER_LOCATION_KEY2, "" + (int) (defheight * 0.76))); - final int divLocation = Integer.parseInt(settings.getProperty(DIVIDER_LOCATION_KEY, "" + (int) (defwidth * 0.17))); + final int divLocationRight = Integer.parseInt(settings.getProperty(DIVIDER_LOCATION_KEY3, String.valueOf((int) (defwidth * 0.62)))); + final int divLocationDown = Integer.parseInt(settings.getProperty(DIVIDER_LOCATION_KEY2, String.valueOf((int) (defheight * 0.76)))); + final int divLocation = Integer.parseInt(settings.getProperty(DIVIDER_LOCATION_KEY, String.valueOf((int) (defwidth * 0.17)))); // get the old location and size - final int x = Integer.parseInt(settings.getProperty(WINDOW_X, "" + (int) ((screen.getWidth() - defwidth) / 2.0))); - final int y = Integer.parseInt(settings.getProperty(WINDOW_Y, "" + (int) ((screen.getHeight() - defheight) / 2.0))); - final int width = Integer.parseInt(settings.getProperty(WINDOW_WIDTH, "" + defwidth)); - final int height = Integer.parseInt(settings.getProperty(WINDOW_HEIGHT, "" + defheight)); + final int x = Integer.parseInt(settings.getProperty(WINDOW_X, String.valueOf((int) ((screen.getWidth() - defwidth) / 2.0)))); + final int y = Integer.parseInt(settings.getProperty(WINDOW_Y, String.valueOf((int) ((screen.getHeight() - defheight) / 2.0)))); + final int width = Integer.parseInt(settings.getProperty(WINDOW_WIDTH, String.valueOf(defwidth))); + final int height = Integer.parseInt(settings.getProperty(WINDOW_HEIGHT, String.valueOf(defheight))); // Add all the subviews getContentPane().setLayout(new BorderLayout()); @@ -439,13 +439,13 @@ // Store the location and size final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); final Rectangle bounds = getBounds(); - settings.setProperty(WINDOW_X, "" + bounds.x); - settings.setProperty(WINDOW_Y, "" + bounds.y); - settings.setProperty(WINDOW_WIDTH, "" + bounds.width); - settings.setProperty(WINDOW_HEIGHT, "" + bounds.height); - settings.setProperty(DIVIDER_LOCATION_KEY, "" + splitPane.getDividerLocation()); - settings.setProperty(DIVIDER_LOCATION_KEY2, "" + splitDownPane.getDividerLocation()); - settings.setProperty(DIVIDER_LOCATION_KEY3, "" + splitRightPane.getDividerLocation()); + settings.setProperty(WINDOW_X, String.valueOf(bounds.x)); + settings.setProperty(WINDOW_Y, String.valueOf(bounds.y)); + settings.setProperty(WINDOW_WIDTH, String.valueOf(bounds.width)); + settings.setProperty(WINDOW_HEIGHT, String.valueOf(bounds.height)); + settings.setProperty(DIVIDER_LOCATION_KEY, String.valueOf(splitPane.getDividerLocation())); + settings.setProperty(DIVIDER_LOCATION_KEY2, String.valueOf(splitDownPane.getDividerLocation())); + settings.setProperty(DIVIDER_LOCATION_KEY3, String.valueOf(splitRightPane.getDividerLocation())); archPanel.appExitNotify(); mapArchPanel.appExitNotify(); Modified: trunk/crossfire/src/cfeditor/CMapArchPanel.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-12-23 22:27:35 UTC (rev 1245) +++ trunk/crossfire/src/cfeditor/CMapArchPanel.java 2006-12-23 22:29:52 UTC (rev 1246) @@ -224,7 +224,7 @@ // calculate default value in case there is no settings file final Dimension screen = Toolkit.getDefaultToolkit().getScreenSize(); - splitPane.setDividerLocation(Integer.parseInt(settings.getProperty(MAPARCHPANEL_LOCATION_KEY, "" + (int) (0.49 * screen.getWidth())))); + splitPane.setDividerLocation(Integer.parseInt(settings.getProperty(MAPARCHPANEL_LOCATION_KEY, String.valueOf((int) (0.49 * screen.getWidth()))))); add(splitPane, BorderLayout.CENTER); updateFont(true); @@ -597,7 +597,7 @@ void appExitNotify() { final CSettings settings = CSettings.getInstance(IGUIConstants.APP_NAME); - settings.setProperty(MAPARCHPANEL_LOCATION_KEY, "" + splitPane.getDividerLocation()); + settings.setProperty(MAPARCHPANEL_LOCATION_KEY, String.valueOf(splitPane.getDividerLocation())); } void refresh() { Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-23 22:27:35 UTC (rev 1245) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2006-12-23 22:29:52 UTC (rev 1246) @@ -292,7 +292,7 @@ log.warn("Duplicate Animation " + animName, e); } } else { - animText = "" + animText + thisLine + "\n"; + animText = animText + thisLine + "\n"; } } Modified: trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2006-12-23 22:27:35 UTC (rev 1245) +++ trunk/crossfire/src/cfeditor/gui/map/MapPropertiesDialog.java 2006-12-23 22:29:52 UTC (rev 1246) @@ -574,36 +574,36 @@ mapDescription.setText(map.getText()); mapLore.setText(map.getLore()); mapName.setText(map.getMapName()); - mapRegion.setText("" + map.getMapRegion()); + mapRegion.setText(map.getMapRegion()); final Size2D mapSize = map.getMapSize(); levelWidthField.setText(String.valueOf(mapSize.getWidth())); levelHeightField.setText(String.valueOf(mapSize.getHeight())); - fieldEnterX.setText("" + map.getEnterX()); - fieldEnterY.setText("" + map.getEnterY()); - fieldSwapTime.setText("" + map.getSwapTime()); - fieldResetTimeout.setText("" + map.getResetTimeout()); - fieldDarkness.setText("" + map.getDarkness()); - fieldDifficulty.setText("" + map.getDifficulty()); + fieldEnterX.setText(String.valueOf(map.getEnterX())); + fieldEnterY.setText(String.valueOf(map.getEnterY())); + fieldSwapTime.setText(String.valueOf(map.getSwapTime())); + fieldResetTimeout.setText(String.valueOf(map.getResetTimeout())); + fieldDarkness.setText(String.valueOf(map.getDarkness())); + fieldDifficulty.setText(String.valueOf(map.getDifficulty())); checkboxUnique.setSelected(map.isUnique()); checkboxOutdoor.setSelected(map.isOutdoor()); checkboxFixedReset.setSelected(map.isFixedReset()); checkboxNosmooth.setSelected(map.isNosmooth()); - fieldShopitems.setText("" + map.getShopItems()); - fieldShoprace.setText("" + map.getShopRace()); - fieldShopmax.setText("" + map.getShopMax()); - fieldShopmin.setText("" + map.getShopMin()); - fieldShopgreed.setText("" + map.getShopGreed()); - fieldTemperature.setText("" + map.getTemp()); - fieldPressure.setText("" + map.getPressure()); - fieldHumidity.setText("" + map.getHumid()); - fieldWindspeed.setText("" + map.getWindspeed()); - fieldWindDirection.setText("" + map.getWinddir()); - fieldSkySetting.setText("" + map.getSky()); + fieldShopitems.setText(map.getShopItems()); + fieldShoprace.setText(map.getShopRace()); + fieldShopmax.setText(String.valueOf(map.getShopMax())); + fieldShopmin.setText(String.valueOf(map.getShopMin())); + fieldShopgreed.setText(String.valueOf(map.getShopGreed())); + fieldTemperature.setText(String.valueOf(map.getTemp())); + fieldPressure.setText(String.valueOf(map.getPressure())); + fieldHumidity.setText(String.valueOf(map.getHumid())); + fieldWindspeed.setText(String.valueOf(map.getWindspeed())); + fieldWindDirection.setText(String.valueOf(map.getWinddir())); + fieldSkySetting.setText(String.valueOf(map.getSky())); for (int i = 0; i < 4; i++) { - fieldTilePath[i].setText("" + map.getTilePath(i)); + fieldTilePath[i].setText(map.getTilePath(i)); } } Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2006-12-23 22:27:35 UTC (rev 1245) +++ trunk/gridarta.ipr 2006-12-23 22:29:52 UTC (rev 1246) @@ -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="true" /> + <inspection_tool class="TrivialStringConcatenation" level="ERROR" 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" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |