Skip to content

Commit

Permalink
[FIXUP] Remove VersionMatchRule.NONE. If 'desired' null can be used.
Browse files Browse the repository at this point in the history
  • Loading branch information
HannesWell committed Aug 6, 2024
1 parent 431133e commit 7896430
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,6 @@
* @since 3.19
*/
public enum VersionMatchRule {
/** No rule. */
NONE("none") { //$NON-NLS-1$ // TODO: check this?!
@Override
public VersionRange rangeFor(Version reference) {
// TODO: or include all range?
return COMPATIBLE.rangeFor(reference);
}

@Override
public boolean matches(Version version, Version reference) {
// TODO: or always true?
return COMPATIBLE.matches(version, reference);
}
},
/**
* A rule that matches if a version is perfectly
* {@link Version#equals(Object) equals} to a reference.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static Version getVersion(IPluginModelBase model) {

public static VersionMatchRule matchRuleFromLiteral(int literal) {
return switch (literal) {
case IMatchRules.NONE -> VersionMatchRule.NONE;
case IMatchRules.NONE -> VersionMatchRule.COMPATIBLE;
case IMatchRules.EQUIVALENT -> VersionMatchRule.EQUIVALENT;
case IMatchRules.COMPATIBLE -> VersionMatchRule.COMPATIBLE;
case IMatchRules.PERFECT -> VersionMatchRule.PERFECT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public class PluginRegistryTests {

@Test
public void testMatchNone() {
IPluginModelBase model = PluginRegistry.findModel("org.eclipse.jdt.debug", null, VersionMatchRule.NONE);
IPluginModelBase model = PluginRegistry.findModel("org.eclipse.jdt.debug", null, (VersionMatchRule) null);
assertNotNull(model);
assertEquals("org.eclipse.jdt.debug", model.getPluginBase().getId());
}
Expand Down

0 comments on commit 7896430

Please sign in to comment.