Author: bvahdat Date: Tue Apr 24 19:50:46 2012 New Revision: 1329969 URL: http://svn.apache.org/viewvc?rev=1329969&view=rev Log: Polished.
Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConfigurationHelper.java camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBridgeRouteExceptionHandlerTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCustomExceptionHandlerTest.java camel/trunk/camel-core/src/test/java/org/apache/camel/converter/jaxp/DomConverterTest.java camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConfigurationTest.java camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConvertTest.java camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/Order.java camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/SplitterAndExceptionRouteTwistIssueTest.java camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/file/GenericFileConsumer.java Tue Apr 24 19:50:46 2012 @@ -85,7 +85,6 @@ public abstract class GenericFileConsume /** * Poll for files */ - @SuppressWarnings("unchecked") protected int poll() throws Exception { // must reset for each poll fileExpressionResult = null; @@ -160,7 +159,6 @@ public abstract class GenericFileConsume return polledMessages; } - @SuppressWarnings("unchecked") public int processBatch(Queue<Object> exchanges) { int total = exchanges.size(); @@ -198,13 +196,12 @@ public abstract class GenericFileConsume return total; } - @SuppressWarnings("unchecked") - protected void removeExcessiveInProgressFiles(Deque exchanges, int limit) { + protected void removeExcessiveInProgressFiles(Deque<Exchange> exchanges, int limit) { // remove the file from the in progress list in case the batch was limited by max messages per poll while (exchanges.size() > limit) { // must remove last - Exchange exchange = (Exchange) exchanges.removeLast(); - GenericFile<T> file = (GenericFile<T>) exchange.getProperty(FileComponent.FILE_EXCHANGE_FILE); + Exchange exchange = exchanges.removeLast(); + GenericFile<?> file = exchange.getProperty(FileComponent.FILE_EXCHANGE_FILE, GenericFile.class); String key = file.getAbsoluteFilePath(); endpoint.getInProgressRepository().remove(key); } Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConfigurationHelper.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConfigurationHelper.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConfigurationHelper.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/ConfigurationHelper.java Tue Apr 24 19:50:46 2012 @@ -28,7 +28,6 @@ import org.apache.camel.RuntimeCamelExce import org.apache.camel.URIField; import org.apache.camel.util.IntrospectionSupport; import org.apache.camel.util.URISupport; -import org.apache.camel.util.UnsafeUriCharactersEncoder; import org.slf4j.Logger; import org.slf4j.LoggerFactory; Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java (original) +++ camel/trunk/camel-core/src/main/java/org/apache/camel/impl/converter/BaseTypeConverterRegistry.java Tue Apr 24 19:50:46 2012 @@ -178,6 +178,7 @@ public abstract class BaseTypeConverterR return tryConvertTo(type, null, value); } + @SuppressWarnings("unchecked") @Override public <T> T tryConvertTo(Class<T> type, Exchange exchange, Object value) { if (!isRunAllowed()) { Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/TestSupport.java Tue Apr 24 19:50:46 2012 @@ -28,7 +28,6 @@ import org.apache.camel.builder.ValueBui import org.apache.camel.impl.DefaultCamelContext; import org.apache.camel.impl.DefaultExchange; import org.apache.camel.processor.ErrorHandlerSupport; -import org.apache.camel.util.ExchangeHelper; import org.apache.camel.util.PredicateAssertHelper; import org.slf4j.Logger; import org.slf4j.LoggerFactory; Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBridgeRouteExceptionHandlerTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBridgeRouteExceptionHandlerTest.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBridgeRouteExceptionHandlerTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerBridgeRouteExceptionHandlerTest.java Tue Apr 24 19:50:46 2012 @@ -16,6 +16,7 @@ */ package org.apache.camel.component.file; +import java.io.File; import java.io.IOException; import org.apache.camel.ContextTestSupport; @@ -73,17 +74,17 @@ public class FileConsumerBridgeRouteExce // END SNIPPET: e2 // used for simulating exception during acquiring a lock on the file - private class MyReadLockStrategy implements GenericFileExclusiveReadLockStrategy { + private static class MyReadLockStrategy implements GenericFileExclusiveReadLockStrategy<File> { private int counter; @Override - public void prepareOnStartup(GenericFileOperations operations, GenericFileEndpoint endpoint) throws Exception { + public void prepareOnStartup(GenericFileOperations<File> operations, GenericFileEndpoint<File> endpoint) throws Exception { // noop } @Override - public boolean acquireExclusiveReadLock(GenericFileOperations operations, GenericFile file, Exchange exchange) throws Exception { + public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception { if (file.getFileNameOnly().equals("bye.txt")) { if (counter++ == 0) { // force an exception on acquire attempt for the bye.txt file, on the first attempt @@ -95,7 +96,7 @@ public class FileConsumerBridgeRouteExce } @Override - public void releaseExclusiveReadLock(GenericFileOperations operations, GenericFile file, Exchange exchange) throws Exception { + public void releaseExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception { // noop } Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCustomExceptionHandlerTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCustomExceptionHandlerTest.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCustomExceptionHandlerTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/component/file/FileConsumerCustomExceptionHandlerTest.java Tue Apr 24 19:50:46 2012 @@ -16,6 +16,7 @@ */ package org.apache.camel.component.file; +import java.io.File; import java.io.IOException; import org.apache.camel.ContextTestSupport; @@ -92,7 +93,7 @@ public class FileConsumerCustomException * Custom {@link ExceptionHandler} to be used on the file consumer, to send * exceptions to a Camel route, to let Camel deal with the error. */ - private class MyExceptionHandler implements ExceptionHandler { + private static class MyExceptionHandler implements ExceptionHandler { private ProducerTemplate template; @@ -130,17 +131,17 @@ public class FileConsumerCustomException // END SNIPPET: e1 // used for simulating exception during acquiring a lock on the file - private class MyReadLockStrategy implements GenericFileExclusiveReadLockStrategy { + private static class MyReadLockStrategy implements GenericFileExclusiveReadLockStrategy<File> { private int counter; @Override - public void prepareOnStartup(GenericFileOperations operations, GenericFileEndpoint endpoint) throws Exception { + public void prepareOnStartup(GenericFileOperations<File> operations, GenericFileEndpoint<File> endpoint) throws Exception { // noop } @Override - public boolean acquireExclusiveReadLock(GenericFileOperations operations, GenericFile file, Exchange exchange) throws Exception { + public boolean acquireExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception { if (file.getFileNameOnly().equals("bye.txt")) { if (counter++ == 0) { // force an exception on acquire attempt for the bye.txt file, on the first attempt @@ -152,7 +153,7 @@ public class FileConsumerCustomException } @Override - public void releaseExclusiveReadLock(GenericFileOperations operations, GenericFile file, Exchange exchange) throws Exception { + public void releaseExclusiveReadLock(GenericFileOperations<File> operations, GenericFile<File> file, Exchange exchange) throws Exception { // noop } Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/converter/jaxp/DomConverterTest.java URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/converter/jaxp/DomConverterTest.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/camel-core/src/test/java/org/apache/camel/converter/jaxp/DomConverterTest.java (original) +++ camel/trunk/camel-core/src/test/java/org/apache/camel/converter/jaxp/DomConverterTest.java Tue Apr 24 19:50:46 2012 @@ -47,14 +47,14 @@ public class DomConverterTest extends Co public void testDomConverterToInteger() throws Exception { Document document = context.getTypeConverter().convertTo(Document.class, "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello>47</hello>"); - Integer number = new DomConverter().toInteger(document.getChildNodes()); + Integer number = DomConverter.toInteger(document.getChildNodes()); assertEquals(47, number.intValue()); } public void testDomConverterToLong() throws Exception { Document document = context.getTypeConverter().convertTo(Document.class, "<?xml version=\"1.0\" encoding=\"UTF-8\"?><hello>47</hello>"); - Long number = new DomConverter().toLong(document.getChildNodes()); + Long number = DomConverter.toLong(document.getChildNodes()); assertEquals(47L, number.longValue()); } Modified: camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java (original) +++ camel/trunk/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/jaxrs/CxfRsComponent.java Tue Apr 24 19:50:46 2012 @@ -81,7 +81,7 @@ public class CxfRsComponent extends Head } String resourceClasses = getAndRemoveParameter(parameters, "resourceClasses", String.class); - Iterator it = ObjectHelper.createIterator(resourceClasses); + Iterator<Object> it = ObjectHelper.createIterator(resourceClasses); while (it.hasNext()) { String name = (String) it.next(); Class<?> clazz = getCamelContext().getClassResolver().resolveMandatoryClass(name); Modified: camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConfigurationTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConfigurationTest.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConfigurationTest.java (original) +++ camel/trunk/components/camel-irc/src/test/java/org/apache/camel/component/irc/IrcConfigurationTest.java Tue Apr 24 19:50:46 2012 @@ -21,7 +21,6 @@ import java.util.List; import org.apache.camel.Endpoint; import org.apache.camel.test.junit4.CamelTestSupport; -import org.apache.camel.util.URISupport; import org.junit.Test; public class IrcConfigurationTest extends CamelTestSupport { Modified: camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConvertTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConvertTest.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConvertTest.java (original) +++ camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/JAXBConvertTest.java Tue Apr 24 19:50:46 2012 @@ -19,11 +19,8 @@ package org.apache.camel.example; import java.io.ByteArrayInputStream; import java.io.InputStream; -import javax.xml.bind.UnmarshalException; - import org.apache.camel.CamelContext; import org.apache.camel.NoTypeConversionAvailableException; -import org.apache.camel.RuntimeCamelException; import org.apache.camel.StreamCache; import org.apache.camel.TypeConversionException; import org.apache.camel.TypeConverter; Modified: camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/Order.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/Order.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/Order.java (original) +++ camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/example/Order.java Tue Apr 24 19:50:46 2012 @@ -18,7 +18,6 @@ package org.apache.camel.example; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; Modified: camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/SplitterAndExceptionRouteTwistIssueTest.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/SplitterAndExceptionRouteTwistIssueTest.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/SplitterAndExceptionRouteTwistIssueTest.java (original) +++ camel/trunk/components/camel-jaxb/src/test/java/org/apache/camel/jaxb/SplitterAndExceptionRouteTwistIssueTest.java Tue Apr 24 19:50:46 2012 @@ -158,6 +158,8 @@ public class SplitterAndExceptionRouteTw @XmlRootElement(name = "twits") class Twits implements Serializable { + private static final long serialVersionUID = 1L; + @XmlElement(name = "twit", required = true) protected List<Twit> twits; @@ -182,6 +184,8 @@ class Twits implements Serializable { @XmlRootElement(name = "twit") class Twit implements Serializable { + private static final long serialVersionUID = 1L; + @XmlElement(required = true) protected String text; Modified: camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java (original) +++ camel/trunk/components/camel-solr/src/main/java/org/apache/camel/component/solr/SolrProducer.java Tue Apr 24 19:50:46 2012 @@ -75,7 +75,7 @@ public class SolrProducer extends Defaul Object body = exchange.getIn().getBody(); if (body instanceof WrappedFile) { - body = ((WrappedFile)body).getFile(); + body = ((WrappedFile<?>)body).getFile(); } if (body instanceof File) { Modified: camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml (original) +++ camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-context.xml Tue Apr 24 19:50:46 2012 @@ -1,14 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor - license agreements. See the NOTICE file distributed with this work for additional - information regarding copyright ownership. The ASF licenses this file to - You under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of - the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required - by applicable law or agreed to in writing, software distributed under the - License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS - OF ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. --> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation=" Modified: camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml?rev=1329969&r1=1329968&r2=1329969&view=diff ============================================================================== --- camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml (original) +++ camel/trunk/components/camel-spring-ws/src/test/resources/org/apache/camel/component/spring/ws/SSLContextParametersLocalRouteTest-servlet-context.xml Tue Apr 24 19:50:46 2012 @@ -1,14 +1,20 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor - license agreements. See the NOTICE file distributed with this work for additional - information regarding copyright ownership. The ASF licenses this file to - You under the Apache License, Version 2.0 (the "License"); you may not use - this file except in compliance with the License. You may obtain a copy of - the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required - by applicable law or agreed to in writing, software distributed under the - License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS - OF ANY KIND, either express or implied. See the License for the specific - language governing permissions and limitations under the License. --> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="