From ebc6b76dcc0b09c2b6d3328a05023134c6094e01 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 23 Sep 2011 06:43:19 +0000 Subject: [PATCH] format code git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1174543 13f79535-47bb-0310-9956-ffa450edef68 --- .../scheduler/repository/RepositoryTask.java | 104 ++++++++++-------- 1 file changed, 59 insertions(+), 45 deletions(-) diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java index 94f55bee7..7e1d170bd 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-repository/src/main/java/org/apache/archiva/scheduler/repository/RepositoryTask.java @@ -1,9 +1,9 @@ package org.apache.archiva.scheduler.repository; -import java.io.File; - import org.codehaus.plexus.taskqueue.Task; +import java.io.File; + /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -24,59 +24,22 @@ import org.codehaus.plexus.taskqueue.Task; */ /** - * DataRefreshTask - task for discovering changes in the repository - * and updating all associated data. + * DataRefreshTask - task for discovering changes in the repository + * and updating all associated data. * * @version $Id: DataRefreshTask.java 525176 2007-04-03 15:21:33Z joakime $ */ public class RepositoryTask implements Task { - @Override - public int hashCode() - { - final int prime = 31; - int result = 1; - result = prime * result + ( ( repositoryId == null ) ? 0 : repositoryId.hashCode() ); - result = prime * result + ( ( resourceFile == null ) ? 0 : resourceFile.hashCode() ); - return result; - } - - @Override - public boolean equals( Object obj ) - { - if ( this == obj ) - return true; - if ( obj == null ) - return false; - if ( getClass() != obj.getClass() ) - return false; - RepositoryTask other = (RepositoryTask) obj; - if ( repositoryId == null ) - { - if ( other.repositoryId != null ) - return false; - } - else if ( !repositoryId.equals( other.repositoryId ) ) - return false; - if ( resourceFile == null ) - { - if ( other.resourceFile != null ) - return false; - } - else if ( !resourceFile.equals( other.resourceFile ) ) - return false; - return true; - } - private String repositoryId; - + private File resourceFile; - + private boolean updateRelatedArtifacts; - + private boolean scanAll; - + public boolean isScanAll() { return scanAll; @@ -128,4 +91,55 @@ public class RepositoryTask return "RepositoryTask [repositoryId=" + repositoryId + ", resourceFile=" + resourceFile + ", scanAll=" + scanAll + ", updateRelatedArtifacts=" + updateRelatedArtifacts + "]"; } + + @Override + public int hashCode() + { + final int prime = 31; + int result = 1; + result = prime * result + ( ( repositoryId == null ) ? 0 : repositoryId.hashCode() ); + result = prime * result + ( ( resourceFile == null ) ? 0 : resourceFile.hashCode() ); + return result; + } + + @Override + public boolean equals( Object obj ) + { + if ( this == obj ) + { + return true; + } + if ( obj == null ) + { + return false; + } + if ( getClass() != obj.getClass() ) + { + return false; + } + RepositoryTask other = (RepositoryTask) obj; + if ( repositoryId == null ) + { + if ( other.repositoryId != null ) + { + return false; + } + } + else if ( !repositoryId.equals( other.repositoryId ) ) + { + return false; + } + if ( resourceFile == null ) + { + if ( other.resourceFile != null ) + { + return false; + } + } + else if ( !resourceFile.equals( other.resourceFile ) ) + { + return false; + } + return true; + } } -- 2.39.5