Commit b68f03e5 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

could be final.


Signed-off-by: Kristof Szabados's avatarKristof Szabados <Kristof.Szabados@ericsson.com>
parent ac27d2d4
......@@ -278,7 +278,7 @@ public class ChangeCreator {
for (final ImportModule m : module.getImports()) {
final Identifier importedIdentifier = m.getIdentifier();
boolean isused = false;
for (Module m2 : usedModules) {
for (final Module m2 : usedModules) {
if(m2.getIdentifier().equals(importedIdentifier)) {
isused = true;
}
......@@ -355,7 +355,7 @@ public class ChangeCreator {
static class ImportsCheck extends ASTVisitor {
private Set<Module> setOfModules = new HashSet<Module>();
private final Set<Module> setOfModules = new HashSet<Module>();
public ImportsCheck() {
setOfModules.clear();
......
......@@ -124,7 +124,7 @@ public class ChangeCreator {
* @return The edit, which contains the proper changes.
* @throws CoreException
*/
private MultiTextEdit runsOnScopeEdit(final TTCN3Module module, IFile toVisit) throws BadLocationException, CoreException {
private MultiTextEdit runsOnScopeEdit(final TTCN3Module module, final IFile toVisit) throws BadLocationException, CoreException {
final MultiTextEdit edit = new MultiTextEdit();
final Set<Definition> list;
......@@ -136,7 +136,7 @@ public class ChangeCreator {
}
list = visit.getLocations();
for (Definition node : list) {
for (final Definition node : list) {
final Set<Identifier> definitions = new HashSet<Identifier>();
final Reference runsOnReference;
......@@ -221,7 +221,7 @@ public class ChangeCreator {
return edit;
}
private static ComponentTypeBody searchComponent(final ComponentTypeBody component, final Set<Identifier> definitions, Set<Identifier> identifiersOfTree) {
private static ComponentTypeBody searchComponent(final ComponentTypeBody component, final Set<Identifier> definitions, final Set<Identifier> identifiersOfTree) {
final List<ComponentTypeBody> parentComponentBodies = component.getExtensions().getComponentBodies();
if (parentComponentBodies.isEmpty()) {
identifiersOfTree.add(component.getIdentifier());
......@@ -229,7 +229,7 @@ public class ChangeCreator {
}
final Set<Identifier> setNodes = new HashSet<Identifier>();
setNodes.add(component.getIdentifier());
for (ComponentTypeBody variable : parentComponentBodies) {
for (final ComponentTypeBody variable : parentComponentBodies) {
final Set<Identifier> identifiersOfNode = new HashSet<Identifier>();
final ComponentTypeBody cb = searchComponent(variable, definitions, identifiersOfNode);
if (cb != null) {
......
......@@ -33,24 +33,24 @@ public class RunsOnScopeReductionFromBrowser extends AbstractHandler implements
private ISelection selection;
@Override
public void run(IAction action) {
public void run(final IAction action) {
performRunsOnScopeReduction();
}
@Override
public void selectionChanged(IAction action, ISelection selection) {
public void selectionChanged(final IAction action, final ISelection selection) {
this.selection = selection;
}
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
public Object execute(final ExecutionEvent event) throws ExecutionException {
selection = HandlerUtil.getActiveWorkbenchWindow(event).getActivePage().getSelection();
performRunsOnScopeReduction();
return null;
}
@Override
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
public void setActivePart(final IAction action, final IWorkbenchPart targetPart) {
// TODO Auto-generated method stub
}
......
......@@ -58,7 +58,7 @@ public class RunsOnScopeReductionFromEditor extends AbstractHandler{
}
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
public Object execute(final ExecutionEvent event) throws ExecutionException {
//update AST
Utils.updateASTForProjectActiveInEditor("RunsOnScopeReduction");
......
......@@ -82,7 +82,7 @@ public class RunsOnScopeReductionRefactoring extends Refactoring{
}
@Override
public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
public RefactoringStatus checkInitialConditions(final IProgressMonitor pm)
throws CoreException, OperationCanceledException {
final RefactoringStatus result = new RefactoringStatus();
try{
......@@ -94,7 +94,7 @@ public class RunsOnScopeReductionRefactoring extends Refactoring{
}
// check that there are no ttcnpp files in the project
for (IProject project : projects) {
for (final IProject project : projects) {
if (hasTtcnppFiles(project)) {
result.addError(MessageFormat.format(PROJECTCONTAINSTTCNPPFILES, project));
}
......@@ -102,9 +102,9 @@ public class RunsOnScopeReductionRefactoring extends Refactoring{
pm.worked(1);
// check that there are no error markers in the project
for (IProject project : projects) {
for (final IProject project : projects) {
final IMarker[] markers = project.findMarkers(null, true, IResource.DEPTH_INFINITE);
for (IMarker marker : markers) {
for (final IMarker marker : markers) {
if (IMarker.SEVERITY_ERROR == marker.getAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR)) {
result.addError(MessageFormat.format(PROJECTCONTAINSERRORS, project));
break;
......@@ -123,13 +123,13 @@ public class RunsOnScopeReductionRefactoring extends Refactoring{
}
@Override
public RefactoringStatus checkFinalConditions(IProgressMonitor pm)
public RefactoringStatus checkFinalConditions(final IProgressMonitor pm)
throws CoreException, OperationCanceledException {
return new RefactoringStatus();
}
@Override
public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException {
public Change createChange(final IProgressMonitor pm) throws CoreException, OperationCanceledException {
if (selection != null) {
final CompositeChange cchange = new CompositeChange("RunsOnScopeRefactoring");
final Iterator<?> it = selection.iterator();
......@@ -169,7 +169,7 @@ public class RunsOnScopeReductionRefactoring extends Refactoring{
public static boolean hasTtcnppFiles(final IResource resource) throws CoreException {
if (resource instanceof IProject || resource instanceof IFolder) {
final IResource[] children = resource instanceof IFolder ? ((IFolder) resource).members() : ((IProject) resource).members();
for (IResource res : children) {
for (final IResource res : children) {
if (hasTtcnppFiles(res)) {
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment