-1

ArrayListサプライヤ番号で文字列を埋めました。このリストには重複する値が含まれているため、HashSet.

次のエラーが表示されます: Invalid expression as statement On line => Set set = new HashSet(leveranciers); (下線を引いたセット)理由は?

String[] leveranciers = new String[wdContext.nodeShoppingCart().size()];

for(int i = 0; i<wdContext.nodeShoppingCart().size(); i++){

      String productnumber = wdContext.nodeShoppingCart().getShoppingCartElementAt(i).getMatnr()

      wdThis.wdGetAchatsIndirectController().GetDetails(productnumber, "NL");
      leveranciers[i] = wdContext.currentEt_DetailsElement().getLifnr();
}

 //Remove duplicates from array
        Set<String> set = new HashSet<String>(leveranciers);
        set.toArray(new String[0]);


for(int y = 0; y<set.size();y++){
    PdfPTable table = GetTable(set[y]);
    byte[] pdf = wdThis.wdGetAchatsIndirectController().GetPDFFromFolder("/intranetdocuments/docs/AchatsIndirect", table);
    wdThis.wdGetAchatsIndirectController().PrintPDF(pdf);
}
4

1 に答える 1