Permalink
Browse files

Merge remote-tracking branch 'origin/master' into sonar-its

  • Loading branch information...
2 parents ff68a46 + 618733b commit 0533742e594df3b88707063ba8d089794db9b6e4 @peterlynch peterlynch committed Nov 6, 2012
Showing with 358 additions and 834 deletions.
  1. +3 −24 nexus/nexus-api/src/main/java/org/sonatype/nexus/AbstractApplicationStatusSource.java
  2. +0 −57 nexus/nexus-api/src/main/java/org/sonatype/nexus/logging/AbstractPlexusLoggingComponent.java
  3. +0 −190 nexus/nexus-api/src/main/java/org/sonatype/nexus/logging/Slf4jPlexusLogger.java
  4. +11 −14 ...s-api/src/main/java/org/sonatype/nexus/plugins/rest/AbstractDocumentationNexusResourceBundle.java
  5. +3 −3 nexus/nexus-api/src/main/java/org/sonatype/nexus/proxy/events/AbstractEventInspector.java
  6. +5 −13 .../nexus-api/src/main/java/org/sonatype/nexus/proxy/wastebasket/DefaultRepositoryFolderRemover.java
  7. +14 −19 nexus/nexus-app/src/main/java/org/sonatype/nexus/error/reporting/DefaultErrorReportingManager.java
  8. +3 −4 nexus/nexus-app/src/main/java/org/sonatype/nexus/events/DefaultEventInspectorHost.java
  9. +1 −3 nexus/nexus-app/src/main/java/org/sonatype/nexus/maven/tasks/DefaultSnapshotRemover.java
  10. +5 −12 nexus/nexus-app/src/main/java/org/sonatype/nexus/notification/DefaultNotificationManager.java
  11. +15 −22 nexus/nexus-app/src/main/java/org/sonatype/nexus/notification/EmailCarrier.java
  12. +2 −2 nexus/nexus-app/src/main/java/org/sonatype/nexus/user/DefaultUserAccountManager.java
  13. +7 −14 nexus/nexus-app/src/main/java/org/sonatype/scheduling/DefaultTaskConfigManager.java
  14. +1 −2 .../nexus-client-core/src/main/java/org/sonatype/nexus/client/internal/rest/AbstractNexusClient.java
  15. +5 −2 ...lients/nexus-rest-client-java/src/main/java/org/sonatype/nexus/client/rest/HttpNxBasicHelper.java
  16. +1 −1 ...-clients/nexus-rest-client-java/src/main/java/org/sonatype/nexus/client/rest/NexusRestClient.java
  17. +1 −1 ...clients/nexus-rest-client-java/src/main/java/org/sonatype/nexus/client/rest/RestClientHelper.java
  18. +1 −1 ...ight-client-common/src/main/java/org/sonatype/nexus/restlight/common/AbstractRESTLightClient.java
  19. +2 −2 ...guration/src/main/java/org/sonatype/nexus/configuration/application/upgrade/Upgrade1100to200.java
  20. +2 −2 ...guration/src/main/java/org/sonatype/nexus/configuration/application/upgrade/Upgrade146to1100.java
  21. +2 −2 ...iguration/src/main/java/org/sonatype/nexus/configuration/application/upgrade/Upgrade200to220.java
  22. +3 −3 ...ation/src/main/java/org/sonatype/nexus/configuration/security/upgrade/SecurityData201Upgrade.java
  23. +1 −2 .../nexus-archetype-plugin/src/main/java/org/sonatype/nexus/plugins/mac/ArchetypeContentLocator.java
  24. +58 −63 ...ent/nexus-indexer-lucene-plugin/src/main/java/org/sonatype/nexus/index/DefaultIndexerManager.java
  25. +1 −2 ...nexus-indexer-lucene-plugin/src/main/java/org/sonatype/nexus/index/LazyContextMemberProvider.java
  26. +1 −2 ...r-lucene-plugin/src/main/java/org/sonatype/nexus/index/treeview/DefaultMergedTreeNodeFactory.java
  27. +0 −55 ...us-indexer-lucene-plugin-parent/nexus-indexer-lucene-plugin/src/main/js/repoServer.SearchPanel.js
  28. +1 −1 .../ldap-common/src/main/java/org/sonatype/security/ldap/authorization/LdapAuthorizationManager.java
  29. +1 −1 ...-parent/ldap-common/src/main/java/org/sonatype/security/ldap/dao/DefaultLdapConnectionTester.java
  30. +1 −1 ...p-plugin-parent/ldap-common/src/main/java/org/sonatype/security/ldap/dao/DefaultLdapGroupDAO.java
  31. +1 −1 ...ap-plugin-parent/ldap-common/src/main/java/org/sonatype/security/ldap/dao/DefaultLdapUserDAO.java
  32. +1 −1 ...p-common/src/main/java/org/sonatype/security/ldap/dao/password/DefaultPasswordEncoderManager.java
  33. +3 −4 .../ldap-common/src/main/java/org/sonatype/security/ldap/realms/AbstractLdapAuthenticatingRealm.java
  34. +1 −1 ...t/ldap-common/src/main/java/org/sonatype/security/ldap/realms/connector/DefaultLdapConnector.java
  35. +1 −1 ...ldap-common/src/main/java/org/sonatype/security/ldap/realms/persist/DefaultLdapConfiguration.java
  36. +1 −1 ...rent/ldap-common/src/main/java/org/sonatype/security/ldap/upgrade/cipher/DefaultPlexusCipher.java
  37. +1 −1 ...-plugin-parent/ldap-common/src/test/java/org/sonatype/security/ldap/realms/SimpleLdapManager.java
  38. +1 −1 ...s-ldap-realm-plugin/src/main/java/org/sonatype/nexus/security/ldap/realms/DefaultLdapManager.java
  39. +3 −4 ...va/org/sonatype/nexus/security/ldap/realms/test/api/LdapUserAndGroupConfigTestPlexusResource.java
  40. +10 −15 ...ore-plugins/nexus-timeline-plugin/src/main/java/org/sonatype/nexus/feeds/DefaultFeedRecorder.java
  41. +7 −12 ...plugins/nexus-timeline-plugin/src/main/java/org/sonatype/nexus/timeline/DefaultNexusTimeline.java
  42. +1 −2 ...plugins/nexus-timeline-plugin/src/main/java/org/sonatype/timeline/internal/AbstractStartable.java
  43. +1 −2 nexus/nexus-logging-extras/src/main/java/org/sonatype/nexus/log/internal/LogbackLogManager.java
  44. +4 −2 nexus/nexus-logging-extras/src/main/resources/META-INF/log/logback-nexus.xml
  45. +31 −17 nexus/nexus-migration-tool/nexus-metadata-rebuild-tool/pom.xml
  46. +0 −37 ...us-migration-tool/nexus-metadata-rebuild-tool/src/main/assembly/metadata-rebuild-cli-assembly.xml
  47. +5 −3 ...tadata-rebuild-tool/src/main/java/org/sonatype/nexus/tools/metadata/DefaultMetadataRebuilder.java
  48. +1 −1 ...nexus-metadata-rebuild-tool/src/main/java/org/sonatype/nexus/tools/metadata/FSMetadataHelper.java
  49. +29 −16 nexus/nexus-migration-tool/nexus-repository-conversion-tool/pom.xml
  50. +0 −37 ...on-tool/nexus-repository-conversion-tool/src/main/assembly/repository-conversion-cli-assembly.xml
  51. +6 −0 nexus/nexus-oss-webapp/src/main/resources/content/conf/logback.xml
  52. +2 −2 ...xus-proxy/src/main/java/org/sonatype/nexus/proxy/attributes/AbstractStorageFileItemInspector.java
  53. +2 −2 ...s/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/attributes/AbstractStorageItemInspector.java
  54. +15 −22 nexus/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/mapping/DefaultRequestRepositoryMapper.java
  55. +1 −1 ...exus-proxy/src/main/java/org/sonatype/nexus/proxy/maven/RecreateMavenMetadataWalkerProcessor.java
  56. +1 −4 nexus/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/maven/metadata/AbstractMetadataHelper.java
  57. +1 −1 nexus/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/maven/metadata/DefaultMetadataHelper.java
  58. +3 −9 nexus/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/registry/DefaultRepositoryRegistry.java
  59. +9 −14 nexus/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/registry/DefaultRepositoryTypeRegistry.java
  60. +3 −10 nexus/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/repository/AbstractRepository.java
  61. +1 −6 .../nexus-proxy/src/main/java/org/sonatype/nexus/proxy/repository/RepositoryStatusCheckerThread.java
  62. +1 −1 ...xus-proxy/src/main/java/org/sonatype/nexus/proxy/repository/charger/AbstractRetrieveCallable.java
  63. +1 −1 ...us-proxy/src/main/java/org/sonatype/nexus/proxy/repository/charger/GroupItemRetrieveCallable.java
  64. +1 −1 ...s/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/repository/charger/ItemRetrieveCallable.java
  65. +4 −14 nexus/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/router/DefaultRepositoryRouter.java
  66. +2 −2 ...proxy/src/main/java/org/sonatype/nexus/proxy/storage/remote/DefaultRemoteProviderHintFactory.java
  67. +5 −25 nexus/nexus-proxy/src/main/java/org/sonatype/nexus/proxy/target/DefaultTargetRegistry.java
  68. +3 −3 ...xus-proxy/src/main/java/org/sonatype/nexus/proxy/wastebasket/AbstractRepositoryFolderCleaner.java
  69. +3 −5 nexus/nexus-proxy/src/test/java/org/sonatype/nexus/proxy/AbstractProxyTestEnvironment.java
  70. +3 −3 nexus/nexus-rest-api/src/main/java/org/sonatype/nexus/rest/AbstractArtifactViewProvider.java
  71. +2 −3 nexus/nexus-rest-api/src/main/java/org/sonatype/nexus/rest/NexusRestletResource.java
  72. +4 −6 nexus/nexus-rest-api/src/main/java/org/sonatype/nexus/rest/RestletRepositoryURLBuilder.java
  73. +2 −3 .../nexus-rest-api/src/test/java/org/sonatype/nexus/rest/ResourceStoreContentPlexusResourceTest.java
  74. +6 −13 nexus/nexus-rest-api/src/test/java/org/sonatype/nexus/rest/RestletRepositoryURLBuilderTest.java
  75. BIN nexus/nexus-webapp/src/main/webapp/digestapplet.jar
  76. +24 −4 nexus/pom.xml
@@ -19,13 +19,13 @@
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
-import org.codehaus.plexus.logging.Logger;
-import org.sonatype.nexus.logging.Slf4jPlexusLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public abstract class AbstractApplicationStatusSource
implements ApplicationStatusSource
{
- private Logger logger = Slf4jPlexusLogger.getPlexusLogger( getClass() );
+ protected final Logger logger = LoggerFactory.getLogger(getClass());
/**
* System status.
@@ -54,8 +54,6 @@ public AbstractApplicationStatusSource()
/**
* Internal method for getting SystemStatus. Does not perform any locking.
- *
- * @return
*/
protected SystemStatus getSystemStatusInternal()
{
@@ -64,8 +62,6 @@ protected SystemStatus getSystemStatusInternal()
/**
* Returns the RW lock.
- *
- * @return
*/
protected ReadWriteLock getLock()
{
@@ -116,20 +112,7 @@ public boolean setState( SystemState state )
// ==
/**
- * Returns the Plexus logger.
- *
- * @return
- */
- protected Logger getLogger()
- {
- return logger;
- }
-
- /**
* Reads the version from a properties file (the one embedded by Maven into Jar).
- *
- * @param path
- * @return
*/
protected String readVersion( String path )
{
@@ -191,16 +174,12 @@ protected void updateSystemStatusIfNeeded( boolean forced )
/**
* Discovers (probably in "edition specific" way) the version of the application.
- *
- * @return
*/
protected abstract String discoverApplicationVersion();
/**
* Implement here any updates to SystemStatus needed. No need to bother with locking, it happens in the caller of
* this method. The method body contains exclusive lock to SystemStatus.
- *
- * @param systemStatus
*/
protected abstract void renewSystemStatus( SystemStatus systemStatus );
}
@@ -1,57 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version
- * Copyright (c) 2007-2012 Sonatype, Inc.
- * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
- *
- * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
- * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
- * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
- * Eclipse Foundation. All other trademarks are the property of their respective owners.
- */
-package org.sonatype.nexus.logging;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.codehaus.plexus.logging.Logger;
-
-/**
- * Plexus' AbstractLogEnabled in compatibility way.
- *
- * @author: cstamas
- * @deprecated To be used by components still relying on Plexus Logger only, but in general, avoid this! Use
- * AbstractLoggingComponent or directly SLF4J API instead!
- */
-public class AbstractPlexusLoggingComponent
-{
-
- private final Logger plexusLogger;
-
- protected AbstractPlexusLoggingComponent()
- {
- this.plexusLogger = checkNotNull( createLogger() );
- }
-
- /**
- * Creates logger instance to be used with component instance. It might be overridden by subclasses to implement
- * alternative logger naming strategy. By default, this method does the "usual" fluff: {@code Slf4jPlexusLogger.getPlexusLogger(getClass() )}.
- *
- * @return The Logger instance to be used by component for logging.
- */
- protected Logger createLogger()
- {
- return Slf4jPlexusLogger.getPlexusLogger( getClass() );
- }
-
- /**
- * Returns the Logger instance of this component. Never returns {@code null}.
- *
- * @return
- */
- protected Logger getLogger()
- {
- return plexusLogger;
- }
-
-}
@@ -1,190 +0,0 @@
-/**
- * Sonatype Nexus (TM) Open Source Version
- * Copyright (c) 2007-2012 Sonatype, Inc.
- * All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
- *
- * This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
- * which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
- * of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
- * Eclipse Foundation. All other trademarks are the property of their respective owners.
- */
-package org.sonatype.nexus.logging;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Wrapper that wraps SLF4J logger into a Plexus Logger interface to be used with Legacy Plexus components.
- *
- * @author: cstamas
- *
- * @deprecated This class should be removed, and only used in places where a Plexus logger is required for compatibility with legacy apis.
- */
-@Deprecated
-public class Slf4jPlexusLogger
- implements org.codehaus.plexus.logging.Logger
-{
-
- private final Logger logger;
-
- public Slf4jPlexusLogger( final Logger logger )
- {
- this.logger = checkNotNull( logger );
- }
-
- public Logger getSlf4jLogger()
- {
- return logger;
- }
-
- // ==
-
- @Override
- public void debug( final String message )
- {
- logger.debug( message );
- }
-
- @Override
- public void debug( final String message, final Throwable throwable )
- {
- logger.debug( message, throwable );
- }
-
- @Override
- public boolean isDebugEnabled()
- {
- return logger.isDebugEnabled();
- }
-
- @Override
- public void info( final String message )
- {
- logger.info( message );
- }
-
- @Override
- public void info( final String message, final Throwable throwable )
- {
- logger.info( message, throwable );
- }
-
- @Override
- public boolean isInfoEnabled()
- {
- return logger.isInfoEnabled();
- }
-
- @Override
- public void warn( final String message )
- {
- logger.warn( message );
- }
-
- @Override
- public void warn( final String message, final Throwable throwable )
- {
- logger.warn( message, throwable );
- }
-
- @Override
- public boolean isWarnEnabled()
- {
- return logger.isWarnEnabled();
- }
-
- @Override
- public void error( final String message )
- {
- logger.error( message );
- }
-
- @Override
- public void error( final String message, final Throwable throwable )
- {
- logger.error( message, throwable );
- }
-
- @Override
- public boolean isErrorEnabled()
- {
- return logger.isErrorEnabled();
- }
-
- @Override
- public void fatalError( final String message )
- {
- error( message );
- }
-
- @Override
- public void fatalError( final String message, final Throwable throwable )
- {
- error( message, throwable );
- }
-
- @Override
- public boolean isFatalErrorEnabled()
- {
- return isErrorEnabled();
- }
-
- // ==
-
- @Override
- public int getThreshold()
- {
- // unused
- return LEVEL_DEBUG;
- }
-
- @Override
- public void setThreshold( final int threshold )
- {
- // noop, it is a matter of Slf4j backend.
- }
-
- @Override
- public org.codehaus.plexus.logging.Logger getChildLogger( final String name )
- {
- // this is a noop implementation actually, since in Core there is only one component using this
- // feature that itself is disabled (parked).
- return this;
- }
-
- @Override
- public String getName()
- {
- return logger.getName();
- }
-
- // ==
-
- /**
- * Factory method for Plexus Logger instances, that uses the good old {@code LoggerFactory.getLogger(owner)} way
- * to obtain Slf4l Logger to have it wrapped into Slf4jPlexusLogger instance.
- *
- * @param owner
- * @return
- */
- public static org.codehaus.plexus.logging.Logger getPlexusLogger( final Class<?> owner )
- {
- return getPlexusLogger( LoggerFactory.getLogger( owner ) );
- }
-
- /**
- * Factory method for Plexus Logger instances, that wraps existing Slf4j Logger instances.
- *
- * @param logger
- * @return
- */
- public static org.codehaus.plexus.logging.Logger getPlexusLogger( final Logger logger )
- {
- return new Slf4jPlexusLogger( logger );
- }
-
-}
@@ -24,14 +24,14 @@
import com.google.common.annotations.VisibleForTesting;
import org.codehaus.plexus.component.annotations.Requirement;
-import org.codehaus.plexus.logging.Logger;
-import org.sonatype.nexus.logging.Slf4jPlexusLogger;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import org.sonatype.nexus.mime.MimeSupport;
public abstract class AbstractDocumentationNexusResourceBundle
implements NexusDocumentationBundle
{
- private Logger logger = Slf4jPlexusLogger.getPlexusLogger(getClass());
+ private final Logger logger = LoggerFactory.getLogger(getClass());
@Requirement
private MimeSupport mimeSupport;
@@ -44,11 +44,6 @@ protected AbstractDocumentationNexusResourceBundle(final MimeSupport mimeSupport
this.mimeSupport = mimeSupport;
}
- protected Logger getLogger()
- {
- return logger;
- }
-
public List<StaticResource> getContributedResouces()
{
List<StaticResource> resources = new LinkedList<StaticResource>();
@@ -84,14 +79,17 @@ protected Logger getLogger()
resources.add( new DefaultStaticResource( url, path, mimeSupport.guessMimeTypeFromPath( name ) ) );
}
- if ( getLogger().isDebugEnabled() )
+ if ( logger.isTraceEnabled() )
{
- getLogger().debug( "Discovered documentation for: '" + getPluginId() + "': " + resources.toString() );
+ logger.trace("Discovered documentation for: {}", getPluginId());
+ for (StaticResource resource: resources) {
+ logger.trace(" {}", resource);
+ }
}
}
catch ( IOException e )
{
- getLogger().error( "Error discovering plugin documentation " + getPluginId(), e );
+ logger.error( "Error discovering plugin documentation {}", getPluginId(), e );
}
finally
{
@@ -103,7 +101,7 @@ protected Logger getLogger()
}
catch ( IOException e )
{
- getLogger().debug( e.getMessage(), e );
+ logger.debug( e.getMessage(), e );
}
}
}
@@ -122,8 +120,7 @@ public String getPathPrefix()
/**
* Deprecated, but left in place because old plugins still rely on this.
- *
- * @return
+ *
* @deprecated use getPathPrefix() method.
*/
@Deprecated
Oops, something went wrong.

0 comments on commit 0533742

Please sign in to comment.