You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2018/10/26 14:29:56 UTC

[camel] branch master updated (5420c9b -> bd0f400)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git.


    from 5420c9b  [CAMEL-12902] SMX version of qpid is no longer needed
     new 3f471f8  Fixed CS
     new dbc6749  Fixed CS
     new bd0f400  Fixed CS

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../remote/sftp/SftpConsumerDisconnectTest.java    |  7 +++--
 .../linkedin/api/LinkedInOAuthRequestFilter.java   | 31 +++++++++++-----------
 .../api/AbstractResourceIntegrationTest.java       | 10 ++++---
 .../internal/CachingOAuthSecureStorage.java        |  2 +-
 .../apache/camel/swagger/RestSwaggerSupport.java   |  3 +--
 5 files changed, 27 insertions(+), 26 deletions(-)


[camel] 03/03: Fixed CS

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit bd0f400e58da2fa0d4018161b1242a4ad2f3c0c4
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Oct 26 16:27:58 2018 +0200

    Fixed CS
---
 .../linkedin/api/LinkedInOAuthRequestFilter.java   | 31 +++++++++++-----------
 .../api/AbstractResourceIntegrationTest.java       | 10 ++++---
 .../internal/CachingOAuthSecureStorage.java        |  2 +-
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java
index a82a26b..c060561 100644
--- a/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java
+++ b/components/camel-linkedin/camel-linkedin-api/src/main/java/org/apache/camel/component/linkedin/api/LinkedInOAuthRequestFilter.java
@@ -50,7 +50,6 @@ import com.gargoylesoftware.htmlunit.html.HtmlPasswordInput;
 import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput;
 import com.gargoylesoftware.htmlunit.html.HtmlTextInput;
 import com.gargoylesoftware.htmlunit.util.WebConnectionWrapper;
-
 import org.apache.http.HttpHeaders;
 import org.apache.http.HttpHost;
 import org.apache.http.HttpStatus;
@@ -165,23 +164,23 @@ public final class LinkedInOAuthRequestFilter implements ClientRequestFilter {
                 // only handle errors returned with redirects
                 boolean done = false;
                 do {
-                        if (e.getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY || e.getStatusCode() == HttpStatus.SC_SEE_OTHER) {
-                            final URL location = new URL(e.getResponse().getResponseHeaderValue(HttpHeaders.LOCATION));
-                            final String locationQuery = location.getQuery();
-                            if (locationQuery != null && locationQuery.contains("error=")) {
-                                throw new IOException(URLDecoder.decode(locationQuery).replaceAll("&", ", "));
-                            } else {
-                                // follow the redirect to login form
-                                try {
-                                    authPage = webClient.getPage(location);
-                                    done = true;
-                                } catch (FailingHttpStatusCodeException e1) {
-                                    e = e1;
-                                }
-                            }
+                    if (e.getStatusCode() == HttpStatus.SC_MOVED_TEMPORARILY || e.getStatusCode() == HttpStatus.SC_SEE_OTHER) {
+                        final URL location = new URL(e.getResponse().getResponseHeaderValue(HttpHeaders.LOCATION));
+                        final String locationQuery = location.getQuery();
+                        if (locationQuery != null && locationQuery.contains("error=")) {
+                            throw new IOException(URLDecoder.decode(locationQuery).replaceAll("&", ", "));
                         } else {
-                            throw e;
+                            // follow the redirect to login form
+                            try {
+                                authPage = webClient.getPage(location);
+                                done = true;
+                            } catch (FailingHttpStatusCodeException e1) {
+                                e = e1;
+                            }
                         }
+                    } else {
+                        throw e;
+                    }
                 } while (!done);
             }
 
diff --git a/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java b/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java
index 8d3a03e..b0b5e02 100644
--- a/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java
+++ b/components/camel-linkedin/camel-linkedin-api/src/test/java/org/apache/camel/component/linkedin/api/AbstractResourceIntegrationTest.java
@@ -15,11 +15,16 @@
  * limitations under the License.
  */
 package org.apache.camel.component.linkedin.api;
+
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
 import java.util.Properties;
+
+import static java.util.concurrent.TimeUnit.DAYS;
+import static java.util.concurrent.TimeUnit.MILLISECONDS;
+
 import javax.ws.rs.WebApplicationException;
 
 import org.apache.camel.component.linkedin.api.model.Error;
@@ -33,17 +38,16 @@ import org.junit.BeforeClass;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import static java.util.concurrent.TimeUnit.DAYS;
-import static java.util.concurrent.TimeUnit.MILLISECONDS;
 
 /**
  * Base class for resource tests.
  */
 public abstract class AbstractResourceIntegrationTest extends Assert {
 
+    public static final long DEFAULT_EXPIRY = MILLISECONDS.convert(60, DAYS) + System.currentTimeMillis();
+
     protected static final Logger LOG = LoggerFactory.getLogger(PeopleResourceIntegrationTest.class);
     protected static final String DEFAULT_FIELDS = "";
-    public static final long DEFAULT_EXPIRY = MILLISECONDS.convert(60, DAYS) + System.currentTimeMillis();
 
     protected static LinkedInOAuthRequestFilter requestFilter;
     protected static Properties properties;
diff --git a/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/internal/CachingOAuthSecureStorage.java b/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/internal/CachingOAuthSecureStorage.java
index a263fab..d20db3e 100644
--- a/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/internal/CachingOAuthSecureStorage.java
+++ b/components/camel-linkedin/camel-linkedin-component/src/main/java/org/apache/camel/component/linkedin/internal/CachingOAuthSecureStorage.java
@@ -24,8 +24,8 @@ import org.apache.camel.component.linkedin.api.OAuthToken;
  */
 public class CachingOAuthSecureStorage implements OAuthSecureStorage {
 
-    private final OAuthSecureStorage secureStorage;
     protected OAuthToken token;
+    private final OAuthSecureStorage secureStorage;
 
     public CachingOAuthSecureStorage(OAuthSecureStorage secureStorage) {
         this.secureStorage = secureStorage;


[camel] 01/03: Fixed CS

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 3f471f869e69459f9dade6ecc97f7d7d3d3a4977
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Oct 26 16:24:21 2018 +0200

    Fixed CS
---
 .../component/file/remote/sftp/SftpConsumerDisconnectTest.java     | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpConsumerDisconnectTest.java b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpConsumerDisconnectTest.java
index 8b78a32..b6e1286 100644
--- a/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpConsumerDisconnectTest.java
+++ b/components/camel-ftp/src/test/java/org/apache/camel/component/file/remote/sftp/SftpConsumerDisconnectTest.java
@@ -105,10 +105,9 @@ public class SftpConsumerDisconnectTest extends SftpServerTestSupport {
                     .noAutoStartup().process(new Processor() {
                         @Override
                         public void process(Exchange exchange) throws Exception {
-                           disconnectAllSessions(); // disconnect all Sessions
-                                                    // from the SFTP server
-                       }
-                   }).to("mock:result");
+                            disconnectAllSessions(); // disconnect all Sessions from the SFTP server
+                        }
+                    }).to("mock:result");
             }
         };
     }


[camel] 02/03: Fixed CS

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit dbc6749bfd8da1ecd90d295f9533108f4739afce
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Oct 26 16:25:30 2018 +0200

    Fixed CS
---
 .../src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java     | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
index d39f501..dbbcb90 100644
--- a/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
+++ b/components/camel-swagger-java/src/main/java/org/apache/camel/swagger/RestSwaggerSupport.java
@@ -22,7 +22,6 @@ import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-
 import javax.management.AttributeNotFoundException;
 import javax.management.MBeanServer;
 import javax.management.ObjectName;
@@ -375,7 +374,7 @@ public class RestSwaggerSupport {
         String proto = (String) headers.get(HEADER_X_FORWARDED_PROTO);
         if (ObjectHelper.isNotEmpty(proto)) {
             String[] schemes = proto.split(",");
-            for(String scheme : schemes) {
+            for (String scheme : schemes) {
                 String trimmedScheme = scheme.trim();
                 if (ObjectHelper.isNotEmpty(trimmedScheme)) {
                     swagger.addScheme(Scheme.forValue(trimmedScheme));