File tree Expand file tree Collapse file tree 1 file changed +3
-11
lines changed
substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/image Expand file tree Collapse file tree 1 file changed +3
-11
lines changed Original file line number Diff line number Diff line change @@ -905,29 +905,21 @@ enum HeapInclusionReason {
905905 }
906906
907907 final class ObjectReachabilityInfo {
908- private final Object firstReason ;
909- private LinkedHashSet <Object > allReasons ;
908+ private final LinkedHashSet <Object > allReasons ;
910909 private int objectReachabilityGroup ;
911910
912911 ObjectReachabilityInfo (ObjectInfo info , Object firstReason ) {
913- this .firstReason = firstReason ;
914- this .allReasons = null ;
912+ this .allReasons = new LinkedHashSet <>() ;
913+ this .allReasons . add ( firstReason ) ;
915914 this .objectReachabilityGroup = ObjectReachabilityGroup .getFlagForObjectInfo (info , firstReason , objectReachabilityInfo );
916915 }
917916
918917 void addReason (Object additionalReason ) {
919- if (allReasons == null ) {
920- this .allReasons = new LinkedHashSet <>();
921- }
922918 this .allReasons .add (additionalReason );
923919 this .objectReachabilityGroup |= ObjectReachabilityGroup .getByReason (additionalReason , objectReachabilityInfo );
924920 }
925921
926922 Set <Object > getAllReasons () {
927- if (allReasons == null ) {
928- this .allReasons = new LinkedHashSet <>();
929- }
930- this .allReasons .add (firstReason );
931923 return this .allReasons ;
932924 }
933925
You can’t perform that action at this time.
0 commit comments