diff --git a/lsp/org.eclipse.cdt.lsp.core.tests/src/org/eclipse/cdt/lsp/text/tests/ResolveDocumentUriTest.java b/lsp/org.eclipse.cdt.lsp.core.tests/src/org/eclipse/cdt/lsp/text/tests/ResolveDocumentUriTest.java index 6fbc7dbad42..b86f2ff590b 100644 --- a/lsp/org.eclipse.cdt.lsp.core.tests/src/org/eclipse/cdt/lsp/text/tests/ResolveDocumentUriTest.java +++ b/lsp/org.eclipse.cdt.lsp.core.tests/src/org/eclipse/cdt/lsp/text/tests/ResolveDocumentUriTest.java @@ -13,7 +13,7 @@ *******************************************************************************/ package org.eclipse.cdt.lsp.text.tests; -import static org.junit.Assert.assertTrue; +import static org.junit.Assert.assertFalse; import org.eclipse.cdt.lsp.internal.text.ResolveDocumentUri; import org.eclipse.core.filebuffers.FileBuffers; @@ -32,14 +32,14 @@ public class ResolveDocumentUriTest { @Test public void emptyDocument() { - assertTrue(uri.apply(new Document()).isEmpty()); + assertFalse(uri.apply(new Document()).isPresent()); } @Test public void externalDocument() { Document document = new Document(); FileBuffers.createTextFileBufferManager().createEmptyDocument(new Path("some.c"), LocationKind.LOCATION); - assertTrue(uri.apply(document).isEmpty()); + assertFalse(uri.apply(document).isPresent()); } @Test @@ -47,7 +47,7 @@ public class ResolveDocumentUriTest { Document document = new Document(); FileBuffers.createTextFileBufferManager().createEmptyDocument(new Path("some.c"), LocationKind.LOCATION); //it's a pity! see https://bugs.eclipse.org/bugs/show_bug.cgi?id=566044 - assertTrue(uri.apply(document).isEmpty()); + assertFalse(uri.apply(document).isPresent()); } } diff --git a/lsp/org.eclipse.cdt.lsp.cquery/src/org/eclipse/cdt/lsp/internal/cquery/ui/PublishSemanticHighlighting.java b/lsp/org.eclipse.cdt.lsp.cquery/src/org/eclipse/cdt/lsp/internal/cquery/ui/PublishSemanticHighlighting.java index 54412edbcf0..83c72f1f3e3 100644 --- a/lsp/org.eclipse.cdt.lsp.cquery/src/org/eclipse/cdt/lsp/internal/cquery/ui/PublishSemanticHighlighting.java +++ b/lsp/org.eclipse.cdt.lsp.cquery/src/org/eclipse/cdt/lsp/internal/cquery/ui/PublishSemanticHighlighting.java @@ -57,7 +57,7 @@ public class PublishSemanticHighlighting implements Consumer currentReconcilerUri = uri.apply(currentReconcilerDoc); - if (currentReconcilerUri.isEmpty()) { + if (!currentReconcilerUri.isPresent()) { continue; } diff --git a/lsp/org.eclipse.cdt.lsp.ui/src/org/eclipse/cdt/lsp/internal/ui/text/SetInactiveRegions.java b/lsp/org.eclipse.cdt.lsp.ui/src/org/eclipse/cdt/lsp/internal/ui/text/SetInactiveRegions.java index 0912f7ed754..898dd031781 100644 --- a/lsp/org.eclipse.cdt.lsp.ui/src/org/eclipse/cdt/lsp/internal/ui/text/SetInactiveRegions.java +++ b/lsp/org.eclipse.cdt.lsp.ui/src/org/eclipse/cdt/lsp/internal/ui/text/SetInactiveRegions.java @@ -42,7 +42,7 @@ public final class SetInactiveRegions implements BiConsumer, Suppl for (PresentationReconcilerCPP eachReconciler : PresentationReconcilerCPP.presentationReconcilers) { IDocument currentReconcilerDoc = eachReconciler.getTextViewer().getDocument(); Optional currentReconcilerUri = resolve.apply(currentReconcilerDoc); - if (currentReconcilerUri.isEmpty()) { + if (!currentReconcilerUri.isPresent()) { continue; } if (uriReceived.equals(currentReconcilerUri.get())) {