issue_id int64 2.04k 425k | title stringlengths 9 251 | body stringlengths 4 32.8k ⌀ | status stringclasses 6
values | after_fix_sha stringlengths 7 7 | project_name stringclasses 6
values | repo_url stringclasses 6
values | repo_name stringclasses 6
values | language stringclasses 1
value | issue_url null | before_fix_sha null | pull_url null | commit_datetime timestamp[us, tz=UTC] | report_datetime timestamp[us, tz=UTC] | updated_file stringlengths 23 187 | chunk_content stringlengths 1 22k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | {
ReturnStatement statement= (ReturnStatement) statements.get(1);
Expression expression= statement.getExpression();
assertTrue("Has no label", expression != null);
SimpleName newExpression= ast.newSimpleName("x");
rewrite.markAsReplaced(expression, newExpression);
}
{
ReturnStatement sta... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo() {\n");
buf.append(" return x;\n");
buf.append(" return x;\n");
buf.append(" return;\n");
buf.append(" return 9 + 2;\n");
buf.append(" }\n");
buf... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | buf.append(" i= 3;\n");
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);
ASTRewrite rewrite= new ASTRewrite(astRoot)... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | statements.add(caseStatement1);
Statement statement1= ast.newReturnStatement();
rewrite.markAsInserted(statement1);
statements.add(statement1);
SwitchCase caseStatement2= ast.newSwitchCase();
caseStatement2.setExpression(null);
rewrite.markAsInserted(caseStatement2);
statements.add(caseSta... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | Expression newCaseExpression= ast.newNumberLiteral("10");
rewrite.markAsReplaced(caseStatement.getExpression(), newCaseExpression);
{
SwitchCase caseStatement2= ast.newSwitchCase();
caseStatement2.setExpression(ast.newNumberLiteral("11"));
rewrite.markAsInserted(caseStatement2);
statement... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("", cu, rewrite, 10, null);
proposal.getCompilationUnitChange().setSave(true);
proposal.apply(null);
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo(int i)... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
assertEqualString(cu.getSource(), buf.toString());
clearRewrite(rewrite);
}
public void testSynchronizedStatement() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= n... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | {
SynchronizedStatement statement= (SynchronizedStatement) statements.get(0);
ASTNode newExpression= ast.newSimpleName("obj");
rewrite.markAsReplaced(statement.getExpression(), newExpression);
Block newBody= ast.newBlock();
Assignment assign= ast.newAssignment();
assign.setLeftHandSide(ast... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | buf.append("}\n");
assertEqualString(cu.getSource(), buf.toString());
clearRewrite(rewrite);
}
public void testThrowStatement() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | assertTrue("Number of statements not 1", statements.size() == 1);
ThrowStatement statement= (ThrowStatement) statements.get(0);
ClassInstanceCreation creation= ast.newClassInstanceCreation();
creation.setName(ast.newSimpleName("NullPointerException"));
creation.arguments().add(ast.newSimpleName("... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo() {\n");
buf.append(" throw new NullPointerException(x);\n");
buf.append(" }\n");
buf.append(" public void goo() {\n");
buf.append(" throw new Exception(x);\n");
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | buf.append(" try {\n");
buf.append(" } catch (IOException e) {\n");
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | Block body= ast.newBlock();
body.statements().add(ast.newReturnStatement());
rewrite.markAsReplaced(tryStatement.getFinally(), body);
}
{
TryStatement tryStatement= (TryStatement) blockStatements.get(1);
List catchClauses= tryStatement.catchClauses();
CatchClause catchClause= ast.newCatc... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | rewrite.markAsInserted(body);
tryStatement.setFinally(body);
}
{
TryStatement tryStatement= (TryStatement) blockStatements.get(3);
CatchClause catchClause1= ast.newCatchClause();
SingleVariableDeclaration decl1= ast.newSingleVariableDeclaration();
decl1.setType(ast.newSimpleType(ast.newSimpl... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | proposal.getCompilationUnitChange().setSave(true);
proposal.apply(null);
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo(int i) {\n");
buf.append(" try {\n");
buf.append(" } catch (IOException e) {\n");
buf.... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | public void testTypeDeclarationStatement() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo() {\n");
buf.append(" ... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | rewrite.markAsReplaced(stmt.getTypeDeclaration(), newDeclaration);
}
ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("", cu, rewrite, 10, null);
proposal.getCompilationUnitChange().setSave(true);
proposal.apply(null);
buf= new StringBuffer();
buf.append("package test1;\n")... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("A.java", buf.toString(), false, null);
CompilationUnit astRoot= AST.parseCompilationUnit(cu, false);
ASTRewrite rewrite= new ASTRewrite(astRoot);
AST ast= astRoot.getAST();
assertTrue("Parse errors", (ast... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | List fragments= decl.fragments();
VariableDeclarationFragment frag= ast.newVariableDeclarationFragment();
frag.setName(ast.newSimpleName("k1"));
frag.setInitializer(null);
rewrite.markAsInserted(frag);
fragments.add(frag);
}
{
VariableDeclarationStatement decl= (VariableDeclarationSta... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | }
{
VariableDeclarationStatement decl= (VariableDeclarationStatement) statements.get(2);
VariableDeclarationStatement modifiedNode= ast.newVariableDeclarationStatement(ast.newVariableDeclarationFragment());
modifiedNode.setModifiers(0);
rewrite.markAsModified(decl, modifiedNode);
}
A... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo() {\n");
buf.append(" while (i == j) {\n");
buf.append(" System.beep();... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | MethodInvocation invocation= ast.newMethodInvocation();
invocation.setName(ast.newSimpleName("hoo"));
invocation.arguments().add(ast.newNumberLiteral("11"));
newBody.statements().add(ast.newExpressionStatement(invocation));
rewrite.markAsReplaced(whileStatement.getBody(), newBody);
}
ASTRew... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo() {\n");
buf.append(" while (i == j) {\n");
buf.append(" System.beep();\n");
buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/astrewrite/ASTRewritingStatementsTest.java | buf1.append(" System.beep();\n");
buf1.append("}");
ASTNode placeHolder2= rewrite.createPlaceholder(buf1.toString(), ASTRewrite.STATEMENT);
rewrite.markAsInserted(placeHolder2);
statements.add(placeHolder2);
}
ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal("", cu... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | /*******************************************************************************
* Copyright (c) 2000, 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanie... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | public static ITypeBinding normalizeTypeBinding(ITypeBinding binding) {
if (binding != null && !binding.isNullType() && !"void".equals(binding.getName())) {
if (binding.isAnonymous()) {
ITypeBinding[] baseBindings= binding.getInterfaces();
if (baseBindings.length > 0) {
return baseBindings[0];
}
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | ASTNode parent= node.getParent();
switch (parent.getNodeType()) {
case ASTNode.ASSIGNMENT:
Assignment assignment= (Assignment) parent;
if (node.equals(assignment.getLeftHandSide())) {
return assignment.getRightHandSide().resolveTypeBinding();
}
return assignment.getLeftHandSide().resolveTyp... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | if (declaration instanceof VariableDeclarationStatement) {
return ((VariableDeclarationStatement)declaration).getType().resolveBinding();
} else if (declaration instanceof FieldDeclaration) {
return ((FieldDeclaration)declaration).getType().resolveBinding();
}
}
break;
case ASTNode.SUPER_METHO... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | IMethodBinding constrBinding= constrInvocation.resolveConstructorBinding();
if (constrBinding != null) {
return getParameterTypeBinding(node, constrInvocation.arguments(), constrBinding);
}
break;
case ASTNode.CLASS_INSTANCE_CREATION:
ClassInstanceCreation creation= (ClassInstanceCreation) parent;
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | case ASTNode.CONDITIONAL_EXPRESSION:
ConditionalExpression expression= (ConditionalExpression) parent;
if (node.equals(expression.getExpression())) {
return parent.getAST().resolveWellKnownType("boolean");
}
if (node.equals(expression.getElseExpression())) {
return expression.getThenExpression().re... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | if (decl != null) {
return decl.getReturnType().resolveBinding();
}
break;
case ASTNode.CAST_EXPRESSION:
return ((CastExpression) parent).getType().resolveBinding();
case ASTNode.THROW_STATEMENT:
case ASTNode.CATCH_CLAUSE:
return parent.getAST().resolveWellKnownType("java.lang.Exception")... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | }
public static ITypeBinding guessBindingForTypeReference(ASTNode node) {
return normalizeTypeBinding(getPossibleTypeBinding(node));
}
private static ITypeBinding getPossibleTypeBinding(ASTNode node) {
ASTNode parent= node.getParent();
while (parent instanceof Type) {
parent= pa... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | case ASTNode.TYPE_LITERAL:
case ASTNode.CLASS_INSTANCE_CREATION:
return getPossibleReferenceBinding(parent);
}
return null;
}
private static ITypeBinding guessVariableType(List fragments) {
for (Iterator iter= fragments.iterator(); iter.hasNext();) {
V... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | return (BodyDeclaration) node;
}
public static CompilationUnit findParentCompilationUnit(ASTNode node) {
while ((node != null) && (node.getNodeType() != ASTNode.COMPILATION_UNIT)) {
node= node.getParent();
}
return (CompilationUnit) node;
}
/**
* Returns either a TypeDeclaration or an AnonymousTypeDe... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | return ((TypeDeclaration) node).resolveBinding();
} else if (node instanceof AnonymousClassDeclaration) {
return ((AnonymousClassDeclaration) node).resolveBinding();
}
node= node.getParent();
}
return null;
}
public static Statement findParentStatement(ASTNode node) {
while ((node != null) &&... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | public static IScanner createScanner(ICompilationUnit cu, int pos) throws InvalidInputException, JavaModelException {
IScanner scanner= ToolFactory.createScanner(false, false, false, false);
IBuffer buf= cu.getBuffer();
scanner.setSource(buf.getCharacters());
scanner.resetTo(pos, buf.getLength());
return scan... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | throw new InvalidInputException("End of File");
}
} while (curr != tok);
}
public static int getPositionAfter(IScanner scanner, int token) throws InvalidInputException {
readToToken(scanner, token);
return scanner.getCurrentTokenEndPosition() + 1;
}
public static int getPositionBefore(IScanner scanne... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | }
public static Type getTypeFromTypeBinding(AST ast, ITypeBinding binding) {
if (binding.isArray()) {
int dim= binding.getDimensions();
return ast.newArrayType(getTypeFromTypeBinding(ast, binding.getElementType()), dim);
} else if (binding.isPrimitive()) {
String name= binding.getName();
return ast.n... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | public ASTNode node;
}
public static ASTNode findClonedNode(ASTNode cloneRoot, final ASTNode node) {
try {
cloneRoot.accept(new ASTVisitor() {
public void preVisit(ASTNode curr) {
if (curr.getNodeType() == node.getNodeType() && curr.getStartPosition() == node.getStartPosition() && curr.getLength() =... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | if (elem instanceof TypeDeclaration) {
TypeDeclaration decl= (TypeDeclaration) elem;
if (name.equals(decl.getName().getIdentifier())) {
return decl;
}
}
}
return null;
}
public static TypeDeclaration findTypeDeclaration(CompilationUnit root, ITypeBinding binding) {
ArrayList names= new Array... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ASTResolving.java | public static String getQualifier(Name name) {
if (name.isQualifiedName()) {
return getFullName(((QualifiedName) name).getQualifier());
}
return "";
}
public static String getSimpleName(Name name) {
if (name.isQualifiedName()) {
return ((QualifiedName) name).getName().getIdentifier();
} else {
re... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java | package org.eclipse.jdt.internal.ui.text.correction;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jdt.core.IBuffer;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java | public static void addNonAccessibleMemberProposal(ICorrectionContext context, List proposals, boolean visibilityChange) throws JavaModelException {
ICompilationUnit cu= context.getCompilationUnit();
ASTNode selectedNode= context.getCoveringNode();
if (selectedNode == null) {
return;
}
IBinding binding=n... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java | break;
case ASTNode.SUPER_FIELD_ACCESS:
binding= ((SuperFieldAccess) selectedNode).getName().resolveBinding();
break;
case ASTNode.CLASS_INSTANCE_CREATION:
binding= ((ClassInstanceCreation) selectedNode).resolveConstructorBinding();
break;
case ASTNode.SUPER_CONSTRUCTOR_INVOCATION:
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java | String label;
if (visibilityChange) {
excludedModifiers= Modifier.PRIVATE | Modifier.PROTECTED | Modifier.PUBLIC;
includedModifiers= getNeededVisibility(selectedNode, typeBinding);
label= CorrectionMessages.getFormattedString("ModifierCorrectionSubProcessor.changevisibility.description", new String[] { n... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java | return Modifier.PUBLIC;
}
ITypeBinding curr= currNodeBinding;
while (curr != null) {
if (curr.getKey().equals(targetType.getKey())) {
return Modifier.PROTECTED;
}
curr= curr.getSuperclass();
}
if (currNodeBinding.getPackage().getKey().equals(targetType.getPackage().getKey())) {
return 0;
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java | ASTNode parentType= ASTResolving.findParentType(decl);
boolean parentIsAbstract= (parentType instanceof TypeDeclaration) && Modifier.isAbstract(((TypeDeclaration) parentType).getModifiers());
int endPos= decl.getStartPosition() + decl.getLength() - 1;
IBuffer buffer= cu.getBuffer();
boolean hasNoBody= buffer... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ModifierCorrectionSubProcessor.java | Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 1, image);
proposal.ensureNoModifications();
proposals.add(proposal);
}
if (context.getProblemId() == IProblem.AbstractMethodInAbstract... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | /*******************************************************************************
* Copyright (c) 2000, 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanie... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jface.text.IDocument;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.Signature;
impo... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | fSenderBinding= binding;
}
protected ASTRewrite getRewrite() throws CoreException {
ASTRewrite rewrite;
CompilationUnit astRoot= ASTResolving.findParentCompilationUnit(fNode);
ASTNode typeDecl= astRoot.findDeclaringNode(fSenderBinding);
ASTNode newTypeDecl= null;
if (typeDecl != null) {
fIsInDifferent... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | } else if (isConstructor()) {
methods.add(0, newStub);
} else {
methods.add(newStub);
}
rewrite.markAsInserted(newStub);
}
return rewrite;
}
private boolean isConstructor() {
return fNode.getNodeType() != ASTNode.METHOD_INVOCATION && fNode.getNodeType() != ASTNode.SUPER_METHOD_INVOCATION;
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | Expression elem= (Expression) arguments.get(i);
SingleVariableDeclaration param= ast.newSingleVariableDeclaration();
Type type= evaluateParameterType(ast, elem);
param.setType(type);
param.setName(ast.newSimpleName(getParameterName(nameProposer, names, elem, type)));
params.add(param);
}
Block bod... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | String[] namesArray= (String[]) names.toArray(new String[names.size()]);
String name= decl.getName().getIdentifier();
if (isConstructor()) {
StubUtility.genJavaDocStub("Constructor " + name, namesArray, null, null, buf);
} else {
String returnTypeSig= Signature.createTypeSignature(ASTNodes.asString(dec... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | private int findInsertIndex(List decls, int currPos) {
int nDecls= decls.size();
for (int i= 0; i < nDecls; i++) {
ASTNode curr= (ASTNode) decls.get(i);
if (curr instanceof MethodDeclaration && currPos < curr.getStartPosition() + curr.getLength()) {
return i + 1;
}
}
return nDecls;
}
private St... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | }
if (fNode instanceof MethodInvocation) {
int modifiers= 0;
Expression expression= ((MethodInvocation)fNode).getExpression();
if (expression != null) {
if (expression instanceof Name && ((Name) expression).resolveBinding().getKind() == IBinding.TYPE) {
modifiers |= Modifier.STATIC;
}
} else ... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewMethodCompletionProposal.java | private Type evaluateParameterType(AST ast, Expression expr) throws CoreException {
ITypeBinding binding= ASTResolving.normalizeTypeBinding(expr.resolveTypeBinding());
if (binding != null) {
addImport(binding);
return ASTResolving.getTypeFromTypeBinding(ast, binding);
}
return ast.newSimpleType(ast.newSim... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java | /*******************************************************************************
* Copyright (c) 2000, 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanie... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java | public static final int LOCAL= 1;
public static final int FIELD= 2;
public static final int PARAM= 3;
private int fVariableKind;
private SimpleName fOriginalNode;
private ITypeBinding fSenderBinding;
private boolean fIsInDifferentCU;
public NewVariableCompletionProposal(String label, ICompilationUnit cu, int va... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java | BodyDeclaration decl= ASTResolving.findParentBodyDeclaration(node);
if (decl instanceof MethodDeclaration) {
SingleVariableDeclaration newDecl= ast.newSingleVariableDeclaration();
newDecl.setType(evaluateVariableType(ast));
newDecl.setName(ast.newSimpleName(node.getIdentifier()));
rewrite.markAsInsert... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java | int parentParentKind= parent.getParent().getNodeType();
if (parentParentKind == ASTNode.EXPRESSION_STATEMENT) {
Expression placeholder= (Expression) rewrite.createCopy(assignment.getRightHandSide());
newDeclFrag.setInitializer(placeholder);
rewrite.markAsReplaced(assignment.getParent(), newD... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java | statements.add(0, newDecl);
rewrite.markAsInserted(newDecl);
}
}
return rewrite;
}
private ASTRewrite doAddField(CompilationUnit astRoot) throws CoreException {
SimpleName node= fOriginalNode;
ASTRewrite rewrite;
ASTNode newTypeDecl= astRoot.findDeclaringNode(fSenderBinding);
if (newTypeDecl !... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java | newDecl.setModifiers(evaluateFieldModifiers(newTypeDecl));
if (fSenderBinding.isInterface()) {
fragment.setInitializer(ASTResolving.getInitExpression(type));
}
boolean isAnonymous= newTypeDecl.getNodeType() == ASTNode.ANONYMOUS_CLASS_DECLARATION;
List decls= isAnonymous ? ((AnonymousClassDeclaration... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java | }
return ast.newSimpleType(ast.newSimpleName("Object"));
}
private int evaluateFieldModifiers(ASTNode newTypeDecl) {
if (fSenderBinding.isInterface()) {
FieldDeclaration[] fieldDecls= ((TypeDeclaration) newTypeDecl).getFields();
if (fieldDecls.length > 0) {
return fieldDecls[0].getModifiers();
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/NewVariableCompletionProposal.java | }
/**
* Returns the variable kind.
* @return int
*/
public int getVariableKind() {
return fVariableKind;
}
public void apply(IDocument document) {
try {
CompilationUnitChange change= getCompilationUnitChange();
IEditorPart part= null;
if (fIsInDifferentCU) {
change.setKeepExecutedTextE... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | package org.eclipse.jdt.internal.ui.text.correction;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.swt.graphics.Image;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.j... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | private static class ReturnStatementCollector extends ASTVisitor {
private ArrayList fResult= new ArrayList();
public Iterator returnStatements() {
return fResult.iterator();
}
public ITypeBinding getTypeBinding(AST ast) {
boolean couldBeObject= false;
for (int i= 0; i < fResult.size(); i++) {
R... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | }
if (couldBeObject) {
return ast.resolveWellKnownType("java.lang.Object");
}
return ast.resolveWellKnownType("void");
}
public boolean visit(ReturnStatement node) {
fResult.add(node);
return false;
}
public boolean visit(AnonymousClassDeclaration node) {
return false;
}
public boole... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | ReturnStatementCollector collector= new ReturnStatementCollector();
declaration.accept(collector);
for (Iterator iter= collector.returnStatements(); iter.hasNext();) {
rewrite.markAsRemoved((ASTNode) iter.next());
}
String label= CorrectionMessages.getString("ReturnTypeSubProcessor.constrnamemeth... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | if (binding == null) {
binding= selectedNode.getAST().resolveWellKnownType("java.lang.Object");
}
MethodDeclaration methodDeclaration= (MethodDeclaration) decl;
ASTRewrite rewrite= new ASTRewrite(astRoot);
Type newReturnType= ASTResolving.getTypeFromTypeBinding(astRoot.getAST(), binding);
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | String label= CorrectionMessages.getString("ReturnTypeSubProcessor.removereturn.description");
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_CHANGE);
ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 1, image);
proposal.ensureNoModifications();
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | typeName= typeBinding.getName();
} else {
type= ast.newPrimitiveType(PrimitiveType.VOID);
typeName= "void";
}
String label= CorrectionMessages.getFormattedString("ReturnTypeSubProcessor.missingreturntype.description", typeName);
Image image= JavaPluginImages.get(JavaPluginImages.IMG_CORRECTION_C... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | }
}
/**
* Method addMissingReturnStatementProposals.
* @param context
* @param proposals
*/
public static void addMissingReturnStatementProposals(ICorrectionContext context, List proposals) throws CoreException {
ICompilationUnit cu= context.getCompilationUnit();
ASTNode selectedNode= context.getCover... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/ReturnTypeSubProcessor.java | String label= CorrectionMessages.getString("ReturnTypeSubProcessor.changereturnstatement.description");
ASTRewriteCorrectionProposal proposal= new ASTRewriteCorrectionProposal(label, cu, rewrite, 3, image);
proposal.ensureNoModifications();
proposals.add(proposal);
}
} else {
Block block... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | /*******************************************************************************
* Copyright (c) 2000, 2002 International Business Machines Corp. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Common Public License v0.5
* which accompanie... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | ******************************************************************************/
package org.eclipse.jdt.internal.ui.text.correction;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IMethod;
import... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | private ASTNode fTypeNode;
public UnimplementedMethodsCompletionProposal(ICompilationUnit cu, ASTNode typeNode, int relevance) {
super(null, cu, null, relevance, null);
setDisplayName(CorrectionMessages.getString("UnimplementedMethodsCompletionProposal.description"));
setImage(JavaPluginImages.get(JavaPluginImag... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | ASTRewrite rewrite= new ASTRewrite(fTypeNode);
AST ast= fTypeNode.getAST();
CodeGenerationSettings settings= JavaPreferencesSettings.getCodeGenerationSettings();
if (!settings.createComments || binding.isAnonymous()) {
settings= null;
}
for (int i= 0; i < methods.length; i++) {
MethodDeclaration newM... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | ITypeBinding curr= params[i];
addImport(curr);
SingleVariableDeclaration var= ast.newSingleVariableDeclaration();
var.setType(ASTResolving.getTypeFromTypeBinding(ast, curr));
var.setName(ast.newSimpleName(paramNames[i]));
parameters.add(var);
}
List thrownExceptions= decl.thrownExceptions();
... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | for (int i= 0; i < fullParamNames.length; i++) {
fullParamNames[i]= Bindings.getFullyQualifiedName(params[i]);
}
StubUtility.genJavaDocSeeTag(fullTypeName, binding.getName(), fullParamNames, commentSettings.createNonJavadocComments, binding.isDeprecated(), buf);
Javadoc javadoc;
if (commentSettings.crea... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | String[] names= new String[nParams];
for (int i= 0; i < names.length; i++) {
names[i]= "arg" + i;
}
return names;
}
private void findUnimplementedInterfaceMethods(ITypeBinding typeBinding, ArrayList visited, ArrayList allMethods, ArrayList toImplement) {
visited.add(typeBinding);
IMethodBinding[] ... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | if (!visited.contains(superInterfaces[i])) {
findUnimplementedInterfaceMethods(superInterfaces[i], visited, allMethods, toImplement);
}
}
}
private IMethodBinding[] evalUnimplementedMethods(ITypeBinding typeBinding) {
ArrayList allMethods= new ArrayList();
ArrayList toImplement= new ArrayList();
IMe... |
24,920 | Bug 24920 quick fix: fooled by additional dimentions in method declarations [quick fix] | public class DD { private int DD()[]{ }; } add return statement - it puts retrun 0 instead of return null | verified fixed | a209305 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T10:20:54Z | 2002-10-17T10:20:00Z | org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/correction/UnimplementedMethodsCompletionProposal.java | }
for (int i= 0; i < allMethods.size(); i++) {
IMethodBinding curr= (IMethodBinding) allMethods.get(i);
int modifiers= curr.getModifiers();
if ((Modifier.isAbstract(modifiers) || curr.getDeclaringClass().isInterface()) && (typeBinding != curr.getDeclaringClass())) {
toImplement.add(curr);
}
}
... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | package org.eclipse.jdt.ui.tests.quickfix;
import java.util.ArrayList;
import java.util.Hashtable;
import junit.framework.Test;
import junit.framework.TestSuite;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaProject;
import org.eclip... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | }
public static Test suite() {
if (true) {
return new TestSuite(THIS);
} else {
TestSuite suite= new TestSuite();
suite.addTest(new LocalCorrectionsQuickFixTest("testInvisibleTypeRequestedFromSuperClass"));
return suite;
}
}
protected void setUp() throws Exception {
Hashtable options= JavaCore.ge... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.io.File;\n");
buf.append("public class E {\n");
buf.append(" public char foo() {\n");
buf.append(" return (new File(\"x.t... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | buf.append(" return File.separatorChar;\n");
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
public void testQualifiedAccessToStatic() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new ... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | String preview= proposal.getCompilationUnitChange().getPreviewContent();
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" public void foo(Thread t) {\n");
buf.append(" Thread.sleep(10);\n");
buf.append(" }\n");
buf.append("}\n");
assert... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | ArrayList proposals= new ArrayList();
JavaCorrectionProcessor.collectCorrections(context, proposals);
assertNumberOf("proposals", proposals.size(), 1);
assertCorrectLabels(proposals);
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview= proposal.getCompilationUnitChan... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | CompilationUnit astRoot= AST.parseCompilationUnit(cu, true);
IProblem[] problems= astRoot.getProblems();
assertNumberOf("problems", problems.length, 1);
CorrectionContext context= getCorrectionContext(cu, problems[0]);
assertCorrectContext(context);
ArrayList proposals= new ArrayList();
JavaCorrection... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | buf.append(" Object th= o;\n");
buf.append(" }\n");
buf.append("}\n");
String expected2= buf.toString();
assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
public void testCastMissingInVarDecl2() throws Exception {
IPackageFragment p... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | IProblem[] problems= astRoot.getProblems();
assertNumberOf("problems", problems.length, 1);
CorrectionContext context= getCorrectionContext(cu, problems[0]);
assertCorrectContext(context);
ArrayList proposals= new ArrayList();
JavaCorrectionProcessor.collectCorrections(context, proposals);
assertNumb... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | buf.append(" public void foo(Container c) {\n");
buf.append(" List[] lists= c.getLists();\n");
buf.append(" }\n");
buf.append("}\n");
String expected2= buf.toString();
assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
public ... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview1= proposal.getCompilationUnitChange().getPreviewContent();
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("public class E {\n");
buf.append(" int time= (int) System.currentTimeMillis();\n");
buf.ap... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | buf.append(" str= iter.next();\n");
buf.append(" }\n");
buf.append("}\n");
ICompilationUnit cu= pack1.createCompilationUnit("E.java", buf.toString(), false, null);
CompilationUnit astRoot= AST.parseCompilationUnit(cu, true);
IProblem[] problems= astRoot.getProblems();
assertNumberOf("problems",... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | public void testCastMissingInExpression() throws Exception {
IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null);
StringBuffer buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.util.List;\n");
buf.append("public class E {\n");
buf.append(" pu... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | buf.append("public class E {\n");
buf.append(" public String[] foo(List list) {\n");
buf.append(" return (String[]) list.toArray(new List[list.size()]);\n");
buf.append(" }\n");
buf.append("}\n");
assertEqualString(preview, buf.toString());
}
public void testUncaughtException() throws Exception... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | assertCorrectLabels(proposals);
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview1= proposal.getCompilationUnitChange().getPreviewContent();
buf= new StringBuffer();
buf.append("package test1;\n");
buf.append("import java.io.IOException;\n");
buf.append("public c... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | buf.append(" }\n");
buf.append(" }\n");
buf.append("}\n");
String expected2= buf.toString();
assertEqualStringsIgnoreOrder(new String[] { preview1, preview2 }, new String[] { expected1, expected2 });
}
public void testMultipleUncaughtExceptions() throws Exception {
IPackageFragment... |
25,183 | Bug 25183 AST: ITypeBinding of interface returns constructor | 20021018 + jcore for 20021022 LocalCorrectionsQuickFixTest.testUnimplementedMethods Set breakpoint in UnimplementedMethodsCompletionProposal.findUnimplementedInterfaceMethods to see that the ITypeBinding of a interface returns a constructor | verified fixed | 9c77ba1 | JDT | https://github.com/eclipse-jdt/eclipse.jdt.ui | eclipse-jdt/eclipse.jdt.ui | java | null | null | null | 2002-10-22T13:33:21Z | 2002-10-22T12:33:20Z | org.eclipse.jdt.ui.tests/ui/org/eclipse/jdt/ui/tests/quickfix/LocalCorrectionsQuickFixTest.java | JavaCorrectionProcessor.collectCorrections(context, proposals);
assertNumberOf("proposals", proposals.size(), 2);
assertCorrectLabels(proposals);
CUCorrectionProposal proposal= (CUCorrectionProposal) proposals.get(0);
String preview1= proposal.getCompilationUnitChange().getPreviewContent();
buf= new Str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.