forked from phoedos/pmd
@@ -11,12 +11,17 @@ import org.antlr.runtime.ANTLRStringStream;
|
||||
import org.antlr.runtime.Lexer;
|
||||
import org.antlr.runtime.Token;
|
||||
|
||||
import net.sourceforge.pmd.lang.apex.ApexJorjeLogging;
|
||||
import net.sourceforge.pmd.lang.ast.TokenMgrError;
|
||||
|
||||
import apex.jorje.parser.impl.ApexLexer;
|
||||
|
||||
public class ApexTokenizer implements Tokenizer {
|
||||
|
||||
public ApexTokenizer() {
|
||||
ApexJorjeLogging.disableLogging();
|
||||
}
|
||||
|
||||
/**
|
||||
* If the properties is <code>false</code> (default), then the case of any token
|
||||
* is ignored.
|
||||
|
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.apex;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
import apex.jorje.parser.impl.BaseApexLexer;
|
||||
|
||||
public final class ApexJorjeLogging {
|
||||
private ApexJorjeLogging() {
|
||||
// this is a utility class
|
||||
}
|
||||
|
||||
public static void disableLogging() {
|
||||
// Disable the logging of the ApexLexer, e.g.
|
||||
// Jul 16, 2017 8:49:56 PM apex.jorje.parser.impl.BaseApexLexer dedupe
|
||||
// INFORMATION: Deduped array ApexLexer.DFA23_transition. Found 7927114 shorts which is 15MB not
|
||||
// including array overhead. Removed 7204963 shorts which is 13MB not counting array overhead. Took 18ms.
|
||||
Logger log = Logger.getLogger(BaseApexLexer.class.getSimpleName());
|
||||
log.setLevel(Level.WARNING);
|
||||
}
|
||||
}
|
@@ -11,6 +11,7 @@ import java.util.Map;
|
||||
|
||||
import org.apache.commons.io.IOUtils;
|
||||
|
||||
import net.sourceforge.pmd.lang.apex.ApexJorjeLogging;
|
||||
import net.sourceforge.pmd.lang.apex.ApexParserOptions;
|
||||
import net.sourceforge.pmd.lang.ast.ParseException;
|
||||
|
||||
@@ -29,6 +30,7 @@ public class ApexParser {
|
||||
private String suppressMarker = "NOPMD";
|
||||
|
||||
public ApexParser(ApexParserOptions parserOptions) {
|
||||
ApexJorjeLogging.disableLogging();
|
||||
this.parserOptions = parserOptions;
|
||||
|
||||
if (parserOptions.getSuppressMarker() != null) {
|
||||
|
@@ -61,6 +61,7 @@ Based on those metrics, rules like "GodClass" detection can be implemented more
|
||||
|
||||
* apex
|
||||
* [#488](https://github.com/pmd/pmd/pull/488): \[apex] Use Apex lexer for CPD
|
||||
* [#500](https://github.com/pmd/pmd/issues/500): \[apex] Running through CLI shows jorje optimization messages
|
||||
* cpp
|
||||
* [#448](https://github.com/pmd/pmd/issues/448): \[cpp] Write custom CharStream to handle continuation characters
|
||||
* java
|
||||
|
Reference in New Issue
Block a user