You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@groovy.apache.org by pa...@apache.org on 2019/09/26 10:39:48 UTC
[groovy] branch master updated: remove deprecated classes
This is an automated email from the ASF dual-hosted git repository.
paulk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/groovy.git
The following commit(s) were added to refs/heads/master by this push:
new 24fe1f4 remove deprecated classes
24fe1f4 is described below
commit 24fe1f4597908cef07072d6f18a94fe369567338
Author: Paul King <pa...@asert.com.au>
AuthorDate: Thu Sep 26 20:39:35 2019 +1000
remove deprecated classes
---
.../org/codehaus/groovy/ast/tools/Antlr2Utils.java | 41 -----------
.../codehaus/groovy/ast/tools/ClassNodeUtils.java | 79 ----------------------
2 files changed, 120 deletions(-)
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/Antlr2Utils.java b/src/main/java/org/codehaus/groovy/ast/tools/Antlr2Utils.java
deleted file mode 100644
index 922d4ee..0000000
--- a/src/main/java/org/codehaus/groovy/ast/tools/Antlr2Utils.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.codehaus.groovy.ast.tools;
-
-import antlr.RecognitionException;
-import antlr.TokenStreamException;
-import groovy.lang.GroovyRuntimeException;
-import org.codehaus.groovy.antlr.AntlrParserPlugin;
-import org.codehaus.groovy.antlr.parser.GroovyLexer;
-import org.codehaus.groovy.antlr.parser.GroovyRecognizer;
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.ModuleNode;
-import org.codehaus.groovy.control.SourceUnit;
-import org.codehaus.groovy.syntax.ParserException;
-import org.codehaus.groovy.syntax.Reduction;
-
-import java.io.StringReader;
-import java.util.concurrent.atomic.AtomicReference;
-
-public class Antlr2Utils {
- private Antlr2Utils() {
- }
-
- public static ClassNode parse(String option) {
- GroovyLexer lexer = new GroovyLexer(new StringReader("DummyNode<" + option + ">"));
- try {
- final GroovyRecognizer rn = GroovyRecognizer.make(lexer);
- rn.classOrInterfaceType(true);
- final AtomicReference<ClassNode> ref = new AtomicReference<ClassNode>();
- AntlrParserPlugin plugin = new AntlrParserPlugin() {
- @Override
- public ModuleNode buildAST(final SourceUnit sourceUnit, final ClassLoader classLoader, final Reduction cst) throws ParserException {
- ref.set(makeTypeWithArguments(rn.getAST()));
- return null;
- }
- };
- plugin.buildAST(null, null, null);
- return ref.get();
- } catch (RecognitionException | TokenStreamException | ParserException e) {
- throw new GroovyRuntimeException("Unable to parse '" + option + "'", e);
- }
- }
-}
diff --git a/src/main/java/org/codehaus/groovy/ast/tools/ClassNodeUtils.java b/src/main/java/org/codehaus/groovy/ast/tools/ClassNodeUtils.java
deleted file mode 100644
index 75f0720..0000000
--- a/src/main/java/org/codehaus/groovy/ast/tools/ClassNodeUtils.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.codehaus.groovy.ast.tools;
-
-import org.codehaus.groovy.ast.ClassNode;
-import org.codehaus.groovy.ast.MethodNode;
-import org.codehaus.groovy.ast.PropertyNode;
-import org.codehaus.groovy.ast.expr.Expression;
-
-import java.util.Map;
-
-@Deprecated
-public class ClassNodeUtils {
- @Deprecated
- public static void addInterfaceMethods(ClassNode cNode, Map<String, MethodNode> methodsMap) {
- org.apache.groovy.ast.tools.ClassNodeUtils.addDeclaredMethodsFromInterfaces(cNode, methodsMap);
- }
-
- @Deprecated
- public static Map<String, MethodNode> getDeclaredMethodMapsFromInterfaces(ClassNode cNode) {
- return org.apache.groovy.ast.tools.ClassNodeUtils.getDeclaredMethodsFromInterfaces(cNode);
- }
-
- @Deprecated
- public static void addDeclaredMethodMapsFromSuperInterfaces(ClassNode cNode, Map<String, MethodNode> methodsMap) {
- org.apache.groovy.ast.tools.ClassNodeUtils.addDeclaredMethodsFromAllInterfaces(cNode, methodsMap);
- }
-
- @Deprecated
- public static boolean hasPossibleStaticMethod(ClassNode cNode, String name, Expression arguments, boolean trySpread) {
- return org.apache.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticMethod(cNode, name, arguments, trySpread);
- }
-
- @Deprecated
- public static boolean hasPossibleStaticProperty(ClassNode cNode, String methodName) {
- return org.apache.groovy.ast.tools.ClassNodeUtils.hasPossibleStaticProperty(cNode, methodName);
- }
-
- @Deprecated
- public static String getPropNameForAccessor(String accessorName) {
- return org.apache.groovy.ast.tools.ClassNodeUtils.getPropNameForAccessor(accessorName);
- }
-
- @Deprecated
- public static boolean isValidAccessorName(String accessorName) {
- return org.apache.groovy.ast.tools.ClassNodeUtils.isValidAccessorName(accessorName);
- }
-
- @Deprecated
- public static boolean hasStaticProperty(ClassNode cNode, String propName) {
- return org.apache.groovy.ast.tools.ClassNodeUtils.hasStaticProperty(cNode, propName);
- }
-
- @Deprecated
- public static PropertyNode getStaticProperty(ClassNode cNode, String propName) {
- return org.apache.groovy.ast.tools.ClassNodeUtils.getStaticProperty(cNode, propName);
- }
-
- @Deprecated
- public static boolean isInnerClass(ClassNode cNode) {
- return org.apache.groovy.ast.tools.ClassNodeUtils.isInnerClass(cNode);
- }
-}