All language modules: getInstance()
Use a consistent implementation of getInstance(). Now all modules resolve against the LanguageRegistry.
This commit is contained in:
@@ -6,6 +6,7 @@ package net.sourceforge.pmd.lang.python;
|
||||
|
||||
import net.sourceforge.pmd.cpd.Tokenizer;
|
||||
import net.sourceforge.pmd.lang.LanguagePropertyBundle;
|
||||
import net.sourceforge.pmd.lang.LanguageRegistry;
|
||||
import net.sourceforge.pmd.lang.impl.CpdOnlyLanguageModuleBase;
|
||||
import net.sourceforge.pmd.lang.python.cpd.PythonTokenizer;
|
||||
|
||||
@@ -13,9 +14,14 @@ import net.sourceforge.pmd.lang.python.cpd.PythonTokenizer;
|
||||
* Defines the Language module for Python
|
||||
*/
|
||||
public class PythonLanguageModule extends CpdOnlyLanguageModuleBase {
|
||||
private static final String ID = "python";
|
||||
|
||||
public PythonLanguageModule() {
|
||||
super(LanguageMetadata.withId("python").name("Python").extensions("py"));
|
||||
super(LanguageMetadata.withId(ID).name("Python").extensions("py"));
|
||||
}
|
||||
|
||||
public static PythonLanguageModule getInstance() {
|
||||
return (PythonLanguageModule) LanguageRegistry.CPD.getLanguageById(ID);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user