Lines 58-78
Link Here
|
58 |
this.isReached = new int[cacheSize]; // none is reached by default |
58 |
this.isReached = new int[cacheSize]; // none is reached by default |
59 |
this.isNeeded = new int[cacheSize]; // none is needed by default |
59 |
this.isNeeded = new int[cacheSize]; // none is needed by default |
60 |
this.initsOnExceptions = new UnconditionalFlowInfo[count]; |
60 |
this.initsOnExceptions = new UnconditionalFlowInfo[count]; |
61 |
boolean reachUnchecked = !scope.compilerOptions(). |
61 |
if (this.isMethodContext && scope.compilerOptions().reportUnusedDeclaredThrownExceptionIncludeUncheckedExceptions) { |
62 |
reportUnusedDeclaredThrownExceptionIncludeUncheckedExceptions; |
62 |
for (int i = 0; i < count; i++) { |
63 |
for (int i = 0; i < count; i++) { |
63 |
this.indexes.put(handledExceptions[i], i); // key type -> value index |
64 |
this.indexes.put(handledExceptions[i], i); // key type -> value index |
64 |
if (handledExceptions[i].isUncheckedException(true)) { |
65 |
int cacheIndex = i / ExceptionHandlingFlowContext.BitCacheSize, bitMask = 1 << (i % ExceptionHandlingFlowContext.BitCacheSize); |
65 |
this.initsOnExceptions[i] = flowInfo.unconditionalCopy(); |
66 |
if (handledExceptions[i].isUncheckedException(true)) { |
66 |
} else { |
67 |
if (reachUnchecked) { |
67 |
this.initsOnExceptions[i] = FlowInfo.DEAD_END; |
68 |
this.isReached[cacheIndex] |= bitMask; |
68 |
} |
|
|
69 |
} |
70 |
} else { |
71 |
for (int i = 0; i < count; i++) { |
72 |
this.indexes.put(handledExceptions[i], i); // key type -> value index |
73 |
if (handledExceptions[i].isUncheckedException(true)) { |
74 |
this.isReached[i / ExceptionHandlingFlowContext.BitCacheSize] |= 1 << (i % ExceptionHandlingFlowContext.BitCacheSize); |
75 |
this.initsOnExceptions[i] = flowInfo.unconditionalCopy(); |
76 |
} else { |
77 |
this.initsOnExceptions[i] = FlowInfo.DEAD_END; |
69 |
} |
78 |
} |
70 |
this.initsOnExceptions[i] = flowInfo.unconditionalCopy(); |
|
|
71 |
} else { |
72 |
this.initsOnExceptions[i] = FlowInfo.DEAD_END; |
73 |
} |
79 |
} |
74 |
} |
80 |
} |
75 |
System.arraycopy(this.isReached, 0, this.isNeeded, 0, cacheSize); |
81 |
if (!this.isMethodContext) { |
|
|
82 |
System.arraycopy(this.isReached, 0, this.isNeeded, 0, cacheSize); |
83 |
} |
76 |
this.initsOnReturn = FlowInfo.DEAD_END; |
84 |
this.initsOnReturn = FlowInfo.DEAD_END; |
77 |
} |
85 |
} |
78 |
|
86 |
|
Lines 99-107
Link Here
|
99 |
} |
107 |
} |
100 |
nextHandledException: for (int i = 0, count = this.handledExceptions.length; i < count; i++) { |
108 |
nextHandledException: for (int i = 0, count = this.handledExceptions.length; i < count; i++) { |
101 |
int index = this.indexes.get(this.handledExceptions[i]); |
109 |
int index = this.indexes.get(this.handledExceptions[i]); |
102 |
int cacheIndex = index / ExceptionHandlingFlowContext.BitCacheSize; |
110 |
if ((this.isReached[index / ExceptionHandlingFlowContext.BitCacheSize] & 1 << (index % ExceptionHandlingFlowContext.BitCacheSize)) == 0) { |
103 |
int bitMask = 1 << (index % ExceptionHandlingFlowContext.BitCacheSize); |
|
|
104 |
if ((this.isReached[cacheIndex] & bitMask) == 0) { |
105 |
for (int j = 0; j < docCommentReferencesLength; j++) { |
111 |
for (int j = 0; j < docCommentReferencesLength; j++) { |
106 |
if (docCommentReferences[j] == this.handledExceptions[i]) { |
112 |
if (docCommentReferences[j] == this.handledExceptions[i]) { |
107 |
continue nextHandledException; |
113 |
continue nextHandledException; |
Lines 207-213
Link Here
|
207 |
boolean wasAlreadyDefinitelyCaught) { |
213 |
boolean wasAlreadyDefinitelyCaught) { |
208 |
|
214 |
|
209 |
int index = this.indexes.get(exceptionType); |
215 |
int index = this.indexes.get(exceptionType); |
210 |
// if already flagged as being reached (unchecked exception handler) |
|
|
211 |
int cacheIndex = index / ExceptionHandlingFlowContext.BitCacheSize; |
216 |
int cacheIndex = index / ExceptionHandlingFlowContext.BitCacheSize; |
212 |
int bitMask = 1 << (index % ExceptionHandlingFlowContext.BitCacheSize); |
217 |
int bitMask = 1 << (index % ExceptionHandlingFlowContext.BitCacheSize); |
213 |
if (!wasAlreadyDefinitelyCaught) { |
218 |
if (!wasAlreadyDefinitelyCaught) { |