Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2009-05-31 09:11:47 +0000
committerspingel2009-05-31 09:11:47 +0000
commitf347854fce40b8cf22a4dd15a63e3763262b6965 (patch)
tree29daf3d2d241204e9b431c83b6a143d77ec635c5 /org.eclipse.mylyn.tasks.bugs
parenta319d688511de795e20265278ed12354ee4d4b9e (diff)
downloadorg.eclipse.mylyn.tasks-f347854fce40b8cf22a4dd15a63e3763262b6965.tar.gz
org.eclipse.mylyn.tasks-f347854fce40b8cf22a4dd15a63e3763262b6965.tar.xz
org.eclipse.mylyn.tasks-f347854fce40b8cf22a4dd15a63e3763262b6965.zip
NEW - bug 277918: Report as Bug fails to paste in stack trace when used from Error Log
https://bugs.eclipse.org/bugs/show_bug.cgi?id=277918
Diffstat (limited to 'org.eclipse.mylyn.tasks.bugs')
-rw-r--r--org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultTaskContributor.java78
1 files changed, 58 insertions, 20 deletions
diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultTaskContributor.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultTaskContributor.java
index afa7116c3..b34037f8e 100644
--- a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultTaskContributor.java
+++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultTaskContributor.java
@@ -22,6 +22,7 @@ import org.eclipse.core.runtime.IProduct;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.mylyn.internal.provisional.tasks.bugs.AbstractTaskContributor;
+import org.eclipse.mylyn.internal.provisional.tasks.bugs.ISupportRequest;
import org.eclipse.mylyn.internal.provisional.tasks.bugs.ISupportResponse;
import org.eclipse.mylyn.internal.provisional.tasks.bugs.ITaskContribution;
import org.eclipse.mylyn.internal.tasks.bugs.wizards.ErrorLogStatus;
@@ -42,7 +43,8 @@ import org.osgi.framework.Bundle;
public class DefaultTaskContributor extends AbstractTaskContributor {
@Override
- public void process(ITaskContribution contribution) {
+ public void preProcess(ISupportRequest request) {
+ ITaskContribution contribution = request.getDefaultContribution();
String description = getDescription(contribution.getStatus());
if (description != null) {
contribution.appendToDescription(description);
@@ -50,6 +52,16 @@ public class DefaultTaskContributor extends AbstractTaskContributor {
}
@Override
+ public void process(ITaskContribution contribution) {
+ if (contribution.getAttribute(IRepositoryConstants.DESCRIPTION) == null) {
+ String description = getDescription(contribution.getStatus());
+ if (description != null) {
+ contribution.appendToDescription(description);
+ }
+ }
+ }
+
+ @Override
public void postProcess(ISupportResponse response) {
IStatus contribution = response.getStatus();
TaskData taskData = response.getTaskData();
@@ -95,7 +107,7 @@ public class DefaultTaskContributor extends AbstractTaskContributor {
}
public void appendErrorDetails(StringBuilder sb, IStatus status, Date date) {
- sb.append("\n\n");
+ sb.append("\n\n"); //$NON-NLS-1$
sb.append(Messages.DefaultTaskContributor_Error_Details);
if (date != null) {
sb.append("\n"); //$NON-NLS-1$
@@ -105,17 +117,32 @@ public class DefaultTaskContributor extends AbstractTaskContributor {
sb.append(NLS.bind("Message: {0}", status.getMessage()));
sb.append("\n"); //$NON-NLS-1$
sb.append(NLS.bind("Severity: {0}", getSeverityText(status.getSeverity())));
+ appendProductInformation(sb);
+ sb.append("\n"); //$NON-NLS-1$
+ sb.append(NLS.bind("Plugin: {0}", status.getPlugin()));
+ }
+
+ private void appendProductInformation(StringBuilder sb) {
IProduct product = Platform.getProduct();
if (product != null) {
sb.append("\n"); //$NON-NLS-1$
if (product.getName() != null) {
- sb.append(NLS.bind("Product: {0} ({1})", product.getName(), product.getId()));
+ sb.append(NLS.bind("Product: {0}", product.getName()));
} else {
sb.append(NLS.bind("Product: {0}", product.getId()));
}
+ Bundle definingBundle = product.getDefiningBundle();
+ if (definingBundle != null) {
+ Object version = definingBundle.getHeaders().get("Bundle-Version"); //$NON-NLS-1$
+ if (version != null) {
+ sb.append(" "); //$NON-NLS-1$
+ sb.append(version);
+ }
+ }
+ if (product.getName() != null) {
+ sb.append(NLS.bind(" ({0})", product.getId())); //$NON-NLS-1$
+ }
}
- sb.append("\n"); //$NON-NLS-1$
- sb.append(NLS.bind("Plugin: {0}", status.getPlugin()));
}
@Override
@@ -131,33 +158,44 @@ public class DefaultTaskContributor extends AbstractTaskContributor {
if (product.getBundleGroup() != null) {
StringBuilder sb = new StringBuilder();
sb.append("\n\n\n"); //$NON-NLS-1$
- sb.append(Messages.DefaultTaskContributor_INSTALLED_FEATURES_AND_PLUGINS);
+ sb.append("-- Configuration Details --");
+ appendProductInformation(sb);
+ sb.append("\n"); //$NON-NLS-1$
+ sb.append("Installed Features:");
+ sb.append("\n"); //$NON-NLS-1$
for (IBundleGroup bundleGroup : new IBundleGroup[] { product.getBundleGroup() }) {
+ sb.append(" "); //$NON-NLS-1$
sb.append(bundleGroup.getIdentifier());
sb.append(" "); //$NON-NLS-1$
sb.append(bundleGroup.getVersion());
sb.append("\n"); //$NON-NLS-1$
- Bundle[] bundles = bundleGroup.getBundles();
- if (bundles != null) {
- for (Bundle bundle : bundles) {
- sb.append(" "); //$NON-NLS-1$
- sb.append(bundle.getSymbolicName());
- String version = (String) bundle.getHeaders().get(
- Messages.DefaultTaskContributor_Bundle_Version);
- if (version != null) {
- sb.append(" "); //$NON-NLS-1$
- sb.append(version);
- }
- sb.append("\n"); //$NON-NLS-1$
- }
- }
+// Bundle[] bundles = bundleGroup.getBundles();
+// if (bundles != null) {
+// for (Bundle bundle : bundles) {
+// sb.append(" "); //$NON-NLS-1$
+// sb.append(bundle.getSymbolicName());
+// String version = (String) bundle.getHeaders().get(
+// Messages.DefaultTaskContributor_Bundle_Version);
+// if (version != null) {
+// sb.append(" "); //$NON-NLS-1$
+// sb.append(version);
+// }
+// sb.append("\n"); //$NON-NLS-1$
+// }
+// }
}
return sb.toString();
}
} else if (status instanceof ErrorLogStatus) {
ErrorLogStatus errorLogStatus = (ErrorLogStatus) status;
StringBuilder sb = new StringBuilder();
+ sb.append("\n\n"); //$NON-NLS-1$
+ sb.append("What steps will reproduce the problem?");
+ sb.append("\n"); //$NON-NLS-1$
+ sb.append("1. \n");
+ sb.append("2. \n");
+ sb.append("3. \n");
appendErrorDetails(sb, errorLogStatus, errorLogStatus.getDate());
if (errorLogStatus.getLogSessionData() != null) {
sb.append(Messages.DefaultTaskContributor_SESSION_DATA);

Back to the top