Package gov.nasa.jpf.jvm

Examples of gov.nasa.jpf.jvm.FieldInfo


        return memberClass.getSimpleName() + " " + mi.getLongName();
                  //Arrays.toString(mi.getArgumentTypeNames()).replace('[','(').replace(']', ')');
      return mi.getReturnTypeName() + " " + mi.getLongName();
    }
    if(member instanceof FieldInfo) {
      FieldInfo fi = ((FieldInfo) member);
      return fi.getType() + " " + fi.getName();
    }
    throw new RuntimeException("Member " + member + " is not a " +
        "field nor a method");
  }
View Full Code Here


   */
  @Override
  public void executeInstruction(JVM vm) {
    Instruction last = vm.getNextInstruction();
    if(last instanceof FieldInstruction) {
      FieldInfo accessed = ((FieldInstruction) last).getFieldInfo();
      if(isGenerated(accessed))
        logger.warning("The field " + accessed.getFullName() + " is missing from " +
            "the model class.\n\ta default implementation is being used.");
    }
   
  }
View Full Code Here

  @Test
  public void compareEquals1() {
    ClassInfo ci = createMock(ClassInfo.class);
    expect(ci.getName()).andReturn("java.lang.System").times(2);
    replay(ci);
    FieldInfo f1 = FieldInfo.create(ci, "out", "Ljava/io/PrintStream;", Modifier.PUBLIC | Modifier.STATIC, 0, 0);
    FieldInfo f2 = FieldInfo.create(ci, "out", "Ljava/io/PrintStream;", Modifier.PUBLIC | Modifier.STATIC, 0, 0);
    int result = new FieldInfoComparator().compare(f1, f2);
    assertEquals(result, 0);
  }
View Full Code Here

  @Test
  public void compareNotEquals2() {
    ClassInfo ci = createMock(ClassInfo.class);
    expect(ci.getName()).andReturn("java.lang.System").anyTimes();
    replay(ci);
    FieldInfo f1 = FieldInfo.create(ci, "out", "Ljava/io/PrintStrea;", Modifier.PUBLIC | Modifier.STATIC, 0, 0);
    FieldInfo f2 = FieldInfo.create(ci, "out", "Ljava/io/PrintStream;", Modifier.PUBLIC | Modifier.STATIC, 0, 0);
    int result = new FieldInfoComparator().compare(f1, f2);
    assertTrue(result < 0);
  }
View Full Code Here

  @Test
  public void compareNotEquals3() {
    ClassInfo ci = createMock(ClassInfo.class);
    expect(ci.getName()).andReturn("java.lang.System").anyTimes();
    replay(ci);
    FieldInfo f1 = FieldInfo.create(ci, "out", "Ljava/io/PrintStream;", Modifier.PUBLIC | Modifier.STATIC, 0, 0);
    FieldInfo f2 = FieldInfo.create(ci, "in", "Ljava/io/PrintStream;", Modifier.PUBLIC | Modifier.STATIC, 0, 0);
    int result = new FieldInfoComparator().compare(f1, f2);
    assertTrue(result > 0);
  }
View Full Code Here

  public static FieldInfo field(
      int modifiers,
      String type,
      String name)
  {
    FieldInfo fi = createMock(FieldInfo.class);
    expect(fi.getName()).andReturn(name).anyTimes();
    expect(fi.getFullName()).andReturn(name).anyTimes();
    expect(fi.getType()).andReturn(type).anyTimes();
   
    expect(fi.getModifiers()).andReturn(modifiers).anyTimes();
    expect(fi.isPublic()).andReturn(Modifier.isPublic(modifiers)).anyTimes();
   
    return fi;
  }
View Full Code Here

        addClassInfo((MethodInfo) member, ci);
        replay(member);
        methods.add((MethodInfo) member);
      }
      else {
        FieldInfo f = (FieldInfo) member;
        addClassInfo(f, ci);
        replay(f);
        if(Modifier.isStatic(f.getModifiers()))
          staticFields.add(f);
        else
          instanceFields.add(f);
      }
    }
View Full Code Here

TOP

Related Classes of gov.nasa.jpf.jvm.FieldInfo

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.