Package com.google.collide.dto

Examples of com.google.collide.dto.DocOpComponent$Type


    return false;
  }

  public static boolean containsMutation(DocOp docOp) {
    for (int i = 0; i < docOp.getComponents().size(); i++) {
      DocOpComponent component = docOp.getComponents().get(i);
      switch (component.getType()) {
        case DocOpComponent.Type.DELETE:
        case DocOpComponent.Type.INSERT:
          return true;
        case DocOpComponent.Type.RETAIN:
        case DocOpComponent.Type.RETAIN_LINE:
          // Retains do not dirty the contents of a file
          break;
        default:
          throw new IllegalArgumentException("Got an unknown doc op type " + component.getType());
      }
    }
    return false;
  }
View Full Code Here


    lineInfo = new LineInfo(document.getFirstLine(), 0);
  }

  public void apply() {
    for (; componentIndex < components.size(); componentIndex++) {
      DocOpComponent component = components.get(componentIndex);

      switch (component.getType()) {
        case DocOpComponent.Type.INSERT:
          handleInsert((Insert) component);
          break;

        case DocOpComponent.Type.DELETE:
View Full Code Here

        assert false : "Fix test";
    }
  }

  public static void assertDelete(String expectedDeleteText, DocOp op, int index) {
    DocOpComponent component = op.getComponents().get(index);
    assertEquals(DELETE, component.getType());
    assertEquals(expectedDeleteText, ((Delete) component).getText());
  }
View Full Code Here

    assertEquals(DELETE, component.getType());
    assertEquals(expectedDeleteText, ((Delete) component).getText());
  }

  public static void assertInsert(String expectedInsertText, DocOp op, int index) {
    DocOpComponent component = op.getComponents().get(index);
    assertEquals(INSERT, component.getType());
    assertEquals(expectedInsertText, ((Insert) component).getText());
  }
View Full Code Here

    assertEquals(expectedInsertText, ((Insert) component).getText());
  }

  public static void assertRetain(int expectedRetainCount, boolean expectedHasTrailingNewline,
      DocOp op, int index) {
    DocOpComponent component = op.getComponents().get(index);
    assertEquals(RETAIN, component.getType());
    Retain retain = (Retain) component;
    assertEquals(expectedRetainCount, retain.getCount());
    assertEquals(expectedHasTrailingNewline, retain.hasTrailingNewline());
  }
View Full Code Here

    assertEquals(expectedRetainCount, retain.getCount());
    assertEquals(expectedHasTrailingNewline, retain.hasTrailingNewline());
  }

  public static void assertRetainLine(int expectedRetainLineCount, DocOp op, int index) {
    DocOpComponent component = op.getComponents().get(index);
    assertEquals(RETAIN_LINE, component.getType());
    RetainLine retainLine = (RetainLine) component;
    assertEquals(expectedRetainLineCount, retainLine.getLineCount());
  }
View Full Code Here

      System.out.println();

      ExprManager em = new ExprManager();
      SmtEngine smt = new SmtEngine(em);

      Type t = em.booleanType();
      Expr a = em.mkVar("a", em.booleanType());
      Expr b = em.mkVar("b", em.booleanType());
      Expr e = new Expr(em.mkExpr(Kind.AND, a, b, new Expr(a).notExpr()));
      System.out.println("==> " + e);
View Full Code Here

            // now calculate the parameters
            int offset = 1;
            for (Class<?> aClass : delegatedMethod.getParameterTypes())
            {
                final Type type = Type.getType(aClass);
                mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), offset);
                offset += type.getSize();
            }

            // and finally invoke the target method on the provided Contextual Instance
            final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
            boolean interfaceMethod = Modifier.isInterface(delegatedMethod.getDeclaringClass().getModifiers());
            mv.visitMethodInsn(interfaceMethod ? Opcodes.INVOKEINTERFACE : Opcodes.INVOKEVIRTUAL,
                               declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);

            generateReturn(mv, delegatedMethod);

            mv.visitMaxs(-1, -1);
View Full Code Here

            mv.visitFieldInsn(Opcodes.GETFIELD, proxyClassFileName, FIELD_PROXIED_INSTANCE, Type.getDescriptor(classToProxy));

            int offset = 1;
            for (Class<?> aClass : delegatedMethod.getParameterTypes())
            {
                final Type type = Type.getType(aClass);
                mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), offset);
                offset += type.getSize();
            }

            final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
            mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);

            generateReturn(mv, delegatedMethod);

            mv.visitMaxs(-1, -1);
View Full Code Here

            // now calculate the parameters
            int offset = 1;
            for (Class<?> aClass : delegatedMethod.getParameterTypes())
            {
                final Type type = Type.getType(aClass);
                mv.visitVarInsn(type.getOpcode(Opcodes.ILOAD), offset);
                offset += type.getSize();
            }

            // and finally invoke the target method on the provided Contextual Instance
            final Type declaringClass = Type.getType(delegatedMethod.getDeclaringClass());
            if (abstractMethod)
            {
                // generate an empty return block
            }
            else
            {
                // invoke the method on the super class;
                mv.visitMethodInsn(Opcodes.INVOKESPECIAL, declaringClass.getInternalName(), delegatedMethod.getName(), methodDescriptor);
            }

            generateReturn(mv, delegatedMethod);

            mv.visitMaxs(-1, -1);
View Full Code Here

TOP

Related Classes of com.google.collide.dto.DocOpComponent$Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.