/** * Gets the best token for this state * * @param state the state of interest * @return the best token */ protected Token getBestToken(SearchState state) { Token best = bestTokenMap.get(state); if (logger.isLoggable(Level.FINER) && best != null) { logger.finer("BT " + best + " for state " + state); } return best; }
/** Dumps out info about this pool */ public void dumpInfo() { logger.info("Max CI Units " + numCIUnits); logger.info("Unit table size " + unitTable.length); if (logger.isLoggable(Level.FINER)) { for (int i = 0; i < unitTable.length; i++) { logger.finer(String.valueOf(i) + ' ' + unitTable[i]); } } }
private static void recallErrors(List<List<Mention>> goldMentions, List<List<Mention>> predictedMentions, Annotation doc) throws IOException { List<CoreMap> coreMaps = doc.get(CoreAnnotations.SentencesAnnotation.class); int numSentences = goldMentions.size(); for (int i=0;i<numSentences;i++){ CoreMap coreMap = coreMaps.get(i); List<CoreLabel> words = coreMap.get(CoreAnnotations.TokensAnnotation.class); Tree tree = coreMap.get(TreeCoreAnnotations.TreeAnnotation.class); List<Mention> goldMentionsSent = goldMentions.get(i); List<Pair<Integer,Integer>> goldMentionsSpans = extractSpans(goldMentionsSent); for (Pair<Integer,Integer> mentionSpan: goldMentionsSpans){ logger.finer("RECALL ERROR\n"); logger.finer(coreMap + "\n"); for (int x=mentionSpan.first;x<mentionSpan.second;x++){ logger.finer(words.get(x).value() + " "); } logger.finer("\n"+tree + "\n"); } } }
Map<Integer, Mention> golds = document.allGoldMentions; for (int i = 0 ; i < orderedMentionsBySentence.size(); i++) { List<Mention> orderedMentions = orderedMentionsBySentence.get(i); for (int j = 0 ; j < orderedMentions.size(); j++) { Mention m = orderedMentions.get(j); logger.fine("=========Line: "+i+"\tmention: "+j+"======================================================="); logger.fine(m.spanToString()+"\tmentionID: "+m.mentionID+"\tcorefClusterID: "+m.corefClusterID+"\tgoldCorefClusterID: "+m.goldCorefClusterID); CorefCluster corefCluster = corefClusters.get(m.corefClusterID); if (corefCluster != null) { corefCluster.printCorefCluster(logger); } else { logger.finer("CANNOT find coref cluster for cluster " + m.corefClusterID); logger.finer("cluster info: "); if (mC != null) { mC.printCorefCluster(logger); } else { logger.finer("CANNOT find coref cluster for cluster " + m.corefClusterID); logger.finer("----------------------------------------------------------"); if (aC != null) { aC.printCorefCluster(logger); } else { logger.finer("CANNOT find coref cluster for cluster " + m.corefClusterID); logger.finer("");
private static void printDiscourseStructure(Document document) { logger.finer("DISCOURSE STRUCTURE=============================="); logger.finer("doc type: "+document.docType); int previousUtterIndex = -1; String previousSpeaker = ""; try { int previousSpeakerID = Integer.parseInt(previousSpeaker); logger.finer("\n<utter>: "+previousUtterIndex + " <speaker>: "+document.allPredictedMentions.get(previousSpeakerID).spanToString()); } catch (Exception e) { logger.finer("\n<utter>: "+previousUtterIndex + " <speaker>: "+previousSpeaker); logger.finer(sb.toString()); sb.setLength(0); previousUtterIndex = utterIndex; logger.finer("\n<utter>: "+previousUtterIndex + " <speaker>: "+document.allPredictedMentions.get(previousSpeakerID).spanToString()); } catch (Exception e) { logger.finer("\n<utter>: "+previousUtterIndex + " <speaker>: "+previousSpeaker); logger.finer(sb.toString()); logger.finer("END OF DISCOURSE STRUCTURE==============================");
public Resource[] getResources(Device device) throws ValidationException { if (!device.isRoot()) return null; Set<Resource> resources = new HashSet<>(); List<ValidationError> errors = new ArrayList<>(); log.fine("Discovering local resources of device graph"); Resource[] discoveredResources = device.discoverResources(this); for (Resource resource : discoveredResources) { log.finer("Discovered: " + resource); if (!resources.add(resource)) { log.finer("Local resource already exists, queueing validation error"); errors.add(new ValidationError( getClass(), "resources", "Local URI namespace conflict between resources of device: " + resource )); } } if (errors.size() > 0) { throw new ValidationException("Validation of device graph failed, call getErrors() on exception", errors); } return resources.toArray(new Resource[resources.size()]); }
LOGGER.log(Level.FINE, "Have bespoke returnSourceCodeObjectsStatement from DBURI: \"{0}\"", returnSourceCodeObjectsStatement); try (PreparedStatement sourceCodeObjectsStatement = getConnection() LOGGER.fine( "Have dbUri - no returnSourceCodeObjectsStatement, reverting to DatabaseMetaData.getProcedures(...)"); LOGGER.finer(String.format("Identfied=%d sourceObjects", sourceObjectsList.size()));
protected boolean evaluate(CrawlURI uri) { List<Pattern> regexes = getRegexList(); if(regexes.size()==0){ return false; boolean matches = p.matcher(str).matches(); if (logger.isLoggable(Level.FINER)) { logger.finer("Tested '" + str + "' match with regex '" + p.pattern() + " and result was " + matches); if(listLogicOR){ logger.fine("Matched: " + str); return true;
/** * Reads the output arguments after an action execution using accessors. * * @param action The action of which the output arguments are read. * @param instance The instance on which the accessors will be invoked. * @return <code>null</code> if the action has no output arguments, a single instance if it has one, an * <code>Object[]</code> otherwise. * @throws Exception */ protected Object readOutputArgumentValues(Action<LocalService> action, Object instance) throws Exception { Object[] results = new Object[action.getOutputArguments().length]; log.fine("Attempting to retrieve output argument values using accessor: " + results.length); int i = 0; for (ActionArgument outputArgument : action.getOutputArguments()) { log.finer("Calling acccessor method for: " + outputArgument); StateVariableAccessor accessor = getOutputArgumentAccessors().get(outputArgument); if (accessor != null) { log.fine("Calling accessor to read output argument value: " + accessor); results[i++] = accessor.read(instance); } else { throw new IllegalStateException("No accessor bound for: " + outputArgument); } } if (results.length == 1) { return results[0]; } return results.length > 0 ? results : null; }
List<String> kv = KvpUtils.escapedTokens(kvp, ':', 2); String key = kv.get(0); String raw = kv.size() == 1 ? "true" : KvpUtils.unescape(kv.get(1)); if (LOGGER.isLoggable(Level.FINER)) LOGGER.finer( "Could not find kvp parser for: '" + key + "'. Storing as raw string."); parsed = raw;
public void registerBeansWithContext(StaticApplicationContext applicationContext) { for (BeanConfiguration bc : beanConfigs.values()) { if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("[RuntimeConfiguration] Registering bean [" + bc.getName() + "]"); if (LOGGER.isLoggable(Level.FINEST)) { PropertyValue[] pvs = bc.getBeanDefinition() .getPropertyValues() BeanDefinition bd = beanDefinitions.get(key); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("[RuntimeConfiguration] Registering bean [" + key + "]"); if (LOGGER.isLoggable(Level.FINEST)) { for (PropertyValue pv : bd.getPropertyValues().getPropertyValues()) {
private void setType(Dictionaries dict) { if (isListLike()) { mentionType = MentionType.LIST; SieveCoreferenceSystem.logger.finer("IS LIST: " + this); } else if (headWord.containsKey(CoreAnnotations.EntityTypeAnnotation.class)){ // ACE gold mention type if (headWord.get(CoreAnnotations.EntityTypeAnnotation.class).equals("PRO")) { mentionType = MentionType.PRONOMINAL; } else if (headWord.get(CoreAnnotations.EntityTypeAnnotation.class).equals("NAM")) { mentionType = MentionType.PROPER; } else { mentionType = MentionType.NOMINAL; } } else { // MUC if(!headWord.containsKey(CoreAnnotations.NamedEntityTagAnnotation.class)) { // temporary fix mentionType = MentionType.NOMINAL; SieveCoreferenceSystem.logger.finest("no NamedEntityTagAnnotation: "+headWord); } else if (headWord.get(CoreAnnotations.PartOfSpeechAnnotation.class).startsWith("PRP") || (originalSpan.size() == 1 && headWord.get(CoreAnnotations.NamedEntityTagAnnotation.class).equals("O") && (dict.allPronouns.contains(headString) || dict.relativePronouns.contains(headString) ))) { mentionType = MentionType.PRONOMINAL; } else if (!headWord.get(CoreAnnotations.NamedEntityTagAnnotation.class).equals("O") || headWord.get(CoreAnnotations.PartOfSpeechAnnotation.class).startsWith("NNP")) { mentionType = MentionType.PROPER; } else { mentionType = MentionType.NOMINAL; } } }
int maximumIterations = this.bracesList.size() * this.bracesList.size(); int l = -1; int i = 0; while (i < this.bracesList.size()) { l++; StackObject so = bracesList.get(i); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("Processing bracesList(l,i)=(" + l + "," + i + ") of Type " + so.getType() + " with State (aktStatus) = " + aktStatus); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("Transition aktStatus=" + aktStatus); if (lookAhead) { this.lastIndex = i - 1; LOGGER.finer("aktStatus is NULL (lookAhead): Invalid transition"); LOGGER.exiting(this.getClass().getCanonicalName(), "run", false); } else if (l > maximumIterations) { if (LOGGER.isLoggable(Level.SEVERE)) { LOGGER.severe("aktStatus is NULL: maximum Iterations exceeded, abort " + i); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finer("Completed search: firstIndex=" + firstIndex + ", lastIndex=" + lastIndex);
private void changeSupport(Node newOriginal) { final boolean LOG_ENABLED = LOGGER.isLoggable(Level.FINER); boolean init = entrySupport().isInitialized(); boolean changed = false; LOGGER.finer("changeSupport() " + this); // NOI18N LOGGER.finer(" newOriginal: " + newOriginal); // NOI18N LOGGER.finer(" entrySupport().isInitialized(): " + init); // NOI18N LOGGER.finer(" parent: " + parent); // NOI18N if (snapshot.size() > 0) { int[] idxs = getSnapshotIdxs(snapshot); if (newOriginal != null) { LOGGER.finer(" firing node removal: " + snapshot); // NOI18N LOGGER.log(Level.FINER, " initializing new support"); // NOI18N
if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("Determining visibility of " + d + " in contexts of type " + contextClass); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Querying " + f + " for visibility of " + d + " in type " + contextClass); if (LOGGER.isLoggable(Level.CONFIG)) { LOGGER.config("Filter " + f + " hides " + d + " in contexts of type " + contextClass); LOGGER.log(Level.WARNING, "Encountered error while processing filter " + f + " for contexts of type " + contextClass, e); throw e; } catch (Throwable e) { LOGGER.log(logLevelFor(f), "Uncaught exception from filter " + f + " for context of type " + contextClass, e); continue OUTER; // veto-ed. not shown
/** An incremental, poll-based expunger. * * Package-protected for unit-test visibility. */ @SuppressWarnings("unchecked") protected synchronized void pageOutStaleEntries() { int c = 0; long startTime = System.currentTimeMillis(); for(SoftEntry<V> entry; (entry = (SoftEntry<V>)refQueue.poll()) != null;) { pageOutStaleEntry(entry); c++; } if (c > 0 && logger.isLoggable(Level.FINER)) { long endTime = System.currentTimeMillis(); try { logger.finer("DB: " + db.getDatabaseName() + ", Expunged: " + c + ", Diskmap size: " + diskMap.size() + ", Cache size: " + memMap.size() + ", in "+(endTime-startTime)+"ms"); } catch (DatabaseException e) { logger.log(Level.FINER,"exception while logging",e); } } }
public void writeBody(ActionRequestMessage requestMessage, ActionInvocation actionInvocation) throws UnsupportedDataException { log.fine("Writing body of " + requestMessage + " for: " + actionInvocation); try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setNamespaceAware(true); Document d = factory.newDocumentBuilder().newDocument(); Element body = writeBodyElement(d); writeBodyRequest(d, body, requestMessage, actionInvocation); if (log.isLoggable(Level.FINER)) { log.finer("===================================== SOAP BODY BEGIN ============================================"); log.finer(requestMessage.getBodyString()); log.finer("-===================================== SOAP BODY END ============================================"); } } catch (Exception ex) { throw new UnsupportedDataException("Can't transform message payload: " + ex, ex); } }
/** * Returns the last modified time of the given file or directory. * * @param path a file or directory * @return the last modified time */ public static Instant lastModifiedTime(Path path) { try { return Files.getLastModifiedTime(path.toRealPath()).toInstant(); } catch (IOException e) { LOGGER.log(Level.FINE, e, () -> "Cannot obtain the last modified time of '" + path + "'."); } Instant timestamp = Instant.MAX; LOGGER.finer("Cannot obtain the last modified time. Used time '" + timestamp + "' as a content timestamp."); return timestamp; }
/** * Loads scene ambient light. * @param worldStructure * the world's blender structure * @return the scene's ambient light */ public Light toAmbientLight(Structure worldStructure) { LOGGER.fine("Loading ambient light."); AmbientLight ambientLight = null; float ambr = ((Number) worldStructure.getFieldValue("ambr")).floatValue(); float ambg = ((Number) worldStructure.getFieldValue("ambg")).floatValue(); float ambb = ((Number) worldStructure.getFieldValue("ambb")).floatValue(); if (ambr > 0 || ambg > 0 || ambb > 0) { ambientLight = new AmbientLight(); ColorRGBA ambientLightColor = new ColorRGBA(ambr, ambg, ambb, 0.0f); ambientLight.setColor(ambientLightColor); LOGGER.log(Level.FINE, "Loaded ambient light: {0}.", ambientLightColor); } else { LOGGER.finer("Ambient light is set to BLACK which means: no ambient light! The ambient light node will not be included in the result."); } return ambientLight; }
/** * Look up method used for unwrapping (if supported in the application container). * * @param env * @param methods * @param className * @param methodName */ private static void methodSearch( String env, Map<Class<?>, Method> methods, String className, String methodName) { try { Class<?> wrappedConnection = Class.forName(className); Method unwrap = wrappedConnection.getMethod(methodName, (Class[]) null); LOGGER.info(env + " " + className + " supported"); methods.put(wrappedConnection, unwrap); } catch (ClassNotFoundException ignore) { LOGGER.finer(env + " " + className + " not found"); } catch (Throwable e) { LOGGER.fine(env + " " + className + " not available:" + e); } }