Skip to content

Commit

Permalink
Merge branch 'eclipse-jdt:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
carstenartur authored Sep 5, 2024
2 parents e1df30d + 1df6c00 commit bb75292
Show file tree
Hide file tree
Showing 75 changed files with 1,170 additions and 976 deletions.
2 changes: 1 addition & 1 deletion org.eclipse.jdt.bcoview.feature/feature.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<feature
id="org.eclipse.jdt.bcoview.feature"
label="Bytecode Outline View"
version="1.2.500.qualifier"
version="1.2.600.qualifier"
provider-name="Eclipse.org"
license-feature="org.eclipse.license"
license-feature-version="0.0.0">
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.bcoview/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.jdt.bcoview;singleton:=true
Bundle-Version: 1.2.500.qualifier
Bundle-Version: 1.2.600.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.jdt.bcoview.BytecodeOutlinePlugin
Bundle-Vendor: %providerName
Expand Down
2 changes: 1 addition & 1 deletion org.eclipse.jdt.bcoview/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
</parent>
<groupId>org.eclipse.jdt</groupId>
<artifactId>org.eclipse.jdt.bcoview</artifactId>
<version>1.2.500-SNAPSHOT</version>
<version>1.2.600-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>

<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,19 @@ protected void appendDescriptor(StringBuilder buf1, int type, String desc, boole
}
break;
case FIELD_DESCRIPTOR:
if ("T".equals(desc)) { //$NON-NLS-1$
buf1.append("top"); //$NON-NLS-1$
} else if ("N".equals(desc)) { //$NON-NLS-1$
buf1.append("null"); //$NON-NLS-1$
} else if ("U".equals(desc)) { //$NON-NLS-1$
buf1.append("uninitialized_this"); //$NON-NLS-1$
} else {
buf1.append(getSimpleName(Type.getType(desc)));
switch (desc) {
case "T": //$NON-NLS-1$
buf1.append("top"); //$NON-NLS-1$
break;
case "N": //$NON-NLS-1$
buf1.append("null"); //$NON-NLS-1$
break;
case "U": //$NON-NLS-1$
buf1.append("uninitialized_this"); //$NON-NLS-1$
break;
default:
buf1.append(getSimpleName(Type.getType(desc)));
break;
}
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1634,15 +1634,21 @@ public ToggleOrientationAction(int orientation) {
super("", AS_RADIO_BUTTON); //$NON-NLS-1$

String symbolicName = BytecodeOutlinePlugin.getDefault().getBundle().getSymbolicName();
if (orientation == VIEW_ORIENTATION_HORIZONTAL) {
setText(Messages.BytecodeOutlineView_toggle_horizontal_label);
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(symbolicName, "icons/th_horizontal.gif")); //$NON-NLS-1$
} else if (orientation == VIEW_ORIENTATION_VERTICAL) {
setText(Messages.BytecodeOutlineView_toggle_vertical_label);
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(symbolicName, "icons/th_vertical.gif")); //$NON-NLS-1$
} else if (orientation == VIEW_ORIENTATION_AUTOMATIC) {
setText(Messages.BytecodeOutlineView_toggle_automatic_label);
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(symbolicName, "icons/th_automatic.gif")); //$NON-NLS-1$
switch (orientation) {
case VIEW_ORIENTATION_HORIZONTAL:
setText(Messages.BytecodeOutlineView_toggle_horizontal_label);
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(symbolicName, "icons/th_horizontal.gif")); //$NON-NLS-1$
break;
case VIEW_ORIENTATION_VERTICAL:
setText(Messages.BytecodeOutlineView_toggle_vertical_label);
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(symbolicName, "icons/th_vertical.gif")); //$NON-NLS-1$
break;
case VIEW_ORIENTATION_AUTOMATIC:
setText(Messages.BytecodeOutlineView_toggle_automatic_label);
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(symbolicName, "icons/th_automatic.gif")); //$NON-NLS-1$
break;
default:
break;
}
actionOrientation = orientation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,18 @@ protected String getModifiedString(String str, List<TagElement> tags) {
String modifiedStr= str;
for (TagElement tag : tags) {
String name= tag.getTagName();
if (TagElement.TAG_HIGHLIGHT.equals(name)) {
handleSnippetHighlight(modifiedStr, tag, actionElements);
} else if (TagElement.TAG_REPLACE.equals(name)) {
modifiedStr= handleSnippetReplace(modifiedStr, tag, actionElements);
} else if (TagElement.TAG_LINK.equals(name)) {
handleSnippetLink(modifiedStr, tag, actionElements);
switch (name) {
case TagElement.TAG_HIGHLIGHT:
handleSnippetHighlight(modifiedStr, tag, actionElements);
break;
case TagElement.TAG_REPLACE:
modifiedStr= handleSnippetReplace(modifiedStr, tag, actionElements);
break;
case TagElement.TAG_LINK:
handleSnippetLink(modifiedStr, tag, actionElements);
break;
default:
break;
}
}
return getString(modifiedStr, actionElements);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1137,58 +1137,66 @@ protected boolean handleInheritDoc(TagElement node) {
CharSequence inherited= fJavadocLookup.getInheritedMainDescription(fMethod);
return handleInherited(inherited);

} else if (TagElement.TAG_PARAM.equals(blockTagName)) {
List<? extends ASTNode> fragments= blockTag.fragments();
int size= fragments.size();
if (size > 0) {
Object first= fragments.get(0);
if (first instanceof SimpleName) {
String name= ((SimpleName) first).getIdentifier();
String[] parameterNames= fMethod.getParameterNames();
for (int i= 0; i < parameterNames.length; i++) {
if (name.equals(parameterNames[i])) {
CharSequence inherited= fJavadocLookup.getInheritedParamDescription(fMethod, i);
return handleInherited(inherited);
}
}
} else if (size > 2 && first instanceof TextElement) {
String firstText= ((TextElement) first).getText();
if ("<".equals(firstText)) { //$NON-NLS-1$
Object second= fragments.get(1);
Object third= fragments.get(2);
if (second instanceof SimpleName && third instanceof TextElement) {
String thirdText= ((TextElement) third).getText();
if (">".equals(thirdText)) { //$NON-NLS-1$
String name= ((SimpleName) second).getIdentifier();
ITypeParameter[] typeParameters= fMethod.getTypeParameters();
for (int i= 0; i < typeParameters.length; i++) {
ITypeParameter typeParameter= typeParameters[i];
if (name.equals(typeParameter.getElementName())) {
CharSequence inherited= getInheritedTypeParamDescription(i);
return handleInherited(inherited);
} else
switch (blockTagName) {
case TagElement.TAG_PARAM: {
List<? extends ASTNode> fragments= blockTag.fragments();
int size= fragments.size();
if (size > 0) {
Object first= fragments.get(0);
if (first instanceof SimpleName) {
String name= ((SimpleName) first).getIdentifier();
String[] parameterNames= fMethod.getParameterNames();
for (int i= 0; i < parameterNames.length; i++) {
if (name.equals(parameterNames[i])) {
CharSequence inherited= fJavadocLookup.getInheritedParamDescription(fMethod, i);
return handleInherited(inherited);
}
}
} else if (size > 2 && first instanceof TextElement) {
String firstText= ((TextElement) first).getText();
if ("<".equals(firstText)) { //$NON-NLS-1$
Object second= fragments.get(1);
Object third= fragments.get(2);
if (second instanceof SimpleName && third instanceof TextElement) {
String thirdText= ((TextElement) third).getText();
if (">".equals(thirdText)) { //$NON-NLS-1$
String name= ((SimpleName) second).getIdentifier();
ITypeParameter[] typeParameters= fMethod.getTypeParameters();
for (int i= 0; i < typeParameters.length; i++) {
ITypeParameter typeParameter= typeParameters[i];
if (name.equals(typeParameter.getElementName())) {
CharSequence inherited= getInheritedTypeParamDescription(i);
return handleInherited(inherited);
}
}
}
}
}
}
}
break;
}
}

} else if (TagElement.TAG_RETURN.equals(blockTagName)) {
CharSequence inherited= fJavadocLookup.getInheritedReturnDescription(fMethod);
return handleInherited(inherited);

} else if (TagElement.TAG_THROWS.equals(blockTagName) || TagElement.TAG_EXCEPTION.equals(blockTagName)) {
List<? extends ASTNode> fragments= blockTag.fragments();
if (fragments.size() > 0) {
Object first= fragments.get(0);
if (first instanceof Name) {
String name= ASTNodes.getSimpleNameIdentifier((Name) first);
CharSequence inherited= fJavadocLookup.getInheritedExceptionDescription(fMethod, name);
case TagElement.TAG_RETURN: {
CharSequence inherited= fJavadocLookup.getInheritedReturnDescription(fMethod);
return handleInherited(inherited);
}
case TagElement.TAG_THROWS:
case TagElement.TAG_EXCEPTION: {
List<? extends ASTNode> fragments= blockTag.fragments();
if (fragments.size() > 0) {
Object first= fragments.get(0);
if (first instanceof Name) {
String name= ASTNodes.getSimpleNameIdentifier((Name) first);
CharSequence inherited= fJavadocLookup.getInheritedExceptionDescription(fMethod, name);
return handleInherited(inherited);
}
}
break;
}
default:
break;
}
}
} catch (JavaModelException e) {
JavaManipulationPlugin.log(e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,17 +192,23 @@ public IStatus[] getChildren() {
public String toString() {
StringBuilder buf = new StringBuilder();
buf.append("StatusInfo "); //$NON-NLS-1$
if (fSeverity == OK) {
buf.append("OK"); //$NON-NLS-1$
} else if (fSeverity == ERROR) {
buf.append("ERROR"); //$NON-NLS-1$
} else if (fSeverity == WARNING) {
buf.append("WARNING"); //$NON-NLS-1$
} else if (fSeverity == INFO) {
buf.append("INFO"); //$NON-NLS-1$
} else {
buf.append("severity="); //$NON-NLS-1$
buf.append(fSeverity);
switch (fSeverity) {
case OK:
buf.append("OK"); //$NON-NLS-1$
break;
case ERROR:
buf.append("ERROR"); //$NON-NLS-1$
break;
case WARNING:
buf.append("WARNING"); //$NON-NLS-1$
break;
case INFO:
buf.append("INFO"); //$NON-NLS-1$
break;
default:
buf.append("severity="); //$NON-NLS-1$
buf.append(fSeverity);
break;
}
buf.append(": "); //$NON-NLS-1$
buf.append(fStatusMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2214,27 +2214,35 @@ public void collectConstructorProposals(IInvocationContext context, IProblemLoca
IMethodBinding recursiveConstructor= null;

int type= selectedNode.getNodeType();
if (type == ASTNode.CLASS_INSTANCE_CREATION) {
ClassInstanceCreation creation= (ClassInstanceCreation) selectedNode;

ITypeBinding binding= creation.getType().resolveBinding();
if (binding != null) {
targetBinding= binding;
arguments= creation.arguments();
switch (type) {
case ASTNode.CLASS_INSTANCE_CREATION: {
ClassInstanceCreation creation= (ClassInstanceCreation) selectedNode;
ITypeBinding binding= creation.getType().resolveBinding();
if (binding != null) {
targetBinding= binding;
arguments= creation.arguments();
}
break;
}
} else if (type == ASTNode.SUPER_CONSTRUCTOR_INVOCATION) {
ITypeBinding typeBinding= Bindings.getBindingOfParentType(selectedNode);
if (typeBinding != null && !typeBinding.isAnonymous()) {
targetBinding= typeBinding.getSuperclass();
arguments= ((SuperConstructorInvocation) selectedNode).arguments();
case ASTNode.SUPER_CONSTRUCTOR_INVOCATION: {
ITypeBinding typeBinding= Bindings.getBindingOfParentType(selectedNode);
if (typeBinding != null && !typeBinding.isAnonymous()) {
targetBinding= typeBinding.getSuperclass();
arguments= ((SuperConstructorInvocation) selectedNode).arguments();
}
break;
}
} else if (type == ASTNode.CONSTRUCTOR_INVOCATION) {
ITypeBinding typeBinding= Bindings.getBindingOfParentType(selectedNode);
if (typeBinding != null && !typeBinding.isAnonymous()) {
targetBinding= typeBinding;
arguments= ((ConstructorInvocation) selectedNode).arguments();
recursiveConstructor= ASTResolving.findParentMethodDeclaration(selectedNode).resolveBinding();
case ASTNode.CONSTRUCTOR_INVOCATION: {
ITypeBinding typeBinding= Bindings.getBindingOfParentType(selectedNode);
if (typeBinding != null && !typeBinding.isAnonymous()) {
targetBinding= typeBinding;
arguments= ((ConstructorInvocation) selectedNode).arguments();
recursiveConstructor= ASTResolving.findParentMethodDeclaration(selectedNode).resolveBinding();
}
break;
}
default:
break;
}

if (selectedNode.getParent() instanceof EnumConstantDeclaration enumNode) {
Expand Down
Loading

0 comments on commit bb75292

Please sign in to comment.