code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { private Stream<ConceptSetMeasure> runComputeCoreness(GraqlCompute.Centrality query) { long k = query.where().minK().get(); if (k < 2L) throw GraqlQueryException.kValueSmallerThanTwo(); Set<Label> targetTypeLabels; // Check if ofType is valid before returning emptyMap if (query.of().isEmpty()) { targetTypeLabels = scopeTypeLabels(query); } else { targetTypeLabels = query.of().stream() .flatMap(t -> { Label typeLabel = Label.of(t); Type type = tx.getSchemaConcept(typeLabel); if (type == null) throw GraqlQueryException.labelNotFound(typeLabel); if (type.isRelationType()) throw GraqlQueryException.kCoreOnRelationType(typeLabel); return type.subs(); }) .map(SchemaConcept::label) .collect(toSet()); } Set<Label> scopeTypeLabels = Sets.union(scopeTypeLabels(query), targetTypeLabels); if (!scopeContainsInstance(query)) { return Stream.empty(); } ComputerResult result; Set<LabelId> scopeTypeLabelIDs = convertLabelsToIds(scopeTypeLabels); Set<LabelId> targetTypeLabelIDs = convertLabelsToIds(targetTypeLabels); try { result = compute(new CorenessVertexProgram(k), new DegreeDistributionMapReduce(targetTypeLabelIDs, CorenessVertexProgram.CORENESS), scopeTypeLabelIDs); } catch (NoResultException e) { return Stream.empty(); } Map<Long, Set<ConceptId>> centralityMap = result.memory().get(DegreeDistributionMapReduce.class.getName()); return centralityMap.entrySet().stream() .map(centrality -> new ConceptSetMeasure(centrality.getValue(), centrality.getKey())); } }
public class class_name { private Stream<ConceptSetMeasure> runComputeCoreness(GraqlCompute.Centrality query) { long k = query.where().minK().get(); if (k < 2L) throw GraqlQueryException.kValueSmallerThanTwo(); Set<Label> targetTypeLabels; // Check if ofType is valid before returning emptyMap if (query.of().isEmpty()) { targetTypeLabels = scopeTypeLabels(query); // depends on control dependency: [if], data = [none] } else { targetTypeLabels = query.of().stream() .flatMap(t -> { Label typeLabel = Label.of(t); // depends on control dependency: [if], data = [none] Type type = tx.getSchemaConcept(typeLabel); if (type == null) throw GraqlQueryException.labelNotFound(typeLabel); if (type.isRelationType()) throw GraqlQueryException.kCoreOnRelationType(typeLabel); return type.subs(); // depends on control dependency: [if], data = [none] }) .map(SchemaConcept::label) .collect(toSet()); } Set<Label> scopeTypeLabels = Sets.union(scopeTypeLabels(query), targetTypeLabels); if (!scopeContainsInstance(query)) { return Stream.empty(); } ComputerResult result; Set<LabelId> scopeTypeLabelIDs = convertLabelsToIds(scopeTypeLabels); Set<LabelId> targetTypeLabelIDs = convertLabelsToIds(targetTypeLabels); try { result = compute(new CorenessVertexProgram(k), new DegreeDistributionMapReduce(targetTypeLabelIDs, CorenessVertexProgram.CORENESS), scopeTypeLabelIDs); } catch (NoResultException e) { return Stream.empty(); } Map<Long, Set<ConceptId>> centralityMap = result.memory().get(DegreeDistributionMapReduce.class.getName()); return centralityMap.entrySet().stream() .map(centrality -> new ConceptSetMeasure(centrality.getValue(), centrality.getKey())); } }
public class class_name { @Nullable public static String getFileNameFromUri(URI uri) { if (!uri.getScheme().equals("jar")) { return uri.getPath(); } try { String jarEntryFileName = ((JarURLConnection) uri.toURL().openConnection()).getEntryName(); // It's possible (though it violates the zip file spec) for paths to zip file entries to use // '\' as the separator. Normalize to use '/'. jarEntryFileName = BACKSLASH_MATCHER.replaceFrom(jarEntryFileName, '/'); if (!jarEntryFileName.startsWith("/")) { jarEntryFileName = "/" + jarEntryFileName; } return jarEntryFileName; } catch (IOException e) { return null; } } }
public class class_name { @Nullable public static String getFileNameFromUri(URI uri) { if (!uri.getScheme().equals("jar")) { return uri.getPath(); // depends on control dependency: [if], data = [none] } try { String jarEntryFileName = ((JarURLConnection) uri.toURL().openConnection()).getEntryName(); // It's possible (though it violates the zip file spec) for paths to zip file entries to use // '\' as the separator. Normalize to use '/'. jarEntryFileName = BACKSLASH_MATCHER.replaceFrom(jarEntryFileName, '/'); // depends on control dependency: [try], data = [none] if (!jarEntryFileName.startsWith("/")) { jarEntryFileName = "/" + jarEntryFileName; // depends on control dependency: [if], data = [none] } return jarEntryFileName; // depends on control dependency: [try], data = [none] } catch (IOException e) { return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void setTabText(int index, String text) { TextView tv = (TextView) mTabTitleViews.get(index); if (tv != null) { tv.setText(text); } } }
public class class_name { public void setTabText(int index, String text) { TextView tv = (TextView) mTabTitleViews.get(index); if (tv != null) { tv.setText(text); // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override public Loader<ProfileFieldContainer> onCreateLoader(int id, Bundle args) { switch (id) { case LoadersConfig.LOAD_PROFILE_LOADER_ID: return new AsyncTaskLoader<ProfileFieldContainer>(getActivity()) { @Override public ProfileFieldContainer loadInBackground() { if (mMode == Mode.SELF || mMode == Mode.EDIT) { return SPF.get().getProfileManager().getProfileFieldBulk(mCurrentPersona, ProfilePagerAdapter.DEFAULT_FIELDS); } else { SPFRemoteInstance instance = SPF.get().getPeopleManager().getPerson(mPersonIdentifier); if (instance == null) { throw new IllegalStateException("Person " + mPersonIdentifier + " not found in proximity"); } else { String app = getActivity().getCallingPackage(); app = app == null ? "it.polimi.spf.app" : app; return instance.getProfileBulk(ProfileField.toIdentifierList(ProfilePagerAdapter.DEFAULT_FIELDS), app); } } } }; case LoadersConfig.SAVE_PROFILE_LOADER_ID: if (mMode != Mode.EDIT) { Log.e(TAG, "SAVE_PROFILE_LOADER initialized in mode " + mMode); } return new AsyncTaskLoader<ProfileFieldContainer>(getActivity()) { @Override public ProfileFieldContainer loadInBackground() { SPF.get().getProfileManager().setProfileFieldBulk(mContainer, mCurrentPersona); return null; } }; default: throw new IllegalArgumentException("No loader for id " + id); } } }
public class class_name { @Override public Loader<ProfileFieldContainer> onCreateLoader(int id, Bundle args) { switch (id) { case LoadersConfig.LOAD_PROFILE_LOADER_ID: return new AsyncTaskLoader<ProfileFieldContainer>(getActivity()) { @Override public ProfileFieldContainer loadInBackground() { if (mMode == Mode.SELF || mMode == Mode.EDIT) { return SPF.get().getProfileManager().getProfileFieldBulk(mCurrentPersona, ProfilePagerAdapter.DEFAULT_FIELDS); // depends on control dependency: [if], data = [none] } else { SPFRemoteInstance instance = SPF.get().getPeopleManager().getPerson(mPersonIdentifier); if (instance == null) { throw new IllegalStateException("Person " + mPersonIdentifier + " not found in proximity"); } else { String app = getActivity().getCallingPackage(); app = app == null ? "it.polimi.spf.app" : app; // depends on control dependency: [if], data = [none] return instance.getProfileBulk(ProfileField.toIdentifierList(ProfilePagerAdapter.DEFAULT_FIELDS), app); // depends on control dependency: [if], data = [none] } } } }; case LoadersConfig.SAVE_PROFILE_LOADER_ID: if (mMode != Mode.EDIT) { Log.e(TAG, "SAVE_PROFILE_LOADER initialized in mode " + mMode); // depends on control dependency: [if], data = [none] } return new AsyncTaskLoader<ProfileFieldContainer>(getActivity()) { @Override public ProfileFieldContainer loadInBackground() { SPF.get().getProfileManager().setProfileFieldBulk(mContainer, mCurrentPersona); return null; } }; default: throw new IllegalArgumentException("No loader for id " + id); } } }
public class class_name { public TrainingSpecification withSupportedTrainingInstanceTypes(String... supportedTrainingInstanceTypes) { if (this.supportedTrainingInstanceTypes == null) { setSupportedTrainingInstanceTypes(new java.util.ArrayList<String>(supportedTrainingInstanceTypes.length)); } for (String ele : supportedTrainingInstanceTypes) { this.supportedTrainingInstanceTypes.add(ele); } return this; } }
public class class_name { public TrainingSpecification withSupportedTrainingInstanceTypes(String... supportedTrainingInstanceTypes) { if (this.supportedTrainingInstanceTypes == null) { setSupportedTrainingInstanceTypes(new java.util.ArrayList<String>(supportedTrainingInstanceTypes.length)); // depends on control dependency: [if], data = [none] } for (String ele : supportedTrainingInstanceTypes) { this.supportedTrainingInstanceTypes.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static void setTime(Calendar cal, Date time) { if (time != null) { Calendar startCalendar = popCalendar(time); cal.set(Calendar.HOUR_OF_DAY, startCalendar.get(Calendar.HOUR_OF_DAY)); cal.set(Calendar.MINUTE, startCalendar.get(Calendar.MINUTE)); cal.set(Calendar.SECOND, startCalendar.get(Calendar.SECOND)); pushCalendar(startCalendar); } } }
public class class_name { public static void setTime(Calendar cal, Date time) { if (time != null) { Calendar startCalendar = popCalendar(time); cal.set(Calendar.HOUR_OF_DAY, startCalendar.get(Calendar.HOUR_OF_DAY)); // depends on control dependency: [if], data = [none] cal.set(Calendar.MINUTE, startCalendar.get(Calendar.MINUTE)); // depends on control dependency: [if], data = [none] cal.set(Calendar.SECOND, startCalendar.get(Calendar.SECOND)); // depends on control dependency: [if], data = [none] pushCalendar(startCalendar); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void set(Map<String, String> newConfiguration) { for(Map.Entry<String, String> entry : newConfiguration.entrySet()) { if(entry.getValue() == null) { this.unset(entry.getKey()); } else { this.set(entry.getKey(), entry.getValue()); } } } }
public class class_name { public void set(Map<String, String> newConfiguration) { for(Map.Entry<String, String> entry : newConfiguration.entrySet()) { if(entry.getValue() == null) { this.unset(entry.getKey()); // depends on control dependency: [if], data = [none] } else { this.set(entry.getKey(), entry.getValue()); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public Graph<K, NullValue, EV> intersect(Graph<K, VV, EV> graph, boolean distinctEdges) { DataSet<Edge<K, EV>> intersectEdges; if (distinctEdges) { intersectEdges = getDistinctEdgeIntersection(graph.getEdges()); } else { intersectEdges = getPairwiseEdgeIntersection(graph.getEdges()); } return Graph.fromDataSet(intersectEdges, getContext()); } }
public class class_name { public Graph<K, NullValue, EV> intersect(Graph<K, VV, EV> graph, boolean distinctEdges) { DataSet<Edge<K, EV>> intersectEdges; if (distinctEdges) { intersectEdges = getDistinctEdgeIntersection(graph.getEdges()); // depends on control dependency: [if], data = [none] } else { intersectEdges = getPairwiseEdgeIntersection(graph.getEdges()); // depends on control dependency: [if], data = [none] } return Graph.fromDataSet(intersectEdges, getContext()); } }
public class class_name { protected Link insert(Token newToken, Link insertPoint, Transaction transaction) throws ObjectManagerException { final String methodName = "insert"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { newToken, insertPoint, transaction }); // Prevent other transactions using the list until its creation is commited. if (!(state == stateReady) && !((state == stateAdded) && lockedBy(transaction))) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { new Integer(state), stateNames[state] }); throw new InvalidStateException(this, state, stateNames[state]); } // All replacements to links in the list must be made together, so we // construct a single log record for all of them. managedObjectsToAdd.clear(); managedObjectsToReplace.clear(); reservedSpaceInStore = storeSpaceForAdd(); owningToken.objectStore.reserve((int) reservedSpaceInStore, false); // Create the new link and add it to its object store. Link newLink = new Link(this, newToken, insertPoint.previous, insertPoint.owningToken, transaction); managedObjectsToAdd.add(newLink); // Chain the new Link into the list. if (insertPoint.previous == null) // Cursor at head of list? { if (head == null) // Only/first element in the list? tail = newLink.getToken(); else { insertPoint.previous = newLink.getToken(); managedObjectsToReplace.add(insertPoint); } head = newLink.getToken(); } else { // Chain the new element into the body of the list. Link previousLink = (Link) insertPoint.previous.getManagedObject(); previousLink.next = newLink.getToken(); managedObjectsToReplace.add(previousLink); // Cursor at the end of the list? if (insertPoint.owningToken == tail) { tail = newLink.getToken(); } else { // Not at the end of the list. insertPoint.previous = newLink.getToken(); managedObjectsToReplace.add(insertPoint); } } // If at head of list? // We dont know where the link is added so assume it is ahead of the // availableHead. availableHead = head; skipToBeDeleted(); incrementSize(); // Adjust list length assuming we will commit. managedObjectsToReplace.add(this); // Harden the updates. If the update fails, because the log is full, // we have affected the structure of the list so we will have to // reverse the changes. Reserve enough space to reverse the update if the // transaction backs out. try { transaction.optimisticReplace(managedObjectsToAdd, managedObjectsToReplace, null, // No tokens to delete. null, // No tokens to notify. +logSpaceForDelete()); // Give up reserved space, but keep back enough to remove the entry if we have to. owningToken.objectStore.reserve((int) (storeSpaceForRemove() - reservedSpaceInStore), false); } catch (InvalidStateException exception) { // No FFDC Code Needed, user error. // Remove the link we just added. undoAdd(newLink); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw exception; } catch (LogFileFullException exception) { // No FFDC Code Needed, InternalTransaction has already done this. // Remove the link we just added. undoAdd(newLink); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw exception; // We should not see ObjectStoreFullException because we have preReserved // the ObjectStore space. // } catch (ObjectStoreFullException exception) { // // No FFDC Code Needed, InternalTransaction has already done this. // // Remove the link we just added. // undoAdd(newLink); // // if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) // trace.exit(this, cclass, methodName, exception); // throw exception; } // try. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { newLink }); return newLink; } }
public class class_name { protected Link insert(Token newToken, Link insertPoint, Transaction transaction) throws ObjectManagerException { final String methodName = "insert"; if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.entry(this, cclass, methodName, new Object[] { newToken, insertPoint, transaction }); // Prevent other transactions using the list until its creation is commited. if (!(state == stateReady) && !((state == stateAdded) && lockedBy(transaction))) { if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { new Integer(state), stateNames[state] }); throw new InvalidStateException(this, state, stateNames[state]); } // All replacements to links in the list must be made together, so we // construct a single log record for all of them. managedObjectsToAdd.clear(); managedObjectsToReplace.clear(); reservedSpaceInStore = storeSpaceForAdd(); owningToken.objectStore.reserve((int) reservedSpaceInStore, false); // Create the new link and add it to its object store. Link newLink = new Link(this, newToken, insertPoint.previous, insertPoint.owningToken, transaction); managedObjectsToAdd.add(newLink); // Chain the new Link into the list. if (insertPoint.previous == null) // Cursor at head of list? { if (head == null) // Only/first element in the list? tail = newLink.getToken(); else { insertPoint.previous = newLink.getToken(); // depends on control dependency: [if], data = [none] managedObjectsToReplace.add(insertPoint); // depends on control dependency: [if], data = [none] } head = newLink.getToken(); } else { // Chain the new element into the body of the list. Link previousLink = (Link) insertPoint.previous.getManagedObject(); previousLink.next = newLink.getToken(); managedObjectsToReplace.add(previousLink); // Cursor at the end of the list? if (insertPoint.owningToken == tail) { tail = newLink.getToken(); // depends on control dependency: [if], data = [none] } else { // Not at the end of the list. insertPoint.previous = newLink.getToken(); // depends on control dependency: [if], data = [none] managedObjectsToReplace.add(insertPoint); // depends on control dependency: [if], data = [none] } } // If at head of list? // We dont know where the link is added so assume it is ahead of the // availableHead. availableHead = head; skipToBeDeleted(); incrementSize(); // Adjust list length assuming we will commit. managedObjectsToReplace.add(this); // Harden the updates. If the update fails, because the log is full, // we have affected the structure of the list so we will have to // reverse the changes. Reserve enough space to reverse the update if the // transaction backs out. try { transaction.optimisticReplace(managedObjectsToAdd, managedObjectsToReplace, null, // No tokens to delete. null, // No tokens to notify. +logSpaceForDelete()); // Give up reserved space, but keep back enough to remove the entry if we have to. owningToken.objectStore.reserve((int) (storeSpaceForRemove() - reservedSpaceInStore), false); } catch (InvalidStateException exception) { // No FFDC Code Needed, user error. // Remove the link we just added. undoAdd(newLink); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw exception; } catch (LogFileFullException exception) { // No FFDC Code Needed, InternalTransaction has already done this. // Remove the link we just added. undoAdd(newLink); if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, exception); throw exception; // We should not see ObjectStoreFullException because we have preReserved // the ObjectStore space. // } catch (ObjectStoreFullException exception) { // // No FFDC Code Needed, InternalTransaction has already done this. // // Remove the link we just added. // undoAdd(newLink); // // if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) // trace.exit(this, cclass, methodName, exception); // throw exception; } // try. if (Tracing.isAnyTracingEnabled() && trace.isEntryEnabled()) trace.exit(this, cclass, methodName, new Object[] { newLink }); return newLink; } }
public class class_name { public void emitSeq(String tag, SeqStyle style) { Level parent = parentLevel(); Level lvl = currentLevel(); if(parent.status == LevelStatus.map && parent.ncount % 2 == 1) { write(QUESTION_MARK_SPACE, 2); parent.status = LevelStatus.mapx; } emitTag(tag, "tag:yaml.org,2002:seq"); if(style == SeqStyle.Inline || (parent.status == LevelStatus.imap || parent.status == LevelStatus.iseq)) { write(SQUARE_OPEN, 1); lvl.status = LevelStatus.iseq; } else { lvl.status = LevelStatus.seq; } } }
public class class_name { public void emitSeq(String tag, SeqStyle style) { Level parent = parentLevel(); Level lvl = currentLevel(); if(parent.status == LevelStatus.map && parent.ncount % 2 == 1) { write(QUESTION_MARK_SPACE, 2); // depends on control dependency: [if], data = [none] parent.status = LevelStatus.mapx; // depends on control dependency: [if], data = [none] } emitTag(tag, "tag:yaml.org,2002:seq"); if(style == SeqStyle.Inline || (parent.status == LevelStatus.imap || parent.status == LevelStatus.iseq)) { write(SQUARE_OPEN, 1); // depends on control dependency: [if], data = [none] lvl.status = LevelStatus.iseq; // depends on control dependency: [if], data = [none] } else { lvl.status = LevelStatus.seq; // depends on control dependency: [if], data = [none] } } }
public class class_name { static String getMethodSignature(Method m) { StringBuilder result = new StringBuilder(); result.append('('); for (Class<?> parameterType : m.getParameterTypes()) { result.append(getSignature(parameterType)); } result.append(")"); result.append(getSignature(m.getReturnType())); return result.toString(); } }
public class class_name { static String getMethodSignature(Method m) { StringBuilder result = new StringBuilder(); result.append('('); for (Class<?> parameterType : m.getParameterTypes()) { result.append(getSignature(parameterType)); // depends on control dependency: [for], data = [parameterType] } result.append(")"); result.append(getSignature(m.getReturnType())); return result.toString(); } }
public class class_name { public static int getAlphaNumCount(final Buffer buffer) throws IndexOutOfBoundsException, IOException { boolean done = false; int count = 0; final int index = buffer.getReaderIndex(); while (buffer.hasReadableBytes() && !done) { final byte b = buffer.readByte(); if (isAlphaNum(b)) { ++count; } else { done = true; } } buffer.setReaderIndex(index); return count; } }
public class class_name { public static int getAlphaNumCount(final Buffer buffer) throws IndexOutOfBoundsException, IOException { boolean done = false; int count = 0; final int index = buffer.getReaderIndex(); while (buffer.hasReadableBytes() && !done) { final byte b = buffer.readByte(); if (isAlphaNum(b)) { ++count; // depends on control dependency: [if], data = [none] } else { done = true; // depends on control dependency: [if], data = [none] } } buffer.setReaderIndex(index); return count; } }
public class class_name { @Override public void destroyResources() { if (eurekaConnCleaner != null) { // Execute the connection cleaner one final time during shutdown eurekaConnCleaner.execute(connectionCleanerTask); eurekaConnCleaner.shutdown(); } if (apacheHttpClient != null) { apacheHttpClient.close(); } } }
public class class_name { @Override public void destroyResources() { if (eurekaConnCleaner != null) { // Execute the connection cleaner one final time during shutdown eurekaConnCleaner.execute(connectionCleanerTask); // depends on control dependency: [if], data = [none] eurekaConnCleaner.shutdown(); // depends on control dependency: [if], data = [none] } if (apacheHttpClient != null) { apacheHttpClient.close(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static void validateValues(Object actualValue, Object expectedValue, String pathExpression, TestContext context) throws ValidationException { try { if (actualValue != null) { Assert.isTrue(expectedValue != null, ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", null, actualValue)); if (expectedValue instanceof Matcher) { Assert.isTrue(((Matcher) expectedValue).matches(actualValue), ValidationUtils.buildValueMismatchErrorMessage( "Values not matching for element '" + pathExpression + "'", expectedValue, actualValue)); return; } if (!(expectedValue instanceof String)) { Object converted = TypeConversionUtils.convertIfNecessary(actualValue, expectedValue.getClass()); if (converted == null) { throw new CitrusRuntimeException(String.format("Failed to convert value '%s' to required type '%s'", actualValue, expectedValue.getClass())); } if (converted instanceof List) { Assert.isTrue(converted.toString().equals(expectedValue.toString()), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValue.toString(), converted.toString())); } else if (converted instanceof String[]) { String convertedDelimitedString = StringUtils.arrayToCommaDelimitedString((String[]) converted); String expectedDelimitedString = StringUtils.arrayToCommaDelimitedString((String[]) expectedValue); Assert.isTrue(convertedDelimitedString.equals(expectedDelimitedString), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedDelimitedString, convertedDelimitedString)); } else if (converted instanceof byte[]) { String convertedBase64 = Base64.encodeBase64String((byte[]) converted); String expectedBase64 = Base64.encodeBase64String((byte[]) expectedValue); Assert.isTrue(convertedBase64.equals(expectedBase64), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedBase64, convertedBase64)); } else { Assert.isTrue(converted.equals(expectedValue), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValue, converted)); } } else { String expectedValueString = expectedValue.toString(); String actualValueString; if (List.class.isAssignableFrom(actualValue.getClass())) { actualValueString = StringUtils.arrayToCommaDelimitedString(((List)actualValue).toArray(new Object[((List)actualValue).size()])); expectedValueString = expectedValueString.replaceAll("^\\[", "").replaceAll("\\]$", "").replaceAll(",\\s", ","); } else { actualValueString = actualValue.toString(); } if (ValidationMatcherUtils.isValidationMatcherExpression(String.valueOf(expectedValueString))) { ValidationMatcherUtils.resolveValidationMatcher(pathExpression, actualValueString, String.valueOf(expectedValueString), context); } else { Assert.isTrue(actualValueString.equals(expectedValueString), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValueString, actualValueString)); } } } else if (expectedValue != null) { if (expectedValue instanceof Matcher) { Assert.isTrue(((Matcher) expectedValue).matches(null), ValidationUtils.buildValueMismatchErrorMessage( "Values not matching for element '" + pathExpression + "'", expectedValue, null)); } else if (expectedValue instanceof String) { String expectedValueString = expectedValue.toString(); if (ValidationMatcherUtils.isValidationMatcherExpression(expectedValueString)) { ValidationMatcherUtils.resolveValidationMatcher(pathExpression, null, expectedValueString, context); } else { Assert.isTrue(!StringUtils.hasText(expectedValueString), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValueString, null)); } } else { throw new ValidationException("Validation failed: " + ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValue, null)); } } } catch (IllegalArgumentException | AssertionError e) { throw new ValidationException("Validation failed:", e); } } }
public class class_name { public static void validateValues(Object actualValue, Object expectedValue, String pathExpression, TestContext context) throws ValidationException { try { if (actualValue != null) { Assert.isTrue(expectedValue != null, ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", null, actualValue)); if (expectedValue instanceof Matcher) { Assert.isTrue(((Matcher) expectedValue).matches(actualValue), ValidationUtils.buildValueMismatchErrorMessage( "Values not matching for element '" + pathExpression + "'", expectedValue, actualValue)); return; } if (!(expectedValue instanceof String)) { Object converted = TypeConversionUtils.convertIfNecessary(actualValue, expectedValue.getClass()); if (converted == null) { throw new CitrusRuntimeException(String.format("Failed to convert value '%s' to required type '%s'", actualValue, expectedValue.getClass())); } if (converted instanceof List) { Assert.isTrue(converted.toString().equals(expectedValue.toString()), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValue.toString(), converted.toString())); } else if (converted instanceof String[]) { String convertedDelimitedString = StringUtils.arrayToCommaDelimitedString((String[]) converted); String expectedDelimitedString = StringUtils.arrayToCommaDelimitedString((String[]) expectedValue); Assert.isTrue(convertedDelimitedString.equals(expectedDelimitedString), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedDelimitedString, convertedDelimitedString)); // depends on control dependency: [if], data = [none] } else if (converted instanceof byte[]) { String convertedBase64 = Base64.encodeBase64String((byte[]) converted); String expectedBase64 = Base64.encodeBase64String((byte[]) expectedValue); Assert.isTrue(convertedBase64.equals(expectedBase64), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedBase64, convertedBase64)); // depends on control dependency: [if], data = [none] } else { Assert.isTrue(converted.equals(expectedValue), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValue, converted)); // depends on control dependency: [if], data = [none] } } else { String expectedValueString = expectedValue.toString(); String actualValueString; if (List.class.isAssignableFrom(actualValue.getClass())) { actualValueString = StringUtils.arrayToCommaDelimitedString(((List)actualValue).toArray(new Object[((List)actualValue).size()])); // depends on control dependency: [if], data = [none] expectedValueString = expectedValueString.replaceAll("^\\[", "").replaceAll("\\]$", "").replaceAll(",\\s", ","); // depends on control dependency: [if], data = [none] } else { actualValueString = actualValue.toString(); // depends on control dependency: [if], data = [none] } if (ValidationMatcherUtils.isValidationMatcherExpression(String.valueOf(expectedValueString))) { ValidationMatcherUtils.resolveValidationMatcher(pathExpression, actualValueString, String.valueOf(expectedValueString), context); // depends on control dependency: [if], data = [none] } else { Assert.isTrue(actualValueString.equals(expectedValueString), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValueString, actualValueString)); // depends on control dependency: [if], data = [none] } } } else if (expectedValue != null) { if (expectedValue instanceof Matcher) { Assert.isTrue(((Matcher) expectedValue).matches(null), ValidationUtils.buildValueMismatchErrorMessage( "Values not matching for element '" + pathExpression + "'", expectedValue, null)); } else if (expectedValue instanceof String) { String expectedValueString = expectedValue.toString(); if (ValidationMatcherUtils.isValidationMatcherExpression(expectedValueString)) { ValidationMatcherUtils.resolveValidationMatcher(pathExpression, null, expectedValueString, context); } else { Assert.isTrue(!StringUtils.hasText(expectedValueString), ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValueString, null)); } } else { throw new ValidationException("Validation failed: " + ValidationUtils.buildValueMismatchErrorMessage( "Values not equal for element '" + pathExpression + "'", expectedValue, null)); } } } catch (IllegalArgumentException | AssertionError e) { throw new ValidationException("Validation failed:", e); } } }
public class class_name { public void registerPropertyExclusion( Class target, String propertyName ) { if( target != null && propertyName != null ) { Set set = (Set) exclusionMap.get( target ); if( set == null ){ set = new HashSet(); exclusionMap.put( target, set ); } if( !set.contains( propertyName )){ set.add(propertyName ); } } } }
public class class_name { public void registerPropertyExclusion( Class target, String propertyName ) { if( target != null && propertyName != null ) { Set set = (Set) exclusionMap.get( target ); if( set == null ){ set = new HashSet(); // depends on control dependency: [if], data = [none] exclusionMap.put( target, set ); // depends on control dependency: [if], data = [none] } if( !set.contains( propertyName )){ set.add(propertyName ); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @Override public void updateServerLease(String recoveryIdentity, String recoveryGroup, boolean isServerStartup) throws Exception { if (tc.isEntryEnabled()) Tr.entry(tc, "updateServerLease", new Object[] { recoveryIdentity, recoveryGroup, isServerStartup, this }); if (tc.isDebugEnabled()) Tr.debug(tc, "Using recoveryIdentity " + recoveryIdentity + " and log directory " + _tranRecoveryLogDirStem); // At this point we already have a lock on the file prior to attempting to write to it. // And if we have successfully written to the lease file in this instantiation of the server, then // we don't want to rewrite, each time we update the lease. try { // Only "touch" the server file if it belongs to the local server if (recoveryIdentity.equals(_localRecoveryIdentity)) { if (_localLeaseLock != null) { // Write the Transaction Log directory string to the file if (!leaseLogWrittenInThisRun) { try { //fooWriter.write(_logDirStem); // was "\n" ByteBuffer byteBuffer = null; FileChannel fChannel = _localLeaseLock.getFileChannel(); byteBuffer = ByteBuffer.wrap(_tranRecoveryLogDirStem.getBytes()); fChannel.write(byteBuffer); fChannel.force(false); leaseLogWrittenInThisRun = true; if (tc.isDebugEnabled()) Tr.debug(tc, "Have written to file"); } catch (IOException iox) { if (tc.isDebugEnabled()) Tr.debug(tc, "Caught I/O exception when trying to write to file"); } } // "Touch" the file for this server final File leaseFile = new File(_serverInstallLeaseLogDir + String.valueOf(File.separatorChar) + recoveryIdentity); if (leaseLogWrittenInThisRun) { boolean success = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { return leaseFile.setLastModified(System.currentTimeMillis()); } }); if (!success) { // TODO Auto-generated catch block if (tc.isDebugEnabled()) Tr.debug(tc, "Unable to set the last modification time for " + leaseFile); } } } } else { if (tc.isDebugEnabled()) Tr.debug(tc, "Don't modify time as this is not the local server"); } } catch (OverlappingFileLockException e) { // File is already locked in this thread or virtual machine, We're not expecting this to happen. Log the event if (tc.isDebugEnabled()) Tr.debug(tc, "The file aleady appears to be locked in another thread"); } if (tc.isEntryEnabled()) Tr.exit(tc, "updateServerLease", this); } }
public class class_name { @Override public void updateServerLease(String recoveryIdentity, String recoveryGroup, boolean isServerStartup) throws Exception { if (tc.isEntryEnabled()) Tr.entry(tc, "updateServerLease", new Object[] { recoveryIdentity, recoveryGroup, isServerStartup, this }); if (tc.isDebugEnabled()) Tr.debug(tc, "Using recoveryIdentity " + recoveryIdentity + " and log directory " + _tranRecoveryLogDirStem); // At this point we already have a lock on the file prior to attempting to write to it. // And if we have successfully written to the lease file in this instantiation of the server, then // we don't want to rewrite, each time we update the lease. try { // Only "touch" the server file if it belongs to the local server if (recoveryIdentity.equals(_localRecoveryIdentity)) { if (_localLeaseLock != null) { // Write the Transaction Log directory string to the file if (!leaseLogWrittenInThisRun) { try { //fooWriter.write(_logDirStem); // was "\n" ByteBuffer byteBuffer = null; FileChannel fChannel = _localLeaseLock.getFileChannel(); byteBuffer = ByteBuffer.wrap(_tranRecoveryLogDirStem.getBytes()); // depends on control dependency: [try], data = [none] fChannel.write(byteBuffer); // depends on control dependency: [try], data = [none] fChannel.force(false); // depends on control dependency: [try], data = [none] leaseLogWrittenInThisRun = true; // depends on control dependency: [try], data = [none] if (tc.isDebugEnabled()) Tr.debug(tc, "Have written to file"); } catch (IOException iox) { if (tc.isDebugEnabled()) Tr.debug(tc, "Caught I/O exception when trying to write to file"); } // depends on control dependency: [catch], data = [none] } // "Touch" the file for this server final File leaseFile = new File(_serverInstallLeaseLogDir + String.valueOf(File.separatorChar) + recoveryIdentity); if (leaseLogWrittenInThisRun) { boolean success = AccessController.doPrivileged(new PrivilegedAction<Boolean>() { @Override public Boolean run() { return leaseFile.setLastModified(System.currentTimeMillis()); } }); if (!success) { // TODO Auto-generated catch block if (tc.isDebugEnabled()) Tr.debug(tc, "Unable to set the last modification time for " + leaseFile); } } } } else { if (tc.isDebugEnabled()) Tr.debug(tc, "Don't modify time as this is not the local server"); } } catch (OverlappingFileLockException e) { // File is already locked in this thread or virtual machine, We're not expecting this to happen. Log the event if (tc.isDebugEnabled()) Tr.debug(tc, "The file aleady appears to be locked in another thread"); } if (tc.isEntryEnabled()) Tr.exit(tc, "updateServerLease", this); } }
public class class_name { @Override public boolean isValidSubset(FieldSet set) { if (set instanceof FieldList) { return (isValidSubset((FieldList) set)); } else { return false; } } }
public class class_name { @Override public boolean isValidSubset(FieldSet set) { if (set instanceof FieldList) { return (isValidSubset((FieldList) set)); // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } } }
public class class_name { boolean documentThrows(JSTypeExpression type, String throwsDescription) { if (!lazyInitDocumentation()) { return true; } if (documentation.throwsDescriptions == null) { documentation.throwsDescriptions = new LinkedHashMap<>(); } if (!documentation.throwsDescriptions.containsKey(type)) { documentation.throwsDescriptions.put(type, throwsDescription); return true; } return false; } }
public class class_name { boolean documentThrows(JSTypeExpression type, String throwsDescription) { if (!lazyInitDocumentation()) { return true; // depends on control dependency: [if], data = [none] } if (documentation.throwsDescriptions == null) { documentation.throwsDescriptions = new LinkedHashMap<>(); // depends on control dependency: [if], data = [none] } if (!documentation.throwsDescriptions.containsKey(type)) { documentation.throwsDescriptions.put(type, throwsDescription); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { private boolean isLoneBlock(Node n) { Node parent = n.getParent(); if (parent != null && (parent.isScript() || (parent.isBlock() && !parent.isSyntheticBlock() && !parent.isAddedBlock()))) { return !n.isSyntheticBlock() && !n.isAddedBlock(); } return false; } }
public class class_name { private boolean isLoneBlock(Node n) { Node parent = n.getParent(); if (parent != null && (parent.isScript() || (parent.isBlock() && !parent.isSyntheticBlock() && !parent.isAddedBlock()))) { return !n.isSyntheticBlock() && !n.isAddedBlock(); // depends on control dependency: [if], data = [none] } return false; } }
public class class_name { public boolean canGroupAcceptMember(String grpReposId, String mbrReposId) { Map<String, Set<String>> repositoriesForGroupMembers = getRepositoriesForGroupMembers(); if (repositoriesForGroupMembers != null) { Set<String> mbrReposIdSet = repositoriesForGroupMembers.get(grpReposId); if (mbrReposIdSet != null) { return mbrReposIdSet.contains(mbrReposId); } } return false; } }
public class class_name { public boolean canGroupAcceptMember(String grpReposId, String mbrReposId) { Map<String, Set<String>> repositoriesForGroupMembers = getRepositoriesForGroupMembers(); if (repositoriesForGroupMembers != null) { Set<String> mbrReposIdSet = repositoriesForGroupMembers.get(grpReposId); if (mbrReposIdSet != null) { return mbrReposIdSet.contains(mbrReposId); // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public void configureHistoricVariableInstanceQuery(HistoricVariableInstanceQueryImpl query) { Permission readPermission = READ_HISTORY; if (isEnsureSpecificVariablePermission()) { readPermission = READ_HISTORY_VARIABLE; } configureQuery(query, PROCESS_DEFINITION, "RES.PROC_DEF_KEY_", readPermission); } }
public class class_name { public void configureHistoricVariableInstanceQuery(HistoricVariableInstanceQueryImpl query) { Permission readPermission = READ_HISTORY; if (isEnsureSpecificVariablePermission()) { readPermission = READ_HISTORY_VARIABLE; // depends on control dependency: [if], data = [none] } configureQuery(query, PROCESS_DEFINITION, "RES.PROC_DEF_KEY_", readPermission); } }
public class class_name { private FieldPosition[] expandAffix(String pattern) { ArrayList<FieldPosition> positions = null; int stringIndex = 0; for (int i=0; i<pattern.length(); ) { char c = pattern.charAt(i++); if (c == QUOTE) { int field = -1; Format.Field fieldID = null; c = pattern.charAt(i++); switch (c) { case CURRENCY_SIGN: String string; if (i<pattern.length() && pattern.charAt(i) == CURRENCY_SIGN) { ++i; string = symbols.getInternationalCurrencySymbol(); } else { string = symbols.getCurrencySymbol(); } if (string.length() > 0) { if (positions == null) { positions = new ArrayList<>(2); } FieldPosition fp = new FieldPosition(Field.CURRENCY); fp.setBeginIndex(stringIndex); fp.setEndIndex(stringIndex + string.length()); positions.add(fp); stringIndex += string.length(); } continue; case PATTERN_PERCENT: c = symbols.getPercent(); field = -1; fieldID = Field.PERCENT; break; case PATTERN_PER_MILLE: c = symbols.getPerMill(); field = -1; fieldID = Field.PERMILLE; break; case PATTERN_MINUS: c = symbols.getMinusSign(); field = -1; fieldID = Field.SIGN; break; } if (fieldID != null) { if (positions == null) { positions = new ArrayList<>(2); } FieldPosition fp = new FieldPosition(fieldID, field); fp.setBeginIndex(stringIndex); fp.setEndIndex(stringIndex + 1); positions.add(fp); } } stringIndex++; } if (positions != null) { return positions.toArray(EmptyFieldPositionArray); } return EmptyFieldPositionArray; } }
public class class_name { private FieldPosition[] expandAffix(String pattern) { ArrayList<FieldPosition> positions = null; int stringIndex = 0; for (int i=0; i<pattern.length(); ) { char c = pattern.charAt(i++); if (c == QUOTE) { int field = -1; Format.Field fieldID = null; c = pattern.charAt(i++); // depends on control dependency: [if], data = [none] switch (c) { case CURRENCY_SIGN: String string; if (i<pattern.length() && pattern.charAt(i) == CURRENCY_SIGN) { ++i; // depends on control dependency: [if], data = [none] string = symbols.getInternationalCurrencySymbol(); // depends on control dependency: [if], data = [none] } else { string = symbols.getCurrencySymbol(); // depends on control dependency: [if], data = [none] } if (string.length() > 0) { if (positions == null) { positions = new ArrayList<>(2); // depends on control dependency: [if], data = [none] } FieldPosition fp = new FieldPosition(Field.CURRENCY); fp.setBeginIndex(stringIndex); // depends on control dependency: [if], data = [none] fp.setEndIndex(stringIndex + string.length()); // depends on control dependency: [if], data = [none] positions.add(fp); // depends on control dependency: [if], data = [none] stringIndex += string.length(); // depends on control dependency: [if], data = [none] } continue; case PATTERN_PERCENT: c = symbols.getPercent(); field = -1; fieldID = Field.PERCENT; break; case PATTERN_PER_MILLE: c = symbols.getPerMill(); field = -1; fieldID = Field.PERMILLE; break; case PATTERN_MINUS: c = symbols.getMinusSign(); field = -1; fieldID = Field.SIGN; break; } if (fieldID != null) { if (positions == null) { positions = new ArrayList<>(2); // depends on control dependency: [if], data = [none] } FieldPosition fp = new FieldPosition(fieldID, field); fp.setBeginIndex(stringIndex); // depends on control dependency: [if], data = [none] fp.setEndIndex(stringIndex + 1); // depends on control dependency: [if], data = [none] positions.add(fp); // depends on control dependency: [if], data = [none] } } stringIndex++; // depends on control dependency: [for], data = [none] } if (positions != null) { return positions.toArray(EmptyFieldPositionArray); // depends on control dependency: [if], data = [none] } return EmptyFieldPositionArray; } }
public class class_name { public HystrixPropertiesStrategy getPropertiesStrategy() { if (propertiesFactory.get() == null) { // check for an implementation from Archaius first Object impl = getPluginImplementation(HystrixPropertiesStrategy.class); if (impl == null) { // nothing set via Archaius so initialize with default propertiesFactory.compareAndSet(null, HystrixPropertiesStrategyDefault.getInstance()); // we don't return from here but call get() again in case of thread-race so the winner will always get returned } else { // we received an implementation from Archaius so use it propertiesFactory.compareAndSet(null, (HystrixPropertiesStrategy) impl); } } return propertiesFactory.get(); } }
public class class_name { public HystrixPropertiesStrategy getPropertiesStrategy() { if (propertiesFactory.get() == null) { // check for an implementation from Archaius first Object impl = getPluginImplementation(HystrixPropertiesStrategy.class); if (impl == null) { // nothing set via Archaius so initialize with default propertiesFactory.compareAndSet(null, HystrixPropertiesStrategyDefault.getInstance()); // depends on control dependency: [if], data = [none] // we don't return from here but call get() again in case of thread-race so the winner will always get returned } else { // we received an implementation from Archaius so use it propertiesFactory.compareAndSet(null, (HystrixPropertiesStrategy) impl); // depends on control dependency: [if], data = [none] } } return propertiesFactory.get(); } }
public class class_name { @Throws(IllegalNotNullArgumentException.class) public static void isNull(final boolean condition, @Nullable final Object reference, @Nullable final String name) { if (condition) { Check.isNull(reference, name); } } }
public class class_name { @Throws(IllegalNotNullArgumentException.class) public static void isNull(final boolean condition, @Nullable final Object reference, @Nullable final String name) { if (condition) { Check.isNull(reference, name); // depends on control dependency: [if], data = [none] } } }
public class class_name { public E get(int x, int y) { if (columns.size() < x) { columns.set(x, new ArrayList<>()); } ArrayList<E> columnList = columns.get(x); if (columnList.size() < y) { columnList.set(y, this.defaultElement); } return columnList.get(y); } }
public class class_name { public E get(int x, int y) { if (columns.size() < x) { columns.set(x, new ArrayList<>()); // depends on control dependency: [if], data = [none] } ArrayList<E> columnList = columns.get(x); if (columnList.size() < y) { columnList.set(y, this.defaultElement); // depends on control dependency: [if], data = [none] } return columnList.get(y); } }
public class class_name { public ModifyInstanceCreditSpecificationRequest withInstanceCreditSpecifications(InstanceCreditSpecificationRequest... instanceCreditSpecifications) { if (this.instanceCreditSpecifications == null) { setInstanceCreditSpecifications(new com.amazonaws.internal.SdkInternalList<InstanceCreditSpecificationRequest>(instanceCreditSpecifications.length)); } for (InstanceCreditSpecificationRequest ele : instanceCreditSpecifications) { this.instanceCreditSpecifications.add(ele); } return this; } }
public class class_name { public ModifyInstanceCreditSpecificationRequest withInstanceCreditSpecifications(InstanceCreditSpecificationRequest... instanceCreditSpecifications) { if (this.instanceCreditSpecifications == null) { setInstanceCreditSpecifications(new com.amazonaws.internal.SdkInternalList<InstanceCreditSpecificationRequest>(instanceCreditSpecifications.length)); // depends on control dependency: [if], data = [none] } for (InstanceCreditSpecificationRequest ele : instanceCreditSpecifications) { this.instanceCreditSpecifications.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { @PostMapping(path = SamlIdPConstants.ENDPOINT_SAML1_SOAP_ARTIFACT_RESOLUTION) protected void handlePostRequest(final HttpServletResponse response, final HttpServletRequest request) { val ctx = decodeSoapRequest(request); val artifactMsg = (ArtifactResolve) ctx.getMessage(); try { val issuer = artifactMsg.getIssuer().getValue(); val service = verifySamlRegisteredService(issuer); val adaptor = getSamlMetadataFacadeFor(service, artifactMsg); if (adaptor.isEmpty()) { throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, "Cannot find metadata linked to " + issuer); } val facade = adaptor.get(); verifyAuthenticationContextSignature(ctx, request, artifactMsg, facade); val artifactId = artifactMsg.getArtifact().getArtifact(); val ticketId = getSamlProfileHandlerConfigurationContext().getArtifactTicketFactory().createTicketIdFor(artifactId); val ticket = getSamlProfileHandlerConfigurationContext().getTicketRegistry().getTicket(ticketId, SamlArtifactTicket.class); val issuerService = getSamlProfileHandlerConfigurationContext().getWebApplicationServiceFactory().createService(issuer); val casAssertion = buildCasAssertion(ticket.getTicketGrantingTicket().getAuthentication(), issuerService, service, CollectionUtils.wrap("artifact", ticket)); getSamlProfileHandlerConfigurationContext().getResponseBuilder().build(artifactMsg, request, response, casAssertion, service, facade, SAMLConstants.SAML2_ARTIFACT_BINDING_URI, ctx); } catch (final Exception e) { LOGGER.error(e.getMessage(), e); request.setAttribute(SamlIdPConstants.REQUEST_ATTRIBUTE_ERROR, e.getMessage()); getSamlProfileHandlerConfigurationContext().getSamlFaultResponseBuilder().build(artifactMsg, request, response, null, null, null, SAMLConstants.SAML2_ARTIFACT_BINDING_URI, ctx); } } }
public class class_name { @PostMapping(path = SamlIdPConstants.ENDPOINT_SAML1_SOAP_ARTIFACT_RESOLUTION) protected void handlePostRequest(final HttpServletResponse response, final HttpServletRequest request) { val ctx = decodeSoapRequest(request); val artifactMsg = (ArtifactResolve) ctx.getMessage(); try { val issuer = artifactMsg.getIssuer().getValue(); val service = verifySamlRegisteredService(issuer); val adaptor = getSamlMetadataFacadeFor(service, artifactMsg); if (adaptor.isEmpty()) { throw new UnauthorizedServiceException(UnauthorizedServiceException.CODE_UNAUTHZ_SERVICE, "Cannot find metadata linked to " + issuer); } val facade = adaptor.get(); verifyAuthenticationContextSignature(ctx, request, artifactMsg, facade); // depends on control dependency: [try], data = [none] val artifactId = artifactMsg.getArtifact().getArtifact(); val ticketId = getSamlProfileHandlerConfigurationContext().getArtifactTicketFactory().createTicketIdFor(artifactId); val ticket = getSamlProfileHandlerConfigurationContext().getTicketRegistry().getTicket(ticketId, SamlArtifactTicket.class); val issuerService = getSamlProfileHandlerConfigurationContext().getWebApplicationServiceFactory().createService(issuer); val casAssertion = buildCasAssertion(ticket.getTicketGrantingTicket().getAuthentication(), issuerService, service, CollectionUtils.wrap("artifact", ticket)); getSamlProfileHandlerConfigurationContext().getResponseBuilder().build(artifactMsg, request, response, casAssertion, service, facade, SAMLConstants.SAML2_ARTIFACT_BINDING_URI, ctx); // depends on control dependency: [try], data = [none] } catch (final Exception e) { LOGGER.error(e.getMessage(), e); request.setAttribute(SamlIdPConstants.REQUEST_ATTRIBUTE_ERROR, e.getMessage()); getSamlProfileHandlerConfigurationContext().getSamlFaultResponseBuilder().build(artifactMsg, request, response, null, null, null, SAMLConstants.SAML2_ARTIFACT_BINDING_URI, ctx); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override public void getDetailInfo(Formatter f) { f.format("NetcdfDataset location= %s%n", getLocation()); f.format(" title= %s%n", getTitle()); f.format(" id= %s%n", getId()); f.format(" fileType= %s%n", getFileTypeId()); f.format(" fileDesc= %s%n", getFileTypeDescription()); f.format(" class= %s%n", getClass().getName()); if (agg == null) { f.format(" has no Aggregation element%n"); } else { f.format("%nAggregation:%n"); agg.getDetailInfo(f); } if (orgFile == null) { f.format(" has no referenced NetcdfFile%n"); showCached(f); showProxies(f); } else { f.format("%nReferenced File:%n"); f.format("%s", orgFile.getDetailInfo()); } } }
public class class_name { @Override public void getDetailInfo(Formatter f) { f.format("NetcdfDataset location= %s%n", getLocation()); f.format(" title= %s%n", getTitle()); f.format(" id= %s%n", getId()); f.format(" fileType= %s%n", getFileTypeId()); f.format(" fileDesc= %s%n", getFileTypeDescription()); f.format(" class= %s%n", getClass().getName()); if (agg == null) { f.format(" has no Aggregation element%n"); // depends on control dependency: [if], data = [none] } else { f.format("%nAggregation:%n"); // depends on control dependency: [if], data = [none] agg.getDetailInfo(f); // depends on control dependency: [if], data = [none] } if (orgFile == null) { f.format(" has no referenced NetcdfFile%n"); // depends on control dependency: [if], data = [none] showCached(f); // depends on control dependency: [if], data = [none] showProxies(f); // depends on control dependency: [if], data = [none] } else { f.format("%nReferenced File:%n"); // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] f.format("%s", orgFile.getDetailInfo()); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static void initilizeSuggestTree(ServletContext context) { SuggestTree suggestTree = new SuggestTree( ProtocolConstants.MAX_NUMBER_OF_SUGGESTIONS); HashMap<String, String> imageIndex = new HashMap<String, String>(); try { // FIXME change after debugging File saveFile = new File("/var/lib/tomcat/Database.save"); if (saveFile.exists()) { FileInputStream fileInputStream = new FileInputStream(saveFile); ObjectInputStream restore = new ObjectInputStream( fileInputStream); while (true) { try { SuggestionComponents suggestTreeEntry = (SuggestionComponents) restore .readObject(); suggestTree.put(suggestTreeEntry.getSuggestString(), suggestTreeEntry.getWeight(), suggestTreeEntry.getKey()); imageIndex.put(suggestTreeEntry.getKey(), suggestTreeEntry.getImageBase64()); } catch (EOFException e) { restore.close(); break; } } } } catch (IOException | ClassNotFoundException e1) { e1.printStackTrace(); } ContextListener.setIndex(ProtocolConstants.DEFAULT_INDEX_NAME, suggestTree, context); ContextListener.setImageIndex(imageIndex, context); } }
public class class_name { public static void initilizeSuggestTree(ServletContext context) { SuggestTree suggestTree = new SuggestTree( ProtocolConstants.MAX_NUMBER_OF_SUGGESTIONS); HashMap<String, String> imageIndex = new HashMap<String, String>(); try { // FIXME change after debugging File saveFile = new File("/var/lib/tomcat/Database.save"); if (saveFile.exists()) { FileInputStream fileInputStream = new FileInputStream(saveFile); ObjectInputStream restore = new ObjectInputStream( fileInputStream); while (true) { try { SuggestionComponents suggestTreeEntry = (SuggestionComponents) restore .readObject(); suggestTree.put(suggestTreeEntry.getSuggestString(), suggestTreeEntry.getWeight(), suggestTreeEntry.getKey()); // depends on control dependency: [try], data = [none] imageIndex.put(suggestTreeEntry.getKey(), suggestTreeEntry.getImageBase64()); // depends on control dependency: [try], data = [none] } catch (EOFException e) { restore.close(); break; } // depends on control dependency: [catch], data = [none] } } } catch (IOException | ClassNotFoundException e1) { e1.printStackTrace(); } // depends on control dependency: [catch], data = [none] ContextListener.setIndex(ProtocolConstants.DEFAULT_INDEX_NAME, suggestTree, context); ContextListener.setImageIndex(imageIndex, context); } }
public class class_name { protected DataSource buildDataSource(Properties props) { if (druidFactoryClass != null) { log.debug("build DruidDataSource by props"); Mirror<?> mirror = Mirror.me(druidFactoryClass); DataSource ds = (DataSource) mirror.invoke(null, "createDataSource", props); if (!props.containsKey("maxWait")) Mirror.me(ds).setValue(ds, "maxWait", 15*1000); return ds; } log.debug("build SimpleteDataSource by props"); return SimpleDataSource.createDataSource(props); } }
public class class_name { protected DataSource buildDataSource(Properties props) { if (druidFactoryClass != null) { log.debug("build DruidDataSource by props"); // depends on control dependency: [if], data = [none] Mirror<?> mirror = Mirror.me(druidFactoryClass); DataSource ds = (DataSource) mirror.invoke(null, "createDataSource", props); if (!props.containsKey("maxWait")) Mirror.me(ds).setValue(ds, "maxWait", 15*1000); return ds; // depends on control dependency: [if], data = [none] } log.debug("build SimpleteDataSource by props"); return SimpleDataSource.createDataSource(props); } }
public class class_name { public ShardInformation getShardInformation(String shard) { ShardInformation shardInformation = shardIndex.get(Objects.requireNonNull(shard, "shard required")); if (shardInformation == null) { shardInformation = createShardInformation(shard); } return shardInformation; } }
public class class_name { public ShardInformation getShardInformation(String shard) { ShardInformation shardInformation = shardIndex.get(Objects.requireNonNull(shard, "shard required")); if (shardInformation == null) { shardInformation = createShardInformation(shard); // depends on control dependency: [if], data = [none] } return shardInformation; } }
public class class_name { private void logState(final FileRollEvent fileRollEvent) { // if (ApplicationState.isApplicationStateEnabled()) { synchronized (this) { final Collection<ApplicationState.ApplicationStateMessage> entries = ApplicationState.getAppStateEntries(); for (ApplicationState.ApplicationStateMessage entry : entries) { Level level = ApplicationState.getLog4jLevel(entry.getLevel()); if(level.isGreaterOrEqual(ApplicationState.LOGGER.getEffectiveLevel())) { final org.apache.log4j.spi.LoggingEvent loggingEvent = new org.apache.log4j.spi.LoggingEvent(ApplicationState.FQCN, ApplicationState.LOGGER, level, entry.getMessage(), null); //Save the current layout before changing it to the original (relevant for marker cases when the layout was changed) Layout current=fileRollEvent.getSource().getLayout(); //fileRollEvent.getSource().activeOriginalLayout(); String flowContext = (String) MDC.get("flowCtxt"); MDC.remove("flowCtxt"); //Write applicationState: if(fileRollEvent.getSource().isAddApplicationState() && fileRollEvent.getSource().getFile().endsWith("log")){ fileRollEvent.dispatchToAppender(loggingEvent); } //Set current again. fileRollEvent.getSource().setLayout(current); if (flowContext != null) { MDC.put("flowCtxt", flowContext); } } } } // } } }
public class class_name { private void logState(final FileRollEvent fileRollEvent) { // if (ApplicationState.isApplicationStateEnabled()) { synchronized (this) { final Collection<ApplicationState.ApplicationStateMessage> entries = ApplicationState.getAppStateEntries(); for (ApplicationState.ApplicationStateMessage entry : entries) { Level level = ApplicationState.getLog4jLevel(entry.getLevel()); if(level.isGreaterOrEqual(ApplicationState.LOGGER.getEffectiveLevel())) { final org.apache.log4j.spi.LoggingEvent loggingEvent = new org.apache.log4j.spi.LoggingEvent(ApplicationState.FQCN, ApplicationState.LOGGER, level, entry.getMessage(), null); //Save the current layout before changing it to the original (relevant for marker cases when the layout was changed) Layout current=fileRollEvent.getSource().getLayout(); //fileRollEvent.getSource().activeOriginalLayout(); String flowContext = (String) MDC.get("flowCtxt"); MDC.remove("flowCtxt"); // depends on control dependency: [if], data = [none] //Write applicationState: if(fileRollEvent.getSource().isAddApplicationState() && fileRollEvent.getSource().getFile().endsWith("log")){ fileRollEvent.dispatchToAppender(loggingEvent); // depends on control dependency: [if], data = [none] } //Set current again. fileRollEvent.getSource().setLayout(current); // depends on control dependency: [if], data = [none] if (flowContext != null) { MDC.put("flowCtxt", flowContext); // depends on control dependency: [if], data = [none] } } } } // } } }
public class class_name { String getBody(Object object, ContentType contentType) { if (contentType == ContentType.APPLICATION_FORM_URLENCODED) { return jsonToUrlEncodedString((JsonObject) new JsonParser().parse(gson.toJson(object))); } return gson.toJson(object); } }
public class class_name { String getBody(Object object, ContentType contentType) { if (contentType == ContentType.APPLICATION_FORM_URLENCODED) { return jsonToUrlEncodedString((JsonObject) new JsonParser().parse(gson.toJson(object))); // depends on control dependency: [if], data = [none] } return gson.toJson(object); } }
public class class_name { protected byte[] getBinaryRequestPayload(SignableRequest<?> request) { if (SdkHttpUtils.usePayloadForQueryParameters(request)) { String encodedParameters = SdkHttpUtils.encodeParameters(request); if (encodedParameters == null) return new byte[0]; return encodedParameters.getBytes(UTF8); } return getBinaryRequestPayloadWithoutQueryParams(request); } }
public class class_name { protected byte[] getBinaryRequestPayload(SignableRequest<?> request) { if (SdkHttpUtils.usePayloadForQueryParameters(request)) { String encodedParameters = SdkHttpUtils.encodeParameters(request); if (encodedParameters == null) return new byte[0]; return encodedParameters.getBytes(UTF8); // depends on control dependency: [if], data = [none] } return getBinaryRequestPayloadWithoutQueryParams(request); } }
public class class_name { @Override public final T process( final Map<String, Object> pAddParam, final T pEntity, final IRequestData pRequestData) throws Exception { T entity = this.srvOrm.retrieveEntity(pAddParam, pEntity); if (entity.getIdDatabaseBirth() != getSrvOrm().getIdDatabase()) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_change_foreign_src"); } entity.setIsNew(false); pRequestData.setAttribute("entity", entity); pRequestData.setAttribute("mngUvds", this.mngUvdSettings); pRequestData.setAttribute("srvOrm", this.srvOrm); pRequestData.setAttribute("srvDate", this.srvDate); pRequestData.setAttribute("hldCnvFtfsNames", this.fieldConverterNamesHolder); pRequestData.setAttribute("fctCnvFtfs", this.convertersFieldsFatory); // owned lists: String ownedLists = mngUvdSettings.lazClsSts(pEntity.getClass()) .get("ownedLists"); if (ownedLists != null) { Map<Class<?>, List<Object>> ownedListsMap = new LinkedHashMap<Class<?>, List<Object>>(); pRequestData.setAttribute("ownedListsMap", ownedListsMap); Set<String> ownedListsSet = utlProperties .evalPropsStringsSet(ownedLists); for (String className : ownedListsSet) { Class<?> entityFolClass = Class.forName(className); @SuppressWarnings("unchecked") IFillerObjectFields<Object> fillerEfol = (IFillerObjectFields<Object>) this.fillersFieldsFactory.lazyGet(pAddParam, entityFolClass); // find owner field name: String ownerFieldName = null; TableSql tableSqlEfol = this.srvOrm.getTablesMap() .get(entityFolClass.getSimpleName()); for (Map.Entry<String, FieldSql> entry : tableSqlEfol .getFieldsMap().entrySet()) { if (pEntity.getClass().getSimpleName() .equals(entry.getValue().getForeignEntity())) { ownerFieldName = entry.getKey(); } } if (ownerFieldName == null) { throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG, "Can't find owner field name for class/class from owned list: " + pEntity.getClass() + "/" + entityFolClass); } @SuppressWarnings("unchecked") IFactorySimple<Object> entFolFac = (IFactorySimple<Object>) this.entitiesFactoriesFatory.lazyGet(pAddParam, entityFolClass); Object entityFol = entFolFac.create(pAddParam); fillerEfol.fill(pAddParam, entityFol, entity, ownerFieldName); String ooids = entityFolClass.getSimpleName() + ownerFieldName + "deepLevel"; pAddParam.put(ooids, 1); //only ID List<Object> entities = this.srvOrm .retrieveListForField(pAddParam, entityFol, ownerFieldName); for (Object efol : entities) { fillerEfol.fill(pAddParam, efol, entity, ownerFieldName); } pAddParam.remove(ooids); ownedListsMap.put(entityFolClass, entities); } } return entity; } }
public class class_name { @Override public final T process( final Map<String, Object> pAddParam, final T pEntity, final IRequestData pRequestData) throws Exception { T entity = this.srvOrm.retrieveEntity(pAddParam, pEntity); if (entity.getIdDatabaseBirth() != getSrvOrm().getIdDatabase()) { throw new ExceptionWithCode(ExceptionWithCode.WRONG_PARAMETER, "can_not_change_foreign_src"); } entity.setIsNew(false); pRequestData.setAttribute("entity", entity); pRequestData.setAttribute("mngUvds", this.mngUvdSettings); pRequestData.setAttribute("srvOrm", this.srvOrm); pRequestData.setAttribute("srvDate", this.srvDate); pRequestData.setAttribute("hldCnvFtfsNames", this.fieldConverterNamesHolder); pRequestData.setAttribute("fctCnvFtfs", this.convertersFieldsFatory); // owned lists: String ownedLists = mngUvdSettings.lazClsSts(pEntity.getClass()) .get("ownedLists"); if (ownedLists != null) { Map<Class<?>, List<Object>> ownedListsMap = new LinkedHashMap<Class<?>, List<Object>>(); pRequestData.setAttribute("ownedListsMap", ownedListsMap); Set<String> ownedListsSet = utlProperties .evalPropsStringsSet(ownedLists); for (String className : ownedListsSet) { Class<?> entityFolClass = Class.forName(className); @SuppressWarnings("unchecked") IFillerObjectFields<Object> fillerEfol = (IFillerObjectFields<Object>) this.fillersFieldsFactory.lazyGet(pAddParam, entityFolClass); // find owner field name: String ownerFieldName = null; TableSql tableSqlEfol = this.srvOrm.getTablesMap() .get(entityFolClass.getSimpleName()); for (Map.Entry<String, FieldSql> entry : tableSqlEfol .getFieldsMap().entrySet()) { if (pEntity.getClass().getSimpleName() .equals(entry.getValue().getForeignEntity())) { ownerFieldName = entry.getKey(); // depends on control dependency: [if], data = [none] } } if (ownerFieldName == null) { throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG, "Can't find owner field name for class/class from owned list: " + pEntity.getClass() + "/" + entityFolClass); } @SuppressWarnings("unchecked") IFactorySimple<Object> entFolFac = (IFactorySimple<Object>) this.entitiesFactoriesFatory.lazyGet(pAddParam, entityFolClass); Object entityFol = entFolFac.create(pAddParam); fillerEfol.fill(pAddParam, entityFol, entity, ownerFieldName); String ooids = entityFolClass.getSimpleName() + ownerFieldName + "deepLevel"; pAddParam.put(ooids, 1); //only ID List<Object> entities = this.srvOrm .retrieveListForField(pAddParam, entityFol, ownerFieldName); for (Object efol : entities) { fillerEfol.fill(pAddParam, efol, entity, ownerFieldName); // depends on control dependency: [for], data = [efol] } pAddParam.remove(ooids); ownedListsMap.put(entityFolClass, entities); } } return entity; } }
public class class_name { @Pure public double distance(double x, double y) { if (isValidPrimitive()) { final GeoLocationPoint p = getGeoPosition(); return Point2D.getDistancePointPoint(p.getX(), p.getY(), x, y); } return Double.NaN; } }
public class class_name { @Pure public double distance(double x, double y) { if (isValidPrimitive()) { final GeoLocationPoint p = getGeoPosition(); return Point2D.getDistancePointPoint(p.getX(), p.getY(), x, y); // depends on control dependency: [if], data = [none] } return Double.NaN; } }
public class class_name { @SuppressWarnings({"checkstyle:npathcomplexity"}) @SuppressFBWarnings("RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED") private synchronized boolean bind0(TcpIpConnection connection, Address remoteEndpoint, Collection<Address> remoteAddressAliases, boolean reply) { final Address remoteAddress = new Address(connection.getRemoteSocketAddress()); if (tcpIpEndpointManager.connectionsInProgress.contains(remoteAddress)) { // this is the connection initiator side --> register the connection under the address that was requested remoteEndpoint = remoteAddress; } if (remoteEndpoint == null) { if (remoteAddressAliases == null) { throw new IllegalStateException("Remote endpoint and remote address aliases cannot be both null"); } else { // let it fail if no remoteEndpoint and no aliases are defined remoteEndpoint = remoteAddressAliases.iterator().next(); } } connection.setEndPoint(remoteEndpoint); ioService.onSuccessfulConnection(remoteEndpoint); if (reply) { BindRequest bindRequest = new BindRequest(logger, ioService, connection, remoteEndpoint, false); bindRequest.send(); } if (checkAlreadyConnected(connection, remoteEndpoint)) { return false; } if (logger.isLoggable(Level.FINEST)) { logger.finest("Registering connection " + connection + " to address " + remoteEndpoint); } boolean returnValue = tcpIpEndpointManager.registerConnection(remoteEndpoint, connection); if (remoteAddressAliases != null && returnValue) { for (Address remoteAddressAlias : remoteAddressAliases) { if (logger.isLoggable(Level.FINEST)) { logger.finest("Registering connection " + connection + " to address alias " + remoteAddressAlias); } tcpIpEndpointManager.connectionsMap.putIfAbsent(remoteAddressAlias, connection); } } return returnValue; } }
public class class_name { @SuppressWarnings({"checkstyle:npathcomplexity"}) @SuppressFBWarnings("RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED") private synchronized boolean bind0(TcpIpConnection connection, Address remoteEndpoint, Collection<Address> remoteAddressAliases, boolean reply) { final Address remoteAddress = new Address(connection.getRemoteSocketAddress()); if (tcpIpEndpointManager.connectionsInProgress.contains(remoteAddress)) { // this is the connection initiator side --> register the connection under the address that was requested remoteEndpoint = remoteAddress; // depends on control dependency: [if], data = [none] } if (remoteEndpoint == null) { if (remoteAddressAliases == null) { throw new IllegalStateException("Remote endpoint and remote address aliases cannot be both null"); } else { // let it fail if no remoteEndpoint and no aliases are defined remoteEndpoint = remoteAddressAliases.iterator().next(); // depends on control dependency: [if], data = [none] } } connection.setEndPoint(remoteEndpoint); ioService.onSuccessfulConnection(remoteEndpoint); if (reply) { BindRequest bindRequest = new BindRequest(logger, ioService, connection, remoteEndpoint, false); bindRequest.send(); // depends on control dependency: [if], data = [none] } if (checkAlreadyConnected(connection, remoteEndpoint)) { return false; // depends on control dependency: [if], data = [none] } if (logger.isLoggable(Level.FINEST)) { logger.finest("Registering connection " + connection + " to address " + remoteEndpoint); // depends on control dependency: [if], data = [none] } boolean returnValue = tcpIpEndpointManager.registerConnection(remoteEndpoint, connection); if (remoteAddressAliases != null && returnValue) { for (Address remoteAddressAlias : remoteAddressAliases) { if (logger.isLoggable(Level.FINEST)) { logger.finest("Registering connection " + connection + " to address alias " + remoteAddressAlias); // depends on control dependency: [if], data = [none] } tcpIpEndpointManager.connectionsMap.putIfAbsent(remoteAddressAlias, connection); // depends on control dependency: [for], data = [remoteAddressAlias] } } return returnValue; } }
public class class_name { public void marshall(ListDevelopmentSchemaArnsRequest listDevelopmentSchemaArnsRequest, ProtocolMarshaller protocolMarshaller) { if (listDevelopmentSchemaArnsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listDevelopmentSchemaArnsRequest.getNextToken(), NEXTTOKEN_BINDING); protocolMarshaller.marshall(listDevelopmentSchemaArnsRequest.getMaxResults(), MAXRESULTS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ListDevelopmentSchemaArnsRequest listDevelopmentSchemaArnsRequest, ProtocolMarshaller protocolMarshaller) { if (listDevelopmentSchemaArnsRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(listDevelopmentSchemaArnsRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(listDevelopmentSchemaArnsRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public CustomPortletModeType<PortletDescriptor> getOrCreateCustomPortletMode() { List<Node> nodeList = model.get("custom-portlet-mode"); if (nodeList != null && nodeList.size() > 0) { return new CustomPortletModeTypeImpl<PortletDescriptor>(this, "custom-portlet-mode", model, nodeList.get(0)); } return createCustomPortletMode(); } }
public class class_name { public CustomPortletModeType<PortletDescriptor> getOrCreateCustomPortletMode() { List<Node> nodeList = model.get("custom-portlet-mode"); if (nodeList != null && nodeList.size() > 0) { return new CustomPortletModeTypeImpl<PortletDescriptor>(this, "custom-portlet-mode", model, nodeList.get(0)); // depends on control dependency: [if], data = [none] } return createCustomPortletMode(); } }
public class class_name { private void processInstanceEvent(InstanceContentEvent instanceEvent) { Instance instance = instanceEvent.getInstance(); boolean predictionCovered = false; boolean trainingCovered = false; boolean continuePrediction = instanceEvent.isTesting(); boolean continueTraining = instanceEvent.isTraining(); ErrorWeightedVote errorWeightedVote = newErrorWeightedVote(); Iterator<PassiveRule> ruleIterator= this.ruleSet.iterator(); while (ruleIterator.hasNext()) { if (!continuePrediction && !continueTraining) break; PassiveRule rule = ruleIterator.next(); if (rule.isCovering(instance) == true){ predictionCovered = true; if (continuePrediction) { double [] vote=rule.getPrediction(instance); double error= rule.getCurrentError(); errorWeightedVote.addVote(vote,error); if (!this.unorderedRules) continuePrediction = false; } if (continueTraining) { if (!isAnomaly(instance, rule)) { trainingCovered = true; rule.updateStatistics(instance); // Send instance to statistics PIs sendInstanceToRule(instance, rule.getRuleNumberID()); if (!this.unorderedRules) continueTraining = false; } } } } if (predictionCovered) { // Combined prediction ResultContentEvent rce = newResultContentEvent(errorWeightedVote.computeWeightedVote(), instanceEvent); resultStream.put(rce); } else if (instanceEvent.isTesting()) { // predict with default rule double [] vote=defaultRule.getPrediction(instance); ResultContentEvent rce = newResultContentEvent(vote, instanceEvent); resultStream.put(rce); } if (!trainingCovered && instanceEvent.isTraining()) { // train default rule with this instance defaultRule.updateStatistics(instance); if (defaultRule.getInstancesSeen() % this.gracePeriod == 0.0) { if (defaultRule.tryToExpand(this.splitConfidence, this.tieThreshold) == true) { ActiveRule newDefaultRule=newRule(defaultRule.getRuleNumberID(),(RuleActiveRegressionNode)defaultRule.getLearningNode(), ((RuleActiveRegressionNode)defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); //other branch defaultRule.split(); defaultRule.setRuleNumberID(++ruleNumberID); this.ruleSet.add(new PassiveRule(this.defaultRule)); // send to statistics PI sendAddRuleEvent(defaultRule.getRuleNumberID(), this.defaultRule); defaultRule=newDefaultRule; } } } } }
public class class_name { private void processInstanceEvent(InstanceContentEvent instanceEvent) { Instance instance = instanceEvent.getInstance(); boolean predictionCovered = false; boolean trainingCovered = false; boolean continuePrediction = instanceEvent.isTesting(); boolean continueTraining = instanceEvent.isTraining(); ErrorWeightedVote errorWeightedVote = newErrorWeightedVote(); Iterator<PassiveRule> ruleIterator= this.ruleSet.iterator(); while (ruleIterator.hasNext()) { if (!continuePrediction && !continueTraining) break; PassiveRule rule = ruleIterator.next(); if (rule.isCovering(instance) == true){ predictionCovered = true; // depends on control dependency: [if], data = [none] if (continuePrediction) { double [] vote=rule.getPrediction(instance); double error= rule.getCurrentError(); errorWeightedVote.addVote(vote,error); // depends on control dependency: [if], data = [none] if (!this.unorderedRules) continuePrediction = false; } if (continueTraining) { if (!isAnomaly(instance, rule)) { trainingCovered = true; // depends on control dependency: [if], data = [none] rule.updateStatistics(instance); // depends on control dependency: [if], data = [none] // Send instance to statistics PIs sendInstanceToRule(instance, rule.getRuleNumberID()); // depends on control dependency: [if], data = [none] if (!this.unorderedRules) continueTraining = false; } } } } if (predictionCovered) { // Combined prediction ResultContentEvent rce = newResultContentEvent(errorWeightedVote.computeWeightedVote(), instanceEvent); resultStream.put(rce); // depends on control dependency: [if], data = [none] } else if (instanceEvent.isTesting()) { // predict with default rule double [] vote=defaultRule.getPrediction(instance); ResultContentEvent rce = newResultContentEvent(vote, instanceEvent); resultStream.put(rce); // depends on control dependency: [if], data = [none] } if (!trainingCovered && instanceEvent.isTraining()) { // train default rule with this instance defaultRule.updateStatistics(instance); // depends on control dependency: [if], data = [none] if (defaultRule.getInstancesSeen() % this.gracePeriod == 0.0) { if (defaultRule.tryToExpand(this.splitConfidence, this.tieThreshold) == true) { ActiveRule newDefaultRule=newRule(defaultRule.getRuleNumberID(),(RuleActiveRegressionNode)defaultRule.getLearningNode(), ((RuleActiveRegressionNode)defaultRule.getLearningNode()).getStatisticsOtherBranchSplit()); //other branch defaultRule.split(); // depends on control dependency: [if], data = [none] defaultRule.setRuleNumberID(++ruleNumberID); // depends on control dependency: [if], data = [none] this.ruleSet.add(new PassiveRule(this.defaultRule)); // depends on control dependency: [if], data = [none] // send to statistics PI sendAddRuleEvent(defaultRule.getRuleNumberID(), this.defaultRule); // depends on control dependency: [if], data = [none] defaultRule=newDefaultRule; // depends on control dependency: [if], data = [none] } } } } }
public class class_name { protected static int containsIndex(int[] is, int i) { for(int j = 0; j < is.length; j++) { if(i == is[j]) { return j; } } return -1; } }
public class class_name { protected static int containsIndex(int[] is, int i) { for(int j = 0; j < is.length; j++) { if(i == is[j]) { return j; // depends on control dependency: [if], data = [none] } } return -1; } }
public class class_name { public void registerJsonPropertyNameProcessor( Class target, PropertyNameProcessor propertyNameProcessor ) { if( target != null && propertyNameProcessor != null ) { jsonPropertyNameProcessorMap.put( target, propertyNameProcessor ); } } }
public class class_name { public void registerJsonPropertyNameProcessor( Class target, PropertyNameProcessor propertyNameProcessor ) { if( target != null && propertyNameProcessor != null ) { jsonPropertyNameProcessorMap.put( target, propertyNameProcessor ); // depends on control dependency: [if], data = [( target] } } }
public class class_name { public static String encodePath(String path, boolean flag) { char[] retCC = new char[path.length() * 2 + 16]; int retLen = 0; char[] pathCC = path.toCharArray(); int n = path.length(); for (int i=0; i<n; i++) { char c = pathCC[i]; if ((!flag && c == '/') || (flag && c == File.separatorChar)) retCC[retLen++] = '/'; else { if (c <= 0x007F) { if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9') { retCC[retLen++] = c; } else if (encodedInPath.get(c)) retLen = escape(retCC, c, retLen); else retCC[retLen++] = c; } else if (c > 0x07FF) { retLen = escape(retCC, (char)(0xE0 | ((c >> 12) & 0x0F)), retLen); retLen = escape(retCC, (char)(0x80 | ((c >> 6) & 0x3F)), retLen); retLen = escape(retCC, (char)(0x80 | ((c >> 0) & 0x3F)), retLen); } else { retLen = escape(retCC, (char)(0xC0 | ((c >> 6) & 0x1F)), retLen); retLen = escape(retCC, (char)(0x80 | ((c >> 0) & 0x3F)), retLen); } } //worst case scenario for character [0x7ff-] every single //character will be encoded into 9 characters. if (retLen + 9 > retCC.length) { int newLen = retCC.length * 2 + 16; if (newLen < 0) { newLen = Integer.MAX_VALUE; } char[] buf = new char[newLen]; System.arraycopy(retCC, 0, buf, 0, retLen); retCC = buf; } } return new String(retCC, 0, retLen); } }
public class class_name { public static String encodePath(String path, boolean flag) { char[] retCC = new char[path.length() * 2 + 16]; int retLen = 0; char[] pathCC = path.toCharArray(); int n = path.length(); for (int i=0; i<n; i++) { char c = pathCC[i]; if ((!flag && c == '/') || (flag && c == File.separatorChar)) retCC[retLen++] = '/'; else { if (c <= 0x007F) { if (c >= 'a' && c <= 'z' || c >= 'A' && c <= 'Z' || c >= '0' && c <= '9') { retCC[retLen++] = c; // depends on control dependency: [if], data = [none] } else if (encodedInPath.get(c)) retLen = escape(retCC, c, retLen); else retCC[retLen++] = c; } else if (c > 0x07FF) { retLen = escape(retCC, (char)(0xE0 | ((c >> 12) & 0x0F)), retLen); // depends on control dependency: [if], data = [(c] retLen = escape(retCC, (char)(0x80 | ((c >> 6) & 0x3F)), retLen); // depends on control dependency: [if], data = [(c] retLen = escape(retCC, (char)(0x80 | ((c >> 0) & 0x3F)), retLen); // depends on control dependency: [if], data = [(c] } else { retLen = escape(retCC, (char)(0xC0 | ((c >> 6) & 0x1F)), retLen); // depends on control dependency: [if], data = [(c] retLen = escape(retCC, (char)(0x80 | ((c >> 0) & 0x3F)), retLen); // depends on control dependency: [if], data = [(c] } } //worst case scenario for character [0x7ff-] every single //character will be encoded into 9 characters. if (retLen + 9 > retCC.length) { int newLen = retCC.length * 2 + 16; if (newLen < 0) { newLen = Integer.MAX_VALUE; // depends on control dependency: [if], data = [none] } char[] buf = new char[newLen]; System.arraycopy(retCC, 0, buf, 0, retLen); // depends on control dependency: [if], data = [none] retCC = buf; // depends on control dependency: [if], data = [none] } } return new String(retCC, 0, retLen); } }
public class class_name { public List<Scan.ScanOrigin> getScanOrigin() { if (scanOrigin == null) { scanOrigin = new ArrayList<Scan.ScanOrigin>(); } return this.scanOrigin; } }
public class class_name { public List<Scan.ScanOrigin> getScanOrigin() { if (scanOrigin == null) { scanOrigin = new ArrayList<Scan.ScanOrigin>(); // depends on control dependency: [if], data = [none] } return this.scanOrigin; } }
public class class_name { private static LineString reverse3D(LineString lineString, String order) { CoordinateSequence seq = lineString.getCoordinateSequence(); double startZ = seq.getCoordinate(0).z; double endZ = seq.getCoordinate(seq.size() - 1).z; if (order.equalsIgnoreCase("desc")) { if (!Double.isNaN(startZ) && !Double.isNaN(endZ) && startZ < endZ) { CoordinateSequences.reverse(seq); return FACTORY.createLineString(seq); } } else if (order.equalsIgnoreCase("asc")) { if (!Double.isNaN(startZ) && !Double.isNaN(endZ) && startZ > endZ) { CoordinateSequences.reverse(seq); return FACTORY.createLineString(seq); } } else { throw new IllegalArgumentException("Supported order values are asc or desc."); } return lineString; } }
public class class_name { private static LineString reverse3D(LineString lineString, String order) { CoordinateSequence seq = lineString.getCoordinateSequence(); double startZ = seq.getCoordinate(0).z; double endZ = seq.getCoordinate(seq.size() - 1).z; if (order.equalsIgnoreCase("desc")) { if (!Double.isNaN(startZ) && !Double.isNaN(endZ) && startZ < endZ) { CoordinateSequences.reverse(seq); // depends on control dependency: [if], data = [none] return FACTORY.createLineString(seq); // depends on control dependency: [if], data = [none] } } else if (order.equalsIgnoreCase("asc")) { if (!Double.isNaN(startZ) && !Double.isNaN(endZ) && startZ > endZ) { CoordinateSequences.reverse(seq); // depends on control dependency: [if], data = [none] return FACTORY.createLineString(seq); // depends on control dependency: [if], data = [none] } } else { throw new IllegalArgumentException("Supported order values are asc or desc."); } return lineString; } }
public class class_name { public T min() { TObjectLongIterator<T> iter = counts.iterator(); long minCount = Long.MAX_VALUE; T min = null; while (iter.hasNext()) { iter.advance(); long count = iter.value(); if (count < minCount) { min = iter.key(); minCount = count; } } return min; } }
public class class_name { public T min() { TObjectLongIterator<T> iter = counts.iterator(); long minCount = Long.MAX_VALUE; T min = null; while (iter.hasNext()) { iter.advance(); // depends on control dependency: [while], data = [none] long count = iter.value(); if (count < minCount) { min = iter.key(); // depends on control dependency: [if], data = [none] minCount = count; // depends on control dependency: [if], data = [none] } } return min; } }
public class class_name { protected void addGroupToRole(String group, String role) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, CLASS_NAME + "addGroupToRole", new Object[] { group, role }); } Set<String> groupsForTheRole = roleToGroupMap.get(role); if (groupsForTheRole != null) { groupsForTheRole.add(group); } else { groupsForTheRole = new HashSet<String>(); groupsForTheRole.add(group); } roleToGroupMap.put(role, groupsForTheRole); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(tc, CLASS_NAME + "addGroupToRole"); } } }
public class class_name { protected void addGroupToRole(String group, String role) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.entry(tc, CLASS_NAME + "addGroupToRole", new Object[] { group, role }); // depends on control dependency: [if], data = [none] } Set<String> groupsForTheRole = roleToGroupMap.get(role); if (groupsForTheRole != null) { groupsForTheRole.add(group); // depends on control dependency: [if], data = [none] } else { groupsForTheRole = new HashSet<String>(); // depends on control dependency: [if], data = [none] groupsForTheRole.add(group); // depends on control dependency: [if], data = [none] } roleToGroupMap.put(role, groupsForTheRole); if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { SibTr.exit(tc, CLASS_NAME + "addGroupToRole"); // depends on control dependency: [if], data = [none] } } }
public class class_name { protected String nextOtherNumber( int c ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append((char)c); int ch; while ( (ch = readNext()) != -1 ) { if ( StringUtil.isWhitespace(ch) ) { pushBack(ch); break; } if ( ! StringUtil.isOtherNumber(ch) ) { pushBack(ch); break; } isb.append((char)ch); } return isb.toString(); } }
public class class_name { protected String nextOtherNumber( int c ) throws IOException { //StringBuilder isb = new StringBuilder(); isb.clear(); isb.append((char)c); int ch; while ( (ch = readNext()) != -1 ) { if ( StringUtil.isWhitespace(ch) ) { pushBack(ch); // depends on control dependency: [if], data = [none] break; } if ( ! StringUtil.isOtherNumber(ch) ) { pushBack(ch); // depends on control dependency: [if], data = [none] break; } isb.append((char)ch); } return isb.toString(); } }
public class class_name { public static <T> JavaRDD<T> repartitionBalanceIfRequired(JavaRDD<T> rdd, Repartition repartition, int objectsPerPartition, int numPartitions) { int origNumPartitions = rdd.partitions().size(); switch (repartition) { case Never: return rdd; case NumPartitionsWorkersDiffers: if (origNumPartitions == numPartitions) return rdd; case Always: //Repartition: either always, or origNumPartitions != numWorkers //First: count number of elements in each partition. Need to know this so we can work out how to properly index each example, // so we can in turn create properly balanced partitions after repartitioning //Because the objects (DataSets etc) should be small, this should be OK //Count each partition... List<Tuple2<Integer, Integer>> partitionCounts = rdd.mapPartitionsWithIndex(new CountPartitionsFunction<T>(), true).collect(); int totalObjects = 0; int initialPartitions = partitionCounts.size(); boolean allCorrectSize = true; int x = 0; for (Tuple2<Integer, Integer> t2 : partitionCounts) { int partitionSize = t2._2(); allCorrectSize &= (partitionSize == objectsPerPartition); totalObjects += t2._2(); } if (numPartitions * objectsPerPartition < totalObjects) { allCorrectSize = true; for (Tuple2<Integer, Integer> t2 : partitionCounts) { allCorrectSize &= (t2._2() == objectsPerPartition); } } if (initialPartitions == numPartitions && allCorrectSize) { //Don't need to do any repartitioning here - already in the format we want return rdd; } //Index each element for repartitioning (can only do manual repartitioning on a JavaPairRDD) JavaPairRDD<Integer, T> pairIndexed = indexedRDD(rdd); int remainder = (totalObjects - numPartitions * objectsPerPartition) % numPartitions; log.info("Amount to rebalance: numPartitions={}, objectsPerPartition={}, remainder={}", numPartitions, objectsPerPartition, remainder); pairIndexed = pairIndexed .partitionBy(new BalancedPartitioner(numPartitions, objectsPerPartition, remainder)); return pairIndexed.values(); default: throw new RuntimeException("Unknown setting for repartition: " + repartition); } } }
public class class_name { public static <T> JavaRDD<T> repartitionBalanceIfRequired(JavaRDD<T> rdd, Repartition repartition, int objectsPerPartition, int numPartitions) { int origNumPartitions = rdd.partitions().size(); switch (repartition) { case Never: return rdd; case NumPartitionsWorkersDiffers: if (origNumPartitions == numPartitions) return rdd; case Always: //Repartition: either always, or origNumPartitions != numWorkers //First: count number of elements in each partition. Need to know this so we can work out how to properly index each example, // so we can in turn create properly balanced partitions after repartitioning //Because the objects (DataSets etc) should be small, this should be OK //Count each partition... List<Tuple2<Integer, Integer>> partitionCounts = rdd.mapPartitionsWithIndex(new CountPartitionsFunction<T>(), true).collect(); int totalObjects = 0; int initialPartitions = partitionCounts.size(); boolean allCorrectSize = true; int x = 0; for (Tuple2<Integer, Integer> t2 : partitionCounts) { int partitionSize = t2._2(); allCorrectSize &= (partitionSize == objectsPerPartition); // depends on control dependency: [for], data = [none] totalObjects += t2._2(); // depends on control dependency: [for], data = [t2] } if (numPartitions * objectsPerPartition < totalObjects) { allCorrectSize = true; // depends on control dependency: [if], data = [none] for (Tuple2<Integer, Integer> t2 : partitionCounts) { allCorrectSize &= (t2._2() == objectsPerPartition); // depends on control dependency: [for], data = [t2] } } if (initialPartitions == numPartitions && allCorrectSize) { //Don't need to do any repartitioning here - already in the format we want return rdd; // depends on control dependency: [if], data = [none] } //Index each element for repartitioning (can only do manual repartitioning on a JavaPairRDD) JavaPairRDD<Integer, T> pairIndexed = indexedRDD(rdd); int remainder = (totalObjects - numPartitions * objectsPerPartition) % numPartitions; log.info("Amount to rebalance: numPartitions={}, objectsPerPartition={}, remainder={}", numPartitions, objectsPerPartition, remainder); pairIndexed = pairIndexed .partitionBy(new BalancedPartitioner(numPartitions, objectsPerPartition, remainder)); return pairIndexed.values(); default: throw new RuntimeException("Unknown setting for repartition: " + repartition); } } }
public class class_name { public void connect( final String endpoint, final Callback<? super HttpSocket> onConnect, final Callback<? super Exception> onError ) { executors.getUnbounded().submit( new Runnable() { @Override public void run() { try { // Build request bytes AoByteArrayOutputStream bout = new AoByteArrayOutputStream(); try { try (DataOutputStream out = new DataOutputStream(bout)) { out.writeBytes("action=connect"); } } finally { bout.close(); } long connectTime = System.currentTimeMillis(); URL endpointURL = new URL(endpoint); HttpURLConnection conn = (HttpURLConnection)endpointURL.openConnection(); conn.setAllowUserInteraction(false); conn.setConnectTimeout(CONNECT_TIMEOUT); conn.setDoOutput(true); conn.setFixedLengthStreamingMode(bout.size()); conn.setInstanceFollowRedirects(false); conn.setReadTimeout(CONNECT_TIMEOUT); conn.setRequestMethod("POST"); conn.setUseCaches(false); // Write request OutputStream out = conn.getOutputStream(); try { out.write(bout.getInternalByteArray(), 0, bout.size()); out.flush(); } finally { out.close(); } // Get response int responseCode = conn.getResponseCode(); if(responseCode != 200) throw new IOException("Unexpect response code: " + responseCode); if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: got connection"); DocumentBuilder builder = builderFactory.newDocumentBuilder(); Element document = builder.parse(conn.getInputStream()).getDocumentElement(); if(!"connection".equals(document.getNodeName())) throw new IOException("Unexpected root node name: " + document.getNodeName()); Identifier id = Identifier.valueOf(document.getAttribute("id")); if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: got id=" + id); HttpSocket httpSocket = new HttpSocket( HttpSocketClient.this, id, connectTime, endpointURL ); if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: adding socket"); addSocket(httpSocket); if(onConnect!=null) { if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: calling onConnect"); onConnect.call(httpSocket); } } catch(Exception exc) { if(onError!=null) { if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: calling onError"); onError.call(exc); } } } } ); } }
public class class_name { public void connect( final String endpoint, final Callback<? super HttpSocket> onConnect, final Callback<? super Exception> onError ) { executors.getUnbounded().submit( new Runnable() { @Override public void run() { try { // Build request bytes AoByteArrayOutputStream bout = new AoByteArrayOutputStream(); try { try (DataOutputStream out = new DataOutputStream(bout)) { out.writeBytes("action=connect"); } } finally { bout.close(); } long connectTime = System.currentTimeMillis(); URL endpointURL = new URL(endpoint); HttpURLConnection conn = (HttpURLConnection)endpointURL.openConnection(); conn.setAllowUserInteraction(false); // depends on control dependency: [try], data = [none] conn.setConnectTimeout(CONNECT_TIMEOUT); // depends on control dependency: [try], data = [none] conn.setDoOutput(true); // depends on control dependency: [try], data = [none] conn.setFixedLengthStreamingMode(bout.size()); // depends on control dependency: [try], data = [none] conn.setInstanceFollowRedirects(false); // depends on control dependency: [try], data = [none] conn.setReadTimeout(CONNECT_TIMEOUT); // depends on control dependency: [try], data = [none] conn.setRequestMethod("POST"); // depends on control dependency: [try], data = [none] conn.setUseCaches(false); // depends on control dependency: [try], data = [none] // Write request OutputStream out = conn.getOutputStream(); try { out.write(bout.getInternalByteArray(), 0, bout.size()); // depends on control dependency: [try], data = [none] out.flush(); // depends on control dependency: [try], data = [none] } finally { out.close(); } // Get response int responseCode = conn.getResponseCode(); if(responseCode != 200) throw new IOException("Unexpect response code: " + responseCode); if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: got connection"); DocumentBuilder builder = builderFactory.newDocumentBuilder(); Element document = builder.parse(conn.getInputStream()).getDocumentElement(); if(!"connection".equals(document.getNodeName())) throw new IOException("Unexpected root node name: " + document.getNodeName()); Identifier id = Identifier.valueOf(document.getAttribute("id")); if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: got id=" + id); HttpSocket httpSocket = new HttpSocket( HttpSocketClient.this, id, connectTime, endpointURL ); if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: adding socket"); addSocket(httpSocket); // depends on control dependency: [try], data = [none] if(onConnect!=null) { if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: calling onConnect"); onConnect.call(httpSocket); // depends on control dependency: [if], data = [none] } } catch(Exception exc) { if(onError!=null) { if(DEBUG) System.out.println("DEBUG: HttpSocketClient: connect: calling onError"); onError.call(exc); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } } ); } }
public class class_name { public Element toElement(final DynamoDbDatastore datastore) { final Element ds = getDocument().createElement("dynamodb-datastore"); ds.setAttribute("name", datastore.getName()); if (!Strings.isNullOrEmpty(datastore.getDescription())) { ds.setAttribute("description", datastore.getDescription()); } appendElement(ds, "region", datastore.getRegion()); appendElement(ds, "accessKeyId", datastore.getAccessKeyId()); appendElement(ds, "secretAccessKey", encodePassword(datastore.getSecretAccessKey())); return ds; } }
public class class_name { public Element toElement(final DynamoDbDatastore datastore) { final Element ds = getDocument().createElement("dynamodb-datastore"); ds.setAttribute("name", datastore.getName()); if (!Strings.isNullOrEmpty(datastore.getDescription())) { ds.setAttribute("description", datastore.getDescription()); // depends on control dependency: [if], data = [none] } appendElement(ds, "region", datastore.getRegion()); appendElement(ds, "accessKeyId", datastore.getAccessKeyId()); appendElement(ds, "secretAccessKey", encodePassword(datastore.getSecretAccessKey())); return ds; } }
public class class_name { protected static Pair<PasswordAuthenticator, List<String>> getConnectionObjectsFromHostOrKey(String hostOrKey) { // Check if hostOrKey is really a host, if it's a host, then we let only one host!! URI singleHostURI = checkAndGetURI(hostOrKey); // No scheme defined so it's considered a configuration key if (singleHostURI == null || singleHostURI.getScheme() == null) { return getConnectionObjectsFromConfigurationKey(hostOrKey); } else { return getConnectionObjectsFromHost(singleHostURI); } } }
public class class_name { protected static Pair<PasswordAuthenticator, List<String>> getConnectionObjectsFromHostOrKey(String hostOrKey) { // Check if hostOrKey is really a host, if it's a host, then we let only one host!! URI singleHostURI = checkAndGetURI(hostOrKey); // No scheme defined so it's considered a configuration key if (singleHostURI == null || singleHostURI.getScheme() == null) { return getConnectionObjectsFromConfigurationKey(hostOrKey); // depends on control dependency: [if], data = [none] } else { return getConnectionObjectsFromHost(singleHostURI); // depends on control dependency: [if], data = [(singleHostURI] } } }
public class class_name { public final EqualsToHolder getEquals() throws RecognitionException { EqualsToHolder holder = null; Token a=null; Token b=null; try { // druidG.g:333:2: ( (a= ID ( WS )? EQUALS ( WS )? b= ( SINGLE_QUOTE_STRING | FLOAT | LONG ) ) ) // druidG.g:333:4: (a= ID ( WS )? EQUALS ( WS )? b= ( SINGLE_QUOTE_STRING | FLOAT | LONG ) ) { // druidG.g:333:4: (a= ID ( WS )? EQUALS ( WS )? b= ( SINGLE_QUOTE_STRING | FLOAT | LONG ) ) // druidG.g:333:5: a= ID ( WS )? EQUALS ( WS )? b= ( SINGLE_QUOTE_STRING | FLOAT | LONG ) { a=(Token)match(input,ID,FOLLOW_ID_in_getEquals2187); // druidG.g:333:10: ( WS )? int alt140=2; int LA140_0 = input.LA(1); if ( (LA140_0==WS) ) { alt140=1; } switch (alt140) { case 1 : // druidG.g:333:10: WS { match(input,WS,FOLLOW_WS_in_getEquals2189); } break; } match(input,EQUALS,FOLLOW_EQUALS_in_getEquals2192); // druidG.g:333:21: ( WS )? int alt141=2; int LA141_0 = input.LA(1); if ( (LA141_0==WS) ) { alt141=1; } switch (alt141) { case 1 : // druidG.g:333:21: WS { match(input,WS,FOLLOW_WS_in_getEquals2194); } break; } b=input.LT(1); if ( input.LA(1)==FLOAT||input.LA(1)==LONG||input.LA(1)==SINGLE_QUOTE_STRING ) { input.consume(); state.errorRecovery=false; } else { MismatchedSetException mse = new MismatchedSetException(null,input); throw mse; } } holder = new EqualsToHolder((a!=null?a.getText():null), (b!=null?b.getText():null)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } return holder; } }
public class class_name { public final EqualsToHolder getEquals() throws RecognitionException { EqualsToHolder holder = null; Token a=null; Token b=null; try { // druidG.g:333:2: ( (a= ID ( WS )? EQUALS ( WS )? b= ( SINGLE_QUOTE_STRING | FLOAT | LONG ) ) ) // druidG.g:333:4: (a= ID ( WS )? EQUALS ( WS )? b= ( SINGLE_QUOTE_STRING | FLOAT | LONG ) ) { // druidG.g:333:4: (a= ID ( WS )? EQUALS ( WS )? b= ( SINGLE_QUOTE_STRING | FLOAT | LONG ) ) // druidG.g:333:5: a= ID ( WS )? EQUALS ( WS )? b= ( SINGLE_QUOTE_STRING | FLOAT | LONG ) { a=(Token)match(input,ID,FOLLOW_ID_in_getEquals2187); // druidG.g:333:10: ( WS )? int alt140=2; int LA140_0 = input.LA(1); if ( (LA140_0==WS) ) { alt140=1; // depends on control dependency: [if], data = [none] } switch (alt140) { case 1 : // druidG.g:333:10: WS { match(input,WS,FOLLOW_WS_in_getEquals2189); } break; } match(input,EQUALS,FOLLOW_EQUALS_in_getEquals2192); // druidG.g:333:21: ( WS )? int alt141=2; int LA141_0 = input.LA(1); if ( (LA141_0==WS) ) { alt141=1; // depends on control dependency: [if], data = [none] } switch (alt141) { case 1 : // druidG.g:333:21: WS { match(input,WS,FOLLOW_WS_in_getEquals2194); } break; } b=input.LT(1); if ( input.LA(1)==FLOAT||input.LA(1)==LONG||input.LA(1)==SINGLE_QUOTE_STRING ) { input.consume(); // depends on control dependency: [if], data = [none] state.errorRecovery=false; // depends on control dependency: [if], data = [none] } else { MismatchedSetException mse = new MismatchedSetException(null,input); throw mse; } } holder = new EqualsToHolder((a!=null?a.getText():null), (b!=null?b.getText():null)); } } catch (RecognitionException re) { reportError(re); recover(input,re); } finally { // do for sure before leaving } return holder; } }
public class class_name { public void substitute(SAXRule r) { // System.out.println("[sequitur debug] *substitute* " + this.value + " with rule " // + r.asDebugLine()); // clean up this place and the next // here we keep the original position in the input string // r.addIndex(this.originalPosition); this.cleanUp(); this.n.cleanUp(); // link the rule instead of digram SAXNonTerminal nt = new SAXNonTerminal(r); nt.originalPosition = this.originalPosition; this.p.insertAfter(nt); // do p check // // TODO: not getting this if (!p.check()) { p.n.check(); } } }
public class class_name { public void substitute(SAXRule r) { // System.out.println("[sequitur debug] *substitute* " + this.value + " with rule " // + r.asDebugLine()); // clean up this place and the next // here we keep the original position in the input string // r.addIndex(this.originalPosition); this.cleanUp(); this.n.cleanUp(); // link the rule instead of digram SAXNonTerminal nt = new SAXNonTerminal(r); nt.originalPosition = this.originalPosition; this.p.insertAfter(nt); // do p check // // TODO: not getting this if (!p.check()) { p.n.check(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static ArrayList<String> getKeywordDataclass(Entry entry, DataSet d) { Set<String> keywordDataclassSet = new HashSet<String>(); ArrayList<String> keywordDataclasses=new ArrayList<String>(); HashMap<String, String> compressedKeywordToDataclassMap = new HashMap<String, String>(); HashMap<String, String> compressedKeywordToKeywordMap = new HashMap<String, String>(); HashMap<Text, Text> keywordMap = new HashMap<Text, Text>(); for (DataRow row : d.getRows()) { compressedKeywordToDataclassMap.put(row.getString(1), row.getString(0)); if (row.getString(2) != null) compressedKeywordToKeywordMap.put(row.getString(1), row.getString(2)); } for (Text keyword : entry.getKeywords()) { String compressedKeyword = getcompressedKeyword(keyword); if (compressedKeywordToDataclassMap.containsKey(compressedKeyword) && compressedKeywordToKeywordMap.containsKey(compressedKeyword)) { keywordMap.put(keyword, new Text(compressedKeywordToKeywordMap.get(compressedKeyword))); keywordDataclassSet.add(compressedKeywordToDataclassMap.get(compressedKeyword)); } } for (Text key : keywordMap.keySet()) { entry.removeKeyword(key); entry.addKeyword(keywordMap.get(key)); } if (keywordDataclassSet.isEmpty()) { keywordDataclasses.add("XXX"); return keywordDataclasses; } if (keywordDataclassSet.size() == 1) { keywordDataclasses.add(keywordDataclassSet.toArray()[0].toString()); return keywordDataclasses; } if (keywordDataclassSet.size() == 2 && keywordDataclassSet.contains(Entry.TPA_DATACLASS)) { if (keywordDataclassSet.contains(Entry.WGS_DATACLASS)) { keywordDataclasses.add(Entry.WGS_DATACLASS); return keywordDataclasses; } if (keywordDataclassSet.contains(Entry.CON_DATACLASS)) { keywordDataclasses.add(Entry.CON_DATACLASS); return keywordDataclasses; } if (keywordDataclassSet.contains(Entry.TSA_DATACLASS)) { keywordDataclasses.add(Entry.TSA_DATACLASS);// EMD-5315 return keywordDataclasses; } } else { for (String keywordDataclass:keywordDataclassSet) { keywordDataclasses.add(keywordDataclass); } return keywordDataclasses; } return null; } }
public class class_name { public static ArrayList<String> getKeywordDataclass(Entry entry, DataSet d) { Set<String> keywordDataclassSet = new HashSet<String>(); ArrayList<String> keywordDataclasses=new ArrayList<String>(); HashMap<String, String> compressedKeywordToDataclassMap = new HashMap<String, String>(); HashMap<String, String> compressedKeywordToKeywordMap = new HashMap<String, String>(); HashMap<Text, Text> keywordMap = new HashMap<Text, Text>(); for (DataRow row : d.getRows()) { compressedKeywordToDataclassMap.put(row.getString(1), row.getString(0)); // depends on control dependency: [for], data = [row] if (row.getString(2) != null) compressedKeywordToKeywordMap.put(row.getString(1), row.getString(2)); } for (Text keyword : entry.getKeywords()) { String compressedKeyword = getcompressedKeyword(keyword); if (compressedKeywordToDataclassMap.containsKey(compressedKeyword) && compressedKeywordToKeywordMap.containsKey(compressedKeyword)) { keywordMap.put(keyword, new Text(compressedKeywordToKeywordMap.get(compressedKeyword))); // depends on control dependency: [if], data = [none] keywordDataclassSet.add(compressedKeywordToDataclassMap.get(compressedKeyword)); // depends on control dependency: [if], data = [none] } } for (Text key : keywordMap.keySet()) { entry.removeKeyword(key); // depends on control dependency: [for], data = [key] entry.addKeyword(keywordMap.get(key)); // depends on control dependency: [for], data = [key] } if (keywordDataclassSet.isEmpty()) { keywordDataclasses.add("XXX"); // depends on control dependency: [if], data = [none] return keywordDataclasses; // depends on control dependency: [if], data = [none] } if (keywordDataclassSet.size() == 1) { keywordDataclasses.add(keywordDataclassSet.toArray()[0].toString()); // depends on control dependency: [if], data = [none] return keywordDataclasses; // depends on control dependency: [if], data = [none] } if (keywordDataclassSet.size() == 2 && keywordDataclassSet.contains(Entry.TPA_DATACLASS)) { if (keywordDataclassSet.contains(Entry.WGS_DATACLASS)) { keywordDataclasses.add(Entry.WGS_DATACLASS); // depends on control dependency: [if], data = [none] return keywordDataclasses; // depends on control dependency: [if], data = [none] } if (keywordDataclassSet.contains(Entry.CON_DATACLASS)) { keywordDataclasses.add(Entry.CON_DATACLASS); // depends on control dependency: [if], data = [none] return keywordDataclasses; // depends on control dependency: [if], data = [none] } if (keywordDataclassSet.contains(Entry.TSA_DATACLASS)) { keywordDataclasses.add(Entry.TSA_DATACLASS);// EMD-5315 // depends on control dependency: [if], data = [none] return keywordDataclasses; // depends on control dependency: [if], data = [none] } } else { for (String keywordDataclass:keywordDataclassSet) { keywordDataclasses.add(keywordDataclass); // depends on control dependency: [for], data = [keywordDataclass] } return keywordDataclasses; // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { private Expr parseConditionExpression(EnclosingScope scope, boolean terminated) { int start = index; Token lookahead; // First, attempt to parse quantifiers (e.g. some, all, no, etc) if ((lookahead = tryAndMatch(terminated, Some, All)) != null) { return parseQuantifierExpression(lookahead, scope, terminated); } Expr lhs = parseShiftExpression(scope, terminated); lookahead = tryAndMatch(terminated, LessEquals, LeftAngle, GreaterEquals, RightAngle, EqualsEquals, NotEquals, Is, Subset, SubsetEquals, Superset, SupersetEquals); if (lookahead != null && lookahead.kind == Is) { Type type = parseType(scope); lhs = annotateSourceLocation(new Expr.Is(lhs, type), start); } else if (lookahead != null) { Expr rhs = parseShiftExpression(scope, terminated); // switch (lookahead.kind) { case LessEquals: lhs = new Expr.IntegerLessThanOrEqual(lhs, rhs); break; case LeftAngle: lhs = new Expr.IntegerLessThan(lhs, rhs); break; case GreaterEquals: lhs = new Expr.IntegerGreaterThanOrEqual(lhs, rhs); break; case RightAngle: lhs = new Expr.IntegerGreaterThan(lhs, rhs); break; case EqualsEquals: lhs = new Expr.Equal(lhs, rhs); break; case NotEquals: lhs = new Expr.NotEqual(lhs, rhs); break; default: throw new RuntimeException("deadcode"); // dead-code } lhs = annotateSourceLocation(lhs,start); } return lhs; } }
public class class_name { private Expr parseConditionExpression(EnclosingScope scope, boolean terminated) { int start = index; Token lookahead; // First, attempt to parse quantifiers (e.g. some, all, no, etc) if ((lookahead = tryAndMatch(terminated, Some, All)) != null) { return parseQuantifierExpression(lookahead, scope, terminated); // depends on control dependency: [if], data = [none] } Expr lhs = parseShiftExpression(scope, terminated); lookahead = tryAndMatch(terminated, LessEquals, LeftAngle, GreaterEquals, RightAngle, EqualsEquals, NotEquals, Is, Subset, SubsetEquals, Superset, SupersetEquals); if (lookahead != null && lookahead.kind == Is) { Type type = parseType(scope); lhs = annotateSourceLocation(new Expr.Is(lhs, type), start); // depends on control dependency: [if], data = [none] } else if (lookahead != null) { Expr rhs = parseShiftExpression(scope, terminated); // switch (lookahead.kind) { case LessEquals: lhs = new Expr.IntegerLessThanOrEqual(lhs, rhs); break; case LeftAngle: lhs = new Expr.IntegerLessThan(lhs, rhs); break; case GreaterEquals: lhs = new Expr.IntegerGreaterThanOrEqual(lhs, rhs); break; case RightAngle: lhs = new Expr.IntegerGreaterThan(lhs, rhs); break; case EqualsEquals: lhs = new Expr.Equal(lhs, rhs); break; case NotEquals: lhs = new Expr.NotEqual(lhs, rhs); break; default: throw new RuntimeException("deadcode"); // dead-code } lhs = annotateSourceLocation(lhs,start); // depends on control dependency: [if], data = [none] } return lhs; } }
public class class_name { void updateCss() { String formatterId = m_formatterSelect.getFormValueAsString(); CmsFormatterConfig formatter = m_elementBean.getFormatters().get(m_containerId).get(formatterId); Set<String> cssResources = formatter.getCssResources(); for (String cssResource : cssResources) { CmsDomUtil.ensureStyleSheetIncluded(cssResource); } if (formatter.hasInlineCss()) { ensureInlineCss(formatterId, formatter.getInlineCss()); } } }
public class class_name { void updateCss() { String formatterId = m_formatterSelect.getFormValueAsString(); CmsFormatterConfig formatter = m_elementBean.getFormatters().get(m_containerId).get(formatterId); Set<String> cssResources = formatter.getCssResources(); for (String cssResource : cssResources) { CmsDomUtil.ensureStyleSheetIncluded(cssResource); // depends on control dependency: [for], data = [cssResource] } if (formatter.hasInlineCss()) { ensureInlineCss(formatterId, formatter.getInlineCss()); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void inlineText(WhitespaceRetentionPolicy whitespacePolicy) throws ParseException { switch (whitespacePolicy) { case REMOVE_ALL: skipWhitespace(); break; case REMOVE_FIRST_SPACE: if (ch == ' ') nextChar(); break; case RETAIN_ALL: default: // do nothing break; } int pos = bp; int depth = 1; loop: while (bp < buflen) { switch (ch) { case '\n': case '\r': case '\f': newline = true; break; case ' ': case '\t': break; case '{': newline = false; depth++; break; case '}': if (--depth == 0) { return; } newline = false; break; case '@': if (newline) break loop; newline = false; break; default: newline = false; break; } nextChar(); } throw new ParseException("dc.unterminated.inline.tag"); } }
public class class_name { private void inlineText(WhitespaceRetentionPolicy whitespacePolicy) throws ParseException { switch (whitespacePolicy) { case REMOVE_ALL: skipWhitespace(); break; case REMOVE_FIRST_SPACE: if (ch == ' ') nextChar(); break; case RETAIN_ALL: default: // do nothing break; } int pos = bp; int depth = 1; loop: while (bp < buflen) { switch (ch) { case '\n': case '\r': case '\f': newline = true; break; case ' ': case '\t': break; case '{': newline = false; depth++; break; case '}': if (--depth == 0) { return; // depends on control dependency: [if], data = [none] } newline = false; break; case '@': if (newline) break loop; newline = false; break; default: newline = false; break; } nextChar(); } throw new ParseException("dc.unterminated.inline.tag"); } }
public class class_name { private void rewriteJsdoc(JSDocInfo info) { for (Node typeNode : info.getTypeNodes()) { NodeUtil.visitPreOrder(typeNode, replaceJsDocRefs); } } }
public class class_name { private void rewriteJsdoc(JSDocInfo info) { for (Node typeNode : info.getTypeNodes()) { NodeUtil.visitPreOrder(typeNode, replaceJsDocRefs); // depends on control dependency: [for], data = [typeNode] } } }
public class class_name { public static <T> void registerLater(MeterRegistry registry, MeterIdPrefix idPrefix, Class<T> type, BiFunction<MeterRegistry, MeterIdPrefix, T> factory) { final RegistrationState registrationState = MicrometerUtil.registrationState.get(); if (!registrationState.isRegistering) { register(registry, idPrefix, type, factory); } else { registrationState.pendingRegistrations.add( new PendingRegistration<>(registry, idPrefix, type, factory)); } } }
public class class_name { public static <T> void registerLater(MeterRegistry registry, MeterIdPrefix idPrefix, Class<T> type, BiFunction<MeterRegistry, MeterIdPrefix, T> factory) { final RegistrationState registrationState = MicrometerUtil.registrationState.get(); if (!registrationState.isRegistering) { register(registry, idPrefix, type, factory); // depends on control dependency: [if], data = [none] } else { registrationState.pendingRegistrations.add( new PendingRegistration<>(registry, idPrefix, type, factory)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void addPropertyListeners(PropertyListener[] listeners) { if (listeners == null) throw new NullArgumentException("listeners"); for (int i = 0; i < listeners.length; i++) { addPropertyListener(listeners[i]); } } }
public class class_name { public void addPropertyListeners(PropertyListener[] listeners) { if (listeners == null) throw new NullArgumentException("listeners"); for (int i = 0; i < listeners.length; i++) { addPropertyListener(listeners[i]); // depends on control dependency: [for], data = [i] } } }
public class class_name { public boolean removeEventListener(IEventListener listener) { log.debug("removeEventListener - scope: {} {}", getName(), listener); if (log.isTraceEnabled()) { log.trace("Listeners - check #1: {}", listeners); } boolean removed = listeners.remove(listener); if (!keepOnDisconnect) { if (removed && keepAliveJobName == null) { if (ScopeUtils.isRoom(this) && listeners.isEmpty()) { // create job to kill the scope off if no listeners join within the delay ISchedulingService schedulingService = (ISchedulingService) parent.getContext().getBean(ISchedulingService.BEAN_NAME); // by default keep a scope around for a fraction of a second keepAliveJobName = schedulingService.addScheduledOnceJob((keepDelay > 0 ? keepDelay * 1000 : 100), new KeepAliveJob(this)); } } } else { log.trace("Scope: {} is exempt from removal when empty", getName()); } if (log.isTraceEnabled()) { log.trace("Listeners - check #2: {}", listeners); } return removed; } }
public class class_name { public boolean removeEventListener(IEventListener listener) { log.debug("removeEventListener - scope: {} {}", getName(), listener); if (log.isTraceEnabled()) { log.trace("Listeners - check #1: {}", listeners); // depends on control dependency: [if], data = [none] } boolean removed = listeners.remove(listener); if (!keepOnDisconnect) { if (removed && keepAliveJobName == null) { if (ScopeUtils.isRoom(this) && listeners.isEmpty()) { // create job to kill the scope off if no listeners join within the delay ISchedulingService schedulingService = (ISchedulingService) parent.getContext().getBean(ISchedulingService.BEAN_NAME); // by default keep a scope around for a fraction of a second keepAliveJobName = schedulingService.addScheduledOnceJob((keepDelay > 0 ? keepDelay * 1000 : 100), new KeepAliveJob(this)); // depends on control dependency: [if], data = [none] } } } else { log.trace("Scope: {} is exempt from removal when empty", getName()); // depends on control dependency: [if], data = [none] } if (log.isTraceEnabled()) { log.trace("Listeners - check #2: {}", listeners); // depends on control dependency: [if], data = [none] } return removed; } }
public class class_name { private static SubstitutionMatrix<AminoAcidCompound> getAminoAcidMatrix(String file) { if (!aminoAcidMatrices.containsKey(file)) { aminoAcidMatrices.put(file, new SimpleSubstitutionMatrix<AminoAcidCompound>( AminoAcidCompoundSet.getAminoAcidCompoundSet(), getReader(file), file)); } return aminoAcidMatrices.get(file); } }
public class class_name { private static SubstitutionMatrix<AminoAcidCompound> getAminoAcidMatrix(String file) { if (!aminoAcidMatrices.containsKey(file)) { aminoAcidMatrices.put(file, new SimpleSubstitutionMatrix<AminoAcidCompound>( AminoAcidCompoundSet.getAminoAcidCompoundSet(), getReader(file), file)); // depends on control dependency: [if], data = [none] } return aminoAcidMatrices.get(file); } }
public class class_name { public static boolean process(final URI uri, final String path, final SpanFilterType type) { final String methodName = "process"; String newExcludeFilterString = OpentracingConfiguration.getServerSkipPattern(); if (!compare(excludeFilterString, newExcludeFilterString)) { updateFilters(newExcludeFilterString); } boolean result = true; // Copy the static reference locally so that it doesn't matter if the static list // is updated while we're processing since that will just overwrite the reference final SpanFilter[] filters = allFilters; for (int i = 0; i < filters.length; i++) { result = filters[i].process(result, uri, path, type); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, methodName, "filter " + filters[i] + " set result to " + result); } } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, methodName, "Checking to see if this request should be excluded. request uri=" + uri + ", path=" + path + " result=" + (result ? "INCLUDE" : "EXCLUDE")); } return result; } }
public class class_name { public static boolean process(final URI uri, final String path, final SpanFilterType type) { final String methodName = "process"; String newExcludeFilterString = OpentracingConfiguration.getServerSkipPattern(); if (!compare(excludeFilterString, newExcludeFilterString)) { updateFilters(newExcludeFilterString); // depends on control dependency: [if], data = [none] } boolean result = true; // Copy the static reference locally so that it doesn't matter if the static list // is updated while we're processing since that will just overwrite the reference final SpanFilter[] filters = allFilters; for (int i = 0; i < filters.length; i++) { result = filters[i].process(result, uri, path, type); // depends on control dependency: [for], data = [i] if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, methodName, "filter " + filters[i] + " set result to " + result); // depends on control dependency: [if], data = [none] } } if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, methodName, "Checking to see if this request should be excluded. request uri=" + uri + ", path=" + path + " result=" + (result ? "INCLUDE" : "EXCLUDE")); // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { @Override public List<Namespace> getNamespaces(KamInfo ki) { if (ki == null) throw new InvalidArgument("missing KAM info"); if (!exists(ki)) return null; try { return kamStoreDao(ki).getNamespaces(); } catch (SQLException e) { final String fmt = "error getting namespaces for %s"; final String msg = format(fmt, ki.getName()); throw new KAMStoreException(msg, e); } } }
public class class_name { @Override public List<Namespace> getNamespaces(KamInfo ki) { if (ki == null) throw new InvalidArgument("missing KAM info"); if (!exists(ki)) return null; try { return kamStoreDao(ki).getNamespaces(); // depends on control dependency: [try], data = [none] } catch (SQLException e) { final String fmt = "error getting namespaces for %s"; final String msg = format(fmt, ki.getName()); throw new KAMStoreException(msg, e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { void unregisterUse() { final int value = this.uses.decrementAndGet(); if (value == 0) { uninstall(UninstallationStage.PRE_DESTROY_EVENT); uninstall(UninstallationStage.POST_DESTROY_EVENT); } } }
public class class_name { void unregisterUse() { final int value = this.uses.decrementAndGet(); if (value == 0) { uninstall(UninstallationStage.PRE_DESTROY_EVENT); // depends on control dependency: [if], data = [none] uninstall(UninstallationStage.POST_DESTROY_EVENT); // depends on control dependency: [if], data = [none] } } }
public class class_name { private void updateField(PropertyEditor editor, Object updateValue, BioPAXElement existing, Model target) { if (updateValue instanceof BioPAXElement) { BioPAXElement bpe = (BioPAXElement) updateValue; //Now there are two possibilities BioPAXElement ibpe = target.getByID(bpe.getUri()); //1. has an identical in the target if (ibpe != null) { updateValue = ibpe; } //2. it has no identical in the target //I do not have to do anything as it will eventually //be moved. } editor.setValueToBean(updateValue, existing); } }
public class class_name { private void updateField(PropertyEditor editor, Object updateValue, BioPAXElement existing, Model target) { if (updateValue instanceof BioPAXElement) { BioPAXElement bpe = (BioPAXElement) updateValue; //Now there are two possibilities BioPAXElement ibpe = target.getByID(bpe.getUri()); //1. has an identical in the target if (ibpe != null) { updateValue = ibpe; // depends on control dependency: [if], data = [none] } //2. it has no identical in the target //I do not have to do anything as it will eventually //be moved. } editor.setValueToBean(updateValue, existing); } }
public class class_name { static Color decode( String value, String defaultValue ) { Color result; try { result = Color.decode( value ); } catch( NumberFormatException e ) { Logger logger = Logger.getLogger( GraphUtils.class.getName()); logger.severe( "The specified color " + value + " could not be parsed. Back to default value: " + defaultValue ); Utils.logException( logger, e ); result = Color.decode( defaultValue ); } return result; } }
public class class_name { static Color decode( String value, String defaultValue ) { Color result; try { result = Color.decode( value ); // depends on control dependency: [try], data = [none] } catch( NumberFormatException e ) { Logger logger = Logger.getLogger( GraphUtils.class.getName()); logger.severe( "The specified color " + value + " could not be parsed. Back to default value: " + defaultValue ); Utils.logException( logger, e ); result = Color.decode( defaultValue ); } // depends on control dependency: [catch], data = [none] return result; } }
public class class_name { public final hqlParser.orderByClause_return orderByClause() throws RecognitionException { hqlParser.orderByClause_return retval = new hqlParser.orderByClause_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token ORDER126=null; Token string_literal127=null; Token COMMA129=null; ParserRuleReturnScope orderElement128 =null; ParserRuleReturnScope orderElement130 =null; CommonTree ORDER126_tree=null; CommonTree string_literal127_tree=null; CommonTree COMMA129_tree=null; try { // hql.g:336:2: ( ORDER ^ 'by' ! orderElement ( COMMA ! orderElement )* ) // hql.g:336:4: ORDER ^ 'by' ! orderElement ( COMMA ! orderElement )* { root_0 = (CommonTree)adaptor.nil(); ORDER126=(Token)match(input,ORDER,FOLLOW_ORDER_in_orderByClause1603); ORDER126_tree = (CommonTree)adaptor.create(ORDER126); root_0 = (CommonTree)adaptor.becomeRoot(ORDER126_tree, root_0); string_literal127=(Token)match(input,LITERAL_by,FOLLOW_LITERAL_by_in_orderByClause1606); pushFollow(FOLLOW_orderElement_in_orderByClause1609); orderElement128=orderElement(); state._fsp--; adaptor.addChild(root_0, orderElement128.getTree()); // hql.g:336:30: ( COMMA ! orderElement )* loop40: while (true) { int alt40=2; int LA40_0 = input.LA(1); if ( (LA40_0==COMMA) ) { alt40=1; } switch (alt40) { case 1 : // hql.g:336:32: COMMA ! orderElement { COMMA129=(Token)match(input,COMMA,FOLLOW_COMMA_in_orderByClause1613); pushFollow(FOLLOW_orderElement_in_orderByClause1616); orderElement130=orderElement(); state._fsp--; adaptor.addChild(root_0, orderElement130.getTree()); } break; default : break loop40; } } } retval.stop = input.LT(-1); retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; } }
public class class_name { public final hqlParser.orderByClause_return orderByClause() throws RecognitionException { hqlParser.orderByClause_return retval = new hqlParser.orderByClause_return(); retval.start = input.LT(1); CommonTree root_0 = null; Token ORDER126=null; Token string_literal127=null; Token COMMA129=null; ParserRuleReturnScope orderElement128 =null; ParserRuleReturnScope orderElement130 =null; CommonTree ORDER126_tree=null; CommonTree string_literal127_tree=null; CommonTree COMMA129_tree=null; try { // hql.g:336:2: ( ORDER ^ 'by' ! orderElement ( COMMA ! orderElement )* ) // hql.g:336:4: ORDER ^ 'by' ! orderElement ( COMMA ! orderElement )* { root_0 = (CommonTree)adaptor.nil(); ORDER126=(Token)match(input,ORDER,FOLLOW_ORDER_in_orderByClause1603); ORDER126_tree = (CommonTree)adaptor.create(ORDER126); root_0 = (CommonTree)adaptor.becomeRoot(ORDER126_tree, root_0); string_literal127=(Token)match(input,LITERAL_by,FOLLOW_LITERAL_by_in_orderByClause1606); pushFollow(FOLLOW_orderElement_in_orderByClause1609); orderElement128=orderElement(); state._fsp--; adaptor.addChild(root_0, orderElement128.getTree()); // hql.g:336:30: ( COMMA ! orderElement )* loop40: while (true) { int alt40=2; int LA40_0 = input.LA(1); if ( (LA40_0==COMMA) ) { alt40=1; // depends on control dependency: [if], data = [none] } switch (alt40) { case 1 : // hql.g:336:32: COMMA ! orderElement { COMMA129=(Token)match(input,COMMA,FOLLOW_COMMA_in_orderByClause1613); pushFollow(FOLLOW_orderElement_in_orderByClause1616); orderElement130=orderElement(); state._fsp--; adaptor.addChild(root_0, orderElement130.getTree()); } break; default : break loop40; } } } retval.stop = input.LT(-1); retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0); adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop); } catch (RecognitionException re) { reportError(re); recover(input,re); retval.tree = (CommonTree)adaptor.errorNode(input, retval.start, input.LT(-1), re); } finally { // do for sure before leaving } return retval; } }
public class class_name { public SplitDataProperties<T> splitsOrderedBy(String orderFields, Order[] orders) { if (orderFields == null || orders == null) { throw new InvalidProgramException("OrderFields or Orders may not be null."); } String[] orderKeysA = orderFields.split(";"); if (orderKeysA.length == 0) { throw new InvalidProgramException("OrderFields may not be empty."); } else if (orders.length == 0) { throw new InvalidProgramException("Orders may not be empty"); } else if (orderKeysA.length != orders.length) { throw new InvalidProgramException("Number of OrderFields and Orders must match."); } if (this.splitGroupKeys != null) { throw new InvalidProgramException("DataSource may either be grouped or sorted."); } this.splitOrdering = new Ordering(); for (int i = 0; i < orderKeysA.length; i++) { String keyExp = orderKeysA[i]; Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(keyExp, this.type); int[] flatKeys = ek.computeLogicalKeyPositions(); for (int key : flatKeys) { // check for duplicates for (int okey : splitOrdering.getFieldPositions()) { if (key == okey) { throw new InvalidProgramException("Duplicate field in field expression " + keyExp); } } // append key this.splitOrdering.appendOrdering(key, null, orders[i]); } } return this; } }
public class class_name { public SplitDataProperties<T> splitsOrderedBy(String orderFields, Order[] orders) { if (orderFields == null || orders == null) { throw new InvalidProgramException("OrderFields or Orders may not be null."); } String[] orderKeysA = orderFields.split(";"); if (orderKeysA.length == 0) { throw new InvalidProgramException("OrderFields may not be empty."); } else if (orders.length == 0) { throw new InvalidProgramException("Orders may not be empty"); } else if (orderKeysA.length != orders.length) { throw new InvalidProgramException("Number of OrderFields and Orders must match."); } if (this.splitGroupKeys != null) { throw new InvalidProgramException("DataSource may either be grouped or sorted."); } this.splitOrdering = new Ordering(); for (int i = 0; i < orderKeysA.length; i++) { String keyExp = orderKeysA[i]; Keys.ExpressionKeys<T> ek = new Keys.ExpressionKeys<>(keyExp, this.type); int[] flatKeys = ek.computeLogicalKeyPositions(); for (int key : flatKeys) { // check for duplicates for (int okey : splitOrdering.getFieldPositions()) { if (key == okey) { throw new InvalidProgramException("Duplicate field in field expression " + keyExp); } } // append key this.splitOrdering.appendOrdering(key, null, orders[i]); // depends on control dependency: [for], data = [key] } } return this; } }
public class class_name { int CalcSubrOffsetSize(int Offset,int Size) { // Set the size to 0 int OffsetSize = 0; // Go to the beginning of the private dict seek(Offset); // Go until the end of the private dict while (getPosition() < Offset+Size) { int p1 = getPosition(); getDictItem(); int p2 = getPosition(); // When reached to the subrs offset if (key=="Subrs") { // The Offsize (minus the subrs key) OffsetSize = p2-p1-1; } // All other keys are ignored } // return the size return OffsetSize; } }
public class class_name { int CalcSubrOffsetSize(int Offset,int Size) { // Set the size to 0 int OffsetSize = 0; // Go to the beginning of the private dict seek(Offset); // Go until the end of the private dict while (getPosition() < Offset+Size) { int p1 = getPosition(); getDictItem(); // depends on control dependency: [while], data = [none] int p2 = getPosition(); // When reached to the subrs offset if (key=="Subrs") { // The Offsize (minus the subrs key) OffsetSize = p2-p1-1; // depends on control dependency: [if], data = [none] } // All other keys are ignored } // return the size return OffsetSize; } }
public class class_name { @Override public void userEventTriggered(final ChannelHandlerContext ctx, final Object evt) { if (evt instanceof IdleStateEvent) { IdleStateEvent e = (IdleStateEvent) evt; if (e.state() == IdleState.READER_IDLE) { ctx.close(); LOG.warn(jnrpeContext, "Read Timeout"); //jnrpeContext.getEventBus().post(new LogEvent(this, LogEventType.INFO, "Read Timeout")); //EventsUtil.sendEvent(this.jnrpeContext, this, LogEvent.INFO, "Read Timeout"); } else if (e.state() == IdleState.WRITER_IDLE) { LOG.warn(jnrpeContext, "Write Timeout"); //jnrpeContext.getEventBus().post(new LogEvent(this, LogEventType.INFO, "Write Timeout")); //EventsUtil.sendEvent(jnrpeContext, this, LogEvent.INFO, "Write Timeout"); ctx.close(); } } } }
public class class_name { @Override public void userEventTriggered(final ChannelHandlerContext ctx, final Object evt) { if (evt instanceof IdleStateEvent) { IdleStateEvent e = (IdleStateEvent) evt; if (e.state() == IdleState.READER_IDLE) { ctx.close(); // depends on control dependency: [if], data = [none] LOG.warn(jnrpeContext, "Read Timeout"); // depends on control dependency: [if], data = [none] //jnrpeContext.getEventBus().post(new LogEvent(this, LogEventType.INFO, "Read Timeout")); //EventsUtil.sendEvent(this.jnrpeContext, this, LogEvent.INFO, "Read Timeout"); } else if (e.state() == IdleState.WRITER_IDLE) { LOG.warn(jnrpeContext, "Write Timeout"); // depends on control dependency: [if], data = [none] //jnrpeContext.getEventBus().post(new LogEvent(this, LogEventType.INFO, "Write Timeout")); //EventsUtil.sendEvent(jnrpeContext, this, LogEvent.INFO, "Write Timeout"); ctx.close(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public void setAssociation(String collectionRole, Association association) { if ( associations == null ) { associations = new HashMap<>(); } associations.put( collectionRole, association ); } }
public class class_name { public void setAssociation(String collectionRole, Association association) { if ( associations == null ) { associations = new HashMap<>(); // depends on control dependency: [if], data = [none] } associations.put( collectionRole, association ); } }
public class class_name { protected void postDestroyConnection(ConnectionHandle handle){ ConnectionPartition partition = handle.getOriginatingPartition(); if (this.finalizableRefQueue != null && handle.getInternalConnection() != null){ //safety this.finalizableRefs.remove(handle.getInternalConnection()); // assert o != null : "Did not manage to remove connection from finalizable ref queue"; } partition.updateCreatedConnections(-1); partition.setUnableToCreateMoreTransactions(false); // we can create new ones now, this is an optimization // "Destroying" for us means: don't put it back in the pool. if (handle.getConnectionHook() != null){ handle.getConnectionHook().onDestroy(handle); } } }
public class class_name { protected void postDestroyConnection(ConnectionHandle handle){ ConnectionPartition partition = handle.getOriginatingPartition(); if (this.finalizableRefQueue != null && handle.getInternalConnection() != null){ //safety this.finalizableRefs.remove(handle.getInternalConnection()); // depends on control dependency: [if], data = [none] // assert o != null : "Did not manage to remove connection from finalizable ref queue"; } partition.updateCreatedConnections(-1); partition.setUnableToCreateMoreTransactions(false); // we can create new ones now, this is an optimization // "Destroying" for us means: don't put it back in the pool. if (handle.getConnectionHook() != null){ handle.getConnectionHook().onDestroy(handle); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static final int getSidForSymbolTableField(String text) { final int shortestFieldNameLength = 4; // 'name' if (text != null && text.length() >= shortestFieldNameLength) { int c = text.charAt(0); switch (c) { case 'v': if (VERSION.equals(text)) { return VERSION_SID; } break; case 'n': if (NAME.equals(text)) { return NAME_SID; } break; case 's': if (SYMBOLS.equals(text)) { return SYMBOLS_SID; } break; case 'i': if (IMPORTS.equals(text)) { return IMPORTS_SID; } break; case 'm': if (MAX_ID.equals(text)) { return MAX_ID_SID; } break; default: break; } } return UNKNOWN_SYMBOL_ID; } }
public class class_name { public static final int getSidForSymbolTableField(String text) { final int shortestFieldNameLength = 4; // 'name' if (text != null && text.length() >= shortestFieldNameLength) { int c = text.charAt(0); switch (c) { case 'v': if (VERSION.equals(text)) { return VERSION_SID; // depends on control dependency: [if], data = [none] } break; case 'n': if (NAME.equals(text)) { return NAME_SID; // depends on control dependency: [if], data = [none] } break; case 's': if (SYMBOLS.equals(text)) { return SYMBOLS_SID; // depends on control dependency: [if], data = [none] } break; case 'i': if (IMPORTS.equals(text)) { return IMPORTS_SID; // depends on control dependency: [if], data = [none] } break; case 'm': if (MAX_ID.equals(text)) { return MAX_ID_SID; // depends on control dependency: [if], data = [none] } break; default: break; } } return UNKNOWN_SYMBOL_ID; } }
public class class_name { public void add(MultiVertexGeometryImpl src, int beginIndex, int endIndex) { int endIndexC = endIndex < 0 ? src.getPointCount() : endIndex; if (beginIndex < 0 || beginIndex > src.getPointCount() || endIndexC < beginIndex) throw new IllegalArgumentException(); if (beginIndex == endIndexC) return; mergeVertexDescription(src.getDescription()); int count = endIndexC - beginIndex; int oldPointCount = m_pointCount; resize(m_pointCount + count); _verifyAllStreams(); for (int iattrib = 0, nattrib = src.getDescription() .getAttributeCount(); iattrib < nattrib; iattrib++) { int semantics = src.getDescription()._getSemanticsImpl(iattrib); int ncomps = VertexDescription.getComponentCount(semantics); AttributeStreamBase stream = getAttributeStreamRef(semantics); AttributeStreamBase srcStream = src .getAttributeStreamRef(semantics); stream.insertRange(oldPointCount * ncomps, srcStream, beginIndex * ncomps, count * ncomps, true, 1, oldPointCount * ncomps); } } }
public class class_name { public void add(MultiVertexGeometryImpl src, int beginIndex, int endIndex) { int endIndexC = endIndex < 0 ? src.getPointCount() : endIndex; if (beginIndex < 0 || beginIndex > src.getPointCount() || endIndexC < beginIndex) throw new IllegalArgumentException(); if (beginIndex == endIndexC) return; mergeVertexDescription(src.getDescription()); int count = endIndexC - beginIndex; int oldPointCount = m_pointCount; resize(m_pointCount + count); _verifyAllStreams(); for (int iattrib = 0, nattrib = src.getDescription() .getAttributeCount(); iattrib < nattrib; iattrib++) { int semantics = src.getDescription()._getSemanticsImpl(iattrib); int ncomps = VertexDescription.getComponentCount(semantics); AttributeStreamBase stream = getAttributeStreamRef(semantics); AttributeStreamBase srcStream = src .getAttributeStreamRef(semantics); stream.insertRange(oldPointCount * ncomps, srcStream, beginIndex * ncomps, count * ncomps, true, 1, oldPointCount * ncomps); // depends on control dependency: [for], data = [none] } } }
public class class_name { @Beta public static Type getMapping(final String eventType) { if (!containsMappingFor(eventType)) { return null; } else { return systemEventMappings.get(canonicalizeEventType(eventType)); } } }
public class class_name { @Beta public static Type getMapping(final String eventType) { if (!containsMappingFor(eventType)) { return null; // depends on control dependency: [if], data = [none] } else { return systemEventMappings.get(canonicalizeEventType(eventType)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public String[] getEnabledCipherSuites(SSLEngine sslEngine) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "getEnabledCipherSuites"); } String ciphers[] = null; // First check the properties object for the ciphers. Object ciphersObject = this.myConfig.get(Constants.SSLPROP_ENABLED_CIPHERS); if (null == ciphersObject) { // Did not find the enabled ciphers. Need to determine them here. String securityLevel = this.myConfig.getProperty(Constants.SSLPROP_SECURITY_LEVEL); if (null == securityLevel) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Defaulting to HIGH security level"); } securityLevel = Constants.SECURITY_LEVEL_HIGH; } // Found the security level. ciphers = Constants.adjustSupportedCiphersToSecurityLevel( sslEngine.getSupportedCipherSuites(), securityLevel); } else { // Found enabled cipher suites. Now we need to put them in the right kind of object. if (ciphersObject instanceof String) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "enabledCipherSuites is a String: " + ciphersObject); } // Quickly break the string up into an array based on space delimiters. ciphers = ((String) ciphersObject).split("\\s"); } else if (ciphersObject instanceof String[]) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "enabledCipherSuites is a String array"); } ciphers = (String[]) ciphersObject; } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Invalid object for enabledCipherSuites: " + ciphersObject); } } } // check for when we're returning 0 ciphers as the connection will not // work and will be throwing errors later on if (null == ciphers || 0 == ciphers.length) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Unable to find any enabled ciphers"); } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "getEnabledCipherSuites"); } return ciphers; } }
public class class_name { public String[] getEnabledCipherSuites(SSLEngine sslEngine) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "getEnabledCipherSuites"); // depends on control dependency: [if], data = [none] } String ciphers[] = null; // First check the properties object for the ciphers. Object ciphersObject = this.myConfig.get(Constants.SSLPROP_ENABLED_CIPHERS); if (null == ciphersObject) { // Did not find the enabled ciphers. Need to determine them here. String securityLevel = this.myConfig.getProperty(Constants.SSLPROP_SECURITY_LEVEL); if (null == securityLevel) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Defaulting to HIGH security level"); // depends on control dependency: [if], data = [none] } securityLevel = Constants.SECURITY_LEVEL_HIGH; // depends on control dependency: [if], data = [none] } // Found the security level. ciphers = Constants.adjustSupportedCiphersToSecurityLevel( sslEngine.getSupportedCipherSuites(), securityLevel); // depends on control dependency: [if], data = [none] } else { // Found enabled cipher suites. Now we need to put them in the right kind of object. if (ciphersObject instanceof String) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "enabledCipherSuites is a String: " + ciphersObject); // depends on control dependency: [if], data = [none] } // Quickly break the string up into an array based on space delimiters. ciphers = ((String) ciphersObject).split("\\s"); // depends on control dependency: [if], data = [none] } else if (ciphersObject instanceof String[]) { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "enabledCipherSuites is a String array"); // depends on control dependency: [if], data = [none] } ciphers = (String[]) ciphersObject; // depends on control dependency: [if], data = [none] } else { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Invalid object for enabledCipherSuites: " + ciphersObject); // depends on control dependency: [if], data = [none] } } } // check for when we're returning 0 ciphers as the connection will not // work and will be throwing errors later on if (null == ciphers || 0 == ciphers.length) { if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Unable to find any enabled ciphers"); // depends on control dependency: [if], data = [none] } } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "getEnabledCipherSuites"); // depends on control dependency: [if], data = [none] } return ciphers; } }
public class class_name { protected void checkProcessorVersion(Hashtable h) { if (null == h) h = new Hashtable(); try { final String XALAN1_VERSION_CLASS = "org.apache.xalan.xslt.XSLProcessorVersion"; Class clazz = ObjectFactory.findProviderClass( XALAN1_VERSION_CLASS, ObjectFactory.findClassLoader(), true); // Found Xalan-J 1.x, grab it's version fields StringBuffer buf = new StringBuffer(); Field f = clazz.getField("PRODUCT"); buf.append(f.get(null)); buf.append(';'); f = clazz.getField("LANGUAGE"); buf.append(f.get(null)); buf.append(';'); f = clazz.getField("S_VERSION"); buf.append(f.get(null)); buf.append(';'); h.put(VERSION + "xalan1", buf.toString()); } catch (Exception e1) { h.put(VERSION + "xalan1", CLASS_NOTPRESENT); } try { // NOTE: This is the old Xalan 2.0, 2.1, 2.2 version class, // is being replaced by class below final String XALAN2_VERSION_CLASS = "org.apache.xalan.processor.XSLProcessorVersion"; Class clazz = ObjectFactory.findProviderClass( XALAN2_VERSION_CLASS, ObjectFactory.findClassLoader(), true); // Found Xalan-J 2.x, grab it's version fields StringBuffer buf = new StringBuffer(); Field f = clazz.getField("S_VERSION"); buf.append(f.get(null)); h.put(VERSION + "xalan2x", buf.toString()); } catch (Exception e2) { h.put(VERSION + "xalan2x", CLASS_NOTPRESENT); } try { // NOTE: This is the new Xalan 2.2+ version class final String XALAN2_2_VERSION_CLASS = "org.apache.xalan.Version"; final String XALAN2_2_VERSION_METHOD = "getVersion"; final Class noArgs[] = new Class[0]; Class clazz = ObjectFactory.findProviderClass( XALAN2_2_VERSION_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(XALAN2_2_VERSION_METHOD, noArgs); Object returnValue = method.invoke(null, new Object[0]); h.put(VERSION + "xalan2_2", (String)returnValue); } catch (Exception e2) { h.put(VERSION + "xalan2_2", CLASS_NOTPRESENT); } } }
public class class_name { protected void checkProcessorVersion(Hashtable h) { if (null == h) h = new Hashtable(); try { final String XALAN1_VERSION_CLASS = "org.apache.xalan.xslt.XSLProcessorVersion"; Class clazz = ObjectFactory.findProviderClass( XALAN1_VERSION_CLASS, ObjectFactory.findClassLoader(), true); // Found Xalan-J 1.x, grab it's version fields StringBuffer buf = new StringBuffer(); Field f = clazz.getField("PRODUCT"); buf.append(f.get(null)); // depends on control dependency: [try], data = [none] buf.append(';'); // depends on control dependency: [try], data = [none] f = clazz.getField("LANGUAGE"); // depends on control dependency: [try], data = [none] buf.append(f.get(null)); // depends on control dependency: [try], data = [none] buf.append(';'); // depends on control dependency: [try], data = [none] f = clazz.getField("S_VERSION"); // depends on control dependency: [try], data = [none] buf.append(f.get(null)); // depends on control dependency: [try], data = [none] buf.append(';'); // depends on control dependency: [try], data = [none] h.put(VERSION + "xalan1", buf.toString()); // depends on control dependency: [try], data = [none] } catch (Exception e1) { h.put(VERSION + "xalan1", CLASS_NOTPRESENT); } // depends on control dependency: [catch], data = [none] try { // NOTE: This is the old Xalan 2.0, 2.1, 2.2 version class, // is being replaced by class below final String XALAN2_VERSION_CLASS = "org.apache.xalan.processor.XSLProcessorVersion"; Class clazz = ObjectFactory.findProviderClass( XALAN2_VERSION_CLASS, ObjectFactory.findClassLoader(), true); // Found Xalan-J 2.x, grab it's version fields StringBuffer buf = new StringBuffer(); Field f = clazz.getField("S_VERSION"); buf.append(f.get(null)); // depends on control dependency: [try], data = [none] h.put(VERSION + "xalan2x", buf.toString()); // depends on control dependency: [try], data = [none] } catch (Exception e2) { h.put(VERSION + "xalan2x", CLASS_NOTPRESENT); } // depends on control dependency: [catch], data = [none] try { // NOTE: This is the new Xalan 2.2+ version class final String XALAN2_2_VERSION_CLASS = "org.apache.xalan.Version"; final String XALAN2_2_VERSION_METHOD = "getVersion"; final Class noArgs[] = new Class[0]; Class clazz = ObjectFactory.findProviderClass( XALAN2_2_VERSION_CLASS, ObjectFactory.findClassLoader(), true); Method method = clazz.getMethod(XALAN2_2_VERSION_METHOD, noArgs); Object returnValue = method.invoke(null, new Object[0]); h.put(VERSION + "xalan2_2", (String)returnValue); } catch (Exception e2) { h.put(VERSION + "xalan2_2", CLASS_NOTPRESENT); } } }
public class class_name { public Object getDataElements(int rgb, Object pixel) { int alpha = (rgb>>>24); int pix; if (alpha < ALPHA_THRESHOLD && getTransparentPixel() != -1) { pix = getTransparentPixel(); } else { int color = rgb & RGB_MASK; if (color == WHITE && whiteIndex != -1) { pix = whiteIndex; } else { pix = inverseMap.getIndexNearest(color); } } return installpixel(pixel, pix); } }
public class class_name { public Object getDataElements(int rgb, Object pixel) { int alpha = (rgb>>>24); int pix; if (alpha < ALPHA_THRESHOLD && getTransparentPixel() != -1) { pix = getTransparentPixel(); // depends on control dependency: [if], data = [none] } else { int color = rgb & RGB_MASK; if (color == WHITE && whiteIndex != -1) { pix = whiteIndex; // depends on control dependency: [if], data = [none] } else { pix = inverseMap.getIndexNearest(color); // depends on control dependency: [if], data = [(color] } } return installpixel(pixel, pix); } }
public class class_name { @Override public void cacheResult(List<CommerceOrderItem> commerceOrderItems) { for (CommerceOrderItem commerceOrderItem : commerceOrderItems) { if (entityCache.getResult( CommerceOrderItemModelImpl.ENTITY_CACHE_ENABLED, CommerceOrderItemImpl.class, commerceOrderItem.getPrimaryKey()) == null) { cacheResult(commerceOrderItem); } else { commerceOrderItem.resetOriginalValues(); } } } }
public class class_name { @Override public void cacheResult(List<CommerceOrderItem> commerceOrderItems) { for (CommerceOrderItem commerceOrderItem : commerceOrderItems) { if (entityCache.getResult( CommerceOrderItemModelImpl.ENTITY_CACHE_ENABLED, CommerceOrderItemImpl.class, commerceOrderItem.getPrimaryKey()) == null) { cacheResult(commerceOrderItem); // depends on control dependency: [if], data = [none] } else { commerceOrderItem.resetOriginalValues(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private boolean checkAvailable(){ int i = 0; try{ i = this.in.available(); if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Current amount immediately available in buffers : " + i); } } catch (Exception e){ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "There was an IOException during the checkAvailable method : " + e); } } return ((i > 0) ? true : false); } }
public class class_name { private boolean checkAvailable(){ int i = 0; try{ i = this.in.available(); // depends on control dependency: [try], data = [none] if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "Current amount immediately available in buffers : " + i); // depends on control dependency: [if], data = [none] } } catch (Exception e){ if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { Tr.debug(tc, "There was an IOException during the checkAvailable method : " + e); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] return ((i > 0) ? true : false); } }
public class class_name { private static void sendResponse(PrintWriter out, SmtpResponse smtpResponse) { if (smtpResponse.getCode() > 0) { int code = smtpResponse.getCode(); String message = smtpResponse.getMessage(); out.print(code + " " + message + "\r\n"); out.flush(); } } }
public class class_name { private static void sendResponse(PrintWriter out, SmtpResponse smtpResponse) { if (smtpResponse.getCode() > 0) { int code = smtpResponse.getCode(); String message = smtpResponse.getMessage(); out.print(code + " " + message + "\r\n"); // depends on control dependency: [if], data = [none] out.flush(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static SecureRandom getSecure() { SecureRandom random = THREAD_LOCAL_SECURE_RANDOM.get(); if (random == null) { random = new SecureRandom(); THREAD_LOCAL_SECURE_RANDOM.set(random); } return random; } }
public class class_name { public static SecureRandom getSecure() { SecureRandom random = THREAD_LOCAL_SECURE_RANDOM.get(); if (random == null) { random = new SecureRandom(); // depends on control dependency: [if], data = [none] THREAD_LOCAL_SECURE_RANDOM.set(random); // depends on control dependency: [if], data = [(random] } return random; } }
public class class_name { public Classifier<String, String> loadFromFilename(String file) { try { File tgtFile = new File(file); BufferedReader in = new BufferedReader(new FileReader(tgtFile)); // Format: read indicies first, weights, then thresholds Index<String> labelIndex = HashIndex.loadFromReader(in); Index<String> featureIndex = HashIndex.loadFromReader(in); double[][] weights = new double[featureIndex.size()][labelIndex.size()]; String line = in.readLine(); int currLine = 1; while (line != null && line.length()>0) { String[] tuples = line.split(LinearClassifier.TEXT_SERIALIZATION_DELIMITER); if (tuples.length != 3) { throw new Exception("Error: incorrect number of tokens in weight specifier, line=" +currLine+" in file "+tgtFile.getAbsolutePath()); } currLine++; int feature = Integer.valueOf(tuples[0]); int label = Integer.valueOf(tuples[1]); double value = Double.valueOf(tuples[2]); weights[feature][label] = value; line = in.readLine(); } // First line in thresholds is the number of thresholds int numThresholds = Integer.valueOf(in.readLine()); double[] thresholds = new double[numThresholds]; int curr = 0; while ((line = in.readLine()) != null) { double tval = Double.valueOf(line.trim()); thresholds[curr++] = tval; } in.close(); LinearClassifier<String, String> classifier = new LinearClassifier<String, String>(weights, featureIndex, labelIndex); return classifier; } catch (Exception e) { System.err.println("Error in LinearClassifierFactory, loading from file="+file); e.printStackTrace(); return null; } } }
public class class_name { public Classifier<String, String> loadFromFilename(String file) { try { File tgtFile = new File(file); BufferedReader in = new BufferedReader(new FileReader(tgtFile)); // Format: read indicies first, weights, then thresholds Index<String> labelIndex = HashIndex.loadFromReader(in); Index<String> featureIndex = HashIndex.loadFromReader(in); double[][] weights = new double[featureIndex.size()][labelIndex.size()]; String line = in.readLine(); int currLine = 1; while (line != null && line.length()>0) { String[] tuples = line.split(LinearClassifier.TEXT_SERIALIZATION_DELIMITER); if (tuples.length != 3) { throw new Exception("Error: incorrect number of tokens in weight specifier, line=" +currLine+" in file "+tgtFile.getAbsolutePath()); } currLine++; // depends on control dependency: [while], data = [none] int feature = Integer.valueOf(tuples[0]); int label = Integer.valueOf(tuples[1]); double value = Double.valueOf(tuples[2]); weights[feature][label] = value; // depends on control dependency: [while], data = [none] line = in.readLine(); // depends on control dependency: [while], data = [none] } // First line in thresholds is the number of thresholds int numThresholds = Integer.valueOf(in.readLine()); double[] thresholds = new double[numThresholds]; int curr = 0; while ((line = in.readLine()) != null) { double tval = Double.valueOf(line.trim()); thresholds[curr++] = tval; // depends on control dependency: [while], data = [none] } in.close(); // depends on control dependency: [try], data = [none] LinearClassifier<String, String> classifier = new LinearClassifier<String, String>(weights, featureIndex, labelIndex); return classifier; // depends on control dependency: [try], data = [none] } catch (Exception e) { System.err.println("Error in LinearClassifierFactory, loading from file="+file); e.printStackTrace(); return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public List<Entity> getAllChildrenRecursive() { List<Entity> result = newArrayList(); if (isRoot()) { allChildrenRecursive(this, result); } return result; } }
public class class_name { public List<Entity> getAllChildrenRecursive() { List<Entity> result = newArrayList(); if (isRoot()) { allChildrenRecursive(this, result); // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { public static void validateAroundSignature(InterceptorMethodKind kind, Method m, J2EEName name) throws EJBConfigurationException { // Get the modifers for the interceptor method and verify that the // method is neither final nor static as required by EJB specification. int mod = m.getModifiers(); if (Modifier.isFinal(mod) || Modifier.isStatic(mod)) { // CNTR0229E: The {0} interceptor method must not be declared as final or static. String method = m.toGenericString(); Tr.error(tc, "INVALID_INTERCEPTOR_METHOD_MODIFIER_CNTR0229E", new Object[] { method }); throw new EJBConfigurationException(kind.getXMLElementName() + " interceptor \"" + method + "\" must not be declared as final or static."); } // Verify AroundInvoke has 1 parameter of type InvocationContext. Class<?>[] parmTypes = m.getParameterTypes(); if ((parmTypes.length == 1) && (parmTypes[0].equals(InvocationContext.class))) { // Has correct signature of 1 parameter of type InvocationContext } else { String method = m.toGenericString(); Tr.error(tc, "INVALID_AROUND_INVOKE_SIGNATURE_CNTR0230E", new Object[] { method, kind.getXMLElementName() }); // F743-17763.1 throw new EJBConfigurationException(kind.getXMLElementName() + " interceptor \"" + method + "\" must have a single parameter of type javax.interceptors.InvocationContext."); } // Verify return type. Class<?> returnType = m.getReturnType(); // F743-17763.1 - The spec requires that around interceptor methods have // exactly Object as the return type. The original AroundInvoke check // was not as strict, but we keep it for compatibility with previous // releases. if (returnType != Object.class) { boolean compatiblyValid = kind == InterceptorMethodKind.AROUND_INVOKE && Object.class.isAssignableFrom(returnType); // d668039 if (!compatiblyValid || isValidationLoggable()) { String method = m.toGenericString(); Tr.error(tc, "INVALID_AROUND_INVOKE_SIGNATURE_CNTR0230E", new Object[] { method, kind.getXMLElementName() }); // F743-17763.1 if (!compatiblyValid || isValidationFailable()) // d668039 { throw new EJBConfigurationException(kind.getXMLElementName() + " interceptor \"" + method + "\" must have a return value of type java.lang.Object."); } } } // Per the EJB 3.2 spec, "Note: An around-invoke interceptor method may // be declared to throw any checked exceptions that the associated // target method allows within its throws clause. It may be declared to // throw the java.lang.Exception if it interposes on several methods // that can throw unrelated checked exceptions." } }
public class class_name { public static void validateAroundSignature(InterceptorMethodKind kind, Method m, J2EEName name) throws EJBConfigurationException { // Get the modifers for the interceptor method and verify that the // method is neither final nor static as required by EJB specification. int mod = m.getModifiers(); if (Modifier.isFinal(mod) || Modifier.isStatic(mod)) { // CNTR0229E: The {0} interceptor method must not be declared as final or static. String method = m.toGenericString(); Tr.error(tc, "INVALID_INTERCEPTOR_METHOD_MODIFIER_CNTR0229E", new Object[] { method }); throw new EJBConfigurationException(kind.getXMLElementName() + " interceptor \"" + method + "\" must not be declared as final or static."); } // Verify AroundInvoke has 1 parameter of type InvocationContext. Class<?>[] parmTypes = m.getParameterTypes(); if ((parmTypes.length == 1) && (parmTypes[0].equals(InvocationContext.class))) { // Has correct signature of 1 parameter of type InvocationContext } else { String method = m.toGenericString(); Tr.error(tc, "INVALID_AROUND_INVOKE_SIGNATURE_CNTR0230E", new Object[] { method, kind.getXMLElementName() }); // F743-17763.1 throw new EJBConfigurationException(kind.getXMLElementName() + " interceptor \"" + method + "\" must have a single parameter of type javax.interceptors.InvocationContext."); } // Verify return type. Class<?> returnType = m.getReturnType(); // F743-17763.1 - The spec requires that around interceptor methods have // exactly Object as the return type. The original AroundInvoke check // was not as strict, but we keep it for compatibility with previous // releases. if (returnType != Object.class) { boolean compatiblyValid = kind == InterceptorMethodKind.AROUND_INVOKE && Object.class.isAssignableFrom(returnType); // d668039 if (!compatiblyValid || isValidationLoggable()) { String method = m.toGenericString(); Tr.error(tc, "INVALID_AROUND_INVOKE_SIGNATURE_CNTR0230E", new Object[] { method, kind.getXMLElementName() }); // F743-17763.1 if (!compatiblyValid || isValidationFailable()) // d668039 { throw new EJBConfigurationException(kind.getXMLElementName() + " interceptor \"" + method + "\" must have a return value of type java.lang.Object."); // depends on control dependency: [if], data = [none] } } } // Per the EJB 3.2 spec, "Note: An around-invoke interceptor method may // be declared to throw any checked exceptions that the associated // target method allows within its throws clause. It may be declared to // throw the java.lang.Exception if it interposes on several methods // that can throw unrelated checked exceptions." } }
public class class_name { public Object evaluate() { if( !isCompileTimeConstant() ) { return super.evaluate(); } Object lhsValue = getLHS().evaluate(); if( lhsValue == null ) { return null; } Object rhsValue = getRHS().evaluate(); if( rhsValue == null ) { return null; } IType type = getType(); if( getOperator().equals( "<<" ) ) { if( type == JavaTypes.pINT() ) { return CommonServices.getCoercionManager().makeIntegerFrom( lhsValue ) << CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ); } if( type == JavaTypes.pLONG() ) { return makeLong( CommonServices.getCoercionManager().makeLongFrom( lhsValue ) << CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ) ); } throw new UnsupportedNumberTypeException(type); } if( getOperator().equals( ">>" ) ) { if( type == JavaTypes.pINT() ) { return CommonServices.getCoercionManager().makeIntegerFrom( lhsValue ) >> CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ); } if( type == JavaTypes.pLONG() ) { return makeLong( CommonServices.getCoercionManager().makeLongFrom( lhsValue ) >> CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ) ); } throw new UnsupportedNumberTypeException(type); } if( getOperator().equals( ">>>" ) ) { if( type == JavaTypes.pINT() ) { return CommonServices.getCoercionManager().makeIntegerFrom( lhsValue ) >>> CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ); } if( type == JavaTypes.pLONG() ) { return makeLong( CommonServices.getCoercionManager().makeLongFrom( lhsValue ) >>> CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ) ); } throw new UnsupportedNumberTypeException(type); } throw new UnsupportedNumberTypeException(type); } }
public class class_name { public Object evaluate() { if( !isCompileTimeConstant() ) { return super.evaluate(); // depends on control dependency: [if], data = [none] } Object lhsValue = getLHS().evaluate(); if( lhsValue == null ) { return null; // depends on control dependency: [if], data = [none] } Object rhsValue = getRHS().evaluate(); if( rhsValue == null ) { return null; // depends on control dependency: [if], data = [none] } IType type = getType(); if( getOperator().equals( "<<" ) ) { if( type == JavaTypes.pINT() ) { return CommonServices.getCoercionManager().makeIntegerFrom( lhsValue ) << CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ); // depends on control dependency: [if], data = [none] } if( type == JavaTypes.pLONG() ) { return makeLong( CommonServices.getCoercionManager().makeLongFrom( lhsValue ) << CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } throw new UnsupportedNumberTypeException(type); } if( getOperator().equals( ">>" ) ) { if( type == JavaTypes.pINT() ) { return CommonServices.getCoercionManager().makeIntegerFrom( lhsValue ) >> CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ); // depends on control dependency: [if], data = [none] } if( type == JavaTypes.pLONG() ) { return makeLong( CommonServices.getCoercionManager().makeLongFrom( lhsValue ) >> CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } throw new UnsupportedNumberTypeException(type); } if( getOperator().equals( ">>>" ) ) { if( type == JavaTypes.pINT() ) { return CommonServices.getCoercionManager().makeIntegerFrom( lhsValue ) >>> CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ); // depends on control dependency: [if], data = [none] } if( type == JavaTypes.pLONG() ) { return makeLong( CommonServices.getCoercionManager().makeLongFrom( lhsValue ) >>> CommonServices.getCoercionManager().makeIntegerFrom( rhsValue ) ); // depends on control dependency: [if], data = [none] } throw new UnsupportedNumberTypeException(type); } throw new UnsupportedNumberTypeException(type); } }
public class class_name { public static final Promise race(Promise... promises) { if (promises == null || promises.length == 0) { return Promise.resolve(); } @SuppressWarnings("unchecked") CompletableFuture<Tree>[] futures = new CompletableFuture[promises.length]; for (int i = 0; i < promises.length; i++) { futures[i] = promises[i].future; } CompletableFuture<Object> any = CompletableFuture.anyOf(futures); return new Promise(r -> { any.whenComplete((object, error) -> { try { if (error != null) { r.reject(error); return; } r.resolve((Tree) object); } catch (Throwable cause) { r.reject(cause); } }); }); } }
public class class_name { public static final Promise race(Promise... promises) { if (promises == null || promises.length == 0) { return Promise.resolve(); // depends on control dependency: [if], data = [none] } @SuppressWarnings("unchecked") CompletableFuture<Tree>[] futures = new CompletableFuture[promises.length]; for (int i = 0; i < promises.length; i++) { futures[i] = promises[i].future; // depends on control dependency: [for], data = [i] } CompletableFuture<Object> any = CompletableFuture.anyOf(futures); return new Promise(r -> { any.whenComplete((object, error) -> { try { if (error != null) { r.reject(error); return; } r.resolve((Tree) object); } catch (Throwable cause) { r.reject(cause); } }); }); } }
public class class_name { public EncodedElement addInt(int input, int bitCount) { if(next != null) { EncodedElement end = EncodedElement.getEnd_S(next); return end.addInt(input, bitCount); } else if(data.length*8 < usableBits+bitCount) { //create child and attach to next. //Set child's offset appropriately(i.e, manually set usable bits) int tOff = usableBits %8; //int size = data.length/2+1; int size = 1000; //guarantee that our new element can store our given value //if(size <= bitCount+tOff) size = (size+tOff+bitCount)*10; next = new EncodedElement(size, tOff); System.err.println("creating next node of size:bitCount "+size+ ":"+bitCount+":"+usableBits+":"+data.length); System.err.println("value: "+input); //+this.toString()+"::"+next.toString()); //add int to child return next.addInt(input, bitCount); } else { //At this point, we have the space, and we are the end of the chain. int startPos = this.usableBits; byte[] dest = this.data; EncodedElement.addInt_new(input, bitCount, startPos, dest); //EncodedElement.addInt_buf2(input, bitCount, startPos, dest); /*if(startPos/8+8 > dest.length) EncodedElement.addInt(input, bitCount, startPos, dest); else EncodedElement.addInt_new(input, bitCount, startPos, dest);*/ usableBits += bitCount; return this; } } }
public class class_name { public EncodedElement addInt(int input, int bitCount) { if(next != null) { EncodedElement end = EncodedElement.getEnd_S(next); return end.addInt(input, bitCount); // depends on control dependency: [if], data = [none] } else if(data.length*8 < usableBits+bitCount) { //create child and attach to next. //Set child's offset appropriately(i.e, manually set usable bits) int tOff = usableBits %8; //int size = data.length/2+1; int size = 1000; //guarantee that our new element can store our given value //if(size <= bitCount+tOff) size = (size+tOff+bitCount)*10; next = new EncodedElement(size, tOff); // depends on control dependency: [if], data = [none] System.err.println("creating next node of size:bitCount "+size+ ":"+bitCount+":"+usableBits+":"+data.length); // depends on control dependency: [if], data = [none] System.err.println("value: "+input); // depends on control dependency: [if], data = [none] //+this.toString()+"::"+next.toString()); //add int to child return next.addInt(input, bitCount); // depends on control dependency: [if], data = [none] } else { //At this point, we have the space, and we are the end of the chain. int startPos = this.usableBits; byte[] dest = this.data; EncodedElement.addInt_new(input, bitCount, startPos, dest); // depends on control dependency: [if], data = [none] //EncodedElement.addInt_buf2(input, bitCount, startPos, dest); /*if(startPos/8+8 > dest.length) EncodedElement.addInt(input, bitCount, startPos, dest); else EncodedElement.addInt_new(input, bitCount, startPos, dest);*/ usableBits += bitCount; // depends on control dependency: [if], data = [none] return this; // depends on control dependency: [if], data = [none] } } }
public class class_name { protected void processAssignment(Row row) { Resource resource = m_project.getResourceByUniqueID(row.getInteger("RES_UID")); Task task = m_project.getTaskByUniqueID(row.getInteger("TASK_UID")); if (task != null) { ResourceAssignment assignment = task.addResourceAssignment(resource); m_assignmentMap.put(row.getInteger("ASSN_UID"), assignment); assignment.setActualCost(row.getCurrency("ASSN_ACT_COST")); assignment.setActualFinish(row.getDate("ASSN_ACT_FINISH")); assignment.setActualOvertimeCost(row.getCurrency("ASSN_ACT_OVT_COST")); assignment.setActualOvertimeWork(row.getDuration("ASSN_ACT_OVT_WORK")); assignment.setActualStart(row.getDate("ASSN_ACT_START")); assignment.setActualWork(row.getDuration("ASSN_ACT_WORK")); assignment.setACWP(row.getCurrency("ASSN_ACWP")); assignment.setBaselineCost(row.getCurrency("ASSN_BASE_COST")); assignment.setBaselineFinish(row.getDate("ASSN_BASE_FINISH")); assignment.setBaselineStart(row.getDate("ASSN_BASE_START")); assignment.setBaselineWork(row.getDuration("ASSN_BASE_WORK")); assignment.setBCWP(row.getCurrency("ASSN_BCWP")); assignment.setBCWS(row.getCurrency("ASSN_BCWS")); assignment.setCost(row.getCurrency("ASSN_COST")); assignment.setCostRateTableIndex(row.getInt("ASSN_COST_RATE_TABLE")); //assignment.setCostVariance(); //assignment.setCreateDate(row.getDate("ASSN_CREATION_DATE")); - not present in some MPD files? //assignment.setCV(); assignment.setDelay(row.getDuration("ASSN_DELAY")); assignment.setFinish(row.getDate("ASSN_FINISH_DATE")); assignment.setFinishVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("ASSN_FINISH_VAR"), TimeUnit.DAYS)); //assignment.setGUID(); assignment.setLevelingDelay(MPDUtility.getAdjustedDuration(m_project, row.getInt("ASSN_LEVELING_DELAY"), MPDUtility.getDurationTimeUnits(row.getInt("ASSN_DELAY_FMT")))); assignment.setLinkedFields(row.getBoolean("ASSN_HAS_LINKED_FIELDS")); //assignment.setOvertimeCost(); assignment.setOvertimeWork(row.getDuration("ASSN_OVT_WORK")); //assignment.setPercentageWorkComplete(); assignment.setRemainingCost(row.getCurrency("ASSN_REM_COST")); assignment.setRemainingOvertimeCost(row.getCurrency("ASSN_REM_OVT_COST")); assignment.setRemainingOvertimeWork(row.getDuration("ASSN_REM_OVT_WORK")); assignment.setRegularWork(row.getDuration("ASSN_REG_WORK")); assignment.setRemainingWork(row.getDuration("ASSN_REM_WORK")); assignment.setResponsePending(row.getBoolean("ASSN_RESPONSE_PENDING")); assignment.setStart(row.getDate("ASSN_START_DATE")); assignment.setStartVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("ASSN_START_VAR"), TimeUnit.DAYS)); //assignment.setSV(); assignment.setTeamStatusPending(row.getBoolean("ASSN_TEAM_STATUS_PENDING")); assignment.setUniqueID(row.getInteger("ASSN_UID")); assignment.setUnits(Double.valueOf(row.getDouble("ASSN_UNITS").doubleValue() * 100.0d)); assignment.setUpdateNeeded(row.getBoolean("ASSN_UPDATE_NEEDED")); //assignment.setVAC(v); assignment.setWork(row.getDuration("ASSN_WORK")); assignment.setWorkContour(WorkContour.getInstance(row.getInt("ASSN_WORK_CONTOUR"))); //assignment.setWorkVariance(); String notes = row.getString("ASSN_RTF_NOTES"); if (notes != null) { if (m_preserveNoteFormatting == false) { notes = RtfHelper.strip(notes); } assignment.setNotes(notes); } m_eventManager.fireAssignmentReadEvent(assignment); } } }
public class class_name { protected void processAssignment(Row row) { Resource resource = m_project.getResourceByUniqueID(row.getInteger("RES_UID")); Task task = m_project.getTaskByUniqueID(row.getInteger("TASK_UID")); if (task != null) { ResourceAssignment assignment = task.addResourceAssignment(resource); m_assignmentMap.put(row.getInteger("ASSN_UID"), assignment); // depends on control dependency: [if], data = [none] assignment.setActualCost(row.getCurrency("ASSN_ACT_COST")); // depends on control dependency: [if], data = [none] assignment.setActualFinish(row.getDate("ASSN_ACT_FINISH")); // depends on control dependency: [if], data = [none] assignment.setActualOvertimeCost(row.getCurrency("ASSN_ACT_OVT_COST")); // depends on control dependency: [if], data = [none] assignment.setActualOvertimeWork(row.getDuration("ASSN_ACT_OVT_WORK")); // depends on control dependency: [if], data = [none] assignment.setActualStart(row.getDate("ASSN_ACT_START")); // depends on control dependency: [if], data = [none] assignment.setActualWork(row.getDuration("ASSN_ACT_WORK")); // depends on control dependency: [if], data = [none] assignment.setACWP(row.getCurrency("ASSN_ACWP")); // depends on control dependency: [if], data = [none] assignment.setBaselineCost(row.getCurrency("ASSN_BASE_COST")); // depends on control dependency: [if], data = [none] assignment.setBaselineFinish(row.getDate("ASSN_BASE_FINISH")); // depends on control dependency: [if], data = [none] assignment.setBaselineStart(row.getDate("ASSN_BASE_START")); // depends on control dependency: [if], data = [none] assignment.setBaselineWork(row.getDuration("ASSN_BASE_WORK")); // depends on control dependency: [if], data = [none] assignment.setBCWP(row.getCurrency("ASSN_BCWP")); // depends on control dependency: [if], data = [none] assignment.setBCWS(row.getCurrency("ASSN_BCWS")); // depends on control dependency: [if], data = [none] assignment.setCost(row.getCurrency("ASSN_COST")); // depends on control dependency: [if], data = [none] assignment.setCostRateTableIndex(row.getInt("ASSN_COST_RATE_TABLE")); // depends on control dependency: [if], data = [none] //assignment.setCostVariance(); //assignment.setCreateDate(row.getDate("ASSN_CREATION_DATE")); - not present in some MPD files? //assignment.setCV(); assignment.setDelay(row.getDuration("ASSN_DELAY")); // depends on control dependency: [if], data = [none] assignment.setFinish(row.getDate("ASSN_FINISH_DATE")); // depends on control dependency: [if], data = [none] assignment.setFinishVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("ASSN_FINISH_VAR"), TimeUnit.DAYS)); // depends on control dependency: [if], data = [none] //assignment.setGUID(); assignment.setLevelingDelay(MPDUtility.getAdjustedDuration(m_project, row.getInt("ASSN_LEVELING_DELAY"), MPDUtility.getDurationTimeUnits(row.getInt("ASSN_DELAY_FMT")))); // depends on control dependency: [if], data = [none] assignment.setLinkedFields(row.getBoolean("ASSN_HAS_LINKED_FIELDS")); // depends on control dependency: [if], data = [none] //assignment.setOvertimeCost(); assignment.setOvertimeWork(row.getDuration("ASSN_OVT_WORK")); // depends on control dependency: [if], data = [none] //assignment.setPercentageWorkComplete(); assignment.setRemainingCost(row.getCurrency("ASSN_REM_COST")); // depends on control dependency: [if], data = [none] assignment.setRemainingOvertimeCost(row.getCurrency("ASSN_REM_OVT_COST")); // depends on control dependency: [if], data = [none] assignment.setRemainingOvertimeWork(row.getDuration("ASSN_REM_OVT_WORK")); // depends on control dependency: [if], data = [none] assignment.setRegularWork(row.getDuration("ASSN_REG_WORK")); // depends on control dependency: [if], data = [none] assignment.setRemainingWork(row.getDuration("ASSN_REM_WORK")); // depends on control dependency: [if], data = [none] assignment.setResponsePending(row.getBoolean("ASSN_RESPONSE_PENDING")); // depends on control dependency: [if], data = [none] assignment.setStart(row.getDate("ASSN_START_DATE")); // depends on control dependency: [if], data = [none] assignment.setStartVariance(MPDUtility.getAdjustedDuration(m_project, row.getInt("ASSN_START_VAR"), TimeUnit.DAYS)); // depends on control dependency: [if], data = [none] //assignment.setSV(); assignment.setTeamStatusPending(row.getBoolean("ASSN_TEAM_STATUS_PENDING")); // depends on control dependency: [if], data = [none] assignment.setUniqueID(row.getInteger("ASSN_UID")); // depends on control dependency: [if], data = [none] assignment.setUnits(Double.valueOf(row.getDouble("ASSN_UNITS").doubleValue() * 100.0d)); // depends on control dependency: [if], data = [none] assignment.setUpdateNeeded(row.getBoolean("ASSN_UPDATE_NEEDED")); // depends on control dependency: [if], data = [none] //assignment.setVAC(v); assignment.setWork(row.getDuration("ASSN_WORK")); // depends on control dependency: [if], data = [none] assignment.setWorkContour(WorkContour.getInstance(row.getInt("ASSN_WORK_CONTOUR"))); // depends on control dependency: [if], data = [none] //assignment.setWorkVariance(); String notes = row.getString("ASSN_RTF_NOTES"); if (notes != null) { if (m_preserveNoteFormatting == false) { notes = RtfHelper.strip(notes); // depends on control dependency: [if], data = [none] } assignment.setNotes(notes); // depends on control dependency: [if], data = [(notes] } m_eventManager.fireAssignmentReadEvent(assignment); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(ResourceShareAssociation resourceShareAssociation, ProtocolMarshaller protocolMarshaller) { if (resourceShareAssociation == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(resourceShareAssociation.getResourceShareArn(), RESOURCESHAREARN_BINDING); protocolMarshaller.marshall(resourceShareAssociation.getAssociatedEntity(), ASSOCIATEDENTITY_BINDING); protocolMarshaller.marshall(resourceShareAssociation.getAssociationType(), ASSOCIATIONTYPE_BINDING); protocolMarshaller.marshall(resourceShareAssociation.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(resourceShareAssociation.getStatusMessage(), STATUSMESSAGE_BINDING); protocolMarshaller.marshall(resourceShareAssociation.getCreationTime(), CREATIONTIME_BINDING); protocolMarshaller.marshall(resourceShareAssociation.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING); protocolMarshaller.marshall(resourceShareAssociation.getExternal(), EXTERNAL_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ResourceShareAssociation resourceShareAssociation, ProtocolMarshaller protocolMarshaller) { if (resourceShareAssociation == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(resourceShareAssociation.getResourceShareArn(), RESOURCESHAREARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(resourceShareAssociation.getAssociatedEntity(), ASSOCIATEDENTITY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(resourceShareAssociation.getAssociationType(), ASSOCIATIONTYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(resourceShareAssociation.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(resourceShareAssociation.getStatusMessage(), STATUSMESSAGE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(resourceShareAssociation.getCreationTime(), CREATIONTIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(resourceShareAssociation.getLastUpdatedTime(), LASTUPDATEDTIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(resourceShareAssociation.getExternal(), EXTERNAL_BINDING); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Nullable public List<Point> calculateRemainingWaypoints(RouteProgress routeProgress) { if (routeProgress.directionsRoute().routeOptions() == null) { return null; } List<Point> coordinates = new ArrayList<>(routeProgress.directionsRoute().routeOptions().coordinates()); int coordinatesSize = coordinates.size(); int remainingWaypoints = routeProgress.remainingWaypoints(); if (coordinatesSize < remainingWaypoints) { return null; } List<Point> remainingCoordinates = coordinates.subList(coordinatesSize - remainingWaypoints, coordinatesSize); return remainingCoordinates; } }
public class class_name { @Nullable public List<Point> calculateRemainingWaypoints(RouteProgress routeProgress) { if (routeProgress.directionsRoute().routeOptions() == null) { return null; // depends on control dependency: [if], data = [none] } List<Point> coordinates = new ArrayList<>(routeProgress.directionsRoute().routeOptions().coordinates()); int coordinatesSize = coordinates.size(); int remainingWaypoints = routeProgress.remainingWaypoints(); if (coordinatesSize < remainingWaypoints) { return null; // depends on control dependency: [if], data = [none] } List<Point> remainingCoordinates = coordinates.subList(coordinatesSize - remainingWaypoints, coordinatesSize); return remainingCoordinates; } }
public class class_name { public GetMetricDataRequest withHistoricalMetrics(HistoricalMetric... historicalMetrics) { if (this.historicalMetrics == null) { setHistoricalMetrics(new java.util.ArrayList<HistoricalMetric>(historicalMetrics.length)); } for (HistoricalMetric ele : historicalMetrics) { this.historicalMetrics.add(ele); } return this; } }
public class class_name { public GetMetricDataRequest withHistoricalMetrics(HistoricalMetric... historicalMetrics) { if (this.historicalMetrics == null) { setHistoricalMetrics(new java.util.ArrayList<HistoricalMetric>(historicalMetrics.length)); // depends on control dependency: [if], data = [none] } for (HistoricalMetric ele : historicalMetrics) { this.historicalMetrics.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public List<ITopicNode> getTopicNodesForTopicID(final Integer topicId) { if (topics.containsKey(topicId)) { return topics.get(topicId); } return new LinkedList<ITopicNode>(); } }
public class class_name { public List<ITopicNode> getTopicNodesForTopicID(final Integer topicId) { if (topics.containsKey(topicId)) { return topics.get(topicId); // depends on control dependency: [if], data = [none] } return new LinkedList<ITopicNode>(); } }
public class class_name { public DescribeMaintenanceWindowExecutionTaskInvocationsResult withWindowExecutionTaskInvocationIdentities( MaintenanceWindowExecutionTaskInvocationIdentity... windowExecutionTaskInvocationIdentities) { if (this.windowExecutionTaskInvocationIdentities == null) { setWindowExecutionTaskInvocationIdentities(new com.amazonaws.internal.SdkInternalList<MaintenanceWindowExecutionTaskInvocationIdentity>( windowExecutionTaskInvocationIdentities.length)); } for (MaintenanceWindowExecutionTaskInvocationIdentity ele : windowExecutionTaskInvocationIdentities) { this.windowExecutionTaskInvocationIdentities.add(ele); } return this; } }
public class class_name { public DescribeMaintenanceWindowExecutionTaskInvocationsResult withWindowExecutionTaskInvocationIdentities( MaintenanceWindowExecutionTaskInvocationIdentity... windowExecutionTaskInvocationIdentities) { if (this.windowExecutionTaskInvocationIdentities == null) { setWindowExecutionTaskInvocationIdentities(new com.amazonaws.internal.SdkInternalList<MaintenanceWindowExecutionTaskInvocationIdentity>( windowExecutionTaskInvocationIdentities.length)); // depends on control dependency: [if], data = [none] } for (MaintenanceWindowExecutionTaskInvocationIdentity ele : windowExecutionTaskInvocationIdentities) { this.windowExecutionTaskInvocationIdentities.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public InputStream locate(final String uri) throws IOException { Validate.notNull(uri, "URI cannot be NULL!"); // replace prefix & clean path by removing '..' characters if exists and // normalizing the location to use. String location = StringUtils.cleanPath(uri.replaceFirst(PREFIX, "")).trim(); if (getWildcardStreamLocator().hasWildcard(location)) { try { return locateWildcardStream(uri, location); } catch (final IOException e) { if (location.contains("?")) { location = DefaultWildcardStreamLocator.stripQueryPath(location); LOG.debug("Trying fallback location: {}", location); } } } final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(location); if (is == null) { throw new IOException("Couldn't get InputStream from this resource: " + uri); } return is; } }
public class class_name { public InputStream locate(final String uri) throws IOException { Validate.notNull(uri, "URI cannot be NULL!"); // replace prefix & clean path by removing '..' characters if exists and // normalizing the location to use. String location = StringUtils.cleanPath(uri.replaceFirst(PREFIX, "")).trim(); if (getWildcardStreamLocator().hasWildcard(location)) { try { return locateWildcardStream(uri, location); // depends on control dependency: [try], data = [none] } catch (final IOException e) { if (location.contains("?")) { location = DefaultWildcardStreamLocator.stripQueryPath(location); // depends on control dependency: [if], data = [none] LOG.debug("Trying fallback location: {}", location); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } final InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream(location); if (is == null) { throw new IOException("Couldn't get InputStream from this resource: " + uri); } return is; } }
public class class_name { public List<org.openprovenance.prov.model.Location> getLocation() { if (location == null) { location=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Location.class); } return this.location; } }
public class class_name { public List<org.openprovenance.prov.model.Location> getLocation() { if (location == null) { location=AttributeList.populateKnownAttributes(this,all, org.openprovenance.prov.model.Location.class); // depends on control dependency: [if], data = [none] } return this.location; } }
public class class_name { private void checkReferenceForeignkeys(ModelDef modelDef, String checkLevel) throws ConstraintException { if (CHECKLEVEL_NONE.equals(checkLevel)) { return; } ClassDescriptorDef classDef; ReferenceDescriptorDef refDef; for (Iterator it = modelDef.getClasses(); it.hasNext();) { classDef = (ClassDescriptorDef)it.next(); for (Iterator refIt = classDef.getReferences(); refIt.hasNext();) { refDef = (ReferenceDescriptorDef)refIt.next(); if (!refDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false)) { checkReferenceForeignkeys(modelDef, refDef); } } } } }
public class class_name { private void checkReferenceForeignkeys(ModelDef modelDef, String checkLevel) throws ConstraintException { if (CHECKLEVEL_NONE.equals(checkLevel)) { return; } ClassDescriptorDef classDef; ReferenceDescriptorDef refDef; for (Iterator it = modelDef.getClasses(); it.hasNext();) { classDef = (ClassDescriptorDef)it.next(); for (Iterator refIt = classDef.getReferences(); refIt.hasNext();) { refDef = (ReferenceDescriptorDef)refIt.next(); // depends on control dependency: [for], data = [refIt] if (!refDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_IGNORE, false)) { checkReferenceForeignkeys(modelDef, refDef); // depends on control dependency: [if], data = [none] } } } } }
public class class_name { public EqualsBuilder append(Object objectFieldValue, Object otherFieldValue) { if (equals && !same) { delegate.append(objectFieldValue, otherFieldValue); } return this; } }
public class class_name { public EqualsBuilder append(Object objectFieldValue, Object otherFieldValue) { if (equals && !same) { delegate.append(objectFieldValue, otherFieldValue); // depends on control dependency: [if], data = [none] } return this; } }