I'm trying to use ceilingKey(), ceilingEntry(), firstKey() and firstEntry() of the TreeMap class but getting error:
java.lang.NoSuchMethodError: method java.util.TreeMap.firstEntry with signature ()Ljava.util.Map$Entry; was not found.
This error is caused by following code:
if (tmpmap.size() == 1 && tmpmap.firstKey() == req_sbyte && tmpmap.firstEntry().getValue() == req_size) {
send("F" + req_nr + "," + Integer.toString(req_filenr) + "," + Long.toString(req_sbyte) + "," + Integer.toString(req_size), "localhost", CLIENTPORT);
}
This is the output of java -version:
java version "1.5.0"
gij (GNU libgcj) version 4.1.2 20070925 (Red Hat 4.1.2-33)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Any explanations why is this happening and how to fix it? I checked libgcj's documentation, and it says there is such method firstEntry() and it returns Entry object which has getValue() method. So I do not clearly understand what is the problem with my code.