Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,15 @@ public void testCreateIntersectionTypeSignature2() {
Signature.getIntersectionTypeBounds(signature)
);
}

public void testDollarPackage() {
String signature = Signature.getTypeErasure("Ljava.util.$foo$.Optional");
assertEquals(
"Ljava.util.$foo$.Optional",
new String(signature.toCharArray())
);
}

// Bug 380048 - error popup when navigating to source files
public void testSourceMapperSigConversion01() {
SourceMapper mapper = new SourceMapper();
Expand Down
24 changes: 15 additions & 9 deletions org.eclipse.jdt.core/model/org/eclipse/jdt/core/Signature.java
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,8 @@ private static int appendClassTypeSignature(char[] string, int start, boolean fu
throw newIllegalArgumentException(string, start);
}
c = string[p];
char prevC = string[p - 1];
char nextC = p < string.length - 1 ? string[p + 1] : 0;
switch(c) {
case C_SEMICOLON :
// all done
Expand Down Expand Up @@ -668,15 +670,19 @@ private static int appendClassTypeSignature(char[] string, int start, boolean fu
innerTypeStart = buffer.length();
inAnonymousType = false;
if (resolved) {
// once we hit "$" there are no more package prefixes
removePackageQualifiers = false;
/**
* Convert '$' in resolved type signatures into '.'.
* NOTE: This assumes that the type signature is an inner type
* signature. This is true in most cases, but someone can define a
* non-inner type name containing a '$'.
*/
buffer.append('.');
if (prevC == C_DOT || nextC == C_DOT) {
buffer.append('$');
} else {
// once we hit "$" there are no more package prefixes
removePackageQualifiers = false;
/**
* Convert '$' in resolved type signatures into '.'.
* NOTE: This assumes that the type signature is an inner type
* signature. This is true in most cases, but someone can define a
* non-inner type name containing a '$'.
*/
buffer.append('.');
}
}
break;
default :
Expand Down
Loading