Skip to content
This repository was archived by the owner on Jan 30, 2019. It is now read-only.

Commit eb9d2f1

Browse files
author
jglick
committed
Avoid catching, and printing, Exception.
Causes fatal errors to be ignored from caller's perspective. http://netbeans.org/bugzilla/show_bug.cgi?id=127368#c44 svn path=/trunk/; revision=85
1 parent 7daa976 commit eb9d2f1

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

jhMaster/JSearch/indexer/com/sun/java/help/search/DefaultIndexerKit.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ public int parseIntoTokens (String source, int pos) {
131131
}
132132
currentPos += source.length();
133133
}
134+
catch (RuntimeException e) {
135+
throw e;
136+
}
134137
catch (Exception e) {
135138
e.printStackTrace();
136139
}
@@ -139,21 +142,21 @@ public int parseIntoTokens (String source, int pos) {
139142

140143
protected void startStoreDocument (String file) throws Exception {
141144
if ((config == null) || (builder == null)) {
142-
throw new Exception("ConfigFile and/or IndexBuilder not set");
145+
throw new IllegalStateException("ConfigFile and/or IndexBuilder not set");
143146
}
144147
builder.openDocument(config.getURLString(file));
145148
}
146149

147150
protected void endStoreDocument () throws Exception {
148151
if ((config == null) || (builder == null)) {
149-
throw new Exception("ConfigFile and/or IndexBuilder not set");
152+
throw new IllegalStateException("ConfigFile and/or IndexBuilder not set");
150153
}
151154
builder.closeDocument();
152155
}
153156

154157
protected void storeToken (String token, int pos) throws Exception {
155158
if ((config == null) || (builder == null)) {
156-
throw new Exception("ConfigFile and/or IndexBuilder not set");
159+
throw new IllegalStateException("ConfigFile and/or IndexBuilder not set");
157160
}
158161
if (!documentStarted) {
159162
try {
@@ -169,7 +172,7 @@ protected void storeToken (String token, int pos) throws Exception {
169172

170173
protected void storeTitle (String title) throws Exception {
171174
if ((config == null) || (builder == null)) {
172-
throw new Exception("ConfigFile and/or IndexBuilder not set");
175+
throw new IllegalStateException("ConfigFile and/or IndexBuilder not set");
173176
}
174177
builder.storeTitle(title);
175178
}

jhMaster/JSearch/indexer/com/sun/java/help/search/Indexer.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,9 @@ public class Indexer {
8181
* @param args[] the command line arguments
8282
**/
8383

84-
public static void main(String args[]) {
84+
public static void main(String args[]) throws Exception {
8585
Indexer compiler = new Indexer();
86-
try {
87-
compiler.compile(args);
88-
}
89-
catch (Exception e) {
90-
e.printStackTrace();
91-
}
86+
compiler.compile(args);
9287
}
9388

9489
/**

0 commit comments

Comments
 (0)