Skip to content

Commit

Permalink
Merge pull request pmd#2152 from oowekyala/deprecate-abstract-parser
Browse files Browse the repository at this point in the history
[java] Deprecate abstract java parser, internalize some other APIs
  • Loading branch information
jsotuyod authored Dec 8, 2019
2 parents ca29917 + 4014ab1 commit 3833d8c
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docs/pages/release_notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,22 @@ This is a {{ site.pmd.release_type }} release.

### API Changes


#### Deprecated APIs

##### Internal API

* {% jdoc java::lang.java.JavaLanguageHandler %}
* {% jdoc java::lang.java.JavaLanguageParser %}
* {% jdoc java::lang.java.JavaDataFlowHandler %}


##### For removal

* {% jdoc java::lang.java.AbstractJavaParser %}
* {% jdoc java::lang.java.AbstractJavaHandler %}


### External Contributions

{% endtocmaker %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@
* classes as adapters of the visitors to the VisitorStarter interface.
*
* @author pieter_van_raemdonck - Application Engineers NV/SA - www.ae.be
*
* @deprecated For removal, the abstraction is not useful.
*/
@Deprecated
public abstract class AbstractJavaHandler extends AbstractLanguageVersionHandler {

private final LanguageMetricsProvider<ASTAnyTypeDeclaration, MethodLikeNode> myMetricsProvider = new JavaMetricsProvider();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@
*
* @see AbstractParser
* @see JavaParser
*
* @deprecated For removal, the abstraction is not useful.
*/
@Deprecated
public abstract class AbstractJavaParser extends AbstractParser {
private JavaParser parser;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,18 @@

import java.util.List;

import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.lang.DataFlowHandler;
import net.sourceforge.pmd.lang.ast.Node;
import net.sourceforge.pmd.lang.dfa.DataFlowNode;
import net.sourceforge.pmd.lang.java.ast.ASTLabeledStatement;
import net.sourceforge.pmd.lang.java.dfa.JavaDataFlowNode;

/**
* @deprecated Is internal API.
*/
@InternalApi
@Deprecated
public class JavaDataFlowHandler implements DataFlowHandler {
@Override
public DataFlowNode createDataFlowNode(List<DataFlowNode> dataFlow, Node node) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,16 @@

package net.sourceforge.pmd.lang.java;

import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.lang.LanguageVersion;
import net.sourceforge.pmd.lang.Parser;
import net.sourceforge.pmd.lang.ParserOptions;

/**
* @deprecated This is internal API, use {@link LanguageVersion#getLanguageVersionHandler()}.
*/
@Deprecated
@InternalApi
public class JavaLanguageHandler extends AbstractJavaHandler {
private final int jdkVersion;
private final boolean preview;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

import java.io.Reader;

import net.sourceforge.pmd.annotation.InternalApi;
import net.sourceforge.pmd.lang.LanguageVersionHandler;
import net.sourceforge.pmd.lang.ParserOptions;
import net.sourceforge.pmd.lang.java.ast.JavaParser;
import net.sourceforge.pmd.lang.java.ast.ParseException;
Expand All @@ -15,7 +17,11 @@
*
* @author Pieter_Van_Raemdonck - Application Engineers NV/SA - www.ae.be
* @author Andreas Dangel
*
* @deprecated This is internal API, use {@link LanguageVersionHandler#getParser(ParserOptions)}.
*/
@InternalApi
@Deprecated
public class JavaLanguageParser extends AbstractJavaParser {
private final int jdkVersion;
private final boolean preview;
Expand Down

0 comments on commit 3833d8c

Please sign in to comment.