private List<String> initExceptionNames() { if (fMethod != null) { try { String[] exceptionTypes = fMethod.getExceptionTypes(); ArrayList<String> exceptionNames = new ArrayList<>(); for (int i = 0; i < exceptionTypes.length; i++) { exceptionNames.add(Signature.getSimpleName(Signature.toString(exceptionTypes[i]))); } return exceptionNames; } catch (JavaModelException e) { } } return Collections.emptyList(); }
private List<String> initExceptionNames() { if (fMethod != null) { try { String[] exceptionTypes= fMethod.getExceptionTypes(); ArrayList<String> exceptionNames= new ArrayList<>(); for (int i= 0; i < exceptionTypes.length; i++) { exceptionNames.add(Signature.getSimpleName(Signature.toString(exceptionTypes[i]))); } return exceptionNames; } catch (JavaModelException e) { JavaPlugin.log(e); } } return Collections.emptyList(); }
private List<String> initExceptionNames() { if (fMethod != null) { try { String[] exceptionTypes= fMethod.getExceptionTypes(); ArrayList<String> exceptionNames= new ArrayList<>(); for (int i= 0; i < exceptionTypes.length; i++) { exceptionNames.add(Signature.getSimpleName(Signature.toString(exceptionTypes[i]))); } return exceptionNames; } catch (JavaModelException e) { JavaPlugin.log(e); } } return Collections.emptyList(); }
final String[] exceptionTypes= method.getExceptionTypes(); final int exceptionLength= exceptionTypes.length; if (exceptionLength > 0)
final String[] exceptionTypes= method.getExceptionTypes(); final int exceptionLength= exceptionTypes.length; if (exceptionLength > 0)
String[] paramTypes = method.getParameterTypes(); String[] paramNames = method.getParameterNames(); String[] exceptionTypes = method.getExceptionTypes();
private Set<IPath> getMethodTypes(final IType typeElement, final List<IImport> imports, final Path path) throws JavaModelException { final IMethod[] methods = typeElement.getMethods(); final Set<IPath> methodTypes = new HashSet<>(); for (final IMethod method : methods) { final String returnType = method.getReturnType(); addToPaths(imports, path, methodTypes, returnType); final String[] parameterTypes = method.getParameterTypes(); for (final String parameterType : parameterTypes) { addToPaths(imports, path, methodTypes, parameterType); } final String[] exceptionTypes = method.getExceptionTypes(); for (final String exceptionType : exceptionTypes) { addToPaths(imports, path, methodTypes, exceptionType); } } return methodTypes; }
final String[] exceptionTypes= method.getExceptionTypes(); final int exceptionLength= exceptionTypes.length; if (exceptionLength > 0)
if (constructor.getExceptionTypes().length == 0) { superConstructor= constructor; multi= constructors.size() != 1;
if (constructor.getExceptionTypes().length == 0) { superConstructor= constructor; multi= constructors.size() != 1;
if (superMethod.isConstructor() && !Flags.isPrivate(superMethod.getFlags())) { superConstructor= superMethod; if (superConstructor.getExceptionTypes().length == 0) break;
/** * Returns the comment for a method or constructor using the comment code templates (constructor / method / overriding method). * <code>null</code> is returned if the template is empty. * <p>The returned string is unformatted and not indented. * * @param method The method to be documented. The method must exist. * @param overridden The method that will be overridden by the created method or * <code>null</code> for non-overriding methods. If not <code>null</code>, the method must exist. * @param lineDelimiter The line delimiter to be used. * @return Returns the constructed comment or <code>null</code> if * the comment code template is empty. The returned string is unformatted and and has no indent (formatting required). * @throws CoreException Thrown when the evaluation of the code template fails. */ public static String getMethodComment(IMethod method, IMethod overridden, String lineDelimiter) throws CoreException { String retType= method.isConstructor() ? null : method.getReturnType(); String[] paramNames= method.getParameterNames(); String[] typeParameterNames= StubUtility.getTypeParameterNames(method.getTypeParameters()); return StubUtility.getMethodComment(method.getCompilationUnit(), method.getDeclaringType().getElementName(), method.getElementName(), paramNames, method.getExceptionTypes(), retType, typeParameterNames, overridden, false, lineDelimiter); }
/** * Returns the comment for a method or constructor using the comment code templates (constructor / method / overriding method). * <code>null</code> is returned if the template is empty. * <p>The returned string is unformatted and not indented. * * @param method The method to be documented. The method must exist. * @param overridden The method that will be overridden by the created method or * <code>null</code> for non-overriding methods. If not <code>null</code>, the method must exist. * @param lineDelimiter The line delimiter to be used. * @return Returns the constructed comment or <code>null</code> if * the comment code template is empty. The returned string is unformatted and and has no indent (formatting required). * @throws CoreException Thrown when the evaluation of the code template fails. */ public static String getMethodComment(IMethod method, IMethod overridden, String lineDelimiter) throws CoreException { String retType= method.isConstructor() ? null : method.getReturnType(); String[] paramNames= method.getParameterNames(); String[] typeParameterNames= StubUtility.shouldGenerateMethodTypeParameterTags(method.getJavaProject()) ? StubUtility.getTypeParameterNames(method.getTypeParameters()) : new String[0]; return StubUtility.getMethodComment(method.getCompilationUnit(), method.getDeclaringType().getElementName(), method.getElementName(), paramNames, method.getExceptionTypes(), retType, typeParameterNames, overridden, false, lineDelimiter); }
/** * Returns the comment for a method or constructor using the comment code templates (constructor / method / overriding method). * <code>null</code> is returned if the template is empty. * <p>The returned string is unformatted and not indented. * * @param method The method to be documented. The method must exist. * @param overridden The method that will be overridden by the created method or * <code>null</code> for non-overriding methods. If not <code>null</code>, the method must exist. * @param lineDelimiter The line delimiter to be used. * @return Returns the constructed comment or <code>null</code> if * the comment code template is empty. The returned string is unformatted and and has no indent (formatting required). * @throws CoreException Thrown when the evaluation of the code template fails. */ public static String getMethodComment(IMethod method, IMethod overridden, String lineDelimiter) throws CoreException { String retType= method.isConstructor() ? null : method.getReturnType(); String[] paramNames= method.getParameterNames(); String[] typeParameterNames= StubUtility.shouldGenerateMethodTypeParameterTags(method.getJavaProject()) ? StubUtility.getTypeParameterNames(method.getTypeParameters()) : new String[0]; return StubUtility.getMethodComment(method.getCompilationUnit(), method.getDeclaringType().getElementName(), method.getElementName(), paramNames, method.getExceptionTypes(), retType, typeParameterNames, overridden, false, lineDelimiter); }
String[] exceptionTypeNames = method.getExceptionTypes(); int exceptionCount = exceptionTypeNames == null ? 0 : exceptionTypeNames.length; if(exceptionCount > 0) {
String[] exceptionTypeNames = method.getExceptionTypes(); int exceptionCount = exceptionTypeNames == null ? 0 : exceptionTypeNames.length; if(exceptionCount > 0) {
String[] exceptionTypeNames = method.getExceptionTypes(); int exceptionCount = exceptionTypeNames == null ? 0 : exceptionTypeNames.length; if(exceptionCount > 0) {
String[] exceptionTypeNames = method.getExceptionTypes(); int exceptionCount = exceptionTypeNames == null ? 0 : exceptionTypeNames.length; if(exceptionCount > 0) {
String[] exceptionTypeNames = method.getExceptionTypes(); int exceptionCount = exceptionTypeNames == null ? 0 : exceptionTypeNames.length; if(exceptionCount > 0) {
String[] exceptionTypeNames = method.getExceptionTypes(); int exceptionCount = exceptionTypeNames == null ? 0 : exceptionTypeNames.length; if(exceptionCount > 0) {