public void saveState(){
  for (  Field field : declaringClass.getDeclaredFields()) {
    field.setAccessible(true);
    int mods=Modifier.fieldModifiers() & field.getModifiers();
    if (Modifier.isStatic(mods) && !Modifier.isFinal(mods)) {
      Object value;
      try {
        value=field.get(null);
      }
 catch (      IllegalAccessException e) {
        throw new BugInRandoopException("unable to save value of field " + field.getName());
      }
      valueMap.put(field,value);
    }
  }
}

public void saveState ( ) { for ( Field field : declaringClass . getDeclaredFields ( ) ) { field . setAccessible ( true ) ; int mods = Modifier . fieldModifiers ( ) & field . getModifiers ( ) ; if ( Modifier . isStatic ( mods ) && ! Modifier . isFinal ( mods ) ) { Object value ; try { value = field . get ( null ) ; } catch ( IllegalAccessException e ) { throw new BugInRandoopException ( "unable to save value of field " + field . getName ( ) ) ; } valueMap . put ( field , value ) ; } } }
saves the state for the class in this object . only saves non - final static fields .
