From cbdd94da58ff7c9897f6a4453dde52697b0da711 Mon Sep 17 00:00:00 2001 From: dgelessus <dgelessus@users.noreply.github.com> Date: Tue, 10 May 2022 18:06:33 +0200 Subject: [PATCH] Expand docs for deprecated methods to silence Javadoc warnings --- .../sablecc/sablecc/analysis/Analysis.java | 8 ++++++++ .../sablecc/analysis/AnalysisAdapter.java | 12 ----------- .../org/sablecc/sablecc/parser/Parser.java | 2 ++ .../org/sablecc/sablecc/analyses.txt | 20 ++++++++----------- .../resources/org/sablecc/sablecc/parser.txt | 2 ++ 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/src/main/java/org/sablecc/sablecc/analysis/Analysis.java b/src/main/java/org/sablecc/sablecc/analysis/Analysis.java index bd6623f..999e37a 100644 --- a/src/main/java/org/sablecc/sablecc/analysis/Analysis.java +++ b/src/main/java/org/sablecc/sablecc/analysis/Analysis.java @@ -7,24 +7,32 @@ import org.sablecc.sablecc.node.*; public interface Analysis extends Switch { /** + * @param node the node for which to look up the associated object + * @return the corresponding object previously associated using {@link #setIn(Node, Object)}, or {@code null} if there is none * @deprecated If you need a map field, declare it yourself. */ @Deprecated Object getIn(Node node); /** + * @param node the node with which to associate the given object + * @param o the object to associate with the node * @deprecated If you need a map field, declare it yourself. */ @Deprecated void setIn(Node node, Object o); /** + * @param node the node for which to look up the associated object + * @return the corresponding object previously associated using {@link #setOut(Node, Object)}, or {@code null} if there is none * @deprecated If you need a map field, declare it yourself. */ @Deprecated Object getOut(Node node); /** + * @param node the node with which to associate the given object + * @param o the object to associate with the node * @deprecated If you need a map field, declare it yourself. */ @Deprecated diff --git a/src/main/java/org/sablecc/sablecc/analysis/AnalysisAdapter.java b/src/main/java/org/sablecc/sablecc/analysis/AnalysisAdapter.java index 9a756d9..c07b260 100644 --- a/src/main/java/org/sablecc/sablecc/analysis/AnalysisAdapter.java +++ b/src/main/java/org/sablecc/sablecc/analysis/AnalysisAdapter.java @@ -19,9 +19,6 @@ public class AnalysisAdapter implements Analysis @Deprecated private Hashtable<Node,Object> out; - /** - * @deprecated If you need a map field, declare it yourself. - */ @Deprecated @Override public Object getIn(Node node) @@ -34,9 +31,6 @@ public class AnalysisAdapter implements Analysis return this.in.get(node); } - /** - * @deprecated If you need a map field, declare it yourself. - */ @Deprecated @Override public void setIn(Node node, Object o) @@ -56,9 +50,6 @@ public class AnalysisAdapter implements Analysis } } - /** - * @deprecated If you need a map field, declare it yourself. - */ @Deprecated @Override public Object getOut(Node node) @@ -71,9 +62,6 @@ public class AnalysisAdapter implements Analysis return this.out.get(node); } - /** - * @deprecated If you need a map field, declare it yourself. - */ @Deprecated @Override public void setOut(Node node, Object o) diff --git a/src/main/java/org/sablecc/sablecc/parser/Parser.java b/src/main/java/org/sablecc/sablecc/parser/Parser.java index aadf743..c9535df 100644 --- a/src/main/java/org/sablecc/sablecc/parser/Parser.java +++ b/src/main/java/org/sablecc/sablecc/parser/Parser.java @@ -146,6 +146,8 @@ public class Parser implements IParser } /** + * @param productionRuleAsString internal name of the production rule in question + * @return {@code false} if creation of a new list should be skipped, {@code true} for default behavior * @deprecated Overriding this method no longer has any effect. This optimization is now applied automatically iff it is safe. */ @Deprecated diff --git a/src/main/resources/org/sablecc/sablecc/analyses.txt b/src/main/resources/org/sablecc/sablecc/analyses.txt index f7c37c0..4a31607 100644 --- a/src/main/resources/org/sablecc/sablecc/analyses.txt +++ b/src/main/resources/org/sablecc/sablecc/analyses.txt @@ -15,24 +15,32 @@ import $1$.*; public interface Analysis extends Switch { /** + * @param node the node for which to look up the associated object + * @return the corresponding object previously associated using {@link #setIn(Node, Object)}, or {@code null} if there is none * @deprecated If you need a map field, declare it yourself. */ @Deprecated Object getIn(Node node); /** + * @param node the node with which to associate the given object + * @param o the object to associate with the node * @deprecated If you need a map field, declare it yourself. */ @Deprecated void setIn(Node node, Object o); /** + * @param node the node for which to look up the associated object + * @return the corresponding object previously associated using {@link #setOut(Node, Object)}, or {@code null} if there is none * @deprecated If you need a map field, declare it yourself. */ @Deprecated Object getOut(Node node); /** + * @param node the node with which to associate the given object + * @param o the object to associate with the node * @deprecated If you need a map field, declare it yourself. */ @Deprecated @@ -78,9 +86,6 @@ public class AnalysisAdapter implements Analysis @Deprecated private Hashtable<Node,Object> out; - /** - * @deprecated If you need a map field, declare it yourself. - */ @Deprecated @Override public Object getIn(Node node) @@ -93,9 +98,6 @@ public class AnalysisAdapter implements Analysis return this.in.get(node); } - /** - * @deprecated If you need a map field, declare it yourself. - */ @Deprecated @Override public void setIn(Node node, Object o) @@ -115,9 +117,6 @@ public class AnalysisAdapter implements Analysis } } - /** - * @deprecated If you need a map field, declare it yourself. - */ @Deprecated @Override public Object getOut(Node node) @@ -130,9 +129,6 @@ public class AnalysisAdapter implements Analysis return this.out.get(node); } - /** - * @deprecated If you need a map field, declare it yourself. - */ @Deprecated @Override public void setOut(Node node, Object o) diff --git a/src/main/resources/org/sablecc/sablecc/parser.txt b/src/main/resources/org/sablecc/sablecc/parser.txt index d6d876b..e24642d 100644 --- a/src/main/resources/org/sablecc/sablecc/parser.txt +++ b/src/main/resources/org/sablecc/sablecc/parser.txt @@ -154,6 +154,8 @@ public class Parser implements IParser } /** + * @param productionRuleAsString internal name of the production rule in question + * @return {@code false} if creation of a new list should be skipped, {@code true} for default behavior * @deprecated Overriding this method no longer has any effect. This optimization is now applied automatically iff it is safe. */ @Deprecated -- GitLab