Bug 125814 - a new project's "error parser settings" are stored to the preferences instead of to the project
Summary: a new project's "error parser settings" are stored to the preferences instead...
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-core (show other bugs)
Version: 3.0.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.1   Edit
Assignee: Norbert Plött CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2006-01-31 07:16 EST by Michael Luber CLA
Modified: 2009-01-12 09:08 EST (History)
1 user (show)

See Also:


Attachments
Patch that implements the proposed modification (768 bytes, patch)
2006-03-15 08:19 EST, Michael Luber CLA
bjorn.freeman-benson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Luber CLA 2006-01-31 07:16:58 EST
Reproduce:
==========
I create a "Standard Make C Project", give it some name, hit "Next",
then change the settings in the "Error Parsers" tab, and hit finish.

Now I open the "properties" of the new project, and inspect the "Error Parsers"
tab under "C/C++ Make Project". I observe that the settings are not those
I have entered, but those that had been offered as default values.

Now I open the "preferences" in the "Window" menu, and inspect the default
settings for a "New Make Project". Here i see the settings that i have entered.



Probable reason:
================
in "ErrorParserBlock.java" (package org.eclipse.cdt.make.internal.ui) I found the following method:

public void saveErrorParsers(IProject project, String[] parserIDs) throws CoreException {
  if (getContainer().getProject() != null && fBuildInfo == null) {
    try {
      fBuildInfo = MakeCorePlugin.createBuildInfo(getContainer().getProject(), MakeBuilder.BUILDER_ID);
    } catch (CoreException e) {
    }
  } 
  if (fBuildInfo != null) {
   fBuildInfo.setErrorParsers(parserIDs);
  }
}


When I enter this method while creating a new C project, the field "fBuildInfo" points to the "default settings". It should be changed to point to my actual project, which would be done by the try-block, but the if-statement prevents that. 


Proposed Solution
=================

Change
  if (getContainer().getProject() != null && fBuildInfo == null) {
to
  if (getContainer().getProject() != null) {


Version info
============
I could reproduce this behavoir with these version combinations:
Eclipse SDK 3.1.1 with CDT 3.0.1
Eclispe SDK 3.2_N20060131 with CDT 3.1.0_I200601300600
Eclispe SDK 3.2_N20060131 with CDT 3.0.2_I200601300600
Comment 1 Michael Luber CLA 2006-03-15 08:19:36 EST
Created attachment 36328 [details]
Patch that implements the proposed modification
Comment 2 Michael Luber CLA 2006-03-15 08:20:48 EST
Comment on attachment 36328 [details]
Patch that implements the proposed modification

When I enter this method while creating a new C project, the field "fBuildInfo"
points to the "default settings". It should be changed to point to my actual
project, which would be done by the try-block, but the if-statement prevents
that.
Comment 3 Norbert Plött CLA 2006-03-28 01:39:59 EST
Patch applied, thanks Michael.