added -J option to preserve unmodified files in preexisting jarfile
[org.ibex.tool.git] / src / org / eclipse / jdt / internal / compiler / lookup / ProblemMethodBinding.java
1 /*******************************************************************************
2  * Copyright (c) 2000, 2004 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials 
4  * are made available under the terms of the Common Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/cpl-v10.html
7  * 
8  * Contributors:
9  *     IBM Corporation - initial API and implementation
10  *******************************************************************************/
11 package org.eclipse.jdt.internal.compiler.lookup;
12
13 public class ProblemMethodBinding extends MethodBinding {
14     
15         private int problemReason;
16         public MethodBinding closestMatch; // TODO (philippe) should rename into #alternateMatch
17         
18 public ProblemMethodBinding(char[] selector, TypeBinding[] args, int problemReason) {
19         this.selector = selector;
20         this.parameters = (args == null || args.length == 0) ? NoParameters : args;
21         this.problemReason = problemReason;
22 }
23 public ProblemMethodBinding(char[] selector, TypeBinding[] args, ReferenceBinding declaringClass, int problemReason) {
24         this.selector = selector;
25         this.parameters = (args == null || args.length == 0) ? NoParameters : args;
26         this.declaringClass = declaringClass;
27         this.problemReason = problemReason;
28 }
29 public ProblemMethodBinding(MethodBinding closestMatch, char[] selector, TypeBinding[] args, int problemReason) {
30         this(selector, args, problemReason);
31         this.closestMatch = closestMatch;
32         if (closestMatch != null) this.declaringClass = closestMatch.declaringClass;
33 }
34 /* API
35 * Answer the problem id associated with the receiver.
36 * NoError if the receiver is a valid binding.
37 */
38
39 public final int problemId() {
40         return this.problemReason;
41 }
42 }