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/05/06 12:38:20 UTC

svn commit: r1100164 - in /commons/sandbox/runtime/trunk/src/main: java/org/apache/commons/runtime/ java/org/apache/commons/runtime/net/ test/org/apache/commons/runtime/

Author: mturk
Date: Fri May  6 10:38:19 2011
New Revision: 1100164

URL: http://svn.apache.org/viewvc?rev=1100164&view=rev
Log:
Re-arange exceptions (once more). Might not be the end of that story :)

Removed:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/ServiceNotFoundException.java
Modified:
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AccessDeniedException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AlreadyExistsException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidArgumentException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidRangeException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexType.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NameTooLongException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NoSuchObjectException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotImplementedException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotPermittedException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/TimeoutException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/UnsupportedOperatingSystemException.java
    commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Service.java
    commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestMemory.java

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AccessDeniedException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AccessDeniedException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AccessDeniedException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AccessDeniedException.java Fri May  6 10:38:19 2011
@@ -24,7 +24,7 @@ package org.apache.commons.runtime;
  * @since Runtime 1.0
  */
 
-public class AccessDeniedException extends SystemException
+public class AccessDeniedException extends SecurityException
 {
 
     public AccessDeniedException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AlreadyExistsException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AlreadyExistsException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AlreadyExistsException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/AlreadyExistsException.java Fri May  6 10:38:19 2011
@@ -24,7 +24,7 @@ package org.apache.commons.runtime;
  * @since Runtime 1.0
  */
 
-public class AlreadyExistsException extends SystemException
+public class AlreadyExistsException extends RuntimeException
 {
 
     public AlreadyExistsException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/ConstPointer.java Fri May  6 10:38:19 2011
@@ -50,7 +50,7 @@ final class ConstPointer extends Pointer
     public final void free()
         throws Throwable
     {
-        throw new UnsupportedOperationException();
+        throw new OperationNotPermittedException();
     }
 
 }

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidArgumentException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidArgumentException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidArgumentException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidArgumentException.java Fri May  6 10:38:19 2011
@@ -24,7 +24,7 @@ import java.io.IOException;
  *
  * @since Runtime 1.0
  */
-public class InvalidArgumentException extends SystemException
+public class InvalidArgumentException extends RuntimeException
 {
 
     public InvalidArgumentException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidRangeException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidRangeException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidRangeException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/InvalidRangeException.java Fri May  6 10:38:19 2011
@@ -23,7 +23,7 @@ import java.io.IOException;
  *
  * @since Runtime 1.0
  */
-public class InvalidRangeException extends SystemException
+public class InvalidRangeException extends RuntimeException
 {
 
     public InvalidRangeException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexType.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexType.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexType.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/MutexType.java Fri May  6 10:38:19 2011
@@ -43,13 +43,13 @@ public enum MutexType
     }
 
     public static MutexType valueOf(int value)
-        throws IllegalArgumentException
+        throws InvalidArgumentException
     {
         for (MutexType e : values()) {
             if (e.value == value)
                 return e;
         }
-        throw new IllegalArgumentException(Local.sm.get("mutextype.EINVAL", value));
+        throw new InvalidArgumentException(Local.sm.get("mutextype.EINVAL", value));
     }
 
 }

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NameTooLongException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NameTooLongException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NameTooLongException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NameTooLongException.java Fri May  6 10:38:19 2011
@@ -23,7 +23,7 @@ import java.io.IOException;
  *
  * @since Runtime 1.0
  */
-public class NameTooLongException extends SystemException
+public class NameTooLongException extends InvalidArgumentException
 {
 
     public NameTooLongException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NoSuchObjectException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NoSuchObjectException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NoSuchObjectException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/NoSuchObjectException.java Fri May  6 10:38:19 2011
@@ -24,7 +24,7 @@ package org.apache.commons.runtime;
  * @since Runtime 1.0
  */
 
-public class NoSuchObjectException extends SystemException
+public class NoSuchObjectException extends RuntimeException
 {
 
     public NoSuchObjectException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotImplementedException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotImplementedException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotImplementedException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotImplementedException.java Fri May  6 10:38:19 2011
@@ -23,7 +23,7 @@ package org.apache.commons.runtime;
  *
  */
 
-public class OperationNotImplementedException extends SystemException
+public class OperationNotImplementedException extends RuntimeException
 {
 
     public OperationNotImplementedException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotPermittedException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotPermittedException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotPermittedException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/OperationNotPermittedException.java Fri May  6 10:38:19 2011
@@ -24,7 +24,7 @@ package org.apache.commons.runtime;
  * @since Runtime 1.0
  */
 
-public class OperationNotPermittedException extends SystemException
+public class OperationNotPermittedException extends SecurityException
 {
 
     public OperationNotPermittedException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/TimeoutException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/TimeoutException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/TimeoutException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/TimeoutException.java Fri May  6 10:38:19 2011
@@ -16,6 +16,7 @@
 
 package org.apache.commons.runtime;
 
+import java.io.IOException;
 /**
  * Exception thrown when a blocking operation times out.  Blocking
  * operations for which a timeout is specified need a means to
@@ -27,7 +28,7 @@ package org.apache.commons.runtime;
  *
  * @since Runtime 1.0
  */
-public class TimeoutException extends SystemException
+public class TimeoutException extends IOException
 {
 
     public TimeoutException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/UnsupportedOperatingSystemException.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/UnsupportedOperatingSystemException.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/UnsupportedOperatingSystemException.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/UnsupportedOperatingSystemException.java Fri May  6 10:38:19 2011
@@ -22,7 +22,7 @@ package org.apache.commons.runtime;
  *
  */
 
-public class UnsupportedOperatingSystemException extends SystemException
+public class UnsupportedOperatingSystemException extends UnsupportedOperationException
 {
 
     public UnsupportedOperatingSystemException()

Modified: commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Service.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Service.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Service.java (original)
+++ commons/sandbox/runtime/trunk/src/main/java/org/apache/commons/runtime/net/Service.java Fri May  6 10:38:19 2011
@@ -16,6 +16,7 @@
 
 package org.apache.commons.runtime.net;
 
+import java.net.UnknownServiceException;
 import java.util.List;
 import java.util.ArrayList;
 import org.apache.commons.runtime.InvalidArgumentException;
@@ -56,18 +57,18 @@ public final class Service
      *
      * @throws NullPointerException
      *          if the argument {@code name} is {@code null}.
-     * @throws ServiceNotFoundException
+     * @throws UnknownServiceException
      *          if the service is unknown.
      */
     public Service(String name)
         throws NullPointerException,
-               ServiceNotFoundException
+               UnknownServiceException
     {
         if (name == null)
             throw new NullPointerException();
         int rc = getservbyname(name, null);
         if (rc != 0)
-            throw new ServiceNotFoundException(Status.describe(rc));
+            throw new UnknownServiceException(Status.describe(rc));
     }
 
     /**
@@ -78,19 +79,19 @@ public final class Service
      *
      * @throws NullPointerException
      *          if the argument {@code name} is {@code null}.
-     * @throws ServiceNotFoundException
+     * @throws UnknownServiceException
      *          if the service is unknown or does not exsit for the
      *          specified {@code protocol}.
      */
     public Service(String name, String protocol)
         throws NullPointerException,
-               ServiceNotFoundException
+               UnknownServiceException
     {
         if (name == null || protocol == null)
             throw new NullPointerException();
         int rc = getservbyname(name, protocol);
         if (rc != 0)
-            throw new ServiceNotFoundException(Status.describe(rc));
+            throw new UnknownServiceException(Status.describe(rc));
     }
 
     /**
@@ -100,18 +101,18 @@ public final class Service
      *
      * @throws InvalidArgumentException
      *          if the argument {@code port} is invalid.
-     * @throws ServiceNotFoundException
+     * @throws UnknownServiceException
      *          if the service is unknown.
      */
     public Service(int port)
         throws InvalidArgumentException,
-               ServiceNotFoundException
+               UnknownServiceException
     {
         if (port < 0 || port > 65535)
             throw new InvalidArgumentException();
         int rc = getservbyport((char)port, null);
         if (rc != 0)
-            throw new ServiceNotFoundException(Status.describe(rc));
+            throw new UnknownServiceException(Status.describe(rc));
     }
 
     /**
@@ -122,14 +123,14 @@ public final class Service
      *
      * @throws InvalidArgumentException
      *          if the argument {@code port} is invalid.
-     * @throws ServiceNotFoundException
+     * @throws UnknownServiceException
      *          if the service is unknown or does not exsit for the
      *          specified {@code protocol}.
      */
     public Service(int port, String protocol)
         throws NullPointerException,
                InvalidArgumentException,
-               ServiceNotFoundException
+               UnknownServiceException
     {
         if (protocol == null)
             throw new NullPointerException();
@@ -137,7 +138,7 @@ public final class Service
             throw new InvalidArgumentException();
         int rc = getservbyport((char)port, protocol);
         if (rc != 0)
-            throw new ServiceNotFoundException(Status.describe(rc));
+            throw new UnknownServiceException(Status.describe(rc));
     }
 
     /**

Modified: commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestMemory.java
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestMemory.java?rev=1100164&r1=1100163&r2=1100164&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestMemory.java (original)
+++ commons/sandbox/runtime/trunk/src/main/test/org/apache/commons/runtime/TestMemory.java Fri May  6 10:38:19 2011
@@ -60,7 +60,7 @@ public class TestMemory extends Assert
         p.free();
     }
 
-    @Test(groups = { "private" }, expectedExceptions={ UnsupportedOperationException.class })
+    @Test(groups = { "private" }, expectedExceptions={ OperationNotPermittedException.class })
     public void freeConstPointer()
         throws Throwable
     {