Skip to content

Commit

Permalink
fix NON-NLS warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
EcljpseB0T authored and akurtakov committed Nov 29, 2023
1 parent 66d3224 commit bcc43b1
Show file tree
Hide file tree
Showing 27 changed files with 52 additions and 73 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ private void setInstall(List<String> lines, LauncherData launcherData, File laun
}
File folder = ParserUtils.fromOSGiJarToOSGiInstallArea(launcherData.getFwJar().getAbsolutePath());
if (Constants.OS_MACOSX.equals(launcherData.getOS())) {
folder = new File(folder, "../MacOS");
folder = new File(folder, "../MacOS"); //$NON-NLS-1$
}
if (!folder.equals(launcherFolder)) {
// Launcher will replace "@launcher.dir" with actual path. See bug 572890.
ParserUtils.setValueForArgument(EquinoxConstants.OPTION_INSTALL, "@launcher.dir/", lines);
ParserUtils.setValueForArgument(EquinoxConstants.OPTION_INSTALL, "@launcher.dir/", lines); //$NON-NLS-1$
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ static File toFile(URL url) {
File file = URIUtil.toFile(uri);
if (file == null) {
// fall back to path of URL in catch block
throw new URISyntaxException(uri.toString(), "file URL does not represent a local file");
throw new URISyntaxException(uri.toString(), "file URL does not represent a local file"); //$NON-NLS-1$
}
return file;
} catch (URISyntaxException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public IArtifactKey getArtifactKey() {
@Override
public IStatus getResult() {
if (result == DEFAULT_STATUS)
return new Status(IStatus.ERROR, Activator.ID, "No repository found containing: " + getArtifactKey().toString());
return new Status(IStatus.ERROR, Activator.ID, "No repository found containing: " + getArtifactKey().toString()); //$NON-NLS-1$

return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
* An OSGi console command provider that adds various commands for interacting
* with the provisioning system.
*/
@SuppressWarnings("nls")
public class ProvCommandProvider implements CommandProvider {
private static final String WILDCARD_ANY = "*"; //$NON-NLS-1$
public static final String NEW_LINE = "\r\n"; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ TarEntry getNextEntryInternal() throws TarException, IOException {
long fileMode = Long.decode(mode.toString()).longValue();
entry.setMode(fileMode);
} catch (NumberFormatException nfe) {
throw new TarException("Not a valid TAR format.", nfe);
throw new TarException("Not a valid TAR format.", nfe); //$NON-NLS-1$
}

pos = 100 + 24;
Expand All @@ -249,7 +249,7 @@ TarEntry getNextEntryInternal() throws TarException, IOException {
try {
fileSize = Integer.decode(size.toString()).intValue();
} catch (NumberFormatException nfe) {
throw new TarException("Not a valid TAR format.", nfe);
throw new TarException("Not a valid TAR format.", nfe); //$NON-NLS-1$
}

entry.setSize(fileSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ protected IEclipsePreferences getLoadLevel() {

@Override
protected synchronized void save() throws BackingStoreException {
throw new BackingStoreException("Can't store in shared install");
throw new BackingStoreException("Can't store in shared install"); //$NON-NLS-1$
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public synchronized long[] listProfileTimestamps(String id) {
if (!profileDirectory.isDirectory())
return new long[0];

File[] profileFiles = profileDirectory.listFiles((FileFilter) pathname -> (pathname.getName().endsWith(PROFILE_EXT) || pathname.getName().endsWith(PROFILE_GZ_EXT)) && pathname.isFile() && !pathname.getName().startsWith("._"));
File[] profileFiles = profileDirectory.listFiles((FileFilter) pathname -> (pathname.getName().endsWith(PROFILE_EXT) || pathname.getName().endsWith(PROFILE_GZ_EXT)) && pathname.isFile() && !pathname.getName().startsWith("._")); //$NON-NLS-1$

long[] timestamps = new long[profileFiles.length];
for (int i = 0; i < profileFiles.length; i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,17 @@ public void execute() {
validate();
IMetadataRepositoryManager manager = getAgent().getService(IMetadataRepositoryManager.class);
if (manager == null)
throw new BuildException("Unable to aquire metadata repository manager service.");
throw new BuildException("Unable to aquire metadata repository manager service."); //$NON-NLS-1$

// load the composite repository
CompositeMetadataRepository repo = null;
try {
repo = (CompositeMetadataRepository) manager.loadRepository(location, null);
} catch (ClassCastException e) {
throw new BuildException("Repository at location: " + location + " is not a composite metadata repository.");
throw new BuildException(
"Repository at location: " + location + " is not a composite metadata repository."); //$NON-NLS-1$ //$NON-NLS-2$
} catch (ProvisionException e) {
throw new BuildException("Error occurred while loading repository.", e);
throw new BuildException("Error occurred while loading repository.", e); //$NON-NLS-1$
}

// add the child
Expand All @@ -56,9 +57,9 @@ public void execute() {
*/
private void validate() {
if (location == null)
throw new BuildException("Need to specify the composite repository location.");
throw new BuildException("Need to specify the composite repository location."); //$NON-NLS-1$
if (child == null)
throw new BuildException("Need to specify the child repository location.");
throw new BuildException("Need to specify the child repository location."); //$NON-NLS-1$
}

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/**
* Ant task for creating a new composite metadata repository.
*/
@SuppressWarnings("nls")
public class CreateCompositeMetadataRepositoryTask extends AbstractMDRTask {

URI location; // desired location of the composite repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public class RemoveChildTask extends AbstractMDRTask {
public void execute() {
IMetadataRepositoryManager manager = getAgent().getService(IMetadataRepositoryManager.class);
if (manager == null)
throw new BuildException("Unable to aquire metadata repository manager service.");
throw new BuildException("Unable to aquire metadata repository manager service."); //$NON-NLS-1$

CompositeMetadataRepository repo;
try {
repo = (CompositeMetadataRepository) manager.loadRepository(location, null);
} catch (ProvisionException e) {
throw new BuildException("Error occurred while loading repository.", e);
throw new BuildException("Error occurred while loading repository.", e); //$NON-NLS-1$
}

// remove all the children repositories if requested, otherwise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ private Set<IInstallableUnit> getRoots() {
Set<IInstallableUnit> allRoots = profile.query(new IUProfilePropertyQuery(INCLUSION_RULES, IUProfilePropertyQuery.ANY), null).toSet();
if (!honorSharedSettings)
return allRoots;
IQueryResult<IInstallableUnit> baseRoots = profile.query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.base", Boolean.TRUE.toString()), null);
IQueryResult<IInstallableUnit> baseRoots = profile.query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.base", Boolean.TRUE.toString()), null); //$NON-NLS-1$
allRoots.removeAll(baseRoots.toUnmodifiableSet());
return allRoots;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public static boolean guessUnpack(BundleDescription bundle, String[] classpath)
return false;

for (String classpath1 : classpath) {
if (classpath1.equals(".")) {
if (classpath1.equals(".")) { //$NON-NLS-1$
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,55 +15,25 @@
*******************************************************************************/
package org.eclipse.equinox.p2.internal.repository.tools;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.OutputStream;
import java.io.*;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;

import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.URIUtil;
import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
import org.eclipse.equinox.frameworkadmin.BundleInfo;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.engine.DownloadManager;
import org.eclipse.equinox.internal.p2.engine.InstallableUnitOperand;
import org.eclipse.equinox.internal.p2.engine.InstallableUnitPhase;
import org.eclipse.equinox.internal.p2.engine.Phase;
import org.eclipse.equinox.internal.p2.engine.PhaseSet;
import org.eclipse.equinox.internal.p2.engine.ProfileWriter;
import org.eclipse.equinox.internal.p2.engine.ProfileXMLConstants;
import org.eclipse.equinox.internal.p2.engine.*;
import org.eclipse.equinox.internal.p2.engine.phases.Collect;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IEngine;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.engine.IProvisioningPlan;
import org.eclipse.equinox.p2.engine.ProvisioningContext;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.IProvidedCapability;
import org.eclipse.equinox.p2.metadata.*;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.query.QueryUtil;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRequest;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.simpleconfigurator.manipulator.SimpleConfiguratorManipulator;

Expand All @@ -75,6 +45,7 @@
*
* @since 1.0
*/
@SuppressWarnings("nls")
public class Repo2Runnable extends AbstractApplication implements IApplication {
private static final String NATIVE_ARTIFACTS = "nativeArtifacts"; //$NON-NLS-1$
private static final String NATIVE_TYPE = "org.eclipse.equinox.p2.native"; //$NON-NLS-1$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;

@SuppressWarnings("nls")
public class RepositoryAnalyzerApplication implements IApplication {

private URI uri = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
/**
* This service checks that all Group IUs have a copyright.
*/
@SuppressWarnings("nls")
public class CopyrightAnalyzer extends IUAnalyzer {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void analyzeIU(IInstallableUnit iu) {
VersionRange range = RequiredCapability.extractRange(hostMatch);
IQueryResult<IInstallableUnit> results = repository.query(QueryUtil.createIUQuery(name, range), new NullProgressMonitor());
if (results.isEmpty()) {
error(iu, "IU Fragment: " + iu.getId() + " cannot find host" + name + " : " + range);
error(iu, "IU Fragment: " + iu.getId() + " cannot find host" + name + " : " + range); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ public void analyzeIU(IInstallableUnit iu) {

@Override
public IStatus postAnalysis() {
System.out.println("Total IUs: " + totalIUs);
System.out.println(" Total Groups: " + totalGroups);
System.out.println(" Total Fragments: " + totalFragments);
System.out.println(" Total Categories: " + totalCategories);
System.out.println("Total IUs: " + totalIUs); //$NON-NLS-1$
System.out.println(" Total Groups: " + totalGroups); //$NON-NLS-1$
System.out.println(" Total Fragments: " + totalFragments); //$NON-NLS-1$
System.out.println(" Total Categories: " + totalCategories); //$NON-NLS-1$
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/**
* This service checks that each IU has a license.
*/
@SuppressWarnings("nls")
public class LicenseAnalyzer extends IUAnalyzer {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public class UniqueIUAnalyzer extends IUAnalyzer {
@Override
public void analyzeIU(IInstallableUnit iu) {
// Create a unique name / version pair and cache it
String uniqueID = iu.getId() + ":" + iu.getVersion().toString();
String uniqueID = iu.getId() + ":" + iu.getVersion().toString(); //$NON-NLS-1$
if (versionedNames.contains(uniqueID)) {
error(iu, "[ERROR]" + iu.getId() + " with version: " + iu.getVersion() + " already exists in the repository");
error(iu, "[ERROR]" + iu.getId() + " with version: " + iu.getVersion() + " already exists in the repository"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
return;
}
versionedNames.add(uniqueID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,19 @@ public class UnzipFeatureJarAnalyzer extends IUAnalyzer {

@Override
public void analyzeIU(IInstallableUnit iu) {
if (iu.getId().indexOf("feature.jar") > -1) {
if (iu.getId().indexOf("feature.jar") > -1) { //$NON-NLS-1$
Collection<ITouchpointData> touchpointData = iu.getTouchpointData();
if (touchpointData.size() == 0) {
error(iu, "[ERROR] No unzip touchpoint for: " + iu.getId());
error(iu, "[ERROR] No unzip touchpoint for: " + iu.getId()); //$NON-NLS-1$
} else {
boolean found = false;
for (ITouchpointData td : touchpointData) {
ITouchpointInstruction instruction = td.getInstruction("zipped");
if (instruction.getBody().equals("true"))
ITouchpointInstruction instruction = td.getInstruction("zipped"); //$NON-NLS-1$
if (instruction.getBody().equals("true")) //$NON-NLS-1$
found = true;
}
if (!found) {
error(iu, "[ERROR] No unzip touchpoint for: " + iu.getId());
error(iu, "[ERROR] No unzip touchpoint for: " + iu.getId()); //$NON-NLS-1$
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* 1. No 0.0.0
* 2. No x.y.z.qualifier (each qualifier has been replaced)
*/
@SuppressWarnings("nls")
public class VersionAnalyzer extends IUAnalyzer {

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
/**
* Ant task for creating a new composite artifact repository.
*/
@SuppressWarnings("nls")
public class CreateCompositeArtifactRepositoryTask extends Task {

URI location; // desired location of the composite repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ private CatalogItem processCatalogItem(IMetadataRepository repository, IInstalla

public String getProperty(IInstallableUnit candidate, String key) {
String value = TranslationSupport.getInstance().getIUProperty(candidate, key);
return (value != null) ? value : "";
return (value != null) ? value : ""; //$NON-NLS-1$
}

private AbstractCatalogSource getSource(IMetadataRepository repository) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public class MigrationPage extends WizardPage implements ISelectableIUsPage, Lis
static IProvisioningAgent agent = null;
protected Button updateToLatest;

public static final String REMIND_ME_LATER = "remindMeToMigrateLater";
public static final String REMIND_ME_LATER = "remindMeToMigrateLater"; //$NON-NLS-1$

IProfile profile = null;

Expand Down Expand Up @@ -944,7 +944,7 @@ public static boolean loadCustomizedSetting() {
IScopeContext[] contexts = new IScopeContext[] { InstanceScope.INSTANCE, DefaultScope.INSTANCE,
BundleDefaultsScope.INSTANCE, ConfigurationScope.INSTANCE };
boolean updateToLatest = Platform.getPreferencesService().getBoolean(AutomaticUpdatePlugin.PLUGIN_ID,
"updateToLatest", false, contexts);
"updateToLatest", false, contexts); //$NON-NLS-1$
return updateToLatest;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ protected Collection<IInstallableUnit> findUnitstoMigrate(IProfile previousProfi
private Set<IInstallableUnit> getUserRoots(IProfile previousProfile) {
IQueryResult<IInstallableUnit> allRoots = previousProfile.query(new UserVisibleRootQuery(), null);
Set<IInstallableUnit> rootsFromTheBase = previousProfile
.query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.base", "true"), null).toUnmodifiableSet();
.query(new IUProfilePropertyQuery("org.eclipse.equinox.p2.base", "true"), null).toUnmodifiableSet(); //$NON-NLS-1$ //$NON-NLS-2$
Set<IInstallableUnit> userRoots = allRoots.toSet();
userRoots.removeAll(rootsFromTheBase);
return userRoots;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ protected IDialogSettings getDialogBoundsSettings() {
if (section == null) {
section = settings.addNewSection(wizard.getDialogSettingsSectionName());
// Set initial bound values for the MigrationWizardDialog so that it does not cover all the height of the screen when migrating a large set of IUs.
section.put("DIALOG_WIDTH", 883);
section.put("DIALOG_HEIGHT", 691);
section.put("DIALOG_WIDTH", 883); //$NON-NLS-1$
section.put("DIALOG_HEIGHT", 691); //$NON-NLS-1$

}
return section;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ public void updateBundles(Manipulator manipulator) throws IOException {
Properties properties = new Properties();
String[] jvmArgs = manipulator.getLauncherData().getJvmArgs();
for (String jvmArg : jvmArgs) {
if (jvmArg.startsWith("-D")) {
if (jvmArg.startsWith("-D")) { //$NON-NLS-1$
// $NON-NLS-1$
int index = jvmArg.indexOf("="); //$NON-NLS-1$
if (index > 0 && jvmArg.length() > 2) {
Expand Down

0 comments on commit bcc43b1

Please sign in to comment.