You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by GitBox <gi...@apache.org> on 2023/01/11 11:44:00 UTC

[GitHub] [avro] github-code-scanning[bot] commented on a diff in pull request #2053: AVRO-3704: namae validator interface

github-code-scanning[bot] commented on code in PR #2053:
URL: https://github.com/apache/avro/pull/2053#discussion_r1066895474


##########
lang/java/avro/src/test/java/org/apache/avro/SchemaNameValidatorTest.java:
##########
@@ -0,0 +1,42 @@
+package org.apache.avro;
+
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.util.stream.Stream;
+
+class SchemaNameValidatorTest {

Review Comment:
   ## Unused classes and interfaces
   
   Unused class: SchemaNameValidatorTest is not referenced within this codebase. If not used as an external API it should be removed.
   
   [Show more details](https://github.com/apache/avro/security/code-scanning/2964)



##########
lang/java/avro/src/main/java/org/apache/avro/Schema.java:
##########
@@ -1724,7 +1712,7 @@
           if (defaultValue != null
               && (Type.FLOAT.equals(fieldSchema.getType()) || Type.DOUBLE.equals(fieldSchema.getType()))
               && defaultValue.isTextual())
-            defaultValue = new DoubleNode(Double.valueOf(defaultValue.textValue()));
+            defaultValue = new DoubleNode(Double.parseDouble(defaultValue.textValue()));

Review Comment:
   ## Missing catch of NumberFormatException
   
   Potential uncaught 'java.lang.NumberFormatException'.
   
   [Show more details](https://github.com/apache/avro/security/code-scanning/2965)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@avro.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org