Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -500,7 +500,7 @@ class PutTaskRunner

private final File file;

private final FileTransformer fileTransformer;
private final FileTransformer fileTransformer;

private final Collection<RepositoryLayout.Checksum> checksums;

Expand All @@ -511,9 +511,9 @@ class PutTaskRunner
}

/**
* <strong>IMPORTANT</strong> When using a fileTransformer, the content of the file is stored in memory to
* <strong>IMPORTANT</strong> When using a fileTransformer, the content of the file is stored in memory to
* ensure that file content and checksums stay in sync!
*
*
* @param path
* @param file
* @param fileTransformer
Expand All @@ -538,7 +538,7 @@ protected void runTask()
// transform data once to byte array, ensure constant data for checksum
ByteArrayOutputStream baos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];

try ( InputStream transformData = fileTransformer.transformData( file ) )
{
for ( int read; ( read = transformData.read( buffer, 0, buffer.length ) ) != -1; )
Expand All @@ -559,7 +559,7 @@ protected void runTask()
}

/**
*
*
* @param file source
* @param bytes transformed data from file or {@code null}
* @param location target
Expand All @@ -577,7 +577,7 @@ private void uploadChecksums( File file, byte[] bytes, URI location )
{
algos.add( checksum.getAlgorithm() );
}

Map<String, Object> sumsByAlgo;
if ( bytes != null )
{
Expand All @@ -595,15 +595,7 @@ private void uploadChecksums( File file, byte[] bytes, URI location )
}
catch ( IOException e )
{
String msg = "Failed to upload checksums for " + file + ": " + e.getMessage();
if ( LOGGER.isDebugEnabled() )
{
LOGGER.warn( msg, e );
}
else
{
LOGGER.warn( msg );
}
LOGGER.warn( "Failed to upload checksums for {}", file, e );
}
}

Expand All @@ -619,15 +611,7 @@ private void uploadChecksum( URI location, Object checksum )
}
catch ( Exception e )
{
String msg = "Failed to upload checksum " + location + ": " + e.getMessage();
if ( LOGGER.isDebugEnabled() )
{
LOGGER.warn( msg, e );
}
else
{
LOGGER.warn( msg );
}
LOGGER.warn( "Failed to upload checksum to {}", location, e );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -251,7 +251,7 @@ public void commit()
}
catch ( IOException e )
{
LOGGER.debug( "Failed to write checksum file {}: {}", checksumFile, e.getMessage(), e );
LOGGER.debug( "Failed to write checksum file {}", checksumFile, e );
}
}
checksumFiles.clear();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -282,8 +282,7 @@ public PartialFile newInstance( File dstFile, RemoteAccessChecker checker )
catch ( IOException e )
{
lockFile.close();
LOGGER.debug( "Cannot create resumable file {}: {}", partFile.getAbsolutePath(), e.getMessage(),
e );
LOGGER.debug( "Cannot create resumable file {}", partFile.getAbsolutePath(), e );
// fall through and try non-resumable/temporary file location
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -55,8 +55,8 @@ public static RepositorySystem newRepositorySystem()
@Override
public void serviceCreationFailed( Class<?> type, Class<?> impl, Throwable exception )
{
LOGGER.error( "Service creation failed for {} implementation {}: {}",
type, impl, exception.getMessage(), exception );
LOGGER.error( "Service creation failed for {} with implementation {}",
type, impl, exception );
}
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -124,10 +124,9 @@ public LocalRepositoryManager newLocalRepositoryManager( RepositorySystemSession
}
if ( LOGGER.isDebugEnabled() && errors.size() > 1 )
{
String msg = "Could not obtain local repository manager for " + repository;
for ( Exception e : errors )
{
LOGGER.debug( msg, e );
LOGGER.debug( "Could not obtain local repository manager for {}", repository, e );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -145,10 +145,9 @@ public RepositoryConnector newRepositoryConnector( RepositorySystemSession sessi
}
if ( LOGGER.isDebugEnabled() && errors.size() > 1 )
{
String msg = "Could not obtain connector factory for " + repository;
for ( Exception e : errors )
{
LOGGER.debug( msg, e );
LOGGER.debug( "Could not obtain connector factory for {}", repository, e );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -174,17 +174,7 @@ private void dispatch( RepositoryEvent event, RepositoryListener listener )

private void logError( Throwable e, Object listener )
{
String msg =
"Failed to dispatch repository event to " + listener.getClass().getCanonicalName() + ": " + e.getMessage();

if ( LOGGER.isDebugEnabled() )
{
LOGGER.warn( msg, e );
}
else
{
LOGGER.warn( msg );
}
LOGGER.warn( "Failed to dispatch repository event to {}", listener.getClass().getCanonicalName(), e );
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -111,10 +111,9 @@ public RepositoryLayout newRepositoryLayout( RepositorySystemSession session, Re
}
if ( LOGGER.isDebugEnabled() && errors.size() > 1 )
{
String msg = "Could not obtain layout factory for " + repository;
for ( Exception e : errors )
{
LOGGER.debug( msg, e );
LOGGER.debug( "Could not obtain layout factory for {}", repository, e );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -123,10 +123,9 @@ public Transporter newTransporter( RepositorySystemSession session, RemoteReposi
}
if ( LOGGER.isDebugEnabled() && errors.size() > 1 )
{
String msg = "Could not obtain transporter factory for " + repository;
for ( Exception e : errors )
{
LOGGER.debug( msg, e );
LOGGER.debug( "Could not obtain transporter factory for {}", repository, e );
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -107,7 +107,7 @@ public void checkArtifact( RepositorySystemSession session, UpdateCheck<Artifact
if ( check.getLocalLastUpdated() != 0
&& !isUpdatedRequired( session, check.getLocalLastUpdated(), check.getPolicy() ) )
{
LOGGER.debug( "Skipped remote request for {}, locally installed artifact up-to-date.", check.getItem() );
LOGGER.debug( "Skipped remote request for {}, locally installed artifact up-to-date", check.getItem() );

check.setRequired( false );
return;
Expand Down Expand Up @@ -161,11 +161,7 @@ else if ( error.length() <= 0 )
}
else if ( isAlreadyUpdated( session, updateKey ) )
{
if ( LOGGER.isDebugEnabled() )
{
LOGGER.debug( "Skipped remote request for " + check.getItem()
+ ", already updated during this session." );
}
LOGGER.debug( "Skipped remote request for {}, already updated during this session", check.getItem() );

check.setRequired( false );
if ( error != null )
Expand All @@ -179,7 +175,7 @@ else if ( isUpdatedRequired( session, lastUpdated, check.getPolicy() ) )
}
else if ( fileExists )
{
LOGGER.debug( "Skipped remote request for {}, locally cached artifact up-to-date.", check.getItem() );
LOGGER.debug( "Skipped remote request for {}, locally cached artifact up-to-date", check.getItem() );

check.setRequired( false );
}
Expand Down Expand Up @@ -234,7 +230,7 @@ public void checkMetadata( RepositorySystemSession session, UpdateCheck<Metadata
if ( check.getLocalLastUpdated() != 0
&& !isUpdatedRequired( session, check.getLocalLastUpdated(), check.getPolicy() ) )
{
LOGGER.debug( "Skipped remote request for {} locally installed metadata up-to-date.", check.getItem() );
LOGGER.debug( "Skipped remote request for {} locally installed metadata up-to-date", check.getItem() );

check.setRequired( false );
return;
Expand Down Expand Up @@ -288,7 +284,7 @@ else if ( error.length() <= 0 )
}
else if ( isAlreadyUpdated( session, updateKey ) )
{
LOGGER.debug( "Skipped remote request for {}, already updated during this session.", check.getItem() );
LOGGER.debug( "Skipped remote request for {}, already updated during this session", check.getItem() );

check.setRequired( false );
if ( error != null )
Expand All @@ -302,7 +298,7 @@ else if ( isUpdatedRequired( session, lastUpdated, check.getPolicy() ) )
}
else if ( fileExists )
{
LOGGER.debug( "Skipped remote request for {}, locally cached metadata up-to-date.", check.getItem() );
LOGGER.debug( "Skipped remote request for {}, locally cached metadata up-to-date", check.getItem() );

check.setRequired( false );
}
Expand Down Expand Up @@ -349,7 +345,7 @@ private long getLastUpdated( Properties props, String key )
}
catch ( NumberFormatException e )
{
LOGGER.debug( "Cannot parse lastUpdated date: \'{}\'. Ignoring.", value, e );
LOGGER.debug( "Cannot parse last updated date {}, ignoring it", value, e );
return 1;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
Expand Down Expand Up @@ -189,7 +189,8 @@ private Object getLock( File file )
}
catch ( IOException e )
{
LOGGER.warn( "Failed to canonicalize path {}: {}", file, e.getMessage() );
LOGGER.warn( "Failed to canonicalize path {}", file, e );
// TODO This is code smell and deprecated
return file.getAbsolutePath().intern();
}
}
Expand Down
Loading