subbudvk commented on code in PR #1022:
URL: https://github.com/apache/opennlp/pull/1022#discussion_r3144767646


##########
opennlp-core/opennlp-ml/opennlp-ml-commons/src/main/java/opennlp/tools/ml/model/AbstractModelReader.java:
##########
@@ -24,11 +24,39 @@
 import java.util.StringTokenizer;
 import java.util.zip.GZIPInputStream;
 
+import opennlp.tools.util.InvalidFormatException;

Review Comment:
   Used IllegalArgumentException



##########
opennlp-core/opennlp-ml/opennlp-ml-commons/src/main/java/opennlp/tools/ml/model/AbstractModelReader.java:
##########
@@ -131,6 +159,10 @@ public AbstractModel getModel() throws IOException {
    */
   protected String[] getOutcomes() throws IOException {
     int numOutcomes = readInt();
+    if (numOutcomes < 0 || numOutcomes > MAX_ENTRIES) {
+      throw new InvalidFormatException(

Review Comment:
   Used IllegalArgumentException



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to