Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed JENKINS-24822
  • Loading branch information
MadsNielsen committed Nov 12, 2014
1 parent 28eef8b commit 7fcb755
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -371,7 +371,7 @@
<artifactId>praqmajutils</artifactId>
<version>${praqmajutils.version}</version>
</dependency>

<dependency>
<groupId>net.praqma</groupId>
<artifactId>praqmajutils</artifactId>
Expand Down
Expand Up @@ -37,7 +37,7 @@ public class ConfigurationRotator extends SCM {
*/
private boolean printDebug = false;

private static Logger logger = Logger.getLogger( ConfigurationRotator.class.getName() );
private static final Logger logger = Logger.getLogger( ConfigurationRotator.class.getName() );

public enum ResultType {
COMPATIBLE,
Expand Down Expand Up @@ -296,7 +296,7 @@ public String getDisplayName() {

@Override
public SCM newInstance( StaplerRequest req, JSONObject formData ) throws FormException {
ConfigurationRotator r = (ConfigurationRotator) super.newInstance( req, formData );
ConfigurationRotator r = (ConfigurationRotator) super.newInstance( req, formData );
ConfigurationRotatorSCMDescriptor<AbstractConfigurationRotatorSCM> d = (ConfigurationRotatorSCMDescriptor<AbstractConfigurationRotatorSCM>) r.getAcrs().getDescriptor();
r.acrs = d.newInstance( req, formData, r.acrs );
save();
Expand Down
Expand Up @@ -27,8 +27,6 @@ public Class<?> getClazz() {
return clazz;
}



public void doReset( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException {
SCM scm = build.getProject().getScm();
if( scm instanceof ConfigurationRotator ) {
Expand Down
Expand Up @@ -84,17 +84,17 @@ public boolean wasReconfigured( AbstractProject<?, ?> project ) {
}

List<ClearCaseUCMTarget> list = getCompareTargets(project);
List<ClearCaseUCMTarget> configTargets = getTargets();

/* Check if the sizes are equal */
if( targets.size() != list.size() ) {
if( configTargets.size() != list.size() ) {
logger.fine( "Size was not equal" );
return true;
}



for( int i = 0; i < targets.size(); ++i ) {
if( !targets.get( i ).equals( list.get( i ) ) ) {

for( int i = 0; i < configTargets.size(); ++i ) {
logger.fine(String.format( "Comparing (SCM Configuration Target) %s to (Previously Completed Build Target) %s", configTargets.get(i), list.get(i)) );
if( !configTargets.get( i ).equals( list.get( i ) ) ) {
return true;
}
}
Expand Down Expand Up @@ -324,7 +324,7 @@ public <TT extends AbstractTarget> void setTargets( List<TT> targets ) {
* @return A list of targets
*/
@Override
public List<ClearCaseUCMTarget> getTargets() {
public final List<ClearCaseUCMTarget> getTargets() {
if( projectConfiguration != null ) {
return getConfigurationAsTargets( (ClearCaseUCMConfiguration) projectConfiguration );
} else {
Expand Down Expand Up @@ -414,7 +414,6 @@ public AbstractConfigurationRotatorSCM newInstance( StaplerRequest req, JSONObje
}
}
instance.targets = targets;

save();
return instance;
}
Expand Down

0 comments on commit 7fcb755

Please sign in to comment.