Skip to content

Commit

Permalink
Fixed about 600 warns.
Browse files Browse the repository at this point in the history
  • Loading branch information
Acarus committed Sep 29, 2016
1 parent 926b41c commit fc65aac
Show file tree
Hide file tree
Showing 63 changed files with 1,411 additions and 857 deletions.
Expand Up @@ -34,6 +34,8 @@
import com.google.gwt.user.client.ui.RootLayoutPanel;
import com.google.web.bindery.event.shared.EventBus;

import jline.internal.Log;

import org.kaaproject.kaa.common.dto.KaaAuthorityDto;
import org.kaaproject.kaa.common.dto.admin.AuthResultDto;
import org.kaaproject.kaa.common.dto.admin.AuthResultDto.Result;
Expand Down Expand Up @@ -89,7 +91,8 @@ public static boolean isDevMode() {
}

public static void signOut() {
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, GWT.getModuleBaseURL() + "j_spring_security_logout");
RequestBuilder builder = new RequestBuilder(
RequestBuilder.POST, GWT.getModuleBaseURL() + "j_spring_security_logout");
try {
builder.sendRequest(null, new RequestCallback() {
@Override
Expand All @@ -103,7 +106,8 @@ public void onError(Request request, Throwable exception) {
redirectToModule("..");
}
});
} catch (RequestException e) {
} catch (RequestException ex) {
GWT.log("Exception: " + ex.getMessage());
}
}

Expand Down Expand Up @@ -154,14 +158,14 @@ private void init() {

dataSource = new DataSource(eventBus);

PlaceController placeController = clientFactory.getPlaceController();

ActivityMapper headerActivityMapper = new HeaderActivityMapper(clientFactory);
ActivityManager headerActivityManager = new ActivityManager(headerActivityMapper, eventBus);
headerActivityManager.setDisplay(appWidget.getAppHeaderHolder());

ActivityMapper navigationActivityMapper = new NavigationActivityMapper(clientFactory, eventBus);
ActivityManager navigationActivityManager = new ActivityManager(navigationActivityMapper, eventBus);
ActivityMapper navigationActivityMapper = new NavigationActivityMapper(
clientFactory, eventBus);
ActivityManager navigationActivityManager = new ActivityManager(
navigationActivityMapper, eventBus);
navigationActivityManager.setDisplay(appWidget.getNavContentHolder());

ActivityMapper appActivityMapper = new AppActivityMapper(clientFactory);
Expand All @@ -186,7 +190,8 @@ private void init() {
historyMapper = GWT.create(TenantUserPlaceHistoryMapper.class);
clientFactory.setHomePlace(new ApplicationsPlace());
break;

default:
break;
}

PlaceHistoryHandler historyHandler = new PlaceHistoryHandler(historyMapper);
Expand All @@ -198,6 +203,7 @@ private void init() {
place = new ApplicationsPlace();
}

PlaceController placeController = clientFactory.getPlaceController();
historyHandler.register(placeController, eventBus, place);

RootLayoutPanel.get().add(appWidget);
Expand Down
Expand Up @@ -54,8 +54,8 @@ public CustomDeckLayoutPanel() {
}

@Override
public void add(Widget w) {
insert(w, getWidgetCount());
public void add(Widget widget) {
insert(widget, getWidgetCount());
}

@Override
Expand Down Expand Up @@ -114,8 +114,8 @@ public int getVisibleWidgetIndex() {
}

@Override
public void insert(IsWidget w, int beforeIndex) {
insert(asWidgetOrNull(w), beforeIndex);
public void insert(IsWidget widget, int beforeIndex) {
insert(asWidgetOrNull(widget), beforeIndex);
}

@Override
Expand Down Expand Up @@ -190,20 +190,20 @@ public void onResize() {
}

@Override
public boolean remove(Widget w) {
boolean removed = super.remove(w);
public boolean remove(Widget widget) {
boolean removed = super.remove(widget);
if (removed) {
Layer layer = (Layer) w.getLayoutData();
Layer layer = (Layer) widget.getLayoutData();
layout.removeChild(layer);
w.setLayoutData(null);
widget.setLayoutData(null);

if (visibleWidget == w) {
if (visibleWidget == widget) {
visibleWidget = null;
}
if (hidingWidget == w) {
if (hidingWidget == widget) {
hidingWidget = null;
}
if (lastVisibleWidget == w) {
if (lastVisibleWidget == widget) {
lastVisibleWidget = null;
}
}
Expand All @@ -215,23 +215,23 @@ public boolean remove(Widget w) {
* is added to the end of the panel. If the specified widget is null, the
* currently-visible widget will be hidden.
*
* @param w the widget to show, and add if not a child
* @param widget the widget to show, and add if not a child
*/
@Override
public void setWidget(IsWidget w) {
public void setWidget(IsWidget widget) {
// Hide the currently visible widget.
if (w == null) {
if (widget == null) {
showWidget(null);
return;
}

// Add the widget if it is not already a child.
if (w.asWidget().getParent() != this) {
add(w);
if (widget.asWidget().getParent() != this) {
add(widget);
}

// Show the widget.
showWidget(w.asWidget());
showWidget(widget.asWidget());
}

/**
Expand Down Expand Up @@ -294,7 +294,8 @@ protected void onDetach() {
* @param widget the widget to check
*/
void assertIsChild(Widget widget) {
assert (widget == null) || (widget.getParent() == this) : "The specified widget is not a child of this panel";
assert (widget == null)
|| (widget.getParent() == this) : "The specified widget is not a child of this panel";
}

/**
Expand Down Expand Up @@ -322,8 +323,8 @@ private void doBeforeLayout() {
int oldIndex = getWidgetIndex(lastVisibleWidget);
int newIndex = getWidgetIndex(visibleWidget);
double direction = (oldIndex < newIndex) ? 100.0 : -100.0;
double vDirection = isAnimationVertical ? direction : 0.0;
double hDirection = isAnimationVertical ? 0.0
double vertDirection = isAnimationVertical ? direction : 0.0;
double horizDirection = isAnimationVertical ? 0.0
: LocaleInfo.getCurrentLocale().isRTL() ? -direction : direction;

/*
Expand All @@ -342,8 +343,8 @@ private void doBeforeLayout() {
}
if (newLayer != null) {
// The new layer starts off to one side.
newLayer.setTopHeight(vDirection, Unit.PCT, 100.0, Unit.PCT);
newLayer.setLeftWidth(hDirection, Unit.PCT, 100.0, Unit.PCT);
newLayer.setTopHeight(vertDirection, Unit.PCT, 100.0, Unit.PCT);
newLayer.setLeftWidth(horizDirection, Unit.PCT, 100.0, Unit.PCT);
setWidgetVisible(visibleWidget, newLayer, true);
}
layout.layout();
Expand All @@ -353,8 +354,8 @@ private void doBeforeLayout() {
// Set the end positions of the layers.
if (oldLayer != null) {
// The old layer ends off to one side.
oldLayer.setTopHeight(-vDirection, Unit.PCT, 100.0, Unit.PCT);
oldLayer.setLeftWidth(-hDirection, Unit.PCT, 100.0, Unit.PCT);
oldLayer.setTopHeight(-vertDirection, Unit.PCT, 100.0, Unit.PCT);
oldLayer.setLeftWidth(-horizDirection, Unit.PCT, 100.0, Unit.PCT);
setWidgetVisible(lastVisibleWidget, oldLayer, true);
}
if (newLayer != null) {
Expand All @@ -373,14 +374,14 @@ private void doBeforeLayout() {
lastVisibleWidget = visibleWidget;
}

private void setWidgetVisible(Widget w, Layer layer, boolean visible) {
private void setWidgetVisible(Widget widget, Layer layer, boolean visible) {
layer.setVisible(visible);

/*
* Set the visibility of the widget. This is used by lazy panel to
* initialize the widget.
*/
w.setVisible(visible);
widget.setVisible(visible);
}

/**
Expand Down
Expand Up @@ -26,26 +26,26 @@ public class SimpleWidgetPanel extends LayoutPanel implements AcceptsOneWidget {
private Widget widget;

@Override
public void setWidget(IsWidget w) {
setOneWidget(asWidgetOrNull(w));
public void setWidget(IsWidget widget) {
setOneWidget(asWidgetOrNull(widget));
}

private void setOneWidget(Widget w) {
private void setOneWidget(Widget widget) {
// validate
if (w == widget) {
if (widget == this.widget) {
return;
}

// remove the old widget
if (widget != null) {
super.remove(widget);
if (this.widget != null) {
super.remove(this.widget);
}

// logical attach
widget = w;
this.widget = widget;

if (w != null) {
super.add(w);
if (widget != null) {
super.add(widget);
}
forceLayout();
}
Expand Down
Expand Up @@ -65,20 +65,21 @@ public LoginView() {

initWidget(uiBinder.createAndBindUi(this));

loginTitle.getElement().setInnerSafeHtml(SafeHtmlUtils.fromSafeConstant(Utils.messages.loginTitle()));
loginTitle.getElement().setInnerSafeHtml(
SafeHtmlUtils.fromSafeConstant(Utils.messages.loginTitle()));

Label loginLabel = new Label(Utils.constants.username());
usernameBox = new TextBox();
usernameBox.setName("j_username");
usernameBox.setWidth("100%");

Label passwordLabel = new Label(Utils.constants.password());
passwordBox = new PasswordTextBox();
passwordBox.setName("j_password");
passwordBox.setWidth("100%");

Label loginLabel = new Label(Utils.constants.username());
loginTable.setWidget(0, 0, loginLabel);
loginTable.setWidget(0, 1, usernameBox);
Label passwordLabel = new Label(Utils.constants.password());
loginTable.setWidget(1, 0, passwordLabel);
loginTable.setWidget(1, 1, passwordBox);

Expand All @@ -87,10 +88,14 @@ public LoginView() {
loginTable.setWidget(2, 0, forgotPasswordLabel);

loginTable.getFlexCellFormatter().setWidth(0, 0, "130px");
loginTable.getFlexCellFormatter().setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter().setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter().setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter().setColSpan(2, 0, 2);
loginTable.getFlexCellFormatter()
.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter()
.setHorizontalAlignment(1, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter()
.setHorizontalAlignment(2, 0, HasHorizontalAlignment.ALIGN_RIGHT);
loginTable.getFlexCellFormatter()
.setColSpan(2, 0, 2);

loginButton = new Button(Utils.constants.login());
loginButton.addStyleName(Utils.kaaAdminStyle.loginButton());
Expand Down
Expand Up @@ -135,9 +135,12 @@ public class ClientFactoryImpl implements ClientFactory {
private final TenantView createTenantView = new TenantViewImpl(true);
private final TenantView tenantView = new TenantViewImpl(false);

private final BaseListView<ApplicationDto> applicationsView = new ApplicationsViewImpl(KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));
private final ApplicationView createApplicationView = new ApplicationViewImpl(true, KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));
private final ApplicationView applicationView = new ApplicationViewImpl(false, KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));
private final BaseListView<ApplicationDto> applicationsView =
new ApplicationsViewImpl(KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));
private final ApplicationView createApplicationView =
new ApplicationViewImpl(true, KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));
private final ApplicationView applicationView =
new ApplicationViewImpl(false, KaaAdmin.checkAuthorities(KaaAuthorityDto.TENANT_ADMIN));

private final BaseListView<SdkProfileDto> sdkProfilesView = new SdkProfilesViewImpl();
private final SdkProfileView sdkProfileView = new SdkProfileViewImpl();
Expand All @@ -147,21 +150,33 @@ public class ClientFactoryImpl implements ClientFactory {
private final UserView createUserView = new UserViewImpl(true);
private final UserView userView = new UserViewImpl(false);

private final BaseListView<EndpointProfileSchemaDto> profileSchemasView = new ProfileSchemasViewImpl();
private final BaseCtlSchemaView profileSchemaView = new ProfileSchemaViewImpl(false);
private final BaseCtlSchemaView createProfileSchemaView = new ProfileSchemaViewImpl(true);

private final BaseListView<ServerProfileSchemaDto> serverProfileSchemasView = new ServerProfileSchemasViewImpl();
private final BaseCtlSchemaView serverProfileSchemaView = new ServerProfileSchemaViewImpl(false);
private final BaseCtlSchemaView createServerProfileSchemaView = new ServerProfileSchemaViewImpl(true);

private final BaseListView<ConfigurationSchemaDto> configurationSchemasView = new ConfigurationSchemasViewImpl();
private final BaseCtlSchemaView configurationSchemaView = new ConfigurationSchemaViewImpl(false);
private final BaseCtlSchemaView createConfigurationSchemaView = new ConfigurationSchemaViewImpl(true);

private final BaseListView<NotificationSchemaDto> notificationSchemasView = new NotificationSchemasViewImpl();
private final BaseCtlSchemaView notificationSchemaView = new NotificationSchemaViewImpl(false);
private final BaseCtlSchemaView createNotificationSchemaView = new NotificationSchemaViewImpl(true);
private final BaseListView<EndpointProfileSchemaDto> profileSchemasView =
new ProfileSchemasViewImpl();
private final BaseCtlSchemaView profileSchemaView =
new ProfileSchemaViewImpl(false);
private final BaseCtlSchemaView createProfileSchemaView =
new ProfileSchemaViewImpl(true);

private final BaseListView<ServerProfileSchemaDto> serverProfileSchemasView =
new ServerProfileSchemasViewImpl();
private final BaseCtlSchemaView serverProfileSchemaView =
new ServerProfileSchemaViewImpl(false);
private final BaseCtlSchemaView createServerProfileSchemaView =
new ServerProfileSchemaViewImpl(true);

private final BaseListView<ConfigurationSchemaDto> configurationSchemasView =
new ConfigurationSchemasViewImpl();
private final BaseCtlSchemaView configurationSchemaView =
new ConfigurationSchemaViewImpl(false);
private final BaseCtlSchemaView createConfigurationSchemaView =
new ConfigurationSchemaViewImpl(true);

private final BaseListView<NotificationSchemaDto> notificationSchemasView =
new NotificationSchemasViewImpl();
private final BaseCtlSchemaView notificationSchemaView =
new NotificationSchemaViewImpl(false);
private final BaseCtlSchemaView createNotificationSchemaView =
new NotificationSchemaViewImpl(true);

private final BaseListView<LogSchemaDto> logSchemasView = new LogSchemasViewImpl();
private final BaseCtlSchemaView logSchemaView = new LogSchemaViewImpl(false);
Expand Down Expand Up @@ -217,7 +232,8 @@ public class ClientFactoryImpl implements ClientFactory {

private final CtlSchemaView createCtlSchemaView = new CtlSchemaViewImpl(true, true);
private final CtlSchemaView editCtlSchemaView = new CtlSchemaViewImpl(false, true);
private final CtlSchemaView editApplicationCtlSchemaView = new ApplicationCtlSchemaViewImpl(false, true);
private final CtlSchemaView editApplicationCtlSchemaView =
new ApplicationCtlSchemaViewImpl(false, true);
private final CtlSchemaView viewCtlSchemaView = new CtlSchemaViewImpl(false, false);

private Place homePlace;
Expand Down
Expand Up @@ -398,7 +398,7 @@ public void onSuccessImpl(CtlSchemaFormDto result) {
} else if (place.getSchemaType() == SchemaType.EVENT_CLASS && place.getPreviousPlace() != null) {
EventClassPlace eventClassPlace = new EventClassPlace(place.getEcfId(), place.getEcfVersionId(), place.getEcfVersion(), "");
eventClassPlace.setCtlSchemaId(ctlSchemaID);
eventClassPlace.setNameEC(nameEC);
eventClassPlace.setNameEc(nameEC);
goTo(eventClassPlace);
}
} else if (place.getPreviousPlace() != null) {
Expand Down
Expand Up @@ -182,7 +182,7 @@ public void onFailure(Throwable caught) {
@Override
public void onSuccess(CtlSchemaReferenceDto ctlSchemaReferenceDto) {
detailsView.getCtlSchemaReference().setValue(ctlSchemaReferenceDto);
detailsView.getName().setValue(place.getNameEC());
detailsView.getName().setValue(place.getNameEc());
place.setCtlSchemaId(null);
}
});
Expand Down
Expand Up @@ -64,7 +64,8 @@ public boolean equals(Object obj) {
return true;
}

public static abstract class Tokenizer<P extends AbstractPluginPlace> implements PlaceTokenizer<P>, PlaceConstants {
public abstract static class Tokenizer<P extends AbstractPluginPlace>
implements PlaceTokenizer<P>, PlaceConstants {

@Override
public P getPlace(String token) {
Expand Down
Expand Up @@ -68,7 +68,8 @@ public TreePlaceDataProvider getDataProvider(EventBus eventBus) {
return null;
}

public static abstract class Tokenizer<P extends AbstractPluginsPlace> implements PlaceTokenizer<P>, PlaceConstants {
public static abstract class Tokenizer<P extends AbstractPluginsPlace>
implements PlaceTokenizer<P>, PlaceConstants {

@Override
public P getPlace(String token) {
Expand Down

0 comments on commit fc65aac

Please sign in to comment.