Skip to content

Commit

Permalink
Various small code cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaDemianenko committed Jul 26, 2018
1 parent 75f6f42 commit 9bfce59
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
Expand Up @@ -28,7 +28,6 @@ abstract class DefaultRelationshipCursor<STORECURSOR extends StorageRelationship
{
private boolean hasChanges;
private boolean checkHasChanges;
private PropertyCursor propertyCursor;
final DefaultCursors pool;
Read read;

Expand Down
Expand Up @@ -50,11 +50,11 @@ void ping() throws IOException

StringBuilder uri = new StringBuilder( "http://" + address + "/" + "?" );

for ( String key : usageDataMap.keySet() )
for ( Map.Entry<String,String> entry : usageDataMap.entrySet() )
{
uri.append( key );
uri.append( entry.getKey() );
uri.append( "=" );
uri.append( URLEncoder.encode( usageDataMap.get( key ), StandardCharsets.UTF_8.name() ) );
uri.append( URLEncoder.encode( entry.getValue(), StandardCharsets.UTF_8.name() ) );
uri.append( "+" );
}

Expand Down
Expand Up @@ -57,7 +57,7 @@ public static AnyValue loadVariable( ExecutionContext ctx, String name )
{
if ( !ctx.contains( name ) )
{
throw new NotFoundException( String.format( "Unknown variable `%s`." ) );
throw new NotFoundException( String.format( "Unknown variable `%s`.", name ) );
}
return ctx.apply( name );
}
Expand Down
Expand Up @@ -109,10 +109,10 @@ else if ( resourceType.typeId() != other.resourceType.typeId() )
public int compareTo( LockUnit o )
{
// Exclusive locks go first to minimize amount of potential deadlocks
int exclusiveCompare = Boolean.compare( exclusive, o.exclusive );
int exclusiveCompare = Boolean.compare( o.exclusive, exclusive );
if ( exclusiveCompare != 0 )
{
return -exclusiveCompare;
return exclusiveCompare;
}

// Then shared/exclusive locks are compared by resourceTypeId and then by resourceId
Expand Down

0 comments on commit 9bfce59

Please sign in to comment.