0

我从来没有遇到过这个问题。我不能在数组列表上使用任何类型的循环。

那是错误:链接:https ://i.imgur.com/cshtpof.png

我的头等舱代码:

    private List<String> aliases = new ArrayList<>();

    ....

    
    public final List<String> getAliasesList() {
        return aliases;
    }

另一个类中的错误代码:


        this.subCommands.put(subCommand.getName().toLowerCase(), subCommand);
        if (subCommand.hasAliases()) {
            for (String alias : subCommand.getAliasesList()) {//here is the error

            }
        }

我做了什么?

  1. 检查系统包的版本(和更新)-> Elementary OS 5.1
  2. 检查 IntelliJ-Idea-Ultimate 版本 -> 2021.1.2

一些信息: 语言级别:8 Java 版本:openJDK11 操作系统版本:elementaryOS 5.1 (Hera) CPU (GPU):AMD Ryzen 3 2200G (Vega 8) RAM:24 GB Hyper X DDR4

感谢您的阅读,也许您的帮助

4

0 回答 0