code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
public static String formatIsoDate(ZonedDateTime value) {
if (value == null) {
return null;
}
// to match the format we get from Python's .isoformat(), we don't include second fraction if it's zero
if (value.getNano() == 0) {
return ISO_DATETIME_FORMAT_NO_SECOND_FRACTION.format(value);
}
return ISO_DATETIME_FORMAT.format(value);
} }
|
public class class_name {
public static String formatIsoDate(ZonedDateTime value) {
if (value == null) {
return null; // depends on control dependency: [if], data = [none]
}
// to match the format we get from Python's .isoformat(), we don't include second fraction if it's zero
if (value.getNano() == 0) {
return ISO_DATETIME_FORMAT_NO_SECOND_FRACTION.format(value); // depends on control dependency: [if], data = [none]
}
return ISO_DATETIME_FORMAT.format(value);
} }
|
public class class_name {
public static JedisPool create(final PippoSettings settings) {
String host = settings.getString(HOST, Protocol.DEFAULT_HOST).trim();
int minIdle = settings.getInteger(MIN_IDLE, GenericObjectPoolConfig.DEFAULT_MIN_IDLE);
int maxIdle = settings.getInteger(MAX_IDLE, GenericObjectPoolConfig.DEFAULT_MAX_IDLE);
int maxTotal = settings.getInteger(MAX_TOTAL, GenericObjectPoolConfig.DEFAULT_MAX_TOTAL);
JedisPoolConfig config = new JedisPoolConfig();
config.setMinIdle(minIdle);
config.setMaxIdle(maxIdle);
config.setMaxTotal(maxTotal);
try {
return new JedisPool(config, new URI(host));
} catch (URISyntaxException e) {
throw new PippoRuntimeException("Malformed redis URI", e);
}
} }
|
public class class_name {
public static JedisPool create(final PippoSettings settings) {
String host = settings.getString(HOST, Protocol.DEFAULT_HOST).trim();
int minIdle = settings.getInteger(MIN_IDLE, GenericObjectPoolConfig.DEFAULT_MIN_IDLE);
int maxIdle = settings.getInteger(MAX_IDLE, GenericObjectPoolConfig.DEFAULT_MAX_IDLE);
int maxTotal = settings.getInteger(MAX_TOTAL, GenericObjectPoolConfig.DEFAULT_MAX_TOTAL);
JedisPoolConfig config = new JedisPoolConfig();
config.setMinIdle(minIdle);
config.setMaxIdle(maxIdle);
config.setMaxTotal(maxTotal);
try {
return new JedisPool(config, new URI(host)); // depends on control dependency: [try], data = [none]
} catch (URISyntaxException e) {
throw new PippoRuntimeException("Malformed redis URI", e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
static List<ExperimentAlgorithm<BinarySolution, List<BinarySolution>>> configureAlgorithmList(
List<ExperimentProblem<BinarySolution>> problemList) {
List<ExperimentAlgorithm<BinarySolution, List<BinarySolution>>> algorithms = new ArrayList<>();
for (int run = 0; run < INDEPENDENT_RUNS; run++) {
for (int i = 0; i < problemList.size(); i++) {
Algorithm<List<BinarySolution>> algorithm = new NSGAIIBuilder<BinarySolution>(
problemList.get(i).getProblem(),
new SinglePointCrossover(1.0),
new BitFlipMutation(
1.0 / ((BinaryProblem) problemList.get(i).getProblem()).getNumberOfBits(0)),
100)
.setMaxEvaluations(25000)
.build();
algorithms.add(new ExperimentAlgorithm<>(algorithm, problemList.get(i), run));
}
for (int i = 0; i < problemList.size(); i++) {
Algorithm<List<BinarySolution>> algorithm = new SPEA2Builder<BinarySolution>(
problemList.get(i).getProblem(),
new SinglePointCrossover(1.0),
new BitFlipMutation(
1.0 / ((BinaryProblem) problemList.get(i).getProblem()).getNumberOfBits(0)))
.setMaxIterations(250)
.setPopulationSize(100)
.build();
algorithms.add(new ExperimentAlgorithm<>(algorithm, problemList.get(i), run));
}
for (int i = 0; i < problemList.size(); i++) {
Algorithm<List<BinarySolution>> algorithm = new MOCellBuilder<BinarySolution>(
problemList.get(i).getProblem(),
new SinglePointCrossover(1.0),
new BitFlipMutation(
1.0 / ((BinaryProblem) problemList.get(i).getProblem()).getNumberOfBits(0)))
.setMaxEvaluations(25000)
.setPopulationSize(100)
.build();
algorithms.add(new ExperimentAlgorithm<>(algorithm, problemList.get(i), run));
}
for (int i = 0; i < problemList.size(); i++) {
CrossoverOperator<BinarySolution> crossoverOperator;
MutationOperator<BinarySolution> mutationOperator;
SelectionOperator<List<BinarySolution>, BinarySolution> parentsSelection;
SelectionOperator<List<BinarySolution>, List<BinarySolution>> newGenerationSelection;
crossoverOperator = new HUXCrossover(1.0);
parentsSelection = new RandomSelection<BinarySolution>();
newGenerationSelection = new RankingAndCrowdingSelection<BinarySolution>(100);
mutationOperator = new BitFlipMutation(0.35);
Algorithm<List<BinarySolution>> algorithm = new MOCHCBuilder(
(BinaryProblem) problemList.get(i).getProblem())
.setInitialConvergenceCount(0.25)
.setConvergenceValue(3)
.setPreservedPopulation(0.05)
.setPopulationSize(100)
.setMaxEvaluations(25000)
.setCrossover(crossoverOperator)
.setNewGenerationSelection(newGenerationSelection)
.setCataclysmicMutation(mutationOperator)
.setParentSelection(parentsSelection)
.setEvaluator(new SequentialSolutionListEvaluator<BinarySolution>())
.build();
algorithms.add(new ExperimentAlgorithm<>(algorithm, problemList.get(i), run));
}
}
return algorithms;
} }
|
public class class_name {
static List<ExperimentAlgorithm<BinarySolution, List<BinarySolution>>> configureAlgorithmList(
List<ExperimentProblem<BinarySolution>> problemList) {
List<ExperimentAlgorithm<BinarySolution, List<BinarySolution>>> algorithms = new ArrayList<>();
for (int run = 0; run < INDEPENDENT_RUNS; run++) {
for (int i = 0; i < problemList.size(); i++) {
Algorithm<List<BinarySolution>> algorithm = new NSGAIIBuilder<BinarySolution>(
problemList.get(i).getProblem(),
new SinglePointCrossover(1.0),
new BitFlipMutation(
1.0 / ((BinaryProblem) problemList.get(i).getProblem()).getNumberOfBits(0)),
100)
.setMaxEvaluations(25000)
.build();
algorithms.add(new ExperimentAlgorithm<>(algorithm, problemList.get(i), run)); // depends on control dependency: [for], data = [i]
}
for (int i = 0; i < problemList.size(); i++) {
Algorithm<List<BinarySolution>> algorithm = new SPEA2Builder<BinarySolution>(
problemList.get(i).getProblem(),
new SinglePointCrossover(1.0),
new BitFlipMutation(
1.0 / ((BinaryProblem) problemList.get(i).getProblem()).getNumberOfBits(0)))
.setMaxIterations(250)
.setPopulationSize(100)
.build();
algorithms.add(new ExperimentAlgorithm<>(algorithm, problemList.get(i), run)); // depends on control dependency: [for], data = [i]
}
for (int i = 0; i < problemList.size(); i++) {
Algorithm<List<BinarySolution>> algorithm = new MOCellBuilder<BinarySolution>(
problemList.get(i).getProblem(),
new SinglePointCrossover(1.0),
new BitFlipMutation(
1.0 / ((BinaryProblem) problemList.get(i).getProblem()).getNumberOfBits(0)))
.setMaxEvaluations(25000)
.setPopulationSize(100)
.build();
algorithms.add(new ExperimentAlgorithm<>(algorithm, problemList.get(i), run)); // depends on control dependency: [for], data = [i]
}
for (int i = 0; i < problemList.size(); i++) {
CrossoverOperator<BinarySolution> crossoverOperator;
MutationOperator<BinarySolution> mutationOperator;
SelectionOperator<List<BinarySolution>, BinarySolution> parentsSelection;
SelectionOperator<List<BinarySolution>, List<BinarySolution>> newGenerationSelection;
crossoverOperator = new HUXCrossover(1.0); // depends on control dependency: [for], data = [none]
parentsSelection = new RandomSelection<BinarySolution>(); // depends on control dependency: [for], data = [none]
newGenerationSelection = new RankingAndCrowdingSelection<BinarySolution>(100); // depends on control dependency: [for], data = [none]
mutationOperator = new BitFlipMutation(0.35); // depends on control dependency: [for], data = [none]
Algorithm<List<BinarySolution>> algorithm = new MOCHCBuilder(
(BinaryProblem) problemList.get(i).getProblem())
.setInitialConvergenceCount(0.25)
.setConvergenceValue(3)
.setPreservedPopulation(0.05)
.setPopulationSize(100)
.setMaxEvaluations(25000)
.setCrossover(crossoverOperator)
.setNewGenerationSelection(newGenerationSelection)
.setCataclysmicMutation(mutationOperator)
.setParentSelection(parentsSelection)
.setEvaluator(new SequentialSolutionListEvaluator<BinarySolution>())
.build();
algorithms.add(new ExperimentAlgorithm<>(algorithm, problemList.get(i), run)); // depends on control dependency: [for], data = [i]
}
}
return algorithms;
} }
|
public class class_name {
protected List<Serializable> getMessageArguments() {
List<Serializable> args = new ArrayList<>(1);
WLabel label = input.getLabel();
if (label == null) {
args.add("");
} else {
args.add(label.getText());
}
return args;
} }
|
public class class_name {
protected List<Serializable> getMessageArguments() {
List<Serializable> args = new ArrayList<>(1);
WLabel label = input.getLabel();
if (label == null) {
args.add(""); // depends on control dependency: [if], data = [none]
} else {
args.add(label.getText()); // depends on control dependency: [if], data = [(label]
}
return args;
} }
|
public class class_name {
public List<Integer> get(String stream, List<Object> tuple, Collection<Tuple> anchors, Object rootId) {
List<Integer> outTasks = new ArrayList<>();
// get grouper, then get which task should tuple be sent to.
Map<String, MkGrouper> componentCrouping = streamComponentGrouper.get(stream);
if (componentCrouping == null) {
// if the target component's parallelism is 0, don't need send to
// them
LOG.debug("Failed to get Grouper of " + stream + " when " + debugIdStr);
return outTasks;
}
for (Entry<String, MkGrouper> ee : componentCrouping.entrySet()) {
String targetComponent = ee.getKey();
MkGrouper g = ee.getValue();
if (GrouperType.direct.equals(g.gettype())) {
throw new IllegalArgumentException("Cannot do regular emit to direct stream");
}
outTasks.addAll(g.grouper(tuple));
}
if (isDebug(anchors, rootId)) {
LOG.info(debugIdStr + stream + " to " + outTasks + ":" + tuple.toString());
}
int num_out_tasks = outTasks.size();
taskStats.send_tuple(stream, num_out_tasks);
return outTasks;
} }
|
public class class_name {
public List<Integer> get(String stream, List<Object> tuple, Collection<Tuple> anchors, Object rootId) {
List<Integer> outTasks = new ArrayList<>();
// get grouper, then get which task should tuple be sent to.
Map<String, MkGrouper> componentCrouping = streamComponentGrouper.get(stream);
if (componentCrouping == null) {
// if the target component's parallelism is 0, don't need send to
// them
LOG.debug("Failed to get Grouper of " + stream + " when " + debugIdStr); // depends on control dependency: [if], data = [none]
return outTasks; // depends on control dependency: [if], data = [none]
}
for (Entry<String, MkGrouper> ee : componentCrouping.entrySet()) {
String targetComponent = ee.getKey();
MkGrouper g = ee.getValue();
if (GrouperType.direct.equals(g.gettype())) {
throw new IllegalArgumentException("Cannot do regular emit to direct stream");
}
outTasks.addAll(g.grouper(tuple)); // depends on control dependency: [for], data = [none]
}
if (isDebug(anchors, rootId)) {
LOG.info(debugIdStr + stream + " to " + outTasks + ":" + tuple.toString()); // depends on control dependency: [if], data = [none]
}
int num_out_tasks = outTasks.size();
taskStats.send_tuple(stream, num_out_tasks);
return outTasks;
} }
|
public class class_name {
public MappedSuperclass<OrmDescriptor> getOrCreateMappedSuperclass()
{
List<Node> nodeList = model.get("mapped-superclass");
if (nodeList != null && nodeList.size() > 0)
{
return new MappedSuperclassImpl<OrmDescriptor>(this, "mapped-superclass", model, nodeList.get(0));
}
return createMappedSuperclass();
} }
|
public class class_name {
public MappedSuperclass<OrmDescriptor> getOrCreateMappedSuperclass()
{
List<Node> nodeList = model.get("mapped-superclass");
if (nodeList != null && nodeList.size() > 0)
{
return new MappedSuperclassImpl<OrmDescriptor>(this, "mapped-superclass", model, nodeList.get(0)); // depends on control dependency: [if], data = [none]
}
return createMappedSuperclass();
} }
|
public class class_name {
public void setVpnConnectionIds(java.util.Collection<String> vpnConnectionIds) {
if (vpnConnectionIds == null) {
this.vpnConnectionIds = null;
return;
}
this.vpnConnectionIds = new com.amazonaws.internal.SdkInternalList<String>(vpnConnectionIds);
} }
|
public class class_name {
public void setVpnConnectionIds(java.util.Collection<String> vpnConnectionIds) {
if (vpnConnectionIds == null) {
this.vpnConnectionIds = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.vpnConnectionIds = new com.amazonaws.internal.SdkInternalList<String>(vpnConnectionIds);
} }
|
public class class_name {
private boolean isValidTemplateElement(String template, String element) {
List elements = new ArrayList(getTemplateElements(template));
Iterator i = elements.iterator();
while (i.hasNext()) {
CmsDialogElement currElement = (CmsDialogElement)i.next();
if (element.equals(currElement.getName())) {
return true;
}
}
return false;
} }
|
public class class_name {
private boolean isValidTemplateElement(String template, String element) {
List elements = new ArrayList(getTemplateElements(template));
Iterator i = elements.iterator();
while (i.hasNext()) {
CmsDialogElement currElement = (CmsDialogElement)i.next();
if (element.equals(currElement.getName())) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} }
|
public class class_name {
public DoubleProperty lengthProperty() {
if (this.length == null) {
this.length = new ReadOnlyDoubleWrapper();
this.length.bind(Bindings.createDoubleBinding(() ->
Path3afp.computeLength(getPathIterator()),
innerTypesProperty(), innerCoordinatesProperty()));
}
return this.length;
} }
|
public class class_name {
public DoubleProperty lengthProperty() {
if (this.length == null) {
this.length = new ReadOnlyDoubleWrapper(); // depends on control dependency: [if], data = [none]
this.length.bind(Bindings.createDoubleBinding(() ->
Path3afp.computeLength(getPathIterator()),
innerTypesProperty(), innerCoordinatesProperty())); // depends on control dependency: [if], data = [none]
}
return this.length;
} }
|
public class class_name {
public void start()
{
if (registryService != null && !registryService.getForceXMLConfigurationValue(initParams))
{
SessionProvider sessionProvider = SessionProvider.createSystemProvider();
try
{
readParamsFromRegistryService(sessionProvider);
}
catch (Exception e)
{
readParamsFromFile();
try
{
writeParamsToRegistryService(sessionProvider);
}
catch (Exception exc)
{
LOG.error("Cannot write init configuration to RegistryService.", exc);
}
}
finally
{
sessionProvider.close();
}
}
else
{
readParamsFromFile();
}
} }
|
public class class_name {
public void start()
{
if (registryService != null && !registryService.getForceXMLConfigurationValue(initParams))
{
SessionProvider sessionProvider = SessionProvider.createSystemProvider();
try
{
readParamsFromRegistryService(sessionProvider); // depends on control dependency: [try], data = [none]
}
catch (Exception e)
{
readParamsFromFile();
try
{
writeParamsToRegistryService(sessionProvider); // depends on control dependency: [try], data = [none]
}
catch (Exception exc)
{
LOG.error("Cannot write init configuration to RegistryService.", exc);
} // depends on control dependency: [catch], data = [none]
} // depends on control dependency: [catch], data = [none]
finally
{
sessionProvider.close();
}
}
else
{
readParamsFromFile(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public HlsGroupSettings withAdMarkers(String... adMarkers) {
if (this.adMarkers == null) {
setAdMarkers(new java.util.ArrayList<String>(adMarkers.length));
}
for (String ele : adMarkers) {
this.adMarkers.add(ele);
}
return this;
} }
|
public class class_name {
public HlsGroupSettings withAdMarkers(String... adMarkers) {
if (this.adMarkers == null) {
setAdMarkers(new java.util.ArrayList<String>(adMarkers.length)); // depends on control dependency: [if], data = [none]
}
for (String ele : adMarkers) {
this.adMarkers.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public void marshall(InputProcessingConfigurationUpdate inputProcessingConfigurationUpdate, ProtocolMarshaller protocolMarshaller) {
if (inputProcessingConfigurationUpdate == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(inputProcessingConfigurationUpdate.getInputLambdaProcessorUpdate(), INPUTLAMBDAPROCESSORUPDATE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(InputProcessingConfigurationUpdate inputProcessingConfigurationUpdate, ProtocolMarshaller protocolMarshaller) {
if (inputProcessingConfigurationUpdate == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(inputProcessingConfigurationUpdate.getInputLambdaProcessorUpdate(), INPUTLAMBDAPROCESSORUPDATE_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void setUserSettings(java.util.Collection<UserSetting> userSettings) {
if (userSettings == null) {
this.userSettings = null;
return;
}
this.userSettings = new java.util.ArrayList<UserSetting>(userSettings);
} }
|
public class class_name {
public void setUserSettings(java.util.Collection<UserSetting> userSettings) {
if (userSettings == null) {
this.userSettings = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.userSettings = new java.util.ArrayList<UserSetting>(userSettings);
} }
|
public class class_name {
public static String determineMostSpecificType(final String... types) {
switch (types.length) {
case 0:
throw new IllegalArgumentException("At least one type has to be provided");
case 1:
return types[0];
case 2:
return determineMostSpecific(types[0], types[1]);
default:
String currentMostSpecific = determineMostSpecific(types[0], types[1]);
for (int i = 2; i < types.length; i++) {
currentMostSpecific = determineMostSpecific(currentMostSpecific, types[i]);
}
return currentMostSpecific;
}
} }
|
public class class_name {
public static String determineMostSpecificType(final String... types) {
switch (types.length) {
case 0:
throw new IllegalArgumentException("At least one type has to be provided");
case 1:
return types[0];
case 2:
return determineMostSpecific(types[0], types[1]);
default:
String currentMostSpecific = determineMostSpecific(types[0], types[1]);
for (int i = 2; i < types.length; i++) {
currentMostSpecific = determineMostSpecific(currentMostSpecific, types[i]); // depends on control dependency: [for], data = [i]
}
return currentMostSpecific;
}
} }
|
public class class_name {
public static ExceptionDescriptor parseStackTrace(final Collection<String> lines) {
if ((lines == null) || lines.isEmpty()) {
throw new IllegalArgumentException("No stack trace provided.");
}
try {
final Builder b = new Builder();
final Collection<ExceptionLine> parsedLines = new ExceptionParser().parse(lines);
parsedLines.forEach(b::addLine);
return b.build();
} catch (final ExceptionParseException e) {
// FIXME provides no information as to why there's no exception
// found
return null;
}
} }
|
public class class_name {
public static ExceptionDescriptor parseStackTrace(final Collection<String> lines) {
if ((lines == null) || lines.isEmpty()) {
throw new IllegalArgumentException("No stack trace provided.");
}
try {
final Builder b = new Builder();
final Collection<ExceptionLine> parsedLines = new ExceptionParser().parse(lines);
parsedLines.forEach(b::addLine); // depends on control dependency: [try], data = [none]
return b.build(); // depends on control dependency: [try], data = [none]
} catch (final ExceptionParseException e) {
// FIXME provides no information as to why there's no exception
// found
return null;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void registerForLaterWriting (@Nonnull final AbstractWALDAO <?> aDAO,
@Nonnull final String sWALFilename,
@Nonnull final TimeValue aWaitingWime)
{
// In case many DAOs of the same class exist, the filename is also added
final String sKey = aDAO.getClass ().getName () + "::" + sWALFilename;
// Check if the passed DAO is already scheduled for writing
final boolean bDoScheduleForWriting = m_aRWLock.writeLocked ( () -> m_aWaitingDAOs.add (sKey));
if (bDoScheduleForWriting)
{
// We need to schedule it now
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Now scheduling writing for DAO " + sKey);
// What should be executed upon writing
final Runnable r = () -> {
// Use DAO lock!
aDAO.internalWriteLocked ( () -> {
// Main DAO writing
aDAO._writeToFileAndResetPendingChanges ("ScheduledWriter.run");
// Delete the WAL file
aDAO._deleteWALFileAfterProcessing (sWALFilename);
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Finished scheduled writing for DAO " + sKey);
});
// Remove from the internal set so that another job will be
// scheduled for the same DAO
// Do this after the writing to the file
m_aRWLock.writeLocked ( () -> {
// Remove from the overall set as well as from the scheduled items
m_aWaitingDAOs.remove (sKey);
m_aScheduledItems.remove (sKey);
});
};
// Schedule exactly once in the specified waiting time
final ScheduledFuture <?> aFuture = m_aES.schedule (r, aWaitingWime.getDuration (), aWaitingWime.getTimeUnit ());
// Remember the scheduled item and the runnable so that the task can
// be rescheduled upon shutdown.
m_aRWLock.writeLocked ( () -> m_aScheduledItems.put (sKey, new WALItem (aFuture, r)));
}
// else the writing of the passed DAO is already scheduled and no further
// action is necessary
} }
|
public class class_name {
public void registerForLaterWriting (@Nonnull final AbstractWALDAO <?> aDAO,
@Nonnull final String sWALFilename,
@Nonnull final TimeValue aWaitingWime)
{
// In case many DAOs of the same class exist, the filename is also added
final String sKey = aDAO.getClass ().getName () + "::" + sWALFilename;
// Check if the passed DAO is already scheduled for writing
final boolean bDoScheduleForWriting = m_aRWLock.writeLocked ( () -> m_aWaitingDAOs.add (sKey));
if (bDoScheduleForWriting)
{
// We need to schedule it now
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Now scheduling writing for DAO " + sKey);
// What should be executed upon writing
final Runnable r = () -> {
// Use DAO lock!
aDAO.internalWriteLocked ( () -> {
// Main DAO writing
aDAO._writeToFileAndResetPendingChanges ("ScheduledWriter.run");
// Delete the WAL file
aDAO._deleteWALFileAfterProcessing (sWALFilename);
if (LOGGER.isDebugEnabled ())
LOGGER.debug ("Finished scheduled writing for DAO " + sKey);
});
// Remove from the internal set so that another job will be
// scheduled for the same DAO
// Do this after the writing to the file
m_aRWLock.writeLocked ( () -> {
// Remove from the overall set as well as from the scheduled items
m_aWaitingDAOs.remove (sKey); // depends on control dependency: [if], data = [none]
m_aScheduledItems.remove (sKey); // depends on control dependency: [if], data = [none]
});
};
// Schedule exactly once in the specified waiting time
final ScheduledFuture <?> aFuture = m_aES.schedule (r, aWaitingWime.getDuration (), aWaitingWime.getTimeUnit ());
// Remember the scheduled item and the runnable so that the task can
// be rescheduled upon shutdown.
m_aRWLock.writeLocked ( () -> m_aScheduledItems.put (sKey, new WALItem (aFuture, r)));
}
// else the writing of the passed DAO is already scheduled and no further
// action is necessary
} }
|
public class class_name {
public DataSetBuilder remainingColumnsNull() {
for (int i = 0; i < fillers.length; i++) {
if (fillers[i] == null) {
fillers[i] = NULL_FILLER;
fillerCount++;
}
}
return this;
} }
|
public class class_name {
public DataSetBuilder remainingColumnsNull() {
for (int i = 0; i < fillers.length; i++) {
if (fillers[i] == null) {
fillers[i] = NULL_FILLER; // depends on control dependency: [if], data = [none]
fillerCount++; // depends on control dependency: [if], data = [none]
}
}
return this;
} }
|
public class class_name {
public void setIcon(FontOpenCms icon, String color) {
if (icon != null) {
m_iconCell.setInnerHTML(icon.getHtml(32, color));
} else {
m_iconCell.setInnerHTML("");
}
} }
|
public class class_name {
public void setIcon(FontOpenCms icon, String color) {
if (icon != null) {
m_iconCell.setInnerHTML(icon.getHtml(32, color)); // depends on control dependency: [if], data = [(icon]
} else {
m_iconCell.setInnerHTML(""); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void warn(String message, Object ... args) {
if (log.isWarnEnabled()) {
log.warn(String.format(message, args));
}
} }
|
public class class_name {
public void warn(String message, Object ... args) {
if (log.isWarnEnabled()) {
log.warn(String.format(message, args)); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private static HttpEntity entityFromConnection(HttpURLConnection connection) {
BasicHttpEntity entity = new BasicHttpEntity();
InputStream inputStream;
try {
inputStream = connection.getInputStream();
} catch (IOException ioe) {
inputStream = connection.getErrorStream();
}
entity.setContent(inputStream);
entity.setContentLength(connection.getContentLength());
entity.setContentEncoding(connection.getContentEncoding());
entity.setContentType(connection.getContentType());
return entity;
} }
|
public class class_name {
private static HttpEntity entityFromConnection(HttpURLConnection connection) {
BasicHttpEntity entity = new BasicHttpEntity();
InputStream inputStream;
try {
inputStream = connection.getInputStream(); // depends on control dependency: [try], data = [none]
} catch (IOException ioe) {
inputStream = connection.getErrorStream();
} // depends on control dependency: [catch], data = [none]
entity.setContent(inputStream);
entity.setContentLength(connection.getContentLength());
entity.setContentEncoding(connection.getContentEncoding());
entity.setContentType(connection.getContentType());
return entity;
} }
|
public class class_name {
public Observable<ServiceResponse<Page<WorkerPoolResourceInner>>> listMultiRolePoolsWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listMultiRolePoolsSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<WorkerPoolResourceInner>>, Observable<ServiceResponse<Page<WorkerPoolResourceInner>>>>() {
@Override
public Observable<ServiceResponse<Page<WorkerPoolResourceInner>>> call(ServiceResponse<Page<WorkerPoolResourceInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listMultiRolePoolsNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<Page<WorkerPoolResourceInner>>> listMultiRolePoolsWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listMultiRolePoolsSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<WorkerPoolResourceInner>>, Observable<ServiceResponse<Page<WorkerPoolResourceInner>>>>() {
@Override
public Observable<ServiceResponse<Page<WorkerPoolResourceInner>>> call(ServiceResponse<Page<WorkerPoolResourceInner>> 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(listMultiRolePoolsNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public static <T extends Serializable> Observable<T> read(final ObjectInputStream ois) {
return Observable.create(new SyncOnSubscribe<ObjectInputStream,T>() {
@Override
protected ObjectInputStream generateState() {
return ois;
}
@Override
protected ObjectInputStream next(ObjectInputStream ois, Observer<? super T> observer) {
try {
@SuppressWarnings("unchecked")
T t = (T) ois.readObject();
observer.onNext(t);
} catch (EOFException e) {
observer.onCompleted();
} catch (ClassNotFoundException e) {
observer.onError(e);
} catch (IOException e) {
observer.onError(e);
}
return ois;
}
});
} }
|
public class class_name {
public static <T extends Serializable> Observable<T> read(final ObjectInputStream ois) {
return Observable.create(new SyncOnSubscribe<ObjectInputStream,T>() {
@Override
protected ObjectInputStream generateState() {
return ois;
}
@Override
protected ObjectInputStream next(ObjectInputStream ois, Observer<? super T> observer) {
try {
@SuppressWarnings("unchecked")
T t = (T) ois.readObject();
observer.onNext(t); // depends on control dependency: [try], data = [none]
} catch (EOFException e) {
observer.onCompleted();
} catch (ClassNotFoundException e) { // depends on control dependency: [catch], data = [none]
observer.onError(e);
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
observer.onError(e);
} // depends on control dependency: [catch], data = [none]
return ois;
}
});
} }
|
public class class_name {
@Override
public boolean launch(final Activity context, Bundle data) {
String url = data.getString(Socialize.DIRECT_URL);
if(!StringUtils.isEmpty(url)) {
final DirectUrlWebView webView = directUrlWebViewFactory.getBean();
webView.setListener(directUrlListener);
Dialog dialog = dialogFactory.build(context, webView, true);
dialog.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
handleCloseEvent(webView, context);
}
});
dialog.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
handleCloseEvent(webView, context);
}
});
dialog.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK) {
if(webView.canGoBack()) {
webView.goBack();
return true;
}
}
return false;
}
});
boolean show = true;
if(directUrlListener != null) {
show = directUrlListener.onBeforePageLoaded(webView, url);
}
if(show) {
dialog.show();
webView.loadUrl(url);
}
return show;
}
else {
handleWarn("No url found under key [" +
Socialize.DIRECT_URL +
"]");
}
return false;
} }
|
public class class_name {
@Override
public boolean launch(final Activity context, Bundle data) {
String url = data.getString(Socialize.DIRECT_URL);
if(!StringUtils.isEmpty(url)) {
final DirectUrlWebView webView = directUrlWebViewFactory.getBean();
webView.setListener(directUrlListener); // depends on control dependency: [if], data = [none]
Dialog dialog = dialogFactory.build(context, webView, true);
dialog.setOnCancelListener(new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
handleCloseEvent(webView, context);
}
}); // depends on control dependency: [if], data = [none]
dialog.setOnDismissListener(new OnDismissListener() {
@Override
public void onDismiss(DialogInterface dialog) {
handleCloseEvent(webView, context);
}
}); // depends on control dependency: [if], data = [none]
dialog.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(DialogInterface dialog, int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK) {
if(webView.canGoBack()) {
webView.goBack(); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
}
}); // depends on control dependency: [if], data = [none]
boolean show = true;
if(directUrlListener != null) {
show = directUrlListener.onBeforePageLoaded(webView, url); // depends on control dependency: [if], data = [none]
}
if(show) {
dialog.show(); // depends on control dependency: [if], data = [none]
webView.loadUrl(url); // depends on control dependency: [if], data = [none]
}
return show; // depends on control dependency: [if], data = [none]
}
else {
handleWarn("No url found under key [" +
Socialize.DIRECT_URL +
"]"); // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
public static byte[] changeEncoding(byte[] input, String oldEncoding, String newEncoding) {
if ((oldEncoding == null) || (newEncoding == null)) {
return input;
}
if (oldEncoding.trim().equalsIgnoreCase(newEncoding.trim())) {
return input;
}
byte[] result = input;
try {
result = (new String(input, oldEncoding)).getBytes(newEncoding);
} catch (UnsupportedEncodingException e) {
// return value will be input value
}
return result;
} }
|
public class class_name {
public static byte[] changeEncoding(byte[] input, String oldEncoding, String newEncoding) {
if ((oldEncoding == null) || (newEncoding == null)) {
return input; // depends on control dependency: [if], data = [none]
}
if (oldEncoding.trim().equalsIgnoreCase(newEncoding.trim())) {
return input; // depends on control dependency: [if], data = [none]
}
byte[] result = input;
try {
result = (new String(input, oldEncoding)).getBytes(newEncoding); // depends on control dependency: [try], data = [none]
} catch (UnsupportedEncodingException e) {
// return value will be input value
} // depends on control dependency: [catch], data = [none]
return result;
} }
|
public class class_name {
public void placeRing(IRing ring, Point2d ringCenter, double bondLength, Map<Integer, Double> startAngles) {
double radius = this.getNativeRingRadius(ring, bondLength);
double addAngle = 2 * Math.PI / ring.getRingSize();
IAtom startAtom = ring.getAtom(0);
Point2d p = new Point2d(ringCenter.x + radius, ringCenter.y);
startAtom.setPoint2d(p);
double startAngle = Math.PI * 0.5;
/*
* Different ring sizes get different start angles to have visually
* correct placement
*/
int ringSize = ring.getRingSize();
if (startAngles.get(ringSize) != null) startAngle = startAngles.get(ringSize);
List<IBond> bonds = ring.getConnectedBondsList(startAtom);
/*
* Store all atoms to draw in consecutive order relative to the chosen
* bond.
*/
Vector<IAtom> atomsToDraw = new Vector<IAtom>();
IAtom currentAtom = startAtom;
IBond currentBond = (IBond) bonds.get(0);
for (int i = 0; i < ring.getBondCount(); i++) {
currentBond = ring.getNextBond(currentBond, currentAtom);
currentAtom = currentBond.getOther(currentAtom);
atomsToDraw.addElement(currentAtom);
}
atomPlacer.populatePolygonCorners(atomsToDraw, ringCenter, startAngle, addAngle, radius);
} }
|
public class class_name {
public void placeRing(IRing ring, Point2d ringCenter, double bondLength, Map<Integer, Double> startAngles) {
double radius = this.getNativeRingRadius(ring, bondLength);
double addAngle = 2 * Math.PI / ring.getRingSize();
IAtom startAtom = ring.getAtom(0);
Point2d p = new Point2d(ringCenter.x + radius, ringCenter.y);
startAtom.setPoint2d(p);
double startAngle = Math.PI * 0.5;
/*
* Different ring sizes get different start angles to have visually
* correct placement
*/
int ringSize = ring.getRingSize();
if (startAngles.get(ringSize) != null) startAngle = startAngles.get(ringSize);
List<IBond> bonds = ring.getConnectedBondsList(startAtom);
/*
* Store all atoms to draw in consecutive order relative to the chosen
* bond.
*/
Vector<IAtom> atomsToDraw = new Vector<IAtom>();
IAtom currentAtom = startAtom;
IBond currentBond = (IBond) bonds.get(0);
for (int i = 0; i < ring.getBondCount(); i++) {
currentBond = ring.getNextBond(currentBond, currentAtom); // depends on control dependency: [for], data = [none]
currentAtom = currentBond.getOther(currentAtom); // depends on control dependency: [for], data = [none]
atomsToDraw.addElement(currentAtom); // depends on control dependency: [for], data = [none]
}
atomPlacer.populatePolygonCorners(atomsToDraw, ringCenter, startAngle, addAngle, radius);
} }
|
public class class_name {
public Geometry convert2JTS(Object object) {
if (object == null) {
return null;
}
String data = (String) object;
int srid = Integer.parseInt(data.substring(0, data.indexOf("|")));
Geometry geom;
try {
WKTReader reader = new WKTReader();
geom = reader.read(data.substring(data.indexOf("|") + 1));
} catch (Exception e) { // NOSONAR
throw new RuntimeException("Couldn't parse incoming wkt geometry.", e);
}
geom.setSRID(srid);
return geom;
} }
|
public class class_name {
public Geometry convert2JTS(Object object) {
if (object == null) {
return null; // depends on control dependency: [if], data = [none]
}
String data = (String) object;
int srid = Integer.parseInt(data.substring(0, data.indexOf("|")));
Geometry geom;
try {
WKTReader reader = new WKTReader();
geom = reader.read(data.substring(data.indexOf("|") + 1)); // depends on control dependency: [try], data = [none]
} catch (Exception e) { // NOSONAR
throw new RuntimeException("Couldn't parse incoming wkt geometry.", e);
} // depends on control dependency: [catch], data = [none]
geom.setSRID(srid);
return geom;
} }
|
public class class_name {
public LinkedList<Map.Entry<String, V>> commonPrefixSearchWithValue(char[] chars, int begin)
{
LinkedList<Map.Entry<String, V>> result = new LinkedList<Map.Entry<String, V>>();
StringBuilder sb = new StringBuilder();
BaseNode branch = this;
for (int i = begin; i < chars.length; ++i)
{
char aChar = chars[i];
branch = branch.getChild(aChar);
if (branch == null || branch.status == Status.UNDEFINED_0) return result;
sb.append(aChar);
if (branch.status == Status.WORD_MIDDLE_2 || branch.status == Status.WORD_END_3)
{
result.add(new AbstractMap.SimpleEntry<String, V>(sb.toString(), (V) branch.value));
}
}
return result;
} }
|
public class class_name {
public LinkedList<Map.Entry<String, V>> commonPrefixSearchWithValue(char[] chars, int begin)
{
LinkedList<Map.Entry<String, V>> result = new LinkedList<Map.Entry<String, V>>();
StringBuilder sb = new StringBuilder();
BaseNode branch = this;
for (int i = begin; i < chars.length; ++i)
{
char aChar = chars[i];
branch = branch.getChild(aChar); // depends on control dependency: [for], data = [none]
if (branch == null || branch.status == Status.UNDEFINED_0) return result;
sb.append(aChar); // depends on control dependency: [for], data = [none]
if (branch.status == Status.WORD_MIDDLE_2 || branch.status == Status.WORD_END_3)
{
result.add(new AbstractMap.SimpleEntry<String, V>(sb.toString(), (V) branch.value)); // depends on control dependency: [if], data = [none]
}
}
return result;
} }
|
public class class_name {
public void setDevices(java.util.Collection<DeviceDescription> devices) {
if (devices == null) {
this.devices = null;
return;
}
this.devices = new java.util.ArrayList<DeviceDescription>(devices);
} }
|
public class class_name {
public void setDevices(java.util.Collection<DeviceDescription> devices) {
if (devices == null) {
this.devices = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.devices = new java.util.ArrayList<DeviceDescription>(devices);
} }
|
public class class_name {
@SuppressWarnings("unchecked")
public <T> T rpoplpush(Object srcKey, Object dstKey) {
Jedis jedis = getJedis();
try {
return (T)valueFromBytes(jedis.rpoplpush(keyToBytes(srcKey), keyToBytes(dstKey)));
}
finally {close(jedis);}
} }
|
public class class_name {
@SuppressWarnings("unchecked")
public <T> T rpoplpush(Object srcKey, Object dstKey) {
Jedis jedis = getJedis();
try {
return (T)valueFromBytes(jedis.rpoplpush(keyToBytes(srcKey), keyToBytes(dstKey)));
// depends on control dependency: [try], data = [none]
}
finally {close(jedis);}
} }
|
public class class_name {
public boolean restAuthEnabled() {
final boolean restInitiallyDisabled = staticSettings.getAsBoolean(ConfigConstants.SEARCHGUARD_UNSUPPORTED_DISABLE_REST_AUTH_INITIALLY, false);
if(restInitiallyDisabled) {
if(dynamicSgConfig == null) {
if(log.isTraceEnabled()) {
log.trace("dynamicSgConfig is null, initially static restDisabled");
}
return false;
} else {
final boolean restDynamicallyDisabled = dynamicSgConfig.getAsBoolean("searchguard.dynamic.disable_rest_auth", false);
if(log.isTraceEnabled()) {
log.trace("searchguard.dynamic.disable_rest_auth {}", restDynamicallyDisabled);
}
return !restDynamicallyDisabled;
}
} else {
return true;
}
} }
|
public class class_name {
public boolean restAuthEnabled() {
final boolean restInitiallyDisabled = staticSettings.getAsBoolean(ConfigConstants.SEARCHGUARD_UNSUPPORTED_DISABLE_REST_AUTH_INITIALLY, false);
if(restInitiallyDisabled) {
if(dynamicSgConfig == null) {
if(log.isTraceEnabled()) {
log.trace("dynamicSgConfig is null, initially static restDisabled"); // depends on control dependency: [if], data = [none]
}
return false; // depends on control dependency: [if], data = [none]
} else {
final boolean restDynamicallyDisabled = dynamicSgConfig.getAsBoolean("searchguard.dynamic.disable_rest_auth", false);
if(log.isTraceEnabled()) {
log.trace("searchguard.dynamic.disable_rest_auth {}", restDynamicallyDisabled); // depends on control dependency: [if], data = [none]
}
return !restDynamicallyDisabled; // depends on control dependency: [if], data = [none]
}
} else {
return true; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public String getHostName() {
String value = System.getProperty("GLOBUS_HOSTNAME");
if (value != null) {
return value;
}
return getProperty("hostname", null);
} }
|
public class class_name {
public String getHostName() {
String value = System.getProperty("GLOBUS_HOSTNAME");
if (value != null) {
return value; // depends on control dependency: [if], data = [none]
}
return getProperty("hostname", null);
} }
|
public class class_name {
@Override
public byte[] convertBlock(int[] input, int inPos, byte[] output, int numOfComponents, int startCoordinate,
int row, int scanlineStride) {
int index = 0, inputOffset = 0, bounds = 0;
int Y, Cb, Cr;
int len = output.length;
for (int i = 0; i < DCTSIZE; i++) {
index = startCoordinate + i * scanlineStride;
bounds = row * scanlineStride;
for (int j = 0; j < DCTSIZE; j++) {
Y = input[inputOffset++] & 0xFF;
Cb = input[inputOffset++] & 0xFF;
Cr = input[inputOffset++] & 0xFF;
if (index >= len) {
return output;
}
if (index < bounds) {
output[index++] = (byte) sampleRangeLimitTable[sampleRangeLimitOffset + Y + Cr2R[Cr]];
output[index++] = (byte) sampleRangeLimitTable[sampleRangeLimitOffset + Y
+ ((Cb2G[Cb] + Cr2G[Cr]) >> 16)];
output[index++] = (byte) sampleRangeLimitTable[sampleRangeLimitOffset + Y + Cb2B[Cb]];
}
}
row++;
}
return output;
} }
|
public class class_name {
@Override
public byte[] convertBlock(int[] input, int inPos, byte[] output, int numOfComponents, int startCoordinate,
int row, int scanlineStride) {
int index = 0, inputOffset = 0, bounds = 0;
int Y, Cb, Cr;
int len = output.length;
for (int i = 0; i < DCTSIZE; i++) {
index = startCoordinate + i * scanlineStride; // depends on control dependency: [for], data = [i]
bounds = row * scanlineStride; // depends on control dependency: [for], data = [none]
for (int j = 0; j < DCTSIZE; j++) {
Y = input[inputOffset++] & 0xFF; // depends on control dependency: [for], data = [none]
Cb = input[inputOffset++] & 0xFF; // depends on control dependency: [for], data = [none]
Cr = input[inputOffset++] & 0xFF; // depends on control dependency: [for], data = [none]
if (index >= len) {
return output; // depends on control dependency: [if], data = [none]
}
if (index < bounds) {
output[index++] = (byte) sampleRangeLimitTable[sampleRangeLimitOffset + Y + Cr2R[Cr]]; // depends on control dependency: [if], data = [none]
output[index++] = (byte) sampleRangeLimitTable[sampleRangeLimitOffset + Y
+ ((Cb2G[Cb] + Cr2G[Cr]) >> 16)]; // depends on control dependency: [if], data = [none]
output[index++] = (byte) sampleRangeLimitTable[sampleRangeLimitOffset + Y + Cb2B[Cb]]; // depends on control dependency: [if], data = [none]
}
}
row++; // depends on control dependency: [for], data = [none]
}
return output;
} }
|
public class class_name {
public java.util.List<String> getCustomSecurityGroupIds() {
if (customSecurityGroupIds == null) {
customSecurityGroupIds = new com.amazonaws.internal.SdkInternalList<String>();
}
return customSecurityGroupIds;
} }
|
public class class_name {
public java.util.List<String> getCustomSecurityGroupIds() {
if (customSecurityGroupIds == null) {
customSecurityGroupIds = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none]
}
return customSecurityGroupIds;
} }
|
public class class_name {
public boolean isCollection()
{
if (target instanceof Collection)
{
return true;
}
if (containsKey("@items") && !containsKey("@keys"))
{
return type != null && !type.contains("[");
}
return false;
} }
|
public class class_name {
public boolean isCollection()
{
if (target instanceof Collection)
{
return true;
// depends on control dependency: [if], data = [none]
}
if (containsKey("@items") && !containsKey("@keys"))
{
return type != null && !type.contains("[");
// depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
public void marshall(InstanceAssociationStatusInfo instanceAssociationStatusInfo, ProtocolMarshaller protocolMarshaller) {
if (instanceAssociationStatusInfo == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(instanceAssociationStatusInfo.getAssociationId(), ASSOCIATIONID_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getName(), NAME_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getDocumentVersion(), DOCUMENTVERSION_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getAssociationVersion(), ASSOCIATIONVERSION_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getInstanceId(), INSTANCEID_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getExecutionDate(), EXECUTIONDATE_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getStatus(), STATUS_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getDetailedStatus(), DETAILEDSTATUS_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getExecutionSummary(), EXECUTIONSUMMARY_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getErrorCode(), ERRORCODE_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getOutputUrl(), OUTPUTURL_BINDING);
protocolMarshaller.marshall(instanceAssociationStatusInfo.getAssociationName(), ASSOCIATIONNAME_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(InstanceAssociationStatusInfo instanceAssociationStatusInfo, ProtocolMarshaller protocolMarshaller) {
if (instanceAssociationStatusInfo == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(instanceAssociationStatusInfo.getAssociationId(), ASSOCIATIONID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getDocumentVersion(), DOCUMENTVERSION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getAssociationVersion(), ASSOCIATIONVERSION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getInstanceId(), INSTANCEID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getExecutionDate(), EXECUTIONDATE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getStatus(), STATUS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getDetailedStatus(), DETAILEDSTATUS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getExecutionSummary(), EXECUTIONSUMMARY_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getErrorCode(), ERRORCODE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getOutputUrl(), OUTPUTURL_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(instanceAssociationStatusInfo.getAssociationName(), ASSOCIATIONNAME_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void initDownstream()
{
for (Interaction inter : getDownstreamInteractions(pe.getParticipantOf()))
{
AbstractNode node = (AbstractNode) graph.getGraphObject(inter);
if (node == null) continue;
if (inter instanceof Conversion)
{
Conversion conv = (Conversion) inter;
ConversionWrapper conW = (ConversionWrapper) node;
if (conv.getConversionDirection() == ConversionDirectionType.REVERSIBLE &&
conv.getRight().contains(pe))
{
node = conW.getReverse();
}
}
Edge edge = new EdgeL3(this, node, graph);
this.getDownstreamNoInit().add(edge);
node.getUpstreamNoInit().add(edge);
}
} }
|
public class class_name {
public void initDownstream()
{
for (Interaction inter : getDownstreamInteractions(pe.getParticipantOf()))
{
AbstractNode node = (AbstractNode) graph.getGraphObject(inter);
if (node == null) continue;
if (inter instanceof Conversion)
{
Conversion conv = (Conversion) inter;
ConversionWrapper conW = (ConversionWrapper) node;
if (conv.getConversionDirection() == ConversionDirectionType.REVERSIBLE &&
conv.getRight().contains(pe))
{
node = conW.getReverse();
// depends on control dependency: [if], data = [none]
}
}
Edge edge = new EdgeL3(this, node, graph);
this.getDownstreamNoInit().add(edge);
// depends on control dependency: [for], data = [none]
node.getUpstreamNoInit().add(edge);
// depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
@Nonnull
public DataBuilder appendOperatingSystemPattern(@Nonnull final OperatingSystemPattern pattern) {
Check.notNull(pattern, "pattern");
if (!operatingSystemPatterns.containsKey(pattern.getId())) {
operatingSystemPatterns.put(pattern.getId(), new TreeSet<OperatingSystemPattern>(OS_PATTERN_COMPARATOR));
}
operatingSystemPatterns.get(pattern.getId()).add(pattern);
return this;
} }
|
public class class_name {
@Nonnull
public DataBuilder appendOperatingSystemPattern(@Nonnull final OperatingSystemPattern pattern) {
Check.notNull(pattern, "pattern");
if (!operatingSystemPatterns.containsKey(pattern.getId())) {
operatingSystemPatterns.put(pattern.getId(), new TreeSet<OperatingSystemPattern>(OS_PATTERN_COMPARATOR)); // depends on control dependency: [if], data = [none]
}
operatingSystemPatterns.get(pattern.getId()).add(pattern);
return this;
} }
|
public class class_name {
final public void Concatenation() throws ParseException {
Math();
label_11:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case CONCAT:
;
break;
default:
jj_la1[24] = jj_gen;
break label_11;
}
jj_consume_token(CONCAT);
AstConcatenation jjtn001 = new AstConcatenation(JJTCONCATENATION);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
Math();
} catch (Throwable jjte001) {
if (jjtc001) {
jjtree.clearNodeScope(jjtn001);
jjtc001 = false;
} else {
jjtree.popNode();
}
if (jjte001 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte001;}
}
if (jjte001 instanceof ParseException) {
{if (true) throw (ParseException)jjte001;}
}
{if (true) throw (Error)jjte001;}
} finally {
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 2);
}
}
}
} }
|
public class class_name {
final public void Concatenation() throws ParseException {
Math();
label_11:
while (true) {
switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
case CONCAT:
;
break;
default:
jj_la1[24] = jj_gen;
break label_11;
}
jj_consume_token(CONCAT);
AstConcatenation jjtn001 = new AstConcatenation(JJTCONCATENATION);
boolean jjtc001 = true;
jjtree.openNodeScope(jjtn001);
try {
Math(); // depends on control dependency: [try], data = [none]
} catch (Throwable jjte001) {
if (jjtc001) {
jjtree.clearNodeScope(jjtn001); // depends on control dependency: [if], data = [none]
jjtc001 = false; // depends on control dependency: [if], data = [none]
} else {
jjtree.popNode(); // depends on control dependency: [if], data = [none]
}
if (jjte001 instanceof RuntimeException) {
{if (true) throw (RuntimeException)jjte001;}
}
if (jjte001 instanceof ParseException) {
{if (true) throw (ParseException)jjte001;}
}
{if (true) throw (Error)jjte001;}
} finally { // depends on control dependency: [catch], data = [none]
if (jjtc001) {
jjtree.closeNodeScope(jjtn001, 2); // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
@Override
public void validateSetup(Server server, Query query) throws ValidationException {
// Check if we've already created a logger for this file. If so, use it.
Logger logger;
if (loggers.containsKey(outputFile)) {
logger = getLogger(outputFile);
}else{
// need to create a logger
try {
logger = buildLogger(outputFile);
loggers.put(outputFile, logger);
} catch (IOException e) {
throw new ValidationException("Failed to setup logback", query, e);
}
}
logwriter = new LogWriter(logger,delimiter);
} }
|
public class class_name {
@Override
public void validateSetup(Server server, Query query) throws ValidationException {
// Check if we've already created a logger for this file. If so, use it.
Logger logger;
if (loggers.containsKey(outputFile)) {
logger = getLogger(outputFile);
}else{
// need to create a logger
try {
logger = buildLogger(outputFile); // depends on control dependency: [try], data = [none]
loggers.put(outputFile, logger); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
throw new ValidationException("Failed to setup logback", query, e);
} // depends on control dependency: [catch], data = [none]
}
logwriter = new LogWriter(logger,delimiter);
} }
|
public class class_name {
private void refreshMetadataCache(final Queue<WindupMetadataSystem> metadataSystemCache, final DecompilerSettings settings)
{
metadataSystemCache.clear();
for (int i = 0; i < this.getNumberOfThreads(); i++)
{
metadataSystemCache.add(new NoRetryMetadataSystem(settings.getTypeLoader()));
}
} }
|
public class class_name {
private void refreshMetadataCache(final Queue<WindupMetadataSystem> metadataSystemCache, final DecompilerSettings settings)
{
metadataSystemCache.clear();
for (int i = 0; i < this.getNumberOfThreads(); i++)
{
metadataSystemCache.add(new NoRetryMetadataSystem(settings.getTypeLoader())); // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
public void visitLookupSwitchInsn(
final Label dflt,
final int keys[],
final Label labels[]) {
if (computeMaxs) {
// updates current stack size (max stack size unchanged)
--stackSize;
// ends current block (with many new successors)
if (currentBlock != null) {
currentBlock.maxStackSize = maxStackSize;
addSuccessor(stackSize, dflt);
for (int i = 0; i < labels.length; ++i) {
addSuccessor(stackSize, labels[i]);
}
currentBlock = null;
}
}
final ByteBuffer code = this.code;
// adds the instruction to the bytecode of the method
int source = code.length;
code.putByte(Constants.LOOKUPSWITCH);
while (code.length % 4 != 0) {
code.putByte(0);
}
dflt.put(this, code, source, true);
code.putInt(labels.length);
for (int i = 0; i < labels.length; ++i) {
code.putInt(keys[i]);
labels[i].put(this, code, source, true);
}
} }
|
public class class_name {
public void visitLookupSwitchInsn(
final Label dflt,
final int keys[],
final Label labels[]) {
if (computeMaxs) {
// updates current stack size (max stack size unchanged)
--stackSize; // depends on control dependency: [if], data = [none]
// ends current block (with many new successors)
if (currentBlock != null) {
currentBlock.maxStackSize = maxStackSize; // depends on control dependency: [if], data = [none]
addSuccessor(stackSize, dflt); // depends on control dependency: [if], data = [none]
for (int i = 0; i < labels.length; ++i) {
addSuccessor(stackSize, labels[i]); // depends on control dependency: [for], data = [i]
}
currentBlock = null; // depends on control dependency: [if], data = [none]
}
}
final ByteBuffer code = this.code;
// adds the instruction to the bytecode of the method
int source = code.length;
code.putByte(Constants.LOOKUPSWITCH);
while (code.length % 4 != 0) {
code.putByte(0); // depends on control dependency: [while], data = [0)]
}
dflt.put(this, code, source, true);
code.putInt(labels.length);
for (int i = 0; i < labels.length; ++i) {
code.putInt(keys[i]); // depends on control dependency: [for], data = [i]
labels[i].put(this, code, source, true); // depends on control dependency: [for], data = [i]
}
} }
|
public class class_name {
public String[] getHeaders() {
String[] headers = new String[columns.getColumns().size()];
Column column = null;
for (int i = 0; i < columns.getColumns().size(); i++) {
column = columns.getColumns().get(i);
if (column.getHeader() != null && !column.getHeader().equals("")) {
headers[i] = columns.getColumns().get(i).getHeader();
} else {
headers[i] = column.getName();
}
}
return headers;
} }
|
public class class_name {
public String[] getHeaders() {
String[] headers = new String[columns.getColumns().size()];
Column column = null;
for (int i = 0; i < columns.getColumns().size(); i++) {
column = columns.getColumns().get(i); // depends on control dependency: [for], data = [i]
if (column.getHeader() != null && !column.getHeader().equals("")) {
headers[i] = columns.getColumns().get(i).getHeader(); // depends on control dependency: [if], data = [none]
} else {
headers[i] = column.getName(); // depends on control dependency: [if], data = [none]
}
}
return headers;
} }
|
public class class_name {
private static <T> T populateObject(T object) {
Class clazz = object.getClass();
while (clazz != null) {
String name = clazz.getName();
if (name.startsWith("java.") || name.startsWith("javax.") || name.startsWith("android.")) {
// Skip system classes
break;
}
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
if (!Modifier.isFinal(field.getModifiers())) {
Object value = generateValue(field);
field.setAccessible(true);
try {
field.set(object, value);
} catch (Exception e) {
throw new RuntimeException("Failed to populate object of type "
+ object.getClass().getCanonicalName(), e);
}
}
}
clazz = clazz.getSuperclass();
}
return object;
} }
|
public class class_name {
private static <T> T populateObject(T object) {
Class clazz = object.getClass();
while (clazz != null) {
String name = clazz.getName();
if (name.startsWith("java.") || name.startsWith("javax.") || name.startsWith("android.")) {
// Skip system classes
break;
}
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
if (!Modifier.isFinal(field.getModifiers())) {
Object value = generateValue(field);
field.setAccessible(true); // depends on control dependency: [if], data = [none]
try {
field.set(object, value); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new RuntimeException("Failed to populate object of type "
+ object.getClass().getCanonicalName(), e);
} // depends on control dependency: [catch], data = [none]
}
}
clazz = clazz.getSuperclass(); // depends on control dependency: [while], data = [none]
}
return object;
} }
|
public class class_name {
@NonNull protected FragmentMvpDelegate<V, P> getMvpDelegate() {
if (mvpDelegate == null) {
mvpDelegate = new FragmentMvpDelegateImpl<>(this, this, true, true);
}
return mvpDelegate;
} }
|
public class class_name {
@NonNull protected FragmentMvpDelegate<V, P> getMvpDelegate() {
if (mvpDelegate == null) {
mvpDelegate = new FragmentMvpDelegateImpl<>(this, this, true, true); // depends on control dependency: [if], data = [none]
}
return mvpDelegate;
} }
|
public class class_name {
public EnvInfo info() {
if (closed) {
throw new AlreadyClosedException();
}
final MDB_envinfo info = new MDB_envinfo(RUNTIME);
checkRc(LIB.mdb_env_info(ptr, info));
final long mapAddress;
if (info.f0_me_mapaddr.get() == null) {
mapAddress = 0;
} else {
mapAddress = info.f0_me_mapaddr.get().address();
}
return new EnvInfo(
mapAddress,
info.f1_me_mapsize.longValue(),
info.f2_me_last_pgno.longValue(),
info.f3_me_last_txnid.longValue(),
info.f4_me_maxreaders.intValue(),
info.f5_me_numreaders.intValue());
} }
|
public class class_name {
public EnvInfo info() {
if (closed) {
throw new AlreadyClosedException();
}
final MDB_envinfo info = new MDB_envinfo(RUNTIME);
checkRc(LIB.mdb_env_info(ptr, info));
final long mapAddress;
if (info.f0_me_mapaddr.get() == null) {
mapAddress = 0; // depends on control dependency: [if], data = [none]
} else {
mapAddress = info.f0_me_mapaddr.get().address(); // depends on control dependency: [if], data = [none]
}
return new EnvInfo(
mapAddress,
info.f1_me_mapsize.longValue(),
info.f2_me_last_pgno.longValue(),
info.f3_me_last_txnid.longValue(),
info.f4_me_maxreaders.intValue(),
info.f5_me_numreaders.intValue());
} }
|
public class class_name {
public void marshall(DisassociateSkillFromSkillGroupRequest disassociateSkillFromSkillGroupRequest, ProtocolMarshaller protocolMarshaller) {
if (disassociateSkillFromSkillGroupRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(disassociateSkillFromSkillGroupRequest.getSkillGroupArn(), SKILLGROUPARN_BINDING);
protocolMarshaller.marshall(disassociateSkillFromSkillGroupRequest.getSkillId(), SKILLID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(DisassociateSkillFromSkillGroupRequest disassociateSkillFromSkillGroupRequest, ProtocolMarshaller protocolMarshaller) {
if (disassociateSkillFromSkillGroupRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(disassociateSkillFromSkillGroupRequest.getSkillGroupArn(), SKILLGROUPARN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(disassociateSkillFromSkillGroupRequest.getSkillId(), SKILLID_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 {
String generateBlankNodeIdentifier(String id) {
if (id != null && blankNodeIdentifierMap.containsKey(id)) {
return blankNodeIdentifierMap.get(id);
}
final String bnid = "_:b" + blankNodeCounter++;
if (id != null) {
blankNodeIdentifierMap.put(id, bnid);
}
return bnid;
} }
|
public class class_name {
String generateBlankNodeIdentifier(String id) {
if (id != null && blankNodeIdentifierMap.containsKey(id)) {
return blankNodeIdentifierMap.get(id); // depends on control dependency: [if], data = [(id]
}
final String bnid = "_:b" + blankNodeCounter++;
if (id != null) {
blankNodeIdentifierMap.put(id, bnid); // depends on control dependency: [if], data = [(id]
}
return bnid;
} }
|
public class class_name {
private boolean walkInvalidList(String className, String name, String[][] list) {
boolean isInvalidCombination = false;
for (int i = 0; i != list.length; i++) {
if (className.equalsIgnoreCase(list[i][0])) {
if (name.equalsIgnoreCase(list[i][1])) {
isInvalidCombination = true;
break;
}
}
}
return isInvalidCombination;
} }
|
public class class_name {
private boolean walkInvalidList(String className, String name, String[][] list) {
boolean isInvalidCombination = false;
for (int i = 0; i != list.length; i++) {
if (className.equalsIgnoreCase(list[i][0])) {
if (name.equalsIgnoreCase(list[i][1])) {
isInvalidCombination = true; // depends on control dependency: [if], data = [none]
break;
}
}
}
return isInvalidCombination;
} }
|
public class class_name {
@VisibleForTesting
static void recordMessageEvent(Span span, long size, Type eventType) {
Preconditions.checkArgument(span != null, "span should not be null.");
if (size < 0) {
size = 0;
}
MessageEvent event =
MessageEvent.builder(eventType, idGenerator.getAndIncrement())
.setUncompressedMessageSize(size)
.build();
span.addMessageEvent(event);
} }
|
public class class_name {
@VisibleForTesting
static void recordMessageEvent(Span span, long size, Type eventType) {
Preconditions.checkArgument(span != null, "span should not be null.");
if (size < 0) {
size = 0; // depends on control dependency: [if], data = [none]
}
MessageEvent event =
MessageEvent.builder(eventType, idGenerator.getAndIncrement())
.setUncompressedMessageSize(size)
.build();
span.addMessageEvent(event);
} }
|
public class class_name {
protected boolean refreshFromSystem() {
this.nodeTypesLock.writeLock().lock();
try {
// Re-read and re-register all of the node types ...
SessionCache systemCache = repository.createSystemSession(context, true);
SystemContent system = new SystemContent(systemCache);
Collection<NodeTypeDefinition> nodeTypes = system.readAllNodeTypes();
if (nodeTypes.isEmpty()) return false;
registerNodeTypes(nodeTypes, false, false, false);
return true;
} catch (Throwable e) {
logger.error(e, JcrI18n.errorRefreshingNodeTypes, repository.name());
return false;
} finally {
this.nodeTypesLock.writeLock().unlock();
}
} }
|
public class class_name {
protected boolean refreshFromSystem() {
this.nodeTypesLock.writeLock().lock();
try {
// Re-read and re-register all of the node types ...
SessionCache systemCache = repository.createSystemSession(context, true);
SystemContent system = new SystemContent(systemCache);
Collection<NodeTypeDefinition> nodeTypes = system.readAllNodeTypes();
if (nodeTypes.isEmpty()) return false;
registerNodeTypes(nodeTypes, false, false, false); // depends on control dependency: [try], data = [none]
return true; // depends on control dependency: [try], data = [none]
} catch (Throwable e) {
logger.error(e, JcrI18n.errorRefreshingNodeTypes, repository.name());
return false;
} finally { // depends on control dependency: [catch], data = [none]
this.nodeTypesLock.writeLock().unlock();
}
} }
|
public class class_name {
@PublicEvolving
public <ACC, V, R> SingleOutputStreamOperator<R> aggregate(
AggregateFunction<T, ACC, V> aggregateFunction,
ProcessAllWindowFunction<V, R, W> windowFunction,
TypeInformation<ACC> accumulatorType,
TypeInformation<V> aggregateResultType,
TypeInformation<R> resultType) {
checkNotNull(aggregateFunction, "aggregateFunction");
checkNotNull(windowFunction, "windowFunction");
checkNotNull(accumulatorType, "accumulatorType");
checkNotNull(aggregateResultType, "aggregateResultType");
checkNotNull(resultType, "resultType");
if (aggregateFunction instanceof RichFunction) {
throw new UnsupportedOperationException("This aggregate function cannot be a RichFunction.");
}
//clean the closures
windowFunction = input.getExecutionEnvironment().clean(windowFunction);
aggregateFunction = input.getExecutionEnvironment().clean(aggregateFunction);
final String callLocation = Utils.getCallLocationName();
final String udfName = "AllWindowedStream." + callLocation;
final String opName;
final KeySelector<T, Byte> keySel = input.getKeySelector();
OneInputStreamOperator<T, R> operator;
if (evictor != null) {
@SuppressWarnings({"unchecked", "rawtypes"})
TypeSerializer<StreamRecord<T>> streamRecordSerializer =
(TypeSerializer<StreamRecord<T>>) new StreamElementSerializer(
input.getType().createSerializer(getExecutionEnvironment().getConfig()));
ListStateDescriptor<StreamRecord<T>> stateDesc =
new ListStateDescriptor<>("window-contents", streamRecordSerializer);
opName = "TriggerWindow(" + windowAssigner + ", " + stateDesc + ", " + trigger + ", " + evictor + ", " + udfName + ")";
operator = new EvictingWindowOperator<>(windowAssigner,
windowAssigner.getWindowSerializer(getExecutionEnvironment().getConfig()),
keySel,
input.getKeyType().createSerializer(getExecutionEnvironment().getConfig()),
stateDesc,
new InternalAggregateProcessAllWindowFunction<>(aggregateFunction, windowFunction),
trigger,
evictor,
allowedLateness,
lateDataOutputTag);
} else {
AggregatingStateDescriptor<T, ACC, V> stateDesc = new AggregatingStateDescriptor<>(
"window-contents",
aggregateFunction,
accumulatorType.createSerializer(getExecutionEnvironment().getConfig()));
opName = "TriggerWindow(" + windowAssigner + ", " + stateDesc + ", " + trigger + ", " + udfName + ")";
operator = new WindowOperator<>(
windowAssigner,
windowAssigner.getWindowSerializer(getExecutionEnvironment().getConfig()),
keySel,
input.getKeyType().createSerializer(getExecutionEnvironment().getConfig()),
stateDesc,
new InternalSingleValueProcessAllWindowFunction<>(windowFunction),
trigger,
allowedLateness,
lateDataOutputTag);
}
return input.transform(opName, resultType, operator).forceNonParallel();
} }
|
public class class_name {
@PublicEvolving
public <ACC, V, R> SingleOutputStreamOperator<R> aggregate(
AggregateFunction<T, ACC, V> aggregateFunction,
ProcessAllWindowFunction<V, R, W> windowFunction,
TypeInformation<ACC> accumulatorType,
TypeInformation<V> aggregateResultType,
TypeInformation<R> resultType) {
checkNotNull(aggregateFunction, "aggregateFunction");
checkNotNull(windowFunction, "windowFunction");
checkNotNull(accumulatorType, "accumulatorType");
checkNotNull(aggregateResultType, "aggregateResultType");
checkNotNull(resultType, "resultType");
if (aggregateFunction instanceof RichFunction) {
throw new UnsupportedOperationException("This aggregate function cannot be a RichFunction.");
}
//clean the closures
windowFunction = input.getExecutionEnvironment().clean(windowFunction);
aggregateFunction = input.getExecutionEnvironment().clean(aggregateFunction);
final String callLocation = Utils.getCallLocationName();
final String udfName = "AllWindowedStream." + callLocation;
final String opName;
final KeySelector<T, Byte> keySel = input.getKeySelector();
OneInputStreamOperator<T, R> operator;
if (evictor != null) {
@SuppressWarnings({"unchecked", "rawtypes"})
TypeSerializer<StreamRecord<T>> streamRecordSerializer =
(TypeSerializer<StreamRecord<T>>) new StreamElementSerializer(
input.getType().createSerializer(getExecutionEnvironment().getConfig()));
ListStateDescriptor<StreamRecord<T>> stateDesc =
new ListStateDescriptor<>("window-contents", streamRecordSerializer);
opName = "TriggerWindow(" + windowAssigner + ", " + stateDesc + ", " + trigger + ", " + evictor + ", " + udfName + ")";
operator = new EvictingWindowOperator<>(windowAssigner,
windowAssigner.getWindowSerializer(getExecutionEnvironment().getConfig()),
keySel,
input.getKeyType().createSerializer(getExecutionEnvironment().getConfig()),
stateDesc,
new InternalAggregateProcessAllWindowFunction<>(aggregateFunction, windowFunction),
trigger,
evictor,
allowedLateness,
lateDataOutputTag); // depends on control dependency: [if], data = [none]
} else {
AggregatingStateDescriptor<T, ACC, V> stateDesc = new AggregatingStateDescriptor<>(
"window-contents",
aggregateFunction,
accumulatorType.createSerializer(getExecutionEnvironment().getConfig()));
opName = "TriggerWindow(" + windowAssigner + ", " + stateDesc + ", " + trigger + ", " + udfName + ")";
operator = new WindowOperator<>(
windowAssigner,
windowAssigner.getWindowSerializer(getExecutionEnvironment().getConfig()),
keySel,
input.getKeyType().createSerializer(getExecutionEnvironment().getConfig()),
stateDesc,
new InternalSingleValueProcessAllWindowFunction<>(windowFunction),
trigger,
allowedLateness,
lateDataOutputTag); // depends on control dependency: [if], data = [none]
}
return input.transform(opName, resultType, operator).forceNonParallel();
} }
|
public class class_name {
public Properties getHeader() {
if (header == null) {
OnePidRecordListImpl logResult = getLogResult();
if (logResult != null) {
header = logResult.getHeader();
}
if (header == null) {
OnePidRecordListImpl traceResult = getTraceResult();
if (traceResult != null) {
header = traceResult.getHeader();
}
}
// If not real header anywhere get the parsed one
if (header == null && logResult != null) {
header = logResult.getParsedHeader();
}
if (header == null && traceResult != null) {
header = traceResult.getParsedHeader();
}
}
return header;
} }
|
public class class_name {
public Properties getHeader() {
if (header == null) {
OnePidRecordListImpl logResult = getLogResult();
if (logResult != null) {
header = logResult.getHeader(); // depends on control dependency: [if], data = [none]
}
if (header == null) {
OnePidRecordListImpl traceResult = getTraceResult();
if (traceResult != null) {
header = traceResult.getHeader(); // depends on control dependency: [if], data = [none]
}
}
// If not real header anywhere get the parsed one
if (header == null && logResult != null) {
header = logResult.getParsedHeader(); // depends on control dependency: [if], data = [none]
}
if (header == null && traceResult != null) {
header = traceResult.getParsedHeader(); // depends on control dependency: [if], data = [none]
}
}
return header;
} }
|
public class class_name {
@Override
public void deregister(Controllable controllable, ControllableType type)
throws NotRegisteredException, SIBExceptionInvalidValue {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deregister", new Object[] { controllable, type });
try {
if (type == ControllableType.QUEUE_POINT) {
ServiceRegistration<QueueMBean> qMBean = (ServiceRegistration<QueueMBean>) this.serviceObjects.get(controllable.getName());
qMBean.unregister();
} else if (type == ControllableType.PUBLICATION_POINT) {
ServiceRegistration<TopicMBean> topicMBean = (ServiceRegistration<TopicMBean>) this.serviceObjects.get(controllable.getName());
topicMBean.unregister();
} else if (type == ControllableType.SUBSCRIPTION_POINT) {
ServiceRegistration<SubscriberMBean> subMBean = (ServiceRegistration<SubscriberMBean>) this.serviceObjects.get(controllable.getName());
subMBean.unregister();
}
} catch (Exception e) {
SibTr.exception(tc, e);
}
deregister(controllable);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deregister");
return;
} }
|
public class class_name {
@Override
public void deregister(Controllable controllable, ControllableType type)
throws NotRegisteredException, SIBExceptionInvalidValue {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "deregister", new Object[] { controllable, type });
try {
if (type == ControllableType.QUEUE_POINT) {
ServiceRegistration<QueueMBean> qMBean = (ServiceRegistration<QueueMBean>) this.serviceObjects.get(controllable.getName());
qMBean.unregister(); // depends on control dependency: [if], data = [none]
} else if (type == ControllableType.PUBLICATION_POINT) {
ServiceRegistration<TopicMBean> topicMBean = (ServiceRegistration<TopicMBean>) this.serviceObjects.get(controllable.getName());
topicMBean.unregister(); // depends on control dependency: [if], data = [none]
} else if (type == ControllableType.SUBSCRIPTION_POINT) {
ServiceRegistration<SubscriberMBean> subMBean = (ServiceRegistration<SubscriberMBean>) this.serviceObjects.get(controllable.getName());
subMBean.unregister(); // depends on control dependency: [if], data = [none]
}
} catch (Exception e) {
SibTr.exception(tc, e);
} // depends on control dependency: [catch], data = [none]
deregister(controllable);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "deregister");
return;
} }
|
public class class_name {
public void setAsText(String text ) {
if ( text == null || text.equals("")) {
super.setValue( new ComponentID[0]);
} else {
java.util.ArrayList results = new java.util.ArrayList();
// the format for component ID is name vendor version.
java.util.StringTokenizer st = new java.util.StringTokenizer(text,CID_SEPARATOR,true);
ComponentIDPropertyEditor cidPropEditor = new ComponentIDPropertyEditor();
while (st.hasMoreTokens()) {
cidPropEditor.setAsText(st.nextToken());
if (st.hasMoreTokens()) {
st.nextToken();
}
results.add(cidPropEditor.getValue());
}
ComponentID[] cid = new ComponentID[results.size()];
results.toArray(cid);
this.setValue(cid);
}
} }
|
public class class_name {
public void setAsText(String text ) {
if ( text == null || text.equals("")) {
super.setValue( new ComponentID[0]);
// depends on control dependency: [if], data = [none]
} else {
java.util.ArrayList results = new java.util.ArrayList();
// the format for component ID is name vendor version.
java.util.StringTokenizer st = new java.util.StringTokenizer(text,CID_SEPARATOR,true);
ComponentIDPropertyEditor cidPropEditor = new ComponentIDPropertyEditor();
while (st.hasMoreTokens()) {
cidPropEditor.setAsText(st.nextToken());
// depends on control dependency: [while], data = [none]
if (st.hasMoreTokens()) {
st.nextToken();
// depends on control dependency: [if], data = [none]
}
results.add(cidPropEditor.getValue());
// depends on control dependency: [while], data = [none]
}
ComponentID[] cid = new ComponentID[results.size()];
results.toArray(cid);
// depends on control dependency: [if], data = [none]
this.setValue(cid);
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static Axis generateAxisFromCollection(List<Float> axisValues) {
List<AxisValue> values = new ArrayList<AxisValue>();
int index = 0;
for (float value : axisValues) {
AxisValue axisValue = new AxisValue(value);
values.add(axisValue);
++index;
}
Axis axis = new Axis(values);
return axis;
} }
|
public class class_name {
public static Axis generateAxisFromCollection(List<Float> axisValues) {
List<AxisValue> values = new ArrayList<AxisValue>();
int index = 0;
for (float value : axisValues) {
AxisValue axisValue = new AxisValue(value);
values.add(axisValue); // depends on control dependency: [for], data = [value]
++index; // depends on control dependency: [for], data = [none]
}
Axis axis = new Axis(values);
return axis;
} }
|
public class class_name {
@Override
public Object getValueAt(final int rowIndex, final int columnIndex) {
final T object = getObjectAt(rowIndex);
final String identifier = getIdentifier(columnIndex);
if (identifier == null || object == null) {
// cas particulier: si cette colonne n'a pas d'identifier, alors on suppose qu'il y a un renderer spécifique sur la colonne
// qui utilisera comme valeur l'objet correspondant à cette ligne dans le tableau
return object;
}
// la valeur affichée dans la cellule est le résultat de l'appel
// à la méthode "get" + Identifier sur l'objet
try {
// le getter pour un attribut commence par "get" ou "is" selon la convention de nommage
final String upperFirstIdentifier = Character.toUpperCase(identifier.charAt(0))
+ identifier.substring(1);
Method method;
try {
method = object.getClass().getDeclaredMethod("get" + upperFirstIdentifier,
(Class<?>[]) null);
} catch (final NoSuchMethodException e) {
try {
method = object.getClass().getDeclaredMethod("is" + upperFirstIdentifier,
(Class<?>[]) null);
} catch (final NoSuchMethodException e2) {
// si non trouvée non plus, alors l'exception lancée est e et non e2
throw e;
}
}
// la méthode n'est pas forcément public dans notre cas
method.setAccessible(true);
return method.invoke(object, (Object[]) null);
} catch (final Exception e) {
// s'il y a une erreur dans le getter, alors il ne faut surtout pas afficher de popup d'erreur
// car tous les affichages de cellules vont en permanence afficher des popups ce qui rendrait l'application bloquée,
// donc on se contente de logguer le message de l'exception dans un warning (sans trace de l'exception pour ne pas saturer le log non plus)
// et on affiche "??" dans la cellule
e.printStackTrace(System.err);
return "??";
}
} }
|
public class class_name {
@Override
public Object getValueAt(final int rowIndex, final int columnIndex) {
final T object = getObjectAt(rowIndex);
final String identifier = getIdentifier(columnIndex);
if (identifier == null || object == null) {
// cas particulier: si cette colonne n'a pas d'identifier, alors on suppose qu'il y a un renderer spécifique sur la colonne
// qui utilisera comme valeur l'objet correspondant à cette ligne dans le tableau
return object;
// depends on control dependency: [if], data = [none]
}
// la valeur affichée dans la cellule est le résultat de l'appel
// à la méthode "get" + Identifier sur l'objet
try {
// le getter pour un attribut commence par "get" ou "is" selon la convention de nommage
final String upperFirstIdentifier = Character.toUpperCase(identifier.charAt(0))
+ identifier.substring(1);
Method method;
try {
method = object.getClass().getDeclaredMethod("get" + upperFirstIdentifier,
(Class<?>[]) null);
// depends on control dependency: [try], data = [none]
} catch (final NoSuchMethodException e) {
try {
method = object.getClass().getDeclaredMethod("is" + upperFirstIdentifier,
(Class<?>[]) null);
// depends on control dependency: [try], data = [none]
} catch (final NoSuchMethodException e2) {
// si non trouvée non plus, alors l'exception lancée est e et non e2
throw e;
}
// depends on control dependency: [catch], data = [none]
}
// depends on control dependency: [catch], data = [none]
// la méthode n'est pas forcément public dans notre cas
method.setAccessible(true);
// depends on control dependency: [try], data = [none]
return method.invoke(object, (Object[]) null);
// depends on control dependency: [try], data = [none]
} catch (final Exception e) {
// s'il y a une erreur dans le getter, alors il ne faut surtout pas afficher de popup d'erreur
// car tous les affichages de cellules vont en permanence afficher des popups ce qui rendrait l'application bloquée,
// donc on se contente de logguer le message de l'exception dans un warning (sans trace de l'exception pour ne pas saturer le log non plus)
// et on affiche "??" dans la cellule
e.printStackTrace(System.err);
return "??";
}
// depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static ServerServiceDefinition intercept(ServerServiceDefinition serviceDef,
List<? extends ServerInterceptor> interceptors) {
Preconditions.checkNotNull(serviceDef, "serviceDef");
if (interceptors.isEmpty()) {
return serviceDef;
}
ServerServiceDefinition.Builder serviceDefBuilder
= ServerServiceDefinition.builder(serviceDef.getServiceDescriptor());
for (ServerMethodDefinition<?, ?> method : serviceDef.getMethods()) {
wrapAndAddMethod(serviceDefBuilder, method, interceptors);
}
return serviceDefBuilder.build();
} }
|
public class class_name {
public static ServerServiceDefinition intercept(ServerServiceDefinition serviceDef,
List<? extends ServerInterceptor> interceptors) {
Preconditions.checkNotNull(serviceDef, "serviceDef");
if (interceptors.isEmpty()) {
return serviceDef; // depends on control dependency: [if], data = [none]
}
ServerServiceDefinition.Builder serviceDefBuilder
= ServerServiceDefinition.builder(serviceDef.getServiceDescriptor());
for (ServerMethodDefinition<?, ?> method : serviceDef.getMethods()) {
wrapAndAddMethod(serviceDefBuilder, method, interceptors);
}
return serviceDefBuilder.build();
} }
|
public class class_name {
boolean scrollIfNecessary() {
if (mSelected == null) {
mDragScrollStartTimeInMs = Long.MIN_VALUE;
return false;
}
final long now = System.currentTimeMillis();
final long scrollDuration = mDragScrollStartTimeInMs
== Long.MIN_VALUE ? 0 : now - mDragScrollStartTimeInMs;
RecyclerView.LayoutManager lm = mRecyclerView.getLayoutManager();
if (mTmpRect == null) {
mTmpRect = new Rect();
}
int scrollX = 0;
int scrollY = 0;
lm.calculateItemDecorationsForChild(mSelected.itemView, mTmpRect);
if (lm.canScrollHorizontally()) {
int curX = (int) (mSelectedStartX + mDx);
final int leftDiff = curX - mTmpRect.left - mRecyclerView.getPaddingLeft();
if (mDx < 0 && leftDiff < 0) {
scrollX = leftDiff;
} else if (mDx > 0) {
final int rightDiff =
curX + mSelected.itemView.getWidth() + mTmpRect.right
- (mRecyclerView.getWidth() - mRecyclerView.getPaddingRight());
if (rightDiff > 0) {
scrollX = rightDiff;
}
}
}
if (lm.canScrollVertically()) {
int curY = (int) (mSelectedStartY + mDy);
final int topDiff = curY - mTmpRect.top - mRecyclerView.getPaddingTop();
if (mDy < 0 && topDiff < 0) {
scrollY = topDiff;
} else if (mDy > 0) {
final int bottomDiff = curY + mSelected.itemView.getHeight() + mTmpRect.bottom
- (mRecyclerView.getHeight() - mRecyclerView.getPaddingBottom());
if (bottomDiff > 0) {
scrollY = bottomDiff;
}
}
}
if (scrollX != 0) {
scrollX = mCallback.interpolateOutOfBoundsScroll(mRecyclerView,
mSelected.itemView.getWidth(), scrollX,
mRecyclerView.getWidth(), scrollDuration);
}
if (scrollY != 0) {
scrollY = mCallback.interpolateOutOfBoundsScroll(mRecyclerView,
mSelected.itemView.getHeight(), scrollY,
mRecyclerView.getHeight(), scrollDuration);
}
if (scrollX != 0 || scrollY != 0) {
if (mDragScrollStartTimeInMs == Long.MIN_VALUE) {
mDragScrollStartTimeInMs = now;
}
mRecyclerView.scrollBy(scrollX, scrollY);
return true;
}
mDragScrollStartTimeInMs = Long.MIN_VALUE;
return false;
} }
|
public class class_name {
boolean scrollIfNecessary() {
if (mSelected == null) {
mDragScrollStartTimeInMs = Long.MIN_VALUE; // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
final long now = System.currentTimeMillis();
final long scrollDuration = mDragScrollStartTimeInMs
== Long.MIN_VALUE ? 0 : now - mDragScrollStartTimeInMs;
RecyclerView.LayoutManager lm = mRecyclerView.getLayoutManager();
if (mTmpRect == null) {
mTmpRect = new Rect(); // depends on control dependency: [if], data = [none]
}
int scrollX = 0;
int scrollY = 0;
lm.calculateItemDecorationsForChild(mSelected.itemView, mTmpRect);
if (lm.canScrollHorizontally()) {
int curX = (int) (mSelectedStartX + mDx);
final int leftDiff = curX - mTmpRect.left - mRecyclerView.getPaddingLeft();
if (mDx < 0 && leftDiff < 0) {
scrollX = leftDiff; // depends on control dependency: [if], data = [none]
} else if (mDx > 0) {
final int rightDiff =
curX + mSelected.itemView.getWidth() + mTmpRect.right
- (mRecyclerView.getWidth() - mRecyclerView.getPaddingRight());
if (rightDiff > 0) {
scrollX = rightDiff; // depends on control dependency: [if], data = [none]
}
}
}
if (lm.canScrollVertically()) {
int curY = (int) (mSelectedStartY + mDy);
final int topDiff = curY - mTmpRect.top - mRecyclerView.getPaddingTop();
if (mDy < 0 && topDiff < 0) {
scrollY = topDiff; // depends on control dependency: [if], data = [none]
} else if (mDy > 0) {
final int bottomDiff = curY + mSelected.itemView.getHeight() + mTmpRect.bottom
- (mRecyclerView.getHeight() - mRecyclerView.getPaddingBottom());
if (bottomDiff > 0) {
scrollY = bottomDiff; // depends on control dependency: [if], data = [none]
}
}
}
if (scrollX != 0) {
scrollX = mCallback.interpolateOutOfBoundsScroll(mRecyclerView,
mSelected.itemView.getWidth(), scrollX,
mRecyclerView.getWidth(), scrollDuration); // depends on control dependency: [if], data = [none]
}
if (scrollY != 0) {
scrollY = mCallback.interpolateOutOfBoundsScroll(mRecyclerView,
mSelected.itemView.getHeight(), scrollY,
mRecyclerView.getHeight(), scrollDuration); // depends on control dependency: [if], data = [none]
}
if (scrollX != 0 || scrollY != 0) {
if (mDragScrollStartTimeInMs == Long.MIN_VALUE) {
mDragScrollStartTimeInMs = now; // depends on control dependency: [if], data = [none]
}
mRecyclerView.scrollBy(scrollX, scrollY); // depends on control dependency: [if], data = [(scrollX]
return true; // depends on control dependency: [if], data = [none]
}
mDragScrollStartTimeInMs = Long.MIN_VALUE;
return false;
} }
|
public class class_name {
@Override
public void close() {
namedParamSqlCache.clear();
namedParamIndexPropCache.clear();
clearStatementCache();
if (useConnection != null) {
try {
useConnection.close();
} catch (SQLException e) {
LOG.finest("Caught exception closing connection: " + e.getMessage());
}
}
} }
|
public class class_name {
@Override
public void close() {
namedParamSqlCache.clear();
namedParamIndexPropCache.clear();
clearStatementCache();
if (useConnection != null) {
try {
useConnection.close(); // depends on control dependency: [try], data = [none]
} catch (SQLException e) {
LOG.finest("Caught exception closing connection: " + e.getMessage());
} // depends on control dependency: [catch], data = [none]
}
} }
|
public class class_name {
protected void resolveColumnDbSqlType(final Connection connection, final DbEntityColumnDescriptor dec) {
if (dec.dbSqlType != SqlType.DB_SQLTYPE_UNKNOWN) {
return;
}
ResultSet rs = null;
DbEntityDescriptor ded = dec.getDbEntityDescriptor();
try {
DatabaseMetaData dmd = connection.getMetaData();
rs = dmd.getColumns(null, ded.getSchemaName(), ded.getTableName(), dec.getColumnName());
if (rs.next()) {
dec.dbSqlType = rs.getInt("DATA_TYPE");
} else {
dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
if (log.isWarnEnabled()) {
log.warn("Column SQL type not available: " + ded.toString() + '.' + dec.getColumnName());
}
}
} catch (SQLException sex) {
dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
if (log.isWarnEnabled()) {
log.warn("Column SQL type not resolved: " + ded.toString() + '.' + dec.getColumnName(), sex);
}
} finally {
DbUtil.close(rs);
}
} }
|
public class class_name {
protected void resolveColumnDbSqlType(final Connection connection, final DbEntityColumnDescriptor dec) {
if (dec.dbSqlType != SqlType.DB_SQLTYPE_UNKNOWN) {
return; // depends on control dependency: [if], data = [none]
}
ResultSet rs = null;
DbEntityDescriptor ded = dec.getDbEntityDescriptor();
try {
DatabaseMetaData dmd = connection.getMetaData();
rs = dmd.getColumns(null, ded.getSchemaName(), ded.getTableName(), dec.getColumnName()); // depends on control dependency: [try], data = [none]
if (rs.next()) {
dec.dbSqlType = rs.getInt("DATA_TYPE"); // depends on control dependency: [if], data = [none]
} else {
dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE; // depends on control dependency: [if], data = [none]
if (log.isWarnEnabled()) {
log.warn("Column SQL type not available: " + ded.toString() + '.' + dec.getColumnName()); // depends on control dependency: [if], data = [none]
}
}
} catch (SQLException sex) {
dec.dbSqlType = SqlType.DB_SQLTYPE_NOT_AVAILABLE;
if (log.isWarnEnabled()) {
log.warn("Column SQL type not resolved: " + ded.toString() + '.' + dec.getColumnName(), sex); // depends on control dependency: [if], data = [none]
}
} finally { // depends on control dependency: [catch], data = [none]
DbUtil.close(rs);
}
} }
|
public class class_name {
public static String stripTrailingSlash(String string) {
if (string == null) {
return null;
}
if (string.startsWith("/")) {
string = string.substring(1, string.length());
}
return string;
} }
|
public class class_name {
public static String stripTrailingSlash(String string) {
if (string == null) {
return null; // depends on control dependency: [if], data = [none]
}
if (string.startsWith("/")) {
string = string.substring(1, string.length()); // depends on control dependency: [if], data = [none]
}
return string;
} }
|
public class class_name {
public Iterator<Operator<Term>> traverse(Predicate predicate, boolean reverse)
{
/*log.fine("Traversing predicate " + predicate.toString());*/
Clause[] body = predicate.getBody();
Queue<Operator<Term>> queue = (!reverse) ? new StackQueue<Operator<Term>>() : new LinkedList<Operator<Term>>();
// For the predicate bodies.
if (body != null)
{
for (int i = leftToRightPredicateBodies ? 0 : (body.length - 1);
leftToRightPredicateBodies ? (i < body.length) : (i >= 0);
i = i + (leftToRightPredicateBodies ? 1 : -1))
{
Clause bodyClause = body[i];
bodyClause.setReversable(createClauseOperator(bodyClause, i, body, predicate));
bodyClause.setTermTraverser(this);
queue.offer(bodyClause);
}
}
return queue.iterator();
} }
|
public class class_name {
public Iterator<Operator<Term>> traverse(Predicate predicate, boolean reverse)
{
/*log.fine("Traversing predicate " + predicate.toString());*/
Clause[] body = predicate.getBody();
Queue<Operator<Term>> queue = (!reverse) ? new StackQueue<Operator<Term>>() : new LinkedList<Operator<Term>>();
// For the predicate bodies.
if (body != null)
{
for (int i = leftToRightPredicateBodies ? 0 : (body.length - 1);
leftToRightPredicateBodies ? (i < body.length) : (i >= 0);
i = i + (leftToRightPredicateBodies ? 1 : -1))
{
Clause bodyClause = body[i];
bodyClause.setReversable(createClauseOperator(bodyClause, i, body, predicate)); // depends on control dependency: [for], data = [i]
bodyClause.setTermTraverser(this); // depends on control dependency: [for], data = [none]
queue.offer(bodyClause); // depends on control dependency: [for], data = [none]
}
}
return queue.iterator();
} }
|
public class class_name {
public MarkdownDocStream append(CharSequence p, int start, int end) {
for(int pos = start; pos < end; ++pos) {
final char c = p.charAt(pos);
if(c == '\r') {
continue;
}
append(c); // Uses \n magic.
}
return this;
} }
|
public class class_name {
public MarkdownDocStream append(CharSequence p, int start, int end) {
for(int pos = start; pos < end; ++pos) {
final char c = p.charAt(pos);
if(c == '\r') {
continue;
}
append(c); // Uses \n magic. // depends on control dependency: [for], data = [none]
}
return this;
} }
|
public class class_name {
protected void addReturnType(ExecutableElement method, Content htmltree) {
TypeMirror type = utils.getReturnType(method);
if (type != null) {
Content linkContent = writer.getLink(
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type));
htmltree.addContent(linkContent);
htmltree.addContent(Contents.SPACE);
}
} }
|
public class class_name {
protected void addReturnType(ExecutableElement method, Content htmltree) {
TypeMirror type = utils.getReturnType(method);
if (type != null) {
Content linkContent = writer.getLink(
new LinkInfoImpl(configuration, LinkInfoImpl.Kind.RETURN_TYPE, type));
htmltree.addContent(linkContent); // depends on control dependency: [if], data = [none]
htmltree.addContent(Contents.SPACE); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public Observable<ServiceResponse<Void>> deleteIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
}
if (iterationId == null) {
throw new IllegalArgumentException("Parameter iterationId is required and cannot be null.");
}
if (this.client.apiKey() == null) {
throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null.");
}
return service.deleteIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = deleteIterationDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<Void>> deleteIterationWithServiceResponseAsync(UUID projectId, UUID iterationId) {
if (projectId == null) {
throw new IllegalArgumentException("Parameter projectId is required and cannot be null.");
}
if (iterationId == null) {
throw new IllegalArgumentException("Parameter iterationId is required and cannot be null.");
}
if (this.client.apiKey() == null) {
throw new IllegalArgumentException("Parameter this.client.apiKey() is required and cannot be null.");
}
return service.deleteIteration(projectId, iterationId, this.client.apiKey(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = deleteIterationDelegate(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 {
@Override
public void write(byte []buffer, int offset, int length)
{
if (isClosed() || isHead()) {
return;
}
int byteLength = _offset;
while (true) {
int sublen = Math.min(length, SIZE - byteLength);
System.arraycopy(buffer, offset, _buffer, byteLength, sublen);
offset += sublen;
length -= sublen;
byteLength += sublen;
if (length <= 0) {
break;
}
_offset = byteLength;
flushByteBuffer();
byteLength = _offset;
}
_offset = byteLength;
} }
|
public class class_name {
@Override
public void write(byte []buffer, int offset, int length)
{
if (isClosed() || isHead()) {
return; // depends on control dependency: [if], data = [none]
}
int byteLength = _offset;
while (true) {
int sublen = Math.min(length, SIZE - byteLength);
System.arraycopy(buffer, offset, _buffer, byteLength, sublen); // depends on control dependency: [while], data = [none]
offset += sublen; // depends on control dependency: [while], data = [none]
length -= sublen; // depends on control dependency: [while], data = [none]
byteLength += sublen; // depends on control dependency: [while], data = [none]
if (length <= 0) {
break;
}
_offset = byteLength; // depends on control dependency: [while], data = [none]
flushByteBuffer(); // depends on control dependency: [while], data = [none]
byteLength = _offset; // depends on control dependency: [while], data = [none]
}
_offset = byteLength;
} }
|
public class class_name {
public void setPolicyToPathList(java.util.Collection<PolicyToPath> policyToPathList) {
if (policyToPathList == null) {
this.policyToPathList = null;
return;
}
this.policyToPathList = new java.util.ArrayList<PolicyToPath>(policyToPathList);
} }
|
public class class_name {
public void setPolicyToPathList(java.util.Collection<PolicyToPath> policyToPathList) {
if (policyToPathList == null) {
this.policyToPathList = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.policyToPathList = new java.util.ArrayList<PolicyToPath>(policyToPathList);
} }
|
public class class_name {
public void marshall(CreateCodeRepositoryRequest createCodeRepositoryRequest, ProtocolMarshaller protocolMarshaller) {
if (createCodeRepositoryRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createCodeRepositoryRequest.getCodeRepositoryName(), CODEREPOSITORYNAME_BINDING);
protocolMarshaller.marshall(createCodeRepositoryRequest.getGitConfig(), GITCONFIG_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(CreateCodeRepositoryRequest createCodeRepositoryRequest, ProtocolMarshaller protocolMarshaller) {
if (createCodeRepositoryRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(createCodeRepositoryRequest.getCodeRepositoryName(), CODEREPOSITORYNAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(createCodeRepositoryRequest.getGitConfig(), GITCONFIG_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void delete() {
Buffer buffer = this.buffer instanceof SlicedBuffer ? ((SlicedBuffer) this.buffer).root() : this.buffer;
if (buffer instanceof FileBuffer) {
((FileBuffer) buffer).delete();
} else if (buffer instanceof MappedBuffer) {
((MappedBuffer) buffer).delete();
}
offsetIndex.delete();
} }
|
public class class_name {
public void delete() {
Buffer buffer = this.buffer instanceof SlicedBuffer ? ((SlicedBuffer) this.buffer).root() : this.buffer;
if (buffer instanceof FileBuffer) {
((FileBuffer) buffer).delete(); // depends on control dependency: [if], data = [none]
} else if (buffer instanceof MappedBuffer) {
((MappedBuffer) buffer).delete(); // depends on control dependency: [if], data = [none]
}
offsetIndex.delete();
} }
|
public class class_name {
public static Matrix identity(final int N)
{
final Matrix I = new Matrix(N, N);
for (int i = 0; i < N; i++)
{
I.m_data[i][i] = 1;
}
return I;
} }
|
public class class_name {
public static Matrix identity(final int N)
{
final Matrix I = new Matrix(N, N);
for (int i = 0; i < N; i++)
{
I.m_data[i][i] = 1;
// depends on control dependency: [for], data = [i]
}
return I;
} }
|
public class class_name {
@Override
public String getHeader(final String header) {
if (isExcluded(header)) {
return null;
}
return super.getHeader(header);
} }
|
public class class_name {
@Override
public String getHeader(final String header) {
if (isExcluded(header)) {
return null; // depends on control dependency: [if], data = [none]
}
return super.getHeader(header);
} }
|
public class class_name {
public void marshall(DescribeEnvironmentsRequest describeEnvironmentsRequest, ProtocolMarshaller protocolMarshaller) {
if (describeEnvironmentsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeEnvironmentsRequest.getEnvironmentIds(), ENVIRONMENTIDS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(DescribeEnvironmentsRequest describeEnvironmentsRequest, ProtocolMarshaller protocolMarshaller) {
if (describeEnvironmentsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeEnvironmentsRequest.getEnvironmentIds(), ENVIRONMENTIDS_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 {
static void addHandlerBeforeReactorEndHandlers(Connection context, String
name, ChannelHandler handler) {
Objects.requireNonNull(name, "name");
Objects.requireNonNull(handler, "handler");
Channel channel = context.channel();
boolean exists = channel.pipeline().get(name) != null;
if (exists) {
if (log.isDebugEnabled()) {
log.debug(format(channel, "Handler [{}] already exists in the pipeline, decoder has been skipped"),
name);
}
return;
}
//we need to find the correct position
String before = null;
for (String s : channel.pipeline().names()) {
if (s.startsWith(NettyPipeline.RIGHT)) {
before = s;
break;
}
}
if (before == null) {
channel.pipeline().addLast(name, handler);
}
else {
channel.pipeline().addBefore(NettyPipeline.ReactiveBridge, name, handler);
}
registerForClose(context.isPersistent(), name, context);
if (log.isDebugEnabled()) {
log.debug(format(channel, "Added decoder [{}] at the end of the user pipeline, full pipeline: {}"),
name,
channel.pipeline().names());
}
} }
|
public class class_name {
static void addHandlerBeforeReactorEndHandlers(Connection context, String
name, ChannelHandler handler) {
Objects.requireNonNull(name, "name");
Objects.requireNonNull(handler, "handler");
Channel channel = context.channel();
boolean exists = channel.pipeline().get(name) != null;
if (exists) {
if (log.isDebugEnabled()) {
log.debug(format(channel, "Handler [{}] already exists in the pipeline, decoder has been skipped"),
name); // depends on control dependency: [if], data = [none]
}
return; // depends on control dependency: [if], data = [none]
}
//we need to find the correct position
String before = null;
for (String s : channel.pipeline().names()) {
if (s.startsWith(NettyPipeline.RIGHT)) {
before = s; // depends on control dependency: [if], data = [none]
break;
}
}
if (before == null) {
channel.pipeline().addLast(name, handler); // depends on control dependency: [if], data = [none]
}
else {
channel.pipeline().addBefore(NettyPipeline.ReactiveBridge, name, handler); // depends on control dependency: [if], data = [none]
}
registerForClose(context.isPersistent(), name, context);
if (log.isDebugEnabled()) {
log.debug(format(channel, "Added decoder [{}] at the end of the user pipeline, full pipeline: {}"),
name,
channel.pipeline().names()); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void addChain(String httpMethod, ActionChain chain) {
if (Strings.isBlank(httpMethod))
throw Lang.makeThrow("chain need a valid HTTP Method, but is is '%s'", httpMethod);
ActionChain old = chainMap.put(httpMethod.toUpperCase(), chain);
if (old != null) {
log.warnf("Duplicate @At mapping with same HttpMethod");
}
} }
|
public class class_name {
public void addChain(String httpMethod, ActionChain chain) {
if (Strings.isBlank(httpMethod))
throw Lang.makeThrow("chain need a valid HTTP Method, but is is '%s'", httpMethod);
ActionChain old = chainMap.put(httpMethod.toUpperCase(), chain);
if (old != null) {
log.warnf("Duplicate @At mapping with same HttpMethod"); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void ensureCapacity(int minCapacity) {
int minExpand = (elementData != DEFAULTCAPACITY_EMPTY_ELEMENTDATA)
// any size if not default element table
? 0
// larger than default for default empty table. It's already
// supposed to be at default size.
: DEFAULT_CAPACITY;
if (minCapacity > minExpand) {
ensureExplicitCapacity(minCapacity);
}
} }
|
public class class_name {
public void ensureCapacity(int minCapacity) {
int minExpand = (elementData != DEFAULTCAPACITY_EMPTY_ELEMENTDATA)
// any size if not default element table
? 0
// larger than default for default empty table. It's already
// supposed to be at default size.
: DEFAULT_CAPACITY;
if (minCapacity > minExpand) {
ensureExplicitCapacity(minCapacity); // depends on control dependency: [if], data = [(minCapacity]
}
} }
|
public class class_name {
private void registerMethods() {
// register routes for all the methods
for (Method method : methods) {
final Class<?> controllerClass = method.getDeclaringClass();
final Path methodPath = method.getAnnotation(Path.class);
final Set<String> controllerPaths = controllers
.get(controllerClass);
String[] paths = {"/"};
if (methodPath != null) {
paths = methodPath.value();
}
for (String controllerPath : controllerPaths) {
for (String methodPathSpec : paths) {
final String httpMethod = getHttpMethod(method);
final String fullPath = controllerPath + methodPathSpec;
final String methodName = method.getName();
router.METHOD(httpMethod).route(fullPath)
.with(controllerClass, methodName);
}
}
}
} }
|
public class class_name {
private void registerMethods() {
// register routes for all the methods
for (Method method : methods) {
final Class<?> controllerClass = method.getDeclaringClass();
final Path methodPath = method.getAnnotation(Path.class);
final Set<String> controllerPaths = controllers
.get(controllerClass);
String[] paths = {"/"};
if (methodPath != null) {
paths = methodPath.value(); // depends on control dependency: [if], data = [none]
}
for (String controllerPath : controllerPaths) {
for (String methodPathSpec : paths) {
final String httpMethod = getHttpMethod(method);
final String fullPath = controllerPath + methodPathSpec;
final String methodName = method.getName();
router.METHOD(httpMethod).route(fullPath)
.with(controllerClass, methodName); // depends on control dependency: [for], data = [none]
}
}
}
} }
|
public class class_name {
private void updateRecentMenu() {
menu.removeAllMenuItems();
int index = 1;
boolean first = true;
for (Iterator<ExampleData> i = recent.iterator(); i.hasNext();) {
ExampleData data = i.next();
try {
StringBuilder builder = new StringBuilder(Integer.toString(index++)).append(". ");
if (data.getExampleGroupName() != null) {
builder.append(data.getExampleGroupName()).append(" - ");
}
builder.append(data.getExampleName());
addRecentExample(builder.toString(), data, first);
first = false;
} catch (Exception e) {
i.remove();
LogFactory.getLog(getClass()).error("Unable to read recent class: " + data.getExampleName());
}
}
} }
|
public class class_name {
private void updateRecentMenu() {
menu.removeAllMenuItems();
int index = 1;
boolean first = true;
for (Iterator<ExampleData> i = recent.iterator(); i.hasNext();) {
ExampleData data = i.next();
try {
StringBuilder builder = new StringBuilder(Integer.toString(index++)).append(". ");
if (data.getExampleGroupName() != null) {
builder.append(data.getExampleGroupName()).append(" - "); // depends on control dependency: [if], data = [(data.getExampleGroupName()]
}
builder.append(data.getExampleName()); // depends on control dependency: [try], data = [none]
addRecentExample(builder.toString(), data, first); // depends on control dependency: [try], data = [none]
first = false; // depends on control dependency: [try], data = [none]
} catch (Exception e) {
i.remove();
LogFactory.getLog(getClass()).error("Unable to read recent class: " + data.getExampleName());
} // depends on control dependency: [catch], data = [none]
}
} }
|
public class class_name {
public boolean removeAll(AbstractBooleanList other) {
// overridden for performance only.
if (! (other instanceof BooleanArrayList)) return super.removeAll(other);
/* There are two possibilities to do the thing
a) use other.indexOf(...)
b) sort other, then use other.binarySearch(...)
Let's try to figure out which one is faster. Let M=size, N=other.size, then
a) takes O(M*N) steps
b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
*/
if (other.size()==0) {return false;} //nothing to do
int limit = other.size()-1;
int j=0;
boolean[] theElements = elements;
int mySize = size();
double N=(double) other.size();
double M=(double) mySize;
if ( (N+M)*cern.colt.Math.log2(N) < M*N ) {
// it is faster to sort other before searching in it
BooleanArrayList sortedList = (BooleanArrayList) other.clone();
sortedList.quickSort();
for (int i=0; i<mySize ; i++) {
if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
}
}
else {
// it is faster to search in other without sorting
for (int i=0; i<mySize ; i++) {
if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
}
}
boolean modified = (j!=mySize);
setSize(j);
return modified;
} }
|
public class class_name {
public boolean removeAll(AbstractBooleanList other) {
// overridden for performance only.
if (! (other instanceof BooleanArrayList)) return super.removeAll(other);
/* There are two possibilities to do the thing
a) use other.indexOf(...)
b) sort other, then use other.binarySearch(...)
Let's try to figure out which one is faster. Let M=size, N=other.size, then
a) takes O(M*N) steps
b) takes O(N*logN + M*logN) steps (sorting is O(N*logN) and binarySearch is O(logN))
Hence, if N*logN + M*logN < M*N, we use b) otherwise we use a).
*/
if (other.size()==0) {return false;} //nothing to do
// depends on control dependency: [if], data = [none]
int limit = other.size()-1;
int j=0;
boolean[] theElements = elements;
int mySize = size();
double N=(double) other.size();
double M=(double) mySize;
if ( (N+M)*cern.colt.Math.log2(N) < M*N ) {
// it is faster to sort other before searching in it
BooleanArrayList sortedList = (BooleanArrayList) other.clone();
sortedList.quickSort();
// depends on control dependency: [if], data = [none]
for (int i=0; i<mySize ; i++) {
if (sortedList.binarySearchFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
}
}
else {
// it is faster to search in other without sorting
for (int i=0; i<mySize ; i++) {
if (other.indexOfFromTo(theElements[i], 0, limit) < 0) theElements[j++]=theElements[i];
}
}
boolean modified = (j!=mySize);
setSize(j);
return modified;
} }
|
public class class_name {
public SwitchYardServiceResponse invoke(SwitchYardServiceRequest request) {
Map<String, Object> contextOut = new HashMap<String, Object>();
Object contentOut = null;
Object fault = null;
try {
QName serviceName = request.getServiceName();
if (serviceName == null) {
throw CommonKnowledgeMessages.MESSAGES.serviceNameNull();
} else if (Strings.trimToNull(serviceName.getNamespaceURI()) == null) {
String tns = getTargetNamespace();
if (tns != null) {
serviceName = XMLHelper.createQName(tns, serviceName.getLocalPart());
}
}
ServiceDomain serviceDomain = getServiceDomain();
if (serviceDomain == null) {
throw CommonKnowledgeMessages.MESSAGES.serviceDomainNull();
}
ServiceReference serviceReference = serviceDomain.getServiceReference(serviceName);
if (serviceReference == null) {
throw CommonKnowledgeMessages.MESSAGES.serviceReferenceNull(serviceName.toString());
}
final Exchange exchangeIn;
FaultHandler handler = new FaultHandler();
String operationName = request.getOperationName();
if (operationName != null) {
exchangeIn = serviceReference.createExchange(operationName, handler);
} else {
exchangeIn = serviceReference.createExchange(handler);
}
Message messageIn = exchangeIn.createMessage();
Context contextIn = exchangeIn.getContext(messageIn);
for (Map.Entry<String, Object> entry : request.getContext().entrySet()) {
contextIn.setProperty(entry.getKey(), entry.getValue());
}
Object contentIn = request.getContent();
if (contentIn != null) {
messageIn.setContent(contentIn);
}
exchangeIn.send(messageIn);
if (ExchangePattern.IN_OUT.equals(exchangeIn.getContract().getConsumerOperation().getExchangePattern())) {
Exchange exchangeOut = handler.waitForOut();
Message messageOut = exchangeOut.getMessage();
contentOut = messageOut.getContent();
for (Property property : exchangeOut.getContext(messageOut).getProperties()) {
contextOut.put(property.getName(), property.getValue());
}
}
fault = handler.getFault();
} catch (Throwable t) {
fault = t;
}
return new SwitchYardServiceResponse(contentOut, contextOut, fault);
} }
|
public class class_name {
public SwitchYardServiceResponse invoke(SwitchYardServiceRequest request) {
Map<String, Object> contextOut = new HashMap<String, Object>();
Object contentOut = null;
Object fault = null;
try {
QName serviceName = request.getServiceName();
if (serviceName == null) {
throw CommonKnowledgeMessages.MESSAGES.serviceNameNull();
} else if (Strings.trimToNull(serviceName.getNamespaceURI()) == null) {
String tns = getTargetNamespace();
if (tns != null) {
serviceName = XMLHelper.createQName(tns, serviceName.getLocalPart()); // depends on control dependency: [if], data = [(tns]
}
}
ServiceDomain serviceDomain = getServiceDomain();
if (serviceDomain == null) {
throw CommonKnowledgeMessages.MESSAGES.serviceDomainNull();
}
ServiceReference serviceReference = serviceDomain.getServiceReference(serviceName);
if (serviceReference == null) {
throw CommonKnowledgeMessages.MESSAGES.serviceReferenceNull(serviceName.toString());
}
final Exchange exchangeIn;
FaultHandler handler = new FaultHandler();
String operationName = request.getOperationName();
if (operationName != null) {
exchangeIn = serviceReference.createExchange(operationName, handler); // depends on control dependency: [if], data = [(operationName]
} else {
exchangeIn = serviceReference.createExchange(handler); // depends on control dependency: [if], data = [none]
}
Message messageIn = exchangeIn.createMessage();
Context contextIn = exchangeIn.getContext(messageIn);
for (Map.Entry<String, Object> entry : request.getContext().entrySet()) {
contextIn.setProperty(entry.getKey(), entry.getValue()); // depends on control dependency: [for], data = [entry]
}
Object contentIn = request.getContent();
if (contentIn != null) {
messageIn.setContent(contentIn); // depends on control dependency: [if], data = [(contentIn]
}
exchangeIn.send(messageIn); // depends on control dependency: [try], data = [none]
if (ExchangePattern.IN_OUT.equals(exchangeIn.getContract().getConsumerOperation().getExchangePattern())) {
Exchange exchangeOut = handler.waitForOut();
Message messageOut = exchangeOut.getMessage();
contentOut = messageOut.getContent(); // depends on control dependency: [if], data = [none]
for (Property property : exchangeOut.getContext(messageOut).getProperties()) {
contextOut.put(property.getName(), property.getValue()); // depends on control dependency: [for], data = [property]
}
}
fault = handler.getFault(); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
fault = t;
} // depends on control dependency: [catch], data = [none]
return new SwitchYardServiceResponse(contentOut, contextOut, fault);
} }
|
public class class_name {
public static String cleanupVersion(String version) {
StringBuilder result = new StringBuilder();
Matcher m = FUZZY_VERSION.matcher(version);
if (m.matches()) {
String major = m.group(1);
String minor = m.group(3);
String micro = m.group(5);
String qualifier = m.group(7);
if (major != null) {
result.append(major);
if (minor != null) {
result.append(".");
result.append(minor);
if (micro != null) {
result.append(".");
result.append(micro);
if (qualifier != null) {
result.append(".");
cleanupModifier(result, qualifier);
}
} else if (qualifier != null) {
result.append(".0.");
cleanupModifier(result, qualifier);
} else {
result.append(".0");
}
} else if (qualifier != null) {
result.append(".0.0.");
cleanupModifier(result, qualifier);
} else {
result.append(".0.0");
}
}
} else {
result.append("0.0.0.");
cleanupModifier(result, version);
}
return result.toString();
} }
|
public class class_name {
public static String cleanupVersion(String version) {
StringBuilder result = new StringBuilder();
Matcher m = FUZZY_VERSION.matcher(version);
if (m.matches()) {
String major = m.group(1);
String minor = m.group(3);
String micro = m.group(5);
String qualifier = m.group(7);
if (major != null) {
result.append(major); // depends on control dependency: [if], data = [(major]
if (minor != null) {
result.append("."); // depends on control dependency: [if], data = [none]
result.append(minor); // depends on control dependency: [if], data = [(minor]
if (micro != null) {
result.append("."); // depends on control dependency: [if], data = [none]
result.append(micro); // depends on control dependency: [if], data = [(micro]
if (qualifier != null) {
result.append("."); // depends on control dependency: [if], data = [none]
cleanupModifier(result, qualifier); // depends on control dependency: [if], data = [none]
}
} else if (qualifier != null) {
result.append(".0."); // depends on control dependency: [if], data = [none]
cleanupModifier(result, qualifier); // depends on control dependency: [if], data = [none]
} else {
result.append(".0"); // depends on control dependency: [if], data = [none]
}
} else if (qualifier != null) {
result.append(".0.0."); // depends on control dependency: [if], data = [none]
cleanupModifier(result, qualifier); // depends on control dependency: [if], data = [none]
} else {
result.append(".0.0"); // depends on control dependency: [if], data = [none]
}
}
} else {
result.append("0.0.0."); // depends on control dependency: [if], data = [none]
cleanupModifier(result, version); // depends on control dependency: [if], data = [none]
}
return result.toString();
} }
|
public class class_name {
public final String getSubmittedFileName(
final Part pPart) throws Exception {
for (String cd : pPart.getHeader("content-disposition").split(";")) {
if (cd.trim().startsWith("filename")) {
String fileName = cd.substring(cd.indexOf('=') + 1)
.trim().replace("\"", "");
return fileName.substring(fileName.lastIndexOf('/') + 1)
.substring(fileName.lastIndexOf('\\') + 1); // MSIE fix.
}
}
throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
"Can't retrieve file name");
} }
|
public class class_name {
public final String getSubmittedFileName(
final Part pPart) throws Exception {
for (String cd : pPart.getHeader("content-disposition").split(";")) {
if (cd.trim().startsWith("filename")) {
String fileName = cd.substring(cd.indexOf('=') + 1)
.trim().replace("\"", "");
return fileName.substring(fileName.lastIndexOf('/') + 1)
.substring(fileName.lastIndexOf('\\') + 1); // MSIE fix. // depends on control dependency: [if], data = [none]
}
}
throw new ExceptionWithCode(ExceptionWithCode.SOMETHING_WRONG,
"Can't retrieve file name");
} }
|
public class class_name {
public static void stop(String name) {
Long start = PENDING.remove(name);
if (start == null) {
return;
}
long duration = System.currentTimeMillis() - start;
Counter sum = CUMULATED.computeIfAbsent(name, k -> new Counter(k, "ms"));
sum.increment(duration);
} }
|
public class class_name {
public static void stop(String name) {
Long start = PENDING.remove(name);
if (start == null) {
return; // depends on control dependency: [if], data = [none]
}
long duration = System.currentTimeMillis() - start;
Counter sum = CUMULATED.computeIfAbsent(name, k -> new Counter(k, "ms"));
sum.increment(duration);
} }
|
public class class_name {
public ClassRef toReference(TypeRef... arguments) {
List<TypeRef> actualArguments = new ArrayList<TypeRef>();
for (int i = 0; i < parameters.size(); i++) {
if (i < arguments.length) {
actualArguments.add(arguments[i]);
} else {
actualArguments.add(new WildcardRef());
}
}
return new ClassRefBuilder()
.withDefinition(this)
.withArguments(actualArguments)
.withAttributes(getAttributes())
.build();
} }
|
public class class_name {
public ClassRef toReference(TypeRef... arguments) {
List<TypeRef> actualArguments = new ArrayList<TypeRef>();
for (int i = 0; i < parameters.size(); i++) {
if (i < arguments.length) {
actualArguments.add(arguments[i]); // depends on control dependency: [if], data = [none]
} else {
actualArguments.add(new WildcardRef()); // depends on control dependency: [if], data = [none]
}
}
return new ClassRefBuilder()
.withDefinition(this)
.withArguments(actualArguments)
.withAttributes(getAttributes())
.build();
} }
|
public class class_name {
private static void addFieldValue(OlapDocument document, String fieldName, String value, String idFieldName) {
if (fieldName.equals(idFieldName)) {
document.setId(value);
} else if (fieldName.equals("_table")) {
document.setTable(value);
} else if (fieldName.equals("_deleted")) {
document.setDeleted("true".equals(value));
} else {
document.addField(fieldName, value);
}
} }
|
public class class_name {
private static void addFieldValue(OlapDocument document, String fieldName, String value, String idFieldName) {
if (fieldName.equals(idFieldName)) {
document.setId(value); // depends on control dependency: [if], data = [none]
} else if (fieldName.equals("_table")) {
document.setTable(value); // depends on control dependency: [if], data = [none]
} else if (fieldName.equals("_deleted")) {
document.setDeleted("true".equals(value)); // depends on control dependency: [if], data = [none]
} else {
document.addField(fieldName, value); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private static void loadProperties(Properties properties,InputStream inputStream,boolean internal)
{
try
{
properties.load(inputStream);
LibraryConfigurationLoader.closeResource(inputStream);
}
catch(Exception exception)
{
LibraryConfigurationLoader.closeResource(inputStream);
String prefix="External";
if(internal)
{
prefix="Internal";
}
throw new FaxException(prefix+" "+LibraryConfigurationLoader.CONFIGURATION_FILE_NAME+" not found.",exception);
}
} }
|
public class class_name {
private static void loadProperties(Properties properties,InputStream inputStream,boolean internal)
{
try
{
properties.load(inputStream); // depends on control dependency: [try], data = [none]
LibraryConfigurationLoader.closeResource(inputStream); // depends on control dependency: [try], data = [none]
}
catch(Exception exception)
{
LibraryConfigurationLoader.closeResource(inputStream);
String prefix="External";
if(internal)
{
prefix="Internal"; // depends on control dependency: [if], data = [none]
}
throw new FaxException(prefix+" "+LibraryConfigurationLoader.CONFIGURATION_FILE_NAME+" not found.",exception);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
if (executor.isShutdown()) {
throw new RejectedExecutionException();
}
final BlockingQueue<Runnable> poolQueue = executor.getQueue();
if (LOG.isDebugEnabled()) {
LOG.debug("Putting Runnable into BlockingQueue(size=" + poolQueue.size() + ") directly and potentially waiting due to executor rejection");
}
try {
poolQueue.put(r);
if (LOG.isDebugEnabled()) {
LOG.debug("Put Runnable into BlockingQueue(size=" + poolQueue.size() + ") directly due to executor rejection");
}
}
catch (InterruptedException e) {
throw new RejectedExecutionException("Interrupted while waiting to queue Runnable", e);
}
} }
|
public class class_name {
public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
if (executor.isShutdown()) {
throw new RejectedExecutionException();
}
final BlockingQueue<Runnable> poolQueue = executor.getQueue();
if (LOG.isDebugEnabled()) {
LOG.debug("Putting Runnable into BlockingQueue(size=" + poolQueue.size() + ") directly and potentially waiting due to executor rejection"); // depends on control dependency: [if], data = [none]
}
try {
poolQueue.put(r); // depends on control dependency: [try], data = [none]
if (LOG.isDebugEnabled()) {
LOG.debug("Put Runnable into BlockingQueue(size=" + poolQueue.size() + ") directly due to executor rejection"); // depends on control dependency: [if], data = [none]
}
}
catch (InterruptedException e) {
throw new RejectedExecutionException("Interrupted while waiting to queue Runnable", e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private boolean hasSpecializedHandlerIntents(Context context, Intent intent) {
try {
PackageManager pm = context.getPackageManager();
List<ResolveInfo> handlers = pm.queryIntentActivities(
intent,
PackageManager.GET_RESOLVED_FILTER);
if (handlers == null || handlers.size() == 0) {
return false;
}
for (ResolveInfo resolveInfo : handlers) {
IntentFilter filter = resolveInfo.filter;
if (filter == null) continue;
if (filter.countDataAuthorities() == 0 || filter.countDataPaths() == 0) continue;
if (resolveInfo.activityInfo == null) continue;
return true;
}
} catch (RuntimeException e) {
Log.e(TAG, "Runtime exception while getting specialized handlers");
}
return false;
} }
|
public class class_name {
private boolean hasSpecializedHandlerIntents(Context context, Intent intent) {
try {
PackageManager pm = context.getPackageManager();
List<ResolveInfo> handlers = pm.queryIntentActivities(
intent,
PackageManager.GET_RESOLVED_FILTER);
if (handlers == null || handlers.size() == 0) {
return false; // depends on control dependency: [if], data = [none]
}
for (ResolveInfo resolveInfo : handlers) {
IntentFilter filter = resolveInfo.filter;
if (filter == null) continue;
if (filter.countDataAuthorities() == 0 || filter.countDataPaths() == 0) continue;
if (resolveInfo.activityInfo == null) continue;
return true; // depends on control dependency: [for], data = [none]
}
} catch (RuntimeException e) {
Log.e(TAG, "Runtime exception while getting specialized handlers");
} // depends on control dependency: [catch], data = [none]
return false;
} }
|
public class class_name {
public static boolean checkIfNoneMatchEtag(HttpServletRequest request,
HttpServletResponse response, String etag) {
String headerValue = request.getHeader(HttpHeaders.IF_NONE_MATCH);
if (headerValue != null) {
boolean conditionSatisfied = false;
if (!StringPool.ASTERISK.equals(headerValue)) {
StringTokenizer commaTokenizer = new StringTokenizer(headerValue, StringPool.COMMA);
while (!conditionSatisfied && commaTokenizer.hasMoreTokens()) {
String currentToken = commaTokenizer.nextToken();
if (currentToken.trim().equals(etag)) {
conditionSatisfied = true;
}
}
} else {
conditionSatisfied = true;
}
if (conditionSatisfied) {
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED);
response.setHeader(HttpHeaders.ETAG, etag);
return false;
}
}
return true;
} }
|
public class class_name {
public static boolean checkIfNoneMatchEtag(HttpServletRequest request,
HttpServletResponse response, String etag) {
String headerValue = request.getHeader(HttpHeaders.IF_NONE_MATCH);
if (headerValue != null) {
boolean conditionSatisfied = false;
if (!StringPool.ASTERISK.equals(headerValue)) {
StringTokenizer commaTokenizer = new StringTokenizer(headerValue, StringPool.COMMA);
while (!conditionSatisfied && commaTokenizer.hasMoreTokens()) {
String currentToken = commaTokenizer.nextToken();
if (currentToken.trim().equals(etag)) {
conditionSatisfied = true; // depends on control dependency: [if], data = [none]
}
}
} else {
conditionSatisfied = true; // depends on control dependency: [if], data = [none]
}
if (conditionSatisfied) {
response.setStatus(HttpServletResponse.SC_NOT_MODIFIED); // depends on control dependency: [if], data = [none]
response.setHeader(HttpHeaders.ETAG, etag); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
}
return true;
} }
|
public class class_name {
@Override
public void setCursorDepth(float depth)
{
super.setCursorDepth(depth);
if (mRayModel != null)
{
mRayModel.getTransform().setScaleZ(mCursorDepth);
}
} }
|
public class class_name {
@Override
public void setCursorDepth(float depth)
{
super.setCursorDepth(depth);
if (mRayModel != null)
{
mRayModel.getTransform().setScaleZ(mCursorDepth); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public int getInt(FaceletContext ctx)
{
if ((this.capabilities & EL_LITERAL) != 0)
{
return Integer.parseInt(this.value);
}
else
{
return ((Number) this.getObject(ctx, Integer.class)).intValue();
}
} }
|
public class class_name {
public int getInt(FaceletContext ctx)
{
if ((this.capabilities & EL_LITERAL) != 0)
{
return Integer.parseInt(this.value); // depends on control dependency: [if], data = [none]
}
else
{
return ((Number) this.getObject(ctx, Integer.class)).intValue(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static boolean hasTimestamp(final MessageOrBuilder messageOrBuilder) {
try {
final FieldDescriptor fieldDescriptor = ProtoBufFieldProcessor.getFieldDescriptor(messageOrBuilder, TIMESTAMP_FIELD_NAME);
return messageOrBuilder.hasField(fieldDescriptor);
} catch (NotAvailableException ex) {
return false;
}
} }
|
public class class_name {
public static boolean hasTimestamp(final MessageOrBuilder messageOrBuilder) {
try {
final FieldDescriptor fieldDescriptor = ProtoBufFieldProcessor.getFieldDescriptor(messageOrBuilder, TIMESTAMP_FIELD_NAME);
return messageOrBuilder.hasField(fieldDescriptor); // depends on control dependency: [try], data = [none]
} catch (NotAvailableException ex) {
return false;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public synchronized long nextId() {
long currTimestamp = timestampGen();
if (currTimestamp < lastTimestamp) {
throw new IllegalStateException(
String.format("Clock moved backwards. Refusing to generate id for %d milliseconds",
lastTimestamp - currTimestamp));
}
if (currTimestamp == lastTimestamp) {
sequence = (sequence + 1) & maxSequence;
if (sequence == 0) { // overflow: greater than max sequence
currTimestamp = waitNextMillis(currTimestamp);
}
} else { // reset to 0 for next period/millisecond
sequence = 0L;
}
// track and memo the time stamp last snowflake ID generated
lastTimestamp = currTimestamp;
return ((currTimestamp - epoch) << timestampShift) | //
(datacenterId << datacenterIdShift) | //
(workerId << workerIdShift) | // new line for nice looking
sequence;
} }
|
public class class_name {
public synchronized long nextId() {
long currTimestamp = timestampGen();
if (currTimestamp < lastTimestamp) {
throw new IllegalStateException(
String.format("Clock moved backwards. Refusing to generate id for %d milliseconds",
lastTimestamp - currTimestamp));
}
if (currTimestamp == lastTimestamp) {
sequence = (sequence + 1) & maxSequence; // depends on control dependency: [if], data = [none]
if (sequence == 0) { // overflow: greater than max sequence
currTimestamp = waitNextMillis(currTimestamp); // depends on control dependency: [if], data = [none]
}
} else { // reset to 0 for next period/millisecond
sequence = 0L; // depends on control dependency: [if], data = [none]
}
// track and memo the time stamp last snowflake ID generated
lastTimestamp = currTimestamp;
return ((currTimestamp - epoch) << timestampShift) | //
(datacenterId << datacenterIdShift) | //
(workerId << workerIdShift) | // new line for nice looking
sequence;
} }
|
public class class_name {
public static synchronized void setOpenHelperClass(Class<? extends OrmLiteSqliteOpenHelper> openHelperClass) {
if (openHelperClass == null) {
helperClass = null;
} else {
innerSetHelperClass(openHelperClass);
}
} }
|
public class class_name {
public static synchronized void setOpenHelperClass(Class<? extends OrmLiteSqliteOpenHelper> openHelperClass) {
if (openHelperClass == null) {
helperClass = null; // depends on control dependency: [if], data = [none]
} else {
innerSetHelperClass(openHelperClass); // depends on control dependency: [if], data = [(openHelperClass]
}
} }
|
public class class_name {
public Configuration getConfiguration() {
final Configuration conf = new Configuration();
for (Map.Entry<String, String> entry : data.entrySet()) {
conf.setString(entry.getKey(), entry.getValue());
}
return conf;
} }
|
public class class_name {
public Configuration getConfiguration() {
final Configuration conf = new Configuration();
for (Map.Entry<String, String> entry : data.entrySet()) {
conf.setString(entry.getKey(), entry.getValue()); // depends on control dependency: [for], data = [entry]
}
return conf;
} }
|
public class class_name {
private void writeCalendars(Project project)
{
//
// Create the new MSPDI calendar list
//
Project.Calendars calendars = m_factory.createProjectCalendars();
project.setCalendars(calendars);
List<Project.Calendars.Calendar> calendar = calendars.getCalendar();
//
// Process each calendar in turn
//
for (ProjectCalendar cal : m_projectFile.getCalendars())
{
calendar.add(writeCalendar(cal));
}
} }
|
public class class_name {
private void writeCalendars(Project project)
{
//
// Create the new MSPDI calendar list
//
Project.Calendars calendars = m_factory.createProjectCalendars();
project.setCalendars(calendars);
List<Project.Calendars.Calendar> calendar = calendars.getCalendar();
//
// Process each calendar in turn
//
for (ProjectCalendar cal : m_projectFile.getCalendars())
{
calendar.add(writeCalendar(cal)); // depends on control dependency: [for], data = [cal]
}
} }
|
public class class_name {
public static void blur(int[] in, int[] out, int width, int height, float radius) {
int widthMinus1 = width - 1;
int r = (int) radius;
int tableSize = 2 * r + 1;
int divide[] = new int[256 * tableSize];
for (int i = 0; i < 256 * tableSize; i++) {
divide[i] = i / tableSize;
}
int inIndex = 0;
for (int y = 0; y < height; y++) {
int outIndex = y;
int ta = 0, tr = 0, tg = 0, tb = 0;
for (int i = -r; i <= r; i++) {
int rgb = in[inIndex + clamp(i, 0, width - 1)];
ta += (rgb >> 24) & 0xff;
tr += (rgb >> 16) & 0xff;
tg += (rgb >> 8) & 0xff;
tb += rgb & 0xff;
}
for (int x = 0; x < width; x++) {
out[outIndex] = (divide[ta] << 24) | (divide[tr] << 16) | (divide[tg] << 8) | divide[tb];
int i1 = x + r + 1;
if (i1 > widthMinus1) {
i1 = widthMinus1;
}
int i2 = x - r;
if (i2 < 0) {
i2 = 0;
}
int rgb1 = in[inIndex + i1];
int rgb2 = in[inIndex + i2];
ta += ((rgb1 >> 24) & 0xff) - ((rgb2 >> 24) & 0xff);
tr += ((rgb1 & 0xff0000) - (rgb2 & 0xff0000)) >> 16;
tg += ((rgb1 & 0xff00) - (rgb2 & 0xff00)) >> 8;
tb += (rgb1 & 0xff) - (rgb2 & 0xff);
outIndex += height;
}
inIndex += width;
}
} }
|
public class class_name {
public static void blur(int[] in, int[] out, int width, int height, float radius) {
int widthMinus1 = width - 1;
int r = (int) radius;
int tableSize = 2 * r + 1;
int divide[] = new int[256 * tableSize];
for (int i = 0; i < 256 * tableSize; i++) {
divide[i] = i / tableSize; // depends on control dependency: [for], data = [i]
}
int inIndex = 0;
for (int y = 0; y < height; y++) {
int outIndex = y;
int ta = 0, tr = 0, tg = 0, tb = 0;
for (int i = -r; i <= r; i++) {
int rgb = in[inIndex + clamp(i, 0, width - 1)];
ta += (rgb >> 24) & 0xff; // depends on control dependency: [for], data = [none]
tr += (rgb >> 16) & 0xff; // depends on control dependency: [for], data = [none]
tg += (rgb >> 8) & 0xff; // depends on control dependency: [for], data = [none]
tb += rgb & 0xff; // depends on control dependency: [for], data = [none]
}
for (int x = 0; x < width; x++) {
out[outIndex] = (divide[ta] << 24) | (divide[tr] << 16) | (divide[tg] << 8) | divide[tb]; // depends on control dependency: [for], data = [none]
int i1 = x + r + 1;
if (i1 > widthMinus1) {
i1 = widthMinus1; // depends on control dependency: [if], data = [none]
}
int i2 = x - r;
if (i2 < 0) {
i2 = 0; // depends on control dependency: [if], data = [none]
}
int rgb1 = in[inIndex + i1];
int rgb2 = in[inIndex + i2];
ta += ((rgb1 >> 24) & 0xff) - ((rgb2 >> 24) & 0xff); // depends on control dependency: [for], data = [none]
tr += ((rgb1 & 0xff0000) - (rgb2 & 0xff0000)) >> 16; // depends on control dependency: [for], data = [none]
tg += ((rgb1 & 0xff00) - (rgb2 & 0xff00)) >> 8; // depends on control dependency: [for], data = [none]
tb += (rgb1 & 0xff) - (rgb2 & 0xff); // depends on control dependency: [for], data = [none]
outIndex += height; // depends on control dependency: [for], data = [none]
}
inIndex += width; // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
@Override
public boolean accept(V value) {
Boolean result = acceptRecursive(value);
if (result == null) {
return this.defaultResult;
} else {
return result.booleanValue();
}
} }
|
public class class_name {
@Override
public boolean accept(V value) {
Boolean result = acceptRecursive(value);
if (result == null) {
return this.defaultResult;
// depends on control dependency: [if], data = [none]
} else {
return result.booleanValue();
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public KeyArea setupKey(int iKeyArea)
{
KeyArea keyArea = null;
if (iKeyArea == 0)
{
keyArea = this.makeIndex(DBConstants.UNIQUE, ID_KEY);
keyArea.addKeyField(ID, DBConstants.ASCENDING);
}
if (iKeyArea == 1)
{
keyArea = this.makeIndex(DBConstants.NOT_UNIQUE, PARENT_FOLDER_ID_KEY);
keyArea.addKeyField(PARENT_FOLDER_ID, DBConstants.ASCENDING);
keyArea.addKeyField(SEQUENCE, DBConstants.ASCENDING);
keyArea.addKeyField(NAME, DBConstants.ASCENDING);
}
if (iKeyArea == 2)
{
keyArea = this.makeIndex(DBConstants.NOT_UNIQUE, CODE_KEY);
keyArea.addKeyField(CODE, DBConstants.ASCENDING);
}
if (keyArea == null)
keyArea = super.setupKey(iKeyArea);
return keyArea;
} }
|
public class class_name {
public KeyArea setupKey(int iKeyArea)
{
KeyArea keyArea = null;
if (iKeyArea == 0)
{
keyArea = this.makeIndex(DBConstants.UNIQUE, ID_KEY); // depends on control dependency: [if], data = [none]
keyArea.addKeyField(ID, DBConstants.ASCENDING); // depends on control dependency: [if], data = [none]
}
if (iKeyArea == 1)
{
keyArea = this.makeIndex(DBConstants.NOT_UNIQUE, PARENT_FOLDER_ID_KEY); // depends on control dependency: [if], data = [none]
keyArea.addKeyField(PARENT_FOLDER_ID, DBConstants.ASCENDING); // depends on control dependency: [if], data = [none]
keyArea.addKeyField(SEQUENCE, DBConstants.ASCENDING); // depends on control dependency: [if], data = [none]
keyArea.addKeyField(NAME, DBConstants.ASCENDING); // depends on control dependency: [if], data = [none]
}
if (iKeyArea == 2)
{
keyArea = this.makeIndex(DBConstants.NOT_UNIQUE, CODE_KEY); // depends on control dependency: [if], data = [none]
keyArea.addKeyField(CODE, DBConstants.ASCENDING); // depends on control dependency: [if], data = [none]
}
if (keyArea == null)
keyArea = super.setupKey(iKeyArea);
return keyArea;
} }
|
public class class_name {
@Override
public void delete(final I id) {
if (entity != null) {
inTransaction(
new Callable<Void>() {
@Override
public Void call() throws Exception {
final T entity = findOne(id);
T attached = getAttached(entity);
if (attached != null) {
entityManager.remove(attached);
}
return null;
}
}
);
}
} }
|
public class class_name {
@Override
public void delete(final I id) {
if (entity != null) {
inTransaction(
new Callable<Void>() {
@Override
public Void call() throws Exception {
final T entity = findOne(id);
T attached = getAttached(entity);
if (attached != null) {
entityManager.remove(attached);
}
return null;
}
}
); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void preparePrefer30sMap() {
// We'll split up the visible output and the non-visible output such that each visible
// output will correspond to a range of 14 associated input degrees, and each non-visible
// output will correspond to a range of 4 associate input degrees, so visible numbers
// are more than 3 times easier to get than non-visible numbers:
// {354-359,0-7}:0, {8-11}:6, {12-15}:12, {16-19}:18, {20-23}:24, {24-37}:30, etc.
//
// If an output of 30 degrees should correspond to a range of 14 associated degrees, then
// we'll need any input between 24 - 37 to snap to 30. Working out from there, 20-23 should
// snap to 24, while 38-41 should snap to 36. This is somewhat counter-intuitive, that you
// can be touching 36 degrees but have the selection snapped to 30 degrees; however, this
// inconsistency isn't noticeable at such fine-grained degrees, and it affords us the
// ability to aggressively prefer the visible values by a factor of more than 3:1, which
// greatly contributes to the selectability of these values.
// Our input will be 0 through 360.
mSnapPrefer30sMap = new int[361];
// The first output is 0, and each following output will increment by 6 {0, 6, 12, ...}.
int snappedOutputDegrees = 0;
// Count of how many inputs we've designated to the specified output.
int count = 1;
// How many input we expect for a specified output. This will be 14 for output divisible
// by 30, and 4 for the remaining output. We'll special case the outputs of 0 and 360, so
// the caller can decide which they need.
int expectedCount = 8;
// Iterate through the input.
for (int degrees = 0; degrees < 361; degrees++) {
// Save the input-output mapping.
mSnapPrefer30sMap[degrees] = snappedOutputDegrees;
// If this is the last input for the specified output, calculate the next output and
// the next expected count.
if (count == expectedCount) {
snappedOutputDegrees += 6;
if (snappedOutputDegrees == 360) {
expectedCount = 7;
} else if (snappedOutputDegrees % 30 == 0) {
expectedCount = 14;
} else {
expectedCount = 4;
}
count = 1;
} else {
count++;
}
}
} }
|
public class class_name {
private void preparePrefer30sMap() {
// We'll split up the visible output and the non-visible output such that each visible
// output will correspond to a range of 14 associated input degrees, and each non-visible
// output will correspond to a range of 4 associate input degrees, so visible numbers
// are more than 3 times easier to get than non-visible numbers:
// {354-359,0-7}:0, {8-11}:6, {12-15}:12, {16-19}:18, {20-23}:24, {24-37}:30, etc.
//
// If an output of 30 degrees should correspond to a range of 14 associated degrees, then
// we'll need any input between 24 - 37 to snap to 30. Working out from there, 20-23 should
// snap to 24, while 38-41 should snap to 36. This is somewhat counter-intuitive, that you
// can be touching 36 degrees but have the selection snapped to 30 degrees; however, this
// inconsistency isn't noticeable at such fine-grained degrees, and it affords us the
// ability to aggressively prefer the visible values by a factor of more than 3:1, which
// greatly contributes to the selectability of these values.
// Our input will be 0 through 360.
mSnapPrefer30sMap = new int[361];
// The first output is 0, and each following output will increment by 6 {0, 6, 12, ...}.
int snappedOutputDegrees = 0;
// Count of how many inputs we've designated to the specified output.
int count = 1;
// How many input we expect for a specified output. This will be 14 for output divisible
// by 30, and 4 for the remaining output. We'll special case the outputs of 0 and 360, so
// the caller can decide which they need.
int expectedCount = 8;
// Iterate through the input.
for (int degrees = 0; degrees < 361; degrees++) {
// Save the input-output mapping.
mSnapPrefer30sMap[degrees] = snappedOutputDegrees; // depends on control dependency: [for], data = [degrees]
// If this is the last input for the specified output, calculate the next output and
// the next expected count.
if (count == expectedCount) {
snappedOutputDegrees += 6; // depends on control dependency: [if], data = [none]
if (snappedOutputDegrees == 360) {
expectedCount = 7; // depends on control dependency: [if], data = [none]
} else if (snappedOutputDegrees % 30 == 0) {
expectedCount = 14; // depends on control dependency: [if], data = [none]
} else {
expectedCount = 4; // depends on control dependency: [if], data = [none]
}
count = 1; // depends on control dependency: [if], data = [none]
} else {
count++; // depends on control dependency: [if], data = [none]
}
}
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.