mirror of
https://github.com/apache/archiva.git
synced 2025-02-08 02:59:43 +00:00
Reducing compiler warnings and adapting to redback changes
This commit is contained in:
parent
4175f2c2d7
commit
ec8e6600ce
@ -98,7 +98,7 @@
|
|||||||
public class DefaultArchivaConfiguration
|
public class DefaultArchivaConfiguration
|
||||||
implements ArchivaConfiguration, RegistryListener
|
implements ArchivaConfiguration, RegistryListener
|
||||||
{
|
{
|
||||||
private Logger log = LoggerFactory.getLogger( DefaultArchivaConfiguration.class );
|
private final Logger log = LoggerFactory.getLogger( DefaultArchivaConfiguration.class );
|
||||||
|
|
||||||
private static String FILE_ENCODING = "UTF-8";
|
private static String FILE_ENCODING = "UTF-8";
|
||||||
|
|
||||||
|
@ -46,9 +46,9 @@ public boolean evaluate( ProxyConnectorConfiguration object )
|
|||||||
{
|
{
|
||||||
boolean satisfies = false;
|
boolean satisfies = false;
|
||||||
|
|
||||||
if ( object instanceof ProxyConnectorConfiguration )
|
if ( object != null )
|
||||||
{
|
{
|
||||||
ProxyConnectorConfiguration connector = (ProxyConnectorConfiguration) object;
|
ProxyConnectorConfiguration connector = object;
|
||||||
return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
|
return ( StringUtils.equals( sourceId, connector.getSourceRepoId() ) && StringUtils.equals( targetId,
|
||||||
connector.getTargetRepoId() ) );
|
connector.getTargetRepoId() ) );
|
||||||
}
|
}
|
||||||
|
@ -212,7 +212,6 @@
|
|||||||
<Import-Package>
|
<Import-Package>
|
||||||
javax.annotation,
|
javax.annotation,
|
||||||
javax.inject,
|
javax.inject,
|
||||||
org.apache.archiva.admin.model*;version=${project.version},
|
|
||||||
org.apache.archiva.checksum;version=${project.version},
|
org.apache.archiva.checksum;version=${project.version},
|
||||||
org.apache.archiva.common.utils;version=${project.version},
|
org.apache.archiva.common.utils;version=${project.version},
|
||||||
org.apache.archiva.configuration;version=${project.version},
|
org.apache.archiva.configuration;version=${project.version},
|
||||||
|
@ -157,7 +157,6 @@
|
|||||||
<Import-Package>
|
<Import-Package>
|
||||||
javax.annotation,
|
javax.annotation,
|
||||||
javax.inject,
|
javax.inject,
|
||||||
org.apache.archiva.admin.model*;version=${project.version},
|
|
||||||
org.apache.archiva.common.plexusbridge;version=${project.version},
|
org.apache.archiva.common.plexusbridge;version=${project.version},
|
||||||
org.apache.archiva.configuration;version=${project.version},
|
org.apache.archiva.configuration;version=${project.version},
|
||||||
org.apache.archiva.consumers;version=${project.version},
|
org.apache.archiva.consumers;version=${project.version},
|
||||||
|
@ -33,10 +33,10 @@
|
|||||||
public class DefaultUrlFailureCache
|
public class DefaultUrlFailureCache
|
||||||
implements UrlFailureCache
|
implements UrlFailureCache
|
||||||
{
|
{
|
||||||
private Cache urlCache;
|
private Cache<String, Date> urlCache;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
public DefaultUrlFailureCache( @Named( "cache#url-failures-cache" ) Cache urlCache )
|
public DefaultUrlFailureCache( @Named( "cache#url-failures-cache" ) Cache<String, Date> urlCache )
|
||||||
{
|
{
|
||||||
this.urlCache = urlCache;
|
this.urlCache = urlCache;
|
||||||
}
|
}
|
||||||
|
@ -195,7 +195,7 @@ private Map<String, ManagedRepository> getManagedRepositoriesFromConfig( )
|
|||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
log.error("Could not initialize repositories from config: {}",e.getMessage(), e );
|
log.error("Could not initialize repositories from config: {}",e.getMessage(), e );
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return Collections.EMPTY_MAP;
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -209,6 +209,7 @@ private ManagedRepository createNewManagedRepository( RepositoryProvider provide
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
private void updateRepositoryReferences(RepositoryProvider provider, ManagedRepository repo, ManagedRepositoryConfiguration cfg, Configuration configuration) throws RepositoryException
|
private void updateRepositoryReferences(RepositoryProvider provider, ManagedRepository repo, ManagedRepositoryConfiguration cfg, Configuration configuration) throws RepositoryException
|
||||||
{
|
{
|
||||||
log.debug("Updating references of repo {}",repo.getId());
|
log.debug("Updating references of repo {}",repo.getId());
|
||||||
@ -284,7 +285,7 @@ private Map<String, RemoteRepository> getRemoteRepositoriesFromConfig( )
|
|||||||
if ( remoteRepoConfigs == null )
|
if ( remoteRepoConfigs == null )
|
||||||
{
|
{
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return Collections.EMPTY_MAP;
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, RemoteRepository> remoteRepos = new LinkedHashMap<>( remoteRepoConfigs.size( ) );
|
Map<String, RemoteRepository> remoteRepos = new LinkedHashMap<>( remoteRepoConfigs.size( ) );
|
||||||
@ -313,7 +314,7 @@ private Map<String, RemoteRepository> getRemoteRepositoriesFromConfig( )
|
|||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
log.error("Could not initialize remote repositories from config: {}", e.getMessage(), e);
|
log.error("Could not initialize remote repositories from config: {}", e.getMessage(), e);
|
||||||
//noinspection unchecked
|
//noinspection unchecked
|
||||||
return Collections.EMPTY_MAP;
|
return Collections.emptyMap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -327,6 +328,7 @@ private RemoteRepository createNewRemoteRepository( RepositoryProvider provider,
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
private void updateRepositoryReferences( RepositoryProvider provider, RemoteRepository repo, RemoteRepositoryConfiguration cfg, Configuration configuration) throws RepositoryException
|
private void updateRepositoryReferences( RepositoryProvider provider, RemoteRepository repo, RemoteRepositoryConfiguration cfg, Configuration configuration) throws RepositoryException
|
||||||
{
|
{
|
||||||
if ( repo instanceof EditableRemoteRepository && repo.getContent() == null)
|
if ( repo instanceof EditableRemoteRepository && repo.getContent() == null)
|
||||||
@ -570,6 +572,7 @@ public ManagedRepository putRepository( ManagedRepositoryConfiguration managedRe
|
|||||||
* @return the new or updated repository
|
* @return the new or updated repository
|
||||||
* @throws RepositoryException if the configuration cannot be saved or updated
|
* @throws RepositoryException if the configuration cannot be saved or updated
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
public ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration, Configuration configuration) throws RepositoryException
|
public ManagedRepository putRepository( ManagedRepositoryConfiguration managedRepositoryConfiguration, Configuration configuration) throws RepositoryException
|
||||||
{
|
{
|
||||||
rwLock.writeLock( ).lock( );
|
rwLock.writeLock( ).lock( );
|
||||||
@ -751,6 +754,7 @@ public RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepos
|
|||||||
* @return the new or updated repository
|
* @return the new or updated repository
|
||||||
* @throws RepositoryException if the configuration cannot be saved or updated
|
* @throws RepositoryException if the configuration cannot be saved or updated
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
public RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration, Configuration configuration) throws RepositoryException
|
public RemoteRepository putRepository( RemoteRepositoryConfiguration remoteRepositoryConfiguration, Configuration configuration) throws RepositoryException
|
||||||
{
|
{
|
||||||
rwLock.writeLock( ).lock( );
|
rwLock.writeLock( ).lock( );
|
||||||
@ -791,6 +795,8 @@ public void removeRepository(String repoId) throws RepositoryException {
|
|||||||
removeRepository(repo);
|
removeRepository(repo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
public void removeRepository(Repository repo) throws RepositoryException
|
public void removeRepository(Repository repo) throws RepositoryException
|
||||||
{
|
{
|
||||||
if (repo instanceof RemoteRepository ) {
|
if (repo instanceof RemoteRepository ) {
|
||||||
@ -946,6 +952,7 @@ public void reload() {
|
|||||||
* @param repo
|
* @param repo
|
||||||
* @throws IndexUpdateFailedException
|
* @throws IndexUpdateFailedException
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
public void resetIndexingContext(Repository repo) throws IndexUpdateFailedException {
|
public void resetIndexingContext(Repository repo) throws IndexUpdateFailedException {
|
||||||
if (repo.hasIndex() && repo instanceof EditableRepository) {
|
if (repo.hasIndex() && repo instanceof EditableRepository) {
|
||||||
EditableRepository eRepo = (EditableRepository) repo;
|
EditableRepository eRepo = (EditableRepository) repo;
|
||||||
@ -975,6 +982,7 @@ public ManagedRepository clone(ManagedRepository repo, String newId) throws Repo
|
|||||||
return cloned;
|
return cloned;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
public <T extends Repository> Repository clone(T repo, String newId) throws RepositoryException {
|
public <T extends Repository> Repository clone(T repo, String newId) throws RepositoryException {
|
||||||
if (repo instanceof RemoteRepository ) {
|
if (repo instanceof RemoteRepository ) {
|
||||||
return this.clone((RemoteRepository)repo, newId);
|
return this.clone((RemoteRepository)repo, newId);
|
||||||
@ -1029,6 +1037,7 @@ public void clearListeners() {
|
|||||||
this.listeners.clear();
|
this.listeners.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
@Override
|
@Override
|
||||||
public <T> void raise(RepositoryEvent<T> event) {
|
public <T> void raise(RepositoryEvent<T> event) {
|
||||||
if (event instanceof IndexCreationEvent ) {
|
if (event instanceof IndexCreationEvent ) {
|
||||||
|
@ -73,7 +73,7 @@ public class DefaultRepositoryArchivaTaskScheduler
|
|||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Named( value = "taskQueue#repository-scanning" )
|
@Named( value = "taskQueue#repository-scanning" )
|
||||||
private TaskQueue repositoryScanningQueue;
|
private TaskQueue<RepositoryTask> repositoryScanningQueue;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
private ArchivaConfiguration archivaConfiguration;
|
private ArchivaConfiguration archivaConfiguration;
|
||||||
|
@ -39,6 +39,7 @@ public class RepositoryTaskJob
|
|||||||
* @param context
|
* @param context
|
||||||
* @throws org.quartz.JobExecutionException
|
* @throws org.quartz.JobExecutionException
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings( "unchecked" )
|
||||||
@Override
|
@Override
|
||||||
public void execute( JobExecutionContext context )
|
public void execute( JobExecutionContext context )
|
||||||
throws JobExecutionException
|
throws JobExecutionException
|
||||||
|
@ -270,7 +270,7 @@ public List<User> findUsersByEmailKey( String emailKey, boolean orderAscending )
|
|||||||
|
|
||||||
for ( UserManager userManager : userManagerPerId.values() )
|
for ( UserManager userManager : userManagerPerId.values() )
|
||||||
{
|
{
|
||||||
List<User> found = userManager.findUsersByEmailKey( emailKey, orderAscending );
|
List<? extends User> found = userManager.findUsersByEmailKey( emailKey, orderAscending );
|
||||||
if ( found != null )
|
if ( found != null )
|
||||||
{
|
{
|
||||||
users.addAll( found );
|
users.addAll( found );
|
||||||
@ -287,7 +287,7 @@ public List<User> findUsersByFullNameKey( String fullNameKey, boolean orderAscen
|
|||||||
|
|
||||||
for ( UserManager userManager : userManagerPerId.values() )
|
for ( UserManager userManager : userManagerPerId.values() )
|
||||||
{
|
{
|
||||||
List<User> found = userManager.findUsersByFullNameKey( fullNameKey, orderAscending );
|
List<? extends User> found = userManager.findUsersByFullNameKey( fullNameKey, orderAscending );
|
||||||
if ( found != null )
|
if ( found != null )
|
||||||
{
|
{
|
||||||
users.addAll( found );
|
users.addAll( found );
|
||||||
@ -304,7 +304,7 @@ public List<User> findUsersByQuery( UserQuery query )
|
|||||||
|
|
||||||
for ( UserManager userManager : userManagerPerId.values() )
|
for ( UserManager userManager : userManagerPerId.values() )
|
||||||
{
|
{
|
||||||
List<User> found = userManager.findUsersByQuery( query );
|
List<? extends User> found = userManager.findUsersByQuery( query );
|
||||||
if ( found != null )
|
if ( found != null )
|
||||||
{
|
{
|
||||||
users.addAll( found );
|
users.addAll( found );
|
||||||
@ -321,7 +321,7 @@ public List<User> findUsersByUsernameKey( String usernameKey, boolean orderAscen
|
|||||||
|
|
||||||
for ( UserManager userManager : userManagerPerId.values() )
|
for ( UserManager userManager : userManagerPerId.values() )
|
||||||
{
|
{
|
||||||
List<User> found = userManager.findUsersByUsernameKey( usernameKey, orderAscending );
|
List<? extends User> found = userManager.findUsersByUsernameKey( usernameKey, orderAscending );
|
||||||
if ( found != null )
|
if ( found != null )
|
||||||
{
|
{
|
||||||
users.addAll( found );
|
users.addAll( found );
|
||||||
@ -344,7 +344,7 @@ public List<User> getUsers()
|
|||||||
|
|
||||||
for ( UserManager userManager : userManagerPerId.values() )
|
for ( UserManager userManager : userManagerPerId.values() )
|
||||||
{
|
{
|
||||||
List<User> found = userManager.getUsers();
|
List<? extends User> found = userManager.getUsers();
|
||||||
if ( found != null )
|
if ( found != null )
|
||||||
{
|
{
|
||||||
users.addAll( found );
|
users.addAll( found );
|
||||||
@ -361,7 +361,7 @@ public List<User> getUsers( boolean orderAscending )
|
|||||||
|
|
||||||
for ( UserManager userManager : userManagerPerId.values() )
|
for ( UserManager userManager : userManagerPerId.values() )
|
||||||
{
|
{
|
||||||
List<User> found = userManager.getUsers( orderAscending );
|
List<? extends User> found = userManager.getUsers( orderAscending );
|
||||||
if ( found != null )
|
if ( found != null )
|
||||||
{
|
{
|
||||||
users.addAll( found );
|
users.addAll( found );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user