1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-08 10:16:03 +02:00

2004-09-22 Chris Wiebe

show warnings instead of errors for invalid filenames
	workaround for bug#24152
	* index/org/eclipse/cdt/internal/core/messages.properties
	* src/org/eclipse/cdt/core/CConventions.java
This commit is contained in:
Chris Wiebe 2004-09-22 20:34:39 +00:00
parent de94789d8d
commit cb338485bf
3 changed files with 13 additions and 1 deletions

View file

@ -1,3 +1,10 @@
2004-09-22 Chris Wiebe
show warnings instead of errors for invalid filenames
workaround for bug#24152
* index/org/eclipse/cdt/internal/core/messages.properties
* src/org/eclipse/cdt/core/CConventions.java
2004-09-22 Chris Wiebe 2004-09-22 Chris Wiebe
added file naming conventions added file naming conventions

View file

@ -44,6 +44,7 @@ convention.namespace.invalidName= Namespace is invalid
convention.filename.nullName=File name is blank convention.filename.nullName=File name is blank
convention.filename.invalid=File name contains illegal characters convention.filename.invalid=File name contains illegal characters
convention.filename.possiblyInvalid=File name contains non-standard or illegal characters
convention.filename.nameWithBlanks=File name contains spaces convention.filename.nameWithBlanks=File name contains spaces
convention.headerFilename.filetype=File extension does not correspond to known header file types convention.headerFilename.filetype=File extension does not correspond to known header file types
convention.sourceFilename.filetype=File extension does not correspond to known source file types convention.sourceFilename.filetype=File extension does not correspond to known source file types

View file

@ -326,6 +326,8 @@ public class CConventions {
return false; return false;
} }
//TODO we need platform-independent validation, see bug#24152
int len = name.length(); int len = name.length();
// if (Character.isWhitespace(name.charAt(0)) || Character.isWhitespace(name.charAt(len - 1))) { // if (Character.isWhitespace(name.charAt(0)) || Character.isWhitespace(name.charAt(len - 1))) {
// return false; // return false;
@ -358,7 +360,9 @@ public class CConventions {
return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.nullName"), null); //$NON-NLS-1$ return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.nullName"), null); //$NON-NLS-1$
} }
if (!isLegalFilename(name)) { if (!isLegalFilename(name)) {
return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.invalid"), null); //$NON-NLS-1$ //TODO we need platform-independent validation, see bug#24152
//return new Status(IStatus.ERROR, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.invalid"), null); //$NON-NLS-1$
return new Status(IStatus.WARNING, CCorePlugin.PLUGIN_ID, -1, Util.bind("convention.filename.possiblyInvalid"), null); //$NON-NLS-1$
} }
String trimmed = name.trim(); String trimmed = name.trim();