Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ekaterina Tuzova
2013-11-18 17:34:05 +04:00
9 changed files with 37 additions and 39 deletions
-1
View File
@@ -56,7 +56,6 @@ def layoutFull(String home, String targetDirectory, String patchedDescriptorDir
"java-analysis-api",
"java-indexing-api",
"java-psi-api",
"js-analysis-api",
"jsp-openapi",
"jsp-base-openapi",
"openapi",
@@ -148,11 +148,11 @@ class DetailsPanel extends JPanel implements ListSelectionListener {
}
private static String getAuthorText(VcsFullCommitDetails commit) {
String authorText = commit.getAuthor().getName() + " at " + DateFormatUtil.formatDateTime(commit.getTime());
String authorText = commit.getAuthor().getName() + " at " + DateFormatUtil.formatDateTime(commit.getAuthorTime());
if (!commit.getAuthor().equals(commit.getCommitter())) {
String commitTime;
if (commit.getAuthorTime() != commit.getTime()) {
commitTime = " at " + DateFormatUtil.formatDateTime(commit.getAuthorTime());
commitTime = " at " + DateFormatUtil.formatDateTime(commit.getTime());
}
else {
commitTime = "";
@@ -16,10 +16,8 @@
package org.jetbrains.plugins.groovy.lang.psi.impl.synthetic;
import com.intellij.codeInsight.completion.originInfo.OriginInfoAwareElement;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
/**
* @author Sergey Evdokimov
@@ -41,15 +39,7 @@ public class GrMethodWrapper extends GrLightMethodBuilder {
getModifierList().copyModifiers(method);
for (PsiParameter parameter : method.getParameterList().getParameters()) {
GrLightParameter p = new GrLightParameter(StringUtil.notNullize(parameter.getName()), parameter.getType(), this);
if (parameter instanceof GrParameter) {
p.setOptional(((GrParameter)parameter).isOptional());
}
addParameter(p);
}
getParameterList().copyParameters(method);
if (method instanceof OriginInfoAwareElement) {
setOriginInfo(((OriginInfoAwareElement)method).getOriginInfo());
@@ -36,7 +36,7 @@ public interface MavenServerEmbedder extends Remote {
@NotNull Collection<String> activeProfiles) throws RemoteException,
MavenServerProcessCanceledException;
@NotNull
@Nullable
String evaluateEffectivePom(@NotNull File file, @NotNull List<String> activeProfiles) throws RemoteException,
MavenServerProcessCanceledException;
@@ -198,7 +198,7 @@ public class Maven2ServerEmbedderImpl extends MavenRemoteObject implements Maven
return result;
}
@NotNull
@Nullable
public String evaluateEffectivePom(@NotNull File file, @NotNull List<String> activeProfiles) {
throw new UnsupportedOperationException();
}
@@ -287,7 +287,7 @@ public class Maven3ServerEmbedderImpl extends MavenRemoteObject implements Maven
return createExecutionResult(file, result, listener.getRootNode());
}
@NotNull
@Nullable
@Override
public String evaluateEffectivePom(@NotNull File file, @NotNull List<String> activeProfiles)
throws RemoteException, MavenServerProcessCanceledException {
@@ -17,6 +17,7 @@ import org.jdom.input.SAXBuilder;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.io.IOException;
@@ -43,38 +44,43 @@ public class MavenEffectivePomDumper {
private static final String SETTINGS_XSD_URL = "http://maven.apache.org/xsd/settings-1.0.0.xsd";
// See org.apache.maven.plugins.help.EffectivePomMojo#execute from maven-help-plugin
@Nullable
public static String evaluateEffectivePom(final Maven3ServerEmbedderImpl embedder,
@NotNull final File file,
@NotNull List<String> activeProfiles)
throws RemoteException, MavenServerProcessCanceledException {
final MavenExecutionRequest
request = embedder.createRequest(file, activeProfiles, Collections.<String>emptyList(), Collections.<String>emptyList());
final StringWriter w = new StringWriter();
embedder.executeWithMavenSession(request, new Runnable() {
@Override
public void run() {
try {
// copied from DefaultMavenProjectBuilder.buildWithDependencies
ProjectBuilder builder = embedder.getComponent(ProjectBuilder.class);
ProjectBuildingResult buildingResult = builder.build(new File(file.getPath()), request.getProjectBuildingRequest());
try {
final MavenExecutionRequest
request = embedder.createRequest(file, activeProfiles, Collections.<String>emptyList(), Collections.<String>emptyList());
MavenProject project = buildingResult.getProject();
embedder.executeWithMavenSession(request, new Runnable() {
@Override
public void run() {
try {
// copied from DefaultMavenProjectBuilder.buildWithDependencies
ProjectBuilder builder = embedder.getComponent(ProjectBuilder.class);
ProjectBuildingResult buildingResult = builder.build(new File(file.getPath()), request.getProjectBuildingRequest());
XMLWriter writer = new PrettyPrintXMLWriter(w, StringUtils.repeat(" ", XmlWriterUtil.DEFAULT_INDENTATION_SIZE));
MavenProject project = buildingResult.getProject();
writeHeader(writer);
XMLWriter writer = new PrettyPrintXMLWriter(w, StringUtils.repeat(" ", XmlWriterUtil.DEFAULT_INDENTATION_SIZE));
writeEffectivePom(project, writer);
writeHeader(writer);
writeEffectivePom(project, writer);
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
catch (Exception e) {
throw new RuntimeException(e);
}
}
});
});
}
catch (Exception e) {
return null;
}
return w.toString();
}
@@ -66,7 +66,10 @@ public class MavenShowEffectivePom extends AnAction implements DumbAware {
if (project.isDisposed()) return;
if (s == null) { // null means UnsupportedOperationException
showUnsupportedNotification(project, file);
new Notification(MavenUtil.MAVEN_NOTIFICATION_GROUP,
"Error",
"Failed to evaluate effective pom.",
NotificationType.ERROR).notify(project);
return;
}
@@ -101,7 +101,7 @@ public abstract class MavenEmbedderWrapper extends RemoteObjectWrapper<MavenServ
});
}
@NotNull
@Nullable
public String evaluateEffectivePom(@NotNull final VirtualFile file, @NotNull final Collection<String> activeProfiles)
throws MavenProcessCanceledException {
return perform(new RetriableCancelable<String>() {