Package org.springsource.loaded.SystemClassReflectionRewriter

Examples of org.springsource.loaded.SystemClassReflectionRewriter.RewriteResult.summarize()


    // Check the correct amount of rewriting went on
    assertTrue((rr.bits & (JLRF_GET | JLC_GETFIELD)) != 0);
    assertTrue((rr.bits & ~(JLRF_GET | JLC_GETFIELD)) == 0);

    assertEquals(1, callcount);
    assertEquals("Class.getField() Field.get()", rr.summarize());
  }
 
  @Test
  public void jlClass_getModifiers() throws Exception {
    byte[] classbytes = loadBytesForClass("system.Eight");
View Full Code Here


    assertEquals(3, callcount);
    assertEquals(3, events.size());
    assertEquals("helper6(system.Eight)", events.get(0));
    assertEquals("helper6(system.DefaultVis)", events.get(1));
    assertEquals("helper6(system.Eight$Inner)", events.get(2));
    assertEquals("Class.getModifiers()", rr.summarize());
  }

  @Test
  public void jlClass_getMethods() throws Exception {
    byte[] classbytes = loadBytesForClass("system.Nine");
View Full Code Here

    // Check the correct amount of rewriting went on
    assertTrue((rr.bits & JLC_GETMETHODS) != 0);
    assertTrue((rr.bits & ~JLC_GETMETHODS) == 0);

    assertEquals(1, callcount);
    assertEquals("Class.getMethods()", rr.summarize());
  }

  // ---

  static int callcount;
View Full Code Here

        if (systemClassesContainingReflection.contains(slashedClassName)) {
          try {
            // TODO [perf] why are we not using the cache here, is it because the list is so short?
            RewriteResult rr = SystemClassReflectionRewriter.rewrite(slashedClassName, bytes);
            if (GlobalConfiguration.verboseMode && log.isLoggable(Level.INFO)) {
              log.info("System class rewritten: name="+slashedClassName+" rewrite summary="+rr.summarize());
            }
            systemClassesRequiringInitialization.put(slashedClassName, rr.bits);
            return rr.bytes;
          } catch (Exception re) {
            re.printStackTrace();
View Full Code Here

          if (GlobalConfiguration.rewriteAllSystemClasses) {
            systemClassesRequiringInitialization.put(slashedClassName, rr.bits);
            return rr.bytes;
          }
          else {
            System.err.println("Type " + slashedClassName + " rewrite summary: " + rr.summarize());
            return bytes;
          }
        }
      }
      return bytes;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.