Skip to content

"SEVERE: Internal Error java.lang.ClassCastException" when attempting to rename a method. #3916

Open
@dailytabs

Description

Trying to rename a method and keep getting the following:

Jan 13, 2025 6:01:16 PM org.eclipse.lsp4j.jsonrpc.RemoteEndpoint fallbackResponseError
SEVERE: Internal error: java.lang.ClassCastException: class org.eclipse.jdt.internal.core.BinaryType cannot be cast to class org.eclipse.jdt.core.IMethod (org.eclipse.jdt.internal.core.BinaryType and org.eclipse.jdt.core.IMethod are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @659add35)
java.util.concurrent.CompletionException: java.lang.ClassCastException: class org.eclipse.jdt.internal.core.BinaryType cannot be cast to class org.eclipse.jdt.core.IMethod (org.eclipse.jdt.internal.core.BinaryType and org.eclipse.jdt.core.IMethod are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @659add35)
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.lang.ClassCastException: class org.eclipse.jdt.internal.core.BinaryType cannot be cast to class org.eclipse.jdt.core.IMethod (org.eclipse.jdt.internal.core.BinaryType and org.eclipse.jdt.core.IMethod are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @659add35)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2$1MethodRequestor.acceptSearchMatch(RippleMethodFinder2.java:444)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.report(MatchLocator.java:2505)
at org.eclipse.jdt.internal.core.search.matching.MethodLocator.matchReportReference(MethodLocator.java:720)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:3055)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:3470)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:3594)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:3177)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:2360)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatchesDefaultImpl(MatchLocator.java:1611)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1573)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1692)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1835)
at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:143)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:276)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:620)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:677)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.findAllDeclarations(RippleMethodFinder2.java:476)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.findAllRippleMethods(RippleMethodFinder2.java:209)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getAllRippleMethods(RippleMethodFinder2.java:189)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getRelatedMethods(RippleMethodFinder2.java:182)
at org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor.initializeMethodsToRename(RenameMethodProcessor.java:259)
at org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor.doCheckFinalConditions(RenameMethodProcessor.java:401)
at org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor.doCheckFinalConditions(RenameVirtualMethodProcessor.java:153)
at org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor.checkFinalConditions(JavaRenameProcessor.java:51)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:227)
at org.eclipse.ltk.core.refactoring.Refactoring.checkAllConditions(Refactoring.java:163)
at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:82)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:116)
at org.eclipse.jdt.ls.core.internal.handlers.RenameHandler.rename(RenameHandler.java:92)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$22(JDTLanguageServer.java:869)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
... 7 more

[Error - 6:01:16 PM] Request textDocument/rename failed.
Message: Internal error.
Code: -32603
java.util.concurrent.CompletionException: java.lang.ClassCastException: class org.eclipse.jdt.internal.core.BinaryType cannot be cast to class org.eclipse.jdt.core.IMethod (org.eclipse.jdt.internal.core.BinaryType and org.eclipse.jdt.core.IMethod are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @659add35)
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(Unknown Source)
at java.base/java.util.concurrent.CompletableFuture$Completion.exec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinTask.doExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.scan(Unknown Source)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(Unknown Source)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(Unknown Source)
Caused by: java.lang.ClassCastException: class org.eclipse.jdt.internal.core.BinaryType cannot be cast to class org.eclipse.jdt.core.IMethod (org.eclipse.jdt.internal.core.BinaryType and org.eclipse.jdt.core.IMethod are in unnamed module of loader org.eclipse.osgi.internal.loader.EquinoxClassLoader @659add35)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2$1MethodRequestor.acceptSearchMatch(RippleMethodFinder2.java:444)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.report(MatchLocator.java:2505)
at org.eclipse.jdt.internal.core.search.matching.MethodLocator.matchReportReference(MethodLocator.java:720)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:3055)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:3470)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:3594)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.reportMatching(MatchLocator.java:3177)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.process(MatchLocator.java:2360)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatchesDefaultImpl(MatchLocator.java:1611)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1573)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1692)
at org.eclipse.jdt.internal.core.search.matching.MatchLocator.locateMatches(MatchLocator.java:1835)
at org.eclipse.jdt.internal.core.search.JavaSearchParticipant.locateMatches(JavaSearchParticipant.java:143)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.findMatches(BasicSearchEngine.java:276)
at org.eclipse.jdt.internal.core.search.BasicSearchEngine.search(BasicSearchEngine.java:620)
at org.eclipse.jdt.core.search.SearchEngine.search(SearchEngine.java:677)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.findAllDeclarations(RippleMethodFinder2.java:476)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.findAllRippleMethods(RippleMethodFinder2.java:209)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getAllRippleMethods(RippleMethodFinder2.java:189)
at org.eclipse.jdt.internal.corext.refactoring.rename.RippleMethodFinder2.getRelatedMethods(RippleMethodFinder2.java:182)
at org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor.initializeMethodsToRename(RenameMethodProcessor.java:259)
at org.eclipse.jdt.internal.corext.refactoring.rename.RenameMethodProcessor.doCheckFinalConditions(RenameMethodProcessor.java:401)
at org.eclipse.jdt.internal.corext.refactoring.rename.RenameVirtualMethodProcessor.doCheckFinalConditions(RenameVirtualMethodProcessor.java:153)
at org.eclipse.jdt.internal.corext.refactoring.rename.JavaRenameProcessor.checkFinalConditions(JavaRenameProcessor.java:51)
at org.eclipse.ltk.core.refactoring.participants.ProcessorBasedRefactoring.checkFinalConditions(ProcessorBasedRefactoring.java:227)
at org.eclipse.ltk.core.refactoring.Refactoring.checkAllConditions(Refactoring.java:163)
at org.eclipse.ltk.core.refactoring.CheckConditionsOperation.run(CheckConditionsOperation.java:82)
at org.eclipse.ltk.core.refactoring.CreateChangeOperation.run(CreateChangeOperation.java:116)
at org.eclipse.jdt.ls.core.internal.handlers.RenameHandler.rename(RenameHandler.java:92)
at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.lambda$22(JDTLanguageServer.java:869)
at org.eclipse.jdt.ls.core.internal.BaseJDTLanguageServer.lambda$0(BaseJDTLanguageServer.java:87)
... 7 more

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions