Skip to content

Commit

Permalink
pinpoint-apm#1838 Buffer API enhancement
Browse files Browse the repository at this point in the history
 - cleanup deprecated api
  • Loading branch information
emeroad committed Jun 10, 2016
1 parent 6d45b16 commit f8cb1f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -513,18 +513,18 @@ public int readValue(byte[] bytes, int offset) {

// FIXME (2015.03) Legacy - applicationServiceType added in v1.1.0
// Defaults to span's service type for older versions where applicationServiceType does not exist.
if (buffer.limit() > 0) {
if (buffer.hasRemaining()) {
final boolean hasApplicationServiceType = buffer.readBoolean();
if (hasApplicationServiceType) {
this.applicationServiceType = buffer.readShort();
}
}

if (buffer.limit() > 0) {
if (buffer.hasRemaining()) {
this.loggingTransactionInfo = buffer.readByte();
}

if (buffer.limit() > 0) {
if (buffer.hasRemaining()) {
this.acceptorHost = buffer.readPrefixedString();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private AgentInfoBo.Builder createBuilderFromValue(byte[] serializedAgentInfo) {
builder.setEndTimeStamp(buffer.readLong());
builder.setEndStatus(buffer.readInt());
// FIXME - 2015.09 v1.5.0 added vmVersion (check for compatibility)
if (buffer.limit() > 0) {
if (buffer.hasRemaining()) {
builder.setVmVersion(buffer.readPrefixedString());
}
return builder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public List<ApiMetaDataBo> mapRow(Result result, int rowNum) throws Exception {
String apiInfo = buffer.readPrefixedString();
int lineNumber = buffer.readInt();
int type = 0;
if (buffer.limit() > 0) {
if (buffer.hasRemaining()) {
type = buffer.readInt();
}
apiMetaDataBo.setApiInfo(apiInfo);
Expand Down

0 comments on commit f8cb1f4

Please sign in to comment.