Examples of LazyClassEntry


Examples of nginx.clojure.wave.MethodDatabase.LazyClassEntry

      }
      BufferedReader r = new BufferedReader(new InputStreamReader(in, MethodDatabase.UTF_8));
      db.getUserDefinedWaveConfigFiles().add(resource);
      String l = null;
      ClassEntry ce = null;
      LazyClassEntry lce = null;
      FuzzyLazyClassEntry flce = null;
      int lc = 0;
      String clz = null;
      while ((l = r.readLine()) != null) {
        lc++;
        l = l.trim();
        if (l.startsWith("class:")) {
          lce = null;
          flce = null;
          clz = l.substring("class:".length());
          ce = db.getClasses().get(clz);
          if (ce == null) {
            ce = buildClassEntryFamily(db, clz);
            if (ce == null) {
              db.warn("file %s line %d : not found class: %s", resource , lc,  clz);
              ce = null;
              continue;
            }
          }
        }else if (l.startsWith("lazyclass:")) {
          clz = l.substring("lazyclass:".length());
          ce = null;
          flce = null;
          lce = db.getLazyClasses().get(clz);
          if (lce == null) {
            db.getLazyClasses().put(clz, lce = new LazyClassEntry(resource));
          }
        }else if (l.startsWith("fuzzyclass:")) {
          clz = l.substring("fuzzyclass:".length());
          ce = null;
          lce = null;
          flce = new FuzzyLazyClassEntry(Pattern.compile(clz), resource);
          db.getFuzzlyLazyClasses().add(flce);
        }else if (l.startsWith("retransform:")) {
          db.getRetransformedClasses().add(l.substring("retransform:".length()).trim());
          ce = null;
          lce = null;
          flce = null;
        }else if (l.startsWith("filter:")) {
          db.getFilters().add(l.substring("filter:".length()).trim());
          ce = null;
          lce = null;
          flce = null;
        }else if (l.length() == 0 || (ce == null && lce == null && flce == null) || l.charAt(0) == '#'){
          continue;
        }else {
          String[] ma = l.split(":");
          String m = ma[0];
          Integer st = MethodDatabase.SUSPEND_NORMAL;
          if (ma.length > 1) {
            if (MethodDatabase.SUSPEND_NORMAL_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_NORMAL;
            }else if (MethodDatabase.SUSPEND_NONE_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_NONE;
            }else if (MethodDatabase.SUSPEND_JUST_MARK_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_JUST_MARK;
            }else if (MethodDatabase.SUSPEND_BLOCKING_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_BLOCKING;
            }else if (MethodDatabase.SUSPEND_FAMILY_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_FAMILY;
            }else if (MethodDatabase.SUSPEND_SKIP_STR.equals(ma[1])) {
              st = MethodDatabase.SUSPEND_SKIP;
            }else {
              db.warn("file %s line %d : unknown suspend type: %s , we just set to 'normal'", resource , lc, ma[1]);
              st = MethodDatabase.SUSPEND_NORMAL;
            }
          }
          if (lce != null) {
            Map<String, Integer> methods = lce.getMethods();
            Integer ost = methods.get(m);
            if (ost == null || st.intValue() > ost.intValue()) {
              methods.put(m, st);
            }else {
              st = ost;
View Full Code Here

Examples of nginx.clojure.wave.MethodDatabase.LazyClassEntry

  }
 
  public static ClassEntry buildClassEntryFamily(MethodDatabase db, CheckInstrumentationVisitor civ) {
    ClassEntry ce = civ.getClassEntry();
    String clz = civ.getName();
    LazyClassEntry lce = db.getLazyClasses().get(clz);
   
    if (lce != null) {
      db.debug("rebuild wave info for lazy class %s", clz);
      for (Entry<String, Integer> lme : lce.getMethods().entrySet()) {
        String m = lme.getKey();
        Integer st = lme.getValue();
        if (m.charAt(0) == '/') { // regex pattern
          Pattern p = Pattern.compile(m.substring(1));
          boolean matched = false;
          for (Entry<String, Integer> me : ce.getMethods().entrySet()) {
            if (p.matcher(me.getKey()).find()) {
              me.setValue(st);
              matched = true;
            }
          }
          if (!matched) {
            db.warn("file %s lazy class %s: none of methods matched regex: %s ,ignored", lce.getResource() , clz, m);
          }
        }else if (ce.getMethods().get(m) == null) {
          db.warn("file %s lazy class %s:  : unknown method: %s ,ignored", lce.getResource() , clz, m);
          continue;
        }else {
          Integer ost = ce.getMethods().get(m);
          if (ost == null || st.intValue() > ost.intValue()) {
            ce.set(m, st);
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.