"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pmd-core/src/main/java/net/sourceforge/pmd/lang/AbstractParser.java" between
pmd-src-6.37.0.zip and pmd-src-6.38.0.zip

About: PMD is a source code analyzer for Java, JavaScript, XML and others. It finds unused variables, empty catch blocks, unnecessary object creation, and so forth. Sources (Java).

AbstractParser.java  (pmd-src-6.37.0):AbstractParser.java  (pmd-src-6.38.0)
/** /**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/ */
package net.sourceforge.pmd.lang; package net.sourceforge.pmd.lang;
import java.io.Reader; import java.io.Reader;
import java.nio.file.Paths;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.ast.xpath.internal.FileNameXPathFunction;
/** /**
* This is a generic implementation of the Parser interface. * This is a generic implementation of the Parser interface.
* *
* @see Parser * @see Parser
* *
* @deprecated This will become useless in PMD 7. Implement or use {@link Parser } directly * @deprecated This will become useless in PMD 7. Implement or use {@link Parser } directly
*/ */
@Deprecated @Deprecated
public abstract class AbstractParser implements Parser { public abstract class AbstractParser implements Parser {
skipping to change at line 37 skipping to change at line 41
} }
@Override @Override
public TokenManager getTokenManager(String fileName, Reader source) { public TokenManager getTokenManager(String fileName, Reader source) {
TokenManager tokenManager = createTokenManager(source); TokenManager tokenManager = createTokenManager(source);
tokenManager.setFileName(fileName); tokenManager.setFileName(fileName);
return tokenManager; return tokenManager;
} }
protected abstract TokenManager createTokenManager(Reader source); protected abstract TokenManager createTokenManager(Reader source);
@Deprecated
public static Node doParse(Parser parser, String fileName, Reader source) {
Node rootNode = parser.parse(fileName, source);
// remove prefixed path segments.
String simpleFileName = Paths.get(fileName).getFileName().toString();
rootNode.getUserMap().set(FileNameXPathFunction.FILE_NAME_KEY, simpleFil
eName);
return rootNode;
}
} }
 End of changes. 2 change blocks. 
0 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)