Skip to content

Commit

Permalink
Merge pull request #730 from ArcBees/ol_small_cleanup
Browse files Browse the repository at this point in the history
Small cleanup
  • Loading branch information
Olivier Lafleur committed Sep 21, 2015
2 parents fe71e72 + f191eaa commit 6c920bd
Show file tree
Hide file tree
Showing 37 changed files with 73 additions and 100 deletions.
2 changes: 0 additions & 2 deletions .gitignore
@@ -1,5 +1,3 @@
gwt-unitCache
www-test
target
.project
*.iml
Expand Down
Expand Up @@ -79,7 +79,7 @@ public final class CrawlFilter implements Filter {
* characters that were escaped by the crawler. If the query string does not
* contain _escaped_fragment_, it is not modified.
*
* @param queryString
* @param queryString query string
* @return A modified query string followed by a hash fragment if applicable.
* The non-modified query string otherwise.
* @throws UnsupportedEncodingException
Expand Down
Expand Up @@ -24,7 +24,7 @@ public interface ExceptionHandler {
/**
* {@link ExceptionHandler}'s status enumeration.
*/
public enum Status {
enum Status {
CONTINUE, STOP
}

Expand Down
Expand Up @@ -59,7 +59,7 @@ public abstract class AbstractCachingClientActionHandler<A, R> extends AbstractC
private final Cache cache;

// Holds callbacks, so that for multiple requests before the first returns (is served), we save round trips as well
private Map<A, List<CallbackDispatchRequest<R>>> pendingRequestCallbackMap =
private final Map<A, List<CallbackDispatchRequest<R>>> pendingRequestCallbackMap =
new HashMap<A, List<CallbackDispatchRequest<R>>>();

public AbstractCachingClientActionHandler(Class<A> actionType, Cache cache) {
Expand Down
Expand Up @@ -45,7 +45,7 @@ public long getLastUpdateTime() {
}
}

private Map<Object, CacheValue> map;
private final Map<Object, CacheValue> map;
private long autoExpireTimeInMs;

/**
Expand Down
Expand Up @@ -23,7 +23,7 @@
* This class is used by {@link RestAction} to associate a parameter name to a value.
*/
public interface HttpParameter {
public enum Type {
enum Type {
/** Represent {@link javax.ws.rs.CookieParam @CookieParam} parameters. */
COOKIE,
/** Represent {@link javax.ws.rs.FormParam @FormParam} parameters. */
Expand Down
Expand Up @@ -109,8 +109,8 @@ private void maybeAddSecurityToken(String securityToken, RestAction<?> action, L
}
}

private boolean addGlobalHeaders(RestAction<?> action, List<HttpParameter> headerParams) {
return headerParams.addAll(globalParams.get(action.getHttpMethod()));
private void addGlobalHeaders(RestAction<?> action, List<HttpParameter> headerParams) {
headerParams.addAll(globalParams.get(action.getHttpMethod()));
}

private void addActionHeaders(RestAction<?> action, List<HttpParameter> headerParams) {
Expand Down
Expand Up @@ -39,9 +39,10 @@ public class DefaultGinModuleGenerator extends AbstractVelocityGenerator impleme
private static final String TEMPLATE = "com/gwtplatform/dispatch/rest/rebind/gin/GinModule.vm";
private static final String GIN_MODULE_PROPERTY = "gwtp.dispatch.rest.ginModule";

private final List<RegisterGinBindingEvent> bindings;

private String packageName;
private String implName;
private List<RegisterGinBindingEvent> bindings;

@Inject
DefaultGinModuleGenerator(
Expand Down
Expand Up @@ -29,7 +29,7 @@
public class CookieParamValueResolverTest {
private static final String SOME_VALUE = "llamas";

private CookieParamValueResolver resolver = new CookieParamValueResolver();
private final CookieParamValueResolver resolver = new CookieParamValueResolver();

@Test
public void resolve_cookieParam() {
Expand Down
Expand Up @@ -29,7 +29,7 @@
public class MatrixParamValueResolverTest {
private static final String VALUE = "tiger";

private MatrixParamValueResolver resolver = new MatrixParamValueResolver();
private final MatrixParamValueResolver resolver = new MatrixParamValueResolver();

@Test
public void resolve_matrixParam() {
Expand Down
Expand Up @@ -57,7 +57,7 @@ public abstract class AbstractCachingRpcInterceptor<A, R> extends AbstractRpcInt
private final Cache cache;

// Holds callbacks, so that for multiple requests before the first returns (is served), we save round trips as well
private Map<A, List<CallbackDispatchRequest<R>>> pendingRequestCallbackMap =
private final Map<A, List<CallbackDispatchRequest<R>>> pendingRequestCallbackMap =
new HashMap<A, List<CallbackDispatchRequest<R>>>();

public AbstractCachingRpcInterceptor(Class<A> actionType, Cache cache) {
Expand Down
Expand Up @@ -42,7 +42,7 @@ public long getLastUpateTime() {
}
}

private Map<Object, CacheValue> map;
private final Map<Object, CacheValue> map;
private long autoExpireTimeInMs;

/**
Expand Down
Expand Up @@ -37,9 +37,9 @@
* {@link HandlerModule} instances.
*/
public class DispatchModule extends AbstractModule {
private Class<? extends Dispatch> dispatchClass;
private Class<? extends ActionHandlerValidatorRegistry> actionHandlerValidatorRegistryClass;
private Class<? extends RequestProvider> requestProviderClass;
private final Class<? extends Dispatch> dispatchClass;
private final Class<? extends ActionHandlerValidatorRegistry> actionHandlerValidatorRegistryClass;
private final Class<? extends RequestProvider> requestProviderClass;

/**
* A DispatchModule builder.
Expand Down
Expand Up @@ -39,7 +39,7 @@ public GuiceBindingDescriptorAdapter(Binding<B> binding) {
}
}

private Injector injector;
private final Injector injector;

public GuiceBeanProvider(Injector injector) {
this.injector = injector;
Expand Down
Expand Up @@ -26,7 +26,7 @@
@Singleton
public class DefaultRequestProvider implements RequestProvider {

private Provider<HttpServletRequest> requestProvider;
private final Provider<HttpServletRequest> requestProvider;

@Inject
public DefaultRequestProvider(Provider<HttpServletRequest> requestProvider) {
Expand Down
Expand Up @@ -39,7 +39,7 @@ public SpringBindingDescriptorAdapter(Entry<String, B> binding) {
}
}

private ApplicationContext applicationContext;
private final ApplicationContext applicationContext;

public SpringBeanProvider(ApplicationContext applicationContext) {
this.applicationContext = applicationContext;
Expand Down
Expand Up @@ -115,7 +115,7 @@ private boolean containValidator(ActionValidator actionValidator) {

private ActionHandlerValidatorInstance createInstance(
ActionHandlerValidatorClass<? extends Action<?>, ? extends Result> actionHandlerValidatorClass) {
ActionHandlerValidatorInstance actionHandlerValidatorInstance = null;
ActionHandlerValidatorInstance actionHandlerValidatorInstance;
ActionValidator actionValidator = findActionValidator(actionHandlerValidatorClass.getActionValidatorClass());

ActionHandler<?, ?> actionHandler = SpringUtils.getInstance(applicationContext,
Expand Down
Expand Up @@ -53,7 +53,7 @@ public abstract class AbstractDispatchServiceImpl extends RemoteServiceServlet i
"the security cookie?)";
protected final Dispatch dispatch;
protected final Logger logger;
protected RequestProvider requestProvider;
protected final RequestProvider requestProvider;

protected AbstractDispatchServiceImpl(Logger logger,
Dispatch dispatch,
Expand Down
Expand Up @@ -33,7 +33,7 @@ public interface BeanProvider {
/**
* @param <B>
*/
public interface BindingDescriptor<B> {
interface BindingDescriptor<B> {

String getBeanName();

Expand All @@ -47,8 +47,8 @@ public interface BindingDescriptor<B> {
*/
public static class CommonBindingDescriptor<B> implements BindingDescriptor<B> {

private String name;
private B bean;
private final String name;
private final B bean;

public CommonBindingDescriptor(B bean, String name) {
this.name = name;
Expand Down
Expand Up @@ -30,8 +30,9 @@
*/
public final class DelayedBindRegistry {

private static final List<DelayedBind> delayedBindObjects = new ArrayList<DelayedBind>();

private static Ginjector ginjector;
private static List<DelayedBind> delayedBindObjects = new ArrayList<DelayedBind>();

/**
* Bind all the registered classes, by calling their
Expand Down
Expand Up @@ -311,7 +311,7 @@ public void fireEvent(GwtEvent<?> event) {
* Fires the given event to the handlers listening to the event's type.
* <p>
* Any exceptions thrown by handlers will be bundled into a
* {@link UmbrellaException} and then re-thrown after all handlers have
* {@link com.google.gwt.event.shared.UmbrellaException UmbrellaException} and then re-thrown after all handlers have
* completed. An exception thrown by a handler will not prevent other handlers
* from executing.
*
Expand Down
Expand Up @@ -70,7 +70,7 @@
@Target(ElementType.TYPE)
public @interface ProxyCodeSplitBundle {

public final class NoOpProviderBundle extends ProviderBundle {
final class NoOpProviderBundle extends ProviderBundle {
private NoOpProviderBundle(int bundleSize) {
super(bundleSize);
}
Expand Down
Expand Up @@ -24,7 +24,7 @@ public class CenterPopupPositioner extends PopupPositioner {
/**
* By default this method centers the popup horizontally.
* You can override this method to change the horizontal position of the popup.
* @param popupWidth
* @param popupWidth the width of the popup
* @return the left position of the popup
*/
protected int getLeft(int popupWidth) {
Expand All @@ -34,7 +34,7 @@ protected int getLeft(int popupWidth) {
/**
* By default this method centers the popup vertically.
* You can override this method to change the vertical position of the popup.
* @param popupHeight
* @param popupHeight the height of the popup
* @return the top position of the popup.
*/
protected int getTop(int popupHeight) {
Expand Down
Expand Up @@ -17,8 +17,8 @@

public abstract class PopupPositioner {
public static class PopupPosition {
private int top;
private int left;
private final int top;
private final int left;

public PopupPosition(int left, int top) {
this.left = left;
Expand Down
Expand Up @@ -20,8 +20,8 @@
* Positions the popup at the left and top coordinates.
*/
public class TopLeftPopupPositioner extends PopupPositioner {
private int left;
private int top;
private final int left;
private final int top;

public TopLeftPopupPositioner(int left, int top) {
super();
Expand Down
Expand Up @@ -30,21 +30,16 @@

public class ProxyGenerator extends Generator {

private ClassCollection classCollection;
private GinjectorInspector ginjectorInspector;
private PresenterInspector presenterInspector;
private ProxyOutputterFactory proxyOutputterFactory;

@Override
public String generate(TreeLogger logger, GeneratorContext ctx,
String requestedClass) throws UnableToCompleteException {
// Initialize dependencies
TypeOracle oracle = ctx.getTypeOracle();
classCollection = new ClassCollection(oracle);
ginjectorInspector = new GinjectorInspector(classCollection, ctx, logger);
presenterInspector = new PresenterInspector(oracle, logger, classCollection,
ClassCollection classCollection = new ClassCollection(oracle);
GinjectorInspector ginjectorInspector = new GinjectorInspector(classCollection, ctx, logger);
PresenterInspector presenterInspector = new PresenterInspector(oracle, logger, classCollection,
ginjectorInspector);
proxyOutputterFactory = new ProxyOutputterFactory(oracle, logger, classCollection,
ProxyOutputterFactory proxyOutputterFactory = new ProxyOutputterFactory(oracle, logger, classCollection,
ginjectorInspector, presenterInspector);

// Find the requested class
Expand Down
Expand Up @@ -47,7 +47,7 @@ public interface MyView extends View {
public interface MyProxy extends Proxy<MainPresenterTestUtil> {
}

private PresenterWidget<?> subPresenter;
private final PresenterWidget<?> subPresenter;

@Inject
public MainPresenterTestUtil(final EventBus eventBus, final MyView view,
Expand Down
Expand Up @@ -35,7 +35,7 @@ public class AsyncEventPresenterTestUtil extends
AsyncCallFailHandler,
AsyncCallStartHandler, AsyncCallSucceedHandler {

private DispatchAsync dispatcher;
private final DispatchAsync dispatcher;

/**
* Presenter's view.
Expand Down
Expand Up @@ -72,12 +72,12 @@ private static class RouteMatch implements Comparable<RouteMatch> {
/**
* Route/place-token associated to the match.
*/
String route;
final String route;

/**
* Number of static matches in this route.
*/
int staticMatches;
final int staticMatches;

/**
* Parsed parameters of this route.
Expand Down

0 comments on commit 6c920bd

Please sign in to comment.