Skip to content

Commit 26bb58c

Browse files
author
jossonsmith
committed
Fixed bug#1563609. Merge from trunk
1 parent 862f1a8 commit 26bb58c

File tree

3 files changed

+24
-12
lines changed

3 files changed

+24
-12
lines changed

src/net/sf/j2s/ui/launching/J2SLaunchingUtil.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,20 @@ private static String generateClasspathExistedClasses (
288288
String path = javaProject.getOutputLocation().toString();
289289
int idx = path.indexOf('/', 2);
290290
String relativePath = null;
291+
File srcFolder = null;
291292
if (idx != -1) {
292-
relativePath = path.substring(idx + 1);
293+
relativePath = path.substring(idx + 1);
294+
srcFolder = new File(workingDir, relativePath);
295+
} else {
296+
relativePath = "";
297+
srcFolder = workingDir;
293298
}
294299

295300
buf.append('[');
296301
try {
297-
buf.append(new File(workingDir, relativePath).getCanonicalPath());
302+
buf.append(srcFolder.getCanonicalPath());
298303
} catch (IOException e) {
304+
// should never run into these lines!
299305
e.printStackTrace();
300306
buf.append(relativePath);
301307
}
@@ -394,9 +400,9 @@ private static String generateClasspathExistedClasses (
394400
int idx2 = clazzName.lastIndexOf(".");
395401
if (idx2 != -1) {
396402
clazzName = clazzName.substring(0, idx2);
403+
set.add(clazzName);
404+
existedPackages = true;
397405
}
398-
set.add(clazzName);
399-
existedPackages = true;
400406
}
401407
}
402408
if (existedPackages) {

src/net/sf/j2s/ui/launching/J2SUnitLaunchingUtil.java

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,14 +289,20 @@ private static String generateClasspathExistedClasses (
289289
String path = javaProject.getOutputLocation().toString();
290290
int idx = path.indexOf('/', 2);
291291
String relativePath = null;
292+
File srcFolder = null;
292293
if (idx != -1) {
293-
relativePath = path.substring(idx + 1);
294+
relativePath = path.substring(idx + 1);
295+
srcFolder = new File(workingDir, relativePath);
296+
} else {
297+
relativePath = "";
298+
srcFolder = workingDir;
294299
}
295300

296301
buf.append('[');
297302
try {
298-
buf.append(new File(workingDir, relativePath).getCanonicalPath());
303+
buf.append(srcFolder.getCanonicalPath());
299304
} catch (IOException e) {
305+
// should never run into these lines!
300306
e.printStackTrace();
301307
buf.append(relativePath);
302308
}
@@ -395,9 +401,9 @@ private static String generateClasspathExistedClasses (
395401
int idx2 = clazzName.lastIndexOf(".");
396402
if (idx2 != -1) {
397403
clazzName = clazzName.substring(0, idx2);
404+
set.add(clazzName);
405+
existedPackages = true;
398406
}
399-
set.add(clazzName);
400-
existedPackages = true;
401407
}
402408
}
403409
if (existedPackages) {

src/net/sf/j2s/ui/property/J2SConfigPage.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,9 +422,9 @@ protected void updateButtonGroup() {
422422
return ;
423423
}
424424
if (isSelectionInOneCategory()) {
425-
if (!isAbandonsSelected()) {
425+
//if (!isAbandonsSelected()) {
426426
buttonRemove.setEnabled(true);
427-
}
427+
//}
428428
if (!isLastElementSelected()) {
429429
buttonDown.setEnabled(true);
430430
}
@@ -443,9 +443,9 @@ protected void updateButtonGroup() {
443443
}
444444
}
445445
} else if (!isSelectionContainsCategory() && getSelection().length > 0) {
446-
if (!isAbandonsSelected()) {
446+
//if (!isAbandonsSelected()) {
447447
buttonRemove.setEnabled(true);
448-
}
448+
//}
449449
}
450450
if (getSelection().length == 1) {
451451
if (isResourceCategorySelected()) {

0 commit comments

Comments
 (0)