]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Security.java (Security): Silence the warning about no providers found in the no...
authorAndreas Tobler <a.tobler@schweiz.ch>
Tue, 16 Nov 2004 21:31:55 +0000 (22:31 +0100)
committerAndreas Tobler <andreast@gcc.gnu.org>
Tue, 16 Nov 2004 21:31:55 +0000 (22:31 +0100)
2004-11-16  Andreas Tobler  <a.tobler@schweiz.ch>

* java/security/Security.java (Security): Silence the warning about no
providers found in the no debug case.

From-SVN: r90765

libjava/ChangeLog
libjava/java/security/Security.java

index 7a6759d723afce55ecc21f4c408d54da7360d52d..1f649b3a1edaf7db410386f5326ae4438d0298fb 100644 (file)
@@ -1,3 +1,8 @@
+2004-11-16  Andreas Tobler  <a.tobler@schweiz.ch>
+
+       * java/security/Security.java (Security): Silence the warning about no
+       providers found in the no debug case.
+
 2004-11-16  Michael Koch  <konqueror@gmx.de>
 
        * java/net/InetAddress.java
index 1820319c06d84c1ddb61a9d46d32d5103a396d48..01c0a0587d6b77834ffdd8e6c20e3944d500ef0b 100644 (file)
@@ -40,6 +40,8 @@ package java.security;
 
 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 @@ public final class Security
       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. Could be done with java.util.logging later.
+                      */
+                     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()
   {