Bug Type (问题类型)
others (please edit later)
Before submit
Environment (环境信息)
- SonarQube block issue [java:S2095]
Connections, streams, files, and other classes that implement the Closeable interface or its super-interface, AutoCloseable, needs to be closed after use. Further, that close call must be made in a finally block otherwise an exception could keep the call from being made. Preferably, when class implements AutoCloseable, resource should be created using "try-with-resources" pattern and will be closed automatically.
Failure to properly close resources will result in a resource leak which could bring first the application and then perhaps the box the application is on to their knees.
Expected & Actual behavior (期望与实际表现)
// Multiple steps, construct first step to iterator
Iterator<Edge> edges = this.edgesOfVertexWithCount(source, firstStep);
// Wrap steps to Iterator except last step
for (int i = 1; i < stepNum - 1; i++) {
EdgeStep currentStep = steps.get(i);
edges = new FlatMapperIterator<>(edges, (edge) -> {
Id target = ((HugeEdge) edge).id().otherVertexId();
return this.edgesOfVertexWithCount(target, currentStep);
});
}
close FlatMapperIterator after usage
Vertex/Edge example (问题点 / 边数据举例)
No response
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
No response
Bug Type (问题类型)
others (please edit later)
Before submit
Environment (环境信息)
Connections, streams, files, and other classes that implement the Closeable interface or its super-interface, AutoCloseable, needs to be closed after use. Further, that close call must be made in a finally block otherwise an exception could keep the call from being made. Preferably, when class implements AutoCloseable, resource should be created using "try-with-resources" pattern and will be closed automatically.
Failure to properly close resources will result in a resource leak which could bring first the application and then perhaps the box the application is on to their knees.
Expected & Actual behavior (期望与实际表现)
close FlatMapperIterator after usage
Vertex/Edge example (问题点 / 边数据举例)
No response
Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)
No response