[java-opensaml] branch master updated: OSJ-99 - Warn on deprecated Methods and Classes

Scott Cantor cantor.2 at osu.edu
Wed Sep 13 15:49:25 EDT 2017


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-opensaml.

View the commit online:
http://git.shibboleth.net/view/?p=java-opensaml.git;a=commit;h=9ae0b12d85b14639314cfff10ffcfa756a900170

The following commit(s) were added to refs/heads/master by this push:
       new  9ae0b12   OSJ-99 - Warn on deprecated Methods and Classes
9ae0b12 is described below

commit 9ae0b12d85b14639314cfff10ffcfa756a900170
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Wed Sep 13 15:49:23 2017 -0400

    OSJ-99 - Warn on deprecated Methods and Classes
---
 .../opensaml/core/xml/util/XMLObjectSupport.java   |  5 +++++
 .../opensaml/profile/logic/IPRangePredicate.java   |  1 +
 .../filter/impl/SchemaValidationFilter.java        |  1 +
 .../filter/impl/SignatureValidationFilter.java     |  6 ++++++
 .../impl/SecurityEnhancedTLSSocketFactory.java     |  1 +
 .../impl/TrustEngineTLSSocketFactory.java          |  3 +++
 .../http/AbstractPipelineHttpSOAPClient.java       |  5 +++++
 .../java/org/opensaml/soap/util/SOAPSupport.java   | 25 ++++++++++++++++++++++
 .../soap/wssecurity/AttributedDateTime.java        |  3 ++-
 9 files changed, 49 insertions(+), 1 deletion(-)

diff --git a/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java b/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
index 0938a42..06ae81a 100644
--- a/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
+++ b/opensaml-core/src/main/java/org/opensaml/core/xml/util/XMLObjectSupport.java
@@ -28,6 +28,8 @@ import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
 import javax.xml.namespace.QName;
 
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 import net.shibboleth.utilities.java.support.xml.AttributeSupport;
 import net.shibboleth.utilities.java.support.xml.ParserPool;
@@ -138,6 +140,9 @@ public final class XMLObjectSupport {
     @Deprecated
     @Nullable public static <T extends XMLObject> T cloneXMLObject(@Nullable final T originalXMLObject,
             final boolean rootInNewDocument) throws MarshallingException, UnmarshallingException {
+        DeprecationSupport.warnOnce(ObjectType.METHOD, "org.opensaml.core.xml.util.XMLObjectSupport" +
+            ".cloneXMLObject(XMLObject, boolean)", null, "cloneXMLObject(XMLObject, CloneOutputOption)");
+        
         if (rootInNewDocument) {
             return cloneXMLObject(originalXMLObject, CloneOutputOption.RootDOMInNewDocument);
         } else {
diff --git a/opensaml-profile-api/src/main/java/org/opensaml/profile/logic/IPRangePredicate.java b/opensaml-profile-api/src/main/java/org/opensaml/profile/logic/IPRangePredicate.java
index 1f526d4..b4179b0 100644
--- a/opensaml-profile-api/src/main/java/org/opensaml/profile/logic/IPRangePredicate.java
+++ b/opensaml-profile-api/src/main/java/org/opensaml/profile/logic/IPRangePredicate.java
@@ -65,6 +65,7 @@ public class IPRangePredicate implements Predicate<BaseContext> {
      * 
      * @deprecated
      */
+    @Deprecated
     public void setAddressRanges(@Nonnull @NonnullElements final Iterable<IPRange> ranges) {
         DeprecationSupport.warn(ObjectType.METHOD, getClass().getName() + ".setAddressRanges(Iterable)", null,
                 "setAddressRanges(Collection)");
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/SchemaValidationFilter.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/SchemaValidationFilter.java
index 9f21093..cd8c916 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/SchemaValidationFilter.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/SchemaValidationFilter.java
@@ -77,6 +77,7 @@ public class SchemaValidationFilter implements MetadataFilter {
      * @param builder SAML schema source to use
      * @param extensionSchemas classpath-based location of metadata extension schemas
      */
+    @Deprecated
     public SchemaValidationFilter(@Nonnull final SAMLSchemaBuilder builder,
             @Nullable @NonnullElements final String[] extensionSchemas) {
         samlSchemaBuilder = Constraint.isNotNull(builder, "SAMLSchemaBuilder cannot be null");
diff --git a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/SignatureValidationFilter.java b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/SignatureValidationFilter.java
index f248ccd..937c838 100644
--- a/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/SignatureValidationFilter.java
+++ b/opensaml-saml-impl/src/main/java/org/opensaml/saml/metadata/resolver/filter/impl/SignatureValidationFilter.java
@@ -26,6 +26,8 @@ import javax.annotation.Nullable;
 
 import net.shibboleth.utilities.java.support.annotation.constraint.NotEmpty;
 import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
 import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
 
 import org.opensaml.core.xml.XMLObject;
@@ -182,6 +184,8 @@ public class SignatureValidationFilter implements MetadataFilter {
      */
     @Deprecated
     public boolean getRequireSignature() {
+        DeprecationSupport.warnOnce(ObjectType.METHOD, getClass().getName() + ".getRequireSignature", null,
+                "getRequireSignedRoot");
         return getRequireSignedRoot();
     }
 
@@ -196,6 +200,8 @@ public class SignatureValidationFilter implements MetadataFilter {
      */
     @Deprecated
     public void setRequireSignature(final boolean require) {
+        DeprecationSupport.warnOnce(ObjectType.METHOD, getClass().getName() + ".setRequireSignature", null,
+                "setRequireSignedRoot");
         setRequireSignedRoot(require);
     }
  
diff --git a/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/SecurityEnhancedTLSSocketFactory.java b/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/SecurityEnhancedTLSSocketFactory.java
index 5ef94b9..40e3726 100644
--- a/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/SecurityEnhancedTLSSocketFactory.java
+++ b/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/SecurityEnhancedTLSSocketFactory.java
@@ -245,6 +245,7 @@ public class SecurityEnhancedTLSSocketFactory implements LayeredConnectionSocket
      *           
      * @deprecated use {@link #performTrustEval(Socket, String, HttpContext)}
      */
+    @Deprecated
     protected void performTrustEval(@Nonnull final Socket socket, @Nonnull final HttpContext context) 
             throws IOException {
         //TODO when we remove this deprecated method, change called method to @Nonnull for hostname
diff --git a/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactory.java b/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactory.java
index c45f5f3..d4d5ecb 100644
--- a/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactory.java
+++ b/opensaml-security-impl/src/main/java/org/opensaml/security/httpclient/impl/TrustEngineTLSSocketFactory.java
@@ -31,6 +31,8 @@ import javax.net.ssl.SSLSession;
 import javax.net.ssl.SSLSocket;
 
 import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
 import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
 
 import org.apache.http.HttpHost;
@@ -102,6 +104,7 @@ public class TrustEngineTLSSocketFactory implements LayeredConnectionSocketFacto
      */
     public TrustEngineTLSSocketFactory(final LayeredConnectionSocketFactory factory,
             final X509HostnameVerifier verifier) {
+        DeprecationSupport.warnOnce(ObjectType.CLASS, getClass().getName(), null, "SecurityEnhancedTLSSocketFactory");
         wrappedFactory = Constraint.isNotNull(factory, "Socket factory was null");
         hostnameVerifier = verifier;
     }
diff --git a/opensaml-soap-api/src/main/java/org/opensaml/soap/client/http/AbstractPipelineHttpSOAPClient.java b/opensaml-soap-api/src/main/java/org/opensaml/soap/client/http/AbstractPipelineHttpSOAPClient.java
index e67e3b1..c601976 100644
--- a/opensaml-soap-api/src/main/java/org/opensaml/soap/client/http/AbstractPipelineHttpSOAPClient.java
+++ b/opensaml-soap-api/src/main/java/org/opensaml/soap/client/http/AbstractPipelineHttpSOAPClient.java
@@ -34,6 +34,8 @@ import net.shibboleth.utilities.java.support.component.AbstractInitializableComp
 import net.shibboleth.utilities.java.support.component.ComponentInitializationException;
 import net.shibboleth.utilities.java.support.component.ComponentSupport;
 import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
 import net.shibboleth.utilities.java.support.resolver.CriteriaSet;
 
 import org.apache.http.HttpResponse;
@@ -312,6 +314,9 @@ public abstract class AbstractPipelineHttpSOAPClient<OutboundMessageType, Inboun
     @Deprecated
     protected void checkTLSCredentialTrusted(@Nonnull final HttpClientContext context, 
             @Nonnull final HttpUriRequest request) throws SSLPeerUnverifiedException {
+        DeprecationSupport.warnOnce(ObjectType.METHOD, getClass().getName() + ".checkTLSCredentialTrusted", null,
+                "HttpClientSecuritySupport.checkTLSCredentialEvaluated");
+        
         HttpClientSecuritySupport.checkTLSCredentialEvaluated(context, request.getURI().getScheme());
     }
     
diff --git a/opensaml-soap-api/src/main/java/org/opensaml/soap/util/SOAPSupport.java b/opensaml-soap-api/src/main/java/org/opensaml/soap/util/SOAPSupport.java
index 88fbc05..700e9ca 100644
--- a/opensaml-soap-api/src/main/java/org/opensaml/soap/util/SOAPSupport.java
+++ b/opensaml-soap-api/src/main/java/org/opensaml/soap/util/SOAPSupport.java
@@ -29,6 +29,8 @@ import javax.xml.namespace.QName;
 
 import net.shibboleth.utilities.java.support.collection.LazyList;
 import net.shibboleth.utilities.java.support.logic.Constraint;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport;
+import net.shibboleth.utilities.java.support.primitive.DeprecationSupport.ObjectType;
 import net.shibboleth.utilities.java.support.primitive.StringSupport;
 import net.shibboleth.utilities.java.support.xml.XMLConstants;
 
@@ -407,8 +409,12 @@ public final class SOAPSupport {
      * 
      * @deprecated use {@link SOAPMessagingSupport#addHeaderBlock(MessageContext, XMLObject)}
      */
+    @Deprecated
     public static void addHeaderBlock(@Nonnull final MessageContext messageContext,
             @Nonnull final XMLObject headerBlock) {
+        DeprecationSupport.warnOnce(ObjectType.METHOD,
+                "org.opensaml.soap.util.SOAPSupport.addHeaderBlock", null,
+                "org.opensaml.soap.messaging.SOAPMessagingSupport.addHeaderBlock");
         SOAPMessagingSupport.addHeaderBlock(messageContext, headerBlock);
     }
 
@@ -420,7 +426,11 @@ public final class SOAPSupport {
      * 
      * @deprecated use {@link SOAPMessagingSupport#addSOAP11HeaderBlock(Envelope, XMLObject)}
      */
+    @Deprecated
     public static void addSOAP11HeaderBlock(@Nonnull final Envelope envelope, @Nonnull final XMLObject headerBlock) {
+        DeprecationSupport.warnOnce(ObjectType.METHOD,
+                "org.opensaml.soap.util.SOAPSupport.addSOAP11HeaderBlock", null,
+                "org.opensaml.soap.messaging.SOAPMessagingSupport.addSOAP11HeaderBlock");
         SOAPMessagingSupport.addSOAP11HeaderBlock(envelope, headerBlock);
     }
 
@@ -437,9 +447,13 @@ public final class SOAPSupport {
      * 
      * @deprecated use {@link SOAPMessagingSupport#getInboundHeaderBlock(MessageContext, QName)}
      */
+    @Deprecated
     @Nonnull public static List<XMLObject> getInboundHeaderBlock(
             @Nonnull final MessageContext messageContext, @Nonnull final QName headerName,
             @Nullable final Set<String> targetNodes, final boolean isFinalDestination) {
+        DeprecationSupport.warnOnce(ObjectType.METHOD,
+                "org.opensaml.soap.util.SOAPSupport.getInboundHeaderBlock", null,
+                "org.opensaml.soap.messaging.SOAPMessagingSupport.getInboundHeaderBlock");
         return SOAPMessagingSupport.getHeaderBlock(messageContext, headerName, targetNodes, isFinalDestination);
     }
 
@@ -455,9 +469,13 @@ public final class SOAPSupport {
      * 
      * @deprecated use {@link SOAPMessagingSupport#getSOAP11HeaderBlock(Envelope, QName, Set, boolean)}
      */
+    @Deprecated
     @Nonnull public static List<XMLObject> getSOAP11HeaderBlock(@Nonnull final Envelope envelope,
             @Nonnull final QName headerName, @Nullable final Set<String> targetNodes,
             final boolean isFinalDestination) {
+        DeprecationSupport.warnOnce(ObjectType.METHOD,
+                "org.opensaml.soap.util.SOAPSupport.getSOAP11HeaderBlock", null,
+                "org.opensaml.soap.messaging.SOAPMessagingSupport.getSOAP11HeaderBlock");
         return SOAPMessagingSupport.getSOAP11HeaderBlock(envelope, headerName, targetNodes, isFinalDestination);
     }
     
@@ -473,8 +491,12 @@ public final class SOAPSupport {
      * 
      * @deprecated use {@link SOAPMessagingSupport#isSOAP11HeaderTargetedToNode(XMLObject, Set, boolean)}
      */
+    @Deprecated
     public static boolean isSOAP11HeaderTargetedToNode(@Nonnull final XMLObject header,
             @Nullable final Set<String> nodeActors, final boolean isFinalDestination) {
+        DeprecationSupport.warnOnce(ObjectType.METHOD,
+                "org.opensaml.soap.util.SOAPSupport.isSOAP11HeaderTargetedToNode", null,
+                "org.opensaml.soap.messaging.SOAPMessagingSupport.isSOAP11HeaderTargetedToNode");
         return SOAPMessagingSupport.isSOAP11HeaderTargetedToNode(header, nodeActors, isFinalDestination);
     }
 
@@ -487,7 +509,10 @@ public final class SOAPSupport {
      * 
      * @deprecated use {@link SOAPMessagingSupport#isSOAPMessage(MessageContext)}
      */
+    @Deprecated
     public static boolean isSOAPMessage(@Nonnull final MessageContext<? extends XMLObject> messageContext) {
+        DeprecationSupport.warnOnce(ObjectType.METHOD, "org.opensaml.soap.util.SOAPSupport.isSOAPMessage", null,
+                "org.opensaml.soap.messaging.SOAPMessagingSupport.isSOAPMessage");
         return SOAPMessagingSupport.isSOAPMessage(messageContext);
     }
 
diff --git a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/AttributedDateTime.java b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/AttributedDateTime.java
index 35792d5..29a4288 100644
--- a/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/AttributedDateTime.java
+++ b/opensaml-soap-api/src/main/java/org/opensaml/soap/wssecurity/AttributedDateTime.java
@@ -42,7 +42,8 @@ public interface AttributedDateTime extends XSString, IdBearing, AttributeExtens
      * @deprecated replaced by use of a {@link DateTimeFormatter} 
      *              configured via {@link #setDateTimeFormatter(DateTimeFormatter)}.
      * 
-     * */
+     */
+    @Deprecated
     public static final String DEFAULT_DATETIME_FORMAT= "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
 
     /**

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list