Skip to content

Commit a275201

Browse files
committed
disable the recycle test and add some error-proofing
1 parent 6b192c9 commit a275201

4 files changed

Lines changed: 36 additions & 25 deletions

File tree

app/src/processing/app/Library.java

100644100755
Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ public class Library extends LocalContribution {
1515
protected File examplesFolder; // shortname/examples
1616
protected File referenceFile; // shortname/reference/index.html
1717

18-
/**
19-
* Subfolder for grouping libraries in a menu. Basic subfolder support
20-
* is provided so that some organization can be done in the import menu.
18+
/**
19+
* Subfolder for grouping libraries in a menu. Basic subfolder support
20+
* is provided so that some organization can be done in the import menu.
2121
* (This is the replacement for the "library compilation" type.)
2222
*/
2323
protected String group;
@@ -89,13 +89,16 @@ static public Library load(File folder) {
8989
return new Library(folder);
9090
// } catch (IgnorableException ig) {
9191
// Base.log(ig.getMessage());
92-
} catch (Exception e) {
93-
e.printStackTrace();
92+
} catch (Error err) {
93+
// Handles UnsupportedClassVersionError and others
94+
err.printStackTrace();
95+
} catch (Exception ex) {
96+
ex.printStackTrace();
9497
}
9598
return null;
9699
}
97-
98-
100+
101+
99102
private Library(File folder) {
100103
this(folder, null);
101104
}
@@ -432,14 +435,14 @@ public boolean accept(File dir, String name) {
432435
}
433436
};
434437

435-
438+
436439
static public ArrayList<File> discover(File folder) {
437440
ArrayList<File> libraries = new ArrayList<File>();
438441
discover(folder, libraries);
439442
return libraries;
440443
}
441444

442-
445+
443446
static public void discover(File folder, ArrayList<File> libraries) {
444447
String[] list = folder.list(junkFolderFilter);
445448

@@ -474,14 +477,14 @@ static public void discover(File folder, ArrayList<File> libraries) {
474477
}
475478
}
476479

477-
480+
478481
static protected ArrayList<Library> list(File folder) {
479482
ArrayList<Library> libraries = new ArrayList<Library>();
480483
list(folder, libraries);
481484
return libraries;
482485
}
483486

484-
487+
485488
static protected void list(File folder, ArrayList<Library> libraries) {
486489
ArrayList<File> librariesFolders = new ArrayList<File>();
487490
discover(folder, librariesFolders);
@@ -507,7 +510,7 @@ static protected void list(File folder, ArrayList<Library> libraries) {
507510
}
508511
}
509512

510-
513+
511514
public ContributionType getType() {
512515
return ContributionType.LIBRARY;
513516
}

app/src/processing/app/contrib/ModeContribution.java

100644100755
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
GNU General Public License for more details.
1717
18-
You should have received a copy of the GNU General Public License along
18+
You should have received a copy of the GNU General Public License along
1919
with this program; if not, write to the Free Software Foundation, Inc.
2020
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2121
*/
@@ -39,18 +39,21 @@ static public ModeContribution load(Base base, File folder) {
3939
}
4040

4141

42-
static public ModeContribution load(Base base, File folder,
42+
static public ModeContribution load(Base base, File folder,
4343
String searchName) {
4444
try {
4545
return new ModeContribution(base, folder, searchName);
4646
} catch (IgnorableException ig) {
4747
Base.log(ig.getMessage());
48+
} catch (Error err) {
49+
// Handles UnsupportedClassVersionError and others
50+
err.printStackTrace();
4851
} catch (Exception e) {
4952
if (searchName == null) {
5053
e.printStackTrace();
5154
} else {
52-
// For the built-in modes, don't print the exception, just log it
53-
// for debugging. This should be impossible for most users to reach,
55+
// For the built-in modes, don't print the exception, just log it
56+
// for debugging. This should be impossible for most users to reach,
5457
// but it helps us load experimental mode when it's available.
5558
Base.log("ModeContribution.load() failed for " + searchName, e);
5659
}

app/src/processing/app/contrib/ToolContribution.java

100644100755
Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1616
GNU General Public License for more details.
1717
18-
You should have received a copy of the GNU General Public License along
18+
You should have received a copy of the GNU General Public License along
1919
with this program; if not, write to the Free Software Foundation, Inc.
2020
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2121
*/
@@ -40,8 +40,11 @@ static public ToolContribution load(File folder) {
4040
return new ToolContribution(folder);
4141
} catch (IgnorableException ig) {
4242
Base.log(ig.getMessage());
43-
} catch (Exception e) {
44-
e.printStackTrace();
43+
} catch (Error err) {
44+
// Handles UnsupportedClassVersionError and others
45+
err.printStackTrace();
46+
} catch (Exception ex) {
47+
ex.printStackTrace();
4548
}
4649
return null;
4750
}

app/src/processing/app/windows/Platform.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,14 @@
4242

4343

4444
/**
45-
* Platform-specific glue for Windows.
45+
* Platform-specific glue for Windows.
4646
*
4747
*/
4848
public class Platform extends processing.app.Platform {
4949

5050
static final String APP_NAME = "Processing";
5151
static final String REG_OPEN_COMMAND =
52-
System.getProperty("user.dir").replace('/', '\\') +
52+
System.getProperty("user.dir").replace('/', '\\') +
5353
"\\" + APP_NAME.toLowerCase() + ".exe \"%1\"";
5454
static final String REG_DOC = APP_NAME + ".Document";
5555

@@ -60,6 +60,7 @@ public void init(Base base) {
6060
//checkQuickTime();
6161
checkPath();
6262

63+
/*
6364
File f = new File(System.getProperty("user.dir"), "recycle-test.txt");
6465
//File f = new File("C:\\recycle-test.txt");
6566
System.out.println(f.getAbsolutePath());
@@ -72,6 +73,7 @@ public void init(Base base) {
7273
} catch (IOException e) {
7374
e.printStackTrace();
7475
}
76+
*/
7577

7678
//findJDK();
7779
/*
@@ -149,8 +151,8 @@ protected void checkAssociations() {
149151

150152

151153
/**
152-
* Associate .pde files with this version of Processing. After 2.0.1,
153-
* this was changed to only set the values for the current user, so that
154+
* Associate .pde files with this version of Processing. After 2.0.1,
155+
* this was changed to only set the values for the current user, so that
154156
* it would no longer silently fail on systems that have UAC turned on.
155157
*/
156158
protected void setAssociations() throws UnsupportedEncodingException {
@@ -217,8 +219,8 @@ protected void setAssociations() throws UnsupportedEncodingException {
217219
Preferences.setBoolean("platform.auto_file_type_associations", false);
218220
}
219221
}
220-
221-
222+
223+
222224
/**
223225
* Remove extra quotes, slashes, and garbage from the Windows PATH.
224226
*/

0 commit comments

Comments
 (0)