コード例 #1
0
 public DefaultContextSelector(AnalysisOptions options, IClassHierarchy cha) {
   if (options == null) {
     throw new IllegalArgumentException("null options");
   }
   ContextInsensitiveSelector ci = new ContextInsensitiveSelector();
   ContextSelector r = ReflectionContextSelector.createReflectionContextSelector(options);
   ContextSelector s = new DelegatingContextSelector(r, ci);
   delegate = new DelegatingContextSelector(new CloneContextSelector(cha), s);
 }
コード例 #2
0
ファイル: AnalysisPresets.java プロジェクト: majestyhao/joana
  /**
   * Make the analysis as cheap as possible.
   *
   * <p>These settings barely respect context. They are intended for testing purposes. Remember to
   * call {@link #regenerate(Preset)} when you alter these settings outside.
   *
   * @param p preset to alter
   * @return altered preset
   */
  public static Preset applyFast(final Preset p) {
    // Let the model use a single global instance for each type..
    p.scfg.fieldPropagation = FieldPropagation.FLAT;
    p.scfg.pts = PointsToPrecision.TYPE_BASED;

    Preset.aem.setDoBootSequence(false);
    // The setting of entrypointLocatorFlags causes missed entrypoints!
    p.entrypointLocatorFlags = EnumSet.noneOf(LocatorFlags.class);

    // Create a dummy Context Selector and interpreter...
    p.options.setReflectionOptions(ReflectionOptions.NONE);
    p.ctxSel = ReflectionContextSelector.createReflectionContextSelector(p.options);
    p.ctxIpr =
        ReflectionContextInterpreter.createReflectionContextInterpreter(
            p.scfg.cha, p.options, p.scfg.cache);

    return p;
  }