commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r890377 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/platform/windows/ native/os/win32/
Date Mon, 14 Dec 2009 15:43:33 GMT
Author: mturk
Date: Mon Dec 14 15:43:32 2009
New Revision: 890377

URL: http://svn.apache.org/viewvc?rev=890377&view=rev
Log:
Use less cryptic class names

Added:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKey.java
      - copied, changed from r890275, commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKeyAccessRights.java
      - copied, changed from r889932, commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java
Removed:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java
Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/win32/registry.c

Copied: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKey.java
(from r890275, commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKey.java?p2=commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKey.java&p1=commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java&r1=890275&r2=890377&rev=890377&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/HKEY.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKey.java
Mon Dec 14 15:43:32 2009
@@ -31,7 +31,7 @@
  * keys.
  * </p>
  */
-public class HKEY implements Closeable
+public class RegistryKey implements Closeable
 {
 
     /** Registry entries subordinate to this key define types (or classes)
@@ -48,7 +48,7 @@
      * This handle should not be used in a service or an application that
      * impersonates different users.
      */
-    public static final HKEY CLASSES_ROOT       = new HKEY(0x80000000L);
+    public static final RegistryKey CLASSES_ROOT       = new RegistryKey(0x80000000L);
 
     /** Registry entries subordinate to this key define the preferences of
      * the current user. These preferences include the settings of
@@ -57,7 +57,7 @@
      * easier to establish the current user's settings; the key maps to the
      * current user's branch in {@code HKEY_USERS}.
      */
-    public static final HKEY CURRENT_USER       = new HKEY(0x80000001L);
+    public static final RegistryKey CURRENT_USER       = new RegistryKey(0x80000001L);
 
     /** Registry entries subordinate to this key define the physical state
      * of the computer, including data about the bus type, system memory,
@@ -68,20 +68,20 @@
      * security information, software-related information (such as server
      * names and the location of the server), and other system information.
      */
-    public static final HKEY LOCAL_MACHINE      = new HKEY(0x80000002L);
+    public static final RegistryKey LOCAL_MACHINE      = new RegistryKey(0x80000002L);
 
     /** Registry entries subordinate to this key define the default user
      * configuration for new users on the local computer and the user
      * configuration for the current user.
      */
-    public static final HKEY USERS              = new HKEY(0x80000003L);
+    public static final RegistryKey USERS              = new RegistryKey(0x80000003L);
 
     /** Registry entries subordinate to this key allow you to access
      * performance data. The data is not actually stored in the registry;
      * the registry functions cause the system to collect the data from
      * its source.
      */
-    public static final HKEY PERFORMANCE_DATA   = new HKEY(0x80000004L);
+    public static final RegistryKey PERFORMANCE_DATA   = new RegistryKey(0x80000004L);
 
     /** Contains information about the current hardware profile of the
      * local computer system.
@@ -93,10 +93,10 @@
      * and System keys of {@code HKEY_LOCAL_MACHINE}.
      * </p>
      */
-    public static final HKEY CURRENT_CONFIG     = new HKEY(0x80000005L);
+    public static final RegistryKey CURRENT_CONFIG     = new RegistryKey(0x80000005L);
 
     private long hKey;
-    private HKEY(long v)
+    private RegistryKey(long v)
     {
         hKey = v;
     }

Copied: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKeyAccessRights.java
(from r889932, commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java)
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKeyAccessRights.java?p2=commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKeyAccessRights.java&p1=commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java&r1=889932&r2=890377&rev=890377&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/KeyAccessRights.java
(original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/RegistryKeyAccessRights.java
Mon Dec 14 15:43:32 2009
@@ -21,7 +21,7 @@
 /**
  * Registry Key Access Rights.
  */
-public enum KeyAccessRights
+public enum RegistryKeyAccessRights
 {
 
     /**
@@ -43,7 +43,7 @@
     WRITE(              0x0800);
 
     private int value;
-    private KeyAccessRights(int v)
+    private RegistryKeyAccessRights(int v)
     {
         value = v;
     }
@@ -59,11 +59,11 @@
      * @param set The {@code EnumSet} which values to get.
      * @return sum of {@code KeyAccessRights} values
      */
-    public static int bitmapOf(EnumSet<KeyAccessRights> set)
+    public static int bitmapOf(EnumSet<RegistryKeyAccessRights> set)
     {
         int bitmap = 0;
         if (set != null) {
-            for (KeyAccessRights a : set)
+            for (RegistryKeyAccessRights a : set)
                 bitmap += a.valueOf();
         }
         return bitmap;
@@ -75,11 +75,11 @@
      * @param set arguments of {@code KeyAccessRights} which values to get.
      * @return sum of {@code KeyAccessRights} values
      */
-    public static int bitmapOf(KeyAccessRights... set)
+    public static int bitmapOf(RegistryKeyAccessRights... set)
     {
         int bitmap = 0;
         if (set != null) {
-            for (KeyAccessRights a : set)
+            for (RegistryKeyAccessRights a : set)
                 bitmap += a.valueOf();
         }
         return bitmap;
@@ -92,21 +92,21 @@
      * with {@code KeyAccessRights} values mathching the value flags.
      * @return set of {@code KeyAccessRights} enums.
      */
-    public static EnumSet<KeyAccessRights> valueOf(int value)
+    public static EnumSet<RegistryKeyAccessRights> valueOf(int value)
     {
-        EnumSet<KeyAccessRights> set = EnumSet.noneOf(KeyAccessRights.class);
-        for (KeyAccessRights e : values()) {
+        EnumSet<RegistryKeyAccessRights> set = EnumSet.noneOf(RegistryKeyAccessRights.class);
+        for (RegistryKeyAccessRights e : values()) {
             if ((e.value & value) == e.value)
                 set.add(e);
         }
         return set;
     }
 
-    public static EnumSet<KeyAccessRights> of(KeyAccessRights... of)
+    public static EnumSet<RegistryKeyAccessRights> of(RegistryKeyAccessRights... of)
     {
-        EnumSet<KeyAccessRights> set = EnumSet.noneOf(KeyAccessRights.class);
+        EnumSet<RegistryKeyAccessRights> set = EnumSet.noneOf(RegistryKeyAccessRights.class);
         if (of != null) {
-            for (KeyAccessRights a : of)
+            for (RegistryKeyAccessRights a : of)
                 set.add(a);
         }
         return set;

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/registry.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/registry.c?rev=890377&r1=890376&r2=890377&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/registry.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/registry.c Mon Dec 14 15:43:32
2009
@@ -399,8 +399,8 @@
     return i;
 }
 
-ACR_JNI_PLATFORM_DECLARE(jint, HKEY, close0)(ACR_JNISTDARGS,
-                                             jlong key)
+ACR_JNI_PLATFORM_DECLARE(jint, RegistryKey, close0)(ACR_JNISTDARGS,
+                                                    jlong key)
 {
     int rc    = ACR_EBADF;
     HKEY hkey = J2P(key, HKEY);



Mime
View raw message