You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by tv...@apache.org on 2014/05/24 03:49:46 UTC
svn commit: r1597233 [3/4] - in /tomee/tomee/trunk: ./
arquillian/arquillian-common/src/main/java/org/apache/openejb/arquillian/common/
arquillian/arquillian-common/src/main/java/org/apache/openejb/arquillian/common/deployment/
arquillian/arquillian-co...
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-moviefun-example/src/main/java/org/superbiz/moviefun/util/JsfUtil.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-moviefun-example/src/main/java/org/superbiz/moviefun/util/JsfUtil.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-moviefun-example/src/main/java/org/superbiz/moviefun/util/JsfUtil.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-moviefun-example/src/main/java/org/superbiz/moviefun/util/JsfUtil.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.superbiz.moviefun.util;
@@ -25,22 +25,22 @@ import java.util.List;
public class JsfUtil {
- public static SelectItem[] getSelectItems(List<?> entities, boolean selectOne) {
- int size = selectOne ? entities.size() + 1 : entities.size();
- SelectItem[] items = new SelectItem[size];
+ public static SelectItem[] getSelectItems(final List<?> entities, final boolean selectOne) {
+ final int size = selectOne ? entities.size() + 1 : entities.size();
+ final SelectItem[] items = new SelectItem[size];
int i = 0;
if (selectOne) {
items[0] = new SelectItem("", "---");
i++;
}
- for (Object x : entities) {
+ for (final Object x : entities) {
items[i++] = new SelectItem(x, x.toString());
}
return items;
}
- public static void addErrorMessage(Exception ex, String defaultMsg) {
- String msg = ex.getLocalizedMessage();
+ public static void addErrorMessage(final Exception ex, final String defaultMsg) {
+ final String msg = ex.getLocalizedMessage();
if (msg != null && msg.length() > 0) {
addErrorMessage(msg);
} else {
@@ -48,28 +48,28 @@ public class JsfUtil {
}
}
- public static void addErrorMessages(List<String> messages) {
- for (String message : messages) {
+ public static void addErrorMessages(final List<String> messages) {
+ for (final String message : messages) {
addErrorMessage(message);
}
}
- public static void addErrorMessage(String msg) {
- FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
+ public static void addErrorMessage(final String msg) {
+ final FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_ERROR, msg, msg);
FacesContext.getCurrentInstance().addMessage(null, facesMsg);
}
- public static void addSuccessMessage(String msg) {
- FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
+ public static void addSuccessMessage(final String msg) {
+ final FacesMessage facesMsg = new FacesMessage(FacesMessage.SEVERITY_INFO, msg, msg);
FacesContext.getCurrentInstance().addMessage("successInfo", facesMsg);
}
- public static String getRequestParameter(String key) {
+ public static String getRequestParameter(final String key) {
return FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap().get(key);
}
- public static Object getObjectFromRequestParameter(String requestParameterName, Converter converter, UIComponent component) {
- String theId = JsfUtil.getRequestParameter(requestParameterName);
+ public static Object getObjectFromRequestParameter(final String requestParameterName, final Converter converter, final UIComponent component) {
+ final String theId = JsfUtil.getRequestParameter(requestParameterName);
return converter.getAsObject(FacesContext.getCurrentInstance(), component, theId);
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-moviefun-example/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-moviefun-example/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-moviefun-example/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-moviefun-example/src/main/java/org/superbiz/moviefun/util/PaginationHelper.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.superbiz.moviefun.util;
@@ -23,7 +23,7 @@ public abstract class PaginationHelper {
private int pageSize;
private int page;
- public PaginationHelper(int pageSize) {
+ public PaginationHelper(final int pageSize) {
this.pageSize = pageSize;
}
@@ -37,7 +37,7 @@ public abstract class PaginationHelper {
public int getPageLastItem() {
int i = getPageFirstItem() + pageSize - 1;
- int count = getItemsCount() - 1;
+ final int count = getItemsCount() - 1;
if (i > count) {
i = count;
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEConfiguration.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEConfiguration.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEConfiguration.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEConfiguration.java Sat May 24 01:49:45 2014
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.remote;
@@ -42,7 +42,10 @@ public class RemoteTomEEConfiguration ex
private boolean cleanOnStartUp;
private boolean debug;
private int debugPort = 5005;
+
+ @SuppressWarnings("checkstyle:membername")
private String catalina_opts = null; // using this format to match the script one
+
private boolean simpleLog = false;
private String deployerProperties = "";
@@ -50,7 +53,7 @@ public class RemoteTomEEConfiguration ex
return groupId;
}
- public void setGroupId(String groupId) {
+ public void setGroupId(final String groupId) {
this.groupId = groupId;
}
@@ -58,7 +61,7 @@ public class RemoteTomEEConfiguration ex
return artifactId;
}
- public void setArtifactId(String artifactId) {
+ public void setArtifactId(final String artifactId) {
this.artifactId = artifactId;
}
@@ -66,7 +69,7 @@ public class RemoteTomEEConfiguration ex
return version;
}
- public void setVersion(String version) {
+ public void setVersion(final String version) {
this.version = version;
}
@@ -74,7 +77,7 @@ public class RemoteTomEEConfiguration ex
return classifier;
}
- public void setClassifier(String classifier) {
+ public void setClassifier(final String classifier) {
this.classifier = classifier;
}
@@ -82,7 +85,7 @@ public class RemoteTomEEConfiguration ex
return type;
}
- public void setType(String type) {
+ public void setType(final String type) {
this.type = type;
}
@@ -98,7 +101,7 @@ public class RemoteTomEEConfiguration ex
return removeUnusedWebapps;
}
- public void setRemoveUnusedWebapps(boolean removeUnusedWebapps) {
+ public void setRemoveUnusedWebapps(final boolean removeUnusedWebapps) {
this.removeUnusedWebapps = removeUnusedWebapps;
}
@@ -106,7 +109,7 @@ public class RemoteTomEEConfiguration ex
return ajpPort;
}
- public void setAjpPort(int ajpPort) {
+ public void setAjpPort(final int ajpPort) {
this.ajpPort = ajpPort;
}
@@ -114,7 +117,7 @@ public class RemoteTomEEConfiguration ex
return conf;
}
- public void setConf(String conf) {
+ public void setConf(final String conf) {
this.conf = conf;
}
@@ -122,7 +125,7 @@ public class RemoteTomEEConfiguration ex
return bin;
}
- public void setBin(String bin) {
+ public void setBin(final String bin) {
this.bin = bin;
}
@@ -130,7 +133,7 @@ public class RemoteTomEEConfiguration ex
return lib;
}
- public void setLib(String lib) {
+ public void setLib(final String lib) {
this.lib = lib;
}
@@ -161,7 +164,7 @@ public class RemoteTomEEConfiguration ex
return toInts(value);
}
- public void setCleanOnStartUp(boolean clearOnStartUp) {
+ public void setCleanOnStartUp(final boolean clearOnStartUp) {
this.cleanOnStartUp = clearOnStartUp;
}
@@ -173,7 +176,7 @@ public class RemoteTomEEConfiguration ex
return debug;
}
- public void setDebug(boolean debug) {
+ public void setDebug(final boolean debug) {
this.debug = debug;
}
@@ -181,7 +184,7 @@ public class RemoteTomEEConfiguration ex
return debugPort;
}
- public void setDebugPort(int debugPort) {
+ public void setDebugPort(final int debugPort) {
this.debugPort = debugPort;
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEContainer.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -107,7 +107,7 @@ public class RemoteTomEEContainer extend
IO.readProperties(IO.read(configuration.getProperties().getBytes()), props);
containerArchives = ArquillianUtil.toDeploy(props);
- for (Archive<?> archive : containerArchives) {
+ for (final Archive<?> archive : containerArchives) {
deploy(archive);
}
}
@@ -225,14 +225,16 @@ public class RemoteTomEEContainer extend
if (logger.isLoggable(Level.FINE)) {
final Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties());
- for (Map.Entry<Object, Object> entry : map.entrySet()) {
+ for (final Map.Entry<Object, Object> entry : map.entrySet()) {
logger.log(Level.FINE, String.format("%s = %s\n", entry.getKey(), entry.getValue()));
}
}
}
private boolean noLoggingConfigProvided() {
- if (configuration.getConf() == null) return true;
+ if (configuration.getConf() == null) {
+ return true;
+ }
final File conf = new File(configuration.getConf());
@@ -262,14 +264,14 @@ public class RemoteTomEEContainer extend
protected Deployer deployer() throws NamingException {
try {
return super.deployer();
- } catch (RuntimeException ne) {
+ } catch (final RuntimeException ne) {
// some debug lines
if (Boolean.getBoolean("openejb.arquillian.debug")) {
container.kill3UNIX();
LOGGER.info("Can't connect to deployer through: " + providerUrl());
try {
LOGGER.info("Here is the server.xml:\n" + IO.slurp(new File(Setup.findHome(new File(configuration.getDir()).getAbsoluteFile()), "conf/server.xml")));
- } catch (IOException ignored) {
+ } catch (final IOException ignored) {
// no-op
}
}
@@ -299,7 +301,7 @@ public class RemoteTomEEContainer extend
throw new UnsupportedOperationException("No more element");
}
- char endChar;
+ final char endChar;
if (string.charAt(currentIndex) == '"') {
currentIndex++;
endChar = '"';
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEEJBEnricherArchiveAppender.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEEJBEnricherArchiveAppender.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEEJBEnricherArchiveAppender.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEEJBEnricherArchiveAppender.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.remote;
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEExtension.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEExtension.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEExtension.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEExtension.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.remote;
@@ -54,7 +54,7 @@ public class RemoteTomEEExtension implem
builder.service(DeployableContainer.class, RemoteTomEEContainer.class)
.service(AuxiliaryArchiveAppender.class, RemoteTomEEEJBEnricherArchiveAppender.class)
.service(ResourceProvider.class, DeploymentExceptionProvider.class);
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
Logger.getLogger(RemoteTomEEExtension.class.getName()).log(Level.WARNING, "RemoteTomEEExtension: " + e.getMessage());
}
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEObserver.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEObserver.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEObserver.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEEObserver.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,19 +8,16 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.remote;
import org.apache.openejb.cdi.ThreadSingletonServiceImpl;
-import org.jboss.arquillian.container.spi.client.protocol.metadata.ProtocolMetaData;
-import org.jboss.arquillian.container.spi.context.annotation.DeploymentScoped;
-import org.jboss.arquillian.core.api.Instance;
import org.jboss.arquillian.core.api.InstanceProducer;
import org.jboss.arquillian.core.api.annotation.Inject;
import org.jboss.arquillian.core.api.annotation.Observes;
@@ -41,11 +38,11 @@ public class RemoteTomEEObserver {
@SuiteScoped
private InstanceProducer<Context> context;
- public void beforeSuite(@Observes BeforeSuite event) {
+ public void beforeSuite(@Observes final BeforeSuite event) {
beanManager.set(ThreadSingletonServiceImpl.get(Thread.currentThread().getContextClassLoader()).getBeanManagerImpl());
try {
context.set(new InitialContext());
- } catch (NamingException e) {
+ } catch (final NamingException e) {
// no-op
}
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEERemoteExtension.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEERemoteExtension.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEERemoteExtension.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-remote/src/main/java/org/apache/tomee/arquillian/remote/RemoteTomEERemoteExtension.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.remote;
@@ -26,7 +26,7 @@ import org.jboss.arquillian.transaction.
public class RemoteTomEERemoteExtension implements RemoteLoadableExtension {
@Override
- public void register(ExtensionBuilder builder) {
+ public void register(final ExtensionBuilder builder) {
builder.observer(RemoteTomEEObserver.class)
.service(TestEnricher.class, TomEEInjectionEnricher.class)
.service(TransactionProvider.class, OpenEJBTransactionProvider.class);
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappConfiguration.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappConfiguration.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappConfiguration.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappConfiguration.java Sat May 24 01:49:45 2014
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.webapp;
@@ -27,9 +27,6 @@ import java.util.List;
*/
@Prefixes({"tomee", "tomee.webapp"})
public class TomEEWebappConfiguration extends TomEEConfiguration {
- private static final String TOMCAT_REFERENCE_ARTIFACT = "org.apache.tomcat:tomcat-catalina";
- private static final String TOMCAT_VERSION_PREFIX = "7.";
-
private String tomcatVersion;
private String groupId;
private String artifactId;
@@ -43,7 +40,7 @@ public class TomEEWebappConfiguration ex
return groupId;
}
- public void setGroupId(String groupId) {
+ public void setGroupId(final String groupId) {
this.groupId = groupId;
}
@@ -51,7 +48,7 @@ public class TomEEWebappConfiguration ex
return artifactId;
}
- public void setArtifactId(String artifactId) {
+ public void setArtifactId(final String artifactId) {
this.artifactId = artifactId;
}
@@ -59,7 +56,7 @@ public class TomEEWebappConfiguration ex
return version;
}
- public void setVersion(String version) {
+ public void setVersion(final String version) {
this.version = version;
}
@@ -67,7 +64,7 @@ public class TomEEWebappConfiguration ex
return type;
}
- public void setType(String type) {
+ public void setType(final String type) {
this.type = type;
}
@@ -75,7 +72,7 @@ public class TomEEWebappConfiguration ex
return useInstallerServlet;
}
- public void setUseInstallerServlet(boolean useInstallerServlet) {
+ public void setUseInstallerServlet(final boolean useInstallerServlet) {
this.useInstallerServlet = useInstallerServlet;
}
@@ -89,7 +86,7 @@ public class TomEEWebappConfiguration ex
return tomcatVersion;
}
- public void setTomcatVersion(String tomcatVersion) {
+ public void setTomcatVersion(final String tomcatVersion) {
this.tomcatVersion = tomcatVersion;
}
@@ -97,7 +94,7 @@ public class TomEEWebappConfiguration ex
return removeUnusedWebapps;
}
- public void setRemoveUnusedWebapps(boolean removeUnusedWebapps) {
+ public void setRemoveUnusedWebapps(final boolean removeUnusedWebapps) {
this.removeUnusedWebapps = removeUnusedWebapps;
}
@@ -105,7 +102,7 @@ public class TomEEWebappConfiguration ex
return ajpPort;
}
- public void setAjpPort(int ajpPort) {
+ public void setAjpPort(final int ajpPort) {
this.ajpPort = ajpPort;
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappContainer.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -130,8 +130,8 @@ public class TomEEWebappContainer extend
}
if (logger.isLoggable(Level.FINE)) {
- Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties());
- for (Map.Entry<Object, Object> entry : map.entrySet()) {
+ final Map<Object, Object> map = new TreeMap<Object, Object>(System.getProperties());
+ for (final Map.Entry<Object, Object> entry : map.entrySet()) {
System.out.printf("%s = %s\n", entry.getKey(), entry.getValue());
}
}
@@ -175,16 +175,16 @@ public class TomEEWebappContainer extend
container = new RemoteServer();
container.start(Arrays.asList("-Dorg.apache.openejb.servlet.filters=" + ArquillianFilterRunner.class.getName() + "=" + ServletMethodExecutor.ARQUILLIAN_SERVLET_MAPPING), "start", true);
container.killOnExit();
- } catch (Exception e) {
+ } catch (final Exception e) {
throw new LifecycleException("Unable to start remote container", e);
}
}
- private static void write(URL resource, File file) throws IOException {
+ private static void write(final URL resource, final File file) throws IOException {
if (file.exists()) {
Files.delete(file);
}
- InputStream is = org.apache.openejb.loader.IO.read(resource);
+ final InputStream is = org.apache.openejb.loader.IO.read(resource);
try {
IO.copy(is, file);
@@ -193,13 +193,13 @@ public class TomEEWebappContainer extend
}
}
- protected void downloadOpenEJBWebapp(File targetDirectory) throws LifecycleException {
- String artifactName = configuration.getArtifactName();
- File zipFile = Setup.downloadFile(artifactName, null);
+ protected void downloadOpenEJBWebapp(final File targetDirectory) throws LifecycleException {
+ final String artifactName = configuration.getArtifactName();
+ final File zipFile = Setup.downloadFile(artifactName, null);
Zips.unzip(zipFile, targetDirectory);
}
- protected void downloadTomcat(File catalinaDirectory, String tomcatVersion) throws LifecycleException {
+ protected void downloadTomcat(final File catalinaDirectory, final String tomcatVersion) throws LifecycleException {
String source = null;
if (tomcatVersion.startsWith("7.")) {
@@ -218,7 +218,7 @@ public class TomEEWebappContainer extend
throw new LifecycleException("Unable to find URL for Tomcat " + tomcatVersion);
}
- File zipFile = Setup.downloadFile("org.apache.tomcat:tomcat:" + tomcatVersion + ":zip", source);
+ final File zipFile = Setup.downloadFile("org.apache.tomcat:tomcat:" + tomcatVersion + ":zip", source);
Zips.unzip(zipFile, catalinaDirectory);
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappEJBEnricherArchiveAppender.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappEJBEnricherArchiveAppender.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappEJBEnricherArchiveAppender.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappEJBEnricherArchiveAppender.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.webapp;
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappExtension.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.webapp;
@@ -55,7 +55,7 @@ public class TomEEWebappExtension implem
builder.service(DeployableContainer.class, TomEEWebappContainer.class)
.service(AuxiliaryArchiveAppender.class, TomEEWebappEJBEnricherArchiveAppender.class)
.service(ResourceProvider.class, DeploymentExceptionProvider.class);
- } catch (IllegalArgumentException e) {
+ } catch (final IllegalArgumentException e) {
Logger.getLogger(TomEEWebappExtension.class.getName()).log(Level.WARNING, "TomEEWebappExtension: " + e.getMessage());
}
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappObserver.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappObserver.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappObserver.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappObserver.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.webapp;
@@ -37,11 +37,11 @@ public class TomEEWebappObserver {
@SuiteScoped
private InstanceProducer<Context> context;
- public void beforeSuite(@Observes BeforeSuite event) {
+ public void beforeSuite(@Observes final BeforeSuite event) {
beanManager.set(ThreadSingletonServiceImpl.get(Thread.currentThread().getContextClassLoader()).getBeanManagerImpl());
try {
context.set(new InitialContext());
- } catch (NamingException e) {
+ } catch (final NamingException e) {
// no-op
}
}
Modified: tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappRemoteExtension.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappRemoteExtension.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappRemoteExtension.java (original)
+++ tomee/tomee/trunk/arquillian/arquillian-tomee-webapp-remote/src/main/java/org/apache/tomee/arquillian/webapp/TomEEWebappRemoteExtension.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.tomee.arquillian.webapp;
@@ -26,7 +26,7 @@ import org.jboss.arquillian.transaction.
public class TomEEWebappRemoteExtension implements RemoteLoadableExtension {
@Override
- public void register(ExtensionBuilder builder) {
+ public void register(final ExtensionBuilder builder) {
builder.observer(TomEEWebappObserver.class)
.service(TestEnricher.class, TomEEInjectionEnricher.class)
.service(TransactionProvider.class, OpenEJBTransactionProvider.class);
Modified: tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Archive.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Archive.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Archive.java (original)
+++ tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Archive.java Sat May 24 01:49:45 2014
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.ziplock;
@@ -42,25 +42,25 @@ public class Archive {
return new Archive();
}
- public Archive manifest(String key, Object value) {
+ public Archive manifest(final String key, final Object value) {
manifest.put(key, value.toString());
return this;
}
- public Archive manifest(String key, Class value) {
+ public Archive manifest(final String key, final Class value) {
manifest.put(key, value.getName());
return this;
}
- public Archive copyTo(String path, File file) {
+ public Archive copyTo(final String path, final File file) {
if (file.isDirectory()) {
- for (File child : file.listFiles()) {
+ for (final File child : file.listFiles()) {
copyTo(path + "/" + child.getName(), child);
}
} else {
try {
entries.put(path, IO.readBytes(file));
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new RuntimeException(e);
}
}
@@ -68,7 +68,7 @@ public class Archive {
return this;
}
- public Archive addTo(String path, Class<?> clazz) {
+ public Archive addTo(final String path, final Class<?> clazz) {
try {
final String name = clazz.getName().replace('.', '/') + ".class";
@@ -89,7 +89,7 @@ public class Archive {
} else {
entries.put(name, to.toByteArray());
}
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new IllegalStateException(e);
}
@@ -97,7 +97,7 @@ public class Archive {
}
- public Archive add(Class<?> clazz) {
+ public Archive add(final Class<?> clazz) {
return addTo(null, clazz);
}
@@ -112,7 +112,7 @@ public class Archive {
// Create the ZIP file
final ZipOutputStream out = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(file)));
- for (Map.Entry<String, byte[]> entry : entries().entrySet()) {
+ for (final Map.Entry<String, byte[]> entry : entries().entrySet()) {
out.putNextEntry(new ZipEntry(entry.getKey()));
out.write(entry.getValue());
}
@@ -125,7 +125,7 @@ public class Archive {
public File asJar() {
try {
return toJar();
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new RuntimeException(e);
}
}
@@ -133,22 +133,22 @@ public class Archive {
public File asJar(final String prefix, final String suffix) {
try {
return toJar(prefix, suffix);
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new RuntimeException(e);
}
}
public File toDir() throws IOException {
- File classpath = Files.tmpdir();
+ final File classpath = Files.tmpdir();
- for (Map.Entry<String, byte[]> entry : entries().entrySet()) {
+ for (final Map.Entry<String, byte[]> entry : entries().entrySet()) {
final String key = entry.getKey().replace('/', File.separatorChar);
final File file = new File(classpath, key);
- File d = file.getParentFile();
+ final File d = file.getParentFile();
if (!d.exists()) {
if (!d.mkdirs()) {
@@ -156,7 +156,7 @@ public class Archive {
}
}
- BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));
+ final BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));
out.write(entry.getValue());
@@ -169,7 +169,7 @@ public class Archive {
public File asDir() {
try {
return toDir();
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new RuntimeException(e);
}
}
@@ -183,7 +183,7 @@ public class Archive {
private String buildManifest() {
return Join.join("\r\n", new Join.NameCallback<Map.Entry<String, String>>() {
@Override
- public String getName(Map.Entry<String, String> entry) {
+ public String getName(final Map.Entry<String, String> entry) {
return entry.getKey() + ": " + entry.getValue();
}
}, manifest.entrySet());
Modified: tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/ClassLoaders.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/ClassLoaders.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/ClassLoaders.java (original)
+++ tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/ClassLoaders.java Sat May 24 01:49:45 2014
@@ -1,4 +1,4 @@
-/**
+/*
* 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.
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.ziplock;
@@ -93,14 +93,16 @@ public final class ClassLoaders {
return null;
}
- public static String decode(String fileName) {
- if (fileName.indexOf('%') == -1) return fileName;
+ public static String decode(final String fileName) {
+ if (fileName.indexOf('%') == -1) {
+ return fileName;
+ }
- StringBuilder result = new StringBuilder(fileName.length());
- ByteArrayOutputStream out = new ByteArrayOutputStream();
+ final StringBuilder result = new StringBuilder(fileName.length());
+ final ByteArrayOutputStream out = new ByteArrayOutputStream();
for (int i = 0; i < fileName.length();) {
- char c = fileName.charAt(i);
+ final char c = fileName.charAt(i);
if (c == '%') {
out.reset();
@@ -109,8 +111,8 @@ public final class ClassLoaders {
throw new IllegalArgumentException("Incomplete % sequence at: " + i);
}
- int d1 = Character.digit(fileName.charAt(i + 1), 16);
- int d2 = Character.digit(fileName.charAt(i + 2), 16);
+ final int d1 = Character.digit(fileName.charAt(i + 1), 16);
+ final int d2 = Character.digit(fileName.charAt(i + 2), 16);
if (d1 == -1 || d2 == -1) {
throw new IllegalArgumentException("Invalid % sequence (" + fileName.substring(i, i + 3) + ") at: " + String.valueOf(i));
@@ -148,7 +150,7 @@ public final class ClassLoaders {
}
- private static boolean isSurefire(ClassLoader classLoader) {
+ private static boolean isSurefire(final ClassLoader classLoader) {
return System.getProperty("surefire.real.class.path") != null && classLoader == SYSTEM;
}
Modified: tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Files.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Files.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Files.java (original)
+++ tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Files.java Sat May 24 01:49:45 2014
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.ziplock;
@@ -44,19 +44,27 @@ public class Files {
public static List<File> collect(final File dir, final FileFilter filter) {
final List<File> accepted = new ArrayList<File>();
- if (filter.accept(dir)) accepted.add(dir);
+ if (filter.accept(dir)) {
+ accepted.add(dir);
+ }
final File[] files = dir.listFiles();
- if (files != null) for (final File file : files) {
- accepted.addAll(collect(file, filter));
+ if (files != null) {
+ for (final File file : files) {
+ accepted.addAll(collect(file, filter));
+ }
}
return accepted;
}
public static void remove(final File file) {
- if (file == null) return;
- if (!file.exists()) return;
+ if (file == null) {
+ return;
+ }
+ if (!file.exists()) {
+ return;
+ }
if (file.isDirectory()) {
final File[] files = file.listFiles();
@@ -77,7 +85,7 @@ public class Files {
File file = null;
try {
file = File.createTempFile("temp", "dir");
- } catch (Throwable e) {
+ } catch (final Throwable e) {
//Use a local tmp directory
final File tmp = new File("tmp");
if (!tmp.exists() && !tmp.mkdirs()) {
@@ -96,14 +104,18 @@ public class Files {
return file;
- } catch (IOException e) {
+ } catch (final IOException e) {
throw new RuntimeException(e);
}
}
public static File mkdir(final File file) {
- if (file.exists()) return file;
- if (!file.mkdirs()) throw new RuntimeException("Cannot mkdir: " + file.getAbsolutePath());
+ if (file.exists()) {
+ return file;
+ }
+ if (!file.mkdirs()) {
+ throw new RuntimeException("Cannot mkdir: " + file.getAbsolutePath());
+ }
return file;
}
@@ -120,7 +132,7 @@ public class Files {
for (final String path : delete) {
try {
remove(new File(path));
- } catch (Throwable e) {
+ } catch (final Throwable e) {
System.err.println(e.getMessage());
}
}
@@ -128,7 +140,7 @@ public class Files {
};
try {
Runtime.getRuntime().addShutdownHook(deleteShutdownHook);
- } catch (Throwable e) {
+ } catch (final Throwable e) {
//Ignore
}
} finally {
Modified: tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/IO.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/IO.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/IO.java (original)
+++ tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/IO.java Sat May 24 01:49:45 2014
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.ziplock;
@@ -71,7 +71,7 @@ public class IO {
return new String(bytes);
}
- public static byte[] readBytes(File file) throws IOException {
+ public static byte[] readBytes(final File file) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
copy(file, out);
return out.toByteArray();
@@ -82,7 +82,7 @@ public class IO {
return new String(bytes, "UTF-8");
}
- public static byte[] readBytes(InputStream in) throws IOException {
+ public static byte[] readBytes(final InputStream in) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
copy(in, out);
return out.toByteArray();
@@ -93,7 +93,7 @@ public class IO {
return new String(bytes);
}
- public static byte[] readBytes(URL url) throws IOException {
+ public static byte[] readBytes(final URL url) throws IOException {
final ByteArrayOutputStream out = new ByteArrayOutputStream();
copy(url, out);
return out.toByteArray();
@@ -170,21 +170,27 @@ public class IO {
}
public static void close(final Closeable closeable) throws IOException {
- if (closeable == null) return;
+ if (closeable == null) {
+ return;
+ }
try {
if (closeable instanceof Flushable) {
((Flushable) closeable).flush();
}
- } catch (IOException e) {
+ } catch (final IOException e) {
+ // no-op
}
try {
closeable.close();
- } catch (IOException e) {
+ } catch (final IOException e) {
+ // no-op
}
}
public static boolean delete(final File file) {
- if (file == null) return false;
+ if (file == null) {
+ return false;
+ }
if (!file.delete()) {
System.err.println("Delete failed " + file.getAbsolutePath());
return false;
Modified: tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/JarLocation.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/JarLocation.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/JarLocation.java (original)
+++ tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/JarLocation.java Sat May 24 01:49:45 2014
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.ziplock;
@@ -64,13 +64,15 @@ public class JarLocation {
}
if ("jar".equals(url.getProtocol())) {
- String spec = url.getFile();
+ final String spec = url.getFile();
int separator = spec.indexOf('!');
/*
* REMIND: we don't handle nested JAR URLs
*/
- if (separator == -1) throw new MalformedURLException("no ! found in jar url spec:" + spec);
+ if (separator == -1) {
+ throw new MalformedURLException("no ! found in jar url spec:" + spec);
+ }
url = new URL(spec.substring(0, separator++));
@@ -100,7 +102,7 @@ public class JarLocation {
}
}
- private static File toFile(String classFileName, URL url) {
+ private static File toFile(final String classFileName, final URL url) {
String path = url.getFile();
path = path.substring(0, path.length() - classFileName.length());
return new File(decode(path));
Modified: tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Join.java
URL: http://svn.apache.org/viewvc/tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Join.java?rev=1597233&r1=1597232&r2=1597233&view=diff
==============================================================================
--- tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Join.java (original)
+++ tomee/tomee/trunk/arquillian/ziplock/src/main/java/org/apache/ziplock/Join.java Sat May 24 01:49:45 2014
@@ -8,11 +8,11 @@
*
* 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.
+ * 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.
*/
package org.apache.ziplock;
@@ -28,54 +28,54 @@ public class Join {
public static final ClassCallback CLASS_CALLBACK = new ClassCallback();
- public static String join(String delimiter, Collection collection) {
+ public static String join(final String delimiter, final Collection collection) {
if (collection.size() == 0) {
return "";
}
- StringBuilder sb = new StringBuilder();
- for (Object obj : collection) {
+ final StringBuilder sb = new StringBuilder();
+ for (final Object obj : collection) {
sb.append(obj).append(delimiter);
}
return sb.substring(0, sb.length() - delimiter.length());
}
- public static String join(String delimiter, Object... collection) {
+ public static String join(final String delimiter, final Object... collection) {
if (collection.length == 0) {
return "";
}
- StringBuilder sb = new StringBuilder();
- for (Object obj : collection) {
+ final StringBuilder sb = new StringBuilder();
+ for (final Object obj : collection) {
sb.append(obj).append(delimiter);
}
return sb.substring(0, sb.length() - delimiter.length());
}
- public static <T> String join(String delimiter, NameCallback<T> nameCallback, T... collection) {
+ public static <T> String join(final String delimiter, final NameCallback<T> nameCallback, final T... collection) {
if (collection.length == 0) {
return "";
}
- StringBuilder sb = new StringBuilder();
- for (T obj : collection) {
+ final StringBuilder sb = new StringBuilder();
+ for (final T obj : collection) {
sb.append(nameCallback.getName(obj)).append(delimiter);
}
return sb.substring(0, sb.length() - delimiter.length());
}
- public static <T> String join(String delimiter, NameCallback<T> nameCallback, Collection<T> collection) {
+ public static <T> String join(final String delimiter, final NameCallback<T> nameCallback, final Collection<T> collection) {
if (collection.size() == 0) {
return "";
}
- StringBuilder sb = new StringBuilder();
- for (T obj : collection) {
+ final StringBuilder sb = new StringBuilder();
+ for (final T obj : collection) {
sb.append(nameCallback.getName(obj)).append(delimiter);
}
return sb.substring(0, sb.length() - delimiter.length());
}
- public static <T> List<String> strings(Collection<T> collection, NameCallback<T> callback) {
+ public static <T> List<String> strings(final Collection<T> collection, final NameCallback<T> callback) {
final List<String> list = new ArrayList<String>();
- for (T t : collection) {
+ for (final T t : collection) {
final String name = callback.getName(t);
list.add(name);
}
@@ -83,28 +83,27 @@ public class Join {
return list;
}
- public static interface NameCallback<T> {
-
- public String getName(T object);
+ public interface NameCallback<T> {
+ String getName(T object);
}
public static class FileCallback implements NameCallback<File> {
- public String getName(File file) {
+ public String getName(final File file) {
return file.getName();
}
}
public static class MethodCallback implements NameCallback<Method> {
- public String getName(Method method) {
+ public String getName(final Method method) {
return method.getName();
}
}
public static class ClassCallback implements NameCallback<Class<?>> {
- public String getName(Class<?> cls) {
+ public String getName(final Class<?> cls) {
return cls.getName();
}
}