From 762b083c0b6bfc69bf59d68457bbbca5e1a358c1 Mon Sep 17 00:00:00 2001 From: benfry Date: Fri, 20 Feb 2009 18:51:27 +0000 Subject: [PATCH] fix StringIndexOutOfBoundsException caused by import statements with no dots (bug #1145) --- app/src/processing/app/Sketch.java | 4 +++- core/todo.txt | 9 ++++++--- todo.txt | 6 +++--- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/processing/app/Sketch.java b/app/src/processing/app/Sketch.java index 1fcd1001e..28f253b8c 100644 --- a/app/src/processing/app/Sketch.java +++ b/app/src/processing/app/Sketch.java @@ -1411,7 +1411,9 @@ public class Sketch { importedLibraries = new ArrayList(); 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) { diff --git a/core/todo.txt b/core/todo.txt index b009cf400..bfa633829 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -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 diff --git a/todo.txt b/todo.txt index 490ef9188..803054975 100644 --- a/todo.txt +++ b/todo.txt @@ -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