mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-21 07:05:58 +02:00
[cleanup] compiler warnings
This commit is contained in:
parent
9231857606
commit
11098079b2
3 changed files with 50 additions and 50 deletions
|
@ -55,8 +55,8 @@ import org.eclipse.rse.persistence.dom.RSEDOMNodeAttribute;
|
||||||
*/
|
*/
|
||||||
public class PropertyFileProvider implements IRSEPersistenceProvider {
|
public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
|
|
||||||
private static final String NULL_VALUE_STRING = "null";
|
private static final String NULL_VALUE_STRING = "null"; //$NON-NLS-1$
|
||||||
private static final String PROPERTIES_FILE_NAME = "node.properties";
|
private static final String PROPERTIES_FILE_NAME = "node.properties"; //$NON-NLS-1$
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Metatype names
|
* Metatype names
|
||||||
|
@ -65,27 +65,30 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
* Names must not contain periods or whitespace.
|
* Names must not contain periods or whitespace.
|
||||||
* Lowercase letters, numbers and dashes (-) are preferred.
|
* Lowercase letters, numbers and dashes (-) are preferred.
|
||||||
*/
|
*/
|
||||||
private static final String[] MT_ATTRIBUTE_TYPE = new String[] {"04-attr-type", "attr-type"};
|
private static final String[] MT_ATTRIBUTE_TYPE = new String[] {"04-attr-type", "attr-type"}; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
private static final String[] MT_ATTRIBUTE = new String[] {"03-attr", "attr"};
|
private static final String[] MT_ATTRIBUTE = new String[] {"03-attr", "attr"}; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
private static final String[] MT_CHILD = new String[] {"06-child", "child"};
|
private static final String[] MT_CHILD = new String[] {"06-child", "child"}; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
private static final String[] MT_NODE_TYPE = new String[] {"01-type", "01-node-type", "n-type"};
|
private static final String[] MT_NODE_TYPE = new String[] {"01-type", "01-node-type", "n-type"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
private static final String[] MT_NODE_NAME = new String[] {"00-name", "00-node-name", "n-name"};
|
private static final String[] MT_NODE_NAME = new String[] {"00-name", "00-node-name", "n-name"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
private static final String[] MT_REFERENCE = new String[] {"05-ref", "ref"};
|
private static final String[] MT_REFERENCE = new String[] {"05-ref", "ref"}; //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
|
|
||||||
/* Type abbreviations */
|
/* Type abbreviations */
|
||||||
private static final String AB_SUBSYSTEM = "SS";
|
private static final String AB_SUBSYSTEM = "SS"; //$NON-NLS-1$
|
||||||
private static final String AB_SERVICE_LAUNCHER = "SL";
|
private static final String AB_SERVICE_LAUNCHER = "SL"; //$NON-NLS-1$
|
||||||
private static final String AB_PROPERTY_SET = "PS";
|
private static final String AB_PROPERTY_SET = "PS"; //$NON-NLS-1$
|
||||||
private static final String AB_PROPERTY = "P";
|
private static final String AB_PROPERTY = "P"; //$NON-NLS-1$
|
||||||
private static final String AB_HOST = "H";
|
private static final String AB_HOST = "H"; //$NON-NLS-1$
|
||||||
private static final String AB_FILTER_STRING = "FS";
|
private static final String AB_FILTER_STRING = "FS"; //$NON-NLS-1$
|
||||||
private static final String AB_FILTER_POOL_REFERENCE = "FPR";
|
private static final String AB_FILTER_POOL_REFERENCE = "FPR"; //$NON-NLS-1$
|
||||||
private static final String AB_FILTER_POOL = "FP";
|
private static final String AB_FILTER_POOL = "FP"; //$NON-NLS-1$
|
||||||
private static final String AB_FILTER = "F";
|
private static final String AB_FILTER = "F"; //$NON-NLS-1$
|
||||||
private static final String AB_CONNECTOR_SERVICE = "CS";
|
private static final String AB_CONNECTOR_SERVICE = "CS"; //$NON-NLS-1$
|
||||||
private static final String AB_PROFILE = "PRF";
|
private static final String AB_PROFILE = "PRF"; //$NON-NLS-1$
|
||||||
|
|
||||||
|
private Pattern period = Pattern.compile("\\."); //$NON-NLS-1$
|
||||||
|
private Pattern suffixPattern = Pattern.compile("_(\\d+)$"); //$NON-NLS-1$
|
||||||
|
private Pattern unicodePattern = Pattern.compile("#(\\p{XDigit}+)#"); //$NON-NLS-1$
|
||||||
|
|
||||||
private Pattern period = Pattern.compile("\\.");
|
|
||||||
private Map typeQualifiers = getTypeQualifiers();
|
private Map typeQualifiers = getTypeQualifiers();
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -180,7 +183,7 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
removeFolders(nodeFolder, childFolderNames);
|
removeFolders(nodeFolder, childFolderNames);
|
||||||
String propertiesFileName = PROPERTIES_FILE_NAME;
|
String propertiesFileName = PROPERTIES_FILE_NAME;
|
||||||
IFile propertiesFile = nodeFolder.getFile(propertiesFileName);
|
IFile propertiesFile = nodeFolder.getFile(propertiesFileName);
|
||||||
writeProperties(properties, "RSE DOM Node", propertiesFile);
|
writeProperties(properties, "RSE DOM Node", propertiesFile); //$NON-NLS-1$
|
||||||
return nodeFolderName;
|
return nodeFolderName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -226,8 +229,8 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String VALID = "abcdefghijklmnopqrstuvwxyz0123456789-._";
|
private static final String VALID = "abcdefghijklmnopqrstuvwxyz0123456789-._"; //$NON-NLS-1$
|
||||||
private static final String UPPER = "ABCDEFGHIJKLMNOPQRTSUVWXYZ";
|
private static final String UPPER = "ABCDEFGHIJKLMNOPQRTSUVWXYZ"; //$NON-NLS-1$
|
||||||
/**
|
/**
|
||||||
* Transforms an arbitrary name into one that can be used in any file system
|
* Transforms an arbitrary name into one that can be used in any file system
|
||||||
* that supports long names. The transformation appends a number to the name
|
* that supports long names. The transformation appends a number to the name
|
||||||
|
@ -263,7 +266,7 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
buf.append('#');
|
buf.append('#');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
name = buf.toString() + "_" + Long.toString(suffix);
|
name = buf.toString() + "_" + Long.toString(suffix); //$NON-NLS-1$
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -275,7 +278,6 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
*/
|
*/
|
||||||
private String thaw(String name) {
|
private String thaw(String name) {
|
||||||
String result = name;
|
String result = name;
|
||||||
Pattern suffixPattern = Pattern.compile("_(\\d+)$");
|
|
||||||
Matcher m = suffixPattern.matcher(name);
|
Matcher m = suffixPattern.matcher(name);
|
||||||
if (m.find()) {
|
if (m.find()) {
|
||||||
String root = name.substring(0, m.start());
|
String root = name.substring(0, m.start());
|
||||||
|
@ -289,7 +291,6 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String thawUnicode(String name) {
|
private String thawUnicode(String name) {
|
||||||
Pattern unicodePattern = Pattern.compile("#(\\p{XDigit}+)#");
|
|
||||||
Matcher m = unicodePattern.matcher(name);
|
Matcher m = unicodePattern.matcher(name);
|
||||||
StringBuffer b = new StringBuffer();
|
StringBuffer b = new StringBuffer();
|
||||||
int p0 = 0;
|
int p0 = 0;
|
||||||
|
@ -352,14 +353,14 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
// System.out.println("writing "+file.getFullPath()+"...");
|
// System.out.println("writing "+file.getFullPath()+"...");
|
||||||
ByteArrayOutputStream outStream = new ByteArrayOutputStream(500);
|
ByteArrayOutputStream outStream = new ByteArrayOutputStream(500);
|
||||||
PrintWriter out = new PrintWriter(outStream);
|
PrintWriter out = new PrintWriter(outStream);
|
||||||
out.println("# " + header);
|
out.println("# " + header); //$NON-NLS-1$
|
||||||
Map map = new TreeMap(properties);
|
Map map = new TreeMap(properties);
|
||||||
Set keys = map.keySet();
|
Set keys = map.keySet();
|
||||||
|
|
||||||
for (Iterator z = keys.iterator(); z.hasNext();) {
|
for (Iterator z = keys.iterator(); z.hasNext();) {
|
||||||
String key = (String) z.next();
|
String key = (String) z.next();
|
||||||
String value = (String)map.get(key);
|
String value = (String)map.get(key);
|
||||||
String keyvalue = key + "=" + escapeValue(value);
|
String keyvalue = key + "=" + escapeValue(value); //$NON-NLS-1$
|
||||||
// System.out.println("writing "+keyvalue);
|
// System.out.println("writing "+keyvalue);
|
||||||
out.println(keyvalue);
|
out.println(keyvalue);
|
||||||
}
|
}
|
||||||
|
@ -401,7 +402,7 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
*/
|
*/
|
||||||
private String getIndexString(int i) {
|
private String getIndexString(int i) {
|
||||||
if (i < 0 || i > 99999) throw new IllegalArgumentException("Argument must be between 0 and 99999");
|
if (i < 0 || i > 99999) throw new IllegalArgumentException("Argument must be between 0 and 99999");
|
||||||
String index = "00000" + Integer.toString(i);
|
String index = "00000" + Integer.toString(i); //$NON-NLS-1$
|
||||||
index = index.substring(index.length() - 5);
|
index = index.substring(index.length() - 5);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
@ -429,21 +430,21 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
for (int i = 0; i < characters.length; i++) {
|
for (int i = 0; i < characters.length; i++) {
|
||||||
char c = characters[i];
|
char c = characters[i];
|
||||||
if (c == '\\') {
|
if (c == '\\') {
|
||||||
buffer.append("\\\\");
|
buffer.append("\\\\"); //$NON-NLS-1$
|
||||||
} else if (c == '\t') {
|
} else if (c == '\t') {
|
||||||
buffer.append("\\t");
|
buffer.append("\\t"); //$NON-NLS-1$
|
||||||
} else if (c == '\f') {
|
} else if (c == '\f') {
|
||||||
buffer.append("\\f");
|
buffer.append("\\f"); //$NON-NLS-1$
|
||||||
} else if (c == '\n') {
|
} else if (c == '\n') {
|
||||||
buffer.append("\\n");
|
buffer.append("\\n"); //$NON-NLS-1$
|
||||||
} else if (c == '\r') {
|
} else if (c == '\r') {
|
||||||
buffer.append("\\r");
|
buffer.append("\\r"); //$NON-NLS-1$
|
||||||
} else if ((c < '\u0020' && c > '\u007E')) {
|
} else if ((c < '\u0020' && c > '\u007E')) {
|
||||||
String cString = "0000" + Integer.toHexString(c);
|
String cString = "0000" + Integer.toHexString(c); //$NON-NLS-1$
|
||||||
cString = cString.substring(cString.length() - 4);
|
cString = cString.substring(cString.length() - 4);
|
||||||
cString = "\\u" + cString;
|
cString = "\\u" + cString; //$NON-NLS-1$
|
||||||
buffer.append(cString);
|
buffer.append(cString);
|
||||||
} else if ("=!#:".indexOf(c) >= 0) {
|
} else if ("=!#:".indexOf(c) >= 0) { //$NON-NLS-1$
|
||||||
buffer.append('\\');
|
buffer.append('\\');
|
||||||
buffer.append(c);
|
buffer.append(c);
|
||||||
} else {
|
} else {
|
||||||
|
@ -753,7 +754,7 @@ public class PropertyFileProvider implements IRSEPersistenceProvider {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
}
|
}
|
||||||
//IFolder providerFolder = getFolder(project, "org.eclipse.rse.dom.properties");
|
//IFolder providerFolder = getFolder(project, "org.eclipse.rse.dom.properties");
|
||||||
IFolder providerFolder = getFolder(project, "dom.properties");
|
IFolder providerFolder = getFolder(project, "dom.properties"); //$NON-NLS-1$
|
||||||
return providerFolder;
|
return providerFolder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ import org.eclipse.core.runtime.IExtensionRegistry;
|
||||||
import org.eclipse.core.runtime.IProgressMonitor;
|
import org.eclipse.core.runtime.IProgressMonitor;
|
||||||
import org.eclipse.core.runtime.IStatus;
|
import org.eclipse.core.runtime.IStatus;
|
||||||
import org.eclipse.core.runtime.Platform;
|
import org.eclipse.core.runtime.Platform;
|
||||||
import org.eclipse.core.runtime.Status;
|
|
||||||
import org.eclipse.core.runtime.jobs.Job;
|
import org.eclipse.core.runtime.jobs.Job;
|
||||||
import org.eclipse.rse.core.RSECorePlugin;
|
import org.eclipse.rse.core.RSECorePlugin;
|
||||||
import org.eclipse.rse.core.filters.ISystemFilter;
|
import org.eclipse.rse.core.filters.ISystemFilter;
|
||||||
|
@ -68,7 +67,7 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
|
||||||
private RSEDOMImporter _importer;
|
private RSEDOMImporter _importer;
|
||||||
|
|
||||||
private static IProject remoteSystemsProject = null;
|
private static IProject remoteSystemsProject = null;
|
||||||
public static final String RESOURCE_PROJECT_NAME = "RemoteSystemsConnections";
|
public static final String RESOURCE_PROJECT_NAME = "RemoteSystemsConnections"; //$NON-NLS-1$
|
||||||
|
|
||||||
private ISystemRegistry _registry;
|
private ISystemRegistry _registry;
|
||||||
private ISystemProfileManager _profileManager;
|
private ISystemProfileManager _profileManager;
|
||||||
|
@ -111,15 +110,15 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
|
||||||
IRSEPersistenceProvider provider = (IRSEPersistenceProvider) loadedProviders.get(id);
|
IRSEPersistenceProvider provider = (IRSEPersistenceProvider) loadedProviders.get(id);
|
||||||
if (provider == null) {
|
if (provider == null) {
|
||||||
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
IExtensionRegistry registry = Platform.getExtensionRegistry();
|
||||||
IConfigurationElement[] providerCandidates = registry.getConfigurationElementsFor("org.eclipse.rse.core", "persistenceProviders");
|
IConfigurationElement[] providerCandidates = registry.getConfigurationElementsFor("org.eclipse.rse.core", "persistenceProviders"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||||
for (int j = 0; j < providerCandidates.length; j++) {
|
for (int j = 0; j < providerCandidates.length; j++) {
|
||||||
IConfigurationElement providerCandidate = providerCandidates[j];
|
IConfigurationElement providerCandidate = providerCandidates[j];
|
||||||
if (providerCandidate.getName().equals("persistenceProvider")) {
|
if (providerCandidate.getName().equals("persistenceProvider")) { //$NON-NLS-1$
|
||||||
String candidateId = providerCandidate.getAttribute("id");
|
String candidateId = providerCandidate.getAttribute("id"); //$NON-NLS-1$
|
||||||
if (candidateId != null) {
|
if (candidateId != null) {
|
||||||
if (candidateId.equals(id)) {
|
if (candidateId.equals(id)) {
|
||||||
try {
|
try {
|
||||||
provider = (IRSEPersistenceProvider) providerCandidate.createExecutableExtension("class");
|
provider = (IRSEPersistenceProvider) providerCandidate.createExecutableExtension("class"); //$NON-NLS-1$
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
logger.logError("Exception loading persistence provider", e); // DWD nls
|
logger.logError("Exception loading persistence provider", e); // DWD nls
|
||||||
}
|
}
|
||||||
|
@ -144,7 +143,7 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
|
||||||
* TODO: need to determine what this is. Having more than one is problematic.
|
* TODO: need to determine what this is. Having more than one is problematic.
|
||||||
*/
|
*/
|
||||||
public IRSEPersistenceProvider getRSEPersistenceProvider() {
|
public IRSEPersistenceProvider getRSEPersistenceProvider() {
|
||||||
IRSEPersistenceProvider provider = getRSEPersistenceProvider("org.eclipse.rse.persistence.PropertyFileProvider");
|
IRSEPersistenceProvider provider = getRSEPersistenceProvider("org.eclipse.rse.persistence.PropertyFileProvider"); //$NON-NLS-1$
|
||||||
return provider;
|
return provider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -178,7 +177,7 @@ public class RSEPersistenceManager implements IRSEPersistenceManager {
|
||||||
commit(profiles[idx]);
|
commit(profiles[idx]);
|
||||||
} catch (Exception exc) {
|
} catch (Exception exc) {
|
||||||
exc.printStackTrace();
|
exc.printStackTrace();
|
||||||
System.out.println("Error saving profile " + profiles[idx] + ": " + exc.getClass().getName() + " " + exc.getMessage());
|
System.out.println("Error saving profile " + profiles[idx] + ": " + exc.getClass().getName() + " " + exc.getMessage()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,7 +66,7 @@ public class SerializingProvider implements IRSEPersistenceProvider
|
||||||
IResource child = children[0];
|
IResource child = children[0];
|
||||||
if (child.getType() == IResource.FILE) {
|
if (child.getType() == IResource.FILE) {
|
||||||
String profileName = candidateFolder.getName();
|
String profileName = candidateFolder.getName();
|
||||||
String domFileName = profileName + ".rsedom";
|
String domFileName = profileName + ".rsedom"; //$NON-NLS-1$
|
||||||
String childName = child.getName();
|
String childName = child.getName();
|
||||||
if (childName.equals(domFileName)) {
|
if (childName.equals(domFileName)) {
|
||||||
names.add(profileName);
|
names.add(profileName);
|
||||||
|
@ -147,7 +147,7 @@ public class SerializingProvider implements IRSEPersistenceProvider
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return folder.getFile(domName + ".rsedom");
|
return folder.getFile(domName + ".rsedom"); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue