String oldVarName = variableDecl.getName().toString();
Name parameterName = ((JCVariableDecl) methodTree.getParameters().get(0)).getName(); fix.replace(parameterType, "Object");
ec.astName(new Identifier().astValue(vd.getName().toString())); fillList(vd.mods.annotations, ec.rawAnnotations()); if (vd.init instanceof JCNewClass) {
ec.astName(new Identifier().astValue(vd.getName().toString())); fillList(vd.mods.annotations, ec.rawAnnotations()); if (vd.init instanceof JCNewClass) {
appendIndent( out ); out.append( res.accept( this, v ) ); String ident = ((JCTree.JCVariableDecl)res).getName().toString(); resIdents.add( ident );
String var = cond.getLeftOperand().accept( this, v ); if( var.equals( up.getExpression().accept( this, v ) ) && var.equals( iniz.getName().toString() ) && (up.getTag() == JCTree.Tag.PREINC || up.getTag() == JCTree.Tag.POSTINC) && "0".equals( iniz.getInitializer().accept( this, v ) ) )
Name parameterName = ((JCVariableDecl) methodTree.getParameters().get(0)).getName(); fix.replace(parameterType, "Object");
String var = cond.getLeftOperand().accept(this, v); if (var.equals(up.getExpression().accept(this, v)) && var.equals(iniz.getName().toString()) && (up.getTag() == JCTree.Tag.PREINC || up.getTag() == JCTree.Tag.POSTINC) && "0".equals(iniz.getInitializer().accept(this, v))) {
appendIndent(out); out.append(res.accept(this, v)); String ident = ((JCTree.JCVariableDecl) res).getName().toString(); resIdents.add(ident);
"Parameter " + param.getName() + " of method " + md.getName() + " must be declared final.", e ); fail = true;
@Override public void visitVarDef(JCTree.JCVariableDecl jcVariableDecl) { if ("int".equals(jcVariableDecl.getType().toString())) { int id = Integer.valueOf(jcVariableDecl.getInitializer().toString()); String resourceName = jcVariableDecl.getName().toString(); QualifiedId qualifiedId = new QualifiedId( this.respectivePackageName, this.className.toString(), jcVariableDecl.getName().toString(), id ); this.ids.put(qualifiedId, new Id(id, this.className, resourceName)); } }
@Override public void visitVarDef(JCTree.JCVariableDecl jcVariableDecl) { if ("int".equals(jcVariableDecl.getType().toString())) { int id = Integer.valueOf(jcVariableDecl.getInitializer().toString()); String resourceName = jcVariableDecl.getName().toString(); QualifiedId qualifiedId = new QualifiedId(respectivePackageName, id); ids.put(qualifiedId, new Id(id, className, resourceName)); } } }
private boolean containsField(JCTree.JCClassDecl classDef, Name name) { return classDef.defs.stream() .filter(t -> t instanceof JCVariableDecl) .map(elem -> (JCVariableDecl) elem) .anyMatch(var -> var.getName().equals(name)); }
print("["); for (JCVariableDecl param : methodDecl.params) { print("'" + param.getName() + "', ");
printIndent().print(method.getName() + ": ("); for (JCVariableDecl param : method.getParameters()) { print(param.getName() + ", ");
&& var.sym.getModifiers().contains(Modifier.STATIC)) { commentLines.add("@property {" + getMappedDocType(context, var.getType(), var.getType().type) + "} " + var.getName().toString()); Comment varComment = compilationUnit.docComments.getComment(var); if(varComment!=null) {
for (JCVariableDecl param : methodDecl.getParameters()) { if (isWrapped) { print(param.getName().toString()); } else { print(param);
protected void printVariableInitialization(JCClassDecl clazz, JCVariableDecl var) { String name = var.getName().toString(); if (context.getFieldNameMapping(var.sym) != null) { name = context.getFieldNameMapping(var.sym); } else { name = getIdentifier(var.sym); } if (getScope().innerClassNotStatic && !Util.isConstantOrNullField(var)) { if (doesMemberNameRequireQuotes(name)) { printIndent().print("this['").print(name).print("'] = "); } else { printIndent().print("this.").print(name).print(" = "); } substituteAndPrintAssignedExpression(var.type, var.init); print(";").println(); } else if (var.init == null) { if (doesMemberNameRequireQuotes(name)) { printIndent().print("if(").print("this['").print(name).print("']").print("===undefined) ") .print("this['").print(name).print("'] = ").print(Util.getTypeInitialValue(var.type)).print(";") .println(); } else { printIndent().print("if(").print("this.").print(name).print("===undefined) this.").print(name) .print(" = ").print(Util.getTypeInitialValue(var.type)).print(";").println(); } } }