Hi,

In package org.apache.xml.security.keys.content, field DEREncodedKeyValue.supportedKeyTypes is declared as public:

    public static final String supportedKeyTypes[] = { "RSA", "DSA", "EC"};

However, the field is never used in other classes. It's better to declare it as private to minimize the scope of this variable. Otherwise, FindBugs would complain that "Field should be package protected".

Here is the simple patch:

$ svn  diff DEREncodedKeyValue.java
Index: DEREncodedKeyValue.java
===================================================================
--- DEREncodedKeyValue.java     (revision 1513379)
+++ DEREncodedKeyValue.java     (working copy)
@@ -38,7 +38,7 @@
public class DEREncodedKeyValue extends Signature11ElementProxy implements KeyInfoContent {

     /** JCA algorithm key types supported by this implementation. */
-    public static final String supportedKeyTypes[] = { "RSA", "DSA", "EC"};
+ private static final String supportedKeyTypes[] = { "RSA", "DSA", "EC"};

     /**
      * Constructor DEREncodedKeyValue


Regards,
Xuelei Fan

Reply via email to