cleanup cpdCompat

This commit is contained in:
Clément Fournier committed 2022-07-21 04:00:05 +02:00
1 parent ea52a779e4
commit 5f0ece0591
2 files changed
+3 -14

No files matched your search

@@ -5,10 +5,8 @@
package net.sourceforge.pmd.lang.document;
import net.sourceforge.pmd.cpd.SourceCode;
import net.sourceforge.pmd.lang.Language;
import net.sourceforge.pmd.lang.LanguageVersion;
import net.sourceforge.pmd.lang.impl.LanguageModuleBase.LanguageMetadata;
import net.sourceforge.pmd.lang.impl.SimpleLanguageModuleBase;
import net.sourceforge.pmd.lang.PlainTextLanguage;
/**
* Compatibility APIs, to be removed before PMD 7 is out.
@@ -20,18 +18,9 @@ public final class CpdCompat {
// utility class
}
/** The language version must be non-null. */
@Deprecated
private static final Language DUMMY_LANG =
new SimpleLanguageModuleBase(LanguageMetadata.withId("dummy").name("dummy").extensions("dummy"),
props -> () -> task -> {
throw new UnsupportedOperationException();
});
@Deprecated
public static LanguageVersion dummyVersion() {
return DUMMY_LANG.getDefaultVersion();
return PlainTextLanguage.getInstance().getDefaultVersion();
}
/**
@@ -147,7 +147,7 @@ public abstract class LanguageModuleBase implements Language {
return Objects.equals(getId(), other.getId());
}
public static final class LanguageMetadata {
protected static final class LanguageMetadata {
private String name;
private String shortName;
private final String id;