You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-commits@db.apache.org by dj...@apache.org on 2005/05/27 18:46:24 UTC

svn commit: r178795 - /incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor /incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor

Author: djd
Date: Fri May 27 09:46:23 2005
New Revision: 178795

URL: http://svn.apache.org/viewcvs?rev=178795&view=rev
Log:
Fix Derby-19 - Handle IOException on invalid service name,
e.g. device not ready on path to CD-ROM.

Modified:
    incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/PersistentService.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/PersistentServiceImpl.java
    incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/PersistentService.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/PersistentService.java?rev=178795&r1=178794&r2=178795&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/PersistentService.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/iapi/services/monitor/PersistentService.java Fri May 27 09:46:23 2005
@@ -159,8 +159,11 @@
 	/**
 		Convert a service name into its canonical form. Returns null if the name
 		cannot be converted into a canonical form.
+		
+		@exception No canonical name, name probably invalid
 	*/
-	public String getCanonicalServiceName(String name);
+	public String getCanonicalServiceName(String name)
+		throws StandardException;
 
 	/**
 		Return the user form of a service name. This name is only valid within

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/PersistentServiceImpl.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/PersistentServiceImpl.java?rev=178795&r1=178794&r2=178795&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/PersistentServiceImpl.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/PersistentServiceImpl.java Fri May 27 09:46:23 2005
@@ -736,6 +736,7 @@
 	} // end of removeServiceRoot
 
 	public String getCanonicalServiceName(String name)
+		throws StandardException
     {
 		String protocolLeadIn = getType() + ":";
         int colon = name.indexOf( ':');
@@ -769,15 +770,8 @@
         }
 		catch (PrivilegedActionException pae)
         {
-            if( SanityManager.DEBUG)
-            {
-                Exception ex = pae.getException();
-                SanityManager.THROWASSERT( ex.getClass().getName()
-                                           + " thrown while getting the canonical name: "
-                                           + ex.getMessage());
-            }
-            return null;
-        }
+			throw Monitor.exceptionStartingModule(pae.getException());
+		}
 	} // end of getCanonicalServiceName
 
 	public String getUserServiceName(String serviceName)
@@ -800,8 +794,13 @@
     {
 		if (SanityManager.DEBUG)
         {
+			try {
             SanityManager.ASSERT(serviceName1.equals(getCanonicalServiceName(serviceName1)), serviceName1);
 			SanityManager.ASSERT(serviceName2.equals(getCanonicalServiceName(serviceName2)), serviceName2);
+			} catch (StandardException se)
+			{
+				return false;
+			}
 		}
 		return serviceName1.equals(serviceName2);
 	} // end of isSameService

Modified: incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java
URL: http://svn.apache.org/viewcvs/incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java?rev=178795&r1=178794&r2=178795&view=diff
==============================================================================
--- incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java (original)
+++ incubator/derby/code/trunk/java/engine/org/apache/derby/impl/services/monitor/TopService.java Fri May 27 09:46:23 2005
@@ -137,7 +137,13 @@
 		if (serviceType == null)
 			otherCanonicalName = otherKey.getIdentifier();
 		else {
-			otherCanonicalName = serviceType.getCanonicalServiceName(otherKey.getIdentifier());
+			try
+			{
+				otherCanonicalName = serviceType.getCanonicalServiceName(otherKey.getIdentifier());
+			} catch (StandardException se)
+			{
+				return false;
+			}
 
 			// if the service name cannot be converted into a canonical name then it is not a service.
 			if (otherCanonicalName == null)