Skip to content

Commit

Permalink
add add few logs messages for problem detection
Browse files Browse the repository at this point in the history
Signed-off-by: Vitalii Parfonov <vparfonov@redhat.com>
  • Loading branch information
vparfonov committed Feb 27, 2018
1 parent a362d20 commit 5e1ab4f
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,10 @@
*/
package org.eclipse.che.ide.navigation;

import static java.util.Collections.emptyList;
import static org.eclipse.che.ide.api.jsonrpc.Constants.WS_AGENT_JSON_RPC_ENDPOINT_ID;
import static org.eclipse.che.ide.util.NameUtils.getFileExtension;

import com.google.gwt.http.client.URL;
import com.google.gwt.user.client.Timer;
import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.Comparator;
import java.util.List;
import org.eclipse.che.api.core.jsonrpc.commons.RequestTransmitter;
import org.eclipse.che.api.project.shared.dto.ProjectSearchRequestDto;
import org.eclipse.che.api.project.shared.dto.ProjectSearchResponseDto;
Expand All @@ -30,6 +24,13 @@
import org.eclipse.che.ide.resource.Path;
import org.eclipse.che.ide.util.loging.Log;

import java.util.Comparator;
import java.util.List;

import static java.util.Collections.emptyList;
import static org.eclipse.che.ide.api.jsonrpc.Constants.WS_AGENT_JSON_RPC_ENDPOINT_ID;
import static org.eclipse.che.ide.util.NameUtils.getFileExtension;

/**
* Presenter for file navigation (find file by name and open it).
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
*/
package org.eclipse.che.ide.ext.java.client.navigation.filestructure;

import static com.google.common.collect.Iterables.all;
import static org.eclipse.che.ide.ui.smartTree.SelectionModel.Mode.SINGLE;

import com.google.common.base.Predicate;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.NativeEvent;
Expand All @@ -25,7 +22,6 @@
import com.google.inject.Inject;
import com.google.inject.Singleton;
import elemental.events.Event;
import java.util.Collections;
import org.eclipse.che.ide.api.action.Action;
import org.eclipse.che.ide.api.action.ActionEvent;
import org.eclipse.che.ide.api.action.ActionManager;
Expand All @@ -44,6 +40,12 @@
import org.eclipse.che.ide.util.input.CharCodeWithModifiers;
import org.eclipse.che.ide.util.input.SignalEvent;
import org.eclipse.che.ide.util.input.SignalEventUtils;
import org.eclipse.che.ide.util.loging.Log;

import java.util.Collections;

import static com.google.common.collect.Iterables.all;
import static org.eclipse.che.ide.ui.smartTree.SelectionModel.Mode.SINGLE;

/**
* Implementation of {@link FileStructure} view.
Expand Down Expand Up @@ -112,6 +114,7 @@ public FileStructureImpl(
/** {@inheritDoc} */
@Override
public void setStructure(CompilationUnit compilationUnit, boolean showInheritedMembers) {
Log.info(getClass(), compilationUnit.toString());
showInheritedLabel.setText(
showInheritedMembers
? locale.hideInheritedMembersLabel()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,14 +88,18 @@ public void show(EditorPartPresenter editorPartPresenter) {
}

final String fqn = JavaUtil.resolveFQN((Container) srcFolder.get(), (Resource) file);

Log.info(getClass(), "Going to take information for " + fqn + " at " + System.currentTimeMillis());
javaNavigationService
.getCompilationUnit(project.get().getLocation(), fqn, showInheritedMembers)
.then(
unit -> {
Log.info(getClass(), ">>>>> Got information for " + fqn + " at " + System.currentTimeMillis());
view.setTitleCaption(editorPartPresenter.getEditorInput().getFile().getName());
view.setStructure(unit, showInheritedMembers);
view.showDialog();
showInheritedMembers = !showInheritedMembers;
Log.info(getClass(), ">>>>> Shown information for " + fqn + " at " + System.currentTimeMillis());
})
.catchError(
arg -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,8 @@
*/
package org.eclipse.che.ide.ext.java.client.navigation.service;

import static org.eclipse.che.ide.MimeType.APPLICATION_JSON;
import static org.eclipse.che.ide.rest.HTTPHeader.ACCEPT;

import com.google.inject.Inject;
import com.google.inject.Singleton;
import java.util.List;
import org.eclipse.che.api.promises.client.Promise;
import org.eclipse.che.ide.MimeType;
import org.eclipse.che.ide.api.app.AppContext;
Expand All @@ -33,6 +29,11 @@
import org.eclipse.che.ide.rest.DtoUnmarshallerFactory;
import org.eclipse.che.ide.ui.loaders.request.LoaderFactory;

import java.util.List;

import static org.eclipse.che.ide.MimeType.APPLICATION_JSON;
import static org.eclipse.che.ide.rest.HTTPHeader.ACCEPT;

/** @author Evgen Vidolob */
@Singleton
public class JavaNavigationServiceImpl implements JavaNavigationService {
Expand Down Expand Up @@ -272,7 +273,7 @@ public Promise<CompilationUnit> getCompilationUnit(
return requestFactory
.createGetRequest(url)
.header(ACCEPT, APPLICATION_JSON)
.loader(loaderFactory.newLoader("Getting information about ..."))
.loader(loaderFactory.newLoader("Getting information about " + fqn))
.send(unmarshallerFactory.newUnmarshaller(CompilationUnit.class));
}

Expand Down

0 comments on commit 5e1ab4f

Please sign in to comment.