@@ -505,13 +505,16 @@ public CompletableFuture<PlcBrowseResponse> browseWithInterceptor(PlcBrowseReque
505505 options .put ("size-in-bytes" , new PlcUDINT (symbol .getSize ()));
506506
507507 if (plc4xPlcValueType == org .apache .plc4x .java .api .types .PlcValueType .List ) {
508- List <ArrayInfo > arrayInfo = new ArrayList <>();
508+ List <ArrayInfo > arrayInfo = new ArrayList <>(dataType .getArrayInfo ().size ());
509+ List <PlcBrowseItemArrayInfo > itemArrayInfo = new ArrayList <>(dataType .getArrayInfo ().size ());
509510 for (AdsDataTypeArrayInfo adsDataTypeArrayInfo : dataType .getArrayInfo ()) {
510511 arrayInfo .add (new DefaultArrayInfo (
511512 (int ) adsDataTypeArrayInfo .getLowerBound (), (int ) adsDataTypeArrayInfo .getUpperBound ()));
513+ itemArrayInfo .add (new DefaultPlcBrowseItemArrayInfo (
514+ adsDataTypeArrayInfo .getLowerBound (), adsDataTypeArrayInfo .getUpperBound ()));
512515 }
513516 DefaultListPlcBrowseItem item = new DefaultListPlcBrowseItem (new SymbolicAdsTag (symbol .getName (), plc4xPlcValueType , arrayInfo ), itemName ,
514- true , !symbol .getFlagReadOnly (), true , childMap , options );
517+ true , !symbol .getFlagReadOnly (), true , childMap , options , itemArrayInfo );
515518
516519 // Check if this item should be added to the result
517520 if (interceptor .intercept (item )) {
@@ -571,17 +574,23 @@ protected List<PlcBrowseItem> getBrowseItems(String basePath, long baseGroupId,
571574 options .put ("size-in-bytes" , new PlcUDINT (childDataType .getSize ()));
572575
573576 if (plc4xPlcValueType == org .apache .plc4x .java .api .types .PlcValueType .List ) {
574- List <ArrayInfo > arrayInfo = new ArrayList <>();
577+ List <ArrayInfo > arrayInfo = new ArrayList <>(childDataType .getArrayInfo ().size ());
578+ List <PlcBrowseItemArrayInfo > itemArrayInfo = new ArrayList <>(childDataType .getArrayInfo ().size ());
575579 for (AdsDataTypeArrayInfo adsDataTypeArrayInfo : childDataType .getArrayInfo ()) {
576580 arrayInfo .add (new DefaultArrayInfo (
577581 (int ) adsDataTypeArrayInfo .getLowerBound (), (int ) adsDataTypeArrayInfo .getUpperBound ()));
582+ itemArrayInfo .add (new DefaultPlcBrowseItemArrayInfo (
583+ adsDataTypeArrayInfo .getLowerBound (), adsDataTypeArrayInfo .getUpperBound ()));
578584 }
579585 // Add the type itself.
580- values .add (new DefaultListPlcBrowseItem (new SymbolicAdsTag (basePath + "." + child .getPropertyName (), plc4xPlcValueType , arrayInfo ), itemName ,
581- true , parentWritable , true , childMap , options ));
586+ values .add (new DefaultListPlcBrowseItem (new SymbolicAdsTag (
587+ basePath + "." + child .getPropertyName (), plc4xPlcValueType , arrayInfo ), itemName ,
588+ true , parentWritable , true , childMap , options , itemArrayInfo ));
582589 } else {
583590 // Add the type itself.
584- values .add (new DefaultPlcBrowseItem (new SymbolicAdsTag (basePath + "." + child .getPropertyName (), plc4xPlcValueType , Collections .emptyList ()), itemName ,
591+ values .add (new DefaultPlcBrowseItem (new SymbolicAdsTag (
592+ basePath + "." + child .getPropertyName (), plc4xPlcValueType ,
593+ Collections .emptyList ()), itemName ,
585594 true , parentWritable , true , childMap , options ));
586595 }
587596 }
0 commit comments