Cleanup some warnings

git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@743883 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Musachy Barroso
2009-02-12 21:06:41 +00:00
parent 3334651a89
commit 09871d7da2
6 changed files with 11 additions and 10 deletions
@@ -94,10 +94,11 @@ public class ClasspathConfigurationProvider implements ConfigurationProvider, Di
}
/**
* Depends on devMode, relead and actionConfigBuilder.needsReload()
* @return Always false.
*/
public boolean needsReload() {
return devMode && reload ? actionConfigBuilder.needsReload() : false;
return devMode && reload && actionConfigBuilder.needsReload();
}
public void dispatcherInitialized(Dispatcher du) {
@@ -98,7 +98,7 @@ public class DefaultInterceptorMapBuilder implements InterceptorMapBuilder {
PackageConfig.Builder builder, InterceptorRef ref, Map params) {
return InterceptorBuilder.constructInterceptorReference(builder, ref
.value(), params, builder.build().getLocation(),
(ObjectFactory) configuration.getContainer().getInstance(
configuration.getContainer().getInstance(
ObjectFactory.class));
}
@@ -45,6 +45,7 @@ import org.apache.struts2.convention.annotation.Namespaces;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.classloader.ReloadingClassLoader;
import org.apache.struts2.StrutsConstants;
import org.apache.struts2.StrutsException;
import com.opensymphony.xwork2.ObjectFactory;
import com.opensymphony.xwork2.config.Configuration;
@@ -117,7 +118,7 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
this.configuration = configuration;
this.actionNameBuilder = container.getInstance(ActionNameBuilder.class, container.getInstance(String.class, ConventionConstants.CONVENTION_ACTION_NAME_BUILDER));
this.resultMapBuilder = container.getInstance(ResultMapBuilder.class, container.getInstance(String.class, ConventionConstants.CONVENTION_RESULT_MAP_BUILDER));
this.interceptorMapBuilder = container.getInstance(InterceptorMapBuilder.class, container.getInstance(String.class, ConventionConstants.CONVENTION_INTERCEPTOR_MAP_BUILDER));;
this.interceptorMapBuilder = container.getInstance(InterceptorMapBuilder.class, container.getInstance(String.class, ConventionConstants.CONVENTION_INTERCEPTOR_MAP_BUILDER));
this.objectFactory = objectFactory;
this.redirectToSlash = Boolean.parseBoolean(redirectToSlash);
@@ -435,9 +436,9 @@ public class PackageBasedActionConfigBuilder implements ActionConfigBuilder {
try {
objectFactory.getClassInstance(actionClass.getName());
} catch (ClassNotFoundException e) {
// Impossible
new Throwable().printStackTrace();
System.exit(1);
if (LOG.isErrorEnabled())
LOG.error("Object Factory was unable to load class [#0]", e, actionClass.getName());
throw new StrutsException("Object Factory was unable to load class " + actionClass.getName(), e);
}
// Determine the action package
@@ -29,7 +29,6 @@ public interface ResourceStore {
byte[] read(final String pResourceName);
//FIXME: return the result of the remove
void remove(final String pResourceName);
}
@@ -42,8 +42,7 @@ public final class ResourceStoreClassLoader extends ClassLoader {
private Class fastFindClass(final String name) {
if (stores != null) {
for (int i = 0; i < stores.length; i++) {
final ResourceStore store = stores[i];
for (final ResourceStore store : stores) {
final byte[] clazzBytes = store.read(name.replace('.', '/') + ".class");
if (clazzBytes != null) {
return defineClass(name, clazzBytes, 0, clazzBytes.length);
@@ -505,7 +505,8 @@ public class PackageBasedActionConfigBuilderTest extends TestCase {
assertNotNull(result);
assertTrue(result instanceof ActionChainResult);
ActionChainResult chainResult = (ActionChainResult) result;
ActionChainResult chainResultToCompare = new ActionChainResult("/chain", "foo-bar", "bar");
ActionChainResult chainResultToCompare = new ActionChainResult(null, "foo-bar", null);
assertEquals(chainResultToCompare, chainResult);
}
private void verifyActionConfig(PackageConfig pkgConfig, String actionName, Class<?> actionClass,