|
47 | 47 | import org.eclipse.jdt.core.dom.EmptyStatement; |
48 | 48 | import org.eclipse.jdt.core.dom.EnhancedForStatement; |
49 | 49 | import org.eclipse.jdt.core.dom.EnumConstantDeclaration; |
50 | | -import org.eclipse.jdt.core.dom.Expression; |
51 | 50 | import org.eclipse.jdt.core.dom.ExpressionStatement; |
52 | 51 | import org.eclipse.jdt.core.dom.FieldAccess; |
53 | 52 | import org.eclipse.jdt.core.dom.FieldDeclaration; |
54 | 53 | import org.eclipse.jdt.core.dom.ForStatement; |
55 | 54 | import org.eclipse.jdt.core.dom.ITypeBinding; |
56 | | -import org.eclipse.jdt.core.dom.IVariableBinding; |
57 | 55 | import org.eclipse.jdt.core.dom.IfStatement; |
58 | 56 | import org.eclipse.jdt.core.dom.ImportDeclaration; |
59 | 57 | import org.eclipse.jdt.core.dom.InfixExpression; |
|
104 | 102 | import org.eclipse.jdt.core.dom.WildcardType; |
105 | 103 |
|
106 | 104 | import net.sf.j2s.core.adapters.AbstractPluginAdapter; |
107 | | -import net.sf.j2s.core.adapters.FieldAdapter; |
108 | 105 | import net.sf.j2s.core.adapters.FinalVariable; |
109 | 106 | import net.sf.j2s.core.adapters.J2SMapAdapter; |
110 | 107 | import net.sf.j2s.core.adapters.TypeAdapter; |
@@ -218,62 +215,22 @@ protected static boolean isStatic(BodyDeclaration b) { |
218 | 215 | } |
219 | 216 |
|
220 | 217 |
|
221 | | - /** |
222 | | - * We need to check packages only for local "var" variables, as only those will be |
223 | | - * references as unqualified names. And the problem is only the same method. |
224 | | - * |
225 | | - * For example, |
226 | | - * |
227 | | - * var test = 3 |
228 | | - * |
229 | | - * x = test.Test_1.getX(); |
230 | | - * |
231 | | - * |
232 | | - * |
233 | | - * @param name |
234 | | - * @param checkPackages |
235 | | - * @param addName TODO |
236 | | - * @return |
237 | | - */ |
238 | | - protected void appendValidFieldName$Qualifier(String name, boolean checkPackages, boolean addName) { |
239 | | - boolean isViolation = FieldAdapter.checkKeywordViolation(name, checkPackages ? definedPackageNames : null); |
240 | | - if (isViolation) |
241 | | - buffer.append("$"); |
242 | | - if (addName) |
243 | | - buffer.append(name); |
244 | | - } |
245 | | - |
246 | | - protected String getClassName() { |
| 218 | + protected String getUnqualifiedClassName() { |
247 | 219 | return ((TypeAdapter) getAdaptable(TypeAdapter.class)).getClassName(); |
248 | 220 | } |
249 | | - protected String getConstantValue(Expression exp) { |
250 | | - return ((VariableAdapter) getAdaptable(VariableAdapter.class)).getConstantValue(exp); |
251 | | - } |
252 | 221 |
|
253 | | - protected String getFieldName$Appended(ITypeBinding binding, String name) { |
254 | | - return J2SMapAdapter.getFieldName$Appended(binding, name); |
| 222 | + protected String getQualifiedClassName() { |
| 223 | + return ((TypeAdapter) getAdaptable(TypeAdapter.class)).getFullClassName(); |
255 | 224 | } |
256 | 225 |
|
257 | 226 | protected List<FinalVariable> getVariableList(char fvn) { |
258 | 227 | return ((VariableAdapter) getAdaptable(VariableAdapter.class)).getVariableList(fvn); |
259 | 228 | } |
260 | 229 |
|
261 | | - protected String getFullClassName() { |
262 | | - return ((TypeAdapter) getAdaptable(TypeAdapter.class)).getFullClassName(); |
263 | | - } |
264 | | - |
265 | 230 | protected String getIndexedVarName(String name, int i) { |
266 | 231 | return ((VariableAdapter) getAdaptable(VariableAdapter.class)).getIndexedVarName(name, i); |
267 | 232 | } |
268 | 233 |
|
269 | | - protected String getJ2SName(SimpleName node) { |
270 | | - return J2SMapAdapter.getJ2SName(node); |
271 | | - } |
272 | | - |
273 | | - protected String getJ2SName(IVariableBinding binding) { |
274 | | - return J2SMapAdapter.getJ2SName(binding); |
275 | | - } |
276 | | - |
277 | 234 | protected String getNormalVariableName(String name) { |
278 | 235 | return ((VariableAdapter) getAdaptable(VariableAdapter.class)).getNormalVariableName(name); |
279 | 236 | } |
|
0 commit comments