Bug 566657 - Invocation of java.net.URL.hashCode(), which blocks to do domain name resolution, in org.eclipse.jdt.internal.core.index.IndexLocation.hashCode()
Summary: Invocation of java.net.URL.hashCode(), which blocks to do domain name resolut...
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Core (show other bugs)
Version: 4.17   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 4.24 M1   Edit
Assignee: Carsten Hammer CLA
QA Contact:
URL:
Whiteboard:
Keywords: performance
Depends on:
Blocks:
 
Reported: 2020-09-03 16:39 EDT by Carsten Hammer CLA
Modified: 2022-07-17 08:32 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carsten Hammer CLA 2020-09-03 16:39:42 EDT
Bug: Invocation of java.net.URL.hashCode(), which blocks to do domain name resolution, in org.eclipse.jdt.internal.core.index.IndexLocation.hashCode()

The equals and hashCode method of URL perform domain name resolution, this can result in a big performance hit. See http://michaelscharf.blogspot.com/2006/11/javaneturlequals-and-hashcode-make.html for more information. Consider using java.net.URI instead. 

Rank: Of Concern (16), confidence: High
Pattern: DMI_BLOCKING_METHODS_ON_URL 
Type: Dm, Category: PERFORMANCE (Performance)
Comment 1 Carsten Hammer CLA 2020-09-03 16:44:45 EDT
More cases in

org.eclipse.jdt.internal.core.index.JarIndexLocation.equals(Object)
org.eclipse.jdt.internal.core.search.indexing.IndexManager.computeIndexLocation(IPath, URL)
org.eclipse.jdt.internal.core.ClasspathChange.requestIndexing()
Comment 3 Eclipse Genie CLA 2022-04-09 13:49:04 EDT
New Gerrit change created: https://git.eclipse.org/r/c/jdt/eclipse.jdt.core/+/192601
Comment 4 Andrey Loskutov CLA 2022-07-17 08:32:52 EDT
See https://github.com/eclipse-jdt/eclipse.jdt.core/issues/235.

This change caused regressions and I had to partly revert it.