forked from phoedos/pmd
PMD dogfooding - avoid unnecessary local before return
This commit is contained in:
@ -351,7 +351,7 @@ public class CPDConfiguration extends AbstractConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
FilenameFilter filter = new FilenameFilter() {
|
||||
return new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
File f = new File(dir, name);
|
||||
@ -362,7 +362,6 @@ public class CPDConfiguration extends AbstractConfiguration {
|
||||
return languageFilter.accept(dir, name);
|
||||
}
|
||||
};
|
||||
return filter;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -720,7 +720,7 @@ public class GUI implements CPDListener {
|
||||
|
||||
final long start = System.currentTimeMillis();
|
||||
|
||||
Timer t = new Timer(1000, new ActionListener() {
|
||||
return new Timer(1000, new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
long now = System.currentTimeMillis();
|
||||
@ -731,7 +731,6 @@ public class GUI implements CPDListener {
|
||||
timeField.setText(formatTime(minutes, seconds));
|
||||
}
|
||||
});
|
||||
return t;
|
||||
}
|
||||
|
||||
private static String formatTime(long minutes, long seconds) {
|
||||
@ -762,7 +761,7 @@ public class GUI implements CPDListener {
|
||||
|
||||
private TableModel tableModelFrom(final List<Match> items) {
|
||||
|
||||
TableModel model = new SortingTableModel<Match>() {
|
||||
return new SortingTableModel<Match>() {
|
||||
|
||||
private int sortColumn;
|
||||
private boolean sortDescending;
|
||||
@ -837,8 +836,6 @@ public class GUI implements CPDListener {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
return model;
|
||||
}
|
||||
|
||||
private void sortOnColumn(int columnIndex) {
|
||||
|
@ -312,7 +312,7 @@ public class Designer implements ClipboardOwner {
|
||||
|
||||
@Override
|
||||
public Enumeration<TreeNode> children() {
|
||||
Enumeration<TreeNode> e = new Enumeration<TreeNode>() {
|
||||
return new Enumeration<TreeNode>() {
|
||||
int i = 0;
|
||||
|
||||
@Override
|
||||
@ -325,7 +325,6 @@ public class Designer implements ClipboardOwner {
|
||||
return kids[i++];
|
||||
}
|
||||
};
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -395,7 +394,7 @@ public class Designer implements ClipboardOwner {
|
||||
getChildAt(0); // force it to build kids
|
||||
}
|
||||
|
||||
Enumeration<TreeNode> e = new Enumeration<TreeNode>() {
|
||||
return new Enumeration<TreeNode>() {
|
||||
int i = 0;
|
||||
|
||||
@Override
|
||||
@ -408,7 +407,6 @@ public class Designer implements ClipboardOwner {
|
||||
return kids[i++];
|
||||
}
|
||||
};
|
||||
return e;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user