コード例 #1
0
 private static JvmOperation mockJvmOperation(String name, boolean isAbstract) {
   JvmOperation operation = mock(JvmOperation.class);
   when(operation.isAbstract()).thenReturn(isAbstract);
   when(operation.isStatic()).thenReturn(false);
   when(operation.isDefault()).thenReturn(false);
   when(operation.isDeprecated()).thenReturn(false);
   when(operation.isFinal()).thenReturn(false);
   when(operation.isSynchronized()).thenReturn(false);
   when(operation.isNative()).thenReturn(false);
   when(operation.getSimpleName()).thenReturn(name);
   when(operation.getAnnotations()).thenReturn(new BasicEList<JvmAnnotationReference>());
   return operation;
 }
コード例 #2
0
 protected SignatureHashBuilder appendSignature(JvmOperation operation) {
   appendVisibility(operation.getVisibility()).append(" ");
   if (operation.isAbstract()) append("abstract ");
   if (operation.isStatic()) append("static ");
   if (operation.isFinal()) append("final ");
   appendType(operation.getReturnType())
       .appendTypeParameters(operation)
       .append(" ")
       .append(operation.getSimpleName())
       .append("(");
   for (JvmFormalParameter p : operation.getParameters()) {
     appendType(p.getParameterType());
     append(" ");
   }
   append(") ");
   for (JvmTypeReference ex : operation.getExceptions()) {
     appendType(ex).append(" ");
   }
   return this;
 }