Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 316327 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/wst/jsdt/internal/ui/text/java/MethodProposalInfo.java (-12 / +20 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2000, 2009 IBM Corporation and others.
2
 * Copyright (c) 2000, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 57-83 Link Here
57
	 */
57
	 */
58
	protected IMember resolveMember() throws JavaScriptModelException {
58
	protected IMember resolveMember() throws JavaScriptModelException {
59
		char[] declarationSignature= fProposal.getDeclarationSignature();
59
		char[] declarationSignature= fProposal.getDeclarationSignature();
60
		
60
		IFunction func = null;
61
		if (declarationSignature!=null) {
61
		if (declarationSignature!=null) {
62
			String typeName = SignatureUtil.stripSignatureToFQN(String
62
			String typeName = SignatureUtil.stripSignatureToFQN(String
63
					.valueOf(declarationSignature));
63
					.valueOf(declarationSignature));
64
			String name = String.valueOf(fProposal.getName());
64
			String name = String.valueOf(fProposal.getName());
65
			String[] parameters = Signature.getParameterTypes(String
65
			String[] parameters = Signature.getParameterTypes(String
66
					.valueOf(fProposal.getSignature()));
66
					.valueOf(fProposal.getSignature()));
67
			IType type = fJavaProject.findType(typeName);
67
			//search all the possible types until a match is found
68
			if (type != null) {
68
			IType[] types = fJavaProject.findTypes(typeName);
69
				boolean isConstructor = fProposal.isConstructor();
69
			for(int i = 0; i < types.length && func != null; ++i) {
70
70
				IType type = types[i];
71
				return findMethod(name, parameters, isConstructor, type);
71
				if (type != null) {
72
					boolean isConstructor = fProposal.isConstructor();
73
					try {
74
						func = findMethod(name, parameters, isConstructor, type);
75
					} catch(JavaScriptModelException e) {
76
						//ignore, could not find method
77
					}
78
				}
72
			}
79
			}
73
			else
80
			
74
			{
81
			if(func == null) {
75
				ITypeRoot typeRoot=fJavaProject.findTypeRoot(typeName);
82
				ITypeRoot typeRoot=fJavaProject.findTypeRoot(typeName);
76
				if(typeRoot != null)
83
				if(typeRoot != null) {
77
					return typeRoot.getFunction(name, parameters);
84
					func = typeRoot.getFunction(name, parameters);
85
				}
78
			}
86
			}
79
		}		
87
		}		
80
		return null;
88
		return func;
81
	}
89
	}
82
90
83
	/* adapted from JavaModelUtil */
91
	/* adapted from JavaModelUtil */
(-)src/org/eclipse/wst/jsdt/internal/ui/text/java/FieldProposalInfo.java (-8 / +11 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2005, 2008 IBM Corporation and others.
2
 * Copyright (c) 2005, 2010 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 50-63 Link Here
50
		if (declarationSignature == null)
50
		if (declarationSignature == null)
51
			return null;
51
			return null;
52
		String typeName= SignatureUtil.stripSignatureToFQN(String.valueOf(declarationSignature));
52
		String typeName= SignatureUtil.stripSignatureToFQN(String.valueOf(declarationSignature));
53
		IType type= fJavaProject.findType(typeName);
53
		IType[] types = this.fJavaProject.findTypes(typeName);
54
		if (type != null) {
54
		for(int i = 0; i < types.length; ++i) {
55
			String name= String.valueOf(fProposal.getName());
55
			IType type = types[i];
56
			IField field= type.getField(name);
56
			if (type != null) {
57
			if (field.exists())
57
				String name= String.valueOf(fProposal.getName());
58
				return field;
58
				IField field= type.getField(name);
59
				if (field.exists())
60
					return field;
61
			}
59
		}
62
		}
60
63
		
61
		return null;
64
		return null;
62
	}
65
	}
63
}
66
}

Return to bug 316327