Примеры ошибок, обнаруженных с помощью диагностики V6006
V6006. The object was created but it is not being used. The 'throw' keyword could be missing.
Elasticsearch
V6006 The object was created but it is not being used. The 'throw' keyword could be missing. JdbcConnection.java(88)
@Override
public void setAutoCommit(boolean autoCommit) throws SQLException {
checkOpen();
if (!autoCommit) {
new SQLFeatureNotSupportedException(....);
}
}
Ghidra
V6006 The object was created but it is not being used. The 'throw' keyword could be missing: 'new MemoryAccessException("Cyclic Access");'. BitMappedSubMemoryBlock.java(99)
public void putByte(long offsetInMemBlock, byte b)
throws MemoryAccessException, IOException {
long offsetInSubBlock = offsetInMemBlock - subBlockOffset;
try {
if (ioPending) {
new MemoryAccessException("Cyclic Access"); // <=
}
ioPending = true;
doPutByte(mappedAddress.addNoWrap(offsetInSubBlock / 8),
(int) (offsetInSubBlock % 8), b);
}
catch (AddressOverflowException e) {
new MemoryAccessException("No memory at address"); // <=
}
finally {
ioPending = false;
}
}
Similar errors can be found in some other places:
- V6006 The object was created but it is not being used. The 'throw' keyword could be missing: 'new MemoryAccessException("Cyclic Access");'. BitMappedSubMemoryBlock.java(77)
- V6006 The object was created but it is not being used. The 'throw' keyword could be missing: 'new MemoryAccessException("No memory at address");'. BitMappedSubMemoryBlock.java(106)
- V6006 The object was created but it is not being used. The 'throw' keyword could be missing: 'new MemoryAccessException("Cyclic Access");'. BitMappedSubMemoryBlock.java(122)
- And 4 additional diagnostic messages.
Apache Solr
V6006 The object was created but it is not being used. The 'throw' keyword could be missing. ShardSplitTest.java 773
private void doSplitShardWithRule(SolrIndexSplitter.SplitMethod splitMethod)
throws Exception {
....
try {
ZkStateReader.from(cloudClient)
.waitForState(collectionName, 30,
TimeUnit.SECONDS,
SolrCloudTestCase.activeClusterShape(1, 2));
} catch (TimeoutException e) {
new RuntimeException("Timeout waiting for 1shards and 2 replicas.", e);
}
....
}