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 @@ -60,7 +60,7 @@
/**
* An abstract test class for tests on Check models. Allows creating a project and adding files.
*/
@SuppressWarnings({"PMD.SignatureDeclareThrowsException", "restriction"})
@SuppressWarnings({"PMD.SignatureDeclareThrowsException", "restriction", "nls"})
public abstract class AbstractCheckTestCase extends TestCase {
private static final int TWO_KILO_BYTES = 2048;
protected static final Logger LOGGER = LogManager.getLogger(AbstractCheckTestCase.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
*/
@RunWith(XtextRunner.class)
@InjectWith(CheckInjectorProvider.class)
@SuppressWarnings("nls")
public class BugAig1314 {

/** Constructor of super class is protected... */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
*/
@InjectWith(CheckInjectorProvider.class)
@RunWith(XtextRunner.class)
@SuppressWarnings("nls")
public class BugDsl27 extends AbstractCheckGenerationTestCase {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

@InjectWith(CheckUiInjectorProvider.class)
@RunWith(XtextRunner.class)
@SuppressWarnings("nls")
public class CheckJavaValidatorUtilTest extends TestCase {

// assertion messages.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
/**
* @author Christoph Kulla - Initial contribution and API
*/
@SuppressWarnings("nls")
public class JavaDocCommentDocumentationProvider implements IEObjectDocumentationProvider {

// TODO refactor with MultilineCommentDocumentationProvider
Expand Down Expand Up @@ -73,7 +74,7 @@ protected String getJavaDocComment(final INode node) {
}
if (node instanceof ILeafNode && node.getGrammarElement() instanceof TerminalRule
&& ruleName.equalsIgnoreCase(((TerminalRule) node.getGrammarElement()).getName())) {
String comment = ((ILeafNode) node).getText();
String comment = node.getText();
if (comment.matches("(?s)" + startTag + ".*")) {
return comment;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
/**
* The Check compiler used for generating Java code from Check models.
*/
@SuppressWarnings("nls")
// CHECKSTYLE:CONSTANTS-OFF
public class CheckCompiler extends XbaseCompiler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/**
* Generator constants.
*/
@SuppressWarnings("nls")
public final class CheckGeneratorConstants {

public static final String CHECK_DOC_OUTPUT = "CHECK_DOC_OUTPUT";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*
* @see org.eclipse.xtext.generator.IFileSystemAccess
*/
@SuppressWarnings("nls")
public class CheckOutputConfigurationProvider extends OutputConfigurationProvider {

public static final String DOCS_PATH = "docs/content";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/**
* Generates keys and values used by issue codes and check configurations.
*/
@SuppressWarnings("nls")
public final class CheckPropertiesGenerator {

private CheckPropertiesGenerator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,27 +30,27 @@ public class CheckDeclarativeQualifiedNameProvider extends XbaseQualifiedNamePro

/**
* Gets the qualified name for a {@link CheckCatalog Check Catalog}.
*
*
* @param catalog
* the check catalog
* @return the fully qualified name
*/
QualifiedName qualifiedName(final CheckCatalog catalog) {
return converter.toQualifiedName(catalog.getPackageName() + "." + catalog.getName());
return converter.toQualifiedName(catalog.getPackageName() + '.' + catalog.getName());
}

/**
* Creates a qualified name for a given Check instance. The first segment of the
* qualified name corresponds to the parent catalog name.
*
*
* @param check
* the check
* @return the qualified name
*/
QualifiedName qualifiedName(final Check check) {
// name of check can be null while editing
String name = check.getName();
return qualifiedName(EcoreUtil2.getContainerOfType(check, CheckCatalog.class)).append(name != null ? name : "null");
return qualifiedName(EcoreUtil2.getContainerOfType(check, CheckCatalog.class)).append(name != null ? name : "null"); //$NON-NLS-1$
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
/**
* Defines a scope scope for check catalogs located in the plugin registry.
*/
@SuppressWarnings("nls")
public class CatalogFromExtensionPointScope extends AbstractScope {

private final IModelLocation locationData;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,23 @@
import org.eclipse.xtext.conversion.IValueConverterService;
import org.eclipse.xtext.nodemodel.INode;

import com.avaloq.tools.ddk.xtext.linking.AbstractFastLinkingService;
import com.avaloq.tools.ddk.check.check.CheckPackage;
import com.avaloq.tools.ddk.check.services.CheckGrammarAccess;
import com.avaloq.tools.ddk.xtext.linking.AbstractFastLinkingService;
import com.google.inject.Inject;


/**
* A linking service for the Check language.
*/
@SuppressWarnings("nls")
public class CheckLinkingService extends AbstractFastLinkingService {

@Inject
private IValueConverterService valueConverterService;
@Inject
private CheckGrammarAccess grammarAccess;

/**
* {@inheritDoc}
*/
@Override
public List<EObject> getLinkedObjects(final EObject context, final EReference ref, final INode node) {
if (ref == CheckPackage.Literals.CHECK_CATALOG__GRAMMAR) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* and the wizards.
*/
@Singleton
@SuppressWarnings("nls")
public class CheckJavaValidatorUtil {

/** Two dots in a row. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
* Largely inspired from org.eclipse.xtext.xtend2.validation.ClasspathBasedChecks.
* TODO: This code should go in utility functions...
*/
@SuppressWarnings("nls")
public class ClasspathBasedChecks extends AbstractDeclarativeValidator {

private static final String SLASH = "/";
Expand All @@ -44,7 +45,7 @@ public void register(final EValidatorRegistrar registrar) {
/**
* Verifies that a given catalog file has the same name as the name given in the model.
* Also verifies that the given package exists and that the file is in that package.
*
*
* @param catalog
* a check catalog
*/
Expand Down Expand Up @@ -81,7 +82,7 @@ public void checkFileNamingConventions(final CheckCatalog catalog) {

/**
* Reports an invalid package error.
*
*
* @param catalog
* the catalog
* @param givenPackageName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public void register(final EValidatorRegistrar registrar) {
/**
* Validates that all XNumberLiterals in this expression, which occurs on the right-hand side of a formal parameter
* declaration/definition, have indeed integral values.
*
*
* @param value
* to check
* @param issueCode
Expand All @@ -52,7 +52,7 @@ protected void checkRightHandSideHasOnlyIntegralNumbers(final XExpression value,
try {
Integer.decode(((XNumberLiteral) e).getValue());
} catch (NumberFormatException ex) {
error("Only integral values as numbers are allowed in check parameters", expr, null, issueCode); // TODO: NLS
error("Only integral values as numbers are allowed in check parameters", expr, null, issueCode); // TODO: NLS //$NON-NLS-1$
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
/**
* Issue codes used for the Check Java validator.
*/
@SuppressWarnings("nls")
public final class IssueCodes {
private static final String ISSUE_CODE_PREFIX = "com.avaloq.tools.ddk.check.validation.IssueCodes.";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/**
* Provides some tests of the reflective {@link AbstractCheckContext} framework.
*/
@SuppressWarnings("nls")
public class CheckContextTest extends TestCase {

public static final String ENABLED_ISSUE_CODE = "Enabled.Issue.Code";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
/**
* Provides some test cases for the Check extension point.
*/
@SuppressWarnings("nls")
public class CheckExtensionPointTests extends TestCase {

private static final String DUMMY_EXTENSION_ID = "com.avaloq.tools.ddk.check.runtime.core.test";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/**
* Performs some basic validation tests on the {@link AbstractCheckValidator}.
*/
@SuppressWarnings("nls")
public class CheckValidatorTest extends AbstractCheckValidator {
/**
* Represents the dummy language which is also registered in the plugin.xml.
Expand All @@ -31,7 +32,7 @@ public class CheckValidatorTest extends AbstractCheckValidator {

/**
* Returns a dummy language ID.
*
*
* @return the host language
*/
@Override
Expand All @@ -41,7 +42,7 @@ protected String getHostLanguage() {

/**
* Tests that the dummy validator is found via the check validator extension point.
*
*
* @see {@link com.avaloq.tools.ddk.check.extensionpoint.test.validation.DummyValidator}
*/
@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
public class TestLanguageUiInjectorProvider implements IInjectorProvider {

@Override
@SuppressWarnings("nls")
public Injector getInjector() {
return com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator.getInstance().getInjector("com.avaloq.tools.ddk.check.TestLanguage");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class TestLanguageUiInjectorProvider implements IInjectorProvider {

@Override
public Injector getInjector() {
return com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator.getInstance().getInjector("com.avaloq.tools.ddk.check.TestLanguage");
return com.avaloq.tools.ddk.check.ui.internal.TestLanguageActivator.getInstance().getInjector("com.avaloq.tools.ddk.check.TestLanguage"); //$NON-NLS-1$
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
/**
* The Class TestLanguageJavaValidator.
*/
@SuppressWarnings("nls")
public class TestLanguageJavaValidator extends AbstractTestLanguageJavaValidator {

@Check
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class CheckUiInjectorProvider implements IInjectorProvider {

@Override
public Injector getInjector() {
return com.avaloq.tools.ddk.check.ui.internal.CheckActivator.getInstance().getInjector("com.avaloq.tools.ddk.check.Check");
return com.avaloq.tools.ddk.check.ui.internal.CheckActivator.getInstance().getInjector("com.avaloq.tools.ddk.check.Check"); //$NON-NLS-1$
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
*/
@InjectWith(CheckWizardUiTestInjectorProvider.class)
@RunWith(XtextClassRunner.class)
@SuppressWarnings("nls")
public class CheckCatalogWizardTest {

/** This is the name of the catalog wizard. It's the name SWTBot uses to look up the wizard. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
*/
@InjectWith(CheckWizardUiTestInjectorProvider.class)
@RunWith(XtextClassRunner.class)
@SuppressWarnings("nls")
public class CheckProjectWizardTest {

/** This is the name of the project wizard. It's the name SWTBot uses to look up the wizard. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import org.eclipse.pde.core.plugin.IPluginExtension;
import org.eclipse.pde.core.plugin.IPluginModelBase;
import org.eclipse.pde.internal.core.plugin.WorkspacePluginModel;
import org.eclipse.xtext.testing.InjectWith;
import org.eclipse.xtext.testing.XtextRunner;
import org.eclipse.xtext.testing.util.ParseHelper;
import org.eclipse.xtext.testing.InjectWith;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
Expand All @@ -39,7 +39,7 @@
/**
* Tests CheckContextExtensionUtil.
*/
@SuppressWarnings("restriction")
@SuppressWarnings({"restriction", "nls"})
@InjectWith(CheckWizardUiTestInjectorProvider.class)
@RunWith(XtextRunner.class)
public class CheckContextsExtensionTest extends TestCase {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
/**
* Tests the MarkerHelpExtensionUtil class.
*/
@SuppressWarnings({"restriction", "PMD.SignatureDeclareThrowsException"})
@SuppressWarnings({"restriction", "PMD.SignatureDeclareThrowsException", "nls"})
@InjectWith(CheckWizardUiTestInjectorProvider.class)
@RunWith(XtextRunner.class)
public class CheckMarkerHelpExtensionTest {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
*******************************************************************************/
package com.avaloq.tools.ddk.check.ui.test.builder;

import junit.framework.TestCase;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.runtime.CoreException;
Expand All @@ -35,11 +33,13 @@
import com.google.common.collect.Lists;
import com.google.inject.Inject;

import junit.framework.TestCase;


/**
* Tests the CheckTocExtensionUtil class.
*/
@SuppressWarnings({"restriction", "PMD.SignatureDeclareThrowsException"})
@SuppressWarnings({"restriction", "PMD.SignatureDeclareThrowsException", "nls"})
@InjectWith(CheckWizardUiTestInjectorProvider.class)
@RunWith(XtextRunner.class)
public class CheckTocExtensionTest extends TestCase {
Expand Down Expand Up @@ -69,7 +69,7 @@ public void setUp() throws Exception {

/**
* Tests if the toc extension is correctly created.
*
*
* @throws CoreException
* the core exception
*/
Expand All @@ -84,7 +84,7 @@ public void testCreateExtension() throws CoreException {

/**
* Tests if isExtensionUpdateRequired returns true if only an erroneous extension exists for the check catalog.
*
*
* @throws CoreException
* the core exception
*/
Expand All @@ -98,7 +98,7 @@ public void testIsExtensionUpdateRequiredTrue() throws CoreException {

/**
* Creates an erroneous toc extension.
*
*
* @return the plugin extension
* @throws CoreException
* the core exception
Expand All @@ -116,7 +116,7 @@ private IPluginExtension createErroneousTocExtension() throws CoreException {

/**
* Tests if an update of a toc extension is correctly done.
*
*
* @throws CoreException
* the core exception
*/
Expand All @@ -130,7 +130,7 @@ public void testUpdateTocExtension() throws CoreException {

/**
* Tests if isExtensionUpdateRequires returns false if a correct extension already exists.
*
*
* @throws CoreException
* the core exception
*/
Expand Down
Loading