cassandra-pr mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snazy <...@git.apache.org>
Subject [GitHub] cassandra pull request #236: 9608 trunk
Date Mon, 02 Jul 2018 09:45:44 GMT
Github user snazy commented on a diff in the pull request:

    https://github.com/apache/cassandra/pull/236#discussion_r199440779
  
    --- Diff: src/java/org/apache/cassandra/cql3/functions/JavaBasedUDFunction.java ---
    @@ -591,14 +612,48 @@ private NameEnvironmentAnswer findType(String className)
     
                 String resourceName = className.replace('.', '/') + ".class";
     
    -            try (InputStream is = UDFunction.udfClassLoader.getResourceAsStream(resourceName))
    +            // up to Java 8:
    +            //      returns a non-null InputStream for class files
    +            // since Java 11:
    +            //      returns a non-null InputStream for class files for application classes
    +            //      returns null for class files for system modules (e.g. java.base)
    +            try
                 {
    -                if (is != null)
    +                InputStream is = UDFunction.udfClassLoader.getResourceAsStream(resourceName);
    +                try
    +                {
    +                    if (is == null)
    +                    {
    +                        // For Java 11 try to see whether the class actually exists and
read the
    +                        // class file data via the class' module. (This is necessary
at least
    +                        // for 9-ea build 123)
    --- End diff --
    
    Hm - seems that was actually a bug in Java and it's been fixed.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org


Mime
View raw message