code stringlengths 130 281k | code_dependency stringlengths 182 306k |
|---|---|
public class class_name {
public static String getTopActivityClassName(Context context) {
ComponentName activity = getTopActivity(context);
if (activity == null) {
return null;
}
return activity.getClassName();
} } | public class class_name {
public static String getTopActivityClassName(Context context) {
ComponentName activity = getTopActivity(context);
if (activity == null) {
return null; // depends on control dependency: [if], data = [none]
}
return activity.getClassName();
} } |
public class class_name {
public static String normalizeSlashes(final String path) {
// prepare
final StringBuilder builder = new StringBuilder(path);
boolean modified = false;
// remove all trailing '/'s except the first one
while (builder.length() > 0 && builder.length() != 1 && PATH_SEPARATOR == builder.charAt(builder.length() - 1)) {
builder.deleteCharAt(builder.length() - 1);
modified = true;
}
// add a slash at the beginning if one isn't present
if (builder.length() == 0 || PATH_SEPARATOR != builder.charAt(0)) {
builder.insert(0, PATH_SEPARATOR);
modified = true;
}
// only create string when it was modified
if (modified) {
return builder.toString();
}
return path;
} } | public class class_name {
public static String normalizeSlashes(final String path) {
// prepare
final StringBuilder builder = new StringBuilder(path);
boolean modified = false;
// remove all trailing '/'s except the first one
while (builder.length() > 0 && builder.length() != 1 && PATH_SEPARATOR == builder.charAt(builder.length() - 1)) {
builder.deleteCharAt(builder.length() - 1); // depends on control dependency: [while], data = [none]
modified = true; // depends on control dependency: [while], data = [none]
}
// add a slash at the beginning if one isn't present
if (builder.length() == 0 || PATH_SEPARATOR != builder.charAt(0)) {
builder.insert(0, PATH_SEPARATOR); // depends on control dependency: [if], data = [none]
modified = true; // depends on control dependency: [if], data = [none]
}
// only create string when it was modified
if (modified) {
return builder.toString(); // depends on control dependency: [if], data = [none]
}
return path;
} } |
public class class_name {
private void stripCommas(TokenList tokens) {
TokenList.Token t = tokens.getFirst();
while( t != null ) {
TokenList.Token next = t.next;
if( t.getSymbol() == Symbol.COMMA ) {
tokens.remove(t);
}
t = next;
}
} } | public class class_name {
private void stripCommas(TokenList tokens) {
TokenList.Token t = tokens.getFirst();
while( t != null ) {
TokenList.Token next = t.next;
if( t.getSymbol() == Symbol.COMMA ) {
tokens.remove(t); // depends on control dependency: [if], data = [none]
}
t = next; // depends on control dependency: [while], data = [none]
}
} } |
public class class_name {
public String[] subMapKeysAsStrings(PropertyMap map) {
String[] result = null;
Set<?> keySet = map.subMapKeySet();
int keySize = keySet.size();
if (keySize > 0) {
result = keySet.toArray(new String[keySize]);
}
return result;
} } | public class class_name {
public String[] subMapKeysAsStrings(PropertyMap map) {
String[] result = null;
Set<?> keySet = map.subMapKeySet();
int keySize = keySet.size();
if (keySize > 0) {
result = keySet.toArray(new String[keySize]); // depends on control dependency: [if], data = [none]
}
return result;
} } |
public class class_name {
@Override
public boolean createTileMatrixSetTable() {
verifyWritable();
boolean created = false;
TileMatrixSetDao dao = getTileMatrixSetDao();
try {
if (!dao.isTableExists()) {
created = tableCreator.createTileMatrixSet() > 0;
}
} catch (SQLException e) {
throw new GeoPackageException("Failed to check if "
+ TileMatrixSet.class.getSimpleName()
+ " table exists and create it", e);
}
return created;
} } | public class class_name {
@Override
public boolean createTileMatrixSetTable() {
verifyWritable();
boolean created = false;
TileMatrixSetDao dao = getTileMatrixSetDao();
try {
if (!dao.isTableExists()) {
created = tableCreator.createTileMatrixSet() > 0; // depends on control dependency: [if], data = [none]
}
} catch (SQLException e) {
throw new GeoPackageException("Failed to check if "
+ TileMatrixSet.class.getSimpleName()
+ " table exists and create it", e);
} // depends on control dependency: [catch], data = [none]
return created;
} } |
public class class_name {
@Override
public void close() {
// get current session
Neo4JSession session = this.session.get();
if (session != null) {
// close session
session.close();
// remove session
this.session.remove();
}
// synchronize access to set
synchronized (closeListeners) {
// notify consumers
closeListeners.forEach(consumer -> consumer.accept(this));
}
} } | public class class_name {
@Override
public void close() {
// get current session
Neo4JSession session = this.session.get();
if (session != null) {
// close session
session.close(); // depends on control dependency: [if], data = [none]
// remove session
this.session.remove(); // depends on control dependency: [if], data = [none]
}
// synchronize access to set
synchronized (closeListeners) {
// notify consumers
closeListeners.forEach(consumer -> consumer.accept(this));
}
} } |
public class class_name {
private static MessageInfoType mapMessageInfo(MessageInfo messageInfo) {
if (messageInfo == null) {
return null;
}
MessageInfoType miType = new MessageInfoType();
miType.setMessageId(messageInfo.getMessageId());
miType.setFlowId(messageInfo.getFlowId());
miType.setPorttype(convertString(messageInfo.getPortType()));
miType.setOperationName(messageInfo.getOperationName());
miType.setTransport(messageInfo.getTransportType());
return miType;
} } | public class class_name {
private static MessageInfoType mapMessageInfo(MessageInfo messageInfo) {
if (messageInfo == null) {
return null; // depends on control dependency: [if], data = [none]
}
MessageInfoType miType = new MessageInfoType();
miType.setMessageId(messageInfo.getMessageId());
miType.setFlowId(messageInfo.getFlowId());
miType.setPorttype(convertString(messageInfo.getPortType()));
miType.setOperationName(messageInfo.getOperationName());
miType.setTransport(messageInfo.getTransportType());
return miType;
} } |
public class class_name {
public ElementBox createBox(ElementBox parent, Element n, String display)
{
ElementBox root = null;
//New box style
NodeData style = decoder.getElementStyleInherited(n);
if (style == null)
style = createAnonymousStyle(display);
//Special (HTML) tag names
if (config.getUseHTML() && html.isTagSupported(n))
{
root = html.createBox(parent, n, viewport, style);
}
//Not created yet -- create a box according to the display value
if (root == null)
{
root = createElementInstance(parent, n, style);
}
root.setBase(baseurl);
root.setViewport(viewport);
root.setParent(parent);
root.setOrder(next_order++);
return root;
} } | public class class_name {
public ElementBox createBox(ElementBox parent, Element n, String display)
{
ElementBox root = null;
//New box style
NodeData style = decoder.getElementStyleInherited(n);
if (style == null)
style = createAnonymousStyle(display);
//Special (HTML) tag names
if (config.getUseHTML() && html.isTagSupported(n))
{
root = html.createBox(parent, n, viewport, style); // depends on control dependency: [if], data = [none]
}
//Not created yet -- create a box according to the display value
if (root == null)
{
root = createElementInstance(parent, n, style); // depends on control dependency: [if], data = [none]
}
root.setBase(baseurl);
root.setViewport(viewport);
root.setParent(parent);
root.setOrder(next_order++);
return root;
} } |
public class class_name {
public void appendStart(StringBuilder buffer, Object object) {
if (object != null) {
appendClassName(buffer, object);
appendIdentityHashCode(buffer, object);
appendContentStart(buffer);
if (fieldSeparatorAtStart) {
appendFieldSeparator(buffer);
}
}
} } | public class class_name {
public void appendStart(StringBuilder buffer, Object object) {
if (object != null) {
appendClassName(buffer, object); // depends on control dependency: [if], data = [none]
appendIdentityHashCode(buffer, object); // depends on control dependency: [if], data = [none]
appendContentStart(buffer); // depends on control dependency: [if], data = [none]
if (fieldSeparatorAtStart) {
appendFieldSeparator(buffer); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public void marshall(S3DestinationSettings s3DestinationSettings, ProtocolMarshaller protocolMarshaller) {
if (s3DestinationSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(s3DestinationSettings.getEncryption(), ENCRYPTION_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(S3DestinationSettings s3DestinationSettings, ProtocolMarshaller protocolMarshaller) {
if (s3DestinationSettings == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(s3DestinationSettings.getEncryption(), ENCRYPTION_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 {
private void handleBorrowTaskMessage(BorrowTaskMessage message) {
// borrows do not advance the sp handle. The handle would
// move backwards anyway once the next message is received
// from the SP leader.
long newSpHandle = getMaxScheduledTxnSpHandle();
Iv2Trace.logFragmentTaskMessage(message.getFragmentTaskMessage(),
m_mailbox.getHSId(), newSpHandle, true);
final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPI);
if (traceLog != null) {
traceLog.add(() -> VoltTrace.beginAsync("recvfragment",
MiscUtils.hsIdPairTxnIdToString(m_mailbox.getHSId(), m_mailbox.getHSId(), newSpHandle, 0),
"txnId", TxnEgo.txnIdToString(message.getTxnId()),
"partition", m_partitionId,
"hsId", CoreUtils.hsIdToString(m_mailbox.getHSId())));
}
TransactionState txn = m_outstandingTxns.get(message.getTxnId());
if (txn == null) {
// If the borrow is the first fragment for a transaction, run it as
// a single partition fragment; Must not engage/pause this
// site on a MP transaction before the SP instructs to do so.
// Do not track the borrow task as outstanding - it completes
// immediately and is not a valid transaction state for
// full MP participation (it claims everything can run as SP).
txn = new BorrowTransactionState(newSpHandle, message);
}
// BorrowTask is a read only task embedded in a MP transaction
// and its response (FragmentResponseMessage) should not be buffered
if (message.getFragmentTaskMessage().isSysProcTask()) {
final SysprocBorrowedTask task =
new SysprocBorrowedTask(m_mailbox, (ParticipantTransactionState)txn,
m_pendingTasks, message.getFragmentTaskMessage(),
message.getInputDepMap());
task.setResponseNotBufferable();
m_pendingTasks.offer(task);
}
else {
final BorrowedTask task =
new BorrowedTask(m_mailbox, (ParticipantTransactionState)txn,
m_pendingTasks, message.getFragmentTaskMessage(),
message.getInputDepMap());
task.setResponseNotBufferable();
m_pendingTasks.offer(task);
}
} } | public class class_name {
private void handleBorrowTaskMessage(BorrowTaskMessage message) {
// borrows do not advance the sp handle. The handle would
// move backwards anyway once the next message is received
// from the SP leader.
long newSpHandle = getMaxScheduledTxnSpHandle();
Iv2Trace.logFragmentTaskMessage(message.getFragmentTaskMessage(),
m_mailbox.getHSId(), newSpHandle, true);
final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPI);
if (traceLog != null) {
traceLog.add(() -> VoltTrace.beginAsync("recvfragment",
MiscUtils.hsIdPairTxnIdToString(m_mailbox.getHSId(), m_mailbox.getHSId(), newSpHandle, 0),
"txnId", TxnEgo.txnIdToString(message.getTxnId()),
"partition", m_partitionId,
"hsId", CoreUtils.hsIdToString(m_mailbox.getHSId()))); // depends on control dependency: [if], data = [none]
}
TransactionState txn = m_outstandingTxns.get(message.getTxnId());
if (txn == null) {
// If the borrow is the first fragment for a transaction, run it as
// a single partition fragment; Must not engage/pause this
// site on a MP transaction before the SP instructs to do so.
// Do not track the borrow task as outstanding - it completes
// immediately and is not a valid transaction state for
// full MP participation (it claims everything can run as SP).
txn = new BorrowTransactionState(newSpHandle, message); // depends on control dependency: [if], data = [none]
}
// BorrowTask is a read only task embedded in a MP transaction
// and its response (FragmentResponseMessage) should not be buffered
if (message.getFragmentTaskMessage().isSysProcTask()) {
final SysprocBorrowedTask task =
new SysprocBorrowedTask(m_mailbox, (ParticipantTransactionState)txn,
m_pendingTasks, message.getFragmentTaskMessage(),
message.getInputDepMap());
task.setResponseNotBufferable(); // depends on control dependency: [if], data = [none]
m_pendingTasks.offer(task); // depends on control dependency: [if], data = [none]
}
else {
final BorrowedTask task =
new BorrowedTask(m_mailbox, (ParticipantTransactionState)txn,
m_pendingTasks, message.getFragmentTaskMessage(),
message.getInputDepMap());
task.setResponseNotBufferable(); // depends on control dependency: [if], data = [none]
m_pendingTasks.offer(task); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Contract(pure = true)
public final boolean isRunning(@NonNull final String tag) {
final Integer id = mTaggedRequests.get(tag);
//noinspection SimplifiableIfStatement
if (id != null) {
return isRunning(id);
} else {
return false;
}
} } | public class class_name {
@Contract(pure = true)
public final boolean isRunning(@NonNull final String tag) {
final Integer id = mTaggedRequests.get(tag);
//noinspection SimplifiableIfStatement
if (id != null) {
return isRunning(id); // depends on control dependency: [if], data = [(id]
} else {
return false; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMetricDefintionsWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listMetricDefintionsSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<ResourceMetricDefinitionInner>>, Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> call(ServiceResponse<Page<ResourceMetricDefinitionInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listMetricDefintionsNextWithServiceResponseAsync(nextPageLink));
}
});
} } | public class class_name {
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listMetricDefintionsWithServiceResponseAsync(final String resourceGroupName, final String name) {
return listMetricDefintionsSinglePageAsync(resourceGroupName, name)
.concatMap(new Func1<ServiceResponse<Page<ResourceMetricDefinitionInner>>, Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> call(ServiceResponse<Page<ResourceMetricDefinitionInner>> 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(listMetricDefintionsNextWithServiceResponseAsync(nextPageLink));
}
});
} } |
public class class_name {
@Implementation
protected final int bulkInsert(Uri url, ContentValues[] values) {
ContentProvider provider = getProvider(url);
InsertStatement insertStatement = new InsertStatement(url, provider, values);
statements.add(insertStatement);
insertStatements.add(insertStatement);
if (provider != null) {
return provider.bulkInsert(url, values);
} else {
return values.length;
}
} } | public class class_name {
@Implementation
protected final int bulkInsert(Uri url, ContentValues[] values) {
ContentProvider provider = getProvider(url);
InsertStatement insertStatement = new InsertStatement(url, provider, values);
statements.add(insertStatement);
insertStatements.add(insertStatement);
if (provider != null) {
return provider.bulkInsert(url, values); // depends on control dependency: [if], data = [none]
} else {
return values.length; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Override
public void printRanking(final Long user, final List<Pair<Long, Double>> scoredItems, final PrintStream out, final OUTPUT_FORMAT format) {
final Map<Long, Double> scores = new HashMap<Long, Double>();
for (Pair<Long, Double> p : scoredItems) {
scores.put(p.getFirst(), p.getSecond());
}
printRanking("" + user, scores, out, format);
} } | public class class_name {
@Override
public void printRanking(final Long user, final List<Pair<Long, Double>> scoredItems, final PrintStream out, final OUTPUT_FORMAT format) {
final Map<Long, Double> scores = new HashMap<Long, Double>();
for (Pair<Long, Double> p : scoredItems) {
scores.put(p.getFirst(), p.getSecond()); // depends on control dependency: [for], data = [p]
}
printRanking("" + user, scores, out, format);
} } |
public class class_name {
private static List<String> getYearSpan(int startYear, int endYear) {
List<String> result = new ArrayList<String>();
for (int i = startYear; i <= endYear; i++) {
String dateStr = String.valueOf(i);
result.add(dateStr);
}
return result;
} } | public class class_name {
private static List<String> getYearSpan(int startYear, int endYear) {
List<String> result = new ArrayList<String>();
for (int i = startYear; i <= endYear; i++) {
String dateStr = String.valueOf(i);
result.add(dateStr); // depends on control dependency: [for], data = [none]
}
return result;
} } |
public class class_name {
private String queryPlaceholder(int length) {
StringBuilder sb = new StringBuilder(length * 2 + 1);
sb.append("(?");
for (int i = 1; i < length; i++) {
sb.append(",?");
}
sb.append(")");
return sb.toString();
} } | public class class_name {
private String queryPlaceholder(int length) {
StringBuilder sb = new StringBuilder(length * 2 + 1);
sb.append("(?");
for (int i = 1; i < length; i++) {
sb.append(",?"); // depends on control dependency: [for], data = [none]
}
sb.append(")");
return sb.toString();
} } |
public class class_name {
public String getState() throws CmsException {
if (CmsStringUtil.isNotEmpty(getParamResource())) {
CmsResource file = getCms().readResource(getParamResource(), CmsResourceFilter.ALL);
if (getCms().isInsideCurrentProject(getParamResource())) {
return key(Messages.getStateKey(file.getState()));
} else {
return key(Messages.GUI_EXPLORER_STATENIP_0);
}
}
return "+++ resource parameter not found +++";
} } | public class class_name {
public String getState() throws CmsException {
if (CmsStringUtil.isNotEmpty(getParamResource())) {
CmsResource file = getCms().readResource(getParamResource(), CmsResourceFilter.ALL);
if (getCms().isInsideCurrentProject(getParamResource())) {
return key(Messages.getStateKey(file.getState())); // depends on control dependency: [if], data = [none]
} else {
return key(Messages.GUI_EXPLORER_STATENIP_0); // depends on control dependency: [if], data = [none]
}
}
return "+++ resource parameter not found +++";
} } |
public class class_name {
@Override
public Configuration register(Class<?> endpointClass) {
try {
if(endpointClass.isAnnotationPresent(Config.class)) {
Configuration configuration = endpointClass.getAnnotation(Config.class).value().newInstance();
HttpClient httpClient = configuration.httpClient();
HttpClientDirectory.INSTANCE.bind(endpointClass, httpClient); //currently the only configurable property
return configuration;
}
else {
HttpClientDirectory.INSTANCE.bind(endpointClass, HttpClientDirectory.DEFAULT);
return new Configuration(){};
}
}
catch(Exception e) {
throw new ConfigurationFailedException(endpointClass, e);
}
} } | public class class_name {
@Override
public Configuration register(Class<?> endpointClass) {
try {
if(endpointClass.isAnnotationPresent(Config.class)) {
Configuration configuration = endpointClass.getAnnotation(Config.class).value().newInstance();
HttpClient httpClient = configuration.httpClient();
HttpClientDirectory.INSTANCE.bind(endpointClass, httpClient); //currently the only configurable property // depends on control dependency: [if], data = [none]
return configuration; // depends on control dependency: [if], data = [none]
}
else {
HttpClientDirectory.INSTANCE.bind(endpointClass, HttpClientDirectory.DEFAULT); // depends on control dependency: [if], data = [none]
return new Configuration(){}; // depends on control dependency: [if], data = [none]
}
}
catch(Exception e) {
throw new ConfigurationFailedException(endpointClass, e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public <E> E fromThriftRow(Class<E> clazz, EntityMetadata m, DataRow<SuperColumn> tr) throws Exception
{
// Instantiate a new instance
E e = null;
// Set row-key. Note:
// Get a name->field map for super-columns
Map<String, Field> columnNameToFieldMap = new HashMap<String, Field>();
Map<String, Field> superColumnNameToFieldMap = new HashMap<String, Field>();
MetadataUtils.populateColumnAndSuperColumnMaps(m, columnNameToFieldMap, superColumnNameToFieldMap,
kunderaMetadata);
Collection embeddedCollection = null;
Field embeddedCollectionField = null;
for (SuperColumn sc : tr.getColumns())
{
if (e == null)
{
// Instantiate a new instance
e = clazz.newInstance();
// Set row-key.
PropertyAccessorHelper.setId(e, m, tr.getId());
}
String scName = PropertyAccessorFactory.STRING.fromBytes(String.class, sc.getName());
String scNamePrefix = null;
if (scName.indexOf(Constants.EMBEDDED_COLUMN_NAME_DELIMITER) != -1)
{
scNamePrefix = MetadataUtils.getEmbeddedCollectionPrefix(scName);
embeddedCollectionField = superColumnNameToFieldMap.get(scNamePrefix);
embeddedCollection = MetadataUtils.getEmbeddedCollectionInstance(embeddedCollectionField);
Object embeddedObject = populateEmbeddedObject(sc, m);
embeddedCollection.add(embeddedObject);
PropertyAccessorHelper.set(e, embeddedCollectionField, embeddedCollection);
}
else
{
boolean intoRelations = false;
if (scName.equals(Constants.FOREIGN_KEY_EMBEDDED_COLUMN_NAME))
{
intoRelations = true;
}
for (Column column : sc.getColumns())
{
if (column != null)
{
String name = PropertyAccessorFactory.STRING.fromBytes(String.class, column.getName());
byte[] value = column.getValue();
if (value == null)
{
continue;
}
if (intoRelations)
{
String foreignKeys = PropertyAccessorFactory.STRING.fromBytes(String.class, value);
Set<String> keys = MetadataUtils.deserializeKeys(foreignKeys);
}
else
{
// set value of the field in the bean
Field field = columnNameToFieldMap.get(name);
Object embeddedObject = PropertyAccessorHelper.getObject(e, scName);
PropertyAccessorHelper.set(embeddedObject, field, value);
}
}
}
}
}
if (log.isInfoEnabled())
{
log.info("Returning entity {} for class {}", e, clazz);
}
return e;
} } | public class class_name {
public <E> E fromThriftRow(Class<E> clazz, EntityMetadata m, DataRow<SuperColumn> tr) throws Exception
{
// Instantiate a new instance
E e = null;
// Set row-key. Note:
// Get a name->field map for super-columns
Map<String, Field> columnNameToFieldMap = new HashMap<String, Field>();
Map<String, Field> superColumnNameToFieldMap = new HashMap<String, Field>();
MetadataUtils.populateColumnAndSuperColumnMaps(m, columnNameToFieldMap, superColumnNameToFieldMap,
kunderaMetadata);
Collection embeddedCollection = null;
Field embeddedCollectionField = null;
for (SuperColumn sc : tr.getColumns())
{
if (e == null)
{
// Instantiate a new instance
e = clazz.newInstance();
// Set row-key.
PropertyAccessorHelper.setId(e, m, tr.getId());
}
String scName = PropertyAccessorFactory.STRING.fromBytes(String.class, sc.getName());
String scNamePrefix = null;
if (scName.indexOf(Constants.EMBEDDED_COLUMN_NAME_DELIMITER) != -1)
{
scNamePrefix = MetadataUtils.getEmbeddedCollectionPrefix(scName);
embeddedCollectionField = superColumnNameToFieldMap.get(scNamePrefix);
embeddedCollection = MetadataUtils.getEmbeddedCollectionInstance(embeddedCollectionField);
Object embeddedObject = populateEmbeddedObject(sc, m);
embeddedCollection.add(embeddedObject);
PropertyAccessorHelper.set(e, embeddedCollectionField, embeddedCollection);
}
else
{
boolean intoRelations = false;
if (scName.equals(Constants.FOREIGN_KEY_EMBEDDED_COLUMN_NAME))
{
intoRelations = true; // depends on control dependency: [if], data = [none]
}
for (Column column : sc.getColumns())
{
if (column != null)
{
String name = PropertyAccessorFactory.STRING.fromBytes(String.class, column.getName());
byte[] value = column.getValue();
if (value == null)
{
continue;
}
if (intoRelations)
{
String foreignKeys = PropertyAccessorFactory.STRING.fromBytes(String.class, value);
Set<String> keys = MetadataUtils.deserializeKeys(foreignKeys);
}
else
{
// set value of the field in the bean
Field field = columnNameToFieldMap.get(name);
Object embeddedObject = PropertyAccessorHelper.getObject(e, scName);
PropertyAccessorHelper.set(embeddedObject, field, value); // depends on control dependency: [if], data = [none]
}
}
}
}
}
if (log.isInfoEnabled())
{
log.info("Returning entity {} for class {}", e, clazz);
}
return e;
} } |
public class class_name {
public FluidItem createFlowItem(
FluidItem flowJobItemParam,
String flowNameParam) {
if (flowJobItemParam != null && this.serviceTicket != null) {
flowJobItemParam.setServiceTicket(this.serviceTicket);
}
//Flow Job Item Step etc...
if(flowJobItemParam != null)
{
flowJobItemParam.setFlow(flowNameParam);
}
try {
return new FluidItem(this.putJson(
flowJobItemParam, WS.Path.FlowItem.Version1.flowItemCreate()));
}
//
catch (JSONException e) {
throw new FluidClientException(e.getMessage(), e,
FluidClientException.ErrorCode.JSON_PARSING);
}
} } | public class class_name {
public FluidItem createFlowItem(
FluidItem flowJobItemParam,
String flowNameParam) {
if (flowJobItemParam != null && this.serviceTicket != null) {
flowJobItemParam.setServiceTicket(this.serviceTicket); // depends on control dependency: [if], data = [none]
}
//Flow Job Item Step etc...
if(flowJobItemParam != null)
{
flowJobItemParam.setFlow(flowNameParam); // depends on control dependency: [if], data = [none]
}
try {
return new FluidItem(this.putJson(
flowJobItemParam, WS.Path.FlowItem.Version1.flowItemCreate())); // depends on control dependency: [try], data = [none]
}
//
catch (JSONException e) {
throw new FluidClientException(e.getMessage(), e,
FluidClientException.ErrorCode.JSON_PARSING);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
private void process(ImmutableSetMultimap<Class<? extends Annotation>, Element> validElements) {
for (ProcessingStep step : steps) {
ImmutableSetMultimap<Class<? extends Annotation>, Element> stepElements =
new ImmutableSetMultimap.Builder<Class<? extends Annotation>, Element>()
.putAll(indexByAnnotation(elementsDeferredBySteps.get(step), step.annotations()))
.putAll(filterKeys(validElements, Predicates.<Object>in(step.annotations())))
.build();
if (stepElements.isEmpty()) {
elementsDeferredBySteps.removeAll(step);
} else {
Set<? extends Element> rejectedElements = step.process(stepElements);
elementsDeferredBySteps.replaceValues(
step,
transform(
rejectedElements,
new Function<Element, ElementName>() {
@Override
public ElementName apply(Element element) {
return ElementName.forAnnotatedElement(element);
}
}));
}
}
} } | public class class_name {
private void process(ImmutableSetMultimap<Class<? extends Annotation>, Element> validElements) {
for (ProcessingStep step : steps) {
ImmutableSetMultimap<Class<? extends Annotation>, Element> stepElements =
new ImmutableSetMultimap.Builder<Class<? extends Annotation>, Element>()
.putAll(indexByAnnotation(elementsDeferredBySteps.get(step), step.annotations()))
.putAll(filterKeys(validElements, Predicates.<Object>in(step.annotations())))
.build(); // depends on control dependency: [for], data = [none]
if (stepElements.isEmpty()) {
elementsDeferredBySteps.removeAll(step); // depends on control dependency: [if], data = [none]
} else {
Set<? extends Element> rejectedElements = step.process(stepElements); // depends on control dependency: [if], data = [none]
elementsDeferredBySteps.replaceValues(
step,
transform(
rejectedElements,
new Function<Element, ElementName>() {
@Override
public ElementName apply(Element element) {
return ElementName.forAnnotatedElement(element);
}
})); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
private void pdb_EXPDTA_Handler(String line) {
String technique ;
if (line.length() > 69)
technique = line.substring (10, 70).trim() ;
else
technique = line.substring(10).trim();
for (String singleTechnique: technique.split(";\\s+")) {
pdbHeader.setExperimentalTechnique(singleTechnique);
}
} } | public class class_name {
private void pdb_EXPDTA_Handler(String line) {
String technique ;
if (line.length() > 69)
technique = line.substring (10, 70).trim() ;
else
technique = line.substring(10).trim();
for (String singleTechnique: technique.split(";\\s+")) {
pdbHeader.setExperimentalTechnique(singleTechnique); // depends on control dependency: [for], data = [singleTechnique]
}
} } |
public class class_name {
private void initSeLionRemoteProxySpecificValues(RemoteProxy proxy) {
if (SeLionRemoteProxy.class.getCanonicalName().equals(
proxy.getOriginalRegistrationRequest().getConfiguration().proxy)) {
SeLionRemoteProxy srp = (SeLionRemoteProxy) proxy;
// figure out if the proxy is scheduled to shutdown
isShuttingDown = srp.isScheduledForRecycle();
// update the logsLocation if the proxy supports LogServlet
if (srp.supportsViewLogs()) {
logsLocation = proxy.getRemoteHost().toExternalForm() + "/extra/" + LogServlet.class.getSimpleName();
}
totalSessionsStarted = srp.getTotalSessionsStarted();
totalSessionsComplete = srp.getTotalSessionsComplete();
uptimeInMinutes = srp.getUptimeInMinutes();
}
} } | public class class_name {
private void initSeLionRemoteProxySpecificValues(RemoteProxy proxy) {
if (SeLionRemoteProxy.class.getCanonicalName().equals(
proxy.getOriginalRegistrationRequest().getConfiguration().proxy)) {
SeLionRemoteProxy srp = (SeLionRemoteProxy) proxy;
// figure out if the proxy is scheduled to shutdown
isShuttingDown = srp.isScheduledForRecycle(); // depends on control dependency: [if], data = [none]
// update the logsLocation if the proxy supports LogServlet
if (srp.supportsViewLogs()) {
logsLocation = proxy.getRemoteHost().toExternalForm() + "/extra/" + LogServlet.class.getSimpleName(); // depends on control dependency: [if], data = [none]
}
totalSessionsStarted = srp.getTotalSessionsStarted(); // depends on control dependency: [if], data = [none]
totalSessionsComplete = srp.getTotalSessionsComplete(); // depends on control dependency: [if], data = [none]
uptimeInMinutes = srp.getUptimeInMinutes(); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public ParameterParser getFormParamParser(String url) {
List<Context> contexts = getContextsForUrl(url);
if (contexts.size() > 0) {
return contexts.get(0).getPostParamParser();
}
return this.defaultParamParser;
} } | public class class_name {
public ParameterParser getFormParamParser(String url) {
List<Context> contexts = getContextsForUrl(url);
if (contexts.size() > 0) {
return contexts.get(0).getPostParamParser();
// depends on control dependency: [if], data = [0)]
}
return this.defaultParamParser;
} } |
public class class_name {
public WorkflowExecutionInfos withExecutionInfos(WorkflowExecutionInfo... executionInfos) {
if (this.executionInfos == null) {
setExecutionInfos(new java.util.ArrayList<WorkflowExecutionInfo>(executionInfos.length));
}
for (WorkflowExecutionInfo ele : executionInfos) {
this.executionInfos.add(ele);
}
return this;
} } | public class class_name {
public WorkflowExecutionInfos withExecutionInfos(WorkflowExecutionInfo... executionInfos) {
if (this.executionInfos == null) {
setExecutionInfos(new java.util.ArrayList<WorkflowExecutionInfo>(executionInfos.length)); // depends on control dependency: [if], data = [none]
}
for (WorkflowExecutionInfo ele : executionInfos) {
this.executionInfos.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
public int nz_index( int row , int col ) {
int col0 = col_idx[col];
int col1 = col_idx[col+1];
for (int i = col0; i < col1; i++) {
if( nz_rows[i] == row ) {
return i;
}
}
return -1;
} } | public class class_name {
public int nz_index( int row , int col ) {
int col0 = col_idx[col];
int col1 = col_idx[col+1];
for (int i = col0; i < col1; i++) {
if( nz_rows[i] == row ) {
return i; // depends on control dependency: [if], data = [none]
}
}
return -1;
} } |
public class class_name {
private boolean handleException(final Throwable t,
final HttpServletResponse resp,
final boolean serverError) {
if (serverError) {
return true;
}
try {
error(t);
sendError(t, resp);
return true;
} catch (Throwable t1) {
// Pretty much screwed if we get here
return true;
}
} } | public class class_name {
private boolean handleException(final Throwable t,
final HttpServletResponse resp,
final boolean serverError) {
if (serverError) {
return true; // depends on control dependency: [if], data = [none]
}
try {
error(t); // depends on control dependency: [try], data = [none]
sendError(t, resp); // depends on control dependency: [try], data = [none]
return true; // depends on control dependency: [try], data = [none]
} catch (Throwable t1) {
// Pretty much screwed if we get here
return true;
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public Token getMetaDataToken()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getMetaDataToken");
SibTr.exit(this, tc, "getMetaDataToken", "return=" + _metaDataToken);
}
return _metaDataToken;
} } | public class class_name {
public Token getMetaDataToken()
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
{
SibTr.entry(this, tc, "getMetaDataToken"); // depends on control dependency: [if], data = [none]
SibTr.exit(this, tc, "getMetaDataToken", "return=" + _metaDataToken); // depends on control dependency: [if], data = [none]
}
return _metaDataToken;
} } |
public class class_name {
public List<JAXBElement<Object>> get_GenericApplicationPropertyOfBridgePart() {
if (_GenericApplicationPropertyOfBridgePart == null) {
_GenericApplicationPropertyOfBridgePart = new ArrayList<JAXBElement<Object>>();
}
return this._GenericApplicationPropertyOfBridgePart;
} } | public class class_name {
public List<JAXBElement<Object>> get_GenericApplicationPropertyOfBridgePart() {
if (_GenericApplicationPropertyOfBridgePart == null) {
_GenericApplicationPropertyOfBridgePart = new ArrayList<JAXBElement<Object>>(); // depends on control dependency: [if], data = [none]
}
return this._GenericApplicationPropertyOfBridgePart;
} } |
public class class_name {
static void render(List<AbstractConfigValue> stack, StringBuilder sb, int indent, boolean atRoot, String atKey,
ConfigRenderOptions options) {
boolean commentMerge = options.getComments();
if (commentMerge) {
sb.append("# unresolved merge of " + stack.size() + " values follows (\n");
if (atKey == null) {
indent(sb, indent, options);
sb.append("# this unresolved merge will not be parseable because it's at the root of the object\n");
indent(sb, indent, options);
sb.append("# the HOCON format has no way to list multiple root objects in a single file\n");
}
}
List<AbstractConfigValue> reversed = new ArrayList<AbstractConfigValue>();
reversed.addAll(stack);
Collections.reverse(reversed);
int i = 0;
for (AbstractConfigValue v : reversed) {
if (commentMerge) {
indent(sb, indent, options);
if (atKey != null) {
sb.append("# unmerged value " + i + " for key "
+ ConfigImplUtil.renderJsonString(atKey) + " from ");
} else {
sb.append("# unmerged value " + i + " from ");
}
i += 1;
sb.append(v.origin().description());
sb.append("\n");
for (String comment : v.origin().comments()) {
indent(sb, indent, options);
sb.append("# ");
sb.append(comment);
sb.append("\n");
}
}
indent(sb, indent, options);
if (atKey != null) {
sb.append(ConfigImplUtil.renderJsonString(atKey));
if (options.getFormatted())
sb.append(" : ");
else
sb.append(":");
}
v.render(sb, indent, atRoot, options);
sb.append(",");
if (options.getFormatted())
sb.append('\n');
}
// chop comma or newline
sb.setLength(sb.length() - 1);
if (options.getFormatted()) {
sb.setLength(sb.length() - 1); // also chop comma
sb.append("\n"); // put a newline back
}
if (commentMerge) {
indent(sb, indent, options);
sb.append("# ) end of unresolved merge\n");
}
} } | public class class_name {
static void render(List<AbstractConfigValue> stack, StringBuilder sb, int indent, boolean atRoot, String atKey,
ConfigRenderOptions options) {
boolean commentMerge = options.getComments();
if (commentMerge) {
sb.append("# unresolved merge of " + stack.size() + " values follows (\n"); // depends on control dependency: [if], data = [none]
if (atKey == null) {
indent(sb, indent, options); // depends on control dependency: [if], data = [none]
sb.append("# this unresolved merge will not be parseable because it's at the root of the object\n"); // depends on control dependency: [if], data = [none]
indent(sb, indent, options); // depends on control dependency: [if], data = [none]
sb.append("# the HOCON format has no way to list multiple root objects in a single file\n"); // depends on control dependency: [if], data = [none]
}
}
List<AbstractConfigValue> reversed = new ArrayList<AbstractConfigValue>();
reversed.addAll(stack);
Collections.reverse(reversed);
int i = 0;
for (AbstractConfigValue v : reversed) {
if (commentMerge) {
indent(sb, indent, options); // depends on control dependency: [if], data = [none]
if (atKey != null) {
sb.append("# unmerged value " + i + " for key "
+ ConfigImplUtil.renderJsonString(atKey) + " from "); // depends on control dependency: [if], data = [none]
} else {
sb.append("# unmerged value " + i + " from "); // depends on control dependency: [if], data = [none]
}
i += 1; // depends on control dependency: [if], data = [none]
sb.append(v.origin().description()); // depends on control dependency: [if], data = [none]
sb.append("\n"); // depends on control dependency: [if], data = [none]
for (String comment : v.origin().comments()) {
indent(sb, indent, options); // depends on control dependency: [for], data = [none]
sb.append("# "); // depends on control dependency: [for], data = [none]
sb.append(comment); // depends on control dependency: [for], data = [comment]
sb.append("\n"); // depends on control dependency: [for], data = [none]
}
}
indent(sb, indent, options); // depends on control dependency: [for], data = [none]
if (atKey != null) {
sb.append(ConfigImplUtil.renderJsonString(atKey)); // depends on control dependency: [if], data = [(atKey]
if (options.getFormatted())
sb.append(" : ");
else
sb.append(":");
}
v.render(sb, indent, atRoot, options); // depends on control dependency: [for], data = [v]
sb.append(","); // depends on control dependency: [for], data = [none]
if (options.getFormatted())
sb.append('\n');
}
// chop comma or newline
sb.setLength(sb.length() - 1);
if (options.getFormatted()) {
sb.setLength(sb.length() - 1); // also chop comma // depends on control dependency: [if], data = [none]
sb.append("\n"); // put a newline back // depends on control dependency: [if], data = [none]
}
if (commentMerge) {
indent(sb, indent, options); // depends on control dependency: [if], data = [none]
sb.append("# ) end of unresolved merge\n");
}
} } |
public class class_name {
public boolean delete(DeleteAction deleteAction,
DeleteActionModifier deleteActionModifier) {
if (deleteActionModifier != null) {
deleteAction = deleteActionModifier.modifyDeleteAction(deleteAction);
}
return delete(deleteAction);
} } | public class class_name {
public boolean delete(DeleteAction deleteAction,
DeleteActionModifier deleteActionModifier) {
if (deleteActionModifier != null) {
deleteAction = deleteActionModifier.modifyDeleteAction(deleteAction); // depends on control dependency: [if], data = [none]
}
return delete(deleteAction);
} } |
public class class_name {
public void sessionAttributeAccessed(ISession session, Object key, Object value) {
// ArrayList sessionStateObservers = null;
/*
* Check to see if there is a non-empty list of sessionStateObservers.
*/
if (_sessionStateObservers == null || _sessionStateObservers.size() < 1) {
return;
}
// synchronized(_sessionStateObservers) {
// _sessionStateObservers = (ArrayList)_sessionStateObservers.clone();
// }
ISessionStateObserver sessionStateObserver = null;
for (int i = 0; i < _sessionStateObservers.size(); i++) {
sessionStateObserver = (ISessionStateObserver) _sessionStateObservers.get(i);
sessionStateObserver.sessionAttributeAccessed(session, key, value);
}
} } | public class class_name {
public void sessionAttributeAccessed(ISession session, Object key, Object value) {
// ArrayList sessionStateObservers = null;
/*
* Check to see if there is a non-empty list of sessionStateObservers.
*/
if (_sessionStateObservers == null || _sessionStateObservers.size() < 1) {
return; // depends on control dependency: [if], data = [none]
}
// synchronized(_sessionStateObservers) {
// _sessionStateObservers = (ArrayList)_sessionStateObservers.clone();
// }
ISessionStateObserver sessionStateObserver = null;
for (int i = 0; i < _sessionStateObservers.size(); i++) {
sessionStateObserver = (ISessionStateObserver) _sessionStateObservers.get(i); // depends on control dependency: [for], data = [i]
sessionStateObserver.sessionAttributeAccessed(session, key, value); // depends on control dependency: [for], data = [none]
}
} } |
public class class_name {
public TabbedPanel2 getTabbedSelect() {
if (tabbedSelect == null) {
tabbedSelect = new TabbedPanel2();
tabbedSelect.setPreferredSize(new Dimension(200, 400));
tabbedSelect.setName("tabbedSelect");
tabbedSelect.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
}
return tabbedSelect;
} } | public class class_name {
public TabbedPanel2 getTabbedSelect() {
if (tabbedSelect == null) {
tabbedSelect = new TabbedPanel2();
// depends on control dependency: [if], data = [none]
tabbedSelect.setPreferredSize(new Dimension(200, 400));
// depends on control dependency: [if], data = [none]
tabbedSelect.setName("tabbedSelect");
// depends on control dependency: [if], data = [none]
tabbedSelect.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
// depends on control dependency: [if], data = [none]
}
return tabbedSelect;
} } |
public class class_name {
@SafeVarargs
public static <K, V> Map<K, V> map(final Entry<? extends K, ? extends V>... entries) {
final Map<K, V> map = new LinkedHashMap<K, V>(entries.length);
for (final Entry<? extends K, ? extends V> entry : entries) {
map.put(entry.getKey(), entry.getValue());
}
return map;
} } | public class class_name {
@SafeVarargs
public static <K, V> Map<K, V> map(final Entry<? extends K, ? extends V>... entries) {
final Map<K, V> map = new LinkedHashMap<K, V>(entries.length);
for (final Entry<? extends K, ? extends V> entry : entries) {
map.put(entry.getKey(), entry.getValue()); // depends on control dependency: [for], data = [entry]
}
return map;
} } |
public class class_name {
private Schema flattenUnion(Schema schema, boolean shouldPopulateLineage, boolean flattenComplexTypes) {
Preconditions.checkNotNull(schema);
Preconditions.checkArgument(Schema.Type.UNION.equals(schema.getType()));
Schema flattenedSchema;
List<Schema> flattenedUnionMembers = new ArrayList<>();
if (null != schema.getTypes() && schema.getTypes().size() > 0) {
for (Schema oldUnionMember : schema.getTypes()) {
if (flattenComplexTypes) {
// It's member might still recursively contain records
flattenedUnionMembers.add(flatten(oldUnionMember, shouldPopulateLineage, flattenComplexTypes));
} else {
flattenedUnionMembers.add(oldUnionMember);
}
}
}
flattenedSchema = Schema.createUnion(flattenedUnionMembers);
return flattenedSchema;
} } | public class class_name {
private Schema flattenUnion(Schema schema, boolean shouldPopulateLineage, boolean flattenComplexTypes) {
Preconditions.checkNotNull(schema);
Preconditions.checkArgument(Schema.Type.UNION.equals(schema.getType()));
Schema flattenedSchema;
List<Schema> flattenedUnionMembers = new ArrayList<>();
if (null != schema.getTypes() && schema.getTypes().size() > 0) {
for (Schema oldUnionMember : schema.getTypes()) {
if (flattenComplexTypes) {
// It's member might still recursively contain records
flattenedUnionMembers.add(flatten(oldUnionMember, shouldPopulateLineage, flattenComplexTypes)); // depends on control dependency: [if], data = [none]
} else {
flattenedUnionMembers.add(oldUnionMember); // depends on control dependency: [if], data = [none]
}
}
}
flattenedSchema = Schema.createUnion(flattenedUnionMembers);
return flattenedSchema;
} } |
public class class_name {
@SuppressWarnings("unchecked")
@Override
public Boolean execute() {
for(int i = 0 ; i < agents.length ; i++) {
createRoom(i);
}
return Boolean.TRUE;
} } | public class class_name {
@SuppressWarnings("unchecked")
@Override
public Boolean execute() {
for(int i = 0 ; i < agents.length ; i++) {
createRoom(i); // depends on control dependency: [for], data = [i]
}
return Boolean.TRUE;
} } |
public class class_name {
public static final void texture(final Shape shape, Image image, final TexCoordGenerator gen) {
Texture t = TextureImpl.getLastBind();
image.getTexture().bind();
final float center[] = shape.getCenter();
fill(shape, new PointCallback() {
public float[] preRenderPoint(Shape shape, float x, float y) {
Vector2f tex = gen.getCoordFor(x, y);
GL.glTexCoord2f(tex.x, tex.y);
return new float[] {x,y};
}
});
if (t == null) {
TextureImpl.bindNone();
} else {
t.bind();
}
} } | public class class_name {
public static final void texture(final Shape shape, Image image, final TexCoordGenerator gen) {
Texture t = TextureImpl.getLastBind();
image.getTexture().bind();
final float center[] = shape.getCenter();
fill(shape, new PointCallback() {
public float[] preRenderPoint(Shape shape, float x, float y) {
Vector2f tex = gen.getCoordFor(x, y);
GL.glTexCoord2f(tex.x, tex.y);
return new float[] {x,y};
}
});
if (t == null) {
TextureImpl.bindNone();
// depends on control dependency: [if], data = [none]
} else {
t.bind();
// depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
protected void ensureColKey(E key) {
if (!colKeys.containsKey(key)) {
colKeys.put(key, colKeys.size());
addCol();
}
} } | public class class_name {
protected void ensureColKey(E key) {
if (!colKeys.containsKey(key)) {
colKeys.put(key, colKeys.size());
// depends on control dependency: [if], data = [none]
addCol();
// depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Override
public String getActions()
{
StringBuffer actions = new StringBuffer();
if (methodName != null)
actions.append(methodName);
if (methodInterface != null)
{
actions.append(',');
actions.append(methodInterface);
}
else if (methodSig != null)
{
actions.append(',');
}
if (methodSig != null)
{
actions.append(',');
actions.append(methodSig);
}
String methodSpec = null;
if (actions.length() > 0)
methodSpec = actions.toString();
return methodSpec;
} } | public class class_name {
@Override
public String getActions()
{
StringBuffer actions = new StringBuffer();
if (methodName != null)
actions.append(methodName);
if (methodInterface != null)
{
actions.append(','); // depends on control dependency: [if], data = [none]
actions.append(methodInterface); // depends on control dependency: [if], data = [(methodInterface]
}
else if (methodSig != null)
{
actions.append(','); // depends on control dependency: [if], data = [none]
}
if (methodSig != null)
{
actions.append(','); // depends on control dependency: [if], data = [none]
actions.append(methodSig); // depends on control dependency: [if], data = [(methodSig]
}
String methodSpec = null;
if (actions.length() > 0)
methodSpec = actions.toString();
return methodSpec;
} } |
public class class_name {
static InstallState getNextInstallState(InstallState current) {
List<Function<Provider<InstallState>,InstallState>> installStateFilterChain = new ArrayList<>();
for (InstallStateFilter setupExtension : InstallStateFilter.all()) {
installStateFilterChain.add(next -> setupExtension.getNextInstallState(current, next));
}
// Terminal condition: getNextState() on the current install state
installStateFilterChain.add(input -> {
// Initially, install state is unknown and
// needs to be determined
if (current == null || InstallState.UNKNOWN.equals(current)) {
return getDefaultInstallState();
}
Map<InstallState, InstallState> states = new HashMap<>();
{
states.put(InstallState.CONFIGURE_INSTANCE, InstallState.INITIAL_SETUP_COMPLETED);
states.put(InstallState.CREATE_ADMIN_USER, InstallState.CONFIGURE_INSTANCE);
states.put(InstallState.INITIAL_PLUGINS_INSTALLING, InstallState.CREATE_ADMIN_USER);
states.put(InstallState.INITIAL_SECURITY_SETUP, InstallState.NEW);
states.put(InstallState.RESTART, InstallState.RUNNING);
states.put(InstallState.UPGRADE, InstallState.INITIAL_SETUP_COMPLETED);
states.put(InstallState.DOWNGRADE, InstallState.INITIAL_SETUP_COMPLETED);
states.put(InstallState.INITIAL_SETUP_COMPLETED, InstallState.RUNNING);
}
return states.get(current);
});
ProviderChain<InstallState> chain = new ProviderChain<>(installStateFilterChain.iterator());
return chain.get();
} } | public class class_name {
static InstallState getNextInstallState(InstallState current) {
List<Function<Provider<InstallState>,InstallState>> installStateFilterChain = new ArrayList<>();
for (InstallStateFilter setupExtension : InstallStateFilter.all()) {
installStateFilterChain.add(next -> setupExtension.getNextInstallState(current, next)); // depends on control dependency: [for], data = [setupExtension]
}
// Terminal condition: getNextState() on the current install state
installStateFilterChain.add(input -> {
// Initially, install state is unknown and
// needs to be determined
if (current == null || InstallState.UNKNOWN.equals(current)) {
return getDefaultInstallState();
}
Map<InstallState, InstallState> states = new HashMap<>();
{
states.put(InstallState.CONFIGURE_INSTANCE, InstallState.INITIAL_SETUP_COMPLETED);
states.put(InstallState.CREATE_ADMIN_USER, InstallState.CONFIGURE_INSTANCE);
states.put(InstallState.INITIAL_PLUGINS_INSTALLING, InstallState.CREATE_ADMIN_USER);
states.put(InstallState.INITIAL_SECURITY_SETUP, InstallState.NEW);
states.put(InstallState.RESTART, InstallState.RUNNING);
states.put(InstallState.UPGRADE, InstallState.INITIAL_SETUP_COMPLETED);
states.put(InstallState.DOWNGRADE, InstallState.INITIAL_SETUP_COMPLETED);
states.put(InstallState.INITIAL_SETUP_COMPLETED, InstallState.RUNNING);
}
return states.get(current);
});
ProviderChain<InstallState> chain = new ProviderChain<>(installStateFilterChain.iterator());
return chain.get();
} } |
public class class_name {
public ListImportsResult withImports(String... imports) {
if (this.imports == null) {
setImports(new com.amazonaws.internal.SdkInternalList<String>(imports.length));
}
for (String ele : imports) {
this.imports.add(ele);
}
return this;
} } | public class class_name {
public ListImportsResult withImports(String... imports) {
if (this.imports == null) {
setImports(new com.amazonaws.internal.SdkInternalList<String>(imports.length)); // depends on control dependency: [if], data = [none]
}
for (String ele : imports) {
this.imports.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
public AwsSecurityFindingFilters withSourceUrl(StringFilter... sourceUrl) {
if (this.sourceUrl == null) {
setSourceUrl(new java.util.ArrayList<StringFilter>(sourceUrl.length));
}
for (StringFilter ele : sourceUrl) {
this.sourceUrl.add(ele);
}
return this;
} } | public class class_name {
public AwsSecurityFindingFilters withSourceUrl(StringFilter... sourceUrl) {
if (this.sourceUrl == null) {
setSourceUrl(new java.util.ArrayList<StringFilter>(sourceUrl.length)); // depends on control dependency: [if], data = [none]
}
for (StringFilter ele : sourceUrl) {
this.sourceUrl.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
private File createNewUniqueFile(File srcFile) throws IOException {
String dateString = getDateString();
int index = findFileIndexAndUpdateCounter(dateString);
String destFileName;
File destFile;
do {
int counter = lastCounter++;
destFileName = fileName + dateString + '.' + counter + fileExtension;
destFile = new File(directory, destFileName);
boolean success;
if (srcFile == null) {
success = destFile.createNewFile();
} else {
// We don't want to rename over an existing file, so try to
// avoid doing so with a racy exists() check.
if (!destFile.exists()) {
success = srcFile.renameTo(destFile);
} else {
success = false;
}
}
if (success) {
// Add the file to our list, which will cause old files to be
// deleted if we've reached the max.
addFile(index, destFileName);
return destFile;
}
} while (destFile.isFile());
if (srcFile != null && copyFileTo(srcFile, destFile)) {
addFile(index, destFileName);
return FileLogUtils.deleteFile(srcFile) ? destFile : null;
}
Tr.error(tc, "UNABLE_TO_DELETE_RESOURCE_NOEX", new Object[] { destFile });
return null;
} } | public class class_name {
private File createNewUniqueFile(File srcFile) throws IOException {
String dateString = getDateString();
int index = findFileIndexAndUpdateCounter(dateString);
String destFileName;
File destFile;
do {
int counter = lastCounter++;
destFileName = fileName + dateString + '.' + counter + fileExtension;
destFile = new File(directory, destFileName);
boolean success;
if (srcFile == null) {
success = destFile.createNewFile(); // depends on control dependency: [if], data = [none]
} else {
// We don't want to rename over an existing file, so try to
// avoid doing so with a racy exists() check.
if (!destFile.exists()) {
success = srcFile.renameTo(destFile); // depends on control dependency: [if], data = [none]
} else {
success = false; // depends on control dependency: [if], data = [none]
}
}
if (success) {
// Add the file to our list, which will cause old files to be
// deleted if we've reached the max.
addFile(index, destFileName); // depends on control dependency: [if], data = [none]
return destFile; // depends on control dependency: [if], data = [none]
}
} while (destFile.isFile());
if (srcFile != null && copyFileTo(srcFile, destFile)) {
addFile(index, destFileName);
return FileLogUtils.deleteFile(srcFile) ? destFile : null;
}
Tr.error(tc, "UNABLE_TO_DELETE_RESOURCE_NOEX", new Object[] { destFile });
return null;
} } |
public class class_name {
public ProjectTask getDetailChildren()
{
if (m_recDetailChildren == null)
{
RecordOwner recordOwner = this.getRecordOwner();
m_recDetailChildren = new ProjectTask(recordOwner);
if (recordOwner != null)
recordOwner.removeRecord(m_recDetailChildren);
m_recDetailChildren.addListener(new SubFileFilter(this, true));
}
return m_recDetailChildren;
} } | public class class_name {
public ProjectTask getDetailChildren()
{
if (m_recDetailChildren == null)
{
RecordOwner recordOwner = this.getRecordOwner();
m_recDetailChildren = new ProjectTask(recordOwner); // depends on control dependency: [if], data = [none]
if (recordOwner != null)
recordOwner.removeRecord(m_recDetailChildren);
m_recDetailChildren.addListener(new SubFileFilter(this, true)); // depends on control dependency: [if], data = [none]
}
return m_recDetailChildren;
} } |
public class class_name {
@Override
public void set(String propName, Object value) {
if (propName.equals("mappedProperties")) {
getMappedProperties().add(((String) value));
}
super.set(propName, value);
} } | public class class_name {
@Override
public void set(String propName, Object value) {
if (propName.equals("mappedProperties")) {
getMappedProperties().add(((String) value)); // depends on control dependency: [if], data = [none]
}
super.set(propName, value);
} } |
public class class_name {
public Query query(Schema schema, Query range) {
BooleanQuery.Builder builder = new BooleanQuery.Builder();
if (range != null) {
builder.add(range, FILTER);
}
filter.forEach(condition -> builder.add(condition.query(schema), FILTER));
query.forEach(condition -> builder.add(condition.query(schema), MUST));
BooleanQuery booleanQuery = builder.build();
return booleanQuery.clauses().isEmpty() ? new MatchAllDocsQuery() : booleanQuery;
} } | public class class_name {
public Query query(Schema schema, Query range) {
BooleanQuery.Builder builder = new BooleanQuery.Builder();
if (range != null) {
builder.add(range, FILTER); // depends on control dependency: [if], data = [(range]
}
filter.forEach(condition -> builder.add(condition.query(schema), FILTER));
query.forEach(condition -> builder.add(condition.query(schema), MUST));
BooleanQuery booleanQuery = builder.build();
return booleanQuery.clauses().isEmpty() ? new MatchAllDocsQuery() : booleanQuery;
} } |
public class class_name {
public boolean isRevoked(Certificate cert) {
if (revokedMap.isEmpty() || (!(cert instanceof X509Certificate))) {
return false;
}
X509Certificate xcert = (X509Certificate) cert;
X509IssuerSerial issuerSerial = new X509IssuerSerial(xcert);
return revokedMap.containsKey(issuerSerial);
} } | public class class_name {
public boolean isRevoked(Certificate cert) {
if (revokedMap.isEmpty() || (!(cert instanceof X509Certificate))) {
return false; // depends on control dependency: [if], data = [none]
}
X509Certificate xcert = (X509Certificate) cert;
X509IssuerSerial issuerSerial = new X509IssuerSerial(xcert);
return revokedMap.containsKey(issuerSerial);
} } |
public class class_name {
public static ClassLoader getClassLoader(Class<?> cls) {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClassLoader();
} catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back to system
// class loader...
}
if (cl == null) {
// No thread context class loader -> use class loader of this class.
cl = cls.getClassLoader();
}
return cl;
} } | public class class_name {
public static ClassLoader getClassLoader(Class<?> cls) {
ClassLoader cl = null;
try {
cl = Thread.currentThread().getContextClassLoader();
// depends on control dependency: [try], data = [none]
} catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back to system
// class loader...
}
// depends on control dependency: [catch], data = [none]
if (cl == null) {
// No thread context class loader -> use class loader of this class.
cl = cls.getClassLoader();
// depends on control dependency: [if], data = [none]
}
return cl;
} } |
public class class_name {
public final void put(final String pNm, final String pVal) {
if (isId(pNm)) {
if (this.idStrs == null) {
this.idStrs = new HashMap<String, String>();
}
this.idStrs.put(pNm, pVal);
} else {
if (this.strs == null) {
this.strs = new HashMap<String, String>();
}
this.strs.put(pNm, pVal);
}
} } | public class class_name {
public final void put(final String pNm, final String pVal) {
if (isId(pNm)) {
if (this.idStrs == null) {
this.idStrs = new HashMap<String, String>(); // depends on control dependency: [if], data = [none]
}
this.idStrs.put(pNm, pVal); // depends on control dependency: [if], data = [none]
} else {
if (this.strs == null) {
this.strs = new HashMap<String, String>(); // depends on control dependency: [if], data = [none]
}
this.strs.put(pNm, pVal); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public synchronized void close() {
LOGGER.debug("disconnect from {}", socket);
byte[] header = new byte[OtherConstants.FDFS_PROTO_PKG_LEN_SIZE + 2];
Arrays.fill(header, (byte) 0);
byte[] hex_len = BytesUtil.long2buff(0);
System.arraycopy(hex_len, 0, header, 0, hex_len.length);
header[OtherConstants.PROTO_HEADER_CMD_INDEX] = CmdConstants.FDFS_PROTO_CMD_QUIT;
header[OtherConstants.PROTO_HEADER_STATUS_INDEX] = (byte) 0;
try {
socket.getOutputStream().write(header);
socket.close();
} catch (IOException e) {
LOGGER.error("close connection error", e);
} finally {
IOUtils.closeQuietly(socket);
}
} } | public class class_name {
public synchronized void close() {
LOGGER.debug("disconnect from {}", socket);
byte[] header = new byte[OtherConstants.FDFS_PROTO_PKG_LEN_SIZE + 2];
Arrays.fill(header, (byte) 0);
byte[] hex_len = BytesUtil.long2buff(0);
System.arraycopy(hex_len, 0, header, 0, hex_len.length);
header[OtherConstants.PROTO_HEADER_CMD_INDEX] = CmdConstants.FDFS_PROTO_CMD_QUIT;
header[OtherConstants.PROTO_HEADER_STATUS_INDEX] = (byte) 0;
try {
socket.getOutputStream().write(header); // depends on control dependency: [try], data = [none]
socket.close(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
LOGGER.error("close connection error", e);
} finally { // depends on control dependency: [catch], data = [none]
IOUtils.closeQuietly(socket);
}
} } |
public class class_name {
protected boolean canRead(MediaType mediaType) {
if (mediaType == null) {
return true;
}
for (MediaType supportedMediaType : getSupportedMediaTypes()) {
if (supportedMediaType.includes(mediaType)) {
return true;
}
}
return false;
} } | public class class_name {
protected boolean canRead(MediaType mediaType) {
if (mediaType == null) {
return true; // depends on control dependency: [if], data = [none]
}
for (MediaType supportedMediaType : getSupportedMediaTypes()) {
if (supportedMediaType.includes(mediaType)) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} } |
public class class_name {
public static void expandNodes(@NonNull JTree tree)
{
for (int i = 0; i < tree.getRowCount(); i++)
{
tree.expandRow(i);
}
} } | public class class_name {
public static void expandNodes(@NonNull JTree tree)
{
for (int i = 0; i < tree.getRowCount(); i++)
{
tree.expandRow(i); // depends on control dependency: [for], data = [i]
}
} } |
public class class_name {
public final void aggCallSite(AggItem aggItem) throws RecognitionException {
Token x=null;
Token y=null;
String p =null;
try {
// druidG.g:458:2: (p= aggFunc ( ( WS )? LPARAN ( WS )? (x= ID ) ( ( WS )? ',' ( WS )? y= ID )* ( WS )? RPARAN ) | COUNT ( '(*)' ) )
int alt198=2;
int LA198_0 = input.LA(1);
if ( (LA198_0==DOUBLE_SUM||LA198_0==HYPER_UNIQUE||LA198_0==JAVASCRIPT||LA198_0==LONG_SUM||LA198_0==MAX||LA198_0==MIN||LA198_0==UNIQUE) ) {
alt198=1;
}
else if ( (LA198_0==COUNT) ) {
alt198=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 198, 0, input);
throw nvae;
}
switch (alt198) {
case 1 :
// druidG.g:458:4: p= aggFunc ( ( WS )? LPARAN ( WS )? (x= ID ) ( ( WS )? ',' ( WS )? y= ID )* ( WS )? RPARAN )
{
pushFollow(FOLLOW_aggFunc_in_aggCallSite3076);
p=aggFunc();
state._fsp--;
aggItem.setAggType(p);
// druidG.g:458:39: ( ( WS )? LPARAN ( WS )? (x= ID ) ( ( WS )? ',' ( WS )? y= ID )* ( WS )? RPARAN )
// druidG.g:458:40: ( WS )? LPARAN ( WS )? (x= ID ) ( ( WS )? ',' ( WS )? y= ID )* ( WS )? RPARAN
{
// druidG.g:458:40: ( WS )?
int alt192=2;
int LA192_0 = input.LA(1);
if ( (LA192_0==WS) ) {
alt192=1;
}
switch (alt192) {
case 1 :
// druidG.g:458:40: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3081);
}
break;
}
match(input,LPARAN,FOLLOW_LPARAN_in_aggCallSite3084);
// druidG.g:458:51: ( WS )?
int alt193=2;
int LA193_0 = input.LA(1);
if ( (LA193_0==WS) ) {
alt193=1;
}
switch (alt193) {
case 1 :
// druidG.g:458:51: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3086);
}
break;
}
// druidG.g:458:55: (x= ID )
// druidG.g:458:57: x= ID
{
x=(Token)match(input,ID,FOLLOW_ID_in_aggCallSite3093);
aggItem.setFieldName((x!=null?x.getText():null));
}
// druidG.g:458:96: ( ( WS )? ',' ( WS )? y= ID )*
loop196:
while (true) {
int alt196=2;
int LA196_0 = input.LA(1);
if ( (LA196_0==WS) ) {
int LA196_1 = input.LA(2);
if ( (LA196_1==91) ) {
alt196=1;
}
}
else if ( (LA196_0==91) ) {
alt196=1;
}
switch (alt196) {
case 1 :
// druidG.g:458:97: ( WS )? ',' ( WS )? y= ID
{
// druidG.g:458:97: ( WS )?
int alt194=2;
int LA194_0 = input.LA(1);
if ( (LA194_0==WS) ) {
alt194=1;
}
switch (alt194) {
case 1 :
// druidG.g:458:97: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3099);
}
break;
}
match(input,91,FOLLOW_91_in_aggCallSite3102);
// druidG.g:458:105: ( WS )?
int alt195=2;
int LA195_0 = input.LA(1);
if ( (LA195_0==WS) ) {
alt195=1;
}
switch (alt195) {
case 1 :
// druidG.g:458:105: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3104);
}
break;
}
y=(Token)match(input,ID,FOLLOW_ID_in_aggCallSite3109);
if (aggItem.fieldNames == null || aggItem.fieldNames.isEmpty()) {
aggItem.fieldNames = new ArrayList<>();
aggItem.fieldNames.add(aggItem.fieldName);
aggItem.fieldName = null;
}
aggItem.fieldNames.add((y!=null?y.getText():null));
}
break;
default :
break loop196;
}
}
// druidG.g:465:6: ( WS )?
int alt197=2;
int LA197_0 = input.LA(1);
if ( (LA197_0==WS) ) {
alt197=1;
}
switch (alt197) {
case 1 :
// druidG.g:465:6: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3115);
}
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_aggCallSite3118);
}
}
break;
case 2 :
// druidG.g:466:4: COUNT ( '(*)' )
{
match(input,COUNT,FOLLOW_COUNT_in_aggCallSite3125);
aggItem.setAggType("count");
// druidG.g:466:41: ( '(*)' )
// druidG.g:466:42: '(*)'
{
match(input,89,FOLLOW_89_in_aggCallSite3130);
}
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
} } | public class class_name {
public final void aggCallSite(AggItem aggItem) throws RecognitionException {
Token x=null;
Token y=null;
String p =null;
try {
// druidG.g:458:2: (p= aggFunc ( ( WS )? LPARAN ( WS )? (x= ID ) ( ( WS )? ',' ( WS )? y= ID )* ( WS )? RPARAN ) | COUNT ( '(*)' ) )
int alt198=2;
int LA198_0 = input.LA(1);
if ( (LA198_0==DOUBLE_SUM||LA198_0==HYPER_UNIQUE||LA198_0==JAVASCRIPT||LA198_0==LONG_SUM||LA198_0==MAX||LA198_0==MIN||LA198_0==UNIQUE) ) {
alt198=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA198_0==COUNT) ) {
alt198=2; // depends on control dependency: [if], data = [none]
}
else {
NoViableAltException nvae =
new NoViableAltException("", 198, 0, input);
throw nvae;
}
switch (alt198) {
case 1 :
// druidG.g:458:4: p= aggFunc ( ( WS )? LPARAN ( WS )? (x= ID ) ( ( WS )? ',' ( WS )? y= ID )* ( WS )? RPARAN )
{
pushFollow(FOLLOW_aggFunc_in_aggCallSite3076);
p=aggFunc();
state._fsp--;
aggItem.setAggType(p);
// druidG.g:458:39: ( ( WS )? LPARAN ( WS )? (x= ID ) ( ( WS )? ',' ( WS )? y= ID )* ( WS )? RPARAN )
// druidG.g:458:40: ( WS )? LPARAN ( WS )? (x= ID ) ( ( WS )? ',' ( WS )? y= ID )* ( WS )? RPARAN
{
// druidG.g:458:40: ( WS )?
int alt192=2;
int LA192_0 = input.LA(1);
if ( (LA192_0==WS) ) {
alt192=1; // depends on control dependency: [if], data = [none]
}
switch (alt192) {
case 1 :
// druidG.g:458:40: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3081);
}
break;
}
match(input,LPARAN,FOLLOW_LPARAN_in_aggCallSite3084);
// druidG.g:458:51: ( WS )?
int alt193=2;
int LA193_0 = input.LA(1);
if ( (LA193_0==WS) ) {
alt193=1; // depends on control dependency: [if], data = [none]
}
switch (alt193) {
case 1 :
// druidG.g:458:51: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3086);
}
break;
}
// druidG.g:458:55: (x= ID )
// druidG.g:458:57: x= ID
{
x=(Token)match(input,ID,FOLLOW_ID_in_aggCallSite3093);
aggItem.setFieldName((x!=null?x.getText():null));
}
// druidG.g:458:96: ( ( WS )? ',' ( WS )? y= ID )*
loop196:
while (true) {
int alt196=2;
int LA196_0 = input.LA(1);
if ( (LA196_0==WS) ) {
int LA196_1 = input.LA(2);
if ( (LA196_1==91) ) {
alt196=1; // depends on control dependency: [if], data = [none]
}
}
else if ( (LA196_0==91) ) {
alt196=1; // depends on control dependency: [if], data = [none]
}
switch (alt196) {
case 1 :
// druidG.g:458:97: ( WS )? ',' ( WS )? y= ID
{
// druidG.g:458:97: ( WS )?
int alt194=2;
int LA194_0 = input.LA(1);
if ( (LA194_0==WS) ) {
alt194=1; // depends on control dependency: [if], data = [none]
}
switch (alt194) {
case 1 :
// druidG.g:458:97: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3099);
}
break;
}
match(input,91,FOLLOW_91_in_aggCallSite3102);
// druidG.g:458:105: ( WS )?
int alt195=2;
int LA195_0 = input.LA(1);
if ( (LA195_0==WS) ) {
alt195=1; // depends on control dependency: [if], data = [none]
}
switch (alt195) {
case 1 :
// druidG.g:458:105: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3104);
}
break;
}
y=(Token)match(input,ID,FOLLOW_ID_in_aggCallSite3109);
if (aggItem.fieldNames == null || aggItem.fieldNames.isEmpty()) {
aggItem.fieldNames = new ArrayList<>(); // depends on control dependency: [if], data = [none]
aggItem.fieldNames.add(aggItem.fieldName); // depends on control dependency: [if], data = [none]
aggItem.fieldName = null; // depends on control dependency: [if], data = [none]
}
aggItem.fieldNames.add((y!=null?y.getText():null));
}
break;
default :
break loop196;
}
}
// druidG.g:465:6: ( WS )?
int alt197=2;
int LA197_0 = input.LA(1);
if ( (LA197_0==WS) ) {
alt197=1; // depends on control dependency: [if], data = [none]
}
switch (alt197) {
case 1 :
// druidG.g:465:6: WS
{
match(input,WS,FOLLOW_WS_in_aggCallSite3115);
}
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_aggCallSite3118);
}
}
break;
case 2 :
// druidG.g:466:4: COUNT ( '(*)' )
{
match(input,COUNT,FOLLOW_COUNT_in_aggCallSite3125);
aggItem.setAggType("count");
// druidG.g:466:41: ( '(*)' )
// druidG.g:466:42: '(*)'
{
match(input,89,FOLLOW_89_in_aggCallSite3130);
}
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
}
} } |
public class class_name {
private Parser<Class<?>> arrayClass() {
Parser<Class<?>> arrayType = FQN.next(name -> {
// Only invoked when we already see a "[" at the beginning.
Class<?> primitiveArray = PRIMITIVE_ARRAY_TYPES.get("[" + name);
if (primitiveArray != null) return Parsers.constant(primitiveArray);
if (name.startsWith("L") && name.endsWith(";")) {
String className = name.substring(1, name.length() - 1);
return Parsers.constant(Types.newArrayType(loadClass(className)));
} else {
return Parsers.expect("array class internal name");
}
});
return TERMS.token("[") // must be an array internal format from this point on.
.next(arrayType.prefix(TERMS.token("[").retn(Types::newArrayType)));
} } | public class class_name {
private Parser<Class<?>> arrayClass() {
Parser<Class<?>> arrayType = FQN.next(name -> {
// Only invoked when we already see a "[" at the beginning.
Class<?> primitiveArray = PRIMITIVE_ARRAY_TYPES.get("[" + name);
if (primitiveArray != null) return Parsers.constant(primitiveArray);
if (name.startsWith("L") && name.endsWith(";")) {
String className = name.substring(1, name.length() - 1);
return Parsers.constant(Types.newArrayType(loadClass(className))); // depends on control dependency: [if], data = [none]
} else {
return Parsers.expect("array class internal name"); // depends on control dependency: [if], data = [none]
}
});
return TERMS.token("[") // must be an array internal format from this point on.
.next(arrayType.prefix(TERMS.token("[").retn(Types::newArrayType)));
} } |
public class class_name {
public static StatusJson wrapState(PipelineStatus status) {
if(status == null) {
return null;
}
switch(status) {
case STOPPED:
return StatusJson.STOPPED;
case STOPPING:
return StatusJson.STOPPING;
case RUNNING:
return StatusJson.RUNNING;
case RUN_ERROR:
return StatusJson.RUN_ERROR;
case FINISHED:
return StatusJson.FINISHED;
case CONNECTING:
return StatusJson.CONNECTING;
case CONNECT_ERROR:
return StatusJson.CONNECT_ERROR;
case DISCONNECTED:
return StatusJson.DISCONNECTED;
case DISCONNECTING:
return StatusJson.DISCONNECTING;
case EDITED:
return StatusJson.EDITED;
case FINISHING:
return StatusJson.FINISHING;
case KILLED:
return StatusJson.KILLED;
case RUNNING_ERROR:
return StatusJson.RUNNING_ERROR;
case STARTING:
return StatusJson.STARTING;
case STARTING_ERROR:
return StatusJson.STARTING_ERROR;
case START_ERROR:
return StatusJson.START_ERROR;
case RETRY:
return StatusJson.RETRY;
case STOP_ERROR:
return StatusJson.STOP_ERROR;
case STOPPING_ERROR:
return StatusJson.STOPPING_ERROR;
case DELETED:
return StatusJson.DELETED;
default:
throw new IllegalArgumentException("Unrecognized state" + status);
}
} } | public class class_name {
public static StatusJson wrapState(PipelineStatus status) {
if(status == null) {
return null; // depends on control dependency: [if], data = [none]
}
switch(status) {
case STOPPED:
return StatusJson.STOPPED;
case STOPPING:
return StatusJson.STOPPING;
case RUNNING:
return StatusJson.RUNNING;
case RUN_ERROR:
return StatusJson.RUN_ERROR;
case FINISHED:
return StatusJson.FINISHED;
case CONNECTING:
return StatusJson.CONNECTING;
case CONNECT_ERROR:
return StatusJson.CONNECT_ERROR;
case DISCONNECTED:
return StatusJson.DISCONNECTED;
case DISCONNECTING:
return StatusJson.DISCONNECTING;
case EDITED:
return StatusJson.EDITED;
case FINISHING:
return StatusJson.FINISHING;
case KILLED:
return StatusJson.KILLED;
case RUNNING_ERROR:
return StatusJson.RUNNING_ERROR;
case STARTING:
return StatusJson.STARTING;
case STARTING_ERROR:
return StatusJson.STARTING_ERROR;
case START_ERROR:
return StatusJson.START_ERROR;
case RETRY:
return StatusJson.RETRY;
case STOP_ERROR:
return StatusJson.STOP_ERROR;
case STOPPING_ERROR:
return StatusJson.STOPPING_ERROR;
case DELETED:
return StatusJson.DELETED;
default:
throw new IllegalArgumentException("Unrecognized state" + status);
}
} } |
public class class_name {
public EClass getIfcColourOrFactor() {
if (ifcColourOrFactorEClass == null) {
ifcColourOrFactorEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(943);
}
return ifcColourOrFactorEClass;
} } | public class class_name {
public EClass getIfcColourOrFactor() {
if (ifcColourOrFactorEClass == null) {
ifcColourOrFactorEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(943);
// depends on control dependency: [if], data = [none]
}
return ifcColourOrFactorEClass;
} } |
public class class_name {
private RRBudgetDocument getRRBudget() {
deleteAutoGenNarratives();
RRBudgetDocument rrBudgetDocument = RRBudgetDocument.Factory
.newInstance();
RRBudget rrBudget = RRBudget.Factory.newInstance();
rrBudget.setFormVersion(FormVersion.v1_1.getVersion());
if (pdDoc.getDevelopmentProposal().getApplicantOrganization() != null) {
rrBudget.setDUNSID(pdDoc.getDevelopmentProposal()
.getApplicantOrganization().getOrganization()
.getDunsNumber());
rrBudget.setOrganizationName(pdDoc.getDevelopmentProposal()
.getApplicantOrganization().getOrganization()
.getOrganizationName());
}
rrBudget.setBudgetType(BudgetTypeDataType.PROJECT);
// Set default values for mandatory fields
rrBudget.setBudgetYear1(BudgetYear1DataType.Factory.newInstance());
List<BudgetPeriodDto> budgetperiodList;
BudgetSummaryDto budgetSummary = null;
try {
validateBudgetForForm(pdDoc);
budgetperiodList = s2sBudgetCalculatorService
.getBudgetPeriods(pdDoc);
budgetSummary = s2sBudgetCalculatorService.getBudgetInfo(pdDoc,budgetperiodList);
} catch (S2SException e) {
LOG.error(e.getMessage(), e);
return rrBudgetDocument;
}
for (BudgetPeriodDto budgetPeriodData : budgetperiodList) {
if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P1.getNum()) {
rrBudget
.setBudgetYear1(getBudgetYear1DataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P2.getNum()) {
rrBudget
.setBudgetYear2(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P3.getNum()) {
rrBudget
.setBudgetYear3(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P4.getNum()) {
rrBudget
.setBudgetYear4(getBudgetYearDataType(budgetPeriodData));
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P5.getNum()) {
rrBudget
.setBudgetYear5(getBudgetYearDataType(budgetPeriodData));
}
}
for (BudgetPeriodDto budgetPeriodData : budgetperiodList) {
if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P1.getNum()) {
rrBudget
.setBudgetYear1(getBudgetJustificationAttachment(rrBudget.getBudgetYear1()));
}
}
rrBudget.setBudgetSummary(getBudgetSummary(budgetSummary));
rrBudgetDocument.setRRBudget(rrBudget);
return rrBudgetDocument;
} } | public class class_name {
private RRBudgetDocument getRRBudget() {
deleteAutoGenNarratives();
RRBudgetDocument rrBudgetDocument = RRBudgetDocument.Factory
.newInstance();
RRBudget rrBudget = RRBudget.Factory.newInstance();
rrBudget.setFormVersion(FormVersion.v1_1.getVersion());
if (pdDoc.getDevelopmentProposal().getApplicantOrganization() != null) {
rrBudget.setDUNSID(pdDoc.getDevelopmentProposal()
.getApplicantOrganization().getOrganization()
.getDunsNumber()); // depends on control dependency: [if], data = [none]
rrBudget.setOrganizationName(pdDoc.getDevelopmentProposal()
.getApplicantOrganization().getOrganization()
.getOrganizationName()); // depends on control dependency: [if], data = [none]
}
rrBudget.setBudgetType(BudgetTypeDataType.PROJECT);
// Set default values for mandatory fields
rrBudget.setBudgetYear1(BudgetYear1DataType.Factory.newInstance());
List<BudgetPeriodDto> budgetperiodList;
BudgetSummaryDto budgetSummary = null;
try {
validateBudgetForForm(pdDoc); // depends on control dependency: [try], data = [none]
budgetperiodList = s2sBudgetCalculatorService
.getBudgetPeriods(pdDoc); // depends on control dependency: [try], data = [none]
budgetSummary = s2sBudgetCalculatorService.getBudgetInfo(pdDoc,budgetperiodList); // depends on control dependency: [try], data = [none]
} catch (S2SException e) {
LOG.error(e.getMessage(), e);
return rrBudgetDocument;
} // depends on control dependency: [catch], data = [none]
for (BudgetPeriodDto budgetPeriodData : budgetperiodList) {
if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P1.getNum()) {
rrBudget
.setBudgetYear1(getBudgetYear1DataType(budgetPeriodData)); // depends on control dependency: [if], data = [none]
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P2.getNum()) {
rrBudget
.setBudgetYear2(getBudgetYearDataType(budgetPeriodData)); // depends on control dependency: [if], data = [none]
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P3.getNum()) {
rrBudget
.setBudgetYear3(getBudgetYearDataType(budgetPeriodData)); // depends on control dependency: [if], data = [none]
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P4.getNum()) {
rrBudget
.setBudgetYear4(getBudgetYearDataType(budgetPeriodData)); // depends on control dependency: [if], data = [none]
} else if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P5.getNum()) {
rrBudget
.setBudgetYear5(getBudgetYearDataType(budgetPeriodData)); // depends on control dependency: [if], data = [none]
}
}
for (BudgetPeriodDto budgetPeriodData : budgetperiodList) {
if (budgetPeriodData.getBudgetPeriod() == BudgetPeriodNum.P1.getNum()) {
rrBudget
.setBudgetYear1(getBudgetJustificationAttachment(rrBudget.getBudgetYear1())); // depends on control dependency: [if], data = [none]
}
}
rrBudget.setBudgetSummary(getBudgetSummary(budgetSummary));
rrBudgetDocument.setRRBudget(rrBudget);
return rrBudgetDocument;
} } |
public class class_name {
public void setSecurityGroupIdList(java.util.Collection<String> securityGroupIdList) {
if (securityGroupIdList == null) {
this.securityGroupIdList = null;
return;
}
this.securityGroupIdList = new java.util.ArrayList<String>(securityGroupIdList);
} } | public class class_name {
public void setSecurityGroupIdList(java.util.Collection<String> securityGroupIdList) {
if (securityGroupIdList == null) {
this.securityGroupIdList = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.securityGroupIdList = new java.util.ArrayList<String>(securityGroupIdList);
} } |
public class class_name {
@Override
public IScan getScanByNumLower(int scanNum) {
IScan scan = getNum2scan().lowerEntry(scanNum).getValue();
if (scan != null) {
return scan;
}
return null;
} } | public class class_name {
@Override
public IScan getScanByNumLower(int scanNum) {
IScan scan = getNum2scan().lowerEntry(scanNum).getValue();
if (scan != null) {
return scan; // depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
private void emitSuiteStart(Description description, long startTimestamp) throws IOException {
String suiteName = description.getDisplayName();
if (useSimpleNames) {
if (suiteName.lastIndexOf('.') >= 0) {
suiteName = suiteName.substring(suiteName.lastIndexOf('.') + 1);
}
}
logShort(shortTimestamp(startTimestamp) +
"Suite: " +
FormattingUtils.padTo(maxClassNameColumns, suiteName, "[...]"));
} } | public class class_name {
private void emitSuiteStart(Description description, long startTimestamp) throws IOException {
String suiteName = description.getDisplayName();
if (useSimpleNames) {
if (suiteName.lastIndexOf('.') >= 0) {
suiteName = suiteName.substring(suiteName.lastIndexOf('.') + 1); // depends on control dependency: [if], data = [(suiteName.lastIndexOf('.')]
}
}
logShort(shortTimestamp(startTimestamp) +
"Suite: " +
FormattingUtils.padTo(maxClassNameColumns, suiteName, "[...]"));
} } |
public class class_name {
@Override
public void moveLocation(double extrp, Direction direction, Direction... directions)
{
double vx = direction.getDirectionHorizontal();
double vy = direction.getDirectionVertical();
for (final Direction current : directions)
{
vx += current.getDirectionHorizontal();
vy += current.getDirectionVertical();
}
setLocation(x + vx * extrp, y + vy * extrp);
} } | public class class_name {
@Override
public void moveLocation(double extrp, Direction direction, Direction... directions)
{
double vx = direction.getDirectionHorizontal();
double vy = direction.getDirectionVertical();
for (final Direction current : directions)
{
vx += current.getDirectionHorizontal(); // depends on control dependency: [for], data = [current]
vy += current.getDirectionVertical(); // depends on control dependency: [for], data = [current]
}
setLocation(x + vx * extrp, y + vy * extrp);
} } |
public class class_name {
public void execute(Context context) throws ActionExecutionException{
Action action = checkNotNull(getChild());
// start a timer that will set the timesup flag to true
Timer timer = new Timer();
TimerTask task = new TimerTask(){
@Override
public void run() {
timesupFlag = true;
}
};
if (timeout < Long.MAX_VALUE){
timer.schedule(task, timeout);
}
ActionExecutionException exception = null;
timesupFlag = false;
stopFlag = false;
while(!timesupFlag && !stopFlag){
try{
action.execute(context);
return;
}catch(ActionExecutionException e){
exception = e;
}
synchronized (this){
try {
this.wait(interval);
} catch (InterruptedException e) {
}
}
}
if (timesupFlag){
// execution does not succeed before timeout
// rethrow the exception
if (exception != null)
throw exception;
}
} } | public class class_name {
public void execute(Context context) throws ActionExecutionException{
Action action = checkNotNull(getChild());
// start a timer that will set the timesup flag to true
Timer timer = new Timer();
TimerTask task = new TimerTask(){
@Override
public void run() {
timesupFlag = true;
}
};
if (timeout < Long.MAX_VALUE){
timer.schedule(task, timeout);
}
ActionExecutionException exception = null;
timesupFlag = false;
stopFlag = false;
while(!timesupFlag && !stopFlag){
try{
action.execute(context);
return;
}catch(ActionExecutionException e){
exception = e;
}
synchronized (this){
try {
this.wait(interval); // depends on control dependency: [try], data = [none]
} catch (InterruptedException e) {
} // depends on control dependency: [catch], data = [none]
}
}
if (timesupFlag){
// execution does not succeed before timeout
// rethrow the exception
if (exception != null)
throw exception;
}
} } |
public class class_name {
public Observable<ServiceResponse<Page<RouteFilterRuleInner>>> listByRouteFilterNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listByRouteFilterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<RouteFilterRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<RouteFilterRuleInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<RouteFilterRuleInner>> result = listByRouteFilterNextDelegate(response);
return Observable.just(new ServiceResponse<Page<RouteFilterRuleInner>>(result.body(), result.response()));
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} } | public class class_name {
public Observable<ServiceResponse<Page<RouteFilterRuleInner>>> listByRouteFilterNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
}
String nextUrl = String.format("%s", nextPageLink);
return service.listByRouteFilterNext(nextUrl, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Page<RouteFilterRuleInner>>>>() {
@Override
public Observable<ServiceResponse<Page<RouteFilterRuleInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<RouteFilterRuleInner>> result = listByRouteFilterNextDelegate(response);
return Observable.just(new ServiceResponse<Page<RouteFilterRuleInner>>(result.body(), result.response())); // 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 EClass getIfcDraughtingPreDefinedColour() {
if (ifcDraughtingPreDefinedColourEClass == null) {
ifcDraughtingPreDefinedColourEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(198);
}
return ifcDraughtingPreDefinedColourEClass;
} } | public class class_name {
@Override
public EClass getIfcDraughtingPreDefinedColour() {
if (ifcDraughtingPreDefinedColourEClass == null) {
ifcDraughtingPreDefinedColourEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(198);
// depends on control dependency: [if], data = [none]
}
return ifcDraughtingPreDefinedColourEClass;
} } |
public class class_name {
public static void main(String[] args)
{
String[] argsDefault = {};
// String[] argsDefault = {"local=Jdbc", "remote=Jdbc", "table=Jdbc", "databaseproduct=cloudscape"};
if ((args == null) || (args.length == 0))
args = argsDefault;
Map<String,Object> properties = new Hashtable<String,Object>();
Util.parseArgs(properties, args);
if (properties.get(DBParams.LOCAL) == null)
properties.put(DBParams.LOCAL, DBParams.JDBC);
if (properties.get(DBParams.REMOTE) == null)
properties.put(DBParams.REMOTE, DBParams.JDBC);
if (properties.get(DBParams.TABLE) == null)
properties.put(DBParams.TABLE, DBParams.JDBC);
String archiveRoot = (String)properties.get("archiveDir");
if (archiveRoot == null)
archiveRoot = "./" + DEFAULT_ARCHIVE_DIR;
String recordClass = "org.jbundle.main.user.db.UserGroup";
if (properties.get(DBParams.RECORD) != null)
recordClass = properties.get(DBParams.RECORD).toString();
Environment env = new Environment(properties);
Application app = new MainApplication(env, properties, null);
Task task = new AutoTask(app, null, null);
XmlInOut test = new XmlInOut(task, null, null);
if ((archiveRoot.endsWith("/")) || (archiveRoot.endsWith(File.separator)))
archiveRoot = archiveRoot.substring(0, archiveRoot.length() - 1);
test.archiveRoot = archiveRoot;
boolean bAllFiles = false;
if (DBConstants.TRUE.equalsIgnoreCase((String)properties.get("allFiles")))
bAllFiles = true;
if (bAllFiles)
test.importArchives(archiveRoot, null); // Import the entire archive
else
{
Record record = Record.makeRecordFromClassName(recordClass, test);
String archiveFile = "/main_user/org/jbundle/main/user/db/UserGroup.xml";
if (properties.get("archiveFile") != null)
archiveFile = properties.get("archiveFile").toString();
if (!test.importXML(record.getTable(), archiveRoot + archiveFile, null)) // Import the menu file.
System.exit(1);
// Record record = new org.jbundle.main.db.Menus(recordOwner);
// test.importXML(record, "archive/main/db/Menus.xml"); // Import the menu file.
record.free();
}
test.free();
test = null;
Environment.getEnvironment(null).free();
System.exit(0);
} } | public class class_name {
public static void main(String[] args)
{
String[] argsDefault = {};
// String[] argsDefault = {"local=Jdbc", "remote=Jdbc", "table=Jdbc", "databaseproduct=cloudscape"};
if ((args == null) || (args.length == 0))
args = argsDefault;
Map<String,Object> properties = new Hashtable<String,Object>();
Util.parseArgs(properties, args);
if (properties.get(DBParams.LOCAL) == null)
properties.put(DBParams.LOCAL, DBParams.JDBC);
if (properties.get(DBParams.REMOTE) == null)
properties.put(DBParams.REMOTE, DBParams.JDBC);
if (properties.get(DBParams.TABLE) == null)
properties.put(DBParams.TABLE, DBParams.JDBC);
String archiveRoot = (String)properties.get("archiveDir");
if (archiveRoot == null)
archiveRoot = "./" + DEFAULT_ARCHIVE_DIR;
String recordClass = "org.jbundle.main.user.db.UserGroup";
if (properties.get(DBParams.RECORD) != null)
recordClass = properties.get(DBParams.RECORD).toString();
Environment env = new Environment(properties);
Application app = new MainApplication(env, properties, null);
Task task = new AutoTask(app, null, null);
XmlInOut test = new XmlInOut(task, null, null);
if ((archiveRoot.endsWith("/")) || (archiveRoot.endsWith(File.separator)))
archiveRoot = archiveRoot.substring(0, archiveRoot.length() - 1);
test.archiveRoot = archiveRoot;
boolean bAllFiles = false;
if (DBConstants.TRUE.equalsIgnoreCase((String)properties.get("allFiles")))
bAllFiles = true;
if (bAllFiles)
test.importArchives(archiveRoot, null); // Import the entire archive
else
{
Record record = Record.makeRecordFromClassName(recordClass, test);
String archiveFile = "/main_user/org/jbundle/main/user/db/UserGroup.xml";
if (properties.get("archiveFile") != null)
archiveFile = properties.get("archiveFile").toString();
if (!test.importXML(record.getTable(), archiveRoot + archiveFile, null)) // Import the menu file.
System.exit(1);
// Record record = new org.jbundle.main.db.Menus(recordOwner);
// test.importXML(record, "archive/main/db/Menus.xml"); // Import the menu file.
record.free(); // depends on control dependency: [if], data = [none]
}
test.free();
test = null;
Environment.getEnvironment(null).free();
System.exit(0);
} } |
public class class_name {
@Trivial
public static void printTrace(String key, Object value, int tabLevel) {
if (tc.isDebugEnabled()) {
StringBuilder msg = new StringBuilder();
for (int count = 0; count < tabLevel; count++) {
msg.append("\t");
}
if (value != null) {
msg.append(key);
msg.append(":");
msg.append(value);
} else {
msg.append(key);
}
Tr.debug(tc, msg.toString());
}
} } | public class class_name {
@Trivial
public static void printTrace(String key, Object value, int tabLevel) {
if (tc.isDebugEnabled()) {
StringBuilder msg = new StringBuilder();
for (int count = 0; count < tabLevel; count++) {
msg.append("\t"); // depends on control dependency: [for], data = [none]
}
if (value != null) {
msg.append(key); // depends on control dependency: [if], data = [none]
msg.append(":"); // depends on control dependency: [if], data = [none]
msg.append(value); // depends on control dependency: [if], data = [(value]
} else {
msg.append(key); // depends on control dependency: [if], data = [none]
}
Tr.debug(tc, msg.toString()); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private Set<Location> waitForTasksCompleted() {
try {
Set<Location> targets = new HashSet<>();
FutureTask<Set<Location>> task;
while ((task = tasks.poll()) != null) {
// wait for completion
if (!task.isDone())
targets.addAll(task.get());
}
return targets;
} catch (InterruptedException|ExecutionException e) {
throw new Error(e);
}
} } | public class class_name {
private Set<Location> waitForTasksCompleted() {
try {
Set<Location> targets = new HashSet<>();
FutureTask<Set<Location>> task;
while ((task = tasks.poll()) != null) {
// wait for completion
if (!task.isDone())
targets.addAll(task.get());
}
return targets; // depends on control dependency: [try], data = [none]
} catch (InterruptedException|ExecutionException e) {
throw new Error(e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
@Override
public boolean listenToResultSet(final BenchmarkMethod meth, final AbstractMeter meter, final double data) {
Method m = meth.getMethodToBench();
final PrintStream stream = setUpNewPrintStream(false, m.getDeclaringClass().getSimpleName(), m.getName(), meter.getName());
if (!firstResult) {
stream.append(",");
}
stream.append(Double.toString(data));
stream.flush();
firstResult = false;
return true;
} } | public class class_name {
@Override
public boolean listenToResultSet(final BenchmarkMethod meth, final AbstractMeter meter, final double data) {
Method m = meth.getMethodToBench();
final PrintStream stream = setUpNewPrintStream(false, m.getDeclaringClass().getSimpleName(), m.getName(), meter.getName());
if (!firstResult) {
stream.append(","); // depends on control dependency: [if], data = [none]
}
stream.append(Double.toString(data));
stream.flush();
firstResult = false;
return true;
} } |
public class class_name {
public Optional<InputStream> getResourceAsStream(String path) {
if (!isDirectory(path)) {
return Optional.ofNullable(classLoader.getResourceAsStream(prefixPath(path)));
}
return Optional.empty();
} } | public class class_name {
public Optional<InputStream> getResourceAsStream(String path) {
if (!isDirectory(path)) {
return Optional.ofNullable(classLoader.getResourceAsStream(prefixPath(path))); // depends on control dependency: [if], data = [none]
}
return Optional.empty();
} } |
public class class_name {
public void setExcludedMembers(java.util.Collection<String> excludedMembers) {
if (excludedMembers == null) {
this.excludedMembers = null;
return;
}
this.excludedMembers = new com.amazonaws.internal.SdkInternalList<String>(excludedMembers);
} } | public class class_name {
public void setExcludedMembers(java.util.Collection<String> excludedMembers) {
if (excludedMembers == null) {
this.excludedMembers = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.excludedMembers = new com.amazonaws.internal.SdkInternalList<String>(excludedMembers);
} } |
public class class_name {
@Override
public IPermission newPermission(String owner, IAuthorizationPrincipal principal) {
IPermission p = getPermissionStore().newInstance(owner);
if (principal != null) {
String pString = getPrincipalString(principal);
p.setPrincipal(pString);
}
return p;
} } | public class class_name {
@Override
public IPermission newPermission(String owner, IAuthorizationPrincipal principal) {
IPermission p = getPermissionStore().newInstance(owner);
if (principal != null) {
String pString = getPrincipalString(principal);
p.setPrincipal(pString); // depends on control dependency: [if], data = [none]
}
return p;
} } |
public class class_name {
static StatsData aggregateStats(Collection<StatsData> dataSet) {
StatsData combined = new StatsData();
for (StatsData stats : dataSet) {
if (stats.count == 0) {
continue;
}
if (combined.total == 0) {
combined.min = stats.min;
combined.max = stats.max;
}
combined.total = combined.total + stats.total;
combined.count = combined.count + stats.count;
combined.mean = combined.total / combined.count;
combined.min = Math.min(combined.min, stats.min);
combined.max = Math.max(combined.max, stats.max);
// Sum of the squares of the difference from the mean
double meanDifference = stats.mean - combined.mean;
combined.varianceNumeratorSum += stats.varianceNumeratorSum + stats.count * meanDifference * meanDifference;
}
return combined;
} } | public class class_name {
static StatsData aggregateStats(Collection<StatsData> dataSet) {
StatsData combined = new StatsData();
for (StatsData stats : dataSet) {
if (stats.count == 0) {
continue;
}
if (combined.total == 0) {
combined.min = stats.min; // depends on control dependency: [if], data = [none]
combined.max = stats.max; // depends on control dependency: [if], data = [none]
}
combined.total = combined.total + stats.total; // depends on control dependency: [for], data = [stats]
combined.count = combined.count + stats.count; // depends on control dependency: [for], data = [stats]
combined.mean = combined.total / combined.count; // depends on control dependency: [for], data = [none]
combined.min = Math.min(combined.min, stats.min); // depends on control dependency: [for], data = [stats]
combined.max = Math.max(combined.max, stats.max); // depends on control dependency: [for], data = [stats]
// Sum of the squares of the difference from the mean
double meanDifference = stats.mean - combined.mean;
combined.varianceNumeratorSum += stats.varianceNumeratorSum + stats.count * meanDifference * meanDifference; // depends on control dependency: [for], data = [stats]
}
return combined;
} } |
public class class_name {
public void setNotificationConfigurations(java.util.Collection<NotificationConfiguration> notificationConfigurations) {
if (notificationConfigurations == null) {
this.notificationConfigurations = null;
return;
}
this.notificationConfigurations = new com.amazonaws.internal.SdkInternalList<NotificationConfiguration>(notificationConfigurations);
} } | public class class_name {
public void setNotificationConfigurations(java.util.Collection<NotificationConfiguration> notificationConfigurations) {
if (notificationConfigurations == null) {
this.notificationConfigurations = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.notificationConfigurations = new com.amazonaws.internal.SdkInternalList<NotificationConfiguration>(notificationConfigurations);
} } |
public class class_name {
public Vector<Object> getSpecifications(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams)
{
try
{
Repository repository = loadRepository( repositoryParams );
SystemUnderTest systemUnderTest = XmlRpcDataMarshaller.toSystemUnderTest( systemUnderTestParams );
List<Specification> specifications = service.getSpecifications( systemUnderTest, repository );
log.debug( "Retrieved specifications for sut: " + systemUnderTest.getName() + " and repoUID:" + repository.getUid() );
return XmlRpcDataMarshaller.toXmlRpcSpecificationsParameters( specifications );
}
catch (Exception e)
{
return errorAsVector( e, SPECIFICATIONS_NOT_FOUND );
}
} } | public class class_name {
public Vector<Object> getSpecifications(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams)
{
try
{
Repository repository = loadRepository( repositoryParams );
SystemUnderTest systemUnderTest = XmlRpcDataMarshaller.toSystemUnderTest( systemUnderTestParams );
List<Specification> specifications = service.getSpecifications( systemUnderTest, repository );
log.debug( "Retrieved specifications for sut: " + systemUnderTest.getName() + " and repoUID:" + repository.getUid() ); // depends on control dependency: [try], data = [none]
return XmlRpcDataMarshaller.toXmlRpcSpecificationsParameters( specifications ); // depends on control dependency: [try], data = [none]
}
catch (Exception e)
{
return errorAsVector( e, SPECIFICATIONS_NOT_FOUND );
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public Expression genObjToPass(
CallNode callNode,
TemplateAliases templateAliases,
TranslationContext translationContext,
ErrorReporter errorReporter,
TranslateExprNodeVisitor exprTranslator) {
// ------ Generate the expression for the original data to pass ------
Expression dataToPass;
if (callNode.isPassingAllData()) {
dataToPass = JsRuntime.OPT_DATA;
} else if (callNode.isPassingData()) {
dataToPass = exprTranslator.exec(callNode.getDataExpr());
} else if (callNode.numChildren() == 0) {
// If we're passing neither children nor indirect data, we can immediately return null.
return LITERAL_NULL;
} else {
dataToPass = LITERAL_NULL;
}
Map<String, Expression> paramDefaults = getDefaultParams(callNode, translationContext);
// ------ Case 1: No additional params ------
if (callNode.numChildren() == 0) {
if (!paramDefaults.isEmpty()) {
dataToPass = SOY_ASSIGN_DEFAULTS.call(dataToPass, Expression.objectLiteral(paramDefaults));
}
// Ignore inconsistencies between Closure Compiler & Soy type systems (eg, proto nullability).
return dataToPass.castAs("?");
}
// ------ Build an object literal containing the additional params ------
Map<String, Expression> params = paramDefaults;
for (CallParamNode child : callNode.getChildren()) {
Expression value;
if (child instanceof CallParamValueNode) {
CallParamValueNode cpvn = (CallParamValueNode) child;
value = exprTranslator.exec(cpvn.getExpr());
} else {
CallParamContentNode cpcn = (CallParamContentNode) child;
if (isComputableAsJsExprsVisitor.exec(cpcn)) {
List<Expression> chunks =
genJsExprsVisitorFactory
.create(translationContext, templateAliases, errorReporter)
.exec(cpcn);
value = CodeChunkUtils.concatChunksForceString(chunks);
} else {
// This is a param with content that cannot be represented as JS expressions, so we assume
// that code has been generated to define the temporary variable 'param<n>'.
value = id("param" + cpcn.getId());
}
value = maybeWrapContent(translationContext.codeGenerator(), cpcn, value);
}
params.put(child.getKey().identifier(), value);
}
Expression paramsExp = Expression.objectLiteral(params);
// ------ Cases 2 and 3: Additional params with and without original data to pass ------
if (callNode.isPassingData()) {
Expression allData = SOY_ASSIGN_DEFAULTS.call(paramsExp, dataToPass);
// No need to cast; assignDefaults already returns {?}.
return allData;
} else {
// Ignore inconsistencies between Closure Compiler & Soy type systems (eg, proto nullability).
return paramsExp.castAs("?");
}
} } | public class class_name {
public Expression genObjToPass(
CallNode callNode,
TemplateAliases templateAliases,
TranslationContext translationContext,
ErrorReporter errorReporter,
TranslateExprNodeVisitor exprTranslator) {
// ------ Generate the expression for the original data to pass ------
Expression dataToPass;
if (callNode.isPassingAllData()) {
dataToPass = JsRuntime.OPT_DATA; // depends on control dependency: [if], data = [none]
} else if (callNode.isPassingData()) {
dataToPass = exprTranslator.exec(callNode.getDataExpr()); // depends on control dependency: [if], data = [none]
} else if (callNode.numChildren() == 0) {
// If we're passing neither children nor indirect data, we can immediately return null.
return LITERAL_NULL; // depends on control dependency: [if], data = [none]
} else {
dataToPass = LITERAL_NULL; // depends on control dependency: [if], data = [none]
}
Map<String, Expression> paramDefaults = getDefaultParams(callNode, translationContext);
// ------ Case 1: No additional params ------
if (callNode.numChildren() == 0) {
if (!paramDefaults.isEmpty()) {
dataToPass = SOY_ASSIGN_DEFAULTS.call(dataToPass, Expression.objectLiteral(paramDefaults)); // depends on control dependency: [if], data = [none]
}
// Ignore inconsistencies between Closure Compiler & Soy type systems (eg, proto nullability).
return dataToPass.castAs("?"); // depends on control dependency: [if], data = [none]
}
// ------ Build an object literal containing the additional params ------
Map<String, Expression> params = paramDefaults;
for (CallParamNode child : callNode.getChildren()) {
Expression value;
if (child instanceof CallParamValueNode) {
CallParamValueNode cpvn = (CallParamValueNode) child;
value = exprTranslator.exec(cpvn.getExpr()); // depends on control dependency: [if], data = [none]
} else {
CallParamContentNode cpcn = (CallParamContentNode) child;
if (isComputableAsJsExprsVisitor.exec(cpcn)) {
List<Expression> chunks =
genJsExprsVisitorFactory
.create(translationContext, templateAliases, errorReporter)
.exec(cpcn);
value = CodeChunkUtils.concatChunksForceString(chunks); // depends on control dependency: [if], data = [none]
} else {
// This is a param with content that cannot be represented as JS expressions, so we assume
// that code has been generated to define the temporary variable 'param<n>'.
value = id("param" + cpcn.getId()); // depends on control dependency: [if], data = [none]
}
value = maybeWrapContent(translationContext.codeGenerator(), cpcn, value); // depends on control dependency: [if], data = [none]
}
params.put(child.getKey().identifier(), value); // depends on control dependency: [for], data = [child]
}
Expression paramsExp = Expression.objectLiteral(params);
// ------ Cases 2 and 3: Additional params with and without original data to pass ------
if (callNode.isPassingData()) {
Expression allData = SOY_ASSIGN_DEFAULTS.call(paramsExp, dataToPass);
// No need to cast; assignDefaults already returns {?}.
return allData; // depends on control dependency: [if], data = [none]
} else {
// Ignore inconsistencies between Closure Compiler & Soy type systems (eg, proto nullability).
return paramsExp.castAs("?"); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private void displayTable(TransferTable t) {
tCurrent = t;
if (t == null) {
return;
}
tSourceTable.setText(t.Stmts.sSourceTable);
tDestTable.setText(t.Stmts.sDestTable);
tDestDrop.setText(t.Stmts.sDestDrop);
tDestCreateIndex.setText(t.Stmts.sDestCreateIndex);
tDestDropIndex.setText(t.Stmts.sDestDropIndex);
tDestCreate.setText(t.Stmts.sDestCreate);
tDestDelete.setText(t.Stmts.sDestDelete);
tSourceSelect.setText(t.Stmts.sSourceSelect);
tDestInsert.setText(t.Stmts.sDestInsert);
tDestAlter.setText(t.Stmts.sDestAlter);
cTransfer.setState(t.Stmts.bTransfer);
cDrop.setState(t.Stmts.bDrop);
cCreate.setState(t.Stmts.bCreate);
cDropIndex.setState(t.Stmts.bDropIndex);
cCreateIndex.setState(t.Stmts.bCreateIndex);
cDelete.setState(t.Stmts.bDelete);
cInsert.setState(t.Stmts.bInsert);
cAlter.setState(t.Stmts.bAlter);
cFKForced.setState(t.Stmts.bFKForced);
cIdxForced.setState(t.Stmts.bIdxForced);
} } | public class class_name {
private void displayTable(TransferTable t) {
tCurrent = t;
if (t == null) {
return; // depends on control dependency: [if], data = [none]
}
tSourceTable.setText(t.Stmts.sSourceTable);
tDestTable.setText(t.Stmts.sDestTable);
tDestDrop.setText(t.Stmts.sDestDrop);
tDestCreateIndex.setText(t.Stmts.sDestCreateIndex);
tDestDropIndex.setText(t.Stmts.sDestDropIndex);
tDestCreate.setText(t.Stmts.sDestCreate);
tDestDelete.setText(t.Stmts.sDestDelete);
tSourceSelect.setText(t.Stmts.sSourceSelect);
tDestInsert.setText(t.Stmts.sDestInsert);
tDestAlter.setText(t.Stmts.sDestAlter);
cTransfer.setState(t.Stmts.bTransfer);
cDrop.setState(t.Stmts.bDrop);
cCreate.setState(t.Stmts.bCreate);
cDropIndex.setState(t.Stmts.bDropIndex);
cCreateIndex.setState(t.Stmts.bCreateIndex);
cDelete.setState(t.Stmts.bDelete);
cInsert.setState(t.Stmts.bInsert);
cAlter.setState(t.Stmts.bAlter);
cFKForced.setState(t.Stmts.bFKForced);
cIdxForced.setState(t.Stmts.bIdxForced);
} } |
public class class_name {
private Inflater getInflater() {
Inflater inf;
synchronized (inflaterCache) {
while (null != (inf = inflaterCache.poll())) {
if (false == inf.ended()) {
return inf;
}
}
}
return new Inflater(true);
} } | public class class_name {
private Inflater getInflater() {
Inflater inf;
synchronized (inflaterCache) {
while (null != (inf = inflaterCache.poll())) {
if (false == inf.ended()) {
return inf; // depends on control dependency: [if], data = [none]
}
}
}
return new Inflater(true);
} } |
public class class_name {
ObjectType findCommonSuperObject(ObjectType a, ObjectType b) {
List<ObjectType> stackA = getSuperStack(a);
List<ObjectType> stackB = getSuperStack(b);
ObjectType result = getNativeObjectType(JSTypeNative.OBJECT_TYPE);
while (!stackA.isEmpty() && !stackB.isEmpty()) {
ObjectType currentA = stackA.remove(stackA.size() - 1);
ObjectType currentB = stackB.remove(stackB.size() - 1);
if (currentA.isEquivalentTo(currentB)) {
result = currentA;
} else {
return result;
}
}
return result;
} } | public class class_name {
ObjectType findCommonSuperObject(ObjectType a, ObjectType b) {
List<ObjectType> stackA = getSuperStack(a);
List<ObjectType> stackB = getSuperStack(b);
ObjectType result = getNativeObjectType(JSTypeNative.OBJECT_TYPE);
while (!stackA.isEmpty() && !stackB.isEmpty()) {
ObjectType currentA = stackA.remove(stackA.size() - 1);
ObjectType currentB = stackB.remove(stackB.size() - 1);
if (currentA.isEquivalentTo(currentB)) {
result = currentA; // depends on control dependency: [if], data = [none]
} else {
return result; // depends on control dependency: [if], data = [none]
}
}
return result;
} } |
public class class_name {
void clearCache(Entity entity, String name) {
final Asset asset = getAsset(entity);
IAttributeDefinition def = null;
if (name != null) {
def = asset.getAssetType().getAttributeDefinition(name);
}
asset.clearAttributeCache(def);
} } | public class class_name {
void clearCache(Entity entity, String name) {
final Asset asset = getAsset(entity);
IAttributeDefinition def = null;
if (name != null) {
def = asset.getAssetType().getAttributeDefinition(name); // depends on control dependency: [if], data = [(name]
}
asset.clearAttributeCache(def);
} } |
public class class_name {
Collection<FutureReadResultEntry> poll(long maxOffset) {
List<FutureReadResultEntry> result = new ArrayList<>();
synchronized (this.reads) {
Exceptions.checkNotClosed(this.closed, this);
// 'reads' is sorted by Starting Offset, in ascending order. As long as it is not empty and the
// first entry overlaps the given offset by at least one byte, extract and return it.
while (this.reads.size() > 0 && this.reads.peek().getStreamSegmentOffset() <= maxOffset) {
result.add(this.reads.poll());
}
}
return result;
} } | public class class_name {
Collection<FutureReadResultEntry> poll(long maxOffset) {
List<FutureReadResultEntry> result = new ArrayList<>();
synchronized (this.reads) {
Exceptions.checkNotClosed(this.closed, this);
// 'reads' is sorted by Starting Offset, in ascending order. As long as it is not empty and the
// first entry overlaps the given offset by at least one byte, extract and return it.
while (this.reads.size() > 0 && this.reads.peek().getStreamSegmentOffset() <= maxOffset) {
result.add(this.reads.poll()); // depends on control dependency: [while], data = [none]
}
}
return result;
} } |
public class class_name {
@Override
protected Object createPoolOrConnection()
{
PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata()
.getPersistenceUnitMetadata(getPersistenceUnit());
Properties props = persistenceUnitMetadata.getProperties();
String keyspace = null;
if (externalProperties != null)
{
keyspace = (String) externalProperties.get(PersistenceProperties.KUNDERA_KEYSPACE);
}
if (keyspace == null)
{
keyspace = (String) props.get(PersistenceProperties.KUNDERA_KEYSPACE);
}
for (Host host : ((CassandraHostConfiguration) configuration).getCassandraHosts())
{
PoolConfiguration prop = new PoolProperties();
prop.setHost(host.getHost());
prop.setPort(host.getPort());
prop.setKeySpace(keyspace);
CassandraUtilities.setPoolConfigPolicy((CassandraHost) host, prop);
try
{
ConnectionPool pool = new ConnectionPool(prop);
hostPools.put(host, pool);
}
catch (TException e)
{
logger.warn("Node {} are down, Caused by {} .", host.getHost(), e.getMessage());
if (host.isRetryHost())
{
logger.warn("Scheduling node for future retry");
((CassandraRetryService) hostRetryService).add((CassandraHost) host);
}
}
}
return null;
} } | public class class_name {
@Override
protected Object createPoolOrConnection()
{
PersistenceUnitMetadata persistenceUnitMetadata = kunderaMetadata.getApplicationMetadata()
.getPersistenceUnitMetadata(getPersistenceUnit());
Properties props = persistenceUnitMetadata.getProperties();
String keyspace = null;
if (externalProperties != null)
{
keyspace = (String) externalProperties.get(PersistenceProperties.KUNDERA_KEYSPACE); // depends on control dependency: [if], data = [none]
}
if (keyspace == null)
{
keyspace = (String) props.get(PersistenceProperties.KUNDERA_KEYSPACE); // depends on control dependency: [if], data = [none]
}
for (Host host : ((CassandraHostConfiguration) configuration).getCassandraHosts())
{
PoolConfiguration prop = new PoolProperties();
prop.setHost(host.getHost()); // depends on control dependency: [for], data = [host]
prop.setPort(host.getPort()); // depends on control dependency: [for], data = [host]
prop.setKeySpace(keyspace); // depends on control dependency: [for], data = [none]
CassandraUtilities.setPoolConfigPolicy((CassandraHost) host, prop); // depends on control dependency: [for], data = [host]
try
{
ConnectionPool pool = new ConnectionPool(prop);
hostPools.put(host, pool); // depends on control dependency: [try], data = [none]
}
catch (TException e)
{
logger.warn("Node {} are down, Caused by {} .", host.getHost(), e.getMessage());
if (host.isRetryHost())
{
logger.warn("Scheduling node for future retry"); // depends on control dependency: [if], data = [none]
((CassandraRetryService) hostRetryService).add((CassandraHost) host); // depends on control dependency: [if], data = [none]
}
} // depends on control dependency: [catch], data = [none]
}
return null;
} } |
public class class_name {
public static BufferedImage loadPGM( InputStream inputStream , BufferedImage storage ) throws IOException {
DataInputStream in = new DataInputStream(inputStream);
readLine(in);
String line = readLine(in);
while( line.charAt(0) == '#')
line = readLine(in);
String s[] = line.split(" ");
int w = Integer.parseInt(s[0]);
int h = Integer.parseInt(s[1]);
readLine(in);
if( storage == null || storage.getWidth() != w || storage.getHeight() != h )
storage = new BufferedImage(w,h,BufferedImage.TYPE_BYTE_GRAY );
int length = w*h;
byte[] data = new byte[length];
read(in,data,length);
boolean useFailSafe = storage.getType() != BufferedImage.TYPE_BYTE_GRAY;
// try using the internal array for better performance
if( storage.getRaster().getDataBuffer().getDataType() == DataBuffer.TYPE_BYTE ) {
byte gray[] = ((DataBufferByte)storage.getRaster().getDataBuffer()).getData();
int indexIn = 0;
int indexOut = 0;
for( int y = 0; y < h; y++ ) {
for( int x = 0; x < w; x++ ) {
gray[indexOut++] = data[indexIn++];
}
}
}
if( useFailSafe ) {
// use the slow setRGB() function
int indexIn = 0;
for( int y = 0; y < h; y++ ) {
for( int x = 0; x < w; x++ ) {
int gray = data[indexIn++] & 0xFF;
storage.setRGB(x, y, gray << 16 | gray << 8 | gray );
}
}
}
return storage;
} } | public class class_name {
public static BufferedImage loadPGM( InputStream inputStream , BufferedImage storage ) throws IOException {
DataInputStream in = new DataInputStream(inputStream);
readLine(in);
String line = readLine(in);
while( line.charAt(0) == '#')
line = readLine(in);
String s[] = line.split(" ");
int w = Integer.parseInt(s[0]);
int h = Integer.parseInt(s[1]);
readLine(in);
if( storage == null || storage.getWidth() != w || storage.getHeight() != h )
storage = new BufferedImage(w,h,BufferedImage.TYPE_BYTE_GRAY );
int length = w*h;
byte[] data = new byte[length];
read(in,data,length);
boolean useFailSafe = storage.getType() != BufferedImage.TYPE_BYTE_GRAY;
// try using the internal array for better performance
if( storage.getRaster().getDataBuffer().getDataType() == DataBuffer.TYPE_BYTE ) {
byte gray[] = ((DataBufferByte)storage.getRaster().getDataBuffer()).getData();
int indexIn = 0;
int indexOut = 0;
for( int y = 0; y < h; y++ ) {
for( int x = 0; x < w; x++ ) {
gray[indexOut++] = data[indexIn++]; // depends on control dependency: [for], data = [none]
}
}
}
if( useFailSafe ) {
// use the slow setRGB() function
int indexIn = 0;
for( int y = 0; y < h; y++ ) {
for( int x = 0; x < w; x++ ) {
int gray = data[indexIn++] & 0xFF;
storage.setRGB(x, y, gray << 16 | gray << 8 | gray ); // depends on control dependency: [for], data = [x]
}
}
}
return storage;
} } |
public class class_name {
public static base_responses add(nitro_service client, vpntrafficaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpntrafficaction addresources[] = new vpntrafficaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new vpntrafficaction();
addresources[i].name = resources[i].name;
addresources[i].qual = resources[i].qual;
addresources[i].apptimeout = resources[i].apptimeout;
addresources[i].sso = resources[i].sso;
addresources[i].formssoaction = resources[i].formssoaction;
addresources[i].fta = resources[i].fta;
addresources[i].wanscaler = resources[i].wanscaler;
addresources[i].kcdaccount = resources[i].kcdaccount;
addresources[i].samlssoprofile = resources[i].samlssoprofile;
}
result = add_bulk_request(client, addresources);
}
return result;
} } | public class class_name {
public static base_responses add(nitro_service client, vpntrafficaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpntrafficaction addresources[] = new vpntrafficaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new vpntrafficaction(); // depends on control dependency: [for], data = [i]
addresources[i].name = resources[i].name; // depends on control dependency: [for], data = [i]
addresources[i].qual = resources[i].qual; // depends on control dependency: [for], data = [i]
addresources[i].apptimeout = resources[i].apptimeout; // depends on control dependency: [for], data = [i]
addresources[i].sso = resources[i].sso; // depends on control dependency: [for], data = [i]
addresources[i].formssoaction = resources[i].formssoaction; // depends on control dependency: [for], data = [i]
addresources[i].fta = resources[i].fta; // depends on control dependency: [for], data = [i]
addresources[i].wanscaler = resources[i].wanscaler; // depends on control dependency: [for], data = [i]
addresources[i].kcdaccount = resources[i].kcdaccount; // depends on control dependency: [for], data = [i]
addresources[i].samlssoprofile = resources[i].samlssoprofile; // depends on control dependency: [for], data = [i]
}
result = add_bulk_request(client, addresources);
}
return result;
} } |
public class class_name {
public boolean isSupported(DurationFieldType type) {
if (type == null) {
return false;
}
return type.getField(getChronology()).isSupported();
} } | public class class_name {
public boolean isSupported(DurationFieldType type) {
if (type == null) {
return false; // depends on control dependency: [if], data = [none]
}
return type.getField(getChronology()).isSupported();
} } |
public class class_name {
@Override
public void endDocument(MetaData metadata)
{
for (Listener listener : this.listeners) {
listener.endDocument(metadata);
}
} } | public class class_name {
@Override
public void endDocument(MetaData metadata)
{
for (Listener listener : this.listeners) {
listener.endDocument(metadata); // depends on control dependency: [for], data = [listener]
}
} } |
public class class_name {
private void handleRedundantConnect() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "handleRedundantConnect, vc=" + getVCHash());
}
// This conn link has already been connected.
// Need to shut get a new SSL engine.
cleanup();
// PK46069 - use engine that allows session id re-use
sslEngine = SSLUtils.getOutboundSSLEngine(
sslContext, getLinkConfig(),
targetAddress.getRemoteAddress().getHostName(),
targetAddress.getRemoteAddress().getPort(),
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "New SSL engine=" + getSSLEngine().hashCode() + " for vc=" + getVCHash());
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "handleRedundantConnect");
}
} } | public class class_name {
private void handleRedundantConnect() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "handleRedundantConnect, vc=" + getVCHash()); // depends on control dependency: [if], data = [none]
}
// This conn link has already been connected.
// Need to shut get a new SSL engine.
cleanup();
// PK46069 - use engine that allows session id re-use
sslEngine = SSLUtils.getOutboundSSLEngine(
sslContext, getLinkConfig(),
targetAddress.getRemoteAddress().getHostName(),
targetAddress.getRemoteAddress().getPort(),
this);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "New SSL engine=" + getSSLEngine().hashCode() + " for vc=" + getVCHash()); // depends on control dependency: [if], data = [none]
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "handleRedundantConnect"); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
static Integer convertToInt(SessionInterface session, Object a, int type) {
int value;
if (a instanceof Integer) {
if (type == Types.SQL_INTEGER) {
return (Integer) a;
}
value = ((Integer) a).intValue();
} else if (a instanceof Long) {
long temp = ((Long) a).longValue();
if (Integer.MAX_VALUE < temp || temp < Integer.MIN_VALUE) {
throw Error.error(ErrorCode.X_22003);
}
value = (int) temp;
} else if (a instanceof BigDecimal) {
BigDecimal bd = ((BigDecimal) a);
if (bd.compareTo(MAX_INT) > 0 || bd.compareTo(MIN_INT) < 0) {
throw Error.error(ErrorCode.X_22003);
}
value = bd.intValue();
} else if (a instanceof Double || a instanceof Float) {
double d = ((Number) a).doubleValue();
if (session instanceof Session) {
if (!((Session) session).database.sqlConvertTruncate) {
d = java.lang.Math.rint(d);
}
}
if (Double.isInfinite(d) || Double.isNaN(d)
|| d >= (double) Integer.MAX_VALUE + 1
|| d <= (double) Integer.MIN_VALUE - 1) {
throw Error.error(ErrorCode.X_22003);
}
value = (int) d;
} else {
throw Error.error(ErrorCode.X_42561);
}
if (type == Types.TINYINT) {
if (Byte.MAX_VALUE < value || value < Byte.MIN_VALUE) {
throw Error.error(ErrorCode.X_22003);
}
} else if (type == Types.SQL_SMALLINT) {
if (Short.MAX_VALUE < value || value < Short.MIN_VALUE) {
throw Error.error(ErrorCode.X_22003);
}
}
return Integer.valueOf(value);
} } | public class class_name {
static Integer convertToInt(SessionInterface session, Object a, int type) {
int value;
if (a instanceof Integer) {
if (type == Types.SQL_INTEGER) {
return (Integer) a; // depends on control dependency: [if], data = [none]
}
value = ((Integer) a).intValue(); // depends on control dependency: [if], data = [none]
} else if (a instanceof Long) {
long temp = ((Long) a).longValue();
if (Integer.MAX_VALUE < temp || temp < Integer.MIN_VALUE) {
throw Error.error(ErrorCode.X_22003);
}
value = (int) temp; // depends on control dependency: [if], data = [none]
} else if (a instanceof BigDecimal) {
BigDecimal bd = ((BigDecimal) a);
if (bd.compareTo(MAX_INT) > 0 || bd.compareTo(MIN_INT) < 0) {
throw Error.error(ErrorCode.X_22003);
}
value = bd.intValue(); // depends on control dependency: [if], data = [none]
} else if (a instanceof Double || a instanceof Float) {
double d = ((Number) a).doubleValue();
if (session instanceof Session) {
if (!((Session) session).database.sqlConvertTruncate) {
d = java.lang.Math.rint(d); // depends on control dependency: [if], data = [none]
}
}
if (Double.isInfinite(d) || Double.isNaN(d)
|| d >= (double) Integer.MAX_VALUE + 1
|| d <= (double) Integer.MIN_VALUE - 1) {
throw Error.error(ErrorCode.X_22003);
}
value = (int) d; // depends on control dependency: [if], data = [none]
} else {
throw Error.error(ErrorCode.X_42561);
}
if (type == Types.TINYINT) {
if (Byte.MAX_VALUE < value || value < Byte.MIN_VALUE) {
throw Error.error(ErrorCode.X_22003);
}
} else if (type == Types.SQL_SMALLINT) {
if (Short.MAX_VALUE < value || value < Short.MIN_VALUE) {
throw Error.error(ErrorCode.X_22003);
}
}
return Integer.valueOf(value);
} } |
public class class_name {
@Override
public final String getFor(final Class<?> pClass, final String pThingName) {
if ("entityEdit".equals(pThingName) && pClass == Cart.class) {
return null;
} else if (pClass == CustOrder.class) {
if ("entitySave".equals(pThingName)) {
return PrCuOrSv.class.getSimpleName();
} else if ("entityEdit".equals(pThingName)
|| "entityPrint".equals(pThingName)) {
return PrcEntityRetrieve.class.getSimpleName();
}
return null;
} else if ("entityEdit".equals(pThingName)
|| "entityConfirmDelete".equals(pThingName)) {
return getForRetrieveForEditDelete(pClass);
} else if ("entityCopy".equals(pThingName)) {
return getForCopy(pClass);
} else if ("entityPrint".equals(pThingName)) {
return getForPrint(pClass);
} else if ("entitySave".equals(pThingName)) {
return getForSave(pClass);
} else if ("entityFDelete".equals(pThingName)) {
return getForFDelete(pClass);
} else if ("entityEFDelete".equals(pThingName)) {
return getForEFDelete(pClass);
} else if ("entityFSave".equals(pThingName)) {
return getForFSave(pClass);
} else if ("entityEFSave".equals(pThingName)) {
return getForEFSave(pClass);
} else if ("entityFolDelete".equals(pThingName)) {
return getForFolDelete(pClass);
} else if ("entityFolSave".equals(pThingName)) {
return getForFolSave(pClass);
} else if ("entityDelete".equals(pThingName)) {
return getForDelete(pClass);
} else if ("entityCreate".equals(pThingName)) {
return getForCreate(pClass);
}
return null;
} } | public class class_name {
@Override
public final String getFor(final Class<?> pClass, final String pThingName) {
if ("entityEdit".equals(pThingName) && pClass == Cart.class) {
return null; // depends on control dependency: [if], data = [none]
} else if (pClass == CustOrder.class) {
if ("entitySave".equals(pThingName)) {
return PrCuOrSv.class.getSimpleName(); // depends on control dependency: [if], data = [none]
} else if ("entityEdit".equals(pThingName)
|| "entityPrint".equals(pThingName)) {
return PrcEntityRetrieve.class.getSimpleName(); // depends on control dependency: [if], data = [none]
}
return null; // depends on control dependency: [if], data = [none]
} else if ("entityEdit".equals(pThingName)
|| "entityConfirmDelete".equals(pThingName)) {
return getForRetrieveForEditDelete(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityCopy".equals(pThingName)) {
return getForCopy(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityPrint".equals(pThingName)) {
return getForPrint(pClass); // depends on control dependency: [if], data = [none]
} else if ("entitySave".equals(pThingName)) {
return getForSave(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityFDelete".equals(pThingName)) {
return getForFDelete(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityEFDelete".equals(pThingName)) {
return getForEFDelete(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityFSave".equals(pThingName)) {
return getForFSave(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityEFSave".equals(pThingName)) {
return getForEFSave(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityFolDelete".equals(pThingName)) {
return getForFolDelete(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityFolSave".equals(pThingName)) {
return getForFolSave(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityDelete".equals(pThingName)) {
return getForDelete(pClass); // depends on control dependency: [if], data = [none]
} else if ("entityCreate".equals(pThingName)) {
return getForCreate(pClass); // depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
public void setIsOmit(boolean isOmit) {
Element child = getFirstChild(root, childNames);
boolean isAlreadyOmit = isDAVElement(child, "omit"); //$NON-NLS-1$
if (isOmit) {
if (!isAlreadyOmit) {
if (child != null)
root.removeChild(child);
appendChild(root, "omit"); //$NON-NLS-1$
}
} else if (isAlreadyOmit)
root.removeChild(child);
} } | public class class_name {
public void setIsOmit(boolean isOmit) {
Element child = getFirstChild(root, childNames);
boolean isAlreadyOmit = isDAVElement(child, "omit"); //$NON-NLS-1$
if (isOmit) {
if (!isAlreadyOmit) {
if (child != null)
root.removeChild(child);
appendChild(root, "omit"); //$NON-NLS-1$ // depends on control dependency: [if], data = [none]
}
} else if (isAlreadyOmit)
root.removeChild(child);
} } |
public class class_name {
public SecurityGroup withIpPermissions(IpPermission... ipPermissions) {
if (this.ipPermissions == null) {
setIpPermissions(new com.amazonaws.internal.SdkInternalList<IpPermission>(ipPermissions.length));
}
for (IpPermission ele : ipPermissions) {
this.ipPermissions.add(ele);
}
return this;
} } | public class class_name {
public SecurityGroup withIpPermissions(IpPermission... ipPermissions) {
if (this.ipPermissions == null) {
setIpPermissions(new com.amazonaws.internal.SdkInternalList<IpPermission>(ipPermissions.length)); // depends on control dependency: [if], data = [none]
}
for (IpPermission ele : ipPermissions) {
this.ipPermissions.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
protected void _before(SarlCapacityUses uses, IExtraLanguageGeneratorContext context) {
// Rename the function in order to produce the good features at the calls.
for (final JvmTypeReference capacity : uses.getCapacities()) {
final JvmType type = capacity.getType();
if (type instanceof JvmDeclaredType) {
computeCapacityFunctionMarkers((JvmDeclaredType) type);
}
}
} } | public class class_name {
protected void _before(SarlCapacityUses uses, IExtraLanguageGeneratorContext context) {
// Rename the function in order to produce the good features at the calls.
for (final JvmTypeReference capacity : uses.getCapacities()) {
final JvmType type = capacity.getType();
if (type instanceof JvmDeclaredType) {
computeCapacityFunctionMarkers((JvmDeclaredType) type); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public void addMessageSelectorFactory(MessageSelectorFactory<?> factory) {
if (factory instanceof BeanFactoryAware) {
((BeanFactoryAware) factory).setBeanFactory(beanFactory);
}
this.factories.add(factory);
} } | public class class_name {
public void addMessageSelectorFactory(MessageSelectorFactory<?> factory) {
if (factory instanceof BeanFactoryAware) {
((BeanFactoryAware) factory).setBeanFactory(beanFactory); // depends on control dependency: [if], data = [none]
}
this.factories.add(factory);
} } |
public class class_name {
public SimpleDialog itemHeight(int height){
if(mItemHeight != height){
mItemHeight = height;
if(mAdapter != null)
mAdapter.notifyDataSetChanged();
}
return this;
} } | public class class_name {
public SimpleDialog itemHeight(int height){
if(mItemHeight != height){
mItemHeight = height; // depends on control dependency: [if], data = [none]
if(mAdapter != null)
mAdapter.notifyDataSetChanged();
}
return this;
} } |
public class class_name {
@SuppressWarnings("unchecked")
public static <T> T asType(Closure cl, Class<T> clazz) {
if (clazz.isInterface() && !(clazz.isInstance(cl))) {
if (Traits.isTrait(clazz)) {
Method samMethod = CachedSAMClass.getSAMMethod(clazz);
if (samMethod!=null) {
Map impl = Collections.singletonMap(samMethod.getName(),cl);
return (T) ProxyGenerator.INSTANCE.instantiateAggregate(impl, Collections.<Class>singletonList(clazz));
}
}
return (T) Proxy.newProxyInstance(
clazz.getClassLoader(),
new Class[]{clazz},
new ConvertedClosure(cl));
}
try {
return asType((Object) cl, clazz);
} catch (GroovyCastException ce) {
try {
return (T) ProxyGenerator.INSTANCE.instantiateAggregateFromBaseClass(cl, clazz);
} catch (GroovyRuntimeException cause) {
throw new GroovyCastException("Error casting closure to " + clazz.getName() +
", Reason: " + cause.getMessage());
}
}
} } | public class class_name {
@SuppressWarnings("unchecked")
public static <T> T asType(Closure cl, Class<T> clazz) {
if (clazz.isInterface() && !(clazz.isInstance(cl))) {
if (Traits.isTrait(clazz)) {
Method samMethod = CachedSAMClass.getSAMMethod(clazz);
if (samMethod!=null) {
Map impl = Collections.singletonMap(samMethod.getName(),cl);
return (T) ProxyGenerator.INSTANCE.instantiateAggregate(impl, Collections.<Class>singletonList(clazz)); // depends on control dependency: [if], data = [none]
}
}
return (T) Proxy.newProxyInstance(
clazz.getClassLoader(),
new Class[]{clazz},
new ConvertedClosure(cl)); // depends on control dependency: [if], data = [none]
}
try {
return asType((Object) cl, clazz); // depends on control dependency: [try], data = [none]
} catch (GroovyCastException ce) {
try {
return (T) ProxyGenerator.INSTANCE.instantiateAggregateFromBaseClass(cl, clazz); // depends on control dependency: [try], data = [none]
} catch (GroovyRuntimeException cause) {
throw new GroovyCastException("Error casting closure to " + clazz.getName() +
", Reason: " + cause.getMessage());
} // depends on control dependency: [catch], data = [none]
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
private void bindValue(Session session, String name, Object value) {
if (value instanceof SessionBindingListener) {
((SessionBindingListener)value).valueBound(session, name, value);
}
} } | public class class_name {
private void bindValue(Session session, String name, Object value) {
if (value instanceof SessionBindingListener) {
((SessionBindingListener)value).valueBound(session, name, value); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void writeAll(List<String[]> allLines, boolean applyQuotesToAll) {
for (String[] line : allLines) {
writeNext(line, applyQuotesToAll);
}
} } | public class class_name {
public void writeAll(List<String[]> allLines, boolean applyQuotesToAll) {
for (String[] line : allLines) {
writeNext(line, applyQuotesToAll); // depends on control dependency: [for], data = [line]
}
} } |
public class class_name {
public CtorInjectionPoint resolve(final Class type, final boolean useAnnotation) {
// lookup methods
ClassDescriptor cd = ClassIntrospector.get().lookup(type);
CtorDescriptor[] allCtors = cd.getAllCtorDescriptors();
Constructor foundedCtor = null;
Constructor defaultCtor = null;
BeanReferences[] references = null;
for (CtorDescriptor ctorDescriptor : allCtors) {
Constructor<?> ctor = ctorDescriptor.getConstructor();
Class<?>[] paramTypes = ctor.getParameterTypes();
if (paramTypes.length == 0) {
defaultCtor = ctor; // detects default ctors
}
if (!useAnnotation) {
continue;
}
BeanReferences[] ctorReferences = referencesResolver.readAllReferencesFromAnnotation(ctor);
if (ctorReferences == null) {
continue;
}
if (foundedCtor != null) {
throw new PetiteException("Two or more constructors are annotated as injection points in the bean: " + type.getName());
}
foundedCtor = ctor;
references = ctorReferences;
}
if (foundedCtor == null) {
// there is no annotated constructor
if (allCtors.length == 1) {
foundedCtor = allCtors[0].getConstructor();
} else {
foundedCtor = defaultCtor;
}
if (foundedCtor == null) {
// no matching ctor found
// still this is not an error if bean is already instantiated.
return CtorInjectionPoint.EMPTY;
}
references = referencesResolver.readAllReferencesFromAnnotation(foundedCtor);
if (references == null) {
references = new BeanReferences[0];
}
}
return new CtorInjectionPoint(foundedCtor, references);
} } | public class class_name {
public CtorInjectionPoint resolve(final Class type, final boolean useAnnotation) {
// lookup methods
ClassDescriptor cd = ClassIntrospector.get().lookup(type);
CtorDescriptor[] allCtors = cd.getAllCtorDescriptors();
Constructor foundedCtor = null;
Constructor defaultCtor = null;
BeanReferences[] references = null;
for (CtorDescriptor ctorDescriptor : allCtors) {
Constructor<?> ctor = ctorDescriptor.getConstructor();
Class<?>[] paramTypes = ctor.getParameterTypes();
if (paramTypes.length == 0) {
defaultCtor = ctor; // detects default ctors // depends on control dependency: [if], data = [none]
}
if (!useAnnotation) {
continue;
}
BeanReferences[] ctorReferences = referencesResolver.readAllReferencesFromAnnotation(ctor);
if (ctorReferences == null) {
continue;
}
if (foundedCtor != null) {
throw new PetiteException("Two or more constructors are annotated as injection points in the bean: " + type.getName());
}
foundedCtor = ctor; // depends on control dependency: [for], data = [none]
references = ctorReferences; // depends on control dependency: [for], data = [none]
}
if (foundedCtor == null) {
// there is no annotated constructor
if (allCtors.length == 1) {
foundedCtor = allCtors[0].getConstructor(); // depends on control dependency: [if], data = [none]
} else {
foundedCtor = defaultCtor; // depends on control dependency: [if], data = [none]
}
if (foundedCtor == null) {
// no matching ctor found
// still this is not an error if bean is already instantiated.
return CtorInjectionPoint.EMPTY; // depends on control dependency: [if], data = [none]
}
references = referencesResolver.readAllReferencesFromAnnotation(foundedCtor); // depends on control dependency: [if], data = [(foundedCtor]
if (references == null) {
references = new BeanReferences[0]; // depends on control dependency: [if], data = [none]
}
}
return new CtorInjectionPoint(foundedCtor, references);
} } |
public class class_name {
public void delete(final T object, final SuccessCallback<Boolean> successCallback, final ErrorCallback errorCallback) {
checkNotNull(successCallback);
checkNotNull(errorCallback);
checkNotNull(object);
final Callable<Boolean> call = new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return SugarRecord.delete(object);
}
};
final Future<Boolean> future = doInBackground(call);
Boolean isDeleted;
try {
isDeleted = future.get();
if (null == isDeleted || !isDeleted) {
errorCallback.onError(new Exception("Error when performing delete of " + object.toString()));
} else {
successCallback.onSuccess(isDeleted);
}
} catch (Exception e) {
errorCallback.onError(e);
}
} } | public class class_name {
public void delete(final T object, final SuccessCallback<Boolean> successCallback, final ErrorCallback errorCallback) {
checkNotNull(successCallback);
checkNotNull(errorCallback);
checkNotNull(object);
final Callable<Boolean> call = new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
return SugarRecord.delete(object);
}
};
final Future<Boolean> future = doInBackground(call);
Boolean isDeleted;
try {
isDeleted = future.get(); // depends on control dependency: [try], data = [none]
if (null == isDeleted || !isDeleted) {
errorCallback.onError(new Exception("Error when performing delete of " + object.toString())); // depends on control dependency: [if], data = [none]
} else {
successCallback.onSuccess(isDeleted); // depends on control dependency: [if], data = [none]
}
} catch (Exception e) {
errorCallback.onError(e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public void setLocalVariable(String name, Term[] terms, Element value)
throws EvaluationException {
assert (name != null);
// Only truly local variables can be set via this method. Throw an
// exception if a global variable is found which matches the name.
if (globalVariables.containsKey(name)) {
throw new EvaluationException(MessageUtils.format(
MSG_CANNOT_MODIFY_GLOBAL_VARIABLE_FROM_DML, name));
}
if (terms == null || terms.length == 0) {
// Revert back to the simple case that does not require
// dereferencing.
setLocalVariable(name, value);
} else {
// The more complicated case where we need to dereference the
// variable. (And also possibly create the parents.)
// Retrieve the value of the local variable.
Element var = getLocalVariable(name);
// If the value is a protected resource, then make a shallow copy
// and replace the value of the local variable.
if (var != null && var.isProtected()) {
var = var.writableCopy();
setLocalVariable(name, var);
}
// If the value does not exist, create a resource of the correct
// type and insert into variable table.
if (var == null || var instanceof Undef) {
Term term = terms[0];
if (term.isKey()) {
var = new HashResource();
} else {
var = new ListResource();
}
setLocalVariable(name, var);
}
// Recursively descend to set the value.
assert (var != null);
try {
var.rput(terms, 0, value);
} catch (InvalidTermException ite) {
throw new EvaluationException(ite.formatVariableMessage(name,
terms));
}
}
} } | public class class_name {
public void setLocalVariable(String name, Term[] terms, Element value)
throws EvaluationException {
assert (name != null);
// Only truly local variables can be set via this method. Throw an
// exception if a global variable is found which matches the name.
if (globalVariables.containsKey(name)) {
throw new EvaluationException(MessageUtils.format(
MSG_CANNOT_MODIFY_GLOBAL_VARIABLE_FROM_DML, name));
}
if (terms == null || terms.length == 0) {
// Revert back to the simple case that does not require
// dereferencing.
setLocalVariable(name, value);
} else {
// The more complicated case where we need to dereference the
// variable. (And also possibly create the parents.)
// Retrieve the value of the local variable.
Element var = getLocalVariable(name);
// If the value is a protected resource, then make a shallow copy
// and replace the value of the local variable.
if (var != null && var.isProtected()) {
var = var.writableCopy(); // depends on control dependency: [if], data = [none]
setLocalVariable(name, var); // depends on control dependency: [if], data = [none]
}
// If the value does not exist, create a resource of the correct
// type and insert into variable table.
if (var == null || var instanceof Undef) {
Term term = terms[0];
if (term.isKey()) {
var = new HashResource(); // depends on control dependency: [if], data = [none]
} else {
var = new ListResource(); // depends on control dependency: [if], data = [none]
}
setLocalVariable(name, var); // depends on control dependency: [if], data = [none]
}
// Recursively descend to set the value.
assert (var != null);
try {
var.rput(terms, 0, value); // depends on control dependency: [try], data = [none]
} catch (InvalidTermException ite) {
throw new EvaluationException(ite.formatVariableMessage(name,
terms));
} // depends on control dependency: [catch], data = [none]
}
} } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.