/** * @return true if the functionSignature changed and triggerered * revisitation */ private boolean chooseNameIfMissing(FunctionSignature functionSignature) { Function function = functionSignature.getFunction(); Element parent = functionSignature.getParentElement(); if (function != null && (isNull(function.getName()) || parent instanceof VariablesDeclaration || parent instanceof Arg)) { String name = null; String exact = JNAeratorUtils.getExactTypeDefName(functionSignature); if (exact != null) { name = exact; } else { List<String> ownerNames = JNAeratorUtils.guessOwnerName(function); if (function.getName() != null) { ownerNames.add(function.getName().toString()); } name = chooseName(functionSignature, ownerNames, true); } if (name != null) { function.setName(ident(name)); function.accept(this); return true; } } return false; } Map<String, Integer> nextUnnamedId = new LinkedHashMap<String, Integer>();
/** * @return true if the functionSignature changed and triggerered * revisitation */ private boolean chooseNameIfMissing(FunctionSignature functionSignature) { Function function = functionSignature.getFunction(); Element parent = functionSignature.getParentElement(); if (function != null && (isNull(function.getName()) || parent instanceof VariablesDeclaration || parent instanceof Arg)) { String name = null; String exact = JNAeratorUtils.getExactTypeDefName(functionSignature); if (exact != null) { name = exact; } else { List<String> ownerNames = JNAeratorUtils.guessOwnerName(function); if (function.getName() != null) { ownerNames.add(function.getName().toString()); } name = chooseName(functionSignature, ownerNames, true); } if (name != null) { function.setName(ident(name)); function.accept(this); return true; } } return false; } Map<String, Integer> nextUnnamedId = new LinkedHashMap<String, Integer>();