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 39498 Details for
Bug 136219
convert bug parser to use xml and rdf sources
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]
Progress: fixes new bug submission errors
patch136219-4.txt (text/plain), 18.84 KB, created by
Robert Elves
on 2006-04-25 21:19:59 EDT
(
hide
)
Description:
Progress: fixes new bug submission errors
Filename:
MIME Type:
Creator:
Robert Elves
Created:
2006-04-25 21:19:59 EDT
Size:
18.84 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mylar.bugzilla.core >Index: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java,v >retrieving revision 1.14 >diff -u -r1.14 BugzillaRepositoryUtil.java >--- src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java 25 Apr 2006 16:50:26 -0000 1.14 >+++ src/org/eclipse/mylar/internal/bugzilla/core/BugzillaRepositoryUtil.java 26 Apr 2006 01:02:08 -0000 >@@ -62,7 +62,6 @@ > import org.eclipse.swt.widgets.Display; > import org.eclipse.ui.PlatformUI; > >- > /** > * @author Mik Kersten (some rewriting) > * @author Rob Elves (attachments) >@@ -99,7 +98,7 @@ > > public static final char PREF_DELIM_REPOSITORY = ':'; > >- public static final String POST_ARGS_SHOW_BUG = "/show_bug.cgi?id="; >+ public static final String POST_ARGS_SHOW_BUG = "/show_bug.cgi?id=";//ctype=xml& > > public static final String POST_ARGS_ATTACHMENT_DOWNLOAD = "/attachment.cgi?id="; > >@@ -142,11 +141,15 @@ > if (input != null) { > in = new BufferedReader(new InputStreamReader(input)); > >- // get the actual bug fron the server and return it >- BugReport bug = BugParser.parseBug(in, id, repository.getUrl(), !repository.getVersion().equals( >- BugzillaServerVersion.SERVER_216.toString()), repository.getUserName(), repository >+ // BugReportFactory reportFactory = >+ // BugReportFactory.getInstance(); >+ // BugReport bugReport = reportFactory.readReport(in, id, >+ // repository, connection.getContentType()); >+ // get the actual bug from the server and return it >+ BugReport bugReport = BugParser.parseBug(in, id, repository.getUrl(), !repository.getVersion() >+ .equals(BugzillaServerVersion.SERVER_216.toString()), repository.getUserName(), repository > .getPassword(), connection.getContentType()); >- return bug; >+ return bugReport; > } > } > // TODO handle the error >@@ -213,12 +216,13 @@ > > return BugzillaPlugin.getDefault().getProductConfiguration(repository.getUrl()).getProducts(); > >-// BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, new NullProgressMonitor()); >-// if (!parser.wasSuccessful()) { >-// throw new RuntimeException("Couldn't get products"); >-// } else { >-// return Arrays.asList(parser.getProductValues()); >-// } >+ // BugzillaQueryPageParser parser = new >+ // BugzillaQueryPageParser(repository, new NullProgressMonitor()); >+ // if (!parser.wasSuccessful()) { >+ // throw new RuntimeException("Couldn't get products"); >+ // } else { >+ // return Arrays.asList(parser.getProductValues()); >+ // } > > } > >@@ -303,61 +307,64 @@ > > HashMap<String, Attribute> attributes = new HashMap<String, Attribute>(); > >- // ATTRIBUTE: Severity > Attribute a = new Attribute("Severity"); > a.setParameterName("bug_severity"); >- // get optionValues from ProductConfiguration > List<String> optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getSeverities(); >- // add option values from ProductConfiguration to Attribute optionValues >- for (String option: optionValues) { >+ for (String option : optionValues) { > a.addOptionValue(option, option); > } >- // add Attribute to model > attributes.put("severites", a); > >- // ATTRIBUTE: OS > a = new Attribute("OS"); > a.setParameterName("op_sys"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getOSs(); >- for (String option: optionValues) { >+ for (String option : optionValues) { > a.addOptionValue(option, option); > } > attributes.put("OSs", a); > >- // ATTRIBUTE: Platform > a = new Attribute("Platform"); > a.setParameterName("rep_platform"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPlatforms(); >- for (String option: optionValues) { >+ for (String option : optionValues) { > a.addOptionValue(option, option); > } > attributes.put("platforms", a); > >- // ATTRIBUTE: Version > a = new Attribute("Version"); > a.setParameterName("version"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getVersions(model.getProduct()); >- for (String option: optionValues) { >+ for (String option : optionValues) { > a.addOptionValue(option, option); > } > attributes.put("versions", a); > >- // ATTRIBUTE: Component >+ > a = new Attribute("Component"); > a.setParameterName("component"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getComponents(model.getProduct()); >- for (String option: optionValues) { >+ for (String option : optionValues) { > a.addOptionValue(option, option); > } > attributes.put("components", a); > >- // ATTRIBUTE: Priority >+ > a = new Attribute("Priority"); >- a.setParameterName("bug_severity"); >+ a.setParameterName("priority"); > optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getPriorities(); >- for (String option: optionValues) { >+ for (String option : optionValues) { > a.addOptionValue(option, option); > } >+ attributes.put("priorities", a); >+ >+ >+ a = new Attribute("Product"); >+ a.setParameterName("product"); >+ optionValues = BugzillaPlugin.getDefault().getProductConfiguration(serverUrl).getProducts(); >+ for (String option : optionValues) { >+ a.addOptionValue(option, option); >+ } >+ attributes.put("products", a); > > // set NBM Attributes (after all Attributes have been created, and added > // to attributes map) >@@ -387,13 +394,13 @@ > } > > static String queryOptionsToString(List<String> array) { >- >+ > StringBuffer buffer = new StringBuffer(); > for (String string : array) { > buffer.append(string); > buffer.append("!"); > } >- >+ > return buffer.toString(); > } > >@@ -437,12 +444,12 @@ > IOException { > > String repositoryUrl = repository.getUrl(); >-// BugzillaQueryPageParser parser = new BugzillaQueryPageParser(repository, monitor); >-// if (!parser.wasSuccessful()) >-// return; >- >- RepositoryConfiguration config = ServerConfigurationFactory.getInstance().getConfiguration( >- repositoryUrl); >+ // BugzillaQueryPageParser parser = new >+ // BugzillaQueryPageParser(repository, monitor); >+ // if (!parser.wasSuccessful()) >+ // return; >+ >+ RepositoryConfiguration config = ServerConfigurationFactory.getInstance().getConfiguration(repositoryUrl); > > // get the preferences store so that we can change the data in it > IPreferenceStore prefs = BugzillaPlugin.getDefault().getPreferenceStore(); >@@ -479,7 +486,6 @@ > queryOptionsToString(config.getProducts())); > monitor.worked(1); > >- > prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl, > queryOptionsToString(config.getComponents())); > monitor.worked(1); >@@ -487,27 +493,25 @@ > prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl, > queryOptionsToString(config.getVersions())); > monitor.worked(1); >- >+ > prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl, > queryOptionsToString(config.getTargetMilestones())); > monitor.worked(1); >- >- for (String product: config.getProducts()) { >- prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl+PREF_DELIM_REPOSITORY+product, >- queryOptionsToString(config.getComponents(product))); >+ >+ for (String product : config.getProducts()) { >+ prefs.setValue(IBugzillaConstants.VALUES_COMPONENT + PREF_DELIM_REPOSITORY + repositoryUrl >+ + PREF_DELIM_REPOSITORY + product, queryOptionsToString(config.getComponents(product))); > monitor.worked(1); > >- prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl+PREF_DELIM_REPOSITORY+product, >- queryOptionsToString(config.getVersions(product))); >+ prefs.setValue(IBugzillaConstants.VALUES_VERSION + PREF_DELIM_REPOSITORY + repositoryUrl >+ + PREF_DELIM_REPOSITORY + product, queryOptionsToString(config.getVersions(product))); > monitor.worked(1); >- >- prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl+PREF_DELIM_REPOSITORY+product, >- queryOptionsToString(config.getTargetMilestones(product))); >+ >+ prefs.setValue(IBugzillaConstants.VALUES_TARGET + PREF_DELIM_REPOSITORY + repositoryUrl >+ + PREF_DELIM_REPOSITORY + product, queryOptionsToString(config.getTargetMilestones(product))); > monitor.worked(1); > } >- > >- > } > > public static boolean downloadAttachment(TaskRepository repository, int id, File destinationFile, boolean overwrite) >@@ -613,7 +617,7 @@ > } > > postMethod.setRequestEntity(new MultipartRequestEntity(parts.toArray(new Part[1]), postMethod.getParams())); >- >+ > client.getHttpConnectionManager().getParams().setConnectionTimeout(5000); > int status = client.executeMethod(postMethod); > if (status == HttpStatus.SC_OK) { >Index: src/org/eclipse/mylar/internal/bugzilla/core/BugzillaReportSubmitForm.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.core/src/org/eclipse/mylar/internal/bugzilla/core/BugzillaReportSubmitForm.java,v >retrieving revision 1.12 >diff -u -r1.12 BugzillaReportSubmitForm.java >--- src/org/eclipse/mylar/internal/bugzilla/core/BugzillaReportSubmitForm.java 29 Mar 2006 20:43:34 -0000 1.12 >+++ src/org/eclipse/mylar/internal/bugzilla/core/BugzillaReportSubmitForm.java 26 Apr 2006 01:02:08 -0000 >@@ -52,6 +52,10 @@ > */ > public class BugzillaReportSubmitForm { > >+ private static final String KEY_BUG_FILE_LOC = "bug_file_loc"; >+ >+ private static final String KEY_PRODUCT = "product"; >+ > private static final String VAL_TRUE = "true"; > > private static final String KEY_REMOVECC = "removecc"; >@@ -250,12 +254,20 @@ > } > } > >+ form.add(KEY_BUG_FILE_LOC, ""); >+ >+ // specify the product >+ form.add(KEY_PRODUCT, model.getProduct()); >+ > // add the summary to the bug post > form.add("short_desc", model.getSummary()); >- >- BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository.getVersion()); >+ >+ BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository >+ .getVersion()); > if (bugzillaServerVersion != null && bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >= 0) { >-// if (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString())) { >+ // if >+ // (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString())) >+ // { > form.add("bug_status", "NEW"); > } > >@@ -273,9 +285,11 @@ > > /** > * TODO: refactor common stuff with new bug post >- * @param removeCC >+ * >+ * @param removeCC > */ >- public static BugzillaReportSubmitForm makeExistingBugPost(BugReport bug, TaskRepository repository, Set<String> removeCC) { >+ public static BugzillaReportSubmitForm makeExistingBugPost(BugReport bug, TaskRepository repository, >+ Set<String> removeCC) { > > BugzillaReportSubmitForm bugReportPostHandler = new BugzillaReportSubmitForm(); > >@@ -319,12 +333,12 @@ > if (bug.getAttribute(BugReport.ATTR_SUMMARY) != null) { > bugReportPostHandler.add(KEY_SHORT_DESC, bug.getAttribute(BugReport.ATTR_SUMMARY).getNewValue()); > } >- >+ > // add the new comment to the bug post if there is some text in it > if (bug.getNewNewComment().length() != 0) { > bugReportPostHandler.add(KEY_COMMENT, bug.getNewNewComment()); > } >- >+ > if (removeCC != null && removeCC.size() > 0) { > String[] s = new String[removeCC.size()]; > bugReportPostHandler.add(KEY_CC, toCommaSeparatedList(removeCC.toArray(s))); >@@ -344,7 +358,7 @@ > } > return buffer.toString(); > } >- >+ > /** > * Add a value to be posted to the bug > * >@@ -425,19 +439,23 @@ > > String aString = in.readLine(); > >+ // while(aString != null) { >+ // System.err.println(aString); >+ // aString = in.readLine(); >+ // } >+ > boolean possibleFailure = true; > error = ""; > > while (aString != null) { > error += aString == null ? "" : aString + "\n"; > >- // // check if we have run into an error >- >- >+ // check if we have run into an error >+ > if (result == null > && (aString.toLowerCase().indexOf("check e-mail") != -1 || aString.toLowerCase().indexOf( >- "error") != -1)) { >- throw new LoginException("Bugzilla login problem."); >+ "error") != -1)) { >+ throw new LoginException("Bugzilla login problem."); > } else if (aString.indexOf("Invalid Username Or Password") != -1) { > throw new LoginException("Invalid Username or Password."); > } else if (aString.toLowerCase().matches(".*bug\\s+processed.*") // TODO: >@@ -475,7 +493,8 @@ > && (prefix != null && prefix2 == null && postfix != null && postfix2 != null)) { > throw new PossibleBugzillaFailureException("Could not find bug number for new bug."); > } else if (possibleFailure) { >- throw new PossibleBugzillaFailureException("Could not find indication that bug was processed successfully. Message from Bugzilla was: "); >+ throw new PossibleBugzillaFailureException( >+ "Could not find indication that bug was processed successfully. Message from Bugzilla was: "); > } > > // set the error to null if we dont think that there was one >@@ -624,9 +643,12 @@ > * properly in bugzilla > */ > private static String formatTextToLineWrap(String origText, TaskRepository repository) { >- BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository.getVersion()); >+ BugzillaServerVersion bugzillaServerVersion = IBugzillaConstants.BugzillaServerVersion.fromString(repository >+ .getVersion()); > if (bugzillaServerVersion != null && bugzillaServerVersion.compareTo(BugzillaServerVersion.SERVER_220) >= 0) { >-// if (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString())) { >+ // if >+ // (repository.getVersion().equals(BugzillaServerVersion.SERVER_220.toString())) >+ // { > return origText; > } > >#P org.eclipse.mylar.bugzilla.ui >Index: src/org/eclipse/mylar/internal/bugzilla/ui/wizard/AbstractBugzillaWizardPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.ui/src/org/eclipse/mylar/internal/bugzilla/ui/wizard/AbstractBugzillaWizardPage.java,v >retrieving revision 1.6 >diff -u -r1.6 AbstractBugzillaWizardPage.java >--- src/org/eclipse/mylar/internal/bugzilla/ui/wizard/AbstractBugzillaWizardPage.java 7 Apr 2006 17:40:18 -0000 1.6 >+++ src/org/eclipse/mylar/internal/bugzilla/ui/wizard/AbstractBugzillaWizardPage.java 26 Apr 2006 01:02:09 -0000 >@@ -725,7 +725,7 @@ > > if (java2buzillaOSMap != null && java2buzillaOSMap.containsKey(OS) && opSysAttribute != null && opSysAttribute.getOptionValues() != null) { > bugzillaOS = java2buzillaOSMap.get(OS); >- if (!opSysAttribute.getOptionValues().values().contains(bugzillaOS)) { >+ if (opSysAttribute != null && !opSysAttribute.getOptionValues().values().contains(bugzillaOS)) { > // If the OS we found is not in the list of available > // options, set bugzillaOS > // to null, and just use "other" >@@ -739,7 +739,8 @@ > > if (platform != null && java2buzillaPlatformMap.containsKey(platform)) { > bugzillaPlatform = java2buzillaPlatformMap.get(platform); >- if (!platformAttribute.getOptionValues().values().contains(bugzillaPlatform)) { >+ >+ if (platformAttribute != null && !platformAttribute.getOptionValues().values().contains(bugzillaPlatform)) { > // If the platform we found is not int the list of available > // optinos, set the > // Bugzilla Platform to null, and juse use "other" >@@ -752,9 +753,9 @@ > } > > // Set the OS and the Platform in the model >- if (bugzillaOS != null) >+ if (bugzillaOS != null && opSysAttribute != null) > opSysAttribute.setValue(bugzillaOS); >- if (bugzillaPlatform != null) >+ if (bugzillaPlatform != null && platformAttribute != null) > platformAttribute.setValue(bugzillaPlatform); > } catch (Exception e) { > MylarStatusHandler.fail(e, "could not set platform options", false); >Index: src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java >=================================================================== >RCS file: /cvsroot/technology/org.eclipse.mylar/org.eclipse.mylar.bugzilla.ui/src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java,v >retrieving revision 1.12 >diff -u -r1.12 BugzillaProductPage.java >--- src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java 25 Apr 2006 01:41:00 -0000 1.12 >+++ src/org/eclipse/mylar/internal/bugzilla/ui/wizard/BugzillaProductPage.java 26 Apr 2006 01:02:09 -0000 >@@ -148,31 +148,16 @@ > if (!bugWizard.model.hasParsedProducts()) { > String repositoryUrl = repository.getUrl(); > try { >- // ProductConfiguration productConfiguration = >- // BugzillaPlugin.getDefault().getProductConfiguration(repositoryUrl); > String[] storedProducts = BugzillaRepositoryUtil.getQueryOptions(IBugzillaConstants.VALUES_PRODUCT, > repositoryUrl); > if (storedProducts.length > 0) { >- // String[] storedProducts = >- // BugzillaPlugin.getDefault().getProductConfiguration(repositoryUrl).getProducts(); > products = Arrays.asList(storedProducts); > } else { > products = BugzillaRepositoryUtil.getProductList(repository); > } >- // bugWizard.model.setConnected(true); >+ bugWizard.model.setConnected(true); > bugWizard.model.setParsedProductsStatus(true); >- // } catch (IOException e) { >- // bugWizard.model.setConnected(false); >- // >- // if (e instanceof IOException) { >- // MessageDialog.openError(null, "Bugzilla Connect Error", >- // "Unable to connect to Bugzilla server.\n" >- // + "Product configuration will be read from the workspace."); >- // >- // products = >- // Arrays.asList(BugzillaPlugin.getDefault().getProductConfiguration(repositoryUrl).getProducts()); >- // bugWizard.model.setParsedProductsStatus(true); >- // } >+ > } catch (Exception e) { > bugWizard.model.setConnected(false); > PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { >@@ -223,7 +208,8 @@ > > // try to get the attributes from the bugzilla server > try { >- if (!model.hasParsedAttributes() || !prevProduct.equals(model.getProduct())) { >+ //if (prevProduct != null && !prevProduct.equals(model.getProduct())) { >+ //!model.hasParsedAttributes() || > String serverUrl = repository.getUrl(); > // if (model.isConnected()) { > // BugzillaRepositoryUtil.setupNewBugAttributes(serverUrl, model, false); >@@ -240,8 +226,9 @@ > // will createControl again with new attributes in model > bugWizard.getAttributePage().setControl(null); > } >- } >+ //} > } catch (final Exception e) { >+ e.printStackTrace(); > PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { > public void run() { > MessageDialog.openError(Display.getDefault().getActiveShell(), NEW_BUGZILLA_TASK_ERROR_TITLE, e
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 136219
:
39378
|
39381
|
39429
|
39484
| 39498 |
39599
|
39615
|
39833
|
39835
|
40093
|
40670
|
40671