Skip to content

Commit

Permalink
Removed/merged unused/duplicate code
Browse files Browse the repository at this point in the history
  • Loading branch information
tinwelint committed Nov 14, 2016
1 parent e0f409a commit b0eb9f6
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
5 changes: 2 additions & 3 deletions tools/src/main/java/org/neo4j/tools/dump/DumpLogicalLog.java
Expand Up @@ -300,7 +300,7 @@ public static void main( String args[] ) throws IOException
Args arguments = Args.withFlags( TO_FILE ).parse( args );
TimeZone timeZone = parseTimeZoneConfig( arguments );
Predicate<LogEntry[]> filter = parseFilter( arguments, timeZone );
Function<LogEntry,String> serializer = parseSerializer( arguments, filter, timeZone );
Function<LogEntry,String> serializer = parseSerializer( filter, timeZone );
try ( Printer printer = getPrinter( arguments ) )
{
for ( String fileAsString : arguments.orphans() )
Expand All @@ -312,8 +312,7 @@ public static void main( String args[] ) throws IOException
}

@SuppressWarnings( "unchecked" )
private static Function<LogEntry,String> parseSerializer( Args arguments, Predicate<LogEntry[]> filter,
TimeZone timeZone )
private static Function<LogEntry,String> parseSerializer( Predicate<LogEntry[]> filter, TimeZone timeZone )
{
if ( filter instanceof Function )
{
Expand Down
Expand Up @@ -81,31 +81,31 @@ public void read( Reader reader ) throws IOException
}
else if ( state == 1 )
{
String entityType = entityType( line );
long id = id( line );
if ( entityType != null && id != -1 )
{
propagate( entityType, id );
}
tryPropagate( line );
}
else if ( state == 1 || state == 2 )
else if ( state == 2 )
{
if ( line.startsWith( "Inconsistent with: " ) )
{
line = line.substring( "Inconsistent with: ".length() );
}

String entityType = entityType( line );
long id = id( line );
if ( entityType != null && id != -1 )
{
propagate( entityType, id );
}
tryPropagate( line );
}
state = (state + 1) % 3;
}
}

private void tryPropagate( String line )
{
String entityType = entityType( line );
long id = id( line );
if ( entityType != null && id != -1 )
{
propagate( entityType, id );
}
}

private void propagate( String entityType, long id )
{
switch ( entityType )
Expand Down

0 comments on commit b0eb9f6

Please sign in to comment.