From 1a0418fe6841575c81d6118777f1b3d7508f49ff Mon Sep 17 00:00:00 2001 From: Chuck Ritola Date: Tue, 16 Apr 2024 21:35:49 -0400 Subject: [PATCH] =?UTF-8?q?=E2=9C=94NPE=20when=20invoking=20getReadTally()?= =?UTF-8?q?=20on=20InputStream=20while=20writing.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/org/jtrfp/jfdt/Parser.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jtrfp/jfdt/Parser.java b/src/main/java/org/jtrfp/jfdt/Parser.java index d8fad77..6d86ad1 100644 --- a/src/main/java/org/jtrfp/jfdt/Parser.java +++ b/src/main/java/org/jtrfp/jfdt/Parser.java @@ -36,6 +36,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.List; +import java.util.Objects; import java.util.Stack; @@ -799,8 +800,7 @@ public PROPERTY_CLASS get(ThirdPartyParseable bean) Class indexingClass=null; try{indexingClass=Parser.this.getPropertyReturnType(bean, propertyName);} catch(NoSuchMethodException e){ - final long readTally = is.getReadTally(); - throw new RuntimeException("Occurred at byte "+readTally+" (0x"+Long.toHexString(readTally).toUpperCase()+")",e);} + throw new RuntimeException(e);} if(List.class.isAssignableFrom(indexingClass)) {@SuppressWarnings("unchecked") List list = (List)Parser.this.get(bean, propertyName,indexingClass); @@ -1258,8 +1258,7 @@ public void write(EndianAwareDataOutputStream os, Class indexingClass=null; try{indexingClass=Parser.this.getPropertyReturnType(bean, arrayOrListPropertyName);} catch(NoSuchMethodException e){ - final long readTally = is.getReadTally(); - throw new RuntimeException("Occurred at byte "+readTally+" (0x"+Long.toHexString(readTally).toUpperCase()+")",e); + throw new RuntimeException(e); } if(List.class.isAssignableFrom(indexingClass))