the number type casts error (#4788)

Co-authored-by: zhuanghaochao <zhuanghaochao@yy.com>
This commit is contained in:
Daming 2020-05-14 21:13:22 +08:00 committed by GitHub
parent 2dd9a3fd19
commit 544d419fc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 20 additions and 20 deletions

View File

@ -99,7 +99,7 @@ public class AlarmQuery implements IAlarmQueryDAO {
.sorted((a, b) -> Long.compare((long) b.get(1), (long) a.get(1)))
.skip(from)
.forEach(values -> {
final int sid = (int) values.get(4);
final int sid = ((Number) values.get(4)).intValue();
Scope scope = Scope.Finder.valueOf(sid);
AlarmMessage message = new AlarmMessage();

View File

@ -141,7 +141,7 @@ public class LogQuery implements ILogQueryDAO {
data.put(columns.get(i), value);
}
log.setContent((String) data.get(CONTENT));
log.setContentType(ContentType.instanceOf((int) data.get(CONTENT_TYPE)));
log.setContentType(ContentType.instanceOf(((Number) data.get(CONTENT_TYPE)).intValue()));
log.setEndpointId((String) data.get(ENDPOINT_ID));
log.setEndpointName((String) data.get(ENDPOINT_NAME));

View File

@ -134,10 +134,10 @@ public class ProfileTaskQuery implements IProfileTaskQueryDAO {
.endpointName((String) values.get(3))
.startTime(((Number) values.get(4)).longValue())
.createTime(((Number) values.get(5)).longValue())
.duration((int) values.get(6))
.minDurationThreshold((int) values.get(7))
.dumpPeriod((int) values.get(8))
.maxSamplingCount((int) values.get(9))
.duration(((Number) values.get(6)).intValue())
.minDurationThreshold(((Number) values.get(7)).intValue())
.dumpPeriod(((Number) values.get(8)).intValue())
.maxSamplingCount(((Number) values.get(9)).intValue())
.build();
}

View File

@ -98,8 +98,8 @@ public class ProfileThreadSnapshotQuery implements IProfileThreadSnapshotQueryDA
basicTrace.setSegmentId((String) values.get(2));
basicTrace.setStart(String.valueOf(values.get(3)));
basicTrace.getEndpointNames().add((String) values.get(4));
basicTrace.setDuration((int) values.get(5));
basicTrace.setError(BooleanUtils.valueToBoolean((int) values.get(6)));
basicTrace.setDuration(((Number) values.get(5)).intValue());
basicTrace.setError(BooleanUtils.valueToBoolean(((Number) values.get(6)).intValue()));
String traceIds = (String) values.get(7);
basicTrace.getTraceIds().add(traceIds);
@ -148,7 +148,7 @@ public class ProfileThreadSnapshotQuery implements IProfileThreadSnapshotQueryDA
record.setTaskId((String) values.get(1));
record.setSegmentId((String) values.get(2));
record.setDumpTime(((Number) values.get(3)).longValue());
record.setSequence((int) values.get(4));
record.setSequence(((Number) values.get(4)).intValue());
String dataBinaryBase64 = String.valueOf(values.get(5));
if (StringUtil.isNotEmpty(dataBinaryBase64)) {
record.setStackBinary(Base64.getDecoder().decode(dataBinaryBase64));

View File

@ -87,7 +87,7 @@ public class TopNRecordsQuery implements ITopNRecordsQueryDAO {
final List<SelectedRecord> records = new ArrayList<>();
series.getValues().forEach(values -> {
SelectedRecord record = new SelectedRecord();
record.setValue(String.valueOf((long) values.get(1)));
record.setValue(String.valueOf(values.get(1)));
record.setRefId((String) values.get(3));
record.setName((String) values.get(2));
records.add(record);

View File

@ -255,7 +255,7 @@ public class TopologyQuery implements ITopologyQueryDAO {
series.getValues().forEach(values -> {
Call.CallDetail call = new Call.CallDetail();
String entityId = String.valueOf(values.get(1));
int componentId = (int) values.get(2);
int componentId = ((Number) values.get(2)).intValue();
call.buildFromServiceRelation(entityId, componentId, detectPoint);
calls.add(call);
});
@ -285,7 +285,7 @@ public class TopologyQuery implements ITopologyQueryDAO {
series.getValues().forEach(values -> {
Call.CallDetail call = new Call.CallDetail();
String entityId = (String) values.get(1);
int componentId = (int) values.get(2);
int componentId = ((Number) values.get(2)).intValue();
call.buildFromInstanceRelation(entityId, componentId, detectPoint);
calls.add(call);
});

View File

@ -154,10 +154,10 @@ public class TraceQuery implements ITraceQueryDAO {
BasicTrace basicTrace = new BasicTrace();
basicTrace.setSegmentId((String) values.get(2));
basicTrace.setStart(String.valueOf((long) values.get(3)));
basicTrace.setStart(String.valueOf(values.get(3)));
basicTrace.getEndpointNames().add((String) values.get(4));
basicTrace.setDuration((int) values.get(5));
basicTrace.setError(BooleanUtils.valueToBoolean((int) values.get(6)));
basicTrace.setDuration(((Number) values.get(5)).intValue());
basicTrace.setError(BooleanUtils.valueToBoolean(((Number) values.get(6)).intValue()));
basicTrace.getTraceIds().add((String) values.get(7));
traceBrief.getTraces().add(basicTrace);
@ -197,11 +197,11 @@ public class TraceQuery implements ITraceQueryDAO {
segmentRecord.setServiceId((String) values.get(3));
segmentRecord.setServiceInstanceId((String) values.get(4));
segmentRecord.setEndpointName((String) values.get(5));
segmentRecord.setStartTime((long) values.get(6));
segmentRecord.setEndTime((long) values.get(7));
segmentRecord.setLatency((int) values.get(8));
segmentRecord.setIsError((int) values.get(9));
segmentRecord.setVersion((int) values.get(11));
segmentRecord.setStartTime(((Number) values.get(6)).longValue());
segmentRecord.setEndTime(((Number) values.get(7)).longValue());
segmentRecord.setLatency(((Number) values.get(8)).intValue());
segmentRecord.setIsError(((Number) values.get(9)).intValue());
segmentRecord.setVersion(((Number) values.get(11)).intValue());
String base64 = (String) values.get(10);
if (!Strings.isNullOrEmpty(base64)) {