java - 未定义的参数返回 INT
问题描述
当我像这样创建它时,我有这样的代码
public final class PhpArray extends AbstractMap
{
private TreeMap t;
private HashMap m;
public PhpArray() {
this.t = new TreeMap(Request.PHP_ARRAY_KEY_COMPARATOR);
this.m = null;
}
@Override
public Object put(final Object key, final Object value) {
if (this.m != null) {
return this.m.put(key, value);
}
try {
return this.t.put(key, value);
}
catch (ClassCastException e) {
this.m = new HashMap(this.t);
this.t = null;
return this.m.put(key, value);
}
}
@Override
public Set entrySet() {
if (this.t != null) {
return this.t.entrySet();
}
return this.m.entrySet();
}
public int arraySize() {
if (this.t == null) {
throw new IllegalArgumentException("The passed PHP \"array\" is not a sequence but a dictionary");
}
if (this.t.size() == 0) {
return 0;
}
return 1 + this.t.lastKey();
}
}
但是当我更新我的项目时,我在代码中遇到了错误
return 1 + this.t.lastKey();
错误是一个参数+未定义..为什么这样?以及如何解决问题?
解决方案
推荐阅读
- macos - 如何在不使用 mac 上的完整路径的情况下运行 clickhouse 命令
- excel-formula - 如何在 Excel 中使用 Let 函数追加行和向量
- swift - Swift - 将 json 数据传递给其他视图
- java - Scene.getFocusOwner() 从 Scene 返回节点的 null inseatd
- sass - scss使用外部veribales更改主题颜色
- nestjs - TypeOrm - Nest.js 无法连接到 XX:1433 - 自签名证书
- python - Python:从 HTML 文档中提取代码块?
- python - python和asyncua中的异步队列
- node.js - 使用 Puppeteer 抓取 Google 地图搜索结果链接
- javascript - Discord 机器人斜线命令