Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public interface SearchResponseHandler
* @param server Server that replied to a search request
* @param version Server version
* @param guid Globally unique ID of the server
* @param tcp Does server require TLS?
* @param tls Does server require TLS?
*/
void handleSearchResponse(int channel_id, InetSocketAddress server, int version, Guid guid, boolean tls);
}
Expand Down Expand Up @@ -250,15 +250,15 @@ private boolean handleBeacon(final InetSocketAddress from, final byte version,
else
server = new InetSocketAddress(addr, port);

final String protocol = PVAString.decodeString(buffer);
if (! "tcp".equals(protocol))
{
logger.log(Level.WARNING, "PVA Server " + from + " sent beacon for protocol '" + protocol + "'");
return false;
}

try
{
final String protocol = PVAString.decodeString(buffer);
if (! "tcp".equals(protocol))
{
logger.log(Level.WARNING, "PVA Server " + from + " sent beacon for protocol '" + protocol + "'");
return false;
}

// Decode optional server status (likely null)
final PVATypeRegistry types = new PVATypeRegistry();
final PVAData server_status = types.decodeType("", buffer);
Expand Down
11 changes: 11 additions & 0 deletions core/pva/src/main/java/org/epics/pva/common/PVAHeader.java
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@

// Application messages are followed by this number of data bytes
final int payload = buffer.getInt(PVAHeader.HEADER_OFFSET_PAYLOAD_SIZE);
// Java implementation for now does not handle large 'unsigned' sizes,
// limited to the positive range of a signed int.
// Could use `Integer.toUnsignedLong(payload)`, but JDK API
// like buffer buffer.remaining() or buffer.get(10) is using int,
// so us updating to long would be of limited use
if (payload < 0)
throw new Exception("Payload size " + payload +

Check warning on line 222 in core/pva/src/main/java/org/epics/pva/common/PVAHeader.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZZfHEaWdj6QFA9f&open=AZ_x3ZZfHEaWdj6QFA9f&pullRequest=3878
" exceeds max signed integer " + Integer.toHexString(Integer.MAX_VALUE));
// Could check against a PVA variant of EPICS_CA_MAX_ARRAY_BYTES,
// but PVA design specifically aims to use all available memory
// without self-enforced limitations (confirmed in 2026-07-10 EPICS code telecon)

// Total message size: Header followed by data
return PVAHeader.HEADER_SIZE + payload;
Expand Down
54 changes: 35 additions & 19 deletions core/pva/src/main/java/org/epics/pva/common/SearchRequest.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
}
catch (Exception ex)
{
logger.log(Level.WARNING, "PVA Client " + from + " sent search #" + search.seq + " with invalid address");

Check failure on line 154 in core/pva/src/main/java/org/epics/pva/common/SearchRequest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal "PVA Client " 6 times.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZZJHEaWdj6QFA9e&open=AZ_x3ZZJHEaWdj6QFA9e&pullRequest=3878

Check failure on line 154 in core/pva/src/main/java/org/epics/pva/common/SearchRequest.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Define a constant instead of duplicating this literal " sent search #" 5 times.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZZJHEaWdj6QFA9d&open=AZ_x3ZZJHEaWdj6QFA9d&pullRequest=3878
return null;
}
int port = Short.toUnsignedInt(buffer.getShort());
Expand All @@ -173,15 +173,23 @@
boolean tcp = search.tls = false;
int count = Byte.toUnsignedInt(buffer.get());
String unknown_protocol = "<none>";
for (int i=0; i<count; ++i)
try
{
final String protocol = PVAString.decodeString(buffer);
if ("tls".equals(protocol))
search.tls = true;
else if ("tcp".equals(protocol))
tcp = true;
else
unknown_protocol = protocol;
for (int i=0; i<count; ++i)
{
final String protocol = PVAString.decodeString(buffer);
if ("tls".equals(protocol))
search.tls = true;
else if ("tcp".equals(protocol))
tcp = true;
else
unknown_protocol = protocol;
}
}
catch (Exception ex)
{
logger.log(Level.WARNING, ex, () -> "PVA Client " + from + " sent search #" + search.seq + " with invalid protocol");
return null;
}

// Loop over searched channels
Expand All @@ -200,18 +208,26 @@
return null;
}
search.channels = new ArrayList<>(count);
for (int i=0; i<count; ++i)
try
{
final int cid = buffer.getInt();
final String name = PVAString.decodeString(buffer);
logger.log(Level.FINER, () -> "PVA Client " + from + " sent search #" + search.seq + " for " + name + " [cid " + cid + "]"
+ ", reply addr " + orig_response_addr
+ (orig_response_addr.equals(search.client) ? "" : ", using " + search.client)
+ (search.tls ? " (TLS)" : "")
+ (search.unicast ? " (unicast)" : "")
+ (search.reply_required ? " (reply required)" : "")
+ (search.reply_to_src_port ? (origin == null ? " (reply to source port)" : " (reply to source port ignored because of origin tag)") : ""));
search.channels.add(new Channel(cid, name));
for (int i=0; i<count; ++i)
{
final int cid = buffer.getInt();
final String name = PVAString.decodeString(buffer);
logger.log(Level.FINER, () -> "PVA Client " + from + " sent search #" + search.seq + " for " + name + " [cid " + cid + "]"
+ ", reply addr " + orig_response_addr
+ (orig_response_addr.equals(search.client) ? "" : ", using " + search.client)
+ (search.tls ? " (TLS)" : "")
+ (search.unicast ? " (unicast)" : "")
+ (search.reply_required ? " (reply required)" : "")
+ (search.reply_to_src_port ? (origin == null ? " (reply to source port)" : " (reply to source port ignored because of origin tag)") : ""));
search.channels.add(new Channel(cid, name));
}
}
catch (Exception ex)
{
logger.log(Level.WARNING, ex, () -> "PVA Client " + from + " sent damaged search #" + search.seq);
return null;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
result.found = PVABool.decodeBoolean(buffer);

final int count = Short.toUnsignedInt(buffer.getShort());
if (count*Integer.BYTES > buffer.remaining())
throw new Exception("PVA Server sent search reply #" + result.seq + " for " + count + " CIDs " +

Check warning on line 101 in core/pva/src/main/java/org/epics/pva/common/SearchResponse.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZYsHEaWdj6QFA9c&open=AZ_x3ZYsHEaWdj6QFA9c&pullRequest=3878

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have a unit test that checks this exception is raised.

" with only " + buffer.remaining() + " bytes in buffer");
result.cid = new int[count];
for (int i=0; i<count; ++i)
result.cid[i] = buffer.getInt();
Expand Down
3 changes: 3 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVAAnyArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@
public void decode(PVATypeRegistry types, ByteBuffer buffer) throws Exception {

final int count = PVASize.decodeSize(buffer);
// Each array element needs at least the 'non_null' byte
if (count < 0 || count > buffer.remaining())
throw new Exception("Array size " + count + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 133 in core/pva/src/main/java/org/epics/pva/data/PVAAnyArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZVHHEaWdj6QFA9R&open=AZ_x3ZVHHEaWdj6QFA9R&pullRequest=3878
// Try to re-use elements
PVAny[] new_elements = elements;
if (new_elements == null || new_elements.length != count)
Expand Down
5 changes: 4 additions & 1 deletion core/pva/src/main/java/org/epics/pva/data/PVABitSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@

/** @param buffer Source buffer
* @return Decoded bits
* @throws Exception on error
*/
public static BitSet decodeBitSet(final ByteBuffer buffer)
public static BitSet decodeBitSet(final ByteBuffer buffer) throws Exception

Check warning on line 32 in core/pva/src/main/java/org/epics/pva/data/PVABitSet.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZV2HEaWdj6QFA9U&open=AZ_x3ZV2HEaWdj6QFA9U&pullRequest=3878
{
final int size = PVASize.decodeSize(buffer);
if (size < 0 || size > buffer.remaining())
throw new Exception("Bitset size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 36 in core/pva/src/main/java/org/epics/pva/data/PVABitSet.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZV2HEaWdj6QFA9T&open=AZ_x3ZV2HEaWdj6QFA9T&pullRequest=3878
final byte[] bytes = new byte[size];
buffer.get(bytes);
return BitSet.valueOf(bytes);
Expand Down
2 changes: 2 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVABoolArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int size = PVASize.decodeSize(buffer);
if (size < 0 || size > buffer.remaining())
throw new Exception("Array size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 99 in core/pva/src/main/java/org/epics/pva/data/PVABoolArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZT7HEaWdj6QFA9P&open=AZ_x3ZT7HEaWdj6QFA9P&pullRequest=3878
final boolean[] new_value = new boolean[size];
for (int i=0; i<size; ++i)
new_value[i] = buffer.get() != 0;
Expand Down
2 changes: 2 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVAByteArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,8 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int size = PVASize.decodeSize(buffer);
if (size < 0 || size > buffer.remaining())
throw new Exception("Array size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 118 in core/pva/src/main/java/org/epics/pva/data/PVAByteArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZXnHEaWdj6QFA9Z&open=AZ_x3ZXnHEaWdj6QFA9Z&pullRequest=3878

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not throw this inside PVASize.decodeSize? Then you don't need to update every single type.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decoding the size doesn't fail. It parses the size just fine.
The calling code then checks if that size is possible within the context. If not, it throws an exception because we're stuck in a situation with no good way out other than give up and move on with the next message at a higher level. The exception text gives some potential hint to experts, showing if this is about an array size or structure size or string size or ...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, then a tiny method

checkRemainingSize(min, max, remaining)

So that the code isn't repeated and you don't repeat yourself unnecessarily.

final byte[] new_value = new byte[size];
buffer.get(new_value);
value = new_value;
Expand Down
2 changes: 2 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVADoubleArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int size = PVASize.decodeSize(buffer);
if (size < 0 || size*Double.BYTES > buffer.remaining())
throw new Exception("Array size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 102 in core/pva/src/main/java/org/epics/pva/data/PVADoubleArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZVhHEaWdj6QFA9S&open=AZ_x3ZVhHEaWdj6QFA9S&pullRequest=3878
final double[] new_value = new double[size];
for (int i=0; i<size; ++i)
new_value[i] = buffer.getDouble();
Expand Down
2 changes: 2 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVAFloatArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int size = PVASize.decodeSize(buffer);
if (size < 0 || size*Float.BYTES > buffer.remaining())
throw new Exception("Array size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 103 in core/pva/src/main/java/org/epics/pva/data/PVAFloatArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZX9HEaWdj6QFA9a&open=AZ_x3ZX9HEaWdj6QFA9a&pullRequest=3878
final float[] new_value = new float[size];
for (int i=0; i<size; ++i)
new_value[i] = buffer.getFloat();
Expand Down
2 changes: 2 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVAIntArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int size = PVASize.decodeSize(buffer);
if (size < 0 || size*Integer.BYTES > buffer.remaining())
throw new Exception("Array size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 115 in core/pva/src/main/java/org/epics/pva/data/PVAIntArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZTgHEaWdj6QFA9O&open=AZ_x3ZTgHEaWdj6QFA9O&pullRequest=3878
final int[] new_value = new int[size];
for (int i=0; i<size; ++i)
new_value[i] = buffer.getInt();
Expand Down
2 changes: 2 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVALongArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int size = PVASize.decodeSize(buffer);
if (size < 0 || size*Long.BYTES > buffer.remaining())
throw new Exception("Array size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 115 in core/pva/src/main/java/org/epics/pva/data/PVALongArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZUtHEaWdj6QFA9Q&open=AZ_x3ZUtHEaWdj6QFA9Q&pullRequest=3878
final long[] new_value = new long[size];
for (int i=0; i<size; ++i)
new_value[i] = buffer.getLong();
Expand Down
2 changes: 2 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVAShortArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int size = PVASize.decodeSize(buffer);
if (size < 0 || size*Short.BYTES > buffer.remaining())
throw new Exception("Array size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 115 in core/pva/src/main/java/org/epics/pva/data/PVAShortArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZYUHEaWdj6QFA9b&open=AZ_x3ZYUHEaWdj6QFA9b&pullRequest=3878
// Try to re-use existing array
final short[] new_value = new short[size];
// Considered using
Expand Down
3 changes: 3 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVASize.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ else if (size < 254)
*/
public static final int decodeSize(final ByteBuffer buffer)
{
// XXXX Update to long, using Integer.toUnsignedLong(..)?
// JDK api like buffer.remaining() is limited to int,
// so this would have limited effect...
byte b = buffer.get();
if (b == -1)
return -1;
Expand Down
3 changes: 2 additions & 1 deletion core/pva/src/main/java/org/epics/pva/data/PVAStatus.java
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ public void encode(final ByteBuffer buffer)

/** @param buffer Source buffer
* @return Decoded status
* @throws Exception on error
*/
public static PVAStatus decode(final ByteBuffer buffer)
public static PVAStatus decode(final ByteBuffer buffer) throws Exception
{
final byte b = buffer.get();
if (b == -1)
Expand Down
6 changes: 5 additions & 1 deletion core/pva/src/main/java/org/epics/pva/data/PVAString.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@

/** @param buffer Buffer from which to decode string
* @return Decoded string
* @throws Exception on error
*/
public static String decodeString(final ByteBuffer buffer)
public static String decodeString(final ByteBuffer buffer) throws Exception

Check warning on line 54 in core/pva/src/main/java/org/epics/pva/data/PVAString.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZWNHEaWdj6QFA9W&open=AZ_x3ZWNHEaWdj6QFA9W&pullRequest=3878
{
final int size = PVASize.decodeSize(buffer);
if (size >= 0)
{
if (size > buffer.remaining())
throw new Exception("PVAString size " + size +

Check warning on line 60 in core/pva/src/main/java/org/epics/pva/data/PVAString.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZWNHEaWdj6QFA9V&open=AZ_x3ZWNHEaWdj6QFA9V&pullRequest=3878
" exceeds remaining buffer size " + buffer.remaining());
byte[] bytes = new byte[size];
buffer.get(bytes);
return new String(bytes);
Expand Down
3 changes: 3 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVAStringArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int size = PVASize.decodeSize(buffer);
// Each array element needs to contain at least a byte for the string size
if (size < 0 || size > buffer.remaining())
throw new Exception("Array size " + size + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 94 in core/pva/src/main/java/org/epics/pva/data/PVAStringArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZXGHEaWdj6QFA9Y&open=AZ_x3ZXGHEaWdj6QFA9Y&pullRequest=3878
String[] new_value = value;
if (new_value == null || new_value.length != size)
new_value = new String[size];
Expand Down
4 changes: 4 additions & 0 deletions core/pva/src/main/java/org/epics/pva/data/PVAStructure.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@
// number of elements
final int size = PVASize.decodeSize(buffer);

// Each element needs name (at least byte for length) and value (at least byte)
if (size < 0 || size*2 > buffer.remaining())
throw new Exception("Structure with " + size + " elements but only " + buffer.remaining() + " bytes in buffer");

Check warning on line 60 in core/pva/src/main/java/org/epics/pva/data/PVAStructure.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZN4HEaWdj6QFA9N&open=AZ_x3ZN4HEaWdj6QFA9N&pullRequest=3878

// (name, FieldDesc)[]
final List<PVAData> values = new ArrayList<>(size);
for (int i=0; i<size; ++i)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@
public void decode(final PVATypeRegistry types, final ByteBuffer buffer) throws Exception
{
final int count = PVASize.decodeSize(buffer);

// Each element needs at least the 'non null' info byte
if (count < 0 || count > buffer.remaining())
throw new Exception("Structure element count " + count + " with only " + buffer.remaining() + " bytes in buffer");

Check warning on line 164 in core/pva/src/main/java/org/epics/pva/data/PVAStructureArray.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Replace generic exceptions with specific library exceptions or a custom exception.

See more on https://sonarcloud.io/project/issues?id=ControlSystemStudio_phoebus&issues=AZ_x3ZWnHEaWdj6QFA9X&open=AZ_x3ZWnHEaWdj6QFA9X&pullRequest=3878

// Try to re-use elements
PVAStructure[] new_elements = elements;
if (new_elements == null || new_elements.length != count)
Expand Down
2 changes: 1 addition & 1 deletion core/pva/src/test/java/org/epics/pva/data/BitSetTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
public class BitSetTest
{
@Test
public void testBitSet()
public void testBitSet() throws Exception
{
final ByteBuffer buffer = ByteBuffer.allocate(100);
BitSet bits = new BitSet();
Expand Down
Loading