code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
---|---|
public class class_name {
private int incrementReferenceCounter(final JobID jobID) {
while (true) {
AtomicInteger ai = this.libraryReferenceCounter.get(jobID);
if (ai == null) {
ai = new AtomicInteger(1);
if (this.libraryReferenceCounter.putIfAbsent(jobID, ai) == null) {
return 1;
}
// We had a race, try again
} else {
return ai.incrementAndGet();
}
}
} } | public class class_name {
private int incrementReferenceCounter(final JobID jobID) {
while (true) {
AtomicInteger ai = this.libraryReferenceCounter.get(jobID);
if (ai == null) {
ai = new AtomicInteger(1); // depends on control dependency: [if], data = [none]
if (this.libraryReferenceCounter.putIfAbsent(jobID, ai) == null) {
return 1; // depends on control dependency: [if], data = [none]
}
// We had a race, try again
} else {
return ai.incrementAndGet(); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public void marshall(Target target, ProtocolMarshaller protocolMarshaller) {
if (target == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(target.getRepositoryName(), REPOSITORYNAME_BINDING);
protocolMarshaller.marshall(target.getSourceReference(), SOURCEREFERENCE_BINDING);
protocolMarshaller.marshall(target.getDestinationReference(), DESTINATIONREFERENCE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(Target target, ProtocolMarshaller protocolMarshaller) {
if (target == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(target.getRepositoryName(), REPOSITORYNAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(target.getSourceReference(), SOURCEREFERENCE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(target.getDestinationReference(), DESTINATIONREFERENCE_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public static boolean hasReturnType(final Method method) {
if (method == null) {
return false;
}
if (method.getReturnType() == null) {
return false;
}
if (Void.class.equals(method.getReturnType())) {
return false;
}
return !Void.TYPE.equals(method.getReturnType());
} } | public class class_name {
public static boolean hasReturnType(final Method method) {
if (method == null) {
return false; // depends on control dependency: [if], data = [none]
}
if (method.getReturnType() == null) {
return false; // depends on control dependency: [if], data = [none]
}
if (Void.class.equals(method.getReturnType())) {
return false; // depends on control dependency: [if], data = [none]
}
return !Void.TYPE.equals(method.getReturnType());
} } |
public class class_name {
@SuppressWarnings("unchecked")
private void handleCollectionOfMaps( Object newInstance,
FieldAccess field, Collection<Map<String, Object>> collectionOfMaps
) {
Collection<Object> newCollection = Conversions.createCollection( field.type(), collectionOfMaps.size() );
Class<?> componentClass = field.getComponentClass();
if ( componentClass != null ) {
for ( Map<String, Object> mapComponent : collectionOfMaps ) {
newCollection.add( fromMap( mapComponent, componentClass ) );
}
field.setObject( newInstance, newCollection );
}
} } | public class class_name {
@SuppressWarnings("unchecked")
private void handleCollectionOfMaps( Object newInstance,
FieldAccess field, Collection<Map<String, Object>> collectionOfMaps
) {
Collection<Object> newCollection = Conversions.createCollection( field.type(), collectionOfMaps.size() );
Class<?> componentClass = field.getComponentClass();
if ( componentClass != null ) {
for ( Map<String, Object> mapComponent : collectionOfMaps ) {
newCollection.add( fromMap( mapComponent, componentClass ) ); // depends on control dependency: [for], data = [mapComponent]
}
field.setObject( newInstance, newCollection ); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void setSystemEventHandler(final SystemEventHandler systemEventHandler) {
if (systemEventSubscription != null) {
systemEventSubscription.unsubscribe();
}
if (systemEventHandler != null) {
systemEventSubscription = eventBus().get()
.filter(evt -> evt.type().equals(EventType.SYSTEM))
.subscribe(new Subscriber<CouchbaseEvent>() {
@Override
public void onCompleted() { /* Ignoring on purpose. */}
@Override
public void onError(Throwable e) { /* Ignoring on purpose. */ }
@Override
public void onNext(CouchbaseEvent evt) {
systemEventHandler.onEvent(evt);
}
});
}
} } | public class class_name {
public void setSystemEventHandler(final SystemEventHandler systemEventHandler) {
if (systemEventSubscription != null) {
systemEventSubscription.unsubscribe(); // depends on control dependency: [if], data = [none]
}
if (systemEventHandler != null) {
systemEventSubscription = eventBus().get()
.filter(evt -> evt.type().equals(EventType.SYSTEM))
.subscribe(new Subscriber<CouchbaseEvent>() {
@Override
public void onCompleted() { /* Ignoring on purpose. */}
@Override
public void onError(Throwable e) { /* Ignoring on purpose. */ }
@Override
public void onNext(CouchbaseEvent evt) {
systemEventHandler.onEvent(evt);
}
}); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void routeEvent(EventContext event) {
final EventRoutingTaskImpl eventRoutingTask = new EventRoutingTaskImpl(event,sleeContainer);
if (stats == null) {
executor.execute(eventRoutingTask);
} else {
executor.execute(new EventRoutingTaskStatsCollector(
eventRoutingTask));
}
} } | public class class_name {
public void routeEvent(EventContext event) {
final EventRoutingTaskImpl eventRoutingTask = new EventRoutingTaskImpl(event,sleeContainer);
if (stats == null) {
executor.execute(eventRoutingTask); // depends on control dependency: [if], data = [none]
} else {
executor.execute(new EventRoutingTaskStatsCollector(
eventRoutingTask)); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private String parseOuterClassName() {
StringBuilder sb = new StringBuilder();
sb.append(parseJavaId());
while (peekChar() == packageSeparator) { // '/' or '.'
nextChar(packageSeparator);
sb.append('.');
sb.append(parseJavaId());
}
return sb.toString();
} } | public class class_name {
private String parseOuterClassName() {
StringBuilder sb = new StringBuilder();
sb.append(parseJavaId());
while (peekChar() == packageSeparator) { // '/' or '.'
nextChar(packageSeparator);
// depends on control dependency: [while], data = [packageSeparator)]
sb.append('.');
// depends on control dependency: [while], data = [none]
sb.append(parseJavaId());
// depends on control dependency: [while], data = [none]
}
return sb.toString();
} } |
public class class_name {
public void marshall(DisableSecurityHubRequest disableSecurityHubRequest, ProtocolMarshaller protocolMarshaller) {
if (disableSecurityHubRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(DisableSecurityHubRequest disableSecurityHubRequest, ProtocolMarshaller protocolMarshaller) {
if (disableSecurityHubRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public static final ULocale[] getAvailableULocales() {
if (shim == null) {
return ICUResourceBundle.getAvailableULocales(
ICUData.ICU_COLLATION_BASE_NAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER);
}
return shim.getAvailableULocales();
} } | public class class_name {
public static final ULocale[] getAvailableULocales() {
if (shim == null) {
return ICUResourceBundle.getAvailableULocales(
ICUData.ICU_COLLATION_BASE_NAME, ICUResourceBundle.ICU_DATA_CLASS_LOADER); // depends on control dependency: [if], data = [none]
}
return shim.getAvailableULocales();
} } |
public class class_name {
public ImageBuilder withImageBuilderErrors(ResourceError... imageBuilderErrors) {
if (this.imageBuilderErrors == null) {
setImageBuilderErrors(new java.util.ArrayList<ResourceError>(imageBuilderErrors.length));
}
for (ResourceError ele : imageBuilderErrors) {
this.imageBuilderErrors.add(ele);
}
return this;
} } | public class class_name {
public ImageBuilder withImageBuilderErrors(ResourceError... imageBuilderErrors) {
if (this.imageBuilderErrors == null) {
setImageBuilderErrors(new java.util.ArrayList<ResourceError>(imageBuilderErrors.length)); // depends on control dependency: [if], data = [none]
}
for (ResourceError ele : imageBuilderErrors) {
this.imageBuilderErrors.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
protected static ContentCreateOptions newContentCreateOptions(
DocumentMetadata meta, ContentCreateOptions options,
boolean isCopyColls, boolean isCopyQuality, boolean isCopyMeta,
boolean isCopyPerms, long effectiveVersion) {
ContentCreateOptions opt = (ContentCreateOptions)options.clone();
if (meta != null) {
if (isCopyQuality && opt.getQuality() == 0) {
opt.setQuality(meta.quality);
}
if (isCopyColls) {
if (opt.getCollections() != null) {
HashSet<String> colSet =
new HashSet<String>(meta.collectionsList);
// union copy_collection and output_collection
for (String s : opt.getCollections()) {
colSet.add(s);
}
opt.setCollections(
colSet.toArray(new String[colSet.size()]));
} else {
opt.setCollections(meta.getCollections());
}
}
if (isCopyPerms) {
if (effectiveVersion < MarkLogicConstants.MIN_NODEUPDATE_VERSION &&
meta.isNakedProps()) {
boolean reset = false;
Vector<ContentPermission> perms = new Vector<>();
for (ContentPermission perm : meta.permissionsList) {
if (!perm.getCapability().toString().equals(
ContentPermission.NODE_UPDATE.toString())) {
perms.add(perm);
} else {
reset = true;
}
}
if (reset) {
meta.clearPermissions();
meta.addPermissions(perms);
meta.setPermString(null);
}
}
if (opt.getPermissions() != null) {
HashSet<ContentPermission> pSet =
new HashSet<ContentPermission>(meta.permissionsList);
// union of output_permission & copy_permission
for (ContentPermission p : opt.getPermissions()) {
pSet.add(p);
}
opt.setPermissions(
pSet.toArray(new ContentPermission[pSet.size()]));
} else {
opt.setPermissions(meta.getPermissions());
}
}
if (isCopyMeta) {
opt.setMetadata(meta.meta);
}
}
return opt;
} } | public class class_name {
protected static ContentCreateOptions newContentCreateOptions(
DocumentMetadata meta, ContentCreateOptions options,
boolean isCopyColls, boolean isCopyQuality, boolean isCopyMeta,
boolean isCopyPerms, long effectiveVersion) {
ContentCreateOptions opt = (ContentCreateOptions)options.clone();
if (meta != null) {
if (isCopyQuality && opt.getQuality() == 0) {
opt.setQuality(meta.quality); // depends on control dependency: [if], data = [none]
}
if (isCopyColls) {
if (opt.getCollections() != null) {
HashSet<String> colSet =
new HashSet<String>(meta.collectionsList);
// union copy_collection and output_collection
for (String s : opt.getCollections()) {
colSet.add(s); // depends on control dependency: [for], data = [s]
}
opt.setCollections(
colSet.toArray(new String[colSet.size()])); // depends on control dependency: [if], data = [none]
} else {
opt.setCollections(meta.getCollections()); // depends on control dependency: [if], data = [none]
}
}
if (isCopyPerms) {
if (effectiveVersion < MarkLogicConstants.MIN_NODEUPDATE_VERSION &&
meta.isNakedProps()) {
boolean reset = false;
Vector<ContentPermission> perms = new Vector<>();
for (ContentPermission perm : meta.permissionsList) {
if (!perm.getCapability().toString().equals(
ContentPermission.NODE_UPDATE.toString())) {
perms.add(perm); // depends on control dependency: [if], data = [none]
} else {
reset = true; // depends on control dependency: [if], data = [none]
}
}
if (reset) {
meta.clearPermissions(); // depends on control dependency: [if], data = [none]
meta.addPermissions(perms); // depends on control dependency: [if], data = [none]
meta.setPermString(null); // depends on control dependency: [if], data = [none]
}
}
if (opt.getPermissions() != null) {
HashSet<ContentPermission> pSet =
new HashSet<ContentPermission>(meta.permissionsList);
// union of output_permission & copy_permission
for (ContentPermission p : opt.getPermissions()) {
pSet.add(p); // depends on control dependency: [for], data = [p]
}
opt.setPermissions(
pSet.toArray(new ContentPermission[pSet.size()])); // depends on control dependency: [if], data = [none]
} else {
opt.setPermissions(meta.getPermissions()); // depends on control dependency: [if], data = [none]
}
}
if (isCopyMeta) {
opt.setMetadata(meta.meta); // depends on control dependency: [if], data = [none]
}
}
return opt;
} } |
public class class_name {
public int discriminate(VirtualConnection vc, Object discrimData) {
if (tc.isEntryEnabled())
SibTr.entry(this, tc, "discriminate", new Object[]
{
vc, discrimData
});
int answer;
// begin D218910
WsByteBuffer[] dataArray = (WsByteBuffer[]) discrimData;
// begin D234423
if (dataArray == null) {
if (tc.isDebugEnabled())
SibTr.debug(this, tc, "timeout prior to discrimination.");
answer = MAYBE;
} else {
WsByteBuffer data = null;
int originalPosition = 0;
int originalLimit = 0;
switch (dataArray.length) {
case 0:
if (tc.isDebugEnabled())
SibTr.debug(this, tc, "discriminate", "MAYBE");
if (tc.isEntryEnabled())
SibTr.exit(this, tc, "discriminate");
return MAYBE;
case 1:
originalPosition = dataArray[0].position();
originalLimit = dataArray[0].limit();
data = dataArray[0].flip();
break;
default:
int totalAmount = 0;
for (int i = 0; i < dataArray.length; ++i) {
totalAmount += dataArray[i].position();
}
data = CommsServerServiceFacade.getBufferPoolManager().allocate(totalAmount);
for (int i = 0; i < dataArray.length; ++i) {
originalPosition = dataArray[i].position();
originalLimit = dataArray[i].limit();
dataArray[i].flip();
data.put(dataArray[i]);
dataArray[i].position(originalPosition);
dataArray[i].limit(originalLimit);
}
data.flip();
break;
}
// end D218910
if (tc.isDebugEnabled()) {
byte[] debugData = null;
int start = 0;
if (data.hasArray()) {
debugData = data.array();
start = data.arrayOffset() + data.position();;
} else {
debugData = new byte[32];
int pos = data.position();
data.get(debugData);
data.position(pos);
start = 0;
}
SibTr.bytes(this, tc, debugData, start, 32, "Discrimination Data");
}
if (data.remaining() < EYECATCHER.length) {
// Not enought data to tell for sure - but maybe enough to eliminate ourself
answer = MAYBE;
for (int i = 0; (data.remaining() > 0) && (answer == MAYBE); ++i) {
if (data.get() != EYECATCHER[i])
answer = NO;
}
} else {
// Enough data to be able to decide if this is ours or not.
answer = YES;
for (int i = 0; (i < EYECATCHER.length) && (answer == YES); ++i) {
if (data.get() != EYECATCHER[i])
answer = NO;
}
}
data.position(originalPosition); // D218910
data.limit(originalLimit); // D218910
}
// end D234423
if (tc.isDebugEnabled()) {
switch (answer) {
case (YES):
SibTr.debug(this, tc, "discriminate", "YES");
break;
case (NO):
SibTr.debug(this, tc, "discriminate", "NO");
break;
case (MAYBE):
SibTr.debug(this, tc, "discriminate", "MAYBE");
break;
}
}
if (tc.isEntryEnabled())
SibTr.exit(this, tc, "discriminate");
return answer;
} } | public class class_name {
public int discriminate(VirtualConnection vc, Object discrimData) {
if (tc.isEntryEnabled())
SibTr.entry(this, tc, "discriminate", new Object[]
{
vc, discrimData
});
int answer;
// begin D218910
WsByteBuffer[] dataArray = (WsByteBuffer[]) discrimData;
// begin D234423
if (dataArray == null) {
if (tc.isDebugEnabled())
SibTr.debug(this, tc, "timeout prior to discrimination.");
answer = MAYBE; // depends on control dependency: [if], data = [none]
} else {
WsByteBuffer data = null;
int originalPosition = 0;
int originalLimit = 0;
switch (dataArray.length) {
case 0:
if (tc.isDebugEnabled())
SibTr.debug(this, tc, "discriminate", "MAYBE");
if (tc.isEntryEnabled())
SibTr.exit(this, tc, "discriminate");
return MAYBE;
case 1:
originalPosition = dataArray[0].position();
originalLimit = dataArray[0].limit();
data = dataArray[0].flip();
break;
default:
int totalAmount = 0;
for (int i = 0; i < dataArray.length; ++i) {
totalAmount += dataArray[i].position(); // depends on control dependency: [for], data = [i]
}
data = CommsServerServiceFacade.getBufferPoolManager().allocate(totalAmount);
for (int i = 0; i < dataArray.length; ++i) {
originalPosition = dataArray[i].position(); // depends on control dependency: [for], data = [i]
originalLimit = dataArray[i].limit(); // depends on control dependency: [for], data = [i]
dataArray[i].flip(); // depends on control dependency: [for], data = [i]
data.put(dataArray[i]); // depends on control dependency: [for], data = [i]
dataArray[i].position(originalPosition); // depends on control dependency: [for], data = [i]
dataArray[i].limit(originalLimit); // depends on control dependency: [for], data = [i]
}
data.flip();
break;
}
// end D218910
if (tc.isDebugEnabled()) {
byte[] debugData = null;
int start = 0;
if (data.hasArray()) {
debugData = data.array(); // depends on control dependency: [if], data = [none]
start = data.arrayOffset() + data.position();; // depends on control dependency: [if], data = [none]
} else {
debugData = new byte[32]; // depends on control dependency: [if], data = [none]
int pos = data.position();
data.get(debugData); // depends on control dependency: [if], data = [none]
data.position(pos); // depends on control dependency: [if], data = [none]
start = 0; // depends on control dependency: [if], data = [none]
}
SibTr.bytes(this, tc, debugData, start, 32, "Discrimination Data"); // depends on control dependency: [if], data = [none]
}
if (data.remaining() < EYECATCHER.length) {
// Not enought data to tell for sure - but maybe enough to eliminate ourself
answer = MAYBE; // depends on control dependency: [if], data = [none]
for (int i = 0; (data.remaining() > 0) && (answer == MAYBE); ++i) {
if (data.get() != EYECATCHER[i])
answer = NO;
}
} else {
// Enough data to be able to decide if this is ours or not.
answer = YES; // depends on control dependency: [if], data = [none]
for (int i = 0; (i < EYECATCHER.length) && (answer == YES); ++i) {
if (data.get() != EYECATCHER[i])
answer = NO;
}
}
data.position(originalPosition); // D218910 // depends on control dependency: [if], data = [none]
data.limit(originalLimit); // D218910 // depends on control dependency: [if], data = [none]
}
// end D234423
if (tc.isDebugEnabled()) {
switch (answer) {
case (YES):
SibTr.debug(this, tc, "discriminate", "YES");
break;
case (NO):
SibTr.debug(this, tc, "discriminate", "NO");
break;
case (MAYBE):
SibTr.debug(this, tc, "discriminate", "MAYBE");
break;
}
}
if (tc.isEntryEnabled())
SibTr.exit(this, tc, "discriminate");
return answer;
} } |
public class class_name {
public void rekey( String skey ) throws jsqlite.Exception {
synchronized (this) {
byte ekey[] = null;
if (skey != null && skey.length() > 0) {
ekey = new byte[skey.length()];
for( int i = 0; i < skey.length(); i++ ) {
char c = skey.charAt(i);
ekey[i] = (byte) ((c & 0xff) ^ (c >> 8));
}
}
_rekey(ekey);
}
} } | public class class_name {
public void rekey( String skey ) throws jsqlite.Exception {
synchronized (this) {
byte ekey[] = null;
if (skey != null && skey.length() > 0) {
ekey = new byte[skey.length()]; // depends on control dependency: [if], data = [none]
for( int i = 0; i < skey.length(); i++ ) {
char c = skey.charAt(i);
ekey[i] = (byte) ((c & 0xff) ^ (c >> 8)); // depends on control dependency: [for], data = [i]
}
}
_rekey(ekey);
}
} } |
public class class_name {
@Override
public void setX(double min, double max) {
if (min <= max) {
this.minxProperty.set(min);
this.maxxProperty.set(max);
} else {
this.minxProperty.set(max);
this.maxxProperty.set(min);
}
} } | public class class_name {
@Override
public void setX(double min, double max) {
if (min <= max) {
this.minxProperty.set(min); // depends on control dependency: [if], data = [(min]
this.maxxProperty.set(max); // depends on control dependency: [if], data = [none]
} else {
this.minxProperty.set(max); // depends on control dependency: [if], data = [none]
this.maxxProperty.set(min); // depends on control dependency: [if], data = [(min]
}
} } |
public class class_name {
public FFmpegProbeResult probe(String mediaPath, @Nullable String userAgent) throws IOException {
checkIfFFprobe();
ImmutableList.Builder<String> args = new ImmutableList.Builder<String>();
// TODO Add:
// .add("--show_packets")
// .add("--show_frames")
args.add(path).add("-v", "quiet");
if (userAgent != null) {
args.add("-user-agent", userAgent);
}
args.add("-print_format", "json")
.add("-show_error")
.add("-show_format")
.add("-show_streams")
.add(mediaPath);
Process p = runFunc.run(args.build());
try {
Reader reader = wrapInReader(p);
if (LOG.isDebugEnabled()) {
reader = new LoggingFilterReader(reader, LOG);
}
FFmpegProbeResult result = gson.fromJson(reader, FFmpegProbeResult.class);
throwOnError(p);
if (result == null) {
throw new IllegalStateException("Gson returned null, which shouldn't happen :(");
}
return result;
} finally {
p.destroy();
}
} } | public class class_name {
public FFmpegProbeResult probe(String mediaPath, @Nullable String userAgent) throws IOException {
checkIfFFprobe();
ImmutableList.Builder<String> args = new ImmutableList.Builder<String>();
// TODO Add:
// .add("--show_packets")
// .add("--show_frames")
args.add(path).add("-v", "quiet");
if (userAgent != null) {
args.add("-user-agent", userAgent);
}
args.add("-print_format", "json")
.add("-show_error")
.add("-show_format")
.add("-show_streams")
.add(mediaPath);
Process p = runFunc.run(args.build());
try {
Reader reader = wrapInReader(p);
if (LOG.isDebugEnabled()) {
reader = new LoggingFilterReader(reader, LOG); // depends on control dependency: [if], data = [none]
}
FFmpegProbeResult result = gson.fromJson(reader, FFmpegProbeResult.class);
throwOnError(p);
if (result == null) {
throw new IllegalStateException("Gson returned null, which shouldn't happen :(");
}
return result;
} finally {
p.destroy();
}
} } |
public class class_name {
private void decodeStartRule() {
useDaylight = (startDay != 0) && (endDay != 0);
if (useDaylight && dst == 0) {
dst = Grego.MILLIS_PER_DAY;
}
if (startDay != 0) {
if (startMonth < Calendar.JANUARY || startMonth > Calendar.DECEMBER) {
throw new IllegalArgumentException();
}
if (startTime < 0 || startTime > Grego.MILLIS_PER_DAY ||
startTimeMode < WALL_TIME || startTimeMode > UTC_TIME) {
throw new IllegalArgumentException();
}
if (startDayOfWeek == 0) {
startMode = DOM_MODE;
} else {
if (startDayOfWeek > 0) {
startMode = DOW_IN_MONTH_MODE;
} else {
startDayOfWeek = -startDayOfWeek;
if (startDay > 0) {
startMode = DOW_GE_DOM_MODE;
} else {
startDay = -startDay;
startMode = DOW_LE_DOM_MODE;
}
}
if (startDayOfWeek > Calendar.SATURDAY) {
throw new IllegalArgumentException();
}
}
if (startMode == DOW_IN_MONTH_MODE) {
if (startDay < -5 || startDay > 5) {
throw new IllegalArgumentException();
}
} else if (startDay < 1 || startDay > staticMonthLength[startMonth]) {
throw new IllegalArgumentException();
}
}
} } | public class class_name {
private void decodeStartRule() {
useDaylight = (startDay != 0) && (endDay != 0);
if (useDaylight && dst == 0) {
dst = Grego.MILLIS_PER_DAY; // depends on control dependency: [if], data = [none]
}
if (startDay != 0) {
if (startMonth < Calendar.JANUARY || startMonth > Calendar.DECEMBER) {
throw new IllegalArgumentException();
}
if (startTime < 0 || startTime > Grego.MILLIS_PER_DAY ||
startTimeMode < WALL_TIME || startTimeMode > UTC_TIME) {
throw new IllegalArgumentException();
}
if (startDayOfWeek == 0) {
startMode = DOM_MODE; // depends on control dependency: [if], data = [none]
} else {
if (startDayOfWeek > 0) {
startMode = DOW_IN_MONTH_MODE; // depends on control dependency: [if], data = [none]
} else {
startDayOfWeek = -startDayOfWeek; // depends on control dependency: [if], data = [none]
if (startDay > 0) {
startMode = DOW_GE_DOM_MODE; // depends on control dependency: [if], data = [none]
} else {
startDay = -startDay; // depends on control dependency: [if], data = [none]
startMode = DOW_LE_DOM_MODE; // depends on control dependency: [if], data = [none]
}
}
if (startDayOfWeek > Calendar.SATURDAY) {
throw new IllegalArgumentException();
}
}
if (startMode == DOW_IN_MONTH_MODE) {
if (startDay < -5 || startDay > 5) {
throw new IllegalArgumentException();
}
} else if (startDay < 1 || startDay > staticMonthLength[startMonth]) {
throw new IllegalArgumentException();
}
}
} } |
public class class_name {
public T setLogDirectory(final Path path) {
if (path == null) {
logDir = null;
} else {
if (Files.exists(path) && !Files.isDirectory(path)) {
throw LauncherMessages.MESSAGES.invalidDirectory(path);
}
logDir = path.toAbsolutePath().normalize();
}
return getThis();
} } | public class class_name {
public T setLogDirectory(final Path path) {
if (path == null) {
logDir = null; // depends on control dependency: [if], data = [none]
} else {
if (Files.exists(path) && !Files.isDirectory(path)) {
throw LauncherMessages.MESSAGES.invalidDirectory(path);
}
logDir = path.toAbsolutePath().normalize(); // depends on control dependency: [if], data = [none]
}
return getThis();
} } |
public class class_name {
public static String getFileNameWithoutExtenxion(String fileName) {
if (fileName==null){
return null;
} else {
int number=fileName.lastIndexOf('.');
if (number>=0){
return fileName.substring(0, number);
} else {
return fileName;
}
}
} } | public class class_name {
public static String getFileNameWithoutExtenxion(String fileName) {
if (fileName==null){
return null;
// depends on control dependency: [if], data = [none]
} else {
int number=fileName.lastIndexOf('.');
if (number>=0){
return fileName.substring(0, number);
// depends on control dependency: [if], data = [none]
} else {
return fileName;
// depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
protected ClassLoader getClassLoader() {
ClassLoader classLoader = null;
try {
classLoader = Thread.currentThread().getContextClassLoader();
} catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back...
}
return (classLoader != null ? classLoader : getClass().getClassLoader());
} } | public class class_name {
protected ClassLoader getClassLoader() {
ClassLoader classLoader = null;
try {
classLoader = Thread.currentThread().getContextClassLoader(); // depends on control dependency: [try], data = [none]
} catch (Throwable ex) {
// Cannot access thread context ClassLoader - falling back...
} // depends on control dependency: [catch], data = [none]
return (classLoader != null ? classLoader : getClass().getClassLoader());
} } |
public class class_name {
public int runAll() {
int numTasksRun = 0;
if (Thread.currentThread().equals(executorThread)) {
Logger.info("ignoring request to execute task - called from executor's own thread");
return numTasksRun;
}
while (hasQueuedTasks()) {
runNext();
numTasksRun++;
}
return numTasksRun;
} } | public class class_name {
public int runAll() {
int numTasksRun = 0;
if (Thread.currentThread().equals(executorThread)) {
Logger.info("ignoring request to execute task - called from executor's own thread"); // depends on control dependency: [if], data = [none]
return numTasksRun; // depends on control dependency: [if], data = [none]
}
while (hasQueuedTasks()) {
runNext(); // depends on control dependency: [while], data = [none]
numTasksRun++; // depends on control dependency: [while], data = [none]
}
return numTasksRun;
} } |
public class class_name {
public static SubscribeManager getSubscribeManager(SubscribeType type) {
if (type == null) {
return null;
}
SubscribeManager manager = (SubscribeManager) innerContainer.get(type);
return manager;
} } | public class class_name {
public static SubscribeManager getSubscribeManager(SubscribeType type) {
if (type == null) {
return null; // depends on control dependency: [if], data = [none]
}
SubscribeManager manager = (SubscribeManager) innerContainer.get(type);
return manager;
} } |
public class class_name {
public static String getUrlParentDir(String url) {
try {
UsableURI uri = UsableURIFactory.getInstance(url);
String path = uri.getPath();
if(path.length() > 1) {
int startIdx = path.length()-1;
if(path.charAt(path.length()-1) == '/') {
startIdx--;
}
int idx = path.lastIndexOf('/',startIdx);
if(idx >= 0) {
uri.setPath(path.substring(0,idx+1));
uri.setQuery(null);
return uri.toUnicodeHostString();
}
}
} catch (URIException e) {
LOGGER.warning(e.getLocalizedMessage() + ": " + url);
}
return null;
} } | public class class_name {
public static String getUrlParentDir(String url) {
try {
UsableURI uri = UsableURIFactory.getInstance(url);
String path = uri.getPath();
if(path.length() > 1) {
int startIdx = path.length()-1;
if(path.charAt(path.length()-1) == '/') {
startIdx--; // depends on control dependency: [if], data = [none]
}
int idx = path.lastIndexOf('/',startIdx);
if(idx >= 0) {
uri.setPath(path.substring(0,idx+1)); // depends on control dependency: [if], data = [none]
uri.setQuery(null); // depends on control dependency: [if], data = [none]
return uri.toUnicodeHostString(); // depends on control dependency: [if], data = [none]
}
}
} catch (URIException e) {
LOGGER.warning(e.getLocalizedMessage() + ": " + url);
} // depends on control dependency: [catch], data = [none]
return null;
} } |
public class class_name {
private Attribute<D> putInstance(Schema.BaseType instanceBaseType, Supplier<Attribute<D>> finder, BiFunction<VertexElement, AttributeType<D>, Attribute<D>> producer, boolean isInferred) {
Attribute<D> instance = finder.get();
if (instance == null) {
instance = addInstance(instanceBaseType, producer, isInferred);
} else {
if (isInferred && !instance.isInferred()) {
throw TransactionException.nonInferredThingExists(instance);
}
}
return instance;
} } | public class class_name {
private Attribute<D> putInstance(Schema.BaseType instanceBaseType, Supplier<Attribute<D>> finder, BiFunction<VertexElement, AttributeType<D>, Attribute<D>> producer, boolean isInferred) {
Attribute<D> instance = finder.get();
if (instance == null) {
instance = addInstance(instanceBaseType, producer, isInferred); // depends on control dependency: [if], data = [(instance]
} else {
if (isInferred && !instance.isInferred()) {
throw TransactionException.nonInferredThingExists(instance);
}
}
return instance;
} } |
public class class_name {
public void setLogDataDirectory(String logDataDirectory) {
LogState state = ivLog.setDataDirectory(logDataDirectory);
if (state != null) {
updateLogConfiguration(state);
state.copyTo(ivLog);
}
} } | public class class_name {
public void setLogDataDirectory(String logDataDirectory) {
LogState state = ivLog.setDataDirectory(logDataDirectory);
if (state != null) {
updateLogConfiguration(state); // depends on control dependency: [if], data = [(state]
state.copyTo(ivLog); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPInstance cpInstance : findByUuid_C(uuid, companyId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpInstance);
}
} } | public class class_name {
@Override
public void removeByUuid_C(String uuid, long companyId) {
for (CPInstance cpInstance : findByUuid_C(uuid, companyId,
QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpInstance); // depends on control dependency: [for], data = [cpInstance]
}
} } |
public class class_name {
public final void cleanupTicks(StreamInfo sinfo, TransactionCommon t, ArrayList valueTicks) throws MessageStoreException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "cleanupTicks", new Object[]{sinfo, t, valueTicks});
try {
int length = valueTicks.size();
for (int i=0; i<length; i++)
{
AOValue storedTick = (AOValue) valueTicks.get(i);
// If we are here then we do not know which consumerDispatcher originally
// persistently locked the message. We therefore have to use the meUuid in
// the AOValue to find/reconstitute the consumerDispatcher associated with it. This
// potentially involves creating AIHs which is not ideal.
ConsumerDispatcher cd = null;
if (storedTick.getSourceMEUuid()==null ||
storedTick.getSourceMEUuid().equals(getMessageProcessor().getMessagingEngineUuid()))
{
cd = (ConsumerDispatcher)destinationHandler.getLocalPtoPConsumerManager();
}
else
{
AnycastInputHandler aih =
destinationHandler.getAnycastInputHandler(storedTick.getSourceMEUuid(), null, true);
cd = aih.getRCD();
}
SIMPMessage msg = null;
synchronized(storedTick)
{
msg = (SIMPMessage) cd.getMessageByValue(storedTick);
if (msg == null)
{
storedTick.setToBeFlushed();
}
}
Transaction msTran = mp.resolveAndEnlistMsgStoreTransaction(t);
if (msg!=null && msg.getLockID()==storedTick.getPLockId())
msg.unlockMsg(storedTick.getPLockId(), msTran, true);
storedTick.lockItemIfAvailable(controlItemLockID); // should always be successful
storedTick.remove(msTran, controlItemLockID);
}
}
catch (MessageStoreException e)
{
// No FFDC code needed
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "cleanupTicks", e);
throw e;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "cleanupTicks");
} } | public class class_name {
public final void cleanupTicks(StreamInfo sinfo, TransactionCommon t, ArrayList valueTicks) throws MessageStoreException, SIResourceException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "cleanupTicks", new Object[]{sinfo, t, valueTicks});
try {
int length = valueTicks.size();
for (int i=0; i<length; i++)
{
AOValue storedTick = (AOValue) valueTicks.get(i);
// If we are here then we do not know which consumerDispatcher originally
// persistently locked the message. We therefore have to use the meUuid in
// the AOValue to find/reconstitute the consumerDispatcher associated with it. This
// potentially involves creating AIHs which is not ideal.
ConsumerDispatcher cd = null;
if (storedTick.getSourceMEUuid()==null ||
storedTick.getSourceMEUuid().equals(getMessageProcessor().getMessagingEngineUuid()))
{
cd = (ConsumerDispatcher)destinationHandler.getLocalPtoPConsumerManager(); // depends on control dependency: [if], data = [none]
}
else
{
AnycastInputHandler aih =
destinationHandler.getAnycastInputHandler(storedTick.getSourceMEUuid(), null, true);
cd = aih.getRCD(); // depends on control dependency: [if], data = [none]
}
SIMPMessage msg = null;
synchronized(storedTick) // depends on control dependency: [for], data = [none]
{
msg = (SIMPMessage) cd.getMessageByValue(storedTick);
if (msg == null)
{
storedTick.setToBeFlushed(); // depends on control dependency: [if], data = [none]
}
}
Transaction msTran = mp.resolveAndEnlistMsgStoreTransaction(t);
if (msg!=null && msg.getLockID()==storedTick.getPLockId())
msg.unlockMsg(storedTick.getPLockId(), msTran, true);
storedTick.lockItemIfAvailable(controlItemLockID); // should always be successful // depends on control dependency: [for], data = [none]
storedTick.remove(msTran, controlItemLockID); // depends on control dependency: [for], data = [none]
}
}
catch (MessageStoreException e)
{
// No FFDC code needed
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "cleanupTicks", e);
throw e;
} // depends on control dependency: [catch], data = [none]
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "cleanupTicks");
} } |
public class class_name {
private void removeConnectionCallbacks() {
connection.removeSyncStanzaListener(messageListener);
if (messageCollector != null) {
messageCollector.cancel();
messageCollector = null;
}
} } | public class class_name {
private void removeConnectionCallbacks() {
connection.removeSyncStanzaListener(messageListener);
if (messageCollector != null) {
messageCollector.cancel(); // depends on control dependency: [if], data = [none]
messageCollector = null; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private Set<String> getEnvironments(Properties props) {
Set<String> environments = new HashSet<>();
for (Object k : props.keySet()) {
String environment = k.toString().split("\\.")[0];
environments.add(environment);
}
return new TreeSet<>(environments);
} } | public class class_name {
private Set<String> getEnvironments(Properties props) {
Set<String> environments = new HashSet<>();
for (Object k : props.keySet()) {
String environment = k.toString().split("\\.")[0];
environments.add(environment); // depends on control dependency: [for], data = [none]
}
return new TreeSet<>(environments);
} } |
public class class_name {
protected Element getElement(Object parent, String name) {
if (name == null) {
return null;
}
String id;
if (parent == null) {
id = getRootElement().getId();
} else {
id = groupToId.get(parent);
}
return Dom.getElementById(Dom.assembleId(id, name));
} } | public class class_name {
protected Element getElement(Object parent, String name) {
if (name == null) {
return null; // depends on control dependency: [if], data = [none]
}
String id;
if (parent == null) {
id = getRootElement().getId(); // depends on control dependency: [if], data = [none]
} else {
id = groupToId.get(parent); // depends on control dependency: [if], data = [(parent]
}
return Dom.getElementById(Dom.assembleId(id, name));
} } |
public class class_name {
public static List<IElement> getHeavyElements(IMolecularFormula formula) {
List<IElement> newEle = new ArrayList<IElement>();
for (IElement element : elements(formula)) {
if (!element.getSymbol().equals("H")) {
newEle.add(element);
}
}
return newEle;
} } | public class class_name {
public static List<IElement> getHeavyElements(IMolecularFormula formula) {
List<IElement> newEle = new ArrayList<IElement>();
for (IElement element : elements(formula)) {
if (!element.getSymbol().equals("H")) {
newEle.add(element); // depends on control dependency: [if], data = [none]
}
}
return newEle;
} } |
public class class_name {
public URL getAlias()
{
if (__checkAliases && !_aliasChecked)
{
try
{
String abs=_file.getAbsolutePath();
String can=_file.getCanonicalPath();
if (abs.length()!=can.length() || !abs.equals(can))
_alias=new File(can).toURI().toURL();
_aliasChecked=true;
if (_alias!=null && log.isDebugEnabled())
{
log.debug("ALIAS abs="+abs);
log.debug("ALIAS can="+can);
}
}
catch(Exception e)
{
log.warn(LogSupport.EXCEPTION,e);
return getURL();
}
}
return _alias;
} } | public class class_name {
public URL getAlias()
{
if (__checkAliases && !_aliasChecked)
{
try
{
String abs=_file.getAbsolutePath();
String can=_file.getCanonicalPath();
if (abs.length()!=can.length() || !abs.equals(can))
_alias=new File(can).toURI().toURL();
_aliasChecked=true; // depends on control dependency: [try], data = [none]
if (_alias!=null && log.isDebugEnabled())
{
log.debug("ALIAS abs="+abs); // depends on control dependency: [if], data = [none]
log.debug("ALIAS can="+can); // depends on control dependency: [if], data = [none]
}
}
catch(Exception e)
{
log.warn(LogSupport.EXCEPTION,e);
return getURL();
} // depends on control dependency: [catch], data = [none]
}
return _alias;
} } |
public class class_name {
private Object parentValue(Object pojo) {
Object parentValue = parent.getValue(pojo);
if (parentValue == null && autoCreateParent) {
Object newParent = ReflectionUtils.newInstance(parent.getType().getRawType());
parent.setValue(pojo, newParent);
return newParent;
}
return parentValue;
} } | public class class_name {
private Object parentValue(Object pojo) {
Object parentValue = parent.getValue(pojo);
if (parentValue == null && autoCreateParent) {
Object newParent = ReflectionUtils.newInstance(parent.getType().getRawType());
parent.setValue(pojo, newParent); // depends on control dependency: [if], data = [none]
return newParent; // depends on control dependency: [if], data = [none]
}
return parentValue;
} } |
public class class_name {
@SuppressWarnings("unchecked")
public final <C extends T> PropertyList<C> getProperties(final String name) {
final PropertyList<C> list = new PropertyList<C>();
for (final T p : this) {
if (p.getName().equalsIgnoreCase(name)) {
list.add((C) p);
}
}
return list;
} } | public class class_name {
@SuppressWarnings("unchecked")
public final <C extends T> PropertyList<C> getProperties(final String name) {
final PropertyList<C> list = new PropertyList<C>();
for (final T p : this) {
if (p.getName().equalsIgnoreCase(name)) {
list.add((C) p); // depends on control dependency: [if], data = [none]
}
}
return list;
} } |
public class class_name {
public void saveXml(T jaxbBean, OutputStream outputStream) {
try {
validate(jaxbBean);
getOrCreateMarshaller().marshal(jaxbBean, outputStream);
} catch (MarshalException e) {
throw new XmlInvalidException(e, jaxbBean);
} catch (JAXBException e) {
throw new IllegalStateException(e);
}
} } | public class class_name {
public void saveXml(T jaxbBean, OutputStream outputStream) {
try {
validate(jaxbBean); // depends on control dependency: [try], data = [none]
getOrCreateMarshaller().marshal(jaxbBean, outputStream); // depends on control dependency: [try], data = [none]
} catch (MarshalException e) {
throw new XmlInvalidException(e, jaxbBean);
} catch (JAXBException e) { // depends on control dependency: [catch], data = [none]
throw new IllegalStateException(e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
private static long valuedt(TemporalAccessor datetime, ZoneId otherTimezoneOffset) {
ZoneId alternativeTZ = Optional.ofNullable(otherTimezoneOffset).orElse(ZoneOffset.UTC);
if (datetime instanceof LocalDateTime) {
return ((LocalDateTime) datetime).atZone(alternativeTZ).toEpochSecond();
} else if (datetime instanceof ZonedDateTime) {
return ((ZonedDateTime) datetime).toEpochSecond();
} else if (datetime instanceof OffsetDateTime) {
return ((OffsetDateTime) datetime).toEpochSecond();
} else {
throw new RuntimeException("valuedt() for " + datetime + " but is not a FEEL date and time " + datetime.getClass());
}
} } | public class class_name {
private static long valuedt(TemporalAccessor datetime, ZoneId otherTimezoneOffset) {
ZoneId alternativeTZ = Optional.ofNullable(otherTimezoneOffset).orElse(ZoneOffset.UTC);
if (datetime instanceof LocalDateTime) {
return ((LocalDateTime) datetime).atZone(alternativeTZ).toEpochSecond(); // depends on control dependency: [if], data = [none]
} else if (datetime instanceof ZonedDateTime) {
return ((ZonedDateTime) datetime).toEpochSecond(); // depends on control dependency: [if], data = [none]
} else if (datetime instanceof OffsetDateTime) {
return ((OffsetDateTime) datetime).toEpochSecond(); // depends on control dependency: [if], data = [none]
} else {
throw new RuntimeException("valuedt() for " + datetime + " but is not a FEEL date and time " + datetime.getClass());
}
} } |
public class class_name {
public void doGenerateExampleQueries(String args)
{
Boolean del = false;
if (args != null && "overwrite".equals(args))
{
del = true;
}
if (corpusList != null)
{
for (Long corpusId : corpusList)
{
System.out.println("generate example queries " + corpusId);
queriesGenerator.generateQueries(corpusId, del);
}
}
} } | public class class_name {
public void doGenerateExampleQueries(String args)
{
Boolean del = false;
if (args != null && "overwrite".equals(args))
{
del = true; // depends on control dependency: [if], data = [none]
}
if (corpusList != null)
{
for (Long corpusId : corpusList)
{
System.out.println("generate example queries " + corpusId); // depends on control dependency: [for], data = [corpusId]
queriesGenerator.generateQueries(corpusId, del); // depends on control dependency: [for], data = [corpusId]
}
}
} } |
public class class_name {
private void trim() {
int left = 0;
int right = 2 * k - 1;
int minThresholdPosition = 0;
// The leftmost position at which the greatest of the k lower elements
// -- the new value of threshold -- might be found.
int iterations = 0;
int maxIterations = IntMath.log2(right - left, RoundingMode.CEILING) * 3;
while (left < right) {
int pivotIndex = (left + right + 1) >>> 1;
int pivotNewIndex = partition(left, right, pivotIndex);
if (pivotNewIndex > k) {
right = pivotNewIndex - 1;
} else if (pivotNewIndex < k) {
left = Math.max(pivotNewIndex, left + 1);
minThresholdPosition = pivotNewIndex;
} else {
break;
}
iterations++;
if (iterations >= maxIterations) {
// We've already taken O(k log k), let's make sure we don't take longer than O(k log k).
Arrays.sort(buffer, left, right, comparator);
break;
}
}
bufferSize = k;
threshold = buffer[minThresholdPosition];
for (int i = minThresholdPosition + 1; i < k; i++) {
if (comparator.compare(buffer[i], threshold) > 0) {
threshold = buffer[i];
}
}
} } | public class class_name {
private void trim() {
int left = 0;
int right = 2 * k - 1;
int minThresholdPosition = 0;
// The leftmost position at which the greatest of the k lower elements
// -- the new value of threshold -- might be found.
int iterations = 0;
int maxIterations = IntMath.log2(right - left, RoundingMode.CEILING) * 3;
while (left < right) {
int pivotIndex = (left + right + 1) >>> 1;
int pivotNewIndex = partition(left, right, pivotIndex);
if (pivotNewIndex > k) {
right = pivotNewIndex - 1; // depends on control dependency: [if], data = [none]
} else if (pivotNewIndex < k) {
left = Math.max(pivotNewIndex, left + 1); // depends on control dependency: [if], data = [(pivotNewIndex]
minThresholdPosition = pivotNewIndex; // depends on control dependency: [if], data = [none]
} else {
break;
}
iterations++; // depends on control dependency: [while], data = [none]
if (iterations >= maxIterations) {
// We've already taken O(k log k), let's make sure we don't take longer than O(k log k).
Arrays.sort(buffer, left, right, comparator); // depends on control dependency: [if], data = [none]
break;
}
}
bufferSize = k;
threshold = buffer[minThresholdPosition];
for (int i = minThresholdPosition + 1; i < k; i++) {
if (comparator.compare(buffer[i], threshold) > 0) {
threshold = buffer[i]; // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public static String addToFilter(String filter, String key, String value)
{
if (value != null)
{
String newFilter = "(" + key + "=" + value + ")";
if ((filter == null) || (filter.length() == 0))
filter = newFilter;
else if ((filter.startsWith("(&")) && (filter.endsWith("")))
filter = filter.substring(0, filter.length() - 1) + newFilter + ")";
else
filter = "(&" + filter + newFilter + ")";
}
return filter;
} } | public class class_name {
public static String addToFilter(String filter, String key, String value)
{
if (value != null)
{
String newFilter = "(" + key + "=" + value + ")";
if ((filter == null) || (filter.length() == 0))
filter = newFilter;
else if ((filter.startsWith("(&")) && (filter.endsWith(""))) // depends on control dependency: [if], data = [none]
filter = filter.substring(0, filter.length() - 1) + newFilter + ")"; // depends on control dependency: [if], data = [none]
else
filter = "(&" + filter + newFilter + ")";
}
return filter;
} } |
public class class_name {
public void writeElement(String name, int type) {
StringBuffer nsdecl = new StringBuffer();
if (_isRootElement) {
for (Iterator<String> iter = _namespaces.keySet().iterator(); iter
.hasNext();) {
String fullName = (String) iter.next();
String abbrev = (String) _namespaces.get(fullName);
nsdecl.append(" xmlns:").append(abbrev).append("=\"").append(
fullName).append("\"");
}
_isRootElement = false;
}
int pos = name.lastIndexOf(':');
if (pos >= 0) {
// lookup prefix for namespace
String fullns = name.substring(0, pos);
String prefix = (String) _namespaces.get(fullns);
if (prefix == null) {
// there is no prefix for this namespace
name = name.substring(pos + 1);
nsdecl.append(" xmlns=\"").append(fullns).append("\"");
} else {
// there is a prefix
name = prefix + ":" + name.substring(pos + 1);
}
} else {
throw new IllegalArgumentException(
"All XML elements must have a namespace");
}
switch (type) {
case OPENING:
_buffer.append("<");
_buffer.append(name);
_buffer.append( nsdecl);
_buffer.append( ">");
break;
case CLOSING:
_buffer.append("</");
_buffer.append( name);
_buffer.append( ">\n");
break;
case NO_CONTENT:
default:
_buffer.append("<");
_buffer.append( name);
_buffer.append( nsdecl);
_buffer.append( "/>");
break;
}
} } | public class class_name {
public void writeElement(String name, int type) {
StringBuffer nsdecl = new StringBuffer();
if (_isRootElement) {
for (Iterator<String> iter = _namespaces.keySet().iterator(); iter
.hasNext();) {
String fullName = (String) iter.next();
String abbrev = (String) _namespaces.get(fullName);
nsdecl.append(" xmlns:").append(abbrev).append("=\"").append(
fullName).append("\""); // depends on control dependency: [for], data = [none]
}
_isRootElement = false; // depends on control dependency: [if], data = [none]
}
int pos = name.lastIndexOf(':');
if (pos >= 0) {
// lookup prefix for namespace
String fullns = name.substring(0, pos);
String prefix = (String) _namespaces.get(fullns);
if (prefix == null) {
// there is no prefix for this namespace
name = name.substring(pos + 1); // depends on control dependency: [if], data = [none]
nsdecl.append(" xmlns=\"").append(fullns).append("\""); // depends on control dependency: [if], data = [none]
} else {
// there is a prefix
name = prefix + ":" + name.substring(pos + 1); // depends on control dependency: [if], data = [none]
}
} else {
throw new IllegalArgumentException(
"All XML elements must have a namespace");
}
switch (type) {
case OPENING:
_buffer.append("<");
_buffer.append(name);
_buffer.append( nsdecl);
_buffer.append( ">");
break;
case CLOSING:
_buffer.append("</");
_buffer.append( name);
_buffer.append( ">\n");
break;
case NO_CONTENT:
default:
_buffer.append("<");
_buffer.append( name);
_buffer.append( nsdecl);
_buffer.append( "/>");
break;
}
} } |
public class class_name {
public QuestionStructure getMainPart(String question, List<edu.stanford.nlp.ling.Word> words) {
QuestionStructure questionStructure = new QuestionStructure();
questionStructure.setQuestion(question);
Tree tree = LP.apply(words);
LOG.info("句法树: ");
tree.pennPrint();
questionStructure.setTree(tree);
GrammaticalStructure gs = GSF.newGrammaticalStructure(tree);
if(gs == null){
return null;
}
//获取依存关系
Collection<TypedDependency> tdls = gs.typedDependenciesCCprocessed(true);
questionStructure.setTdls(tdls);
Map<String, String> map = new HashMap<>();
String top = null;
String root = null;
LOG.info("句子依存关系:");
//依存关系
List<String> dependencies = new ArrayList<>();
for (TypedDependency tdl : tdls) {
String item = tdl.toString();
dependencies.add(item);
LOG.info("\t" + item);
if (item.startsWith("top")) {
top = item;
}
if (item.startsWith("root")) {
root = item;
}
int start = item.indexOf("(");
int end = item.lastIndexOf(")");
item = item.substring(start + 1, end);
String[] attr = item.split(",");
String k = attr[0].trim();
String v = attr[1].trim();
String value = map.get(k);
if (value == null) {
map.put(k, v);
} else {
//有值
value += ":";
value += v;
map.put(k, value);
}
}
questionStructure.setDependencies(dependencies);
String mainPartForTop = null;
String mainPartForRoot = null;
if (top != null) {
mainPartForTop = topPattern(top, map);
}
if (root != null) {
mainPartForRoot = rootPattern(root, map);
}
questionStructure.setMainPartForTop(mainPartForTop);
questionStructure.setMainPartForRoot(mainPartForRoot);
if (questionStructure.getMainPart() == null) {
LOG.error("未能识别主谓宾:" + question);
} else {
LOG.info("主谓宾:" + questionStructure.getMainPart());
}
return questionStructure;
} } | public class class_name {
public QuestionStructure getMainPart(String question, List<edu.stanford.nlp.ling.Word> words) {
QuestionStructure questionStructure = new QuestionStructure();
questionStructure.setQuestion(question);
Tree tree = LP.apply(words);
LOG.info("句法树: ");
tree.pennPrint();
questionStructure.setTree(tree);
GrammaticalStructure gs = GSF.newGrammaticalStructure(tree);
if(gs == null){
return null; // depends on control dependency: [if], data = [none]
}
//获取依存关系
Collection<TypedDependency> tdls = gs.typedDependenciesCCprocessed(true);
questionStructure.setTdls(tdls);
Map<String, String> map = new HashMap<>();
String top = null;
String root = null;
LOG.info("句子依存关系:");
//依存关系
List<String> dependencies = new ArrayList<>();
for (TypedDependency tdl : tdls) {
String item = tdl.toString();
dependencies.add(item); // depends on control dependency: [for], data = [none]
LOG.info("\t" + item); // depends on control dependency: [for], data = [none]
if (item.startsWith("top")) {
top = item; // depends on control dependency: [if], data = [none]
}
if (item.startsWith("root")) {
root = item; // depends on control dependency: [if], data = [none]
}
int start = item.indexOf("(");
int end = item.lastIndexOf(")");
item = item.substring(start + 1, end); // depends on control dependency: [for], data = [none]
String[] attr = item.split(",");
String k = attr[0].trim();
String v = attr[1].trim();
String value = map.get(k);
if (value == null) {
map.put(k, v); // depends on control dependency: [if], data = [none]
} else {
//有值
value += ":"; // depends on control dependency: [if], data = [none]
value += v; // depends on control dependency: [if], data = [none]
map.put(k, value); // depends on control dependency: [if], data = [none]
}
}
questionStructure.setDependencies(dependencies);
String mainPartForTop = null;
String mainPartForRoot = null;
if (top != null) {
mainPartForTop = topPattern(top, map); // depends on control dependency: [if], data = [(top]
}
if (root != null) {
mainPartForRoot = rootPattern(root, map); // depends on control dependency: [if], data = [(root]
}
questionStructure.setMainPartForTop(mainPartForTop);
questionStructure.setMainPartForRoot(mainPartForRoot);
if (questionStructure.getMainPart() == null) {
LOG.error("未能识别主谓宾:" + question); // depends on control dependency: [if], data = [none]
} else {
LOG.info("主谓宾:" + questionStructure.getMainPart()); // depends on control dependency: [if], data = [none]
}
return questionStructure;
} } |
public class class_name {
@Override
public boolean contains(int element)
{
if (element < 0) {
throw new IndexOutOfBoundsException("element < 0: " + element);
}
if (isEmpty()) {
return false;
}
return findElementOrEmpty(element) >= 0;
} } | public class class_name {
@Override
public boolean contains(int element)
{
if (element < 0) {
throw new IndexOutOfBoundsException("element < 0: " + element);
}
if (isEmpty()) {
return false;
// depends on control dependency: [if], data = [none]
}
return findElementOrEmpty(element) >= 0;
} } |
public class class_name {
void markStackedVariables(Stack s)
{
// Reverse the stack.
Stack bts = new Stack();
// LogStream.err.println("Variables to be marked:");
while (!s.empty()) {
// LogStream.err.println(((BaseType)s.peek()).getName());
bts.push(s.pop());
}
// For each but the last stack element, set the projection.
// setProject(true, false) for a ctor type sets the projection for
// the ctor itself but *does not* set the projection for all its
// children. Thus, if a user wants the variable S.X, and S contains Y
// and Z too, S's projection will be set (so serialize will descend
// into S) but X, Y and Z's projection remain clear. In this example,
// X's projection is set by the code that follows the while loop.
// 1/28/2000 jhrg
while (bts.size() > 1) {
ServerMethods ct = (ServerMethods) bts.pop();
ct.setProject(true, false);
}
// For the last element, project the entire variable.
ServerMethods bt = (ServerMethods) bts.pop();
bt.setProject(true, true);
} } | public class class_name {
void markStackedVariables(Stack s)
{
// Reverse the stack.
Stack bts = new Stack();
// LogStream.err.println("Variables to be marked:");
while (!s.empty()) {
// LogStream.err.println(((BaseType)s.peek()).getName());
bts.push(s.pop());
// depends on control dependency: [while], data = [none]
}
// For each but the last stack element, set the projection.
// setProject(true, false) for a ctor type sets the projection for
// the ctor itself but *does not* set the projection for all its
// children. Thus, if a user wants the variable S.X, and S contains Y
// and Z too, S's projection will be set (so serialize will descend
// into S) but X, Y and Z's projection remain clear. In this example,
// X's projection is set by the code that follows the while loop.
// 1/28/2000 jhrg
while (bts.size() > 1) {
ServerMethods ct = (ServerMethods) bts.pop();
ct.setProject(true, false);
// depends on control dependency: [while], data = [none]
}
// For the last element, project the entire variable.
ServerMethods bt = (ServerMethods) bts.pop();
bt.setProject(true, true);
} } |
public class class_name {
public PropertyStyle getStyle() {
if (isDerived()) {
return PropertyStyle.DERIVED;
}
if (getBean().isImmutable()) {
return PropertyStyle.IMMUTABLE;
}
if (getGetStyle().length() > 0 && getSetStyle().length() > 0 && (getSetterGen().isSetterGenerated(this) || getSetStyle().equals("manual"))) {
return PropertyStyle.READ_WRITE;
}
if (getGetStyle().length() > 0) {
if (bean.isBuilderScopeVisible()) {
return PropertyStyle.READ_ONLY_BUILDABLE;
} else {
return PropertyStyle.READ_ONLY;
}
}
if (getSetStyle().length() > 0) {
return PropertyStyle.WRITE_ONLY;
}
throw new RuntimeException("Property must have a getter or setter: " +
getBean().getTypeRaw() + "." + getPropertyName());
} } | public class class_name {
public PropertyStyle getStyle() {
if (isDerived()) {
return PropertyStyle.DERIVED; // depends on control dependency: [if], data = [none]
}
if (getBean().isImmutable()) {
return PropertyStyle.IMMUTABLE; // depends on control dependency: [if], data = [none]
}
if (getGetStyle().length() > 0 && getSetStyle().length() > 0 && (getSetterGen().isSetterGenerated(this) || getSetStyle().equals("manual"))) {
return PropertyStyle.READ_WRITE; // depends on control dependency: [if], data = [none]
}
if (getGetStyle().length() > 0) {
if (bean.isBuilderScopeVisible()) {
return PropertyStyle.READ_ONLY_BUILDABLE; // depends on control dependency: [if], data = [none]
} else {
return PropertyStyle.READ_ONLY; // depends on control dependency: [if], data = [none]
}
}
if (getSetStyle().length() > 0) {
return PropertyStyle.WRITE_ONLY; // depends on control dependency: [if], data = [none]
}
throw new RuntimeException("Property must have a getter or setter: " +
getBean().getTypeRaw() + "." + getPropertyName());
} } |
public class class_name {
public DeleteFacesRequest withFaceIds(String... faceIds) {
if (this.faceIds == null) {
setFaceIds(new java.util.ArrayList<String>(faceIds.length));
}
for (String ele : faceIds) {
this.faceIds.add(ele);
}
return this;
} } | public class class_name {
public DeleteFacesRequest withFaceIds(String... faceIds) {
if (this.faceIds == null) {
setFaceIds(new java.util.ArrayList<String>(faceIds.length)); // depends on control dependency: [if], data = [none]
}
for (String ele : faceIds) {
this.faceIds.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
E getEntry(@Nullable Object key) {
if (key == null) {
return null;
}
int hash = hash(key);
return segmentFor(hash).getEntry(key, hash);
} } | public class class_name {
E getEntry(@Nullable Object key) {
if (key == null) {
return null; // depends on control dependency: [if], data = [none]
}
int hash = hash(key);
return segmentFor(hash).getEntry(key, hash);
} } |
public class class_name {
public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException, IllegalStateException
{
checkIfOpened();
try
{
ResultSet node = findChildNodesByParentIdentifier(getInternalId(parent.getIdentifier()));
try
{
List<NodeData> childrens = new ArrayList<NodeData>();
while (node.next())
{
childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLASS_NODE, parent.getACL()));
}
return childrens;
}
finally
{
try
{
node.close();
}
catch (SQLException e)
{
LOG.error("Can't close the ResultSet: " + e.getMessage());
}
}
}
catch (SQLException e)
{
throw new RepositoryException(e);
}
catch (IOException e)
{
throw new RepositoryException(e);
}
} } | public class class_name {
public List<NodeData> getChildNodesData(NodeData parent) throws RepositoryException, IllegalStateException
{
checkIfOpened();
try
{
ResultSet node = findChildNodesByParentIdentifier(getInternalId(parent.getIdentifier()));
try
{
List<NodeData> childrens = new ArrayList<NodeData>();
while (node.next())
{
childrens.add((NodeData)itemData(parent.getQPath(), node, I_CLASS_NODE, parent.getACL())); // depends on control dependency: [while], data = [none]
}
return childrens; // depends on control dependency: [try], data = [none]
}
finally
{
try
{
node.close(); // depends on control dependency: [try], data = [none]
}
catch (SQLException e)
{
LOG.error("Can't close the ResultSet: " + e.getMessage());
} // depends on control dependency: [catch], data = [none]
}
}
catch (SQLException e)
{
throw new RepositoryException(e);
}
catch (IOException e)
{
throw new RepositoryException(e);
}
} } |
public class class_name {
public void accept(final MethodVisitor mv) {
AbstractInsnNode insn = first;
while (insn != null) {
insn.accept(mv);
insn = insn.next;
}
} } | public class class_name {
public void accept(final MethodVisitor mv) {
AbstractInsnNode insn = first;
while (insn != null) {
insn.accept(mv); // depends on control dependency: [while], data = [none]
insn = insn.next; // depends on control dependency: [while], data = [none]
}
} } |
public class class_name {
private ResultSet executeCQL(String cql) {
m_logger.debug("Executing CQL: {}", cql);
try {
return m_dbservice.getSession().execute(cql);
} catch (Exception e) {
m_logger.error("CQL query failed", e);
m_logger.info(" Query={}", cql);
throw e;
}
} } | public class class_name {
private ResultSet executeCQL(String cql) {
m_logger.debug("Executing CQL: {}", cql);
try {
return m_dbservice.getSession().execute(cql); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
m_logger.error("CQL query failed", e);
m_logger.info(" Query={}", cql);
throw e;
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public synchronized void suspended(ServerActivityCallback requestCountListener) {
this.paused = true;
listenerUpdater.set(this, requestCountListener);
if (activeRequestCountUpdater.get(this) == 0) {
if (listenerUpdater.compareAndSet(this, requestCountListener, null)) {
requestCountListener.done();
}
}
} } | public class class_name {
public synchronized void suspended(ServerActivityCallback requestCountListener) {
this.paused = true;
listenerUpdater.set(this, requestCountListener);
if (activeRequestCountUpdater.get(this) == 0) {
if (listenerUpdater.compareAndSet(this, requestCountListener, null)) {
requestCountListener.done(); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public ServiceBroker createService(String name, Service service) {
if (serviceRegistry == null) {
// Start service later
services.put(name, service);
} else {
// Register and start service now
eventbus.addListeners(name, service);
serviceRegistry.addActions(name, service);
}
return this;
} } | public class class_name {
public ServiceBroker createService(String name, Service service) {
if (serviceRegistry == null) {
// Start service later
services.put(name, service); // depends on control dependency: [if], data = [none]
} else {
// Register and start service now
eventbus.addListeners(name, service); // depends on control dependency: [if], data = [none]
serviceRegistry.addActions(name, service); // depends on control dependency: [if], data = [none]
}
return this;
} } |
public class class_name {
@Deprecated
public static RoaringBitmap remove(RoaringBitmap rb, final int rangeStart, final int rangeEnd) {
if (rangeStart >= 0) {
return remove(rb, (long) rangeStart, (long) rangeEnd);
}
// rangeStart being -ve and rangeEnd being positive is not expected)
// so assume both -ve
return remove(rb, rangeStart & 0xFFFFFFFFL, rangeEnd & 0xFFFFFFFFL);
} } | public class class_name {
@Deprecated
public static RoaringBitmap remove(RoaringBitmap rb, final int rangeStart, final int rangeEnd) {
if (rangeStart >= 0) {
return remove(rb, (long) rangeStart, (long) rangeEnd); // depends on control dependency: [if], data = [none]
}
// rangeStart being -ve and rangeEnd being positive is not expected)
// so assume both -ve
return remove(rb, rangeStart & 0xFFFFFFFFL, rangeEnd & 0xFFFFFFFFL);
} } |
public class class_name {
protected static OrientEdge getEdge(final OrientBaseGraph graph, final ODocument doc, String fieldName,
final OPair<Direction, String> connection, final Object fieldValue, final OIdentifiable iTargetVertex,
final String[] iLabels) {
final OrientEdge toAdd;
final ODocument fieldRecord = ((OIdentifiable) fieldValue).getRecord();
if (fieldRecord == null)
return null;
OClass klass = ODocumentInternal.getImmutableSchemaClass(fieldRecord);
if (klass == null && ODatabaseRecordThreadLocal.instance().getIfDefined() != null) {
ODatabaseRecordThreadLocal.instance().getIfDefined().getMetadata().reload();
klass = fieldRecord.getSchemaClass();
}
if (klass.isVertexType()) {
if (iTargetVertex != null && !iTargetVertex.equals(fieldValue))
return null;
// DIRECT VERTEX, CREATE A DUMMY EDGE BETWEEN VERTICES
if (connection.getKey() == Direction.OUT)
toAdd = graph.getEdgeInstance(doc, fieldRecord, connection.getValue());
else
toAdd = graph.getEdgeInstance(fieldRecord, doc, connection.getValue());
} else if (klass.isEdgeType()) {
// EDGE
if (iTargetVertex != null) {
Object targetVertex = OrientEdge.getConnection(fieldRecord, connection.getKey().opposite());
if (!iTargetVertex.equals(targetVertex))
return null;
}
toAdd = graph.getEdge(fieldRecord);
} else
throw new IllegalStateException("Invalid content found in " + fieldName + " field: " + fieldRecord);
return toAdd;
} } | public class class_name {
protected static OrientEdge getEdge(final OrientBaseGraph graph, final ODocument doc, String fieldName,
final OPair<Direction, String> connection, final Object fieldValue, final OIdentifiable iTargetVertex,
final String[] iLabels) {
final OrientEdge toAdd;
final ODocument fieldRecord = ((OIdentifiable) fieldValue).getRecord();
if (fieldRecord == null)
return null;
OClass klass = ODocumentInternal.getImmutableSchemaClass(fieldRecord);
if (klass == null && ODatabaseRecordThreadLocal.instance().getIfDefined() != null) {
ODatabaseRecordThreadLocal.instance().getIfDefined().getMetadata().reload(); // depends on control dependency: [if], data = [none]
klass = fieldRecord.getSchemaClass(); // depends on control dependency: [if], data = [none]
}
if (klass.isVertexType()) {
if (iTargetVertex != null && !iTargetVertex.equals(fieldValue))
return null;
// DIRECT VERTEX, CREATE A DUMMY EDGE BETWEEN VERTICES
if (connection.getKey() == Direction.OUT)
toAdd = graph.getEdgeInstance(doc, fieldRecord, connection.getValue());
else
toAdd = graph.getEdgeInstance(fieldRecord, doc, connection.getValue());
} else if (klass.isEdgeType()) {
// EDGE
if (iTargetVertex != null) {
Object targetVertex = OrientEdge.getConnection(fieldRecord, connection.getKey().opposite());
if (!iTargetVertex.equals(targetVertex))
return null;
}
toAdd = graph.getEdge(fieldRecord); // depends on control dependency: [if], data = [none]
} else
throw new IllegalStateException("Invalid content found in " + fieldName + " field: " + fieldRecord);
return toAdd;
} } |
public class class_name {
private static Identity parse(final JsonObject json) {
final Map<String, String> props = new HashMap<>(json.size());
final Opt<JsonObject> image = new Opt.Single<>(
json.getJsonObject("image")
);
if (image.has()) {
props.put(PsGoogle.PICTURE, image.get().getString("url", "#"));
} else {
props.put(PsGoogle.PICTURE, "#");
}
props.put(
PsGoogle.NAME, json.getString(PsGoogle.DISPLAY_NAME, "unknown")
);
return new Identity.Simple(
String.format("urn:google:%s", json.getString("id")), props
);
} } | public class class_name {
private static Identity parse(final JsonObject json) {
final Map<String, String> props = new HashMap<>(json.size());
final Opt<JsonObject> image = new Opt.Single<>(
json.getJsonObject("image")
);
if (image.has()) {
props.put(PsGoogle.PICTURE, image.get().getString("url", "#")); // depends on control dependency: [if], data = [none]
} else {
props.put(PsGoogle.PICTURE, "#"); // depends on control dependency: [if], data = [none]
}
props.put(
PsGoogle.NAME, json.getString(PsGoogle.DISPLAY_NAME, "unknown")
);
return new Identity.Simple(
String.format("urn:google:%s", json.getString("id")), props
);
} } |
public class class_name {
public void marshall(UpdateChannelRequest updateChannelRequest, ProtocolMarshaller protocolMarshaller) {
if (updateChannelRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateChannelRequest.getDescription(), DESCRIPTION_BINDING);
protocolMarshaller.marshall(updateChannelRequest.getId(), ID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(UpdateChannelRequest updateChannelRequest, ProtocolMarshaller protocolMarshaller) {
if (updateChannelRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateChannelRequest.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(updateChannelRequest.getId(), ID_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 Bwprocesses getBWProcesses(Bw bwService) {
for (Object o : bwService.getRest()) {
if (o.getClass().equals(Bwprocesses.class)) {
return (Bwprocesses) o;
}
}
return null;
} } | public class class_name {
private Bwprocesses getBWProcesses(Bw bwService) {
for (Object o : bwService.getRest()) {
if (o.getClass().equals(Bwprocesses.class)) {
return (Bwprocesses) o; // depends on control dependency: [if], data = [none]
}
}
return null;
} } |
public class class_name {
public ValueVo getConfItemByParameter(Long appId, Long envId, String version, String key) {
Config config = configDao.getByParameter(appId, envId, version, key, DisConfigTypeEnum.ITEM);
if (config == null) {
return ConfigUtils.getErrorVo("cannot find this config");
}
ValueVo valueVo = new ValueVo();
valueVo.setValue(config.getValue());
valueVo.setStatus(Constants.OK);
return valueVo;
} } | public class class_name {
public ValueVo getConfItemByParameter(Long appId, Long envId, String version, String key) {
Config config = configDao.getByParameter(appId, envId, version, key, DisConfigTypeEnum.ITEM);
if (config == null) {
return ConfigUtils.getErrorVo("cannot find this config"); // depends on control dependency: [if], data = [none]
}
ValueVo valueVo = new ValueVo();
valueVo.setValue(config.getValue());
valueVo.setStatus(Constants.OK);
return valueVo;
} } |
public class class_name {
private boolean _decompose() {
double h[] = QH.data;
for( int k = 0; k < N-2; k++ ) {
// find the largest value in this column
// this is used to normalize the column and mitigate overflow/underflow
double max = 0;
for( int i = k+1; i < N; i++ ) {
// copy the householder vector to vector outside of the matrix to reduce caching issues
// big improvement on larger matrices and a relatively small performance hit on small matrices.
double val = u[i] = h[i*N+k];
val = Math.abs(val);
if( val > max )
max = val;
}
if( max > 0 ) {
// -------- set up the reflector Q_k
double tau = 0;
// normalize to reduce overflow/underflow
// and compute tau for the reflector
for( int i = k+1; i < N; i++ ) {
double val = u[i] /= max;
tau += val*val;
}
tau = Math.sqrt(tau);
if( u[k+1] < 0 )
tau = -tau;
// write the reflector into the lower left column of the matrix
double nu = u[k+1] + tau;
u[k+1] = 1.0;
for( int i = k+2; i < N; i++ ) {
h[i*N+k] = u[i] /= nu;
}
double gamma = nu/tau;
gammas[k] = gamma;
// ---------- multiply on the left by Q_k
QrHelperFunctions_DDRM.rank1UpdateMultR(QH, u, gamma, k + 1, k + 1, N, b);
// ---------- multiply on the right by Q_k
QrHelperFunctions_DDRM.rank1UpdateMultL(QH, u, gamma, 0, k + 1, N);
// since the first element in the householder vector is known to be 1
// store the full upper hessenberg
h[(k+1)*N+k] = -tau*max;
} else {
gammas[k] = 0;
}
}
return true;
} } | public class class_name {
private boolean _decompose() {
double h[] = QH.data;
for( int k = 0; k < N-2; k++ ) {
// find the largest value in this column
// this is used to normalize the column and mitigate overflow/underflow
double max = 0;
for( int i = k+1; i < N; i++ ) {
// copy the householder vector to vector outside of the matrix to reduce caching issues
// big improvement on larger matrices and a relatively small performance hit on small matrices.
double val = u[i] = h[i*N+k];
val = Math.abs(val); // depends on control dependency: [for], data = [none]
if( val > max )
max = val;
}
if( max > 0 ) {
// -------- set up the reflector Q_k
double tau = 0;
// normalize to reduce overflow/underflow
// and compute tau for the reflector
for( int i = k+1; i < N; i++ ) {
double val = u[i] /= max;
tau += val*val; // depends on control dependency: [for], data = [none]
}
tau = Math.sqrt(tau); // depends on control dependency: [if], data = [none]
if( u[k+1] < 0 )
tau = -tau;
// write the reflector into the lower left column of the matrix
double nu = u[k+1] + tau;
u[k+1] = 1.0; // depends on control dependency: [if], data = [none]
for( int i = k+2; i < N; i++ ) {
h[i*N+k] = u[i] /= nu; // depends on control dependency: [for], data = [i]
}
double gamma = nu/tau;
gammas[k] = gamma; // depends on control dependency: [if], data = [none]
// ---------- multiply on the left by Q_k
QrHelperFunctions_DDRM.rank1UpdateMultR(QH, u, gamma, k + 1, k + 1, N, b); // depends on control dependency: [if], data = [none]
// ---------- multiply on the right by Q_k
QrHelperFunctions_DDRM.rank1UpdateMultL(QH, u, gamma, 0, k + 1, N); // depends on control dependency: [if], data = [none]
// since the first element in the householder vector is known to be 1
// store the full upper hessenberg
h[(k+1)*N+k] = -tau*max; // depends on control dependency: [if], data = [none]
} else {
gammas[k] = 0; // depends on control dependency: [if], data = [none]
}
}
return true;
} } |
public class class_name {
@Override
public ConversationReceiveListener dataReceived(WsByteBuffer data, int segmentType,
int requestNumber, int priority,
boolean allocatedFromBufferPool,
boolean partOfExchange,
Conversation conversation) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "dataReceived");
AuditManager auditManager = new AuditManager();
auditManager.setJMSConversationMetaData(conversation.getMetaData());
// Get a CommsServerByteBuffer to wrap the data
CommsServerByteBuffer buffer = poolManager.allocate();
buffer.reset(data);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
String LF = System.getProperty("line.separator");
String debugInfo = LF + LF + "-------------------------------------------------------" + LF;
debugInfo += " Segment type : " + JFapChannelConstants.getSegmentName(segmentType) +
" - " + segmentType +
" (0x" + Integer.toHexString(segmentType) + ")" + LF;
debugInfo += " Request number: " + requestNumber + LF;
debugInfo += " Priority : " + priority + LF;
debugInfo += " Exchange? : " + partOfExchange + LF;
debugInfo += " From pool? : " + allocatedFromBufferPool + LF;
debugInfo += " Conversation : " + conversation + LF;
debugInfo += "-------------------------------------------------------" + LF;
SibTr.debug(this, tc, debugInfo);
SibTr.debug(this, tc, conversation.getFullSummary());
}
try {
switch (segmentType) {
case (JFapChannelConstants.SEG_HANDSHAKE):
rcvHandshake(buffer, conversation, requestNumber, allocatedFromBufferPool);
break;
case (JFapChannelConstants.SEG_TOPOLOGY):
rcvTRMExchange(buffer, conversation, requestNumber, allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_MESSAGE_FORMAT_INFO):
rcvMFPExchange(buffer, conversation, requestNumber, allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_DIRECT_CONNECT):
rcvDirectConnect(buffer, conversation, requestNumber, allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_SCHEMA_NOREPLY):
rcvMFPSchema(buffer, conversation, requestNumber, allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XACOMMIT):
StaticCATXATransaction.rcvXACommit(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAEND):
StaticCATXATransaction.rcvXAEnd(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAFORGET):
StaticCATXATransaction.rcvXAForget(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAOPEN):
StaticCATXATransaction.rcvXAOpen(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAPREPARE):
StaticCATXATransaction.rcvXAPrepare(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XARECOVER):
StaticCATXATransaction.rcvXARecover(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAROLLBACK):
StaticCATXATransaction.rcvXARollback(buffer,
conversation,
requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XASTART):
StaticCATXATransaction.rcvXAStart(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XA_GETTXTIMEOUT):
StaticCATXATransaction.rcvXA_getTxTimeout(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XA_SETTXTIMEOUT):
StaticCATXATransaction.rcvXA_setTxTimeout(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CLOSE_CONNECTION):
StaticCATConnection.rcvCloseConnection(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_CLONE_CONNECTION):
StaticCATConnection.rcvCloneConnection(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_TEMP_DESTINATION):
StaticCATDestination.rcvCreateTempDestination(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_DELETE_TEMP_DESTINATION):
StaticCATDestination.rcvDeleteTempDestination(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_GET_DESTINATION_CONFIGURATION):
StaticCATDestination.rcvGetDestinationConfiguration(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_DURABLE_SUB):
StaticCATSubscription.rcvCreateDurableSub(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_DELETE_DURABLE_SUB):
StaticCATSubscription.rcvDeleteDurableSub(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_CONN_MSG):
StaticCATProducer.rcvSendConnMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_CONN_MSG_NOREPLY):
StaticCATProducer.rcvSendConnMsgNoReply(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_RECEIVE_CONN_MSG):
StaticCATConnection.rcvReceiveConnMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_PRODUCER_SESS):
StaticCATProducer.rcvCreateProducerSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CLOSE_CONSUMER_SESS):
StaticCATConsumer.rcvCloseConsumerSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CLOSE_PRODUCER_SESS):
StaticCATProducer.rcvCloseProducerSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_SESS_MSG):
StaticCATProducer.rcvSendSessMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_SESS_MSG_NOREPLY):
StaticCATProducer.rcvSendSessMsgNoReply(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_CONSUMER_SESS):
StaticCATConsumer.rcvCreateConsumerSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_RECEIVE_SESS_MSG):
StaticCATConsumer.rcvSessReceive(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_REQUEST_MSGS):
StaticCATConsumer.rcvRequestMsgs(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_UCTRANSACTION):
StaticCATTransaction.rcvCreateUCTransaction(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_COMMIT_TRANSACTION):
StaticCATTransaction.rcvCommitTransaction(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_ROLLBACK_TRANSACTION):
StaticCATTransaction.rcvRollbackTransaction(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_REGISTER_ASYNC_CONSUMER):
case (JFapChannelConstants.SEG_REGISTER_STOPPABLE_ASYNC_CONSUMER): //SIB0115d.comms
StaticCATConsumer.rcvRegisterAsyncConsumer(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange,
segmentType == JFapChannelConstants.SEG_REGISTER_STOPPABLE_ASYNC_CONSUMER); //SIB0115d.comms
break;
case (JFapChannelConstants.SEG_DEREGISTER_ASYNC_CONSUMER):
case (JFapChannelConstants.SEG_DEREGISTER_STOPPABLE_ASYNC_CONSUMER): //SIB0115d.comms
StaticCATConsumer.rcvDeregisterAsyncConsumer(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange,
segmentType == JFapChannelConstants.SEG_DEREGISTER_STOPPABLE_ASYNC_CONSUMER); //SIB0115d.comms
break;
case (JFapChannelConstants.SEG_START_SESS):
case (JFapChannelConstants.SEG_RESTART_SESS): //471642
StaticCATConsumer.rcvStartSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange,
(segmentType == JFapChannelConstants.SEG_RESTART_SESS)); //471642
break;
case (JFapChannelConstants.SEG_STOP_SESS):
StaticCATConsumer.rcvStopSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_FLUSH_SESS):
StaticCATConsumer.rcvFlushSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_UNLOCK_ALL):
StaticCATConsumer.rcvUnlockAll(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_UNLOCK_SET):
case (JFapChannelConstants.SEG_UNLOCK_SET_NOREPLY):
StaticCATConsumer.rcvUnlockSet(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_DELETE_SET):
case (JFapChannelConstants.SEG_DELETE_SET_NOREPLY):
StaticCATConsumer.rcvDeleteSet(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_BROWSER_SESS):
StaticCATBrowser.rcvCreateBrowserSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_RESET_BROWSE):
StaticCATBrowser.rcvResetBrowse(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_GET_UNIQUE_ID):
StaticCATConnection.rcvGetUniqueId(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_CONS_FOR_DURABLE_SUB):
StaticCATSubscription.rcvCreateConsumerForDurableSub(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_READ_AND_DELETE_SET):
StaticCATConsumer.rcvReadAndDeleteSet(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_READ_SET):
StaticCATConsumer.rcvReadSet(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_BIFURCATED_SESSION):
StaticCATConsumer.rcvCreateBifurcatedSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_ORDER_CONTEXT):
StaticCATConnection.rcvCreateOrderContext(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_TO_EXCEPTION_DESTINATION):
StaticCATDestination.rcvSendToExceptionDest(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CLOSE_ORDER_CONTEXT):
StaticCATConnection.rcvCloseOrderContext(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_REQUEST_SCHEMA):
rcvMFPRequestSchema(buffer, conversation, requestNumber, segmentType,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_CHECK_MESSAGING_REQUIRED):
StaticCATConnection.rcvCheckMessagingRequired(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_INVOKE_COMMAND):
StaticCATConnection.rcvInvokeCommand(buffer, conversation, requestNumber,
allocatedFromBufferPool, false);
break;
case (JFapChannelConstants.SEG_INVOKE_COMMAND_WITH_TX):
StaticCATConnection.rcvInvokeCommand(buffer, conversation, requestNumber,
allocatedFromBufferPool, true);
break;
case (JFapChannelConstants.SEG_SEND_CHUNKED_SESS_MSG):
case (JFapChannelConstants.SEG_SEND_CHUNKED_SESS_MSG_NOREPLY):
StaticCATProducer.rcvSendChunkedSessMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_CHUNKED_CONN_MSG):
case (JFapChannelConstants.SEG_SEND_CHUNKED_CONN_MSG_NOREPLY):
StaticCATProducer.rcvSendChunkedConnMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_CHUNKED_TO_EXCEPTION_DESTINATION):
StaticCATDestination.rcvSendChunkedToExceptionDest(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_ADD_DESTINATION_LISTENER): //SIB0137.comms.2
StaticCATConnection.rcvAddDestinationListener(buffer, conversation, requestNumber, //SIB0137.comms.2
allocatedFromBufferPool, //SIB0137.comms.2
partOfExchange); //SIB0137.comms.2
break; //SIB0137.comms.2
case (JFapChannelConstants.SEG_REGISTER_CONSUMER_SET_MONITOR): //F011127
StaticCATConnection.rcvAddConsumerMonitorListener(buffer, conversation, requestNumber, //F011127
allocatedFromBufferPool, //F011127
partOfExchange); //F011127
break;
case (JFapChannelConstants.SEG_UNLOCK_ALL_NO_INC_LOCK_COUNT): //F013661
StaticCATConsumer.rcvUnlockAllWithUnlockCountFlag(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
default:
String nlsText = nls.getFormattedMessage("INVALID_PROP_SICO8011",
new Object[] { "" + segmentType },
null);
SIConnectionLostException commsException = new SIConnectionLostException(nlsText);
if (partOfExchange) {
StaticCATHelper.sendExceptionToClient(commsException,
null,
conversation,
requestNumber);
}
if (allocatedFromBufferPool) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "releasing WsByteBuffer");
buffer.release();
}
// At this point we should close the connection down as we have no idea what the
// client is up to - sending us invalid segments.
closeConnection(conversation);
break;
}
} catch (Throwable t) {
// If an exception is caught here this indicates that something has
// thrown an exception, probably a RunTimeException that was not expected.
// This may have been the result of a CoreAPI operation.
// At this point we should FFDC and respond with the exception to the
// client.
FFDCFilter.processException(t,
CLASS_NAME + ".dataReceived",
CommsConstants.SERVERTRANSPORTRECEIVELISTENER_DATARCV_01,
new Object[]
{
buffer.getDumpReceivedBytes(128),
this
});
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Caught an exception: ", t);
if (partOfExchange) {
StaticCATHelper.sendExceptionToClient(t,
CommsConstants.SERVERTRANSPORTRECEIVELISTENER_DATARCV_01,
conversation, requestNumber);
}
} finally {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "dataReceived");
}
return null;
} } | public class class_name {
@Override
public ConversationReceiveListener dataReceived(WsByteBuffer data, int segmentType,
int requestNumber, int priority,
boolean allocatedFromBufferPool,
boolean partOfExchange,
Conversation conversation) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "dataReceived");
AuditManager auditManager = new AuditManager();
auditManager.setJMSConversationMetaData(conversation.getMetaData());
// Get a CommsServerByteBuffer to wrap the data
CommsServerByteBuffer buffer = poolManager.allocate();
buffer.reset(data);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
String LF = System.getProperty("line.separator");
String debugInfo = LF + LF + "-------------------------------------------------------" + LF;
debugInfo += " Segment type : " + JFapChannelConstants.getSegmentName(segmentType) + // depends on control dependency: [if], data = [none]
" - " + segmentType +
" (0x" + Integer.toHexString(segmentType) + ")" + LF;
debugInfo += " Request number: " + requestNumber + LF; // depends on control dependency: [if], data = [none]
debugInfo += " Priority : " + priority + LF; // depends on control dependency: [if], data = [none]
debugInfo += " Exchange? : " + partOfExchange + LF; // depends on control dependency: [if], data = [none]
debugInfo += " From pool? : " + allocatedFromBufferPool + LF; // depends on control dependency: [if], data = [none]
debugInfo += " Conversation : " + conversation + LF; // depends on control dependency: [if], data = [none]
debugInfo += "-------------------------------------------------------" + LF; // depends on control dependency: [if], data = [none]
SibTr.debug(this, tc, debugInfo); // depends on control dependency: [if], data = [none]
SibTr.debug(this, tc, conversation.getFullSummary()); // depends on control dependency: [if], data = [none]
}
try {
switch (segmentType) {
case (JFapChannelConstants.SEG_HANDSHAKE):
rcvHandshake(buffer, conversation, requestNumber, allocatedFromBufferPool);
break;
case (JFapChannelConstants.SEG_TOPOLOGY):
rcvTRMExchange(buffer, conversation, requestNumber, allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_MESSAGE_FORMAT_INFO):
rcvMFPExchange(buffer, conversation, requestNumber, allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_DIRECT_CONNECT):
rcvDirectConnect(buffer, conversation, requestNumber, allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_SCHEMA_NOREPLY):
rcvMFPSchema(buffer, conversation, requestNumber, allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XACOMMIT):
StaticCATXATransaction.rcvXACommit(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAEND):
StaticCATXATransaction.rcvXAEnd(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAFORGET):
StaticCATXATransaction.rcvXAForget(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAOPEN):
StaticCATXATransaction.rcvXAOpen(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAPREPARE):
StaticCATXATransaction.rcvXAPrepare(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XARECOVER):
StaticCATXATransaction.rcvXARecover(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XAROLLBACK):
StaticCATXATransaction.rcvXARollback(buffer,
conversation,
requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XASTART):
StaticCATXATransaction.rcvXAStart(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XA_GETTXTIMEOUT):
StaticCATXATransaction.rcvXA_getTxTimeout(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_XA_SETTXTIMEOUT):
StaticCATXATransaction.rcvXA_setTxTimeout(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CLOSE_CONNECTION):
StaticCATConnection.rcvCloseConnection(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_CLONE_CONNECTION):
StaticCATConnection.rcvCloneConnection(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_TEMP_DESTINATION):
StaticCATDestination.rcvCreateTempDestination(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_DELETE_TEMP_DESTINATION):
StaticCATDestination.rcvDeleteTempDestination(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_GET_DESTINATION_CONFIGURATION):
StaticCATDestination.rcvGetDestinationConfiguration(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_DURABLE_SUB):
StaticCATSubscription.rcvCreateDurableSub(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_DELETE_DURABLE_SUB):
StaticCATSubscription.rcvDeleteDurableSub(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_CONN_MSG):
StaticCATProducer.rcvSendConnMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_CONN_MSG_NOREPLY):
StaticCATProducer.rcvSendConnMsgNoReply(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_RECEIVE_CONN_MSG):
StaticCATConnection.rcvReceiveConnMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_PRODUCER_SESS):
StaticCATProducer.rcvCreateProducerSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CLOSE_CONSUMER_SESS):
StaticCATConsumer.rcvCloseConsumerSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CLOSE_PRODUCER_SESS):
StaticCATProducer.rcvCloseProducerSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_SESS_MSG):
StaticCATProducer.rcvSendSessMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_SESS_MSG_NOREPLY):
StaticCATProducer.rcvSendSessMsgNoReply(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_CONSUMER_SESS):
StaticCATConsumer.rcvCreateConsumerSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_RECEIVE_SESS_MSG):
StaticCATConsumer.rcvSessReceive(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_REQUEST_MSGS):
StaticCATConsumer.rcvRequestMsgs(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_UCTRANSACTION):
StaticCATTransaction.rcvCreateUCTransaction(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_COMMIT_TRANSACTION):
StaticCATTransaction.rcvCommitTransaction(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_ROLLBACK_TRANSACTION):
StaticCATTransaction.rcvRollbackTransaction(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_REGISTER_ASYNC_CONSUMER):
case (JFapChannelConstants.SEG_REGISTER_STOPPABLE_ASYNC_CONSUMER): //SIB0115d.comms
StaticCATConsumer.rcvRegisterAsyncConsumer(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange,
segmentType == JFapChannelConstants.SEG_REGISTER_STOPPABLE_ASYNC_CONSUMER); //SIB0115d.comms
break;
case (JFapChannelConstants.SEG_DEREGISTER_ASYNC_CONSUMER):
case (JFapChannelConstants.SEG_DEREGISTER_STOPPABLE_ASYNC_CONSUMER): //SIB0115d.comms
StaticCATConsumer.rcvDeregisterAsyncConsumer(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange,
segmentType == JFapChannelConstants.SEG_DEREGISTER_STOPPABLE_ASYNC_CONSUMER); //SIB0115d.comms
break;
case (JFapChannelConstants.SEG_START_SESS):
case (JFapChannelConstants.SEG_RESTART_SESS): //471642
StaticCATConsumer.rcvStartSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange,
(segmentType == JFapChannelConstants.SEG_RESTART_SESS)); //471642
break;
case (JFapChannelConstants.SEG_STOP_SESS):
StaticCATConsumer.rcvStopSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_FLUSH_SESS):
StaticCATConsumer.rcvFlushSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_UNLOCK_ALL):
StaticCATConsumer.rcvUnlockAll(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_UNLOCK_SET):
case (JFapChannelConstants.SEG_UNLOCK_SET_NOREPLY):
StaticCATConsumer.rcvUnlockSet(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_DELETE_SET):
case (JFapChannelConstants.SEG_DELETE_SET_NOREPLY):
StaticCATConsumer.rcvDeleteSet(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_BROWSER_SESS):
StaticCATBrowser.rcvCreateBrowserSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_RESET_BROWSE):
StaticCATBrowser.rcvResetBrowse(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_GET_UNIQUE_ID):
StaticCATConnection.rcvGetUniqueId(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_CONS_FOR_DURABLE_SUB):
StaticCATSubscription.rcvCreateConsumerForDurableSub(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_READ_AND_DELETE_SET):
StaticCATConsumer.rcvReadAndDeleteSet(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_READ_SET):
StaticCATConsumer.rcvReadSet(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_BIFURCATED_SESSION):
StaticCATConsumer.rcvCreateBifurcatedSess(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CREATE_ORDER_CONTEXT):
StaticCATConnection.rcvCreateOrderContext(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_TO_EXCEPTION_DESTINATION):
StaticCATDestination.rcvSendToExceptionDest(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_CLOSE_ORDER_CONTEXT):
StaticCATConnection.rcvCloseOrderContext(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_REQUEST_SCHEMA):
rcvMFPRequestSchema(buffer, conversation, requestNumber, segmentType,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_CHECK_MESSAGING_REQUIRED):
StaticCATConnection.rcvCheckMessagingRequired(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_INVOKE_COMMAND):
StaticCATConnection.rcvInvokeCommand(buffer, conversation, requestNumber,
allocatedFromBufferPool, false);
break;
case (JFapChannelConstants.SEG_INVOKE_COMMAND_WITH_TX):
StaticCATConnection.rcvInvokeCommand(buffer, conversation, requestNumber,
allocatedFromBufferPool, true);
break;
case (JFapChannelConstants.SEG_SEND_CHUNKED_SESS_MSG):
case (JFapChannelConstants.SEG_SEND_CHUNKED_SESS_MSG_NOREPLY):
StaticCATProducer.rcvSendChunkedSessMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_CHUNKED_CONN_MSG):
case (JFapChannelConstants.SEG_SEND_CHUNKED_CONN_MSG_NOREPLY):
StaticCATProducer.rcvSendChunkedConnMsg(buffer, conversation, requestNumber,
allocatedFromBufferPool, partOfExchange);
break;
case (JFapChannelConstants.SEG_SEND_CHUNKED_TO_EXCEPTION_DESTINATION):
StaticCATDestination.rcvSendChunkedToExceptionDest(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
case (JFapChannelConstants.SEG_ADD_DESTINATION_LISTENER): //SIB0137.comms.2
StaticCATConnection.rcvAddDestinationListener(buffer, conversation, requestNumber, //SIB0137.comms.2
allocatedFromBufferPool, //SIB0137.comms.2
partOfExchange); //SIB0137.comms.2
break; //SIB0137.comms.2
case (JFapChannelConstants.SEG_REGISTER_CONSUMER_SET_MONITOR): //F011127
StaticCATConnection.rcvAddConsumerMonitorListener(buffer, conversation, requestNumber, //F011127
allocatedFromBufferPool, //F011127
partOfExchange); //F011127
break;
case (JFapChannelConstants.SEG_UNLOCK_ALL_NO_INC_LOCK_COUNT): //F013661
StaticCATConsumer.rcvUnlockAllWithUnlockCountFlag(buffer, conversation, requestNumber,
allocatedFromBufferPool,
partOfExchange);
break;
default:
String nlsText = nls.getFormattedMessage("INVALID_PROP_SICO8011",
new Object[] { "" + segmentType },
null);
SIConnectionLostException commsException = new SIConnectionLostException(nlsText);
if (partOfExchange) {
StaticCATHelper.sendExceptionToClient(commsException,
null,
conversation,
requestNumber); // depends on control dependency: [if], data = [none]
}
if (allocatedFromBufferPool) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "releasing WsByteBuffer");
buffer.release(); // depends on control dependency: [if], data = [none]
}
// At this point we should close the connection down as we have no idea what the
// client is up to - sending us invalid segments.
closeConnection(conversation);
break;
}
} catch (Throwable t) {
// If an exception is caught here this indicates that something has
// thrown an exception, probably a RunTimeException that was not expected.
// This may have been the result of a CoreAPI operation.
// At this point we should FFDC and respond with the exception to the
// client.
FFDCFilter.processException(t,
CLASS_NAME + ".dataReceived",
CommsConstants.SERVERTRANSPORTRECEIVELISTENER_DATARCV_01,
new Object[]
{
buffer.getDumpReceivedBytes(128),
this
});
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(this, tc, "Caught an exception: ", t);
if (partOfExchange) {
StaticCATHelper.sendExceptionToClient(t,
CommsConstants.SERVERTRANSPORTRECEIVELISTENER_DATARCV_01,
conversation, requestNumber); // depends on control dependency: [if], data = [none]
}
} finally { // depends on control dependency: [catch], data = [none]
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(this, tc, "dataReceived");
}
return null;
} } |
public class class_name {
public DatePicker setDateFormat(SimpleDateFormat dateFormat) {
this.dateFormat = dateFormat;
for (Validator validator : this.getValidators()) {
if (validator instanceof DateValidator) {
((DateValidator) validator).setDateFormat(dateFormat);
}
}
return this;
} } | public class class_name {
public DatePicker setDateFormat(SimpleDateFormat dateFormat) {
this.dateFormat = dateFormat;
for (Validator validator : this.getValidators()) {
if (validator instanceof DateValidator) {
((DateValidator) validator).setDateFormat(dateFormat);
// depends on control dependency: [if], data = [none]
}
}
return this;
} } |
public class class_name {
public void marshall(ListBackupPlanVersionsRequest listBackupPlanVersionsRequest, ProtocolMarshaller protocolMarshaller) {
if (listBackupPlanVersionsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listBackupPlanVersionsRequest.getBackupPlanId(), BACKUPPLANID_BINDING);
protocolMarshaller.marshall(listBackupPlanVersionsRequest.getNextToken(), NEXTTOKEN_BINDING);
protocolMarshaller.marshall(listBackupPlanVersionsRequest.getMaxResults(), MAXRESULTS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(ListBackupPlanVersionsRequest listBackupPlanVersionsRequest, ProtocolMarshaller protocolMarshaller) {
if (listBackupPlanVersionsRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listBackupPlanVersionsRequest.getBackupPlanId(), BACKUPPLANID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listBackupPlanVersionsRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(listBackupPlanVersionsRequest.getMaxResults(), MAXRESULTS_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
@Nullable
public static String getRealPathFromUri(ContentResolver contentResolver, final Uri srcUri) {
String result = null;
if (isLocalContentUri(srcUri)) {
Cursor cursor = null;
try {
cursor = contentResolver.query(srcUri, null, null, null, null);
if (cursor != null && cursor.moveToFirst()) {
int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
if (idx != -1) {
result = cursor.getString(idx);
}
}
} finally {
if (cursor != null) {
cursor.close();
}
}
} else if (isLocalFileUri(srcUri)) {
result = srcUri.getPath();
}
return result;
} } | public class class_name {
@Nullable
public static String getRealPathFromUri(ContentResolver contentResolver, final Uri srcUri) {
String result = null;
if (isLocalContentUri(srcUri)) {
Cursor cursor = null;
try {
cursor = contentResolver.query(srcUri, null, null, null, null); // depends on control dependency: [try], data = [none]
if (cursor != null && cursor.moveToFirst()) {
int idx = cursor.getColumnIndex(MediaStore.Images.ImageColumns.DATA);
if (idx != -1) {
result = cursor.getString(idx); // depends on control dependency: [if], data = [(idx]
}
}
} finally {
if (cursor != null) {
cursor.close(); // depends on control dependency: [if], data = [none]
}
}
} else if (isLocalFileUri(srcUri)) {
result = srcUri.getPath(); // depends on control dependency: [if], data = [none]
}
return result;
} } |
public class class_name {
static final Set<String> uniquePrefixSet(final Config config) {
Set<String> prefixSet = Sets.newHashSet();
for(Map.Entry<String, ConfigValue> entry : config.entrySet()) {
String key = entry.getKey();
int index = key.indexOf('.');
if(index > 0) {
String prefix = key.substring(0, index);
prefixSet.add(prefix);
}
}
return prefixSet;
} } | public class class_name {
static final Set<String> uniquePrefixSet(final Config config) {
Set<String> prefixSet = Sets.newHashSet();
for(Map.Entry<String, ConfigValue> entry : config.entrySet()) {
String key = entry.getKey();
int index = key.indexOf('.');
if(index > 0) {
String prefix = key.substring(0, index);
prefixSet.add(prefix); // depends on control dependency: [if], data = [none]
}
}
return prefixSet;
} } |
public class class_name {
public void marshall(ListPipelinesRequest listPipelinesRequest, ProtocolMarshaller protocolMarshaller) {
if (listPipelinesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listPipelinesRequest.getNextToken(), NEXTTOKEN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(ListPipelinesRequest listPipelinesRequest, ProtocolMarshaller protocolMarshaller) {
if (listPipelinesRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(listPipelinesRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public I_CmsEditor getEditorForType(I_CmsResourceType type, boolean plainText) {
List<I_CmsEditor> editors = new ArrayList<I_CmsEditor>();
for (int i = 0; i < EDITORS.length; i++) {
if (EDITORS[i].matchesType(type, plainText)) {
editors.add(EDITORS[i]);
}
}
I_CmsEditor result = null;
if (editors.size() == 1) {
result = editors.get(0);
} else if (editors.size() > 1) {
Collections.sort(editors, new Comparator<I_CmsEditor>() {
public int compare(I_CmsEditor o1, I_CmsEditor o2) {
return o1.getPriority() > o2.getPriority() ? -1 : 1;
}
});
result = editors.get(0);
}
return result;
} } | public class class_name {
public I_CmsEditor getEditorForType(I_CmsResourceType type, boolean plainText) {
List<I_CmsEditor> editors = new ArrayList<I_CmsEditor>();
for (int i = 0; i < EDITORS.length; i++) {
if (EDITORS[i].matchesType(type, plainText)) {
editors.add(EDITORS[i]); // depends on control dependency: [if], data = [none]
}
}
I_CmsEditor result = null;
if (editors.size() == 1) {
result = editors.get(0); // depends on control dependency: [if], data = [none]
} else if (editors.size() > 1) {
Collections.sort(editors, new Comparator<I_CmsEditor>() {
public int compare(I_CmsEditor o1, I_CmsEditor o2) {
return o1.getPriority() > o2.getPriority() ? -1 : 1;
}
}); // depends on control dependency: [if], data = [none]
result = editors.get(0); // depends on control dependency: [if], data = [none]
}
return result;
} } |
public class class_name {
public static <T> List<T> createServiceObjects(String... pDescriptorPaths) {
try {
ServiceEntry.initDefaultOrder();
TreeMap<ServiceEntry,T> extractorMap = new TreeMap<ServiceEntry,T>();
for (String descriptor : pDescriptorPaths) {
readServiceDefinitions(extractorMap, descriptor);
}
ArrayList<T> ret = new ArrayList<T>();
for (T service : extractorMap.values()) {
ret.add(service);
}
return ret;
} finally {
ServiceEntry.removeDefaultOrder();
}
} } | public class class_name {
public static <T> List<T> createServiceObjects(String... pDescriptorPaths) {
try {
ServiceEntry.initDefaultOrder(); // depends on control dependency: [try], data = [none]
TreeMap<ServiceEntry,T> extractorMap = new TreeMap<ServiceEntry,T>();
for (String descriptor : pDescriptorPaths) {
readServiceDefinitions(extractorMap, descriptor); // depends on control dependency: [for], data = [descriptor]
}
ArrayList<T> ret = new ArrayList<T>();
for (T service : extractorMap.values()) {
ret.add(service); // depends on control dependency: [for], data = [service]
}
return ret; // depends on control dependency: [try], data = [none]
} finally {
ServiceEntry.removeDefaultOrder();
}
} } |
public class class_name {
public static long longForQuery(SQLiteDatabase db, String query, String[] selectionArgs) {
SQLiteStatement prog = db.compileStatement(query);
try {
return longForQuery(prog, selectionArgs);
} finally {
prog.close();
}
} } | public class class_name {
public static long longForQuery(SQLiteDatabase db, String query, String[] selectionArgs) {
SQLiteStatement prog = db.compileStatement(query);
try {
return longForQuery(prog, selectionArgs); // depends on control dependency: [try], data = [none]
} finally {
prog.close();
}
} } |
public class class_name {
public void getImageAttributes(Map<String, String> attributes, I_CmsSimpleCallback<Map<String, String>> callback) {
if (getGalleryMode() == GalleryMode.editor) {
m_imageEditorFormatsTab.getImageAttributes(attributes);
m_imageAdvancedTab.getImageAttributes(attributes, callback);
} else {
callback.execute(attributes);
}
} } | public class class_name {
public void getImageAttributes(Map<String, String> attributes, I_CmsSimpleCallback<Map<String, String>> callback) {
if (getGalleryMode() == GalleryMode.editor) {
m_imageEditorFormatsTab.getImageAttributes(attributes); // depends on control dependency: [if], data = [none]
m_imageAdvancedTab.getImageAttributes(attributes, callback); // depends on control dependency: [if], data = [none]
} else {
callback.execute(attributes); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Override
public String ingest(DataHandler objectXML, String format, String logMessage) {
LOG.debug("start: ingest");
assertInitialized();
try {
// always gens pid, unless pid in stream starts with "test:" "demo:"
// or other prefix that is configured in the retainPIDs parameter of
// fedora.fcfg
MessageContext ctx = context.getMessageContext();
InputStream byteStream = null;
if (objectXML != null) {
byteStream = objectXML.getInputStream();
}
return m_management.ingest(ReadOnlyContext.getSoapContext(ctx),
byteStream,
logMessage,
format,
"UTF-8",
"new");
} catch (Throwable th) {
LOG.error("Error ingesting", th);
throw CXFUtility.getFault(th);
} finally {
LOG.debug("end: ingest");
}
} } | public class class_name {
@Override
public String ingest(DataHandler objectXML, String format, String logMessage) {
LOG.debug("start: ingest");
assertInitialized();
try {
// always gens pid, unless pid in stream starts with "test:" "demo:"
// or other prefix that is configured in the retainPIDs parameter of
// fedora.fcfg
MessageContext ctx = context.getMessageContext();
InputStream byteStream = null;
if (objectXML != null) {
byteStream = objectXML.getInputStream(); // depends on control dependency: [if], data = [none]
}
return m_management.ingest(ReadOnlyContext.getSoapContext(ctx),
byteStream,
logMessage,
format,
"UTF-8",
"new"); // depends on control dependency: [try], data = [none]
} catch (Throwable th) {
LOG.error("Error ingesting", th);
throw CXFUtility.getFault(th);
} finally { // depends on control dependency: [catch], data = [none]
LOG.debug("end: ingest");
}
} } |
public class class_name {
public void marshall(DeleteKnownHostKeysRequest deleteKnownHostKeysRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteKnownHostKeysRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteKnownHostKeysRequest.getInstanceName(), INSTANCENAME_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(DeleteKnownHostKeysRequest deleteKnownHostKeysRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteKnownHostKeysRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteKnownHostKeysRequest.getInstanceName(), INSTANCENAME_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 Queue<QueueElem> getInstanceSplitList(final AbstractInstance instance) {
Queue<QueueElem> instanceSplitList = this.instanceMap.get(instance);
if (instanceSplitList == null) {
// Create and populate instance specific split list
instanceSplitList = new PriorityQueue<LocatableInputSplitList.QueueElem>();
final Iterator<LocatableInputSplit> it = this.masterSet.iterator();
while (it.hasNext()) {
final LocatableInputSplit split = it.next();
final String[] hostnames = split.getHostnames();
if (hostnames == null) {
instanceSplitList.add(new QueueElem(split, Integer.MAX_VALUE));
} else {
int minDistance = Integer.MAX_VALUE;
for (int i = 0; i < hostnames.length; ++i) {
final int distance = instance.getDistance(hostnames[i]);
if (LOG.isDebugEnabled()) {
LOG.debug("Distance between " + instance + " and " + hostnames[i] + " is " + distance);
}
if (distance < minDistance) {
minDistance = distance;
}
}
instanceSplitList.add(new QueueElem(split, minDistance));
}
}
this.instanceMap.put(instance, instanceSplitList);
}
return instanceSplitList;
} } | public class class_name {
private Queue<QueueElem> getInstanceSplitList(final AbstractInstance instance) {
Queue<QueueElem> instanceSplitList = this.instanceMap.get(instance);
if (instanceSplitList == null) {
// Create and populate instance specific split list
instanceSplitList = new PriorityQueue<LocatableInputSplitList.QueueElem>(); // depends on control dependency: [if], data = [none]
final Iterator<LocatableInputSplit> it = this.masterSet.iterator();
while (it.hasNext()) {
final LocatableInputSplit split = it.next();
final String[] hostnames = split.getHostnames();
if (hostnames == null) {
instanceSplitList.add(new QueueElem(split, Integer.MAX_VALUE)); // depends on control dependency: [if], data = [none]
} else {
int minDistance = Integer.MAX_VALUE;
for (int i = 0; i < hostnames.length; ++i) {
final int distance = instance.getDistance(hostnames[i]);
if (LOG.isDebugEnabled()) {
LOG.debug("Distance between " + instance + " and " + hostnames[i] + " is " + distance); // depends on control dependency: [if], data = [none]
}
if (distance < minDistance) {
minDistance = distance; // depends on control dependency: [if], data = [none]
}
}
instanceSplitList.add(new QueueElem(split, minDistance)); // depends on control dependency: [if], data = [none]
}
}
this.instanceMap.put(instance, instanceSplitList); // depends on control dependency: [if], data = [none]
}
return instanceSplitList;
} } |
public class class_name {
public static void main(final String[] args) throws IOException, InterruptedException {
final NamedEntityAnalyser nea = new NamedEntityAnalyser(new Configuration());
if (args.length >= 1) {
final String content = new String(Files.readAllBytes(Paths.get(args[0])));
System.out.println(nea.process(content));
}
else {
try (final Scanner in = new Scanner(System.in)) {
while (true) {
System.out.println("Type in texts, -q for quit.");
System.out.print("> ");
final String processString = in.nextLine();
if ("-q".equalsIgnoreCase(processString)) break;
System.out.println(nea.process(processString).getMappedResult());
}
}
}
} } | public class class_name {
public static void main(final String[] args) throws IOException, InterruptedException {
final NamedEntityAnalyser nea = new NamedEntityAnalyser(new Configuration());
if (args.length >= 1) {
final String content = new String(Files.readAllBytes(Paths.get(args[0])));
System.out.println(nea.process(content));
}
else {
try (final Scanner in = new Scanner(System.in)) {
while (true) {
System.out.println("Type in texts, -q for quit."); // depends on control dependency: [while], data = [none]
System.out.print("> "); // depends on control dependency: [while], data = [none]
final String processString = in.nextLine();
if ("-q".equalsIgnoreCase(processString)) break;
System.out.println(nea.process(processString).getMappedResult()); // depends on control dependency: [while], data = [none]
}
}
}
} } |
public class class_name {
protected String lookupServerURL(DataBinder binder) {
_logger.info("STANDARD lookupServerURL: servers=" + _servers + ", selector='" + _selector + '\'');
if (_servers != null) {
if (_selector != null) {
return _servers.get(binder.get(_selector));
} else if (_servers.size() == 1) {
return _servers.values().iterator().next();
} else {
return null;
}
} else {
return null;
}
} } | public class class_name {
protected String lookupServerURL(DataBinder binder) {
_logger.info("STANDARD lookupServerURL: servers=" + _servers + ", selector='" + _selector + '\'');
if (_servers != null) {
if (_selector != null) {
return _servers.get(binder.get(_selector)); // depends on control dependency: [if], data = [(_selector]
} else if (_servers.size() == 1) {
return _servers.values().iterator().next(); // depends on control dependency: [if], data = [none]
} else {
return null; // depends on control dependency: [if], data = [none]
}
} else {
return null; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
@Override
public CommercePriceEntry fetchByPrimaryKey(Serializable primaryKey) {
Serializable serializable = entityCache.getResult(CommercePriceEntryModelImpl.ENTITY_CACHE_ENABLED,
CommercePriceEntryImpl.class, primaryKey);
if (serializable == nullModel) {
return null;
}
CommercePriceEntry commercePriceEntry = (CommercePriceEntry)serializable;
if (commercePriceEntry == null) {
Session session = null;
try {
session = openSession();
commercePriceEntry = (CommercePriceEntry)session.get(CommercePriceEntryImpl.class,
primaryKey);
if (commercePriceEntry != null) {
cacheResult(commercePriceEntry);
}
else {
entityCache.putResult(CommercePriceEntryModelImpl.ENTITY_CACHE_ENABLED,
CommercePriceEntryImpl.class, primaryKey, nullModel);
}
}
catch (Exception e) {
entityCache.removeResult(CommercePriceEntryModelImpl.ENTITY_CACHE_ENABLED,
CommercePriceEntryImpl.class, primaryKey);
throw processException(e);
}
finally {
closeSession(session);
}
}
return commercePriceEntry;
} } | public class class_name {
@Override
public CommercePriceEntry fetchByPrimaryKey(Serializable primaryKey) {
Serializable serializable = entityCache.getResult(CommercePriceEntryModelImpl.ENTITY_CACHE_ENABLED,
CommercePriceEntryImpl.class, primaryKey);
if (serializable == nullModel) {
return null; // depends on control dependency: [if], data = [none]
}
CommercePriceEntry commercePriceEntry = (CommercePriceEntry)serializable;
if (commercePriceEntry == null) {
Session session = null;
try {
session = openSession(); // depends on control dependency: [try], data = [none]
commercePriceEntry = (CommercePriceEntry)session.get(CommercePriceEntryImpl.class,
primaryKey); // depends on control dependency: [try], data = [none]
if (commercePriceEntry != null) {
cacheResult(commercePriceEntry); // depends on control dependency: [if], data = [(commercePriceEntry]
}
else {
entityCache.putResult(CommercePriceEntryModelImpl.ENTITY_CACHE_ENABLED,
CommercePriceEntryImpl.class, primaryKey, nullModel); // depends on control dependency: [if], data = [none]
}
}
catch (Exception e) {
entityCache.removeResult(CommercePriceEntryModelImpl.ENTITY_CACHE_ENABLED,
CommercePriceEntryImpl.class, primaryKey);
throw processException(e);
} // depends on control dependency: [catch], data = [none]
finally {
closeSession(session);
}
}
return commercePriceEntry;
} } |
public class class_name {
public Object put(String key, Boolean value) {
if (value == null) {
stateMap.put(key, Type.NULL);
} else {
stateMap.put(key, Type.BOOLEAN);
}
return super.put(key, value);
} } | public class class_name {
public Object put(String key, Boolean value) {
if (value == null) {
stateMap.put(key, Type.NULL); // depends on control dependency: [if], data = [none]
} else {
stateMap.put(key, Type.BOOLEAN); // depends on control dependency: [if], data = [none]
}
return super.put(key, value);
} } |
public class class_name {
private static String normalize( String pathName )
{
// replaces multiple '/' by one unique '/'
pathName = pathName.replaceAll( "/+", "/" );
// removes a '/' if it finishes a path and is not root
pathName = pathName.replaceAll( "(.+)/$", "$1" );
if ( !pathName.startsWith( "/" ) ) {
pathName = "/" + pathName;
}
return pathName;
} } | public class class_name {
private static String normalize( String pathName )
{
// replaces multiple '/' by one unique '/'
pathName = pathName.replaceAll( "/+", "/" );
// removes a '/' if it finishes a path and is not root
pathName = pathName.replaceAll( "(.+)/$", "$1" );
if ( !pathName.startsWith( "/" ) ) {
pathName = "/" + pathName; // depends on control dependency: [if], data = [none]
}
return pathName;
} } |
public class class_name {
private ImageIcon createIcon(String resourcePath) {
if (getView() == null) {
return null;
}
return new ImageIcon(ExtensionScript.class.getResource(resourcePath));
} } | public class class_name {
private ImageIcon createIcon(String resourcePath) {
if (getView() == null) {
return null;
// depends on control dependency: [if], data = [none]
}
return new ImageIcon(ExtensionScript.class.getResource(resourcePath));
} } |
public class class_name {
public java.util.List<Timezone> getSupportedTimezones() {
if (supportedTimezones == null) {
supportedTimezones = new com.amazonaws.internal.SdkInternalList<Timezone>();
}
return supportedTimezones;
} } | public class class_name {
public java.util.List<Timezone> getSupportedTimezones() {
if (supportedTimezones == null) {
supportedTimezones = new com.amazonaws.internal.SdkInternalList<Timezone>(); // depends on control dependency: [if], data = [none]
}
return supportedTimezones;
} } |
public class class_name {
public static boolean hasExtension(String extension) {
if (extension == null || extension.length() == 0) {
return false;
}
return extensionToMimeTypeMap.containsKey(extension);
} } | public class class_name {
public static boolean hasExtension(String extension) {
if (extension == null || extension.length() == 0) {
return false; // depends on control dependency: [if], data = [none]
}
return extensionToMimeTypeMap.containsKey(extension);
} } |
public class class_name {
@Override
public void setSelected(ButtonModel m, boolean selected) {
if (!selected && m == getSelection()) {
clearSelection();
} else {
super.setSelected(m, selected);
}
} } | public class class_name {
@Override
public void setSelected(ButtonModel m, boolean selected) {
if (!selected && m == getSelection()) {
clearSelection(); // depends on control dependency: [if], data = [none]
} else {
super.setSelected(m, selected); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public Permission withAccess(String... access) {
if (this.access == null) {
setAccess(new com.amazonaws.internal.SdkInternalList<String>(access.length));
}
for (String ele : access) {
this.access.add(ele);
}
return this;
} } | public class class_name {
public Permission withAccess(String... access) {
if (this.access == null) {
setAccess(new com.amazonaws.internal.SdkInternalList<String>(access.length)); // depends on control dependency: [if], data = [none]
}
for (String ele : access) {
this.access.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} } |
public class class_name {
public static String getCanonicalName(final Class<?> cls, final String valueIfNull) {
if (cls == null) {
return valueIfNull;
}
final String canonicalName = cls.getCanonicalName();
return canonicalName == null ? valueIfNull : canonicalName;
} } | public class class_name {
public static String getCanonicalName(final Class<?> cls, final String valueIfNull) {
if (cls == null) {
return valueIfNull; // depends on control dependency: [if], data = [none]
}
final String canonicalName = cls.getCanonicalName();
return canonicalName == null ? valueIfNull : canonicalName;
} } |
public class class_name {
public MatrixFile calculate(Matrix input) {
try {
File affMatrixFile = File.createTempFile("affinty-matrix",".dat");
PrintWriter affMatrixWriter = new PrintWriter(affMatrixFile);
int rows = input.rows();
// Iterate through each row, i, in the data matrix and compare row i
// to each proceeding row, j. If the similarity is above the edge
// similarity threshold, emit an edge between row i and row j and
// between row j and row i, assuming that the edge similarity metric
// is symmetric. Each edge is written in the Matlab Sparse matrix
// format.
for (int i = 0; i < rows; ++i) {
LOG.fine("computing affinity for row " + i);
DoubleVector row1 = input.getRowVector(i);
for (int j = i+1; j < rows; ++j) {
DoubleVector row2 = input.getRowVector(j);
double dataSimilarity = edgeSim.sim(row1, row2);
// If the edge similarity is above the threshold, compute
// the kernel similarity for each new edge.
if (dataSimilarity > edgeSimThreshold) {
double edgeWeight = kernelSim.sim(row1, row2);
affMatrixWriter.printf("%d %d %f\n",i+1,j+1,edgeWeight);
// If the kernel metric is symmetric, just reuse the
// previously calculated edge weight. Otherwise
// recalculate it.
edgeWeight = (kernelSim.isSymmetric())
? edgeWeight
: kernelSim.sim(row2, row1);
affMatrixWriter.printf("%d %d %f\n",j+1,i+1,edgeWeight);
}
}
}
affMatrixWriter.close();
return new MatrixFile(affMatrixFile, MatrixIO.Format.MATLAB_SPARSE);
} catch (IOException ioe) {
throw new IOError(ioe);
}
} } | public class class_name {
public MatrixFile calculate(Matrix input) {
try {
File affMatrixFile = File.createTempFile("affinty-matrix",".dat");
PrintWriter affMatrixWriter = new PrintWriter(affMatrixFile);
int rows = input.rows();
// Iterate through each row, i, in the data matrix and compare row i
// to each proceeding row, j. If the similarity is above the edge
// similarity threshold, emit an edge between row i and row j and
// between row j and row i, assuming that the edge similarity metric
// is symmetric. Each edge is written in the Matlab Sparse matrix
// format.
for (int i = 0; i < rows; ++i) {
LOG.fine("computing affinity for row " + i); // depends on control dependency: [for], data = [i]
DoubleVector row1 = input.getRowVector(i);
for (int j = i+1; j < rows; ++j) {
DoubleVector row2 = input.getRowVector(j);
double dataSimilarity = edgeSim.sim(row1, row2);
// If the edge similarity is above the threshold, compute
// the kernel similarity for each new edge.
if (dataSimilarity > edgeSimThreshold) {
double edgeWeight = kernelSim.sim(row1, row2);
affMatrixWriter.printf("%d %d %f\n",i+1,j+1,edgeWeight); // depends on control dependency: [if], data = [none]
// If the kernel metric is symmetric, just reuse the
// previously calculated edge weight. Otherwise
// recalculate it.
edgeWeight = (kernelSim.isSymmetric())
? edgeWeight
: kernelSim.sim(row2, row1); // depends on control dependency: [if], data = [none]
affMatrixWriter.printf("%d %d %f\n",j+1,i+1,edgeWeight); // depends on control dependency: [if], data = [none]
}
}
}
affMatrixWriter.close(); // depends on control dependency: [try], data = [none]
return new MatrixFile(affMatrixFile, MatrixIO.Format.MATLAB_SPARSE); // depends on control dependency: [try], data = [none]
} catch (IOException ioe) {
throw new IOError(ioe);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
private Optional tryCreate(Constructor<?> constructor) {
Object[] args = new Object[constructor.getParameterCount()];
Object arg;
Optional<Object> resolved;
int i = 0;
for (Parameter parameter : constructor.getParameters()) {
resolved = context.resolve(parameter);
if (!resolved.isPresent()) {
return Optional.empty();
}
arg = resolved.value();
args[i++] = arg;
}
return Optional.of(createFunction.apply(constructor, args));
} } | public class class_name {
private Optional tryCreate(Constructor<?> constructor) {
Object[] args = new Object[constructor.getParameterCount()];
Object arg;
Optional<Object> resolved;
int i = 0;
for (Parameter parameter : constructor.getParameters()) {
resolved = context.resolve(parameter); // depends on control dependency: [for], data = [parameter]
if (!resolved.isPresent()) {
return Optional.empty(); // depends on control dependency: [if], data = [none]
}
arg = resolved.value(); // depends on control dependency: [for], data = [none]
args[i++] = arg; // depends on control dependency: [for], data = [none]
}
return Optional.of(createFunction.apply(constructor, args));
} } |
public class class_name {
public static Pointcut createPointcut(PointcutRule pointcutRule) {
if (pointcutRule.getPointcutType() == PointcutType.REGEXP) {
return createRegexpPointcut(pointcutRule.getPointcutPatternRuleList());
} else {
return createWildcardPointcut(pointcutRule.getPointcutPatternRuleList());
}
} } | public class class_name {
public static Pointcut createPointcut(PointcutRule pointcutRule) {
if (pointcutRule.getPointcutType() == PointcutType.REGEXP) {
return createRegexpPointcut(pointcutRule.getPointcutPatternRuleList()); // depends on control dependency: [if], data = [none]
} else {
return createWildcardPointcut(pointcutRule.getPointcutPatternRuleList()); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public static String calculateHash(MessageDigest d, byte[] bytes)
{
if (bytes == null)
{
return null;
}
d.update(bytes);
return ByteUtilities.encode(d.digest());
} } | public class class_name {
public static String calculateHash(MessageDigest d, byte[] bytes)
{
if (bytes == null)
{
return null; // depends on control dependency: [if], data = [none]
}
d.update(bytes);
return ByteUtilities.encode(d.digest());
} } |
public class class_name {
public void setNS(java.util.Collection<String> nS) {
if (nS == null) {
this.nS = null;
return;
}
java.util.List<String> nSCopy = new java.util.ArrayList<String>(nS.size());
nSCopy.addAll(nS);
this.nS = nSCopy;
} } | public class class_name {
public void setNS(java.util.Collection<String> nS) {
if (nS == null) {
this.nS = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
java.util.List<String> nSCopy = new java.util.ArrayList<String>(nS.size());
nSCopy.addAll(nS);
this.nS = nSCopy;
} } |
public class class_name {
public static void chunkedCopy(InputStream src, File dest) throws IOException
{
final byte[] buf = new byte[8 << 20]; // 8Mb buffer
long offset = 0;
long lastOffset = 0;
try (final RandomAccessFile raf = new RandomAccessFile(dest, "rw")) {
final int fd = getfd(raf.getFD());
for (int numBytes = 0, bytesRead = 0, lastBytes = 0; bytesRead > -1;) {
bytesRead = src.read(buf, numBytes, buf.length - numBytes);
if (numBytes >= buf.length || bytesRead == -1) {
raf.write(buf, 0, numBytes);
// This won't block, but will start writeout asynchronously
trySyncFileRange(fd, offset, numBytes, SYNC_FILE_RANGE_WRITE);
if (offset > 0) {
// This does a blocking write-and-wait on any old ranges
trySyncFileRange(fd, lastOffset, lastBytes,
SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_AFTER);
// Remove the old range from the cache
trySkipCache(fd, lastOffset, lastBytes);
}
lastOffset = offset;
offset = raf.getFilePointer();
numBytes = 0;
}
lastBytes = numBytes;
numBytes += bytesRead;
}
}
} } | public class class_name {
public static void chunkedCopy(InputStream src, File dest) throws IOException
{
final byte[] buf = new byte[8 << 20]; // 8Mb buffer
long offset = 0;
long lastOffset = 0;
try (final RandomAccessFile raf = new RandomAccessFile(dest, "rw")) {
final int fd = getfd(raf.getFD());
for (int numBytes = 0, bytesRead = 0, lastBytes = 0; bytesRead > -1;) {
bytesRead = src.read(buf, numBytes, buf.length - numBytes);
if (numBytes >= buf.length || bytesRead == -1) {
raf.write(buf, 0, numBytes); // depends on control dependency: [if], data = [none]
// This won't block, but will start writeout asynchronously
trySyncFileRange(fd, offset, numBytes, SYNC_FILE_RANGE_WRITE); // depends on control dependency: [if], data = [none]
if (offset > 0) {
// This does a blocking write-and-wait on any old ranges
trySyncFileRange(fd, lastOffset, lastBytes,
SYNC_FILE_RANGE_WAIT_BEFORE | SYNC_FILE_RANGE_WRITE | SYNC_FILE_RANGE_WAIT_AFTER); // depends on control dependency: [if], data = [none]
// Remove the old range from the cache
trySkipCache(fd, lastOffset, lastBytes); // depends on control dependency: [if], data = [none]
}
lastOffset = offset; // depends on control dependency: [if], data = [none]
offset = raf.getFilePointer(); // depends on control dependency: [if], data = [none]
numBytes = 0; // depends on control dependency: [if], data = [none]
}
lastBytes = numBytes;
numBytes += bytesRead;
}
}
} } |
public class class_name {
public static mil.nga.geopackage.map.geom.MultiPolygon addPolygonsToMap(
GoogleMap map, MultiPolygonOptions polygons) {
mil.nga.geopackage.map.geom.MultiPolygon multiPolygon = new mil.nga.geopackage.map.geom.MultiPolygon();
for (PolygonOptions polygonOption : polygons.getPolygonOptions()) {
if (polygons.getOptions() != null) {
polygonOption.fillColor(polygons.getOptions().getFillColor());
polygonOption.strokeColor(polygons.getOptions()
.getStrokeColor());
polygonOption.geodesic(polygons.getOptions().isGeodesic());
polygonOption.visible(polygons.getOptions().isVisible());
polygonOption.zIndex(polygons.getOptions().getZIndex());
polygonOption.strokeWidth(polygons.getOptions().getStrokeWidth());
}
com.google.android.gms.maps.model.Polygon polygon = addPolygonToMap(
map, polygonOption);
multiPolygon.add(polygon);
}
return multiPolygon;
} } | public class class_name {
public static mil.nga.geopackage.map.geom.MultiPolygon addPolygonsToMap(
GoogleMap map, MultiPolygonOptions polygons) {
mil.nga.geopackage.map.geom.MultiPolygon multiPolygon = new mil.nga.geopackage.map.geom.MultiPolygon();
for (PolygonOptions polygonOption : polygons.getPolygonOptions()) {
if (polygons.getOptions() != null) {
polygonOption.fillColor(polygons.getOptions().getFillColor()); // depends on control dependency: [if], data = [(polygons.getOptions()]
polygonOption.strokeColor(polygons.getOptions()
.getStrokeColor()); // depends on control dependency: [if], data = [none]
polygonOption.geodesic(polygons.getOptions().isGeodesic()); // depends on control dependency: [if], data = [(polygons.getOptions()]
polygonOption.visible(polygons.getOptions().isVisible()); // depends on control dependency: [if], data = [(polygons.getOptions()]
polygonOption.zIndex(polygons.getOptions().getZIndex()); // depends on control dependency: [if], data = [(polygons.getOptions()]
polygonOption.strokeWidth(polygons.getOptions().getStrokeWidth()); // depends on control dependency: [if], data = [(polygons.getOptions()]
}
com.google.android.gms.maps.model.Polygon polygon = addPolygonToMap(
map, polygonOption);
multiPolygon.add(polygon); // depends on control dependency: [for], data = [none]
}
return multiPolygon;
} } |
public class class_name {
private static void quickSort1(int off, int len, IntComparator comp, Swapper swapper) {
// Insertion sort on smallest arrays
if (len < SMALL) {
for (int i=off; i<len+off; i++)
for (int j=i; j>off && (comp.compare(j-1,j)>0); j--) {
swapper.swap(j, j-1);
}
return;
}
// Choose a partition element, v
int m = off + len/2; // Small arrays, middle element
if (len > SMALL) {
int l = off;
int n = off + len - 1;
if (len > MEDIUM) { // Big arrays, pseudomedian of 9
int s = len/8;
l = med3(l, l+s, l+2*s, comp);
m = med3(m-s, m, m+s, comp);
n = med3(n-2*s, n-s, n, comp);
}
m = med3(l, m, n, comp); // Mid-size, med of 3
}
//long v = x[m];
// Establish Invariant: v* (<v)* (>v)* v*
int a = off, b = a, c = off + len - 1, d = c;
while(true) {
int comparison;
while (b <= c && ((comparison=comp.compare(b,m))<=0)) {
if (comparison == 0) {
if (a==m) m = b; // moving target; DELTA to JDK !!!
else if (b==m) m = a; // moving target; DELTA to JDK !!!
swapper.swap(a++, b);
}
b++;
}
while (c >= b && ((comparison=comp.compare(c,m))>=0)) {
if (comparison == 0) {
if (c==m) m = d; // moving target; DELTA to JDK !!!
else if (d==m) m = c; // moving target; DELTA to JDK !!!
swapper.swap(c, d--);
}
c--;
}
if (b > c) break;
if (b==m) m = d; // moving target; DELTA to JDK !!!
else if (c==m) m = c; // moving target; DELTA to JDK !!!
swapper.swap(b++, c--);
}
// Swap partition elements back to middle
int s, n = off + len;
s = java.lang.Math.min(a-off, b-a ); vecswap(swapper, off, b-s, s);
s = java.lang.Math.min(d-c, n-d-1); vecswap(swapper, b, n-s, s);
// Recursively sort non-partition-elements
if ((s = b-a) > 1)
quickSort1(off, s, comp, swapper);
if ((s = d-c) > 1)
quickSort1(n-s, s, comp, swapper);
} } | public class class_name {
private static void quickSort1(int off, int len, IntComparator comp, Swapper swapper) {
// Insertion sort on smallest arrays
if (len < SMALL) {
for (int i=off; i<len+off; i++)
for (int j=i; j>off && (comp.compare(j-1,j)>0); j--) {
swapper.swap(j, j-1);
// depends on control dependency: [for], data = [j]
}
return;
// depends on control dependency: [if], data = [none]
}
// Choose a partition element, v
int m = off + len/2; // Small arrays, middle element
if (len > SMALL) {
int l = off;
int n = off + len - 1;
if (len > MEDIUM) { // Big arrays, pseudomedian of 9
int s = len/8;
l = med3(l, l+s, l+2*s, comp);
// depends on control dependency: [if], data = [none]
m = med3(m-s, m, m+s, comp);
// depends on control dependency: [if], data = [none]
n = med3(n-2*s, n-s, n, comp);
// depends on control dependency: [if], data = [none]
}
m = med3(l, m, n, comp); // Mid-size, med of 3
// depends on control dependency: [if], data = [none]
}
//long v = x[m];
// Establish Invariant: v* (<v)* (>v)* v*
int a = off, b = a, c = off + len - 1, d = c;
while(true) {
int comparison;
while (b <= c && ((comparison=comp.compare(b,m))<=0)) {
if (comparison == 0) {
if (a==m) m = b; // moving target; DELTA to JDK !!!
else if (b==m) m = a; // moving target; DELTA to JDK !!!
swapper.swap(a++, b);
// depends on control dependency: [if], data = [none]
}
b++;
// depends on control dependency: [while], data = [none]
}
while (c >= b && ((comparison=comp.compare(c,m))>=0)) {
if (comparison == 0) {
if (c==m) m = d; // moving target; DELTA to JDK !!!
else if (d==m) m = c; // moving target; DELTA to JDK !!!
swapper.swap(c, d--);
// depends on control dependency: [if], data = [none]
}
c--;
// depends on control dependency: [while], data = [none]
}
if (b > c) break;
if (b==m) m = d; // moving target; DELTA to JDK !!!
else if (c==m) m = c; // moving target; DELTA to JDK !!!
swapper.swap(b++, c--);
// depends on control dependency: [while], data = [none]
}
// Swap partition elements back to middle
int s, n = off + len;
s = java.lang.Math.min(a-off, b-a ); vecswap(swapper, off, b-s, s);
s = java.lang.Math.min(d-c, n-d-1); vecswap(swapper, b, n-s, s);
// Recursively sort non-partition-elements
if ((s = b-a) > 1)
quickSort1(off, s, comp, swapper);
if ((s = d-c) > 1)
quickSort1(n-s, s, comp, swapper);
} } |
public class class_name {
public static InputStream decompress(final InputStream in, final String fileName) throws IOException
{
if (fileName.endsWith(GZ_SUFFIX)) {
return gzipInputStream(in);
} else if (fileName.endsWith(BZ2_SUFFIX)) {
return new BZip2CompressorInputStream(in, true);
} else if (fileName.endsWith(XZ_SUFFIX)) {
return new XZCompressorInputStream(in, true);
} else if (fileName.endsWith(SNAPPY_SUFFIX)) {
return new FramedSnappyCompressorInputStream(in);
} else if (fileName.endsWith(ZSTD_SUFFIX)) {
return new ZstdCompressorInputStream(in);
} else if (fileName.endsWith(ZIP_SUFFIX)) {
// This reads the first file in the archive.
final ZipInputStream zipIn = new ZipInputStream(in, StandardCharsets.UTF_8);
try {
final ZipEntry nextEntry = zipIn.getNextEntry();
if (nextEntry == null) {
zipIn.close();
// No files in the archive - return an empty stream.
return new ByteArrayInputStream(new byte[0]);
}
return zipIn;
}
catch (IOException e) {
try {
zipIn.close();
}
catch (IOException e2) {
e.addSuppressed(e2);
}
throw e;
}
} else {
return in;
}
} } | public class class_name {
public static InputStream decompress(final InputStream in, final String fileName) throws IOException
{
if (fileName.endsWith(GZ_SUFFIX)) {
return gzipInputStream(in);
} else if (fileName.endsWith(BZ2_SUFFIX)) {
return new BZip2CompressorInputStream(in, true);
} else if (fileName.endsWith(XZ_SUFFIX)) {
return new XZCompressorInputStream(in, true);
} else if (fileName.endsWith(SNAPPY_SUFFIX)) {
return new FramedSnappyCompressorInputStream(in);
} else if (fileName.endsWith(ZSTD_SUFFIX)) {
return new ZstdCompressorInputStream(in);
} else if (fileName.endsWith(ZIP_SUFFIX)) {
// This reads the first file in the archive.
final ZipInputStream zipIn = new ZipInputStream(in, StandardCharsets.UTF_8);
try {
final ZipEntry nextEntry = zipIn.getNextEntry();
if (nextEntry == null) {
zipIn.close(); // depends on control dependency: [if], data = [none]
// No files in the archive - return an empty stream.
return new ByteArrayInputStream(new byte[0]); // depends on control dependency: [if], data = [none]
}
return zipIn; // depends on control dependency: [try], data = [none]
}
catch (IOException e) {
try {
zipIn.close(); // depends on control dependency: [try], data = [none]
}
catch (IOException e2) {
e.addSuppressed(e2);
} // depends on control dependency: [catch], data = [none]
throw e;
} // depends on control dependency: [catch], data = [none]
} else {
return in;
}
} } |
public class class_name {
@Override
public void destroy() {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "destroy : " + this);
if (state == DESTROYED) {
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "destroy : already destroyed");
return;
}
setState(DESTROYED);
InterceptorMetaData imd = home.beanMetaData.ivInterceptorMetaData;
InterceptorProxy[] proxies = (imd == null) ? null : imd.ivPreDestroyInterceptors;
if (proxies == null) {
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "destroy : no PreDestroy");
return;
}
BeanMetaData bmd = home.beanMetaData;
CallbackContextHelper contextHelper = new CallbackContextHelper(this);
try {
contextHelper.begin(CallbackContextHelper.Tx.LTC,
CallbackContextHelper.Contexts.CallbackBean);
// Invoke the PreDestroy interceptor methods.
if (bmd.managedObjectManagesInjectionAndInterceptors) {
ivManagedObject.release();
} else {
InvocationContextImpl<?> inv = getInvocationContext();
inv.doLifeCycle(proxies, bmd._moduleMetaData);
}
} catch (Exception ex) {
FFDCFilter.processException(ex, CLASS_NAME + ".destroy", "262", this);
// Just trace this event and continue so that BeanO is transitioned
// to the DESTROYED state. No other lifecycle callbacks on this bean
// instance will occur once in the DESTROYED state, which is the same
// affect as if bean was discarded as result of this exception.
if (isTraceOn && tc.isEventEnabled()) // d144064
Tr.event(tc, "destroy caught exception:", new Object[] { this, ex });
} finally {
try {
contextHelper.complete(true);
} catch (Throwable t) {
FFDCFilter.processException(t, CLASS_NAME + ".destroy", "279", this);
// Just trace this event and continue so that BeanO is transitioned
// to the DESTROYED state. No other lifecycle callbacks on this bean
// instance will occur once in the DESTROYED state, which is the same
// affect as if bean was discarded as result of this exception.
if (isTraceOn && tc.isEventEnabled())
Tr.event(tc, "destroy caught exception: ", new Object[] { this, t });
}
releaseManagedObjectContext();
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "destroy : completed PreDestroy");
}
} } | public class class_name {
@Override
public void destroy() {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "destroy : " + this);
if (state == DESTROYED) {
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "destroy : already destroyed");
return; // depends on control dependency: [if], data = [none]
}
setState(DESTROYED);
InterceptorMetaData imd = home.beanMetaData.ivInterceptorMetaData;
InterceptorProxy[] proxies = (imd == null) ? null : imd.ivPreDestroyInterceptors;
if (proxies == null) {
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "destroy : no PreDestroy");
return; // depends on control dependency: [if], data = [none]
}
BeanMetaData bmd = home.beanMetaData;
CallbackContextHelper contextHelper = new CallbackContextHelper(this);
try {
contextHelper.begin(CallbackContextHelper.Tx.LTC,
CallbackContextHelper.Contexts.CallbackBean); // depends on control dependency: [try], data = [none]
// Invoke the PreDestroy interceptor methods.
if (bmd.managedObjectManagesInjectionAndInterceptors) {
ivManagedObject.release(); // depends on control dependency: [if], data = [none]
} else {
InvocationContextImpl<?> inv = getInvocationContext();
inv.doLifeCycle(proxies, bmd._moduleMetaData); // depends on control dependency: [if], data = [none]
}
} catch (Exception ex) {
FFDCFilter.processException(ex, CLASS_NAME + ".destroy", "262", this);
// Just trace this event and continue so that BeanO is transitioned
// to the DESTROYED state. No other lifecycle callbacks on this bean
// instance will occur once in the DESTROYED state, which is the same
// affect as if bean was discarded as result of this exception.
if (isTraceOn && tc.isEventEnabled()) // d144064
Tr.event(tc, "destroy caught exception:", new Object[] { this, ex });
} finally { // depends on control dependency: [catch], data = [none]
try {
contextHelper.complete(true); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
FFDCFilter.processException(t, CLASS_NAME + ".destroy", "279", this);
// Just trace this event and continue so that BeanO is transitioned
// to the DESTROYED state. No other lifecycle callbacks on this bean
// instance will occur once in the DESTROYED state, which is the same
// affect as if bean was discarded as result of this exception.
if (isTraceOn && tc.isEventEnabled())
Tr.event(tc, "destroy caught exception: ", new Object[] { this, t });
} // depends on control dependency: [catch], data = [none]
releaseManagedObjectContext();
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "destroy : completed PreDestroy");
}
} } |
public class class_name {
public ClientBuilder interceptors(HttpConnectionInterceptor... interceptors) {
for (HttpConnectionInterceptor interceptor : interceptors) {
if (interceptor instanceof HttpConnectionRequestInterceptor) {
requestInterceptors.add((HttpConnectionRequestInterceptor) interceptor);
}
if (interceptor instanceof HttpConnectionResponseInterceptor) {
responseInterceptors.add((HttpConnectionResponseInterceptor) interceptor);
}
}
return this;
} } | public class class_name {
public ClientBuilder interceptors(HttpConnectionInterceptor... interceptors) {
for (HttpConnectionInterceptor interceptor : interceptors) {
if (interceptor instanceof HttpConnectionRequestInterceptor) {
requestInterceptors.add((HttpConnectionRequestInterceptor) interceptor); // depends on control dependency: [if], data = [none]
}
if (interceptor instanceof HttpConnectionResponseInterceptor) {
responseInterceptors.add((HttpConnectionResponseInterceptor) interceptor); // depends on control dependency: [if], data = [none]
}
}
return this;
} } |
public class class_name {
protected SITransaction getActiveTransaction() {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "getActiveTransaction");
}
SITransaction activeTransaction = null;
if ((_xaResource != null) && _xaResource.isEnlisted()) {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
SibTr.debug(this, TRACE,
"Current transaction is an XA global transaction");
}
activeTransaction = _xaResource;
} else if ((_localTransaction != null)
&& (_localTransaction.getLocalSITransaction() != null)) {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
SibTr.debug(TRACE, "Current transaction is a "
+ "container-managed local transaction");
}
activeTransaction = _localTransaction.getLocalSITransaction();
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, "getActiveTransaction", activeTransaction);
}
return activeTransaction;
} } | public class class_name {
protected SITransaction getActiveTransaction() {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.entry(this, TRACE, "getActiveTransaction"); // depends on control dependency: [if], data = [none]
}
SITransaction activeTransaction = null;
if ((_xaResource != null) && _xaResource.isEnlisted()) {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
SibTr.debug(this, TRACE,
"Current transaction is an XA global transaction"); // depends on control dependency: [if], data = [none]
}
activeTransaction = _xaResource; // depends on control dependency: [if], data = [none]
} else if ((_localTransaction != null)
&& (_localTransaction.getLocalSITransaction() != null)) {
if (TraceComponent.isAnyTracingEnabled() && TRACE.isDebugEnabled()) {
SibTr.debug(TRACE, "Current transaction is a "
+ "container-managed local transaction"); // depends on control dependency: [if], data = [none]
}
activeTransaction = _localTransaction.getLocalSITransaction(); // depends on control dependency: [if], data = [none]
}
if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
SibTr.exit(this, TRACE, "getActiveTransaction", activeTransaction); // depends on control dependency: [if], data = [none]
}
return activeTransaction;
} } |
public class class_name {
@SuppressWarnings("unchecked")
public Optional<CalendarPeriod<T>> findIntersection(ChronoInterval<T> other) {
if (this.isEmpty() || other.isEmpty()) {
return Optional.empty();
}
Boundary<T> s;
Boundary<T> e;
if (other.getStart().isInfinite()) {
s = this.getStart();
} else {
T d1 = this.t1;
T d2 = other.getStart().getTemporal();
if (other.getStart().isOpen()) {
d2 = this.getTimeLine().stepForward(d2);
}
if (d2 == null) {
return Optional.empty();
}
s = ((this.getTimeLine().compare(d1, d2) < 0) ? Boundary.ofClosed(d2) : Boundary.ofClosed(d1));
}
if (other.getEnd().isInfinite()) {
e = this.getEnd();
} else {
T d1 = this.t2;
T d2 = other.getEnd().getTemporal();
if (other.getEnd().isOpen()) {
d2 = this.getTimeLine().stepBackwards(d2);
}
e = ((this.getTimeLine().compare(d1, d2) < 0) ? Boundary.ofClosed(d1) : Boundary.ofClosed(d2));
}
if (toProlepticNumber(s.getTemporal()) > toProlepticNumber(e.getTemporal())) {
return Optional.empty();
} else {
CalendarPeriod<?> intersection;
T max = this.getTimeLine().getMaximum();
if (max instanceof FixedCalendarInterval) {
FixedCalendarInterval<?> d1 = FixedCalendarInterval.class.cast(s.getTemporal());
FixedCalendarInterval<?> d2 = FixedCalendarInterval.class.cast(e.getTemporal());
FixedCalendarTimeLine<?> fixed = FixedCalendarTimeLine.class.cast(this.getTimeLine());
intersection = new FixedCalendarPeriod(d1, d2, fixed);
} else {
CalendarDate d1 = CalendarDate.class.cast(s.getTemporal());
CalendarDate d2 = CalendarDate.class.cast(e.getTemporal());
GenericCalendarPeriod<?> period = GenericCalendarPeriod.class.cast(this);
intersection = period.with(d1, d2);
}
CalendarPeriod<T> result = (CalendarPeriod<T>) intersection;
return (result.isEmpty() ? Optional.empty() : Optional.of(result));
}
} } | public class class_name {
@SuppressWarnings("unchecked")
public Optional<CalendarPeriod<T>> findIntersection(ChronoInterval<T> other) {
if (this.isEmpty() || other.isEmpty()) {
return Optional.empty(); // depends on control dependency: [if], data = [none]
}
Boundary<T> s;
Boundary<T> e;
if (other.getStart().isInfinite()) {
s = this.getStart(); // depends on control dependency: [if], data = [none]
} else {
T d1 = this.t1;
T d2 = other.getStart().getTemporal();
if (other.getStart().isOpen()) {
d2 = this.getTimeLine().stepForward(d2); // depends on control dependency: [if], data = [none]
}
if (d2 == null) {
return Optional.empty(); // depends on control dependency: [if], data = [none]
}
s = ((this.getTimeLine().compare(d1, d2) < 0) ? Boundary.ofClosed(d2) : Boundary.ofClosed(d1)); // depends on control dependency: [if], data = [none]
}
if (other.getEnd().isInfinite()) {
e = this.getEnd(); // depends on control dependency: [if], data = [none]
} else {
T d1 = this.t2;
T d2 = other.getEnd().getTemporal();
if (other.getEnd().isOpen()) {
d2 = this.getTimeLine().stepBackwards(d2); // depends on control dependency: [if], data = [none]
}
e = ((this.getTimeLine().compare(d1, d2) < 0) ? Boundary.ofClosed(d1) : Boundary.ofClosed(d2)); // depends on control dependency: [if], data = [none]
}
if (toProlepticNumber(s.getTemporal()) > toProlepticNumber(e.getTemporal())) {
return Optional.empty(); // depends on control dependency: [if], data = [none]
} else {
CalendarPeriod<?> intersection;
T max = this.getTimeLine().getMaximum();
if (max instanceof FixedCalendarInterval) {
FixedCalendarInterval<?> d1 = FixedCalendarInterval.class.cast(s.getTemporal());
FixedCalendarInterval<?> d2 = FixedCalendarInterval.class.cast(e.getTemporal());
FixedCalendarTimeLine<?> fixed = FixedCalendarTimeLine.class.cast(this.getTimeLine());
intersection = new FixedCalendarPeriod(d1, d2, fixed); // depends on control dependency: [if], data = [none]
} else {
CalendarDate d1 = CalendarDate.class.cast(s.getTemporal());
CalendarDate d2 = CalendarDate.class.cast(e.getTemporal());
GenericCalendarPeriod<?> period = GenericCalendarPeriod.class.cast(this);
intersection = period.with(d1, d2); // depends on control dependency: [if], data = [none]
}
CalendarPeriod<T> result = (CalendarPeriod<T>) intersection;
return (result.isEmpty() ? Optional.empty() : Optional.of(result)); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void setItem(java.util.Collection<ImportJobResponse> item) {
if (item == null) {
this.item = null;
return;
}
this.item = new java.util.ArrayList<ImportJobResponse>(item);
} } | public class class_name {
public void setItem(java.util.Collection<ImportJobResponse> item) {
if (item == null) {
this.item = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.item = new java.util.ArrayList<ImportJobResponse>(item);
} } |
public class class_name {
public void close() throws IOException
{
// atomically set the close flag
synchronized (this.closeLock) {
if (this.closed) {
return;
}
this.closed = true;
try {
// wait until as many buffers have been returned as were written
// only then is everything guaranteed to be consistent.{
while (this.requestsNotReturned.get() > 0) {
try {
// we add a timeout here, because it is not guaranteed that the
// decrementing during buffer return and the check here are deadlock free.
// the deadlock situation is however unlikely and caught by the timeout
this.closeLock.wait(1000);
checkErroneous();
}
catch (InterruptedException iex) {}
}
}
finally {
// close the file
if (this.fileChannel.isOpen()) {
this.fileChannel.close();
}
}
}
} } | public class class_name {
public void close() throws IOException
{
// atomically set the close flag
synchronized (this.closeLock) {
if (this.closed) {
return; // depends on control dependency: [if], data = [none]
}
this.closed = true;
try {
// wait until as many buffers have been returned as were written
// only then is everything guaranteed to be consistent.{
while (this.requestsNotReturned.get() > 0) {
try {
// we add a timeout here, because it is not guaranteed that the
// decrementing during buffer return and the check here are deadlock free.
// the deadlock situation is however unlikely and caught by the timeout
this.closeLock.wait(1000); // depends on control dependency: [try], data = [none]
checkErroneous(); // depends on control dependency: [try], data = [none]
}
catch (InterruptedException iex) {} // depends on control dependency: [catch], data = [none]
}
}
finally {
// close the file
if (this.fileChannel.isOpen()) {
this.fileChannel.close(); // depends on control dependency: [if], data = [none]
}
}
}
} } |
public class class_name {
public void setHorizontalAlignment(HorizontalAlignmentConstant align) {
if (align.equals(HasHorizontalAlignment.ALIGN_CENTER)) {
// ignore center alignment
return;
}
m_button.setHorizontalAlignment(align);
m_align = align;
} } | public class class_name {
public void setHorizontalAlignment(HorizontalAlignmentConstant align) {
if (align.equals(HasHorizontalAlignment.ALIGN_CENTER)) {
// ignore center alignment
return; // depends on control dependency: [if], data = [none]
}
m_button.setHorizontalAlignment(align);
m_align = align;
} } |
public class class_name {
private void setDirectiveList(String directives) {
String[] directiveList = directives.replaceAll("\\s", EMPTY_STRING_VALUE).split(",");
for (String entry : directiveList) {
String[] nameValueArray = entry.split("=");
String directiveName = nameValueArray[0];
if (checkDirective(directiveName)) {
if (nameValueArray.length > 1) {
parseDirectiveWithValue(directiveName, nameValueArray[1]);
continue;
}
this.directives.put(Directive.get(directiveName), EMPTY_STRING_VALUE);
}
}
} } | public class class_name {
private void setDirectiveList(String directives) {
String[] directiveList = directives.replaceAll("\\s", EMPTY_STRING_VALUE).split(",");
for (String entry : directiveList) {
String[] nameValueArray = entry.split("=");
String directiveName = nameValueArray[0];
if (checkDirective(directiveName)) {
if (nameValueArray.length > 1) {
parseDirectiveWithValue(directiveName, nameValueArray[1]); // depends on control dependency: [if], data = [none]
continue;
}
this.directives.put(Directive.get(directiveName), EMPTY_STRING_VALUE); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
private void savePreviousImageValues() {
if (matrix != null && viewHeight != 0 && viewWidth != 0) {
matrix.getValues(m);
prevMatrix.setValues(m);
prevMatchViewHeight = matchViewHeight;
prevMatchViewWidth = matchViewWidth;
prevViewHeight = viewHeight;
prevViewWidth = viewWidth;
}
} } | public class class_name {
private void savePreviousImageValues() {
if (matrix != null && viewHeight != 0 && viewWidth != 0) {
matrix.getValues(m); // depends on control dependency: [if], data = [none]
prevMatrix.setValues(m); // depends on control dependency: [if], data = [none]
prevMatchViewHeight = matchViewHeight; // depends on control dependency: [if], data = [none]
prevMatchViewWidth = matchViewWidth; // depends on control dependency: [if], data = [none]
prevViewHeight = viewHeight; // depends on control dependency: [if], data = [none]
prevViewWidth = viewWidth; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public static String abbreviateMiddle(final String str, final String middle, final int length) {
if (isEmpty(str) || isEmpty(middle)) {
return str;
}
if (length >= str.length() || length < middle.length()+2) {
return str;
}
final int targetSting = length-middle.length();
final int startOffset = targetSting/2+targetSting%2;
final int endOffset = str.length()-targetSting/2;
return str.substring(0, startOffset) +
middle +
str.substring(endOffset);
} } | public class class_name {
public static String abbreviateMiddle(final String str, final String middle, final int length) {
if (isEmpty(str) || isEmpty(middle)) {
return str; // depends on control dependency: [if], data = [none]
}
if (length >= str.length() || length < middle.length()+2) {
return str; // depends on control dependency: [if], data = [none]
}
final int targetSting = length-middle.length();
final int startOffset = targetSting/2+targetSting%2;
final int endOffset = str.length()-targetSting/2;
return str.substring(0, startOffset) +
middle +
str.substring(endOffset);
} } |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.