Skip to content

Commit

Permalink
Merge pull request #6366 from spacecowboy/3.0-findbugsannotations
Browse files Browse the repository at this point in the history
 Turn on findbugs and add annotation support
  • Loading branch information
Max Sumrall committed Feb 12, 2016
2 parents f565c9d + dd77f78 commit 66d1ea9
Show file tree
Hide file tree
Showing 118 changed files with 20,682 additions and 253 deletions.
510 changes: 510 additions & 0 deletions community/bolt/LICENSES.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions community/bolt/NOTICE.txt
Expand Up @@ -28,6 +28,7 @@ Third-party licenses
Apache Software License, Version 2.0
Apache Commons Lang
ConcurrentLinkedHashMap
FindBugs-jsr305
Lucene Common Analyzers
Lucene Core
Lucene Memory
Expand All @@ -48,3 +49,6 @@ Bouncy Castle License
Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs
Bouncy Castle Provider

GNU Lesser General Public License, Version 2.1
FindBugs-Annotations

717 changes: 717 additions & 0 deletions community/collections/LICENSES.txt

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions community/collections/NOTICE.txt
Expand Up @@ -25,3 +25,9 @@ Full license texts are found in LICENSES.txt.
Third-party licenses
--------------------

Apache Software License, Version 2.0
FindBugs-jsr305

GNU Lesser General Public License, Version 2.1
FindBugs-Annotations

510 changes: 510 additions & 0 deletions community/consistency-check-legacy/LICENSES.txt

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions community/consistency-check-legacy/NOTICE.txt
Expand Up @@ -27,8 +27,12 @@ Third-party licenses

Apache Software License, Version 2.0
Apache Commons Lang
FindBugs-jsr305
Lucene Common Analyzers
Lucene Core
Lucene Memory
Lucene QueryParsers

GNU Lesser General Public License, Version 2.1
FindBugs-Annotations

Expand Up @@ -22,6 +22,7 @@
import java.io.PrintWriter;
import java.util.function.Consumer;
import java.util.function.Supplier;
import javax.annotation.Nonnull;

import org.neo4j.function.Suppliers;
import org.neo4j.logging.AbstractLog;
Expand Down Expand Up @@ -57,32 +58,36 @@ public boolean isDebugEnabled()
return false;
}

@Nonnull
@Override
public Logger debugLogger()
{
return NullLogger.getInstance();
}

@Nonnull
@Override
public Logger infoLogger()
{
return infoLogger;
}

@Nonnull
@Override
public Logger warnLogger()
{
return warnLogger;
}

@Nonnull
@Override
public Logger errorLogger()
{
return errorLogger;
}

@Override
public void bulk( Consumer<Log> consumer )
public void bulk( @Nonnull Consumer<Log> consumer )
{
PrintWriter writer;
synchronized (this)
Expand Down
Expand Up @@ -21,6 +21,7 @@

import java.io.PrintWriter;
import java.util.function.Supplier;
import javax.annotation.Nonnull;

import org.neo4j.function.Suppliers;
import org.neo4j.logging.AbstractPrintWriterLogger;
Expand All @@ -30,14 +31,15 @@ public class ConsistencyReportLogger extends AbstractPrintWriterLogger
{
private final String prefix;

public ConsistencyReportLogger( Supplier<PrintWriter> writerSupplier, Object lock, String prefix, boolean autoFlush )
public ConsistencyReportLogger( @Nonnull Supplier<PrintWriter> writerSupplier, @Nonnull Object lock,
@Nonnull String prefix, boolean autoFlush )
{
super( writerSupplier, lock, autoFlush );
this.prefix = prefix;
}

@Override
protected void writeLog( PrintWriter out, String message )
protected void writeLog( @Nonnull PrintWriter out, @Nonnull String message )
{
out.write( prefix );
out.write( ": " );
Expand All @@ -46,7 +48,7 @@ protected void writeLog( PrintWriter out, String message )
}

@Override
protected void writeLog( PrintWriter out, String message, Throwable throwable )
protected void writeLog( @Nonnull PrintWriter out, @Nonnull String message, @Nonnull Throwable throwable )
{
out.write( prefix );
out.write( ": " );
Expand All @@ -58,7 +60,7 @@ protected void writeLog( PrintWriter out, String message, Throwable throwable )
}

@Override
protected Logger getBulkLogger( PrintWriter out, Object lock )
protected Logger getBulkLogger( @Nonnull PrintWriter out, @Nonnull Object lock )
{
return new ConsistencyReportLogger( Suppliers.singleton( out ), lock, prefix, false );
}
Expand Down

0 comments on commit 66d1ea9

Please sign in to comment.