X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/problem/ProblemHandler.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/problem/ProblemHandler.java index 9295af1..6e52747 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/problem/ProblemHandler.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/compiler/problem/ProblemHandler.java @@ -1,22 +1,22 @@ /******************************************************************************* - * Copyright (c) 2000, 2001, 2002 International Business Machines Corp. and others. + * Copyright (c) 2000, 2003 IBM Corporation and others. * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Common Public License v0.5 + * are made available under the terms of the Common Public License v1.0 * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/cpl-v05.html + * http://www.eclipse.org/legal/cpl-v10.html * * Contributors: * IBM Corporation - initial API and implementation - ******************************************************************************/ + *******************************************************************************/ package net.sourceforge.phpdt.internal.compiler.problem; import net.sourceforge.phpdt.core.compiler.IProblem; import net.sourceforge.phpdt.internal.compiler.CompilationResult; import net.sourceforge.phpdt.internal.compiler.IErrorHandlingPolicy; import net.sourceforge.phpdt.internal.compiler.IProblemFactory; -import net.sourceforge.phpdt.internal.compiler.impl.CompilerOptions; import net.sourceforge.phpdt.internal.compiler.impl.ReferenceContext; + /* * Compiler error handler, responsible to determine whether * a problem is actually a warning or an error; also will @@ -28,19 +28,22 @@ import net.sourceforge.phpdt.internal.compiler.impl.ReferenceContext; public class ProblemHandler implements ProblemSeverities { + public final static String[] NoArgument = new String[0]; + final public IErrorHandlingPolicy policy; public final IProblemFactory problemFactory; - public final CompilerOptions options; +// public final CompilerOptions options; /* * Problem handler can be supplied with a policy to specify * its behavior in error handling. Also see static methods for * built-in policies. * */ -public ProblemHandler(IErrorHandlingPolicy policy, CompilerOptions options, IProblemFactory problemFactory) { +public ProblemHandler(IErrorHandlingPolicy policy, IProblemFactory problemFactory) { +//CompilerOptions options, IProblemFactory problemFactory) { this.policy = policy; this.problemFactory = problemFactory; - this.options = options; +// this.options = options; } /* * Given the current configuration, answers which category the problem @@ -48,13 +51,17 @@ public ProblemHandler(IErrorHandlingPolicy policy, CompilerOptions options, IPro * Error | Warning | Ignore */ public int computeSeverity(int problemId){ - + if (problemId==IProblem.PHPParsingWarning || + problemId==IProblem.PHPVarDeprecatedWarning) { + return Warning; + } return Error; // by default all problems are errors } public IProblem createProblem( char[] fileName, int problemId, String[] problemArguments, + String[] messageArguments, int severity, int problemStartPosition, int problemEndPosition, @@ -66,6 +73,7 @@ public IProblem createProblem( fileName, problemId, problemArguments, + messageArguments, severity, problemStartPosition, problemEndPosition, @@ -74,6 +82,7 @@ public IProblem createProblem( public void handle( int problemId, String[] problemArguments, + String[] messageArguments, int severity, int problemStartPosition, int problemEndPosition, @@ -86,7 +95,7 @@ public void handle( // if no reference context, we need to abort from the current compilation process if (referenceContext == null) { if ((severity & Error) != 0) { // non reportable error is fatal - throw new AbortCompilation(problemId, problemArguments); + throw new AbortCompilation(problemId, problemArguments, messageArguments); } else { return; // ignore non reportable warning } @@ -97,6 +106,7 @@ public void handle( unitResult.getFileName(), problemId, problemArguments, + messageArguments, severity, problemStartPosition, problemEndPosition, @@ -132,6 +142,7 @@ public void handle( public void handle( int problemId, String[] problemArguments, + String[] messageArguments, int problemStartPosition, int problemEndPosition, ReferenceContext referenceContext, @@ -140,6 +151,7 @@ public void handle( this.handle( problemId, problemArguments, + messageArguments, this.computeSeverity(problemId), // severity inferred using the ID problemStartPosition, problemEndPosition,