Analyzes a part of the classpath.

@param part	the part to analyze
@param state 	the traversal state
964323
protected void traverseClasspathPart(String part, TraversalState state) {
    File		file;

    file = null;
    if (part.startsWith("file:")) {
      part = part.replace(" ", "%20");
      try {
	file = new File(new java.net.URI(part));
      }
      catch (URISyntaxException e) {
	getLogger().log(Level.SEVERE, "Failed to generate URI: " + part, e);
      }
    }
    else {
      file = new File(part);
    }
    if (file == null) {
      if (isLoggingEnabled())
	getLogger().log(Level.INFO, "Skipping: " + part);
      return;
    }

    // find classes
    if (file.isDirectory())
      traverseDir(file, state);
    else if (file.exists())
      traverseJar(file, state);
  }
1231891
static void runPartialLearner() {

        // construct a (state local input) simulator membership query oracle
        StateLocalInputMealyOracle<Integer, OutputAndLocalInputs<Integer, Character>> mqOracle =
                new StateLocalInputSULOracle<>(SUL);

        // construct L* instance
        PartialLStarMealy<Integer, Character> lstar =
                new PartialLStarMealyBuilder<Integer, Character>().withOracle(mqOracle)
                                                                  .withCexHandler(ObservationTableCEXHandlers.RIVEST_SCHAPIRE)
                                                                  .create();

        // here, we simply use an equivalence check for the original automaton model
        StateLocalInputMealySimulatorEQOracle<Integer, Character> eqOracle =
                new StateLocalInputMealySimulatorEQOracle<>(TARGET);

        // construct the experiment
        // note, we can't use the regular MealyExperiment (or MooreExperiment) because the output type of our hypothesis
        // is different from our membership query type
        Experiment<StateLocalInputMealyMachine<?, Integer, ?, Character>> experiment =
                new Experiment<>(lstar, eqOracle, INPUTS);

        // run experiment
        experiment.run();

        // get learned model
        MealyMachine<?, Integer, ?, Character> result = experiment.getFinalHypothesis();

        // report results
        System.out.println("-------------------------------------------------------");

        System.out.println("States: " + result.size());
        System.out.println("Sigma: " + INPUTS.size());

        System.out.println("-------------------------------------------------------");

        System.out.println("Final observation table:");
        new ObservationTableASCIIWriter<>().write(lstar.getObservationTable(), System.out);
    }
1199331
private static void calculateClosure(Fst fst, State state, HashMap<Integer,Double>[] closure, Semiring semiring, int iEps, int oEps) {

    for (int j = 0; j < state.getArcCount(); j++) {
      Arc arc = state.getArc(j);
      if ((arc.getIlabel() != iEps) || (arc.getOlabel() != oEps)) {
        continue;
      }
      int nextStateId = arc.getNextState().getId();
      if (closure[nextStateId] == null) {
        calculateClosure(fst, arc.getNextState(), closure, semiring, iEps, oEps);
      }
      HashMap<Integer,Double> closureEntry = closure[nextStateId];
      if (closureEntry != null) {
        for (Integer pathFinalStateIndex : closureEntry.keySet()) {
          State pathFinalState = fst.getState(pathFinalStateIndex);
          Double prevPathWeight = getPathWeight(arc.getNextState(), pathFinalState, closure);
          Preconditions.checkNotNull(prevPathWeight, "prev arc %s never set in closure", arc);
          double newPathWeight = semiring.times(prevPathWeight, arc.getWeight());
          add(state, pathFinalState, newPathWeight, closure, semiring);
        }
      }
      add(state, arc.getNextState(), arc.getWeight(), closure, semiring);
    }
  }
248072
function leaveFromCurrentSegment(analyzer, node) {
    const state = CodePath.getState(analyzer.codePath);
    const currentSegments = state.currentSegments;

    for (let i = 0; i < currentSegments.length; ++i) {
        const currentSegment = currentSegments[i];

        debug.dump(`onCodePathSegmentEnd ${currentSegment.id}`);
        if (currentSegment.reachable) {
            analyzer.emitter.emit(
                "onCodePathSegmentEnd",
                currentSegment,
                node
            );
        }
    }

    state.currentSegments = [];
}
1327702
protected void setState(State state) {
        if (DEBUG)
            LOG.debug("{} --> {}", _state, state);
        _state = state;
    }
1330170
private void processClasspath(String classpathElement) throws ResourceNotFoundException, ParseErrorException, Exception {
//        getLog().info("Classpath is " + classpathElement);
        if (classpathElement.endsWith(".jar")) {
            // TODO: implement JAR scanning
        } else {
            final File dir = new File(classpathElement);

            processPackage(dir, dir);
        }
    }
860480
def find_states(path)
      state = self
      parts = path.split('.')
      ret = []
      parts.each do |name|
        state = state.states[name.to_sym]
        ret << state
        return unless state
      end
      ret
    end
1143715
protected void traverseJar(File file, TraversalState state) {
    JarFile		jar;
    JarEntry		entry;
    Enumeration		enm;

    if (isLoggingEnabled())
      getLogger().log(Level.INFO, "Analyzing jar: " + file);

    if (!file.exists()) {
      getLogger().log(Level.WARNING, "Jar does not exist: " + file);
      return;
    }
    
    try {
      jar = new JarFile(file);
      enm = jar.entries();
      while (enm.hasMoreElements()) {
        entry = (JarEntry) enm.nextElement();
        if (entry.getName().endsWith(".class"))
          traverse(entry.getName(), state);
      }
      traverseManifest(jar.getManifest(), state);
    }
    catch (Exception e) {
      getLogger().log(Level.SEVERE, "Failed to inspect: " + file, e);
    }
  }
238321
protected final void setState(int state) {

        String thisMethodName = "setState";

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.entry(tc, thisMethodName, Integer.toString(state));
        }

        _state = state;
        // 212263 - State changes promoted from debug to info

        // 227363 - Only use info for certain state changes. Other state changes
        // that are less interesting to users are kept as debug only. The rationale
        // for the split is as follows:
        // STATE_UNINITIALIZED => debug, because not interesting
        // STATE_INITIALIZING => debug, because trivial change
        // STATE_INITIALIZED => debug, limited interest
        // STATE_JOINING => debug, useful when DCS/HAM problems
        // STATE_JOINED => info, because hi-lites DCS/HAM problems
        // STATE_AUTOSTARTING => debug, not interesting
        // STATE_STARTING => info, need to know ME is trying to start
        // STATE_STARTED => info, essential knowledge
        // STATE_STOPPING => info, useful indication that ME is trying
        // STATE_STOPPING_MEMBER => info, useful cos only state on deactivate path
        // STATE_STOPPED => info, essential knowledge
        // STATE_DESTROYING => debug, limited interest
        // STATE_DESTROYED => debug, limited interest

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            SibTr.exit(tc, thisMethodName);
        }
    }
979093
private String normalizeState(String state) {

        String result = "";
        if (state.contains(STATE_SEPARATOR)) {
            result = state;
            while (result.startsWith("/")) {
                result = result.substring(1);
            }
        }
        return result;
    }
1289731
@Override
  public void part(int start, int end) {
    blockNumbers[count][0] = start;
    blockNumbers[count][1] = end - 1;
    count++;
  }
652270
private static void processPathPart(String path, Set<String> classes) {
        File rootFile = new File(path);
        if (rootFile.isDirectory() == false) {
            return;
        }

        File[] files = rootFile.listFiles();
        for (File f : files) {
            // classes in the anonymous package
            if (f.getName().endsWith(".class")) {
                String className = f.getName();
                // trim the trailing .class from the end
                className = className.substring(0, className.length() - ".class".length());
                classes.add(className);
            }
            if (f.isDirectory()) {
                Package p = new Package(null, f);
                p.process(classes);
            }
        }
    }
715079
@Override
    public ClassContext analyze(IAnalysisCache analysisCache, ClassDescriptor descriptor) throws CheckedAnalysisException {

        JavaClass javaClass = analysisCache.getClassAnalysis(JavaClass.class, descriptor);
        ClassContext classContext = new ClassContext(javaClass, AnalysisContext.currentAnalysisContext());
        return classContext;
    }
407011
public final void analyze(final File classesDir) {

        final FileProcessor fileProcessor = new FileProcessor(new FileHandler() {
            @Override
            public final FileHandlerResult handleFile(final File classFile) {
                if (!classFile.getName().endsWith(".class")) {
                    return FileHandlerResult.CONTINUE;
                }
                try {
                    final ClassInfo classInfo = new ClassInfo(classFile);

                    final Package<DependsOn> allowedPkg = dependencies.findAllowedByName(classInfo.getPackageName());
                    if (allowedPkg == null) {
                        final Package<NotDependsOn> forbiddenPkg = dependencies.findForbiddenByName(classInfo.getPackageName());
                        if (forbiddenPkg == null) {
                            dependencyErrors.addAll(checkAlwaysForbiddenSection(dependencies, classInfo));
                        } else {
                            dependencyErrors.addAll(checkForbiddenSection(dependencies, forbiddenPkg, classInfo));
                        }
                    } else {
                        dependencyErrors.addAll(checkAllowedSection(dependencies, allowedPkg, classInfo));
                    }
                } catch (final IOException ex) {
                    throw new RuntimeException("Error handling file: " + classFile, ex);
                }

                return FileHandlerResult.CONTINUE;

            }
        });

        dependencyErrors.clear();
        fileProcessor.process(classesDir);

    }
210829
private static String[] getRegions(final String state) {
		if ("ACT".equals(state)) {
			return ACT_REGIONS;

		} else if ("VIC".equals(state)) {
			return VIC_REGIONS;
		} else {
			return null;
		}

	}
1321491
public static void partByPart(InputStream _inputStream, String delimiter, Function<String, Object> function) {
        try (Scanner scanner = new Scanner(_inputStream);) {
            scanner.useDelimiter(delimiter);
            while (scanner.hasNext()) {
                String next = scanner.next();
                function.apply(next);
            }
        }
    }
606728
def use_comparative_assessment_part_view(self):
        """"""
        self._object_views['assessment_part'] = COMPARATIVE
        # self._get_provider_session('assessment_part_lookup_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_comparative_assessment_part_view()
            except AttributeError:
                pass