Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* Describes a mapping of check catalogs registered with the check plugin extension to
* model location objects storing derived and cached data relevant to scoping and type providers.
*/
public class BundleAwareModelLocation extends AbstractModelLocation implements IModelLocation {
public class BundleAwareModelLocation extends AbstractModelLocation {

private final Bundle bundle;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,22 @@

import java.util.Arrays;
import java.util.List;
import java.util.stream.Stream;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.osgi.util.NLS;
import org.eclipse.ui.progress.UIJob;
import org.eclipse.xtext.common.types.access.jdt.IJavaProjectProvider;
import org.junit.jupiter.api.Test;

import com.google.common.base.Function;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;


/**
* Tests content assist in Check models.
*/
@SuppressWarnings({"PMD.SignatureDeclareThrowsException", "PMD.AvoidFinalLocalVariable", "nls"})
public class BugAig931Test extends AbstractCheckContentAssistBugTest implements IJavaProjectProvider {
@SuppressWarnings("nls")
public class BugAig931Test extends AbstractCheckContentAssistBugTest {

/**
* Verifies that given completions exist.
Expand All @@ -44,13 +40,7 @@ public class BugAig931Test extends AbstractCheckContentAssistBugTest implements
* the expected display strings
*/
private void completionsExist(final ICompletionProposal[] completionProposals, final String... expected) {
List<String> actual = Lists.newArrayList(Iterables.transform(Lists.newArrayList(completionProposals), //
new Function<ICompletionProposal, String>() {
@Override
public String apply(final ICompletionProposal input) {
return input.getDisplayString();
}
}));
List<String> actual = Stream.of(completionProposals).map(ICompletionProposal::getDisplayString).toList();
for (String string : expected) {
assertTrue(actual.contains(string), NLS.bind("Expected {0} but found {1}", Arrays.toString(expected), actual));
}
Expand All @@ -63,13 +53,13 @@ public String apply(final ICompletionProposal input) {
* the exception
*/
@Test
@SuppressWarnings("PMD.SignatureDeclareThrowsException")
public void testBugAig931() throws Exception {
final String partialModel = "package p catalog T for grammar com.avaloq.tools.ddk.check.Check { error \"X\" for ";
final String[] expectedContextTypeProposals = {"EObject - org.eclipse.emf.ecore", "JvmType - org.eclipse.xtext.common.types"};
new UIJob("compute completion proposals") {
@SuppressWarnings("restriction")
@Override
public IStatus runInUIThread(final IProgressMonitor monitor) {
String partialModel = "package p catalog T for grammar com.avaloq.tools.ddk.check.Check { error \"X\" for ";
String[] expectedContextTypeProposals = {"EObject - org.eclipse.emf.ecore", "JvmType - org.eclipse.xtext.common.types"};
try {
completionsExist(newBuilder().append(partialModel).computeCompletionProposals(), expectedContextTypeProposals);
// CHECKSTYLE:OFF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* The extension point utility class for preference initializers. Intended to be used by the Check builder participant.
*/
@SuppressWarnings("nls")
public final class CheckPreferencesExtensionHelper extends AbstractCheckExtensionHelper implements ICheckExtensionHelper {
public final class CheckPreferencesExtensionHelper extends AbstractCheckExtensionHelper {

public static final String GENERATE_PREFERENCES_EXTENSION_PREFERENCE = "generatePreferencesExtension";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import java.util.List;
import java.util.Locale;

import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.EObjectImpl;
import org.junit.jupiter.api.Test;

Expand Down Expand Up @@ -132,7 +131,7 @@ public String getName() {

}

protected class ParameterList extends EObjectImpl implements InternalEObject {
protected class ParameterList extends EObjectImpl {
// Empty class to make protected constructor visible.
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import org.antlr.runtime.TokenSource;
import org.eclipse.xtext.conversion.IValueConverter;
import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.conversion.ValueConverter;
import org.eclipse.xtext.xbase.conversion.XbaseValueConverterService;

Expand All @@ -25,7 +24,7 @@
* Value converters for Format.
*/
@Singleton
public class FormatValueConverterService extends XbaseValueConverterService implements IValueConverterService {
public class FormatValueConverterService extends XbaseValueConverterService {

@Inject
private Injector injector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.mwe2.ecore.EcoreGenerator;
import org.eclipse.emf.mwe2.runtime.Mandatory;
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowComponent;
import org.eclipse.emf.mwe2.runtime.workflow.IWorkflowContext;

import com.google.common.base.Joiner;
Expand All @@ -44,7 +43,7 @@
* order not to show a warning.
*/
@SuppressWarnings("nls")
public class CustomClassAwareEcoreGenerator extends EcoreGenerator implements IWorkflowComponent {
public class CustomClassAwareEcoreGenerator extends EcoreGenerator {
private static final Logger LOGGER = LogManager.getLogger(EcoreGenerator.class);

private String genModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
/**
* Common interface of LazyLinkingResource with custom implementations.
*/
public interface ILazyLinkingResource2 extends Resource, Resource.Internal {
public interface ILazyLinkingResource2 extends Resource.Internal {

String MARK_UNRESOLVABLE_XREFS = ILazyLinkingResource2.class.getName() + ".MARK_UNRESOLVABLE_XREFS"; //$NON-NLS-1$

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

import java.util.List;

import org.eclipse.xtext.naming.IQualifiedNameConverter;
import org.eclipse.xtext.naming.IQualifiedNameConverter.DefaultImpl;
import org.eclipse.xtext.naming.QualifiedName;
import org.eclipse.xtext.util.Strings;
Expand All @@ -22,7 +21,7 @@
* AcsQualifiedNamesConverter overrides {@link DefaultImpl} in order to use custom segment splitter.
* This implementation is about 3 times faster than the (uncompiled) regexp splitter.
*/
public class QualifiedNameConverter extends DefaultImpl implements IQualifiedNameConverter {
public class QualifiedNameConverter extends DefaultImpl {

private static final String DELIMITER = "."; //$NON-NLS-1$

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* A {@link ResourceDescriptionsData} that delegates all operations to another {@link ResourceDescriptionsData}.
*/
public class DelegatingResourceDescriptionsData extends AbstractResourceDescriptionsData implements IResourceDescriptionsData {
public class DelegatingResourceDescriptionsData extends AbstractResourceDescriptionsData {

private final ResourceDescriptionsData delegate;
private final IResourceDescriptions2 wrapped;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
/**
* A null version of {@link ResourceDescriptionsData}.
*/
public class NullResourceDescriptionsData extends DelegatingResourceDescriptionsData implements IResourceDescriptionsData {
public class NullResourceDescriptionsData extends DelegatingResourceDescriptionsData {

public NullResourceDescriptionsData() {
super(new ResourceDescriptionsData(Collections.<IResourceDescription> emptyList()));
Expand Down
2 changes: 1 addition & 1 deletion ddk-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
<spotbugs.plugin.version>4.9.8.2</spotbugs.plugin.version>
<spotbugs.version>4.9.8</spotbugs.version>
<pmd.plugin.version>3.28.0</pmd.plugin.version>
<pmd.version>7.21.0</pmd.version>
<pmd.version>7.22.0</pmd.version>
<tycho.version>5.0.2</tycho.version>
<xtend.version>2.42.0</xtend.version>
</properties>
Expand Down