X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/flow/ExceptionHandlingFlowContext.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/flow/ExceptionHandlingFlowContext.java index e483357..0ddf6ab 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/flow/ExceptionHandlingFlowContext.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/flow/ExceptionHandlingFlowContext.java @@ -12,13 +12,12 @@ package net.sourceforge.phpdt.internal.compiler.flow; import java.util.ArrayList; +import net.sourceforge.phpdt.internal.compiler.ast.ASTNode; import net.sourceforge.phpdt.internal.compiler.codegen.ObjectCache; import net.sourceforge.phpdt.internal.compiler.lookup.BlockScope; import net.sourceforge.phpdt.internal.compiler.lookup.ReferenceBinding; import net.sourceforge.phpdt.internal.compiler.lookup.Scope; import net.sourceforge.phpdt.internal.compiler.lookup.TypeBinding; -import net.sourceforge.phpeclipse.internal.compiler.ast.ASTNode; -import net.sourceforge.phpeclipse.internal.compiler.ast.TryStatement; /** * Reflects the context of code analysis, keeping track of enclosing @@ -69,31 +68,32 @@ public class ExceptionHandlingFlowContext extends FlowContext { System.arraycopy(this.isReached, 0, this.isNeeded, 0, cacheSize); this.initsOnReturn = FlowInfo.DEAD_END; } - - public void complainIfUnusedExceptionHandlers( - ASTNode[] exceptionHandlers, - BlockScope scope, - TryStatement tryStatement) { - // report errors for unreachable exception handlers - for (int i = 0, count = handledExceptions.length; i < count; i++) { - int index = indexes.get(handledExceptions[i]); - int cacheIndex = index / BitCacheSize; - int bitMask = 1 << (index % BitCacheSize); - if ((isReached[cacheIndex] & bitMask) == 0) { - scope.problemReporter().unreachableExceptionHandler( - handledExceptions[index], - exceptionHandlers[index]); - } else { - if ((isNeeded[cacheIndex] & bitMask) == 0) { - scope.problemReporter().maskedExceptionHandler( - handledExceptions[index], - exceptionHandlers[index]); - } - } - } - // will optimized out unnecessary catch block during code gen - tryStatement.preserveExceptionHandler = isNeeded; - } + + +// public void complainIfUnusedExceptionHandlers( +// ASTNode[] exceptionHandlers, +// BlockScope scope, +// TryStatement tryStatement) { +// // report errors for unreachable exception handlers +// for (int i = 0, count = handledExceptions.length; i < count; i++) { +// int index = indexes.get(handledExceptions[i]); +// int cacheIndex = index / BitCacheSize; +// int bitMask = 1 << (index % BitCacheSize); +// if ((isReached[cacheIndex] & bitMask) == 0) { +// scope.problemReporter().unreachableExceptionHandler( +// handledExceptions[index], +// exceptionHandlers[index]); +// } else { +// if ((isNeeded[cacheIndex] & bitMask) == 0) { +// scope.problemReporter().maskedExceptionHandler( +// handledExceptions[index], +// exceptionHandlers[index]); +// } +// } +// } +// // will optimized out unnecessary catch block during code gen +// tryStatement.preserveExceptionHandler = isNeeded; +// } public String individualToString() {