Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 47025 Details for
Bug 143567
support automatic duplicate detection before submitting reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Fixes stack parsing, adds test to excersize bug
duplicate-detection-fix-stack-identify-3.txt (text/plain), 4.12 KB, created by
Jeff Pound
on 2006-07-30 11:23:19 EDT
(
hide
)
Description:
Fixes stack parsing, adds test to excersize bug
Filename:
MIME Type:
Creator:
Jeff Pound
Created:
2006-07-30 11:23:19 EDT
Size:
4.12 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.bugzilla.tests >Index: src/org/eclipse/mylar/bugzilla/tests/DuplicateDetetionTest.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.tests/src/org/eclipse/mylar/bugzilla/tests/DuplicateDetetionTest.java,v >retrieving revision 1.3 >diff -u -r1.3 DuplicateDetetionTest.java >--- src/org/eclipse/mylar/bugzilla/tests/DuplicateDetetionTest.java 28 Jul 2006 22:55:13 -0000 1.3 >+++ src/org/eclipse/mylar/bugzilla/tests/DuplicateDetetionTest.java 30 Jul 2006 15:25:34 -0000 >@@ -51,8 +51,8 @@ > IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); > NewBugEditorInput input = new NewBugEditorInput(repository, model); > TaskUiUtil.openEditor(input, BugzillaUiPlugin.NEW_BUG_EDITOR_ID, page); >- >- MylarTaskEditor taskEditor = (MylarTaskEditor) page.getActiveEditor(); >+ >+ MylarTaskEditor taskEditor = (MylarTaskEditor) page.getActiveEditor(); > NewBugEditor editor = (NewBugEditor) taskEditor.getActivePageInstance(); > assertTrue(editor.searchForDuplicates()); > >@@ -70,11 +70,32 @@ > NewBugEditorInput input = new NewBugEditorInput(repository, model); > TaskUiUtil.openEditor(input, BugzillaUiPlugin.NEW_BUG_EDITOR_ID, page); > >- MylarTaskEditor taskEditor = (MylarTaskEditor) page.getActiveEditor(); >+ MylarTaskEditor taskEditor = (MylarTaskEditor) page.getActiveEditor(); > NewBugEditor editor = (NewBugEditor) taskEditor.getActivePageInstance(); > assertNull(editor.getStackTraceFromDescription()); > > editor.markDirty(false); > editor.close(); > } >+ >+ public void testStackTraceWithAppendedText() throws Exception { >+ >+ String stackTrace = "java.lang.NullPointerException\nat jeff.testing.stack.trace.functionality(jeff.java:481)"; >+ String extraText = "\nExtra text that isnt' part of the stack trace java:"; >+ >+ NewBugzillaReport model = new NewBugzillaReport(repository.getUrl(), TasksUiPlugin.getDefault() >+ .getOfflineReportsFile().getNextOfflineBugId()); >+ model.setNewComment(extraText + "\n" + stackTrace + "\n"); >+ model.setHasLocalChanges(true); >+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); >+ NewBugEditorInput input = new NewBugEditorInput(repository, model); >+ TaskUiUtil.openEditor(input, BugzillaUiPlugin.NEW_BUG_EDITOR_ID, page); >+ >+ MylarTaskEditor taskEditor = (MylarTaskEditor) page.getActiveEditor(); >+ NewBugEditor editor = (NewBugEditor) taskEditor.getActivePageInstance(); >+ assertEquals(stackTrace, editor.getStackTraceFromDescription().trim()); >+ >+ editor.markDirty(false); >+ editor.close(); >+ } > } >#P org.eclipse.mylar.bugzilla.ui >Index: src/org/eclipse/mylar/internal/bugzilla/ui/editor/NewBugEditor.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.ui/src/org/eclipse/mylar/internal/bugzilla/ui/editor/NewBugEditor.java,v >retrieving revision 1.40 >diff -u -r1.40 NewBugEditor.java >--- src/org/eclipse/mylar/internal/bugzilla/ui/editor/NewBugEditor.java 28 Jul 2006 18:57:53 -0000 1.40 >+++ src/org/eclipse/mylar/internal/bugzilla/ui/editor/NewBugEditor.java 30 Jul 2006 15:25:35 -0000 >@@ -238,7 +238,7 @@ > boolean hit = false; > while (tok.hasMoreTokens() && stackBuffer.length() == 0) { > String line = tok.nextToken().trim(); >- while (line.indexOf("at ") < 0 && line.indexOf(".java:") < 0 && tok.hasMoreTokens()) { >+ while ((line.indexOf("at ") < 0 || line.indexOf(".java:") < 0) && tok.hasMoreTokens()) { > prevLine = line; > line = tok.nextToken(); > hit = true; >@@ -247,10 +247,15 @@ > if (!hit) { > return null; > } >- stackBuffer.append(prevLine + "\n" + line + "\n"); >- while (line.indexOf(".java:") > 0 && line.indexOf("at ") == 0 && tok.hasMoreTokens()) { >- line = tok.nextToken(); >+ stackBuffer.append(prevLine + "\n"); >+ while (line.indexOf(".java:") > 0 && line.indexOf("at ") == 0) { > stackBuffer.append(line + "\n"); >+ if (tok.hasMoreTokens()) { >+ line = tok.nextToken(); >+ } >+ else { >+ line = ""; >+ } > } > } > if (stackBuffer.length() > 0) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 143567
:
46617
|
46618
|
46620
|
46621
|
46646
|
46850
|
46851
|
46907
|
46929
|
47016
|
47017
|
47021
| 47025