Skip to content

Instantly share code, notes, and snippets.

@testanull
Created February 19, 2020 03:33
Show Gist options
  • Save testanull/b440c58b2319258b3f7829f6e0dcfbfd to your computer and use it in GitHub Desktop.
Save testanull/b440c58b2319258b3f7829f6e0dcfbfd to your computer and use it in GitHub Desktop.
public Object getObject(final String url) throws Exception {
HashMap ht = new HashMap();
URL u = new URL(url);
ht.put(u, url); // <===
Reflections.setFieldValue(u, "hashCode", -1);
return ht;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment