code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { @UsedByGeneratedCode public __DynamicallyDispatchable determineDispatcher(Object instance, String nameAndDescriptor) { if (nameAndDescriptor.startsWith("<init>")) { // its a ctor, no dynamic lookup required if (!hasBeenReloaded()) { // TODO evaluate whether this is too naughty. it forces creation of the dispatcher so we can return it loadNewVersion("0", bytesInitial); } return (__DynamicallyDispatchable) getLiveVersion().dispatcherInstance; } String dynamicTypeName = instance.getClass().getName(); // iterate up the hierarchy finding the first person that can satisfy that method from a virtual dispatch perspective ReloadableType rtype = typeRegistry.getReloadableType(dynamicTypeName.replace('.', '/')); if (rtype == null) { throw new ReloadException("ReloadableType.determineDispatcher(): expected " + dynamicTypeName + " to be reloadable"); } boolean found = false; while (rtype != null && !found) { if (rtype.hasBeenReloaded()) { // Does the type now define it: // TODO not sure if we should be looking at deleted methods here. It is possible they are // handled by catchers/executors delegating as appropriate - and in those cases we never // end up in determineDispatcher List<MethodMember> mms = rtype.getLiveVersion().incrementalTypeDescriptor.getNewOrChangedMethods(); for (MethodMember mm : mms) { // boolean wd = IncrementalTypeDescriptor.wasDeleted(mm); if (mm.isPrivate()) { // TODO is skipping of private methods correct thing to do continue; } if (mm.getNameAndDescriptor().equals(nameAndDescriptor)) { // the reloaded version does implement this method found = true; break; } } } else { // Did the type originally define it: MethodMember[] mms = rtype.getTypeDescriptor().getMethods(); for (MethodMember mm : mms) { // TODO don't need superdispatcher check, name won't match will it... if (mm.getNameAndDescriptor().equals(nameAndDescriptor) && !MethodMember.isCatcher(mm) && !MethodMember.isSuperDispatcher(mm)) { // the original version does implement it found = true; break; } } } if (!found) { String slashedSupername = rtype.getTypeDescriptor().getSupertypeName(); rtype = typeRegistry.getReloadableType(slashedSupername); } } if (found) { if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) { log.log(Level.INFO, "appears that type " + rtype.getName() + " implements " + nameAndDescriptor); } } if (rtype == null) { return null; } if (!rtype.hasBeenReloaded()) { // TODO evaluate whether this is too naughty. it forces creation of the dispatcher so we can return it rtype.loadNewVersion("0", rtype.bytesInitial); } return (__DynamicallyDispatchable) rtype.getLiveVersion().dispatcherInstance; } }
public class class_name { @UsedByGeneratedCode public __DynamicallyDispatchable determineDispatcher(Object instance, String nameAndDescriptor) { if (nameAndDescriptor.startsWith("<init>")) { // its a ctor, no dynamic lookup required if (!hasBeenReloaded()) { // TODO evaluate whether this is too naughty. it forces creation of the dispatcher so we can return it loadNewVersion("0", bytesInitial); // depends on control dependency: [if], data = [none] } return (__DynamicallyDispatchable) getLiveVersion().dispatcherInstance; // depends on control dependency: [if], data = [none] } String dynamicTypeName = instance.getClass().getName(); // iterate up the hierarchy finding the first person that can satisfy that method from a virtual dispatch perspective ReloadableType rtype = typeRegistry.getReloadableType(dynamicTypeName.replace('.', '/')); if (rtype == null) { throw new ReloadException("ReloadableType.determineDispatcher(): expected " + dynamicTypeName + " to be reloadable"); } boolean found = false; while (rtype != null && !found) { if (rtype.hasBeenReloaded()) { // Does the type now define it: // TODO not sure if we should be looking at deleted methods here. It is possible they are // handled by catchers/executors delegating as appropriate - and in those cases we never // end up in determineDispatcher List<MethodMember> mms = rtype.getLiveVersion().incrementalTypeDescriptor.getNewOrChangedMethods(); for (MethodMember mm : mms) { // boolean wd = IncrementalTypeDescriptor.wasDeleted(mm); if (mm.isPrivate()) { // TODO is skipping of private methods correct thing to do continue; } if (mm.getNameAndDescriptor().equals(nameAndDescriptor)) { // the reloaded version does implement this method found = true; // depends on control dependency: [if], data = [none] break; } } } else { // Did the type originally define it: MethodMember[] mms = rtype.getTypeDescriptor().getMethods(); for (MethodMember mm : mms) { // TODO don't need superdispatcher check, name won't match will it... if (mm.getNameAndDescriptor().equals(nameAndDescriptor) && !MethodMember.isCatcher(mm) && !MethodMember.isSuperDispatcher(mm)) { // the original version does implement it found = true; // depends on control dependency: [if], data = [none] break; } } } if (!found) { String slashedSupername = rtype.getTypeDescriptor().getSupertypeName(); rtype = typeRegistry.getReloadableType(slashedSupername); // depends on control dependency: [if], data = [none] } } if (found) { if (GlobalConfiguration.isRuntimeLogging && log.isLoggable(Level.INFO)) { log.log(Level.INFO, "appears that type " + rtype.getName() + " implements " + nameAndDescriptor); // depends on control dependency: [if], data = [none] } } if (rtype == null) { return null; // depends on control dependency: [if], data = [none] } if (!rtype.hasBeenReloaded()) { // TODO evaluate whether this is too naughty. it forces creation of the dispatcher so we can return it rtype.loadNewVersion("0", rtype.bytesInitial); // depends on control dependency: [if], data = [none] } return (__DynamicallyDispatchable) rtype.getLiveVersion().dispatcherInstance; } }
public class class_name { private byte[] getBytesFromDocumentEntry(final DocumentEntry de) throws IOException { InputStream is = null; try { is = new DocumentInputStream(de); return getBytesFromStream(is); } finally { if (is != null) { try { is.close(); } catch (final IOException e) { LOGGER.error("Could not close input stream for document entry", e); } } } } }
public class class_name { private byte[] getBytesFromDocumentEntry(final DocumentEntry de) throws IOException { InputStream is = null; try { is = new DocumentInputStream(de); return getBytesFromStream(is); } finally { if (is != null) { try { is.close(); // depends on control dependency: [try], data = [none] } catch (final IOException e) { LOGGER.error("Could not close input stream for document entry", e); } // depends on control dependency: [catch], data = [none] } } } }
public class class_name { boolean addPersona(SPFPersona persona) { SQLiteDatabase db = getWritableDatabase(); String table = Contract.TABLE_PERSONAS; String nullColumnHack = null; ContentValues values = new ContentValues(); values.put(Contract.COLUMN_PERSONA, persona.getIdentifier()); if (db.insert(table, nullColumnHack, values) > 0) { // copy the unique identifier ProfileFieldContainer pfc = getProfileFieldBulk(SPFPersona.getDefault(), ProfileField.IDENTIFIER); String id = pfc.getFieldValue(ProfileField.IDENTIFIER); if (setValue(ProfileField.IDENTIFIER.getIdentifier(), id, persona.getIdentifier())) { addCircleToFieldsInternal(DefaultCircles.PUBLIC, ProfileField.IDENTIFIER, persona, db); addCircleToFieldsInternal(DefaultCircles.PUBLIC, ProfileField.DISPLAY_NAME, persona, db); return true; } else { removePersona(persona); return false; } } return false; } }
public class class_name { boolean addPersona(SPFPersona persona) { SQLiteDatabase db = getWritableDatabase(); String table = Contract.TABLE_PERSONAS; String nullColumnHack = null; ContentValues values = new ContentValues(); values.put(Contract.COLUMN_PERSONA, persona.getIdentifier()); if (db.insert(table, nullColumnHack, values) > 0) { // copy the unique identifier ProfileFieldContainer pfc = getProfileFieldBulk(SPFPersona.getDefault(), ProfileField.IDENTIFIER); String id = pfc.getFieldValue(ProfileField.IDENTIFIER); if (setValue(ProfileField.IDENTIFIER.getIdentifier(), id, persona.getIdentifier())) { addCircleToFieldsInternal(DefaultCircles.PUBLIC, ProfileField.IDENTIFIER, persona, db); // depends on control dependency: [if], data = [none] addCircleToFieldsInternal(DefaultCircles.PUBLIC, ProfileField.DISPLAY_NAME, persona, db); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } else { removePersona(persona); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { private int maxChildOrGrandchildWithComparator(int k) { int gc = 4 * k; int maxgc; K gcValue; // 4 grandchilden if (gc + 3 <= size) { gcValue = array[gc]; maxgc = gc; if (comparator.compare(array[++gc], gcValue) > 0) { gcValue = array[gc]; maxgc = gc; } if (comparator.compare(array[++gc], gcValue) > 0) { gcValue = array[gc]; maxgc = gc; } if (comparator.compare(array[++gc], gcValue) > 0) { maxgc = gc; } return maxgc; } // less or equal to 3 switch (size - gc) { case 2: // 3 grandchildren, two children gcValue = array[gc]; maxgc = gc; if (comparator.compare(array[++gc], gcValue) > 0) { gcValue = array[gc]; maxgc = gc; } if (comparator.compare(array[++gc], gcValue) > 0) { maxgc = gc; } return maxgc; case 1: // 2 grandchildren, maybe two children gcValue = array[gc]; maxgc = gc; if (comparator.compare(array[++gc], gcValue) > 0) { gcValue = array[gc]; maxgc = gc; } if (2 * k + 1 <= size && comparator.compare(array[2 * k + 1], gcValue) > 0) { maxgc = 2 * k + 1; } return maxgc; case 0: // 1 grandchild, maybe two children gcValue = array[gc]; maxgc = gc; if (2 * k + 1 <= size && comparator.compare(array[2 * k + 1], gcValue) > 0) { maxgc = 2 * k + 1; } return maxgc; } // 0 grandchildren maxgc = 2 * k; gcValue = array[maxgc]; if (2 * k + 1 <= size && comparator.compare(array[2 * k + 1], gcValue) > 0) { maxgc = 2 * k + 1; } return maxgc; } }
public class class_name { private int maxChildOrGrandchildWithComparator(int k) { int gc = 4 * k; int maxgc; K gcValue; // 4 grandchilden if (gc + 3 <= size) { gcValue = array[gc]; // depends on control dependency: [if], data = [none] maxgc = gc; // depends on control dependency: [if], data = [none] if (comparator.compare(array[++gc], gcValue) > 0) { gcValue = array[gc]; // depends on control dependency: [if], data = [none] maxgc = gc; // depends on control dependency: [if], data = [none] } if (comparator.compare(array[++gc], gcValue) > 0) { gcValue = array[gc]; // depends on control dependency: [if], data = [none] maxgc = gc; // depends on control dependency: [if], data = [none] } if (comparator.compare(array[++gc], gcValue) > 0) { maxgc = gc; // depends on control dependency: [if], data = [none] } return maxgc; // depends on control dependency: [if], data = [none] } // less or equal to 3 switch (size - gc) { case 2: // 3 grandchildren, two children gcValue = array[gc]; maxgc = gc; if (comparator.compare(array[++gc], gcValue) > 0) { gcValue = array[gc]; // depends on control dependency: [if], data = [none] maxgc = gc; // depends on control dependency: [if], data = [none] } if (comparator.compare(array[++gc], gcValue) > 0) { maxgc = gc; // depends on control dependency: [if], data = [none] } return maxgc; case 1: // 2 grandchildren, maybe two children gcValue = array[gc]; maxgc = gc; if (comparator.compare(array[++gc], gcValue) > 0) { gcValue = array[gc]; // depends on control dependency: [if], data = [none] maxgc = gc; // depends on control dependency: [if], data = [none] } if (2 * k + 1 <= size && comparator.compare(array[2 * k + 1], gcValue) > 0) { maxgc = 2 * k + 1; // depends on control dependency: [if], data = [none] } return maxgc; case 0: // 1 grandchild, maybe two children gcValue = array[gc]; maxgc = gc; if (2 * k + 1 <= size && comparator.compare(array[2 * k + 1], gcValue) > 0) { maxgc = 2 * k + 1; // depends on control dependency: [if], data = [none] } return maxgc; } // 0 grandchildren maxgc = 2 * k; gcValue = array[maxgc]; if (2 * k + 1 <= size && comparator.compare(array[2 * k + 1], gcValue) > 0) { maxgc = 2 * k + 1; } return maxgc; } }
public class class_name { private void findUnmatchedAssertions(final List<ACE> aces, List<AceAssertion> unsatisfiedAssertions) { List<AceAssertion> unmatchedAssertions = null; if (aces == null || aces.isEmpty()) { return; } for (ACE ace : aces) { long rightsMask = ace.getRights().asUInt(); unmatchedAssertions = new ArrayList<>(unsatisfiedAssertions); LOG.debug("findUnmatchedAssertions, processing ACE: {}", ace); // can only match type ACCESS_ALLOWED or ACCESS_ALLOWED_OBJECT if (ace.getType().getValue() != AceType.ACCESS_ALLOWED_ACE_TYPE.getValue() && ace.getType().getValue() != AceType.ACCESS_ALLOWED_OBJECT_ACE_TYPE.getValue()) { LOG.debug("findUnmatchedAssertions, skipping ACE with non allowed object type: {}", ace.getType().getValue()); continue; } for (AceAssertion assertion : unmatchedAssertions) { long assertRight = assertion.getAceRight().asUInt(); LOG.debug("findUnmatchedAssertions, assertRightMask: {}, aceRightsMask: {}", assertRight, rightsMask); if ((rightsMask & assertRight) == assertRight) { // found a rights match if (doObjectFlagsMatch(ace.getObjectFlags(), assertion.getObjectFlags()) && doObjectTypesMatch( ace.getObjectType(), assertion.getObjectType(), assertion.getObjectFlags()) && doInheritedObjectTypesMatch( ace.getInheritedObjectType(), assertion.getInheritedObjectType(), assertion.getObjectFlags()) && doRequiredFlagsMatch(ace.getFlags(), assertion.getRequiredFlag()) && !isAceExcluded(ace.getFlags(), assertion.getExcludedFlag())) { LOG.debug("findUnmatchedAssertions, found an assertion match for: {}", assertion); unsatisfiedAssertions.remove(assertion); } } } } } }
public class class_name { private void findUnmatchedAssertions(final List<ACE> aces, List<AceAssertion> unsatisfiedAssertions) { List<AceAssertion> unmatchedAssertions = null; if (aces == null || aces.isEmpty()) { return; // depends on control dependency: [if], data = [none] } for (ACE ace : aces) { long rightsMask = ace.getRights().asUInt(); unmatchedAssertions = new ArrayList<>(unsatisfiedAssertions); // depends on control dependency: [for], data = [none] LOG.debug("findUnmatchedAssertions, processing ACE: {}", ace); // depends on control dependency: [for], data = [ace] // can only match type ACCESS_ALLOWED or ACCESS_ALLOWED_OBJECT if (ace.getType().getValue() != AceType.ACCESS_ALLOWED_ACE_TYPE.getValue() && ace.getType().getValue() != AceType.ACCESS_ALLOWED_OBJECT_ACE_TYPE.getValue()) { LOG.debug("findUnmatchedAssertions, skipping ACE with non allowed object type: {}", ace.getType().getValue()); // depends on control dependency: [if], data = [none] continue; } for (AceAssertion assertion : unmatchedAssertions) { long assertRight = assertion.getAceRight().asUInt(); LOG.debug("findUnmatchedAssertions, assertRightMask: {}, aceRightsMask: {}", assertRight, rightsMask); // depends on control dependency: [for], data = [none] if ((rightsMask & assertRight) == assertRight) { // found a rights match if (doObjectFlagsMatch(ace.getObjectFlags(), assertion.getObjectFlags()) && doObjectTypesMatch( ace.getObjectType(), assertion.getObjectType(), assertion.getObjectFlags()) && doInheritedObjectTypesMatch( ace.getInheritedObjectType(), assertion.getInheritedObjectType(), assertion.getObjectFlags()) && doRequiredFlagsMatch(ace.getFlags(), assertion.getRequiredFlag()) && !isAceExcluded(ace.getFlags(), assertion.getExcludedFlag())) { LOG.debug("findUnmatchedAssertions, found an assertion match for: {}", assertion); // depends on control dependency: [if], data = [none] unsatisfiedAssertions.remove(assertion); // depends on control dependency: [if], data = [none] } } } } } }
public class class_name { private void refreshDataForRow(Row row) { if (row == null) { return; } String saveAttrList = SaveAttrsUtility.getSaveAttrListFromRow(row); if (saveAttrList!= null) { String[] saveAttrs = saveAttrList.split(","); for (String fullSaveAttr : saveAttrs) { refreshDataForCell(row, fullSaveAttr); } } } }
public class class_name { private void refreshDataForRow(Row row) { if (row == null) { return; // depends on control dependency: [if], data = [none] } String saveAttrList = SaveAttrsUtility.getSaveAttrListFromRow(row); if (saveAttrList!= null) { String[] saveAttrs = saveAttrList.split(","); for (String fullSaveAttr : saveAttrs) { refreshDataForCell(row, fullSaveAttr); // depends on control dependency: [for], data = [fullSaveAttr] } } } }
public class class_name { @SuppressLint("NewApi") public static Intent createChooser(Intent target, CharSequence title) { if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { return Intent.createChooser(target, title); } Intent intent = new Intent(); intent.setClass(Application.getLastInstance(), ChooserActivity.class); intent.putExtra(Intent.EXTRA_INTENT, target); if (title != null) { intent.putExtra(Intent.EXTRA_TITLE, title); } int permFlags = target.getFlags() & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); if (permFlags != 0 && VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { ClipData targetClipData = target.getClipData(); if (targetClipData == null && target.getData() != null) { ClipData.Item item = new ClipData.Item(target.getData()); String[] mimeTypes; if (target.getType() != null) { mimeTypes = new String[]{ target.getType() }; } else { mimeTypes = new String[]{}; } targetClipData = new ClipData(null, mimeTypes, item); } if (targetClipData != null) { intent.setClipData(targetClipData); intent.addFlags(permFlags); } } return intent; } }
public class class_name { @SuppressLint("NewApi") public static Intent createChooser(Intent target, CharSequence title) { if (VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { return Intent.createChooser(target, title); // depends on control dependency: [if], data = [none] } Intent intent = new Intent(); intent.setClass(Application.getLastInstance(), ChooserActivity.class); intent.putExtra(Intent.EXTRA_INTENT, target); if (title != null) { intent.putExtra(Intent.EXTRA_TITLE, title); // depends on control dependency: [if], data = [none] } int permFlags = target.getFlags() & (Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION); if (permFlags != 0 && VERSION.SDK_INT >= VERSION_CODES.JELLY_BEAN) { ClipData targetClipData = target.getClipData(); if (targetClipData == null && target.getData() != null) { ClipData.Item item = new ClipData.Item(target.getData()); String[] mimeTypes; if (target.getType() != null) { mimeTypes = new String[]{ target.getType() }; // depends on control dependency: [if], data = [none] } else { mimeTypes = new String[]{}; // depends on control dependency: [if], data = [none] } targetClipData = new ClipData(null, mimeTypes, item); // depends on control dependency: [if], data = [none] } if (targetClipData != null) { intent.setClipData(targetClipData); // depends on control dependency: [if], data = [(targetClipData] intent.addFlags(permFlags); // depends on control dependency: [if], data = [none] } } return intent; } }
public class class_name { public void add(final DataPoints dps) { metric_uids.add(dps.metricUID()); // TODO - tags intersection for (final byte[] tagk : dps.getAggregatedTagUids()) { aggregated_tags.add(tagk); } tsuids.addAll(dps.getTSUIDs()); // TODO - this ain't right. We need to number of dps emitted from HERE. For // now we'll just take the first dps size. If it's downsampled then this // will be accurate. //size += dps.size(); // TODO - restore when this is faster //raw_size += dps.aggregatedSize(); } }
public class class_name { public void add(final DataPoints dps) { metric_uids.add(dps.metricUID()); // TODO - tags intersection for (final byte[] tagk : dps.getAggregatedTagUids()) { aggregated_tags.add(tagk); // depends on control dependency: [for], data = [tagk] } tsuids.addAll(dps.getTSUIDs()); // TODO - this ain't right. We need to number of dps emitted from HERE. For // now we'll just take the first dps size. If it's downsampled then this // will be accurate. //size += dps.size(); // TODO - restore when this is faster //raw_size += dps.aggregatedSize(); } }
public class class_name { private ULocale getBestMatchInternal(ULocale languageCode, OutputDouble outputWeight) { languageCode = canonicalize(languageCode); final ULocale maximized = addLikelySubtags(languageCode); if (DEBUG) { System.out.println("\ngetBestMatchInternal: " + languageCode + ";\t" + maximized); } double bestWeight = 0; ULocale bestTableMatch = null; String baseLanguage = maximized.getLanguage(); Set<R3<ULocale, ULocale, Double>> searchTable = desiredLanguageToPossibleLocalesToMaxLocaleToData.get(baseLanguage); if (searchTable != null) { // we preprocessed the table so as to filter by lanugage if (DEBUG) System.out.println("\tSearching: " + searchTable); for (final R3<ULocale, ULocale, Double> tableKeyValue : searchTable) { ULocale tableKey = tableKeyValue.get0(); ULocale maxLocale = tableKeyValue.get1(); Double matchedWeight = tableKeyValue.get2(); final double match = match(languageCode, maximized, tableKey, maxLocale); if (DEBUG) { System.out.println("\t" + tableKeyValue + ";\t" + match + "\n"); } final double weight = match * matchedWeight; if (weight > bestWeight) { bestWeight = weight; bestTableMatch = tableKey; if (weight > 0.999d) { // bail on good enough match. break; } } } } if (bestWeight < threshold) { bestTableMatch = defaultLanguage; } if (outputWeight != null) { outputWeight.value = bestWeight; // only return the weight when needed } return bestTableMatch; } }
public class class_name { private ULocale getBestMatchInternal(ULocale languageCode, OutputDouble outputWeight) { languageCode = canonicalize(languageCode); final ULocale maximized = addLikelySubtags(languageCode); if (DEBUG) { System.out.println("\ngetBestMatchInternal: " + languageCode + ";\t" + maximized); // depends on control dependency: [if], data = [none] } double bestWeight = 0; ULocale bestTableMatch = null; String baseLanguage = maximized.getLanguage(); Set<R3<ULocale, ULocale, Double>> searchTable = desiredLanguageToPossibleLocalesToMaxLocaleToData.get(baseLanguage); if (searchTable != null) { // we preprocessed the table so as to filter by lanugage if (DEBUG) System.out.println("\tSearching: " + searchTable); for (final R3<ULocale, ULocale, Double> tableKeyValue : searchTable) { ULocale tableKey = tableKeyValue.get0(); ULocale maxLocale = tableKeyValue.get1(); Double matchedWeight = tableKeyValue.get2(); final double match = match(languageCode, maximized, tableKey, maxLocale); if (DEBUG) { System.out.println("\t" + tableKeyValue + ";\t" + match + "\n"); // depends on control dependency: [if], data = [none] } final double weight = match * matchedWeight; if (weight > bestWeight) { bestWeight = weight; // depends on control dependency: [if], data = [none] bestTableMatch = tableKey; // depends on control dependency: [if], data = [none] if (weight > 0.999d) { // bail on good enough match. break; } } } } if (bestWeight < threshold) { bestTableMatch = defaultLanguage; // depends on control dependency: [if], data = [none] } if (outputWeight != null) { outputWeight.value = bestWeight; // only return the weight when needed // depends on control dependency: [if], data = [none] } return bestTableMatch; } }
public class class_name { private <T> Collection<Integer> transformSink(SinkTransformation<T> sink) { Collection<Integer> inputIds = transform(sink.getInput()); String slotSharingGroup = determineSlotSharingGroup(sink.getSlotSharingGroup(), inputIds); streamGraph.addSink(sink.getId(), slotSharingGroup, sink.getCoLocationGroupKey(), sink.getOperator(), sink.getInput().getOutputType(), null, "Sink: " + sink.getName()); streamGraph.setParallelism(sink.getId(), sink.getParallelism()); streamGraph.setMaxParallelism(sink.getId(), sink.getMaxParallelism()); for (Integer inputId: inputIds) { streamGraph.addEdge(inputId, sink.getId(), 0 ); } if (sink.getStateKeySelector() != null) { TypeSerializer<?> keySerializer = sink.getStateKeyType().createSerializer(env.getConfig()); streamGraph.setOneInputStateKey(sink.getId(), sink.getStateKeySelector(), keySerializer); } return Collections.emptyList(); } }
public class class_name { private <T> Collection<Integer> transformSink(SinkTransformation<T> sink) { Collection<Integer> inputIds = transform(sink.getInput()); String slotSharingGroup = determineSlotSharingGroup(sink.getSlotSharingGroup(), inputIds); streamGraph.addSink(sink.getId(), slotSharingGroup, sink.getCoLocationGroupKey(), sink.getOperator(), sink.getInput().getOutputType(), null, "Sink: " + sink.getName()); streamGraph.setParallelism(sink.getId(), sink.getParallelism()); streamGraph.setMaxParallelism(sink.getId(), sink.getMaxParallelism()); for (Integer inputId: inputIds) { streamGraph.addEdge(inputId, sink.getId(), 0 ); // depends on control dependency: [for], data = [none] } if (sink.getStateKeySelector() != null) { TypeSerializer<?> keySerializer = sink.getStateKeyType().createSerializer(env.getConfig()); streamGraph.setOneInputStateKey(sink.getId(), sink.getStateKeySelector(), keySerializer); // depends on control dependency: [if], data = [none] } return Collections.emptyList(); } }
public class class_name { @Pure public static List<String> getSystemDefaults(TrafficDirection direction) { final List<String> array = new ArrayList<>(); try { int i = 0; while (true) { array.add(getSystemDefault(direction, i)); ++i; } } catch (AssertionError e) { throw e; } catch (Throwable exception) { // } return array; } }
public class class_name { @Pure public static List<String> getSystemDefaults(TrafficDirection direction) { final List<String> array = new ArrayList<>(); try { int i = 0; while (true) { array.add(getSystemDefault(direction, i)); // depends on control dependency: [while], data = [none] ++i; // depends on control dependency: [while], data = [none] } } catch (AssertionError e) { throw e; } catch (Throwable exception) { // depends on control dependency: [catch], data = [none] // } // depends on control dependency: [catch], data = [none] return array; } }
public class class_name { public static boolean canFormat(ConfigurablePropertyAccessor bw, Object obj, String prop) { String key = obj.getClass().getName() + "_" + prop; if (!cache.containsKey(key)) { cache.put(key, false); TypeDescriptor td = bw.getPropertyTypeDescriptor(prop); if (td != null) { WinletDefaultFormattingConversionService wcs = get(); if (wcs != null && wcs.hasFmtAnnotation(td) && wcs.canConvert(td, TypeDescriptor.valueOf(String.class))) cache.put(key, true); } } return cache.get(key); } }
public class class_name { public static boolean canFormat(ConfigurablePropertyAccessor bw, Object obj, String prop) { String key = obj.getClass().getName() + "_" + prop; if (!cache.containsKey(key)) { cache.put(key, false); // depends on control dependency: [if], data = [none] TypeDescriptor td = bw.getPropertyTypeDescriptor(prop); if (td != null) { WinletDefaultFormattingConversionService wcs = get(); if (wcs != null && wcs.hasFmtAnnotation(td) && wcs.canConvert(td, TypeDescriptor.valueOf(String.class))) cache.put(key, true); } } return cache.get(key); } }
public class class_name { public static void setButtonDimensionHint(Button button) { Assert.isNotNull(button); Object gd= button.getLayoutData(); if (gd instanceof GridData) { ((GridData)gd).widthHint= getButtonWidthHint(button); ((GridData)gd).horizontalAlignment = GridData.FILL; } } }
public class class_name { public static void setButtonDimensionHint(Button button) { Assert.isNotNull(button); Object gd= button.getLayoutData(); if (gd instanceof GridData) { ((GridData)gd).widthHint= getButtonWidthHint(button); // depends on control dependency: [if], data = [none] ((GridData)gd).horizontalAlignment = GridData.FILL; // depends on control dependency: [if], data = [none] } } }
public class class_name { public EClass getIfcRailing() { if (ifcRailingEClass == null) { ifcRailingEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(420); } return ifcRailingEClass; } }
public class class_name { public EClass getIfcRailing() { if (ifcRailingEClass == null) { ifcRailingEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI) .getEClassifiers().get(420); // depends on control dependency: [if], data = [none] } return ifcRailingEClass; } }
public class class_name { static public void cleanCache(Date cutoff, StringBuilder sbuff) { if (sbuff != null) sbuff.append("CleanCache files before ").append(cutoff).append("\n"); File dir = new File(root); File[] children = dir.listFiles(); if (children == null) return; for (File file : children) { Date lastMod = new Date(file.lastModified()); if (lastMod.before(cutoff)) { boolean ret = file.delete(); if (sbuff != null) { sbuff.append(" delete ").append(file).append(" (").append(lastMod).append(")\n"); if (!ret) sbuff.append("Error deleting ").append(file).append("\n"); } } } } }
public class class_name { static public void cleanCache(Date cutoff, StringBuilder sbuff) { if (sbuff != null) sbuff.append("CleanCache files before ").append(cutoff).append("\n"); File dir = new File(root); File[] children = dir.listFiles(); if (children == null) return; for (File file : children) { Date lastMod = new Date(file.lastModified()); if (lastMod.before(cutoff)) { boolean ret = file.delete(); if (sbuff != null) { sbuff.append(" delete ").append(file).append(" (").append(lastMod).append(")\n"); // depends on control dependency: [if], data = [none] if (!ret) sbuff.append("Error deleting ").append(file).append("\n"); } } } } }
public class class_name { protected void readSettings() { boolean createConstructors = false; boolean createUnimplemented = true; boolean createEventHandlers = true; boolean createLifecycleFunctions = true; final IDialogSettings dialogSettings = getDialogSettings(); if (dialogSettings != null) { final IDialogSettings section = dialogSettings.getSection(getName()); if (section != null) { createConstructors = section.getBoolean(SETTINGS_CREATECONSTR); createUnimplemented = section.getBoolean(SETTINGS_CREATEUNIMPLEMENTED); createEventHandlers = section.getBoolean(SETTINGS_GENERATEEVENTHANDLERS); createLifecycleFunctions = section.getBoolean(SETTINGS_GENERATELIFECYCLEFUNCTIONS); } } setMethodStubSelection(createConstructors, createUnimplemented, createEventHandlers, createLifecycleFunctions, true); } }
public class class_name { protected void readSettings() { boolean createConstructors = false; boolean createUnimplemented = true; boolean createEventHandlers = true; boolean createLifecycleFunctions = true; final IDialogSettings dialogSettings = getDialogSettings(); if (dialogSettings != null) { final IDialogSettings section = dialogSettings.getSection(getName()); if (section != null) { createConstructors = section.getBoolean(SETTINGS_CREATECONSTR); // depends on control dependency: [if], data = [none] createUnimplemented = section.getBoolean(SETTINGS_CREATEUNIMPLEMENTED); // depends on control dependency: [if], data = [none] createEventHandlers = section.getBoolean(SETTINGS_GENERATEEVENTHANDLERS); // depends on control dependency: [if], data = [none] createLifecycleFunctions = section.getBoolean(SETTINGS_GENERATELIFECYCLEFUNCTIONS); // depends on control dependency: [if], data = [none] } } setMethodStubSelection(createConstructors, createUnimplemented, createEventHandlers, createLifecycleFunctions, true); } }
public class class_name { synchronized void rollback(Session session, long timestamp) { RowActionBase action = this; do { if (action.session == session && action.commitTimestamp == 0) { if (action.actionTimestamp >= timestamp || action.actionTimestamp == 0) { action.commitTimestamp = session.actionTimestamp; action.rolledback = true; action.prepared = false; } } action = action.next; } while (action != null); } }
public class class_name { synchronized void rollback(Session session, long timestamp) { RowActionBase action = this; do { if (action.session == session && action.commitTimestamp == 0) { if (action.actionTimestamp >= timestamp || action.actionTimestamp == 0) { action.commitTimestamp = session.actionTimestamp; // depends on control dependency: [if], data = [none] action.rolledback = true; // depends on control dependency: [if], data = [none] action.prepared = false; // depends on control dependency: [if], data = [none] } } action = action.next; } while (action != null); } }
public class class_name { public static <N> void merge(MutableGraph<N> graph1, Graph<N> graph2) { for (N node : graph2.nodes()) { graph1.addNode(node); } for (EndpointPair<N> edge : graph2.edges()) { graph1.putEdge(edge.nodeU(), edge.nodeV()); } } }
public class class_name { public static <N> void merge(MutableGraph<N> graph1, Graph<N> graph2) { for (N node : graph2.nodes()) { graph1.addNode(node); // depends on control dependency: [for], data = [node] } for (EndpointPair<N> edge : graph2.edges()) { graph1.putEdge(edge.nodeU(), edge.nodeV()); // depends on control dependency: [for], data = [edge] } } }
public class class_name { public PoseSteering getPoseSteering(long time) { long startTime = this.getTemporalVariable().getEST(); long endTime = this.getTemporalVariable().getEET(); if (time < startTime || time > endTime) { return this.getTrajectory().getPoseSteering()[this.getTrajectory().getPoseSteering().length-1]; // if (this.hasSuperEnvelope()) { // return this.getSuperEnvelope().getPoseSteering(time); // } // return null; } if (this.getReferencePathVariable().getShapeType().equals(PointDomain.class)) { return this.getTrajectory().getPoseSteering()[0]; } long total = endTime-startTime; long soFar = time-startTime; double percent = ((double)soFar)/((double)total); double totDistance = ((LineStringDomain)this.getReferencePathVariable().getDomain()).getGeometry().getLength(); double scannedDistance = 0.0; PoseSteering previousPS = null; PoseSteering currentPS = null; double previousRatio = 0.0; double currentRatio = 0.0; int index = 0; while (scannedDistance/totDistance < percent) { previousRatio = scannedDistance/totDistance; previousPS = this.getTrajectory().getPoseSteering()[index]; currentPS = this.getTrajectory().getPoseSteering()[++index]; scannedDistance += new Coordinate(currentPS.getPose().getX(),currentPS.getPose().getY()).distance(new Coordinate(previousPS.getPose().getX(),previousPS.getPose().getY())); currentRatio = scannedDistance/totDistance; } if (previousPS == null) return this.getTrajectory().getPoseSteering()[0]; double ratio = (percent-previousRatio)/(currentRatio-previousRatio); PoseSteering ret = previousPS.interpolate(currentPS, ratio); return ret; } }
public class class_name { public PoseSteering getPoseSteering(long time) { long startTime = this.getTemporalVariable().getEST(); long endTime = this.getTemporalVariable().getEET(); if (time < startTime || time > endTime) { return this.getTrajectory().getPoseSteering()[this.getTrajectory().getPoseSteering().length-1]; // depends on control dependency: [if], data = [none] // if (this.hasSuperEnvelope()) { // return this.getSuperEnvelope().getPoseSteering(time); // } // return null; } if (this.getReferencePathVariable().getShapeType().equals(PointDomain.class)) { return this.getTrajectory().getPoseSteering()[0]; // depends on control dependency: [if], data = [none] } long total = endTime-startTime; long soFar = time-startTime; double percent = ((double)soFar)/((double)total); double totDistance = ((LineStringDomain)this.getReferencePathVariable().getDomain()).getGeometry().getLength(); double scannedDistance = 0.0; PoseSteering previousPS = null; PoseSteering currentPS = null; double previousRatio = 0.0; double currentRatio = 0.0; int index = 0; while (scannedDistance/totDistance < percent) { previousRatio = scannedDistance/totDistance; // depends on control dependency: [while], data = [none] previousPS = this.getTrajectory().getPoseSteering()[index]; // depends on control dependency: [while], data = [none] currentPS = this.getTrajectory().getPoseSteering()[++index]; // depends on control dependency: [while], data = [none] scannedDistance += new Coordinate(currentPS.getPose().getX(),currentPS.getPose().getY()).distance(new Coordinate(previousPS.getPose().getX(),previousPS.getPose().getY())); // depends on control dependency: [while], data = [none] currentRatio = scannedDistance/totDistance; // depends on control dependency: [while], data = [none] } if (previousPS == null) return this.getTrajectory().getPoseSteering()[0]; double ratio = (percent-previousRatio)/(currentRatio-previousRatio); PoseSteering ret = previousPS.interpolate(currentPS, ratio); return ret; } }
public class class_name { private void removeInstalledExtension(DefaultInstalledExtension installedExtension, String namespace) { removeInstalledFeature(installedExtension.getId().getId(), namespace); for (ExtensionId feature : installedExtension.getExtensionFeatures()) { removeInstalledFeature(feature.getId(), namespace); } removeFromBackwardDependencies(installedExtension, namespace); if (!installedExtension.isInstalled()) { removeCachedExtension(installedExtension); } } }
public class class_name { private void removeInstalledExtension(DefaultInstalledExtension installedExtension, String namespace) { removeInstalledFeature(installedExtension.getId().getId(), namespace); for (ExtensionId feature : installedExtension.getExtensionFeatures()) { removeInstalledFeature(feature.getId(), namespace); // depends on control dependency: [for], data = [feature] } removeFromBackwardDependencies(installedExtension, namespace); if (!installedExtension.isInstalled()) { removeCachedExtension(installedExtension); // depends on control dependency: [if], data = [none] } } }
public class class_name { private EventParameters createEventParameters(Map<String,String> pParams){ EventParameters evParams = EventParameters.Factory.newInstance(); for (String name : pParams.keySet()) { String val = pParams.get(name); if(val == null){ continue; } Parameter evParam = evParams.addNewParameter(); evParam.setName(name); evParam.setStringValue(val); } return evParams; } }
public class class_name { private EventParameters createEventParameters(Map<String,String> pParams){ EventParameters evParams = EventParameters.Factory.newInstance(); for (String name : pParams.keySet()) { String val = pParams.get(name); if(val == null){ continue; } Parameter evParam = evParams.addNewParameter(); evParam.setName(name); // depends on control dependency: [for], data = [name] evParam.setStringValue(val); // depends on control dependency: [for], data = [none] } return evParams; } }
public class class_name { public EncryptionEntities withItems(EncryptionEntity... items) { if (this.items == null) { setItems(new com.amazonaws.internal.SdkInternalList<EncryptionEntity>(items.length)); } for (EncryptionEntity ele : items) { this.items.add(ele); } return this; } }
public class class_name { public EncryptionEntities withItems(EncryptionEntity... items) { if (this.items == null) { setItems(new com.amazonaws.internal.SdkInternalList<EncryptionEntity>(items.length)); // depends on control dependency: [if], data = [none] } for (EncryptionEntity ele : items) { this.items.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static File getUserM2Repository() { // if there is m2override system propery, use it. String m2Override = System.getProperty("apiman.gateway.m2-repository-path"); //$NON-NLS-1$ if (m2Override != null) { return new File(m2Override).getAbsoluteFile(); } String userHome = System.getProperty("user.home"); //$NON-NLS-1$ if (userHome != null) { File userHomeDir = new File(userHome); if (userHomeDir.isDirectory()) { File m2Dir = new File(userHome, ".m2/repository"); //$NON-NLS-1$ if (m2Dir.isDirectory()) { return m2Dir; } } } return null; } }
public class class_name { public static File getUserM2Repository() { // if there is m2override system propery, use it. String m2Override = System.getProperty("apiman.gateway.m2-repository-path"); //$NON-NLS-1$ if (m2Override != null) { return new File(m2Override).getAbsoluteFile(); // depends on control dependency: [if], data = [(m2Override] } String userHome = System.getProperty("user.home"); //$NON-NLS-1$ if (userHome != null) { File userHomeDir = new File(userHome); if (userHomeDir.isDirectory()) { File m2Dir = new File(userHome, ".m2/repository"); //$NON-NLS-1$ if (m2Dir.isDirectory()) { return m2Dir; // depends on control dependency: [if], data = [none] } } } return null; } }
public class class_name { public static EmbeddedPostgresTestDatabaseRule embeddedDatabaseRule(@Nonnull final URL baseUrl, final String... personalities) { try { return embeddedDatabaseRule(baseUrl.toURI(), personalities); } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } } }
public class class_name { public static EmbeddedPostgresTestDatabaseRule embeddedDatabaseRule(@Nonnull final URL baseUrl, final String... personalities) { try { return embeddedDatabaseRule(baseUrl.toURI(), personalities); // depends on control dependency: [try], data = [none] } catch (URISyntaxException e) { throw new IllegalArgumentException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public float getSequenceTailAverageQuality(int numElements) { float quality = -1; if (this.size() >= numElements) { // Sum the quality of the last 'n' elements of the sequence, // and divide the result by 'n' to obtain the average value int totalTailQuality = 0; for (int i = 1; i <= numElements; i++) { totalTailQuality += this.qualityScoresArray[this.size() - i]; } quality = totalTailQuality / numElements; } return quality; } }
public class class_name { public float getSequenceTailAverageQuality(int numElements) { float quality = -1; if (this.size() >= numElements) { // Sum the quality of the last 'n' elements of the sequence, // and divide the result by 'n' to obtain the average value int totalTailQuality = 0; for (int i = 1; i <= numElements; i++) { totalTailQuality += this.qualityScoresArray[this.size() - i]; // depends on control dependency: [for], data = [i] } quality = totalTailQuality / numElements; // depends on control dependency: [if], data = [none] } return quality; } }
public class class_name { public static String getPathToBase() { String path = new File(".").getAbsoluteFile().getParent(); while( path != null ) { File f = new File(path); if( !f.exists() ) break; String[] files = f.list(); if( files == null ) break; boolean foundMain = false; boolean foundExamples = false; boolean foundIntegration = false; for( String s : files ) { if( s.compareToIgnoreCase("main") == 0 ) foundMain = true; else if( s.compareToIgnoreCase("examples") == 0 ) foundExamples = true; else if( s.compareToIgnoreCase("integration") == 0 ) foundIntegration = true; } if( foundMain && foundExamples && foundIntegration) return path; path = f.getParent(); } return null; } }
public class class_name { public static String getPathToBase() { String path = new File(".").getAbsoluteFile().getParent(); while( path != null ) { File f = new File(path); if( !f.exists() ) break; String[] files = f.list(); if( files == null ) break; boolean foundMain = false; boolean foundExamples = false; boolean foundIntegration = false; for( String s : files ) { if( s.compareToIgnoreCase("main") == 0 ) foundMain = true; else if( s.compareToIgnoreCase("examples") == 0 ) foundExamples = true; else if( s.compareToIgnoreCase("integration") == 0 ) foundIntegration = true; } if( foundMain && foundExamples && foundIntegration) return path; path = f.getParent(); // depends on control dependency: [while], data = [none] } return null; } }
public class class_name { private void checkViewMeetsSpec(String viewName, ParsedSelectStmt stmt) throws VoltCompilerException { int groupColCount = stmt.groupByColumns().size(); int displayColCount = stmt.m_displayColumns.size(); StringBuffer msg = new StringBuffer(); msg.append("Materialized view \"" + viewName + "\" "); if (stmt.getParameters().length > 0) { msg.append("contains placeholders (?), which are not allowed in the SELECT query for a view."); throw m_compiler.new VoltCompilerException(msg.toString()); } List <AbstractExpression> checkExpressions = new ArrayList<>(); int i; // First, check the group by columns. They are at // the beginning of the display list. for (i = 0; i < groupColCount; i++) { ParsedColInfo gbcol = stmt.groupByColumns().get(i); ParsedColInfo outcol = stmt.m_displayColumns.get(i); // The columns must be equal. if (!outcol.m_expression.equals(gbcol.m_expression)) { msg.append("must exactly match the GROUP BY clause at index " + String.valueOf(i) + " of SELECT list."); throw m_compiler.new VoltCompilerException(msg.toString()); } // check if the expression return type is not unique indexable StringBuffer exprMsg = new StringBuffer(); if (!outcol.m_expression.isValueTypeUniqueIndexable(exprMsg)) { msg.append("with " + exprMsg + " in GROUP BY clause not supported."); throw m_compiler.new VoltCompilerException(msg.toString()); } // collect all the expressions and we will check // for other guards on all of them together checkExpressions.add(outcol.m_expression); } // check for count star in the display list boolean countStarFound = false; UnsafeOperatorsForDDL unsafeOps = new UnsafeOperatorsForDDL(); // Finally, the display columns must have aggregate // calls. But these are not any aggregate calls. They // must be count(), min(), max() or sum(). for (; i < displayColCount; i++) { ParsedColInfo outcol = stmt.m_displayColumns.get(i); // Note that this expression does not catch all aggregates. // An instance of avg() would cause the exception. // ENG-10945 - We can have count(*) anywhere after the group by columns and multiple count(*)(s) if ( outcol.m_expression.getExpressionType() == ExpressionType.AGGREGATE_COUNT_STAR) { if ( countStarFound == false ) countStarFound = true; continue; } if ((outcol.m_expression.getExpressionType() != ExpressionType.AGGREGATE_COUNT) && (outcol.m_expression.getExpressionType() != ExpressionType.AGGREGATE_SUM) && (outcol.m_expression.getExpressionType() != ExpressionType.AGGREGATE_MIN) && (outcol.m_expression.getExpressionType() != ExpressionType.AGGREGATE_MAX)) { msg.append("must have non-group by columns aggregated by sum, count, min or max."); throw m_compiler.new VoltCompilerException(msg.toString()); } // Don't push the expression, though. Push the argument. // We will check for aggregate calls and fail, and we don't // want to fail on legal aggregate expressions. if (outcol.m_expression.getLeft() != null) { checkExpressions.add(outcol.m_expression.getLeft()); } // Check if the aggregation is safe for non-empty view source table. outcol.m_expression.findUnsafeOperatorsForDDL(unsafeOps); assert(outcol.m_expression.getRight() == null); assert(outcol.m_expression.getArgs() == null || outcol.m_expression.getArgs().size() == 0); } // Users can create SINGLE TABLE VIEWS without declaring count(*) in the stmt. // Multiple table views still need this restriction. if (stmt.m_tableList.size() > 1 && countStarFound == false) { msg.append("joins multiple tables, therefore must include COUNT(*) after any GROUP BY columns."); throw m_compiler.new VoltCompilerException(msg.toString()); } AbstractExpression where = stmt.getSingleTableFilterExpression(); if (where != null) { checkExpressions.add(where); } /* * Gather up all the join expressions. The ParsedSelectStatement * has not been analyzed yet, so it's not clear where these are. But * the stmt knows. */ stmt.gatherJoinExpressions(checkExpressions); if (stmt.getHavingPredicate() != null) { checkExpressions.add(stmt.getHavingPredicate()); } // Check all the subexpressions we gathered up. if (!AbstractExpression.validateExprsForIndexesAndMVs(checkExpressions, msg, true)) { // The error message will be in the StringBuffer msg. throw m_compiler.new VoltCompilerException(msg.toString()); } // Check some other materialized view specific things. // // Check to see if the expression is safe for creating // views on nonempty tables. for (AbstractExpression expr : checkExpressions) { expr.findUnsafeOperatorsForDDL(unsafeOps); } if (unsafeOps.isUnsafe()) { stmt.setUnsafeDDLMessage(unsafeOps.toString()); } if (stmt.hasSubquery()) { msg.append("cannot contain subquery sources."); throw m_compiler.new VoltCompilerException(msg.toString()); } if (! stmt.m_joinTree.allInnerJoins()) { throw m_compiler.new VoltCompilerException("Materialized view only supports INNER JOIN."); } if (stmt.orderByColumns().size() != 0) { msg.append("with an ORDER BY clause is not supported."); throw m_compiler.new VoltCompilerException(msg.toString()); } if (stmt.hasLimitOrOffset()) { msg.append("with a LIMIT or OFFSET clause is not supported."); throw m_compiler.new VoltCompilerException(msg.toString()); } if (stmt.getHavingPredicate() != null) { msg.append("with a HAVING clause is not supported."); throw m_compiler.new VoltCompilerException(msg.toString()); } // ENG-10892, since count(*) can be removed from SV table if ((stmt.m_tableList.size() > 1 && displayColCount <= groupColCount) || displayColCount < groupColCount) { msg.append("has too few columns."); throw m_compiler.new VoltCompilerException(msg.toString()); } checkViewSources(stmt.m_tableList); } }
public class class_name { private void checkViewMeetsSpec(String viewName, ParsedSelectStmt stmt) throws VoltCompilerException { int groupColCount = stmt.groupByColumns().size(); int displayColCount = stmt.m_displayColumns.size(); StringBuffer msg = new StringBuffer(); msg.append("Materialized view \"" + viewName + "\" "); if (stmt.getParameters().length > 0) { msg.append("contains placeholders (?), which are not allowed in the SELECT query for a view."); throw m_compiler.new VoltCompilerException(msg.toString()); } List <AbstractExpression> checkExpressions = new ArrayList<>(); int i; // First, check the group by columns. They are at // the beginning of the display list. for (i = 0; i < groupColCount; i++) { ParsedColInfo gbcol = stmt.groupByColumns().get(i); ParsedColInfo outcol = stmt.m_displayColumns.get(i); // The columns must be equal. if (!outcol.m_expression.equals(gbcol.m_expression)) { msg.append("must exactly match the GROUP BY clause at index " + String.valueOf(i) + " of SELECT list."); // depends on control dependency: [if], data = [none] throw m_compiler.new VoltCompilerException(msg.toString()); } // check if the expression return type is not unique indexable StringBuffer exprMsg = new StringBuffer(); if (!outcol.m_expression.isValueTypeUniqueIndexable(exprMsg)) { msg.append("with " + exprMsg + " in GROUP BY clause not supported."); // depends on control dependency: [if], data = [none] throw m_compiler.new VoltCompilerException(msg.toString()); } // collect all the expressions and we will check // for other guards on all of them together checkExpressions.add(outcol.m_expression); } // check for count star in the display list boolean countStarFound = false; UnsafeOperatorsForDDL unsafeOps = new UnsafeOperatorsForDDL(); // Finally, the display columns must have aggregate // calls. But these are not any aggregate calls. They // must be count(), min(), max() or sum(). for (; i < displayColCount; i++) { ParsedColInfo outcol = stmt.m_displayColumns.get(i); // Note that this expression does not catch all aggregates. // An instance of avg() would cause the exception. // ENG-10945 - We can have count(*) anywhere after the group by columns and multiple count(*)(s) if ( outcol.m_expression.getExpressionType() == ExpressionType.AGGREGATE_COUNT_STAR) { if ( countStarFound == false ) countStarFound = true; continue; } if ((outcol.m_expression.getExpressionType() != ExpressionType.AGGREGATE_COUNT) && (outcol.m_expression.getExpressionType() != ExpressionType.AGGREGATE_SUM) && (outcol.m_expression.getExpressionType() != ExpressionType.AGGREGATE_MIN) && (outcol.m_expression.getExpressionType() != ExpressionType.AGGREGATE_MAX)) { msg.append("must have non-group by columns aggregated by sum, count, min or max."); throw m_compiler.new VoltCompilerException(msg.toString()); } // Don't push the expression, though. Push the argument. // We will check for aggregate calls and fail, and we don't // want to fail on legal aggregate expressions. if (outcol.m_expression.getLeft() != null) { checkExpressions.add(outcol.m_expression.getLeft()); } // Check if the aggregation is safe for non-empty view source table. outcol.m_expression.findUnsafeOperatorsForDDL(unsafeOps); assert(outcol.m_expression.getRight() == null); assert(outcol.m_expression.getArgs() == null || outcol.m_expression.getArgs().size() == 0); } // Users can create SINGLE TABLE VIEWS without declaring count(*) in the stmt. // Multiple table views still need this restriction. if (stmt.m_tableList.size() > 1 && countStarFound == false) { msg.append("joins multiple tables, therefore must include COUNT(*) after any GROUP BY columns."); throw m_compiler.new VoltCompilerException(msg.toString()); } AbstractExpression where = stmt.getSingleTableFilterExpression(); if (where != null) { checkExpressions.add(where); } /* * Gather up all the join expressions. The ParsedSelectStatement * has not been analyzed yet, so it's not clear where these are. But * the stmt knows. */ stmt.gatherJoinExpressions(checkExpressions); if (stmt.getHavingPredicate() != null) { checkExpressions.add(stmt.getHavingPredicate()); } // Check all the subexpressions we gathered up. if (!AbstractExpression.validateExprsForIndexesAndMVs(checkExpressions, msg, true)) { // The error message will be in the StringBuffer msg. throw m_compiler.new VoltCompilerException(msg.toString()); } // Check some other materialized view specific things. // // Check to see if the expression is safe for creating // views on nonempty tables. for (AbstractExpression expr : checkExpressions) { expr.findUnsafeOperatorsForDDL(unsafeOps); } if (unsafeOps.isUnsafe()) { stmt.setUnsafeDDLMessage(unsafeOps.toString()); } if (stmt.hasSubquery()) { msg.append("cannot contain subquery sources."); throw m_compiler.new VoltCompilerException(msg.toString()); } if (! stmt.m_joinTree.allInnerJoins()) { throw m_compiler.new VoltCompilerException("Materialized view only supports INNER JOIN."); } if (stmt.orderByColumns().size() != 0) { msg.append("with an ORDER BY clause is not supported."); throw m_compiler.new VoltCompilerException(msg.toString()); } if (stmt.hasLimitOrOffset()) { msg.append("with a LIMIT or OFFSET clause is not supported."); throw m_compiler.new VoltCompilerException(msg.toString()); } if (stmt.getHavingPredicate() != null) { msg.append("with a HAVING clause is not supported."); throw m_compiler.new VoltCompilerException(msg.toString()); } // ENG-10892, since count(*) can be removed from SV table if ((stmt.m_tableList.size() > 1 && displayColCount <= groupColCount) || displayColCount < groupColCount) { msg.append("has too few columns."); throw m_compiler.new VoltCompilerException(msg.toString()); } checkViewSources(stmt.m_tableList); } }
public class class_name { public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, String keyAreaName, Converter fldDisplayFieldDesc, boolean bIncludeBlankOption, boolean bIncludeFormButton) { ScreenComponent screenField = null; if ((!(this instanceof ReferenceField)) && (!(this instanceof CounterField))) Debug.doAssert(false); // error, wrong field type Converter conv = null; if (keyAreaName != null) { // Set up the listener to read the record using the code key (optional) BaseField fldKey = ((Record)record).getKeyArea(keyAreaName).getField(DBConstants.MAIN_KEY_FIELD); // Code if (this.getRecord().getRecordOwner() instanceof ComponentParent) if (!((ComponentParent)this.getRecord().getRecordOwner()).isPrintReport()) { // Only need the read behavior if this is an input field ((Record)record).setKeyArea(keyAreaName); MainReadOnlyHandler behavior = new MainReadOnlyHandler(keyAreaName); fldKey.addListener(behavior); } if (iDisplayFieldDesc != ScreenConstants.DONT_DISPLAY_DESC) conv = new FieldDescConverter(fldKey, (Converter)converter); // Use the description for this field else conv = fldKey; screenField = conv.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc); // screenField = new SEditText(itsLocation, targetScreen, conv, iDisplayFieldDesc); itsLocation = null; iDisplayFieldDesc = ScreenConstants.DONT_DISPLAY_DESC; // Display it only once } // Set up to display the record description if (fldDisplayFieldDesc != null) { if ((conv == null) && (iDisplayFieldDesc != ScreenConstants.DONT_DISPLAY_DESC)) conv = new FieldDescConverter(fldDisplayFieldDesc, (Converter)converter); // Use the description for this field else conv = fldDisplayFieldDesc; } if (conv != null) { if (itsLocation == null) itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR); ScreenComponent sfDesc = conv.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc); // ScreenField sfDesc = new SEditText(itsLocation, targetScreen, conv, iDisplayFieldDesc); sfDesc.setEnabled(false); } // Add the lookup button and form (opt) button (Even though SSelectBoxes don't use converter, pass it, so field.enable(true), etc will work) Map<String,Object> properties = new HashMap<String,Object>(); properties.put(ScreenModel.RECORD, record); properties.put(ScreenModel.COMMAND, ThinMenuConstants.LOOKUP); properties.put(ScreenModel.IMAGE, ThinMenuConstants.LOOKUP); screenField = createScreenComponent(ScreenModel.CANNED_BOX, targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties); if (bIncludeFormButton) if (!(targetScreen instanceof GridScreenParent)) { properties = new HashMap<String,Object>(); properties.put(ScreenModel.RECORD, record); properties.put(ScreenModel.COMMAND, ThinMenuConstants.FORM); properties.put(ScreenModel.IMAGE, ThinMenuConstants.FORM); screenField = createScreenComponent(ScreenModel.CANNED_BOX, targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties); } if ((bIncludeBlankOption) || (keyAreaName == null)) // If there is no code field, the only way to blank a field is to click this button if (!(targetScreen instanceof GridScreenParent)) { properties = new HashMap<String,Object>(); properties.put(ScreenModel.FIELD, this); properties.put(ScreenModel.COMMAND, ScreenModel.CLEAR); properties.put(ScreenModel.IMAGE, ScreenModel.CLEAR); screenField = createScreenComponent(ScreenModel.CANNED_BOX, targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties); } //x can't yet - what if someone wants access to a field. record.selectScreenFields(); // Only select fields that you will display boolean bUpdateRecord = false; if ((record.getDatabaseType() & (DBConstants.REMOTE | DBConstants.USER_DATA)) == (DBConstants.REMOTE | DBConstants.USER_DATA)) bUpdateRecord = true; // Set up the listener to read the current record on a valid main record ReadSecondaryHandler behavior = new ReadSecondaryHandler((Record)record, null, DBConstants.CLOSE_ON_FREE, bUpdateRecord, bIncludeBlankOption); this.addListener(behavior); if (((Record)record).getRecordOwner() != targetScreen) if (this.getRecord().getRecordOwner() != targetScreen) if (this.getRecord().getRecordOwner() != targetScreen.getParentScreen()) if (targetScreen.getMainRecord() != null) ((Record)targetScreen.getMainRecord()).addListener(new FileRemoveBOnCloseHandler(behavior)); // Being very careful (remove this behavior when screen closes) return screenField; } }
public class class_name { public ScreenComponent setupTableLookup(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Rec record, String keyAreaName, Converter fldDisplayFieldDesc, boolean bIncludeBlankOption, boolean bIncludeFormButton) { ScreenComponent screenField = null; if ((!(this instanceof ReferenceField)) && (!(this instanceof CounterField))) Debug.doAssert(false); // error, wrong field type Converter conv = null; if (keyAreaName != null) { // Set up the listener to read the record using the code key (optional) BaseField fldKey = ((Record)record).getKeyArea(keyAreaName).getField(DBConstants.MAIN_KEY_FIELD); // Code if (this.getRecord().getRecordOwner() instanceof ComponentParent) if (!((ComponentParent)this.getRecord().getRecordOwner()).isPrintReport()) { // Only need the read behavior if this is an input field ((Record)record).setKeyArea(keyAreaName); // depends on control dependency: [if], data = [none] MainReadOnlyHandler behavior = new MainReadOnlyHandler(keyAreaName); fldKey.addListener(behavior); // depends on control dependency: [if], data = [none] } if (iDisplayFieldDesc != ScreenConstants.DONT_DISPLAY_DESC) conv = new FieldDescConverter(fldKey, (Converter)converter); // Use the description for this field else conv = fldKey; screenField = conv.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc); // depends on control dependency: [if], data = [none] // screenField = new SEditText(itsLocation, targetScreen, conv, iDisplayFieldDesc); itsLocation = null; // depends on control dependency: [if], data = [none] iDisplayFieldDesc = ScreenConstants.DONT_DISPLAY_DESC; // Display it only once // depends on control dependency: [if], data = [none] } // Set up to display the record description if (fldDisplayFieldDesc != null) { if ((conv == null) && (iDisplayFieldDesc != ScreenConstants.DONT_DISPLAY_DESC)) conv = new FieldDescConverter(fldDisplayFieldDesc, (Converter)converter); // Use the description for this field else conv = fldDisplayFieldDesc; } if (conv != null) { if (itsLocation == null) itsLocation = targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR); ScreenComponent sfDesc = conv.setupDefaultView(itsLocation, targetScreen, iDisplayFieldDesc); // ScreenField sfDesc = new SEditText(itsLocation, targetScreen, conv, iDisplayFieldDesc); sfDesc.setEnabled(false); // depends on control dependency: [if], data = [none] } // Add the lookup button and form (opt) button (Even though SSelectBoxes don't use converter, pass it, so field.enable(true), etc will work) Map<String,Object> properties = new HashMap<String,Object>(); properties.put(ScreenModel.RECORD, record); properties.put(ScreenModel.COMMAND, ThinMenuConstants.LOOKUP); properties.put(ScreenModel.IMAGE, ThinMenuConstants.LOOKUP); screenField = createScreenComponent(ScreenModel.CANNED_BOX, targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties); if (bIncludeFormButton) if (!(targetScreen instanceof GridScreenParent)) { properties = new HashMap<String,Object>(); // depends on control dependency: [if], data = [none] properties.put(ScreenModel.RECORD, record); // depends on control dependency: [if], data = [none] properties.put(ScreenModel.COMMAND, ThinMenuConstants.FORM); // depends on control dependency: [if], data = [none] properties.put(ScreenModel.IMAGE, ThinMenuConstants.FORM); // depends on control dependency: [if], data = [none] screenField = createScreenComponent(ScreenModel.CANNED_BOX, targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties); // depends on control dependency: [if], data = [none] } if ((bIncludeBlankOption) || (keyAreaName == null)) // If there is no code field, the only way to blank a field is to click this button if (!(targetScreen instanceof GridScreenParent)) { properties = new HashMap<String,Object>(); // depends on control dependency: [if], data = [none] properties.put(ScreenModel.FIELD, this); // depends on control dependency: [if], data = [none] properties.put(ScreenModel.COMMAND, ScreenModel.CLEAR); // depends on control dependency: [if], data = [none] properties.put(ScreenModel.IMAGE, ScreenModel.CLEAR); // depends on control dependency: [if], data = [none] screenField = createScreenComponent(ScreenModel.CANNED_BOX, targetScreen.getNextLocation(ScreenConstants.RIGHT_OF_LAST, ScreenConstants.DONT_SET_ANCHOR), targetScreen, converter, ScreenConstants.DONT_DISPLAY_FIELD_DESC, properties); // depends on control dependency: [if], data = [none] } //x can't yet - what if someone wants access to a field. record.selectScreenFields(); // Only select fields that you will display boolean bUpdateRecord = false; if ((record.getDatabaseType() & (DBConstants.REMOTE | DBConstants.USER_DATA)) == (DBConstants.REMOTE | DBConstants.USER_DATA)) bUpdateRecord = true; // Set up the listener to read the current record on a valid main record ReadSecondaryHandler behavior = new ReadSecondaryHandler((Record)record, null, DBConstants.CLOSE_ON_FREE, bUpdateRecord, bIncludeBlankOption); this.addListener(behavior); if (((Record)record).getRecordOwner() != targetScreen) if (this.getRecord().getRecordOwner() != targetScreen) if (this.getRecord().getRecordOwner() != targetScreen.getParentScreen()) if (targetScreen.getMainRecord() != null) ((Record)targetScreen.getMainRecord()).addListener(new FileRemoveBOnCloseHandler(behavior)); // Being very careful (remove this behavior when screen closes) return screenField; } }
public class class_name { protected void adjustGridLayout() { int numColumns = calcNumberOfColumns(); ((GridLayout) fieldEditorParent.getLayout()).numColumns = numColumns; if (fields != null) { for (int i = 0; i < fields.size(); i++) { FieldEditor fieldEditor = fields.get(i); fieldEditor.fillIntoGrid(fieldEditorParent, numColumns); } } } }
public class class_name { protected void adjustGridLayout() { int numColumns = calcNumberOfColumns(); ((GridLayout) fieldEditorParent.getLayout()).numColumns = numColumns; if (fields != null) { for (int i = 0; i < fields.size(); i++) { FieldEditor fieldEditor = fields.get(i); fieldEditor.fillIntoGrid(fieldEditorParent, numColumns); // depends on control dependency: [for], data = [none] } } } }
public class class_name { protected void setParent(Object parent, Object child) { getProxyBuilder().getCurrentFactory().setParent(getProxyBuilder().getChildBuilder(), parent, child); Factory parentFactory = getProxyBuilder().getParentFactory(); if (parentFactory != null) { parentFactory.setChild(getProxyBuilder().getCurrentBuilder(), parent, child); } } }
public class class_name { protected void setParent(Object parent, Object child) { getProxyBuilder().getCurrentFactory().setParent(getProxyBuilder().getChildBuilder(), parent, child); Factory parentFactory = getProxyBuilder().getParentFactory(); if (parentFactory != null) { parentFactory.setChild(getProxyBuilder().getCurrentBuilder(), parent, child); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void start() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "start"); } if (!this.bRunning) { this.ncsaLog.start(); this.frcaLog.start(); this.debugLog.start(); this.bRunning = true; } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "start"); } } }
public class class_name { public void start() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.entry(tc, "start"); // depends on control dependency: [if], data = [none] } if (!this.bRunning) { this.ncsaLog.start(); // depends on control dependency: [if], data = [none] this.frcaLog.start(); // depends on control dependency: [if], data = [none] this.debugLog.start(); // depends on control dependency: [if], data = [none] this.bRunning = true; // depends on control dependency: [if], data = [none] } if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) { Tr.exit(tc, "start"); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static final <T> Set<T> symmetricDifference(Collection<Set<T>> sets) { MapSet<T,Integer> mapSet = new HashMapSet<>(); int index = 0; for (Set<T> set : sets) { for (T t : set) { mapSet.add(t, index); } index++; } final Set<T> diff = new HashSet<>(); mapSet.forEach((t,s)->{if (s.size() == 1) diff.add(t);}); return diff; } }
public class class_name { public static final <T> Set<T> symmetricDifference(Collection<Set<T>> sets) { MapSet<T,Integer> mapSet = new HashMapSet<>(); int index = 0; for (Set<T> set : sets) { for (T t : set) { mapSet.add(t, index); // depends on control dependency: [for], data = [t] } index++; // depends on control dependency: [for], data = [none] } final Set<T> diff = new HashSet<>(); mapSet.forEach((t,s)->{if (s.size() == 1) diff.add(t);}); return diff; } }
public class class_name { public Observable<ServiceResponse<List<TransparentDataEncryptionActivityInner>>> listByConfigurationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } final String transparentDataEncryptionName = "current"; return service.listByConfiguration(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, transparentDataEncryptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<TransparentDataEncryptionActivityInner>>>>() { @Override public Observable<ServiceResponse<List<TransparentDataEncryptionActivityInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<TransparentDataEncryptionActivityInner>> result = listByConfigurationDelegate(response); List<TransparentDataEncryptionActivityInner> items = null; if (result.body() != null) { items = result.body().items(); } ServiceResponse<List<TransparentDataEncryptionActivityInner>> clientResponse = new ServiceResponse<List<TransparentDataEncryptionActivityInner>>(items, result.response()); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponse<List<TransparentDataEncryptionActivityInner>>> listByConfigurationWithServiceResponseAsync(String resourceGroupName, String serverName, String databaseName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null."); } if (resourceGroupName == null) { throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."); } if (serverName == null) { throw new IllegalArgumentException("Parameter serverName is required and cannot be null."); } if (databaseName == null) { throw new IllegalArgumentException("Parameter databaseName is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } final String transparentDataEncryptionName = "current"; return service.listByConfiguration(this.client.subscriptionId(), resourceGroupName, serverName, databaseName, transparentDataEncryptionName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<TransparentDataEncryptionActivityInner>>>>() { @Override public Observable<ServiceResponse<List<TransparentDataEncryptionActivityInner>>> call(Response<ResponseBody> response) { try { ServiceResponse<PageImpl<TransparentDataEncryptionActivityInner>> result = listByConfigurationDelegate(response); List<TransparentDataEncryptionActivityInner> items = null; if (result.body() != null) { items = result.body().items(); // depends on control dependency: [if], data = [none] } ServiceResponse<List<TransparentDataEncryptionActivityInner>> clientResponse = new ServiceResponse<List<TransparentDataEncryptionActivityInner>>(items, result.response()); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { public com.google.protobuf.ByteString getCallerSuppliedUserAgentBytes() { java.lang.Object ref = callerSuppliedUserAgent_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); callerSuppliedUserAgent_ = b; return b; } else { return (com.google.protobuf.ByteString) ref; } } }
public class class_name { public com.google.protobuf.ByteString getCallerSuppliedUserAgentBytes() { java.lang.Object ref = callerSuppliedUserAgent_; if (ref instanceof java.lang.String) { com.google.protobuf.ByteString b = com.google.protobuf.ByteString.copyFromUtf8( (java.lang.String) ref); callerSuppliedUserAgent_ = b; // depends on control dependency: [if], data = [none] return b; // depends on control dependency: [if], data = [none] } else { return (com.google.protobuf.ByteString) ref; // depends on control dependency: [if], data = [none] } } }
public class class_name { public org.grails.datastore.mapping.query.api.Criteria sizeEq(String propertyName, int size) { if (!validateSimpleExpression()) { throwRuntimeException(new IllegalArgumentException("Call to [sizeEq] with propertyName [" + propertyName + "] and size [" + size + "] not allowed here.")); } propertyName = calculatePropertyName(propertyName); addToCriteria(Restrictions.sizeEq(propertyName, size)); return this; } }
public class class_name { public org.grails.datastore.mapping.query.api.Criteria sizeEq(String propertyName, int size) { if (!validateSimpleExpression()) { throwRuntimeException(new IllegalArgumentException("Call to [sizeEq] with propertyName [" + propertyName + "] and size [" + size + "] not allowed here.")); // depends on control dependency: [if], data = [none] } propertyName = calculatePropertyName(propertyName); addToCriteria(Restrictions.sizeEq(propertyName, size)); return this; } }
public class class_name { public void error( String format, Object arg1, Object arg2 ) { if( m_delegate.isErrorEnabled() ) { FormattingTuple tuple = MessageFormatter.format( format, arg1, arg2 ); m_delegate.error( tuple.getMessage(), tuple.getThrowable() ); } } }
public class class_name { public void error( String format, Object arg1, Object arg2 ) { if( m_delegate.isErrorEnabled() ) { FormattingTuple tuple = MessageFormatter.format( format, arg1, arg2 ); m_delegate.error( tuple.getMessage(), tuple.getThrowable() ); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(Contact contact, ProtocolMarshaller protocolMarshaller) { if (contact == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(contact.getContactArn(), CONTACTARN_BINDING); protocolMarshaller.marshall(contact.getDisplayName(), DISPLAYNAME_BINDING); protocolMarshaller.marshall(contact.getFirstName(), FIRSTNAME_BINDING); protocolMarshaller.marshall(contact.getLastName(), LASTNAME_BINDING); protocolMarshaller.marshall(contact.getPhoneNumber(), PHONENUMBER_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(Contact contact, ProtocolMarshaller protocolMarshaller) { if (contact == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(contact.getContactArn(), CONTACTARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(contact.getDisplayName(), DISPLAYNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(contact.getFirstName(), FIRSTNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(contact.getLastName(), LASTNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(contact.getPhoneNumber(), PHONENUMBER_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 { @Override public void onAddJob(JobSpec addedJob) { if (this.filter.apply(addedJob)) { this.delegate.onAddJob(addedJob); } } }
public class class_name { @Override public void onAddJob(JobSpec addedJob) { if (this.filter.apply(addedJob)) { this.delegate.onAddJob(addedJob); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static URI buildUriInClientFormat(ConfigKeyPath configKeyPath, ConfigStore cs, boolean returnURIWithAuthority) { try { if (!returnURIWithAuthority) { return new URI(cs.getStoreURI().getScheme(), null, configKeyPath.getAbsolutePathString(), null, null); } URI storeRoot = cs.getStoreURI(); // if configKeyPath is root, the configKeyPath.getAbsolutePathString().substring(1) will return "" and // will cause the Path creation failure if not handled here if (configKeyPath.isRootPath()) { return storeRoot; } Path absPath = new Path(storeRoot.getPath(), configKeyPath.getAbsolutePathString().substring(1)); // remote the first "/"; return new URI(storeRoot.getScheme(), storeRoot.getAuthority(), absPath.toString(), null, null); } catch (URISyntaxException e) { // should not come here throw new RuntimeException("Can not build URI based on " + configKeyPath); } } }
public class class_name { public static URI buildUriInClientFormat(ConfigKeyPath configKeyPath, ConfigStore cs, boolean returnURIWithAuthority) { try { if (!returnURIWithAuthority) { return new URI(cs.getStoreURI().getScheme(), null, configKeyPath.getAbsolutePathString(), null, null); // depends on control dependency: [if], data = [none] } URI storeRoot = cs.getStoreURI(); // if configKeyPath is root, the configKeyPath.getAbsolutePathString().substring(1) will return "" and // will cause the Path creation failure if not handled here if (configKeyPath.isRootPath()) { return storeRoot; // depends on control dependency: [if], data = [none] } Path absPath = new Path(storeRoot.getPath(), configKeyPath.getAbsolutePathString().substring(1)); // remote the first "/"; return new URI(storeRoot.getScheme(), storeRoot.getAuthority(), absPath.toString(), null, null); // depends on control dependency: [try], data = [none] } catch (URISyntaxException e) { // should not come here throw new RuntimeException("Can not build URI based on " + configKeyPath); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public void link(String featureTable, String tileTable) { if (!isLinked(featureTable, tileTable)) { getOrCreateExtension(); try { if (!featureTileLinkDao.isTableExists()) { geoPackage.createFeatureTileLinkTable(); } FeatureTileLink link = new FeatureTileLink(); link.setFeatureTableName(featureTable); link.setTileTableName(tileTable); featureTileLinkDao.create(link); } catch (SQLException e) { throw new GeoPackageException( "Failed to create feature tile link for GeoPackage: " + geoPackage.getName() + ", Feature Table: " + featureTable + ", Tile Table: " + tileTable, e); } } } }
public class class_name { public void link(String featureTable, String tileTable) { if (!isLinked(featureTable, tileTable)) { getOrCreateExtension(); try { if (!featureTileLinkDao.isTableExists()) { geoPackage.createFeatureTileLinkTable(); // depends on control dependency: [if], data = [none] } FeatureTileLink link = new FeatureTileLink(); link.setFeatureTableName(featureTable); link.setTileTableName(tileTable); featureTileLinkDao.create(link); } catch (SQLException e) { throw new GeoPackageException( "Failed to create feature tile link for GeoPackage: " + geoPackage.getName() + ", Feature Table: " + featureTable + ", Tile Table: " + tileTable, e); } } } }
public class class_name { private static String removeStartingDots(String fileName) { // machte unter OS X/Linux Probleme, zB. bei dem Titel: "....Paula" while (!fileName.isEmpty() && (fileName.startsWith("."))) { fileName = fileName.substring(1, fileName.length()); } return fileName; } }
public class class_name { private static String removeStartingDots(String fileName) { // machte unter OS X/Linux Probleme, zB. bei dem Titel: "....Paula" while (!fileName.isEmpty() && (fileName.startsWith("."))) { fileName = fileName.substring(1, fileName.length()); // depends on control dependency: [while], data = [none] } return fileName; } }
public class class_name { @Override public Collection<? extends NameClassPair> listRemoteInstances(String appName, String moduleName, String compName, String namespaceString, String nameInContext) throws NamingException { Collection<NameClassPair> allInstances = new HashSet<NameClassPair>(); NamingConstants.JavaColonNamespace namespace = NamingConstants.JavaColonNamespace.fromName(namespaceString); ComponentMetaData cmd = getCMD(appName, moduleName, compName, namespace); try { ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().beginContext(cmd); Iterator<RemoteJavaColonNamingHelper> remoteJCNHelpers = remoteJavaColonNamingHelpers.getServices(); while (remoteJCNHelpers.hasNext()) { RemoteJavaColonNamingHelper helper = remoteJCNHelpers.next(); allInstances.addAll(helper.listRemoteInstances(namespace, nameInContext)); } } finally { ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().endContext(); } return allInstances; } }
public class class_name { @Override public Collection<? extends NameClassPair> listRemoteInstances(String appName, String moduleName, String compName, String namespaceString, String nameInContext) throws NamingException { Collection<NameClassPair> allInstances = new HashSet<NameClassPair>(); NamingConstants.JavaColonNamespace namespace = NamingConstants.JavaColonNamespace.fromName(namespaceString); ComponentMetaData cmd = getCMD(appName, moduleName, compName, namespace); try { ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().beginContext(cmd); Iterator<RemoteJavaColonNamingHelper> remoteJCNHelpers = remoteJavaColonNamingHelpers.getServices(); while (remoteJCNHelpers.hasNext()) { RemoteJavaColonNamingHelper helper = remoteJCNHelpers.next(); allInstances.addAll(helper.listRemoteInstances(namespace, nameInContext)); // depends on control dependency: [while], data = [none] } } finally { ComponentMetaDataAccessorImpl.getComponentMetaDataAccessor().endContext(); } return allInstances; } }
public class class_name { private void charArray(char[] vals, int limit) { int len; char c; int left, right; String str; int instrsPerChunk = 6; int maxLen; int used; left = 0; len = vals.length; // len/CHUNK + 1 is conservative because len % CHUNK may be 0 maxLen = 3 + (len / CHUNK + 1) * instrsPerChunk + 1; if (limit < maxLen) { pushMethod(char.class); if (limit < maxLen) { throw new IllegalStateException("array size ..."); } charArray(vals, MAX_INSTRUCTIONS); popMethod(); return; } dest.emit(LDC, len); ClassRef.CHAR.emitArrayNew(dest); dest.emit(ASTORE, buffer); // store array reference while (left < len) { c = vals[left]; if (c != 0) { right = Math.min(len, left + CHUNK); used = right - left; while (used > 0 && vals[left + used - 1] == 0) { used--; } if (used > 0) { str = String.copyValueOf(vals, left, used); dest.emit(LDC, str); dest.emit(LDC, 0); dest.emit(LDC, used); dest.emit(ALOAD, buffer); dest.emit(LDC, left); dest.emit(INVOKEVIRTUAL, GET_CHARS); left = right; } else { // empty chunk, don't save it } } else { left++; } } dest.emit(ALOAD, buffer); } }
public class class_name { private void charArray(char[] vals, int limit) { int len; char c; int left, right; String str; int instrsPerChunk = 6; int maxLen; int used; left = 0; len = vals.length; // len/CHUNK + 1 is conservative because len % CHUNK may be 0 maxLen = 3 + (len / CHUNK + 1) * instrsPerChunk + 1; if (limit < maxLen) { pushMethod(char.class); // depends on control dependency: [if], data = [none] if (limit < maxLen) { throw new IllegalStateException("array size ..."); } charArray(vals, MAX_INSTRUCTIONS); // depends on control dependency: [if], data = [none] popMethod(); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } dest.emit(LDC, len); ClassRef.CHAR.emitArrayNew(dest); dest.emit(ASTORE, buffer); // store array reference while (left < len) { c = vals[left]; // depends on control dependency: [while], data = [none] if (c != 0) { right = Math.min(len, left + CHUNK); // depends on control dependency: [if], data = [none] used = right - left; // depends on control dependency: [if], data = [none] while (used > 0 && vals[left + used - 1] == 0) { used--; // depends on control dependency: [while], data = [none] } if (used > 0) { str = String.copyValueOf(vals, left, used); // depends on control dependency: [if], data = [none] dest.emit(LDC, str); // depends on control dependency: [if], data = [none] dest.emit(LDC, 0); // depends on control dependency: [if], data = [0)] dest.emit(LDC, used); // depends on control dependency: [if], data = [none] dest.emit(ALOAD, buffer); // depends on control dependency: [if], data = [none] dest.emit(LDC, left); // depends on control dependency: [if], data = [none] dest.emit(INVOKEVIRTUAL, GET_CHARS); // depends on control dependency: [if], data = [none] left = right; // depends on control dependency: [if], data = [none] } else { // empty chunk, don't save it } } else { left++; // depends on control dependency: [if], data = [none] } } dest.emit(ALOAD, buffer); } }
public class class_name { @Pure public static LegalTrafficSide getPreferredLegalTrafficSide() { final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkConstants.class); String name = null; if (prefs != null) { name = prefs.get("LEGAL_TRAFFIC_SIDE", null); //$NON-NLS-1$ } if (name != null) { LegalTrafficSide side; try { side = LegalTrafficSide.valueOf(name); } catch (Throwable exception) { side = null; } if (side != null) { return side; } } return LegalTrafficSide.getCurrent(); } }
public class class_name { @Pure public static LegalTrafficSide getPreferredLegalTrafficSide() { final Preferences prefs = Preferences.userNodeForPackage(RoadNetworkConstants.class); String name = null; if (prefs != null) { name = prefs.get("LEGAL_TRAFFIC_SIDE", null); //$NON-NLS-1$ // depends on control dependency: [if], data = [null)] } if (name != null) { LegalTrafficSide side; try { side = LegalTrafficSide.valueOf(name); // depends on control dependency: [try], data = [none] } catch (Throwable exception) { side = null; } // depends on control dependency: [catch], data = [none] if (side != null) { return side; // depends on control dependency: [if], data = [none] } } return LegalTrafficSide.getCurrent(); } }
public class class_name { public synchronized void cancel() { // If the packet collector has already been cancelled, do nothing. if (cancelled) { return; } cancelled = true; connection.removeStanzaCollector(this); notifyAll(); if (collectorToReset != null) { collectorToReset.cancel(); } } }
public class class_name { public synchronized void cancel() { // If the packet collector has already been cancelled, do nothing. if (cancelled) { return; // depends on control dependency: [if], data = [none] } cancelled = true; connection.removeStanzaCollector(this); notifyAll(); if (collectorToReset != null) { collectorToReset.cancel(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public static <T> Set<T> immutableSetView(Set<T> set) { if (set instanceof ImmutableSet<?>) { return set; } return Collections.unmodifiableSet(set); } }
public class class_name { public static <T> Set<T> immutableSetView(Set<T> set) { if (set instanceof ImmutableSet<?>) { return set; // depends on control dependency: [if], data = [none] } return Collections.unmodifiableSet(set); } }
public class class_name { public String getDecodedMessage() { if (message == null) { return null; } return new String(Base64.base64ToByteArray(message), Charset.forName("UTF-8")); } }
public class class_name { public String getDecodedMessage() { if (message == null) { return null; // depends on control dependency: [if], data = [none] } return new String(Base64.base64ToByteArray(message), Charset.forName("UTF-8")); } }
public class class_name { public Duration getStartSlack() { Duration startSlack = (Duration) getCachedValue(TaskField.START_SLACK); if (startSlack == null) { Duration duration = getDuration(); if (duration != null) { startSlack = DateHelper.getVariance(this, getEarlyStart(), getLateStart(), duration.getUnits()); set(TaskField.START_SLACK, startSlack); } } return (startSlack); } }
public class class_name { public Duration getStartSlack() { Duration startSlack = (Duration) getCachedValue(TaskField.START_SLACK); if (startSlack == null) { Duration duration = getDuration(); if (duration != null) { startSlack = DateHelper.getVariance(this, getEarlyStart(), getLateStart(), duration.getUnits()); // depends on control dependency: [if], data = [none] set(TaskField.START_SLACK, startSlack); // depends on control dependency: [if], data = [none] } } return (startSlack); } }
public class class_name { private Object invokeMethod(final Object obj, final Method method, final Object... args) { // turn method to accessible. otherwise, we won't be able to callback to methods // on non-public classes. boolean accessibility = method.isAccessible(); method.setAccessible(true); try { try { return method.invoke(obj, args); } catch (Exception e) { this.log("Error while invoking %s with %s: %s", method, Arrays.toString(args), Throwables.getStackTraceAsString(e)); throw e; } } catch (InvocationTargetException e) { throw new JsiiException(e.getTargetException()); } catch (IllegalAccessException e) { throw new JsiiException(e); } finally { // revert accessibility. method.setAccessible(accessibility); } } }
public class class_name { private Object invokeMethod(final Object obj, final Method method, final Object... args) { // turn method to accessible. otherwise, we won't be able to callback to methods // on non-public classes. boolean accessibility = method.isAccessible(); method.setAccessible(true); try { try { return method.invoke(obj, args); // depends on control dependency: [try], data = [none] } catch (Exception e) { this.log("Error while invoking %s with %s: %s", method, Arrays.toString(args), Throwables.getStackTraceAsString(e)); throw e; } // depends on control dependency: [catch], data = [none] } catch (InvocationTargetException e) { throw new JsiiException(e.getTargetException()); } catch (IllegalAccessException e) { // depends on control dependency: [catch], data = [none] throw new JsiiException(e); } finally { // depends on control dependency: [catch], data = [none] // revert accessibility. method.setAccessible(accessibility); } } }
public class class_name { public String getLocalAddr() { if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){ checkRequestObjectInUse(); } // 321485 String addr = null; if (this._request != null) { addr = this._request.getLocalAddr(); } if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"getLocalAddr", " address --> " + addr); } return addr; } }
public class class_name { public String getLocalAddr() { if (WCCustomProperties.CHECK_REQUEST_OBJECT_IN_USE){ checkRequestObjectInUse(); // depends on control dependency: [if], data = [none] } // 321485 String addr = null; if (this._request != null) { addr = this._request.getLocalAddr(); // depends on control dependency: [if], data = [none] } if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15 logger.logp(Level.FINE, CLASS_NAME,"getLocalAddr", " address --> " + addr); // depends on control dependency: [if], data = [none] } return addr; } }
public class class_name { @Override public void trace(final MessageItem messageItem, final Object... parameters) { if (getLogger().isTraceEnabled(messageItem.getMarker())) { getLogger().trace(messageItem.getMarker(), messageItem.getText(parameters)); } } }
public class class_name { @Override public void trace(final MessageItem messageItem, final Object... parameters) { if (getLogger().isTraceEnabled(messageItem.getMarker())) { getLogger().trace(messageItem.getMarker(), messageItem.getText(parameters)); // depends on control dependency: [if], data = [none] } } }
public class class_name { public IpPermission withPrefixListIds(PrefixListId... prefixListIds) { if (this.prefixListIds == null) { setPrefixListIds(new com.amazonaws.internal.SdkInternalList<PrefixListId>(prefixListIds.length)); } for (PrefixListId ele : prefixListIds) { this.prefixListIds.add(ele); } return this; } }
public class class_name { public IpPermission withPrefixListIds(PrefixListId... prefixListIds) { if (this.prefixListIds == null) { setPrefixListIds(new com.amazonaws.internal.SdkInternalList<PrefixListId>(prefixListIds.length)); // depends on control dependency: [if], data = [none] } for (PrefixListId ele : prefixListIds) { this.prefixListIds.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private static String base64Encode(byte[] data) { char c64[] = new char[data.length * 4 / 3 + 5]; for (int i = 0, k = 0; i < data.length; i += 3, k += 4) { c64[k + 0] = (char) (data[i] >> 2); c64[k + 1] = (char) ((data[i] & 0x03) << 4); c64[k + 2] = c64[k + 3] = 64; if ((i + i) < data.length) { c64[k + 1] |= data[i + 1] >> 4; c64[k + 2] = (char) ((data[i + 1] & 0x0f) << 2); } if ((i + 2) < data.length) { c64[k + 2] |= data[i + 2] >> 6; c64[k + 3] = (char) (data[i + 2] & 0x3f); } for (int j = 0; j < 4; ++j) { c64[k + j] = BASE64_LUT.charAt(c64[k + j]); } } return new String(c64); } }
public class class_name { private static String base64Encode(byte[] data) { char c64[] = new char[data.length * 4 / 3 + 5]; for (int i = 0, k = 0; i < data.length; i += 3, k += 4) { c64[k + 0] = (char) (data[i] >> 2); // depends on control dependency: [for], data = [i] c64[k + 1] = (char) ((data[i] & 0x03) << 4); // depends on control dependency: [for], data = [i] c64[k + 2] = c64[k + 3] = 64; // depends on control dependency: [for], data = [none] if ((i + i) < data.length) { c64[k + 1] |= data[i + 1] >> 4; // depends on control dependency: [if], data = [none] c64[k + 2] = (char) ((data[i + 1] & 0x0f) << 2); // depends on control dependency: [if], data = [none] } if ((i + 2) < data.length) { c64[k + 2] |= data[i + 2] >> 6; // depends on control dependency: [if], data = [none] c64[k + 3] = (char) (data[i + 2] & 0x3f); // depends on control dependency: [if], data = [none] } for (int j = 0; j < 4; ++j) { c64[k + j] = BASE64_LUT.charAt(c64[k + j]); // depends on control dependency: [for], data = [j] } } return new String(c64); } }
public class class_name { public Collection<Text> split(char separator) { int pointer = pos; int limit = pos + len; int mark = pointer; ArrayList<Text> tokens = new ArrayList<Text>(); while (pointer < limit) { if (chars[pointer] == separator) { tokens.add(new Text(chars, mark, pointer - mark)); mark = pointer + 1; } pointer++; } tokens.add(new Text(chars, mark, limit - mark)); return tokens; } }
public class class_name { public Collection<Text> split(char separator) { int pointer = pos; int limit = pos + len; int mark = pointer; ArrayList<Text> tokens = new ArrayList<Text>(); while (pointer < limit) { if (chars[pointer] == separator) { tokens.add(new Text(chars, mark, pointer - mark)); // depends on control dependency: [if], data = [none] mark = pointer + 1; // depends on control dependency: [if], data = [none] } pointer++; // depends on control dependency: [while], data = [none] } tokens.add(new Text(chars, mark, limit - mark)); return tokens; } }
public class class_name { public void marshall(FileSystem fileSystem, ProtocolMarshaller protocolMarshaller) { if (fileSystem == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(fileSystem.getOwnerId(), OWNERID_BINDING); protocolMarshaller.marshall(fileSystem.getCreationTime(), CREATIONTIME_BINDING); protocolMarshaller.marshall(fileSystem.getFileSystemId(), FILESYSTEMID_BINDING); protocolMarshaller.marshall(fileSystem.getFileSystemType(), FILESYSTEMTYPE_BINDING); protocolMarshaller.marshall(fileSystem.getLifecycle(), LIFECYCLE_BINDING); protocolMarshaller.marshall(fileSystem.getFailureDetails(), FAILUREDETAILS_BINDING); protocolMarshaller.marshall(fileSystem.getStorageCapacity(), STORAGECAPACITY_BINDING); protocolMarshaller.marshall(fileSystem.getVpcId(), VPCID_BINDING); protocolMarshaller.marshall(fileSystem.getSubnetIds(), SUBNETIDS_BINDING); protocolMarshaller.marshall(fileSystem.getNetworkInterfaceIds(), NETWORKINTERFACEIDS_BINDING); protocolMarshaller.marshall(fileSystem.getDNSName(), DNSNAME_BINDING); protocolMarshaller.marshall(fileSystem.getKmsKeyId(), KMSKEYID_BINDING); protocolMarshaller.marshall(fileSystem.getResourceARN(), RESOURCEARN_BINDING); protocolMarshaller.marshall(fileSystem.getTags(), TAGS_BINDING); protocolMarshaller.marshall(fileSystem.getWindowsConfiguration(), WINDOWSCONFIGURATION_BINDING); protocolMarshaller.marshall(fileSystem.getLustreConfiguration(), LUSTRECONFIGURATION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(FileSystem fileSystem, ProtocolMarshaller protocolMarshaller) { if (fileSystem == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(fileSystem.getOwnerId(), OWNERID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getCreationTime(), CREATIONTIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getFileSystemId(), FILESYSTEMID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getFileSystemType(), FILESYSTEMTYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getLifecycle(), LIFECYCLE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getFailureDetails(), FAILUREDETAILS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getStorageCapacity(), STORAGECAPACITY_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getVpcId(), VPCID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getSubnetIds(), SUBNETIDS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getNetworkInterfaceIds(), NETWORKINTERFACEIDS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getDNSName(), DNSNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getKmsKeyId(), KMSKEYID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getResourceARN(), RESOURCEARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getTags(), TAGS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getWindowsConfiguration(), WINDOWSCONFIGURATION_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(fileSystem.getLustreConfiguration(), LUSTRECONFIGURATION_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 { @Deprecated public String getStrVal(String name) { if (getValue(name) instanceof String) { return (String)getValue(name); } return String.valueOf(getValue(name)); } }
public class class_name { @Deprecated public String getStrVal(String name) { if (getValue(name) instanceof String) { return (String)getValue(name); // depends on control dependency: [if], data = [none] } return String.valueOf(getValue(name)); } }
public class class_name { @VisibleForTesting protected CounterData createCounterData(final String counterName) { this.counterNameValidator.validateCounterName(counterName); final Key<CounterData> counterKey = CounterData.key(counterName); // Perform a transactional GET to see if the counter exists. If it does, throw an exception. Otherwise, create // the counter in the same TX. return ObjectifyService.ofy().transact(new Work<CounterData>() { @Override public CounterData run() { final CounterData loadedCounterData = ObjectifyService.ofy().load().key(counterKey).now(); if (loadedCounterData == null) { final CounterData counterData = new CounterData(counterName, config.getNumInitialShards()); ObjectifyService.ofy().save().entity(counterData).now(); return counterData; } else { throw new CounterExistsException(counterName); } } }); } }
public class class_name { @VisibleForTesting protected CounterData createCounterData(final String counterName) { this.counterNameValidator.validateCounterName(counterName); final Key<CounterData> counterKey = CounterData.key(counterName); // Perform a transactional GET to see if the counter exists. If it does, throw an exception. Otherwise, create // the counter in the same TX. return ObjectifyService.ofy().transact(new Work<CounterData>() { @Override public CounterData run() { final CounterData loadedCounterData = ObjectifyService.ofy().load().key(counterKey).now(); if (loadedCounterData == null) { final CounterData counterData = new CounterData(counterName, config.getNumInitialShards()); ObjectifyService.ofy().save().entity(counterData).now(); // depends on control dependency: [if], data = [none] return counterData; // depends on control dependency: [if], data = [none] } else { throw new CounterExistsException(counterName); } } }); } }
public class class_name { @CheckReturnValue LocalSyncWriteModelContainer desyncDocumentsFromRemote( final NamespaceSynchronizationConfig nsConfig, final BsonValue... documentIds) { this.waitUntilInitialized(); final MongoNamespace namespace = nsConfig.getNamespace(); final Lock lock = this.syncConfig.getNamespaceConfig(namespace).getLock().writeLock(); lock.lock(); final DeleteManyModel<CoreDocumentSynchronizationConfig> configsToDelete; try { ongoingOperationsGroup.enter(); configsToDelete = syncConfig.removeSynchronizedDocuments(namespace, documentIds); } finally { lock.unlock(); ongoingOperationsGroup.exit(); } LocalSyncWriteModelContainer container = null; if (configsToDelete != null) { container = newWriteModelContainer(nsConfig); container.addDocIDs(documentIds); container.addLocalWrite(new DeleteManyModel<>( new BsonDocument("_id", new BsonDocument("$in", new BsonArray(Arrays.asList(documentIds)))) )); container.addConfigWrite(configsToDelete); } return container; } }
public class class_name { @CheckReturnValue LocalSyncWriteModelContainer desyncDocumentsFromRemote( final NamespaceSynchronizationConfig nsConfig, final BsonValue... documentIds) { this.waitUntilInitialized(); final MongoNamespace namespace = nsConfig.getNamespace(); final Lock lock = this.syncConfig.getNamespaceConfig(namespace).getLock().writeLock(); lock.lock(); final DeleteManyModel<CoreDocumentSynchronizationConfig> configsToDelete; try { ongoingOperationsGroup.enter(); // depends on control dependency: [try], data = [none] configsToDelete = syncConfig.removeSynchronizedDocuments(namespace, documentIds); // depends on control dependency: [try], data = [none] } finally { lock.unlock(); ongoingOperationsGroup.exit(); } LocalSyncWriteModelContainer container = null; if (configsToDelete != null) { container = newWriteModelContainer(nsConfig); // depends on control dependency: [if], data = [none] container.addDocIDs(documentIds); // depends on control dependency: [if], data = [none] container.addLocalWrite(new DeleteManyModel<>( new BsonDocument("_id", new BsonDocument("$in", new BsonArray(Arrays.asList(documentIds)))) )); // depends on control dependency: [if], data = [none] container.addConfigWrite(configsToDelete); // depends on control dependency: [if], data = [(configsToDelete] } return container; } }
public class class_name { public static String suppressWhiteSpace(String str) { int len = str.length(); StringBuilder sb = new StringBuilder(len); // boolean wasWS=false; char c; char buffer = 0; for (int i = 0; i < len; i++) { c = str.charAt(i); if (c == '\n' || c == '\r') buffer = '\n'; else if (isWhiteSpace(c)) { if (buffer == 0) buffer = c; } else { if (buffer != 0) { sb.append(buffer); buffer = 0; } sb.append(c); } // sb.append(c); } if (buffer != 0) sb.append(buffer); return sb.toString(); } }
public class class_name { public static String suppressWhiteSpace(String str) { int len = str.length(); StringBuilder sb = new StringBuilder(len); // boolean wasWS=false; char c; char buffer = 0; for (int i = 0; i < len; i++) { c = str.charAt(i); // depends on control dependency: [for], data = [i] if (c == '\n' || c == '\r') buffer = '\n'; else if (isWhiteSpace(c)) { if (buffer == 0) buffer = c; } else { if (buffer != 0) { sb.append(buffer); // depends on control dependency: [if], data = [(buffer] buffer = 0; // depends on control dependency: [if], data = [none] } sb.append(c); // depends on control dependency: [if], data = [none] } // sb.append(c); } if (buffer != 0) sb.append(buffer); return sb.toString(); } }
public class class_name { private void countLocalStoresLoadsAndIncrements(int[] localStoreCount, int[] localLoadCount, int[] localIncrementCount, CFG cfg) { for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) { Location location = i.next(); if (location.getBasicBlock().isExceptionHandler()) { continue; } boolean isStore = isStore(location); boolean isLoad = isLoad(location); if (!isStore && !isLoad) { continue; } IndexedInstruction ins = (IndexedInstruction) location.getHandle().getInstruction(); int local = ins.getIndex(); if (ins instanceof IINC) { localStoreCount[local]++; localLoadCount[local]++; localIncrementCount[local]++; } else if (isStore) { localStoreCount[local]++; } else { localLoadCount[local]++; } } } }
public class class_name { private void countLocalStoresLoadsAndIncrements(int[] localStoreCount, int[] localLoadCount, int[] localIncrementCount, CFG cfg) { for (Iterator<Location> i = cfg.locationIterator(); i.hasNext();) { Location location = i.next(); if (location.getBasicBlock().isExceptionHandler()) { continue; } boolean isStore = isStore(location); boolean isLoad = isLoad(location); if (!isStore && !isLoad) { continue; } IndexedInstruction ins = (IndexedInstruction) location.getHandle().getInstruction(); int local = ins.getIndex(); if (ins instanceof IINC) { localStoreCount[local]++; // depends on control dependency: [if], data = [none] localLoadCount[local]++; // depends on control dependency: [if], data = [none] localIncrementCount[local]++; // depends on control dependency: [if], data = [none] } else if (isStore) { localStoreCount[local]++; // depends on control dependency: [if], data = [none] } else { localLoadCount[local]++; // depends on control dependency: [if], data = [none] } } } }
public class class_name { public boolean addAll(Collection<? extends T> toAdd) { boolean changed = false; for (T elem : toAdd) { changed |= addElem(elem); } expandIfNecessary(); return changed; } }
public class class_name { public boolean addAll(Collection<? extends T> toAdd) { boolean changed = false; for (T elem : toAdd) { changed |= addElem(elem); // depends on control dependency: [for], data = [elem] } expandIfNecessary(); return changed; } }
public class class_name { public Discover firstAirDateYearGte(int year) { if (checkYear(year)) { params.add(Param.FIRST_AIR_DATE_GTE, year); } return this; } }
public class class_name { public Discover firstAirDateYearGte(int year) { if (checkYear(year)) { params.add(Param.FIRST_AIR_DATE_GTE, year); // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { final Document createDocument(List<String> row, DocumentFactory documentFactory) { String id = StringUtils.EMPTY; String content = StringUtils.EMPTY; Language language = documentFactory.getDefaultLanguage(); Map<AttributeType, Object> attributeMap = new HashMap<>(); String idField = Config.get(configProperty, "idField").asString("ID").toUpperCase(); String contentField = Config.get(configProperty, "contentField").asString("CONTENT").toUpperCase(); String languageField = Config.get(configProperty, "languageField").asString("LANGUAGE").toUpperCase(); Index<String> fields = getFieldNames(); for (int i = 0; i < row.size() && i < fieldNames.size(); i++) { String field = row.get(i); String fieldName = fields.get(i); if (idField.equalsIgnoreCase(fieldName)) { id = field; } else if (contentField.equalsIgnoreCase(fieldName)) { content = field; } else if (languageField.equalsIgnoreCase(fieldName)) { language = Language.fromString(field); } else { AttributeType attributeType = AttributeType.create(fieldName); attributeMap.put(attributeType, attributeType.getValueType().decode(field)); } } return documentFactory.create(id, content, language, attributeMap); } }
public class class_name { final Document createDocument(List<String> row, DocumentFactory documentFactory) { String id = StringUtils.EMPTY; String content = StringUtils.EMPTY; Language language = documentFactory.getDefaultLanguage(); Map<AttributeType, Object> attributeMap = new HashMap<>(); String idField = Config.get(configProperty, "idField").asString("ID").toUpperCase(); String contentField = Config.get(configProperty, "contentField").asString("CONTENT").toUpperCase(); String languageField = Config.get(configProperty, "languageField").asString("LANGUAGE").toUpperCase(); Index<String> fields = getFieldNames(); for (int i = 0; i < row.size() && i < fieldNames.size(); i++) { String field = row.get(i); String fieldName = fields.get(i); if (idField.equalsIgnoreCase(fieldName)) { id = field; // depends on control dependency: [if], data = [none] } else if (contentField.equalsIgnoreCase(fieldName)) { content = field; // depends on control dependency: [if], data = [none] } else if (languageField.equalsIgnoreCase(fieldName)) { language = Language.fromString(field); // depends on control dependency: [if], data = [none] } else { AttributeType attributeType = AttributeType.create(fieldName); attributeMap.put(attributeType, attributeType.getValueType().decode(field)); // depends on control dependency: [if], data = [none] } } return documentFactory.create(id, content, language, attributeMap); } }
public class class_name { public void marshall(UpdateModelRequest updateModelRequest, ProtocolMarshaller protocolMarshaller) { if (updateModelRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateModelRequest.getRestApiId(), RESTAPIID_BINDING); protocolMarshaller.marshall(updateModelRequest.getModelName(), MODELNAME_BINDING); protocolMarshaller.marshall(updateModelRequest.getPatchOperations(), PATCHOPERATIONS_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(UpdateModelRequest updateModelRequest, ProtocolMarshaller protocolMarshaller) { if (updateModelRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(updateModelRequest.getRestApiId(), RESTAPIID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateModelRequest.getModelName(), MODELNAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(updateModelRequest.getPatchOperations(), PATCHOPERATIONS_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 ListPoliciesResult withPolicyList(PolicySummary... policyList) { if (this.policyList == null) { setPolicyList(new java.util.ArrayList<PolicySummary>(policyList.length)); } for (PolicySummary ele : policyList) { this.policyList.add(ele); } return this; } }
public class class_name { public ListPoliciesResult withPolicyList(PolicySummary... policyList) { if (this.policyList == null) { setPolicyList(new java.util.ArrayList<PolicySummary>(policyList.length)); // depends on control dependency: [if], data = [none] } for (PolicySummary ele : policyList) { this.policyList.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { private void removeEntryFromAuthCacheForUser(HttpServletRequest req, HttpServletResponse res) { getAuthCacheService(); if (authCacheService == null) { return; } String user = req.getRemoteUser(); if (user == null) { Principal p = req.getUserPrincipal(); if (p != null) user = p.getName(); } if (user != null) { if (collabUtils != null) { String realm = collabUtils.getUserRegistryRealm(securityServiceRef); if (!user.contains(realm + ":")) { user = realm + ":" + user; } } authCacheService.remove(user); } } }
public class class_name { private void removeEntryFromAuthCacheForUser(HttpServletRequest req, HttpServletResponse res) { getAuthCacheService(); if (authCacheService == null) { return; // depends on control dependency: [if], data = [none] } String user = req.getRemoteUser(); if (user == null) { Principal p = req.getUserPrincipal(); if (p != null) user = p.getName(); } if (user != null) { if (collabUtils != null) { String realm = collabUtils.getUserRegistryRealm(securityServiceRef); if (!user.contains(realm + ":")) { user = realm + ":" + user; // depends on control dependency: [if], data = [none] } } authCacheService.remove(user); // depends on control dependency: [if], data = [(user] } } }
public class class_name { @Search() public List<Patient> findPatientsByName(@RequiredParam(name = Patient.SP_FAMILY) StringDt theFamilyName) { LinkedList<Patient> retVal = new LinkedList<Patient>(); /* * Look for all patients matching the name */ for (Deque<Patient> nextPatientList : myIdToPatientVersions.values()) { Patient nextPatient = nextPatientList.getLast(); NAMELOOP: for (HumanNameDt nextName : nextPatient.getName()) { for (StringDt nextFamily : nextName.getFamily()) { if (theFamilyName.equals(nextFamily)) { retVal.add(nextPatient); break NAMELOOP; } } } } return retVal; } }
public class class_name { @Search() public List<Patient> findPatientsByName(@RequiredParam(name = Patient.SP_FAMILY) StringDt theFamilyName) { LinkedList<Patient> retVal = new LinkedList<Patient>(); /* * Look for all patients matching the name */ for (Deque<Patient> nextPatientList : myIdToPatientVersions.values()) { Patient nextPatient = nextPatientList.getLast(); NAMELOOP: for (HumanNameDt nextName : nextPatient.getName()) { for (StringDt nextFamily : nextName.getFamily()) { if (theFamilyName.equals(nextFamily)) { retVal.add(nextPatient); // depends on control dependency: [if], data = [none] break NAMELOOP; } } } } return retVal; } }
public class class_name { @Override public EClass getIfcTransportElement() { if (ifcTransportElementEClass == null) { ifcTransportElementEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(730); } return ifcTransportElementEClass; } }
public class class_name { @Override public EClass getIfcTransportElement() { if (ifcTransportElementEClass == null) { ifcTransportElementEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(730); // depends on control dependency: [if], data = [none] } return ifcTransportElementEClass; } }
public class class_name { public Object getJavaDefaultValueDefault() { if (field.getType() == boolean.class) { return DEFAULT_VALUE_BOOLEAN; } else if (field.getType() == byte.class || field.getType() == Byte.class) { return DEFAULT_VALUE_BYTE; } else if (field.getType() == char.class || field.getType() == Character.class) { return DEFAULT_VALUE_CHAR; } else if (field.getType() == short.class || field.getType() == Short.class) { return DEFAULT_VALUE_SHORT; } else if (field.getType() == int.class || field.getType() == Integer.class) { return DEFAULT_VALUE_INT; } else if (field.getType() == long.class || field.getType() == Long.class) { return DEFAULT_VALUE_LONG; } else if (field.getType() == float.class || field.getType() == Float.class) { return DEFAULT_VALUE_FLOAT; } else if (field.getType() == double.class || field.getType() == Double.class) { return DEFAULT_VALUE_DOUBLE; } else { return null; } } }
public class class_name { public Object getJavaDefaultValueDefault() { if (field.getType() == boolean.class) { return DEFAULT_VALUE_BOOLEAN; // depends on control dependency: [if], data = [none] } else if (field.getType() == byte.class || field.getType() == Byte.class) { return DEFAULT_VALUE_BYTE; // depends on control dependency: [if], data = [none] } else if (field.getType() == char.class || field.getType() == Character.class) { return DEFAULT_VALUE_CHAR; // depends on control dependency: [if], data = [none] } else if (field.getType() == short.class || field.getType() == Short.class) { return DEFAULT_VALUE_SHORT; // depends on control dependency: [if], data = [none] } else if (field.getType() == int.class || field.getType() == Integer.class) { return DEFAULT_VALUE_INT; // depends on control dependency: [if], data = [none] } else if (field.getType() == long.class || field.getType() == Long.class) { return DEFAULT_VALUE_LONG; // depends on control dependency: [if], data = [none] } else if (field.getType() == float.class || field.getType() == Float.class) { return DEFAULT_VALUE_FLOAT; // depends on control dependency: [if], data = [none] } else if (field.getType() == double.class || field.getType() == Double.class) { return DEFAULT_VALUE_DOUBLE; // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { public void marshall(DetectTextRequest detectTextRequest, ProtocolMarshaller protocolMarshaller) { if (detectTextRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(detectTextRequest.getImage(), IMAGE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DetectTextRequest detectTextRequest, ProtocolMarshaller protocolMarshaller) { if (detectTextRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(detectTextRequest.getImage(), IMAGE_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 MetricTimeSeries getMetricTimeSeries(String actualMetricPath) { Map<String, String> actualDimensions = new HashMap<>(); actualDimensions.putAll(dimensions); String[] path = actualMetricPath.split("\\|"); for (int i = 0; i < dimensionsPath.length; i++) { if ("-".equals(dimensionsPath[i])) { continue; } actualDimensions.put(dimensionsPath[i], path[i]); } return new MetricTimeSeries(path[path.length - 1], actualDimensions); } }
public class class_name { public MetricTimeSeries getMetricTimeSeries(String actualMetricPath) { Map<String, String> actualDimensions = new HashMap<>(); actualDimensions.putAll(dimensions); String[] path = actualMetricPath.split("\\|"); for (int i = 0; i < dimensionsPath.length; i++) { if ("-".equals(dimensionsPath[i])) { continue; } actualDimensions.put(dimensionsPath[i], path[i]); // depends on control dependency: [for], data = [i] } return new MetricTimeSeries(path[path.length - 1], actualDimensions); } }
public class class_name { public ModelAdapter<Model, Item> setNewList(List<Model> list, boolean retainFilter) { List<Item> items = intercept(list); if (mUseIdDistributor) { getIdDistributor().checkIds(items); } //reset the filter CharSequence filter = null; if (getItemFilter().getConstraint() != null) { filter = getItemFilter().getConstraint(); getItemFilter().performFiltering(null); } mapPossibleTypes(items); boolean publishResults = filter != null && retainFilter; if (publishResults) { getItemFilter().publishResults(filter, getItemFilter().performFiltering(filter)); } mItems.setNewList(items, !publishResults); return this; } }
public class class_name { public ModelAdapter<Model, Item> setNewList(List<Model> list, boolean retainFilter) { List<Item> items = intercept(list); if (mUseIdDistributor) { getIdDistributor().checkIds(items); // depends on control dependency: [if], data = [none] } //reset the filter CharSequence filter = null; if (getItemFilter().getConstraint() != null) { filter = getItemFilter().getConstraint(); // depends on control dependency: [if], data = [none] getItemFilter().performFiltering(null); // depends on control dependency: [if], data = [null)] } mapPossibleTypes(items); boolean publishResults = filter != null && retainFilter; if (publishResults) { getItemFilter().publishResults(filter, getItemFilter().performFiltering(filter)); // depends on control dependency: [if], data = [none] } mItems.setNewList(items, !publishResults); return this; } }
public class class_name { public Set<String> getActivitiesWithRoutingConstraints(){ Set<String> result = new HashSet<>(); String propertyValue = getProperty(ConstraintContextProperty.ACTIVITIES_WITH_CONSTRAINTS); if(propertyValue == null) return result; StringTokenizer activityTokens = StringUtils.splitArrayString(propertyValue, " "); while(activityTokens.hasMoreTokens()){ result.add(activityTokens.nextToken()); } return result; } }
public class class_name { public Set<String> getActivitiesWithRoutingConstraints(){ Set<String> result = new HashSet<>(); String propertyValue = getProperty(ConstraintContextProperty.ACTIVITIES_WITH_CONSTRAINTS); if(propertyValue == null) return result; StringTokenizer activityTokens = StringUtils.splitArrayString(propertyValue, " "); while(activityTokens.hasMoreTokens()){ result.add(activityTokens.nextToken()); // depends on control dependency: [while], data = [none] } return result; } }
public class class_name { public static <T extends Annotation> T findAnnotation(Method m, Class<T> annotationClazz) { T annotation = m.getAnnotation(annotationClazz); if (annotation != null) { return annotation; } if (stereotypeAnnotationClass != null) { List<Class<?>> annotations = new ArrayList<>(); for (Annotation a : m.getAnnotations()) { annotations.add(a.annotationType()); } return findAnnotation(annotations, annotationClazz); } return null; } }
public class class_name { public static <T extends Annotation> T findAnnotation(Method m, Class<T> annotationClazz) { T annotation = m.getAnnotation(annotationClazz); if (annotation != null) { return annotation; // depends on control dependency: [if], data = [none] } if (stereotypeAnnotationClass != null) { List<Class<?>> annotations = new ArrayList<>(); // depends on control dependency: [if], data = [none] for (Annotation a : m.getAnnotations()) { annotations.add(a.annotationType()); // depends on control dependency: [for], data = [a] } return findAnnotation(annotations, annotationClazz); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { public boolean executeJob(String jobName, String jobGroupName) { try { this.scheduler.triggerJob(new JobKey(jobName, jobGroupName)); return true; } catch (SchedulerException e) { logger.error("error executing job: " + jobName + " in group: " + jobGroupName, e); } return false; } }
public class class_name { public boolean executeJob(String jobName, String jobGroupName) { try { this.scheduler.triggerJob(new JobKey(jobName, jobGroupName)); // depends on control dependency: [try], data = [none] return true; // depends on control dependency: [try], data = [none] } catch (SchedulerException e) { logger.error("error executing job: " + jobName + " in group: " + jobGroupName, e); } // depends on control dependency: [catch], data = [none] return false; } }
public class class_name { @Override public T decode(BsonReader reader, DecoderContext decoderContext) { T instance = instantiate(); reader.readStartDocument(); while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) { String fieldName = reader.readName(); BsoneeBaseSetter<T> bsoneeBaseSetter = settersByName.get(fieldName); if (bsoneeBaseSetter != null) { bsoneeBaseSetter.set(instance, reader, decoderContext); } else { // TODO Check options whether to throw an exception or not. By default we skip it :) logger.warn("No setter for " + fieldName); reader.skipValue(); } } reader.readEndDocument(); return instance; } }
public class class_name { @Override public T decode(BsonReader reader, DecoderContext decoderContext) { T instance = instantiate(); reader.readStartDocument(); while (reader.readBsonType() != BsonType.END_OF_DOCUMENT) { String fieldName = reader.readName(); BsoneeBaseSetter<T> bsoneeBaseSetter = settersByName.get(fieldName); if (bsoneeBaseSetter != null) { bsoneeBaseSetter.set(instance, reader, decoderContext); // depends on control dependency: [if], data = [none] } else { // TODO Check options whether to throw an exception or not. By default we skip it :) logger.warn("No setter for " + fieldName); // depends on control dependency: [if], data = [none] reader.skipValue(); // depends on control dependency: [if], data = [none] } } reader.readEndDocument(); return instance; } }
public class class_name { public void addKeyword(String keyword) { if (taxonomy.concepts.containsKey(keyword)) { throw new IllegalArgumentException(String.format("Concept %s already exists.", keyword)); } taxonomy.concepts.put(keyword, this); if (synset == null) { synset = new TreeSet<>(); } synset.add(keyword); } }
public class class_name { public void addKeyword(String keyword) { if (taxonomy.concepts.containsKey(keyword)) { throw new IllegalArgumentException(String.format("Concept %s already exists.", keyword)); } taxonomy.concepts.put(keyword, this); if (synset == null) { synset = new TreeSet<>(); // depends on control dependency: [if], data = [none] } synset.add(keyword); } }
public class class_name { public void doAdd(@FormGroup("dataMediaSourceInfo") Group dataMediaSourceInfo, @FormField(name = "formDataMediaSourceError", group = "dataMediaSourceInfo") CustomErrors err, Navigator nav) throws Exception { DataMediaSource dataMediaSource = new DataMediaSource(); dataMediaSourceInfo.setProperties(dataMediaSource); if (dataMediaSource.getType().isMysql() || dataMediaSource.getType().isOracle()) { DbMediaSource dbMediaSource = new DbMediaSource(); dataMediaSourceInfo.setProperties(dbMediaSource); if (dataMediaSource.getType().isMysql()) { dbMediaSource.setDriver("com.mysql.jdbc.Driver"); } else if (dataMediaSource.getType().isOracle()) { dbMediaSource.setDriver("oracle.jdbc.driver.OracleDriver"); } try { dataMediaSourceService.create(dbMediaSource); } catch (RepeatConfigureException rce) { err.setMessage("invalidDataMediaSource"); return; } } else if (dataMediaSource.getType().isNapoli() || dataMediaSource.getType().isMq()) { MqMediaSource mqMediaSource = new MqMediaSource(); dataMediaSourceInfo.setProperties(mqMediaSource); try { dataMediaSourceService.create(mqMediaSource); } catch (RepeatConfigureException rce) { err.setMessage("invalidDataMediaSource"); return; } } nav.redirectTo(WebConstant.DATA_MEDIA_SOURCE_LIST_LINK); } }
public class class_name { public void doAdd(@FormGroup("dataMediaSourceInfo") Group dataMediaSourceInfo, @FormField(name = "formDataMediaSourceError", group = "dataMediaSourceInfo") CustomErrors err, Navigator nav) throws Exception { DataMediaSource dataMediaSource = new DataMediaSource(); dataMediaSourceInfo.setProperties(dataMediaSource); if (dataMediaSource.getType().isMysql() || dataMediaSource.getType().isOracle()) { DbMediaSource dbMediaSource = new DbMediaSource(); dataMediaSourceInfo.setProperties(dbMediaSource); if (dataMediaSource.getType().isMysql()) { dbMediaSource.setDriver("com.mysql.jdbc.Driver"); // depends on control dependency: [if], data = [none] } else if (dataMediaSource.getType().isOracle()) { dbMediaSource.setDriver("oracle.jdbc.driver.OracleDriver"); // depends on control dependency: [if], data = [none] } try { dataMediaSourceService.create(dbMediaSource); // depends on control dependency: [try], data = [none] } catch (RepeatConfigureException rce) { err.setMessage("invalidDataMediaSource"); return; } // depends on control dependency: [catch], data = [none] } else if (dataMediaSource.getType().isNapoli() || dataMediaSource.getType().isMq()) { MqMediaSource mqMediaSource = new MqMediaSource(); dataMediaSourceInfo.setProperties(mqMediaSource); try { dataMediaSourceService.create(mqMediaSource); // depends on control dependency: [try], data = [none] } catch (RepeatConfigureException rce) { err.setMessage("invalidDataMediaSource"); return; } // depends on control dependency: [catch], data = [none] } nav.redirectTo(WebConstant.DATA_MEDIA_SOURCE_LIST_LINK); } }
public class class_name { public static SubscribeRequest createSubscribeReq(List<SubscribeElement> list) { if (list == null) { throw new NullPointerException("list is not allowed to be null"); } SubscribeRequest ret = createSubscribeReq(); for (SubscribeElement el : list) { ret.addSubscribeElement(el); } return ret; } }
public class class_name { public static SubscribeRequest createSubscribeReq(List<SubscribeElement> list) { if (list == null) { throw new NullPointerException("list is not allowed to be null"); } SubscribeRequest ret = createSubscribeReq(); for (SubscribeElement el : list) { ret.addSubscribeElement(el); // depends on control dependency: [for], data = [el] } return ret; } }
public class class_name { public Observable<ServiceResponseWithHeaders<Void, JobSchedulePatchHeaders>> patchWithServiceResponseAsync(String jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter) { if (this.client.batchUrl() == null) { throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null."); } if (jobScheduleId == null) { throw new IllegalArgumentException("Parameter jobScheduleId is required and cannot be null."); } if (jobSchedulePatchParameter == null) { throw new IllegalArgumentException("Parameter jobSchedulePatchParameter is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(jobSchedulePatchParameter); final JobSchedulePatchOptions jobSchedulePatchOptions = null; Integer timeout = null; UUID clientRequestId = null; Boolean returnClientRequestId = null; DateTime ocpDate = null; String ifMatch = null; String ifNoneMatch = null; DateTime ifModifiedSince = null; DateTime ifUnmodifiedSince = null; String parameterizedHost = Joiner.on(", ").join("{batchUrl}", this.client.batchUrl()); DateTimeRfc1123 ocpDateConverted = null; if (ocpDate != null) { ocpDateConverted = new DateTimeRfc1123(ocpDate); } DateTimeRfc1123 ifModifiedSinceConverted = null; if (ifModifiedSince != null) { ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince); } DateTimeRfc1123 ifUnmodifiedSinceConverted = null; if (ifUnmodifiedSince != null) { ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince); } return service.patch(jobScheduleId, jobSchedulePatchParameter, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Void, JobSchedulePatchHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<Void, JobSchedulePatchHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<Void, JobSchedulePatchHeaders> clientResponse = patchDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponseWithHeaders<Void, JobSchedulePatchHeaders>> patchWithServiceResponseAsync(String jobScheduleId, JobSchedulePatchParameter jobSchedulePatchParameter) { if (this.client.batchUrl() == null) { throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null."); } if (jobScheduleId == null) { throw new IllegalArgumentException("Parameter jobScheduleId is required and cannot be null."); } if (jobSchedulePatchParameter == null) { throw new IllegalArgumentException("Parameter jobSchedulePatchParameter is required and cannot be null."); } if (this.client.apiVersion() == null) { throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null."); } Validator.validate(jobSchedulePatchParameter); final JobSchedulePatchOptions jobSchedulePatchOptions = null; Integer timeout = null; UUID clientRequestId = null; Boolean returnClientRequestId = null; DateTime ocpDate = null; String ifMatch = null; String ifNoneMatch = null; DateTime ifModifiedSince = null; DateTime ifUnmodifiedSince = null; String parameterizedHost = Joiner.on(", ").join("{batchUrl}", this.client.batchUrl()); DateTimeRfc1123 ocpDateConverted = null; if (ocpDate != null) { ocpDateConverted = new DateTimeRfc1123(ocpDate); // depends on control dependency: [if], data = [(ocpDate] } DateTimeRfc1123 ifModifiedSinceConverted = null; if (ifModifiedSince != null) { ifModifiedSinceConverted = new DateTimeRfc1123(ifModifiedSince); // depends on control dependency: [if], data = [(ifModifiedSince] } DateTimeRfc1123 ifUnmodifiedSinceConverted = null; if (ifUnmodifiedSince != null) { ifUnmodifiedSinceConverted = new DateTimeRfc1123(ifUnmodifiedSince); // depends on control dependency: [if], data = [(ifUnmodifiedSince] } return service.patch(jobScheduleId, jobSchedulePatchParameter, this.client.apiVersion(), this.client.acceptLanguage(), timeout, clientRequestId, returnClientRequestId, ocpDateConverted, ifMatch, ifNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, parameterizedHost, this.client.userAgent()) .flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<Void, JobSchedulePatchHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<Void, JobSchedulePatchHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<Void, JobSchedulePatchHeaders> clientResponse = patchDelegate(response); return Observable.just(clientResponse); // depends on control dependency: [try], data = [none] } catch (Throwable t) { return Observable.error(t); } // depends on control dependency: [catch], data = [none] } }); } }
public class class_name { public void marshall(DescribeReservedElasticsearchInstancesRequest describeReservedElasticsearchInstancesRequest, ProtocolMarshaller protocolMarshaller) { if (describeReservedElasticsearchInstancesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeReservedElasticsearchInstancesRequest.getReservedElasticsearchInstanceId(), RESERVEDELASTICSEARCHINSTANCEID_BINDING); protocolMarshaller.marshall(describeReservedElasticsearchInstancesRequest.getMaxResults(), MAXRESULTS_BINDING); protocolMarshaller.marshall(describeReservedElasticsearchInstancesRequest.getNextToken(), NEXTTOKEN_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(DescribeReservedElasticsearchInstancesRequest describeReservedElasticsearchInstancesRequest, ProtocolMarshaller protocolMarshaller) { if (describeReservedElasticsearchInstancesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(describeReservedElasticsearchInstancesRequest.getReservedElasticsearchInstanceId(), RESERVEDELASTICSEARCHINSTANCEID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(describeReservedElasticsearchInstancesRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(describeReservedElasticsearchInstancesRequest.getNextToken(), NEXTTOKEN_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 boolean clickWithExtJS() { String id = getAttributeId(); if (hasId(id)) { String script = "return (function(){var b = Ext.getCmp('" + id + "'); if(b) {b.onClick({preventDefault:function(){},button:0}); return true;} return false;})()"; Object object = WebLocatorUtils.doExecuteScript(script); LOGGER.info("clickWithExtJS on {}; result: {}", toString(), object); return (Boolean) object; } LOGGER.debug("id is: " + id); return false; } }
public class class_name { public boolean clickWithExtJS() { String id = getAttributeId(); if (hasId(id)) { String script = "return (function(){var b = Ext.getCmp('" + id + "'); if(b) {b.onClick({preventDefault:function(){},button:0}); return true;} return false;})()"; // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none] Object object = WebLocatorUtils.doExecuteScript(script); LOGGER.info("clickWithExtJS on {}; result: {}", toString(), object); return (Boolean) object; } LOGGER.debug("id is: " + id); return false; } }
public class class_name { protected boolean hasVisibleElements(BaseUIComponent component) { for (BaseUIComponent child : component.getChildren(BaseUIComponent.class)) { ElementUI ele = getAssociatedElement(child); if (ele != null && ele.isVisible()) { return true; } if (hasVisibleElements(child)) { return true; } } return false; } }
public class class_name { protected boolean hasVisibleElements(BaseUIComponent component) { for (BaseUIComponent child : component.getChildren(BaseUIComponent.class)) { ElementUI ele = getAssociatedElement(child); if (ele != null && ele.isVisible()) { return true; // depends on control dependency: [if], data = [none] } if (hasVisibleElements(child)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public String getDigitPattern() { String pattern = Optional.fromNullable(getParameter(SignalParameters.DIGIT_PATTERN.symbol())).or(""); if (!pattern.isEmpty()) { // Replace pattern to comply with MEGACO digitMap pattern = pattern.replace(".", "*").replace("x", "\\d"); } return pattern; } }
public class class_name { public String getDigitPattern() { String pattern = Optional.fromNullable(getParameter(SignalParameters.DIGIT_PATTERN.symbol())).or(""); if (!pattern.isEmpty()) { // Replace pattern to comply with MEGACO digitMap pattern = pattern.replace(".", "*").replace("x", "\\d"); // depends on control dependency: [if], data = [none] } return pattern; } }
public class class_name { public EEnum getGBIMGRES() { if (gbimgresEEnum == null) { gbimgresEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(135); } return gbimgresEEnum; } }
public class class_name { public EEnum getGBIMGRES() { if (gbimgresEEnum == null) { gbimgresEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(135); // depends on control dependency: [if], data = [none] } return gbimgresEEnum; } }
public class class_name { public static String tokenizeSmileys(String text) { for(Map.Entry<String, String> smiley : SMILEYS_MAPPING.entrySet()) { text = text.replaceAll(smiley.getKey(), smiley.getValue()); } return text; } }
public class class_name { public static String tokenizeSmileys(String text) { for(Map.Entry<String, String> smiley : SMILEYS_MAPPING.entrySet()) { text = text.replaceAll(smiley.getKey(), smiley.getValue()); // depends on control dependency: [for], data = [smiley] } return text; } }
public class class_name { private void reorderJobs(JobInProgress job, JobSchedulingInfo oldInfo, QueueInfo qi) { if(qi.removeWaitingJob(oldInfo) != null) { qi.addWaitingJob(job); } if(qi.removeRunningJob(oldInfo) != null) { qi.addRunningJob(job); } } }
public class class_name { private void reorderJobs(JobInProgress job, JobSchedulingInfo oldInfo, QueueInfo qi) { if(qi.removeWaitingJob(oldInfo) != null) { qi.addWaitingJob(job); // depends on control dependency: [if], data = [none] } if(qi.removeRunningJob(oldInfo) != null) { qi.addRunningJob(job); // depends on control dependency: [if], data = [none] } } }
public class class_name { public double[] getRowPackedCopy() { double[] vals = new double[m * n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { vals[i * n + j] = A[i][j]; } } return vals; } }
public class class_name { public double[] getRowPackedCopy() { double[] vals = new double[m * n]; for (int i = 0; i < m; i++) { for (int j = 0; j < n; j++) { vals[i * n + j] = A[i][j]; // depends on control dependency: [for], data = [j] } } return vals; } }
public class class_name { public static boolean deleteQuietly(@Nullable File file) { if (file == null) { return false; } return deleteQuietly(file.toPath()); } }
public class class_name { public static boolean deleteQuietly(@Nullable File file) { if (file == null) { return false; // depends on control dependency: [if], data = [none] } return deleteQuietly(file.toPath()); } }
public class class_name { public boolean interrupt (final String fireInstanceId) throws UnableToInterruptJobException { final ICommonsList <IJobExecutionContext> jobs = getCurrentlyExecutingJobs (); IJob job = null; for (final IJobExecutionContext jec : jobs) { if (jec.getFireInstanceId ().equals (fireInstanceId)) { job = jec.getJobInstance (); if (job instanceof IInterruptableJob) { ((IInterruptableJob) job).interrupt (); return true; } throw new UnableToInterruptJobException ("Job " + jec.getJobDetail ().getKey () + " can not be interrupted, since it does not implement " + IInterruptableJob.class.getName ()); } } return false; } }
public class class_name { public boolean interrupt (final String fireInstanceId) throws UnableToInterruptJobException { final ICommonsList <IJobExecutionContext> jobs = getCurrentlyExecutingJobs (); IJob job = null; for (final IJobExecutionContext jec : jobs) { if (jec.getFireInstanceId ().equals (fireInstanceId)) { job = jec.getJobInstance (); // depends on control dependency: [if], data = [none] if (job instanceof IInterruptableJob) { ((IInterruptableJob) job).interrupt (); // depends on control dependency: [if], data = [none] return true; // depends on control dependency: [if], data = [none] } throw new UnableToInterruptJobException ("Job " + jec.getJobDetail ().getKey () + " can not be interrupted, since it does not implement " + IInterruptableJob.class.getName ()); } } return false; } }
public class class_name { public static <T> T parse(byte[] in, Class<T> mapTo) { try { JSONParser p = new JSONParser(DEFAULT_PERMISSIVE_MODE); return p.parse(in, defaultReader.getMapper(mapTo)); } catch (Exception e) { return null; } } }
public class class_name { public static <T> T parse(byte[] in, Class<T> mapTo) { try { JSONParser p = new JSONParser(DEFAULT_PERMISSIVE_MODE); return p.parse(in, defaultReader.getMapper(mapTo)); // depends on control dependency: [try], data = [none] } catch (Exception e) { return null; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public boolean isConsistentWith(KbState other) { // Both states need to have the same functions in the same order. // Don't check the names specifically though, because it's expensive. Preconditions.checkArgument(other.functionNames.size() == functionNames.size()); List<FunctionAssignment> otherAssignments = other.getAssignments(); for (int i = 0; i < functionAssignments.size(); i++) { FunctionAssignment a1 = functionAssignments.get(i); FunctionAssignment a2 = otherAssignments.get(i); if (!a1.isConsistentWith(a2)) { return false; } } return true; } }
public class class_name { public boolean isConsistentWith(KbState other) { // Both states need to have the same functions in the same order. // Don't check the names specifically though, because it's expensive. Preconditions.checkArgument(other.functionNames.size() == functionNames.size()); List<FunctionAssignment> otherAssignments = other.getAssignments(); for (int i = 0; i < functionAssignments.size(); i++) { FunctionAssignment a1 = functionAssignments.get(i); FunctionAssignment a2 = otherAssignments.get(i); if (!a1.isConsistentWith(a2)) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { public static String isValidSqlWithMessage(Connection con, String sql, List<QueryParameter> parameters) { try { QueryUtil qu = new QueryUtil(con, DialectUtil.getDialect(con)); Map<String, QueryParameter> params = new HashMap<String, QueryParameter>(); for (QueryParameter qp : parameters) { params.put(qp.getName(), qp); } qu.getColumnNames(sql, params); } catch (Exception ex) { LOG.error(ex.getMessage(), ex); return ex.getMessage(); } return null; } }
public class class_name { public static String isValidSqlWithMessage(Connection con, String sql, List<QueryParameter> parameters) { try { QueryUtil qu = new QueryUtil(con, DialectUtil.getDialect(con)); Map<String, QueryParameter> params = new HashMap<String, QueryParameter>(); for (QueryParameter qp : parameters) { params.put(qp.getName(), qp); // depends on control dependency: [for], data = [qp] } qu.getColumnNames(sql, params); // depends on control dependency: [try], data = [none] } catch (Exception ex) { LOG.error(ex.getMessage(), ex); return ex.getMessage(); } // depends on control dependency: [catch], data = [none] return null; } }
public class class_name { public Map<String, String> readPropertiesFromActiveProfiles( final String prefix, final String... properties ) { if (settings == null) { console.debug("No maven setting injected"); return Collections.emptyMap(); } final List<String> activeProfilesList = settings.getActiveProfiles(); if (activeProfilesList.isEmpty()) { console.debug("No active profiles found"); return Collections.emptyMap(); } final Map<String, String> map = new HashMap<String, String>(); final Set<String> activeProfiles = new HashSet<String>(activeProfilesList); // Iterate over all active profiles in order for (final Profile profile : settings.getProfiles()) { // Check if the profile is active final String profileId = profile.getId(); if (activeProfiles.contains(profileId)) { console.debug("Trying active profile " + profileId); for (final String property : properties) { final String propKey = prefix != null ? prefix + property : property; final String value = profile.getProperties().getProperty(propKey); if (value != null) { console.debug("Found property " + property + " in profile " + profileId); map.put(property, value); } } } } return map; } }
public class class_name { public Map<String, String> readPropertiesFromActiveProfiles( final String prefix, final String... properties ) { if (settings == null) { console.debug("No maven setting injected"); // depends on control dependency: [if], data = [none] return Collections.emptyMap(); // depends on control dependency: [if], data = [none] } final List<String> activeProfilesList = settings.getActiveProfiles(); if (activeProfilesList.isEmpty()) { console.debug("No active profiles found"); // depends on control dependency: [if], data = [none] return Collections.emptyMap(); // depends on control dependency: [if], data = [none] } final Map<String, String> map = new HashMap<String, String>(); final Set<String> activeProfiles = new HashSet<String>(activeProfilesList); // Iterate over all active profiles in order for (final Profile profile : settings.getProfiles()) { // Check if the profile is active final String profileId = profile.getId(); if (activeProfiles.contains(profileId)) { console.debug("Trying active profile " + profileId); // depends on control dependency: [if], data = [none] for (final String property : properties) { final String propKey = prefix != null ? prefix + property : property; final String value = profile.getProperties().getProperty(propKey); if (value != null) { console.debug("Found property " + property + " in profile " + profileId); // depends on control dependency: [if], data = [none] map.put(property, value); // depends on control dependency: [if], data = [none] } } } } return map; } }
public class class_name { @InterfaceAudience.Public public void setIsDeletion(boolean isDeletion) { if (isDeletion == true) { properties.put("_deleted", true); } else { properties.remove("_deleted"); } } }
public class class_name { @InterfaceAudience.Public public void setIsDeletion(boolean isDeletion) { if (isDeletion == true) { properties.put("_deleted", true); // depends on control dependency: [if], data = [true)] } else { properties.remove("_deleted"); // depends on control dependency: [if], data = [none] } } }
public class class_name { public void setButtonMode (int mode) { if (this.mode == mode) { return; } if (this.mode == BreakpointsParam.BUTTON_MODE_SIMPLE) { if (isBreakAll) { setBreakAll(false); setBreakRequest(true); setBreakResponse(true); } } else if (isBreakRequest || isBreakResponse) { setBreakRequest(false); setBreakResponse(false); setBreakAll(true); } this.mode = mode; } }
public class class_name { public void setButtonMode (int mode) { if (this.mode == mode) { return; // depends on control dependency: [if], data = [none] } if (this.mode == BreakpointsParam.BUTTON_MODE_SIMPLE) { if (isBreakAll) { setBreakAll(false); // depends on control dependency: [if], data = [none] setBreakRequest(true); // depends on control dependency: [if], data = [none] setBreakResponse(true); // depends on control dependency: [if], data = [none] } } else if (isBreakRequest || isBreakResponse) { setBreakRequest(false); // depends on control dependency: [if], data = [none] setBreakResponse(false); // depends on control dependency: [if], data = [none] setBreakAll(true); // depends on control dependency: [if], data = [none] } this.mode = mode; } }
public class class_name { public static LongPredicate softenLongPredicate(final CheckedLongPredicate fn) { return t -> { try { return fn.test(t); } catch (final Throwable e) { throw throwSoftenedException(e); } }; } }
public class class_name { public static LongPredicate softenLongPredicate(final CheckedLongPredicate fn) { return t -> { try { return fn.test(t); // depends on control dependency: [try], data = [none] } catch (final Throwable e) { throw throwSoftenedException(e); } // depends on control dependency: [catch], data = [none] }; } }
public class class_name { protected void loadClientMetadata(Map<String, Object> puProperties) { clientMetadata = new ClientMetadata(); String luceneDirectoryPath = puProperties != null ? (String) puProperties .get(PersistenceProperties.KUNDERA_INDEX_HOME_DIR) : null; String indexerClass = puProperties != null ? (String) puProperties .get(PersistenceProperties.KUNDERA_INDEXER_CLASS) : null; String autoGenClass = puProperties != null ? (String) puProperties .get(PersistenceProperties.KUNDERA_AUTO_GENERATOR_CLASS) : null; if (indexerClass == null) { indexerClass = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit) .getProperties().getProperty(PersistenceProperties.KUNDERA_INDEXER_CLASS); } if (autoGenClass == null) { autoGenClass = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit) .getProperties().getProperty(PersistenceProperties.KUNDERA_AUTO_GENERATOR_CLASS); } if (luceneDirectoryPath == null) { luceneDirectoryPath = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit) .getProperty(PersistenceProperties.KUNDERA_INDEX_HOME_DIR); } if (autoGenClass != null) { clientMetadata.setAutoGenImplementor(autoGenClass); } // in case set empty via external property, means want to avoid lucene // directory set up. if (luceneDirectoryPath != null && !StringUtils.isEmpty(luceneDirectoryPath)) { // Add client metadata clientMetadata.setLuceneIndexDir(luceneDirectoryPath); // Set Index Manager try { Method method = Class.forName(IndexingConstants.LUCENE_INDEXER).getDeclaredMethod("getInstance", String.class); Indexer indexer = (Indexer) method.invoke(null, luceneDirectoryPath); indexManager = new IndexManager(indexer, kunderaMetadata); } catch (Exception e) { logger.error( "Missing lucene from classpath. Please make sure those are available to load lucene directory {}!", luceneDirectoryPath); throw new InvalidConfigurationException(e); } // indexManager = new IndexManager(LuceneIndexer.getInstance(new // StandardAnalyzer(Version.LUCENE_CURRENT), // luceneDirectoryPath)); } else if (indexerClass != null) { try { Class<?> indexerClazz = Class.forName(indexerClass); Indexer indexer = (Indexer) indexerClazz.newInstance(); indexManager = new IndexManager(indexer, kunderaMetadata); clientMetadata.setIndexImplementor(indexerClass); } catch (Exception cnfex) { logger.error("Error while initialzing indexer:" + indexerClass, cnfex); throw new KunderaException(cnfex); } } else { indexManager = new IndexManager(null, kunderaMetadata); } // if // (kunderaMetadata.getClientMetadata(persistenceUnit) // == // null) // { // kunderaMetadata.addClientMetadata(persistenceUnit, // clientMetadata); // } } }
public class class_name { protected void loadClientMetadata(Map<String, Object> puProperties) { clientMetadata = new ClientMetadata(); String luceneDirectoryPath = puProperties != null ? (String) puProperties .get(PersistenceProperties.KUNDERA_INDEX_HOME_DIR) : null; String indexerClass = puProperties != null ? (String) puProperties .get(PersistenceProperties.KUNDERA_INDEXER_CLASS) : null; String autoGenClass = puProperties != null ? (String) puProperties .get(PersistenceProperties.KUNDERA_AUTO_GENERATOR_CLASS) : null; if (indexerClass == null) { indexerClass = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit) .getProperties().getProperty(PersistenceProperties.KUNDERA_INDEXER_CLASS); // depends on control dependency: [if], data = [none] } if (autoGenClass == null) { autoGenClass = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit) .getProperties().getProperty(PersistenceProperties.KUNDERA_AUTO_GENERATOR_CLASS); // depends on control dependency: [if], data = [none] } if (luceneDirectoryPath == null) { luceneDirectoryPath = kunderaMetadata.getApplicationMetadata().getPersistenceUnitMetadata(persistenceUnit) .getProperty(PersistenceProperties.KUNDERA_INDEX_HOME_DIR); // depends on control dependency: [if], data = [none] } if (autoGenClass != null) { clientMetadata.setAutoGenImplementor(autoGenClass); // depends on control dependency: [if], data = [(autoGenClass] } // in case set empty via external property, means want to avoid lucene // directory set up. if (luceneDirectoryPath != null && !StringUtils.isEmpty(luceneDirectoryPath)) { // Add client metadata clientMetadata.setLuceneIndexDir(luceneDirectoryPath); // depends on control dependency: [if], data = [(luceneDirectoryPath] // Set Index Manager try { Method method = Class.forName(IndexingConstants.LUCENE_INDEXER).getDeclaredMethod("getInstance", String.class); Indexer indexer = (Indexer) method.invoke(null, luceneDirectoryPath); indexManager = new IndexManager(indexer, kunderaMetadata); // depends on control dependency: [try], data = [none] } catch (Exception e) { logger.error( "Missing lucene from classpath. Please make sure those are available to load lucene directory {}!", luceneDirectoryPath); throw new InvalidConfigurationException(e); } // depends on control dependency: [catch], data = [none] // indexManager = new IndexManager(LuceneIndexer.getInstance(new // StandardAnalyzer(Version.LUCENE_CURRENT), // luceneDirectoryPath)); } else if (indexerClass != null) { try { Class<?> indexerClazz = Class.forName(indexerClass); Indexer indexer = (Indexer) indexerClazz.newInstance(); indexManager = new IndexManager(indexer, kunderaMetadata); clientMetadata.setIndexImplementor(indexerClass); } catch (Exception cnfex) { logger.error("Error while initialzing indexer:" + indexerClass, cnfex); throw new KunderaException(cnfex); } // depends on control dependency: [catch], data = [none] } else { indexManager = new IndexManager(null, kunderaMetadata); // depends on control dependency: [if], data = [none] } // if // (kunderaMetadata.getClientMetadata(persistenceUnit) // == // null) // { // kunderaMetadata.addClientMetadata(persistenceUnit, // clientMetadata); // } } }
public class class_name { private void checkFieldType(int field, Type... expected) { Type actual = getType(field); for (Type type : expected) { if (actual.equals(type)) { return; } } throw new IllegalArgumentException(format("Expected field %s to be a type of %s but is %s", field, StringUtils.join(expected, ","), actual)); } }
public class class_name { private void checkFieldType(int field, Type... expected) { Type actual = getType(field); for (Type type : expected) { if (actual.equals(type)) { return; // depends on control dependency: [if], data = [none] } } throw new IllegalArgumentException(format("Expected field %s to be a type of %s but is %s", field, StringUtils.join(expected, ","), actual)); } }
public class class_name { public boolean waitForDisconnect(long timeout) { initErrorInfo(); RequestEvent event = parent.waitRequest(timeout); if (event == null) { setReturnCode(parent.getReturnCode()); setErrorMessage(parent.getErrorMessage()); setException(parent.getException()); return false; } Request request = event.getRequest(); receivedRequests.add(new SipRequest(event)); while (request.getMethod().equals(Request.BYE) == false) { event = parent.waitRequest(timeout); // TODO, adjust if (event == null) { setReturnCode(parent.getReturnCode()); setErrorMessage(parent.getErrorMessage()); setException(parent.getException()); return false; } request = event.getRequest(); receivedRequests.add(new SipRequest(event)); continue; } ServerTransaction tr = event.getServerTransaction(); if (tr == null) { try { tr = parent.getParent().getSipProvider().getNewServerTransaction(request); } catch (Exception ex) { setReturnCode(SipSession.EXCEPTION_ENCOUNTERED); setErrorMessage("Exception: " + ex.getClass().getName() + ": " + ex.getMessage()); setException(ex); return false; } } dialog = tr.getDialog(); transaction = new SipTransaction(); transaction.setServerTransaction(tr); return true; } }
public class class_name { public boolean waitForDisconnect(long timeout) { initErrorInfo(); RequestEvent event = parent.waitRequest(timeout); if (event == null) { setReturnCode(parent.getReturnCode()); // depends on control dependency: [if], data = [none] setErrorMessage(parent.getErrorMessage()); // depends on control dependency: [if], data = [none] setException(parent.getException()); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } Request request = event.getRequest(); receivedRequests.add(new SipRequest(event)); while (request.getMethod().equals(Request.BYE) == false) { event = parent.waitRequest(timeout); // TODO, adjust // depends on control dependency: [while], data = [none] if (event == null) { setReturnCode(parent.getReturnCode()); // depends on control dependency: [if], data = [none] setErrorMessage(parent.getErrorMessage()); // depends on control dependency: [if], data = [none] setException(parent.getException()); // depends on control dependency: [if], data = [none] return false; // depends on control dependency: [if], data = [none] } request = event.getRequest(); // depends on control dependency: [while], data = [none] receivedRequests.add(new SipRequest(event)); // depends on control dependency: [while], data = [none] continue; } ServerTransaction tr = event.getServerTransaction(); if (tr == null) { try { tr = parent.getParent().getSipProvider().getNewServerTransaction(request); // depends on control dependency: [try], data = [none] } catch (Exception ex) { setReturnCode(SipSession.EXCEPTION_ENCOUNTERED); setErrorMessage("Exception: " + ex.getClass().getName() + ": " + ex.getMessage()); setException(ex); return false; } // depends on control dependency: [catch], data = [none] } dialog = tr.getDialog(); transaction = new SipTransaction(); transaction.setServerTransaction(tr); return true; } }