Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 292906 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/pde/internal/core/builders/BuildErrorReporter.java (-21 / +15 lines)
Lines 318-324 Link Here
318
			if (projectJavaCompatibility != null) {
318
			if (projectJavaCompatibility != null) {
319
				if (jreCompilationProfileEntry == null) {
319
				if (jreCompilationProfileEntry == null) {
320
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, PROPERTY_JRE_COMPILATION_PROFILE, PDECoreMessages.BuildErrorReporter_CompilercomplianceLevel);
320
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, PROPERTY_JRE_COMPILATION_PROFILE, PDECoreMessages.BuildErrorReporter_CompilercomplianceLevel);
321
					prepareError(PROPERTY_JRE_COMPILATION_PROFILE, projectJavaCompatibility, message, PDEMarkerFactory.B_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
321
					prepareError(PROPERTY_JRE_COMPILATION_PROFILE, projectJavaCompatibility, message, PDEMarkerFactory.B_JAVA_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
322
				} else {
322
				} else {
323
					if (!projectJavaCompatibility.equalsIgnoreCase(jreCompilationProfileEntry.getTokens()[0])) {
323
					if (!projectJavaCompatibility.equalsIgnoreCase(jreCompilationProfileEntry.getTokens()[0])) {
324
						message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, PROPERTY_JRE_COMPILATION_PROFILE, PDECoreMessages.BuildErrorReporter_CompilercomplianceLevel);
324
						message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, PROPERTY_JRE_COMPILATION_PROFILE, PDECoreMessages.BuildErrorReporter_CompilercomplianceLevel);
Lines 328-334 Link Here
328
			} else {
328
			} else {
329
				if (javacSourceEntry == null) {
329
				if (javacSourceEntry == null) {
330
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, PROPERTY_JAVAC_SOURCE, PDECoreMessages.BuildErrorReporter_SourceCompatibility);
330
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, PROPERTY_JAVAC_SOURCE, PDECoreMessages.BuildErrorReporter_SourceCompatibility);
331
					prepareError(PROPERTY_JAVAC_SOURCE, projectSourceCompatibility, message, PDEMarkerFactory.B_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
331
					prepareError(PROPERTY_JAVAC_SOURCE, projectSourceCompatibility, message, PDEMarkerFactory.B_JAVA_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
332
				} else {
332
				} else {
333
					if (!projectSourceCompatibility.equalsIgnoreCase(javacSourceEntry.getTokens()[0])) {
333
					if (!projectSourceCompatibility.equalsIgnoreCase(javacSourceEntry.getTokens()[0])) {
334
						message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, PROPERTY_JAVAC_SOURCE, PDECoreMessages.BuildErrorReporter_SourceCompatibility);
334
						message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, PROPERTY_JAVAC_SOURCE, PDECoreMessages.BuildErrorReporter_SourceCompatibility);
Lines 337-343 Link Here
337
				}
337
				}
338
				if (javacTargetEntry == null) {
338
				if (javacTargetEntry == null) {
339
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, PROPERTY_JAVAC_TARGET, PDECoreMessages.BuildErrorReporter_GeneratedClassFilesCompatibility);
339
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, PROPERTY_JAVAC_TARGET, PDECoreMessages.BuildErrorReporter_GeneratedClassFilesCompatibility);
340
					prepareError(PROPERTY_JAVAC_TARGET, projectClassCompatibility, message, PDEMarkerFactory.B_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
340
					prepareError(PROPERTY_JAVAC_TARGET, projectClassCompatibility, message, PDEMarkerFactory.B_JAVA_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
341
				} else {
341
				} else {
342
					if (!projectClassCompatibility.equalsIgnoreCase(javacTargetEntry.getTokens()[0])) {
342
					if (!projectClassCompatibility.equalsIgnoreCase(javacTargetEntry.getTokens()[0])) {
343
						message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, PROPERTY_JAVAC_TARGET, PDECoreMessages.BuildErrorReporter_GeneratedClassFilesCompatibility);
343
						message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, PROPERTY_JAVAC_TARGET, PDECoreMessages.BuildErrorReporter_GeneratedClassFilesCompatibility);
Lines 367-373 Link Here
367
			if (javacWarningsEntry == null) {
367
			if (javacWarningsEntry == null) {
368
				if (warningToken.length() > 0) {
368
				if (warningToken.length() > 0) {
369
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, PROPERTY_JAVAC_WARNINGS_PREFIX, PDECoreMessages.BuildErrorReporter_DisallowIdentifiers);
369
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceMissingEntry, PROPERTY_JAVAC_WARNINGS_PREFIX, PDECoreMessages.BuildErrorReporter_DisallowIdentifiers);
370
					prepareError(JAVAC_WARNINGS_ENTRY, warningToken, message, PDEMarkerFactory.B_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
370
					prepareError(JAVAC_WARNINGS_ENTRY, warningToken, message, PDEMarkerFactory.B_JAVA_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
371
				}
371
				}
372
			} else {
372
			} else {
373
				if (javacWarningsEntry.contains(ASSERT_IDENTIFIER) || javacWarningsEntry.contains('+' + ASSERT_IDENTIFIER) || javacWarningsEntry.contains('-' + ASSERT_IDENTIFIER)) {
373
				if (javacWarningsEntry.contains(ASSERT_IDENTIFIER) || javacWarningsEntry.contains('+' + ASSERT_IDENTIFIER) || javacWarningsEntry.contains('-' + ASSERT_IDENTIFIER)) {
Lines 381-387 Link Here
381
				warningToken = join(assertToken, enumToken);
381
				warningToken = join(assertToken, enumToken);
382
				if (warningToken.length() > 0) {
382
				if (warningToken.length() > 0) {
383
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, PROPERTY_JAVAC_WARNINGS_PREFIX, PDECoreMessages.BuildErrorReporter_DisallowIdentifiers);
383
					message = NLS.bind(PDECoreMessages.BuildErrorReporter_ProjectSpecificJavaComplianceDifferentToken, PROPERTY_JAVAC_WARNINGS_PREFIX, PDECoreMessages.BuildErrorReporter_DisallowIdentifiers);
384
					prepareError(JAVAC_WARNINGS_ENTRY, warningToken, message, PDEMarkerFactory.B_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
384
					prepareError(JAVAC_WARNINGS_ENTRY, warningToken, message, PDEMarkerFactory.B_JAVA_ADDDITION, fJavaComplSeverity, PDEMarkerFactory.CAT_EE);
385
				}
385
				}
386
			}
386
			}
387
		}
387
		}
Lines 514-520 Link Here
514
		}
514
		}
515
515
516
		if (!exists) {
516
		if (!exists) {
517
			prepareError(PROPERTY_BIN_INCLUDES, key, NLS.bind(PDECoreMessages.BuildErrorReporter_binIncludesMissing, key), PDEMarkerFactory.B_ADDDITION, fBinInclSeverity, PDEMarkerFactory.CAT_FATAL);
517
			prepareError(PROPERTY_BIN_INCLUDES, key, NLS.bind(PDECoreMessages.BuildErrorReporter_binIncludesMissing, key), PDEMarkerFactory.B_ADDITION, fBinInclSeverity, PDEMarkerFactory.CAT_FATAL);
518
		}
518
		}
519
	}
519
	}
520
520
Lines 592-598 Link Here
592
				}
592
				}
593
			}
593
			}
594
			if (!found)
594
			if (!found)
595
				prepareError(PROPERTY_BIN_INCLUDES, key, NLS.bind(PDECoreMessages.BuildErrorReporter_binIncludesMissing, key), PDEMarkerFactory.B_ADDDITION, fBinInclSeverity, PDEMarkerFactory.CAT_FATAL);
595
				prepareError(PROPERTY_BIN_INCLUDES, key, NLS.bind(PDECoreMessages.BuildErrorReporter_binIncludesMissing, key), PDEMarkerFactory.B_ADDITION, fBinInclSeverity, PDEMarkerFactory.CAT_FATAL);
596
		}
596
		}
597
	}
597
	}
598
598
Lines 633-639 Link Here
633
			}
633
			}
634
			String sourceEntryKey = PROPERTY_SOURCE_PREFIX + libname;
634
			String sourceEntryKey = PROPERTY_SOURCE_PREFIX + libname;
635
			if (!sourceEntryKeys.contains(sourceEntryKey) && !containedInFragment(model.getBundleDescription(), libname))
635
			if (!sourceEntryKeys.contains(sourceEntryKey) && !containedInFragment(model.getBundleDescription(), libname))
636
				prepareError(sourceEntryKey, null, NLS.bind(PDECoreMessages.BuildErrorReporter_missingEntry, sourceEntryKey), PDEMarkerFactory.B_SOURCE_ADDITION, PDEMarkerFactory.CAT_OTHER);
636
				prepareError(sourceEntryKey, null, NLS.bind(PDECoreMessages.BuildErrorReporter_missingEntry, sourceEntryKey), PDEMarkerFactory.B_ADDITION, PDEMarkerFactory.CAT_OTHER);
637
		}
637
		}
638
	}
638
	}
639
639
Lines 679-701 Link Here
679
679
680
	private void validateSourceEntries(ArrayList sourceEntries, IClasspathEntry[] cpes) {
680
	private void validateSourceEntries(ArrayList sourceEntries, IClasspathEntry[] cpes) {
681
		String[] unlisted = PDEBuilderHelper.getUnlistedClasspaths(sourceEntries, fProject, cpes);
681
		String[] unlisted = PDEBuilderHelper.getUnlistedClasspaths(sourceEntries, fProject, cpes);
682
		StringBuffer sb = new StringBuffer();
682
		String name = ((IBuildEntry) sourceEntries.get(0)).getName();
683
		String message = PDECoreMessages.BuildErrorReporter_classpathEntryMissing1;
684
		if (sourceEntries.size() > 1) {
685
			name = DEF_SOURCE_ENTRY;
686
			message = PDECoreMessages.BuildErrorReporter_classpathEntryMissing;
687
		}
683
		for (int i = 0; i < unlisted.length; i++) {
688
		for (int i = 0; i < unlisted.length; i++) {
684
			if (unlisted[i] == null)
689
			if (unlisted[i] == null)
685
				break;
690
				break;
686
			if (sb.length() > 0)
691
			prepareError(name, unlisted[i], NLS.bind(message, unlisted[i], name), PDEMarkerFactory.B_ADDITION, fSrcLibSeverity, PDEMarkerFactory.CAT_OTHER);
687
				sb.append(", "); //$NON-NLS-1$
688
			sb.append(unlisted[i]);
689
		}
692
		}
690
		String unlistedEntries = sb.toString();
691
		if (sb.length() == 0)
692
			return;
693
		if (sourceEntries.size() == 1) {
694
			String name = ((IBuildEntry) sourceEntries.get(0)).getName();
695
			prepareError(name, null, NLS.bind(PDECoreMessages.BuildErrorReporter_classpathEntryMissing1, unlistedEntries, name), PDEMarkerFactory.B_SOURCE_ADDITION, fSrcLibSeverity, PDEMarkerFactory.CAT_OTHER);
696
		} else
697
			prepareError(DEF_SOURCE_ENTRY, null, NLS.bind(PDECoreMessages.BuildErrorReporter_classpathEntryMissing, unlistedEntries), PDEMarkerFactory.B_SOURCE_ADDITION, fSrcLibSeverity, PDEMarkerFactory.CAT_OTHER);
698
699
	}
693
	}
700
694
701
	// bug 286808
695
	// bug 286808
(-)src/org/eclipse/pde/internal/core/builders/PDEMarkerFactory.java (-1 / +2 lines)
Lines 51-60 Link Here
51
	// build properties fixes
51
	// build properties fixes
52
	public static final int B_APPEND_SLASH_FOLDER_ENTRY = 0x2001;
52
	public static final int B_APPEND_SLASH_FOLDER_ENTRY = 0x2001;
53
	public static final int B_REMOVE_SLASH_FILE_ENTRY = 0x2002;
53
	public static final int B_REMOVE_SLASH_FILE_ENTRY = 0x2002;
54
	public static final int B_ADDDITION = 0x2003;
54
	public static final int B_ADDITION = 0x2003;
55
	public static final int B_SOURCE_ADDITION = 0x2004;
55
	public static final int B_SOURCE_ADDITION = 0x2004;
56
	public static final int B_REMOVAL = 0x2005;
56
	public static final int B_REMOVAL = 0x2005;
57
	public static final int B_REPLACE = 0x2006;
57
	public static final int B_REPLACE = 0x2006;
58
	public static final int B_JAVA_ADDDITION = 0x2007;
58
59
59
	// plugin.xml fixes
60
	// plugin.xml fixes
60
	public static final int P_ILLEGAL_XML_NODE = 0x3001;
61
	public static final int P_ILLEGAL_XML_NODE = 0x3001;
(-)src/org/eclipse/pde/internal/core/builders/SourceEntryErrorReporter.java (-1 / +1 lines)
Lines 346-352 Link Here
346
			String libName = (String) iter.next();
346
			String libName = (String) iter.next();
347
			MissingOutputEntry errorEntry = (MissingOutputEntry) missingOutputEntryErrors.get(libName);
347
			MissingOutputEntry errorEntry = (MissingOutputEntry) missingOutputEntryErrors.get(libName);
348
			String message = NLS.bind(PDECoreMessages.SourceEntryErrorReporter_MissingOutputEntry, errorEntry.get(errorEntry.fSsrcFolders), PROPERTY_OUTPUT_PREFIX + libName);
348
			String message = NLS.bind(PDECoreMessages.SourceEntryErrorReporter_MissingOutputEntry, errorEntry.get(errorEntry.fSsrcFolders), PROPERTY_OUTPUT_PREFIX + libName);
349
			prepareError(PROPERTY_OUTPUT_PREFIX + libName, errorEntry.get(errorEntry.fOutputFolders), message, PDEMarkerFactory.B_ADDDITION, fMissingOutputLibSeverity, PDEMarkerFactory.CAT_OTHER);
349
			prepareError(PROPERTY_OUTPUT_PREFIX + libName, errorEntry.get(errorEntry.fOutputFolders), message, PDEMarkerFactory.B_ADDITION, fMissingOutputLibSeverity, PDEMarkerFactory.CAT_OTHER);
350
		}
350
		}
351
	}
351
	}
352
352
(-)src/org/eclipse/pde/internal/ui/PDEUIMessages.java (+2 lines)
Lines 2683-2688 Link Here
2683
2683
2684
	public static String ManifestEditorContributor_externStringsActionName;
2684
	public static String ManifestEditorContributor_externStringsActionName;
2685
2685
2686
	public static String MultiFixResolution_JavaFixAll;
2687
2686
	public static String MultiFixResolution_FixAll;
2688
	public static String MultiFixResolution_FixAll;
2687
2689
2688
	public static String SplashSection_progressBar;
2690
	public static String SplashSection_progressBar;
(-)src/org/eclipse/pde/internal/ui/pderesources.properties (-1 / +2 lines)
Lines 2158-2164 Link Here
2158
RenamePluginProcessor_renameProjectDesc=Rename project ''{0}'' to ''{1}''
2158
RenamePluginProcessor_renameProjectDesc=Rename project ''{0}'' to ''{1}''
2159
RemoveInternalDirective_label=Remove redundant x-internal header
2159
RemoveInternalDirective_label=Remove redundant x-internal header
2160
RemoveInternalDirective_desc=The x-friends directive implies x-internal, so the latter is redundant
2160
RemoveInternalDirective_desc=The x-friends directive implies x-internal, so the latter is redundant
2161
MultiFixResolution_FixAll=Add all missing java compiler build entries
2161
MultiFixResolution_JavaFixAll=Add all missing java compiler build entries
2162
MultiFixResolution_FixAll=Fix all similar entries
2162
ImportPackageSection_dialogButtonLabel=&Show non-exported packages
2163
ImportPackageSection_dialogButtonLabel=&Show non-exported packages
2163
ExportPackageSection_dialogButtonLabel=&Show non-Java packages
2164
ExportPackageSection_dialogButtonLabel=&Show non-Java packages
2164
MissingResourcePage_missingResource=Missing Resource
2165
MissingResourcePage_missingResource=Missing Resource
(-)src/org/eclipse/pde/internal/ui/correction/AddBuildEntryResolution.java (-4 / +9 lines)
Lines 13-20 Link Here
13
import org.eclipse.core.resources.IMarker;
13
import org.eclipse.core.resources.IMarker;
14
import org.eclipse.core.runtime.CoreException;
14
import org.eclipse.core.runtime.CoreException;
15
import org.eclipse.osgi.util.NLS;
15
import org.eclipse.osgi.util.NLS;
16
import org.eclipse.pde.internal.core.text.build.Build;
16
import org.eclipse.pde.internal.core.text.build.*;
17
import org.eclipse.pde.internal.core.text.build.BuildEntry;
18
import org.eclipse.pde.internal.ui.PDEUIMessages;
17
import org.eclipse.pde.internal.ui.PDEUIMessages;
19
18
20
public class AddBuildEntryResolution extends BuildEntryMarkerResolution {
19
public class AddBuildEntryResolution extends BuildEntryMarkerResolution {
Lines 29-38 Link Here
29
28
30
	protected void createChange(Build build) {
29
	protected void createChange(Build build) {
31
		try {
30
		try {
31
			BuildModel buildModel = build.getModel();
32
			if (buildModel.isStale()) {
33
				buildModel.reconciled(buildModel.getDocument());
34
			}
32
			BuildEntry buildEntry = (BuildEntry) build.getEntry(fEntry);
35
			BuildEntry buildEntry = (BuildEntry) build.getEntry(fEntry);
33
			if (buildEntry == null)
36
			if (buildEntry == null)
34
				buildEntry = new BuildEntry(fEntry, build.getModel());
37
				buildEntry = new BuildEntry(fEntry, buildModel);
35
			buildEntry.addToken(fToken);
38
39
			if (fToken != null)
40
				buildEntry.addToken(fToken);
36
		} catch (CoreException e) {
41
		} catch (CoreException e) {
37
		}
42
		}
38
	}
43
	}
(-)src/org/eclipse/pde/internal/ui/correction/MultiFixResolution.java (-2 / +7 lines)
Lines 28-38 Link Here
28
public class MultiFixResolution extends WorkbenchMarkerResolution {
28
public class MultiFixResolution extends WorkbenchMarkerResolution {
29
29
30
	IMarker fMarker;
30
	IMarker fMarker;
31
	String fLabel;
31
	// if quick fix is invoked from editor, then fix all related markers. If invoked from problem view, fix only the selected ones.
32
	// if quick fix is invoked from editor, then fix all related markers. If invoked from problem view, fix only the selected ones.
32
	boolean problemViewQuickFix;
33
	boolean problemViewQuickFix;
33
34
34
	public MultiFixResolution(IMarker marker) {
35
	public MultiFixResolution(IMarker marker, String label) {
35
		fMarker = marker;
36
		fMarker = marker;
37
		if (label != null)
38
			fLabel = label;
39
		else
40
			fLabel = PDEUIMessages.MultiFixResolution_FixAll;
36
		problemViewQuickFix = false;
41
		problemViewQuickFix = false;
37
	}
42
	}
38
43
Lines 60-66 Link Here
60
	}
65
	}
61
66
62
	public String getLabel() {
67
	public String getLabel() {
63
		return PDEUIMessages.MultiFixResolution_FixAll;
68
		return fLabel;
64
	}
69
	}
65
70
66
	public void run(IMarker marker) {
71
	public void run(IMarker marker) {
(-)src/org/eclipse/pde/internal/ui/correction/ResolutionGenerator.java (-5 / +9 lines)
Lines 20-25 Link Here
20
import org.eclipse.pde.internal.core.ICoreConstants;
20
import org.eclipse.pde.internal.core.ICoreConstants;
21
import org.eclipse.pde.internal.core.TargetPlatformHelper;
21
import org.eclipse.pde.internal.core.TargetPlatformHelper;
22
import org.eclipse.pde.internal.core.builders.PDEMarkerFactory;
22
import org.eclipse.pde.internal.core.builders.PDEMarkerFactory;
23
import org.eclipse.pde.internal.ui.PDEUIMessages;
23
import org.eclipse.ui.IMarkerResolution;
24
import org.eclipse.ui.IMarkerResolution;
24
import org.eclipse.ui.IMarkerResolutionGenerator2;
25
import org.eclipse.ui.IMarkerResolutionGenerator2;
25
import org.osgi.framework.Constants;
26
import org.osgi.framework.Constants;
Lines 78-85 Link Here
78
				return new IMarkerResolution[] {new RemoveSeperatorBuildEntryResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker)};
79
				return new IMarkerResolution[] {new RemoveSeperatorBuildEntryResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker)};
79
			case PDEMarkerFactory.B_APPEND_SLASH_FOLDER_ENTRY :
80
			case PDEMarkerFactory.B_APPEND_SLASH_FOLDER_ENTRY :
80
				return new IMarkerResolution[] {new AppendSeperatorBuildEntryResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker)};
81
				return new IMarkerResolution[] {new AppendSeperatorBuildEntryResolution(AbstractPDEMarkerResolution.RENAME_TYPE, marker)};
81
			case PDEMarkerFactory.B_ADDDITION :
82
			case PDEMarkerFactory.B_ADDITION :
82
				return getBuildEntryAdditionResolutions(marker);
83
				return getBuildEntryAdditionResolutions(marker, null);
84
			case PDEMarkerFactory.B_JAVA_ADDDITION :
85
				return getBuildEntryAdditionResolutions(marker, PDEUIMessages.MultiFixResolution_JavaFixAll);
83
			case PDEMarkerFactory.B_SOURCE_ADDITION :
86
			case PDEMarkerFactory.B_SOURCE_ADDITION :
84
				return new IMarkerResolution[] {new AddSourceBuildEntryResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker)};
87
				return new IMarkerResolution[] {new AddSourceBuildEntryResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker)};
85
			case PDEMarkerFactory.B_REMOVAL :
88
			case PDEMarkerFactory.B_REMOVAL :
Lines 106-120 Link Here
106
		return NO_RESOLUTIONS;
109
		return NO_RESOLUTIONS;
107
	}
110
	}
108
111
109
	private IMarkerResolution[] getBuildEntryAdditionResolutions(IMarker marker) {
112
	private IMarkerResolution[] getBuildEntryAdditionResolutions(IMarker marker, String multiFixDescription) {
110
		ArrayList resolutions = new ArrayList(2);
113
		ArrayList resolutions = new ArrayList(2);
111
		resolutions.add(new AddBuildEntryResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker));
114
		resolutions.add(new AddBuildEntryResolution(AbstractPDEMarkerResolution.CREATE_TYPE, marker));
112
		try {
115
		try {
113
			String markerCategory = (String) marker.getAttribute(PDEMarkerFactory.CAT_ID);
116
			String markerCategory = (String) marker.getAttribute(PDEMarkerFactory.CAT_ID);
117
			int problemID = marker.getAttribute("id", PDEMarkerFactory.NO_RESOLUTION); //$NON-NLS-1$
114
			IMarker[] relatedMarkers = marker.getResource().findMarkers(marker.getType(), true, IResource.DEPTH_INFINITE);
118
			IMarker[] relatedMarkers = marker.getResource().findMarkers(marker.getType(), true, IResource.DEPTH_INFINITE);
115
			for (int i = 0; i < relatedMarkers.length; i++) {
119
			for (int i = 0; i < relatedMarkers.length; i++) {
116
				if (markerCategory.equals(relatedMarkers[i].getAttribute(PDEMarkerFactory.CAT_ID)) && !marker.equals(relatedMarkers[i])) {
120
				if (markerCategory.equals(relatedMarkers[i].getAttribute(PDEMarkerFactory.CAT_ID)) && relatedMarkers[i].getAttribute("id", PDEMarkerFactory.NO_RESOLUTION) == problemID && !marker.equals(relatedMarkers[i])) { //$NON-NLS-1$
117
					resolutions.add(new MultiFixResolution(marker));
121
					resolutions.add(new MultiFixResolution(marker, multiFixDescription));
118
					break;
122
					break;
119
				}
123
				}
120
			}
124
			}
(-)src/org/eclipse/pde/ui/tests/build/properties/AbstractBuildValidationTest.java (-18 / +25 lines)
Lines 52-57 Link Here
52
public abstract class AbstractBuildValidationTest extends TestCase {
52
public abstract class AbstractBuildValidationTest extends TestCase {
53
53
54
	private static final String MARKER = "marker";
54
	private static final String MARKER = "marker";
55
	private static final String MULTIPLE_MARKERS = "multipleMarkers";
55
	private int fBuildPropIndex;
56
	private int fBuildPropIndex;
56
57
57
	/* (non-Javadoc)
58
	/* (non-Javadoc)
Lines 60-66 Link Here
60
	protected void setUp() throws Exception {
61
	protected void setUp() throws Exception {
61
		URL location = MacroPlugin.getBundleContext().getBundle().getEntry("/tests/build.properties");
62
		URL location = MacroPlugin.getBundleContext().getBundle().getEntry("/tests/build.properties");
62
		File projectFile = new File(FileLocator.toFileURL(location).getFile());
63
		File projectFile = new File(FileLocator.toFileURL(location).getFile());
63
		assertTrue("Could not find test zip files at " + projectFile,projectFile.isDirectory());
64
		assertTrue("Could not find test zip files at " + projectFile, projectFile.isDirectory());
64
		File[] zipFiles = projectFile.listFiles();
65
		File[] zipFiles = projectFile.listFiles();
65
		for (int i = 0; i < zipFiles.length; i++) {
66
		for (int i = 0; i < zipFiles.length; i++) {
66
			int index = zipFiles[i].getName().lastIndexOf('.');
67
			int index = zipFiles[i].getName().lastIndexOf('.');
Lines 90-96 Link Here
90
			if (resGen.hasResolutions(markers[i])) {
91
			if (resGen.hasResolutions(markers[i])) {
91
				String markerEntry = (String) markers[i].getAttribute(PDEMarkerFactory.BK_BUILD_ENTRY);
92
				String markerEntry = (String) markers[i].getAttribute(PDEMarkerFactory.BK_BUILD_ENTRY);
92
				IMarkerResolution[] resolutions = resGen.getResolutions(markers[i]);
93
				IMarkerResolution[] resolutions = resGen.getResolutions(markers[i]);
93
				String quickFixindex = getProperty(expectedValues,  markerEntry , "quickfix");
94
				String quickFixindex = getProperty(expectedValues, markerEntry, "quickfix");
94
				resolutions[new Integer(quickFixindex.trim()).intValue()].run(markers[i]);
95
				resolutions[new Integer(quickFixindex.trim()).intValue()].run(markers[i]);
95
				buildProject(markers[i].getResource().getProject(), 0);
96
				buildProject(markers[i].getResource().getProject(), 0);
96
				assertFalse("Quick fix verification failed for build.properties" + fBuildPropIndex, markers[i].exists());
97
				assertFalse("Quick fix verification failed for build.properties" + fBuildPropIndex, markers[i].exists());
Lines 125-141 Link Here
125
			default :
126
			default :
126
				markerSeverity = IMarker.SEVERITY_INFO;
127
				markerSeverity = IMarker.SEVERITY_INFO;
127
		}
128
		}
128
		
129
129
		for (int i = 0; i < markers.length; i++) {
130
		for (int i = 0; i < markers.length; i++) {
130
			message = "Marker severity for build.properties" + fBuildPropIndex;
131
			message = "Marker severity for build.properties" + fBuildPropIndex;
131
			String markerEntry = (String) markers[i].getAttribute(PDEMarkerFactory.BK_BUILD_ENTRY);
132
			String markerEntry = (String) markers[i].getAttribute(PDEMarkerFactory.BK_BUILD_ENTRY);
132
			assertEquals(message, markerSeverity, getIntAttribute(markers[i],IMarker.SEVERITY));
133
			assertEquals(message, markerSeverity, getIntAttribute(markers[i], IMarker.SEVERITY));
133
			
134
134
			message = "Marker type for build.properties" + fBuildPropIndex;
135
			message = "Marker type for build.properties" + fBuildPropIndex;
135
			String markerType = getProperty(expectedValues, markerEntry, PDEMarkerFactory.CAT_ID);
136
			String markerType = getProperty(expectedValues, markerEntry, PDEMarkerFactory.CAT_ID);
136
			assertEquals(message, markerType, getStringAttribute(markers[i],PDEMarkerFactory.CAT_ID));
137
			assertEquals(message, markerType, getStringAttribute(markers[i], PDEMarkerFactory.CAT_ID));
137
138
138
			message = "Marker line number for build.properties" + fBuildPropIndex;			
139
			message = "Marker line number for build.properties" + fBuildPropIndex;
139
			int lineNumber;
140
			int lineNumber;
140
			try {
141
			try {
141
				lineNumber = new Integer(getProperty(expectedValues, markerEntry, IMarker.LINE_NUMBER)).intValue();
142
				lineNumber = new Integer(getProperty(expectedValues, markerEntry, IMarker.LINE_NUMBER)).intValue();
Lines 143-157 Link Here
143
				message = "Could not read expected line number for build.properties" + fBuildPropIndex;
144
				message = "Could not read expected line number for build.properties" + fBuildPropIndex;
144
				lineNumber = 0;
145
				lineNumber = 0;
145
			}
146
			}
146
			assertEquals(message, lineNumber, getIntAttribute(markers[i],IMarker.LINE_NUMBER));
147
			assertEquals(message, lineNumber, getIntAttribute(markers[i], IMarker.LINE_NUMBER));
147
148
148
			message = "Marker build entry token value for build.properties" + fBuildPropIndex;
149
			message = "Marker build entry token value for build.properties" + fBuildPropIndex;
150
			String multipleMarkers = getProperty(expectedValues, markerEntry, MULTIPLE_MARKERS);
149
			String tokenValue = getProperty(expectedValues, markerEntry, PDEMarkerFactory.BK_BUILD_TOKEN);
151
			String tokenValue = getProperty(expectedValues, markerEntry, PDEMarkerFactory.BK_BUILD_TOKEN);
150
			assertEquals(message, tokenValue, getStringAttribute(markers[i],PDEMarkerFactory.BK_BUILD_TOKEN));			
152
			if (multipleMarkers.equalsIgnoreCase(Boolean.TRUE.toString())) {
153
				boolean contains = tokenValue.indexOf(getStringAttribute(markers[i], PDEMarkerFactory.BK_BUILD_TOKEN)) >= 0;
154
				assertTrue(message, contains);
155
			} else {
156
				assertEquals(message, tokenValue, getStringAttribute(markers[i], PDEMarkerFactory.BK_BUILD_TOKEN));
157
			}
151
		}
158
		}
152
159
153
	}
160
	}
154
	
161
155
	private int getIntAttribute(IMarker marker, String property) {
162
	private int getIntAttribute(IMarker marker, String property) {
156
		Integer value;
163
		Integer value;
157
		try {
164
		try {
Lines 160-168 Link Here
160
			return 0;
167
			return 0;
161
		}
168
		}
162
169
163
		if (value == null )
170
		if (value == null)
164
			return 0;
171
			return 0;
165
		return value.intValue();		
172
		return value.intValue();
166
	}
173
	}
167
174
168
	private String getStringAttribute(IMarker marker, String property) {
175
	private String getStringAttribute(IMarker marker, String property) {
Lines 175-183 Link Here
175
182
176
		if (value == null || value.equalsIgnoreCase("\"\""))
183
		if (value == null || value.equalsIgnoreCase("\"\""))
177
			value = "";
184
			value = "";
178
		return value.trim();		
185
		return value.trim();
179
	}
186
	}
180
	
187
181
	private String getProperty(PropertyResourceBundle propertyBundle, String property) {
188
	private String getProperty(PropertyResourceBundle propertyBundle, String property) {
182
		String value;
189
		String value;
183
		try {
190
		try {
Lines 187-197 Link Here
187
		}
194
		}
188
		if (value == null || value.equalsIgnoreCase("\"\""))
195
		if (value == null || value.equalsIgnoreCase("\"\""))
189
			value = "";
196
			value = "";
190
		return value.trim();		
197
		return value.trim();
191
	}
198
	}
192
	
199
193
	private String getProperty(PropertyResourceBundle propertyBundle, String entry, String property) {
200
	private String getProperty(PropertyResourceBundle propertyBundle, String entry, String property) {
194
		return getProperty(propertyBundle, entry + '.' + property);		
201
		return getProperty(propertyBundle, entry + '.' + property);
195
	}
202
	}
196
203
197
	/**
204
	/**
Lines 305-311 Link Here
305
		projectPrefs.flush();
312
		projectPrefs.flush();
306
		projectPrefs.sync();
313
		projectPrefs.sync();
307
	}
314
	}
308
	
315
309
	/**
316
	/**
310
	 * Find the project in workspace with the given id
317
	 * Find the project in workspace with the given id
311
	 * @param id	project id
318
	 * @param id	project id

Return to bug 292906