Skip to content

If there is no source show the raw class file content#2357

Closed
laeubi wants to merge 1 commit into
eclipse-jdt:masterfrom
laeubi:no_source
Closed

If there is no source show the raw class file content#2357
laeubi wants to merge 1 commit into
eclipse-jdt:masterfrom
laeubi:no_source

Conversation

@laeubi
Copy link
Copy Markdown
Contributor

@laeubi laeubi commented Jul 18, 2025

Currently if ClassFileEditor is opened for a classfile that is not on the classpath it fails with an error "The class file is not on the classpath" even though it could just display the raw class.

This now adjust the ClassFileEditor in a way to be more lenient and allows to display class files that are not on the classfile at least with the default raw view.

FYI @iloveeclipse

Currently if ClassFileEditor is opened for a classfile that is not on
the classpath it fails with an error "The class file is not on the
classpath" even though it could just display the raw class.

This now adjust the ClassFileEditor in a way to be more lenient and
allows to display class files that are not on the classfile at least
with the default raw view.
@mehmet-karaman
Copy link
Copy Markdown
Contributor

mehmet-karaman commented Jul 21, 2025

It doesn't displays the class file in the default raw view:
image

!ENTRY org.eclipse.ui 4 4 2025-07-21 09:08:58.368 !MESSAGE Unable to create part !STACK 1 org.eclipse.ui.PartInitException: Factory org.eclipse.jdt.ui.ClassFileEditorInputFactory returned null from createElement for editor id=org.eclipse.jdt.ui.ClassFileEditor name=null at org.eclipse.ui.internal.EditorReference.getEditorInput(EditorReference.java:302) at org.eclipse.ui.internal.e4.compatibility.CompatibilityEditor.createPart(CompatibilityEditor.java:62) at org.eclipse.ui.internal.e4.compatibility.CompatibilityPart.create(CompatibilityPart.java:344) at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103) at java.base/java.lang.reflect.Method.invoke(Method.java:580) at org.eclipse.e4.core.internal.di.MethodRequestor.execute(MethodRequestor.java:56) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:977) at org.eclipse.e4.core.internal.di.InjectorImpl.processAnnotated(InjectorImpl.java:939) at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:139) at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:386) at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:312) at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:203) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:90) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:59) at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:42) at org.eclipse.ui.internal.WorkbenchContributionFactory.create(WorkbenchContributionFactory.java:46)

The ClassFileEditorInputFactory shouldn't return null, it should just return the EditorInput for the binary content.. or isn't it?

@iloveeclipse
Copy link
Copy Markdown
Member

@laeubi & @mehmet-karaman : could you both please provide steps how to reproduce? Maybe you use different use cases?

@mehmet-karaman
Copy link
Copy Markdown
Contributor

I have opened a ClassFile in the ClassFileEditor and closed eclipse. Started the runtime again and saw this error..

@laeubi
Copy link
Copy Markdown
Contributor Author

laeubi commented Jul 21, 2025

It doesn't displays the class file in the default raw view

@mehmet-karaman

for case case you need at least

as well.

could you both please provide steps how to reproduce

I'm confused, last time you wrote you always see "Class is not on classpath" and that is what this fixes here, for the Nullpointer case I have written it here #2353 (comment)

@laeubi
Copy link
Copy Markdown
Contributor Author

laeubi commented Jul 21, 2025

@iloveeclipse just to make sure you have no other changes in JDT.core or PDE in your workspace, so only JDT.ui?

@iloveeclipse
Copy link
Copy Markdown
Member

I hope to have time today to follow up on this afternoon.

Copy link
Copy Markdown
Contributor

@mehmet-karaman mehmet-karaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

@laeubi
Copy link
Copy Markdown
Contributor Author

laeubi commented Jul 24, 2025

I'm closing this in favor of

@laeubi laeubi closed this Jul 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants