summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephan Herrmann2013-01-08 11:18:43 (EST)
committer Dani Megert2013-01-08 11:18:43 (EST)
commit7deee1b79cf1789be4e7e257b25c31d2e6c9d19e (patch)
tree36487189a5950d0b88cddc7f518d62d4d3c6e431
parentb267310ff6f01b19cbf3707fafd9e85faaaea525 (diff)
downloadeclipse.jdt.ui-7deee1b79cf1789be4e7e257b25c31d2e6c9d19e.zip
eclipse.jdt.ui-7deee1b79cf1789be4e7e257b25c31d2e6c9d19e.tar.gz
eclipse.jdt.ui-7deee1b79cf1789be4e7e257b25c31d2e6c9d19e.tar.bz2
Fixed bug 378024: Ordering of comments between imports not preserved
-rw-r--r--org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java21
1 files changed, 8 insertions, 13 deletions
diff --git a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java
index ac5a532..ac1f98d 100644
--- a/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java
+++ b/org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/core/ImportOrganizeTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2012 IBM Corporation and others.
+ * Copyright (c) 2000, 2013 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -42,6 +42,7 @@ import org.eclipse.jdt.internal.corext.codemanipulation.OrganizeImportsOperation
import org.eclipse.jdt.ui.JavaUI;
import org.eclipse.jdt.ui.PreferenceConstants;
+
public class ImportOrganizeTest extends CoreTests {
private static final Class THIS= ImportOrganizeTest.class;
@@ -577,8 +578,7 @@ public class ImportOrganizeTest extends CoreTests {
buf= new StringBuffer();
buf.append("package pack1;\r\n");
buf.append("\r\n");
- buf.append("import java.util.Vector;\r\n");
- buf.append("// comment\r\n");
+ buf.append("import java.util.Vector; // comment\r\n");
buf.append("\r\n");
buf.append("public class C {\r\n");
buf.append(" Vector v;\r\n");
@@ -682,16 +682,12 @@ public class ImportOrganizeTest extends CoreTests {
buf.append("package pack1;\n");
buf.append("\n");
buf.append("// comment 1\n");
- buf.append("/*lead 1*/");
- buf.append("import java.util.*;\n");
+ buf.append("/*lead 1*//*lead 2*/ /**lead 3*/import java.util.*; //test3\n");
+ buf.append("//test1/*test2*/\n");
+ buf.append("");
buf.append("\n");
- buf.append("import pack.List;\n");
- buf.append("//test1\n");
- buf.append("/*lead 2*/ \n");
- buf.append("/*test2*/\n");
- buf.append("/**lead 3*/\n");
- buf.append("//test3\n");
buf.append("/**comment 2*/\n");
+ buf.append("import pack.List;\n");
buf.append("\n");
buf.append("public class C {\n");
buf.append(" Vector v;\n");
@@ -2459,8 +2455,7 @@ public class ImportOrganizeTest extends CoreTests {
buf.append("/**comment1*/\n");
buf.append("/*lead1*/");
buf.append("import java.util.ArrayList;\n");
- buf.append("import java.util.HashMap;\n");
- buf.append("// trail 1\n");
+ buf.append("import java.util.HashMap;// trail 1\n");
buf.append("\n");
buf.append("public class C {\n");
buf.append(" public void foo() {\n");