Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Cleaned up a few of the eclipse warnings. Removed

unused imports and redundant casts.
  • Loading branch information...
commit 311be918e805a6dbfbf0a2945ead9ef46b8196db 1 parent 41c363c
@grootjans authored
Showing with 16 additions and 71 deletions.
  1. +1 −2  src/lombokRefactorings/StartupAction.java
  2. +0 −1  src/lombokRefactorings/TestTypes.java
  3. +0 −6 src/lombokRefactorings/activator/obsoleteMethods/RefactoringsExtract.java
  4. +0 −4 src/lombokRefactorings/activator/obsoleteMethods/RefactoringsMove.java
  5. +0 −2  src/lombokRefactorings/activator/obsoleteMethods/RefactoringsRename.java
  6. +5 −13 src/lombokRefactorings/folderOptions/FolderManager.java
  7. +1 −4 src/lombokRefactorings/refactorings/RefactoringUtils.java
  8. +0 −1  src/lombokRefactorings/refactorings/eclipse/extractRefactorings/ExtractLocalVariableType.java
  9. +3 −4 src/lombokRefactorings/refactorings/eclipse/quickFix/OverrideMethodsQuickFixType.java
  10. +0 −3  src/lombokRefactorings/refactorings/eclipse/renameRefactorings/AbstractRenameRefactoring.java
  11. +0 −1  src/lombokRefactorings/refactorings/eclipse/renameRefactorings/RenameClassType.java
  12. +0 −1  src/lombokRefactorings/refactorings/eclipse/sourceActions/AbstractQuickFix.java
  13. +0 −1  src/lombokRefactorings/refactorings/eclipse/sourceActions/AbstractSourceAction.java
  14. +1 −2  src/lombokRefactorings/refactorings/eclipse/sourceActions/CreateUnresolvedMethodType.java
  15. +0 −5 src/lombokRefactorings/refactorings/eclipse/sourceActions/OrganizeImportsType.java
  16. +5 −12 src/lombokRefactorings/refactorings/eclipse/sourceActions/OverrideMethodsSourceActionType.java
  17. +0 −8 src/lombokRefactorings/refactorings/eclipse/sourceActions/ToggleCommentType.java
  18. +0 −1  src/lombokRefactorings/regex/SearchAndCallRefactorings.java
View
3  src/lombokRefactorings/StartupAction.java
@@ -7,8 +7,8 @@
import lombok.SneakyThrows;
import lombokRefactorings.activator.LombokPlugin;
import lombokRefactorings.folderOptions.FolderManager;
-import lombokRefactorings.folderOptions.TestFolderBuilderImpl;
import lombokRefactorings.folderOptions.TestFolderBuilder.FolderBuilderException;
+import lombokRefactorings.folderOptions.TestFolderBuilderImpl;
import lombokRefactorings.projectOptions.ProjectManager;
import lombokRefactorings.unitTestOptions.AstManager;
import lombokRefactorings.unitTestOptions.TestRunnerBuilder;
@@ -20,7 +20,6 @@
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.junit.launcher.JUnitLaunchShortcut;
View
1  src/lombokRefactorings/TestTypes.java
@@ -1,5 +1,4 @@
package lombokRefactorings;
-import org.eclipse.jdt.internal.ui.text.correction.proposals.AbstractMethodCorrectionProposal;
public enum TestTypes {
View
6 src/lombokRefactorings/activator/obsoleteMethods/RefactoringsExtract.java
@@ -1,8 +1,5 @@
package lombokRefactorings.activator.obsoleteMethods;
-//import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
-import java.util.*;
-
import lombokRefactorings.refactorings.Refactorings;
import org.eclipse.core.runtime.CoreException;
@@ -13,11 +10,8 @@
import org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring;
import org.eclipse.jdt.internal.corext.refactoring.structure.ExtractSupertypeProcessor;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
-import org.eclipse.ltk.core.refactoring.CheckConditionsOperation;
-import org.eclipse.ltk.core.refactoring.PerformRefactoringOperation;
import org.eclipse.ltk.core.refactoring.Refactoring;
import org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring;
-import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
public class RefactoringsExtract extends Refactorings {
View
4 src/lombokRefactorings/activator/obsoleteMethods/RefactoringsMove.java
@@ -6,15 +6,11 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.IVariableBinding;
-import org.eclipse.jdt.core.dom.MethodDeclaration;
import org.eclipse.jdt.internal.corext.codemanipulation.CodeGenerationSettings;
-import org.eclipse.jdt.internal.corext.refactoring.JavaRefactoringArguments;
import org.eclipse.jdt.internal.corext.refactoring.structure.*;
import org.eclipse.jdt.internal.ui.preferences.JavaPreferencesSettings;
import org.eclipse.ltk.core.refactoring.participants.MoveRefactoring;
-import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
public class RefactoringsMove extends Refactorings {
private static final int FIELD = 1;
View
2  src/lombokRefactorings/activator/obsoleteMethods/RefactoringsRename.java
@@ -16,8 +16,6 @@
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
import org.eclipse.jface.text.ITextSelection;
import org.eclipse.jface.text.TextSelection;
-import org.eclipse.ltk.core.refactoring.CheckConditionsOperation;
-import org.eclipse.ltk.core.refactoring.PerformRefactoringOperation;
import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
public class RefactoringsRename extends Refactorings {
View
18 src/lombokRefactorings/folderOptions/FolderManager.java
@@ -1,11 +1,6 @@
package lombokRefactorings.folderOptions;
-import static lombokRefactorings.TestTypes.BEFORE;
-import static lombokRefactorings.TestTypes.DELOMBOKED;
-import static lombokRefactorings.TestTypes.DELOMBOKED_THEN_REFACTORED;
-import static lombokRefactorings.TestTypes.EXPECTED;
-import static lombokRefactorings.TestTypes.REFACTORED;
-import static lombokRefactorings.TestTypes.REFACTORED_THEN_DELOMBOKED;
+import static lombokRefactorings.TestTypes.*;
import java.io.File;
import java.io.IOException;
@@ -13,7 +8,6 @@
import java.util.Map;
import lombokRefactorings.TestTypes;
-import lombokRefactorings.activator.LombokPlugin;
import lombokRefactorings.guiAction.LombokResourceAction;
import lombokRefactorings.projectOptions.ProjectCreator;
import lombokRefactorings.projectOptions.ProjectManager;
@@ -109,12 +103,10 @@ private void deleteSubFolders(IFolder deletable) {
}
}
- else if (deletable != null) {
- try {
- deletable.delete(true, null);
- } catch (CoreException e) {
- System.err.println("Deleting file failed: " + deletable.getName());
- }
+ try {
+ deletable.delete(true, null);
+ } catch (CoreException e) {
+ System.err.println("Deleting file failed: " + deletable.getName());
}
}
View
5 src/lombokRefactorings/refactorings/RefactoringUtils.java
@@ -19,12 +19,9 @@
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
-import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.ltk.core.refactoring.CheckConditionsOperation;
import org.eclipse.ltk.core.refactoring.PerformRefactoringOperation;
import org.eclipse.ltk.core.refactoring.Refactoring;
-import org.eclipse.ui.PartInitException;
@SuppressWarnings("restriction")
@@ -71,7 +68,7 @@ public static IPackageFragmentRoot findPackageFragmentRoot(IJavaElement javaElem
* @throws JavaModelException
*/
public static CompilationUnit parse(ICompilationUnit unit) {
- return (CompilationUnit) RefactoringASTParser.parseWithASTProvider(unit, true, null);
+ return RefactoringASTParser.parseWithASTProvider(unit, true, null);
}
protected static IMethod[] findMethods(IMember[] members) {
View
1  ...lombokRefactorings/refactorings/eclipse/extractRefactorings/ExtractLocalVariableType.java
@@ -3,7 +3,6 @@
import lombokRefactorings.refactorings.RefactoringUtils;
import lombokRefactorings.regex.RefactoringRequest;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.internal.corext.refactoring.code.ExtractTempRefactoring;
@SuppressWarnings("restriction")
/**
View
7 src/lombokRefactorings/refactorings/eclipse/quickFix/OverrideMethodsQuickFixType.java
@@ -1,6 +1,5 @@
package lombokRefactorings.refactorings.eclipse.quickFix;
-import lombokRefactorings.refactorings.RefactoringUtils;
import lombokRefactorings.refactorings.eclipse.EditorBasedRefactoringType;
import lombokRefactorings.regex.RefactoringRequest;
@@ -68,7 +67,7 @@ public void doRefactoring(JavaEditor editor,
parser.setFocalPosition(110);
ASTNode createAST = parser.createAST(new NullProgressMonitor());
- CompilationUnit unit = (CompilationUnit) RefactoringASTParser.parseWithASTProvider(iCompilationUnit, true, null);
+ CompilationUnit unit = RefactoringASTParser.parseWithASTProvider(iCompilationUnit, true, null);
IEditorPart editor1;
try {
@@ -86,11 +85,11 @@ public void doRefactoring(JavaEditor editor,
}
IProblemLocation location = new ProblemLocation(110, 6, annotation);
- System.out.println(location.getCoveringNode((CompilationUnit) unit).getParent() instanceof TypeDeclaration);
+ System.out.println(location.getCoveringNode(unit).getParent() instanceof TypeDeclaration);
IProposableFix proposal = UnimplementedCodeFix.createAddUnimplementedMethodsFix(unit, location);
IProgressMonitor monitor = new NullProgressMonitor();
- TypeDeclaration declaration = (TypeDeclaration) location.getCoveringNode((CompilationUnit) unit).getParent();
+ TypeDeclaration declaration = (TypeDeclaration) location.getCoveringNode(unit).getParent();
CompilationUnitChange change1 = proposal.createChange(monitor);
View
3  ...lombokRefactorings/refactorings/eclipse/renameRefactorings/AbstractRenameRefactoring.java
@@ -1,7 +1,5 @@
package lombokRefactorings.refactorings.eclipse.renameRefactorings;
-import java.util.regex.Matcher;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.ltk.core.refactoring.CheckConditionsOperation;
@@ -11,7 +9,6 @@
import lombokRefactorings.refactorings.IRefactoringType;
import lombokRefactorings.refactorings.RefactoringUtils;
import lombokRefactorings.regex.RefactoringRequest;
-import lombokRefactorings.regex.RegexUtilities;
public abstract class AbstractRenameRefactoring implements IRefactoringType{
int targetStart;
View
1  src/lombokRefactorings/refactorings/eclipse/renameRefactorings/RenameClassType.java
@@ -1,6 +1,5 @@
package lombokRefactorings.refactorings.eclipse.renameRefactorings;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IPackageFragment;
View
1  src/lombokRefactorings/refactorings/eclipse/sourceActions/AbstractQuickFix.java
@@ -1,7 +1,6 @@
package lombokRefactorings.refactorings.eclipse.sourceActions;
import lombokRefactorings.refactorings.IRefactoringType;
-import lombokRefactorings.regex.RefactoringRequest;
abstract class AbstractQuickFix implements IRefactoringType {
View
1  src/lombokRefactorings/refactorings/eclipse/sourceActions/AbstractSourceAction.java
@@ -1,7 +1,6 @@
package lombokRefactorings.refactorings.eclipse.sourceActions;
import lombokRefactorings.refactorings.IRefactoringType;
-import lombokRefactorings.regex.RefactoringRequest;
abstract class AbstractSourceAction implements IRefactoringType {
View
3  src/lombokRefactorings/refactorings/eclipse/sourceActions/CreateUnresolvedMethodType.java
@@ -4,7 +4,6 @@
import java.util.regex.Matcher;
import lombokRefactorings.refactorings.RefactoringFailedException;
-import lombokRefactorings.refactorings.RefactoringUtils;
import lombokRefactorings.regex.RefactoringRequest;
import org.eclipse.jdt.core.ICompilationUnit;
@@ -79,7 +78,7 @@ public void run(RefactoringRequest request) throws Exception {
String methodName = nameNode.getIdentifier();
Expression sender = null;
boolean isSuperInvocation = false;
- List arguments;
+ List<?> arguments;
ASTNode invocationNode= nameNode.getParent();
if (invocationNode instanceof MethodInvocation) {
View
5 src/lombokRefactorings/refactorings/eclipse/sourceActions/OrganizeImportsType.java
@@ -1,17 +1,12 @@
package lombokRefactorings.refactorings.eclipse.sourceActions;
import lombokRefactorings.refactorings.IRefactoringType;
-import lombokRefactorings.refactorings.RefactoringFailedException;
import lombokRefactorings.refactorings.eclipse.EditorBasedRefactoringType;
import lombokRefactorings.regex.RefactoringRequest;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
import org.eclipse.jdt.ui.actions.OrganizeImportsAction;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
@SuppressWarnings("restriction")
public class OrganizeImportsType extends EditorBasedRefactoringType implements IRefactoringType {
View
17 ...ombokRefactorings/refactorings/eclipse/sourceActions/OverrideMethodsSourceActionType.java
@@ -1,10 +1,14 @@
package lombokRefactorings.refactorings.eclipse.sourceActions;
+import lombokRefactorings.refactorings.IRefactoringType;
+import lombokRefactorings.refactorings.RefactoringUtils;
+import lombokRefactorings.refactorings.eclipse.EditorBasedRefactoringType;
+import lombokRefactorings.regex.RefactoringRequest;
+
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.core.dom.IMethodBinding;
import org.eclipse.jdt.core.dom.IPackageBinding;
@@ -12,19 +16,8 @@
import org.eclipse.jdt.internal.corext.codemanipulation.AddUnimplementedMethodsOperation;
import org.eclipse.jdt.internal.corext.codemanipulation.StubUtility2;
import org.eclipse.jdt.internal.corext.dom.ASTNodes;
-import org.eclipse.jdt.internal.corext.refactoring.util.RefactoringASTParser;
import org.eclipse.jdt.internal.ui.actions.SelectionConverter;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.ui.IEditorPart;
-
-import lombokRefactorings.refactorings.IRefactoringType;
-import lombokRefactorings.refactorings.RefactoringUtils;
-import lombokRefactorings.refactorings.eclipse.EditorBasedRefactoringType;
-import lombokRefactorings.refactorings.eclipse.quickFix.AbstractQuickFix;
-import lombokRefactorings.regex.RefactoringRequest;
View
8 src/lombokRefactorings/refactorings/eclipse/sourceActions/ToggleCommentType.java
@@ -4,17 +4,9 @@
import java.util.List;
import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.internal.ui.javaeditor.EditorUtility;
import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
-import org.eclipse.jface.bindings.keys.KeyLookupFactory;
-import org.eclipse.jface.bindings.keys.KeySequence;
import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.text.TextSelection;
-import org.eclipse.jface.viewers.ISelection;
import org.eclipse.swt.widgets.Event;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PartInitException;
import org.eclipse.ui.internal.Workbench;
import org.eclipse.ui.internal.keys.WorkbenchKeyboard;
View
1  src/lombokRefactorings/regex/SearchAndCallRefactorings.java
@@ -4,7 +4,6 @@
import java.util.List;
import java.util.regex.Matcher;
-import lombokRefactorings.activator.LombokPlugin;
import lombokRefactorings.refactorings.IRefactoringType;
import lombokRefactorings.refactorings.RefactoringFactory;
import lombokRefactorings.refactorings.Refactorings;
Please sign in to comment.
Something went wrong with that request. Please try again.