File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed
jbbp/src/main/java/com/igormaznitsa/jbbp Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -313,15 +313,26 @@ public static List<MappedFieldRecord> findAffectedFields(final Object instance)
313313 // make chain of ancestors till java.lang.Object
314314 final List <Class <?>> listOfClassHierarchy = new ArrayList <>();
315315 Class <?> current = instance .getClass ();
316- while (current != java .lang .Object .class ) {
316+ while (current != null ) {
317+ final String packageName = current .getPackage ().getName ();
318+ if (packageName .startsWith ("java." )
319+ || packageName .startsWith ("com.sun." )
320+ || packageName .startsWith ("javax." )
321+ || packageName .startsWith ("android." )
322+ ) {
323+ break ;
324+ }
317325 listOfClassHierarchy .add (current );
318326 current = current .getSuperclass ();
319327 }
320328
321329 for (final Class <?> processingClazz : listOfClassHierarchy ) {
322330 for (Field mappingField : processingClazz .getDeclaredFields ()) {
323331 final int modifiers = mappingField .getModifiers ();
324- if (Modifier .isTransient (modifiers ) || Modifier .isStatic (modifiers ) || Modifier .isFinal (modifiers )) {
332+
333+ if (Modifier .isTransient (modifiers )
334+ || Modifier .isStatic (modifiers )
335+ || Modifier .isFinal (modifiers )) {
325336 continue ;
326337 }
327338
Original file line number Diff line number Diff line change @@ -32,8 +32,7 @@ public static boolean isPotentiallyAccessibleClass(final Class<?> klazz) {
3232
3333 public static boolean isPotentiallyAccessibleField (final Field field ) {
3434 return isPotentiallyAccessibleClass (field .getDeclaringClass ())
35- && Modifier .isPublic (field .getModifiers ())
36- && !Modifier .isFinal (field .getModifiers ());
35+ && Modifier .isPublic (field .getModifiers ());
3736 }
3837
3938 /**
You can’t perform that action at this time.
0 commit comments