Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

used variable deleted #11

Open
cal101 opened this issue Mar 7, 2017 · 6 comments
Open

used variable deleted #11

cal101 opened this issue Mar 7, 2017 · 6 comments
Labels

Comments

@cal101
Copy link
Contributor

cal101 commented Mar 7, 2017

         // create window
-        JFrame mainFrame = getMainFrame();
         mainFrame.setTitle(resourceMap.getString("frameTitle"));
         mainFrame.setSize(FRAME_WIDTH, FRAME_HEIGHT);
         mainFrame.setJMenuBar(buildMenubar());
         
rpau added a commit that referenced this issue Mar 8, 2017
@rpau
Copy link
Contributor

rpau commented Mar 8, 2017

Cal, probably is something more hard to find. I keep working on it

@rpau rpau added the bug label Mar 8, 2017
@cal101
Copy link
Contributor Author

cal101 commented Mar 8, 2017

I don't want to spend too much time extracting real test cases for everything.
Let's do a first run of the bugs that are easy to reproduce (and to fix) and do a second run for the difficult ones where I can try to extract real test cases.
I don't plan to use the PMD plugin at all but just noticed a thing or two when playing with it.

@rpau
Copy link
Contributor

rpau commented Mar 8, 2017

Ok,

I have fixed some important issues and I think that most of those that you reported are pretty much related. Let's see what happens.

cal101 added a commit to cal101/walkmod-misc that referenced this issue Mar 10, 2017
@cal101
Copy link
Contributor Author

cal101 commented Mar 10, 2017

Test case
cal101/walkmod-misc@328a3d1

@rpau
Copy link
Contributor

rpau commented Mar 14, 2017

I have created a test for it and it does not break. When I print the source code is exactly the same
8781ce6

@cal101
Copy link
Contributor Author

cal101 commented Mar 14, 2017

Did you try my test case?

git clone http://github.com/cal101/walkmod-misc.git
cd walkmod-misc/
git branch pmd-plugin-tests origin/pmd-plugin-tests
git checkout pmd-plugin-tests
rm -rf ~/.m2/repository
rm -rf ~/.ivy2
mvn compile
walkmod apply -e

git diff
diff --git a/src/main/java/de/walkmod/pmd/RemoveOfUsedVar1.java b/src/main/java/de/walkmod/pmd/RemoveOfUsedVar1.java
index 41956c6..878bfd4 100644
--- a/src/main/java/de/walkmod/pmd/RemoveOfUsedVar1.java
+++ b/src/main/java/de/walkmod/pmd/RemoveOfUsedVar1.java
@@ -7,8 +7,6 @@ import javax.swing.JTextField;
 public class RemoveOfUsedVar1 {
 
     private JTextField jYear;
-    private JTextField jMonth;
-    private JTextField jDay;
 
     public void setToday() {
           Calendar today = Calendar.getInstance();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants