fix StringIndexOutOfBoundsException caused by import statements with no dots (bug #1145)

This commit is contained in:
benfry
2009-02-20 18:51:27 +00:00
parent 08dbf60a06
commit 762b083c0b
3 changed files with 12 additions and 7 deletions
+3 -1
View File
@@ -1411,7 +1411,9 @@ public class Sketch {
importedLibraries = new ArrayList<File>();
for (String item : preprocessor.getExtraImports()) {
// remove things up to the last dot
String entry = item.substring(0, item.lastIndexOf('.'));
int dot = item.lastIndexOf('.');
// http://dev.processing.org/bugs/show_bug.cgi?id=1145
String entry = (dot == -1) ? item : item.substring(0, dot);
File libFolder = (File) Base.importToLibraryTable.get(entry);
if (libFolder != null) {
+6 -3
View File
@@ -30,11 +30,14 @@ X Got NoClassDefFoundError exception when accessing quicktime API
X http://dev.processing.org/bugs/show_bug.cgi?id=1128
X http://dev.processing.org/bugs/show_bug.cgi?id=1129
X http://dev.processing.org/bugs/show_bug.cgi?id=1130
X http://dev.processing.org/bugs/show_bug.cgi?id=1138
X http://dev.processing.org/bugs/show_bug.cgi?id=1140
X not using present mode correctly
X http://dev.processing.org/bugs/show_bug.cgi?id=1138
X apparent graphics driver conflict on vista
X http://dev.processing.org/bugs/show_bug.cgi?id=1140
X PImage.save() does not create parent directories
X http://dev.processing.org/bugs/show_bug.cgi?id=1124
X sketch turning blue and not working on osx
X http://dev.processing.org/bugs/show_bug.cgi?id=1164
xml
X fix for xml elements that have null names
X added listChildren() method
+3 -3
View File
@@ -7,9 +7,9 @@ X add -X switch to cp on osx build so that extended attrs are not copied
X http://dev.processing.org/bugs/show_bug.cgi?id=1098
_ after deleting a tab code still get's preprocessed, pde file is not forgotten
_ http://dev.processing.org/bugs/show_bug.cgi?id=1092
_ multipage pdf works not like described in the docs
_ http://dev.processing.org/bugs/show_bug.cgi?id=1131
X add JVMArchs to Info.plist so that stupid Apple error msg doesn't appear
X StringIndexOutOfBoundsException caused by import statements with no dots
X http://dev.processing.org/bugs/show_bug.cgi?id=1145
invalid
X Sketchbook sub-menu is empty after changing Sketchbook location preference