[patch] make security tests silent

Andreas Tobler toa@pop.agri.ch
Mon Nov 15 08:13:00 GMT 2004


Hi all,

would this be accepted to make the security tests silent?
Or do you have other DEBUG preferences?

Andreas

P.S, with CL if ok. And reposted.

Index: java/security/Security.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/security/Security.java,v
retrieving revision 1.23
diff -u -r1.23 Security.java
--- java/security/Security.java 21 Oct 2004 20:21:04 -0000      1.23
+++ java/security/Security.java 15 Nov 2004 08:08:44 -0000
@@ -40,6 +40,8 @@

 import gnu.java.security.action.GetPropertyAction;

+import gnu.classpath.Configuration;
+
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.URL;
@@ -81,20 +83,27 @@
       if (!loadProviders (base, "classpath")
          && !loaded
          && providers.size() == 0)
-        {
-         // No providers found and both security files failed to load properly.
-         System.err.println
-           ("WARNING: could not properly read security provider files:");
-         System.err.println
-           ("         " + base + "/security/" + vendor + ".security");
-         System.err.println
-           ("         " + base + "/security/" + "classpath" + ".security");
-         System.err.println
-           ("         Falling back to standard GNU security provider");
-         providers.addElement (new gnu.java.security.provider.Gnu());
-        }
-  }
-
+         {
+             if (Configuration.DEBUG)
+                 {
+                     /* No providers found and both security files failed
to
+                      * load properly. Give a warning in case of DEBUG
is
+                      * enabled.
+                      */
+                     System.err.println
+                         ("WARNING: could not properly read security provider
files:");
+                     System.err.println
+                         ("         " + base + "/security/" + vendor
+                          + ".security");
+                     System.err.println
+                         ("         " + base + "/security/" + "classpath"
+                          + ".security");
+                     System.err.println
+                         ("         Falling back to standard GNU security
provider");
+                 }
+             providers.addElement (new gnu.java.security.provider.Gnu());
+         }
+    }
   // This class can't be instantiated.
   private Security()
   {



More information about the Java-patches mailing list