Skip to content

Commit c5c2ffb

Browse files
authored
Add more details to error message (eclipse-jdt#4992)
Mention the name of the project that has the error in order to better deal with it.
1 parent a0dec6f commit c5c2ffb

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/ClasspathEntry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,7 @@ public static IJavaModelStatus validateClasspath(IJavaProject javaProject, IClas
18431843

18441844
IProject project = javaProject.getProject();
18451845
IPath projectPath= project.getFullPath();
1846-
String projectName = javaProject.getElementName();
1846+
final String projectName = javaProject.getElementName();
18471847

18481848
/* validate output location */
18491849
if (projectOutputLocation == null) {
@@ -2163,7 +2163,7 @@ public boolean isOK() {
21632163
if (hasTest && !hasMain) {
21642164
return new JavaModelStatus(IJavaModelStatusConstants.MAIN_ONLY_PROJECT_DEPENDS_ON_TEST_ONLY_PROJECT,
21652165
Messages.bind(Messages.classpath_main_only_project_depends_on_test_only_project,
2166-
new String[] { prereqProject.getElementName() }));
2166+
new String[] { projectName, prereqProject.getElementName() }));
21672167
}
21682168
}
21692169
}

org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/util/messages.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ classpath_deprecated_variable = Classpath variable ''{0}'' in project ''{1}'' is
190190
classpath_invalidExternalAnnotationPath = Invalid external annotation path: ''{0}'' in project ''{1}'', for classpath entry ''{2}''
191191
classpath_testSourceRequiresSeparateOutputFolder=Test source folder ''{0}'' in project ''{1}'' must have a separate output folder
192192
classpath_testOutputFolderMustBeSeparateFromMainOutputFolders=Test source folder ''{0}'' in project ''{1}'' must have an output folder that is not also used for main sources
193-
classpath_main_only_project_depends_on_test_only_project=Project has only main sources but depends on project ''{0}'' which has only test sources.
193+
classpath_main_only_project_depends_on_test_only_project=Project ''{0}'' has only main sources but depends on project ''{1}'' which has only test sources.
194194
classpath_illegalAddExportsSystemModule=Exporting a package from system module ''{0}'' is not allowed with --release.
195195

196196

0 commit comments

Comments
 (0)