Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 142588 Details for
Bug 48056
[extract method] Test cases for extract method and continue
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
patch+testcases
clipboard.txt (text/plain), 37.54 KB, created by
Benjamin Muskalla
on 2009-07-25 16:03:16 EDT
(
hide
)
Description:
patch+testcases
Filename:
MIME Type:
Creator:
Benjamin Muskalla
Created:
2009-07-25 16:03:16 EDT
Size:
37.54 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java,v >retrieving revision 1.76 >diff -u -r1.76 ExtractMethodAnalyzer.java >--- core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java 11 Sep 2008 11:59:46 -0000 1.76 >+++ core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodAnalyzer.java 25 Jul 2009 20:02:29 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Extract method and continue https://bugs.eclipse.org/bugs/show_bug.cgi?id=48056 > *******************************************************************************/ > package org.eclipse.jdt.internal.corext.refactoring.code; > >@@ -25,6 +26,7 @@ > import org.eclipse.jdt.core.compiler.ITerminalSymbols; > import org.eclipse.jdt.core.dom.AST; > import org.eclipse.jdt.core.dom.ASTNode; >+import org.eclipse.jdt.core.dom.ASTVisitor; > import org.eclipse.jdt.core.dom.AnonymousClassDeclaration; > import org.eclipse.jdt.core.dom.Assignment; > import org.eclipse.jdt.core.dom.Block; >@@ -32,7 +34,9 @@ > import org.eclipse.jdt.core.dom.ClassInstanceCreation; > import org.eclipse.jdt.core.dom.CompilationUnit; > import org.eclipse.jdt.core.dom.ConstructorInvocation; >+import org.eclipse.jdt.core.dom.ContinueStatement; > import org.eclipse.jdt.core.dom.DoStatement; >+import org.eclipse.jdt.core.dom.EnhancedForStatement; > import org.eclipse.jdt.core.dom.Expression; > import org.eclipse.jdt.core.dom.FieldAccess; > import org.eclipse.jdt.core.dom.ForStatement; >@@ -40,12 +44,14 @@ > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.IVariableBinding; > import org.eclipse.jdt.core.dom.Initializer; >+import org.eclipse.jdt.core.dom.LabeledStatement; > import org.eclipse.jdt.core.dom.Message; > import org.eclipse.jdt.core.dom.MethodDeclaration; > import org.eclipse.jdt.core.dom.Name; > import org.eclipse.jdt.core.dom.PrimitiveType; > import org.eclipse.jdt.core.dom.QualifiedName; > import org.eclipse.jdt.core.dom.SimpleName; >+import org.eclipse.jdt.core.dom.Statement; > import org.eclipse.jdt.core.dom.StructuralPropertyDescriptor; > import org.eclipse.jdt.core.dom.SuperConstructorInvocation; > import org.eclipse.jdt.core.dom.SwitchCase; >@@ -55,6 +61,7 @@ > import org.eclipse.jdt.core.dom.VariableDeclarationExpression; > import org.eclipse.jdt.core.dom.VariableDeclarationFragment; > import org.eclipse.jdt.core.dom.VariableDeclarationStatement; >+import org.eclipse.jdt.core.dom.WhileStatement; > import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; > > import org.eclipse.jdt.internal.corext.dom.ASTNodeFactory; >@@ -110,7 +117,8 @@ > > private boolean fForceStatic; > private boolean fIsLastStatementSelected; >- >+ private SimpleName fEnclosingLoopLabel; >+ > public ExtractMethodAnalyzer(ICompilationUnit unit, Selection selection) throws CoreException { > super(unit, selection, false); > } >@@ -314,9 +322,11 @@ > fInputFlowInfo= flowAnalyzer.perform(getSelectedNodes()); > > if (fInputFlowInfo.branches()) { >- status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_branch_mismatch, JavaStatusContext.create(fCUnit, getSelection())); >- fReturnKind= ERROR; >- return status; >+ if (!canHandleBranches()) { >+ status.addFatalError(RefactoringCoreMessages.ExtractMethodAnalyzer_branch_mismatch, JavaStatusContext.create(fCUnit, getSelection())); >+ fReturnKind= ERROR; >+ return status; >+ } > } > if (fInputFlowInfo.isValueReturn()) { > fReturnKind= RETURN_STATEMENT_VALUE; >@@ -341,6 +351,62 @@ > return status; > } > >+ private boolean canHandleBranches() { >+ ASTNode[] selectedNodes= getSelectedNodes(); >+ final ASTNode lastSelectedNode= selectedNodes[selectedNodes.length - 1]; >+ Statement body= getParentLoopBody(lastSelectedNode.getParent()); >+ ASTNode lastStatmentInLoop= null; >+ if (body != null) { >+ if (body instanceof Block) { >+ Block block= (Block)body; >+ lastStatmentInLoop= (ASTNode)block.statements().get(block.statements().size() - 1); >+ } >+ } >+ final boolean continueMatchesLoop[]= new boolean[1]; >+ continueMatchesLoop[0]= false; >+ for (int i= 0; i < selectedNodes.length; i++) { >+ final ASTNode astNode= selectedNodes[i]; >+ astNode.accept(new ASTVisitor() { >+ public void endVisit(ContinueStatement node) { >+ super.endVisit(node); >+ final SimpleName label= node.getLabel(); >+ if (label == null) { >+ continueMatchesLoop[0]= true; >+ } else if (fEnclosingLoopLabel != null) { >+ continueMatchesLoop[0]= label.getIdentifier().equals(fEnclosingLoopLabel.getIdentifier()); >+ } >+ } >+ }); >+ } >+ return lastSelectedNode == lastStatmentInLoop && continueMatchesLoop[0] && fReturnValue == null; >+ } >+ >+ private Statement getParentLoopBody(ASTNode node) { >+ Statement stmt= null; >+ ASTNode start= node; >+ while (start != null >+ && !(start instanceof ForStatement) >+ && !(start instanceof DoStatement) >+ && !(start instanceof WhileStatement) >+ && !(start instanceof EnhancedForStatement)) { >+ start= start.getParent(); >+ } >+ if (start instanceof ForStatement) { >+ stmt= ((ForStatement)start).getBody(); >+ } else if (start instanceof DoStatement) { >+ stmt= ((DoStatement)start).getBody(); >+ } else if (start instanceof WhileStatement) { >+ stmt= ((WhileStatement)start).getBody(); >+ } else if (start instanceof EnhancedForStatement) { >+ stmt= ((EnhancedForStatement)start).getBody(); >+ } >+ if (start.getParent() instanceof LabeledStatement) { >+ LabeledStatement labeledStatement= (LabeledStatement)start.getParent(); >+ fEnclosingLoopLabel= labeledStatement.getLabel(); >+ } >+ return stmt; >+ } >+ > private boolean isVoidMethod() { > // if we have an initializer > if (fEnclosingMethodBinding == null) >Index: core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java,v >retrieving revision 1.166 >diff -u -r1.166 ExtractMethodRefactoring.java >--- core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java 13 Jul 2009 16:08:21 -0000 1.166 >+++ core refactoring/org/eclipse/jdt/internal/corext/refactoring/code/ExtractMethodRefactoring.java 25 Jul 2009 20:02:29 -0000 >@@ -8,6 +8,7 @@ > * Contributors: > * IBM Corporation - initial API and implementation > * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Does not replace similar code in parent class of anonymous class - https://bugs.eclipse.org/bugs/show_bug.cgi?id=160853 >+ * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Extract method and continue https://bugs.eclipse.org/bugs/show_bug.cgi?id=48056 > *******************************************************************************/ > package org.eclipse.jdt.internal.corext.refactoring.code; > >@@ -54,16 +55,21 @@ > import org.eclipse.jdt.core.dom.BodyDeclaration; > import org.eclipse.jdt.core.dom.ChildListPropertyDescriptor; > import org.eclipse.jdt.core.dom.CompilationUnit; >+import org.eclipse.jdt.core.dom.ContinueStatement; >+import org.eclipse.jdt.core.dom.DoStatement; >+import org.eclipse.jdt.core.dom.EnhancedForStatement; > import org.eclipse.jdt.core.dom.EnumDeclaration; > import org.eclipse.jdt.core.dom.Expression; > import org.eclipse.jdt.core.dom.ExpressionStatement; > import org.eclipse.jdt.core.dom.FieldAccess; > import org.eclipse.jdt.core.dom.FieldDeclaration; >+import org.eclipse.jdt.core.dom.ForStatement; > import org.eclipse.jdt.core.dom.IMethodBinding; > import org.eclipse.jdt.core.dom.ITypeBinding; > import org.eclipse.jdt.core.dom.IVariableBinding; > import org.eclipse.jdt.core.dom.Initializer; > import org.eclipse.jdt.core.dom.Javadoc; >+import org.eclipse.jdt.core.dom.LabeledStatement; > import org.eclipse.jdt.core.dom.MethodDeclaration; > import org.eclipse.jdt.core.dom.MethodInvocation; > import org.eclipse.jdt.core.dom.Modifier; >@@ -77,6 +83,7 @@ > import org.eclipse.jdt.core.dom.VariableDeclaration; > import org.eclipse.jdt.core.dom.VariableDeclarationFragment; > import org.eclipse.jdt.core.dom.VariableDeclarationStatement; >+import org.eclipse.jdt.core.dom.WhileStatement; > import org.eclipse.jdt.core.dom.rewrite.ASTRewrite; > import org.eclipse.jdt.core.dom.rewrite.ImportRewrite; > import org.eclipse.jdt.core.dom.rewrite.ListRewrite; >@@ -506,6 +513,7 @@ > } > > replaceDuplicates(result); >+ replaceBranches(result); > > if (fImportRewriter.hasRecordedChanges()) { > TextEdit edit= fImportRewriter.rewriteImports(null); >@@ -523,6 +531,79 @@ > > } > >+ private void replaceBranches(final CompilationUnitChange result) { >+ ASTNode[] selectedNodes= fAnalyzer.getSelectedNodes(); >+ for (int i= 0; i < selectedNodes.length; i++) { >+ final ASTNode astNode= selectedNodes[i]; >+ astNode.accept(new ASTVisitor() { >+ private boolean inLoop; >+ >+ private List innerLabels= new ArrayList(); >+ >+ public boolean visit(ForStatement node) { >+ inLoop= true; >+ if (node.getParent() instanceof LabeledStatement) { >+ LabeledStatement labeledStatement= (LabeledStatement)node.getParent(); >+ final String identifier= labeledStatement.getLabel().getIdentifier(); >+ innerLabels.add(identifier); >+ } >+ return super.visit(node); >+ } >+ >+ public void endVisit(ForStatement node) { >+ super.endVisit(node); >+ inLoop= false; >+ } >+ >+ public boolean visit(WhileStatement node) { >+ inLoop= true; >+ return super.visit(node); >+ } >+ >+ public void endVisit(WhileStatement node) { >+ super.endVisit(node); >+ inLoop= false; >+ } >+ >+ public boolean visit(EnhancedForStatement node) { >+ inLoop= true; >+ return super.visit(node); >+ } >+ >+ public void endVisit(EnhancedForStatement node) { >+ super.endVisit(node); >+ inLoop= false; >+ } >+ >+ public boolean visit(DoStatement node) { >+ inLoop= true; >+ return super.visit(node); >+ } >+ >+ public void endVisit(DoStatement node) { >+ super.endVisit(node); >+ inLoop= false; >+ } >+ >+ public void endVisit(ContinueStatement node) { >+ final SimpleName label= node.getLabel(); >+ if (!inLoop || (label != null && !innerLabels.contains(label.getIdentifier()))) { >+ TextEditGroup description= new TextEditGroup(RefactoringCoreMessages.ExtractMethodRefactoring_replace_continue); >+ result.addTextEditGroup(description); >+ >+ ReturnStatement rs= fAST.newReturnStatement(); >+ IVariableBinding returnValue= fAnalyzer.getReturnValue(); >+ if (returnValue != null) { >+ rs.setExpression(fAST.newSimpleName(getName(returnValue))); >+ } >+ >+ new StatementRewrite(fRewriter, new ASTNode[] { node }).replace(new ASTNode[] { rs }, description); >+ } >+ } >+ }); >+ } >+ } >+ > private ExtractMethodDescriptor getRefactoringDescriptor() { > final Map arguments= new HashMap(); > String project= null; >Index: core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties,v >retrieving revision 1.379 >diff -u -r1.379 refactoring.properties >--- core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties 12 Jun 2009 18:12:16 -0000 1.379 >+++ core refactoring/org/eclipse/jdt/internal/corext/refactoring/refactoring.properties 25 Jul 2009 20:02:29 -0000 >@@ -160,6 +160,7 @@ > ExtractMethodRefactoring_error_nameInUse=''{0}'' is already used as a name in the selected code > ExtractMethodRefactoring_error_sameParameter=A parameter ''{0}'' already exists > ExtractMethodRefactoring_visibility_pattern=Declared visibility: ''{0}'' >+ExtractMethodRefactoring_replace_continue=Replace continue(s) with return. > ExtractMethodRefactoring_replace_occurrences=Replace occurrences of statements with method > ExtractMethodRefactoring_error_vararg_ordering=The variable arity parameter ''{0}'' cannot be followed by another parameter > ExtractMethodRefactoring_descriptor_description=Extract method ''{0}'' from ''{1}'' to ''{2}'' >Index: core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java,v >retrieving revision 1.122 >diff -u -r1.122 RefactoringCoreMessages.java >--- core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java 9 Jan 2009 08:50:07 -0000 1.122 >+++ core refactoring/org/eclipse/jdt/internal/corext/refactoring/RefactoringCoreMessages.java 25 Jul 2009 20:02:28 -0000 >@@ -7,6 +7,7 @@ > * > * Contributors: > * IBM Corporation - initial API and implementation >+ * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Extract method and continue https://bugs.eclipse.org/bugs/show_bug.cgi?id=48056 > *******************************************************************************/ > package org.eclipse.jdt.internal.corext.refactoring; > >@@ -634,6 +635,8 @@ > > public static String ExtractMethodRefactoring_organize_imports; > >+ public static String ExtractMethodRefactoring_replace_continue; >+ > public static String ExtractMethodRefactoring_replace_occurrences; > > public static String ExtractMethodRefactoring_substitute_with_call; >#P org.eclipse.jdt.ui.tests.refactoring >Index: test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui.tests.refactoring/test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java,v >retrieving revision 1.89 >diff -u -r1.89 ExtractMethodTests.java >--- test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java 13 Jul 2009 17:10:21 -0000 1.89 >+++ test cases/org/eclipse/jdt/ui/tests/refactoring/ExtractMethodTests.java 25 Jul 2009 20:02:31 -0000 >@@ -10,6 +10,7 @@ > * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Does not replace similar code in parent class of anonymous class - https://bugs.eclipse.org/bugs/show_bug.cgi?id=160853 > * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Missing return value, while extracting code out of a loop - https://bugs.eclipse.org/bugs/show_bug.cgi?id=213519 > * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] missing return type when code can throw exception - https://bugs.eclipse.org/bugs/show_bug.cgi?id=97413 >+ * Benjamin Muskalla <bmuskalla@eclipsesource.com> - [extract method] Extract method and continue https://bugs.eclipse.org/bugs/show_bug.cgi?id=48056 > *******************************************************************************/ > package org.eclipse.jdt.ui.tests.refactoring; > >@@ -651,6 +652,12 @@ > public void test196() throws Exception { > invalidSelectionTest(); > } >+ >+ //---- continue not possible >+ >+ public void test197() throws Exception { >+ invalidSelectionTest(); >+ } > > > >@@ -1616,6 +1623,62 @@ > branchTest(); > } > >+ public void test756() throws Exception { >+ branchTest(); >+ } >+ >+ public void test757() throws Exception { >+ branchTest(); >+ } >+ >+ public void test758() throws Exception { >+ branchTest(); >+ } >+ >+ public void test759() throws Exception { >+ branchTest(); >+ } >+ >+ public void test760() throws Exception { >+ branchTest(); >+ } >+ >+ public void test761() throws Exception { >+ branchTest(); >+ } >+ >+ public void test762() throws Exception { >+ branchTest(); >+ } >+ >+ public void test763() throws Exception { >+ branchTest(); >+ } >+ >+ public void test764() throws Exception { >+ branchTest(); >+ } >+ >+ public void test765() throws Exception { >+ branchTest(); >+ } >+ >+ public void test766() throws Exception { >+ branchTest(); >+ } >+ >+ public void test767() throws Exception { >+ branchTest(); >+ } >+ >+ public void test768() throws Exception { >+ branchTest(); >+ } >+ >+ public void test769() throws Exception { >+ branchTest(); >+ } >+ > //---- Test for CUs with compiler errors > > public void test800() throws Exception { >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test768.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test768.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test768.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test768.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,21 @@ >+package branch_out; >+ >+public class A_test768 { >+ >+ public void foo() { >+ int i = 0; >+ do { >+ extracted(i); >+ } while ( i < 10 ); >+ } >+ >+ protected void extracted(int i) { >+ /*[*/ >+ if( i == 3 ) { >+ return; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test765.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test765.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test765.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test765.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,19 @@ >+package branch_in; >+ >+public class A_test765 { >+ >+ public void foo() { >+ int x = 0; >+ for (int i= 0; i < 3; i++) { >+ /*[*/ >+ if(i == 2) { >+ x = (i*3); >+ continue; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+ System.out.println(x); >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test763.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test763.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test763.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test763.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,16 @@ >+package branch_in; >+ >+public class A_test763 { >+ >+ public void foo() { >+ inner: for (int i= 0; i < 3; i++) { >+ /*[*/ >+ if(i == 2) { >+ continue inner; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test766.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test766.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test766.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test766.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,19 @@ >+package branch_in; >+ >+public class A_test766 { >+ >+ public void foo() { >+ int x = 0; >+ foo: for (int i= 0; i < 3; i++) { >+ /*[*/ >+ if(i == 2) { >+ x = (i*3); >+ continue; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+ System.out.println(x); >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test762.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test762.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test762.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test762.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,24 @@ >+package branch_out; >+ >+public class A_test762 { >+ >+ public void foo() { >+ outer: for (int i= 0; i < 3; i++) { >+ extracted(); >+ } >+ } >+ >+ protected void extracted() { >+ /*[*/ >+ for (int j= 0; j < 3; j++) { >+ for (int k= 0; k < 3; k++) { >+ if(j == 3) { >+ return; >+ } >+ System.out.println(); >+ } >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/invalidSelection/A_test197.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/invalidSelection/A_test197.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/invalidSelection/A_test197.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/invalidSelection/A_test197.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+package invalidSelection; >+ >+public class A_test197 { >+ >+ public void foo() { >+ outer: for (int i= 0; i < 3; i++) { >+ for (int j= 0; j < 3; j++) { >+ /*[*/ >+ if(j == 3) { >+ continue outer; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+ } >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test757.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test757.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test757.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test757.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+package branch_out; >+ >+public class A_test757 { >+ >+ public void foo() { >+ extracted(); >+ } >+ >+ protected void extracted() { >+ /*[*/ >+ for (int i= 0; i < 3; i++) { >+ if(i == 2) { >+ continue; >+ } >+ System.out.println(); >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test759.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test759.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test759.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test759.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,16 @@ >+package branch_in; >+ >+public class A_test759 { >+ >+ public void foo(int a) { >+ /*[*/ >+ while (a > 0) { >+ if(a == 3) { >+ continue; >+ } >+ System.out.println(); >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test762.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test762.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test762.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test762.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+package branch_in; >+ >+public class A_test762 { >+ >+ public void foo() { >+ outer: for (int i= 0; i < 3; i++) { >+ /*[*/ >+ for (int j= 0; j < 3; j++) { >+ for (int k= 0; k < 3; k++) { >+ if(j == 3) { >+ continue outer; >+ } >+ System.out.println(); >+ } >+ } >+ /*]*/ >+ } >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test769.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test769.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test769.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test769.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+package branch_out; >+ >+public class A_test769 { >+ >+ public void foo(int[] a) { >+ for(int i : a) { >+ extracted(i); >+ } >+ } >+ >+ protected void extracted(int i) { >+ /*[*/ >+ if( i == 3 ) { >+ return; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test765.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test765.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test765.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test765.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,24 @@ >+package branch_out; >+ >+public class A_test765 { >+ >+ public void foo() { >+ int x = 0; >+ for (int i= 0; i < 3; i++) { >+ x = extracted(x, i); >+ } >+ System.out.println(x); >+ } >+ >+ protected int extracted(int x, int i) { >+ /*[*/ >+ if(i == 2) { >+ x = (i*3); >+ return x; >+ } >+ System.out.println(); >+ /*]*/ >+ return x; >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test764.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test764.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test764.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test764.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,24 @@ >+package branch_out; >+ >+public class A_test764 { >+ >+ public void foo() { >+ int x = 0; >+ for (int i= 0; i < 3; i++) { >+ x = extracted(x, i); >+ } >+ System.out.println(x); >+ } >+ >+ protected int extracted(int x, int i) { >+ /*[*/ >+ if(i == 2) { >+ x = 2; >+ return x; >+ } >+ System.out.println(); >+ /*]*/ >+ return x; >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test758.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test758.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test758.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test758.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+package branch_in; >+ >+import java.util.List; >+ >+public class A_test758 { >+ >+ public void foo(List a) { >+ /*[*/ >+ for (Object x : a) { >+ if(x == null) { >+ continue; >+ } >+ System.out.println(); >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test758.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test758.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test758.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test758.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,22 @@ >+package branch_out; >+ >+import java.util.List; >+ >+public class A_test758 { >+ >+ public void foo(List a) { >+ extracted(a); >+ } >+ >+ protected void extracted(List a) { >+ /*[*/ >+ for (Object x : a) { >+ if(x == null) { >+ continue; >+ } >+ System.out.println(); >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test767.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test767.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test767.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test767.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,22 @@ >+package branch_out; >+ >+public class A_test767 { >+ >+ public void foo() { >+ for (int i = 0; i < 3; i++) { >+ extracted(); >+ } >+ } >+ >+ protected void extracted() { >+ /*[*/ >+ inner: for (int j = 0; j < 10; j++) { >+ if (j == 2) { >+ System.out.println(); >+ continue inner; >+ } >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test756.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test756.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test756.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test756.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,16 @@ >+package branch_in; >+ >+public class A_test756 { >+ >+ public void foo() { >+ for (int i= 0; i < 3; i++) { >+ /*[*/ >+ if(i == 2) { >+ continue; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test769.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test769.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test769.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test769.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,16 @@ >+package branch_in; >+ >+public class A_test769 { >+ >+ public void foo(int[] a) { >+ for(int i : a) { >+ /*[*/ >+ if( i == 3 ) { >+ continue; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test761.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test761.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test761.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test761.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+package branch_in; >+ >+public class A_test761 { >+ >+ public void foo() { >+ outer: for (int i= 0; i < 3; i++) { >+ /*[*/ >+ for (int j= 0; j < 3; j++) { >+ if(j == 3) { >+ continue outer; >+ } >+ System.out.println(); >+ } >+ /*]*/ >+ } >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test763.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test763.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test763.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test763.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+package branch_out; >+ >+public class A_test763 { >+ >+ public void foo() { >+ inner: for (int i= 0; i < 3; i++) { >+ extracted(i); >+ } >+ } >+ >+ protected void extracted(int i) { >+ /*[*/ >+ if(i == 2) { >+ return; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test766.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test766.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test766.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test766.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,24 @@ >+package branch_out; >+ >+public class A_test766 { >+ >+ public void foo() { >+ int x = 0; >+ foo: for (int i= 0; i < 3; i++) { >+ x = extracted(x, i); >+ } >+ System.out.println(x); >+ } >+ >+ protected int extracted(int x, int i) { >+ /*[*/ >+ if(i == 2) { >+ x = (i*3); >+ return x; >+ } >+ System.out.println(); >+ /*]*/ >+ return x; >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test764.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test764.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test764.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test764.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,19 @@ >+package branch_in; >+ >+public class A_test764 { >+ >+ public void foo() { >+ int x = 0; >+ for (int i= 0; i < 3; i++) { >+ /*[*/ >+ if(i == 2) { >+ x = 2; >+ continue; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+ System.out.println(x); >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test761.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test761.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test761.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test761.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,22 @@ >+package branch_out; >+ >+public class A_test761 { >+ >+ public void foo() { >+ outer: for (int i= 0; i < 3; i++) { >+ extracted(); >+ } >+ } >+ >+ protected void extracted() { >+ /*[*/ >+ for (int j= 0; j < 3; j++) { >+ if(j == 3) { >+ return; >+ } >+ System.out.println(); >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test767.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test767.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test767.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test767.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,18 @@ >+package branch_in; >+ >+public class A_test767 { >+ >+ public void foo() { >+ for (int i = 0; i < 3; i++) { >+ /*[*/ >+ inner: for (int j = 0; j < 10; j++) { >+ if (j == 2) { >+ System.out.println(); >+ continue inner; >+ } >+ } >+ /*]*/ >+ } >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test760.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test760.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test760.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test760.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+package branch_out; >+ >+public class A_test760 { >+ >+ public void foo(int a) { >+ extracted(a); >+ } >+ >+ protected void extracted(int a) { >+ /*[*/ >+ do { >+ if(a == 3) { >+ continue; >+ } >+ System.out.println(); >+ } while (a > 0); >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test760.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test760.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test760.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test760.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,16 @@ >+package branch_in; >+ >+public class A_test760 { >+ >+ public void foo(int a) { >+ /*[*/ >+ do { >+ if(a == 3) { >+ continue; >+ } >+ System.out.println(); >+ } while (a > 0); >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test759.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test759.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test759.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test759.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+package branch_out; >+ >+public class A_test759 { >+ >+ public void foo(int a) { >+ extracted(a); >+ } >+ >+ protected void extracted(int a) { >+ /*[*/ >+ while (a > 0) { >+ if(a == 3) { >+ continue; >+ } >+ System.out.println(); >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test757.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test757.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test757.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test757.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,16 @@ >+package branch_in; >+ >+public class A_test757 { >+ >+ public void foo() { >+ /*[*/ >+ for (int i= 0; i < 3; i++) { >+ if(i == 2) { >+ continue; >+ } >+ System.out.println(); >+ } >+ /*]*/ >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test768.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test768.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test768.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_in/A_test768.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,17 @@ >+package branch_in; >+ >+public class A_test768 { >+ >+ public void foo() { >+ int i = 0; >+ do { >+ /*[*/ >+ if( i == 3 ) { >+ continue; >+ } >+ System.out.println(); >+ /*]*/ >+ } while ( i < 10 ); >+ } >+} >+ >Index: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test756.java >=================================================================== >RCS file: resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test756.java >diff -N resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test756.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ resources/ExtractMethodWorkSpace/ExtractMethodTests/branch_out/A_test756.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,20 @@ >+package branch_out; >+ >+public class A_test756 { >+ >+ public void foo() { >+ for (int i= 0; i < 3; i++) { >+ extracted(i); >+ } >+ } >+ >+ protected void extracted(int i) { >+ /*[*/ >+ if(i == 2) { >+ return; >+ } >+ System.out.println(); >+ /*]*/ >+ } >+} >+
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
markus.kell.r
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 48056
:
142588
|
143249