Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 118341 Details for
Bug 255345
Problems in new NamingConventions APIs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Proposed fix
bug255345_001.txt (text/plain), 21.88 KB, created by
David Audel
on 2008-11-20 04:31:26 EST
(
hide
)
Description:
Proposed fix
Filename:
MIME Type:
Creator:
David Audel
Created:
2008-11-20 04:31:26 EST
Size:
21.88 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.core >Index: model/org/eclipse/jdt/internal/core/InternalNamingConventions.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/InternalNamingConventions.java,v >retrieving revision 1.22 >diff -u -r1.22 InternalNamingConventions.java >--- model/org/eclipse/jdt/internal/core/InternalNamingConventions.java 22 Oct 2008 08:27:57 -0000 1.22 >+++ model/org/eclipse/jdt/internal/core/InternalNamingConventions.java 20 Nov 2008 09:08:26 -0000 >@@ -282,12 +282,16 @@ > } > > private static char[][] computeBaseTypeNames(char[] typeName, boolean isConstantField, char[][] excludedNames){ >- char[] name = computeBaseTypeNames(typeName[0], excludedNames); >- if(name != null) { >- return new char[][]{name}; >+ if (isConstantField) { >+ return computeNonBaseTypeNames(typeName, isConstantField); > } else { >- // compute variable name like from non base type >- return computeNonBaseTypeNames(typeName, isConstantField); >+ char[] name = computeBaseTypeNames(typeName[0], excludedNames); >+ if(name != null) { >+ return new char[][]{name}; >+ } else { >+ // compute variable name like from non base type >+ return computeNonBaseTypeNames(typeName, isConstantField); >+ } > } > } > private static char[] computeBaseTypeNames(char firstName, char[][] excludedNames){ >@@ -344,7 +348,11 @@ > } > > if (length == 1) { >- return new char[][]{CharOperation.toLowerCase(sourceName)}; >+ if (isConstantField) { >+ return generateConstantName(new char[][]{CharOperation.toLowerCase(sourceName)}, 0); >+ } else { >+ return generateNonConstantName(new char[][]{CharOperation.toLowerCase(sourceName)}, 0); >+ } > } > > char[][] nameParts = new char[length][]; >@@ -533,7 +541,7 @@ > prefixes = assistOptions.staticFieldPrefixes; > suffixes = assistOptions.staticFieldSuffixes; > break; >- case VK_CONSTANT_FIELD: >+ case VK_STATIC_FINAL_FIELD: > prefixes = assistOptions.staticFinalFieldPrefixes; > suffixes = assistOptions.staticFinalFieldSuffixes; > break; >@@ -548,11 +556,11 @@ > } > > >- return getBaseName(name, prefixes, suffixes, variableKind == VK_CONSTANT_FIELD); >+ return getBaseName(name, prefixes, suffixes, variableKind == VK_STATIC_FINAL_FIELD); > } > > private static char[] getBaseName(char[] name, char[][] prefixes, char[][] suffixes, boolean isConstant) { >- char[] nameWithoutPrefixAndSiffix = removeVariablePrefixAndSuffix(name, prefixes, suffixes, false); >+ char[] nameWithoutPrefixAndSiffix = removeVariablePrefixAndSuffix(name, prefixes, suffixes, true); > > char[] baseName; > if (isConstant) { >@@ -564,7 +572,7 @@ > for (int i = 0; i < length; i++) { > char c = nameWithoutPrefixAndSiffix[i]; > if (c != '_') { >- if (previousIsUnderscore || i == 0) { >+ if (previousIsUnderscore) { > baseName[++baseNamePtr] = ScannerHelper.toUpperCase(c); > previousIsUnderscore = false; > } else { >@@ -604,7 +612,7 @@ > prefixes = assistOptions.staticFieldPrefixes; > suffixes = assistOptions.staticFieldSuffixes; > break; >- case VK_CONSTANT_FIELD: >+ case VK_STATIC_FINAL_FIELD: > prefixes = assistOptions.staticFinalFieldPrefixes; > suffixes = assistOptions.staticFinalFieldSuffixes; > break; >@@ -749,7 +757,7 @@ > > public static final int VK_STATIC_FIELD = 1; > public static final int VK_INSTANCE_FIELD = 2; >- public static final int VK_CONSTANT_FIELD = 3; >+ public static final int VK_STATIC_FINAL_FIELD = 3; > public static final int VK_PARAMETER = 4; > public static final int VK_LOCAL = 5; > >@@ -792,7 +800,7 @@ > prefixes = assistOptions.staticFieldPrefixes; > suffixes = assistOptions.staticFieldSuffixes; > break; >- case VK_CONSTANT_FIELD: >+ case VK_STATIC_FINAL_FIELD: > isConstantField = true; > prefixes = assistOptions.staticFinalFieldPrefixes; > suffixes = assistOptions.staticFinalFieldSuffixes; >Index: model/org/eclipse/jdt/core/NamingConventions.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/model/org/eclipse/jdt/core/NamingConventions.java,v >retrieving revision 1.39 >diff -u -r1.39 NamingConventions.java >--- model/org/eclipse/jdt/core/NamingConventions.java 27 Oct 2008 14:20:53 -0000 1.39 >+++ model/org/eclipse/jdt/core/NamingConventions.java 20 Nov 2008 09:08:26 -0000 >@@ -11,6 +11,7 @@ > package org.eclipse.jdt.core; > > import org.eclipse.jdt.core.compiler.CharOperation; >+ > import org.eclipse.jdt.internal.codeassist.impl.AssistOptions; > import org.eclipse.jdt.internal.compiler.parser.ScannerHelper; > import org.eclipse.jdt.internal.core.INamingRequestor; >@@ -25,18 +26,24 @@ > * The possible options are : > * <ul> > * <li> {@link JavaCore#CODEASSIST_FIELD_PREFIXES} : Define the Prefixes for Field Name.</li> >- * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} : Define the Prefixes for Static Field Name.</li> >- * <li> {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} : Define the Prefixes for Local Variable Name.</li> >- * <li> {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} : Define the Prefixes for Argument Name.</li> > * <li> {@link JavaCore#CODEASSIST_FIELD_SUFFIXES} : Define the Suffixes for Field Name.</li> >+ * >+ * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} : Define the Prefixes for Static Field Name.</li> > * <li> {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES} : Define the Suffixes for Static Field Name.</li> >+ * >+ * <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} : Define the Prefixes for Static Final Field Name.</li> >+ * <li> {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES} : Define the Suffixes for Static Final Field Name.</li> >+ * >+ * <li> {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} : Define the Prefixes for Local Variable Name.</li> > * <li> {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES} : Define the Suffixes for Local Variable Name.</li> >+ * >+ * <li> {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} : Define the Prefixes for Argument Name.</li> > * <li> {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES} : Define the Suffixes for Argument Name.</li> > * </ul> > * </p> > * <p> >- * For a complete description of the configurable options, see <code>getDefaultOptions</code>. >- * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. >+ * For a complete description of the configurable options, see {@link JavaCore#getDefaultOptions()}. >+ * To programmatically change these options, see {@link JavaCore#setOptions(java.util.Hashtable)}. > * </p> > * <p> > * This class provides static methods and constants only. >@@ -243,11 +250,18 @@ > */ > public static final int VK_INSTANCE_FIELD = InternalNamingConventions.VK_INSTANCE_FIELD; > /** >+ * Variable kind which represents a static final field. >+ * >+ * @since 3.5 >+ */ >+ public static final int VK_STATIC_FINAL_FIELD = InternalNamingConventions.VK_STATIC_FINAL_FIELD; >+ /** > * Variable kind which represents a constant field (static final). > * > * @since 3.5 >+ * @deprecated use VK_STATIC_FINAL_FIELD instead. This constant will be removed before 3.5M5. > */ >- public static final int VK_CONSTANT_FIELD = InternalNamingConventions.VK_CONSTANT_FIELD; >+ public static final int VK_CONSTANT_FIELD = InternalNamingConventions.VK_STATIC_FINAL_FIELD; > /** > * Variable kind which represents an argument. > * >@@ -542,12 +556,28 @@ > * Returns a base name which could be used to generate the given variable name with {@link #suggestVariableNames(int, int, String, IJavaProject, int, String[], boolean)}. > * <p> > * e.g.<br> >- * If the variable is a {@link #VK_LOCAL} and the variable name is <code>variableName</code> then the base name will be <code>VariableName</code>.<br> >- * If the variable is a {@link #VK_CONSTANT_FIELD} and the variable name is <code>VARIABLE_NAME</code> then the base name will be <code>VariableName</code>.<br> >+ * If the variable is a {@link #VK_LOCAL} and the variable name is <code>variableName</code> then the base name will be <code>variableName</code>.<br> >+ * If the variable is a {@link #VK_STATIC_FINAL_FIELD} and the variable name is <code>VARIABLE_NAME</code> then the base name will be <code>variableName</code>.<br> >+ * </p> >+ * <p> >+ * Prefixes and suffixes defined in JavaCore options will be also removed from the variable name.<br> >+ * Each variable kind is affected by the following JavaCore options: >+ * <ul> >+ * <li>{@link #VK_PARAMETER}: {@link JavaCore#CODEASSIST_ARGUMENT_PREFIXES} and {@link JavaCore#CODEASSIST_ARGUMENT_SUFFIXES}</li> >+ * <li>{@link #VK_LOCAL}: {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}</li> >+ * <li>{@link #VK_INSTANCE_FIELD}: {@link JavaCore#CODEASSIST_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_FIELD_SUFFIXES}</li> >+ * <li>{@link #VK_STATIC_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES}</li> >+ * <li>{@link #VK_STATIC_FINAL_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES}</li> >+ * </ul> >+ * </p> >+ * <p> >+ * e.g.<br> >+ * If the variable is a {@link #VK_LOCAL}, the variable name is <code>preVariableNamesuf</code>, a possible prefix is <code>pre</code> and a possible suffix is <code>suf</code> >+ * then the base name will be <code>variableName</code>.<br> > * </p> > * > * @param variableKind specifies what type the variable is: {@link #VK_LOCAL}, {@link #VK_PARAMETER}, {@link #VK_STATIC_FIELD}, >- * {@link #VK_INSTANCE_FIELD} or {@link #VK_CONSTANT_FIELD}. >+ * {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FINAL_FIELD}. > * @param variableName a variable name > * @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings. > * >@@ -1041,31 +1071,31 @@ > * > * <p> > * The base name is used to compute the variable name. >- * Some different kinds of base name are possible and each kind is associated to a different heuristic to compute variable names.<br> >+ * Some different kinds of base names are possible and each kind is associated to a different heuristic to compute variable names.<br> > * The heuristic depends also on the kind of the variable. Each kind of variable is identified by a constant starting with <code>VK_</code>.<br> > * When a prefix and a suffix can be added then all combinations of prefix and suffix are suggested. > * If the name is <code>name</code>, the prefix is <code>pre</code> and the suffix is <code>suf</code> then the suggested names will be > * <code>prenamesuf</code>, <code>prename</code>, <code>namesuf</code> and <code>name</code>.<br> > * <br> >- * The different kinds of base name are: >+ * The different kinds of base names are: > * <ul> > * <li>{@link #BK_NAME}: the base name is a Java name and the whole base name is considered to compute the variable names. A prefix and a suffix can be added.<br> >- * There is an heuristic by variable kind. >+ * There is a heuristic by variable kind. > * <ul> > * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br> > * In this case the first character will be converted to lower case and the other characters won't be changed.<br> > * If the base name is <code>SimpleName</code> then the suggested name will be <code>simpleName</code>.<br></li> >- * <li>{@link #VK_CONSTANT_FIELD} :<br> >+ * <li>{@link #VK_STATIC_FINAL_FIELD} :<br> > * In this case all letters of the name will be converted to upper case and words will be separated by an underscore (<code>"_"</code>).<br> > * If the base name is <code>SimpleName</code> then the suggested name will be <code>SIMPLE_NAME</code>.</li> > * </ul></li> > * <li>{@link #BK_TYPE_NAME}: the base name is a Java simple type name (e.g. <code>HashMap</code>) and all the words of the base name are considered to compute the variable names. A prefix and a suffix can be added to these names.<br> >- * There is an heuristic by variable kind. >+ * There is a heuristic by variable kind. > * <ul> > * <li>{@link #VK_PARAMETER}, {@link #VK_LOCAL}, {@link #VK_INSTANCE_FIELD} and {@link #VK_STATIC_FIELD}:<br> > * In this case a variable name will contain some words of the base name and the first character will be converted to lower case.<br> > * If the type is <code>TypeName</code> then the suggested names will be <code>typeName</code> and <code>name</code>.</li> >- * <li>{@link #VK_CONSTANT_FIELD} :<br> >+ * <li>{@link #VK_STATIC_FINAL_FIELD} :<br> > * In this case a variable name will contain some words of the base name, all letters of the name will be converted to upper case and segments will be separated by a underscore (<code>"_"</code>).<br> > * If the base name is <code>TypeName</code> then the suggested name will be <code>TYPE_NAME</code> and <code>NAME</code>.</li> > * </ul></li> >@@ -1079,33 +1109,33 @@ > * <li>{@link #VK_LOCAL}: {@link JavaCore#CODEASSIST_LOCAL_PREFIXES} and {@link JavaCore#CODEASSIST_LOCAL_SUFFIXES}</li> > * <li>{@link #VK_INSTANCE_FIELD}: {@link JavaCore#CODEASSIST_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_FIELD_SUFFIXES}</li> > * <li>{@link #VK_STATIC_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FIELD_SUFFIXES}</li> >- * <li>{@link #VK_CONSTANT_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES}</li> >+ * <li>{@link #VK_STATIC_FINAL_FIELD}: {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_PREFIXES} and {@link JavaCore#CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES}</li> > * </ul> > * </p> > * <p> >- * For a complete description of these configurable options, see <code>getDefaultOptions</code>. >- * For programmaticaly change these options, see <code>JavaCore#setOptions()</code>. >+ * For a complete description of these configurable options, see {@link JavaCore#getDefaultOptions()}. >+ * To programmatically change these options, see {@link JavaCore#setOptions(java.util.Hashtable)} and {@link IJavaProject#setOptions(java.util.Map)} > * </p> > * <p> > * Proposed names are sorted by relevance (best proposal first).<br> > * The names are proposed in the following order: > * <ol> >- * <li>Names with prefix and suffix. Longest name are proposed first</li> >- * <li>Names with prefix. Longest name are proposed first</li> >- * <li>Names with suffix. Longest name are proposed first</li> >- * <li>Names without prefix and suffix. Longest name are proposed first</li> >+ * <li>Names with prefix and suffix. Longer names are proposed first</li> >+ * <li>Names with prefix. Longer names are proposed first</li> >+ * <li>Names with suffix. Longer names are proposed first</li> >+ * <li>Names without prefix and suffix. Longer names are proposed first</li> > * </ol> > * </p> > * > * @param variableKind specifies what type the variable is: {@link #VK_LOCAL}, {@link #VK_PARAMETER}, {@link #VK_STATIC_FIELD}, >- * {@link #VK_INSTANCE_FIELD} or {@link #VK_CONSTANT_FIELD}. >+ * {@link #VK_INSTANCE_FIELD} or {@link #VK_STATIC_FINAL_FIELD}. > * @param baseNameKind specifies what type the base name is: {@link #BK_NAME} or {@link #BK_TYPE_NAME} > * @param baseName name used to compute the suggested names. > * @param javaProject project which contains the variable or <code>null</code> to take into account only workspace settings. > * @param dim variable dimension (0 if the field is not an array). > * @param excluded a list of names which cannot be suggested (already used names). >- * Can be <code>null</code> if there is no excluded names. >- * @param evaluateDefault if set, the result is guaranteed to contain at least one result. If not, the result can be an empty array. >+ * Can be <code>null</code> if there are no excluded names. >+ * @param evaluateDefault if <code>true</code>, the result is guaranteed to contain at least one result. If <code>false</code>, the result can be an empty array. > * @return String[] an array of names. > * @see JavaCore#setOptions(java.util.Hashtable) > * @see JavaCore#getDefaultOptions() >Index: codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core/codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java,v >retrieving revision 1.380 >diff -u -r1.380 CompletionEngine.java >--- codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 22 Oct 2008 08:27:57 -0000 1.380 >+++ codeassist/org/eclipse/jdt/internal/codeassist/CompletionEngine.java 20 Nov 2008 09:08:26 -0000 >@@ -1561,7 +1561,7 @@ > InternalNamingConventions.VK_INSTANCE_FIELD : > (field.modifiers & ClassFileConstants.AccFinal) == 0 ? > InternalNamingConventions.VK_STATIC_FIELD : >- InternalNamingConventions.VK_CONSTANT_FIELD; >+ InternalNamingConventions.VK_STATIC_FINAL_FIELD; > > findVariableNames(field.realName, field.type, excludeNames, null, kind); > } >@@ -2176,7 +2176,7 @@ > InternalNamingConventions.VK_INSTANCE_FIELD : > (method.modifiers & ClassFileConstants.AccFinal) == 0 ? > InternalNamingConventions.VK_STATIC_FIELD : >- InternalNamingConventions.VK_CONSTANT_FIELD; >+ InternalNamingConventions.VK_STATIC_FINAL_FIELD; > > findVariableNames(this.completionToken, method.returnType, excludeNames, null, kind); > } >#P org.eclipse.jdt.core.tests.model >Index: src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java,v >retrieving revision 1.23 >diff -u -r1.23 NamingConventionTests.java >--- src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java 22 Oct 2008 08:27:50 -0000 1.23 >+++ src/org/eclipse/jdt/core/tests/model/NamingConventionTests.java 20 Nov 2008 09:08:28 -0000 >@@ -63,7 +63,7 @@ > this.project); > > assertEquals( >- "OneName", //$NON-NLS-1$ >+ "oneName", //$NON-NLS-1$ > baseName); > } > /* >@@ -71,12 +71,12 @@ > */ > public void testGetBaseName002() { > String baseName = NamingConventions.getBaseName( >- NamingConventions.VK_CONSTANT_FIELD, >+ NamingConventions.VK_STATIC_FINAL_FIELD, > "ONE_NAME", //$NON-NLS-1$ > this.project); > > assertEquals( >- "OneName", //$NON-NLS-1$ >+ "oneName", //$NON-NLS-1$ > baseName); > } > /* >@@ -94,7 +94,7 @@ > this.project); > > assertEquals( >- "OneName", //$NON-NLS-1$ >+ "oneName", //$NON-NLS-1$ > baseName); > } > /* >@@ -107,12 +107,12 @@ > JavaCore.setOptions(options); > > String baseName = NamingConventions.getBaseName( >- NamingConventions.VK_CONSTANT_FIELD, >+ NamingConventions.VK_STATIC_FINAL_FIELD, > "preONE_NAMEsuf", //$NON-NLS-1$ > this.project); > > assertEquals( >- "OneName", //$NON-NLS-1$ >+ "oneName", //$NON-NLS-1$ > baseName); > } > public void testSuggestFieldName001() { >@@ -485,7 +485,7 @@ > */ > public void testSuggestFieldName021() { > String[] suggestions = NamingConventions.suggestVariableNames( >- NamingConventions.VK_CONSTANT_FIELD, >+ NamingConventions.VK_STATIC_FINAL_FIELD, > NamingConventions.BK_TYPE_NAME, > "MyType", //$NON-NLS-1$ > this.project, >@@ -508,7 +508,7 @@ > JavaCore.setOptions(options); > > String[] suggestions = NamingConventions.suggestVariableNames( >- NamingConventions.VK_CONSTANT_FIELD, >+ NamingConventions.VK_STATIC_FINAL_FIELD, > NamingConventions.BK_TYPE_NAME, > "MyType", //$NON-NLS-1$ > this.project, >@@ -574,7 +574,7 @@ > */ > public void testSuggestFieldName025() { > String[] suggestions = NamingConventions.suggestVariableNames( >- NamingConventions.VK_CONSTANT_FIELD, >+ NamingConventions.VK_STATIC_FINAL_FIELD, > NamingConventions.BK_TYPE_NAME, > "My_Type", //$NON-NLS-1$ > this.project, >@@ -592,7 +592,7 @@ > */ > public void testSuggestFieldName026() { > String[] suggestions = NamingConventions.suggestVariableNames( >- NamingConventions.VK_CONSTANT_FIELD, >+ NamingConventions.VK_STATIC_FINAL_FIELD, > NamingConventions.BK_TYPE_NAME, > "_MyType", //$NON-NLS-1$ > this.project, >@@ -610,7 +610,7 @@ > */ > public void testSuggestFieldName027() { > String[] suggestions = NamingConventions.suggestVariableNames( >- NamingConventions.VK_CONSTANT_FIELD, >+ NamingConventions.VK_STATIC_FINAL_FIELD, > NamingConventions.BK_TYPE_NAME, > "MyType_", //$NON-NLS-1$ > this.project, >@@ -628,7 +628,7 @@ > */ > public void testSuggestFieldName028() { > String[] suggestions = NamingConventions.suggestVariableNames( >- NamingConventions.VK_CONSTANT_FIELD, >+ NamingConventions.VK_STATIC_FINAL_FIELD, > NamingConventions.BK_TYPE_NAME, > "MyTyp_e", //$NON-NLS-1$ > this.project, >@@ -826,6 +826,40 @@ > "type", //$NON-NLS-1$ > toString(suggestions)); > } >+/* >+ * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=255345 >+ */ >+public void testSuggestFieldName039() { >+ String[] suggestions = NamingConventions.suggestVariableNames( >+ NamingConventions.VK_STATIC_FINAL_FIELD, >+ NamingConventions.BK_TYPE_NAME, >+ "A", //$NON-NLS-1$ >+ this.project, >+ 0, >+ new String[]{}, >+ true); >+ >+ assumeEquals( >+ "A", //$NON-NLS-1$ >+ toString(suggestions)); >+} >+/* >+ * bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=255345 >+ */ >+public void testSuggestFieldName040() { >+ String[] suggestions = NamingConventions.suggestVariableNames( >+ NamingConventions.VK_STATIC_FINAL_FIELD, >+ NamingConventions.BK_TYPE_NAME, >+ "int", //$NON-NLS-1$ >+ this.project, >+ 0, >+ new String[]{}, >+ true); >+ >+ assumeEquals( >+ "INT", //$NON-NLS-1$ >+ toString(suggestions)); >+} > /** @deprecated */ > public void testRemovePrefixAndSuffixForFieldName001() { > Hashtable options = JavaCore.getOptions();
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 255345
:
118040
| 118341