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
walkmod execution to remove dead code #1957
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ | |
*/ | ||
package hudson.cli.handlers; | ||
|
||
import org.kohsuke.args4j.spi.OptionHandler; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,4 +44,3 @@ | |
*/ | ||
package hudson.init; | ||
|
||
import org.jvnet.hudson.reactor.Task; |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -674,7 +674,7 @@ public void renameTo(String newName) throws IOException { | |
|
||
@Override | ||
public void movedTo(DirectlyModifiableTopLevelItemGroup destination, AbstractItem newItem, File destDir) throws IOException { | ||
Job newJob = (Job) newItem; // Missing covariant parameters type here. | ||
// Missing covariant parameters type here. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thought this comment was related to removed line. I guess it used to check types even if it not used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But do you think that is makes sense if the parameter is not used? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see any reason to keep this line There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or to be on the safe side assert newItem instanceof Job |
||
File oldBuildDir = getBuildDir(); | ||
super.movedTo(destination, newItem, destDir); | ||
File newBuildDir = getBuildDir(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
*/ | ||
package hudson.node_monitors; | ||
|
||
import hudson.Util; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't these lines just be removed? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes |
||
import hudson.Extension; | ||
import hudson.model.Computer; | ||
import hudson.remoting.Callable; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!DOCTYPE walkmod PUBLIC "-//WALKMOD//DTD" "http://www.walkmod.com/dtd/walkmod-1.1.dtd"> | ||
<walkmod> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it be possible to keep this file somewhere outside the top level? E.g. src/walkmod There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. walkmod is like maven - it uses the execution directory to find the configuration. If it is a strict requirement, I can add an option for this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No strict requirement |
||
<conf-providers> | ||
<conf-provider type="maven"/> | ||
</conf-providers> | ||
<chain name="default"> | ||
<transformation type="dead-code-cleaner"> | ||
<param name="ignoreSerializableMethods">true</param> | ||
<param name="excludedMethods">["hudson.FilePath#_syncIO()"]</param> | ||
<param name="excludedFields">["hudson.model.Slave#labels", "hudson.model.JenkinsLocationConfiguration#charset", "jenkins.model.JenkinsLocationConfiguration#useSsl"]</param> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keeping configuraiton in xml... afair @jglick is strongly against such things. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can support yml configurations. Is it better? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. XML is fine for me... |
||
</transformation> | ||
<writer path="src/main/java" type="org.walkmod:walkmod-javalang-plugin:string-writer"/> | ||
</chain> | ||
</walkmod> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CC @bsideup