code
stringlengths
130
281k
code_dependency
stringlengths
182
306k
public class class_name { public void loadKeyStores(Map<String, WSKeyStore> config) { // now process each keystore in the provided config for (Entry<String, WSKeyStore> current : config.entrySet()) { try { String name = current.getKey(); WSKeyStore keystore = current.getValue(); addKeyStoreToMap(name, keystore); } catch (Exception e) { FFDCFilter.processException(e, getClass().getName(), "loadKeyStores", new Object[] { this, config }); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Error loading keystore; " + current.getKey() + " " + e); } } } } }
public class class_name { public void loadKeyStores(Map<String, WSKeyStore> config) { // now process each keystore in the provided config for (Entry<String, WSKeyStore> current : config.entrySet()) { try { String name = current.getKey(); WSKeyStore keystore = current.getValue(); addKeyStoreToMap(name, keystore); // depends on control dependency: [try], data = [none] } catch (Exception e) { FFDCFilter.processException(e, getClass().getName(), "loadKeyStores", new Object[] { this, config }); if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) { Tr.event(tc, "Error loading keystore; " + current.getKey() + " " + e); // depends on control dependency: [if], data = [none] } } // depends on control dependency: [catch], data = [none] } } }
public class class_name { public void marshall(WavSettings wavSettings, ProtocolMarshaller protocolMarshaller) { if (wavSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(wavSettings.getBitDepth(), BITDEPTH_BINDING); protocolMarshaller.marshall(wavSettings.getChannels(), CHANNELS_BINDING); protocolMarshaller.marshall(wavSettings.getFormat(), FORMAT_BINDING); protocolMarshaller.marshall(wavSettings.getSampleRate(), SAMPLERATE_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(WavSettings wavSettings, ProtocolMarshaller protocolMarshaller) { if (wavSettings == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(wavSettings.getBitDepth(), BITDEPTH_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(wavSettings.getChannels(), CHANNELS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(wavSettings.getFormat(), FORMAT_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(wavSettings.getSampleRate(), SAMPLERATE_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 <V> Observable<V> mapGet(final String docId, final String key, Class<V> valueType) { final Func1<DocumentFragment<Lookup>, V> mapResult = new Func1<DocumentFragment<Lookup>, V>() { @Override public V call(DocumentFragment<Lookup> documentFragment) { ResponseStatus status = documentFragment.status(0); if (status == ResponseStatus.SUCCESS) { return (V) documentFragment.content(0); } else if (status == ResponseStatus.SUBDOC_PATH_NOT_FOUND) { throw new PathNotFoundException("Key not found in map"); } else { throw new CouchbaseException(status.toString()); } } }; return lookupIn(docId).get(key) .execute() .map(mapResult); } }
public class class_name { @Override public <V> Observable<V> mapGet(final String docId, final String key, Class<V> valueType) { final Func1<DocumentFragment<Lookup>, V> mapResult = new Func1<DocumentFragment<Lookup>, V>() { @Override public V call(DocumentFragment<Lookup> documentFragment) { ResponseStatus status = documentFragment.status(0); if (status == ResponseStatus.SUCCESS) { return (V) documentFragment.content(0); // depends on control dependency: [if], data = [none] } else if (status == ResponseStatus.SUBDOC_PATH_NOT_FOUND) { throw new PathNotFoundException("Key not found in map"); } else { throw new CouchbaseException(status.toString()); } } }; return lookupIn(docId).get(key) .execute() .map(mapResult); } }
public class class_name { public IPersistentMap meta() { if (_meta == null) { _meta = new PersistentArrayMap(new Object[]{makeKeyword("stream"), getSourceStreamId(), makeKeyword("component"), getSourceComponent(), makeKeyword("task"), getSourceTask()}); } return _meta; } }
public class class_name { public IPersistentMap meta() { if (_meta == null) { _meta = new PersistentArrayMap(new Object[]{makeKeyword("stream"), getSourceStreamId(), makeKeyword("component"), getSourceComponent(), makeKeyword("task"), getSourceTask()}); // depends on control dependency: [if], data = [none] } return _meta; } }
public class class_name { protected boolean isSubsetContainedIn(Set<String> selectedListItems, Set<String> distinctFacetValues) { boolean isPresent = false; for (String selectedListItem : selectedListItems) { isPresent = distinctFacetValues.contains(selectedListItem); } return isPresent; } }
public class class_name { protected boolean isSubsetContainedIn(Set<String> selectedListItems, Set<String> distinctFacetValues) { boolean isPresent = false; for (String selectedListItem : selectedListItems) { isPresent = distinctFacetValues.contains(selectedListItem); // depends on control dependency: [for], data = [selectedListItem] } return isPresent; } }
public class class_name { public static Pool<Jedis> createJedisPool(final Config jesqueConfig, final GenericObjectPoolConfig poolConfig) { if (jesqueConfig == null) { throw new IllegalArgumentException("jesqueConfig must not be null"); } if (poolConfig == null) { throw new IllegalArgumentException("poolConfig must not be null"); } if (jesqueConfig.getMasterName() != null && !"".equals(jesqueConfig.getMasterName()) && jesqueConfig.getSentinels() != null && jesqueConfig.getSentinels().size() > 0) { return new JedisSentinelPool(jesqueConfig.getMasterName(), jesqueConfig.getSentinels(), poolConfig, jesqueConfig.getTimeout(), jesqueConfig.getPassword(), jesqueConfig.getDatabase()); } else { return new JedisPool(poolConfig, jesqueConfig.getHost(), jesqueConfig.getPort(), jesqueConfig.getTimeout(), jesqueConfig.getPassword(), jesqueConfig.getDatabase()); } } }
public class class_name { public static Pool<Jedis> createJedisPool(final Config jesqueConfig, final GenericObjectPoolConfig poolConfig) { if (jesqueConfig == null) { throw new IllegalArgumentException("jesqueConfig must not be null"); } if (poolConfig == null) { throw new IllegalArgumentException("poolConfig must not be null"); } if (jesqueConfig.getMasterName() != null && !"".equals(jesqueConfig.getMasterName()) && jesqueConfig.getSentinels() != null && jesqueConfig.getSentinels().size() > 0) { return new JedisSentinelPool(jesqueConfig.getMasterName(), jesqueConfig.getSentinels(), poolConfig, jesqueConfig.getTimeout(), jesqueConfig.getPassword(), jesqueConfig.getDatabase()); // depends on control dependency: [if], data = [(jesqueConfig.getMasterName()] } else { return new JedisPool(poolConfig, jesqueConfig.getHost(), jesqueConfig.getPort(), jesqueConfig.getTimeout(), jesqueConfig.getPassword(), jesqueConfig.getDatabase()); // depends on control dependency: [if], data = [none] } } }
public class class_name { private Choice parseChoice(CharSequenceScanner scanner) { Filter<Object> condition = parseCondition(scanner); List<Segment> segments = new ArrayList<>(); while (scanner.hasNext()) { int index = scanner.getCurrentIndex(); char c = scanner.peek(); String literal = null; if ((c == '"') || (c == '\'')) { scanner.next(); literal = scanner.readUntil(c, false, c); if (literal == null) { throw new IllegalArgumentException(scanner.substring(index, scanner.getCurrentIndex())); } c = scanner.peek(); } NlsArgument argument = null; if (c == NlsArgumentParser.START_EXPRESSION) { scanner.next(); argument = this.nlsDependencies.getArgumentParser().parse(scanner); } if ((argument != null) || (literal != null)) { segments.add(new Segment(literal, argument)); } else { break; } } return new Choice(condition, segments); } }
public class class_name { private Choice parseChoice(CharSequenceScanner scanner) { Filter<Object> condition = parseCondition(scanner); List<Segment> segments = new ArrayList<>(); while (scanner.hasNext()) { int index = scanner.getCurrentIndex(); char c = scanner.peek(); String literal = null; if ((c == '"') || (c == '\'')) { scanner.next(); // depends on control dependency: [if], data = [none] literal = scanner.readUntil(c, false, c); // depends on control dependency: [if], data = [none] if (literal == null) { throw new IllegalArgumentException(scanner.substring(index, scanner.getCurrentIndex())); } c = scanner.peek(); // depends on control dependency: [if], data = [none] } NlsArgument argument = null; if (c == NlsArgumentParser.START_EXPRESSION) { scanner.next(); // depends on control dependency: [if], data = [none] argument = this.nlsDependencies.getArgumentParser().parse(scanner); // depends on control dependency: [if], data = [none] } if ((argument != null) || (literal != null)) { segments.add(new Segment(literal, argument)); // depends on control dependency: [if], data = [none] } else { break; } } return new Choice(condition, segments); } }
public class class_name { @Override public String getCommandLine() { final StringBuilder commandLineString = new StringBuilder(); String tempString; commandLineString.append(callerArguments.getClass().getSimpleName()); // positional args first if( positionalArgumentDefinition != null) { tempString = positionalArgumentDefinition.getCommandLineDisplayString(); commandLineString.append(tempString.length() > 0 ? " " + tempString : ""); } // then args that were explicitly set tempString = namedArgumentDefinitions.stream() .filter(NamedArgumentDefinition::getHasBeenSet) .map(NamedArgumentDefinition::getCommandLineDisplayString) .collect(Collectors.joining(" ")); commandLineString.append(tempString.length() > 0 ? " " + tempString : ""); // finally, args that weren't explicitly set, but have a default value tempString = namedArgumentDefinitions.stream() .filter(argumentDefinition -> !argumentDefinition.getHasBeenSet() && !argumentDefinition.getDefaultValueAsString().equals(NamedArgumentDefinition.NULL_ARGUMENT_STRING)) .map(NamedArgumentDefinition::getCommandLineDisplayString) .collect(Collectors.joining(" ")); commandLineString.append(tempString.length() > 0 ? " " + tempString : ""); return commandLineString.toString(); } }
public class class_name { @Override public String getCommandLine() { final StringBuilder commandLineString = new StringBuilder(); String tempString; commandLineString.append(callerArguments.getClass().getSimpleName()); // positional args first if( positionalArgumentDefinition != null) { tempString = positionalArgumentDefinition.getCommandLineDisplayString(); // depends on control dependency: [if], data = [none] commandLineString.append(tempString.length() > 0 ? " " + tempString : ""); // depends on control dependency: [if], data = [none] } // then args that were explicitly set tempString = namedArgumentDefinitions.stream() .filter(NamedArgumentDefinition::getHasBeenSet) .map(NamedArgumentDefinition::getCommandLineDisplayString) .collect(Collectors.joining(" ")); commandLineString.append(tempString.length() > 0 ? " " + tempString : ""); // finally, args that weren't explicitly set, but have a default value tempString = namedArgumentDefinitions.stream() .filter(argumentDefinition -> !argumentDefinition.getHasBeenSet() && !argumentDefinition.getDefaultValueAsString().equals(NamedArgumentDefinition.NULL_ARGUMENT_STRING)) .map(NamedArgumentDefinition::getCommandLineDisplayString) .collect(Collectors.joining(" ")); commandLineString.append(tempString.length() > 0 ? " " + tempString : ""); return commandLineString.toString(); } }
public class class_name { public boolean isMisspelled(final String word) { // dictionaries usually do not contain punctuation String wordToCheck = word; if (!dictionaryMetadata.getInputConversionPairs().isEmpty()) { wordToCheck = DictionaryLookup.applyReplacements(word, dictionaryMetadata.getInputConversionPairs()); } boolean isAlphabetic = wordToCheck.length() != 1 || isAlphabetic(wordToCheck.charAt(0)); return wordToCheck.length() > 0 && (!dictionaryMetadata.isIgnoringPunctuation() || isAlphabetic) && (!dictionaryMetadata.isIgnoringNumbers() || containsNoDigit(wordToCheck)) && !(dictionaryMetadata.isIgnoringCamelCase() && isCamelCase(wordToCheck)) && !(dictionaryMetadata.isIgnoringAllUppercase() && isAlphabetic && isAllUppercase(wordToCheck)) && !isInDictionary(wordToCheck) && (!dictionaryMetadata.isConvertingCase() || !(!isMixedCase(wordToCheck) && (isInDictionary(wordToCheck.toLowerCase(dictionaryMetadata.getLocale())) || isAllUppercase(wordToCheck) && isInDictionary(initialUppercase(wordToCheck))))); } }
public class class_name { public boolean isMisspelled(final String word) { // dictionaries usually do not contain punctuation String wordToCheck = word; if (!dictionaryMetadata.getInputConversionPairs().isEmpty()) { wordToCheck = DictionaryLookup.applyReplacements(word, dictionaryMetadata.getInputConversionPairs()); // depends on control dependency: [if], data = [none] } boolean isAlphabetic = wordToCheck.length() != 1 || isAlphabetic(wordToCheck.charAt(0)); return wordToCheck.length() > 0 && (!dictionaryMetadata.isIgnoringPunctuation() || isAlphabetic) && (!dictionaryMetadata.isIgnoringNumbers() || containsNoDigit(wordToCheck)) && !(dictionaryMetadata.isIgnoringCamelCase() && isCamelCase(wordToCheck)) && !(dictionaryMetadata.isIgnoringAllUppercase() && isAlphabetic && isAllUppercase(wordToCheck)) && !isInDictionary(wordToCheck) && (!dictionaryMetadata.isConvertingCase() || !(!isMixedCase(wordToCheck) && (isInDictionary(wordToCheck.toLowerCase(dictionaryMetadata.getLocale())) || isAllUppercase(wordToCheck) && isInDictionary(initialUppercase(wordToCheck))))); } }
public class class_name { protected void registerRevision(final String _application, final InstallFile _installFile, final Instance _objInst) throws InstallationException { try { if (CIAdminCommon.Application.getType() != null && CIAdminCommon.Application.getType().getAttributes().size() > 4) { final QueryBuilder appQueryBldr = new QueryBuilder(CIAdminCommon.Application); appQueryBldr.addWhereAttrEqValue(CIAdminCommon.Application.Name, _application); final CachedInstanceQuery appQuery = appQueryBldr.getCachedQuery4Request(); appQuery.execute(); if (appQuery.next()) { final Instance appInst = appQuery.getCurrentValue(); final QueryBuilder queryBldr = new QueryBuilder(CIAdminCommon.ApplicationRevision); queryBldr.addWhereAttrEqValue(CIAdminCommon.ApplicationRevision.ApplicationLink, appInst); queryBldr.addWhereAttrEqValue(CIAdminCommon.ApplicationRevision.Revision, _installFile.getRevision()); final MultiPrintQuery multi = queryBldr.getPrint(); multi.addAttribute(CIAdminCommon.ApplicationRevision.Date); multi.execute(); final Instance appRevInst; if (multi.next()) { appRevInst = multi.getCurrentInstance(); if (_installFile.getDate().isAfter(multi.<DateTime>getAttribute( CIAdminCommon.ApplicationRevision.Date))) { AbstractUpdate.LOG.debug("Updated Revision {} - {} with Date {] ", _installFile.getRevision(), _application, _installFile.getDate()); final Update update = new Update(appRevInst); update.add(CIAdminCommon.ApplicationRevision.Date, _installFile.getDate()); update.executeWithoutTrigger(); } } else { final Insert insert = new Insert(CIAdminCommon.ApplicationRevision); insert.add(CIAdminCommon.ApplicationRevision.ApplicationLink, appInst); insert.add(CIAdminCommon.ApplicationRevision.Revision, _installFile.getRevision()); insert.add(CIAdminCommon.ApplicationRevision.Date, _installFile.getDate()); insert.execute(); appRevInst = insert.getInstance(); } if (_objInst.getType().getAttribute(CIAdmin.Abstract.RevisionLink.name) != null) { final Update update = new Update(_objInst); update.add(CIAdmin.Abstract.RevisionLink.name, appRevInst); update.executeWithoutTrigger(); } } } } catch (final EFapsException e) { throw new InstallationException("Exception", e); } } }
public class class_name { protected void registerRevision(final String _application, final InstallFile _installFile, final Instance _objInst) throws InstallationException { try { if (CIAdminCommon.Application.getType() != null && CIAdminCommon.Application.getType().getAttributes().size() > 4) { final QueryBuilder appQueryBldr = new QueryBuilder(CIAdminCommon.Application); appQueryBldr.addWhereAttrEqValue(CIAdminCommon.Application.Name, _application); final CachedInstanceQuery appQuery = appQueryBldr.getCachedQuery4Request(); appQuery.execute(); if (appQuery.next()) { final Instance appInst = appQuery.getCurrentValue(); final QueryBuilder queryBldr = new QueryBuilder(CIAdminCommon.ApplicationRevision); queryBldr.addWhereAttrEqValue(CIAdminCommon.ApplicationRevision.ApplicationLink, appInst); // depends on control dependency: [if], data = [none] queryBldr.addWhereAttrEqValue(CIAdminCommon.ApplicationRevision.Revision, _installFile.getRevision()); // depends on control dependency: [if], data = [none] final MultiPrintQuery multi = queryBldr.getPrint(); multi.addAttribute(CIAdminCommon.ApplicationRevision.Date); // depends on control dependency: [if], data = [none] multi.execute(); // depends on control dependency: [if], data = [none] final Instance appRevInst; if (multi.next()) { appRevInst = multi.getCurrentInstance(); // depends on control dependency: [if], data = [none] if (_installFile.getDate().isAfter(multi.<DateTime>getAttribute( CIAdminCommon.ApplicationRevision.Date))) { AbstractUpdate.LOG.debug("Updated Revision {} - {} with Date {] ", _installFile.getRevision(), _application, _installFile.getDate()); // depends on control dependency: [if], data = [none] final Update update = new Update(appRevInst); update.add(CIAdminCommon.ApplicationRevision.Date, _installFile.getDate()); // depends on control dependency: [if], data = [none] update.executeWithoutTrigger(); // depends on control dependency: [if], data = [none] } } else { final Insert insert = new Insert(CIAdminCommon.ApplicationRevision); insert.add(CIAdminCommon.ApplicationRevision.ApplicationLink, appInst); // depends on control dependency: [if], data = [none] insert.add(CIAdminCommon.ApplicationRevision.Revision, _installFile.getRevision()); // depends on control dependency: [if], data = [none] insert.add(CIAdminCommon.ApplicationRevision.Date, _installFile.getDate()); // depends on control dependency: [if], data = [none] insert.execute(); // depends on control dependency: [if], data = [none] appRevInst = insert.getInstance(); // depends on control dependency: [if], data = [none] } if (_objInst.getType().getAttribute(CIAdmin.Abstract.RevisionLink.name) != null) { final Update update = new Update(_objInst); update.add(CIAdmin.Abstract.RevisionLink.name, appRevInst); // depends on control dependency: [if], data = [none] update.executeWithoutTrigger(); // depends on control dependency: [if], data = [none] } } } } catch (final EFapsException e) { throw new InstallationException("Exception", e); } } }
public class class_name { public static String render(List<Node> nodes) { StringBuilder buf = new StringBuilder(); for (Node node : nodes) { if (node instanceof Text) { String text = ((Text) node).text; boolean inquote = false; for (int i = 0; i < text.length(); i++) { char ch = text.charAt(i); switch (ch) { case 'G': case 'y': case 'Y': case 'u': case 'U': case 'r': case 'Q': case 'q': case 'M': case 'L': case 'l': case 'w': case 'W': case 'd': case 'D': case 'F': case 'g': case 'E': case 'e': case 'c': case 'a': case 'b': case 'B': case 'h': case 'H': case 'K': case 'k': case 'j': case 'J': case 'C': case 'm': case 's': case 'S': case 'A': case 'z': case 'Z': case 'O': case 'v': case 'V': case 'X': case 'x': if (!inquote) { buf.append('\''); } buf.append(ch); break; default: if (inquote) { buf.append('\''); } buf.append(ch); break; } } } else if (node instanceof Field) { Field field = (Field) node; for (int i = 0; i < field.width; i++) { buf.append(field.ch); } } } return buf.toString(); } }
public class class_name { public static String render(List<Node> nodes) { StringBuilder buf = new StringBuilder(); for (Node node : nodes) { if (node instanceof Text) { String text = ((Text) node).text; boolean inquote = false; for (int i = 0; i < text.length(); i++) { char ch = text.charAt(i); switch (ch) { case 'G': case 'y': case 'Y': case 'u': case 'U': case 'r': case 'Q': case 'q': case 'M': case 'L': case 'l': case 'w': case 'W': case 'd': case 'D': case 'F': case 'g': case 'E': case 'e': case 'c': case 'a': case 'b': case 'B': case 'h': case 'H': case 'K': case 'k': case 'j': case 'J': case 'C': case 'm': case 's': case 'S': case 'A': case 'z': case 'Z': case 'O': case 'v': case 'V': case 'X': case 'x': if (!inquote) { buf.append('\''); // depends on control dependency: [if], data = [none] } buf.append(ch); break; default: if (inquote) { buf.append('\''); // depends on control dependency: [if], data = [none] } buf.append(ch); break; } } } else if (node instanceof Field) { Field field = (Field) node; for (int i = 0; i < field.width; i++) { buf.append(field.ch); // depends on control dependency: [for], data = [none] } } } return buf.toString(); } }
public class class_name { public static String removeEnd(final String s, final char c) { if (endWith(s, c)) { return s.substring(0, s.length() - 1); } return s; } }
public class class_name { public static String removeEnd(final String s, final char c) { if (endWith(s, c)) { return s.substring(0, s.length() - 1); // depends on control dependency: [if], data = [none] } return s; } }
public class class_name { public static String getStringOptional( final Properties properties, final String key, final String other) { Objects.requireNonNull(properties, "Properties"); Objects.requireNonNull(key, "Key"); Objects.requireNonNull(other, "Default value"); final String value = properties.getProperty(key); if (value == null) { return other; } return value; } }
public class class_name { public static String getStringOptional( final Properties properties, final String key, final String other) { Objects.requireNonNull(properties, "Properties"); Objects.requireNonNull(key, "Key"); Objects.requireNonNull(other, "Default value"); final String value = properties.getProperty(key); if (value == null) { return other; // depends on control dependency: [if], data = [none] } return value; } }
public class class_name { @PublicEvolving @Deprecated public <OUT> DataStreamSource<OUT> readFile(FileInputFormat<OUT> inputFormat, String filePath, FileProcessingMode watchType, long interval, FilePathFilter filter) { inputFormat.setFilesFilter(filter); TypeInformation<OUT> typeInformation; try { typeInformation = TypeExtractor.getInputFormatTypes(inputFormat); } catch (Exception e) { throw new InvalidProgramException("The type returned by the input format could not be " + "automatically determined. Please specify the TypeInformation of the produced type " + "explicitly by using the 'createInput(InputFormat, TypeInformation)' method instead."); } return readFile(inputFormat, filePath, watchType, interval, typeInformation); } }
public class class_name { @PublicEvolving @Deprecated public <OUT> DataStreamSource<OUT> readFile(FileInputFormat<OUT> inputFormat, String filePath, FileProcessingMode watchType, long interval, FilePathFilter filter) { inputFormat.setFilesFilter(filter); TypeInformation<OUT> typeInformation; try { typeInformation = TypeExtractor.getInputFormatTypes(inputFormat); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new InvalidProgramException("The type returned by the input format could not be " + "automatically determined. Please specify the TypeInformation of the produced type " + "explicitly by using the 'createInput(InputFormat, TypeInformation)' method instead."); } // depends on control dependency: [catch], data = [none] return readFile(inputFormat, filePath, watchType, interval, typeInformation); } }
public class class_name { public List<InputType> getLayerActivationTypes(@NonNull InputType inputType) { List<InputType> out = new ArrayList<>(); int nLayers = confs.size(); for (int i = 0; i < nLayers; i++) { InputPreProcessor preproc = getInputPreProcess(i); if (preproc != null) { inputType = preproc.getOutputType(inputType); } inputType = confs.get(i).getLayer().getOutputType(i, inputType); out.add(inputType); } return out; } }
public class class_name { public List<InputType> getLayerActivationTypes(@NonNull InputType inputType) { List<InputType> out = new ArrayList<>(); int nLayers = confs.size(); for (int i = 0; i < nLayers; i++) { InputPreProcessor preproc = getInputPreProcess(i); if (preproc != null) { inputType = preproc.getOutputType(inputType); // depends on control dependency: [if], data = [none] } inputType = confs.get(i).getLayer().getOutputType(i, inputType); // depends on control dependency: [for], data = [i] out.add(inputType); // depends on control dependency: [for], data = [none] } return out; } }
public class class_name { void dispatch(String line, DispatchCallback callback) { if (line == null) { // exit exit = true; return; } if (line.trim().length() == 0) { callback.setStatus(DispatchCallback.Status.SUCCESS); return; } if (isComment(line)) { callback.setStatus(DispatchCallback.Status.SUCCESS); return; } line = line.trim(); if (isHelpRequest(line)) { line = COMMAND_PREFIX + "help"; } final boolean echoToFile; if (line.startsWith(COMMAND_PREFIX)) { Map<String, CommandHandler> cmdMap = new TreeMap<>(); String commandLine = line.substring(1); for (CommandHandler commandHandler : getCommandHandlers()) { String match = commandHandler.matches(commandLine); if (match != null) { cmdMap.put(match, commandHandler); } } final CommandHandler matchingHandler; switch (cmdMap.size()) { case 0: callback.setStatus(DispatchCallback.Status.FAILURE); error(loc("unknown-command", commandLine)); return; case 1: matchingHandler = cmdMap.values().iterator().next(); break; default: // look for the exact match matchingHandler = cmdMap.get(split(commandLine, 1)[0]); if (matchingHandler == null) { callback.setStatus(DispatchCallback.Status.FAILURE); error(loc("multiple-matches", cmdMap.keySet().toString())); return; } break; } echoToFile = matchingHandler.echoToFile(); callback.setStatus(DispatchCallback.Status.RUNNING); matchingHandler.execute(commandLine, callback); } else { echoToFile = true; callback.setStatus(DispatchCallback.Status.RUNNING); commands.sql(line, callback); } // save it to the current script, if any if (scriptOutputFile != null && echoToFile) { scriptOutputFile.addLine(line); } } }
public class class_name { void dispatch(String line, DispatchCallback callback) { if (line == null) { // exit exit = true; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } if (line.trim().length() == 0) { callback.setStatus(DispatchCallback.Status.SUCCESS); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } if (isComment(line)) { callback.setStatus(DispatchCallback.Status.SUCCESS); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } line = line.trim(); if (isHelpRequest(line)) { line = COMMAND_PREFIX + "help"; // depends on control dependency: [if], data = [none] } final boolean echoToFile; if (line.startsWith(COMMAND_PREFIX)) { Map<String, CommandHandler> cmdMap = new TreeMap<>(); String commandLine = line.substring(1); for (CommandHandler commandHandler : getCommandHandlers()) { String match = commandHandler.matches(commandLine); if (match != null) { cmdMap.put(match, commandHandler); // depends on control dependency: [if], data = [(match] } } final CommandHandler matchingHandler; switch (cmdMap.size()) { case 0: callback.setStatus(DispatchCallback.Status.FAILURE); error(loc("unknown-command", commandLine)); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] case 1: matchingHandler = cmdMap.values().iterator().next(); break; default: // look for the exact match matchingHandler = cmdMap.get(split(commandLine, 1)[0]); if (matchingHandler == null) { callback.setStatus(DispatchCallback.Status.FAILURE); // depends on control dependency: [if], data = [none] error(loc("multiple-matches", cmdMap.keySet().toString())); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } break; } echoToFile = matchingHandler.echoToFile(); callback.setStatus(DispatchCallback.Status.RUNNING); matchingHandler.execute(commandLine, callback); } else { echoToFile = true; callback.setStatus(DispatchCallback.Status.RUNNING); commands.sql(line, callback); } // save it to the current script, if any if (scriptOutputFile != null && echoToFile) { scriptOutputFile.addLine(line); } } }
public class class_name { synchronized void paintComponent(Graphics componentGraphics) { int width = getWidth(); int height = getHeight(); this.scrollController.updateModel( virtualTerminal.getBufferLineCount() * getFontHeight(), height); boolean needToUpdateBackBuffer = // User has used the scrollbar, we need to update the back buffer to reflect this lastBufferUpdateScrollPosition != scrollController.getScrollingOffset() || // There is blinking text to update hasBlinkingText || // We simply have a hint that we should update everything needFullRedraw; // Detect resize if(width != lastComponentWidth || height != lastComponentHeight) { int columns = width / getFontWidth(); int rows = height / getFontHeight(); TerminalSize terminalSize = virtualTerminal.getTerminalSize().withColumns(columns).withRows(rows); virtualTerminal.setTerminalSize(terminalSize); // Back buffer needs to be updated since the component size has changed needToUpdateBackBuffer = true; } if(needToUpdateBackBuffer) { updateBackBuffer(scrollController.getScrollingOffset()); } ensureGraphicBufferHasRightSize(); Rectangle clipBounds = componentGraphics.getClipBounds(); if(clipBounds == null) { clipBounds = new Rectangle(0, 0, getWidth(), getHeight()); } componentGraphics.drawImage( backbuffer, // Destination coordinates clipBounds.x, clipBounds.y, clipBounds.width, clipBounds.height, // Source coordinates clipBounds.x, clipBounds.y, clipBounds.width, clipBounds.height, null); // Take care of the left-over area at the bottom and right of the component where no character can fit //int leftoverHeight = getHeight() % getFontHeight(); int leftoverWidth = getWidth() % getFontWidth(); componentGraphics.setColor(Color.BLACK); if(leftoverWidth > 0) { componentGraphics.fillRect(getWidth() - leftoverWidth, 0, leftoverWidth, getHeight()); } //0, 0, getWidth(), getHeight(), 0, 0, getWidth(), getHeight(), null); this.lastComponentWidth = width; this.lastComponentHeight = height; componentGraphics.dispose(); notifyAll(); } }
public class class_name { synchronized void paintComponent(Graphics componentGraphics) { int width = getWidth(); int height = getHeight(); this.scrollController.updateModel( virtualTerminal.getBufferLineCount() * getFontHeight(), height); boolean needToUpdateBackBuffer = // User has used the scrollbar, we need to update the back buffer to reflect this lastBufferUpdateScrollPosition != scrollController.getScrollingOffset() || // There is blinking text to update hasBlinkingText || // We simply have a hint that we should update everything needFullRedraw; // Detect resize if(width != lastComponentWidth || height != lastComponentHeight) { int columns = width / getFontWidth(); int rows = height / getFontHeight(); TerminalSize terminalSize = virtualTerminal.getTerminalSize().withColumns(columns).withRows(rows); virtualTerminal.setTerminalSize(terminalSize); // depends on control dependency: [if], data = [none] // Back buffer needs to be updated since the component size has changed needToUpdateBackBuffer = true; // depends on control dependency: [if], data = [none] } if(needToUpdateBackBuffer) { updateBackBuffer(scrollController.getScrollingOffset()); // depends on control dependency: [if], data = [none] } ensureGraphicBufferHasRightSize(); Rectangle clipBounds = componentGraphics.getClipBounds(); if(clipBounds == null) { clipBounds = new Rectangle(0, 0, getWidth(), getHeight()); // depends on control dependency: [if], data = [none] } componentGraphics.drawImage( backbuffer, // Destination coordinates clipBounds.x, clipBounds.y, clipBounds.width, clipBounds.height, // Source coordinates clipBounds.x, clipBounds.y, clipBounds.width, clipBounds.height, null); // Take care of the left-over area at the bottom and right of the component where no character can fit //int leftoverHeight = getHeight() % getFontHeight(); int leftoverWidth = getWidth() % getFontWidth(); componentGraphics.setColor(Color.BLACK); if(leftoverWidth > 0) { componentGraphics.fillRect(getWidth() - leftoverWidth, 0, leftoverWidth, getHeight()); // depends on control dependency: [if], data = [none] } //0, 0, getWidth(), getHeight(), 0, 0, getWidth(), getHeight(), null); this.lastComponentWidth = width; this.lastComponentHeight = height; componentGraphics.dispose(); notifyAll(); } }
public class class_name { Arc findarc(int type, short co) { for (Arc a = outs; a != null; a = a.outchain) { if (a.type == type && a.co == co) { return a; } } return null; } }
public class class_name { Arc findarc(int type, short co) { for (Arc a = outs; a != null; a = a.outchain) { if (a.type == type && a.co == co) { return a; // depends on control dependency: [if], data = [none] } } return null; } }
public class class_name { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> switchMap(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int bufferSize) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); if (this instanceof ScalarCallable) { @SuppressWarnings("unchecked") T v = ((ScalarCallable<T>)this).call(); if (v == null) { return empty(); } return ObservableScalarXMap.scalarXMap(v, mapper); } return RxJavaPlugins.onAssembly(new ObservableSwitchMap<T, R>(this, mapper, bufferSize, false)); } }
public class class_name { @CheckReturnValue @SchedulerSupport(SchedulerSupport.NONE) public final <R> Observable<R> switchMap(Function<? super T, ? extends ObservableSource<? extends R>> mapper, int bufferSize) { ObjectHelper.requireNonNull(mapper, "mapper is null"); ObjectHelper.verifyPositive(bufferSize, "bufferSize"); if (this instanceof ScalarCallable) { @SuppressWarnings("unchecked") T v = ((ScalarCallable<T>)this).call(); if (v == null) { return empty(); // depends on control dependency: [if], data = [none] } return ObservableScalarXMap.scalarXMap(v, mapper); // depends on control dependency: [if], data = [none] } return RxJavaPlugins.onAssembly(new ObservableSwitchMap<T, R>(this, mapper, bufferSize, false)); } }
public class class_name { public BatchGetQueryExecutionRequest withQueryExecutionIds(String... queryExecutionIds) { if (this.queryExecutionIds == null) { setQueryExecutionIds(new java.util.ArrayList<String>(queryExecutionIds.length)); } for (String ele : queryExecutionIds) { this.queryExecutionIds.add(ele); } return this; } }
public class class_name { public BatchGetQueryExecutionRequest withQueryExecutionIds(String... queryExecutionIds) { if (this.queryExecutionIds == null) { setQueryExecutionIds(new java.util.ArrayList<String>(queryExecutionIds.length)); // depends on control dependency: [if], data = [none] } for (String ele : queryExecutionIds) { this.queryExecutionIds.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static String stringDefaultValue(String bytes) { try { return new String(bytes.getBytes("ISO-8859-1"), "UTF-8"); } catch (UnsupportedEncodingException e) { // This should never happen since all JVMs are required to implement // both of the above character sets. throw new IllegalStateException( "Java VM does not support a standard character set.", e); } } }
public class class_name { public static String stringDefaultValue(String bytes) { try { return new String(bytes.getBytes("ISO-8859-1"), "UTF-8"); // depends on control dependency: [try], data = [none] } catch (UnsupportedEncodingException e) { // This should never happen since all JVMs are required to implement // both of the above character sets. throw new IllegalStateException( "Java VM does not support a standard character set.", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @VisibleForTesting String getActiveDomain(String taskType, String[] domains) { if (domains == null || domains.length == 0) { return null; } return Arrays.stream(domains) .filter(domain -> !domain.equalsIgnoreCase("NO_DOMAIN")) .map(domain -> executionDAOFacade.getTaskPollDataByDomain(taskType, domain.trim())) .filter(Objects::nonNull) .filter(validateLastPolledTime) .findFirst() .map(PollData::getDomain) .orElse(domains[domains.length - 1].trim().equalsIgnoreCase("NO_DOMAIN") ? null : domains[domains.length - 1].trim()); } }
public class class_name { @VisibleForTesting String getActiveDomain(String taskType, String[] domains) { if (domains == null || domains.length == 0) { return null; // depends on control dependency: [if], data = [none] } return Arrays.stream(domains) .filter(domain -> !domain.equalsIgnoreCase("NO_DOMAIN")) .map(domain -> executionDAOFacade.getTaskPollDataByDomain(taskType, domain.trim())) .filter(Objects::nonNull) .filter(validateLastPolledTime) .findFirst() .map(PollData::getDomain) .orElse(domains[domains.length - 1].trim().equalsIgnoreCase("NO_DOMAIN") ? null : domains[domains.length - 1].trim()); } }
public class class_name { public static Object getScopedSessionAttr( String attrName, HttpServletRequest request ) { HttpSession session = request.getSession( false ); if ( session != null ) { return session.getAttribute( getScopedSessionAttrName( attrName, request ) ); } else { return null; } } }
public class class_name { public static Object getScopedSessionAttr( String attrName, HttpServletRequest request ) { HttpSession session = request.getSession( false ); if ( session != null ) { return session.getAttribute( getScopedSessionAttrName( attrName, request ) ); // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { private void cumulateSoil( List<Coordinate> pathCoordinates, List<Boolean> isBetweenSlopesCondition ) { // pm.beginTask("Cumulate Soil...", pathCoordinates.size()); java.awt.Point point = new java.awt.Point(); GridGeometry2D gridGeometry = inSoil.getGridGeometry(); /* * check if the trigger is too far to reach the network. */ double distance = 0.0; Coordinate previousCoordinate = null; for( int i = 0; i < pathCoordinates.size(); i++ ) { Coordinate coordinate = pathCoordinates.get(i); CoverageUtilities.colRowFromCoordinate(coordinate, gridGeometry, point); double net = netIter.getSampleDouble(point.x, point.y, 0); if (previousCoordinate != null) { distance = distance + coordinate.distance(previousCoordinate); } previousCoordinate = coordinate; if (distance > pDistance) { // if distance is too large, the path can be discarded return; } if (!isNovalue(net)) { // if path gets into the network, it has to be considered break; } } /* * do the actual cumulation map */ double previousCumulated = 0.0; for( int i = 0; i < pathCoordinates.size(); i++ ) { Coordinate coordinate = pathCoordinates.get(i); CoverageUtilities.colRowFromCoordinate(coordinate, gridGeometry, point); boolean isBetweenSlopes = isBetweenSlopesCondition.get(i); double soil = soilIter.getSampleDouble(point.x, point.y, 0); if (isNovalue(soil)) { throw new ModelsIllegalargumentException("The soil map needs to cover the whole paths.", this, pm); } double net = netIter.getSampleDouble(point.x, point.y, 0); if (!isNovalue(net)) { isBetweenSlopes = true; } double cumulated = outSoilIter.getSampleDouble(point.x, point.y, 0); if (isBetweenSlopes) { if (isNovalue(cumulated)) { outSoilIter.setSample(point.x, point.y, 0, previousCumulated); } else { double newCumulated = cumulated + previousCumulated; outSoilIter.setSample(point.x, point.y, 0, newCumulated); } } else { if (isNovalue(cumulated)) { double newCumulated = soil + previousCumulated; outSoilIter.setSample(point.x, point.y, 0, newCumulated); previousCumulated = newCumulated; } else { double newCumulated = cumulated + previousCumulated; outSoilIter.setSample(point.x, point.y, 0, newCumulated); } } } if (doWholenet) { Coordinate lastCoordinate = pathCoordinates.get(pathCoordinates.size() - 1); CoverageUtilities.colRowFromCoordinate(lastCoordinate, gridGeometry, point); int[] flowDirColRow = new int[]{point.x, point.y}; double net = netIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); double tmpFlowValue = flowIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); // handle the last point of the path only if it was inside the net... if (!isNovalue(net)) { // first move to the next point if (!ModelsEngine.go_downstream(flowDirColRow, tmpFlowValue)) throw new ModelsIllegalargumentException( "Unable to go downstream [col/row]: " + flowDirColRow[0] + "/" + flowDirColRow[1], this, pm); tmpFlowValue = flowIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); while( !isNovalue(tmpFlowValue) && tmpFlowValue != 10 ) { double cumulated = outSoilIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); if (isNovalue(cumulated)) { cumulated = 0.0; } double newCumulated = cumulated + previousCumulated; outSoilIter.setSample(flowDirColRow[0], flowDirColRow[1], 0, newCumulated); if (!ModelsEngine.go_downstream(flowDirColRow, tmpFlowValue)) throw new ModelsIllegalargumentException( "Unable to go downstream [col/row]: " + flowDirColRow[0] + "/" + flowDirColRow[1], this, pm); tmpFlowValue = flowIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); } } } } }
public class class_name { private void cumulateSoil( List<Coordinate> pathCoordinates, List<Boolean> isBetweenSlopesCondition ) { // pm.beginTask("Cumulate Soil...", pathCoordinates.size()); java.awt.Point point = new java.awt.Point(); GridGeometry2D gridGeometry = inSoil.getGridGeometry(); /* * check if the trigger is too far to reach the network. */ double distance = 0.0; Coordinate previousCoordinate = null; for( int i = 0; i < pathCoordinates.size(); i++ ) { Coordinate coordinate = pathCoordinates.get(i); CoverageUtilities.colRowFromCoordinate(coordinate, gridGeometry, point); // depends on control dependency: [for], data = [none] double net = netIter.getSampleDouble(point.x, point.y, 0); if (previousCoordinate != null) { distance = distance + coordinate.distance(previousCoordinate); // depends on control dependency: [if], data = [(previousCoordinate] } previousCoordinate = coordinate; // depends on control dependency: [for], data = [none] if (distance > pDistance) { // if distance is too large, the path can be discarded return; // depends on control dependency: [if], data = [none] } if (!isNovalue(net)) { // if path gets into the network, it has to be considered break; } } /* * do the actual cumulation map */ double previousCumulated = 0.0; for( int i = 0; i < pathCoordinates.size(); i++ ) { Coordinate coordinate = pathCoordinates.get(i); CoverageUtilities.colRowFromCoordinate(coordinate, gridGeometry, point); // depends on control dependency: [for], data = [none] boolean isBetweenSlopes = isBetweenSlopesCondition.get(i); double soil = soilIter.getSampleDouble(point.x, point.y, 0); if (isNovalue(soil)) { throw new ModelsIllegalargumentException("The soil map needs to cover the whole paths.", this, pm); } double net = netIter.getSampleDouble(point.x, point.y, 0); if (!isNovalue(net)) { isBetweenSlopes = true; // depends on control dependency: [if], data = [none] } double cumulated = outSoilIter.getSampleDouble(point.x, point.y, 0); if (isBetweenSlopes) { if (isNovalue(cumulated)) { outSoilIter.setSample(point.x, point.y, 0, previousCumulated); // depends on control dependency: [if], data = [none] } else { double newCumulated = cumulated + previousCumulated; outSoilIter.setSample(point.x, point.y, 0, newCumulated); // depends on control dependency: [if], data = [none] } } else { if (isNovalue(cumulated)) { double newCumulated = soil + previousCumulated; outSoilIter.setSample(point.x, point.y, 0, newCumulated); // depends on control dependency: [if], data = [none] previousCumulated = newCumulated; // depends on control dependency: [if], data = [none] } else { double newCumulated = cumulated + previousCumulated; outSoilIter.setSample(point.x, point.y, 0, newCumulated); // depends on control dependency: [if], data = [none] } } } if (doWholenet) { Coordinate lastCoordinate = pathCoordinates.get(pathCoordinates.size() - 1); CoverageUtilities.colRowFromCoordinate(lastCoordinate, gridGeometry, point); // depends on control dependency: [if], data = [none] int[] flowDirColRow = new int[]{point.x, point.y}; double net = netIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); double tmpFlowValue = flowIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); // handle the last point of the path only if it was inside the net... if (!isNovalue(net)) { // first move to the next point if (!ModelsEngine.go_downstream(flowDirColRow, tmpFlowValue)) throw new ModelsIllegalargumentException( "Unable to go downstream [col/row]: " + flowDirColRow[0] + "/" + flowDirColRow[1], this, pm); tmpFlowValue = flowIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); // depends on control dependency: [if], data = [none] while( !isNovalue(tmpFlowValue) && tmpFlowValue != 10 ) { double cumulated = outSoilIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); if (isNovalue(cumulated)) { cumulated = 0.0; // depends on control dependency: [if], data = [none] } double newCumulated = cumulated + previousCumulated; outSoilIter.setSample(flowDirColRow[0], flowDirColRow[1], 0, newCumulated); // depends on control dependency: [while], data = [none] if (!ModelsEngine.go_downstream(flowDirColRow, tmpFlowValue)) throw new ModelsIllegalargumentException( "Unable to go downstream [col/row]: " + flowDirColRow[0] + "/" + flowDirColRow[1], this, pm); tmpFlowValue = flowIter.getSampleDouble(flowDirColRow[0], flowDirColRow[1], 0); // depends on control dependency: [while], data = [none] } } } } }
public class class_name { <T extends WriterSegmentProcessor> long getLowestUncommittedSequenceNumber(Iterable<T> processors) { // We need to find the lowest value across all processors that have uncommitted data. long result = Long.MAX_VALUE; for (WriterSegmentProcessor p : processors) { // If a processor has uncommitted data, its LUSN will be a positive number. Otherwise it means it is up-to-date. long sn = p.getLowestUncommittedSequenceNumber(); if (sn >= 0 && sn < result) { result = sn; } } // If at least one processor has uncommitted data, return the smallest LUSN among them. Otherwise report that // everything is up-to date. return result == Long.MAX_VALUE ? Operation.NO_SEQUENCE_NUMBER : result; } }
public class class_name { <T extends WriterSegmentProcessor> long getLowestUncommittedSequenceNumber(Iterable<T> processors) { // We need to find the lowest value across all processors that have uncommitted data. long result = Long.MAX_VALUE; for (WriterSegmentProcessor p : processors) { // If a processor has uncommitted data, its LUSN will be a positive number. Otherwise it means it is up-to-date. long sn = p.getLowestUncommittedSequenceNumber(); if (sn >= 0 && sn < result) { result = sn; // depends on control dependency: [if], data = [none] } } // If at least one processor has uncommitted data, return the smallest LUSN among them. Otherwise report that // everything is up-to date. return result == Long.MAX_VALUE ? Operation.NO_SEQUENCE_NUMBER : result; } }
public class class_name { @Override public void run() { while (!stop) { EventModel event; try { event = blockingQueueHandling(); //gets the new Event if one was added to the blockingQueue } catch (InterruptedException e) { getContext().getLogger().warn(e); continue; } List<CompletableFuture<X>> outputExtensions = getContext().getOutput() .generateAllOutputExtensions(this, getArgument(), event); try { outputExtensions = timeOut(outputExtensions, getTimeoutLimit()); } catch (InterruptedException e) { getContext().getLogger().warn(e); } handleFutures(outputExtensions, event); //notifies output-manager when done processing isDone(event); } } }
public class class_name { @Override public void run() { while (!stop) { EventModel event; try { event = blockingQueueHandling(); //gets the new Event if one was added to the blockingQueue // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { getContext().getLogger().warn(e); continue; } // depends on control dependency: [catch], data = [none] List<CompletableFuture<X>> outputExtensions = getContext().getOutput() .generateAllOutputExtensions(this, getArgument(), event); try { outputExtensions = timeOut(outputExtensions, getTimeoutLimit()); // depends on control dependency: [try], data = [none] } catch (InterruptedException e) { getContext().getLogger().warn(e); } // depends on control dependency: [catch], data = [none] handleFutures(outputExtensions, event); // depends on control dependency: [while], data = [none] //notifies output-manager when done processing isDone(event); // depends on control dependency: [while], data = [none] } } }
public class class_name { private int getHalogenCount(IAtomContainer ac, IAtom atom) { List<IAtom> neighbours = ac.getConnectedAtomsList(atom); int acounter = 0; for (IAtom neighbour : neighbours) { if (neighbour.getSymbol().equals("F") || neighbour.getSymbol().equals("I") || neighbour.getSymbol().equals("Cl") || neighbour.getSymbol().equals("Br")) { acounter += 1; } } return acounter; } }
public class class_name { private int getHalogenCount(IAtomContainer ac, IAtom atom) { List<IAtom> neighbours = ac.getConnectedAtomsList(atom); int acounter = 0; for (IAtom neighbour : neighbours) { if (neighbour.getSymbol().equals("F") || neighbour.getSymbol().equals("I") || neighbour.getSymbol().equals("Cl") || neighbour.getSymbol().equals("Br")) { acounter += 1; // depends on control dependency: [if], data = [none] } } return acounter; } }
public class class_name { public void marshall(ProvisionedProductDetail provisionedProductDetail, ProtocolMarshaller protocolMarshaller) { if (provisionedProductDetail == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(provisionedProductDetail.getName(), NAME_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getArn(), ARN_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getType(), TYPE_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getId(), ID_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getStatus(), STATUS_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getStatusMessage(), STATUSMESSAGE_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getCreatedTime(), CREATEDTIME_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getIdempotencyToken(), IDEMPOTENCYTOKEN_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getLastRecordId(), LASTRECORDID_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getProductId(), PRODUCTID_BINDING); protocolMarshaller.marshall(provisionedProductDetail.getProvisioningArtifactId(), PROVISIONINGARTIFACTID_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(ProvisionedProductDetail provisionedProductDetail, ProtocolMarshaller protocolMarshaller) { if (provisionedProductDetail == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(provisionedProductDetail.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getArn(), ARN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getType(), TYPE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getId(), ID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getStatusMessage(), STATUSMESSAGE_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getCreatedTime(), CREATEDTIME_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getIdempotencyToken(), IDEMPOTENCYTOKEN_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getLastRecordId(), LASTRECORDID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getProductId(), PRODUCTID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(provisionedProductDetail.getProvisioningArtifactId(), PROVISIONINGARTIFACTID_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 { protected boolean isConditionColor(final Token.Condition token) { if(MSColor.valueOfKnownColor(token.getCondition()) != null) { return true; } return PATTERN_CONDITION_INDEX_COLOR.matcher(token.getValue()).matches(); } }
public class class_name { protected boolean isConditionColor(final Token.Condition token) { if(MSColor.valueOfKnownColor(token.getCondition()) != null) { return true; // depends on control dependency: [if], data = [none] } return PATTERN_CONDITION_INDEX_COLOR.matcher(token.getValue()).matches(); } }
public class class_name { public static String asString(Object o) { if (o == null) { return NULL; } else if (o instanceof Stringable) { return ((Stringable) o).asString(); } else if (o instanceof Numeric) { return String.format("%d", ((Numeric) o).asInteger()); } else if (o instanceof CharSequence) { return String.format("\"%s\"", escape((CharSequence) o)); } else if (o instanceof Double) { return asString(((Double) o).doubleValue()); } else if (o instanceof Collection) { return asString((Collection<?>) o); } else if (o instanceof Map) { return asString((Map<?, ?>) o); } else { return o.toString(); } } }
public class class_name { public static String asString(Object o) { if (o == null) { return NULL; // depends on control dependency: [if], data = [none] } else if (o instanceof Stringable) { return ((Stringable) o).asString(); // depends on control dependency: [if], data = [none] } else if (o instanceof Numeric) { return String.format("%d", ((Numeric) o).asInteger()); // depends on control dependency: [if], data = [none] } else if (o instanceof CharSequence) { return String.format("\"%s\"", escape((CharSequence) o)); // depends on control dependency: [if], data = [none] } else if (o instanceof Double) { return asString(((Double) o).doubleValue()); // depends on control dependency: [if], data = [none] } else if (o instanceof Collection) { return asString((Collection<?>) o); // depends on control dependency: [if], data = [none] } else if (o instanceof Map) { return asString((Map<?, ?>) o); // depends on control dependency: [if], data = [none] } else { return o.toString(); // depends on control dependency: [if], data = [none] } } }
public class class_name { static public boolean canRepresent(CharSequence str0) { if (str0 == null) { return true; } int len = str0.length(); for (int i = 0; i < len; i++) { // get the char in this string char c = str0.charAt(i); // simple range checks for most common characters (0x20 -> 0x5F) or (0x61 -> 0x7E) if ((c >= ' ' && c <= '_') || (c >= 'a' && c <= '~')) { continue; } else { // 10X more efficient using a switch statement vs. a lookup table search switch (c) { case '\u00A3': // £ case '\u00A5': // ¥ case '\u00E8': // è case '\u00E9': // é case '\u00F9': // ù case '\u00EC': // ì case '\u00F2': // ò case '\u00C7': // Ç case '\n': // newline case '\u00D8': // Ø case '\u00F8': // ø case '\r': // carriage return case '\u000c': // form feed case '\u00C5': // Å case '\u00E5': // å case '\u0394': // Δ case '\u03A6': // Φ case '\u0393': // Γ case '\u039B': // Λ case '\u03A9': // Ω case '\u03A0': // Π case '\u03A8': // Ψ case '\u03A3': // Σ case '\u0398': // Θ case '\u039E': // Ξ case '\u00C6': // Æ case '\u00E6': // æ case '\u00DF': // ß case '\u00C9': // É case '\u00A4': // ¤ case '\u00A1': // ¡ case '\u00C4': // Ä case '\u00D6': // Ö case '\u00D1': // Ñ case '\u00DC': // Ü case '\u00A7': // § case '\u00BF': // ¿ case '\u00E4': // ä case '\u00F6': // ö case '\u00F1': // ñ case '\u00FC': // ü case '\u00E0': // à case '\u20AC': // € continue; default: return false; } } } return true; } }
public class class_name { static public boolean canRepresent(CharSequence str0) { if (str0 == null) { return true; // depends on control dependency: [if], data = [none] } int len = str0.length(); for (int i = 0; i < len; i++) { // get the char in this string char c = str0.charAt(i); // simple range checks for most common characters (0x20 -> 0x5F) or (0x61 -> 0x7E) if ((c >= ' ' && c <= '_') || (c >= 'a' && c <= '~')) { continue; } else { // 10X more efficient using a switch statement vs. a lookup table search switch (c) { case '\u00A3': // £ case '\u00A5': // ¥ case '\u00E8': // è case '\u00E9': // é case '\u00F9': // ù case '\u00EC': // ì case '\u00F2': // ò case '\u00C7': // Ç case '\n': // newline case '\u00D8': // Ø case '\u00F8': // ø case '\r': // carriage return case '\u000c': // form feed case '\u00C5': // Å case '\u00E5': // å case '\u0394': // Δ case '\u03A6': // Φ case '\u0393': // Γ case '\u039B': // Λ case '\u03A9': // Ω case '\u03A0': // Π case '\u03A8': // Ψ case '\u03A3': // Σ case '\u0398': // Θ case '\u039E': // Ξ case '\u00C6': // Æ case '\u00E6': // æ case '\u00DF': // ß case '\u00C9': // É case '\u00A4': // ¤ case '\u00A1': // ¡ case '\u00C4': // Ä case '\u00D6': // Ö case '\u00D1': // Ñ case '\u00DC': // Ü case '\u00A7': // § case '\u00BF': // ¿ case '\u00E4': // ä case '\u00F6': // ö case '\u00F1': // ñ case '\u00FC': // ü case '\u00E0': // à case '\u20AC': // € continue; default: return false; } } } return true; } }
public class class_name { public Iterator getSelectedRows() { TreePath[] paths = table.getSelectionPaths(); if ((paths == null) || (paths.length < 1)) return null; HashSet set = new HashSet(2 * paths.length); for (TreePath path : paths) { model.addRowsToSetFromPath(table.getTree(), path, set); } return set.iterator(); } }
public class class_name { public Iterator getSelectedRows() { TreePath[] paths = table.getSelectionPaths(); if ((paths == null) || (paths.length < 1)) return null; HashSet set = new HashSet(2 * paths.length); for (TreePath path : paths) { model.addRowsToSetFromPath(table.getTree(), path, set); // depends on control dependency: [for], data = [path] } return set.iterator(); } }
public class class_name { private static String getAttributeName(XsdAttribute attribute) { String name = ATTRIBUTE_PREFIX + getCleanName(attribute); if (attributeHasEnum(attribute)) { return name + getEnumName(attribute).replaceAll(name, ""); } String javaType = getFullJavaType(attribute); return name + javaType.substring(javaType.lastIndexOf('/') + 1, javaType.length() - 1); } }
public class class_name { private static String getAttributeName(XsdAttribute attribute) { String name = ATTRIBUTE_PREFIX + getCleanName(attribute); if (attributeHasEnum(attribute)) { return name + getEnumName(attribute).replaceAll(name, ""); // depends on control dependency: [if], data = [none] } String javaType = getFullJavaType(attribute); return name + javaType.substring(javaType.lastIndexOf('/') + 1, javaType.length() - 1); } }
public class class_name { protected TypeData mergeTypeData(final XExpression expression, List<TypeData> allValues, boolean returnType, boolean nullIfEmpty) { int allSize = allValues.size(); if (nullIfEmpty && allSize == 0) { return null; } final List<TypeData> values; if (allSize == 1) { TypeData result = allValues.get(0); if (result.isReturnType() == returnType) { return getSingleMergeResult(result, expression, returnType); } if (nullIfEmpty) return null; if (returnType) { return getSingleMergeResult(result, expression, returnType); } values = Collections.emptyList(); } else { values = collectValues(allValues, returnType); } if (nullIfEmpty && values.size() == 0) { return null; } if (values.size() == 1) { TypeData typeData = values.get(0); return getSingleMergeResult(typeData, expression, returnType); } MergeData mergeData = new MergeData(); enhanceMergeData(values, mergeData); LightweightTypeReference mergedType = getMergedType(mergeData, values); // TODO improve - return error type information if (mergedType == null) return null; if (mergeData.expectation == null) { throw new IllegalStateException("Expectation should never be null here"); } mergedType = refineMergedType(mergeData, mergedType, returnType, nullIfEmpty); TypeData result = new TypeData(expression, mergeData.expectation, mergedType, mergeData.mergedFlags , returnType); return result; } }
public class class_name { protected TypeData mergeTypeData(final XExpression expression, List<TypeData> allValues, boolean returnType, boolean nullIfEmpty) { int allSize = allValues.size(); if (nullIfEmpty && allSize == 0) { return null; // depends on control dependency: [if], data = [none] } final List<TypeData> values; if (allSize == 1) { TypeData result = allValues.get(0); if (result.isReturnType() == returnType) { return getSingleMergeResult(result, expression, returnType); // depends on control dependency: [if], data = [returnType)] } if (nullIfEmpty) return null; if (returnType) { return getSingleMergeResult(result, expression, returnType); // depends on control dependency: [if], data = [none] } values = Collections.emptyList(); // depends on control dependency: [if], data = [none] } else { values = collectValues(allValues, returnType); // depends on control dependency: [if], data = [none] } if (nullIfEmpty && values.size() == 0) { return null; // depends on control dependency: [if], data = [none] } if (values.size() == 1) { TypeData typeData = values.get(0); return getSingleMergeResult(typeData, expression, returnType); // depends on control dependency: [if], data = [none] } MergeData mergeData = new MergeData(); enhanceMergeData(values, mergeData); LightweightTypeReference mergedType = getMergedType(mergeData, values); // TODO improve - return error type information if (mergedType == null) return null; if (mergeData.expectation == null) { throw new IllegalStateException("Expectation should never be null here"); } mergedType = refineMergedType(mergeData, mergedType, returnType, nullIfEmpty); TypeData result = new TypeData(expression, mergeData.expectation, mergedType, mergeData.mergedFlags , returnType); return result; } }
public class class_name { public static Set<Path> getDeepestLevelRenamedDirsWithFileExistence (FileSystem fs, Set<Path> paths) throws IOException { Set<Path> renamedDirs = Sets.newHashSet(); for (FileStatus fileStatus : FileListUtils.listFilesRecursively(fs, paths)) { if (fileStatus.getPath().getParent().toString().endsWith(MRCompactor.COMPACTION_RENAME_SOURCE_DIR_SUFFIX)) { renamedDirs.add(fileStatus.getPath().getParent()); } } return renamedDirs; } }
public class class_name { public static Set<Path> getDeepestLevelRenamedDirsWithFileExistence (FileSystem fs, Set<Path> paths) throws IOException { Set<Path> renamedDirs = Sets.newHashSet(); for (FileStatus fileStatus : FileListUtils.listFilesRecursively(fs, paths)) { if (fileStatus.getPath().getParent().toString().endsWith(MRCompactor.COMPACTION_RENAME_SOURCE_DIR_SUFFIX)) { renamedDirs.add(fileStatus.getPath().getParent()); // depends on control dependency: [if], data = [none] } } return renamedDirs; } }
public class class_name { public void setClusterListEntries(java.util.Collection<ClusterListEntry> clusterListEntries) { if (clusterListEntries == null) { this.clusterListEntries = null; return; } this.clusterListEntries = new java.util.ArrayList<ClusterListEntry>(clusterListEntries); } }
public class class_name { public void setClusterListEntries(java.util.Collection<ClusterListEntry> clusterListEntries) { if (clusterListEntries == null) { this.clusterListEntries = null; // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } this.clusterListEntries = new java.util.ArrayList<ClusterListEntry>(clusterListEntries); } }
public class class_name { @Override public Optional<Property.Builder> getPropertyNames( TypeElement valueType, ExecutableElement method) { boolean declaredOnValueType = method.getEnclosingElement().equals(valueType); String name = method.getSimpleName().toString(); Matcher getterMatcher = GETTER_PATTERN.matcher(name); if (!getterMatcher.matches()) { if (declaredOnValueType) { messager.printMessage( ERROR, "Only getter methods (starting with '" + GET_PREFIX + "' or '" + IS_PREFIX + "') may be declared abstract on FreeBuilder types", method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } String prefix = getterMatcher.group(1); String capitalizedName = getterMatcher.group(2); if (hasUpperCase(capitalizedName.codePointAt(0))) { if (declaredOnValueType) { String message = new StringBuilder() .append("Getter methods cannot have a lowercase character immediately after the '") .append(prefix) .append("' prefix on FreeBuilder types (did you mean '") .append(prefix) .appendCodePoint(Character.toUpperCase(capitalizedName.codePointAt(0))) .append(capitalizedName.substring(capitalizedName.offsetByCodePoints(0, 1))) .append("'?)") .toString(); messager.printMessage(ERROR, message, method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } TypeMirror returnType = getReturnType(valueType, method, types); if (returnType.getKind() == TypeKind.VOID) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods must not be void on FreeBuilder types", method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } if (prefix.equals(IS_PREFIX) && (returnType.getKind() != TypeKind.BOOLEAN)) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods starting with '" + IS_PREFIX + "' must return a boolean on FreeBuilder types", method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } if (!method.getParameters().isEmpty()) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods cannot take parameters on FreeBuilder types", method); } else { printNoImplementationMessage(valueType, method); } return Optional.empty(); } if (!isLegalType(returnType)) { // The compiler should already have issued an error. return Optional.empty(); } String camelCaseName = Introspector.decapitalize(capitalizedName); return Optional.of(new Property.Builder() .setUsingBeanConvention(true) .setName(camelCaseName) .setCapitalizedName(capitalizedName) .setGetterName(getterMatcher.group(0))); } }
public class class_name { @Override public Optional<Property.Builder> getPropertyNames( TypeElement valueType, ExecutableElement method) { boolean declaredOnValueType = method.getEnclosingElement().equals(valueType); String name = method.getSimpleName().toString(); Matcher getterMatcher = GETTER_PATTERN.matcher(name); if (!getterMatcher.matches()) { if (declaredOnValueType) { messager.printMessage( ERROR, "Only getter methods (starting with '" + GET_PREFIX + "' or '" + IS_PREFIX + "') may be declared abstract on FreeBuilder types", method); // depends on control dependency: [if], data = [none] } else { printNoImplementationMessage(valueType, method); // depends on control dependency: [if], data = [none] } return Optional.empty(); // depends on control dependency: [if], data = [none] } String prefix = getterMatcher.group(1); String capitalizedName = getterMatcher.group(2); if (hasUpperCase(capitalizedName.codePointAt(0))) { if (declaredOnValueType) { String message = new StringBuilder() .append("Getter methods cannot have a lowercase character immediately after the '") .append(prefix) .append("' prefix on FreeBuilder types (did you mean '") .append(prefix) .appendCodePoint(Character.toUpperCase(capitalizedName.codePointAt(0))) .append(capitalizedName.substring(capitalizedName.offsetByCodePoints(0, 1))) .append("'?)") .toString(); messager.printMessage(ERROR, message, method); // depends on control dependency: [if], data = [none] } else { printNoImplementationMessage(valueType, method); // depends on control dependency: [if], data = [none] } return Optional.empty(); // depends on control dependency: [if], data = [none] } TypeMirror returnType = getReturnType(valueType, method, types); if (returnType.getKind() == TypeKind.VOID) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods must not be void on FreeBuilder types", method); // depends on control dependency: [if], data = [none] } else { printNoImplementationMessage(valueType, method); // depends on control dependency: [if], data = [none] } return Optional.empty(); // depends on control dependency: [if], data = [none] } if (prefix.equals(IS_PREFIX) && (returnType.getKind() != TypeKind.BOOLEAN)) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods starting with '" + IS_PREFIX + "' must return a boolean on FreeBuilder types", method); // depends on control dependency: [if], data = [none] } else { printNoImplementationMessage(valueType, method); // depends on control dependency: [if], data = [none] } return Optional.empty(); // depends on control dependency: [if], data = [none] } if (!method.getParameters().isEmpty()) { if (declaredOnValueType) { messager.printMessage( ERROR, "Getter methods cannot take parameters on FreeBuilder types", method); // depends on control dependency: [if], data = [none] } else { printNoImplementationMessage(valueType, method); // depends on control dependency: [if], data = [none] } return Optional.empty(); // depends on control dependency: [if], data = [none] } if (!isLegalType(returnType)) { // The compiler should already have issued an error. return Optional.empty(); // depends on control dependency: [if], data = [none] } String camelCaseName = Introspector.decapitalize(capitalizedName); return Optional.of(new Property.Builder() .setUsingBeanConvention(true) .setName(camelCaseName) .setCapitalizedName(capitalizedName) .setGetterName(getterMatcher.group(0))); } }
public class class_name { protected boolean isMatch(String[] words, String filter) { for (String word : words) { int len = filter.length(); if (word.regionMatches(ignoreCase, 0, filter, 0, len)) { return true; } } return false; } }
public class class_name { protected boolean isMatch(String[] words, String filter) { for (String word : words) { int len = filter.length(); if (word.regionMatches(ignoreCase, 0, filter, 0, len)) { return true; // depends on control dependency: [if], data = [none] } } return false; } }
public class class_name { public static String pingSoapHttpUrl(String soapHttpUrl) { soapHttpUrl += "?wsdl"; try { URL url = new URL(soapHttpUrl); Object content = url.getContent(); InputStream is = (InputStream)content; String c = MiscUtil.convertStreamToString(is); boolean isWsdl = c.contains("http://schemas.xmlsoap.org/wsdl"); if (isWsdl) { return OK_PREFIX + ": The url " + soapHttpUrl + " responded with a wsdl as expected"; } else { return ERROR_PREFIX + ": The url " + soapHttpUrl + " does not seem to expose a wsdl, unexpected response: " + c; } } catch (MalformedURLException e) { return ERROR_PREFIX + ": The url " + soapHttpUrl + " did not respon as expected, reason: " + e; } catch (IOException e) { return ERROR_PREFIX + ": The url " + soapHttpUrl + " did not respon as expected, reason: " + e; } } }
public class class_name { public static String pingSoapHttpUrl(String soapHttpUrl) { soapHttpUrl += "?wsdl"; try { URL url = new URL(soapHttpUrl); Object content = url.getContent(); InputStream is = (InputStream)content; String c = MiscUtil.convertStreamToString(is); boolean isWsdl = c.contains("http://schemas.xmlsoap.org/wsdl"); if (isWsdl) { return OK_PREFIX + ": The url " + soapHttpUrl + " responded with a wsdl as expected"; } else { return ERROR_PREFIX + ": The url " + soapHttpUrl + " does not seem to expose a wsdl, unexpected response: " + c; // depends on control dependency: [try], data = [none] } } catch (MalformedURLException e) { return ERROR_PREFIX + ": The url " + soapHttpUrl + " did not respon as expected, reason: " + e; } catch (IOException e) { // depends on control dependency: [catch], data = [none] return ERROR_PREFIX + ": The url " + soapHttpUrl + " did not respon as expected, reason: " + e; } // depends on control dependency: [catch], data = [none] } }
public class class_name { public static String[] allUpperCase(String... strings){ String[] tmp = new String[strings.length]; for(int idx=0;idx<strings.length;idx++){ if(strings[idx] != null){ tmp[idx] = strings[idx].toUpperCase(); } } return tmp; } }
public class class_name { public static String[] allUpperCase(String... strings){ String[] tmp = new String[strings.length]; for(int idx=0;idx<strings.length;idx++){ if(strings[idx] != null){ tmp[idx] = strings[idx].toUpperCase(); // depends on control dependency: [if], data = [none] } } return tmp; } }
public class class_name { protected void applyParseHandlers() { sequenceFlows = new HashMap<String, SequenceFlow>(); for (Process process : bpmnModel.getProcesses()) { currentProcess = process; if (process.isExecutable()) { bpmnParserHandlers.parseElement(this, process); } } } }
public class class_name { protected void applyParseHandlers() { sequenceFlows = new HashMap<String, SequenceFlow>(); for (Process process : bpmnModel.getProcesses()) { currentProcess = process; // depends on control dependency: [for], data = [process] if (process.isExecutable()) { bpmnParserHandlers.parseElement(this, process); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public Observable<ServiceResponse<Page<CertificateItem>>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink) { return getCertificateVersionsNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<CertificateItem>>, Observable<ServiceResponse<Page<CertificateItem>>>>() { @Override public Observable<ServiceResponse<Page<CertificateItem>>> call(ServiceResponse<Page<CertificateItem>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); } return Observable.just(page).concatWith(getCertificateVersionsNextWithServiceResponseAsync(nextPageLink)); } }); } }
public class class_name { public Observable<ServiceResponse<Page<CertificateItem>>> getCertificateVersionsNextWithServiceResponseAsync(final String nextPageLink) { return getCertificateVersionsNextSinglePageAsync(nextPageLink) .concatMap(new Func1<ServiceResponse<Page<CertificateItem>>, Observable<ServiceResponse<Page<CertificateItem>>>>() { @Override public Observable<ServiceResponse<Page<CertificateItem>>> call(ServiceResponse<Page<CertificateItem>> page) { String nextPageLink = page.body().nextPageLink(); if (nextPageLink == null) { return Observable.just(page); // depends on control dependency: [if], data = [none] } return Observable.just(page).concatWith(getCertificateVersionsNextWithServiceResponseAsync(nextPageLink)); } }); } }
public class class_name { public static BeanInfoManager getBeanInfoManager(Class pClass) { BeanInfoManager ret = (BeanInfoManager) mBeanInfoManagerByClass.get(pClass); if (ret == null) { ret = createBeanInfoManager(pClass); } return ret; } }
public class class_name { public static BeanInfoManager getBeanInfoManager(Class pClass) { BeanInfoManager ret = (BeanInfoManager) mBeanInfoManagerByClass.get(pClass); if (ret == null) { ret = createBeanInfoManager(pClass); // depends on control dependency: [if], data = [none] } return ret; } }
public class class_name { public static String trim(final String value, final boolean trimmed) { if(!trimmed || value == null) { return value; } return value.trim(); } }
public class class_name { public static String trim(final String value, final boolean trimmed) { if(!trimmed || value == null) { return value; // depends on control dependency: [if], data = [none] } return value.trim(); } }
public class class_name { @SuppressWarnings({"unused", "WeakerAccess"}) public void addMultiValueForKey(String key, String value) { //noinspection ConstantConditions if (value == null || value.isEmpty()) { _generateEmptyMultiValueError(key); return; } addMultiValuesForKey(key, new ArrayList<>(Collections.singletonList(value))); } }
public class class_name { @SuppressWarnings({"unused", "WeakerAccess"}) public void addMultiValueForKey(String key, String value) { //noinspection ConstantConditions if (value == null || value.isEmpty()) { _generateEmptyMultiValueError(key); // depends on control dependency: [if], data = [none] return; // depends on control dependency: [if], data = [none] } addMultiValuesForKey(key, new ArrayList<>(Collections.singletonList(value))); } }
public class class_name { @Override public <I> void hear(TypeLiteral<I> type, TypeEncounter<I> encounter) { for (Field field : type.getRawType().getDeclaredFields()) { if (field.getType().equals(Logger.class) && field.isAnnotationPresent(InjectLogger.class)) { encounter.register(new SLF4JMembersInjector<I>(field)); } } } }
public class class_name { @Override public <I> void hear(TypeLiteral<I> type, TypeEncounter<I> encounter) { for (Field field : type.getRawType().getDeclaredFields()) { if (field.getType().equals(Logger.class) && field.isAnnotationPresent(InjectLogger.class)) { encounter.register(new SLF4JMembersInjector<I>(field)); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public static String[] splitOptions(String quotedOptionString) throws Exception{ Vector<String> optionsVec = new Vector<String>(); String str = new String(quotedOptionString); int i; while (true){ //trimLeft i = 0; while ((i < str.length()) && (Character.isWhitespace(str.charAt(i)))) i++; str = str.substring(i); //stop when str is empty if (str.length() == 0) break; //if str start with a double quote if (str.charAt(0) == '"'){ //find the first not anti-slached double quote i = 1; while(i < str.length()){ if (str.charAt(i) == str.charAt(0)) break; if (str.charAt(i) == '\\'){ i += 1; if (i >= str.length()) throw new Exception("String should not finish with \\"); } i += 1; } if (i >= str.length()) throw new Exception("Quote parse error."); //add the founded string to the option vector (without quotes) String optStr = str.substring(1,i); optStr = unbackQuoteChars(optStr); optionsVec.addElement(optStr); str = str.substring(i+1); } else { //find first whiteSpace i=0; while((i < str.length()) && (!Character.isWhitespace(str.charAt(i)))) i++; //add the founded string to the option vector String optStr = str.substring(0,i); optionsVec.addElement(optStr); str = str.substring(i); } } //convert optionsVec to an array of String String[] options = new String[optionsVec.size()]; for (i = 0; i < optionsVec.size(); i++) { options[i] = (String)optionsVec.elementAt(i); } return options; } }
public class class_name { public static String[] splitOptions(String quotedOptionString) throws Exception{ Vector<String> optionsVec = new Vector<String>(); String str = new String(quotedOptionString); int i; while (true){ //trimLeft i = 0; while ((i < str.length()) && (Character.isWhitespace(str.charAt(i)))) i++; str = str.substring(i); //stop when str is empty if (str.length() == 0) break; //if str start with a double quote if (str.charAt(0) == '"'){ //find the first not anti-slached double quote i = 1; // depends on control dependency: [if], data = [none] while(i < str.length()){ if (str.charAt(i) == str.charAt(0)) break; if (str.charAt(i) == '\\'){ i += 1; // depends on control dependency: [if], data = [none] if (i >= str.length()) throw new Exception("String should not finish with \\"); } i += 1; // depends on control dependency: [while], data = [none] } if (i >= str.length()) throw new Exception("Quote parse error."); //add the founded string to the option vector (without quotes) String optStr = str.substring(1,i); optStr = unbackQuoteChars(optStr); // depends on control dependency: [if], data = [none] optionsVec.addElement(optStr); // depends on control dependency: [if], data = [none] str = str.substring(i+1); // depends on control dependency: [if], data = [none] } else { //find first whiteSpace i=0; // depends on control dependency: [if], data = [none] while((i < str.length()) && (!Character.isWhitespace(str.charAt(i)))) i++; //add the founded string to the option vector String optStr = str.substring(0,i); optionsVec.addElement(optStr); // depends on control dependency: [if], data = [none] str = str.substring(i); // depends on control dependency: [if], data = [none] } } //convert optionsVec to an array of String String[] options = new String[optionsVec.size()]; for (i = 0; i < optionsVec.size(); i++) { options[i] = (String)optionsVec.elementAt(i); } return options; } }
public class class_name { public void saveFile(File file, String type) { if (file != null) { m_treeController.saveFile(file, type); } } }
public class class_name { public void saveFile(File file, String type) { if (file != null) { m_treeController.saveFile(file, type); // depends on control dependency: [if], data = [(file] } } }
public class class_name { @Override protected Status updateObservationAndClassifierWeights(Dataframe validationDataset, AssociativeArray observationWeights) { //no update on the observationWeights, all observations have equal probability 1/n //update classifier weights with equal weights List<Double> weakClassifierWeights = knowledgeBase.getModelParameters().getWeakClassifierWeights(); //add the new weak learner in the list of weights weakClassifierWeights.add(0.0); int numberOfWeakClassifiers = weakClassifierWeights.size(); double weight = 1.0/numberOfWeakClassifiers; for(int t=0;t<numberOfWeakClassifiers;++t) { weakClassifierWeights.set(t, weight); //equal weight to all classifiers } return Status.NEXT; //always go to next } }
public class class_name { @Override protected Status updateObservationAndClassifierWeights(Dataframe validationDataset, AssociativeArray observationWeights) { //no update on the observationWeights, all observations have equal probability 1/n //update classifier weights with equal weights List<Double> weakClassifierWeights = knowledgeBase.getModelParameters().getWeakClassifierWeights(); //add the new weak learner in the list of weights weakClassifierWeights.add(0.0); int numberOfWeakClassifiers = weakClassifierWeights.size(); double weight = 1.0/numberOfWeakClassifiers; for(int t=0;t<numberOfWeakClassifiers;++t) { weakClassifierWeights.set(t, weight); //equal weight to all classifiers // depends on control dependency: [for], data = [t] } return Status.NEXT; //always go to next } }
public class class_name { private static Element emitterToElement(Document document, ConfigurableEmitter emitter) { Element root = document.createElement("emitter"); root.setAttribute("name", emitter.name); root.setAttribute("imageName", emitter.imageName == null ? "" : emitter.imageName); root .setAttribute("useOriented", emitter.useOriented ? "true" : "false"); root .setAttribute("useAdditive", emitter.useAdditive ? "true" : "false"); if (emitter.usePoints == Particle.INHERIT_POINTS) { root.setAttribute("renderType", "inherit"); } if (emitter.usePoints == Particle.USE_POINTS) { root.setAttribute("renderType", "points"); } if (emitter.usePoints == Particle.USE_QUADS) { root.setAttribute("renderType", "quads"); } root.appendChild(createRangeElement(document, "spawnInterval", emitter.spawnInterval)); root.appendChild(createRangeElement(document, "spawnCount", emitter.spawnCount)); root.appendChild(createRangeElement(document, "initialLife", emitter.initialLife)); root.appendChild(createRangeElement(document, "initialSize", emitter.initialSize)); root.appendChild(createRangeElement(document, "xOffset", emitter.xOffset)); root.appendChild(createRangeElement(document, "yOffset", emitter.yOffset)); root.appendChild(createRangeElement(document, "initialDistance", emitter.initialDistance)); root.appendChild(createRangeElement(document, "speed", emitter.speed)); root .appendChild(createRangeElement(document, "length", emitter.length)); root.appendChild(createRangeElement(document, "emitCount", emitter.emitCount)); root .appendChild(createValueElement(document, "spread", emitter.spread)); root.appendChild(createValueElement(document, "angularOffset", emitter.angularOffset)); root.appendChild(createValueElement(document, "growthFactor", emitter.growthFactor)); root.appendChild(createValueElement(document, "gravityFactor", emitter.gravityFactor)); root.appendChild(createValueElement(document, "windFactor", emitter.windFactor)); root.appendChild(createValueElement(document, "startAlpha", emitter.startAlpha)); root.appendChild(createValueElement(document, "endAlpha", emitter.endAlpha)); root.appendChild(createValueElement(document, "alpha", emitter.alpha)); root.appendChild(createValueElement(document, "size", emitter.size)); root.appendChild(createValueElement(document, "velocity", emitter.velocity)); root .appendChild(createValueElement(document, "scaleY", emitter.scaleY)); Element color = document.createElement("color"); ArrayList list = emitter.colors; for (int i = 0; i < list.size(); i++) { ColorRecord record = (ColorRecord) list.get(i); Element step = document.createElement("step"); step.setAttribute("offset", "" + record.pos); step.setAttribute("r", "" + record.col.r); step.setAttribute("g", "" + record.col.g); step.setAttribute("b", "" + record.col.b); color.appendChild(step); } root.appendChild(color); return root; } }
public class class_name { private static Element emitterToElement(Document document, ConfigurableEmitter emitter) { Element root = document.createElement("emitter"); root.setAttribute("name", emitter.name); root.setAttribute("imageName", emitter.imageName == null ? "" : emitter.imageName); root .setAttribute("useOriented", emitter.useOriented ? "true" : "false"); root .setAttribute("useAdditive", emitter.useAdditive ? "true" : "false"); if (emitter.usePoints == Particle.INHERIT_POINTS) { root.setAttribute("renderType", "inherit"); // depends on control dependency: [if], data = [none] } if (emitter.usePoints == Particle.USE_POINTS) { root.setAttribute("renderType", "points"); // depends on control dependency: [if], data = [none] } if (emitter.usePoints == Particle.USE_QUADS) { root.setAttribute("renderType", "quads"); // depends on control dependency: [if], data = [none] } root.appendChild(createRangeElement(document, "spawnInterval", emitter.spawnInterval)); root.appendChild(createRangeElement(document, "spawnCount", emitter.spawnCount)); root.appendChild(createRangeElement(document, "initialLife", emitter.initialLife)); root.appendChild(createRangeElement(document, "initialSize", emitter.initialSize)); root.appendChild(createRangeElement(document, "xOffset", emitter.xOffset)); root.appendChild(createRangeElement(document, "yOffset", emitter.yOffset)); root.appendChild(createRangeElement(document, "initialDistance", emitter.initialDistance)); root.appendChild(createRangeElement(document, "speed", emitter.speed)); root .appendChild(createRangeElement(document, "length", emitter.length)); root.appendChild(createRangeElement(document, "emitCount", emitter.emitCount)); root .appendChild(createValueElement(document, "spread", emitter.spread)); root.appendChild(createValueElement(document, "angularOffset", emitter.angularOffset)); root.appendChild(createValueElement(document, "growthFactor", emitter.growthFactor)); root.appendChild(createValueElement(document, "gravityFactor", emitter.gravityFactor)); root.appendChild(createValueElement(document, "windFactor", emitter.windFactor)); root.appendChild(createValueElement(document, "startAlpha", emitter.startAlpha)); root.appendChild(createValueElement(document, "endAlpha", emitter.endAlpha)); root.appendChild(createValueElement(document, "alpha", emitter.alpha)); root.appendChild(createValueElement(document, "size", emitter.size)); root.appendChild(createValueElement(document, "velocity", emitter.velocity)); root .appendChild(createValueElement(document, "scaleY", emitter.scaleY)); Element color = document.createElement("color"); ArrayList list = emitter.colors; for (int i = 0; i < list.size(); i++) { ColorRecord record = (ColorRecord) list.get(i); Element step = document.createElement("step"); step.setAttribute("offset", "" + record.pos); // depends on control dependency: [for], data = [none] step.setAttribute("r", "" + record.col.r); // depends on control dependency: [for], data = [none] step.setAttribute("g", "" + record.col.g); // depends on control dependency: [for], data = [none] step.setAttribute("b", "" + record.col.b); // depends on control dependency: [for], data = [none] color.appendChild(step); // depends on control dependency: [for], data = [none] } root.appendChild(color); return root; } }
public class class_name { public List<ConnectionFactoryResourceType<WebAppDescriptor>> getAllConnectionFactory() { List<ConnectionFactoryResourceType<WebAppDescriptor>> list = new ArrayList<ConnectionFactoryResourceType<WebAppDescriptor>>(); List<Node> nodeList = model.get("connection-factory"); for(Node node: nodeList) { ConnectionFactoryResourceType<WebAppDescriptor> type = new ConnectionFactoryResourceTypeImpl<WebAppDescriptor>(this, "connection-factory", model, node); list.add(type); } return list; } }
public class class_name { public List<ConnectionFactoryResourceType<WebAppDescriptor>> getAllConnectionFactory() { List<ConnectionFactoryResourceType<WebAppDescriptor>> list = new ArrayList<ConnectionFactoryResourceType<WebAppDescriptor>>(); List<Node> nodeList = model.get("connection-factory"); for(Node node: nodeList) { ConnectionFactoryResourceType<WebAppDescriptor> type = new ConnectionFactoryResourceTypeImpl<WebAppDescriptor>(this, "connection-factory", model, node); list.add(type); // depends on control dependency: [for], data = [none] } return list; } }
public class class_name { public static void initialize() { if (InfinispanCache.get().exists(MsgPhrase.UUIDCACHE)) { InfinispanCache.get().<UUID, MsgPhrase>getCache(MsgPhrase.UUIDCACHE).clear(); } else { InfinispanCache.get().<UUID, MsgPhrase>getCache(MsgPhrase.UUIDCACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); } if (InfinispanCache.get().exists(MsgPhrase.IDCACHE)) { InfinispanCache.get().<Long, MsgPhrase>getCache(MsgPhrase.IDCACHE).clear(); } else { InfinispanCache.get().<Long, MsgPhrase>getCache(MsgPhrase.IDCACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); } if (InfinispanCache.get().exists(MsgPhrase.NAMECACHE)) { InfinispanCache.get().<String, MsgPhrase>getCache(MsgPhrase.NAMECACHE).clear(); } else { InfinispanCache.get().<String, MsgPhrase>getCache(MsgPhrase.NAMECACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); } if (InfinispanCache.get().exists(MsgPhrase.LABELCACHE)) { InfinispanCache.get().getCache(MsgPhrase.LABELCACHE).clear(); } else { InfinispanCache.get().<String, String>getCache(MsgPhrase.LABELCACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); } if (InfinispanCache.get().exists(MsgPhrase.ARGUMENTCACHE)) { InfinispanCache.get().getCache(MsgPhrase.ARGUMENTCACHE).clear(); } else { InfinispanCache.get().<String, List<String>>getCache(MsgPhrase.ARGUMENTCACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); } } }
public class class_name { public static void initialize() { if (InfinispanCache.get().exists(MsgPhrase.UUIDCACHE)) { InfinispanCache.get().<UUID, MsgPhrase>getCache(MsgPhrase.UUIDCACHE).clear(); // depends on control dependency: [if], data = [none] } else { InfinispanCache.get().<UUID, MsgPhrase>getCache(MsgPhrase.UUIDCACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); // depends on control dependency: [if], data = [none] } if (InfinispanCache.get().exists(MsgPhrase.IDCACHE)) { InfinispanCache.get().<Long, MsgPhrase>getCache(MsgPhrase.IDCACHE).clear(); // depends on control dependency: [if], data = [none] } else { InfinispanCache.get().<Long, MsgPhrase>getCache(MsgPhrase.IDCACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); // depends on control dependency: [if], data = [none] } if (InfinispanCache.get().exists(MsgPhrase.NAMECACHE)) { InfinispanCache.get().<String, MsgPhrase>getCache(MsgPhrase.NAMECACHE).clear(); // depends on control dependency: [if], data = [none] } else { InfinispanCache.get().<String, MsgPhrase>getCache(MsgPhrase.NAMECACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); // depends on control dependency: [if], data = [none] } if (InfinispanCache.get().exists(MsgPhrase.LABELCACHE)) { InfinispanCache.get().getCache(MsgPhrase.LABELCACHE).clear(); // depends on control dependency: [if], data = [none] } else { InfinispanCache.get().<String, String>getCache(MsgPhrase.LABELCACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); // depends on control dependency: [if], data = [none] } if (InfinispanCache.get().exists(MsgPhrase.ARGUMENTCACHE)) { InfinispanCache.get().getCache(MsgPhrase.ARGUMENTCACHE).clear(); // depends on control dependency: [if], data = [none] } else { InfinispanCache.get().<String, List<String>>getCache(MsgPhrase.ARGUMENTCACHE) .addListener(new CacheLogListener(MsgPhrase.LOG)); // depends on control dependency: [if], data = [none] } } }
public class class_name { static OcAgentTraceServiceConfigRpcHandler create( TraceServiceStub stub, TraceConfig traceConfig) { OcAgentTraceServiceConfigRpcHandler configRpcHandler = new OcAgentTraceServiceConfigRpcHandler(traceConfig); UpdatedLibraryConfigObserver updatedLibraryConfigObserver = new UpdatedLibraryConfigObserver(traceConfig, configRpcHandler); try { StreamObserver<CurrentLibraryConfig> currentConfigObserver = stub.config(updatedLibraryConfigObserver); configRpcHandler.setCurrentConfigObserver(currentConfigObserver); } catch (StatusRuntimeException e) { configRpcHandler.onComplete(e); } return configRpcHandler; } }
public class class_name { static OcAgentTraceServiceConfigRpcHandler create( TraceServiceStub stub, TraceConfig traceConfig) { OcAgentTraceServiceConfigRpcHandler configRpcHandler = new OcAgentTraceServiceConfigRpcHandler(traceConfig); UpdatedLibraryConfigObserver updatedLibraryConfigObserver = new UpdatedLibraryConfigObserver(traceConfig, configRpcHandler); try { StreamObserver<CurrentLibraryConfig> currentConfigObserver = stub.config(updatedLibraryConfigObserver); configRpcHandler.setCurrentConfigObserver(currentConfigObserver); // depends on control dependency: [try], data = [none] } catch (StatusRuntimeException e) { configRpcHandler.onComplete(e); } // depends on control dependency: [catch], data = [none] return configRpcHandler; } }
public class class_name { public static String singularize(String target) { // TODO we should add this as an issue in the RamlBase project and // provide a pull request String result = Inflector.singularize(target); if ((target.endsWith("ss")) && (result.equals(target.substring(0, target.length() - 1)))) { result = target; } return result; } }
public class class_name { public static String singularize(String target) { // TODO we should add this as an issue in the RamlBase project and // provide a pull request String result = Inflector.singularize(target); if ((target.endsWith("ss")) && (result.equals(target.substring(0, target.length() - 1)))) { result = target; // depends on control dependency: [if], data = [none] } return result; } }
public class class_name { public InputVariable getInputVariable(String name) { for (InputVariable inputVariable : this.inputVariables) { if (name.equals(inputVariable.getName())) { return inputVariable; } } throw new RuntimeException(String.format( "[engine error] no input variable by name <%s>", name)); } }
public class class_name { public InputVariable getInputVariable(String name) { for (InputVariable inputVariable : this.inputVariables) { if (name.equals(inputVariable.getName())) { return inputVariable; // depends on control dependency: [if], data = [none] } } throw new RuntimeException(String.format( "[engine error] no input variable by name <%s>", name)); } }
public class class_name { private void update(long delay) { if (willUpdate) { return; // Already a pending update scheduled } if (!observing) { return; } willUpdate = true; query.getDatabase().scheduleOnQueryExecutor(new Runnable() { @Override public void run() { update(); } }, delay); } }
public class class_name { private void update(long delay) { if (willUpdate) { return; // Already a pending update scheduled // depends on control dependency: [if], data = [none] } if (!observing) { return; } // depends on control dependency: [if], data = [none] willUpdate = true; query.getDatabase().scheduleOnQueryExecutor(new Runnable() { @Override public void run() { update(); } }, delay); } }
public class class_name { public void curveTo(float x, float y, float cx1, float cy1, float cx2, float cy2, int segments) { // special case for zero movement if ((cx == x) && (cy == y)) { return; } Curve curve = new Curve(new Vector2f(cx,cy),new Vector2f(cx1,cy1),new Vector2f(cx2,cy2),new Vector2f(x,y)); float step = 1.0f / segments; for (int i=1;i<segments+1;i++) { float t = i * step; Vector2f p = curve.pointAt(t); if (hole != null) { hole.add(new float[] {p.x,p.y}); } else { localPoints.add(new float[] {p.x,p.y}); } cx = p.x; cy = p.y; } pointsDirty = true; } }
public class class_name { public void curveTo(float x, float y, float cx1, float cy1, float cx2, float cy2, int segments) { // special case for zero movement if ((cx == x) && (cy == y)) { return; // depends on control dependency: [if], data = [none] } Curve curve = new Curve(new Vector2f(cx,cy),new Vector2f(cx1,cy1),new Vector2f(cx2,cy2),new Vector2f(x,y)); float step = 1.0f / segments; for (int i=1;i<segments+1;i++) { float t = i * step; Vector2f p = curve.pointAt(t); if (hole != null) { hole.add(new float[] {p.x,p.y}); // depends on control dependency: [if], data = [none] } else { localPoints.add(new float[] {p.x,p.y}); // depends on control dependency: [if], data = [none] } cx = p.x; // depends on control dependency: [for], data = [none] cy = p.y; // depends on control dependency: [for], data = [none] } pointsDirty = true; } }
public class class_name { public static Map<String, String> createContentProperties(String absolutePath, String creator) { Map<String, String> props = new HashMap<String, String>(); if (creator != null && creator.trim().length() > 0) { props.put(StorageProvider.PROPERTIES_CONTENT_CREATOR, creator); } props.put(StorageProvider.PROPERTIES_CONTENT_FILE_PATH, absolutePath); try { Path path = FileSystems.getDefault().getPath(absolutePath); BasicFileAttributes bfa = Files.readAttributes(path, BasicFileAttributes.class); String creationDate = DateUtil.convertToStringLong(bfa.creationTime().toMillis()); props.put(StorageProvider.PROPERTIES_CONTENT_FILE_CREATED, creationDate); String lastAccessed = DateUtil.convertToStringLong(bfa.lastAccessTime().toMillis()); props.put(StorageProvider.PROPERTIES_CONTENT_FILE_LAST_ACCESSED, lastAccessed); String modified = DateUtil.convertToStringLong(bfa.lastModifiedTime().toMillis()); props.put(StorageProvider.PROPERTIES_CONTENT_FILE_MODIFIED, modified); } catch (IOException ex) { log.error("Failed to read basic file attributes from " + absolutePath + ": " + ex.getMessage(), ex); } return props; } }
public class class_name { public static Map<String, String> createContentProperties(String absolutePath, String creator) { Map<String, String> props = new HashMap<String, String>(); if (creator != null && creator.trim().length() > 0) { props.put(StorageProvider.PROPERTIES_CONTENT_CREATOR, creator); // depends on control dependency: [if], data = [none] } props.put(StorageProvider.PROPERTIES_CONTENT_FILE_PATH, absolutePath); try { Path path = FileSystems.getDefault().getPath(absolutePath); BasicFileAttributes bfa = Files.readAttributes(path, BasicFileAttributes.class); String creationDate = DateUtil.convertToStringLong(bfa.creationTime().toMillis()); props.put(StorageProvider.PROPERTIES_CONTENT_FILE_CREATED, creationDate); // depends on control dependency: [try], data = [none] String lastAccessed = DateUtil.convertToStringLong(bfa.lastAccessTime().toMillis()); props.put(StorageProvider.PROPERTIES_CONTENT_FILE_LAST_ACCESSED, lastAccessed); // depends on control dependency: [try], data = [none] String modified = DateUtil.convertToStringLong(bfa.lastModifiedTime().toMillis()); props.put(StorageProvider.PROPERTIES_CONTENT_FILE_MODIFIED, modified); // depends on control dependency: [try], data = [none] } catch (IOException ex) { log.error("Failed to read basic file attributes from " + absolutePath + ": " + ex.getMessage(), ex); } // depends on control dependency: [catch], data = [none] return props; } }
public class class_name { public static void compressDirectory(File rootPath, File dstZipPath) throws IOException { ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(dstZipPath)); try { if (rootPath.isDirectory()) { String[] files = rootPath.list(); if (files == null || files.length == 0) { // In java 7 no ZipException is thrown in case of an empty directory // so to remain compatible we need to throw it explicitly throw new ZipException("ZIP file must have at least one entry"); } for (int i = 0; i < files.length; i++) { compressDirectory("", new File(rootPath, files[i]), zip); } } else { compressDirectory("", rootPath, zip); } } finally { if (zip != null) { zip.flush(); zip.close(); } } } }
public class class_name { public static void compressDirectory(File rootPath, File dstZipPath) throws IOException { ZipOutputStream zip = new ZipOutputStream(new FileOutputStream(dstZipPath)); try { if (rootPath.isDirectory()) { String[] files = rootPath.list(); if (files == null || files.length == 0) { // In java 7 no ZipException is thrown in case of an empty directory // so to remain compatible we need to throw it explicitly throw new ZipException("ZIP file must have at least one entry"); } for (int i = 0; i < files.length; i++) { compressDirectory("", new File(rootPath, files[i]), zip); // depends on control dependency: [for], data = [i] } } else { compressDirectory("", rootPath, zip); // depends on control dependency: [if], data = [none] } } finally { if (zip != null) { zip.flush(); // depends on control dependency: [if], data = [none] zip.close(); // depends on control dependency: [if], data = [none] } } } }
public class class_name { private void compileDefaults(Map<String, TreeMap<String, Object>> compiledDefaults, UIDefaults d) { for (Map.Entry<Object, Object> entry : d.entrySet()) { if (entry.getKey() instanceof String) { String key = (String) entry.getKey(); String kp = parsePrefix(key); if (kp == null) continue; TreeMap<String, Object> map = compiledDefaults.get(kp); if (map == null) { map = new TreeMap<String, Object>(); compiledDefaults.put(kp, map); } map.put(key, entry.getValue()); } } } }
public class class_name { private void compileDefaults(Map<String, TreeMap<String, Object>> compiledDefaults, UIDefaults d) { for (Map.Entry<Object, Object> entry : d.entrySet()) { if (entry.getKey() instanceof String) { String key = (String) entry.getKey(); String kp = parsePrefix(key); if (kp == null) continue; TreeMap<String, Object> map = compiledDefaults.get(kp); if (map == null) { map = new TreeMap<String, Object>(); // depends on control dependency: [if], data = [none] compiledDefaults.put(kp, map); // depends on control dependency: [if], data = [none] } map.put(key, entry.getValue()); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @SuppressWarnings("unchecked") private static ManagedPartitionGroup buildSystemPartitionGroup(AtomixConfig config) { PartitionGroupConfig<?> partitionGroupConfig = config.getManagementGroup(); if (partitionGroupConfig == null) { return null; } return partitionGroupConfig.getType().newPartitionGroup(partitionGroupConfig); } }
public class class_name { @SuppressWarnings("unchecked") private static ManagedPartitionGroup buildSystemPartitionGroup(AtomixConfig config) { PartitionGroupConfig<?> partitionGroupConfig = config.getManagementGroup(); if (partitionGroupConfig == null) { return null; // depends on control dependency: [if], data = [none] } return partitionGroupConfig.getType().newPartitionGroup(partitionGroupConfig); } }
public class class_name { private Siren4JSubEntity getSubEntityAnnotation(Field currentField, List<ReflectedInfo> fieldInfo) { Siren4JSubEntity result = null; result = currentField.getAnnotation(Siren4JSubEntity.class); if (result == null && fieldInfo != null) { ReflectedInfo info = ReflectionUtils.getFieldInfoByName(fieldInfo, currentField.getName()); if (info != null && info.getGetter() != null) { result = info.getGetter().getAnnotation(Siren4JSubEntity.class); } } return result; } }
public class class_name { private Siren4JSubEntity getSubEntityAnnotation(Field currentField, List<ReflectedInfo> fieldInfo) { Siren4JSubEntity result = null; result = currentField.getAnnotation(Siren4JSubEntity.class); if (result == null && fieldInfo != null) { ReflectedInfo info = ReflectionUtils.getFieldInfoByName(fieldInfo, currentField.getName()); if (info != null && info.getGetter() != null) { result = info.getGetter().getAnnotation(Siren4JSubEntity.class); // depends on control dependency: [if], data = [none] } } return result; } }
public class class_name { public Broadcastable openChannel(String ccid, String atmosphereTrackingId) { throwExceptionIfTrackingIdnotSet(atmosphereTrackingId); log.debug("GET Channels open long poll channelId: {} trackingId: {}", ccid, atmosphereTrackingId); // NOTE: as of Atmosphere 0.8.5: even though the parameter is set // not to create the broadcaster if not // found, if the // broadcaster is found, but set to "destroyed" then it is recreated // TODO when is a broadcaster "destroyed" ??? Broadcaster broadcaster = BroadcasterFactory.getDefault().lookup(BounceProxyBroadcaster.class, ccid, false); if (broadcaster == null) { log.error("no broadcaster registered for channel {}", ccid); // broadcaster not found for given ccid throw new JoynrHttpException(Status.BAD_REQUEST, JOYNRMESSAGINGERROR_CHANNELNOTFOUND); } // this causes the long poll, or immediate response if elements are // in the cache return new Broadcastable(broadcaster); } }
public class class_name { public Broadcastable openChannel(String ccid, String atmosphereTrackingId) { throwExceptionIfTrackingIdnotSet(atmosphereTrackingId); log.debug("GET Channels open long poll channelId: {} trackingId: {}", ccid, atmosphereTrackingId); // NOTE: as of Atmosphere 0.8.5: even though the parameter is set // not to create the broadcaster if not // found, if the // broadcaster is found, but set to "destroyed" then it is recreated // TODO when is a broadcaster "destroyed" ??? Broadcaster broadcaster = BroadcasterFactory.getDefault().lookup(BounceProxyBroadcaster.class, ccid, false); if (broadcaster == null) { log.error("no broadcaster registered for channel {}", ccid); // depends on control dependency: [if], data = [none] // broadcaster not found for given ccid throw new JoynrHttpException(Status.BAD_REQUEST, JOYNRMESSAGINGERROR_CHANNELNOTFOUND); } // this causes the long poll, or immediate response if elements are // in the cache return new Broadcastable(broadcaster); } }
public class class_name { public GetMappingResult withMapping(MappingEntry... mapping) { if (this.mapping == null) { setMapping(new java.util.ArrayList<MappingEntry>(mapping.length)); } for (MappingEntry ele : mapping) { this.mapping.add(ele); } return this; } }
public class class_name { public GetMappingResult withMapping(MappingEntry... mapping) { if (this.mapping == null) { setMapping(new java.util.ArrayList<MappingEntry>(mapping.length)); // depends on control dependency: [if], data = [none] } for (MappingEntry ele : mapping) { this.mapping.add(ele); // depends on control dependency: [for], data = [ele] } return this; } }
public class class_name { public static List<String> match(List<String> patterns, String name) { List<String> matches = new ArrayList<String>(); for (String pattern : patterns) { if (match(pattern, name)) { matches.add(pattern); } } return matches; } }
public class class_name { public static List<String> match(List<String> patterns, String name) { List<String> matches = new ArrayList<String>(); for (String pattern : patterns) { if (match(pattern, name)) { matches.add(pattern); // depends on control dependency: [if], data = [none] } } return matches; } }
public class class_name { public void restore() throws BackupException { try { SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>() { public Void run() throws IOException { for (int i = 0; i < zipFiles.size(); i++) { File zipFile = zipFiles.get(i); File dataDir = dataDirs.get(i); if (zipFile.isDirectory()) { DirectoryHelper.uncompressEveryFileFromDirectory(zipFile, dataDir); } else { DirectoryHelper.uncompressDirectory(zipFile, dataDir); } } return null; } }); } catch (IOException e) { throw new BackupException(e); } } }
public class class_name { public void restore() throws BackupException { try { SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>() { public Void run() throws IOException { for (int i = 0; i < zipFiles.size(); i++) { File zipFile = zipFiles.get(i); File dataDir = dataDirs.get(i); if (zipFile.isDirectory()) { DirectoryHelper.uncompressEveryFileFromDirectory(zipFile, dataDir); // depends on control dependency: [if], data = [none] } else { DirectoryHelper.uncompressDirectory(zipFile, dataDir); // depends on control dependency: [if], data = [none] } } return null; } }); } catch (IOException e) { throw new BackupException(e); } } }
public class class_name { public boolean computeInverseH(List<Homography2D_F64> homography0toI) { listHInv.reset(); int N = homography0toI.size(); for (int i = 0; i < N; i++) { Homography2D_F64 H = homography0toI.get(i); Homography2D_F64 Hinv = listHInv.grow(); // Ensure the determinant is one double d = CommonOps_DDF3.det(H); if( d < 0 ) CommonOps_DDF3.divide(H,-Math.pow(-d,1.0/3),Hinv); else CommonOps_DDF3.divide(H,Math.pow(d,1.0/3),Hinv); // Now invert the matrix if( !CommonOps_DDF3.invert(Hinv,Hinv) ) { return false; } } return true; } }
public class class_name { public boolean computeInverseH(List<Homography2D_F64> homography0toI) { listHInv.reset(); int N = homography0toI.size(); for (int i = 0; i < N; i++) { Homography2D_F64 H = homography0toI.get(i); Homography2D_F64 Hinv = listHInv.grow(); // Ensure the determinant is one double d = CommonOps_DDF3.det(H); if( d < 0 ) CommonOps_DDF3.divide(H,-Math.pow(-d,1.0/3),Hinv); else CommonOps_DDF3.divide(H,Math.pow(d,1.0/3),Hinv); // Now invert the matrix if( !CommonOps_DDF3.invert(Hinv,Hinv) ) { return false; // depends on control dependency: [if], data = [none] } } return true; } }
public class class_name { public Observable<ServiceResponseWithHeaders<Void, JobUpdateHeaders>> updateWithServiceResponseAsync(String jobId, JobUpdateParameter jobUpdateParameter) { if (this.client.batchUrl() == null) { throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null."); } if (jobId == null) { throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); } if (jobUpdateParameter == null) { throw new IllegalArgumentException("Parameter jobUpdateParameter 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(jobUpdateParameter); final JobUpdateOptions jobUpdateOptions = 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.update(jobId, jobUpdateParameter, 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, JobUpdateHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<Void, JobUpdateHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<Void, JobUpdateHeaders> clientResponse = updateDelegate(response); return Observable.just(clientResponse); } catch (Throwable t) { return Observable.error(t); } } }); } }
public class class_name { public Observable<ServiceResponseWithHeaders<Void, JobUpdateHeaders>> updateWithServiceResponseAsync(String jobId, JobUpdateParameter jobUpdateParameter) { if (this.client.batchUrl() == null) { throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null."); } if (jobId == null) { throw new IllegalArgumentException("Parameter jobId is required and cannot be null."); } if (jobUpdateParameter == null) { throw new IllegalArgumentException("Parameter jobUpdateParameter 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(jobUpdateParameter); final JobUpdateOptions jobUpdateOptions = 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.update(jobId, jobUpdateParameter, 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, JobUpdateHeaders>>>() { @Override public Observable<ServiceResponseWithHeaders<Void, JobUpdateHeaders>> call(Response<ResponseBody> response) { try { ServiceResponseWithHeaders<Void, JobUpdateHeaders> clientResponse = updateDelegate(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(InitiateAuthRequest initiateAuthRequest, ProtocolMarshaller protocolMarshaller) { if (initiateAuthRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(initiateAuthRequest.getAuthFlow(), AUTHFLOW_BINDING); protocolMarshaller.marshall(initiateAuthRequest.getAuthParameters(), AUTHPARAMETERS_BINDING); protocolMarshaller.marshall(initiateAuthRequest.getClientMetadata(), CLIENTMETADATA_BINDING); protocolMarshaller.marshall(initiateAuthRequest.getClientId(), CLIENTID_BINDING); protocolMarshaller.marshall(initiateAuthRequest.getAnalyticsMetadata(), ANALYTICSMETADATA_BINDING); protocolMarshaller.marshall(initiateAuthRequest.getUserContextData(), USERCONTEXTDATA_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
public class class_name { public void marshall(InitiateAuthRequest initiateAuthRequest, ProtocolMarshaller protocolMarshaller) { if (initiateAuthRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(initiateAuthRequest.getAuthFlow(), AUTHFLOW_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(initiateAuthRequest.getAuthParameters(), AUTHPARAMETERS_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(initiateAuthRequest.getClientMetadata(), CLIENTMETADATA_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(initiateAuthRequest.getClientId(), CLIENTID_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(initiateAuthRequest.getAnalyticsMetadata(), ANALYTICSMETADATA_BINDING); // depends on control dependency: [try], data = [none] protocolMarshaller.marshall(initiateAuthRequest.getUserContextData(), USERCONTEXTDATA_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 { protected CmsProject getOfflineIndexProject() { CmsProject result = null; for (I_CmsSearchIndex index : m_offlineIndexes) { try { result = m_adminCms.readProject(index.getProject()); if (!result.isOnlineProject()) { break; } } catch (Exception e) { // may be a missconfigured index, ignore LOG.error(e.getLocalizedMessage(), e); } } return result; } }
public class class_name { protected CmsProject getOfflineIndexProject() { CmsProject result = null; for (I_CmsSearchIndex index : m_offlineIndexes) { try { result = m_adminCms.readProject(index.getProject()); // depends on control dependency: [try], data = [none] if (!result.isOnlineProject()) { break; } } catch (Exception e) { // may be a missconfigured index, ignore LOG.error(e.getLocalizedMessage(), e); } // depends on control dependency: [catch], data = [none] } return result; } }
public class class_name { public static double[] rowMin(double[][] data) { double[] x = new double[data.length]; for (int i = 0; i < x.length; i++) { x[i] = min(data[i]); } return x; } }
public class class_name { public static double[] rowMin(double[][] data) { double[] x = new double[data.length]; for (int i = 0; i < x.length; i++) { x[i] = min(data[i]); // depends on control dependency: [for], data = [i] } return x; } }
public class class_name { private <T extends ServiceType> Binding getBinding(String nameAttribute, T parent) { Bindings bindings = parent.getBindings(); if (bindings != null) { for (Binding binding : bindings.getBinding()) { if (binding.getName().equals(nameAttribute)) { return binding; } } } else { bindings = new Bindings(); parent.setBindings(bindings); } // create new Binding Binding binding = new Binding(); binding.setName(nameAttribute); Product p = new Product(); p.setType("bwengine"); p.setLocation(""); p.setVersion(""); binding.setProduct(p); binding.setDescription(""); binding.setContact(""); Shutdown s = new Shutdown(); s.setCheckpoint(false); s.setTimeout(new BigInteger("0")); binding.setShutdown(s); bindings.getBinding().add(binding); return binding; } }
public class class_name { private <T extends ServiceType> Binding getBinding(String nameAttribute, T parent) { Bindings bindings = parent.getBindings(); if (bindings != null) { for (Binding binding : bindings.getBinding()) { if (binding.getName().equals(nameAttribute)) { return binding; // depends on control dependency: [if], data = [none] } } } else { bindings = new Bindings(); // depends on control dependency: [if], data = [none] parent.setBindings(bindings); // depends on control dependency: [if], data = [(bindings] } // create new Binding Binding binding = new Binding(); binding.setName(nameAttribute); Product p = new Product(); p.setType("bwengine"); p.setLocation(""); p.setVersion(""); binding.setProduct(p); binding.setDescription(""); binding.setContact(""); Shutdown s = new Shutdown(); s.setCheckpoint(false); s.setTimeout(new BigInteger("0")); binding.setShutdown(s); bindings.getBinding().add(binding); return binding; } }
public class class_name { public static <T, X extends RuntimeException> T ifNonNullThrowOrElse(Supplier<X> exceptionSupplier, Supplier<T> provider) { if (Objects.nonNull(exceptionSupplier)) { throw exceptionSupplier.get(); } else { return provider.get(); } } }
public class class_name { public static <T, X extends RuntimeException> T ifNonNullThrowOrElse(Supplier<X> exceptionSupplier, Supplier<T> provider) { if (Objects.nonNull(exceptionSupplier)) { throw exceptionSupplier.get(); } else { return provider.get(); // depends on control dependency: [if], data = [none] } } }
public class class_name { public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) { if (!bInitCalled) { BaseField fldTarget = this.getSyncedListenersField(m_fldTarget, listener); ((InitOnChangeHandler)listener).init(null, fldTarget); } return super.syncClonedListener(field, listener, true); } }
public class class_name { public boolean syncClonedListener(BaseField field, FieldListener listener, boolean bInitCalled) { if (!bInitCalled) { BaseField fldTarget = this.getSyncedListenersField(m_fldTarget, listener); ((InitOnChangeHandler)listener).init(null, fldTarget); // depends on control dependency: [if], data = [none] } return super.syncClonedListener(field, listener, true); } }
public class class_name { public static String generateMixString(int length) { StringBuffer sb = new StringBuffer(); Random random = new Random(); for (int i = 0; i < length; i++) { sb.append(allChar.charAt(random.nextInt(letterChar.length()))); } return sb.toString(); } }
public class class_name { public static String generateMixString(int length) { StringBuffer sb = new StringBuffer(); Random random = new Random(); for (int i = 0; i < length; i++) { sb.append(allChar.charAt(random.nextInt(letterChar.length()))); // depends on control dependency: [for], data = [none] } return sb.toString(); } }
public class class_name { public LocalDate plusYears(long yearsToAdd) { if (yearsToAdd == 0) { return this; } int newYear = YEAR.checkValidIntValue(year + yearsToAdd); // safe overflow return resolvePreviousValid(newYear, month, day); } }
public class class_name { public LocalDate plusYears(long yearsToAdd) { if (yearsToAdd == 0) { return this; // depends on control dependency: [if], data = [none] } int newYear = YEAR.checkValidIntValue(year + yearsToAdd); // safe overflow return resolvePreviousValid(newYear, month, day); } }
public class class_name { @Override protected void rebuild(final int newCapacity) { final int numValues = getNumValues(); checkIfEnoughMemory(mem_, newCapacity, numValues); final int currCapacity = getCurrentCapacity(); final long[] keys = new long[currCapacity]; final double[] values = new double[currCapacity * numValues]; mem_.getLongArray(keysOffset_, keys, 0, currCapacity); mem_.getDoubleArray(valuesOffset_, values, 0, currCapacity * numValues); mem_.clear(keysOffset_, ((long) SIZE_OF_KEY_BYTES * newCapacity) + ((long) SIZE_OF_VALUE_BYTES * newCapacity * numValues)); mem_.putInt(RETAINED_ENTRIES_INT, 0); mem_.putByte(LG_CUR_CAPACITY_BYTE, (byte)Integer.numberOfTrailingZeros(newCapacity)); valuesOffset_ = keysOffset_ + (SIZE_OF_KEY_BYTES * newCapacity); lgCurrentCapacity_ = Integer.numberOfTrailingZeros(newCapacity); for (int i = 0; i < keys.length; i++) { if ((keys[i] != 0) && (keys[i] < theta_)) { insert(keys[i], Arrays.copyOfRange(values, i * numValues, (i + 1) * numValues)); } } setRebuildThreshold(); } }
public class class_name { @Override protected void rebuild(final int newCapacity) { final int numValues = getNumValues(); checkIfEnoughMemory(mem_, newCapacity, numValues); final int currCapacity = getCurrentCapacity(); final long[] keys = new long[currCapacity]; final double[] values = new double[currCapacity * numValues]; mem_.getLongArray(keysOffset_, keys, 0, currCapacity); mem_.getDoubleArray(valuesOffset_, values, 0, currCapacity * numValues); mem_.clear(keysOffset_, ((long) SIZE_OF_KEY_BYTES * newCapacity) + ((long) SIZE_OF_VALUE_BYTES * newCapacity * numValues)); mem_.putInt(RETAINED_ENTRIES_INT, 0); mem_.putByte(LG_CUR_CAPACITY_BYTE, (byte)Integer.numberOfTrailingZeros(newCapacity)); valuesOffset_ = keysOffset_ + (SIZE_OF_KEY_BYTES * newCapacity); lgCurrentCapacity_ = Integer.numberOfTrailingZeros(newCapacity); for (int i = 0; i < keys.length; i++) { if ((keys[i] != 0) && (keys[i] < theta_)) { insert(keys[i], Arrays.copyOfRange(values, i * numValues, (i + 1) * numValues)); // depends on control dependency: [if], data = [none] } } setRebuildThreshold(); } }
public class class_name { private OnChangeSubscriptionQos setMinIntervalMsInternal(final long minIntervalMs) { if (minIntervalMs < MIN_MIN_INTERVAL_MS) { this.minIntervalMs = MIN_MIN_INTERVAL_MS; logger.warn("minIntervalMs < MIN_MIN_INTERVAL_MS. Using MIN_MIN_INTERVAL_MS: {}", MIN_MIN_INTERVAL_MS); } else if (minIntervalMs > MAX_MIN_INTERVAL_MS) { this.minIntervalMs = MAX_MIN_INTERVAL_MS; logger.warn("minIntervalMs > MAX_MIN_INTERVAL_MS. Using MAX_MIN_INTERVAL_MS: {}", MAX_MIN_INTERVAL_MS); } else { this.minIntervalMs = minIntervalMs; } return this; } }
public class class_name { private OnChangeSubscriptionQos setMinIntervalMsInternal(final long minIntervalMs) { if (minIntervalMs < MIN_MIN_INTERVAL_MS) { this.minIntervalMs = MIN_MIN_INTERVAL_MS; // depends on control dependency: [if], data = [none] logger.warn("minIntervalMs < MIN_MIN_INTERVAL_MS. Using MIN_MIN_INTERVAL_MS: {}", MIN_MIN_INTERVAL_MS); // depends on control dependency: [if], data = [MIN_MIN_INTERVAL_MS)] } else if (minIntervalMs > MAX_MIN_INTERVAL_MS) { this.minIntervalMs = MAX_MIN_INTERVAL_MS; // depends on control dependency: [if], data = [none] logger.warn("minIntervalMs > MAX_MIN_INTERVAL_MS. Using MAX_MIN_INTERVAL_MS: {}", MAX_MIN_INTERVAL_MS); // depends on control dependency: [if], data = [MAX_MIN_INTERVAL_MS)] } else { this.minIntervalMs = minIntervalMs; // depends on control dependency: [if], data = [none] } return this; } }
public class class_name { @Override public String getDescription(final Object table, final Object entry) { if (table instanceof TableWithNullOption && entry == null) { return ((TableWithNullOption) table).getNullDescription(); } else if (entry instanceof TableEntry) { return ((TableEntry) entry).getDesc(); } return null; } }
public class class_name { @Override public String getDescription(final Object table, final Object entry) { if (table instanceof TableWithNullOption && entry == null) { return ((TableWithNullOption) table).getNullDescription(); // depends on control dependency: [if], data = [none] } else if (entry instanceof TableEntry) { return ((TableEntry) entry).getDesc(); // depends on control dependency: [if], data = [none] } return null; } }
public class class_name { protected void printPi (final String piString) { System.out.print ("\npi = " + piString.substring (0, 2)); int index = 2; int line = 0; int group = 0; final int length = piString.length (); // Loop for each group of 5 digits while (index + 5 < length) { System.out.print (piString.substring (index, index + 5) + " "); index += 5; // End of line after 10 groups. if (++group == 10) { System.out.println (); // Print a blank line after 10 lines. if (++line == 10) { System.out.println (); line = 0; } System.out.print (" "); group = 0; } } // Print the last partial line. if (index < length) { System.out.println (piString.substring (index)); } } }
public class class_name { protected void printPi (final String piString) { System.out.print ("\npi = " + piString.substring (0, 2)); int index = 2; int line = 0; int group = 0; final int length = piString.length (); // Loop for each group of 5 digits while (index + 5 < length) { System.out.print (piString.substring (index, index + 5) + " "); // depends on control dependency: [while], data = [none] index += 5; // depends on control dependency: [while], data = [none] // End of line after 10 groups. if (++group == 10) { System.out.println (); // depends on control dependency: [if], data = [none] // Print a blank line after 10 lines. if (++line == 10) { System.out.println (); // depends on control dependency: [if], data = [none] line = 0; // depends on control dependency: [if], data = [none] } System.out.print (" "); // depends on control dependency: [if], data = [none] group = 0; // depends on control dependency: [if], data = [none] } } // Print the last partial line. if (index < length) { System.out.println (piString.substring (index)); // depends on control dependency: [if], data = [(index] } } }
public class class_name { public static double cdf(double val, double loc, double scale, double shape1, double shape2) { val = (val - loc) / scale; if(val == Double.NEGATIVE_INFINITY) { return 0.; } if(val == Double.POSITIVE_INFINITY) { return 1.; } if(val != val) { return Double.NaN; } if(shape1 == 0.) { val = FastMath.exp(-val); } else { double tmp = shape1 * val; if(tmp == Double.NEGATIVE_INFINITY) { return shape2 == 0 ? 1 : 0.; } if(tmp >= 1.) { return shape2 == 0 ? 0 : 1.; } val = FastMath.exp(FastMath.log1p(-tmp) / shape1); } if(shape2 == 0.) { return FastMath.exp(-val); } final double tmp = shape2 * val; return tmp < 1. ? FastMath.exp(FastMath.log1p(-tmp) / shape2) : 0.; } }
public class class_name { public static double cdf(double val, double loc, double scale, double shape1, double shape2) { val = (val - loc) / scale; if(val == Double.NEGATIVE_INFINITY) { return 0.; // depends on control dependency: [if], data = [none] } if(val == Double.POSITIVE_INFINITY) { return 1.; // depends on control dependency: [if], data = [none] } if(val != val) { return Double.NaN; // depends on control dependency: [if], data = [none] } if(shape1 == 0.) { val = FastMath.exp(-val); // depends on control dependency: [if], data = [none] } else { double tmp = shape1 * val; if(tmp == Double.NEGATIVE_INFINITY) { return shape2 == 0 ? 1 : 0.; // depends on control dependency: [if], data = [none] } if(tmp >= 1.) { return shape2 == 0 ? 0 : 1.; // depends on control dependency: [if], data = [none] } val = FastMath.exp(FastMath.log1p(-tmp) / shape1); // depends on control dependency: [if], data = [none] } if(shape2 == 0.) { return FastMath.exp(-val); // depends on control dependency: [if], data = [none] } final double tmp = shape2 * val; return tmp < 1. ? FastMath.exp(FastMath.log1p(-tmp) / shape2) : 0.; } }
public class class_name { public byte nextByte(int radix) { // Check cached result if ((typeCache != null) && (typeCache instanceof Byte) && this.radix == radix) { byte val = ((Byte)typeCache).byteValue(); useTypeCache(); return val; } setRadix(radix); clearCaches(); // Search for next byte try { String s = next(integerPattern()); if (matcher.group(SIMPLE_GROUP_INDEX) == null) s = processIntegerToken(s); return Byte.parseByte(s, radix); } catch (NumberFormatException nfe) { position = matcher.start(); // don't skip bad token throw new InputMismatchException(nfe.getMessage()); } } }
public class class_name { public byte nextByte(int radix) { // Check cached result if ((typeCache != null) && (typeCache instanceof Byte) && this.radix == radix) { byte val = ((Byte)typeCache).byteValue(); useTypeCache(); // depends on control dependency: [if], data = [none] return val; // depends on control dependency: [if], data = [none] } setRadix(radix); clearCaches(); // Search for next byte try { String s = next(integerPattern()); if (matcher.group(SIMPLE_GROUP_INDEX) == null) s = processIntegerToken(s); return Byte.parseByte(s, radix); // depends on control dependency: [try], data = [none] } catch (NumberFormatException nfe) { position = matcher.start(); // don't skip bad token throw new InputMismatchException(nfe.getMessage()); } // depends on control dependency: [catch], data = [none] } }
public class class_name { @Override protected TransactionManager locateTransactionManager() { try { return TransactionManagerLocator.INSTANCE.getTransactionManager(); } catch (Exception e) { throw new HibernateException(e); } } }
public class class_name { @Override protected TransactionManager locateTransactionManager() { try { return TransactionManagerLocator.INSTANCE.getTransactionManager(); // depends on control dependency: [try], data = [none] } catch (Exception e) { throw new HibernateException(e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private Definition getWsdlDefinition(Resource wsdl) { try { Definition definition; if (wsdl.getURI().toString().startsWith("jar:")) { // Locate WSDL imports in Jar files definition = WSDLFactory.newInstance().newWSDLReader().readWSDL(new JarWSDLLocator(wsdl)); } else { definition = WSDLFactory.newInstance().newWSDLReader().readWSDL(wsdl.getURI().getPath(), new InputSource(wsdl.getInputStream())); } return definition; } catch (IOException e) { throw new CitrusRuntimeException("Failed to read wsdl file resource", e); } catch (WSDLException e) { throw new CitrusRuntimeException("Failed to wsdl schema instance", e); } } }
public class class_name { private Definition getWsdlDefinition(Resource wsdl) { try { Definition definition; if (wsdl.getURI().toString().startsWith("jar:")) { // Locate WSDL imports in Jar files definition = WSDLFactory.newInstance().newWSDLReader().readWSDL(new JarWSDLLocator(wsdl)); // depends on control dependency: [if], data = [none] } else { definition = WSDLFactory.newInstance().newWSDLReader().readWSDL(wsdl.getURI().getPath(), new InputSource(wsdl.getInputStream())); // depends on control dependency: [if], data = [none] } return definition; // depends on control dependency: [try], data = [none] } catch (IOException e) { throw new CitrusRuntimeException("Failed to read wsdl file resource", e); } catch (WSDLException e) { // depends on control dependency: [catch], data = [none] throw new CitrusRuntimeException("Failed to wsdl schema instance", e); } // depends on control dependency: [catch], data = [none] } }
public class class_name { private CoverageDataTileMatrixResults getResultsZoomOut( BoundingBox requestProjectedBoundingBox, TileMatrix tileMatrix, int overlappingPixels) { CoverageDataTileMatrixResults results = null; for (long zoomLevel = tileMatrix.getZoomLevel() - 1; zoomLevel >= tileDao .getMinZoom(); zoomLevel--) { TileMatrix zoomTileMatrix = tileDao.getTileMatrix(zoomLevel); if (zoomTileMatrix != null) { results = getResults(requestProjectedBoundingBox, zoomTileMatrix, overlappingPixels); if (results != null) { break; } } } return results; } }
public class class_name { private CoverageDataTileMatrixResults getResultsZoomOut( BoundingBox requestProjectedBoundingBox, TileMatrix tileMatrix, int overlappingPixels) { CoverageDataTileMatrixResults results = null; for (long zoomLevel = tileMatrix.getZoomLevel() - 1; zoomLevel >= tileDao .getMinZoom(); zoomLevel--) { TileMatrix zoomTileMatrix = tileDao.getTileMatrix(zoomLevel); if (zoomTileMatrix != null) { results = getResults(requestProjectedBoundingBox, zoomTileMatrix, overlappingPixels); // depends on control dependency: [if], data = [none] if (results != null) { break; } } } return results; } }
public class class_name { public static void setLogLevels(final int aLogLevel, final String[] aLoggerList, final String[] aExcludesList, final String... aIncludesList) { final ArrayList<String> loggerList = new ArrayList<>(Arrays.asList(aLoggerList)); final Class<? extends Logger> simpleLogger = LoggerFactory.getLogger("org.slf4j.impl.SimpleLogger") .getClass(); if (aIncludesList != null) { loggerList.addAll(Arrays.asList(aIncludesList)); } for (final String loggerName : loggerList) { if (aExcludesList != null) { boolean skip = false; for (final String element : aExcludesList) { if (loggerName.equals(element)) { skip = true; break; } } if (skip) { continue; } } final Logger loggerObject = LoggerFactory.getLogger(loggerName); final Class<? extends Logger> loggerClass = loggerObject.getClass(); if (simpleLogger.equals(loggerClass)) { try { final Field field = loggerClass.getDeclaredField("currentLogLevel"); field.setAccessible(true); field.setInt(loggerObject, aLogLevel); if (loggerObject.isDebugEnabled()) { LOGGER.debug(MessageCodes.MVN_012, loggerName, getLevelName(aLogLevel)); } } catch (NoSuchFieldException | IllegalAccessException details) { LOGGER.error(MessageCodes.MVN_011, details); } } else { LOGGER.warn(MessageCodes.MVN_010, loggerName); } } } }
public class class_name { public static void setLogLevels(final int aLogLevel, final String[] aLoggerList, final String[] aExcludesList, final String... aIncludesList) { final ArrayList<String> loggerList = new ArrayList<>(Arrays.asList(aLoggerList)); final Class<? extends Logger> simpleLogger = LoggerFactory.getLogger("org.slf4j.impl.SimpleLogger") .getClass(); if (aIncludesList != null) { loggerList.addAll(Arrays.asList(aIncludesList)); // depends on control dependency: [if], data = [(aIncludesList] } for (final String loggerName : loggerList) { if (aExcludesList != null) { boolean skip = false; for (final String element : aExcludesList) { if (loggerName.equals(element)) { skip = true; // depends on control dependency: [if], data = [none] break; } } if (skip) { continue; } } final Logger loggerObject = LoggerFactory.getLogger(loggerName); final Class<? extends Logger> loggerClass = loggerObject.getClass(); if (simpleLogger.equals(loggerClass)) { try { final Field field = loggerClass.getDeclaredField("currentLogLevel"); field.setAccessible(true); // depends on control dependency: [try], data = [none] field.setInt(loggerObject, aLogLevel); // depends on control dependency: [try], data = [none] if (loggerObject.isDebugEnabled()) { LOGGER.debug(MessageCodes.MVN_012, loggerName, getLevelName(aLogLevel)); // depends on control dependency: [if], data = [none] } } catch (NoSuchFieldException | IllegalAccessException details) { LOGGER.error(MessageCodes.MVN_011, details); } // depends on control dependency: [catch], data = [none] } else { LOGGER.warn(MessageCodes.MVN_010, loggerName); // depends on control dependency: [if], data = [none] } } } }
public class class_name { @SuppressWarnings("unchecked") public static <T,S> T[] toArray(Class<T> type, Collection<S> src) { T[] dest = (T[]) Array.newInstance(type, src.size()); int i = 0; for(S s : src) { dest[i++] = (T) s; } return dest; } }
public class class_name { @SuppressWarnings("unchecked") public static <T,S> T[] toArray(Class<T> type, Collection<S> src) { T[] dest = (T[]) Array.newInstance(type, src.size()); int i = 0; for(S s : src) { dest[i++] = (T) s; // depends on control dependency: [for], data = [s] } return dest; } }
public class class_name { public void writeStartFeed(String requestContextURL, Map<String, Object> meta) throws ODataRenderException { this.contextURL = checkNotNull(requestContextURL); try { startFeed(false); if (ODataUriUtil.hasCountOption(oDataUri) && meta != null && meta.containsKey("count")) { metadataWriter.writeCount(meta.get("count")); } metadataWriter.writeFeedId(null, null); metadataWriter.writeTitle(); metadataWriter.writeUpdate(dateTime); metadataWriter.writeFeedLink(null, null); } catch (XMLStreamException | ODataEdmException e) { LOG.error("Not possible to marshall feed stream XML"); throw new ODataRenderException("Not possible to marshall feed stream XML: ", e); } } }
public class class_name { public void writeStartFeed(String requestContextURL, Map<String, Object> meta) throws ODataRenderException { this.contextURL = checkNotNull(requestContextURL); try { startFeed(false); if (ODataUriUtil.hasCountOption(oDataUri) && meta != null && meta.containsKey("count")) { metadataWriter.writeCount(meta.get("count")); // depends on control dependency: [if], data = [none] } metadataWriter.writeFeedId(null, null); metadataWriter.writeTitle(); metadataWriter.writeUpdate(dateTime); metadataWriter.writeFeedLink(null, null); } catch (XMLStreamException | ODataEdmException e) { LOG.error("Not possible to marshall feed stream XML"); throw new ODataRenderException("Not possible to marshall feed stream XML: ", e); } } }
public class class_name { private ClassLoader doResolve(MavenCoordinate mavenCoordinate) throws MojoExecutionException, MojoFailureException { List<URL> urls = new ArrayList<URL>(); log.info("Resolving transformer dependency: " + mavenCoordinate); try { DependencyNode root = repositorySystem.collectDependencies(repositorySystemSession, new CollectRequest(new Dependency(mavenCoordinate.asArtifact(), "runtime"), remoteRepositories)).getRoot(); repositorySystem.resolveDependencies(repositorySystemSession, new DependencyRequest().setRoot(root)); PreorderNodeListGenerator preorderNodeListGenerator = new PreorderNodeListGenerator(); root.accept(preorderNodeListGenerator); for (Artifact artifact : preorderNodeListGenerator.getArtifacts(false)) { urls.add(artifact.getFile().toURI().toURL()); } } catch (DependencyCollectionException exception) { throw new MojoExecutionException("Could not collect dependencies for " + mavenCoordinate, exception); } catch (DependencyResolutionException exception) { throw new MojoExecutionException("Could not resolve dependencies for " + mavenCoordinate, exception); } catch (MalformedURLException exception) { throw new MojoFailureException("Could not resolve file as URL for " + mavenCoordinate, exception); } return new URLClassLoader(urls.toArray(new URL[0]), ByteBuddy.class.getClassLoader()); } }
public class class_name { private ClassLoader doResolve(MavenCoordinate mavenCoordinate) throws MojoExecutionException, MojoFailureException { List<URL> urls = new ArrayList<URL>(); log.info("Resolving transformer dependency: " + mavenCoordinate); try { DependencyNode root = repositorySystem.collectDependencies(repositorySystemSession, new CollectRequest(new Dependency(mavenCoordinate.asArtifact(), "runtime"), remoteRepositories)).getRoot(); repositorySystem.resolveDependencies(repositorySystemSession, new DependencyRequest().setRoot(root)); PreorderNodeListGenerator preorderNodeListGenerator = new PreorderNodeListGenerator(); root.accept(preorderNodeListGenerator); for (Artifact artifact : preorderNodeListGenerator.getArtifacts(false)) { urls.add(artifact.getFile().toURI().toURL()); // depends on control dependency: [for], data = [artifact] } } catch (DependencyCollectionException exception) { throw new MojoExecutionException("Could not collect dependencies for " + mavenCoordinate, exception); } catch (DependencyResolutionException exception) { throw new MojoExecutionException("Could not resolve dependencies for " + mavenCoordinate, exception); } catch (MalformedURLException exception) { throw new MojoFailureException("Could not resolve file as URL for " + mavenCoordinate, exception); } return new URLClassLoader(urls.toArray(new URL[0]), ByteBuddy.class.getClassLoader()); } }
public class class_name { public CredentialsProvider createFor(String uri, String username, String password, String passphrase, boolean skipSslValidation) { CredentialsProvider provider = null; if (awsAvailable() && AwsCodeCommitCredentialProvider.canHandle(uri)) { this.logger .debug("Constructing AwsCodeCommitCredentialProvider for URI " + uri); AwsCodeCommitCredentialProvider aws = new AwsCodeCommitCredentialProvider(); aws.setUsername(username); aws.setPassword(password); provider = aws; } else if (hasText(username)) { this.logger.debug( "Constructing UsernamePasswordCredentialsProvider for URI " + uri); provider = new UsernamePasswordCredentialsProvider(username, password.toCharArray()); } else if (hasText(passphrase)) { this.logger .debug("Constructing PassphraseCredentialsProvider for URI " + uri); provider = new PassphraseCredentialsProvider(passphrase); } if (skipSslValidation && GitSkipSslValidationCredentialsProvider.canHandle(uri)) { this.logger .debug("Constructing GitSkipSslValidationCredentialsProvider for URI " + uri); provider = new GitSkipSslValidationCredentialsProvider(provider); } if (provider == null) { this.logger.debug("No credentials provider required for URI " + uri); } return provider; } }
public class class_name { public CredentialsProvider createFor(String uri, String username, String password, String passphrase, boolean skipSslValidation) { CredentialsProvider provider = null; if (awsAvailable() && AwsCodeCommitCredentialProvider.canHandle(uri)) { this.logger .debug("Constructing AwsCodeCommitCredentialProvider for URI " + uri); // depends on control dependency: [if], data = [none] AwsCodeCommitCredentialProvider aws = new AwsCodeCommitCredentialProvider(); aws.setUsername(username); // depends on control dependency: [if], data = [none] aws.setPassword(password); // depends on control dependency: [if], data = [none] provider = aws; // depends on control dependency: [if], data = [none] } else if (hasText(username)) { this.logger.debug( "Constructing UsernamePasswordCredentialsProvider for URI " + uri); // depends on control dependency: [if], data = [none] provider = new UsernamePasswordCredentialsProvider(username, password.toCharArray()); // depends on control dependency: [if], data = [none] } else if (hasText(passphrase)) { this.logger .debug("Constructing PassphraseCredentialsProvider for URI " + uri); // depends on control dependency: [if], data = [none] provider = new PassphraseCredentialsProvider(passphrase); // depends on control dependency: [if], data = [none] } if (skipSslValidation && GitSkipSslValidationCredentialsProvider.canHandle(uri)) { this.logger .debug("Constructing GitSkipSslValidationCredentialsProvider for URI " + uri); // depends on control dependency: [if], data = [none] provider = new GitSkipSslValidationCredentialsProvider(provider); // depends on control dependency: [if], data = [none] } if (provider == null) { this.logger.debug("No credentials provider required for URI " + uri); // depends on control dependency: [if], data = [none] } return provider; } }
public class class_name { public boolean addMeasureToVerb(String measureType, Number value, Number scaleMin, Number scaleMax, Number sampleSize) { Map<String, Object> container = new HashMap<String, Object>(); if (measureType != null) { container.put("measureType", measureType); } else { return false; } if (value != null) { container.put("value", value); } else { return false; } if (scaleMin != null) { container.put("scaleMin", scaleMin); } if (scaleMax != null) { container.put("scaleMax", scaleMax); } if (sampleSize != null) { container.put("sampleSize", sampleSize); } return addMeasureToVerb(container); } }
public class class_name { public boolean addMeasureToVerb(String measureType, Number value, Number scaleMin, Number scaleMax, Number sampleSize) { Map<String, Object> container = new HashMap<String, Object>(); if (measureType != null) { container.put("measureType", measureType); // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } if (value != null) { container.put("value", value); // depends on control dependency: [if], data = [none] } else { return false; // depends on control dependency: [if], data = [none] } if (scaleMin != null) { container.put("scaleMin", scaleMin); // depends on control dependency: [if], data = [none] } if (scaleMax != null) { container.put("scaleMax", scaleMax); // depends on control dependency: [if], data = [none] } if (sampleSize != null) { container.put("sampleSize", sampleSize); // depends on control dependency: [if], data = [none] } return addMeasureToVerb(container); } }
public class class_name { public Rectangular transformRect(Rectangular rect) { if (transform != null) { Rectangle src = new Rectangle(rect.getX1(), rect.getY1(), rect.getWidth(), rect.getHeight()); Shape dest = transform.createTransformedShape(src); Rectangle destr; if (dest instanceof Rectangle) destr = (Rectangle) dest; else destr = dest.getBounds(); return new Rectangular(destr); } else return rect; } }
public class class_name { public Rectangular transformRect(Rectangular rect) { if (transform != null) { Rectangle src = new Rectangle(rect.getX1(), rect.getY1(), rect.getWidth(), rect.getHeight()); Shape dest = transform.createTransformedShape(src); Rectangle destr; if (dest instanceof Rectangle) destr = (Rectangle) dest; else destr = dest.getBounds(); return new Rectangular(destr); // depends on control dependency: [if], data = [none] } else return rect; } }
public class class_name { private List<DirectivePair> getAllEligibleRules(HttpServletRequest httpRequest, HttpServletResponse httpResponse) { String requestMime = httpRequest.getContentType(); String userAgent = httpRequest.getHeader(Constants.HTTP_USER_AGENT_HEADER); String url = getURL(httpRequest); String responseMime = httpResponse.getContentType(); if (requestMime == null) { responseMime = Utils.selectMimeByFile(url); } List<DirectivePair> eligibleRules = null; for (RulesMapping rulesMapping : config.rulesMappings) { if (rulesMapping.isURLAccepted(url) && (rulesMapping.isMIMEAccepted(requestMime) || rulesMapping.isMIMEAccepted(responseMime)) && rulesMapping.isUserAgentAccepted(userAgent)) { if (eligibleRules == null) eligibleRules = new ArrayList<>(); //lazy init for (DirectivePair rules : rulesMapping.getRules()) { if (!eligibleRules.contains(rules)) { //((BaseModule) module).setContext(this.filterConfig.getServletContext()); eligibleRules.add(rules); } } } } LOGGER.debug("Found {} rules", eligibleRules != null ? eligibleRules.size() : 0); return eligibleRules == null ? Collections.<DirectivePair>emptyList() : eligibleRules; } }
public class class_name { private List<DirectivePair> getAllEligibleRules(HttpServletRequest httpRequest, HttpServletResponse httpResponse) { String requestMime = httpRequest.getContentType(); String userAgent = httpRequest.getHeader(Constants.HTTP_USER_AGENT_HEADER); String url = getURL(httpRequest); String responseMime = httpResponse.getContentType(); if (requestMime == null) { responseMime = Utils.selectMimeByFile(url); // depends on control dependency: [if], data = [none] } List<DirectivePair> eligibleRules = null; for (RulesMapping rulesMapping : config.rulesMappings) { if (rulesMapping.isURLAccepted(url) && (rulesMapping.isMIMEAccepted(requestMime) || rulesMapping.isMIMEAccepted(responseMime)) && rulesMapping.isUserAgentAccepted(userAgent)) { if (eligibleRules == null) eligibleRules = new ArrayList<>(); //lazy init for (DirectivePair rules : rulesMapping.getRules()) { if (!eligibleRules.contains(rules)) { //((BaseModule) module).setContext(this.filterConfig.getServletContext()); eligibleRules.add(rules); // depends on control dependency: [if], data = [none] } } } } LOGGER.debug("Found {} rules", eligibleRules != null ? eligibleRules.size() : 0); return eligibleRules == null ? Collections.<DirectivePair>emptyList() : eligibleRules; } }
public class class_name { @Trivial private static final void allBeanDebug(BeanManager beanManager, InjectInjectionBinding iBinding) throws InjectionException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { if (beanManager == null) { Tr.debug(tc, "CDI runtime cannot resolve " + iBinding.getDisplayName() + " because of a null BeanManager"); } else { Set<Bean<?>> allBeans = beanManager.getBeans(Object.class); Tr.debug(tc, "\t \t ***** ALL Beans: ***** "); for (Bean<?> bean : allBeans) { Tr.debug(tc, "Bean: " + bean); } Tr.debug(tc, "\t \t ***** ALL Beans: ***** "); } } } }
public class class_name { @Trivial private static final void allBeanDebug(BeanManager beanManager, InjectInjectionBinding iBinding) throws InjectionException { if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) { if (beanManager == null) { Tr.debug(tc, "CDI runtime cannot resolve " + iBinding.getDisplayName() + " because of a null BeanManager"); // depends on control dependency: [if], data = [none] } else { Set<Bean<?>> allBeans = beanManager.getBeans(Object.class); // depends on control dependency: [if], data = [none] Tr.debug(tc, "\t \t ***** ALL Beans: ***** "); // depends on control dependency: [if], data = [none] for (Bean<?> bean : allBeans) { Tr.debug(tc, "Bean: " + bean); // depends on control dependency: [for], data = [bean] } Tr.debug(tc, "\t \t ***** ALL Beans: ***** "); // depends on control dependency: [if], data = [none] } } } }
public class class_name { public <T> boolean write(List<T> list, Class<T> clazz) { ExcelMeta excelMeta = ExcelBeanHelper.getExcelMeta(clazz); try { Sheet sheet = workbook.createSheet(this.sheetName); sheet.setDefaultColumnWidth(15); CellStyle titleStyle = workbook.createCellStyle(); titleStyle.setAlignment(HorizontalAlignment.CENTER); titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); titleStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex()); titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); titleStyle.setBorderBottom(BorderStyle.THIN); //下边框 titleStyle.setBorderLeft(BorderStyle.THIN); Font font = workbook.createFont(); font.setFontName("宋体"); font.setFontHeightInPoints((short) 13); titleStyle.setFont(font); //列值类型 Class<?>[] cellValueTypes = new Class<?>[excelMeta.getTitleColumnNum()]; //写标题 for (int i = 1; i <= excelMeta.getTitleRowNum(); i++) { Row excelRow = sheet.createRow(i - 1); for (int j = 1; j <= excelMeta.getTitleColumnNum(); j++) { TitleMeta titleMeta = excelMeta.getTitleMeta(i, j); Cell cell = excelRow.createCell(j - 1); cell.setCellValue(titleMeta == null ? "" : titleMeta.getTitle()); cell.setCellStyle(titleStyle); cellValueTypes[j-1] = titleMeta.getValueType(); } } //合并表头 //sheet.addMergedRegion(new CellRangeAddress(0, 0, 3, 8)); //sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 0)); mergeColumns(sheet,titleStyle); mergeRows(sheet,titleStyle,excelMeta); // 行数 int rowsCount = sheet.getPhysicalNumberOfRows(); //冻结表头 //sheet.createFreezePane(0, rowsCount - 1); // 写入内容 List<Object[]> rows = ExcelBeanHelper.beanToExcelValueArrays(list, clazz); // 列数 //int colsCount = sheet.getRow(0).getPhysicalNumberOfCells(); for (int i = 0; i < rows.size(); i++) { Row excelRow = sheet.createRow(i + rowsCount); Object[] vals = rows.get(i); for (int j = 0; j < vals.length; j++) { Cell cell = excelRow.createCell(j); if(cellValueTypes[j] == int.class || cellValueTypes[j] == Integer.class){ cell.setCellValue(vals[j] == null ? 0f : Integer.parseInt(vals[j].toString())); }else if(cellValueTypes[j] == float.class || cellValueTypes[j] == Float.class || cellValueTypes[j] == double.class || cellValueTypes[j] == Double.class || cellValueTypes[j] == BigDecimal.class){ cell.setCellValue(vals[j] == null ? 0d : Double.parseDouble(vals[j].toString())); }else{ cell.setCellValue(vals[j] == null ? "" : vals[j].toString()); } } } workbook.write(outputStream); return true; } catch (IOException e) { LOG.error("流异常", e); } catch (Exception e) { LOG.error("其他异常", e); } finally { } return false; } }
public class class_name { public <T> boolean write(List<T> list, Class<T> clazz) { ExcelMeta excelMeta = ExcelBeanHelper.getExcelMeta(clazz); try { Sheet sheet = workbook.createSheet(this.sheetName); sheet.setDefaultColumnWidth(15); // depends on control dependency: [try], data = [none] CellStyle titleStyle = workbook.createCellStyle(); titleStyle.setAlignment(HorizontalAlignment.CENTER); // depends on control dependency: [try], data = [none] titleStyle.setVerticalAlignment(VerticalAlignment.CENTER); // depends on control dependency: [try], data = [none] titleStyle.setFillForegroundColor(IndexedColors.GREY_40_PERCENT.getIndex()); // depends on control dependency: [try], data = [none] titleStyle.setFillPattern(FillPatternType.SOLID_FOREGROUND); // depends on control dependency: [try], data = [none] titleStyle.setBorderBottom(BorderStyle.THIN); //下边框 // depends on control dependency: [try], data = [none] titleStyle.setBorderLeft(BorderStyle.THIN); // depends on control dependency: [try], data = [none] Font font = workbook.createFont(); font.setFontName("宋体"); // depends on control dependency: [try], data = [none] font.setFontHeightInPoints((short) 13); // depends on control dependency: [try], data = [none] titleStyle.setFont(font); // depends on control dependency: [try], data = [none] //列值类型 Class<?>[] cellValueTypes = new Class<?>[excelMeta.getTitleColumnNum()]; //写标题 for (int i = 1; i <= excelMeta.getTitleRowNum(); i++) { Row excelRow = sheet.createRow(i - 1); for (int j = 1; j <= excelMeta.getTitleColumnNum(); j++) { TitleMeta titleMeta = excelMeta.getTitleMeta(i, j); Cell cell = excelRow.createCell(j - 1); cell.setCellValue(titleMeta == null ? "" : titleMeta.getTitle()); // depends on control dependency: [for], data = [none] cell.setCellStyle(titleStyle); // depends on control dependency: [for], data = [none] cellValueTypes[j-1] = titleMeta.getValueType(); // depends on control dependency: [for], data = [j] } } //合并表头 //sheet.addMergedRegion(new CellRangeAddress(0, 0, 3, 8)); //sheet.addMergedRegion(new CellRangeAddress(0, 1, 0, 0)); mergeColumns(sheet,titleStyle); // depends on control dependency: [try], data = [none] mergeRows(sheet,titleStyle,excelMeta); // depends on control dependency: [try], data = [none] // 行数 int rowsCount = sheet.getPhysicalNumberOfRows(); //冻结表头 //sheet.createFreezePane(0, rowsCount - 1); // 写入内容 List<Object[]> rows = ExcelBeanHelper.beanToExcelValueArrays(list, clazz); // 列数 //int colsCount = sheet.getRow(0).getPhysicalNumberOfCells(); for (int i = 0; i < rows.size(); i++) { Row excelRow = sheet.createRow(i + rowsCount); Object[] vals = rows.get(i); for (int j = 0; j < vals.length; j++) { Cell cell = excelRow.createCell(j); if(cellValueTypes[j] == int.class || cellValueTypes[j] == Integer.class){ cell.setCellValue(vals[j] == null ? 0f : Integer.parseInt(vals[j].toString())); // depends on control dependency: [if], data = [none] }else if(cellValueTypes[j] == float.class || cellValueTypes[j] == Float.class || cellValueTypes[j] == double.class || cellValueTypes[j] == Double.class || cellValueTypes[j] == BigDecimal.class){ cell.setCellValue(vals[j] == null ? 0d : Double.parseDouble(vals[j].toString())); // depends on control dependency: [if], data = [none] }else{ cell.setCellValue(vals[j] == null ? "" : vals[j].toString()); // depends on control dependency: [if], data = [none] } } } workbook.write(outputStream); // depends on control dependency: [try], data = [none] return true; // depends on control dependency: [try], data = [none] } catch (IOException e) { LOG.error("流异常", e); } catch (Exception e) { // depends on control dependency: [catch], data = [none] LOG.error("其他异常", e); } finally { // depends on control dependency: [catch], data = [none] } return false; } }
public class class_name { protected void addVerbatimBeforeComponent( UIComponentClassicTagBase parentTag, UIComponent verbatim, UIComponent component) { UIComponent parent = component.getParent(); if (null == parent) { return; } List<UIComponent> children = parent.getChildren(); // EDGE CASE: // Consider CASE 1 or 2 where the component is provided via a // component binding in session or application scope. // The automatically created UIOuput instances for the template text // will already be present. Check the JSP_CREATED_COMPONENT_IDS attribute, // if present and the number of created components is the same // as the number of children replace at a -1 offset from the current // value of indexOfComponentInParent, otherwise, call add() List createdIds = (List) parent.getAttributes().get(JSP_CREATED_COMPONENT_IDS); int indexOfComponentInParent = children.indexOf(component); boolean replace = (indexOfComponentInParent > 0 && createdIds != null && createdIds.size() == children.size()); if (replace) { UIComponent oldVerbatim = children.get(indexOfComponentInParent - 1); if (oldVerbatim instanceof UIOutput && oldVerbatim.isTransient()) { children.set((indexOfComponentInParent - 1), verbatim); } else { children.add(indexOfComponentInParent, verbatim); } } else { children.add(indexOfComponentInParent, verbatim); } parentTag.addChild(verbatim); } }
public class class_name { protected void addVerbatimBeforeComponent( UIComponentClassicTagBase parentTag, UIComponent verbatim, UIComponent component) { UIComponent parent = component.getParent(); if (null == parent) { return; // depends on control dependency: [if], data = [none] } List<UIComponent> children = parent.getChildren(); // EDGE CASE: // Consider CASE 1 or 2 where the component is provided via a // component binding in session or application scope. // The automatically created UIOuput instances for the template text // will already be present. Check the JSP_CREATED_COMPONENT_IDS attribute, // if present and the number of created components is the same // as the number of children replace at a -1 offset from the current // value of indexOfComponentInParent, otherwise, call add() List createdIds = (List) parent.getAttributes().get(JSP_CREATED_COMPONENT_IDS); int indexOfComponentInParent = children.indexOf(component); boolean replace = (indexOfComponentInParent > 0 && createdIds != null && createdIds.size() == children.size()); if (replace) { UIComponent oldVerbatim = children.get(indexOfComponentInParent - 1); if (oldVerbatim instanceof UIOutput && oldVerbatim.isTransient()) { children.set((indexOfComponentInParent - 1), verbatim); // depends on control dependency: [if], data = [none] } else { children.add(indexOfComponentInParent, verbatim); // depends on control dependency: [if], data = [none] } } else { children.add(indexOfComponentInParent, verbatim); // depends on control dependency: [if], data = [none] } parentTag.addChild(verbatim); } }
public class class_name { private static ReloadableType getReloadableTypeIfHasBeenReloaded(Class<?> clazz) { if (TypeRegistry.nothingReloaded) { return null; } ReloadableType rtype = getRType(clazz); if (rtype != null && rtype.hasBeenReloaded()) { return rtype; } else { return null; } } }
public class class_name { private static ReloadableType getReloadableTypeIfHasBeenReloaded(Class<?> clazz) { if (TypeRegistry.nothingReloaded) { return null; // depends on control dependency: [if], data = [none] } ReloadableType rtype = getRType(clazz); if (rtype != null && rtype.hasBeenReloaded()) { return rtype; // depends on control dependency: [if], data = [none] } else { return null; // depends on control dependency: [if], data = [none] } } }
public class class_name { @Override protected void fireInsertUpdate( DocumentEvent evt ) { super.fireInsertUpdate( evt ); try { processChangedLines( evt.getOffset(), evt.getLength() ); } catch( Exception ex ) { System.out.println( "" + ex ); } } }
public class class_name { @Override protected void fireInsertUpdate( DocumentEvent evt ) { super.fireInsertUpdate( evt ); try { processChangedLines( evt.getOffset(), evt.getLength() ); // depends on control dependency: [try], data = [none] } catch( Exception ex ) { System.out.println( "" + ex ); } // depends on control dependency: [catch], data = [none] } }
public class class_name { public MongoClientOptions getOptions() { ReadPreference readPreference = proxied.getReadPreference(); if (readPreference != null) { builder.readPreference(readPreference); } ReadConcern readConcern = proxied.getReadConcern(); if (readConcern != null) { builder.readConcern(readConcern); } WriteConcern writeConcern = proxied.getWriteConcern(); if (writeConcern != null) { builder.writeConcern(writeConcern); } if (proxied.getRetryWritesValue() != null) { builder.retryWrites(proxied.getRetryWritesValue()); } if (proxied.getRetryReads() != null) { builder.retryReads(proxied.getRetryReads()); } Integer maxConnectionPoolSize = proxied.getMaxConnectionPoolSize(); if (maxConnectionPoolSize != null) { builder.connectionsPerHost(maxConnectionPoolSize); } Integer integer = proxied.getMinConnectionPoolSize(); if (integer != null) { builder.minConnectionsPerHost(integer); } Integer maxWaitTime = proxied.getMaxWaitTime(); if (maxWaitTime != null) { builder.maxWaitTime(maxWaitTime); } Integer threadsAllowedToBlockForConnectionMultiplier = proxied.getThreadsAllowedToBlockForConnectionMultiplier(); if (threadsAllowedToBlockForConnectionMultiplier != null) { builder.threadsAllowedToBlockForConnectionMultiplier(threadsAllowedToBlockForConnectionMultiplier); } Integer maxConnectionIdleTime = proxied.getMaxConnectionIdleTime(); if (maxConnectionIdleTime != null) { builder.maxConnectionIdleTime(maxConnectionIdleTime); } Integer maxConnectionLifeTime = proxied.getMaxConnectionLifeTime(); if (maxConnectionLifeTime != null) { builder.maxConnectionLifeTime(maxConnectionLifeTime); } Integer socketTimeout = proxied.getSocketTimeout(); if (socketTimeout != null) { builder.socketTimeout(socketTimeout); } Integer connectTimeout = proxied.getConnectTimeout(); if (connectTimeout != null) { builder.connectTimeout(connectTimeout); } String requiredReplicaSetName = proxied.getRequiredReplicaSetName(); if (requiredReplicaSetName != null) { builder.requiredReplicaSetName(requiredReplicaSetName); } Boolean sslEnabled = proxied.getSslEnabled(); if (sslEnabled != null) { builder.sslEnabled(sslEnabled); } Boolean sslInvalidHostnameAllowed = proxied.getSslInvalidHostnameAllowed(); if (sslInvalidHostnameAllowed != null) { builder.sslInvalidHostNameAllowed(sslInvalidHostnameAllowed); } Integer serverSelectionTimeout = proxied.getServerSelectionTimeout(); if (serverSelectionTimeout != null) { builder.serverSelectionTimeout(serverSelectionTimeout); } Integer localThreshold = proxied.getLocalThreshold(); if (localThreshold != null) { builder.localThreshold(localThreshold); } Integer heartbeatFrequency = proxied.getHeartbeatFrequency(); if (heartbeatFrequency != null) { builder.heartbeatFrequency(heartbeatFrequency); } String applicationName = proxied.getApplicationName(); if (applicationName != null) { builder.applicationName(applicationName); } if (!proxied.getCompressorList().isEmpty()) { builder.compressorList(proxied.getCompressorList()); } return builder.build(); } }
public class class_name { public MongoClientOptions getOptions() { ReadPreference readPreference = proxied.getReadPreference(); if (readPreference != null) { builder.readPreference(readPreference); // depends on control dependency: [if], data = [(readPreference] } ReadConcern readConcern = proxied.getReadConcern(); if (readConcern != null) { builder.readConcern(readConcern); // depends on control dependency: [if], data = [(readConcern] } WriteConcern writeConcern = proxied.getWriteConcern(); if (writeConcern != null) { builder.writeConcern(writeConcern); // depends on control dependency: [if], data = [(writeConcern] } if (proxied.getRetryWritesValue() != null) { builder.retryWrites(proxied.getRetryWritesValue()); // depends on control dependency: [if], data = [(proxied.getRetryWritesValue()] } if (proxied.getRetryReads() != null) { builder.retryReads(proxied.getRetryReads()); // depends on control dependency: [if], data = [(proxied.getRetryReads()] } Integer maxConnectionPoolSize = proxied.getMaxConnectionPoolSize(); if (maxConnectionPoolSize != null) { builder.connectionsPerHost(maxConnectionPoolSize); // depends on control dependency: [if], data = [(maxConnectionPoolSize] } Integer integer = proxied.getMinConnectionPoolSize(); if (integer != null) { builder.minConnectionsPerHost(integer); // depends on control dependency: [if], data = [(integer] } Integer maxWaitTime = proxied.getMaxWaitTime(); if (maxWaitTime != null) { builder.maxWaitTime(maxWaitTime); // depends on control dependency: [if], data = [(maxWaitTime] } Integer threadsAllowedToBlockForConnectionMultiplier = proxied.getThreadsAllowedToBlockForConnectionMultiplier(); if (threadsAllowedToBlockForConnectionMultiplier != null) { builder.threadsAllowedToBlockForConnectionMultiplier(threadsAllowedToBlockForConnectionMultiplier); // depends on control dependency: [if], data = [(threadsAllowedToBlockForConnectionMultiplier] } Integer maxConnectionIdleTime = proxied.getMaxConnectionIdleTime(); if (maxConnectionIdleTime != null) { builder.maxConnectionIdleTime(maxConnectionIdleTime); // depends on control dependency: [if], data = [(maxConnectionIdleTime] } Integer maxConnectionLifeTime = proxied.getMaxConnectionLifeTime(); if (maxConnectionLifeTime != null) { builder.maxConnectionLifeTime(maxConnectionLifeTime); // depends on control dependency: [if], data = [(maxConnectionLifeTime] } Integer socketTimeout = proxied.getSocketTimeout(); if (socketTimeout != null) { builder.socketTimeout(socketTimeout); // depends on control dependency: [if], data = [(socketTimeout] } Integer connectTimeout = proxied.getConnectTimeout(); if (connectTimeout != null) { builder.connectTimeout(connectTimeout); // depends on control dependency: [if], data = [(connectTimeout] } String requiredReplicaSetName = proxied.getRequiredReplicaSetName(); if (requiredReplicaSetName != null) { builder.requiredReplicaSetName(requiredReplicaSetName); // depends on control dependency: [if], data = [(requiredReplicaSetName] } Boolean sslEnabled = proxied.getSslEnabled(); if (sslEnabled != null) { builder.sslEnabled(sslEnabled); // depends on control dependency: [if], data = [(sslEnabled] } Boolean sslInvalidHostnameAllowed = proxied.getSslInvalidHostnameAllowed(); if (sslInvalidHostnameAllowed != null) { builder.sslInvalidHostNameAllowed(sslInvalidHostnameAllowed); // depends on control dependency: [if], data = [(sslInvalidHostnameAllowed] } Integer serverSelectionTimeout = proxied.getServerSelectionTimeout(); if (serverSelectionTimeout != null) { builder.serverSelectionTimeout(serverSelectionTimeout); // depends on control dependency: [if], data = [(serverSelectionTimeout] } Integer localThreshold = proxied.getLocalThreshold(); if (localThreshold != null) { builder.localThreshold(localThreshold); // depends on control dependency: [if], data = [(localThreshold] } Integer heartbeatFrequency = proxied.getHeartbeatFrequency(); if (heartbeatFrequency != null) { builder.heartbeatFrequency(heartbeatFrequency); // depends on control dependency: [if], data = [(heartbeatFrequency] } String applicationName = proxied.getApplicationName(); if (applicationName != null) { builder.applicationName(applicationName); // depends on control dependency: [if], data = [(applicationName] } if (!proxied.getCompressorList().isEmpty()) { builder.compressorList(proxied.getCompressorList()); // depends on control dependency: [if], data = [none] } return builder.build(); } }
public class class_name { @SuppressWarnings("WeakerAccess") public void removeWeakCallback(@NonNull Callback callback) { for (int i = mCallbacks.size() - 1; i >= 0; i--) { Callback currentCallback = mCallbacks.get(i).get(); if (currentCallback == null || currentCallback == callback) { // found callback, or empty weak ref mCallbacks.remove(i); } } } }
public class class_name { @SuppressWarnings("WeakerAccess") public void removeWeakCallback(@NonNull Callback callback) { for (int i = mCallbacks.size() - 1; i >= 0; i--) { Callback currentCallback = mCallbacks.get(i).get(); if (currentCallback == null || currentCallback == callback) { // found callback, or empty weak ref mCallbacks.remove(i); // depends on control dependency: [if], data = [none] } } } }