code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
protected Long createOrRetrieveSidPrimaryKey(Sid sid, boolean allowCreate) {
Assert.notNull(sid, "Sid required");
String sidName;
boolean sidIsPrincipal = true;
if (sid instanceof PrincipalSid) {
sidName = ((PrincipalSid) sid).getPrincipal();
}
else if (sid instanceof GrantedAuthoritySid) {
sidName = ((GrantedAuthoritySid) sid).getGrantedAuthority();
sidIsPrincipal = false;
}
else {
throw new IllegalArgumentException("Unsupported implementation of Sid");
}
return createOrRetrieveSidPrimaryKey(sidName, sidIsPrincipal, allowCreate);
} }
|
public class class_name {
protected Long createOrRetrieveSidPrimaryKey(Sid sid, boolean allowCreate) {
Assert.notNull(sid, "Sid required");
String sidName;
boolean sidIsPrincipal = true;
if (sid instanceof PrincipalSid) {
sidName = ((PrincipalSid) sid).getPrincipal(); // depends on control dependency: [if], data = [none]
}
else if (sid instanceof GrantedAuthoritySid) {
sidName = ((GrantedAuthoritySid) sid).getGrantedAuthority(); // depends on control dependency: [if], data = [none]
sidIsPrincipal = false; // depends on control dependency: [if], data = [none]
}
else {
throw new IllegalArgumentException("Unsupported implementation of Sid");
}
return createOrRetrieveSidPrimaryKey(sidName, sidIsPrincipal, allowCreate);
} }
|
public class class_name {
public void replaceUnsolvedElements(NamedConcreteElement element){
List<ReferenceBase> elements = this.getElements();
if (elements != null){
elements.stream()
.filter(referenceBase -> referenceBase instanceof UnsolvedReference)
.map(referenceBase -> (UnsolvedReference) referenceBase)
.filter(unsolvedReference -> unsolvedReference.getRef().equals(element.getName()))
.findFirst()
.ifPresent(oldElement -> elements.set(elements.indexOf(oldElement), element));
}
} }
|
public class class_name {
public void replaceUnsolvedElements(NamedConcreteElement element){
List<ReferenceBase> elements = this.getElements();
if (elements != null){
elements.stream()
.filter(referenceBase -> referenceBase instanceof UnsolvedReference)
.map(referenceBase -> (UnsolvedReference) referenceBase)
.filter(unsolvedReference -> unsolvedReference.getRef().equals(element.getName()))
.findFirst()
.ifPresent(oldElement -> elements.set(elements.indexOf(oldElement), element)); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public FutureData<Limit> createLimit(String identity, String service, Long allowance) {
if (identity == null || identity.isEmpty()) {
throw new IllegalArgumentException("An identity is required");
}
if (service == null || service.isEmpty()) {
throw new IllegalArgumentException("A service is required");
}
if (allowance < 0) {
throw new IllegalArgumentException("Allowance must be a positive integer");
}
FutureData<Limit> future = new FutureData<>();
URI uri = newParams().forURL(config.newAPIEndpointURI(IDENTITY + "/" + identity + "/limit"));
try {
Request request = config.http()
.postJSON(uri, new PageReader(newRequestCallback(future, new Limit(), config)))
.setData(new NewLimit(service, allowance));
performRequest(future, request);
} catch (JsonProcessingException e) {
e.printStackTrace();
}
return future;
} }
|
public class class_name {
public FutureData<Limit> createLimit(String identity, String service, Long allowance) {
if (identity == null || identity.isEmpty()) {
throw new IllegalArgumentException("An identity is required");
}
if (service == null || service.isEmpty()) {
throw new IllegalArgumentException("A service is required");
}
if (allowance < 0) {
throw new IllegalArgumentException("Allowance must be a positive integer");
}
FutureData<Limit> future = new FutureData<>();
URI uri = newParams().forURL(config.newAPIEndpointURI(IDENTITY + "/" + identity + "/limit"));
try {
Request request = config.http()
.postJSON(uri, new PageReader(newRequestCallback(future, new Limit(), config)))
.setData(new NewLimit(service, allowance));
performRequest(future, request); // depends on control dependency: [try], data = [none]
} catch (JsonProcessingException e) {
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
return future;
} }
|
public class class_name {
@Override
public SIBusMessage[] processMsgSet(SIMessageHandle[] msgHandles,
TransactionCommon transaction,
BifurcatedConsumerSessionImpl owner,
boolean unlock,
boolean delete,
boolean read,
boolean incrementLockCount)
throws SISessionUnavailableException, SIMPMessageNotLockedException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "processMsgSet",
new Object[] { this,
SIMPUtils.messageHandleArrayToString(msgHandles),
transaction,
owner,
Boolean.valueOf(unlock),
Boolean.valueOf(delete),
Boolean.valueOf(read) });
// Do a dirty read of the (volatile) closed/closing states to avoid the synch block if poss
if (_closed || _closing)
{
this.lock();
try
{
checkNotClosed();
} finally
{
this.unlock();
}
}
int numMsgs = 0;
SIBusMessage messages[] = null;
if (msgHandles != null && msgHandles.length > 0)
numMsgs = msgHandles.length;
if (numMsgs > 0)
{
// Actually process the message Ids
messages = _allLockedMessages.processMsgSet(msgHandles, transaction, owner, unlock, delete, read, incrementLockCount);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "processMsgSet", messages);
return messages;
} }
|
public class class_name {
@Override
public SIBusMessage[] processMsgSet(SIMessageHandle[] msgHandles,
TransactionCommon transaction,
BifurcatedConsumerSessionImpl owner,
boolean unlock,
boolean delete,
boolean read,
boolean incrementLockCount)
throws SISessionUnavailableException, SIMPMessageNotLockedException, SIConnectionLostException, SIIncorrectCallException, SIResourceException, SIErrorException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "processMsgSet",
new Object[] { this,
SIMPUtils.messageHandleArrayToString(msgHandles),
transaction,
owner,
Boolean.valueOf(unlock),
Boolean.valueOf(delete),
Boolean.valueOf(read) });
// Do a dirty read of the (volatile) closed/closing states to avoid the synch block if poss
if (_closed || _closing)
{
this.lock();
try
{
checkNotClosed(); // depends on control dependency: [try], data = [none]
} finally
{
this.unlock();
}
}
int numMsgs = 0;
SIBusMessage messages[] = null;
if (msgHandles != null && msgHandles.length > 0)
numMsgs = msgHandles.length;
if (numMsgs > 0)
{
// Actually process the message Ids
messages = _allLockedMessages.processMsgSet(msgHandles, transaction, owner, unlock, delete, read, incrementLockCount);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "processMsgSet", messages);
return messages;
} }
|
public class class_name {
public final UriBuilder setFull(final String str) {
try {
return setFull(new URI(str));
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(ex.getMessage());
}
} }
|
public class class_name {
public final UriBuilder setFull(final String str) {
try {
return setFull(new URI(str)); // depends on control dependency: [try], data = [none]
} catch (URISyntaxException ex) {
throw new IllegalArgumentException(ex.getMessage());
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
@Override
public int complete(String buffer, int cursor, List<CharSequence> candidates)
{
// For now only support tab completion at the end of the line.
if (cursor == buffer.length()) {
// Check for an initial token match?
if (cursor <= m_maxCommandPrefixLength) {
final String bufferu = buffer.toUpperCase();
for (final String command : m_commandPrefixes) {
if (command.startsWith(bufferu)) {
candidates.add(command);
}
}
if (!candidates.isEmpty()) {
return 0;
}
}
}
return cursor;
} }
|
public class class_name {
@Override
public int complete(String buffer, int cursor, List<CharSequence> candidates)
{
// For now only support tab completion at the end of the line.
if (cursor == buffer.length()) {
// Check for an initial token match?
if (cursor <= m_maxCommandPrefixLength) {
final String bufferu = buffer.toUpperCase();
for (final String command : m_commandPrefixes) {
if (command.startsWith(bufferu)) {
candidates.add(command); // depends on control dependency: [if], data = [none]
}
}
if (!candidates.isEmpty()) {
return 0; // depends on control dependency: [if], data = [none]
}
}
}
return cursor;
} }
|
public class class_name {
private static void populateEmbeddedIdFields(Set<Attribute> embeddedAttributes, MetamodelImpl metaModel,
Set<String> embeddedIdFields)
{
for (Attribute attribute : embeddedAttributes)
{
if (!ReflectUtils.isTransientOrStatic((Field) attribute.getJavaMember()))
{
if (metaModel.isEmbeddable(attribute.getJavaType()))
{
EmbeddableType embeddable = metaModel.embeddable(attribute.getJavaType());
populateEmbeddedIdFieldsUtil(embeddable.getAttributes(), metaModel, embeddedIdFields);
}
}
}
} }
|
public class class_name {
private static void populateEmbeddedIdFields(Set<Attribute> embeddedAttributes, MetamodelImpl metaModel,
Set<String> embeddedIdFields)
{
for (Attribute attribute : embeddedAttributes)
{
if (!ReflectUtils.isTransientOrStatic((Field) attribute.getJavaMember()))
{
if (metaModel.isEmbeddable(attribute.getJavaType()))
{
EmbeddableType embeddable = metaModel.embeddable(attribute.getJavaType());
populateEmbeddedIdFieldsUtil(embeddable.getAttributes(), metaModel, embeddedIdFields); // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
public static <E> Distribution<E> laplaceWithExplicitUnknown(Counter<E> counter, double lambda, E UNK) {
Distribution<E> norm = new Distribution<E>();
norm.counter = new ClassicCounter<E>();
double total = counter.totalCount() + (lambda * (counter.size() - 1));
norm.numberOfKeys = counter.size();
norm.reservedMass = 0.0;
for (E key : counter.keySet()) {
if (key.equals(UNK)) {
norm.counter.setCount(key, counter.getCount(key) / total);
} else {
norm.counter.setCount(key, (counter.getCount(key) + lambda) / total);
}
}
return norm;
} }
|
public class class_name {
public static <E> Distribution<E> laplaceWithExplicitUnknown(Counter<E> counter, double lambda, E UNK) {
Distribution<E> norm = new Distribution<E>();
norm.counter = new ClassicCounter<E>();
double total = counter.totalCount() + (lambda * (counter.size() - 1));
norm.numberOfKeys = counter.size();
norm.reservedMass = 0.0;
for (E key : counter.keySet()) {
if (key.equals(UNK)) {
norm.counter.setCount(key, counter.getCount(key) / total);
// depends on control dependency: [if], data = [none]
} else {
norm.counter.setCount(key, (counter.getCount(key) + lambda) / total);
// depends on control dependency: [if], data = [none]
}
}
return norm;
} }
|
public class class_name {
private Object readValue(String value, Class<?> type) {
if (StringUtils.isEmpty(value)) {
return null;
}
if (byte.class.equals(type) || Byte.class.equals(type)) {
return Byte.valueOf(value);
} else if (short.class.equals(type) || Short.class.equals(type)) {
return Short.valueOf(value);
} else if (int.class.equals(type) || Integer.class.equals(type)) {
return Integer.valueOf(value);
} else if (long.class.equals(type) || Long.class.equals(type)) {
return Long.valueOf(value);
} else if (float.class.equals(type) || Float.class.equals(type)) {
return Float.valueOf(value);
} else if (double.class.equals(type) || Double.class.equals(type)) {
return Double.valueOf(value);
} else if (boolean.class.equals(type) || Boolean.class.equals(type)) {
return Boolean.valueOf(value);
} else if (char.class.equals(type) || Character.class.equals(type)) {
return value.charAt(0);
} else if (BigDecimal.class.equals(type)) {
return new BigDecimal(value);
} else if (String.class.equals(type)) {
return value;
} else if (Enum.class.equals(type)) {
return ReflectUtil.invoke(type, "valueOf", new Class[] { String.class }, value);
} else {
throw new NoSupportException("FormParser不支持的数据类型:" + type);
}
} }
|
public class class_name {
private Object readValue(String value, Class<?> type) {
if (StringUtils.isEmpty(value)) {
return null; // depends on control dependency: [if], data = [none]
}
if (byte.class.equals(type) || Byte.class.equals(type)) {
return Byte.valueOf(value); // depends on control dependency: [if], data = [none]
} else if (short.class.equals(type) || Short.class.equals(type)) {
return Short.valueOf(value); // depends on control dependency: [if], data = [none]
} else if (int.class.equals(type) || Integer.class.equals(type)) {
return Integer.valueOf(value); // depends on control dependency: [if], data = [none]
} else if (long.class.equals(type) || Long.class.equals(type)) {
return Long.valueOf(value); // depends on control dependency: [if], data = [none]
} else if (float.class.equals(type) || Float.class.equals(type)) {
return Float.valueOf(value); // depends on control dependency: [if], data = [none]
} else if (double.class.equals(type) || Double.class.equals(type)) {
return Double.valueOf(value); // depends on control dependency: [if], data = [none]
} else if (boolean.class.equals(type) || Boolean.class.equals(type)) {
return Boolean.valueOf(value); // depends on control dependency: [if], data = [none]
} else if (char.class.equals(type) || Character.class.equals(type)) {
return value.charAt(0); // depends on control dependency: [if], data = [none]
} else if (BigDecimal.class.equals(type)) {
return new BigDecimal(value); // depends on control dependency: [if], data = [none]
} else if (String.class.equals(type)) {
return value; // depends on control dependency: [if], data = [none]
} else if (Enum.class.equals(type)) {
return ReflectUtil.invoke(type, "valueOf", new Class[] { String.class }, value); // depends on control dependency: [if], data = [none]
} else {
throw new NoSupportException("FormParser不支持的数据类型:" + type);
}
} }
|
public class class_name {
public static long[] convertToArrayLongs(final Block[] blockArray) {
long[] blocksAsLongs = new long[blockArray.length * LONGS_PER_BLOCK];
BlockListAsLongs bl = new BlockListAsLongs(blocksAsLongs);
assert bl.getNumberOfBlocks() == blockArray.length;
for (int i = 0; i < blockArray.length; i++) {
bl.setBlock(i, blockArray[i]);
}
return blocksAsLongs;
} }
|
public class class_name {
public static long[] convertToArrayLongs(final Block[] blockArray) {
long[] blocksAsLongs = new long[blockArray.length * LONGS_PER_BLOCK];
BlockListAsLongs bl = new BlockListAsLongs(blocksAsLongs);
assert bl.getNumberOfBlocks() == blockArray.length;
for (int i = 0; i < blockArray.length; i++) {
bl.setBlock(i, blockArray[i]); // depends on control dependency: [for], data = [i]
}
return blocksAsLongs;
} }
|
public class class_name {
public InstanceSnapshotInfo withFromDiskInfo(DiskInfo... fromDiskInfo) {
if (this.fromDiskInfo == null) {
setFromDiskInfo(new java.util.ArrayList<DiskInfo>(fromDiskInfo.length));
}
for (DiskInfo ele : fromDiskInfo) {
this.fromDiskInfo.add(ele);
}
return this;
} }
|
public class class_name {
public InstanceSnapshotInfo withFromDiskInfo(DiskInfo... fromDiskInfo) {
if (this.fromDiskInfo == null) {
setFromDiskInfo(new java.util.ArrayList<DiskInfo>(fromDiskInfo.length)); // depends on control dependency: [if], data = [none]
}
for (DiskInfo ele : fromDiskInfo) {
this.fromDiskInfo.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
@Required
public void setLocation(final String location) {
// Assertions.
if (location == null) {
String msg = "Argument 'location' cannot be null.";
throw new IllegalArgumentException(msg);
}
if (this.location != null) {
String msg = "Property 'location' may only be set once.";
throw new RuntimeException(msg);
}
this.location = location;
} }
|
public class class_name {
@Required
public void setLocation(final String location) {
// Assertions.
if (location == null) {
String msg = "Argument 'location' cannot be null.";
throw new IllegalArgumentException(msg);
}
if (this.location != null) {
String msg = "Property 'location' may only be set once."; // depends on control dependency: [if], data = [none]
throw new RuntimeException(msg);
}
this.location = location;
} }
|
public class class_name {
static boolean getLoadLocalLibsFirstForFile(final File file) {
Attributes attributes = loadMainAttributes(file);
if (null == attributes) {
return false;
}
boolean loadFirstDefault=true;
String loadFirst = attributes.getValue(RUNDECK_PLUGIN_LIBS_LOAD_FIRST);
if(null!=loadFirst){
return Boolean.valueOf(loadFirst);
}
return loadFirstDefault;
} }
|
public class class_name {
static boolean getLoadLocalLibsFirstForFile(final File file) {
Attributes attributes = loadMainAttributes(file);
if (null == attributes) {
return false; // depends on control dependency: [if], data = [none]
}
boolean loadFirstDefault=true;
String loadFirst = attributes.getValue(RUNDECK_PLUGIN_LIBS_LOAD_FIRST);
if(null!=loadFirst){
return Boolean.valueOf(loadFirst); // depends on control dependency: [if], data = [loadFirst)]
}
return loadFirstDefault;
} }
|
public class class_name {
public BatchGetImageResult withFailures(ImageFailure... failures) {
if (this.failures == null) {
setFailures(new java.util.ArrayList<ImageFailure>(failures.length));
}
for (ImageFailure ele : failures) {
this.failures.add(ele);
}
return this;
} }
|
public class class_name {
public BatchGetImageResult withFailures(ImageFailure... failures) {
if (this.failures == null) {
setFailures(new java.util.ArrayList<ImageFailure>(failures.length)); // depends on control dependency: [if], data = [none]
}
for (ImageFailure ele : failures) {
this.failures.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public void removeChangeListener(@NonNull ListenerToken token) {
if (token == null) { throw new IllegalArgumentException("token cannot be null."); }
synchronized (lock) {
mustBeOpen();
if (token instanceof ChangeListenerToken && ((ChangeListenerToken) token).getKey() != null) {
removeDocumentChangeListener((ChangeListenerToken) token);
}
else { removeDatabaseChangeListener(token); }
}
} }
|
public class class_name {
public void removeChangeListener(@NonNull ListenerToken token) {
if (token == null) { throw new IllegalArgumentException("token cannot be null."); }
synchronized (lock) {
mustBeOpen();
if (token instanceof ChangeListenerToken && ((ChangeListenerToken) token).getKey() != null) {
removeDocumentChangeListener((ChangeListenerToken) token); // depends on control dependency: [if], data = [none]
}
else { removeDatabaseChangeListener(token); } // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public int[] getDims() {
int[] dims = new int[size()];
for (int i = 0; i < size(); i++) {
dims[i] = get(i).getNumStates();
}
return dims;
} }
|
public class class_name {
public int[] getDims() {
int[] dims = new int[size()];
for (int i = 0; i < size(); i++) {
dims[i] = get(i).getNumStates(); // depends on control dependency: [for], data = [i]
}
return dims;
} }
|
public class class_name {
public static String escapeAttribute (String value)
{
for (int ii = 0; ii < ATTR_ESCAPES.length; ++ii) {
value = value.replace(ATTR_ESCAPES[ii][0], ATTR_ESCAPES[ii][1]);
}
return value;
} }
|
public class class_name {
public static String escapeAttribute (String value)
{
for (int ii = 0; ii < ATTR_ESCAPES.length; ++ii) {
value = value.replace(ATTR_ESCAPES[ii][0], ATTR_ESCAPES[ii][1]); // depends on control dependency: [for], data = [ii]
}
return value;
} }
|
public class class_name {
public Iterable<? extends Element> analyze(Iterable<? extends Element> classes) {
enter(null); // ensure all classes have been entered
final ListBuffer<Element> results = new ListBuffer<>();
try {
if (classes == null) {
handleFlowResults(compiler.flow(compiler.attribute(compiler.todo)), results);
} else {
Filter f = new Filter() {
@Override
public void process(Env<AttrContext> env) {
handleFlowResults(compiler.flow(compiler.attribute(env)), results);
}
};
f.run(compiler.todo, classes);
}
} finally {
compiler.log.flush();
}
return results;
} }
|
public class class_name {
public Iterable<? extends Element> analyze(Iterable<? extends Element> classes) {
enter(null); // ensure all classes have been entered
final ListBuffer<Element> results = new ListBuffer<>();
try {
if (classes == null) {
handleFlowResults(compiler.flow(compiler.attribute(compiler.todo)), results); // depends on control dependency: [if], data = [none]
} else {
Filter f = new Filter() {
@Override
public void process(Env<AttrContext> env) {
handleFlowResults(compiler.flow(compiler.attribute(env)), results);
}
};
f.run(compiler.todo, classes); // depends on control dependency: [if], data = [none]
}
} finally {
compiler.log.flush();
}
return results;
} }
|
public class class_name {
public GlobusResource getResource(String location) {
GlobusResource returnResource;
URL resourceURL;
if (location.startsWith("classpath:")) {
resourceURL = getClass().getClassLoader().getResource(location.replaceFirst("classpath:/", ""));
returnResource = new GlobusResource(resourceURL.getPath());
} else if (location.startsWith("file:")) {
returnResource = new GlobusResource(location.replaceFirst("file:", ""));
} else
returnResource = new GlobusResource(location);
return returnResource;
} }
|
public class class_name {
public GlobusResource getResource(String location) {
GlobusResource returnResource;
URL resourceURL;
if (location.startsWith("classpath:")) {
resourceURL = getClass().getClassLoader().getResource(location.replaceFirst("classpath:/", "")); // depends on control dependency: [if], data = [none]
returnResource = new GlobusResource(resourceURL.getPath()); // depends on control dependency: [if], data = [none]
} else if (location.startsWith("file:")) {
returnResource = new GlobusResource(location.replaceFirst("file:", "")); // depends on control dependency: [if], data = [none]
} else
returnResource = new GlobusResource(location);
return returnResource;
} }
|
public class class_name {
void cfftf(double a[], int offa, int isign) {
int idot;
int l1, l2;
int na, nf, ip, iw, ido, idl1;
final int twon = 2 * n;
int iw1, iw2;
double[] ch = ch2;
iw1 = twon;
iw2 = 4 * n;
nac[0] = 0;
nf = (int) wtable[1 + iw2];
na = 0;
l1 = 1;
iw = iw1;
for (int k1 = 2; k1 <= nf + 1; k1++) {
ip = (int) wtable[k1 + iw2];
l2 = ip * l1;
ido = n / l2;
idot = ido + ido;
idl1 = idot * l1;
switch (ip) {
case 4:
if (na == 0) {
passf4(idot, l1, a, offa, ch, 0, iw, isign);
} else {
passf4(idot, l1, ch, 0, a, offa, iw, isign);
}
na = 1 - na;
break;
case 2:
if (na == 0) {
passf2(idot, l1, a, offa, ch, 0, iw, isign);
} else {
passf2(idot, l1, ch, 0, a, offa, iw, isign);
}
na = 1 - na;
break;
case 3:
if (na == 0) {
passf3(idot, l1, a, offa, ch, 0, iw, isign);
} else {
passf3(idot, l1, ch, 0, a, offa, iw, isign);
}
na = 1 - na;
break;
case 5:
if (na == 0) {
passf5(idot, l1, a, offa, ch, 0, iw, isign);
} else {
passf5(idot, l1, ch, 0, a, offa, iw, isign);
}
na = 1 - na;
break;
default:
if (na == 0) {
passfg(nac, idot, ip, l1, idl1, a, offa, ch, 0, iw, isign);
} else {
passfg(nac, idot, ip, l1, idl1, ch, 0, a, offa, iw, isign);
}
if (nac[0] != 0)
na = 1 - na;
break;
}
l1 = l2;
iw += (ip - 1) * idot;
}
if (na == 0)
return;
System.arraycopy(ch, 0, a, offa, twon);
} }
|
public class class_name {
void cfftf(double a[], int offa, int isign) {
int idot;
int l1, l2;
int na, nf, ip, iw, ido, idl1;
final int twon = 2 * n;
int iw1, iw2;
double[] ch = ch2;
iw1 = twon;
iw2 = 4 * n;
nac[0] = 0;
nf = (int) wtable[1 + iw2];
na = 0;
l1 = 1;
iw = iw1;
for (int k1 = 2; k1 <= nf + 1; k1++) {
ip = (int) wtable[k1 + iw2]; // depends on control dependency: [for], data = [k1]
l2 = ip * l1; // depends on control dependency: [for], data = [none]
ido = n / l2; // depends on control dependency: [for], data = [none]
idot = ido + ido; // depends on control dependency: [for], data = [none]
idl1 = idot * l1; // depends on control dependency: [for], data = [none]
switch (ip) {
case 4:
if (na == 0) {
passf4(idot, l1, a, offa, ch, 0, iw, isign); // depends on control dependency: [if], data = [none]
} else {
passf4(idot, l1, ch, 0, a, offa, iw, isign); // depends on control dependency: [if], data = [none]
}
na = 1 - na;
break;
case 2:
if (na == 0) {
passf2(idot, l1, a, offa, ch, 0, iw, isign); // depends on control dependency: [if], data = [none]
} else {
passf2(idot, l1, ch, 0, a, offa, iw, isign); // depends on control dependency: [if], data = [none]
}
na = 1 - na;
break;
case 3:
if (na == 0) {
passf3(idot, l1, a, offa, ch, 0, iw, isign); // depends on control dependency: [if], data = [none]
} else {
passf3(idot, l1, ch, 0, a, offa, iw, isign); // depends on control dependency: [if], data = [none]
}
na = 1 - na;
break;
case 5:
if (na == 0) {
passf5(idot, l1, a, offa, ch, 0, iw, isign); // depends on control dependency: [if], data = [none]
} else {
passf5(idot, l1, ch, 0, a, offa, iw, isign); // depends on control dependency: [if], data = [none]
}
na = 1 - na;
break;
default:
if (na == 0) {
passfg(nac, idot, ip, l1, idl1, a, offa, ch, 0, iw, isign); // depends on control dependency: [if], data = [(na]
} else {
passfg(nac, idot, ip, l1, idl1, ch, 0, a, offa, iw, isign); // depends on control dependency: [if], data = [(na]
}
if (nac[0] != 0)
na = 1 - na;
break;
}
l1 = l2; // depends on control dependency: [for], data = [none]
iw += (ip - 1) * idot; // depends on control dependency: [for], data = [none]
}
if (na == 0)
return;
System.arraycopy(ch, 0, a, offa, twon);
} }
|
public class class_name {
public static BigDecimal maximum(BigDecimal... values)
{
int len = values.length;
if (len == 1)
{
if (values[0] == null)
{
throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
}
return values[0];
}
BigDecimal current = values[0];
for (int i=1; i < len; i++)
{
if (values[i] == null)
{
throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
}
current = values[i].max(current);
}
return current;
} }
|
public class class_name {
public static BigDecimal maximum(BigDecimal... values)
{
int len = values.length;
if (len == 1)
{
if (values[0] == null)
{
throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
}
return values[0]; // depends on control dependency: [if], data = [none]
}
BigDecimal current = values[0];
for (int i=1; i < len; i++)
{
if (values[i] == null)
{
throw new IllegalArgumentException("Cannot passed null BigDecimal entry to maximum()");
}
current = values[i].max(current); // depends on control dependency: [for], data = [i]
}
return current;
} }
|
public class class_name {
public ListInstancesResponse listInstances(ListInstancesRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, INSTANCE_PREFIX);
if (request.getMarker() != null) {
internalRequest.addParameter("marker", request.getMarker());
}
if (request.getMaxKeys() > 0) {
internalRequest.addParameter("maxKeys", String.valueOf(request.getMaxKeys()));
}
if (!Strings.isNullOrEmpty(request.getInternalIp())) {
internalRequest.addParameter("internalIp", request.getInternalIp());
}
if (!Strings.isNullOrEmpty(request.getDedicatedHostId())) {
internalRequest.addParameter("dedicatedHostId", request.getDedicatedHostId());
}
if (!Strings.isNullOrEmpty(request.getZoneName())) {
internalRequest.addParameter("zoneName", request.getZoneName());
}
return invokeHttpClient(internalRequest, ListInstancesResponse.class);
} }
|
public class class_name {
public ListInstancesResponse listInstances(ListInstancesRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.GET, INSTANCE_PREFIX);
if (request.getMarker() != null) {
internalRequest.addParameter("marker", request.getMarker()); // depends on control dependency: [if], data = [none]
}
if (request.getMaxKeys() > 0) {
internalRequest.addParameter("maxKeys", String.valueOf(request.getMaxKeys())); // depends on control dependency: [if], data = [(request.getMaxKeys()]
}
if (!Strings.isNullOrEmpty(request.getInternalIp())) {
internalRequest.addParameter("internalIp", request.getInternalIp()); // depends on control dependency: [if], data = [none]
}
if (!Strings.isNullOrEmpty(request.getDedicatedHostId())) {
internalRequest.addParameter("dedicatedHostId", request.getDedicatedHostId()); // depends on control dependency: [if], data = [none]
}
if (!Strings.isNullOrEmpty(request.getZoneName())) {
internalRequest.addParameter("zoneName", request.getZoneName()); // depends on control dependency: [if], data = [none]
}
return invokeHttpClient(internalRequest, ListInstancesResponse.class);
} }
|
public class class_name {
private void throwPreferedIPv4StackIPv6AddressError(String location, List<TcpResourceAddress> tcpAddresses) {
try {
InetAddress address = InetAddress.getByName(URIUtils.getHost(location));
boolean preferIPv4Stack = Boolean.parseBoolean(System.getProperty(JAVA_NET_PREFER_IPV4_STACK));
if (preferIPv4Stack && (address instanceof Inet6Address)) {
throw new IllegalArgumentException(format(PREFER_IPV4_STACK_IPV6_ADDRESS_EXCEPTION_FORMATTER, location));
}
} catch (UnknownHostException e) {
// InetAddress.getByName(hostAddress) throws an exception (hostAddress may have an
// unsupported format, e.g. network interface syntax)
}
} }
|
public class class_name {
private void throwPreferedIPv4StackIPv6AddressError(String location, List<TcpResourceAddress> tcpAddresses) {
try {
InetAddress address = InetAddress.getByName(URIUtils.getHost(location));
boolean preferIPv4Stack = Boolean.parseBoolean(System.getProperty(JAVA_NET_PREFER_IPV4_STACK));
if (preferIPv4Stack && (address instanceof Inet6Address)) {
throw new IllegalArgumentException(format(PREFER_IPV4_STACK_IPV6_ADDRESS_EXCEPTION_FORMATTER, location));
}
} catch (UnknownHostException e) {
// InetAddress.getByName(hostAddress) throws an exception (hostAddress may have an
// unsupported format, e.g. network interface syntax)
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static void padInt(StringBuilder buffer, int value, int length) {
String strValue = Integer.toString(value);
for (int i = length - strValue.length(); i > 0; i--) {
buffer.append('0');
}
buffer.append(strValue);
} }
|
public class class_name {
private static void padInt(StringBuilder buffer, int value, int length) {
String strValue = Integer.toString(value);
for (int i = length - strValue.length(); i > 0; i--) {
buffer.append('0'); // depends on control dependency: [for], data = [none]
}
buffer.append(strValue);
} }
|
public class class_name {
public FieldTable linkNewRemoteTable(FieldList record, boolean bUseCache)
{
FieldTable table = record.getTable();
if (table == null)
{
RemoteTable remoteTable = null;
try {
synchronized (this.getRemoteTask())
{ // In case this is called from another task
RemoteTask server = (RemoteTask)this.getRemoteTask();
Map<String, Object> dbProperties = this.getApplication().getProperties();
remoteTable = server.makeRemoteTable(record.getRemoteClassName(), null, null, dbProperties);
}
} catch (RemoteException ex) {
ex.printStackTrace();
} catch (Exception ex) {
ex.printStackTrace();
}
if (bUseCache)
remoteTable = new CachedRemoteTable(remoteTable);
table = new RemoteFieldTable(record, remoteTable, this.getRemoteTask());
}
else
{ // Table exists, make sure cache is correct.
CachedRemoteTable cachedFieldTable = (CachedRemoteTable)table.getRemoteTableType(CachedRemoteTable.class);
SyncRemoteTable syncRemoteTable = (SyncRemoteTable)table.getRemoteTableType(SyncRemoteTable.class);
RemoteTable remoteTable = (RemoteTable)table.getRemoteTableType(TableProxy.class);
if (cachedFieldTable != null)
{
cachedFieldTable.setCacheMode(bUseCache ? CacheMode.CACHE_ON_WRITE : CacheMode.PASSIVE_CACHE, record); // Turn cache on or off
}
else if (bUseCache)
{ // Add cache to chain
if ((remoteTable != null)
&& (syncRemoteTable != null)
&& (syncRemoteTable.getRemoteTable() == remoteTable))
{
remoteTable = new CachedRemoteTable(remoteTable);
syncRemoteTable.setRemoteTable(remoteTable);
}
else
Util.getLogger().severe("Can't add cache, Remote table chain is not as expected.");
}
}
return table;
} }
|
public class class_name {
public FieldTable linkNewRemoteTable(FieldList record, boolean bUseCache)
{
FieldTable table = record.getTable();
if (table == null)
{
RemoteTable remoteTable = null;
try {
synchronized (this.getRemoteTask()) // depends on control dependency: [try], data = [none]
{ // In case this is called from another task
RemoteTask server = (RemoteTask)this.getRemoteTask();
Map<String, Object> dbProperties = this.getApplication().getProperties();
remoteTable = server.makeRemoteTable(record.getRemoteClassName(), null, null, dbProperties);
}
} catch (RemoteException ex) {
ex.printStackTrace();
} catch (Exception ex) { // depends on control dependency: [catch], data = [none]
ex.printStackTrace();
} // depends on control dependency: [catch], data = [none]
if (bUseCache)
remoteTable = new CachedRemoteTable(remoteTable);
table = new RemoteFieldTable(record, remoteTable, this.getRemoteTask()); // depends on control dependency: [if], data = [none]
}
else
{ // Table exists, make sure cache is correct.
CachedRemoteTable cachedFieldTable = (CachedRemoteTable)table.getRemoteTableType(CachedRemoteTable.class);
SyncRemoteTable syncRemoteTable = (SyncRemoteTable)table.getRemoteTableType(SyncRemoteTable.class);
RemoteTable remoteTable = (RemoteTable)table.getRemoteTableType(TableProxy.class);
if (cachedFieldTable != null)
{
cachedFieldTable.setCacheMode(bUseCache ? CacheMode.CACHE_ON_WRITE : CacheMode.PASSIVE_CACHE, record); // Turn cache on or off // depends on control dependency: [if], data = [none]
}
else if (bUseCache)
{ // Add cache to chain
if ((remoteTable != null)
&& (syncRemoteTable != null)
&& (syncRemoteTable.getRemoteTable() == remoteTable))
{
remoteTable = new CachedRemoteTable(remoteTable); // depends on control dependency: [if], data = [none]
syncRemoteTable.setRemoteTable(remoteTable); // depends on control dependency: [if], data = [none]
}
else
Util.getLogger().severe("Can't add cache, Remote table chain is not as expected.");
}
}
return table;
} }
|
public class class_name {
public final void setOptions(Map<String, ?> options) {
/* Is verification of YubiKey owners enabled? */
this.verify_yubikey_owner = true;
if (options.get(OPTION_YUBICO_VERIFY_YK_OWNER) != null) {
if ("false".equals(options.get(OPTION_YUBICO_VERIFY_YK_OWNER).toString())) {
this.verify_yubikey_owner = false;
}
}
if (options.get(OPTION_YUBICO_LDAP_PUBLICID_ATTRIBUTE) != null) {
this.publicid_attribute = options.get(OPTION_YUBICO_LDAP_PUBLICID_ATTRIBUTE).toString();
}
if (options.get(OPTION_YUBICO_LDAP_USERNAME_ATTRIBUTE) != null) {
this.username_attribute = options.get(OPTION_YUBICO_LDAP_USERNAME_ATTRIBUTE).toString();
}
if (options.get(OPTION_LDAP_URL) != null) {
this.ldap_url = options.get(OPTION_LDAP_URL).toString();
}
if (options.get(OPTION_LDAP_BASE_DN) != null) {
this.ldap_base_dn = options.get(OPTION_LDAP_BASE_DN).toString();
}
if (options.get(OPTION_LDAP_BIND_DN) != null) {
this.ldap_bind_dn = options.get(OPTION_LDAP_BIND_DN).toString();
}
if (options.get(OPTION_LDAP_BIND_CREDENTIAL) != null) {
this.ldap_bind_credential = options.get(OPTION_LDAP_BIND_CREDENTIAL).toString();
}
LdapConfig config = new LdapConfig(this.ldap_url, this.ldap_base_dn);
config.setBindDn(this.ldap_bind_dn);
config.setBindCredential(this.ldap_bind_credential);
this.ldap = new Ldap(config);
} }
|
public class class_name {
public final void setOptions(Map<String, ?> options) {
/* Is verification of YubiKey owners enabled? */
this.verify_yubikey_owner = true;
if (options.get(OPTION_YUBICO_VERIFY_YK_OWNER) != null) {
if ("false".equals(options.get(OPTION_YUBICO_VERIFY_YK_OWNER).toString())) {
this.verify_yubikey_owner = false; // depends on control dependency: [if], data = [none]
}
}
if (options.get(OPTION_YUBICO_LDAP_PUBLICID_ATTRIBUTE) != null) {
this.publicid_attribute = options.get(OPTION_YUBICO_LDAP_PUBLICID_ATTRIBUTE).toString(); // depends on control dependency: [if], data = [none]
}
if (options.get(OPTION_YUBICO_LDAP_USERNAME_ATTRIBUTE) != null) {
this.username_attribute = options.get(OPTION_YUBICO_LDAP_USERNAME_ATTRIBUTE).toString(); // depends on control dependency: [if], data = [none]
}
if (options.get(OPTION_LDAP_URL) != null) {
this.ldap_url = options.get(OPTION_LDAP_URL).toString(); // depends on control dependency: [if], data = [none]
}
if (options.get(OPTION_LDAP_BASE_DN) != null) {
this.ldap_base_dn = options.get(OPTION_LDAP_BASE_DN).toString(); // depends on control dependency: [if], data = [none]
}
if (options.get(OPTION_LDAP_BIND_DN) != null) {
this.ldap_bind_dn = options.get(OPTION_LDAP_BIND_DN).toString(); // depends on control dependency: [if], data = [none]
}
if (options.get(OPTION_LDAP_BIND_CREDENTIAL) != null) {
this.ldap_bind_credential = options.get(OPTION_LDAP_BIND_CREDENTIAL).toString(); // depends on control dependency: [if], data = [none]
}
LdapConfig config = new LdapConfig(this.ldap_url, this.ldap_base_dn);
config.setBindDn(this.ldap_bind_dn);
config.setBindCredential(this.ldap_bind_credential);
this.ldap = new Ldap(config);
} }
|
public class class_name {
public DatalogProgram createDatalog(SWRLRule rule){
rule.accept(this);
if (notSupported){
log.warn("Not Supported Translation of: "+ errors);
errors.clear();
}
DatalogProgram dp = datalogFactory.getDatalogProgram();
dp.appendRule(facts);
return dp;
} }
|
public class class_name {
public DatalogProgram createDatalog(SWRLRule rule){
rule.accept(this);
if (notSupported){
log.warn("Not Supported Translation of: "+ errors); // depends on control dependency: [if], data = [none]
errors.clear(); // depends on control dependency: [if], data = [none]
}
DatalogProgram dp = datalogFactory.getDatalogProgram();
dp.appendRule(facts);
return dp;
} }
|
public class class_name {
public void stopSyncPostJournal(AlluxioURI syncPoint) throws InvalidPathException {
MountTable.Resolution resolution = mMountTable.resolve(syncPoint);
long mountId = resolution.getMountId();
// Remove initial sync thread
Future<?> syncFuture = mSyncPathStatus.remove(syncPoint);
if (syncFuture != null) {
syncFuture.cancel(true);
}
if (mFilterMap.get(mountId).isEmpty()) {
// syncPoint removed was the last syncPoint for the mountId
mFilterMap.remove(mountId);
Future<?> future = mPollerMap.remove(mountId);
if (future != null) {
future.cancel(true);
}
}
// Tell UFS to stop monitoring the path
try (CloseableResource<UnderFileSystem> ufs = resolution.acquireUfsResource()) {
ufs.get().stopSync(resolution.getUri());
} catch (IOException e) {
LOG.info("Ufs IOException for uri {}, exception is {}", syncPoint, e);
}
// Stop active sync polling on a particular UFS if it is the last sync point
if (mFilterMap.containsKey(mountId) && mFilterMap.get(mountId).isEmpty()) {
try (CloseableResource<UnderFileSystem> ufs = resolution.acquireUfsResource()) {
ufs.get().stopActiveSyncPolling();
} catch (IOException e) {
LOG.warn("Encountered IOException when trying to stop polling thread {}", e);
}
}
} }
|
public class class_name {
public void stopSyncPostJournal(AlluxioURI syncPoint) throws InvalidPathException {
MountTable.Resolution resolution = mMountTable.resolve(syncPoint);
long mountId = resolution.getMountId();
// Remove initial sync thread
Future<?> syncFuture = mSyncPathStatus.remove(syncPoint);
if (syncFuture != null) {
syncFuture.cancel(true);
}
if (mFilterMap.get(mountId).isEmpty()) {
// syncPoint removed was the last syncPoint for the mountId
mFilterMap.remove(mountId);
Future<?> future = mPollerMap.remove(mountId);
if (future != null) {
future.cancel(true); // depends on control dependency: [if], data = [none]
}
}
// Tell UFS to stop monitoring the path
try (CloseableResource<UnderFileSystem> ufs = resolution.acquireUfsResource()) {
ufs.get().stopSync(resolution.getUri());
} catch (IOException e) {
LOG.info("Ufs IOException for uri {}, exception is {}", syncPoint, e);
}
// Stop active sync polling on a particular UFS if it is the last sync point
if (mFilterMap.containsKey(mountId) && mFilterMap.get(mountId).isEmpty()) {
try (CloseableResource<UnderFileSystem> ufs = resolution.acquireUfsResource()) {
ufs.get().stopActiveSyncPolling();
} catch (IOException e) {
LOG.warn("Encountered IOException when trying to stop polling thread {}", e);
}
}
} }
|
public class class_name {
public void marshall(Attachment attachment, ProtocolMarshaller protocolMarshaller) {
if (attachment == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(attachment.getFileName(), FILENAME_BINDING);
protocolMarshaller.marshall(attachment.getData(), DATA_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(Attachment attachment, ProtocolMarshaller protocolMarshaller) {
if (attachment == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(attachment.getFileName(), FILENAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(attachment.getData(), DATA_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static void helpQuiesce() {
Thread t;
if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
ForkJoinWorkerThread wt = (ForkJoinWorkerThread) t;
wt.pool.helpQuiescePool(wt.workQueue);
} else
ForkJoinPool.quiesceCommonPool();
} }
|
public class class_name {
public static void helpQuiesce() {
Thread t;
if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread) {
ForkJoinWorkerThread wt = (ForkJoinWorkerThread) t;
wt.pool.helpQuiescePool(wt.workQueue); // depends on control dependency: [if], data = [none]
} else
ForkJoinPool.quiesceCommonPool();
} }
|
public class class_name {
protected static Object fixupRefRelativeRowOneToOne(final Object ptg,
final Row newRow) {
if (ptg instanceof RefPtgBase) {
if (ptg instanceof Ref3DPxg) {
Ref3DPxg ref3dPxg = (Ref3DPxg) ptg;
Ref3DPxg new3dpxg = new Ref3DPxg(
ref3dPxg.getExternalWorkbookNumber(),
new SheetIdentifier(null,
new NameIdentifier(ref3dPxg.getSheetName(),
false)),
new CellReference(newRow.getRowNum(),
ref3dPxg.getColumn()));
new3dpxg.setClass(ref3dPxg.getPtgClass());
new3dpxg.setColRelative(ref3dPxg.isColRelative());
new3dpxg.setRowRelative(ref3dPxg.isRowRelative());
new3dpxg.setLastSheetName(ref3dPxg.getLastSheetName());
return new3dpxg;
} else {
RefPtgBase refPtgBase = (RefPtgBase) ptg;
return new RefPtg(newRow.getRowNum(),
refPtgBase.getColumn(), refPtgBase.isRowRelative(),
refPtgBase.isColRelative());
}
} else {
if (ptg instanceof Area3DPxg) {
Area3DPxg area3dPxg = (Area3DPxg) ptg;
Area3DPxg new3dpxg = new Area3DPxg(
area3dPxg.getExternalWorkbookNumber(),
new SheetIdentifier(null,
new NameIdentifier(area3dPxg.getSheetName(),
false)),
area3dPxg.format2DRefAsString());
new3dpxg.setClass(area3dPxg.getPtgClass());
new3dpxg.setFirstColRelative(
area3dPxg.isFirstColRelative());
new3dpxg.setLastColRelative(area3dPxg.isLastColRelative());
int shiftRow = newRow.getRowNum() - area3dPxg.getFirstRow();
new3dpxg.setFirstRow(area3dPxg.getFirstRow() + shiftRow);
new3dpxg.setLastRow(area3dPxg.getLastRow() + shiftRow);
new3dpxg.setFirstRowRelative(
area3dPxg.isFirstRowRelative());
new3dpxg.setLastRowRelative(area3dPxg.isLastRowRelative());
new3dpxg.setLastSheetName(area3dPxg.getLastSheetName());
return new3dpxg;
} else {
AreaPtgBase areaPtgBase = (AreaPtgBase) ptg;
int shiftRow = newRow.getRowNum()
- areaPtgBase.getFirstRow();
return new AreaPtg(areaPtgBase.getFirstRow() + shiftRow,
areaPtgBase.getLastRow() + shiftRow,
areaPtgBase.getFirstColumn(),
areaPtgBase.getLastColumn(),
areaPtgBase.isFirstRowRelative(),
areaPtgBase.isLastRowRelative(),
areaPtgBase.isFirstColRelative(),
areaPtgBase.isLastColRelative());
}
}
} }
|
public class class_name {
protected static Object fixupRefRelativeRowOneToOne(final Object ptg,
final Row newRow) {
if (ptg instanceof RefPtgBase) {
if (ptg instanceof Ref3DPxg) {
Ref3DPxg ref3dPxg = (Ref3DPxg) ptg;
Ref3DPxg new3dpxg = new Ref3DPxg(
ref3dPxg.getExternalWorkbookNumber(),
new SheetIdentifier(null,
new NameIdentifier(ref3dPxg.getSheetName(),
false)),
new CellReference(newRow.getRowNum(),
ref3dPxg.getColumn()));
new3dpxg.setClass(ref3dPxg.getPtgClass());
// depends on control dependency: [if], data = [none]
new3dpxg.setColRelative(ref3dPxg.isColRelative());
// depends on control dependency: [if], data = [none]
new3dpxg.setRowRelative(ref3dPxg.isRowRelative());
// depends on control dependency: [if], data = [none]
new3dpxg.setLastSheetName(ref3dPxg.getLastSheetName());
// depends on control dependency: [if], data = [none]
return new3dpxg;
// depends on control dependency: [if], data = [none]
} else {
RefPtgBase refPtgBase = (RefPtgBase) ptg;
return new RefPtg(newRow.getRowNum(),
refPtgBase.getColumn(), refPtgBase.isRowRelative(),
refPtgBase.isColRelative());
// depends on control dependency: [if], data = [none]
}
} else {
if (ptg instanceof Area3DPxg) {
Area3DPxg area3dPxg = (Area3DPxg) ptg;
Area3DPxg new3dpxg = new Area3DPxg(
area3dPxg.getExternalWorkbookNumber(),
new SheetIdentifier(null,
new NameIdentifier(area3dPxg.getSheetName(),
false)),
area3dPxg.format2DRefAsString());
new3dpxg.setClass(area3dPxg.getPtgClass());
// depends on control dependency: [if], data = [none]
new3dpxg.setFirstColRelative(
area3dPxg.isFirstColRelative());
// depends on control dependency: [if], data = [none]
new3dpxg.setLastColRelative(area3dPxg.isLastColRelative());
// depends on control dependency: [if], data = [none]
int shiftRow = newRow.getRowNum() - area3dPxg.getFirstRow();
new3dpxg.setFirstRow(area3dPxg.getFirstRow() + shiftRow);
// depends on control dependency: [if], data = [none]
new3dpxg.setLastRow(area3dPxg.getLastRow() + shiftRow);
// depends on control dependency: [if], data = [none]
new3dpxg.setFirstRowRelative(
area3dPxg.isFirstRowRelative());
// depends on control dependency: [if], data = [none]
new3dpxg.setLastRowRelative(area3dPxg.isLastRowRelative());
// depends on control dependency: [if], data = [none]
new3dpxg.setLastSheetName(area3dPxg.getLastSheetName());
// depends on control dependency: [if], data = [none]
return new3dpxg;
// depends on control dependency: [if], data = [none]
} else {
AreaPtgBase areaPtgBase = (AreaPtgBase) ptg;
int shiftRow = newRow.getRowNum()
- areaPtgBase.getFirstRow();
return new AreaPtg(areaPtgBase.getFirstRow() + shiftRow,
areaPtgBase.getLastRow() + shiftRow,
areaPtgBase.getFirstColumn(),
areaPtgBase.getLastColumn(),
areaPtgBase.isFirstRowRelative(),
areaPtgBase.isLastRowRelative(),
areaPtgBase.isFirstColRelative(),
areaPtgBase.isLastColRelative());
// depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public CmsPermissionSetCustom getPermissions(CmsUser user, List<CmsGroup> groups, List<CmsRole> roles) {
CmsPermissionSetCustom sum = new CmsPermissionSetCustom();
boolean hasPermissions = false;
CmsPermissionSet p = m_permissions.get(user.getId());
if (p != null) {
sum.addPermissions(p);
hasPermissions = true;
}
if (groups != null) {
int size = groups.size();
for (int i = 0; i < size; i++) {
I_CmsPrincipal principal = groups.get(i);
p = m_permissions.get(principal.getId());
if (p != null) {
sum.addPermissions(p);
hasPermissions = true;
}
}
}
if (roles != null) {
int size = roles.size();
for (int i = 0; i < size; i++) {
CmsRole role = roles.get(i);
p = m_permissions.get(role.getId());
if (p != null) {
sum.addPermissions(p);
hasPermissions = true;
}
}
}
if (!hasPermissions) {
// if no applicable entry is found check the 'all others' entry
p = m_permissions.get(CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID);
if (p != null) {
sum.addPermissions(p);
}
}
return sum;
} }
|
public class class_name {
public CmsPermissionSetCustom getPermissions(CmsUser user, List<CmsGroup> groups, List<CmsRole> roles) {
CmsPermissionSetCustom sum = new CmsPermissionSetCustom();
boolean hasPermissions = false;
CmsPermissionSet p = m_permissions.get(user.getId());
if (p != null) {
sum.addPermissions(p); // depends on control dependency: [if], data = [(p]
hasPermissions = true; // depends on control dependency: [if], data = [none]
}
if (groups != null) {
int size = groups.size();
for (int i = 0; i < size; i++) {
I_CmsPrincipal principal = groups.get(i);
p = m_permissions.get(principal.getId()); // depends on control dependency: [for], data = [none]
if (p != null) {
sum.addPermissions(p); // depends on control dependency: [if], data = [(p]
hasPermissions = true; // depends on control dependency: [if], data = [none]
}
}
}
if (roles != null) {
int size = roles.size();
for (int i = 0; i < size; i++) {
CmsRole role = roles.get(i);
p = m_permissions.get(role.getId()); // depends on control dependency: [for], data = [none]
if (p != null) {
sum.addPermissions(p); // depends on control dependency: [if], data = [(p]
hasPermissions = true; // depends on control dependency: [if], data = [none]
}
}
}
if (!hasPermissions) {
// if no applicable entry is found check the 'all others' entry
p = m_permissions.get(CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_ID); // depends on control dependency: [if], data = [none]
if (p != null) {
sum.addPermissions(p); // depends on control dependency: [if], data = [(p]
}
}
return sum;
} }
|
public class class_name {
private static TypeElement resolveType(Elements elements, String className, StringBuilder sb,
final int index) {
// We assume '$' should be converted to '.'. So we search for classes with dots first.
sb.setCharAt(index, '.');
int nextIndex = nextDollar(className, sb, index + 1);
TypeElement type = nextIndex == -1
? getTypeElement(elements, sb)
: resolveType(elements, className, sb, nextIndex);
if (type != null) {
return type;
}
// if not found, change back to dollar and search.
sb.setCharAt(index, '$');
nextIndex = nextDollar(className, sb, index + 1);
return nextIndex == -1
? getTypeElement(elements, sb)
: resolveType(elements, className, sb, nextIndex);
} }
|
public class class_name {
private static TypeElement resolveType(Elements elements, String className, StringBuilder sb,
final int index) {
// We assume '$' should be converted to '.'. So we search for classes with dots first.
sb.setCharAt(index, '.');
int nextIndex = nextDollar(className, sb, index + 1);
TypeElement type = nextIndex == -1
? getTypeElement(elements, sb)
: resolveType(elements, className, sb, nextIndex);
if (type != null) {
return type; // depends on control dependency: [if], data = [none]
}
// if not found, change back to dollar and search.
sb.setCharAt(index, '$');
nextIndex = nextDollar(className, sb, index + 1);
return nextIndex == -1
? getTypeElement(elements, sb)
: resolveType(elements, className, sb, nextIndex);
} }
|
public class class_name {
@Deprecated
public final long sslCtxPointer() {
Lock readerLock = ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.getSslCtx(ctx);
} finally {
readerLock.unlock();
}
} }
|
public class class_name {
@Deprecated
public final long sslCtxPointer() {
Lock readerLock = ctxLock.readLock();
readerLock.lock();
try {
return SSLContext.getSslCtx(ctx); // depends on control dependency: [try], data = [none]
} finally {
readerLock.unlock();
}
} }
|
public class class_name {
public static void addHttp2ToHttpHeaders(int streamId, Http2Headers inputHeaders, HttpHeaders outputHeaders,
HttpVersion httpVersion, boolean isTrailer, boolean isRequest) throws Http2Exception {
Http2ToHttpHeaderTranslator translator = new Http2ToHttpHeaderTranslator(streamId, outputHeaders, isRequest);
try {
for (Entry<CharSequence, CharSequence> entry : inputHeaders) {
translator.translate(entry);
}
} catch (Http2Exception ex) {
throw ex;
} catch (Throwable t) {
throw streamError(streamId, PROTOCOL_ERROR, t, "HTTP/2 to HTTP/1.x headers conversion error");
}
outputHeaders.remove(HttpHeaderNames.TRANSFER_ENCODING);
outputHeaders.remove(HttpHeaderNames.TRAILER);
if (!isTrailer) {
outputHeaders.setInt(ExtensionHeaderNames.STREAM_ID.text(), streamId);
HttpUtil.setKeepAlive(outputHeaders, httpVersion, true);
}
} }
|
public class class_name {
public static void addHttp2ToHttpHeaders(int streamId, Http2Headers inputHeaders, HttpHeaders outputHeaders,
HttpVersion httpVersion, boolean isTrailer, boolean isRequest) throws Http2Exception {
Http2ToHttpHeaderTranslator translator = new Http2ToHttpHeaderTranslator(streamId, outputHeaders, isRequest);
try {
for (Entry<CharSequence, CharSequence> entry : inputHeaders) {
translator.translate(entry); // depends on control dependency: [for], data = [entry]
}
} catch (Http2Exception ex) {
throw ex;
} catch (Throwable t) {
throw streamError(streamId, PROTOCOL_ERROR, t, "HTTP/2 to HTTP/1.x headers conversion error");
}
outputHeaders.remove(HttpHeaderNames.TRANSFER_ENCODING);
outputHeaders.remove(HttpHeaderNames.TRAILER);
if (!isTrailer) {
outputHeaders.setInt(ExtensionHeaderNames.STREAM_ID.text(), streamId);
HttpUtil.setKeepAlive(outputHeaders, httpVersion, true);
}
} }
|
public class class_name {
@SneakyThrows(DurableDataLogException.class)
private void tryTruncate(LedgerAddress upToAddress) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "tryTruncate", upToAddress);
// Truncate the metadata and get a new copy of it.
val oldMetadata = getLogMetadata();
val newMetadata = oldMetadata.truncate(upToAddress);
// Attempt to persist the new Log Metadata. We need to do this first because if we delete the ledgers but were
// unable to update the metadata, then the log will be corrupted (metadata points to inexistent ledgers).
persistMetadata(newMetadata, false);
// Repoint our metadata to the new one.
synchronized (this.lock) {
this.logMetadata = newMetadata;
}
// Determine ledgers to delete and delete them.
val ledgerIdsToKeep = newMetadata.getLedgers().stream().map(LedgerMetadata::getLedgerId).collect(Collectors.toSet());
val ledgersToDelete = oldMetadata.getLedgers().stream().filter(lm -> !ledgerIdsToKeep.contains(lm.getLedgerId())).iterator();
while (ledgersToDelete.hasNext()) {
val lm = ledgersToDelete.next();
try {
Ledgers.delete(lm.getLedgerId(), this.bookKeeper);
} catch (DurableDataLogException ex) {
// Nothing we can do if we can't delete a ledger; we've already updated the metadata. Log the error and
// move on.
log.error("{}: Unable to delete truncated ledger {}.", this.traceObjectId, lm.getLedgerId(), ex);
}
}
log.info("{}: Truncated up to {}.", this.traceObjectId, upToAddress);
LoggerHelpers.traceLeave(log, this.traceObjectId, "tryTruncate", traceId, upToAddress);
} }
|
public class class_name {
@SneakyThrows(DurableDataLogException.class)
private void tryTruncate(LedgerAddress upToAddress) {
long traceId = LoggerHelpers.traceEnterWithContext(log, this.traceObjectId, "tryTruncate", upToAddress);
// Truncate the metadata and get a new copy of it.
val oldMetadata = getLogMetadata();
val newMetadata = oldMetadata.truncate(upToAddress);
// Attempt to persist the new Log Metadata. We need to do this first because if we delete the ledgers but were
// unable to update the metadata, then the log will be corrupted (metadata points to inexistent ledgers).
persistMetadata(newMetadata, false);
// Repoint our metadata to the new one.
synchronized (this.lock) {
this.logMetadata = newMetadata;
}
// Determine ledgers to delete and delete them.
val ledgerIdsToKeep = newMetadata.getLedgers().stream().map(LedgerMetadata::getLedgerId).collect(Collectors.toSet());
val ledgersToDelete = oldMetadata.getLedgers().stream().filter(lm -> !ledgerIdsToKeep.contains(lm.getLedgerId())).iterator();
while (ledgersToDelete.hasNext()) {
val lm = ledgersToDelete.next();
try {
Ledgers.delete(lm.getLedgerId(), this.bookKeeper); // depends on control dependency: [try], data = [none]
} catch (DurableDataLogException ex) {
// Nothing we can do if we can't delete a ledger; we've already updated the metadata. Log the error and
// move on.
log.error("{}: Unable to delete truncated ledger {}.", this.traceObjectId, lm.getLedgerId(), ex);
} // depends on control dependency: [catch], data = [none]
}
log.info("{}: Truncated up to {}.", this.traceObjectId, upToAddress);
LoggerHelpers.traceLeave(log, this.traceObjectId, "tryTruncate", traceId, upToAddress);
} }
|
public class class_name {
@Override
public boolean scrollByOffset(final float xOffset, final float yOffset, final float zOffset,
final LayoutScroller.OnScrollListener listener) {
if (isScrolling()) {
return false;
}
Vector3Axis offset = new Vector3Axis(xOffset, yOffset, zOffset);
if (offset.isInfinite() || offset.isNaN()) {
Log.e(TAG, new IllegalArgumentException(),
"Invalid scrolling delta: %s", offset);
return false;
}
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollBy(%s): offset %s", getName(), offset);
onScrollImpl(offset, listener);
return true;
} }
|
public class class_name {
@Override
public boolean scrollByOffset(final float xOffset, final float yOffset, final float zOffset,
final LayoutScroller.OnScrollListener listener) {
if (isScrolling()) {
return false; // depends on control dependency: [if], data = [none]
}
Vector3Axis offset = new Vector3Axis(xOffset, yOffset, zOffset);
if (offset.isInfinite() || offset.isNaN()) {
Log.e(TAG, new IllegalArgumentException(),
"Invalid scrolling delta: %s", offset); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
Log.d(Log.SUBSYSTEM.LAYOUT, TAG, "scrollBy(%s): offset %s", getName(), offset);
onScrollImpl(offset, listener);
return true;
} }
|
public class class_name {
@Override
public SocketAddress getLocalSocketAddress() {
if(session != null && session.isOpen()){
return session.getLocalAddress();
}
return null;
} }
|
public class class_name {
@Override
public SocketAddress getLocalSocketAddress() {
if(session != null && session.isOpen()){
return session.getLocalAddress(); // depends on control dependency: [if], data = [none]
}
return null;
} }
|
public class class_name {
public void setCertificates(java.util.Collection<Certificate> certificates) {
if (certificates == null) {
this.certificates = null;
return;
}
this.certificates = new java.util.ArrayList<Certificate>(certificates);
} }
|
public class class_name {
public void setCertificates(java.util.Collection<Certificate> certificates) {
if (certificates == null) {
this.certificates = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.certificates = new java.util.ArrayList<Certificate>(certificates);
} }
|
public class class_name {
public static void setRequiredFieldConf(Configuration conf,
RequiredFieldList requiredFieldList) {
// set required fields conf for RCFile[Protobuf|Thrift] input format
String value = "";
if (requiredFieldList != null) {
List<Integer> indices = Lists.newArrayList();
for(RequiredField f : requiredFieldList.getFields()) {
indices.add(f.getIndex());
}
value = Joiner.on(",").join(indices);
}
conf.set(RCFileUtil.REQUIRED_FIELD_INDICES_CONF, value);
} }
|
public class class_name {
public static void setRequiredFieldConf(Configuration conf,
RequiredFieldList requiredFieldList) {
// set required fields conf for RCFile[Protobuf|Thrift] input format
String value = "";
if (requiredFieldList != null) {
List<Integer> indices = Lists.newArrayList();
for(RequiredField f : requiredFieldList.getFields()) {
indices.add(f.getIndex()); // depends on control dependency: [for], data = [f]
}
value = Joiner.on(",").join(indices); // depends on control dependency: [if], data = [none]
}
conf.set(RCFileUtil.REQUIRED_FIELD_INDICES_CONF, value);
} }
|
public class class_name {
@Override
public void removeByCPOptionCategoryId(long CPOptionCategoryId) {
for (CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue : findByCPOptionCategoryId(
CPOptionCategoryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionSpecificationOptionValue);
}
} }
|
public class class_name {
@Override
public void removeByCPOptionCategoryId(long CPOptionCategoryId) {
for (CPDefinitionSpecificationOptionValue cpDefinitionSpecificationOptionValue : findByCPOptionCategoryId(
CPOptionCategoryId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
remove(cpDefinitionSpecificationOptionValue); // depends on control dependency: [for], data = [cpDefinitionSpecificationOptionValue]
}
} }
|
public class class_name {
AttributeSet withLocale(Locale locale) {
Attributes.Builder builder = new Attributes.Builder();
builder.setAll(this.attributes);
String plus;
String minus;
String lang = LanguageMatch.getAlias(locale);
String country = FormatUtils.getRegion(locale);
if (lang.equals("zh") && locale.getScript().equals("Hant")) {
country = "TW";
}
if (lang.isEmpty() && country.isEmpty()) {
locale = Locale.ROOT;
builder.set(Attributes.NUMBER_SYSTEM, NumberSystem.ARABIC);
builder.set(Attributes.DECIMAL_SEPARATOR, ISO_DECIMAL_SEPARATOR);
plus = "+";
minus = "-";
} else {
String key = lang;
if (!country.isEmpty()) {
key = key + "_" + country;
}
NumericalSymbols symbols = NUMBER_SYMBOL_CACHE.get(key);
if (symbols == null) {
try {
symbols =
new NumericalSymbols(
NUMBER_SYMBOLS.getDefaultNumberSystem(locale),
NUMBER_SYMBOLS.getZeroDigit(locale),
NUMBER_SYMBOLS.getDecimalSeparator(locale),
NUMBER_SYMBOLS.getPlusSign(locale),
NUMBER_SYMBOLS.getMinusSign(locale)
);
} catch (RuntimeException re) {
symbols = DEFAULT_NUMERICAL_SYMBOLS;
}
NumericalSymbols old =
NUMBER_SYMBOL_CACHE.putIfAbsent(key, symbols);
if (old != null) {
symbols = old;
}
}
String code = locale.getUnicodeLocaleType("nu");
char zeroChar = symbols.zeroDigit;
NumberSystem numsys;
if (code == null) {
numsys = symbols.defnumsys;
} else {
numsys = null;
for (NumberSystem ns : NumberSystem.values()) {
if (code.equals(ns.getCode())) {
numsys = ns;
if (numsys.isDecimal()) {
zeroChar = numsys.getDigits().charAt(0);
}
break;
}
}
if (numsys == null) {
throw new IllegalArgumentException("Unsupported unicode-nu-extension: " + code);
}
}
builder.set(Attributes.NUMBER_SYSTEM, numsys);
builder.set(Attributes.ZERO_DIGIT, zeroChar);
builder.set(Attributes.DECIMAL_SEPARATOR, symbols.decimalSeparator);
plus = symbols.plus;
minus = symbols.minus;
}
builder.setLanguage(locale);
Map<String, Object> newInternals = new HashMap<>(this.internals);
newInternals.put(PLUS_SIGN.name(), plus);
newInternals.put(MINUS_SIGN.name(), minus);
return new AttributeSet(builder.build(), locale, this.level, this.section, this.printCondition, newInternals);
} }
|
public class class_name {
AttributeSet withLocale(Locale locale) {
Attributes.Builder builder = new Attributes.Builder();
builder.setAll(this.attributes);
String plus;
String minus;
String lang = LanguageMatch.getAlias(locale);
String country = FormatUtils.getRegion(locale);
if (lang.equals("zh") && locale.getScript().equals("Hant")) {
country = "TW"; // depends on control dependency: [if], data = [none]
}
if (lang.isEmpty() && country.isEmpty()) {
locale = Locale.ROOT; // depends on control dependency: [if], data = [none]
builder.set(Attributes.NUMBER_SYSTEM, NumberSystem.ARABIC); // depends on control dependency: [if], data = [none]
builder.set(Attributes.DECIMAL_SEPARATOR, ISO_DECIMAL_SEPARATOR); // depends on control dependency: [if], data = [none]
plus = "+";
minus = "-"; // depends on control dependency: [if], data = [none]
} else {
String key = lang;
if (!country.isEmpty()) {
key = key + "_" + country; // depends on control dependency: [if], data = [none]
}
NumericalSymbols symbols = NUMBER_SYMBOL_CACHE.get(key);
if (symbols == null) {
try {
symbols =
new NumericalSymbols(
NUMBER_SYMBOLS.getDefaultNumberSystem(locale),
NUMBER_SYMBOLS.getZeroDigit(locale),
NUMBER_SYMBOLS.getDecimalSeparator(locale),
NUMBER_SYMBOLS.getPlusSign(locale),
NUMBER_SYMBOLS.getMinusSign(locale)
); // depends on control dependency: [try], data = [none]
} catch (RuntimeException re) {
symbols = DEFAULT_NUMERICAL_SYMBOLS;
} // depends on control dependency: [catch], data = [none]
NumericalSymbols old =
NUMBER_SYMBOL_CACHE.putIfAbsent(key, symbols);
if (old != null) {
symbols = old; // depends on control dependency: [if], data = [none]
}
}
String code = locale.getUnicodeLocaleType("nu");
char zeroChar = symbols.zeroDigit;
NumberSystem numsys;
if (code == null) {
numsys = symbols.defnumsys; // depends on control dependency: [if], data = [none]
} else {
numsys = null; // depends on control dependency: [if], data = [none]
for (NumberSystem ns : NumberSystem.values()) {
if (code.equals(ns.getCode())) {
numsys = ns; // depends on control dependency: [if], data = [none]
if (numsys.isDecimal()) {
zeroChar = numsys.getDigits().charAt(0); // depends on control dependency: [if], data = [none]
}
break;
}
}
if (numsys == null) {
throw new IllegalArgumentException("Unsupported unicode-nu-extension: " + code);
}
}
builder.set(Attributes.NUMBER_SYSTEM, numsys); // depends on control dependency: [if], data = [none]
builder.set(Attributes.ZERO_DIGIT, zeroChar); // depends on control dependency: [if], data = [none]
builder.set(Attributes.DECIMAL_SEPARATOR, symbols.decimalSeparator); // depends on control dependency: [if], data = [none]
plus = symbols.plus; // depends on control dependency: [if], data = [none]
minus = symbols.minus; // depends on control dependency: [if], data = [none]
}
builder.setLanguage(locale);
Map<String, Object> newInternals = new HashMap<>(this.internals);
newInternals.put(PLUS_SIGN.name(), plus);
newInternals.put(MINUS_SIGN.name(), minus);
return new AttributeSet(builder.build(), locale, this.level, this.section, this.printCondition, newInternals);
} }
|
public class class_name {
public ListChannelsResult withChannels(Channel... channels) {
if (this.channels == null) {
setChannels(new java.util.ArrayList<Channel>(channels.length));
}
for (Channel ele : channels) {
this.channels.add(ele);
}
return this;
} }
|
public class class_name {
public ListChannelsResult withChannels(Channel... channels) {
if (this.channels == null) {
setChannels(new java.util.ArrayList<Channel>(channels.length)); // depends on control dependency: [if], data = [none]
}
for (Channel ele : channels) {
this.channels.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
@Override
public List<Class<?>> retrieveJAXWSHandlers(J2EEName j2eeName) {
JaxWsModuleMetaData jaxWsModuleMetaData = JaxWsMetaDataManager.getJaxWsModuleMetaData();
if (jaxWsModuleMetaData == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unable to get the JaxWsModuleMetaData from current invocation context while querying EJBHandler");
}
return null;
}
JaxWsModuleInfo jaxWsModuleInfo = null;
try {
Container containerToAdapt = jaxWsModuleMetaData.getModuleContainer();
jaxWsModuleInfo = containerToAdapt.adapt(JaxWsModuleInfo.class);
} catch (UnableToAdaptException e) {
throw new IllegalStateException(e);
}
if (jaxWsModuleInfo == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unable to get the JaxWsModuleInfo from current module {0} while querying EJBHandler", jaxWsModuleMetaData.getModuleInfo().getName());
}
return null;
}
JaxWsServerMetaData jaxwsServerMetaData = jaxWsModuleMetaData.getServerMetaData();
String endpointName = jaxwsServerMetaData.retrieveEndpointName(j2eeName);
if (endpointName == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "No endpoint with j2eeName {0} exists in module {1}", j2eeName, jaxWsModuleMetaData.getModuleInfo().getName());
}
return null;
}
EndpointInfo endpointInfo = jaxWsModuleInfo.getEndpointInfo(endpointName);
if (endpointInfo == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "No endpoint with endpoint name {0} exists in module {1}", endpointName, jaxWsModuleMetaData.getModuleInfo().getName());
}
return null;
}
ClassLoader appContextClassLoader = jaxWsModuleMetaData.getAppContextClassLoader();
List<HandlerInfo> handlerInfos = endpointInfo.getHandlerChainsInfo().getAllHandlerInfos();
List<Class<?>> handlerClasses = new ArrayList<Class<?>>(handlerInfos.size());
for (HandlerInfo handlerInfo : handlerInfos) {
String handlerClassName = handlerInfo.getHandlerClass();
try {
Class<?> handlerClass = appContextClassLoader.loadClass(handlerClassName);
handlerClasses.add(handlerClass);
} catch (ClassNotFoundException e) {
Tr.warning(tc, "warn.could.not.find.handler", handlerClassName, e.getMessage());
}
}
return handlerClasses;
} }
|
public class class_name {
@Override
public List<Class<?>> retrieveJAXWSHandlers(J2EEName j2eeName) {
JaxWsModuleMetaData jaxWsModuleMetaData = JaxWsMetaDataManager.getJaxWsModuleMetaData();
if (jaxWsModuleMetaData == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unable to get the JaxWsModuleMetaData from current invocation context while querying EJBHandler"); // depends on control dependency: [if], data = [none]
}
return null; // depends on control dependency: [if], data = [none]
}
JaxWsModuleInfo jaxWsModuleInfo = null;
try {
Container containerToAdapt = jaxWsModuleMetaData.getModuleContainer();
jaxWsModuleInfo = containerToAdapt.adapt(JaxWsModuleInfo.class); // depends on control dependency: [try], data = [none]
} catch (UnableToAdaptException e) {
throw new IllegalStateException(e);
} // depends on control dependency: [catch], data = [none]
if (jaxWsModuleInfo == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Unable to get the JaxWsModuleInfo from current module {0} while querying EJBHandler", jaxWsModuleMetaData.getModuleInfo().getName()); // depends on control dependency: [if], data = [none]
}
return null; // depends on control dependency: [if], data = [none]
}
JaxWsServerMetaData jaxwsServerMetaData = jaxWsModuleMetaData.getServerMetaData();
String endpointName = jaxwsServerMetaData.retrieveEndpointName(j2eeName);
if (endpointName == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "No endpoint with j2eeName {0} exists in module {1}", j2eeName, jaxWsModuleMetaData.getModuleInfo().getName()); // depends on control dependency: [if], data = [none]
}
return null; // depends on control dependency: [if], data = [none]
}
EndpointInfo endpointInfo = jaxWsModuleInfo.getEndpointInfo(endpointName);
if (endpointInfo == null) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "No endpoint with endpoint name {0} exists in module {1}", endpointName, jaxWsModuleMetaData.getModuleInfo().getName()); // depends on control dependency: [if], data = [none]
}
return null; // depends on control dependency: [if], data = [none]
}
ClassLoader appContextClassLoader = jaxWsModuleMetaData.getAppContextClassLoader();
List<HandlerInfo> handlerInfos = endpointInfo.getHandlerChainsInfo().getAllHandlerInfos();
List<Class<?>> handlerClasses = new ArrayList<Class<?>>(handlerInfos.size());
for (HandlerInfo handlerInfo : handlerInfos) {
String handlerClassName = handlerInfo.getHandlerClass();
try {
Class<?> handlerClass = appContextClassLoader.loadClass(handlerClassName);
handlerClasses.add(handlerClass);
} catch (ClassNotFoundException e) {
Tr.warning(tc, "warn.could.not.find.handler", handlerClassName, e.getMessage());
} // depends on control dependency: [catch], data = [none]
}
return handlerClasses;
} }
|
public class class_name {
public static Query setPageParameter(Query query, Pageable pageable){
if( notNull( pageable ) ){
query.setFirstResult( (pageable.getPageNumber()-1) * pageable.getPageSize() );
query.setMaxResults(pageable.getPageSize());
}
return query;
} }
|
public class class_name {
public static Query setPageParameter(Query query, Pageable pageable){
if( notNull( pageable ) ){
query.setFirstResult( (pageable.getPageNumber()-1) * pageable.getPageSize() );
// depends on control dependency: [if], data = [none]
query.setMaxResults(pageable.getPageSize());
// depends on control dependency: [if], data = [none]
}
return query;
} }
|
public class class_name {
public List<ContainerRuntimeOptionType<PortletDescriptor>> getAllContainerRuntimeOption()
{
List<ContainerRuntimeOptionType<PortletDescriptor>> list = new ArrayList<ContainerRuntimeOptionType<PortletDescriptor>>();
List<Node> nodeList = model.get("container-runtime-option");
for(Node node: nodeList)
{
ContainerRuntimeOptionType<PortletDescriptor> type = new ContainerRuntimeOptionTypeImpl<PortletDescriptor>(this, "container-runtime-option", model, node);
list.add(type);
}
return list;
} }
|
public class class_name {
public List<ContainerRuntimeOptionType<PortletDescriptor>> getAllContainerRuntimeOption()
{
List<ContainerRuntimeOptionType<PortletDescriptor>> list = new ArrayList<ContainerRuntimeOptionType<PortletDescriptor>>();
List<Node> nodeList = model.get("container-runtime-option");
for(Node node: nodeList)
{
ContainerRuntimeOptionType<PortletDescriptor> type = new ContainerRuntimeOptionTypeImpl<PortletDescriptor>(this, "container-runtime-option", model, node);
list.add(type); // depends on control dependency: [for], data = [none]
}
return list;
} }
|
public class class_name {
public static Set<String> getRequiredFields(Query query)
{
Set<String> dimensions = new HashSet<>();
Set<String> dimsInFilter = null == query.getFilter() ? new HashSet<String>() : query.getFilter().getRequiredColumns();
dimensions.addAll(dimsInFilter);
if (query instanceof TopNQuery) {
TopNQuery q = (TopNQuery) query;
dimensions.addAll(extractFieldsFromAggregations(q.getAggregatorSpecs()));
dimensions.add(q.getDimensionSpec().getDimension());
} else if (query instanceof TimeseriesQuery) {
TimeseriesQuery q = (TimeseriesQuery) query;
dimensions.addAll(extractFieldsFromAggregations(q.getAggregatorSpecs()));
} else if (query instanceof GroupByQuery) {
GroupByQuery q = (GroupByQuery) query;
dimensions.addAll(extractFieldsFromAggregations(q.getAggregatorSpecs()));
for (DimensionSpec spec : q.getDimensions()) {
String dim = spec.getDimension();
dimensions.add(dim);
}
} else {
throw new UnsupportedOperationException("Method getRequeiredFields only support TopNQuery/TimeseriesQuery/GroupByQuery");
}
return dimensions;
} }
|
public class class_name {
public static Set<String> getRequiredFields(Query query)
{
Set<String> dimensions = new HashSet<>();
Set<String> dimsInFilter = null == query.getFilter() ? new HashSet<String>() : query.getFilter().getRequiredColumns();
dimensions.addAll(dimsInFilter);
if (query instanceof TopNQuery) {
TopNQuery q = (TopNQuery) query;
dimensions.addAll(extractFieldsFromAggregations(q.getAggregatorSpecs())); // depends on control dependency: [if], data = [none]
dimensions.add(q.getDimensionSpec().getDimension()); // depends on control dependency: [if], data = [none]
} else if (query instanceof TimeseriesQuery) {
TimeseriesQuery q = (TimeseriesQuery) query;
dimensions.addAll(extractFieldsFromAggregations(q.getAggregatorSpecs())); // depends on control dependency: [if], data = [none]
} else if (query instanceof GroupByQuery) {
GroupByQuery q = (GroupByQuery) query;
dimensions.addAll(extractFieldsFromAggregations(q.getAggregatorSpecs())); // depends on control dependency: [if], data = [none]
for (DimensionSpec spec : q.getDimensions()) {
String dim = spec.getDimension();
dimensions.add(dim); // depends on control dependency: [for], data = [none]
}
} else {
throw new UnsupportedOperationException("Method getRequeiredFields only support TopNQuery/TimeseriesQuery/GroupByQuery");
}
return dimensions;
} }
|
public class class_name {
@Process(actionType = InitBatch.class)
public void init(final Dispatcher.Channel channel) {
List<ModelNode> steps = new ArrayList<>();
steps.add(readResourceOp(BATCH_ADDRESS));
steps.add(readResourceOp(THREAD_POOL_ADDRESS));
steps.add(readResourceOp(JOB_REPOSITORY_ADDRESS));
steps.add(readThreadFactoriesOp());
final ModelNode comp = new ModelNode();
comp.get(ADDRESS).setEmptyList();
comp.get(OP).set(COMPOSITE);
comp.get(STEPS).set(steps);
dispatcher.execute(new DMRAction(comp), new AsyncCallback<DMRResponse>() {
@Override
public void onFailure(Throwable caught) {
channel.nack(caught);
}
@Override
public void onSuccess(DMRResponse dmrResponse) {
ModelNode response = dmrResponse.get();
if (response.isFailure()) {
channel.nack(new RuntimeException("Failed to initialize batch store using " + comp + ": " +
response.getFailureDescription()));
} else {
ModelNode result = response.get(RESULT);
ModelNode stepResult = result.get("step-1");
if (stepResult.get(RESULT).isDefined()) {
batch = stepResult.get(RESULT);
}
stepResult = result.get("step-2");
if (stepResult.get(RESULT).isDefined()) {
threadPool = stepResult.get(RESULT);
}
stepResult = result.get("step-3");
if (stepResult.get(RESULT).isDefined()) {
jobRepository = stepResult.get(RESULT);
}
stepResult = result.get("step-4");
if (stepResult.get(RESULT).isDefined()) {
threadFactories.clear();
threadFactories.addAll(stepResult.get(RESULT).asPropertyList());
}
channel.ack();
}
}
});
} }
|
public class class_name {
@Process(actionType = InitBatch.class)
public void init(final Dispatcher.Channel channel) {
List<ModelNode> steps = new ArrayList<>();
steps.add(readResourceOp(BATCH_ADDRESS));
steps.add(readResourceOp(THREAD_POOL_ADDRESS));
steps.add(readResourceOp(JOB_REPOSITORY_ADDRESS));
steps.add(readThreadFactoriesOp());
final ModelNode comp = new ModelNode();
comp.get(ADDRESS).setEmptyList();
comp.get(OP).set(COMPOSITE);
comp.get(STEPS).set(steps);
dispatcher.execute(new DMRAction(comp), new AsyncCallback<DMRResponse>() {
@Override
public void onFailure(Throwable caught) {
channel.nack(caught);
}
@Override
public void onSuccess(DMRResponse dmrResponse) {
ModelNode response = dmrResponse.get();
if (response.isFailure()) {
channel.nack(new RuntimeException("Failed to initialize batch store using " + comp + ": " +
response.getFailureDescription())); // depends on control dependency: [if], data = [none]
} else {
ModelNode result = response.get(RESULT);
ModelNode stepResult = result.get("step-1");
if (stepResult.get(RESULT).isDefined()) {
batch = stepResult.get(RESULT); // depends on control dependency: [if], data = [none]
}
stepResult = result.get("step-2"); // depends on control dependency: [if], data = [none]
if (stepResult.get(RESULT).isDefined()) {
threadPool = stepResult.get(RESULT); // depends on control dependency: [if], data = [none]
}
stepResult = result.get("step-3"); // depends on control dependency: [if], data = [none]
if (stepResult.get(RESULT).isDefined()) {
jobRepository = stepResult.get(RESULT); // depends on control dependency: [if], data = [none]
}
stepResult = result.get("step-4"); // depends on control dependency: [if], data = [none]
if (stepResult.get(RESULT).isDefined()) {
threadFactories.clear(); // depends on control dependency: [if], data = [none]
threadFactories.addAll(stepResult.get(RESULT).asPropertyList()); // depends on control dependency: [if], data = [none]
}
channel.ack(); // depends on control dependency: [if], data = [none]
}
}
});
} }
|
public class class_name {
protected Edge buildPotential11Edge(Vertex vertex1, Vertex vertex2, boolean fkToRef)
{
ModificationState state1 = vertex1.getEnvelope().getModificationState();
ModificationState state2 = vertex2.getEnvelope().getModificationState();
if (state1.needsUpdate() || state1.needsDelete())
{
if (state2.needsDelete())
{
// old version of (1) might point to (2)
return new Edge(vertex1, vertex2, fkToRef ? POTENTIAL_EDGE_WEIGHT_WITH_FK : POTENTIAL_EDGE_WEIGHT);
}
}
return null;
} }
|
public class class_name {
protected Edge buildPotential11Edge(Vertex vertex1, Vertex vertex2, boolean fkToRef)
{
ModificationState state1 = vertex1.getEnvelope().getModificationState();
ModificationState state2 = vertex2.getEnvelope().getModificationState();
if (state1.needsUpdate() || state1.needsDelete())
{
if (state2.needsDelete())
{
// old version of (1) might point to (2)
return new Edge(vertex1, vertex2, fkToRef ? POTENTIAL_EDGE_WEIGHT_WITH_FK : POTENTIAL_EDGE_WEIGHT);
// depends on control dependency: [if], data = [none]
}
}
return null;
} }
|
public class class_name {
public void execute(FunctionContext<String[]> fc)
{
ResultSender<Object> rs = fc.getResultSender();
try
{
boolean didExport = false;
if(fc instanceof RegionFunctionContext)
{
String[] args = fc.getArguments();
didExport = this.exportRegion(((RegionFunctionContext)fc).getDataSet(),
Organizer.at(0,args));
}
else
{
didExport = exportRegionByArg(fc);
}
rs.lastResult(didExport);
}
catch (Exception e)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
LogManager.getLogger(getClass()).error(sw.toString());
rs.sendException(e);
}
} }
|
public class class_name {
public void execute(FunctionContext<String[]> fc)
{
ResultSender<Object> rs = fc.getResultSender();
try
{
boolean didExport = false;
if(fc instanceof RegionFunctionContext)
{
String[] args = fc.getArguments();
didExport = this.exportRegion(((RegionFunctionContext)fc).getDataSet(),
Organizer.at(0,args));
// depends on control dependency: [if], data = [none]
}
else
{
didExport = exportRegionByArg(fc);
// depends on control dependency: [if], data = [none]
}
rs.lastResult(didExport);
// depends on control dependency: [try], data = [none]
}
catch (Exception e)
{
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
e.printStackTrace(pw);
LogManager.getLogger(getClass()).error(sw.toString());
rs.sendException(e);
}
// depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static boolean alg_52(int[] blz, int[] number) {
boolean ok;
if (number[0] == 9) {
ok = alg_20(blz, number);
} else {
//Kontonummer muss 8-stellig sein (mgl: number[2] darf 0 sein, d.h. Kontonummer faengt mit 0 an
if (number[0] != 0 || number[1] != 0 || number[2] == 0) {
ok = false;
} else {
int[] weights = new int[]{4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
//ESER-Nummer bauen
int[] eser = new int[12];
int knstartindex = 4;
while (number[knstartindex] == 0) {
knstartindex++;
}
// kontonummer -> eser
int i = 11;
for (int j = 9; j >= knstartindex; j--, i--) {
eser[i] = number[j];
}
//Pruefziffer number[3] muss 0 gesetzt werden
int indexOfPruefziffer = i;
eser[i--] = 0;
//erste Stelle der Kontonummer;
eser[i--] = number[2];
for (int j = 7; j > 3; j--, i--) {
eser[i] = blz[j];
}
//Ende Eser-Nummer bauen
int sum = addProducts(eser, 0, 11, weights, false);
int crc = sum % 11;
int factor = 0;
boolean found = false;
while (!found && factor < 10) {
int tocheck = (crc + factor * weights[indexOfPruefziffer]) % 11;
if (tocheck == 10) {
crc = factor;
found = true;
}
factor++;
}
ok = found && number[3] == crc;
}
}
return ok;
} }
|
public class class_name {
public static boolean alg_52(int[] blz, int[] number) {
boolean ok;
if (number[0] == 9) {
ok = alg_20(blz, number); // depends on control dependency: [if], data = [none]
} else {
//Kontonummer muss 8-stellig sein (mgl: number[2] darf 0 sein, d.h. Kontonummer faengt mit 0 an
if (number[0] != 0 || number[1] != 0 || number[2] == 0) {
ok = false; // depends on control dependency: [if], data = [none]
} else {
int[] weights = new int[]{4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2};
//ESER-Nummer bauen
int[] eser = new int[12];
int knstartindex = 4;
while (number[knstartindex] == 0) {
knstartindex++; // depends on control dependency: [while], data = [none]
}
// kontonummer -> eser
int i = 11;
for (int j = 9; j >= knstartindex; j--, i--) {
eser[i] = number[j]; // depends on control dependency: [for], data = [j]
}
//Pruefziffer number[3] muss 0 gesetzt werden
int indexOfPruefziffer = i;
eser[i--] = 0; // depends on control dependency: [if], data = [none]
//erste Stelle der Kontonummer;
eser[i--] = number[2]; // depends on control dependency: [if], data = [none]
for (int j = 7; j > 3; j--, i--) {
eser[i] = blz[j]; // depends on control dependency: [for], data = [j]
}
//Ende Eser-Nummer bauen
int sum = addProducts(eser, 0, 11, weights, false);
int crc = sum % 11;
int factor = 0;
boolean found = false;
while (!found && factor < 10) {
int tocheck = (crc + factor * weights[indexOfPruefziffer]) % 11;
if (tocheck == 10) {
crc = factor; // depends on control dependency: [if], data = [none]
found = true; // depends on control dependency: [if], data = [none]
}
factor++; // depends on control dependency: [while], data = [none]
}
ok = found && number[3] == crc; // depends on control dependency: [if], data = [none]
}
}
return ok;
} }
|
public class class_name {
private void displayValue() {
if (m_resultList == null) {
if (!m_loadingCategoryTree) {
m_loadingCategoryTree = true;
// generate a list of all configured categories.
final String category = m_category;
final String refPath = m_refPath;
final boolean showWithRepository = m_showWithRepository;
CmsRpcAction<List<CmsCategoryTreeEntry>> action = new CmsRpcAction<List<CmsCategoryTreeEntry>>() {
/**
* @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
*/
@Override
public void execute() {
CmsCoreProvider.getService().getCategories(category, true, refPath, showWithRepository, this);
}
/**
* @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
*/
@Override
protected void onResponse(List<CmsCategoryTreeEntry> result) {
// copy the result to the global variable.
m_resultList = result;
m_loadingCategoryTree = false;
// start to generate the tree view.
m_categoryField.buildCategoryTree(m_resultList, m_selected);
setHeight();
}
};
action.execute();
}
} else {
m_categoryField.buildCategoryTree(m_resultList, m_selected);
setHeight();
}
} }
|
public class class_name {
private void displayValue() {
if (m_resultList == null) {
if (!m_loadingCategoryTree) {
m_loadingCategoryTree = true; // depends on control dependency: [if], data = [none]
// generate a list of all configured categories.
final String category = m_category;
final String refPath = m_refPath;
final boolean showWithRepository = m_showWithRepository;
CmsRpcAction<List<CmsCategoryTreeEntry>> action = new CmsRpcAction<List<CmsCategoryTreeEntry>>() {
/**
* @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
*/
@Override
public void execute() {
CmsCoreProvider.getService().getCategories(category, true, refPath, showWithRepository, this);
}
/**
* @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
*/
@Override
protected void onResponse(List<CmsCategoryTreeEntry> result) {
// copy the result to the global variable.
m_resultList = result;
m_loadingCategoryTree = false;
// start to generate the tree view.
m_categoryField.buildCategoryTree(m_resultList, m_selected);
setHeight();
}
};
action.execute(); // depends on control dependency: [if], data = [none]
}
} else {
m_categoryField.buildCategoryTree(m_resultList, m_selected); // depends on control dependency: [if], data = [(m_resultList]
setHeight(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
protected void addProperties(Root<T> root, Set<String> properties) {
// Si le conteneur est vide
if(properties == null || properties.size() == 0) return;
// Parcours du conteneur
for (String property : properties) {
// Si la ppt est nulle ou vide
if(property == null || property.trim().length() == 0) continue;
// On split
String[] hierarchicalPaths = property.split("\\.");
// Le fetch de depart
FetchParent<?, ?> fetch = root;
// Parcours de la liste
for (String path : hierarchicalPaths) {
// Si la propriete est vide
if(path == null || path.trim().isEmpty()) continue;
// chargement de cette hierarchie
fetch = fetch.fetch(path.trim(), JoinType.LEFT);
}
}
} }
|
public class class_name {
protected void addProperties(Root<T> root, Set<String> properties) {
// Si le conteneur est vide
if(properties == null || properties.size() == 0) return;
// Parcours du conteneur
for (String property : properties) {
// Si la ppt est nulle ou vide
if(property == null || property.trim().length() == 0) continue;
// On split
String[] hierarchicalPaths = property.split("\\.");
// Le fetch de depart
FetchParent<?, ?> fetch = root;
// depends on control dependency: [for], data = [none]
// Parcours de la liste
for (String path : hierarchicalPaths) {
// Si la propriete est vide
if(path == null || path.trim().isEmpty()) continue;
// chargement de cette hierarchie
fetch = fetch.fetch(path.trim(), JoinType.LEFT);
// depends on control dependency: [for], data = [path]
}
}
} }
|
public class class_name {
@Override
public Integer getId() {
try {
return ProcessUtils.readPid(ProcessUtils.findPidFile(getDirectory()));
}
catch (Throwable cause) {
if (cause instanceof PidUnknownException) {
throw (PidUnknownException) cause;
}
throw new PidUnknownException("Process ID (PID) cannot be determined", cause);
}
} }
|
public class class_name {
@Override
public Integer getId() {
try {
return ProcessUtils.readPid(ProcessUtils.findPidFile(getDirectory())); // depends on control dependency: [try], data = [none]
}
catch (Throwable cause) {
if (cause instanceof PidUnknownException) {
throw (PidUnknownException) cause;
}
throw new PidUnknownException("Process ID (PID) cannot be determined", cause);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static boolean checkPermission(Context context, String permission) {
boolean hasPermission =
(PackageManager.PERMISSION_GRANTED == context.checkCallingOrSelfPermission(permission));
if (!hasPermission) {
printErrorLog("permission " + permission + " is missing!");
}
return hasPermission;
} }
|
public class class_name {
public static boolean checkPermission(Context context, String permission) {
boolean hasPermission =
(PackageManager.PERMISSION_GRANTED == context.checkCallingOrSelfPermission(permission));
if (!hasPermission) {
printErrorLog("permission " + permission + " is missing!"); // depends on control dependency: [if], data = [none]
}
return hasPermission;
} }
|
public class class_name {
public static Map<Integer, PrimaryKey> constructPrimaryKeyMap(Collection<PrimaryKey> aPrimaryKeys)
{
if (aPrimaryKeys == null)
return null;
Map<Integer, PrimaryKey> map = new HashMap<Integer, PrimaryKey>(aPrimaryKeys.size());
PrimaryKey primaryKey = null;
for (Iterator<PrimaryKey> i = aPrimaryKeys.iterator(); i.hasNext();)
{
primaryKey = (PrimaryKey) i.next();
map.put(Integer.valueOf(primaryKey.getPrimaryKey()), primaryKey);
}
return map;
} }
|
public class class_name {
public static Map<Integer, PrimaryKey> constructPrimaryKeyMap(Collection<PrimaryKey> aPrimaryKeys)
{
if (aPrimaryKeys == null)
return null;
Map<Integer, PrimaryKey> map = new HashMap<Integer, PrimaryKey>(aPrimaryKeys.size());
PrimaryKey primaryKey = null;
for (Iterator<PrimaryKey> i = aPrimaryKeys.iterator(); i.hasNext();)
{
primaryKey = (PrimaryKey) i.next();
// depends on control dependency: [for], data = [i]
map.put(Integer.valueOf(primaryKey.getPrimaryKey()), primaryKey);
// depends on control dependency: [for], data = [none]
}
return map;
} }
|
public class class_name {
public EClass getIfcElementAssembly() {
if (ifcElementAssemblyEClass == null) {
ifcElementAssemblyEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(197);
}
return ifcElementAssemblyEClass;
} }
|
public class class_name {
public EClass getIfcElementAssembly() {
if (ifcElementAssemblyEClass == null) {
ifcElementAssemblyEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(197);
// depends on control dependency: [if], data = [none]
}
return ifcElementAssemblyEClass;
} }
|
public class class_name {
public java.util.List<String> getCustomEndpoints() {
if (customEndpoints == null) {
customEndpoints = new com.amazonaws.internal.SdkInternalList<String>();
}
return customEndpoints;
} }
|
public class class_name {
public java.util.List<String> getCustomEndpoints() {
if (customEndpoints == null) {
customEndpoints = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none]
}
return customEndpoints;
} }
|
public class class_name {
public static boolean isIPv4(final String ip) {
if (StringUtils.isBlank(ip)) {
return false;
}
final String regex = "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$";
final Pattern pattern = Pattern.compile(regex);
final Matcher matcher = pattern.matcher(ip);
return matcher.matches();
} }
|
public class class_name {
public static boolean isIPv4(final String ip) {
if (StringUtils.isBlank(ip)) {
return false; // depends on control dependency: [if], data = [none]
}
final String regex = "^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$";
final Pattern pattern = Pattern.compile(regex);
final Matcher matcher = pattern.matcher(ip);
return matcher.matches();
} }
|
public class class_name {
@Override
protected void run() throws Exception {
final String iterationId = getConfiguration().getIterationId();
if (iterationId == null || iterationId.length() == 0) {
throw new Exception("Missing iteration ID in the task configuration");
}
final String brokerID = createBrokerIdString(getEnvironment().getJobID(), iterationId ,
getEnvironment().getTaskInfo().getIndexOfThisSubtask());
final long iterationWaitTime = getConfiguration().getIterationWaitTime();
final boolean shouldWait = iterationWaitTime > 0;
final BlockingQueue<StreamRecord<OUT>> dataChannel = new ArrayBlockingQueue<StreamRecord<OUT>>(1);
// offer the queue for the tail
BlockingQueueBroker.INSTANCE.handIn(brokerID, dataChannel);
LOG.info("Iteration head {} added feedback queue under {}", getName(), brokerID);
// do the work
try {
@SuppressWarnings("unchecked")
RecordWriterOutput<OUT>[] outputs = (RecordWriterOutput<OUT>[]) getStreamOutputs();
// If timestamps are enabled we make sure to remove cyclic watermark dependencies
if (isSerializingTimestamps()) {
synchronized (getCheckpointLock()) {
for (RecordWriterOutput<OUT> output : outputs) {
output.emitWatermark(new Watermark(Long.MAX_VALUE));
}
}
}
while (running) {
StreamRecord<OUT> nextRecord = shouldWait ?
dataChannel.poll(iterationWaitTime, TimeUnit.MILLISECONDS) :
dataChannel.take();
if (nextRecord != null) {
synchronized (getCheckpointLock()) {
for (RecordWriterOutput<OUT> output : outputs) {
output.collect(nextRecord);
}
}
}
else {
// done
break;
}
}
}
finally {
// make sure that we remove the queue from the broker, to prevent a resource leak
BlockingQueueBroker.INSTANCE.remove(brokerID);
LOG.info("Iteration head {} removed feedback queue under {}", getName(), brokerID);
}
} }
|
public class class_name {
@Override
protected void run() throws Exception {
final String iterationId = getConfiguration().getIterationId();
if (iterationId == null || iterationId.length() == 0) {
throw new Exception("Missing iteration ID in the task configuration");
}
final String brokerID = createBrokerIdString(getEnvironment().getJobID(), iterationId ,
getEnvironment().getTaskInfo().getIndexOfThisSubtask());
final long iterationWaitTime = getConfiguration().getIterationWaitTime();
final boolean shouldWait = iterationWaitTime > 0;
final BlockingQueue<StreamRecord<OUT>> dataChannel = new ArrayBlockingQueue<StreamRecord<OUT>>(1);
// offer the queue for the tail
BlockingQueueBroker.INSTANCE.handIn(brokerID, dataChannel);
LOG.info("Iteration head {} added feedback queue under {}", getName(), brokerID);
// do the work
try {
@SuppressWarnings("unchecked")
RecordWriterOutput<OUT>[] outputs = (RecordWriterOutput<OUT>[]) getStreamOutputs();
// If timestamps are enabled we make sure to remove cyclic watermark dependencies
if (isSerializingTimestamps()) {
synchronized (getCheckpointLock()) { // depends on control dependency: [if], data = [none]
for (RecordWriterOutput<OUT> output : outputs) {
output.emitWatermark(new Watermark(Long.MAX_VALUE)); // depends on control dependency: [for], data = [output]
}
}
}
while (running) {
StreamRecord<OUT> nextRecord = shouldWait ?
dataChannel.poll(iterationWaitTime, TimeUnit.MILLISECONDS) :
dataChannel.take();
if (nextRecord != null) {
synchronized (getCheckpointLock()) { // depends on control dependency: [if], data = [none]
for (RecordWriterOutput<OUT> output : outputs) {
output.collect(nextRecord); // depends on control dependency: [for], data = [output]
}
}
}
else {
// done
break;
}
}
}
finally {
// make sure that we remove the queue from the broker, to prevent a resource leak
BlockingQueueBroker.INSTANCE.remove(brokerID);
LOG.info("Iteration head {} removed feedback queue under {}", getName(), brokerID);
}
} }
|
public class class_name {
private boolean compareTo(Object relationalEntity, Object originalEntity)
{
if (relationalEntity != null && originalEntity != null
&& relationalEntity.getClass().isAssignableFrom(originalEntity.getClass()))
{
EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
originalEntity.getClass());
Object relationalEntityId = PropertyAccessorHelper.getId(relationalEntity, metadata);
Object originalEntityId = PropertyAccessorHelper.getId(originalEntity, metadata);
return relationalEntityId.equals(originalEntityId);
}
return false;
} }
|
public class class_name {
private boolean compareTo(Object relationalEntity, Object originalEntity)
{
if (relationalEntity != null && originalEntity != null
&& relationalEntity.getClass().isAssignableFrom(originalEntity.getClass()))
{
EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
originalEntity.getClass());
Object relationalEntityId = PropertyAccessorHelper.getId(relationalEntity, metadata);
Object originalEntityId = PropertyAccessorHelper.getId(originalEntity, metadata);
return relationalEntityId.equals(originalEntityId); // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
public void marshall(UpdateRegexPatternSetRequest updateRegexPatternSetRequest, ProtocolMarshaller protocolMarshaller) {
if (updateRegexPatternSetRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateRegexPatternSetRequest.getRegexPatternSetId(), REGEXPATTERNSETID_BINDING);
protocolMarshaller.marshall(updateRegexPatternSetRequest.getUpdates(), UPDATES_BINDING);
protocolMarshaller.marshall(updateRegexPatternSetRequest.getChangeToken(), CHANGETOKEN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(UpdateRegexPatternSetRequest updateRegexPatternSetRequest, ProtocolMarshaller protocolMarshaller) {
if (updateRegexPatternSetRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateRegexPatternSetRequest.getRegexPatternSetId(), REGEXPATTERNSETID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(updateRegexPatternSetRequest.getUpdates(), UPDATES_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(updateRegexPatternSetRequest.getChangeToken(), CHANGETOKEN_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static boolean ifNotBlank(final String text, final Consumer<String> consumer) {
if (StringUtils.isNotBlank(text)) {
consumer.accept(text);
return true;
}
return false;
} }
|
public class class_name {
public static boolean ifNotBlank(final String text, final Consumer<String> consumer) {
if (StringUtils.isNotBlank(text)) {
consumer.accept(text);
// depends on control dependency: [if], data = [none]
return true;
// depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
public static dnssrvrec[] get(nitro_service service, dnssrvrec obj[]) throws Exception{
if (obj != null && obj.length > 0) {
dnssrvrec response[] = new dnssrvrec[obj.length];
for (int i=0;i<obj.length;i++) {
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(obj[i]));
response[i] = (dnssrvrec) obj[i].get_resource(service,option);
}
return response;
}
return null;
} }
|
public class class_name {
public static dnssrvrec[] get(nitro_service service, dnssrvrec obj[]) throws Exception{
if (obj != null && obj.length > 0) {
dnssrvrec response[] = new dnssrvrec[obj.length];
for (int i=0;i<obj.length;i++) {
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(obj[i])); // depends on control dependency: [for], data = [i]
response[i] = (dnssrvrec) obj[i].get_resource(service,option); // depends on control dependency: [for], data = [i]
}
return response;
}
return null;
} }
|
public class class_name {
public final static void getXteaSignature(byte[] array, int offset, int keyid) {
int num_rounds = 32;
int v0, v1, sum = 0, delta = 0x9E3779B9;
int[] k = XTEA_KEYS[keyid];
v0 = ByteBuffer.wrap(array, offset, 4).getInt();
v1 = ByteBuffer.wrap(array, offset + 4, 4).getInt();
for (int i = 0; i < num_rounds; i++) {
v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + k[sum & 3]);
sum += delta;
v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + k[(sum >> 11) & 3]);
}
ByteBuffer tmp = ByteBuffer.allocate(4);
tmp.putInt(v0);
tmp.flip();
System.arraycopy(tmp.array(), 0, array, offset, 4);
tmp.clear();
tmp.putInt(v1);
tmp.flip();
System.arraycopy(tmp.array(), 0, array, offset + 4, 4);
} }
|
public class class_name {
public final static void getXteaSignature(byte[] array, int offset, int keyid) {
int num_rounds = 32;
int v0, v1, sum = 0, delta = 0x9E3779B9;
int[] k = XTEA_KEYS[keyid];
v0 = ByteBuffer.wrap(array, offset, 4).getInt();
v1 = ByteBuffer.wrap(array, offset + 4, 4).getInt();
for (int i = 0; i < num_rounds; i++) {
v0 += (((v1 << 4) ^ (v1 >> 5)) + v1) ^ (sum + k[sum & 3]);
// depends on control dependency: [for], data = [none]
sum += delta;
// depends on control dependency: [for], data = [none]
v1 += (((v0 << 4) ^ (v0 >> 5)) + v0) ^ (sum + k[(sum >> 11) & 3]);
// depends on control dependency: [for], data = [none]
}
ByteBuffer tmp = ByteBuffer.allocate(4);
tmp.putInt(v0);
tmp.flip();
System.arraycopy(tmp.array(), 0, array, offset, 4);
tmp.clear();
tmp.putInt(v1);
tmp.flip();
System.arraycopy(tmp.array(), 0, array, offset + 4, 4);
} }
|
public class class_name {
private String readExtensions(final String featureName) {
final Set<String> exts = new HashSet<>();
if (featureTable.containsKey(featureName)) {
for (final Value ext : featureTable.get(featureName)) {
final String e = ext.value.trim();
if (e.length() != 0) {
exts.add(e);
}
}
}
return StringUtils.join(exts, CONF_LIST_SEPARATOR);
} }
|
public class class_name {
private String readExtensions(final String featureName) {
final Set<String> exts = new HashSet<>();
if (featureTable.containsKey(featureName)) {
for (final Value ext : featureTable.get(featureName)) {
final String e = ext.value.trim();
if (e.length() != 0) {
exts.add(e); // depends on control dependency: [if], data = [none]
}
}
}
return StringUtils.join(exts, CONF_LIST_SEPARATOR);
} }
|
public class class_name {
public static boolean isMethodString(final String str) {
if (str == null) {
return false;
}
return str.matches(TieConstants.METHOD_REGEX);
} }
|
public class class_name {
public static boolean isMethodString(final String str) {
if (str == null) {
return false;
// depends on control dependency: [if], data = [none]
}
return str.matches(TieConstants.METHOD_REGEX);
} }
|
public class class_name {
@Override
public Double getValue(GriddedTile griddedTile, byte[] imageBytes, int x,
int y) {
BufferedImage image;
try {
image = ImageUtils.getImage(imageBytes);
} catch (IOException e) {
throw new GeoPackageException(
"Failed to create an image from image bytes", e);
}
Double value = getValue(griddedTile, image, x, y);
return value;
} }
|
public class class_name {
@Override
public Double getValue(GriddedTile griddedTile, byte[] imageBytes, int x,
int y) {
BufferedImage image;
try {
image = ImageUtils.getImage(imageBytes); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
throw new GeoPackageException(
"Failed to create an image from image bytes", e);
} // depends on control dependency: [catch], data = [none]
Double value = getValue(griddedTile, image, x, y);
return value;
} }
|
public class class_name {
@Override
public JobIntentService.GenericWorkItem dequeueWork() {
JobWorkItem work = null;
synchronized (mLock) {
if (mParams == null) {
return null;
}
try {
work = mParams.dequeueWork();
} catch (SecurityException se) {
//ignore
se.printStackTrace();
}
}
if (work != null) {
work.getIntent().setExtrasClassLoader(mService.getClassLoader());
return new WrapperWorkItem(work);
} else {
return null;
}
} }
|
public class class_name {
@Override
public JobIntentService.GenericWorkItem dequeueWork() {
JobWorkItem work = null;
synchronized (mLock) {
if (mParams == null) {
return null; // depends on control dependency: [if], data = [none]
}
try {
work = mParams.dequeueWork(); // depends on control dependency: [try], data = [none]
} catch (SecurityException se) {
//ignore
se.printStackTrace();
} // depends on control dependency: [catch], data = [none]
}
if (work != null) {
work.getIntent().setExtrasClassLoader(mService.getClassLoader()); // depends on control dependency: [if], data = [none]
return new WrapperWorkItem(work); // depends on control dependency: [if], data = [(work]
} else {
return null; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private SynchronizationAdapter createSynchronizationAdapter(Transaction transaction) {
SynchronizationAdapter adapter = new SynchronizationAdapter(transaction, RemoteXid.create(uuid));
try {
transaction.registerSynchronization(adapter);
} catch (RollbackException | SystemException e) {
throw new CacheException(e);
}
if (trace) {
log.tracef("Registered synchronization for transaction %s. Sync=%s", transaction, adapter);
}
return adapter;
} }
|
public class class_name {
private SynchronizationAdapter createSynchronizationAdapter(Transaction transaction) {
SynchronizationAdapter adapter = new SynchronizationAdapter(transaction, RemoteXid.create(uuid));
try {
transaction.registerSynchronization(adapter); // depends on control dependency: [try], data = [none]
} catch (RollbackException | SystemException e) {
throw new CacheException(e);
} // depends on control dependency: [catch], data = [none]
if (trace) {
log.tracef("Registered synchronization for transaction %s. Sync=%s", transaction, adapter); // depends on control dependency: [if], data = [none]
}
return adapter;
} }
|
public class class_name {
public boolean doAction(String strAction, int iOptions)
{
if (SEND.equalsIgnoreCase(strAction))
{
String strMessage = m_tfTextIn.getText();
m_tfTextIn.setText(Constants.BLANK);
Map<String,Object> properties = new Hashtable<String,Object>();
properties.put(MESSAGE_PARAM, strMessage);
BaseMessage message = new MapMessage(new BaseMessageHeader(CHAT_TYPE, MessageConstants.INTRANET_QUEUE, null, null), properties);
this.getBaseApplet().getApplication().getMessageManager().sendMessage(message);
return true;
}
return super.doAction(strAction, iOptions);
} }
|
public class class_name {
public boolean doAction(String strAction, int iOptions)
{
if (SEND.equalsIgnoreCase(strAction))
{
String strMessage = m_tfTextIn.getText();
m_tfTextIn.setText(Constants.BLANK); // depends on control dependency: [if], data = [none]
Map<String,Object> properties = new Hashtable<String,Object>();
properties.put(MESSAGE_PARAM, strMessage); // depends on control dependency: [if], data = [none]
BaseMessage message = new MapMessage(new BaseMessageHeader(CHAT_TYPE, MessageConstants.INTRANET_QUEUE, null, null), properties);
this.getBaseApplet().getApplication().getMessageManager().sendMessage(message); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
return super.doAction(strAction, iOptions);
} }
|
public class class_name {
@Override
public void complete(VirtualConnection vc, TCPWriteRequestContext wsc) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "complete, vc=" + getVCHash());
}
synchronized (closeSync) {
if (closeCalled) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "complete");
}
return;
}
}
VirtualConnection rc = vc;
if (0 < this.asyncBytesToWrite) {
// previously went async partly through the app data, continue now
rc = encryptAndWriteAsync(this.asyncBytesToWrite, false, this.asyncTimeout);
}
if (null != rc) {
// Nothing else needs to be done here. Report success up the chain.
this.callback.complete(rc, this);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "complete");
}
} }
|
public class class_name {
@Override
public void complete(VirtualConnection vc, TCPWriteRequestContext wsc) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "complete, vc=" + getVCHash()); // depends on control dependency: [if], data = [none]
}
synchronized (closeSync) {
if (closeCalled) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "complete"); // depends on control dependency: [if], data = [none]
}
return; // depends on control dependency: [if], data = [none]
}
}
VirtualConnection rc = vc;
if (0 < this.asyncBytesToWrite) {
// previously went async partly through the app data, continue now
rc = encryptAndWriteAsync(this.asyncBytesToWrite, false, this.asyncTimeout); // depends on control dependency: [if], data = [none]
}
if (null != rc) {
// Nothing else needs to be done here. Report success up the chain.
this.callback.complete(rc, this); // depends on control dependency: [if], data = [none]
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "complete"); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void updateWithGroupDn(final LDAPGroup group, final LdapConnection connection, final String groupDn, final String scope) throws IOException, LdapException, CursorException, FrameworkException {
final Map<String, String> possibleGroupNames = getGroupMapping();
final List<LDAPUser> members = new LinkedList<>();
final Set<String> memberDNs = new LinkedHashSet<>();
// fetch DNs of all group members
try (final EntryCursor cursor = connection.search(groupDn, "(objectclass=*)", SearchScope.valueOf(scope))) {
while (cursor.next()) {
final Entry entry = cursor.get();
final Attribute objectClass = entry.get("objectclass");
for (final java.util.Map.Entry<String, String> groupEntry : possibleGroupNames.entrySet()) {
final String possibleGroupName = groupEntry.getKey();
final String possibleMemberName = groupEntry.getValue();
if (objectClass.contains(possibleGroupName)) {
// add group members
final Attribute groupMembers = entry.get(possibleMemberName);
if (groupMembers != null) {
for (final Value value : groupMembers) {
memberDNs.add(value.getString());
}
}
}
}
}
}
// resolve users
for (final String memberDN : memberDNs) {
try (final EntryCursor cursor = connection.search(memberDN, "(objectclass=*)", SearchScope.valueOf(scope))) {
while (cursor.next()) {
members.add(getOrCreateUser(cursor.get()));
}
}
}
logger.info("{} users updated", members.size());
// update members of group to new state (will remove all members that are not part of the group, as expected)
group.setProperty(StructrApp.key(Group.class, "members"), members);
} }
|
public class class_name {
private void updateWithGroupDn(final LDAPGroup group, final LdapConnection connection, final String groupDn, final String scope) throws IOException, LdapException, CursorException, FrameworkException {
final Map<String, String> possibleGroupNames = getGroupMapping();
final List<LDAPUser> members = new LinkedList<>();
final Set<String> memberDNs = new LinkedHashSet<>();
// fetch DNs of all group members
try (final EntryCursor cursor = connection.search(groupDn, "(objectclass=*)", SearchScope.valueOf(scope))) {
while (cursor.next()) {
final Entry entry = cursor.get();
final Attribute objectClass = entry.get("objectclass");
for (final java.util.Map.Entry<String, String> groupEntry : possibleGroupNames.entrySet()) {
final String possibleGroupName = groupEntry.getKey();
final String possibleMemberName = groupEntry.getValue();
if (objectClass.contains(possibleGroupName)) {
// add group members
final Attribute groupMembers = entry.get(possibleMemberName);
if (groupMembers != null) {
for (final Value value : groupMembers) {
memberDNs.add(value.getString()); // depends on control dependency: [for], data = [value]
}
}
}
}
}
}
// resolve users
for (final String memberDN : memberDNs) {
try (final EntryCursor cursor = connection.search(memberDN, "(objectclass=*)", SearchScope.valueOf(scope))) {
while (cursor.next()) {
members.add(getOrCreateUser(cursor.get())); // depends on control dependency: [while], data = [none]
}
}
}
logger.info("{} users updated", members.size());
// update members of group to new state (will remove all members that are not part of the group, as expected)
group.setProperty(StructrApp.key(Group.class, "members"), members);
} }
|
public class class_name {
public void marshall(VideoSelector videoSelector, ProtocolMarshaller protocolMarshaller) {
if (videoSelector == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(videoSelector.getColorSpace(), COLORSPACE_BINDING);
protocolMarshaller.marshall(videoSelector.getColorSpaceUsage(), COLORSPACEUSAGE_BINDING);
protocolMarshaller.marshall(videoSelector.getHdr10Metadata(), HDR10METADATA_BINDING);
protocolMarshaller.marshall(videoSelector.getPid(), PID_BINDING);
protocolMarshaller.marshall(videoSelector.getProgramNumber(), PROGRAMNUMBER_BINDING);
protocolMarshaller.marshall(videoSelector.getRotate(), ROTATE_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(VideoSelector videoSelector, ProtocolMarshaller protocolMarshaller) {
if (videoSelector == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(videoSelector.getColorSpace(), COLORSPACE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(videoSelector.getColorSpaceUsage(), COLORSPACEUSAGE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(videoSelector.getHdr10Metadata(), HDR10METADATA_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(videoSelector.getPid(), PID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(videoSelector.getProgramNumber(), PROGRAMNUMBER_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(videoSelector.getRotate(), ROTATE_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 SizeableLinkedList<WAMInstruction> compileBodyArguments(Functor functor, boolean isFirstBody,
FunctorName clauseName, int bodyNumber)
{
SizeableLinkedList<WAMInstruction> result = new SizeableLinkedList<WAMInstruction>();
SizeableLinkedList<WAMInstruction> instructions;
Term[] expressions = functor.getArguments();
for (int i = 0; i < expressions.length; i++)
{
Functor expression = (Functor) expressions[i];
Integer permVarsRemaining =
(Integer) defaultBuiltIn.getSymbolTable().get(expression.getSymbolKey(), SYMKEY_PERM_VARS_REMAINING);
// Select a non-default built-in implementation to compile the functor with, if it is a built-in.
BuiltIn builtIn;
if (expression instanceof BuiltIn)
{
builtIn = (BuiltIn) expression;
}
else
{
builtIn = defaultBuiltIn;
}
// The 'isFirstBody' parameter is only set to true, when this is the first functor of a rule.
instructions = builtIn.compileBodyArguments(expression, false, clauseName, bodyNumber);
result.addAll(instructions);
// Call the body. The number of permanent variables remaining is specified for environment trimming.
instructions = builtIn.compileBodyCall(expression, false, false, false, 0 /*permVarsRemaining*/);
result.addAll(instructions);
}
return result;
} }
|
public class class_name {
public SizeableLinkedList<WAMInstruction> compileBodyArguments(Functor functor, boolean isFirstBody,
FunctorName clauseName, int bodyNumber)
{
SizeableLinkedList<WAMInstruction> result = new SizeableLinkedList<WAMInstruction>();
SizeableLinkedList<WAMInstruction> instructions;
Term[] expressions = functor.getArguments();
for (int i = 0; i < expressions.length; i++)
{
Functor expression = (Functor) expressions[i];
Integer permVarsRemaining =
(Integer) defaultBuiltIn.getSymbolTable().get(expression.getSymbolKey(), SYMKEY_PERM_VARS_REMAINING);
// Select a non-default built-in implementation to compile the functor with, if it is a built-in.
BuiltIn builtIn;
if (expression instanceof BuiltIn)
{
builtIn = (BuiltIn) expression; // depends on control dependency: [if], data = [none]
}
else
{
builtIn = defaultBuiltIn; // depends on control dependency: [if], data = [none]
}
// The 'isFirstBody' parameter is only set to true, when this is the first functor of a rule.
instructions = builtIn.compileBodyArguments(expression, false, clauseName, bodyNumber); // depends on control dependency: [for], data = [none]
result.addAll(instructions); // depends on control dependency: [for], data = [none]
// Call the body. The number of permanent variables remaining is specified for environment trimming.
instructions = builtIn.compileBodyCall(expression, false, false, false, 0 /*permVarsRemaining*/); // depends on control dependency: [for], data = [none]
result.addAll(instructions); // depends on control dependency: [for], data = [none]
}
return result;
} }
|
public class class_name {
public List<WsByteBuffer> compress(WsByteBuffer buffer) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "compress, input=" + buffer);
}
List<WsByteBuffer> list = new LinkedList<WsByteBuffer>();
list = compress(list, buffer);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "compress, return list of size " + list.size());
}
return list;
} }
|
public class class_name {
public List<WsByteBuffer> compress(WsByteBuffer buffer) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "compress, input=" + buffer); // depends on control dependency: [if], data = [none]
}
List<WsByteBuffer> list = new LinkedList<WsByteBuffer>();
list = compress(list, buffer);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "compress, return list of size " + list.size()); // depends on control dependency: [if], data = [none]
}
return list;
} }
|
public class class_name {
public static Map<String, List<TraceEvent>> filterCCMPoolEvents(List<TraceEvent> data) throws Exception
{
Map<String, List<TraceEvent>> result = new TreeMap<String, List<TraceEvent>>();
for (TraceEvent te : data)
{
if (te.getType() == TraceEvent.REGISTER_CCM_CONNECTION ||
te.getType() == TraceEvent.UNREGISTER_CCM_CONNECTION ||
te.getType() == TraceEvent.CCM_USER_TRANSACTION ||
te.getType() == TraceEvent.UNKNOWN_CCM_CONNECTION ||
te.getType() == TraceEvent.CLOSE_CCM_CONNECTION)
{
List<TraceEvent> l = result.get(te.getPool());
if (l == null)
l = new ArrayList<TraceEvent>();
l.add(te);
result.put(te.getPool(), l);
}
}
return result;
} }
|
public class class_name {
public static Map<String, List<TraceEvent>> filterCCMPoolEvents(List<TraceEvent> data) throws Exception
{
Map<String, List<TraceEvent>> result = new TreeMap<String, List<TraceEvent>>();
for (TraceEvent te : data)
{
if (te.getType() == TraceEvent.REGISTER_CCM_CONNECTION ||
te.getType() == TraceEvent.UNREGISTER_CCM_CONNECTION ||
te.getType() == TraceEvent.CCM_USER_TRANSACTION ||
te.getType() == TraceEvent.UNKNOWN_CCM_CONNECTION ||
te.getType() == TraceEvent.CLOSE_CCM_CONNECTION)
{
List<TraceEvent> l = result.get(te.getPool());
if (l == null)
l = new ArrayList<TraceEvent>();
l.add(te); // depends on control dependency: [if], data = [none]
result.put(te.getPool(), l); // depends on control dependency: [if], data = [none]
}
}
return result;
} }
|
public class class_name {
protected void createLoginControlDataObject(Root inputRootDataObject, String inputProperty) {
// use the root DataGraph to create a PropertyControl DataGraph
List<Control> propertyControls = inputRootDataObject.getControls();
LoginControl loginCtrl = null;
if (propertyControls != null) {
loginCtrl = new LoginControl();
propertyControls.add(loginCtrl);
}
// add the requested property to the return list of properties
if (loginCtrl != null) {
loginCtrl.getProperties().add(inputProperty);
}
} }
|
public class class_name {
protected void createLoginControlDataObject(Root inputRootDataObject, String inputProperty) {
// use the root DataGraph to create a PropertyControl DataGraph
List<Control> propertyControls = inputRootDataObject.getControls();
LoginControl loginCtrl = null;
if (propertyControls != null) {
loginCtrl = new LoginControl(); // depends on control dependency: [if], data = [none]
propertyControls.add(loginCtrl); // depends on control dependency: [if], data = [none]
}
// add the requested property to the return list of properties
if (loginCtrl != null) {
loginCtrl.getProperties().add(inputProperty); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public Header getHeader() {
List<Header> list = this.getDescendants(Header.class);
if (list.size() > 0) {
return list.get(0);
} else {
return null;
}
} }
|
public class class_name {
public Header getHeader() {
List<Header> list = this.getDescendants(Header.class);
if (list.size() > 0) {
return list.get(0); // depends on control dependency: [if], data = [0)]
} else {
return null; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void requestFailed (Exception cause)
{
Object[] args = _args != null ? ArrayUtil.append(_args, cause) : new Object[] { cause };
if (_slogger != null) {
_slogger.warning(_errorText, args);
} else if (_jlogger != null) {
_jlogger.log(Level.WARNING, Logger.format(_errorText, args), cause);
} else {
System.err.println(Logger.format(_errorText, args));
}
} }
|
public class class_name {
public void requestFailed (Exception cause)
{
Object[] args = _args != null ? ArrayUtil.append(_args, cause) : new Object[] { cause };
if (_slogger != null) {
_slogger.warning(_errorText, args); // depends on control dependency: [if], data = [none]
} else if (_jlogger != null) {
_jlogger.log(Level.WARNING, Logger.format(_errorText, args), cause); // depends on control dependency: [if], data = [none]
} else {
System.err.println(Logger.format(_errorText, args)); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void sortObject( SortableParameter_F32 input[] , int start , int length ) {
for( int i = 0; i < histIndexes.size; i++ ) {
histObjs[i].reset();
}
for( int i = 0; i < length; i++ ) {
int indexInput = i+start;
SortableParameter_F32 p = input[indexInput];
int discretized = (int)((p.sortValue-minValue)/divisor);
histObjs[discretized].add(p);
}
// over wrist the input data with sorted elements
int index = start;
for( int i = 0; i < histIndexes.size; i++ ) {
FastQueue<SortableParameter_F32> matches = histObjs[i];
for( int j = 0; j < matches.size; j++ ) {
input[index++] = matches.data[j];
}
}
} }
|
public class class_name {
public void sortObject( SortableParameter_F32 input[] , int start , int length ) {
for( int i = 0; i < histIndexes.size; i++ ) {
histObjs[i].reset(); // depends on control dependency: [for], data = [i]
}
for( int i = 0; i < length; i++ ) {
int indexInput = i+start;
SortableParameter_F32 p = input[indexInput];
int discretized = (int)((p.sortValue-minValue)/divisor);
histObjs[discretized].add(p); // depends on control dependency: [for], data = [none]
}
// over wrist the input data with sorted elements
int index = start;
for( int i = 0; i < histIndexes.size; i++ ) {
FastQueue<SortableParameter_F32> matches = histObjs[i];
for( int j = 0; j < matches.size; j++ ) {
input[index++] = matches.data[j]; // depends on control dependency: [for], data = [j]
}
}
} }
|
public class class_name {
public final void retag(final Element root, final String selector,
final String tag) {
final Iterable<Element> elements; // Elements selected
checkNotNull(root, "Received a null pointer as root element");
checkNotNull(selector, "Received a null pointer as selector");
checkNotNull(tag, "Received a null pointer as tag");
// Selects and iterates over the elements
elements = root.select(selector);
for (final Element element : elements) {
element.tagName(tag);
}
} }
|
public class class_name {
public final void retag(final Element root, final String selector,
final String tag) {
final Iterable<Element> elements; // Elements selected
checkNotNull(root, "Received a null pointer as root element");
checkNotNull(selector, "Received a null pointer as selector");
checkNotNull(tag, "Received a null pointer as tag");
// Selects and iterates over the elements
elements = root.select(selector);
for (final Element element : elements) {
element.tagName(tag); // depends on control dependency: [for], data = [element]
}
} }
|
public class class_name {
private void convertClassInitializer(AbstractTypeDeclaration typeDecl) {
EntityDeclaration decl = classFile.getMethod("<clinit>", "()V");
if (decl == null) {
return; // Class doesn't have a static initializer.
}
MethodTranslator translator = new MethodTranslator(
parserEnv, translationEnv, null, typeDecl, null);
Block block = (Block) decl.acceptVisitor(translator, null);
for (Statement stmt : block.getStatements()) {
typeDecl.addClassInitStatement(stmt.copy());
}
} }
|
public class class_name {
private void convertClassInitializer(AbstractTypeDeclaration typeDecl) {
EntityDeclaration decl = classFile.getMethod("<clinit>", "()V");
if (decl == null) {
return; // Class doesn't have a static initializer. // depends on control dependency: [if], data = [none]
}
MethodTranslator translator = new MethodTranslator(
parserEnv, translationEnv, null, typeDecl, null);
Block block = (Block) decl.acceptVisitor(translator, null);
for (Statement stmt : block.getStatements()) {
typeDecl.addClassInitStatement(stmt.copy()); // depends on control dependency: [for], data = [stmt]
}
} }
|
public class class_name {
public Observable<ServiceResponse<Page<RecommendationInner>>> listHistoryForWebAppNextWithServiceResponseAsync(final String nextPageLink) {
return listHistoryForWebAppNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<RecommendationInner>>, Observable<ServiceResponse<Page<RecommendationInner>>>>() {
@Override
public Observable<ServiceResponse<Page<RecommendationInner>>> call(ServiceResponse<Page<RecommendationInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listHistoryForWebAppNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<Page<RecommendationInner>>> listHistoryForWebAppNextWithServiceResponseAsync(final String nextPageLink) {
return listHistoryForWebAppNextSinglePageAsync(nextPageLink)
.concatMap(new Func1<ServiceResponse<Page<RecommendationInner>>, Observable<ServiceResponse<Page<RecommendationInner>>>>() {
@Override
public Observable<ServiceResponse<Page<RecommendationInner>>> call(ServiceResponse<Page<RecommendationInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page); // depends on control dependency: [if], data = [none]
}
return Observable.just(page).concatWith(listHistoryForWebAppNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public static Map<Integer, Integer> getMapOfContiguousPartitions(final Cluster cluster,
int zoneId) {
List<Integer> partitionIds = new ArrayList<Integer>(cluster.getPartitionIdsInZone(zoneId));
Map<Integer, Integer> partitionIdToRunLength = Maps.newHashMap();
if(partitionIds.isEmpty()) {
return partitionIdToRunLength;
}
int lastPartitionId = partitionIds.get(0);
int initPartitionId = lastPartitionId;
for(int offset = 1; offset < partitionIds.size(); offset++) {
int partitionId = partitionIds.get(offset);
if(partitionId == lastPartitionId + 1) {
lastPartitionId = partitionId;
continue;
}
int runLength = lastPartitionId - initPartitionId + 1;
partitionIdToRunLength.put(initPartitionId, runLength);
initPartitionId = partitionId;
lastPartitionId = initPartitionId;
}
int runLength = lastPartitionId - initPartitionId + 1;
if(lastPartitionId == cluster.getNumberOfPartitions() - 1
&& partitionIdToRunLength.containsKey(0)) {
// special case of contiguity that wraps around the ring.
partitionIdToRunLength.put(initPartitionId, runLength + partitionIdToRunLength.get(0));
partitionIdToRunLength.remove(0);
} else {
partitionIdToRunLength.put(initPartitionId, runLength);
}
return partitionIdToRunLength;
} }
|
public class class_name {
public static Map<Integer, Integer> getMapOfContiguousPartitions(final Cluster cluster,
int zoneId) {
List<Integer> partitionIds = new ArrayList<Integer>(cluster.getPartitionIdsInZone(zoneId));
Map<Integer, Integer> partitionIdToRunLength = Maps.newHashMap();
if(partitionIds.isEmpty()) {
return partitionIdToRunLength; // depends on control dependency: [if], data = [none]
}
int lastPartitionId = partitionIds.get(0);
int initPartitionId = lastPartitionId;
for(int offset = 1; offset < partitionIds.size(); offset++) {
int partitionId = partitionIds.get(offset);
if(partitionId == lastPartitionId + 1) {
lastPartitionId = partitionId; // depends on control dependency: [if], data = [none]
continue;
}
int runLength = lastPartitionId - initPartitionId + 1;
partitionIdToRunLength.put(initPartitionId, runLength); // depends on control dependency: [for], data = [none]
initPartitionId = partitionId; // depends on control dependency: [for], data = [none]
lastPartitionId = initPartitionId; // depends on control dependency: [for], data = [none]
}
int runLength = lastPartitionId - initPartitionId + 1;
if(lastPartitionId == cluster.getNumberOfPartitions() - 1
&& partitionIdToRunLength.containsKey(0)) {
// special case of contiguity that wraps around the ring.
partitionIdToRunLength.put(initPartitionId, runLength + partitionIdToRunLength.get(0)); // depends on control dependency: [if], data = [none]
partitionIdToRunLength.remove(0); // depends on control dependency: [if], data = [none]
} else {
partitionIdToRunLength.put(initPartitionId, runLength); // depends on control dependency: [if], data = [none]
}
return partitionIdToRunLength;
} }
|
public class class_name {
public void setLedBlinking(final boolean BLINKING) {
if (null == ledBlinking) {
_ledBlinking = BLINKING;
if (_ledBlinking) {
startBlinkExecutorService();
} else {
if (null != blinkFuture) blinkFuture.cancel(true);
setLedOn(false);
}
} else {
ledBlinking.set(BLINKING);
}
} }
|
public class class_name {
public void setLedBlinking(final boolean BLINKING) {
if (null == ledBlinking) {
_ledBlinking = BLINKING; // depends on control dependency: [if], data = [none]
if (_ledBlinking) {
startBlinkExecutorService(); // depends on control dependency: [if], data = [none]
} else {
if (null != blinkFuture) blinkFuture.cancel(true);
setLedOn(false); // depends on control dependency: [if], data = [none]
}
} else {
ledBlinking.set(BLINKING); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public Period plusMinutes(int minutes) {
if (minutes == 0) {
return this;
}
int[] values = getValues(); // cloned
getPeriodType().addIndexedField(this, PeriodType.MINUTE_INDEX, values, minutes);
return new Period(values, getPeriodType());
} }
|
public class class_name {
public Period plusMinutes(int minutes) {
if (minutes == 0) {
return this; // depends on control dependency: [if], data = [none]
}
int[] values = getValues(); // cloned
getPeriodType().addIndexedField(this, PeriodType.MINUTE_INDEX, values, minutes);
return new Period(values, getPeriodType());
} }
|
public class class_name {
public Date setMinSelectableDate(Date min) {
if (min == null) {
minSelectableDate = defaultMinSelectableDate;
} else {
minSelectableDate = min;
}
return minSelectableDate;
} }
|
public class class_name {
public Date setMinSelectableDate(Date min) {
if (min == null) {
minSelectableDate = defaultMinSelectableDate; // depends on control dependency: [if], data = [none]
} else {
minSelectableDate = min; // depends on control dependency: [if], data = [none]
}
return minSelectableDate;
} }
|
public class class_name {
public Object findConvertStringToObject(String className, String versionRange, String string)
{
Object object = this.convertStringToObject(null, className, versionRange, string);
if (object == null) {
Object resource = this.deployThisResource(ClassFinderActivator.getPackageName(className, false), versionRange, false);
if (resource != null)
{
object = this.convertStringToObject(null, className, versionRange, string); // It is possible that the newly started bundle registered itself
if (object == null)
object = this.convertStringToObject(resource, className, versionRange, string);
}
}
return object;
} }
|
public class class_name {
public Object findConvertStringToObject(String className, String versionRange, String string)
{
Object object = this.convertStringToObject(null, className, versionRange, string);
if (object == null) {
Object resource = this.deployThisResource(ClassFinderActivator.getPackageName(className, false), versionRange, false);
if (resource != null)
{
object = this.convertStringToObject(null, className, versionRange, string); // It is possible that the newly started bundle registered itself // depends on control dependency: [if], data = [none]
if (object == null)
object = this.convertStringToObject(resource, className, versionRange, string);
}
}
return object;
} }
|
public class class_name {
public void marshall(PutGatewayResponseRequest putGatewayResponseRequest, ProtocolMarshaller protocolMarshaller) {
if (putGatewayResponseRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putGatewayResponseRequest.getRestApiId(), RESTAPIID_BINDING);
protocolMarshaller.marshall(putGatewayResponseRequest.getResponseType(), RESPONSETYPE_BINDING);
protocolMarshaller.marshall(putGatewayResponseRequest.getStatusCode(), STATUSCODE_BINDING);
protocolMarshaller.marshall(putGatewayResponseRequest.getResponseParameters(), RESPONSEPARAMETERS_BINDING);
protocolMarshaller.marshall(putGatewayResponseRequest.getResponseTemplates(), RESPONSETEMPLATES_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(PutGatewayResponseRequest putGatewayResponseRequest, ProtocolMarshaller protocolMarshaller) {
if (putGatewayResponseRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putGatewayResponseRequest.getRestApiId(), RESTAPIID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(putGatewayResponseRequest.getResponseType(), RESPONSETYPE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(putGatewayResponseRequest.getStatusCode(), STATUSCODE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(putGatewayResponseRequest.getResponseParameters(), RESPONSEPARAMETERS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(putGatewayResponseRequest.getResponseTemplates(), RESPONSETEMPLATES_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static Long parseDecimal(final String s) {
Long parsed = null;
try {
if (s != null) {
parsed = (long) Double.parseDouble(s);
}
} catch (final NumberFormatException e) {
}
return parsed;
} }
|
public class class_name {
public static Long parseDecimal(final String s) {
Long parsed = null;
try {
if (s != null) {
parsed = (long) Double.parseDouble(s); // depends on control dependency: [if], data = [(s]
}
} catch (final NumberFormatException e) {
} // depends on control dependency: [catch], data = [none]
return parsed;
} }
|
public class class_name {
public void requestSystemAlertPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
try {
if (!isSystemAlertGranted()) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + context.getPackageName()));
context.startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE);
} else {
permissionCallback.onPermissionPreGranted(Manifest.permission.SYSTEM_ALERT_WINDOW);
}
} catch (Exception ignored) {}
} else {
permissionCallback.onPermissionPreGranted(Manifest.permission.SYSTEM_ALERT_WINDOW);
}
} }
|
public class class_name {
public void requestSystemAlertPermission() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
try {
if (!isSystemAlertGranted()) {
Intent intent = new Intent(Settings.ACTION_MANAGE_OVERLAY_PERMISSION, Uri.parse("package:" + context.getPackageName()));
context.startActivityForResult(intent, OVERLAY_PERMISSION_REQ_CODE); // depends on control dependency: [if], data = [none]
} else {
permissionCallback.onPermissionPreGranted(Manifest.permission.SYSTEM_ALERT_WINDOW); // depends on control dependency: [if], data = [none]
}
} catch (Exception ignored) {} // depends on control dependency: [catch], data = [none]
} else {
permissionCallback.onPermissionPreGranted(Manifest.permission.SYSTEM_ALERT_WINDOW); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void spoolContent(InputStream is) throws IOException, FileNotFoundException
{
SwapFile swapFile =
SwapFile.get(spoolConfig.tempDirectory, System.currentTimeMillis() + "_" + SEQUENCE.incrementAndGet(),
spoolConfig.fileCleaner);
try
{
OutputStream os = PrivilegedFileHelper.fileOutputStream(swapFile);
try
{
byte[] bytes = new byte[1024];
int length;
while ((length = is.read(bytes)) != -1)
{
os.write(bytes, 0, length);
}
}
finally
{
os.close();
}
}
finally
{
swapFile.spoolDone();
is.close();
}
tempFile = swapFile;
} }
|
public class class_name {
private void spoolContent(InputStream is) throws IOException, FileNotFoundException
{
SwapFile swapFile =
SwapFile.get(spoolConfig.tempDirectory, System.currentTimeMillis() + "_" + SEQUENCE.incrementAndGet(),
spoolConfig.fileCleaner);
try
{
OutputStream os = PrivilegedFileHelper.fileOutputStream(swapFile);
try
{
byte[] bytes = new byte[1024];
int length;
while ((length = is.read(bytes)) != -1)
{
os.write(bytes, 0, length); // depends on control dependency: [while], data = [none]
}
}
finally
{
os.close();
}
}
finally
{
swapFile.spoolDone();
is.close();
}
tempFile = swapFile;
} }
|
public class class_name {
public java.util.List<PlacementGroup> getPlacementGroups() {
if (placementGroups == null) {
placementGroups = new com.amazonaws.internal.SdkInternalList<PlacementGroup>();
}
return placementGroups;
} }
|
public class class_name {
public java.util.List<PlacementGroup> getPlacementGroups() {
if (placementGroups == null) {
placementGroups = new com.amazonaws.internal.SdkInternalList<PlacementGroup>(); // depends on control dependency: [if], data = [none]
}
return placementGroups;
} }
|
public class class_name {
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector vec = new ASN1EncodableVector();
vec.add(this.policyLanguage);
if (this.policy != null) {
vec.add(this.policy);
}
return new DERSequence(vec);
} }
|
public class class_name {
public ASN1Primitive toASN1Primitive() {
ASN1EncodableVector vec = new ASN1EncodableVector();
vec.add(this.policyLanguage);
if (this.policy != null) {
vec.add(this.policy); // depends on control dependency: [if], data = [(this.policy]
}
return new DERSequence(vec);
} }
|
public class class_name {
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (AbstractDataSource.this.options.databaseLifecycleHandler != null) {
AbstractDataSource.this.options.databaseLifecycleHandler.onUpdate(db, oldVersion, newVersion, true);
versionChanged = true;
}
} }
|
public class class_name {
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (AbstractDataSource.this.options.databaseLifecycleHandler != null) {
AbstractDataSource.this.options.databaseLifecycleHandler.onUpdate(db, oldVersion, newVersion, true); // depends on control dependency: [if], data = [none]
versionChanged = true; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static String replace(String original, String pattern, String replace) {
final int len = pattern.length();
int found = original.indexOf(pattern);
if (found > -1) {
StringBuilder sb = new StringBuilder();
int start = 0;
while (found != -1) {
sb.append(original.substring(start, found));
sb.append(replace);
start = found + len;
found = original.indexOf(pattern, start);
}
sb.append(original.substring(start));
return sb.toString();
} else {
return original;
}
} }
|
public class class_name {
public static String replace(String original, String pattern, String replace) {
final int len = pattern.length();
int found = original.indexOf(pattern);
if (found > -1) {
StringBuilder sb = new StringBuilder();
int start = 0;
while (found != -1) {
sb.append(original.substring(start, found)); // depends on control dependency: [while], data = [none]
sb.append(replace); // depends on control dependency: [while], data = [none]
start = found + len; // depends on control dependency: [while], data = [none]
found = original.indexOf(pattern, start); // depends on control dependency: [while], data = [none]
}
sb.append(original.substring(start)); // depends on control dependency: [if], data = [none]
return sb.toString(); // depends on control dependency: [if], data = [none]
} else {
return original; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void learn(List<Sentence> sentenceList)
{
List<List<IWord>> s = new ArrayList<List<IWord>>(sentenceList.size());
for (Sentence sentence : sentenceList)
{
s.add(sentence.wordList);
}
compute(s);
} }
|
public class class_name {
public void learn(List<Sentence> sentenceList)
{
List<List<IWord>> s = new ArrayList<List<IWord>>(sentenceList.size());
for (Sentence sentence : sentenceList)
{
s.add(sentence.wordList); // depends on control dependency: [for], data = [sentence]
}
compute(s);
} }
|
public class class_name {
@Override
public void unsetMessageRouter(MessageRouter msgRouter) {
externalMessageRouter.compareAndSet(msgRouter, null);
if (msgRouter instanceof WsMessageRouter) {
unsetWsMessageRouter((WsMessageRouter) msgRouter);
}
} }
|
public class class_name {
@Override
public void unsetMessageRouter(MessageRouter msgRouter) {
externalMessageRouter.compareAndSet(msgRouter, null);
if (msgRouter instanceof WsMessageRouter) {
unsetWsMessageRouter((WsMessageRouter) msgRouter); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public String[] getRoles(String username, char[] password) throws NamingException
{
String[] rolesArray = null;
DirContext ctx = null;
try
{
String userDN = toDN(username);
ctx = initContext(userDN, password);
SearchControls sc = new SearchControls();
String[] attributeFilter =
{ "cn", "mail", "memberOf" };
sc.setReturningAttributes(attributeFilter);
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
String filter = "(&(sAMAccountName=" + username + "))";
NamingEnumeration<SearchResult> results = ctx.search("", filter, sc);
ArrayList<String> roles = new ArrayList<String>();
while (results.hasMore())
{
SearchResult sr = results.next();
Attributes attrs = sr.getAttributes();
//Attribute attr = attrs.get("cn");
//attr = attrs.get("mail");
Attribute attr2 = attrs.get("memberOf");
NamingEnumeration<?> ne = attr2.getAll();
while (ne.hasMore())
{
roles.add(ne.next().toString());
}
rolesArray = new String[roles.size()];
roles.toArray(rolesArray);
}
}
finally
{
try
{
if (ctx != null)
ctx.close();
}
catch (Exception ex)
{
Debugger.printError(ex);
}
}
return rolesArray;
} }
|
public class class_name {
public String[] getRoles(String username, char[] password) throws NamingException
{
String[] rolesArray = null;
DirContext ctx = null;
try
{
String userDN = toDN(username);
ctx = initContext(userDN, password);
SearchControls sc = new SearchControls();
String[] attributeFilter =
{ "cn", "mail", "memberOf" };
sc.setReturningAttributes(attributeFilter);
sc.setSearchScope(SearchControls.SUBTREE_SCOPE);
String filter = "(&(sAMAccountName=" + username + "))";
NamingEnumeration<SearchResult> results = ctx.search("", filter, sc);
ArrayList<String> roles = new ArrayList<String>();
while (results.hasMore())
{
SearchResult sr = results.next();
Attributes attrs = sr.getAttributes();
//Attribute attr = attrs.get("cn");
//attr = attrs.get("mail");
Attribute attr2 = attrs.get("memberOf");
NamingEnumeration<?> ne = attr2.getAll();
while (ne.hasMore())
{
roles.add(ne.next().toString());
// depends on control dependency: [while], data = [none]
}
rolesArray = new String[roles.size()];
// depends on control dependency: [while], data = [none]
roles.toArray(rolesArray);
// depends on control dependency: [while], data = [none]
}
}
finally
{
try
{
if (ctx != null)
ctx.close();
}
catch (Exception ex)
{
Debugger.printError(ex);
}
// depends on control dependency: [catch], data = [none]
}
return rolesArray;
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.