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 rh...@apache.org on 2022/05/11 19:00:01 UTC

svn commit: r1900816 - in /db/derby/code/trunk/java: org.apache.derby.tests/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java org.apache.derby.tools/org/apache/derby/impl/tools/sysinfo/Main.java

Author: rhillegas
Date: Wed May 11 19:00:01 2022
New Revision: 1900816

URL: http://svn.apache.org/viewvc?rev=1900816&view=rev
Log:
DERBY-7138: Remove more references to SecurityExceptions; commit derby-7138-18-aa-moreSecurityExceptions.diff.

Modified:
    db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java
    db/derby/code/trunk/java/org.apache.derby.tools/org/apache/derby/impl/tools/sysinfo/Main.java

Modified: db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java?rev=1900816&r1=1900815&r2=1900816&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.tests/org/apache/derbyTesting/junit/ClassLoaderTestSetup.java Wed May 11 19:00:01 2022
@@ -63,9 +63,6 @@ public class ClassLoaderTestSetup extend
     /**
      * Force this thread to use a specific class loader.
      * @param which class loader to set
-     *
-     * @throws  SecurityException
-     *          if the current thread cannot set the context ClassLoader
      */
     public static void setThreadLoader(final ClassLoader which) {
         Thread.currentThread().setContextClassLoader(which);

Modified: db/derby/code/trunk/java/org.apache.derby.tools/org/apache/derby/impl/tools/sysinfo/Main.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/org.apache.derby.tools/org/apache/derby/impl/tools/sysinfo/Main.java?rev=1900816&r1=1900815&r2=1900816&view=diff
==============================================================================
--- db/derby/code/trunk/java/org.apache.derby.tools/org/apache/derby/impl/tools/sysinfo/Main.java (original)
+++ db/derby/code/trunk/java/org.apache.derby.tools/org/apache/derby/impl/tools/sysinfo/Main.java Wed May 11 19:00:01 2022
@@ -323,8 +323,7 @@ public static void getMainInfo (java.io.
 }
   
   /**
-   * Return Java properties from java.lang.System. Will catch
-   * SecurityExceptions and note them for displaying information.
+   * Return Java properties from java.lang.System.
    * @param whichProperty This is the name of the property
    * 
    * @return getJavaProperty(whichProperty, false) 
@@ -927,60 +926,39 @@ public static void getMainInfo (java.io.
             zips[0] = zip;
         }
 
-        try
-        {
-			if (classpath != null) {
-				String cp [] = parseClasspath(classpath);
-				List<String> jarNamesList = Arrays.asList(jarNames);
-				Vector<ZipInfoProperties> v = new Vector<ZipInfoProperties>();
-				for (int i = 0; i < cp.length; i++)
-				{
-                    boolean matches = false;
-                    String candidate = cp[i];
-                    for (String jarName : jarNames)
+        if (classpath != null) {
+            String cp [] = parseClasspath(classpath);
+            List<String> jarNamesList = Arrays.asList(jarNames);
+            Vector<ZipInfoProperties> v = new Vector<ZipInfoProperties>();
+            for (int i = 0; i < cp.length; i++)
+            {
+                boolean matches = false;
+                String candidate = cp[i];
+                for (String jarName : jarNames)
+                {
+                    if (candidate.endsWith(jarName))
                     {
-                        if (candidate.endsWith(jarName))
-                        {
-                            matches = true;
-                            break;
-                        }
+                        matches = true;
+                        break;
                     }
-                    if (!matches)
-                        continue;
-
-					ZipInfoProperties zip = null;
-					try {
-						zip = checkForInfo(cp[i]);
-					}
-					catch (SecurityException se)
-					{
-						zip = new ZipInfoProperties(null);
-						zip.setLocation(
-							Main.getTextMessage ("SIF03.C", se.getMessage()));
-					}
-					if (zip != null)
-					{
-						v.addElement(zip);
-					}
-				}
-				if (v.size() > 0)
-				{
-					ZipInfoProperties cpzips[] = new ZipInfoProperties[v.size()];
-					v.copyInto(cpzips);
-					return mergeZips(zips, cpzips);
-				}
-			}
-            return mergeZips(zips, null);
-
-        }
-        catch (SecurityException se)
-        {
-            ZipInfoProperties zip[] = new ZipInfoProperties[1];
-            zip[0] = new ZipInfoProperties(null);
-            zip[0].setLocation(
-					Main.getTextMessage ("SIF03.C", se.getMessage()));
-            return zip;
+                }
+                if (!matches)
+                { continue; }
+
+                ZipInfoProperties zip =  checkForInfo(cp[i]);
+                if (zip != null)
+                {
+                    v.addElement(zip);
+                }
+            }
+            if (v.size() > 0)
+            {
+                ZipInfoProperties cpzips[] = new ZipInfoProperties[v.size()];
+                v.copyInto(cpzips);
+                return mergeZips(zips, cpzips);
+            }
         }
+        return mergeZips(zips, null);
     }
 
     /**