code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
protected static File findValidWlpInstallPath(File searchDirectory, SelfExtractor extractor) {
// Checks the supplied directory to see if it either IS a valid wlp install dir for this archive, or CONTAINS a valid wlp install dir
// (For core, we'll usually break out right away, as any new directory is valid)
if ((extractor.isProductAddon() || extractor.isUserSample()) && extractor.validate(searchDirectory) != ReturnCode.OK) {
// If the install path wasn't valid, and we are installing a product add on it could be
// that we have been given the same path as the runtime archive installer was given. In this
// case liberty will actually be installed in the wlp subfolder so we need to check there too.
File wlpSubdir = new File(searchDirectory, "wlp");
ReturnCode rc = extractor.validate(wlpSubdir);
// The validate call does two things, it checks to see if the provided dir is liberty install
// and it also validates that the archive can be installed into it. If the wlp folder isn't a
// valid liberty install then we need to return the searchDirectory. If it is a valid directory
// but it isn't an applicable install we want to return wlpSubdir so a later call to validate
// will result in the right error message.
if (rc.getCode() == ReturnCode.BAD_OUTPUT && ("invalidInstall".equals(rc.getMessageKey()) || "LICENSE_invalidInstall".equals(rc.getMessageKey()))) {
return searchDirectory;
} else {
return wlpSubdir;
}
}
return searchDirectory;
} }
|
public class class_name {
protected static File findValidWlpInstallPath(File searchDirectory, SelfExtractor extractor) {
// Checks the supplied directory to see if it either IS a valid wlp install dir for this archive, or CONTAINS a valid wlp install dir
// (For core, we'll usually break out right away, as any new directory is valid)
if ((extractor.isProductAddon() || extractor.isUserSample()) && extractor.validate(searchDirectory) != ReturnCode.OK) {
// If the install path wasn't valid, and we are installing a product add on it could be
// that we have been given the same path as the runtime archive installer was given. In this
// case liberty will actually be installed in the wlp subfolder so we need to check there too.
File wlpSubdir = new File(searchDirectory, "wlp");
ReturnCode rc = extractor.validate(wlpSubdir);
// The validate call does two things, it checks to see if the provided dir is liberty install
// and it also validates that the archive can be installed into it. If the wlp folder isn't a
// valid liberty install then we need to return the searchDirectory. If it is a valid directory
// but it isn't an applicable install we want to return wlpSubdir so a later call to validate
// will result in the right error message.
if (rc.getCode() == ReturnCode.BAD_OUTPUT && ("invalidInstall".equals(rc.getMessageKey()) || "LICENSE_invalidInstall".equals(rc.getMessageKey()))) {
return searchDirectory; // depends on control dependency: [if], data = [none]
} else {
return wlpSubdir; // depends on control dependency: [if], data = [none]
}
}
return searchDirectory;
} }
|
public class class_name {
public boolean setupKey(boolean reverse)
{
boolean sameFlag = true;
for (int index = 1; index < m_rgiFldLeft.length; index++)
{
BaseField fldLeft = this.getLeftField(index);
BaseField fldRight = this.getRightField(index);
if (fldRight == null)
break;
if (fldLeft == fldRight)
{
}
else
{
sameFlag = false;
if (reverse)
{
if (fldLeft != null)
fldLeft.moveFieldToThis(fldRight, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
}
else
{
if (fldLeft == null)
fldRight.setString(this.getLeftFieldNameOrValue(index, true, true), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
else
fldRight.moveFieldToThis(fldLeft, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
}
}
}
return sameFlag;
} }
|
public class class_name {
public boolean setupKey(boolean reverse)
{
boolean sameFlag = true;
for (int index = 1; index < m_rgiFldLeft.length; index++)
{
BaseField fldLeft = this.getLeftField(index);
BaseField fldRight = this.getRightField(index);
if (fldRight == null)
break;
if (fldLeft == fldRight)
{
}
else
{
sameFlag = false; // depends on control dependency: [if], data = [none]
if (reverse)
{
if (fldLeft != null)
fldLeft.moveFieldToThis(fldRight, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
}
else
{
if (fldLeft == null)
fldRight.setString(this.getLeftFieldNameOrValue(index, true, true), DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
else
fldRight.moveFieldToThis(fldLeft, DBConstants.DONT_DISPLAY, DBConstants.SCREEN_MOVE);
}
}
}
return sameFlag;
} }
|
public class class_name {
protected void countSpaces(String host,
DuplicationInfo info,
ContentStore store,
List<String> spaces,
boolean primary) {
String storeId = store.getStoreId();
String storeType = store.getStorageProviderType();
for (String spaceId : spaces) {
boolean doCount = false;
// Handle spaces which include space ID, formatted like: spaceId:storeId
if (spaceId.indexOf(":") > -1) {
String[] spaceAndStoreId = spaceId.split(":");
spaceId = spaceAndStoreId[0];
if (primary || storeId.equals(spaceAndStoreId[1])) {
doCount = true;
}
} else {
doCount = true;
}
if (doCount) {
countSpace(host, spaceId, storeId, storeType, info, store);
}
}
} }
|
public class class_name {
protected void countSpaces(String host,
DuplicationInfo info,
ContentStore store,
List<String> spaces,
boolean primary) {
String storeId = store.getStoreId();
String storeType = store.getStorageProviderType();
for (String spaceId : spaces) {
boolean doCount = false;
// Handle spaces which include space ID, formatted like: spaceId:storeId
if (spaceId.indexOf(":") > -1) {
String[] spaceAndStoreId = spaceId.split(":");
spaceId = spaceAndStoreId[0]; // depends on control dependency: [if], data = [none]
if (primary || storeId.equals(spaceAndStoreId[1])) {
doCount = true; // depends on control dependency: [if], data = [none]
}
} else {
doCount = true; // depends on control dependency: [if], data = [none]
}
if (doCount) {
countSpace(host, spaceId, storeId, storeType, info, store); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public List<ITopicNode> getAllTopicNodes() {
final ArrayList<ITopicNode> topicNodes = new ArrayList<ITopicNode>();
for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) {
topicNodes.addAll(topicEntry.getValue());
}
return topicNodes;
} }
|
public class class_name {
public List<ITopicNode> getAllTopicNodes() {
final ArrayList<ITopicNode> topicNodes = new ArrayList<ITopicNode>();
for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) {
topicNodes.addAll(topicEntry.getValue()); // depends on control dependency: [for], data = [topicEntry]
}
return topicNodes;
} }
|
public class class_name {
public ConcatVector newEmptyClone() {
ConcatVector clone = new ConcatVector(getNumberOfComponents());
for (int i = 0; i < pointers.length; i++) {
if (pointers[i] != null && !sparse[i]) {
clone.pointers[i] = new double[pointers[i].length];
clone.sparse[i] = false;
}
}
return clone;
} }
|
public class class_name {
public ConcatVector newEmptyClone() {
ConcatVector clone = new ConcatVector(getNumberOfComponents());
for (int i = 0; i < pointers.length; i++) {
if (pointers[i] != null && !sparse[i]) {
clone.pointers[i] = new double[pointers[i].length]; // depends on control dependency: [if], data = [none]
clone.sparse[i] = false; // depends on control dependency: [if], data = [none]
}
}
return clone;
} }
|
public class class_name {
private void handleCollisionNotMatched(TSDB tsdb, HttpQuery query, final boolean for_collisions) {
final Map<String, Object> map;
if (query.hasContent()) {
map = query.serializer().parseTreeTSUIDsListV1();
} else {
map = parseTSUIDsList(query);
}
final Integer tree_id = (Integer) map.get("treeId");
if (tree_id == null) {
throw new BadRequestException("Missing or invalid Tree ID");
}
// make sure the tree exists
try {
if (Tree.fetchTree(tsdb, tree_id).joinUninterruptibly() == null) {
throw new BadRequestException(HttpResponseStatus.NOT_FOUND,
"Unable to locate tree: " + tree_id);
}
if (query.getAPIMethod() == HttpMethod.GET || query.getAPIMethod() == HttpMethod.POST ||
query.getAPIMethod() == HttpMethod.PUT) {
// ugly, but keeps from having to create a dedicated class just to
// convert one field.
@SuppressWarnings("unchecked")
final List<String> tsuids = (List<String>)map.get("tsuids");
final Map<String, String> results = for_collisions ?
Tree.fetchCollisions(tsdb, tree_id, tsuids).joinUninterruptibly() :
Tree.fetchNotMatched(tsdb, tree_id, tsuids).joinUninterruptibly();
query.sendReply(query.serializer().formatTreeCollisionNotMatchedV1(
results, for_collisions));
} else {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Unsupported HTTP request method");
}
} catch (ClassCastException e) {
throw new BadRequestException(
"Unable to convert the given data to a list", e);
} catch (BadRequestException e) {
throw e;
} catch (IllegalArgumentException e) {
throw new BadRequestException(e);
} catch (Exception e) {
throw new RuntimeException(e);
}
} }
|
public class class_name {
private void handleCollisionNotMatched(TSDB tsdb, HttpQuery query, final boolean for_collisions) {
final Map<String, Object> map;
if (query.hasContent()) {
map = query.serializer().parseTreeTSUIDsListV1(); // depends on control dependency: [if], data = [none]
} else {
map = parseTSUIDsList(query); // depends on control dependency: [if], data = [none]
}
final Integer tree_id = (Integer) map.get("treeId");
if (tree_id == null) {
throw new BadRequestException("Missing or invalid Tree ID");
}
// make sure the tree exists
try {
if (Tree.fetchTree(tsdb, tree_id).joinUninterruptibly() == null) {
throw new BadRequestException(HttpResponseStatus.NOT_FOUND,
"Unable to locate tree: " + tree_id);
}
if (query.getAPIMethod() == HttpMethod.GET || query.getAPIMethod() == HttpMethod.POST ||
query.getAPIMethod() == HttpMethod.PUT) {
// ugly, but keeps from having to create a dedicated class just to
// convert one field.
@SuppressWarnings("unchecked")
final List<String> tsuids = (List<String>)map.get("tsuids");
final Map<String, String> results = for_collisions ?
Tree.fetchCollisions(tsdb, tree_id, tsuids).joinUninterruptibly() :
Tree.fetchNotMatched(tsdb, tree_id, tsuids).joinUninterruptibly();
query.sendReply(query.serializer().formatTreeCollisionNotMatchedV1(
results, for_collisions)); // depends on control dependency: [if], data = [none]
} else {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Unsupported HTTP request method");
}
} catch (ClassCastException e) {
throw new BadRequestException(
"Unable to convert the given data to a list", e);
} catch (BadRequestException e) { // depends on control dependency: [catch], data = [none]
throw e;
} catch (IllegalArgumentException e) { // depends on control dependency: [catch], data = [none]
throw new BadRequestException(e);
} catch (Exception e) { // depends on control dependency: [catch], data = [none]
throw new RuntimeException(e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public WsByteBuffer wrap(com.ibm.wsspi.bytebuffer.WsByteBuffer realBuffer)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "wrap", realBuffer);
RichByteBufferImpl returnBuffer = null;
// Ensure here that if a null realBuffer was passed in we do not wrap that in a wrapper from
// the pool - we must also simply return null
if (realBuffer != null)
{
returnBuffer = getFromPool();
returnBuffer.reset(realBuffer, this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "wrap", returnBuffer);
return returnBuffer;
} }
|
public class class_name {
public WsByteBuffer wrap(com.ibm.wsspi.bytebuffer.WsByteBuffer realBuffer)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "wrap", realBuffer);
RichByteBufferImpl returnBuffer = null;
// Ensure here that if a null realBuffer was passed in we do not wrap that in a wrapper from
// the pool - we must also simply return null
if (realBuffer != null)
{
returnBuffer = getFromPool(); // depends on control dependency: [if], data = [none]
returnBuffer.reset(realBuffer, this); // depends on control dependency: [if], data = [(realBuffer]
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "wrap", returnBuffer);
return returnBuffer;
} }
|
public class class_name {
public String write(Object from) {
try {
StringWriter output = new StringWriter();
write(from, output);
return output.toString();
} catch (IOException e) {
throw new RuntimeException(e);
}
} }
|
public class class_name {
public String write(Object from) {
try {
StringWriter output = new StringWriter();
write(from, output); // depends on control dependency: [try], data = [none]
return output.toString(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
throw new RuntimeException(e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
NewYearRule rule(
HistoricEra era,
int yearOfDisplay
) {
int ad = era.annoDomini(yearOfDisplay);
int previous = Integer.MIN_VALUE;
NewYearRule prevRule = null;
for (int i = 0, n = this.strategies.size(); i < n; i++) {
NewYearStrategy strategy = this.strategies.get(i);
if ((ad >= previous) && (ad < strategy.lastAnnoDomini)) {
return strategy.lastRule;
}
previous = strategy.lastAnnoDomini;
prevRule = strategy.lastRule;
}
if ((ad == previous) && (era == HistoricEra.BYZANTINE) && (prevRule == NewYearRule.BEGIN_OF_SEPTEMBER)) {
return prevRule; // see Russia in byzantine year 7208
}
return this.lastRule;
} }
|
public class class_name {
NewYearRule rule(
HistoricEra era,
int yearOfDisplay
) {
int ad = era.annoDomini(yearOfDisplay);
int previous = Integer.MIN_VALUE;
NewYearRule prevRule = null;
for (int i = 0, n = this.strategies.size(); i < n; i++) {
NewYearStrategy strategy = this.strategies.get(i);
if ((ad >= previous) && (ad < strategy.lastAnnoDomini)) {
return strategy.lastRule; // depends on control dependency: [if], data = [none]
}
previous = strategy.lastAnnoDomini; // depends on control dependency: [for], data = [none]
prevRule = strategy.lastRule; // depends on control dependency: [for], data = [none]
}
if ((ad == previous) && (era == HistoricEra.BYZANTINE) && (prevRule == NewYearRule.BEGIN_OF_SEPTEMBER)) {
return prevRule; // see Russia in byzantine year 7208 // depends on control dependency: [if], data = [none]
}
return this.lastRule;
} }
|
public class class_name {
public ServiceCall<DialogNode> getDialogNode(GetDialogNodeOptions getDialogNodeOptions) {
Validator.notNull(getDialogNodeOptions, "getDialogNodeOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "dialog_nodes" };
String[] pathParameters = { getDialogNodeOptions.workspaceId(), getDialogNodeOptions.dialogNode() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
pathParameters));
builder.query("version", versionDate);
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v1", "getDialogNode");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue());
}
builder.header("Accept", "application/json");
if (getDialogNodeOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getDialogNodeOptions.includeAudit()));
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNode.class));
} }
|
public class class_name {
public ServiceCall<DialogNode> getDialogNode(GetDialogNodeOptions getDialogNodeOptions) {
Validator.notNull(getDialogNodeOptions, "getDialogNodeOptions cannot be null");
String[] pathSegments = { "v1/workspaces", "dialog_nodes" };
String[] pathParameters = { getDialogNodeOptions.workspaceId(), getDialogNodeOptions.dialogNode() };
RequestBuilder builder = RequestBuilder.get(RequestBuilder.constructHttpUrl(getEndPoint(), pathSegments,
pathParameters));
builder.query("version", versionDate);
Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("conversation", "v1", "getDialogNode");
for (Entry<String, String> header : sdkHeaders.entrySet()) {
builder.header(header.getKey(), header.getValue()); // depends on control dependency: [for], data = [header]
}
builder.header("Accept", "application/json");
if (getDialogNodeOptions.includeAudit() != null) {
builder.query("include_audit", String.valueOf(getDialogNodeOptions.includeAudit())); // depends on control dependency: [if], data = [(getDialogNodeOptions.includeAudit()]
}
return createServiceCall(builder.build(), ResponseConverterUtils.getObject(DialogNode.class));
} }
|
public class class_name {
public File getFsImageName(StorageLocationType type, long txid) {
File lastCandidate = null;
for (Iterator<StorageDirectory> it =
dirIterator(NameNodeDirType.IMAGE); it.hasNext();) {
StorageDirectory sd = it.next();
File fsImage = getStorageFile(sd, NameNodeFile.IMAGE, txid);
if(sd.getRoot().canRead() && fsImage.exists()) {
if (isPreferred(type, sd)) {
return fsImage;
}
lastCandidate = fsImage;
}
}
return lastCandidate;
} }
|
public class class_name {
public File getFsImageName(StorageLocationType type, long txid) {
File lastCandidate = null;
for (Iterator<StorageDirectory> it =
dirIterator(NameNodeDirType.IMAGE); it.hasNext();) {
StorageDirectory sd = it.next();
File fsImage = getStorageFile(sd, NameNodeFile.IMAGE, txid);
if(sd.getRoot().canRead() && fsImage.exists()) {
if (isPreferred(type, sd)) {
return fsImage; // depends on control dependency: [if], data = [none]
}
lastCandidate = fsImage; // depends on control dependency: [if], data = [none]
}
}
return lastCandidate;
} }
|
public class class_name {
private static boolean shouldWaive(Method getter, Class<?> implementClass) {
int modifiers = getter.getModifiers();
if (Modifier.isTransient(modifiers) || Modifier.isStatic(modifiers)) {
return true;
}
String fieldName = getter.getName().substring(3);
Class<?> entityType = Generics.getReturnType(getter, implementClass);
return ParamValueLoaderService.noBind(entityType)
|| getter.isAnnotationPresent(NoBind.class)
|| getter.isAnnotationPresent(Stateless.class)
|| getter.isAnnotationPresent(Global.class)
|| ParamValueLoaderService.isInBlackList(fieldName)
|| Object.class.equals(entityType)
|| Class.class.equals(entityType)
|| OsglConfig.globalMappingFilter_shouldIgnore(fieldName);
} }
|
public class class_name {
private static boolean shouldWaive(Method getter, Class<?> implementClass) {
int modifiers = getter.getModifiers();
if (Modifier.isTransient(modifiers) || Modifier.isStatic(modifiers)) {
return true; // depends on control dependency: [if], data = [none]
}
String fieldName = getter.getName().substring(3);
Class<?> entityType = Generics.getReturnType(getter, implementClass);
return ParamValueLoaderService.noBind(entityType)
|| getter.isAnnotationPresent(NoBind.class)
|| getter.isAnnotationPresent(Stateless.class)
|| getter.isAnnotationPresent(Global.class)
|| ParamValueLoaderService.isInBlackList(fieldName)
|| Object.class.equals(entityType)
|| Class.class.equals(entityType)
|| OsglConfig.globalMappingFilter_shouldIgnore(fieldName);
} }
|
public class class_name {
private final Type getGenericType() {
final Class<?> raw = getClass();
final TypeVariable<?>[] typeParameters = raw.getTypeParameters();
if (ArrayUtils.isEmpty(typeParameters)) {
return raw;
}
final Type[] parameters = new Type[typeParameters.length];
// use empty type variable map because we're relying on @BindTypeVariable functionality:
final Map<TypeVariable<?>, Type> typeVariableMap = Collections.emptyMap();
for (int i = 0; i < parameters.length; i++) {
parameters[i] = Types.resolveAt(this, typeParameters[i], typeVariableMap);
}
return TypeUtils.parameterize(raw, parameters);
} }
|
public class class_name {
private final Type getGenericType() {
final Class<?> raw = getClass();
final TypeVariable<?>[] typeParameters = raw.getTypeParameters();
if (ArrayUtils.isEmpty(typeParameters)) {
return raw; // depends on control dependency: [if], data = [none]
}
final Type[] parameters = new Type[typeParameters.length];
// use empty type variable map because we're relying on @BindTypeVariable functionality:
final Map<TypeVariable<?>, Type> typeVariableMap = Collections.emptyMap();
for (int i = 0; i < parameters.length; i++) {
parameters[i] = Types.resolveAt(this, typeParameters[i], typeVariableMap); // depends on control dependency: [for], data = [i]
}
return TypeUtils.parameterize(raw, parameters);
} }
|
public class class_name {
private boolean isTruncationNeeded(PerJVMInfo lInfo,
Map<Task, Map<LogName, LogFileDetail>> taskLogFileDetails,
LogName logName) {
boolean truncationNeeded = false;
LogFileDetail logFileDetail = null;
for (Task task : lInfo.allAttempts) {
long taskRetainSize =
(task.isMapTask() ? mapRetainSize : reduceRetainSize);
Map<LogName, LogFileDetail> allLogsFileDetails =
taskLogFileDetails.get(task);
logFileDetail = allLogsFileDetails.get(logName);
if (taskRetainSize > MINIMUM_RETAIN_SIZE_FOR_TRUNCATION
&& logFileDetail.length > taskRetainSize) {
truncationNeeded = true;
break;
}
}
return truncationNeeded;
} }
|
public class class_name {
private boolean isTruncationNeeded(PerJVMInfo lInfo,
Map<Task, Map<LogName, LogFileDetail>> taskLogFileDetails,
LogName logName) {
boolean truncationNeeded = false;
LogFileDetail logFileDetail = null;
for (Task task : lInfo.allAttempts) {
long taskRetainSize =
(task.isMapTask() ? mapRetainSize : reduceRetainSize);
Map<LogName, LogFileDetail> allLogsFileDetails =
taskLogFileDetails.get(task);
logFileDetail = allLogsFileDetails.get(logName); // depends on control dependency: [for], data = [none]
if (taskRetainSize > MINIMUM_RETAIN_SIZE_FOR_TRUNCATION
&& logFileDetail.length > taskRetainSize) {
truncationNeeded = true; // depends on control dependency: [if], data = [none]
break;
}
}
return truncationNeeded;
} }
|
public class class_name {
public void checkAuthStatus(SimpleLoginAuthenticatedHandler handler) {
if(androidContext != null) {
SharedPreferences sharedPreferences = androidContext.getSharedPreferences(Constants.FIREBASE_ANDROID_SHARED_PREFERENCE, Context.MODE_PRIVATE);
String jsonTokenData = sharedPreferences.getString("jsonTokenData", null);
if(jsonTokenData != null) {
try {
JSONObject jsonObject = new JSONObject(jsonTokenData);
attemptAuthWithData(jsonObject, handler);
}
catch (JSONException e) {
handler.authenticated(null, null);
}
}
else {
handler.authenticated(null, null);
}
}
else {
handler.authenticated(null, null);
}
} }
|
public class class_name {
public void checkAuthStatus(SimpleLoginAuthenticatedHandler handler) {
if(androidContext != null) {
SharedPreferences sharedPreferences = androidContext.getSharedPreferences(Constants.FIREBASE_ANDROID_SHARED_PREFERENCE, Context.MODE_PRIVATE);
String jsonTokenData = sharedPreferences.getString("jsonTokenData", null);
if(jsonTokenData != null) {
try {
JSONObject jsonObject = new JSONObject(jsonTokenData);
attemptAuthWithData(jsonObject, handler); // depends on control dependency: [try], data = [none]
}
catch (JSONException e) {
handler.authenticated(null, null);
} // depends on control dependency: [catch], data = [none]
}
else {
handler.authenticated(null, null); // depends on control dependency: [if], data = [null)]
}
}
else {
handler.authenticated(null, null); // depends on control dependency: [if], data = [null)]
}
} }
|
public class class_name {
public String status(boolean sync)
{
if (exit.isExited()) {
return EXITED;
}
try {
String status = recvStatus();
if (agent.send(STATUS) && sync) {
// wait for the response to emulate sync
status = recvStatus();
// AND refill a status
if (EXITED.equals(status) || !agent.send(STATUS)) {
return EXITED;
}
}
return status;
}
catch (ZMQException e) {
return EXITED;
}
} }
|
public class class_name {
public String status(boolean sync)
{
if (exit.isExited()) {
return EXITED; // depends on control dependency: [if], data = [none]
}
try {
String status = recvStatus();
if (agent.send(STATUS) && sync) {
// wait for the response to emulate sync
status = recvStatus(); // depends on control dependency: [if], data = [none]
// AND refill a status
if (EXITED.equals(status) || !agent.send(STATUS)) {
return EXITED; // depends on control dependency: [if], data = [none]
}
}
return status; // depends on control dependency: [try], data = [none]
}
catch (ZMQException e) {
return EXITED;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public Histogram<T> getHistogram( int numSigmas ) {
Lock lock = this.getLock().writeLock();
lock.lock();
try {
Histogram<T> hist = new Histogram<T>(this.math, this.values);
if (numSigmas > 0) {
// The 'getMediaValue()' method will reset the current histogram, so don't set it...
hist.setStrategy(this.getMedianValue(), this.getStandardDeviation(), numSigmas);
}
this.histogram = hist;
return this.histogram;
} finally {
lock.unlock();
}
} }
|
public class class_name {
public Histogram<T> getHistogram( int numSigmas ) {
Lock lock = this.getLock().writeLock();
lock.lock();
try {
Histogram<T> hist = new Histogram<T>(this.math, this.values);
if (numSigmas > 0) {
// The 'getMediaValue()' method will reset the current histogram, so don't set it...
hist.setStrategy(this.getMedianValue(), this.getStandardDeviation(), numSigmas); // depends on control dependency: [if], data = [none]
}
this.histogram = hist; // depends on control dependency: [try], data = [none]
return this.histogram; // depends on control dependency: [try], data = [none]
} finally {
lock.unlock();
}
} }
|
public class class_name {
private Cookie _createFlashCookie(String name, String value, ExternalContext externalContext)
{
Cookie cookie = new Cookie(name, value);
cookie.setMaxAge(-1);
cookie.setPath(_getCookiePath(externalContext));
cookie.setSecure(externalContext.isSecure());
//cookie.setHttpOnly(true);
if (ServletSpecifications.isServlet30Available())
{
_Servlet30Utils.setCookieHttpOnly(cookie, true);
}
return cookie;
} }
|
public class class_name {
private Cookie _createFlashCookie(String name, String value, ExternalContext externalContext)
{
Cookie cookie = new Cookie(name, value);
cookie.setMaxAge(-1);
cookie.setPath(_getCookiePath(externalContext));
cookie.setSecure(externalContext.isSecure());
//cookie.setHttpOnly(true);
if (ServletSpecifications.isServlet30Available())
{
_Servlet30Utils.setCookieHttpOnly(cookie, true); // depends on control dependency: [if], data = [none]
}
return cookie;
} }
|
public class class_name {
public void setProcessingTargets(java.util.Collection<String> processingTargets) {
if (processingTargets == null) {
this.processingTargets = null;
return;
}
this.processingTargets = new java.util.ArrayList<String>(processingTargets);
} }
|
public class class_name {
public void setProcessingTargets(java.util.Collection<String> processingTargets) {
if (processingTargets == null) {
this.processingTargets = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.processingTargets = new java.util.ArrayList<String>(processingTargets);
} }
|
public class class_name {
public ServerHandle detect(MBeanServerExecutor pMBeanServerExecutor) {
String version = getSingleStringAttribute(pMBeanServerExecutor, "org.apache.activemq:type=Broker,*", "BrokerVersion");
if (version == null) {
return null;
}
return new ServerHandle("Apache","activemq",version, null);
} }
|
public class class_name {
public ServerHandle detect(MBeanServerExecutor pMBeanServerExecutor) {
String version = getSingleStringAttribute(pMBeanServerExecutor, "org.apache.activemq:type=Broker,*", "BrokerVersion");
if (version == null) {
return null; // depends on control dependency: [if], data = [none]
}
return new ServerHandle("Apache","activemq",version, null);
} }
|
public class class_name {
public double[][] copyValues2D()
{
double v[][] = new double[nRows][nCols];
for (int r = 0; r < nRows; ++r) {
for (int c = 0; c < nCols; ++c) {
v[r][c] = values[r][c];
}
}
return v;
} }
|
public class class_name {
public double[][] copyValues2D()
{
double v[][] = new double[nRows][nCols];
for (int r = 0; r < nRows; ++r) {
for (int c = 0; c < nCols; ++c) {
v[r][c] = values[r][c]; // depends on control dependency: [for], data = [c]
}
}
return v;
} }
|
public class class_name {
private TypeSerializer<Object> createSerializer(Object key, int pos) {
if (key == null) {
throw new NullKeyFieldException(pos);
}
try {
TypeInformation<Object> info = TypeExtractor.getForObject(key);
return info.createSerializer(executionConfig);
}
catch (Throwable t) {
throw new RuntimeException("Could not create key serializer for type " + key);
}
} }
|
public class class_name {
private TypeSerializer<Object> createSerializer(Object key, int pos) {
if (key == null) {
throw new NullKeyFieldException(pos);
}
try {
TypeInformation<Object> info = TypeExtractor.getForObject(key);
return info.createSerializer(executionConfig); // depends on control dependency: [try], data = [none]
}
catch (Throwable t) {
throw new RuntimeException("Could not create key serializer for type " + key);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private String scopesToString(Auth.UrlCodex urlCodex) {
if (scopes == null || scopes.length == 0) {
return "";
}
StringBuilder sb = new StringBuilder();
boolean needsSeparator = false;
for (String scope : scopes) {
if (needsSeparator) {
sb.append(scopeDelimiter);
}
needsSeparator = true;
// Use the URL codex to encode each scope, if provided.
sb.append(urlCodex == null ? scope : urlCodex.encode(scope));
}
return sb.toString();
} }
|
public class class_name {
private String scopesToString(Auth.UrlCodex urlCodex) {
if (scopes == null || scopes.length == 0) {
return ""; // depends on control dependency: [if], data = [none]
}
StringBuilder sb = new StringBuilder();
boolean needsSeparator = false;
for (String scope : scopes) {
if (needsSeparator) {
sb.append(scopeDelimiter); // depends on control dependency: [if], data = [none]
}
needsSeparator = true; // depends on control dependency: [for], data = [none]
// Use the URL codex to encode each scope, if provided.
sb.append(urlCodex == null ? scope : urlCodex.encode(scope)); // depends on control dependency: [for], data = [scope]
}
return sb.toString();
} }
|
public class class_name {
public static String getSystemProperty(String key, String def) {
try {
return System.getProperty(key, def);
} catch (SecurityException e) {
return def;
}
} }
|
public class class_name {
public static String getSystemProperty(String key, String def) {
try {
return System.getProperty(key, def); // depends on control dependency: [try], data = [none]
} catch (SecurityException e) {
return def;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public EClass getIfcMinuteInHour() {
if (ifcMinuteInHourEClass == null) {
ifcMinuteInHourEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(709);
}
return ifcMinuteInHourEClass;
} }
|
public class class_name {
public EClass getIfcMinuteInHour() {
if (ifcMinuteInHourEClass == null) {
ifcMinuteInHourEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(709);
// depends on control dependency: [if], data = [none]
}
return ifcMinuteInHourEClass;
} }
|
public class class_name {
static int divide(Slice decimal, int divisor, Slice result)
{
if (divisor == 0) {
throwDivisionByZeroException();
}
checkArgument(divisor > 0);
long remainder = getLong(decimal, 1);
long high = remainder / divisor;
remainder %= divisor;
remainder = (getInt(decimal, 1) & LONG_MASK) + (remainder << 32);
int z1 = (int) (remainder / divisor);
remainder %= divisor;
remainder = (getInt(decimal, 0) & LONG_MASK) + (remainder << 32);
int z0 = (int) (remainder / divisor);
pack(result, z0, z1, high, isNegative(decimal));
return (int) (remainder % divisor);
} }
|
public class class_name {
static int divide(Slice decimal, int divisor, Slice result)
{
if (divisor == 0) {
throwDivisionByZeroException(); // depends on control dependency: [if], data = [none]
}
checkArgument(divisor > 0);
long remainder = getLong(decimal, 1);
long high = remainder / divisor;
remainder %= divisor;
remainder = (getInt(decimal, 1) & LONG_MASK) + (remainder << 32);
int z1 = (int) (remainder / divisor);
remainder %= divisor;
remainder = (getInt(decimal, 0) & LONG_MASK) + (remainder << 32);
int z0 = (int) (remainder / divisor);
pack(result, z0, z1, high, isNegative(decimal));
return (int) (remainder % divisor);
} }
|
public class class_name {
public Spider addUrl(String... urls) {
for (String url : urls) {
addRequest(new Request(url));
}
signalNewUrl();
return this;
} }
|
public class class_name {
public Spider addUrl(String... urls) {
for (String url : urls) {
addRequest(new Request(url)); // depends on control dependency: [for], data = [url]
}
signalNewUrl();
return this;
} }
|
public class class_name {
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
int iErrorCode = DBConstants.NORMAL_RETURN;
if (m_bUpdateRecord)
if (m_record.isModified())
{
try
{
if (m_record.getEditMode() == Constants.EDIT_IN_PROGRESS)
m_record.set();
else if (m_record.getEditMode() == Constants.EDIT_ADD)
m_record.add();
}
catch( DBException ex )
{
return ex.getErrorCode();
}
}
if (m_bMoveBehavior) if (m_keyField != null)
if ((iMoveMode == DBConstants.INIT_MOVE) || (iMoveMode == DBConstants.READ_MOVE))
m_keyField.setModified(true); // Force re-read and GetValid/GetNew listener to run
if (m_keyField == null)
{
int iHandleType = DBConstants.BOOKMARK_HANDLE;
iErrorCode = DBConstants.NORMAL_RETURN;
try
{
Object handle = this.getOwner().getData();
if ((handle == null)
|| ((this.getOwner() instanceof ReferenceField) && (((Integer)handle).intValue() == 0)))
{
if ((m_bAllowNull) || (iMoveMode != DBConstants.SCREEN_MOVE))
m_record.handleNewRecord(DBConstants.DISPLAY); //? Display Fields (Should leave record in an indeterminate state!)
else
iErrorCode = DBConstants.KEY_NOT_FOUND; // Can't have a null value
}
else
{
if (m_record.setHandle(handle, iHandleType) == null) // SCREEN_MOVE says this is coming from here
iErrorCode = DBConstants.KEY_NOT_FOUND;
else // Do all the field behaviors for the secondary record //x if (iMoveMode != DBConstants.READ_MOVE)
{
for (int i = 0; i < m_record.getFieldCount(); i++)
{
m_record.getField(i).handleFieldChanged(bDisplayOption, DBConstants.READ_MOVE); // Make sure all fields of the secondary record get this change notification
}
}
}
} catch (DBException ex) {
iErrorCode = ex.getErrorCode();
}
}
else
iErrorCode = m_keyField.moveFieldToThis(this.getOwner(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // SCREEN_MOVE says this is coming from here
return iErrorCode;
} }
|
public class class_name {
public int fieldChanged(boolean bDisplayOption, int iMoveMode)
{
int iErrorCode = DBConstants.NORMAL_RETURN;
if (m_bUpdateRecord)
if (m_record.isModified())
{
try
{
if (m_record.getEditMode() == Constants.EDIT_IN_PROGRESS)
m_record.set();
else if (m_record.getEditMode() == Constants.EDIT_ADD)
m_record.add();
}
catch( DBException ex )
{
return ex.getErrorCode();
} // depends on control dependency: [catch], data = [none]
}
if (m_bMoveBehavior) if (m_keyField != null)
if ((iMoveMode == DBConstants.INIT_MOVE) || (iMoveMode == DBConstants.READ_MOVE))
m_keyField.setModified(true); // Force re-read and GetValid/GetNew listener to run
if (m_keyField == null)
{
int iHandleType = DBConstants.BOOKMARK_HANDLE;
iErrorCode = DBConstants.NORMAL_RETURN; // depends on control dependency: [if], data = [none]
try
{
Object handle = this.getOwner().getData();
if ((handle == null)
|| ((this.getOwner() instanceof ReferenceField) && (((Integer)handle).intValue() == 0)))
{
if ((m_bAllowNull) || (iMoveMode != DBConstants.SCREEN_MOVE))
m_record.handleNewRecord(DBConstants.DISPLAY); //? Display Fields (Should leave record in an indeterminate state!)
else
iErrorCode = DBConstants.KEY_NOT_FOUND; // Can't have a null value
}
else
{
if (m_record.setHandle(handle, iHandleType) == null) // SCREEN_MOVE says this is coming from here
iErrorCode = DBConstants.KEY_NOT_FOUND;
else // Do all the field behaviors for the secondary record //x if (iMoveMode != DBConstants.READ_MOVE)
{
for (int i = 0; i < m_record.getFieldCount(); i++)
{
m_record.getField(i).handleFieldChanged(bDisplayOption, DBConstants.READ_MOVE); // Make sure all fields of the secondary record get this change notification // depends on control dependency: [for], data = [i]
}
}
}
} catch (DBException ex) {
iErrorCode = ex.getErrorCode();
} // depends on control dependency: [catch], data = [none]
}
else
iErrorCode = m_keyField.moveFieldToThis(this.getOwner(), DBConstants.DISPLAY, DBConstants.SCREEN_MOVE); // SCREEN_MOVE says this is coming from here
return iErrorCode;
} }
|
public class class_name {
public boolean serialize(final Object object) {
if (object == null) {
write(NULL);
return true;
}
TypeJsonSerializer typeJsonSerializer = null;
// callback
if (serializerResolver != null) {
typeJsonSerializer = serializerResolver.apply(object);
}
if (typeJsonSerializer == null) {
// + read paths map
if (jsonSerializer.pathSerializersMap != null) {
typeJsonSerializer = jsonSerializer.pathSerializersMap.get(path);
}
final Class type = object.getClass();
// + read local types map
if (jsonSerializer.typeSerializersMap != null) {
typeJsonSerializer = jsonSerializer.typeSerializersMap.lookup(type);
}
// + globals
if (typeJsonSerializer == null) {
typeJsonSerializer = TypeJsonSerializerMap.get().lookup(type);
}
}
return typeJsonSerializer.serialize(this, object);
} }
|
public class class_name {
public boolean serialize(final Object object) {
if (object == null) {
write(NULL); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
TypeJsonSerializer typeJsonSerializer = null;
// callback
if (serializerResolver != null) {
typeJsonSerializer = serializerResolver.apply(object); // depends on control dependency: [if], data = [none]
}
if (typeJsonSerializer == null) {
// + read paths map
if (jsonSerializer.pathSerializersMap != null) {
typeJsonSerializer = jsonSerializer.pathSerializersMap.get(path); // depends on control dependency: [if], data = [none]
}
final Class type = object.getClass();
// + read local types map
if (jsonSerializer.typeSerializersMap != null) {
typeJsonSerializer = jsonSerializer.typeSerializersMap.lookup(type); // depends on control dependency: [if], data = [none]
}
// + globals
if (typeJsonSerializer == null) {
typeJsonSerializer = TypeJsonSerializerMap.get().lookup(type); // depends on control dependency: [if], data = [none]
}
}
return typeJsonSerializer.serialize(this, object);
} }
|
public class class_name {
public static LockInfo create(Document document) {
Assert.isNotNull(document);
Assert.isTrue(document.getOwnerDocument() == null);
Element element = create(document, "lockinfo"); //$NON-NLS-1$
Element locktype = appendChild(element, "locktype"); //$NON-NLS-1$
appendChild(locktype, "write"); //$NON-NLS-1$
LockInfo result = null;
try {
result = new LockInfo(element);
} catch (MalformedElementException e) {
Assert.isTrue(false, Policy.bind("assert.internalError")); //$NON-NLS-1$
}
return result;
} }
|
public class class_name {
public static LockInfo create(Document document) {
Assert.isNotNull(document);
Assert.isTrue(document.getOwnerDocument() == null);
Element element = create(document, "lockinfo"); //$NON-NLS-1$
Element locktype = appendChild(element, "locktype"); //$NON-NLS-1$
appendChild(locktype, "write"); //$NON-NLS-1$
LockInfo result = null;
try {
result = new LockInfo(element); // depends on control dependency: [try], data = [none]
} catch (MalformedElementException e) {
Assert.isTrue(false, Policy.bind("assert.internalError")); //$NON-NLS-1$
}
return result;
} } // depends on control dependency: [catch], data = [none]
|
public class class_name {
public static boolean contains(
final boolean caseSensitive,
final char[] text, final int textOffset, final int textLen,
final char[] fragment, final int fragmentOffset, final int fragmentLen) {
if (text == null) {
throw new IllegalArgumentException("Text cannot be null");
}
if (fragment == null) {
throw new IllegalArgumentException("Fragment cannot be null");
}
if (textLen < fragmentLen) {
return false;
}
if (fragmentLen == 0) {
return true;
}
char c1, c2;
for (int i = 0,j = 0; i < textLen; i++) {
c1 = text[textOffset + i];
c2 = fragment[fragmentOffset + j];
if (c1 == c2) {
if (++j == fragmentLen) {
return true;
}
continue;
}
if (!caseSensitive) {
c1 = Character.toUpperCase(c1);
c2 = Character.toUpperCase(c2);
if (c1 == c2) {
if (++j == fragmentLen) {
return true;
}
continue;
}
// We check both upper and lower case because that is how String#equalsIgnoreCase() is defined.
// See String#regionMatches(boolean,int,String,int,int)
if (Character.toLowerCase(c1) == Character.toLowerCase(c2)) {
if (++j == fragmentLen) {
return true;
}
continue;
}
}
if (j > 0) {
// Go back to matching start + 1, in order to be able to match things like "aab" with fragment "ab"
i -= j;
}
j = 0;
}
return false;
} }
|
public class class_name {
public static boolean contains(
final boolean caseSensitive,
final char[] text, final int textOffset, final int textLen,
final char[] fragment, final int fragmentOffset, final int fragmentLen) {
if (text == null) {
throw new IllegalArgumentException("Text cannot be null");
}
if (fragment == null) {
throw new IllegalArgumentException("Fragment cannot be null");
}
if (textLen < fragmentLen) {
return false; // depends on control dependency: [if], data = [none]
}
if (fragmentLen == 0) {
return true; // depends on control dependency: [if], data = [none]
}
char c1, c2;
for (int i = 0,j = 0; i < textLen; i++) {
c1 = text[textOffset + i]; // depends on control dependency: [for], data = [i]
c2 = fragment[fragmentOffset + j]; // depends on control dependency: [for], data = [none]
if (c1 == c2) {
if (++j == fragmentLen) {
return true; // depends on control dependency: [if], data = [none]
}
continue;
}
if (!caseSensitive) {
c1 = Character.toUpperCase(c1); // depends on control dependency: [if], data = [none]
c2 = Character.toUpperCase(c2); // depends on control dependency: [if], data = [none]
if (c1 == c2) {
if (++j == fragmentLen) {
return true; // depends on control dependency: [if], data = [none]
}
continue;
}
// We check both upper and lower case because that is how String#equalsIgnoreCase() is defined.
// See String#regionMatches(boolean,int,String,int,int)
if (Character.toLowerCase(c1) == Character.toLowerCase(c2)) {
if (++j == fragmentLen) {
return true; // depends on control dependency: [if], data = [none]
}
continue;
}
}
if (j > 0) {
// Go back to matching start + 1, in order to be able to match things like "aab" with fragment "ab"
i -= j; // depends on control dependency: [if], data = [none]
}
j = 0; // depends on control dependency: [for], data = [none]
}
return false;
} }
|
public class class_name {
protected void update(MetricsRecordImpl record) {
String recordName = record.getRecordName();
TagMap tagTable = record.getTagTable();
Map<String,MetricValue> metricUpdates = record.getMetricTable();
RecordMap recordMap = getRecordMap(recordName);
synchronized (recordMap) {
MetricMap metricMap = recordMap.get(tagTable);
if (metricMap == null) {
metricMap = new MetricMap();
TagMap tagMap = new TagMap(tagTable); // clone tags
recordMap.put(tagMap, metricMap);
}
Set<Entry<String, MetricValue>> entrySet = metricUpdates.entrySet();
for (Entry<String, MetricValue> entry : entrySet) {
String metricName = entry.getKey ();
MetricValue updateValue = entry.getValue ();
Number updateNumber = updateValue.getNumber();
Number currentNumber = metricMap.get(metricName);
if (currentNumber == null || updateValue.isAbsolute()) {
metricMap.put(metricName, updateNumber);
}
else {
Number newNumber = sum(updateNumber, currentNumber);
metricMap.put(metricName, newNumber);
}
}
}
} }
|
public class class_name {
protected void update(MetricsRecordImpl record) {
String recordName = record.getRecordName();
TagMap tagTable = record.getTagTable();
Map<String,MetricValue> metricUpdates = record.getMetricTable();
RecordMap recordMap = getRecordMap(recordName);
synchronized (recordMap) {
MetricMap metricMap = recordMap.get(tagTable);
if (metricMap == null) {
metricMap = new MetricMap();
// depends on control dependency: [if], data = [none]
TagMap tagMap = new TagMap(tagTable); // clone tags
recordMap.put(tagMap, metricMap);
// depends on control dependency: [if], data = [none]
}
Set<Entry<String, MetricValue>> entrySet = metricUpdates.entrySet();
for (Entry<String, MetricValue> entry : entrySet) {
String metricName = entry.getKey ();
MetricValue updateValue = entry.getValue ();
Number updateNumber = updateValue.getNumber();
Number currentNumber = metricMap.get(metricName);
if (currentNumber == null || updateValue.isAbsolute()) {
metricMap.put(metricName, updateNumber);
// depends on control dependency: [if], data = [none]
}
else {
Number newNumber = sum(updateNumber, currentNumber);
metricMap.put(metricName, newNumber);
// depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
public final void removeLayerListener(MapLayerListener listener) {
if (this.listeners != null) {
this.listeners.remove(MapLayerListener.class, listener);
if (this.listeners.isEmpty()) {
this.listeners = null;
}
}
} }
|
public class class_name {
public final void removeLayerListener(MapLayerListener listener) {
if (this.listeners != null) {
this.listeners.remove(MapLayerListener.class, listener); // depends on control dependency: [if], data = [none]
if (this.listeners.isEmpty()) {
this.listeners = null; // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public LifecycleCallbackType<InterceptorType<T>> getOrCreateAroundConstruct()
{
List<Node> nodeList = childNode.get("around-construct");
if (nodeList != null && nodeList.size() > 0)
{
return new LifecycleCallbackTypeImpl<InterceptorType<T>>(this, "around-construct", childNode, nodeList.get(0));
}
return createAroundConstruct();
} }
|
public class class_name {
public LifecycleCallbackType<InterceptorType<T>> getOrCreateAroundConstruct()
{
List<Node> nodeList = childNode.get("around-construct");
if (nodeList != null && nodeList.size() > 0)
{
return new LifecycleCallbackTypeImpl<InterceptorType<T>>(this, "around-construct", childNode, nodeList.get(0)); // depends on control dependency: [if], data = [none]
}
return createAroundConstruct();
} }
|
public class class_name {
private PreparedStatement internalPrepareStatement(final String sql,
final int resultSetScrollType,
final int resultSetConcurrency,
final int autoGeneratedKeys)
throws SQLException {
if (sql != null) {
String sqlQuery = Utils.nativeSql(sql, protocol.noBackslashEscapes());
if (options.useServerPrepStmts && PREPARABLE_STATEMENT_PATTERN.matcher(sqlQuery).find()) {
//prepare isn't delayed -> if prepare fail, fallback to client preparedStatement?
checkConnection();
try {
return new ServerSidePreparedStatement(this,
sqlQuery,
resultSetScrollType,
resultSetConcurrency,
autoGeneratedKeys);
} catch (SQLNonTransientConnectionException e) {
throw e;
} catch (SQLException e) {
//on some specific case, server cannot prepared data (CONJ-238)
//will use clientPreparedStatement
}
}
return new ClientSidePreparedStatement(this,
sqlQuery,
resultSetScrollType,
resultSetConcurrency,
autoGeneratedKeys);
} else {
throw new SQLException("SQL value can not be NULL");
}
} }
|
public class class_name {
private PreparedStatement internalPrepareStatement(final String sql,
final int resultSetScrollType,
final int resultSetConcurrency,
final int autoGeneratedKeys)
throws SQLException {
if (sql != null) {
String sqlQuery = Utils.nativeSql(sql, protocol.noBackslashEscapes());
if (options.useServerPrepStmts && PREPARABLE_STATEMENT_PATTERN.matcher(sqlQuery).find()) {
//prepare isn't delayed -> if prepare fail, fallback to client preparedStatement?
checkConnection();
try {
return new ServerSidePreparedStatement(this,
sqlQuery,
resultSetScrollType,
resultSetConcurrency,
autoGeneratedKeys); // depends on control dependency: [try], data = [none]
} catch (SQLNonTransientConnectionException e) {
throw e;
} catch (SQLException e) { // depends on control dependency: [catch], data = [none]
//on some specific case, server cannot prepared data (CONJ-238)
//will use clientPreparedStatement
} // depends on control dependency: [catch], data = [none]
}
return new ClientSidePreparedStatement(this,
sqlQuery,
resultSetScrollType,
resultSetConcurrency,
autoGeneratedKeys);
} else {
throw new SQLException("SQL value can not be NULL");
}
} }
|
public class class_name {
public CoverageByTime withGroups(ReservationCoverageGroup... groups) {
if (this.groups == null) {
setGroups(new java.util.ArrayList<ReservationCoverageGroup>(groups.length));
}
for (ReservationCoverageGroup ele : groups) {
this.groups.add(ele);
}
return this;
} }
|
public class class_name {
public CoverageByTime withGroups(ReservationCoverageGroup... groups) {
if (this.groups == null) {
setGroups(new java.util.ArrayList<ReservationCoverageGroup>(groups.length)); // depends on control dependency: [if], data = [none]
}
for (ReservationCoverageGroup ele : groups) {
this.groups.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public BodenbelagTyp getBodenbelag() {
if (bodenbelag == null) {
return BodenbelagTyp.KEINE_ANGABE;
} else {
return bodenbelag;
}
} }
|
public class class_name {
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public BodenbelagTyp getBodenbelag() {
if (bodenbelag == null) {
return BodenbelagTyp.KEINE_ANGABE; // depends on control dependency: [if], data = [none]
} else {
return bodenbelag; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static void init(final GwAPI gwAPI, GwFacade facade) throws Exception {
////////
// Overall APIs
///////
gwAPI.route(HttpMethods.GET,"/dme2/:service/:version/:envContext/:routeOffer/:path*",API.VOID,new GwCode(facade,"Document API", true) {
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
//TODO cache this...
try {
Locator loc = new DME2Locator(gwAPI.env, gwAPI.dme2Man,
pathParam(req,":service"),
pathParam(req,":version"),
pathParam(req,":envContext"),
pathParam(req,":routeOffer")
);
if(loc.hasItems()) {
Item item = loc.best();
URI uri = (URI) loc.get(item);
String redirectURL = uri.toString() + '/' + pathParam(req,":path");
trans.warn().log("Redirect to",redirectURL);
resp.sendRedirect(redirectURL);
} else {
context.error(trans, resp, Result.err(Result.ERR_NotFound,"%s is not valid",req.getPathInfo()));
}
} catch (LocatorException e) {
context.error(trans, resp, Result.err(Result.ERR_NotFound,"No DME2 Endpoints found for %s",req.getPathInfo()));
}
}
});
} }
|
public class class_name {
public static void init(final GwAPI gwAPI, GwFacade facade) throws Exception {
////////
// Overall APIs
///////
gwAPI.route(HttpMethods.GET,"/dme2/:service/:version/:envContext/:routeOffer/:path*",API.VOID,new GwCode(facade,"Document API", true) {
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
//TODO cache this...
try {
Locator loc = new DME2Locator(gwAPI.env, gwAPI.dme2Man,
pathParam(req,":service"),
pathParam(req,":version"),
pathParam(req,":envContext"),
pathParam(req,":routeOffer")
);
if(loc.hasItems()) {
Item item = loc.best();
URI uri = (URI) loc.get(item);
String redirectURL = uri.toString() + '/' + pathParam(req,":path");
trans.warn().log("Redirect to",redirectURL); // depends on control dependency: [if], data = [none]
resp.sendRedirect(redirectURL); // depends on control dependency: [if], data = [none]
} else {
context.error(trans, resp, Result.err(Result.ERR_NotFound,"%s is not valid",req.getPathInfo())); // depends on control dependency: [if], data = [none]
}
} catch (LocatorException e) {
context.error(trans, resp, Result.err(Result.ERR_NotFound,"No DME2 Endpoints found for %s",req.getPathInfo()));
} // depends on control dependency: [catch], data = [none]
}
});
} }
|
public class class_name {
public static Map<String, Object> getCommonParams(JsonNode paramsNode)
{
Map<String, Object> parameters = new HashMap<>();
for (JsonNode child : paramsNode)
{
// If there isn't a name then the response from GS must be erroneous.
if (!child.hasNonNull("name"))
{
logger.error("Common Parameter JsonNode encountered with "
+ "no parameter name!");
continue;
}
// Look up the parameter based on the "name" attribute of the node.
String paramName = child.path("name").asText();
// What type of value is it and what's the value?
if (!child.hasNonNull("value"))
{
logger.debug("No value found for Common Parameter {}",
child.path("name").asText());
continue;
}
if (STRING_PARAMS.contains(paramName.toUpperCase()))
{
parameters.put(paramName, child.path("value").asText());
}
else if (INT_PARAMS.contains(paramName.toUpperCase()))
{
parameters.put(paramName, child.path("value").asInt());
}
else if (BOOLEAN_PARAMS.contains(paramName.toUpperCase()))
{
parameters.put(paramName, child.path("value").asBoolean());
}
else
{
logger.debug("Unknown Common Parameter: {}", paramName);
}
logger.debug("Parameter {}: {}",
paramName, child.path("value").asText());
}
return parameters;
} }
|
public class class_name {
public static Map<String, Object> getCommonParams(JsonNode paramsNode)
{
Map<String, Object> parameters = new HashMap<>();
for (JsonNode child : paramsNode)
{
// If there isn't a name then the response from GS must be erroneous.
if (!child.hasNonNull("name"))
{
logger.error("Common Parameter JsonNode encountered with "
+ "no parameter name!"); // depends on control dependency: [if], data = [none]
continue;
}
// Look up the parameter based on the "name" attribute of the node.
String paramName = child.path("name").asText();
// What type of value is it and what's the value?
if (!child.hasNonNull("value"))
{
logger.debug("No value found for Common Parameter {}",
child.path("name").asText()); // depends on control dependency: [if], data = [none]
continue;
}
if (STRING_PARAMS.contains(paramName.toUpperCase()))
{
parameters.put(paramName, child.path("value").asText()); // depends on control dependency: [if], data = [none]
}
else if (INT_PARAMS.contains(paramName.toUpperCase()))
{
parameters.put(paramName, child.path("value").asInt()); // depends on control dependency: [if], data = [none]
}
else if (BOOLEAN_PARAMS.contains(paramName.toUpperCase()))
{
parameters.put(paramName, child.path("value").asBoolean()); // depends on control dependency: [if], data = [none]
}
else
{
logger.debug("Unknown Common Parameter: {}", paramName); // depends on control dependency: [if], data = [none]
}
logger.debug("Parameter {}: {}",
paramName, child.path("value").asText()); // depends on control dependency: [for], data = [none]
}
return parameters;
} }
|
public class class_name {
public void assertContains(@Nullable Description description, @Nullable String actual, @Nonnull String sequence) {
checkNotNull(sequence);
assertNotNull(description, actual);
if (!actual.contains(sequence)) {
String format = "expecting:<%s> to contain:<%s>";
throw failures.failure(description, new BasicErrorMessageFactory(format, actual, sequence));
}
} }
|
public class class_name {
public void assertContains(@Nullable Description description, @Nullable String actual, @Nonnull String sequence) {
checkNotNull(sequence);
assertNotNull(description, actual);
if (!actual.contains(sequence)) {
String format = "expecting:<%s> to contain:<%s>"; // depends on control dependency: [if], data = [none]
throw failures.failure(description, new BasicErrorMessageFactory(format, actual, sequence));
}
} }
|
public class class_name {
public boolean execute(Context ctx) throws Exception
{
PropertyImpl property = (PropertyImpl)ctx.get(InvocationContext.CURRENT_ITEM);
NodeImpl parent = getAndValidateParent(property);
Content content = getContent(parent, property, ctx);
try
{
if (!content.isEmpty())
{
Properties props = extractMetaInfoProperties(ctx, content);
setJCRProperties(parent, props);
}
}
catch (HandlerNotFoundException e)
{
LOG.debug("Binary value reader error, content by path " + property.getPath() + ", property id "
+ property.getData().getIdentifier() + " : " + e.getMessage());
}
catch (IOException e)
{
printWarning(property, e);
}
catch (DocumentReadException e)
{
printWarning(property, e);
}
finally
{
content.destroy();
}
return false;
} }
|
public class class_name {
public boolean execute(Context ctx) throws Exception
{
PropertyImpl property = (PropertyImpl)ctx.get(InvocationContext.CURRENT_ITEM);
NodeImpl parent = getAndValidateParent(property);
Content content = getContent(parent, property, ctx);
try
{
if (!content.isEmpty())
{
Properties props = extractMetaInfoProperties(ctx, content);
setJCRProperties(parent, props); // depends on control dependency: [if], data = [none]
}
}
catch (HandlerNotFoundException e)
{
LOG.debug("Binary value reader error, content by path " + property.getPath() + ", property id "
+ property.getData().getIdentifier() + " : " + e.getMessage());
}
catch (IOException e)
{
printWarning(property, e);
}
catch (DocumentReadException e)
{
printWarning(property, e);
}
finally
{
content.destroy();
}
return false;
} }
|
public class class_name {
@Override
protected void visitChildren(ParentSoyNode<?> node) {
for (SoyNode child : node.getChildren()) {
visit(child);
}
} }
|
public class class_name {
@Override
protected void visitChildren(ParentSoyNode<?> node) {
for (SoyNode child : node.getChildren()) {
visit(child); // depends on control dependency: [for], data = [child]
}
} }
|
public class class_name {
public static base_responses delete(nitro_service client, String neighbor[]) throws Exception {
base_responses result = null;
if (neighbor != null && neighbor.length > 0) {
nd6 deleteresources[] = new nd6[neighbor.length];
for (int i=0;i<neighbor.length;i++){
deleteresources[i] = new nd6();
deleteresources[i].neighbor = neighbor[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} }
|
public class class_name {
public static base_responses delete(nitro_service client, String neighbor[]) throws Exception {
base_responses result = null;
if (neighbor != null && neighbor.length > 0) {
nd6 deleteresources[] = new nd6[neighbor.length];
for (int i=0;i<neighbor.length;i++){
deleteresources[i] = new nd6(); // depends on control dependency: [for], data = [i]
deleteresources[i].neighbor = neighbor[i]; // depends on control dependency: [for], data = [i]
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} }
|
public class class_name {
private void switchToForward() {
assert(state == State.ITER_CHECK_BWD ||
(state == State.ITER_IN_FCD_SEGMENT && pos == limit) ||
(state.compareTo(State.IN_NORM_ITER_AT_LIMIT) >= 0 && pos == normalized.length()));
if(state == State.ITER_CHECK_BWD) {
// Turn around from backward checking.
start = pos = iter.getIndex();
if(pos == limit) {
state = State.ITER_CHECK_FWD; // Check forward.
} else { // pos < limit
state = State.ITER_IN_FCD_SEGMENT; // Stay in FCD segment.
}
} else {
// Reached the end of the FCD segment.
if(state == State.ITER_IN_FCD_SEGMENT) {
// The input text segment is FCD, extend it forward.
} else {
// The input text segment needed to be normalized.
// Switch to checking forward from it.
if(state == State.IN_NORM_ITER_AT_START) {
iter.moveIndex(limit - start);
}
start = limit;
}
state = State.ITER_CHECK_FWD;
}
} }
|
public class class_name {
private void switchToForward() {
assert(state == State.ITER_CHECK_BWD ||
(state == State.ITER_IN_FCD_SEGMENT && pos == limit) ||
(state.compareTo(State.IN_NORM_ITER_AT_LIMIT) >= 0 && pos == normalized.length()));
if(state == State.ITER_CHECK_BWD) {
// Turn around from backward checking.
start = pos = iter.getIndex(); // depends on control dependency: [if], data = [none]
if(pos == limit) {
state = State.ITER_CHECK_FWD; // Check forward. // depends on control dependency: [if], data = [none]
} else { // pos < limit
state = State.ITER_IN_FCD_SEGMENT; // Stay in FCD segment. // depends on control dependency: [if], data = [none]
}
} else {
// Reached the end of the FCD segment.
if(state == State.ITER_IN_FCD_SEGMENT) {
// The input text segment is FCD, extend it forward.
} else {
// The input text segment needed to be normalized.
// Switch to checking forward from it.
if(state == State.IN_NORM_ITER_AT_START) {
iter.moveIndex(limit - start); // depends on control dependency: [if], data = [none]
}
start = limit; // depends on control dependency: [if], data = [none]
}
state = State.ITER_CHECK_FWD; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private synchronized PublicKey fetchPublicKey(JsonNode messageJson) {
URI certUrl = URI.create(messageJson.get(SIGNING_CERT_URL).asText());
PublicKey publicKey = certificateCache.get(certUrl.toString());
if (publicKey == null) {
publicKey = createPublicKey(downloadCertWithRetries(certUrl));
certificateCache.add(certUrl.toString(), publicKey);
}
return publicKey;
} }
|
public class class_name {
private synchronized PublicKey fetchPublicKey(JsonNode messageJson) {
URI certUrl = URI.create(messageJson.get(SIGNING_CERT_URL).asText());
PublicKey publicKey = certificateCache.get(certUrl.toString());
if (publicKey == null) {
publicKey = createPublicKey(downloadCertWithRetries(certUrl)); // depends on control dependency: [if], data = [none]
certificateCache.add(certUrl.toString(), publicKey); // depends on control dependency: [if], data = [none]
}
return publicKey;
} }
|
public class class_name {
public void transform( GrayU8 binary )
{
ImageMiscOps.fill(transform, 0);
originX = binary.width/2;
originY = binary.height/2;
r_max = Math.sqrt(originX*originX+originY*originY);
for( int y = 0; y < binary.height; y++ ) {
int start = binary.startIndex + y*binary.stride;
int stop = start + binary.width;
for( int index = start; index < stop; index++ ) {
if( binary.data[index] != 0 ) {
parameterize(index-start,y);
}
}
}
} }
|
public class class_name {
public void transform( GrayU8 binary )
{
ImageMiscOps.fill(transform, 0);
originX = binary.width/2;
originY = binary.height/2;
r_max = Math.sqrt(originX*originX+originY*originY);
for( int y = 0; y < binary.height; y++ ) {
int start = binary.startIndex + y*binary.stride;
int stop = start + binary.width;
for( int index = start; index < stop; index++ ) {
if( binary.data[index] != 0 ) {
parameterize(index-start,y); // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
public void highlightPath(String sitePath) {
openItemsOnPath(sitePath);
CmsSitemapTreeItem item = getTreeItem(sitePath);
if (item != null) {
item.highlightTemporarily(
1500,
isLastPage(item.getSitemapEntry()) ? Background.YELLOW : Background.DEFAULT);
}
} }
|
public class class_name {
public void highlightPath(String sitePath) {
openItemsOnPath(sitePath);
CmsSitemapTreeItem item = getTreeItem(sitePath);
if (item != null) {
item.highlightTemporarily(
1500,
isLastPage(item.getSitemapEntry()) ? Background.YELLOW : Background.DEFAULT); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void marshall(StartKeyPhrasesDetectionJobRequest startKeyPhrasesDetectionJobRequest, ProtocolMarshaller protocolMarshaller) {
if (startKeyPhrasesDetectionJobRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getInputDataConfig(), INPUTDATACONFIG_BINDING);
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getOutputDataConfig(), OUTPUTDATACONFIG_BINDING);
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getDataAccessRoleArn(), DATAACCESSROLEARN_BINDING);
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getJobName(), JOBNAME_BINDING);
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getLanguageCode(), LANGUAGECODE_BINDING);
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getVolumeKmsKeyId(), VOLUMEKMSKEYID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(StartKeyPhrasesDetectionJobRequest startKeyPhrasesDetectionJobRequest, ProtocolMarshaller protocolMarshaller) {
if (startKeyPhrasesDetectionJobRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getInputDataConfig(), INPUTDATACONFIG_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getOutputDataConfig(), OUTPUTDATACONFIG_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getDataAccessRoleArn(), DATAACCESSROLEARN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getJobName(), JOBNAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getLanguageCode(), LANGUAGECODE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(startKeyPhrasesDetectionJobRequest.getVolumeKmsKeyId(), VOLUMEKMSKEYID_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 String getLeftOf(String srcStr, int charCount) {
String retValue = "";
if (isNotBlank(srcStr)) {
int length = srcStr.length();
if (charCount < length) {
retValue = srcStr.substring(0, charCount);
} else {
retValue = srcStr;
}
}
return retValue;
} }
|
public class class_name {
public String getLeftOf(String srcStr, int charCount) {
String retValue = "";
if (isNotBlank(srcStr)) {
int length = srcStr.length();
if (charCount < length) {
retValue = srcStr.substring(0, charCount);
// depends on control dependency: [if], data = [none]
} else {
retValue = srcStr;
// depends on control dependency: [if], data = [none]
}
}
return retValue;
} }
|
public class class_name {
public static final void deleteQuietly(File file)
{
if (file != null)
{
if (file.isDirectory())
{
File[] children = file.listFiles();
if (children != null)
{
for (File child : children)
{
deleteQuietly(child);
}
}
}
file.delete();
}
} }
|
public class class_name {
public static final void deleteQuietly(File file)
{
if (file != null)
{
if (file.isDirectory())
{
File[] children = file.listFiles();
if (children != null)
{
for (File child : children)
{
deleteQuietly(child); // depends on control dependency: [for], data = [child]
}
}
}
file.delete(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void addAttribute(String attributeName, String attributeValue)
{
if (attributeName != null && attributeName.startsWith(JDBC_PROPERTY_NAME_PREFIX))
{
final String jdbcPropertyName = attributeName.substring(JDBC_PROPERTY_NAME_LENGTH);
jdbcProperties.setProperty(jdbcPropertyName, attributeValue);
}
else if (attributeName != null && attributeName.startsWith(DBCP_PROPERTY_NAME_PREFIX))
{
final String dbcpPropertyName = attributeName.substring(DBCP_PROPERTY_NAME_LENGTH);
dbcpProperties.setProperty(dbcpPropertyName, attributeValue);
}
else
{
super.addAttribute(attributeName, attributeValue);
}
} }
|
public class class_name {
public void addAttribute(String attributeName, String attributeValue)
{
if (attributeName != null && attributeName.startsWith(JDBC_PROPERTY_NAME_PREFIX))
{
final String jdbcPropertyName = attributeName.substring(JDBC_PROPERTY_NAME_LENGTH);
jdbcProperties.setProperty(jdbcPropertyName, attributeValue);
// depends on control dependency: [if], data = [none]
}
else if (attributeName != null && attributeName.startsWith(DBCP_PROPERTY_NAME_PREFIX))
{
final String dbcpPropertyName = attributeName.substring(DBCP_PROPERTY_NAME_LENGTH);
dbcpProperties.setProperty(dbcpPropertyName, attributeValue);
// depends on control dependency: [if], data = [none]
}
else
{
super.addAttribute(attributeName, attributeValue);
// depends on control dependency: [if], data = [(attributeName]
}
} }
|
public class class_name {
private boolean validateFuture(Object validationObject, Annotation annotate)
{
if (checkNullObject(validationObject))
{
return true;
}
int res = 0;
if (validationObject.getClass().isAssignableFrom(java.util.Date.class))
{
Date today = new Date();
Date futureDate = (Date) validationObject;
res = futureDate.compareTo(today);
}
else if (validationObject.getClass().isAssignableFrom(java.util.Calendar.class))
{
Calendar cal = Calendar.getInstance();
Calendar futureDate = (Calendar) validationObject;
res = futureDate.compareTo(cal);
}
// else
// {
// //ruleExceptionHandler(((Future) annotate).message());
// throw new RuleValidationException(((Future)
// annotate).message());
// }
if (res <= 0)
{
throwValidationException(((Future) annotate).message());
}
return true;
} }
|
public class class_name {
private boolean validateFuture(Object validationObject, Annotation annotate)
{
if (checkNullObject(validationObject))
{
return true; // depends on control dependency: [if], data = [none]
}
int res = 0;
if (validationObject.getClass().isAssignableFrom(java.util.Date.class))
{
Date today = new Date();
Date futureDate = (Date) validationObject;
res = futureDate.compareTo(today); // depends on control dependency: [if], data = [none]
}
else if (validationObject.getClass().isAssignableFrom(java.util.Calendar.class))
{
Calendar cal = Calendar.getInstance();
Calendar futureDate = (Calendar) validationObject;
res = futureDate.compareTo(cal); // depends on control dependency: [if], data = [none]
}
// else
// {
// //ruleExceptionHandler(((Future) annotate).message());
// throw new RuleValidationException(((Future)
// annotate).message());
// }
if (res <= 0)
{
throwValidationException(((Future) annotate).message()); // depends on control dependency: [if], data = [none]
}
return true;
} }
|
public class class_name {
private void processActivityCodes(Storepoint storepoint)
{
for (Code code : storepoint.getActivityCodes().getCode())
{
int sequence = 0;
for (Value value : code.getValue())
{
UUID uuid = getUUID(value.getUuid(), value.getName());
m_activityCodeValues.put(uuid, value.getName());
m_activityCodeSequence.put(uuid, Integer.valueOf(++sequence));
}
}
} }
|
public class class_name {
private void processActivityCodes(Storepoint storepoint)
{
for (Code code : storepoint.getActivityCodes().getCode())
{
int sequence = 0;
for (Value value : code.getValue())
{
UUID uuid = getUUID(value.getUuid(), value.getName());
m_activityCodeValues.put(uuid, value.getName()); // depends on control dependency: [for], data = [value]
m_activityCodeSequence.put(uuid, Integer.valueOf(++sequence)); // depends on control dependency: [for], data = [value]
}
}
} }
|
public class class_name {
private String preProcessForSpecials(String predicate)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(cclass,
"preProcessForSpecials",
"predicate: " + predicate);
String processed = predicate;
String replace = replaceSpecialsWithSub(predicate);
if (replace != null)
{
processed = replace;
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(this,cclass, "preProcessForSpecials", processed);
return processed;
} }
|
public class class_name {
private String preProcessForSpecials(String predicate)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.entry(cclass,
"preProcessForSpecials",
"predicate: " + predicate);
String processed = predicate;
String replace = replaceSpecialsWithSub(predicate);
if (replace != null)
{
processed = replace; // depends on control dependency: [if], data = [none]
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
tc.exit(this,cclass, "preProcessForSpecials", processed);
return processed;
} }
|
public class class_name {
public void marshall(StringFilter stringFilter, ProtocolMarshaller protocolMarshaller) {
if (stringFilter == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(stringFilter.getValue(), VALUE_BINDING);
protocolMarshaller.marshall(stringFilter.getComparison(), COMPARISON_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(StringFilter stringFilter, ProtocolMarshaller protocolMarshaller) {
if (stringFilter == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(stringFilter.getValue(), VALUE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(stringFilter.getComparison(), COMPARISON_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void onClearGalleries(List<String> galleries) {
if (galleries != null) {
m_galleryDialog.getGalleriesTab().uncheckGalleries(galleries);
}
} }
|
public class class_name {
public void onClearGalleries(List<String> galleries) {
if (galleries != null) {
m_galleryDialog.getGalleriesTab().uncheckGalleries(galleries); // depends on control dependency: [if], data = [(galleries]
}
} }
|
public class class_name {
public StringBuffer prepare(UCharacterIterator src, int options)
throws StringPrepParseException{
// map
StringBuffer mapOut = map(src,options);
StringBuffer normOut = mapOut;// initialize
if(doNFKC){
// normalize
normOut = normalize(mapOut);
}
int ch;
char result;
UCharacterIterator iter = UCharacterIterator.getInstance(normOut);
Values val = new Values();
int direction=UCharacterDirection.CHAR_DIRECTION_COUNT,
firstCharDir=UCharacterDirection.CHAR_DIRECTION_COUNT;
int rtlPos=-1, ltrPos=-1;
boolean rightToLeft=false, leftToRight=false;
while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){
result = getCodePointValue(ch);
getValues(result,val);
if(val.type == PROHIBITED ){
throw new StringPrepParseException("A prohibited code point was found in the input",
StringPrepParseException.PROHIBITED_ERROR,iter.getText(),val.value);
}
if(checkBiDi) {
direction = bdp.getClass(ch);
if(firstCharDir == UCharacterDirection.CHAR_DIRECTION_COUNT){
firstCharDir = direction;
}
if(direction == UCharacterDirection.LEFT_TO_RIGHT){
leftToRight = true;
ltrPos = iter.getIndex()-1;
}
if(direction == UCharacterDirection.RIGHT_TO_LEFT || direction == UCharacterDirection.RIGHT_TO_LEFT_ARABIC){
rightToLeft = true;
rtlPos = iter.getIndex()-1;
}
}
}
if(checkBiDi == true){
// satisfy 2
if( leftToRight == true && rightToLeft == true){
throw new StringPrepParseException("The input does not conform to the rules for BiDi code points.",
StringPrepParseException.CHECK_BIDI_ERROR,iter.getText(),
(rtlPos>ltrPos) ? rtlPos : ltrPos);
}
//satisfy 3
if( rightToLeft == true &&
!((firstCharDir == UCharacterDirection.RIGHT_TO_LEFT || firstCharDir == UCharacterDirection.RIGHT_TO_LEFT_ARABIC) &&
(direction == UCharacterDirection.RIGHT_TO_LEFT || direction == UCharacterDirection.RIGHT_TO_LEFT_ARABIC))
){
throw new StringPrepParseException("The input does not conform to the rules for BiDi code points.",
StringPrepParseException.CHECK_BIDI_ERROR,iter.getText(),
(rtlPos>ltrPos) ? rtlPos : ltrPos);
}
}
return normOut;
} }
|
public class class_name {
public StringBuffer prepare(UCharacterIterator src, int options)
throws StringPrepParseException{
// map
StringBuffer mapOut = map(src,options);
StringBuffer normOut = mapOut;// initialize
if(doNFKC){
// normalize
normOut = normalize(mapOut);
}
int ch;
char result;
UCharacterIterator iter = UCharacterIterator.getInstance(normOut);
Values val = new Values();
int direction=UCharacterDirection.CHAR_DIRECTION_COUNT,
firstCharDir=UCharacterDirection.CHAR_DIRECTION_COUNT;
int rtlPos=-1, ltrPos=-1;
boolean rightToLeft=false, leftToRight=false;
while((ch=iter.nextCodePoint())!= UCharacterIterator.DONE){
result = getCodePointValue(ch);
getValues(result,val);
if(val.type == PROHIBITED ){
throw new StringPrepParseException("A prohibited code point was found in the input",
StringPrepParseException.PROHIBITED_ERROR,iter.getText(),val.value);
}
if(checkBiDi) {
direction = bdp.getClass(ch); // depends on control dependency: [if], data = [none]
if(firstCharDir == UCharacterDirection.CHAR_DIRECTION_COUNT){
firstCharDir = direction; // depends on control dependency: [if], data = [none]
}
if(direction == UCharacterDirection.LEFT_TO_RIGHT){
leftToRight = true; // depends on control dependency: [if], data = [none]
ltrPos = iter.getIndex()-1; // depends on control dependency: [if], data = [none]
}
if(direction == UCharacterDirection.RIGHT_TO_LEFT || direction == UCharacterDirection.RIGHT_TO_LEFT_ARABIC){
rightToLeft = true; // depends on control dependency: [if], data = [none]
rtlPos = iter.getIndex()-1; // depends on control dependency: [if], data = [none]
}
}
}
if(checkBiDi == true){
// satisfy 2
if( leftToRight == true && rightToLeft == true){
throw new StringPrepParseException("The input does not conform to the rules for BiDi code points.",
StringPrepParseException.CHECK_BIDI_ERROR,iter.getText(),
(rtlPos>ltrPos) ? rtlPos : ltrPos);
}
//satisfy 3
if( rightToLeft == true &&
!((firstCharDir == UCharacterDirection.RIGHT_TO_LEFT || firstCharDir == UCharacterDirection.RIGHT_TO_LEFT_ARABIC) &&
(direction == UCharacterDirection.RIGHT_TO_LEFT || direction == UCharacterDirection.RIGHT_TO_LEFT_ARABIC))
){
throw new StringPrepParseException("The input does not conform to the rules for BiDi code points.",
StringPrepParseException.CHECK_BIDI_ERROR,iter.getText(),
(rtlPos>ltrPos) ? rtlPos : ltrPos);
}
}
return normOut;
} }
|
public class class_name {
public static <T extends Resource> T withDefaultType( T resource, Type defaultType)
{
if( resource.getType() == null)
{
resource.setType( defaultType);
}
return resource;
} }
|
public class class_name {
public static <T extends Resource> T withDefaultType( T resource, Type defaultType)
{
if( resource.getType() == null)
{
resource.setType( defaultType); // depends on control dependency: [if], data = [none]
}
return resource;
} }
|
public class class_name {
@Override
public boolean isValid(Object input) {
boolean value;
try {
value = Boolean.parseBoolean(input.toString());
} catch (NumberFormatException e) {
return false;
}
return true;
} }
|
public class class_name {
@Override
public boolean isValid(Object input) {
boolean value;
try {
value = Boolean.parseBoolean(input.toString()); // depends on control dependency: [try], data = [none]
} catch (NumberFormatException e) {
return false;
} // depends on control dependency: [catch], data = [none]
return true;
} }
|
public class class_name {
public CommentsForComparedCommit withComments(Comment... comments) {
if (this.comments == null) {
setComments(new java.util.ArrayList<Comment>(comments.length));
}
for (Comment ele : comments) {
this.comments.add(ele);
}
return this;
} }
|
public class class_name {
public CommentsForComparedCommit withComments(Comment... comments) {
if (this.comments == null) {
setComments(new java.util.ArrayList<Comment>(comments.length)); // depends on control dependency: [if], data = [none]
}
for (Comment ele : comments) {
this.comments.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
private boolean isAllSuitableNodesOffline(R build) {
Label label = getAssignedLabel();
List<Node> allNodes = Jenkins.getInstance().getNodes();
if (label != null) {
//Invalid label. Put in queue to make administrator fix
if(label.getNodes().isEmpty()) {
return false;
}
//Returns true, if all suitable nodes are offline
return label.isOffline();
} else {
if(canRoam) {
for (Node n : Jenkins.getInstance().getNodes()) {
Computer c = n.toComputer();
if (c != null && c.isOnline() && c.isAcceptingTasks() && n.getMode() == Mode.NORMAL) {
// Some executor is online that is ready and this job can run anywhere
return false;
}
}
//We can roam, check that the master is set to be used as much as possible, and not tied jobs only.
return Jenkins.getInstance().getMode() == Mode.EXCLUSIVE;
}
}
return true;
} }
|
public class class_name {
private boolean isAllSuitableNodesOffline(R build) {
Label label = getAssignedLabel();
List<Node> allNodes = Jenkins.getInstance().getNodes();
if (label != null) {
//Invalid label. Put in queue to make administrator fix
if(label.getNodes().isEmpty()) {
return false; // depends on control dependency: [if], data = [none]
}
//Returns true, if all suitable nodes are offline
return label.isOffline(); // depends on control dependency: [if], data = [none]
} else {
if(canRoam) {
for (Node n : Jenkins.getInstance().getNodes()) {
Computer c = n.toComputer();
if (c != null && c.isOnline() && c.isAcceptingTasks() && n.getMode() == Mode.NORMAL) {
// Some executor is online that is ready and this job can run anywhere
return false; // depends on control dependency: [if], data = [none]
}
}
//We can roam, check that the master is set to be used as much as possible, and not tied jobs only.
return Jenkins.getInstance().getMode() == Mode.EXCLUSIVE; // depends on control dependency: [if], data = [none]
}
}
return true;
} }
|
public class class_name {
public void reload() {
Iterator texs = texturesLinear.values().iterator();
while (texs.hasNext()) {
((TextureImpl) texs.next()).reload();
}
texs = texturesNearest.values().iterator();
while (texs.hasNext()) {
((TextureImpl) texs.next()).reload();
}
} }
|
public class class_name {
public void reload() {
Iterator texs = texturesLinear.values().iterator();
while (texs.hasNext()) {
((TextureImpl) texs.next()).reload();
// depends on control dependency: [while], data = [none]
}
texs = texturesNearest.values().iterator();
while (texs.hasNext()) {
((TextureImpl) texs.next()).reload();
// depends on control dependency: [while], data = [none]
}
} }
|
public class class_name {
public Stream<PlainDate> streamWeekBased(
int weekBasedYears,
int isoWeeks,
int days
) {
if ((weekBasedYears < 0) || (isoWeeks < 0) || (days < 0)) {
throw new IllegalArgumentException("Found illegal negative duration component.");
}
final long effYears = weekBasedYears;
final long effDays = 7L * isoWeeks + days;
if ((weekBasedYears == 0) && (effDays == 0)) {
throw new IllegalArgumentException("Cannot create stream with empty duration.");
}
if (this.isEmpty()) {
return Stream.empty();
}
DateInterval interval = this.toCanonical();
PlainDate start = interval.getStartAsCalendarDate();
PlainDate end = interval.getEndAsCalendarDate();
if ((start == null) || (end == null)) {
throw new IllegalStateException("Streaming is not supported for infinite intervals.");
}
if ((effYears == 0) && (effDays == 1)) {
return DateInterval.streamDaily(start, end);
}
long s = start.getDaysSinceEpochUTC();
long e = end.getDaysSinceEpochUTC();
long n = 1 + ((e - s) / (Math.addExact(Math.multiplyExact(effYears, 371), effDays))); // first estimate
PlainDate date;
long size;
do {
size = n;
long y = Math.multiplyExact(effYears, n);
long d = Math.multiplyExact(effDays, n);
date = start.plus(y, Weekcycle.YEARS).plus(d, CalendarUnit.DAYS);
n++;
} while (!date.isAfter(end));
if (size == 1) {
return Stream.of(start); // short-cut
}
return LongStream.range(0, size).mapToObj(
index -> start.plus(effYears * index, Weekcycle.YEARS).plus(effDays * index, CalendarUnit.DAYS));
} }
|
public class class_name {
public Stream<PlainDate> streamWeekBased(
int weekBasedYears,
int isoWeeks,
int days
) {
if ((weekBasedYears < 0) || (isoWeeks < 0) || (days < 0)) {
throw new IllegalArgumentException("Found illegal negative duration component.");
}
final long effYears = weekBasedYears;
final long effDays = 7L * isoWeeks + days;
if ((weekBasedYears == 0) && (effDays == 0)) {
throw new IllegalArgumentException("Cannot create stream with empty duration.");
}
if (this.isEmpty()) {
return Stream.empty(); // depends on control dependency: [if], data = [none]
}
DateInterval interval = this.toCanonical();
PlainDate start = interval.getStartAsCalendarDate();
PlainDate end = interval.getEndAsCalendarDate();
if ((start == null) || (end == null)) {
throw new IllegalStateException("Streaming is not supported for infinite intervals.");
}
if ((effYears == 0) && (effDays == 1)) {
return DateInterval.streamDaily(start, end); // depends on control dependency: [if], data = [none]
}
long s = start.getDaysSinceEpochUTC();
long e = end.getDaysSinceEpochUTC();
long n = 1 + ((e - s) / (Math.addExact(Math.multiplyExact(effYears, 371), effDays))); // first estimate
PlainDate date;
long size;
do {
size = n;
long y = Math.multiplyExact(effYears, n);
long d = Math.multiplyExact(effDays, n);
date = start.plus(y, Weekcycle.YEARS).plus(d, CalendarUnit.DAYS);
n++;
} while (!date.isAfter(end));
if (size == 1) {
return Stream.of(start); // short-cut // depends on control dependency: [if], data = [none]
}
return LongStream.range(0, size).mapToObj(
index -> start.plus(effYears * index, Weekcycle.YEARS).plus(effDays * index, CalendarUnit.DAYS));
} }
|
public class class_name {
@Override
public void addNotify() {
super.addNotify();
float size = Driver.getFontSize();
JMenuBar menubar = getJMenuBar();
if (menubar != null) {
menubar.setFont(menubar.getFont().deriveFont(size));
for (int i = 0; i < menubar.getMenuCount(); i++) {
for (int j = 0; j < menubar.getMenu(i).getMenuComponentCount(); j++) {
Component temp = menubar.getMenu(i).getMenuComponent(j);
temp.setFont(temp.getFont().deriveFont(size));
}
}
mainFrameTree.updateFonts(size);
}
} }
|
public class class_name {
@Override
public void addNotify() {
super.addNotify();
float size = Driver.getFontSize();
JMenuBar menubar = getJMenuBar();
if (menubar != null) {
menubar.setFont(menubar.getFont().deriveFont(size)); // depends on control dependency: [if], data = [(menubar]
for (int i = 0; i < menubar.getMenuCount(); i++) {
for (int j = 0; j < menubar.getMenu(i).getMenuComponentCount(); j++) {
Component temp = menubar.getMenu(i).getMenuComponent(j);
temp.setFont(temp.getFont().deriveFont(size)); // depends on control dependency: [for], data = [none]
}
}
mainFrameTree.updateFonts(size); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public Observable<ServiceResponse<ConnectionMonitorQueryResultInner>> beginQueryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkWatcherName == null) {
throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.");
}
if (connectionMonitorName == null) {
throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2018-08-01";
return service.beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ConnectionMonitorQueryResultInner>>>() {
@Override
public Observable<ServiceResponse<ConnectionMonitorQueryResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ConnectionMonitorQueryResultInner> clientResponse = beginQueryDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<ConnectionMonitorQueryResultInner>> beginQueryWithServiceResponseAsync(String resourceGroupName, String networkWatcherName, String connectionMonitorName) {
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (networkWatcherName == null) {
throw new IllegalArgumentException("Parameter networkWatcherName is required and cannot be null.");
}
if (connectionMonitorName == null) {
throw new IllegalArgumentException("Parameter connectionMonitorName is required and cannot be null.");
}
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
final String apiVersion = "2018-08-01";
return service.beginQuery(resourceGroupName, networkWatcherName, connectionMonitorName, this.client.subscriptionId(), apiVersion, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<ConnectionMonitorQueryResultInner>>>() {
@Override
public Observable<ServiceResponse<ConnectionMonitorQueryResultInner>> call(Response<ResponseBody> response) {
try {
ServiceResponse<ConnectionMonitorQueryResultInner> clientResponse = beginQueryDelegate(response);
return Observable.just(clientResponse); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
return Observable.error(t);
} // depends on control dependency: [catch], data = [none]
}
});
} }
|
public class class_name {
public Javalin stop() {
eventManager.fireEvent(JavalinEvent.SERVER_STOPPING);
log.info("Stopping Javalin ...");
try {
server.server().stop();
} catch (Exception e) {
log.error("Javalin failed to stop gracefully", e);
}
log.info("Javalin has stopped");
eventManager.fireEvent(JavalinEvent.SERVER_STOPPED);
return this;
} }
|
public class class_name {
public Javalin stop() {
eventManager.fireEvent(JavalinEvent.SERVER_STOPPING);
log.info("Stopping Javalin ...");
try {
server.server().stop(); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
log.error("Javalin failed to stop gracefully", e);
} // depends on control dependency: [catch], data = [none]
log.info("Javalin has stopped");
eventManager.fireEvent(JavalinEvent.SERVER_STOPPED);
return this;
} }
|
public class class_name {
public void receiveMessage(MEConnection conn, AbstractMessage aMessage)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "receiveMessage", new Object[] {conn,
aMessage,
"verboseMsg IN : " + aMessage.toVerboseString()});
// Minimal comms trace of the message we've received
if (TraceComponent.isAnyTracingEnabled()) {
MECommsTrc.traceMessage(tc,
_messageProcessor,
aMessage.getGuaranteedSourceMessagingEngineUUID(),
MECommsTrc.OP_RECV,
conn,
aMessage);
}
// Take a read lock to ensure that we can't be stopped while processing a
// message
mpioLockManager.lock();
try
{
if (started)
{
//pass the message on to the RMR
_remoteMessageReciever.receiveMessage(aMessage);
}
else if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "Ignoring message as in stopped state");
}
}
catch(Throwable e)
{
// Anything going wrong in Processor (or below, e.g. MsgStore) shouldn't
// bring the ME-ME connection down. To get an exception through to here
// we must have gone wrong somewhere, i.e. an APAR-kind of event. But even
// so, that's no reason to knobble all ME-to-ME communication, so we swallow
// any exception here, after spitting out an FFDC.
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.io.MPIO.receiveMessage",
"1:228:1.32",
new Object[] {this, aMessage, conn, _messageProcessor.getMessagingEngineName()});
if (e instanceof Exception)
SibTr.exception(tc, (Exception)e);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Exception occurred when processing a message " + e);
// We're not allowed to swallow this exception - let it work its way back to
// Comms
if(e instanceof ThreadDeath)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "receiveMessage", e);
throw (ThreadDeath)e;
}
}
finally
{
mpioLockManager.unlock();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "receiveMessage");
} }
|
public class class_name {
public void receiveMessage(MEConnection conn, AbstractMessage aMessage)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "receiveMessage", new Object[] {conn,
aMessage,
"verboseMsg IN : " + aMessage.toVerboseString()});
// Minimal comms trace of the message we've received
if (TraceComponent.isAnyTracingEnabled()) {
MECommsTrc.traceMessage(tc,
_messageProcessor,
aMessage.getGuaranteedSourceMessagingEngineUUID(),
MECommsTrc.OP_RECV,
conn,
aMessage); // depends on control dependency: [if], data = [none]
}
// Take a read lock to ensure that we can't be stopped while processing a
// message
mpioLockManager.lock();
try
{
if (started)
{
//pass the message on to the RMR
_remoteMessageReciever.receiveMessage(aMessage); // depends on control dependency: [if], data = [none]
}
else if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "Ignoring message as in stopped state"); // depends on control dependency: [if], data = [none]
}
}
catch(Throwable e)
{
// Anything going wrong in Processor (or below, e.g. MsgStore) shouldn't
// bring the ME-ME connection down. To get an exception through to here
// we must have gone wrong somewhere, i.e. an APAR-kind of event. But even
// so, that's no reason to knobble all ME-to-ME communication, so we swallow
// any exception here, after spitting out an FFDC.
FFDCFilter.processException(
e,
"com.ibm.ws.sib.processor.io.MPIO.receiveMessage",
"1:228:1.32",
new Object[] {this, aMessage, conn, _messageProcessor.getMessagingEngineName()});
if (e instanceof Exception)
SibTr.exception(tc, (Exception)e);
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
SibTr.debug(tc, "Exception occurred when processing a message " + e);
// We're not allowed to swallow this exception - let it work its way back to
// Comms
if(e instanceof ThreadDeath)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "receiveMessage", e);
throw (ThreadDeath)e;
}
} // depends on control dependency: [catch], data = [none]
finally
{
mpioLockManager.unlock();
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "receiveMessage");
} }
|
public class class_name {
public MultiTransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {
MultiTransactionStatus mts = new MultiTransactionStatus(transactionManagers.get(0));
if (!synchronizationManager.isSynchronizationActive() && canCreateTransaction(definition)) {
synchronizationManager.initSynchronization();
mts.setNewSynchronization();
}
try {
for (PlatformTransactionManager transactionManager : transactionManagers) {
mts.registerTransactionManager(definition, transactionManager);
}
} catch (Exception ex) {
Map<PlatformTransactionManager, TransactionStatus> transactionStatuses = mts.getTransactionStatuses();
for (PlatformTransactionManager transactionManager : transactionManagers) {
try {
if (transactionStatuses.get(transactionManager) != null) {
transactionManager.rollback(transactionStatuses.get(transactionManager));
}
} catch (Exception ex2) {
LOGGER.warn("Rollback exception (" + transactionManager + ") " + ex2.getMessage(), ex2);
}
}
if (mts.isNewSynchronization()) {
synchronizationManager.clearSynchronization();
}
throw new CannotCreateTransactionException(ex.getMessage(), ex);
}
return mts;
} }
|
public class class_name {
public MultiTransactionStatus getTransaction(TransactionDefinition definition) throws TransactionException {
MultiTransactionStatus mts = new MultiTransactionStatus(transactionManagers.get(0));
if (!synchronizationManager.isSynchronizationActive() && canCreateTransaction(definition)) {
synchronizationManager.initSynchronization();
mts.setNewSynchronization();
}
try {
for (PlatformTransactionManager transactionManager : transactionManagers) {
mts.registerTransactionManager(definition, transactionManager); // depends on control dependency: [for], data = [transactionManager]
}
} catch (Exception ex) {
Map<PlatformTransactionManager, TransactionStatus> transactionStatuses = mts.getTransactionStatuses();
for (PlatformTransactionManager transactionManager : transactionManagers) {
try {
if (transactionStatuses.get(transactionManager) != null) {
transactionManager.rollback(transactionStatuses.get(transactionManager)); // depends on control dependency: [if], data = [(transactionStatuses.get(transactionManager)]
}
} catch (Exception ex2) {
LOGGER.warn("Rollback exception (" + transactionManager + ") " + ex2.getMessage(), ex2);
} // depends on control dependency: [catch], data = [none]
}
if (mts.isNewSynchronization()) {
synchronizationManager.clearSynchronization(); // depends on control dependency: [if], data = [none]
}
throw new CannotCreateTransactionException(ex.getMessage(), ex);
}
return mts;
} }
|
public class class_name {
public static RandomVariable bachelierOptionValue(
RandomVariable forward,
RandomVariable volatility,
double optionMaturity,
double optionStrike,
RandomVariable payoffUnit)
{
if(optionMaturity < 0) {
return forward.mult(0.0);
}
else
{
RandomVariable integratedVolatility = volatility.mult(Math.sqrt(optionMaturity));
RandomVariable dPlus = forward.sub(optionStrike).div(integratedVolatility);
RandomVariable valueAnalytic = dPlus.apply(NormalDistribution::cumulativeDistribution).mult(forward.sub(optionStrike))
.add(dPlus.apply(NormalDistribution::density).mult(integratedVolatility)).mult(payoffUnit);
return valueAnalytic;
}
} }
|
public class class_name {
public static RandomVariable bachelierOptionValue(
RandomVariable forward,
RandomVariable volatility,
double optionMaturity,
double optionStrike,
RandomVariable payoffUnit)
{
if(optionMaturity < 0) {
return forward.mult(0.0); // depends on control dependency: [if], data = [0)]
}
else
{
RandomVariable integratedVolatility = volatility.mult(Math.sqrt(optionMaturity));
RandomVariable dPlus = forward.sub(optionStrike).div(integratedVolatility);
RandomVariable valueAnalytic = dPlus.apply(NormalDistribution::cumulativeDistribution).mult(forward.sub(optionStrike))
.add(dPlus.apply(NormalDistribution::density).mult(integratedVolatility)).mult(payoffUnit);
return valueAnalytic; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static int intersect(Triangle3D_F64 T , LineSegment3D_F64 R , Point3D_F64 output ,
Vector3D_F64 u , Vector3D_F64 v , Vector3D_F64 n,
Vector3D_F64 dir , Vector3D_F64 w0 ) {
double r, a, b; // params to calc ray-plane intersect
// get triangle edge vectors and plane normal
u.minus(T.v1,T.v0); // NOTE: these could be precomputed
v.minus(T.v2,T.v0);
n.cross(u,v);
if ( n.normSq() == 0 ) // triangle is degenerate
return -1; // do not deal with this case
dir.minus(R.b,R.a); // ray direction vector
w0.minus(R.a,T.v0);
a = -n.dot(w0);
b = n.dot(dir);
if (Math.abs(b) < GrlConstants.EPS) { // ray is parallel to triangle plane
if (a == 0) // ray lies in triangle plane
return 2;
else return 0; // ray disjoint from plane
}
// get intersect point of ray with triangle plane
r = a / b;
if (r < 0.0) // ray goes away from triangle
return 0; // => no intersect
else if( r > 1.0 ) // is past the end of the line segment
return 0;
// intersect point of ray and plane
output.x = R.a.x + r*dir.x;
output.y = R.a.y + r*dir.y;
output.z = R.a.z + r*dir.z;
// is I inside T?
if( containedPlane(T.v0,output,u,v,w0)) {
return 1;
} else {
return 0;
}
} }
|
public class class_name {
public static int intersect(Triangle3D_F64 T , LineSegment3D_F64 R , Point3D_F64 output ,
Vector3D_F64 u , Vector3D_F64 v , Vector3D_F64 n,
Vector3D_F64 dir , Vector3D_F64 w0 ) {
double r, a, b; // params to calc ray-plane intersect
// get triangle edge vectors and plane normal
u.minus(T.v1,T.v0); // NOTE: these could be precomputed
v.minus(T.v2,T.v0);
n.cross(u,v);
if ( n.normSq() == 0 ) // triangle is degenerate
return -1; // do not deal with this case
dir.minus(R.b,R.a); // ray direction vector
w0.minus(R.a,T.v0);
a = -n.dot(w0);
b = n.dot(dir);
if (Math.abs(b) < GrlConstants.EPS) { // ray is parallel to triangle plane
if (a == 0) // ray lies in triangle plane
return 2;
else return 0; // ray disjoint from plane
}
// get intersect point of ray with triangle plane
r = a / b;
if (r < 0.0) // ray goes away from triangle
return 0; // => no intersect
else if( r > 1.0 ) // is past the end of the line segment
return 0;
// intersect point of ray and plane
output.x = R.a.x + r*dir.x;
output.y = R.a.y + r*dir.y;
output.z = R.a.z + r*dir.z;
// is I inside T?
if( containedPlane(T.v0,output,u,v,w0)) {
return 1; // depends on control dependency: [if], data = [none]
} else {
return 0; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private boolean validateCredentials() {
LOGGER.debug("Validating credentials for: " + username);
final LdapConnectionWrapper ldap = new LdapConnectionWrapper();
DirContext dirContext = null;
LdapContext ldapContext = null;
try (AlpineQueryManager qm = new AlpineQueryManager()) {
final LdapUser ldapUser = qm.getLdapUser(username);
if (ldapUser != null && ldapUser.getDN() != null && ldapUser.getDN().contains("=")) {
ldapContext = ldap.createLdapContext(ldapUser.getDN(), password);
LOGGER.debug("The supplied credentials are valid for: " + username);
return true;
} else {
dirContext = ldap.createDirContext();
final SearchResult result = ldap.searchForSingleUsername(dirContext, username);
if (result != null ) {
ldapContext = ldap.createLdapContext(result.getNameInNamespace(), password);
LOGGER.debug("The supplied credentials are invalid for: " + username);
return true;
}
}
} catch (NamingException e) {
LOGGER.debug("An error occurred while attempting to validate credentials", e);
} finally {
ldap.closeQuietly(ldapContext);
ldap.closeQuietly(dirContext);
}
return false;
} }
|
public class class_name {
private boolean validateCredentials() {
LOGGER.debug("Validating credentials for: " + username);
final LdapConnectionWrapper ldap = new LdapConnectionWrapper();
DirContext dirContext = null;
LdapContext ldapContext = null;
try (AlpineQueryManager qm = new AlpineQueryManager()) {
final LdapUser ldapUser = qm.getLdapUser(username);
if (ldapUser != null && ldapUser.getDN() != null && ldapUser.getDN().contains("=")) {
ldapContext = ldap.createLdapContext(ldapUser.getDN(), password); // depends on control dependency: [if], data = [(ldapUser]
LOGGER.debug("The supplied credentials are valid for: " + username); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
} else {
dirContext = ldap.createDirContext(); // depends on control dependency: [if], data = [none]
final SearchResult result = ldap.searchForSingleUsername(dirContext, username);
if (result != null ) {
ldapContext = ldap.createLdapContext(result.getNameInNamespace(), password); // depends on control dependency: [if], data = [(result]
LOGGER.debug("The supplied credentials are invalid for: " + username); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
}
} catch (NamingException e) {
LOGGER.debug("An error occurred while attempting to validate credentials", e);
} finally {
ldap.closeQuietly(ldapContext);
ldap.closeQuietly(dirContext);
}
return false;
} }
|
public class class_name {
private static boolean rowContains(final byte[] row,
short offset, final byte[] bytes) {
for (int pos = bytes.length - 1; pos >= 0; pos--) {
if (row[offset + pos] != bytes[pos]) {
return false;
}
}
return true;
} }
|
public class class_name {
private static boolean rowContains(final byte[] row,
short offset, final byte[] bytes) {
for (int pos = bytes.length - 1; pos >= 0; pos--) {
if (row[offset + pos] != bytes[pos]) {
return false; // depends on control dependency: [if], data = [none]
}
}
return true;
} }
|
public class class_name {
@VisibleForTesting
void prepareConcurrentMultiGetTasks() {
multi_get_wait_cnt = 0;
prepare_multi_get_start_time = DateTime.currentTimeMillis();
final List<Long> row_base_time_list;
if (RollupQuery.isValidQuery(rollup_query)) {
row_base_time_list = prepareRowBaseTimesRollup();
} else {
row_base_time_list = prepareRowBaseTimes();
}
int next_concurrency_index = 0;
List<GetRequest> gets_to_prepare = new ArrayList<GetRequest>(batch_size);
Set<byte[]> tsuids = new ByteSet();
final ByteMap<ByteMap<List<GetRequest>>> all_tsuids_gets;
if (multiget_no_meta) {
// prepare the tagvs combinations and base time list
final List<byte[][]> tagv_compinations = prepareAllTagvCompounds();
all_tsuids_gets = prepareRequestsNoMeta(tagv_compinations, row_base_time_list);
} else {
all_tsuids_gets = prepareRequests(row_base_time_list, tags);
}
// Iterate over all salts
for (final Entry<byte[], ByteMap<List<GetRequest>>> salts_entry : all_tsuids_gets.entrySet()) {
if (gets_to_prepare.size() > 0) { // if we have any gets_to_prepare for previous salt, create a
// request out of it.
final MultiGetTask task = new MultiGetTask(tsuids, gets_to_prepare);
final List<MultiGetTask> mulget_task_list =
multi_get_tasks.get((next_concurrency_index++) % concurrency_multi_get);
mulget_task_list.add(task);
++multi_get_wait_cnt;
multi_get_num_get_requests = multi_get_num_get_requests + gets_to_prepare.size();
gets_to_prepare = new ArrayList<GetRequest>(batch_size);
tsuids = new ByteSet();
}
byte[] curr_salt = salts_entry.getKey();
// Iterate over all tsuid's in curr_salt and add them to gets_to_prepare
for (final Entry<byte[], List<GetRequest>> gets_entry : salts_entry.getValue()) {
byte[] tsuid = gets_entry.getKey();
for (GetRequest request : gets_entry.getValue()) {
if (gets_to_prepare.size() >= batch_size) { // close batch and create a MultiGetTask
final MultiGetTask task = new MultiGetTask(tsuids, gets_to_prepare);
final List<MultiGetTask> mulget_task_list =
multi_get_tasks.get((next_concurrency_index++) % concurrency_multi_get);
mulget_task_list.add(task);
++multi_get_wait_cnt;
multi_get_num_get_requests = multi_get_num_get_requests + gets_to_prepare.size();
if (LOG.isDebugEnabled()) {
LOG.debug("Finished preparing MultiGetRequest with " + gets_to_prepare.size() + " requests for salt " + curr_salt +
" for tsuid " + Bytes.pretty(tsuid));
}
// prepare a new task list and tsuids
gets_to_prepare = new ArrayList<GetRequest>(batch_size);
tsuids = new ByteSet();
}
gets_to_prepare.add(request);
tsuids.add(gets_entry.getKey());
}
tsuids.add(gets_entry.getKey());
}
}
if (gets_to_prepare.size() > 0) {
final MultiGetTask task = new MultiGetTask(tsuids, gets_to_prepare);
final List<MultiGetTask> mulget_task_list =
multi_get_tasks.get((next_concurrency_index++) % concurrency_multi_get);
mulget_task_list.add(task);
++multi_get_wait_cnt;
multi_get_num_get_requests = multi_get_num_get_requests + gets_to_prepare.size();
LOG.debug("Finished preparing MultiGetRequest with " + gets_to_prepare.size());
gets_to_prepare = new ArrayList<GetRequest>(batch_size);
tsuids = new ByteSet();
}
prepare_multi_get_end_time = DateTime.currentTimeMillis();
if (LOG.isDebugEnabled()) {
LOG.debug("Finished preparing concurrency multi get task with "
+ multi_get_wait_cnt + " tasks using "
+ (prepare_multi_get_end_time - prepare_multi_get_start_time) + "ms");
}
} }
|
public class class_name {
@VisibleForTesting
void prepareConcurrentMultiGetTasks() {
multi_get_wait_cnt = 0;
prepare_multi_get_start_time = DateTime.currentTimeMillis();
final List<Long> row_base_time_list;
if (RollupQuery.isValidQuery(rollup_query)) {
row_base_time_list = prepareRowBaseTimesRollup(); // depends on control dependency: [if], data = [none]
} else {
row_base_time_list = prepareRowBaseTimes(); // depends on control dependency: [if], data = [none]
}
int next_concurrency_index = 0;
List<GetRequest> gets_to_prepare = new ArrayList<GetRequest>(batch_size);
Set<byte[]> tsuids = new ByteSet();
final ByteMap<ByteMap<List<GetRequest>>> all_tsuids_gets;
if (multiget_no_meta) {
// prepare the tagvs combinations and base time list
final List<byte[][]> tagv_compinations = prepareAllTagvCompounds();
all_tsuids_gets = prepareRequestsNoMeta(tagv_compinations, row_base_time_list); // depends on control dependency: [if], data = [none]
} else {
all_tsuids_gets = prepareRequests(row_base_time_list, tags); // depends on control dependency: [if], data = [none]
}
// Iterate over all salts
for (final Entry<byte[], ByteMap<List<GetRequest>>> salts_entry : all_tsuids_gets.entrySet()) {
if (gets_to_prepare.size() > 0) { // if we have any gets_to_prepare for previous salt, create a
// request out of it.
final MultiGetTask task = new MultiGetTask(tsuids, gets_to_prepare);
final List<MultiGetTask> mulget_task_list =
multi_get_tasks.get((next_concurrency_index++) % concurrency_multi_get);
mulget_task_list.add(task); // depends on control dependency: [if], data = [none]
++multi_get_wait_cnt; // depends on control dependency: [if], data = [none]
multi_get_num_get_requests = multi_get_num_get_requests + gets_to_prepare.size(); // depends on control dependency: [if], data = [none]
gets_to_prepare = new ArrayList<GetRequest>(batch_size); // depends on control dependency: [if], data = [none]
tsuids = new ByteSet(); // depends on control dependency: [if], data = [none]
}
byte[] curr_salt = salts_entry.getKey();
// Iterate over all tsuid's in curr_salt and add them to gets_to_prepare
for (final Entry<byte[], List<GetRequest>> gets_entry : salts_entry.getValue()) {
byte[] tsuid = gets_entry.getKey();
for (GetRequest request : gets_entry.getValue()) {
if (gets_to_prepare.size() >= batch_size) { // close batch and create a MultiGetTask
final MultiGetTask task = new MultiGetTask(tsuids, gets_to_prepare);
final List<MultiGetTask> mulget_task_list =
multi_get_tasks.get((next_concurrency_index++) % concurrency_multi_get);
mulget_task_list.add(task); // depends on control dependency: [if], data = [none]
++multi_get_wait_cnt; // depends on control dependency: [if], data = [none]
multi_get_num_get_requests = multi_get_num_get_requests + gets_to_prepare.size(); // depends on control dependency: [if], data = [none]
if (LOG.isDebugEnabled()) {
LOG.debug("Finished preparing MultiGetRequest with " + gets_to_prepare.size() + " requests for salt " + curr_salt +
" for tsuid " + Bytes.pretty(tsuid)); // depends on control dependency: [if], data = [none]
}
// prepare a new task list and tsuids
gets_to_prepare = new ArrayList<GetRequest>(batch_size); // depends on control dependency: [if], data = [none]
tsuids = new ByteSet(); // depends on control dependency: [if], data = [none]
}
gets_to_prepare.add(request); // depends on control dependency: [for], data = [request]
tsuids.add(gets_entry.getKey()); // depends on control dependency: [for], data = [none]
}
tsuids.add(gets_entry.getKey()); // depends on control dependency: [for], data = [gets_entry]
}
}
if (gets_to_prepare.size() > 0) {
final MultiGetTask task = new MultiGetTask(tsuids, gets_to_prepare);
final List<MultiGetTask> mulget_task_list =
multi_get_tasks.get((next_concurrency_index++) % concurrency_multi_get);
mulget_task_list.add(task); // depends on control dependency: [if], data = [none]
++multi_get_wait_cnt; // depends on control dependency: [if], data = [none]
multi_get_num_get_requests = multi_get_num_get_requests + gets_to_prepare.size(); // depends on control dependency: [if], data = [none]
LOG.debug("Finished preparing MultiGetRequest with " + gets_to_prepare.size()); // depends on control dependency: [if], data = [none]
gets_to_prepare = new ArrayList<GetRequest>(batch_size); // depends on control dependency: [if], data = [none]
tsuids = new ByteSet(); // depends on control dependency: [if], data = [none]
}
prepare_multi_get_end_time = DateTime.currentTimeMillis();
if (LOG.isDebugEnabled()) {
LOG.debug("Finished preparing concurrency multi get task with "
+ multi_get_wait_cnt + " tasks using "
+ (prepare_multi_get_end_time - prepare_multi_get_start_time) + "ms"); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static final void clearRemaining(ByteBuffer bb)
{
if (bb.hasArray())
{
Arrays.fill(bb.array(), bb.arrayOffset()+bb.position(), bb.arrayOffset()+bb.limit(), (byte)0);
}
else
{
int limit = bb.limit();
for (int ii=bb.position();ii<limit;ii++)
{
bb.put(ii, (byte)0);
}
}
} }
|
public class class_name {
public static final void clearRemaining(ByteBuffer bb)
{
if (bb.hasArray())
{
Arrays.fill(bb.array(), bb.arrayOffset()+bb.position(), bb.arrayOffset()+bb.limit(), (byte)0);
// depends on control dependency: [if], data = [none]
}
else
{
int limit = bb.limit();
for (int ii=bb.position();ii<limit;ii++)
{
bb.put(ii, (byte)0);
// depends on control dependency: [for], data = [ii]
}
}
} }
|
public class class_name {
protected String removeControlChars(String content) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(content)) {
// to avoid later null pointer exceptions an empty String is returned
return "";
}
char[] chars = content.toCharArray();
StringBuffer result = new StringBuffer(chars.length);
boolean wasUnwanted = false;
for (int i = 0; i < chars.length; i++) {
char ch = chars[i];
int type = Character.getType(ch);
switch (type) {
// punctuation
case Character.CURRENCY_SYMBOL:
case Character.CONNECTOR_PUNCTUATION:
case Character.FINAL_QUOTE_PUNCTUATION:
case Character.INITIAL_QUOTE_PUNCTUATION:
case Character.DASH_PUNCTUATION:
case Character.START_PUNCTUATION:
case Character.END_PUNCTUATION:
case Character.OTHER_PUNCTUATION:
// letters
case Character.OTHER_LETTER:
case Character.MODIFIER_LETTER:
case Character.UPPERCASE_LETTER:
case Character.TITLECASE_LETTER:
case Character.LOWERCASE_LETTER:
// digits
case Character.DECIMAL_DIGIT_NUMBER:
// spaces
case Character.SPACE_SEPARATOR:
result.append(ch);
wasUnwanted = false;
break;
// line separators
case Character.LINE_SEPARATOR:
result.append('\n');
wasUnwanted = true;
break;
// symbols
case Character.MATH_SYMBOL:
case Character.OTHER_SYMBOL:
// other stuff:
case Character.CONTROL:
case Character.COMBINING_SPACING_MARK:
case Character.ENCLOSING_MARK:
case Character.FORMAT:
case Character.LETTER_NUMBER:
case Character.MODIFIER_SYMBOL:
case Character.NON_SPACING_MARK:
case Character.PARAGRAPH_SEPARATOR:
case Character.PRIVATE_USE:
case Character.SURROGATE:
case Character.UNASSIGNED:
case Character.OTHER_NUMBER:
default:
if (!wasUnwanted) {
result.append('\n');
wasUnwanted = true;
}
}
}
return result.toString();
} }
|
public class class_name {
protected String removeControlChars(String content) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(content)) {
// to avoid later null pointer exceptions an empty String is returned
return ""; // depends on control dependency: [if], data = [none]
}
char[] chars = content.toCharArray();
StringBuffer result = new StringBuffer(chars.length);
boolean wasUnwanted = false;
for (int i = 0; i < chars.length; i++) {
char ch = chars[i];
int type = Character.getType(ch);
switch (type) {
// punctuation
case Character.CURRENCY_SYMBOL:
case Character.CONNECTOR_PUNCTUATION:
case Character.FINAL_QUOTE_PUNCTUATION:
case Character.INITIAL_QUOTE_PUNCTUATION:
case Character.DASH_PUNCTUATION:
case Character.START_PUNCTUATION:
case Character.END_PUNCTUATION:
case Character.OTHER_PUNCTUATION:
// letters
case Character.OTHER_LETTER:
case Character.MODIFIER_LETTER:
case Character.UPPERCASE_LETTER:
case Character.TITLECASE_LETTER:
case Character.LOWERCASE_LETTER:
// digits
case Character.DECIMAL_DIGIT_NUMBER:
// spaces
case Character.SPACE_SEPARATOR:
result.append(ch);
wasUnwanted = false;
break;
// line separators
case Character.LINE_SEPARATOR:
result.append('\n');
wasUnwanted = true;
break;
// symbols
case Character.MATH_SYMBOL:
case Character.OTHER_SYMBOL:
// other stuff:
case Character.CONTROL:
case Character.COMBINING_SPACING_MARK:
case Character.ENCLOSING_MARK:
case Character.FORMAT:
case Character.LETTER_NUMBER:
case Character.MODIFIER_SYMBOL:
case Character.NON_SPACING_MARK:
case Character.PARAGRAPH_SEPARATOR:
case Character.PRIVATE_USE:
case Character.SURROGATE:
case Character.UNASSIGNED:
case Character.OTHER_NUMBER:
default:
if (!wasUnwanted) {
result.append('\n'); // depends on control dependency: [if], data = [none]
wasUnwanted = true; // depends on control dependency: [if], data = [none]
}
}
}
return result.toString();
} }
|
public class class_name {
public Integer getHeight() {
final Object result = getStateHelper().eval(PropertyKeys.height);
if (result == null) {
return null;
}
// this will handle any type so long as its convertable to integer
return Integer.valueOf(result.toString());
} }
|
public class class_name {
public Integer getHeight() {
final Object result = getStateHelper().eval(PropertyKeys.height);
if (result == null) {
return null; // depends on control dependency: [if], data = [none]
}
// this will handle any type so long as its convertable to integer
return Integer.valueOf(result.toString());
} }
|
public class class_name {
public IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac) {
List atoms = ac.getConnectedAtomsList(atomA);
IAtom atom = null;
for (int i = 0; i < atoms.size(); i++) {
IAtom curAtom = (IAtom) atoms.get(i);
if (curAtom.getFlag(CDKConstants.ISPLACED) && !curAtom.getSymbol().equals("H") && !Objects.equals(curAtom, atomB)) {
return curAtom;
}
}
return atom;
} }
|
public class class_name {
public IAtom getPlacedHeavyAtomInAtomContainer(IAtom atomA, IAtom atomB, IAtomContainer ac) {
List atoms = ac.getConnectedAtomsList(atomA);
IAtom atom = null;
for (int i = 0; i < atoms.size(); i++) {
IAtom curAtom = (IAtom) atoms.get(i);
if (curAtom.getFlag(CDKConstants.ISPLACED) && !curAtom.getSymbol().equals("H") && !Objects.equals(curAtom, atomB)) {
return curAtom; // depends on control dependency: [if], data = [none]
}
}
return atom;
} }
|
public class class_name {
public String parse( String repoName )
{
String prefix = null;
if ( repoName.startsWith( KOJI_BINARY_ ) )
{
prefix = KOJI_BINARY_;
}
else if ( repoName.startsWith( KOJI_ ) )
{
prefix = KOJI_;
}
if ( prefix != null )
{
return repoName.substring( prefix.length() );
}
return null;
} }
|
public class class_name {
public String parse( String repoName )
{
String prefix = null;
if ( repoName.startsWith( KOJI_BINARY_ ) )
{
prefix = KOJI_BINARY_; // depends on control dependency: [if], data = [none]
}
else if ( repoName.startsWith( KOJI_ ) )
{
prefix = KOJI_; // depends on control dependency: [if], data = [none]
}
if ( prefix != null )
{
return repoName.substring( prefix.length() ); // depends on control dependency: [if], data = [( prefix]
}
return null;
} }
|
public class class_name {
private void writeRequest(final NextFilter nextFilter,
final SocksProxyRequest request, int step) {
try {
IoBuffer buf = null;
if (step == SocksProxyConstants.SOCKS5_GREETING_STEP) {
buf = encodeInitialGreetingPacket(request);
} else if (step == SocksProxyConstants.SOCKS5_AUTH_STEP) {
// This step can happen multiple times like in GSSAPI auth for instance
buf = encodeAuthenticationPacket(request);
// If buf is null then go to the next step
if (buf == null) {
step = SocksProxyConstants.SOCKS5_REQUEST_STEP;
}
}
if (step == SocksProxyConstants.SOCKS5_REQUEST_STEP) {
buf = encodeProxyRequestPacket(request);
}
buf.flip();
writeData(nextFilter, buf);
} catch (Exception ex) {
closeSession("Unable to send Socks request: ", ex);
}
} }
|
public class class_name {
private void writeRequest(final NextFilter nextFilter,
final SocksProxyRequest request, int step) {
try {
IoBuffer buf = null;
if (step == SocksProxyConstants.SOCKS5_GREETING_STEP) {
buf = encodeInitialGreetingPacket(request); // depends on control dependency: [if], data = [none]
} else if (step == SocksProxyConstants.SOCKS5_AUTH_STEP) {
// This step can happen multiple times like in GSSAPI auth for instance
buf = encodeAuthenticationPacket(request); // depends on control dependency: [if], data = [none]
// If buf is null then go to the next step
if (buf == null) {
step = SocksProxyConstants.SOCKS5_REQUEST_STEP; // depends on control dependency: [if], data = [none]
}
}
if (step == SocksProxyConstants.SOCKS5_REQUEST_STEP) {
buf = encodeProxyRequestPacket(request); // depends on control dependency: [if], data = [none]
}
buf.flip(); // depends on control dependency: [try], data = [none]
writeData(nextFilter, buf); // depends on control dependency: [try], data = [none]
} catch (Exception ex) {
closeSession("Unable to send Socks request: ", ex);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public PrivateKey bytesToPrivateKey(byte[] pemKey) throws CryptoException {
PrivateKey pk = null;
CryptoException ce = null;
try {
PemReader pr = new PemReader(new StringReader(new String(pemKey)));
PemObject po = pr.readPemObject();
PEMParser pem = new PEMParser(new StringReader(new String(pemKey)));
if (po.getType().equals("PRIVATE KEY")) {
pk = new JcaPEMKeyConverter().getPrivateKey((PrivateKeyInfo) pem.readObject());
} else {
logger.trace("Found private key with type " + po.getType());
PEMKeyPair kp = (PEMKeyPair) pem.readObject();
pk = new JcaPEMKeyConverter().getPrivateKey(kp.getPrivateKeyInfo());
}
} catch (Exception e) {
throw new CryptoException("Failed to convert private key bytes", e);
}
return pk;
} }
|
public class class_name {
public PrivateKey bytesToPrivateKey(byte[] pemKey) throws CryptoException {
PrivateKey pk = null;
CryptoException ce = null;
try {
PemReader pr = new PemReader(new StringReader(new String(pemKey)));
PemObject po = pr.readPemObject();
PEMParser pem = new PEMParser(new StringReader(new String(pemKey)));
if (po.getType().equals("PRIVATE KEY")) {
pk = new JcaPEMKeyConverter().getPrivateKey((PrivateKeyInfo) pem.readObject()); // depends on control dependency: [if], data = [none]
} else {
logger.trace("Found private key with type " + po.getType()); // depends on control dependency: [if], data = [none]
PEMKeyPair kp = (PEMKeyPair) pem.readObject();
pk = new JcaPEMKeyConverter().getPrivateKey(kp.getPrivateKeyInfo()); // depends on control dependency: [if], data = [none]
}
} catch (Exception e) {
throw new CryptoException("Failed to convert private key bytes", e);
}
return pk;
} }
|
public class class_name {
@PluginFactory
public static PaxOsgiAppender createAppender(
// @formatter:off
@PluginAttribute("name") final String name,
@PluginAttribute("filter") final String filter,
@PluginConfiguration final Configuration config) {
// @formatter:on
if (name == null) {
StatusLogger.getLogger().error("No name provided for PaxOsgiAppender");
return null;
}
return new PaxOsgiAppender(name, filter);
} }
|
public class class_name {
@PluginFactory
public static PaxOsgiAppender createAppender(
// @formatter:off
@PluginAttribute("name") final String name,
@PluginAttribute("filter") final String filter,
@PluginConfiguration final Configuration config) {
// @formatter:on
if (name == null) {
StatusLogger.getLogger().error("No name provided for PaxOsgiAppender"); // depends on control dependency: [if], data = [none]
return null; // depends on control dependency: [if], data = [none]
}
return new PaxOsgiAppender(name, filter);
} }
|
public class class_name {
private static ParsedLine extractCommandArguments(final ParsedLine line) {
// copy the list, so we can mutate and pop the first item off
LinkedList<String> words = Lists.newLinkedList(line.words());
String remove = words.pop();
String rawLine = line.line();
// rebuild that list sans the first argument
if (remove.length() > rawLine.length()) {
return new DefaultParser.ArgumentList(
rawLine.substring(remove.length() + 1, rawLine.length()),
words,
line.wordIndex() - 1,
line.wordCursor(),
line.cursor() - remove.length() + 1
);
}
else {
return new DefaultParser.ArgumentList("", Collections.emptyList(), 0, 0, 0);
}
} }
|
public class class_name {
private static ParsedLine extractCommandArguments(final ParsedLine line) {
// copy the list, so we can mutate and pop the first item off
LinkedList<String> words = Lists.newLinkedList(line.words());
String remove = words.pop();
String rawLine = line.line();
// rebuild that list sans the first argument
if (remove.length() > rawLine.length()) {
return new DefaultParser.ArgumentList(
rawLine.substring(remove.length() + 1, rawLine.length()),
words,
line.wordIndex() - 1,
line.wordCursor(),
line.cursor() - remove.length() + 1
); // depends on control dependency: [if], data = [none]
}
else {
return new DefaultParser.ArgumentList("", Collections.emptyList(), 0, 0, 0); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public final void mLIKE() throws RecognitionException {
try {
int _type = LIKE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// druidG.g:643:6: ( ( 'LIKE' | 'like' ) )
// druidG.g:643:8: ( 'LIKE' | 'like' )
{
// druidG.g:643:8: ( 'LIKE' | 'like' )
int alt31=2;
int LA31_0 = input.LA(1);
if ( (LA31_0=='L') ) {
alt31=1;
}
else if ( (LA31_0=='l') ) {
alt31=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 31, 0, input);
throw nvae;
}
switch (alt31) {
case 1 :
// druidG.g:643:9: 'LIKE'
{
match("LIKE");
}
break;
case 2 :
// druidG.g:643:18: 'like'
{
match("like");
}
break;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
} }
|
public class class_name {
public final void mLIKE() throws RecognitionException {
try {
int _type = LIKE;
int _channel = DEFAULT_TOKEN_CHANNEL;
// druidG.g:643:6: ( ( 'LIKE' | 'like' ) )
// druidG.g:643:8: ( 'LIKE' | 'like' )
{
// druidG.g:643:8: ( 'LIKE' | 'like' )
int alt31=2;
int LA31_0 = input.LA(1);
if ( (LA31_0=='L') ) {
alt31=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA31_0=='l') ) {
alt31=2; // depends on control dependency: [if], data = [none]
}
else {
NoViableAltException nvae =
new NoViableAltException("", 31, 0, input);
throw nvae;
}
switch (alt31) {
case 1 :
// druidG.g:643:9: 'LIKE'
{
match("LIKE");
}
break;
case 2 :
// druidG.g:643:18: 'like'
{
match("like");
}
break;
}
}
state.type = _type;
state.channel = _channel;
}
finally {
// do for sure before leaving
}
} }
|
public class class_name {
private void parseThrowIOEForInboundConnections(Map<?, ?> props) {
//PI57542
Object value = props.get(HttpConfigConstants.PROPNAME_THROW_IOE_FOR_INBOUND_CONNECTIONS);
if (null != value) {
this.throwIOEForInboundConnections = convertBoolean(value);
if ((TraceComponent.isAnyTracingEnabled()) && (tc.isEventEnabled())) {
Tr.event(tc, "Config: ThrowIOEForInboundConnections is " + throwIOEForInboundConnections());
}
}
} }
|
public class class_name {
private void parseThrowIOEForInboundConnections(Map<?, ?> props) {
//PI57542
Object value = props.get(HttpConfigConstants.PROPNAME_THROW_IOE_FOR_INBOUND_CONNECTIONS);
if (null != value) {
this.throwIOEForInboundConnections = convertBoolean(value); // depends on control dependency: [if], data = [value)]
if ((TraceComponent.isAnyTracingEnabled()) && (tc.isEventEnabled())) {
Tr.event(tc, "Config: ThrowIOEForInboundConnections is " + throwIOEForInboundConnections()); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public void setPaths(String... paths) {
clear();
try {
List<NutResource> list = getResources(paths);
if (utf8)
for (NutResource nr : list) {
if (log.isDebugEnabled())
log.debug("load properties from " + nr);
Reader r = nr.getReader();
try {
load(nr.getReader(), false);
}
finally {
Streams.safeClose(r);
}
}
else {
Properties p = new Properties();
for (NutResource nr : list) {
// 用字符流来读取文件
BufferedReader bf = new BufferedReader(new InputStreamReader(nr.getInputStream()));
try {
p.load(bf);
}
finally {
Streams.safeClose(bf);
}
}
putAll(p);
}
}
catch (IOException e) {
throw Lang.wrapThrow(e);
}
} }
|
public class class_name {
public void setPaths(String... paths) {
clear();
try {
List<NutResource> list = getResources(paths);
if (utf8)
for (NutResource nr : list) {
if (log.isDebugEnabled())
log.debug("load properties from " + nr);
Reader r = nr.getReader();
try {
load(nr.getReader(), false);
// depends on control dependency: [try], data = [none]
}
finally {
Streams.safeClose(r);
}
}
else {
Properties p = new Properties();
for (NutResource nr : list) {
// 用字符流来读取文件
BufferedReader bf = new BufferedReader(new InputStreamReader(nr.getInputStream()));
try {
p.load(bf);
// depends on control dependency: [try], data = [none]
}
finally {
Streams.safeClose(bf);
}
}
putAll(p);
// depends on control dependency: [if], data = [none]
}
}
catch (IOException e) {
throw Lang.wrapThrow(e);
}
// depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private void resolveAlias(Alias alias) throws MalformedAliasException, UnresolvedAliasException
{
//Get the crucial stuff out of the Alias
String name = alias.getEncodedName();
String attribute = alias.getAliasedToAttributeFieldAsClearString();
if (Debug.isSet("DDS.resolveAliases")) {
DAPNode.log.debug("\n\nFound: Alias " + name +
" " + attribute);
}
// The Attribute field MAY NOT be empty.
if (attribute.equals("")) {
throw new MalformedAliasException("The attribute 'attribute' in the Alias " +
"element (name: '" + name + "') must have a value other than an empty string.");
}
if (Debug.isSet("DDS.resolveAliases")) {
DAPNode.log.debug("Attribute: `" + attribute + "'");
}
// Tokenize the attribute field.
Vector aNames = tokenizeAliasField(attribute);
if (Debug.isSet("DDS.resolveAliases")) {
DAPNode.log.debug("Attribute name tokenized to " + aNames.size() + " elements");
Enumeration e = aNames.elements();
while (e.hasMoreElements()) {
String aname = (String) e.nextElement();
DAPNode.log.debug("name: " + aname);
}
}
// The variable reference is the first part of the attribute field.
// Let's go find it...
BaseType targetBT = null;
// Absolute paths for attributes names must start with the dot character.
boolean isAbsolutePath = aNames.get(0).equals(".");
if (!isAbsolutePath) { //Is it not an absolute path?
throw new MalformedAliasException("In the Alias '" + name + "'" +
" the value of the attribute 'attribute' does not begin with the character dot (.). " +
"The value of the 'attribute' field must always be an absolute path name from the " +
"top level of the variable reference, and thus must always begin with the dot (.) character.");
}
if (aNames.size() == 1) { // Is it only a dot?
throw new MalformedAliasException("In the Alias '" + name + "'" +
" the value of the attribute 'attribute' contains only the character dot (.). " +
"The value of the 'attribute' field must always reference an Attribute using an absolute path name from the " +
"top level of the DAS, and must reference an attribute within the DAS. A simple dot is not allowed.");
}
aNames.remove(0); // Remove the first token, which by now we know is a single dot.
targetBT = getDeepestMatchingVariable(this, aNames);
if (targetBT == null) { // No matching BaseType?
// Then assume the attribute field references a
// top (Dataset) level Attribute.
targetBT = this;
}
//LogStream.out.println("Alias references variable: ."+targetBT.getLongName());
// Now that we have found a target BaseType variable that matches the reference in
// the variable field of the Alias (b.t.w. that's a good thing) let's go
// see if we can find an Attribute within that targetBT that matches the attribute field
// in the Alias decleration.
Attribute targetAT = null;
if (aNames.size() == 0) {
// If there are no remaining tokens in the attribute field then
// we are referencing the attribute container of the targetBT.
targetAT = targetBT.getAttribute();
} else {
// Go try to find the Attribute in the targetBT.
targetAT = getAttribute(targetBT.getAttributeTable(), aNames);
}
alias.setMyVariable(targetBT);
alias.setMyAttribute(targetAT);
} }
|
public class class_name {
private void resolveAlias(Alias alias) throws MalformedAliasException, UnresolvedAliasException
{
//Get the crucial stuff out of the Alias
String name = alias.getEncodedName();
String attribute = alias.getAliasedToAttributeFieldAsClearString();
if (Debug.isSet("DDS.resolveAliases")) {
DAPNode.log.debug("\n\nFound: Alias " + name +
" " + attribute);
}
// The Attribute field MAY NOT be empty.
if (attribute.equals("")) {
throw new MalformedAliasException("The attribute 'attribute' in the Alias " +
"element (name: '" + name + "') must have a value other than an empty string.");
}
if (Debug.isSet("DDS.resolveAliases")) {
DAPNode.log.debug("Attribute: `" + attribute + "'");
}
// Tokenize the attribute field.
Vector aNames = tokenizeAliasField(attribute);
if (Debug.isSet("DDS.resolveAliases")) {
DAPNode.log.debug("Attribute name tokenized to " + aNames.size() + " elements");
Enumeration e = aNames.elements();
while (e.hasMoreElements()) {
String aname = (String) e.nextElement();
DAPNode.log.debug("name: " + aname); // depends on control dependency: [while], data = [none]
}
}
// The variable reference is the first part of the attribute field.
// Let's go find it...
BaseType targetBT = null;
// Absolute paths for attributes names must start with the dot character.
boolean isAbsolutePath = aNames.get(0).equals(".");
if (!isAbsolutePath) { //Is it not an absolute path?
throw new MalformedAliasException("In the Alias '" + name + "'" +
" the value of the attribute 'attribute' does not begin with the character dot (.). " +
"The value of the 'attribute' field must always be an absolute path name from the " +
"top level of the variable reference, and thus must always begin with the dot (.) character.");
}
if (aNames.size() == 1) { // Is it only a dot?
throw new MalformedAliasException("In the Alias '" + name + "'" +
" the value of the attribute 'attribute' contains only the character dot (.). " +
"The value of the 'attribute' field must always reference an Attribute using an absolute path name from the " +
"top level of the DAS, and must reference an attribute within the DAS. A simple dot is not allowed.");
}
aNames.remove(0); // Remove the first token, which by now we know is a single dot.
targetBT = getDeepestMatchingVariable(this, aNames);
if (targetBT == null) { // No matching BaseType?
// Then assume the attribute field references a
// top (Dataset) level Attribute.
targetBT = this;
}
//LogStream.out.println("Alias references variable: ."+targetBT.getLongName());
// Now that we have found a target BaseType variable that matches the reference in
// the variable field of the Alias (b.t.w. that's a good thing) let's go
// see if we can find an Attribute within that targetBT that matches the attribute field
// in the Alias decleration.
Attribute targetAT = null;
if (aNames.size() == 0) {
// If there are no remaining tokens in the attribute field then
// we are referencing the attribute container of the targetBT.
targetAT = targetBT.getAttribute();
} else {
// Go try to find the Attribute in the targetBT.
targetAT = getAttribute(targetBT.getAttributeTable(), aNames);
}
alias.setMyVariable(targetBT);
alias.setMyAttribute(targetAT);
} }
|
public class class_name {
public static String URLDecode( String str,
String enc ) {
if (str == null) {
return (null);
}
// use the specified encoding to extract bytes out of the
// given string so that the encoding is not lost. If an
// encoding is not specified, let it use platform default
byte[] bytes = null;
try {
if (enc == null) {
bytes = str.getBytes();
} else {
bytes = str.getBytes(enc);
}
} catch (UnsupportedEncodingException uee) {
}
return URLDecode(bytes, enc);
} }
|
public class class_name {
public static String URLDecode( String str,
String enc ) {
if (str == null) {
return (null); // depends on control dependency: [if], data = [null)]
}
// use the specified encoding to extract bytes out of the
// given string so that the encoding is not lost. If an
// encoding is not specified, let it use platform default
byte[] bytes = null;
try {
if (enc == null) {
bytes = str.getBytes(); // depends on control dependency: [if], data = [none]
} else {
bytes = str.getBytes(enc); // depends on control dependency: [if], data = [(enc]
}
} catch (UnsupportedEncodingException uee) {
} // depends on control dependency: [catch], data = [none]
return URLDecode(bytes, enc);
} }
|
public class class_name {
public static boolean jmolInClassPath(){
try {
Class.forName(viewer);
} catch (ClassNotFoundException e){
e.printStackTrace();
return false;
}
return true;
} }
|
public class class_name {
public static boolean jmolInClassPath(){
try {
Class.forName(viewer);
} catch (ClassNotFoundException e){
e.printStackTrace();
return false;
} // depends on control dependency: [catch], data = [none]
return true;
} }
|
public class class_name {
public static Intent newCallNumberIntent(String phoneNumber) {
final Intent intent;
if (phoneNumber == null || phoneNumber.trim().length() <= 0) {
intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:"));
} else {
intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber.replace(" ", "")));
}
return intent;
} }
|
public class class_name {
public static Intent newCallNumberIntent(String phoneNumber) {
final Intent intent;
if (phoneNumber == null || phoneNumber.trim().length() <= 0) {
intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:")); // depends on control dependency: [if], data = [none]
} else {
intent = new Intent(Intent.ACTION_CALL, Uri.parse("tel:" + phoneNumber.replace(" ", ""))); // depends on control dependency: [if], data = [none]
}
return intent;
} }
|
public class class_name {
@Override
public boolean hit(Rectangle rect, Shape s, boolean onStroke) {
Shape ts;
if (onStroke) {
ts = this.transform.createTransformedShape(
this.stroke.createStrokedShape(s));
} else {
ts = this.transform.createTransformedShape(s);
}
if (!rect.getBounds2D().intersects(ts.getBounds2D())) {
return false;
}
Area a1 = new Area(rect);
Area a2 = new Area(ts);
a1.intersect(a2);
return !a1.isEmpty();
} }
|
public class class_name {
@Override
public boolean hit(Rectangle rect, Shape s, boolean onStroke) {
Shape ts;
if (onStroke) {
ts = this.transform.createTransformedShape(
this.stroke.createStrokedShape(s)); // depends on control dependency: [if], data = [none]
} else {
ts = this.transform.createTransformedShape(s); // depends on control dependency: [if], data = [none]
}
if (!rect.getBounds2D().intersects(ts.getBounds2D())) {
return false; // depends on control dependency: [if], data = [none]
}
Area a1 = new Area(rect);
Area a2 = new Area(ts);
a1.intersect(a2);
return !a1.isEmpty();
} }
|
public class class_name {
public Set<String> queryParameterNames() {
if (queryNamesAndValues == null) return Collections.emptySet();
Set<String> result = new LinkedHashSet<>();
for (int i = 0, size = queryNamesAndValues.size(); i < size; i += 2) {
result.add(queryNamesAndValues.get(i));
}
return Collections.unmodifiableSet(result);
} }
|
public class class_name {
public Set<String> queryParameterNames() {
if (queryNamesAndValues == null) return Collections.emptySet();
Set<String> result = new LinkedHashSet<>();
for (int i = 0, size = queryNamesAndValues.size(); i < size; i += 2) {
result.add(queryNamesAndValues.get(i)); // depends on control dependency: [for], data = [i]
}
return Collections.unmodifiableSet(result);
} }
|
public class class_name {
private Set<PhysicalEntity> getFlattenedMembers(Complex cx) {
Set<PhysicalEntity> set = new HashSet<PhysicalEntity>();
for (PhysicalEntity mem : cx.getComponent()) {
if (mem instanceof Complex) {
if (!hasNonComplexMember((Complex) mem)) {
set.add(mem);
} else {
set.addAll(getFlattenedMembers((Complex) mem));
}
} else set.add(mem);
}
return set;
} }
|
public class class_name {
private Set<PhysicalEntity> getFlattenedMembers(Complex cx) {
Set<PhysicalEntity> set = new HashSet<PhysicalEntity>();
for (PhysicalEntity mem : cx.getComponent()) {
if (mem instanceof Complex) {
if (!hasNonComplexMember((Complex) mem)) {
set.add(mem); // depends on control dependency: [if], data = [none]
} else {
set.addAll(getFlattenedMembers((Complex) mem)); // depends on control dependency: [if], data = [none]
}
} else set.add(mem);
}
return set;
} }
|
public class class_name {
@Override
public String lookupPersonId(PortletRequest request) {
String studentId = getSchoolId(request);
if (StringUtils.isBlank(studentId)) {
return null;
}
Element element = cache.get(studentId);
if (element != null) {
return (String)element.getObjectValue();
}
String url = getPersonSearchURL();
SSPApiRequest sspReq = new SSPApiRequest(url, String.class)
.addUriParameter("schoolId", studentId);
try {
ResponseEntity<String> response = sspApi.doRequest(sspReq);
String userId = extractUserId(studentId, response);
Element cacheElement = new Element(studentId, userId);
cache.put(cacheElement);
return userId;
} catch (Exception e) {
log.error(e.getMessage(), e);
return null;
}
} }
|
public class class_name {
@Override
public String lookupPersonId(PortletRequest request) {
String studentId = getSchoolId(request);
if (StringUtils.isBlank(studentId)) {
return null; // depends on control dependency: [if], data = [none]
}
Element element = cache.get(studentId);
if (element != null) {
return (String)element.getObjectValue(); // depends on control dependency: [if], data = [none]
}
String url = getPersonSearchURL();
SSPApiRequest sspReq = new SSPApiRequest(url, String.class)
.addUriParameter("schoolId", studentId);
try {
ResponseEntity<String> response = sspApi.doRequest(sspReq);
String userId = extractUserId(studentId, response);
Element cacheElement = new Element(studentId, userId);
cache.put(cacheElement); // depends on control dependency: [try], data = [none]
return userId; // depends on control dependency: [try], data = [none]
} catch (Exception e) {
log.error(e.getMessage(), e);
return null;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static Cell setCellValue(Cell cell, Object value, String dateFormat) {
SimpleDateFormat format =
new SimpleDateFormat(StringUtils.isNotBlank(dateFormat) ? dateFormat : DATE_PATTERN);
if (value == null) {
cell.setCellValue("");
} else if (value instanceof String) {
cell.setCellValue((String) value);
} else if (value instanceof Integer) {
cell.setCellValue((Integer) value);
} else if (value instanceof Date) {
cell.setCellValue(format.format(value));
} else if (value instanceof Calendar) {
cell.setCellValue(format.format(((Calendar) value).getTime()));
} else if (value instanceof Boolean) {
cell.setCellValue((Boolean) value);
} else if (value instanceof Float) {
cell.setCellValue((Float) value);
} else if (value instanceof Double) {
cell.setCellValue((Double) value);
} else if (value instanceof Byte) {
cell.setCellValue((Byte) value);
} else if (value instanceof Short) {
cell.setCellValue((Short) value);
} else if (value instanceof Long) {
cell.setCellValue((Long) value);
} else if (value instanceof Character) {
cell.setCellValue(((Character) value).toString());
} else {
cell.setCellValue(value.toString());
}
return cell;
} }
|
public class class_name {
public static Cell setCellValue(Cell cell, Object value, String dateFormat) {
SimpleDateFormat format =
new SimpleDateFormat(StringUtils.isNotBlank(dateFormat) ? dateFormat : DATE_PATTERN);
if (value == null) {
cell.setCellValue(""); // depends on control dependency: [if], data = [none]
} else if (value instanceof String) {
cell.setCellValue((String) value); // depends on control dependency: [if], data = [none]
} else if (value instanceof Integer) {
cell.setCellValue((Integer) value); // depends on control dependency: [if], data = [none]
} else if (value instanceof Date) {
cell.setCellValue(format.format(value)); // depends on control dependency: [if], data = [none]
} else if (value instanceof Calendar) {
cell.setCellValue(format.format(((Calendar) value).getTime())); // depends on control dependency: [if], data = [none]
} else if (value instanceof Boolean) {
cell.setCellValue((Boolean) value); // depends on control dependency: [if], data = [none]
} else if (value instanceof Float) {
cell.setCellValue((Float) value); // depends on control dependency: [if], data = [none]
} else if (value instanceof Double) {
cell.setCellValue((Double) value); // depends on control dependency: [if], data = [none]
} else if (value instanceof Byte) {
cell.setCellValue((Byte) value); // depends on control dependency: [if], data = [none]
} else if (value instanceof Short) {
cell.setCellValue((Short) value); // depends on control dependency: [if], data = [none]
} else if (value instanceof Long) {
cell.setCellValue((Long) value); // depends on control dependency: [if], data = [none]
} else if (value instanceof Character) {
cell.setCellValue(((Character) value).toString()); // depends on control dependency: [if], data = [none]
} else {
cell.setCellValue(value.toString()); // depends on control dependency: [if], data = [none]
}
return cell;
} }
|
public class class_name {
public CreateFleetRequest withLaunchTemplateConfigs(FleetLaunchTemplateConfigRequest... launchTemplateConfigs) {
if (this.launchTemplateConfigs == null) {
setLaunchTemplateConfigs(new com.amazonaws.internal.SdkInternalList<FleetLaunchTemplateConfigRequest>(launchTemplateConfigs.length));
}
for (FleetLaunchTemplateConfigRequest ele : launchTemplateConfigs) {
this.launchTemplateConfigs.add(ele);
}
return this;
} }
|
public class class_name {
public CreateFleetRequest withLaunchTemplateConfigs(FleetLaunchTemplateConfigRequest... launchTemplateConfigs) {
if (this.launchTemplateConfigs == null) {
setLaunchTemplateConfigs(new com.amazonaws.internal.SdkInternalList<FleetLaunchTemplateConfigRequest>(launchTemplateConfigs.length)); // depends on control dependency: [if], data = [none]
}
for (FleetLaunchTemplateConfigRequest ele : launchTemplateConfigs) {
this.launchTemplateConfigs.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public void clearReferences() {
if (mAsyncTaskController != null) {
mAsyncTaskController.detach();
}
if (mRxTokenController != null) {
mRxTokenController.detach();
}
if (mIntentServiceTokenController != null) {
mIntentServiceTokenController.detach();
}
mAsyncTaskController = null;
mRxTokenController = null;
mIntentServiceTokenController = null;
} }
|
public class class_name {
public void clearReferences() {
if (mAsyncTaskController != null) {
mAsyncTaskController.detach(); // depends on control dependency: [if], data = [none]
}
if (mRxTokenController != null) {
mRxTokenController.detach(); // depends on control dependency: [if], data = [none]
}
if (mIntentServiceTokenController != null) {
mIntentServiceTokenController.detach(); // depends on control dependency: [if], data = [none]
}
mAsyncTaskController = null;
mRxTokenController = null;
mIntentServiceTokenController = null;
} }
|
public class class_name {
public Matrix transformColumn(int j, VectorFunction function) {
Matrix result = copy();
VectorIterator it = result.iteratorOfColumn(j);
while (it.hasNext()) {
double x = it.next();
int i = it.index();
it.set(function.evaluate(i, x));
}
return result;
} }
|
public class class_name {
public Matrix transformColumn(int j, VectorFunction function) {
Matrix result = copy();
VectorIterator it = result.iteratorOfColumn(j);
while (it.hasNext()) {
double x = it.next();
int i = it.index();
it.set(function.evaluate(i, x)); // depends on control dependency: [while], data = [none]
}
return result;
} }
|
public class class_name {
private void appendValueLength(int value, int index) {
int previousValue = toIntUnsigned(getValue(index));
int length = toIntUnsigned(getLength(index));
int offset = value - previousValue;
if (offset > length) {
setLength(index, (short) offset);
}
} }
|
public class class_name {
private void appendValueLength(int value, int index) {
int previousValue = toIntUnsigned(getValue(index));
int length = toIntUnsigned(getLength(index));
int offset = value - previousValue;
if (offset > length) {
setLength(index, (short) offset); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static double[] columnPackedCopy(final double[][] m1) {
final int rowdim = m1.length, coldim = getColumnDimensionality(m1);
final double[] vals = new double[m1.length * coldim];
for(int i = 0; i < rowdim; i++) {
final double[] rowM = m1[i];
// assert rowM.length == coldim : ERR_MATRIX_RAGGED;
for(int j = 0, k = i; j < coldim; j++, k += rowdim) {
vals[k] = rowM[j];
}
}
return vals;
} }
|
public class class_name {
public static double[] columnPackedCopy(final double[][] m1) {
final int rowdim = m1.length, coldim = getColumnDimensionality(m1);
final double[] vals = new double[m1.length * coldim];
for(int i = 0; i < rowdim; i++) {
final double[] rowM = m1[i];
// assert rowM.length == coldim : ERR_MATRIX_RAGGED;
for(int j = 0, k = i; j < coldim; j++, k += rowdim) {
vals[k] = rowM[j]; // depends on control dependency: [for], data = [j]
}
}
return vals;
} }
|
public class class_name {
public V next() {
Collection<? extends V> collection = this.collection;
V offset = this.offset;
if (offset != null) {
boolean accept = false;
for (V element : collection) {
if (element == offset) {
accept = true;
continue;
}
if (accept) {
return this.offset = element;
}
}
}
return this.offset = collection.iterator().next();
} }
|
public class class_name {
public V next() {
Collection<? extends V> collection = this.collection;
V offset = this.offset;
if (offset != null) {
boolean accept = false;
for (V element : collection) {
if (element == offset) {
accept = true; // depends on control dependency: [if], data = [none]
continue;
}
if (accept) {
return this.offset = element; // depends on control dependency: [if], data = [none]
}
}
}
return this.offset = collection.iterator().next();
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.