Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IApiAnnotations.isExact for CompositeApiDescription.resolveAnnotations #1390

Merged
merged 1 commit into from
Sep 5, 2024
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
2 changes: 1 addition & 1 deletion apitools/org.eclipse.pde.api.tools/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.pde.api.tools;singleton:=true
Bundle-Version: 1.3.500.qualifier
Bundle-Version: 1.3.600.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.29.0,4.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public void setExact(boolean equals) {
isExact = equals;
}

@Override
public boolean isExact() {
return isExact;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,12 @@ public IApiAnnotations resolveAnnotations(IElementDescriptor element) {
IApiAnnotations bestMatchAnnotation = null;
for (IApiDescription fDescription : fDescriptions) {
IApiAnnotations ann = fDescription.resolveAnnotations(element);
boolean isExact = false;
if (ann != null) {
bestMatchAnnotation = ann;
if (ann.isExact()) {
return ann; // if exact, return else keep looking for best match
}
}
if (ann instanceof ApiAnnotations) {
isExact = ((ApiAnnotations) ann).isExact();
}
if (isExact) {
return ann; // if exact, return else keep looking for best match
}

}
return bestMatchAnnotation;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@ public int getRestrictions() {
return fAnnotations.getRestrictions();
}

@Override
public boolean isExact() {
return fAnnotations != null && fAnnotations.isExact();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,17 @@ public interface IApiAnnotations {
*/
public int getRestrictions();

/**
* Returns whether these API annotations are based on an exact match of the
* originating element.
*
* @return whether these API annotations are based on an exact match of the
* originating element.
*
* @since 1.3.600
*/
default boolean isExact() {
return false;
}

}
Loading