Share

JQuery: Query-Based Java Code Browser

Tracker: Bugs

5 getJavaModelElement does not work for all methods - ID: 2703807
Last Update: Comment added ( abartho )

JQueryAPI#getJavaModelElement(Object) does not return the method if it
contains array parameters (e.g. main(String[]). The actual bug is in
JQueryTyRuBaAPI#getMethodName(IMethod), in which brackets are used as
string delimiters:

private static String getMethodName(IMethod m) throws JavaModelException {
// so this is kind of "hack-ish" but it seems to work...
String result = m.toString();
result = result.substring(0, result.indexOf("["));
// remove white spaces
result = result.replaceAll("\\p{Space}", "");
return result;
}


A.B. ( abartho ) - 2009-03-22 18:11

5

Open

None

Nobody/Anonymous

Database

v4.0

Public


Comment ( 1 )




Date: 2009-03-22 18:22
Sender: abartho

Suggestion for fix:

private static String getMethodName(IMethod m) throws JavaModelException
{
String result = JavaElementLabels.getElementLabel(m,
JavaElementLabels.ALL_DEFAULT);
return result;
}


Log in to comment.

Attached File

No Files Currently Attached

Change

No changes have been made to this artifact.