sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject svn commit: r1734486 - in /sis/branches/JDK7: ./ core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/ core/sis-utility/src/main/java/org/apache/sis/internal/system/ core/sis-utility/src/main/java/org/apache/sis/util/logging/ src/main/c...
Date Thu, 10 Mar 2016 23:48:42 GMT
Author: desruisseaux
Date: Thu Mar 10 23:48:41 2016
New Revision: 1734486

URL: http://svn.apache.org/viewvc?rev=1734486&view=rev
Log:
Merge from the JDK8 branch.

Added:
    sis/branches/JDK7/src/main/config/
      - copied from r1734484, sis/branches/JDK8/src/main/config/
Modified:
    sis/branches/JDK7/   (props changed)
    sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
    sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
    sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java
    sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java
    sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java

Propchange: sis/branches/JDK7/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Mar 10 23:48:41 2016
@@ -1,4 +1,4 @@
 /sis/branches/Android:1430670-1480699
 /sis/branches/JDK6:1394913-1508480
-/sis/branches/JDK8:1584960-1734395
+/sis/branches/JDK8:1584960-1734484
 /sis/trunk:1394364-1508466,1519089-1519674

Modified: sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java?rev=1734486&r1=1734485&r2=1734486&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-metadata/src/main/java/org/apache/sis/internal/metadata/sql/Initializer.java
[UTF-8] Thu Mar 10 23:48:41 2016
@@ -22,6 +22,8 @@ import java.net.URLClassLoader;
 import java.util.ServiceLoader;
 import java.util.logging.Level;
 import java.util.logging.LogRecord;
+import java.security.AccessController;
+import java.security.PrivilegedAction;
 import java.lang.reflect.Method;
 import javax.sql.DataSource;
 import java.sql.Connection;
@@ -242,7 +244,11 @@ public abstract class Initializer {
              * As a fallback, try to open the Derby database located in $SIS_DATA/Databases/SpatialMetadata
directory.
              */
             final boolean create;
-            final String home = System.getProperty(DERBY_HOME_KEY);
+            final String home = AccessController.doPrivileged(new PrivilegedAction<String>()
{
+                @Override public String run() {
+                    return System.getProperty(DERBY_HOME_KEY);
+                }
+            });
             final Path dir = DataDirectory.DATABASES.getDirectory();
             if (dir != null) {
                 Path path = dir.resolve(DATABASE);
@@ -310,7 +316,11 @@ public abstract class Initializer {
      */
     public static boolean hasJNDI() {
         return NamingManager.hasInitialContextFactoryBuilder() ||
-               System.getProperty(Context.INITIAL_CONTEXT_FACTORY) != null;
+                AccessController.doPrivileged(new PrivilegedAction<Boolean>() {
+                    @Override public Boolean run() {
+                        return System.getProperty(Context.INITIAL_CONTEXT_FACTORY) != null;
+                    }
+                });
     }
 
     /**

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java?rev=1734486&r1=1734485&r2=1734486&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/internal/system/Supervisor.java
[UTF-8] Thu Mar 10 23:48:41 2016
@@ -70,7 +70,7 @@ public final class Supervisor extends St
      * The JMX object name, created when the {@link #register()} is first invoked.
      * {@link ObjectName#WILDCARD} is used as a sentinel value if the registration failed.
      */
-    private static ObjectName name;
+    private static volatile ObjectName name;
 
     /**
      * Registers the {@code Supervisor} instance, if not already done.
@@ -84,19 +84,23 @@ public final class Supervisor extends St
     public static synchronized void register() {
         if (name == null) {
             name = ObjectName.WILDCARD;                         // In case of failure.
+            LogRecord record;
             try {
                 final MBeanServer server = ManagementFactory.getPlatformMBeanServer();
                 final ObjectName n = new ObjectName(NAME);
                 server.registerMBean(new Supervisor(), n);
-                name = n; // Store only on success.
+                name = n;                                    // Store only on success.
+                return;
             } catch (InstanceAlreadyExistsException e) {
-                final LogRecord record = Messages.getResources(null)
-                        .getLogRecord(Level.CONFIG, Messages.Keys.AlreadyRegistered_2, "MBean",
NAME);
-                record.setLoggerName(Loggers.SYSTEM);
-                Logging.log(Supervisor.class, "register", record);
-            } catch (SecurityException | JMException e) {
-                Logging.unexpectedException(Logging.getLogger(Loggers.SYSTEM), Supervisor.class,
"register", e);
+                record = Messages.getResources(null).getLogRecord(Level.CONFIG, Messages.Keys.AlreadyRegistered_2,
"MBean", NAME);
+            } catch (JMException e) {
+                record = new LogRecord(Level.WARNING, e.toString());
+                record.setThrown(e);
+            } catch (SecurityException e) {
+                record = new LogRecord(Level.CONFIG, e.toString());
             }
+            record.setLoggerName(Loggers.SYSTEM);
+            Logging.log(Supervisor.class, "register", record);
         }
     }
 

Modified: sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java?rev=1734486&r1=1734485&r2=1734486&view=diff
==============================================================================
--- sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
[UTF-8] (original)
+++ sis/branches/JDK7/core/sis-utility/src/main/java/org/apache/sis/util/logging/Logging.java
[UTF-8] Thu Mar 10 23:48:41 2016
@@ -376,7 +376,7 @@ public final class Logging extends Stati
          * than the locale on the client side.
          */
         final StringBuilder buffer = new StringBuilder(256).append(Classes.getShortClassName(error));
-        String message = error.getMessage(); // Targeted to system administrators.
+        String message = error.getMessage();                    // Targeted to system administrators.
         if (message != null) {
             buffer.append(": ").append(message);
         }

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java?rev=1734486&r1=1734485&r2=1734486&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/HyperRectangleReader.java
[UTF-8] Thu Mar 10 23:48:41 2016
@@ -29,6 +29,7 @@ import org.apache.sis.storage.DataStoreE
  * The data can be stored in an existing array, or a new array can be created.
  * This class does not handle compression; it is rather designed for efficient reading of
uncompressed data.
  *
+ * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
  * @version 0.7

Modified: sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java?rev=1734486&r1=1734485&r2=1734486&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/Region.java
[UTF-8] Thu Mar 10 23:48:41 2016
@@ -30,6 +30,7 @@ import org.apache.sis.internal.jdk8.JDK8
  * <p>This class assumes that the values are stored in a sequence (array or uncompressed
file)
  * where index at dimension 0 varies fastest, followed by index at dimension 1, <i>etc</i>.</p>
  *
+ * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
  * @version 0.7

Modified: sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java
URL: http://svn.apache.org/viewvc/sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java?rev=1734486&r1=1734485&r2=1734486&view=diff
==============================================================================
--- sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java
[UTF-8] (original)
+++ sis/branches/JDK7/storage/sis-storage/src/test/java/org/apache/sis/internal/storage/HyperRectangleReaderTest.java
[UTF-8] Thu Mar 10 23:48:41 2016
@@ -36,6 +36,7 @@ import static org.junit.Assert.*;
 /**
  * Tests {@link HyperRectangleReader}.
  *
+ * @author  Johann Sorel (Geomatys)
  * @author  Martin Desruisseaux (Geomatys)
  * @since   0.7
  * @version 0.7



Mime
View raw message