You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2011/04/15 14:23:34 UTC

svn commit: r1092679 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/ java/org/apache/commons/runtime/platform/unix/ java/org/apache/commons/runtime/platform/windows/ native/shared/

Author: mturk
Date: Fri Apr 15 12:23:34 2011
New Revision: 1092679

URL: http://svn.apache.org/viewvc?rev=1092679&view=rev
Log:
Axe extra exception class

Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexImpl.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/FcntlMutex.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutex.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutexImpl.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/SysVMutex.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutexImpl.java
    commons/sandbox/runtime/trunk/src/main/native/shared/error.c

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexImpl.java?rev=1092679&r1=1092678&r2=1092679&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexImpl.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexImpl.java Fri Apr 15 12:23:34 2011
@@ -17,7 +17,6 @@ package org.apache.commons.runtime;
 
 import org.apache.commons.runtime.exception.AlreadyExistsException;
 import org.apache.commons.runtime.exception.NoSuchObjectException;
-import org.apache.commons.runtime.exception.NotImplementedException;
 import org.apache.commons.runtime.exception.SystemException;
 
 /**
@@ -39,14 +38,14 @@ public abstract class MutexImpl
         throws IllegalAccessException,
                IllegalArgumentException,
                AlreadyExistsException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException;
 
     public abstract Mutex open(MutexType type, String name)
         throws IllegalAccessException,
                IllegalArgumentException,
                NoSuchObjectException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException;
 
 }

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java?rev=1092679&r1=1092678&r2=1092679&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/Semaphore.java Fri Apr 15 12:23:34 2011
@@ -16,7 +16,6 @@
 package org.apache.commons.runtime;
 
 import org.apache.commons.runtime.exception.SystemException;
-import org.apache.commons.runtime.exception.NotImplementedException;
 
 /**
  * Semaphore class.
@@ -45,10 +44,10 @@ public abstract class Semaphore
     protected boolean owner;
 
     public static final SemaphoreImpl getImpl()
-        throws NotImplementedException
+        throws UnsupportedOperationException
     {
         if (impl == null)
-            throw new NotImplementedException(Local.sm.get("semaphore.ENOTIMPL"));
+            throw new UnsupportedOperationException(Local.sm.get("semaphore.ENOTIMPL"));
         return impl;
     }
 

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/FcntlMutex.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/FcntlMutex.java?rev=1092679&r1=1092678&r2=1092679&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/FcntlMutex.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/FcntlMutex.java Fri Apr 15 12:23:34 2011
@@ -19,7 +19,6 @@ import org.apache.commons.runtime.Mutex;
 import org.apache.commons.runtime.Status;
 import org.apache.commons.runtime.exception.AlreadyExistsException;
 import org.apache.commons.runtime.exception.NoSuchObjectException;
-import org.apache.commons.runtime.exception.NotImplementedException;
 import org.apache.commons.runtime.exception.ClosedDescriptorException;
 import org.apache.commons.runtime.exception.SystemException;
 
@@ -42,7 +41,7 @@ final class FcntlMutex extends Mutex
         throws IllegalAccessException,
                IllegalArgumentException,
                AlreadyExistsException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException
     {
         this.owner = true;

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutex.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutex.java?rev=1092679&r1=1092678&r2=1092679&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutex.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutex.java Fri Apr 15 12:23:34 2011
@@ -18,9 +18,6 @@ package org.apache.commons.runtime.platf
 import org.apache.commons.runtime.Mutex;
 import org.apache.commons.runtime.Status;
 import org.apache.commons.runtime.exception.AlreadyExistsException;
-import org.apache.commons.runtime.exception.NoSuchObjectException;
-import org.apache.commons.runtime.exception.NotImplementedException;
-import org.apache.commons.runtime.exception.ClosedDescriptorException;
 import org.apache.commons.runtime.exception.SystemException;
 
 /**
@@ -42,7 +39,7 @@ final class PosixMutex extends Mutex
         throws IllegalAccessException,
                IllegalArgumentException,
                AlreadyExistsException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException
     {
         this.owner = true;

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutexImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutexImpl.java?rev=1092679&r1=1092678&r2=1092679&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutexImpl.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/PosixMutexImpl.java Fri Apr 15 12:23:34 2011
@@ -20,7 +20,6 @@ import org.apache.commons.runtime.MutexI
 import org.apache.commons.runtime.MutexType;
 import org.apache.commons.runtime.exception.AlreadyExistsException;
 import org.apache.commons.runtime.exception.NoSuchObjectException;
-import org.apache.commons.runtime.exception.NotImplementedException;
 import org.apache.commons.runtime.exception.SystemException;
 
 /**
@@ -49,7 +48,7 @@ final class PosixMutexImpl extends Mutex
         throws IllegalAccessException,
                IllegalArgumentException,
                AlreadyExistsException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException
     {
         if (type == MutexType.DEFAULT)
@@ -62,14 +61,14 @@ final class PosixMutexImpl extends Mutex
             case FCNTL:
                 return new FcntlMutex(name, true);
         }
-        throw new NotImplementedException();        
+        throw new UnsupportedOperationException();        
     }
 
     public Mutex open(MutexType type, String name)
         throws IllegalAccessException,
                IllegalArgumentException,
                NoSuchObjectException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException
     {
         if (type == MutexType.DEFAULT)
@@ -82,7 +81,7 @@ final class PosixMutexImpl extends Mutex
             case FCNTL:
                 return new FcntlMutex(name, false);
         }
-        throw new NotImplementedException();        
+        throw new UnsupportedOperationException();        
     }
 
 }

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/SysVMutex.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/SysVMutex.java?rev=1092679&r1=1092678&r2=1092679&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/SysVMutex.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/unix/SysVMutex.java Fri Apr 15 12:23:34 2011
@@ -18,9 +18,6 @@ package org.apache.commons.runtime.platf
 import org.apache.commons.runtime.Mutex;
 import org.apache.commons.runtime.Status;
 import org.apache.commons.runtime.exception.AlreadyExistsException;
-import org.apache.commons.runtime.exception.NoSuchObjectException;
-import org.apache.commons.runtime.exception.NotImplementedException;
-import org.apache.commons.runtime.exception.ClosedDescriptorException;
 import org.apache.commons.runtime.exception.SystemException;
 
 /**
@@ -42,7 +39,7 @@ final class SysVMutex extends Mutex
         throws IllegalAccessException,
                IllegalArgumentException,
                AlreadyExistsException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException
     {
         this.owner = true;

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutexImpl.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutexImpl.java?rev=1092679&r1=1092678&r2=1092679&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutexImpl.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/platform/windows/WindowsMutexImpl.java Fri Apr 15 12:23:34 2011
@@ -20,7 +20,6 @@ import org.apache.commons.runtime.MutexI
 import org.apache.commons.runtime.MutexType;
 import org.apache.commons.runtime.exception.AlreadyExistsException;
 import org.apache.commons.runtime.exception.NoSuchObjectException;
-import org.apache.commons.runtime.exception.NotImplementedException;
 import org.apache.commons.runtime.exception.SystemException;
 
 /**
@@ -42,28 +41,28 @@ final class WindowsMutexImpl extends Mut
         throws IllegalAccessException,
                IllegalArgumentException,
                AlreadyExistsException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException
     {
         switch (type) {
             case DEFAULT:
                 return new WindowsMutex(name, true);
         }
-        throw new NotImplementedException();        
+        throw new UnsupportedOperationException();        
     }
 
     public Mutex open(MutexType type, String name)
         throws IllegalAccessException,
                IllegalArgumentException,
                NoSuchObjectException,
-               NotImplementedException,
+               UnsupportedOperationException,
                SystemException
     {
         switch (type) {
             case DEFAULT:
                 return new WindowsMutex(name, false);
         }
-        throw new NotImplementedException();        
+        throw new UnsupportedOperationException();        
     }
 
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/error.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/error.c?rev=1092679&r1=1092678&r2=1092679&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/error.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/error.c Fri Apr 15 12:23:34 2011
@@ -29,7 +29,7 @@
 static struct {
     jclass      clazz;
     const char *name;
-} _throw_classes[] = {
+} _throw_classes[ACR_EX_LEN] = {
     { 0, "java/lang/Exception"                                  },
     { 0, "java/lang/RuntimeException"                           },
     { 0, "java/lang/OutOfMemoryError"                           },
@@ -54,8 +54,7 @@ static struct {
     { 0, ACR_EXCEPTION_CP "NoSuchObjectException"               },
     { 0, ACR_EXCEPTION_CP "SystemException"                     },
     { 0, ACR_EXCEPTION_CP "TimeoutException"                    },
-    { 0, ACR_EXCEPTION_CP "UnsupportedOperatingSystemException" },
-    { 0, 0                                                      }
+    { 0, ACR_EXCEPTION_CP "UnsupportedOperatingSystemException" }
 };
 
 static const char *const _canon_errors[] = {