diff options
| author | Maxime Porhel | 2015-08-24 15:17:11 +0000 |
|---|---|---|
| committer | Maxime Porhel | 2015-08-25 13:22:51 +0000 |
| commit | 824f9e7c19f9879edb1801f4acb6bdbfa28c8c40 (patch) | |
| tree | cbe34de3311fa59cec449fa31216ea35ff9ec43d | |
| parent | 3e5fe2d5f3a1cba05c084490c9f43a4c62dbec15 (diff) | |
| download | org.eclipse.sirius-824f9e7c19f9879edb1801f4acb6bdbfa28c8c40.tar.gz org.eclipse.sirius-824f9e7c19f9879edb1801f4acb6bdbfa28c8c40.tar.xz org.eclipse.sirius-824f9e7c19f9879edb1801f4acb6bdbfa28c8c40.zip | |
[472057] Identify non-translatable strings in org.eclipse.sirius.common.xtext
Add NON-NLS markers to all literal strings (in the scope of this ticket)
which should not be translated.
Change the non externalized string literal compiler rule to error for this project.
Bug: 472057
Change-Id: Icf4c9c8b2678aebf2d7bc7b6421441e29681cbae
Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
2 files changed, 8 insertions, 7 deletions
diff --git a/plugins/org.eclipse.sirius.common.xtext/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.sirius.common.xtext/.settings/org.eclipse.jdt.core.prefs index fc8c7f3ddc..39e1d0d4d4 100644 --- a/plugins/org.eclipse.sirius.common.xtext/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/org.eclipse.sirius.common.xtext/.settings/org.eclipse.jdt.core.prefs @@ -32,7 +32,7 @@ org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning -org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore +org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=error org.eclipse.jdt.core.compiler.problem.nullReference=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore diff --git a/plugins/org.eclipse.sirius.common.xtext/src/org/eclipse/sirius/common/xtext/internal/XTextResourceSetFactory.java b/plugins/org.eclipse.sirius.common.xtext/src/org/eclipse/sirius/common/xtext/internal/XTextResourceSetFactory.java index 017b0f9fc2..dbee434bec 100644 --- a/plugins/org.eclipse.sirius.common.xtext/src/org/eclipse/sirius/common/xtext/internal/XTextResourceSetFactory.java +++ b/plugins/org.eclipse.sirius.common.xtext/src/org/eclipse/sirius/common/xtext/internal/XTextResourceSetFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2014 THALES GLOBAL SERVICES and others. + * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -32,6 +32,7 @@ import org.eclipse.jdt.core.JavaModelException; import org.eclipse.sirius.common.tools.DslCommonPlugin; import org.eclipse.xtext.resource.XtextResourceSet; import org.eclipse.xtext.ui.util.JdtClasspathUriResolver; +import org.osgi.framework.Constants; /** * Class overriding the default {@link ResourceSet} factory to correctly setup @@ -89,7 +90,7 @@ public class XTextResourceSetFactory extends org.eclipse.sirius.common.tools.api IClasspathEntry[] classpath = javaProject.getResolvedClasspath(true); for (IClasspathEntry classPathEntry : classpath) { IPath path = classPathEntry.getPath(); - if (path != null && "jar".equals(path.getFileExtension())) { + if (path != null && "jar".equals(path.getFileExtension())) { //$NON-NLS-1$ try { final File file = path.toFile(); if (file != null && file.exists()) { @@ -111,16 +112,16 @@ public class XTextResourceSetFactory extends org.eclipse.sirius.common.tools.api } private void handleManifest(HashMap<URI, URI> hashMap, final File file, Manifest manifest) { - String name = manifest.getMainAttributes().getValue("Bundle-SymbolicName"); + String name = manifest.getMainAttributes().getValue(Constants.BUNDLE_SYMBOLICNAME_ATTRIBUTE); if (name != null) { final int indexOf = name.indexOf(';'); if (indexOf > 0) name = name.substring(0, indexOf); if (!EcorePlugin.getPlatformResourceMap().containsKey(name)) { - String p = "archive:" + file.toURI() + "!/"; + String p = "archive:" + file.toURI() + "!/"; //$NON-NLS-1$ //$NON-NLS-2$ URI uri = URI.createURI(p); - final URI platformResourceKey = URI.createPlatformResourceURI(name + "/", false); - final URI platformPluginKey = URI.createPlatformPluginURI(name + "/", false); + final URI platformResourceKey = URI.createPlatformResourceURI(name + "/", false); //$NON-NLS-1$ + final URI platformPluginKey = URI.createPlatformPluginURI(name + "/", false); //$NON-NLS-1$ hashMap.put(platformResourceKey, uri); hashMap.put(platformPluginKey, uri); } |
