Skip to content

Possible bug in org.fife.rsta.ac.java.classreader.MethodInfo.java #47

@lubomirbenes

Description

@lubomirbenes

Hello,

it seems there is a bug in getReturnTypeString(boolean fullyQualified) method. When method is called first with fullyQualified = false the global returnType variable is initialized by not qualified type name and then not updated. In next call unqualified name is returned.

Here is my code to fix it:

/**
 * Returns the return type of this method.
 *
 * @return The return type of this method.
 */
public String getReturnTypeString(boolean fullyQualified) {
        String returnType0;
	if (returnType==null) {
		returnType0 = getReturnTypeStringFromTypeSignature(fullyQualified);
		if (returnType0==null) {
			returnType0 = getReturnTypeStringFromDescriptor(fullyQualified);
		}
	} else {
                returnType0 = returnType;
            }
	if(!fullyQualified)
	{
		if(returnType0 != null && returnType0.indexOf(".") > -1) {
			return returnType0.substring(returnType0.lastIndexOf(".") +1, returnType0.length());  
		}
	} else {
                returnType = returnType0;
            }
	return returnType;
}

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions