This is an automated email from the ASF dual-hosted git repository.

sunlan pushed a commit to branch GROOVY_3_0_X
in repository https://gitbox.apache.org/repos/asf/groovy.git

commit 185121bbe3bf96a5408aa2bff373e891a2d8bc2d
Author: Daniel.Sun <[email protected]>
AuthorDate: Fri Dec 13 08:19:44 2019 +0800

    Remove deprecated methods of `GroovyClassLoader`
    
    (cherry picked from commit feef283ff89cf68698f6b6a96117e1c29ae659cf)
---
 src/main/java/groovy/lang/GroovyClassLoader.java | 28 ------------------------
 1 file changed, 28 deletions(-)

diff --git a/src/main/java/groovy/lang/GroovyClassLoader.java 
b/src/main/java/groovy/lang/GroovyClassLoader.java
index abc6da0..27e7038 100644
--- a/src/main/java/groovy/lang/GroovyClassLoader.java
+++ b/src/main/java/groovy/lang/GroovyClassLoader.java
@@ -288,28 +288,6 @@ public class GroovyClassLoader extends URLClassLoader {
         return parseClass(gcs);
     }
 
-    /**
-     * @deprecated Prefer using methods taking a Reader rather than an 
InputStream to avoid wrong encoding issues.
-     * Use {@link #parseClass(Reader, String) parseClass} instead
-     */
-    @Deprecated
-    public Class parseClass(final InputStream in, final String fileName) 
throws CompilationFailedException {
-        // For generic input streams, provide a catch-all codebase of 
GroovyScript
-        // Security for these classes can be administered via policy grants 
with
-        // a codebase of file:groovy.script
-        GroovyCodeSource gcs = 
AccessController.doPrivileged((PrivilegedAction<GroovyCodeSource>) () -> {
-            try {
-                String scriptText = config.getSourceEncoding() != null ?
-                        IOGroovyMethods.getText(in, 
config.getSourceEncoding()) :
-                        IOGroovyMethods.getText(in);
-                return new GroovyCodeSource(scriptText, fileName, 
"/groovy/script");
-            } catch (IOException e) {
-                throw new RuntimeException("Impossible to read the content of 
the input stream for file named: " + fileName, e);
-            }
-        });
-        return parseClass(gcs);
-    }
-
     public Class parseClass(GroovyCodeSource codeSource) throws 
CompilationFailedException {
         return parseClass(codeSource, codeSource.isCachable());
     }
@@ -572,12 +550,6 @@ public class GroovyClassLoader extends URLClassLoader {
         }
 
         @Override
-        @Deprecated
-        public Class parseClass(InputStream in, String fileName) throws 
CompilationFailedException {
-            return delegate.parseClass(in, fileName);
-        }
-
-        @Override
         public Class parseClass(GroovyCodeSource codeSource) throws 
CompilationFailedException {
             return delegate.parseClass(codeSource);
         }

Reply via email to