fix string table updating in launcher generator pycharm/130.281
authorDmitry Jemerov <yole@jetbrains.com>
Mon, 15 Apr 2013 16:08:08 +0000 (18:08 +0200)
committerDmitry Jemerov <yole@jetbrains.com>
Mon, 15 Apr 2013 16:09:31 +0000 (18:09 +0200)
build/lib/launcher-generator.jar
tools/launcher-generator/.idea/ant.xml
tools/launcher-generator/.idea/artifacts/launcher_generator_jar.xml
tools/launcher-generator/.idea/libraries/guava.xml [new file with mode: 0644]
tools/launcher-generator/.idea/libraries/guava_12_0.xml [deleted file]
tools/launcher-generator/launcher-generator.iml
tools/launcher-generator/src/com/pme/exe/res/StringTableDirectory.java

index 43a5b5fbb167a7b89161070f091782cd69652845..b86185b53d49f60a6a163219af7ce624f61cc664 100644 (file)
Binary files a/build/lib/launcher-generator.jar and b/build/lib/launcher-generator.jar differ
index 2581ca3fe84ca60107a95f8a2fec4af40f3d38af..f6e673adc243ba90475f82ef457704e9f62624bb 100644 (file)
@@ -1,7 +1,3 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<project version="4">
-  <component name="AntConfiguration">
-    <defaultAnt bundledAnt="true" />
-  </component>
-</project>
+<project version="4" />
 
index e738633e26bba32e7030be1c3bcb9939bcc03bff..5765a9f3665a7b4dbf53d2ddd669e89c4425a2cd 100644 (file)
@@ -9,7 +9,7 @@
         <element id="module-output" name="launcher-generator" />
       </element>
       <element id="library" level="project" name="sanselan-0.98-snapshot" />
-      <element id="library" level="project" name="guava-12.0" />
+      <element id="library" level="project" name="guava" />
       <element id="library" level="project" name="jdom" />
     </root>
   </artifact>
diff --git a/tools/launcher-generator/.idea/libraries/guava.xml b/tools/launcher-generator/.idea/libraries/guava.xml
new file mode 100644 (file)
index 0000000..3383a0e
--- /dev/null
@@ -0,0 +1,9 @@
+<component name="libraryTable">
+  <library name="guava">
+    <CLASSES>
+      <root url="jar://$PROJECT_DIR$/../../lib/guava-14.0.1.jar!/" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES />
+  </library>
+</component>
\ No newline at end of file
diff --git a/tools/launcher-generator/.idea/libraries/guava_12_0.xml b/tools/launcher-generator/.idea/libraries/guava_12_0.xml
deleted file mode 100644 (file)
index 3ccd7bb..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<component name="libraryTable">
-  <library name="guava-12.0">
-    <CLASSES>
-      <root url="jar://$PROJECT_DIR$/../../lib/guava-12.0.jar!/" />
-    </CLASSES>
-    <JAVADOC />
-    <SOURCES />
-  </library>
-</component>
\ No newline at end of file
index 37938cabae084fc6c2afc06561f872fa930766cd..1767e2dd63d0e5875fe5d02e5ea7996171e8894d 100644 (file)
@@ -11,7 +11,7 @@
     <orderEntry type="library" name="jdom" level="project" />
     <orderEntry type="library" name="sanselan-0.98-snapshot" level="project" />
     <orderEntry type="module" module-name="icons" />
-    <orderEntry type="library" name="guava-12.0" level="project" />
+    <orderEntry type="library" name="guava" level="project" />
   </component>
 </module>
 
index b54a7201b72be03b82e6aa641478989ae11666b2..c1cea6e5ee5b76edbee7df49fd33e6db25317515 100644 (file)
@@ -44,11 +44,17 @@ public class StringTableDirectory {
   }
 
   public void setString(int id, String value) {
+    boolean found = false;
     for (Entry entry : myEntries) {
-      if (entry.startID == (id / 16)-1) {
+      if (entry.startID == (id / 16)+1) {
         entry.table.setString(id % 16, value);
+        found = true;
+        break;
       }
     }
+    if (!found) {
+      throw new IllegalArgumentException("Cannot find string entry with ID " + id);
+    }
   }
 
   public void save() throws IOException {