geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject [geode] branch whitelist_wip updated: whitelist WIP
Date Thu, 09 Nov 2017 18:31:06 GMT
This is an automated email from the ASF dual-hosted git repository.

bschuchardt pushed a commit to branch whitelist_wip
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/whitelist_wip by this push:
     new f6b3b3c  whitelist WIP
f6b3b3c is described below

commit f6b3b3c0f400aebc9e923138f18e056ead6b679f
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
AuthorDate: Thu Nov 9 10:26:43 2017 -0800

    whitelist WIP
    
    corrected code loading sanctionedSerializables.  Added some whitelisted
    packages including javax and antlr.
---
 .../geode/internal/CQDistributedSystemService.java | 40 -------------
 .../cache/query/internal/parse/GemFireAST.java     |  7 ++-
 .../internal/InternalDistributedSystem.java        |  3 +-
 .../geode/internal/InternalDataSerializer.java     | 53 +++++++++++-------
 .../apache/geode/internal/cache/BucketAdvisor.java |  2 +-
 .../geode/internal/cache/EventStateHelper.java     |  3 +-
 .../AnalyzeSerializablesJUnitTest.java             | 65 ++++++++++++----------
 .../org/apache/geode/codeAnalysis/openBugs.txt     | 39 -------------
 .../geode/internal/CQDistributedSystemService.java |  6 +-
 .../internal/WANDistributedSystemService.java      |  9 +--
 10 files changed, 88 insertions(+), 139 deletions(-)

diff --git a/geode-core/src/jpfTest/java/org/apache/geode/internal/CQDistributedSystemService.java
b/geode-core/src/jpfTest/java/org/apache/geode/internal/CQDistributedSystemService.java
deleted file mode 100644
index a5972c9..0000000
--- a/geode-core/src/jpfTest/java/org/apache/geode/internal/CQDistributedSystemService.java
+++ /dev/null
@@ -1,40 +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.apache.geode.internal;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-
-import org.apache.geode.distributed.internal.DistributedSystemService;
-import org.apache.geode.distributed.internal.InternalDistributedSystem;
-
-public class CQDistributedSystemService implements DistributedSystemService {
-  @Override
-  public void init(InternalDistributedSystem internalDistributedSystem) {
-
-  }
-
-  @Override
-  public Class getInterface() {
-    return getClass();
-  }
-
-  @Override
-  public Collection<String> getSerializationWhitelist() throws IOException {
-    File sanctionedSerializables = new File(getClass().getResource("sanctionedSerializables.txt").getFile());
-    return InternalDataSerializer.loadClassNames(sanctionedSerializables);
-  }
-}
diff --git a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/GemFireAST.java
b/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/GemFireAST.java
index a373693..18ce94a 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/GemFireAST.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/query/internal/parse/GemFireAST.java
@@ -15,10 +15,13 @@
 
 package org.apache.geode.cache.query.internal.parse;
 
-import antlr.*;
+import antlr.CommonAST;
+import antlr.Token;
+
+import org.apache.geode.cache.query.internal.QCompiler;
+
 // import antlr.collections.*;
 // import org.apache.geode.cache.query.*;
-import org.apache.geode.cache.query.internal.QCompiler;
 
 /**
  *
diff --git a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
index d645d50..b6653e8 100644
--- a/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
+++ b/geode-core/src/main/java/org/apache/geode/distributed/internal/InternalDistributedSystem.java
@@ -610,7 +610,8 @@ public class InternalDistributedSystem extends DistributedSystem
    * mechanism.
    */
   private void initializeServices() {
-    ServiceLoader<DistributedSystemService> loader = ServiceLoader.load(DistributedSystemService.class);
+    ServiceLoader<DistributedSystemService> loader =
+        ServiceLoader.load(DistributedSystemService.class);
     for (DistributedSystemService service : loader) {
       service.init(this);
       services.put(service.getInterface(), service);
diff --git a/geode-core/src/main/java/org/apache/geode/internal/InternalDataSerializer.java
b/geode-core/src/main/java/org/apache/geode/internal/InternalDataSerializer.java
index 1c67cc6..2ef1ebb 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/InternalDataSerializer.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/InternalDataSerializer.java
@@ -81,6 +81,7 @@ import java.io.File;
 import java.io.FileReader;
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.io.NotSerializableException;
 import java.io.ObjectInput;
 import java.io.ObjectInputStream;
@@ -98,6 +99,7 @@ import java.lang.reflect.Proxy;
 import java.math.BigDecimal;
 import java.math.BigInteger;
 import java.net.InetAddress;
+import java.net.URL;
 import java.sql.Timestamp;
 import java.util.ArrayList;
 import java.util.Collection;
@@ -142,7 +144,8 @@ public abstract class InternalDataSerializer extends DataSerializer implements
D
   /**
    * A deserialization filter for ObjectInputStreams
    */
-  private static ObjectInputFilter serializationFilter = ObjectInputFilter.Config.createFilter("**");
+  private static ObjectInputFilter serializationFilter =
+      ObjectInputFilter.Config.createFilter("**");
 
   private static final String serializationVersionTxt =
       System.getProperty(DistributionConfig.GEMFIRE_PREFIX + "serializationVersion");
@@ -198,15 +201,16 @@ public abstract class InternalDataSerializer extends DataSerializer
implements D
   }
 
   /**
-   * Initializes the optional serialization "white list" if the user has requested it in
-   * the DistributionConfig
+   * Initializes the optional serialization "white list" if the user has requested it in
the
+   * DistributionConfig
    *
    * @param distributionConfig the DistributedSystem configuration
    * @param services DistributedSystem services that might have classes to white-list
    */
-  public static void initialize(DistributionConfig distributionConfig, Collection<DistributedSystemService>
services) {
+  public static void initialize(DistributionConfig distributionConfig,
+      Collection<DistributedSystemService> services) {
     String serializationFilterSpec; // get from configuration
-    serializationFilterSpec = "java.**;!*";
+    serializationFilterSpec = "java.**;javax.management.**;javax.print.attribute.EnumSyntax;antlr.**;!*";
     if (serializationFilterSpec != null) {
       if (!ClassUtils.isClassAvailable("sun.misc.ObjectInputFilter")) {
         throw new GemFireConfigException(
@@ -217,10 +221,11 @@ public abstract class InternalDataSerializer extends DataSerializer
implements D
   }
 
 
-  private static void createSerializationFilter(String serializationFilterSpec, Collection<DistributedSystemService>
services) {
+  private static void createSerializationFilter(String serializationFilterSpec,
+      Collection<DistributedSystemService> services) {
 
     Set<String> sanctionedClasses = new HashSet<>(500);
-    for (DistributedSystemService service: services) {
+    for (DistributedSystemService service : services) {
       try {
         sanctionedClasses.addAll(service.getSerializationWhitelist());
       } catch (IOException e) {
@@ -228,16 +233,19 @@ public abstract class InternalDataSerializer extends DataSerializer
implements D
       }
     }
     try {
-      File sanctionedSerializables = new File(InternalDataSerializer.class.getResource("sanctionedSerializables.txt").getFile());
+      URL sanctionedSerializables = ClassPathLoader.getLatest()
+          .getResource(InternalDataSerializer.class, "sanctionedSerializables.txt");
       Collection<String> coreClassNames = loadClassNames(sanctionedSerializables);
       sanctionedClasses.addAll(coreClassNames);
     } catch (IOException e) {
-      throw new InternalGemFireException("unable to read sanctionedSerializables.txt to form
a serialization white-list", e);
+      throw new InternalGemFireException(
+          "unable to read sanctionedSerializables.txt to form a serialization white-list",
e);
     }
 
     logger.debug("setting a serialization filter containing {}", serializationFilterSpec);
 
-    final ObjectInputFilter userFilter = ObjectInputFilter.Config.createFilter(serializationFilterSpec);
+    final ObjectInputFilter userFilter =
+        ObjectInputFilter.Config.createFilter(serializationFilterSpec);
     serializationFilter = filterInfo -> {
       if (filterInfo.serialClass() == null) {
         return userFilter.checkInput(filterInfo);
@@ -247,28 +255,32 @@ public abstract class InternalDataSerializer extends DataSerializer
implements D
       if (filterInfo.serialClass().isArray()) {
         className = filterInfo.serialClass().getComponentType().getName();
       }
-      logger.debug("checking whether {} can be deserialized", className);
       if (sanctionedClasses.contains(className)) {
         return ObjectInputFilter.Status.ALLOWED;
-//        return ObjectInputFilter.Status.UNDECIDED;
+        // return ObjectInputFilter.Status.UNDECIDED;
       } else {
         ObjectInputFilter.Status status = userFilter.checkInput(filterInfo);
+        if (status == ObjectInputFilter.Status.REJECTED) {
+          logger.warn("Serialization filter is rejecting class {}", className);
+        }
         return status;
       }
     };
 
     // global filter - if we enable this it will affect all ObjectInputStreams
-//    ObjectInputFilter.Config.setSerialFilter(serializationFilter);
+    // ObjectInputFilter.Config.setSerialFilter(serializationFilter);
   }
 
   /**
-   * Loads the class names from sanctionedSerializables.txt, a file that is also
-   * maintained for backward-compatibility testing with AnalyzeSerializablesJUnitTest
+   * Loads the class names from sanctionedSerializables.txt, a file that is also maintained
for
+   * backward-compatibility testing with AnalyzeSerializablesJUnitTest
    */
-  public static Collection<String> loadClassNames(File sanctionedSerializables) throws
IOException {
+  public static Collection<String> loadClassNames(URL sanctionedSerializables) throws
IOException {
     Collection<String> result = new ArrayList(1000);
-    try (FileReader fr = new FileReader(sanctionedSerializables);
-         BufferedReader in = new BufferedReader(fr)) {
+    InputStream inputStream = sanctionedSerializables.openStream();
+    InputStreamReader reader = new InputStreamReader(inputStream);
+    BufferedReader in = new BufferedReader(reader);
+    try {
       String line;
       while ((line = in.readLine()) != null) {
         line = line.trim();
@@ -279,6 +291,8 @@ public abstract class InternalDataSerializer extends DataSerializer implements
D
           result.add(line.substring(0, line.indexOf(',')));
         }
       }
+    } finally {
+      inputStream.close();
     }
     return result;
 
@@ -2936,7 +2950,8 @@ public abstract class InternalDataSerializer extends DataSerializer
implements D
           }
 
           ObjectInput ois = new DSObjectInputStream(stream);
-          ObjectInputFilter.Config.setObjectInputFilter((ObjectInputStream)ois, serializationFilter);
+          ObjectInputFilter.Config.setObjectInputFilter((ObjectInputStream) ois,
+              serializationFilter);
           if (stream instanceof VersionedDataStream) {
             Version v = ((VersionedDataStream) stream).getVersion();
             if (v != null && v != Version.CURRENT) {
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
index d5ff7cb..5285e2c 100755
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/BucketAdvisor.java
@@ -659,7 +659,7 @@ public class BucketAdvisor extends CacheDistributionAdvisor {
     @SuppressWarnings("unchecked")
     private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException
{
       stream.defaultReadObject();
-      backingSet = m==null? Collections.<E>emptySet() : m.keySet();
+      backingSet = m == null ? Collections.<E>emptySet() : m.keySet();
     }
   }
 
diff --git a/geode-core/src/main/java/org/apache/geode/internal/cache/EventStateHelper.java
b/geode-core/src/main/java/org/apache/geode/internal/cache/EventStateHelper.java
index 636777d..9f3fc22 100644
--- a/geode-core/src/main/java/org/apache/geode/internal/cache/EventStateHelper.java
+++ b/geode-core/src/main/java/org/apache/geode/internal/cache/EventStateHelper.java
@@ -50,7 +50,8 @@ public class EventStateHelper {
    * {@link RegionStateMessage#toData(DataOutput)} <br>
    */
   @SuppressWarnings("synthetic-access")
-  public static void dataSerialize(DataOutput dop, Map eventState, boolean isHARegion) throws
IOException {
+  public static void dataSerialize(DataOutput dop, Map eventState, boolean isHARegion)
+      throws IOException {
     // For HARegionQueues, the event state map is uses different values
     // than a regular region :(
     InternalDistributedMember myId =
diff --git a/geode-core/src/test/java/org/apache/geode/codeAnalysis/AnalyzeSerializablesJUnitTest.java
b/geode-core/src/test/java/org/apache/geode/codeAnalysis/AnalyzeSerializablesJUnitTest.java
index d6a661b..0ea8c69 100644
--- a/geode-core/src/test/java/org/apache/geode/codeAnalysis/AnalyzeSerializablesJUnitTest.java
+++ b/geode-core/src/test/java/org/apache/geode/codeAnalysis/AnalyzeSerializablesJUnitTest.java
@@ -111,7 +111,8 @@ public class AnalyzeSerializablesJUnitTest {
   }
 
   public void loadExpectedSerializables() throws Exception {
-    this.expectedSerializablesFile = getResourceAsFile(InternalDataSerializer.class, "sanctionedSerializables.txt");
+    this.expectedSerializablesFile =
+        getResourceAsFile(InternalDataSerializer.class, "sanctionedSerializables.txt");
     assertThat(this.expectedSerializablesFile).exists().canRead();
 
     this.expectedSerializables = loadClassesAndVariables(this.expectedSerializablesFile);
@@ -191,21 +192,24 @@ public class AnalyzeSerializablesJUnitTest {
   public void excludedClassesExistAndDoNotDeserialize() throws Exception {
     List<String> excludedClasses = loadExcludedClasses(getResourceAsFile(EXCLUDED_CLASSES_TXT));
     DistributionConfig distributionConfig = new DistributionConfigImpl(new Properties());
-    InternalDataSerializer.initialize(distributionConfig, new ArrayList<DistributedSystemService>());
+    InternalDataSerializer.initialize(distributionConfig,
+        new ArrayList<DistributedSystemService>());
 
-    for (String filePath: excludedClasses) {
+    for (String filePath : excludedClasses) {
       String className = filePath.replaceAll("/", ".");
       System.out.println("testing class " + className);
 
       Class excludedClass = Class.forName(className);
-      assertTrue(excludedClass.getName() + " is not Serializable and should be removed from
excludedClasses.txt",
+      assertTrue(
+          excludedClass.getName()
+              + " is not Serializable and should be removed from excludedClasses.txt",
           Serializable.class.isAssignableFrom(excludedClass));
 
       if (excludedClass.isEnum()) {
         // geode enums are special cased by DataSerializer and are never java-serialized
-//        for (Object instance: excludedClass.getEnumConstants()) {
-//          serializeAndDeserializeObject(instance);
-//        }
+        // for (Object instance: excludedClass.getEnumConstants()) {
+        // serializeAndDeserializeObject(instance);
+        // }
       } else {
         final Object excludedInstance;
         try {
@@ -231,10 +235,8 @@ public class AnalyzeSerializablesJUnitTest {
       System.out.println("Not Serializable: " + object.getClass().getName());
     }
     try {
-      Object
-          instance =
-          DataSerializer.readObject(
-              new DataInputStream(new ByteArrayInputStream(outputStream.toByteArray())));
+      Object instance = DataSerializer
+          .readObject(new DataInputStream(new ByteArrayInputStream(outputStream.toByteArray())));
       fail("I was able to deserialize " + object.getClass().getName());
     } catch (InvalidClassException e) {
       // expected
@@ -248,7 +250,8 @@ public class AnalyzeSerializablesJUnitTest {
 
 
     DistributionConfig distributionConfig = new DistributionConfigImpl(new Properties());
-    InternalDataSerializer.initialize(distributionConfig, new ArrayList<DistributedSystemService>());
+    InternalDataSerializer.initialize(distributionConfig,
+        new ArrayList<DistributedSystemService>());
 
     for (ClassAndVariableDetails details : expectedSerializables) {
       if (openBugs.contains(details.className)) {
@@ -259,7 +262,9 @@ public class AnalyzeSerializablesJUnitTest {
       System.out.println("testing class " + details.className);
 
       Class sanctionedClass = Class.forName(className);
-      assertTrue(sanctionedClass.getName() + " is not Serializable and should be removed
from sanctionedSerializables.txt",
+      assertTrue(
+          sanctionedClass.getName()
+              + " is not Serializable and should be removed from sanctionedSerializables.txt",
           Serializable.class.isAssignableFrom(sanctionedClass));
 
       if (Modifier.isAbstract(sanctionedClass.getModifiers())) {
@@ -267,7 +272,8 @@ public class AnalyzeSerializablesJUnitTest {
         continue;
       }
 
-      if (sanctionedClass.getEnclosingClass() != null && sanctionedClass.getEnclosingClass().isEnum())
{
+      if (sanctionedClass.getEnclosingClass() != null
+          && sanctionedClass.getEnclosingClass().isEnum()) {
         // inner enum class - enum constants are handled when we process their enclosing
class
         continue;
       }
@@ -282,18 +288,17 @@ public class AnalyzeSerializablesJUnitTest {
 
       Object sanctionedInstance = null;
       if (!Serializable.class.isAssignableFrom(sanctionedClass)) {
-        throw new AssertionError(className + " is not serializable.  Remove it from sanctionedSerializables.txt");
+        throw new AssertionError(
+            className + " is not serializable.  Remove it from sanctionedSerializables.txt");
       }
       try {
         boolean isThrowable = Throwable.class.isAssignableFrom(sanctionedClass);
 
-        Constructor constructor = isThrowable ?
-            sanctionedClass.getDeclaredConstructor(String.class) :
-            sanctionedClass.getDeclaredConstructor(null);
+        Constructor constructor = isThrowable ? sanctionedClass.getDeclaredConstructor(String.class)
+            : sanctionedClass.getDeclaredConstructor(null);
         constructor.setAccessible(true);
-        sanctionedInstance = isThrowable ?
-            constructor.newInstance("test throwable") :
-            constructor.newInstance();
+        sanctionedInstance =
+            isThrowable ? constructor.newInstance("test throwable") : constructor.newInstance();
         serializeAndDeserializeSanctionedObject(sanctionedInstance);
         continue;
       } catch (NoSuchMethodException | InstantiationException | IllegalAccessException e)
{
@@ -314,9 +319,8 @@ public class AnalyzeSerializablesJUnitTest {
           }
           constructor = superClass.getDeclaredConstructor((Class<?>[]) null);
           constructor.setAccessible(true);
-          constructor =
-              ReflectionFactory.getReflectionFactory()
-                  .newConstructorForSerialization(sanctionedClass, constructor);
+          constructor = ReflectionFactory.getReflectionFactory()
+              .newConstructorForSerialization(sanctionedClass, constructor);
         }
         sanctionedInstance = constructor.newInstance();
       } catch (Exception e2) {
@@ -338,7 +342,9 @@ public class AnalyzeSerializablesJUnitTest {
     }
 
     for (String openBugClass : openBugs) {
-      assertTrue("open bug class: " + openBugClass + " is not present in sanctionedSerializables.txt",
expectedSerializableClasses.contains(openBugClass));
+      assertTrue(
+          "open bug class: " + openBugClass + " is not present in sanctionedSerializables.txt",
+          expectedSerializableClasses.contains(openBugClass));
     }
   }
 
@@ -354,7 +360,8 @@ public class AnalyzeSerializablesJUnitTest {
     List<String> excludedClasses = loadExcludedClasses(getResourceAsFile(EXCLUDED_CLASSES_TXT));
 
     for (String excludedClass : excludedClasses) {
-      assertFalse("Excluded class: " + excludedClass + " was found in sanctionedSerializables.txt",
expectedSerializableClasses.contains(excludedClass));
+      assertFalse("Excluded class: " + excludedClass + " was found in sanctionedSerializables.txt",
+          expectedSerializableClasses.contains(excludedClass));
     }
   }
 
@@ -368,10 +375,8 @@ public class AnalyzeSerializablesJUnitTest {
       throw new AssertionError("Not Serializable: " + object.getClass().getName(), e);
     }
     try {
-      Object
-          instance =
-          DataSerializer.readObject(
-              new DataInputStream(new ByteArrayInputStream(outputStream.toByteArray())));
+      Object instance = DataSerializer
+          .readObject(new DataInputStream(new ByteArrayInputStream(outputStream.toByteArray())));
     } catch (CancelException e) {
       // PDX classes fish for a PDXRegistry and find that there is no cache
     } catch (InvalidClassException e) {
diff --git a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/openBugs.txt b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/openBugs.txt
index a885e47..07f2e1e 100644
--- a/geode-core/src/test/resources/org/apache/geode/codeAnalysis/openBugs.txt
+++ b/geode-core/src/test/resources/org/apache/geode/codeAnalysis/openBugs.txt
@@ -28,10 +28,6 @@
 ????,org/apache/geode/admin/jmx/internal/DynamicManagedBean
 ????,org/apache/geode/admin/jmx/internal/StatisticAttributeInfo
 
-# extends javax.print.attribute.EnumSyntax.  Can it be turned into a regular enum?
-????,org/apache/geode/cache/EvictionAction
-????,org/apache/geode/cache/EvictionAlgorithm
-
 # has an incestuous subclass that should be merged into the superclass.
 # see InterestResultPolicyImpl
 ????,org/apache/geode/cache/InterestResultPolicy
@@ -43,41 +39,6 @@
 # query class that does custom serialization and throws an NPE in the test
 ????,org/apache/geode/cache/query/internal/ObjectIntHashMap
 
-# query classes that extend an ANTLR class (ANTLR would have to be whitelisted)
-????,org/apache/geode/cache/query/internal/parse/ASTAggregateFunc
-????,org/apache/geode/cache/query/internal/parse/ASTAnd
-????,org/apache/geode/cache/query/internal/parse/ASTCombination
-????,org/apache/geode/cache/query/internal/parse/ASTCompareOp
-????,org/apache/geode/cache/query/internal/parse/ASTConstruction
-????,org/apache/geode/cache/query/internal/parse/ASTConversionExpr
-????,org/apache/geode/cache/query/internal/parse/ASTDummy
-????,org/apache/geode/cache/query/internal/parse/ASTGroupBy
-????,org/apache/geode/cache/query/internal/parse/ASTHint
-????,org/apache/geode/cache/query/internal/parse/ASTHintIdentifier
-????,org/apache/geode/cache/query/internal/parse/ASTIdentifier
-????,org/apache/geode/cache/query/internal/parse/ASTImport
-????,org/apache/geode/cache/query/internal/parse/ASTIn
-????,org/apache/geode/cache/query/internal/parse/ASTIteratorDef
-????,org/apache/geode/cache/query/internal/parse/ASTLike
-????,org/apache/geode/cache/query/internal/parse/ASTLimit
-????,org/apache/geode/cache/query/internal/parse/ASTLiteral
-????,org/apache/geode/cache/query/internal/parse/ASTMethodInvocation
-????,org/apache/geode/cache/query/internal/parse/ASTOr
-????,org/apache/geode/cache/query/internal/parse/ASTOrderBy
-????,org/apache/geode/cache/query/internal/parse/ASTParameter
-????,org/apache/geode/cache/query/internal/parse/ASTPostfix
-????,org/apache/geode/cache/query/internal/parse/ASTProjection
-????,org/apache/geode/cache/query/internal/parse/ASTRegionPath
-????,org/apache/geode/cache/query/internal/parse/ASTSelect
-????,org/apache/geode/cache/query/internal/parse/ASTSortCriterion
-????,org/apache/geode/cache/query/internal/parse/ASTTrace
-????,org/apache/geode/cache/query/internal/parse/ASTType
-????,org/apache/geode/cache/query/internal/parse/ASTTypeCast
-????,org/apache/geode/cache/query/internal/parse/ASTUnary
-????,org/apache/geode/cache/query/internal/parse/ASTUndefinedExpr
-????,org/apache/geode/cache/query/internal/parse/ASTUnsupported
-????,org/apache/geode/cache/query/internal/parse/GemFireAST
-
 # This needs a bug report.  This class serializes a DistributionConfigImpl but we
 # have that class in excludedClasses.txt and aren't monitoring it.
 ????,org/apache/geode/distributed/internal/DistributionConfigSnapshot
diff --git a/geode-cq/src/main/java/org/apache/geode/internal/CQDistributedSystemService.java
b/geode-cq/src/main/java/org/apache/geode/internal/CQDistributedSystemService.java
index df3a5df..576af3b 100644
--- a/geode-cq/src/main/java/org/apache/geode/internal/CQDistributedSystemService.java
+++ b/geode-cq/src/main/java/org/apache/geode/internal/CQDistributedSystemService.java
@@ -16,6 +16,7 @@ package org.apache.geode.internal;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.URL;
 import java.util.Collection;
 
 import org.apache.geode.distributed.internal.DistributedSystemService;
@@ -34,7 +35,8 @@ public class CQDistributedSystemService implements DistributedSystemService
{
 
   @Override
   public Collection<String> getSerializationWhitelist() throws IOException {
-    return InternalDataSerializer.loadClassNames(new File(getClass()
-        .getResource("sanctionedSerializables.txt").getFile()));
+    URL sanctionedSerializables =
+        ClassPathLoader.getLatest().getResource(getClass(), "sanctionedSerializables.txt");
+    return InternalDataSerializer.loadClassNames(sanctionedSerializables);
   }
 }
diff --git a/geode-wan/src/main/java/org/apache/geode/internal/WANDistributedSystemService.java
b/geode-wan/src/main/java/org/apache/geode/internal/WANDistributedSystemService.java
index 677074c..9e59c9e 100644
--- a/geode-wan/src/main/java/org/apache/geode/internal/WANDistributedSystemService.java
+++ b/geode-wan/src/main/java/org/apache/geode/internal/WANDistributedSystemService.java
@@ -16,13 +16,13 @@ package org.apache.geode.internal;
 
 import java.io.File;
 import java.io.IOException;
+import java.net.URL;
 import java.util.Collection;
 
 import org.apache.geode.distributed.internal.DistributedSystemService;
 import org.apache.geode.distributed.internal.InternalDistributedSystem;
 
-public class WANDistributedSystemService implements DistributedSystemService
-{
+public class WANDistributedSystemService implements DistributedSystemService {
   @Override
   public void init(InternalDistributedSystem internalDistributedSystem) {
 
@@ -35,7 +35,8 @@ public class WANDistributedSystemService implements DistributedSystemService
 
   @Override
   public Collection<String> getSerializationWhitelist() throws IOException {
-    return InternalDataSerializer.loadClassNames(new File(getClass()
-        .getResource("sanctionedSerializables.txt").getFile()));
+    URL sanctionedSerializables =
+        ClassPathLoader.getLatest().getResource(getClass(), "sanctionedSerializables.txt");
+    return InternalDataSerializer.loadClassNames(sanctionedSerializables);
   }
 }

-- 
To stop receiving notification emails like this one, please contact
['"commits@geode.apache.org" <commits@geode.apache.org>'].

Mime
View raw message