Skip to content
This repository has been archived by the owner on May 24, 2020. It is now read-only.

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BFergerson committed Jul 4, 2017
1 parent af14621 commit 45043ae
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/java/com/codebrig/jvmmechanic/agent/CacheString.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public static CacheString readFromBuffer(ConfigProperties configProperties, Byte
if (buffer.get() == 1) {
//cached
int cacheIndex = buffer.getInt();
String cacheString = cachedStrings.computeIfAbsent(cacheIndex, i -> (String) configProperties.get("cache_string_" + i));
String cacheString = cachedStrings.computeIfAbsent(
cacheIndex, i -> (String) configProperties.get("cache_string_" + i));
return new CacheString(configProperties, cacheString);
} else {
//raw string
Expand Down Expand Up @@ -51,11 +52,11 @@ public CacheString(ConfigProperties configProperties, String string) {

public void writeToBuffer(ByteBuffer buffer) {
boolean cache = isCachable();
buffer.put((byte)(cache ? 1 : 0));
buffer.put((byte) (cache ? 1 : 0));
if (cache) {
buffer.putInt(cacheIndex);
} else {
buffer.put((byte)(getString() != null ? 1 : 0));
buffer.put((byte) (getString() != null ? 1 : 0));
if (getString() != null) {
byte[] strBytes = getString().getBytes();
buffer.putInt(strBytes.length);
Expand Down

0 comments on commit 45043ae

Please sign in to comment.