Buggy code:
public class PropertyTotals extends AadlProcessingSwitchWithProgress { private double WeightSum = 0.0 ; private AbstractAaxlAction action ; public PropertyTotals ( final IProgressMonitor monitor , AbstractAaxlAction action ) { } protected final void initSwitches ( ) { } public final double calcWeight ( ComponentInstance ci ) { } private double doCalcWeight ( ComponentInstance ci , boolean needWeight , String indent ) { double net = GetProperties . getNetWeight ( ci , 0.0 ) ; double weight = 0.0 ; double gross = GetProperties . getGrossWeight ( ci , 0.0 ) ; double sublimit = 0.0 ; reportWeight ( getPrintName ( ci ) , ci . getCategory ( ) . getName ( ) , ( net > 0.0 ? net : gross ) , ( net > 0.0 ) ) ; EList < ComponentInstance > cil = ci . getComponentInstances ( ) ; for ( ComponentInstance subi : cil ) { ComponentCategory subcat = subi . getCategory ( ) ; if ( ! ( ( ( subcat . equals ( PROCESS ) ) || ( subcat . equals ( VIRTUAL_BUS ) ) ) || ( subcat . equals ( VIRTUAL_PROCESSOR ) ) ) ) { double subweight = doCalcWeight ( subi , ( needWeight && ( ( gross == 0.0 ) || ( net > 0.0 ) ) ) , ( indent + "<seq2seq4repair_space>" ) ) ; weight += subweight ; sublimit += GetProperties . getWeightLimit ( subi , 0.0 ) ; } } EList < ConnectionInstance > connl = ci . getConnectionInstances ( ) ; for ( ConnectionInstance connectionInstance : connl ) { double netconn = GetProperties . getNetWeight ( connectionInstance , 0.0 ) ; double grossconn = GetProperties . getGrossWeight ( connectionInstance , 0.0 ) ; weight += ( netconn > 0 ) ? netconn : grossconn ; reportWeight ( connectionInstance . getName ( ) , "Connection<seq2seq4repair_space>" , ( netconn > 0 ? netconn : grossconn ) , ( netconn > 0 ) ) ; if ( ( netconn > 0 ) || ( grossconn > 0 ) ) { String ResultMsg = String . format ( ( ( connectionInstance . getName ( ) ) + ":<seq2seq4repair_space>Weight<seq2seq4repair_space>of<seq2seq4repair_space>access<seq2seq4repair_space>connection<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg" ) , ( netconn > 0 ? netconn : grossconn ) ) ; reportinfo ( connectionInstance , ResultMsg ) ; } sublimit += GetProperties . getWeightLimit ( connectionInstance , 0.0 ) ; } if ( ( weight == 0.0 ) && ( cil . isEmpty ( ) ) ) { if ( ( gross == 0 ) && ( net > 0 ) ) { weight = net ; } else { weight = gross ; } } else { weight += net ; } if ( gross > 0.0 ) { if ( weight > gross ) { reportwarning ( ci , String . format ( "[G]<seq2seq4repair_space>Sum<seq2seq4repair_space>of<seq2seq4repair_space>weights<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg<seq2seq4repair_space>exceeds<seq2seq4repair_space>grossweight<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg" , weight , gross ) ) ; } else if ( ( weight > 0 ) && ( weight < gross ) ) { reportwarning ( ci , String . format ( "[G]<seq2seq4repair_space>Sum<seq2seq4repair_space>of<seq2seq4repair_space>weights<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg<seq2seq4repair_space>less<seq2seq4repair_space>than<seq2seq4repair_space>grossweight<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg<seq2seq4repair_space>(using<seq2seq4repair_space>gross<seq2seq4repair_space>weight)" , weight , gross ) ) ; weight = gross ; } if ( weight == 0.0 ) { weight = gross ; } } double limit = GetProperties . getWeightLimit ( ci , 0.0 ) ; if ( limit > 0.0 ) { if ( weight > limit ) { String ResultMsg = String . format ( "[A]<seq2seq4repair_space>Sum<seq2seq4repair_space>of<seq2seq4repair_space>weights<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg<seq2seq4repair_space>exceeds<seq2seq4repair_space>weight<seq2seq4repair_space>limit<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg" , weight , limit ) ; reporterror ( ci , ResultMsg ) ; } else { if ( sublimit > limit ) { reportwarning ( ci , String . format ( "[L]<seq2seq4repair_space>Sum<seq2seq4repair_space>of<seq2seq4repair_space>subcomponent<seq2seq4repair_space>weight<seq2seq4repair_space>limits<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg<seq2seq4repair_space>exceeds<seq2seq4repair_space>weight<seq2seq4repair_space>limit<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg" , sublimit , limit ) ) ; } if ( weight < limit ) { String ResultMsg = String . format ( "[A]<seq2seq4repair_space>Sum<seq2seq4repair_space>of<seq2seq4repair_space>weights<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg<seq2seq4repair_space>below<seq2seq4repair_space>weight<seq2seq4repair_space>limit<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg<seq2seq4repair_space>(%.1f<seq2seq4repair_space>%%<seq2seq4repair_space>Weight<seq2seq4repair_space>slack)" , weight , limit , ( ( ( limit - weight ) // limit ) * 100 ) ) ; reportinfo ( ci , ResultMsg ) ; } } } else { if ( weight > 0.0 ) { String ResultMsg = String . format ( "[L]<seq2seq4repair_space>Sum<seq2seq4repair_space>of<seq2seq4repair_space>weights<seq2seq4repair_space>//<seq2seq4repair_space>Gross<seq2seq4repair_space>weight<seq2seq4repair_space>%.3f<seq2seq4repair_space>kg<seq2seq4repair_space>(no<seq2seq4repair_space>limit<seq2seq4repair_space>specified" , weight ) ; reportinfo ( ci , ResultMsg ) ; } else if ( needWeight ) { <START_BUG> String ResultMsg = "[L]<seq2seq4repair_space>no<seq2seq4repair_space>net<seq2seq4repair_space>weight<seq2seq4repair_space>plus<seq2seq4repair_space>subcomomponent<seq2seq4repair_space>weight<seq2seq4repair_space>or<seq2seq4repair_space>no<seq2seq4repair_space>grossweight" ; <END_BUG> reportwarning ( ci , ResultMsg ) ; } } return weight ; } public String getPrintName ( ComponentInstance ci ) { } private void csvlog ( String s ) { } private void reportWeight ( String ownerStr , String elementType , double elementWeight , boolean net ) { } private void reportwarning ( final NamedElement obj , final String msg ) { } private void reporterror ( final NamedElement obj , final String msg ) { } private void reportinfo ( final NamedElement obj , final String msg ) { } }

Fix:
String ResultMsg = "[L]<seq2seq4repair_space>no<seq2seq4repair_space>net<seq2seq4repair_space>weight<seq2seq4repair_space>plus<seq2seq4repair_space>subcomponent<seq2seq4repair_space>weight<seq2seq4repair_space>or<seq2seq4repair_space>no<seq2seq4repair_space>grossweight" ;