Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

FileBufferFunctions.testGetFileStoreAnnotationModel fails when ran from Eclipse

Aperta
#3,828 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
java
Ambito
testing

Direzione di ricerca

Start with FileBufferFunctions.java at the failing assertion and inspect the MANIFEST.MF used by the filebuffers tests, along with the extending test classes named in the issue. Run FileBuffersForFilesInLinkedFolders from Eclipse and compare its bundle availability with the test setup; the issue reports that adding org.eclipse.ui.editors to the manifest makes the test pass. Check the linked PDE issues before deciding whether that is the complete fix.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Run e.g. org.eclipse.core.filebuffers.tests.FileBuffersForFilesInLinkedFolders, observe:

org.opentest4j.AssertionFailedError: expected: not <null>
	at org.eclipse.core.filebuffers.tests.FileBufferFunctions.testGetFileStoreAnnotationModel(FileBufferFunctions.java:1297)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at java.base/java.util.Optional.ifPresent(Optional.java:178)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:184)
	at java.base/java.util.stream.IntPipeline$1$1.accept(IntPipeline.java:180)
	at java.base/java.util.stream.Streams$RangeIntSpliterator.forEachRemaining(Streams.java:108)
	at java.base/java.util.Spliterator$OfInt.forEachRemaining(Spliterator.java:712)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151)
	at java.base/java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:596)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)

There is this code:

	@Override
	protected Class<IAnnotationModel> getAnnotationModelClass() throws Exception {
		Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
		return bundle != null ? IAnnotationModel.class : null;
	}

In several of the extending test cases:

tests/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForFilesInLinkedFolders.java:                Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
tests/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForLinkedFiles.java:         Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
tests/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileBuffersForWorkspaceFiles.java:              Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");
tests/org.eclipse.core.filebuffers.tests/src/org/eclipse/core/filebuffers/tests/FileStoreFileBuffersForWorkspaceFiles.java:             Bundle bundle= Platform.getBundle("org.eclipse.ui.editors");

But the bundle org.eclipse.ui.editor is not in the MANIFEST.MF. Adding it there does make the test pass.

Considering the following, no idea how to fix such problems:

Likely related to: https://github.com/eclipse-pde/eclipse.pde/issues/1999, https://github.com/eclipse-pde/eclipse.pde/issues/2082

Lingua principale
Java
Stelle
124
Fork
269
Merge medio
2g 3h
PR unite (30g)
69

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di eclipse-platform/eclipse.platform.ui

Tutte le issue di eclipse-platform/eclipse.platform.ui

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.