I have to debug java code, but java is not compiled with -g option (Generate all debugging information, including local variables). Someone know, where I could find complied code ready to use? Additionaly I do not look for some openJDK with -g. Also I know, I could compile it myself, but I try to avoid it.
The goal is to read a value of hash
variable in debugging, it is impossible, how to do it?
Code from HashMap:
public V put(K key, V value) {
if (table == EMPTY_TABLE) {
inflateTable(threshold);
}
if (key == null)
return putForNullKey(value);
int hash = hash(key);
int i = indexFor(hash, table.length);
for (Entry<K,V> e = table[i]; e != null; e = e.next) {
Object k;
if (e.hash == hash && ((k = e.key) == key || key.equals(k))) {
V oldValue = e.value;
e.value = value;
e.recordAccess(this);
return oldValue;
}
}
modCount++;
addEntry(hash, key, value, i);
return null;
}
In your JDK installation, you have a src.zip file with all the java classes.
EDIT : Check this Where to get full source code for rt.jar?
Basically, Oracle stopped providing source code for some things. Your best shot is probably openJDK .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.