code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
public void setType(BusItineraryHaltType type) {
if (type != null && type != this.type) {
this.type = type;
firePrimitiveChanged();
}
} }
|
public class class_name {
public void setType(BusItineraryHaltType type) {
if (type != null && type != this.type) {
this.type = type; // depends on control dependency: [if], data = [none]
firePrimitiveChanged(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
@Override
public IntColumn asIntColumn() {
IntArrayList values = new IntArrayList();
for (float d : data) {
values.add((int) d);
}
values.trim();
return IntColumn.create(this.name(), values.elements());
} }
|
public class class_name {
@Override
public IntColumn asIntColumn() {
IntArrayList values = new IntArrayList();
for (float d : data) {
values.add((int) d); // depends on control dependency: [for], data = [d]
}
values.trim();
return IntColumn.create(this.name(), values.elements());
} }
|
public class class_name {
@Override
public QAnd appendSQL(final SQLSelect _sql)
throws EFapsException
{
_sql.addPart(SQLPart.PARENTHESIS_OPEN);
boolean first = true;
for (final AbstractQPart part : this.parts) {
if (first) {
first = false;
} else {
_sql.addPart(SQLPart.AND);
}
part.appendSQL(_sql);
}
_sql.addPart(SQLPart.PARENTHESIS_CLOSE);
return this;
} }
|
public class class_name {
@Override
public QAnd appendSQL(final SQLSelect _sql)
throws EFapsException
{
_sql.addPart(SQLPart.PARENTHESIS_OPEN);
boolean first = true;
for (final AbstractQPart part : this.parts) {
if (first) {
first = false; // depends on control dependency: [if], data = [none]
} else {
_sql.addPart(SQLPart.AND); // depends on control dependency: [if], data = [none]
}
part.appendSQL(_sql);
}
_sql.addPart(SQLPart.PARENTHESIS_CLOSE);
return this;
} }
|
public class class_name {
@Override
public void run() // F73234
{
synchronized (this) // d601399
{
if (ivIsCanceled) // d583637
{
//if this instance has been canceled, we do no more processing.
// this also guarantees that a future alarm is not created.
return;
}
ivIsRunning = true; // F743-33394
}
try {
// Go through the list of beans and check to see if any of
// them needs to be removed
sweep();
} catch (Exception e) {
FFDCFilter.processException(e, CLASS_NAME + ".alarm", "226", this);
Tr.warning(tc, "UNEXPECTED_EXCEPTION_DURING_STATEFUL_BEAN_CLEANUP_CNTR0015W",
new Object[] { this, e }); //p111002.5
} finally {
synchronized (this) {
ivIsRunning = false; // F743-33394
if (ivIsCanceled) {
// The reaper was canceled while we were sweeping. Notify
// the canceling thread that we're done.
notify();
} else if (numObjects != 0) {
startAlarm(); // F743-33394
} else {
ivScheduledFuture = null; // F73234
}
}
}
} }
|
public class class_name {
@Override
public void run() // F73234
{
synchronized (this) // d601399
{
if (ivIsCanceled) // d583637
{
//if this instance has been canceled, we do no more processing.
// this also guarantees that a future alarm is not created.
return; // depends on control dependency: [if], data = [none]
}
ivIsRunning = true; // F743-33394
}
try {
// Go through the list of beans and check to see if any of
// them needs to be removed
sweep(); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
FFDCFilter.processException(e, CLASS_NAME + ".alarm", "226", this);
Tr.warning(tc, "UNEXPECTED_EXCEPTION_DURING_STATEFUL_BEAN_CLEANUP_CNTR0015W",
new Object[] { this, e }); //p111002.5
} finally { // depends on control dependency: [catch], data = [none]
synchronized (this) {
ivIsRunning = false; // F743-33394
if (ivIsCanceled) {
// The reaper was canceled while we were sweeping. Notify
// the canceling thread that we're done.
notify(); // depends on control dependency: [if], data = [none]
} else if (numObjects != 0) {
startAlarm(); // F743-33394 // depends on control dependency: [if], data = [none]
} else {
ivScheduledFuture = null; // F73234 // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
@Deprecated
public void start(final Listener listener) {
if (listener instanceof Observer) {
start((Observer) listener);
} else {
start(new Observer() {
@Override
public void onError(Status error) {
listener.onError(error);
}
@Override
public void onResult(ResolutionResult resolutionResult) {
listener.onAddresses(resolutionResult.getAddresses(), resolutionResult.getAttributes());
}
});
}
} }
|
public class class_name {
@Deprecated
public void start(final Listener listener) {
if (listener instanceof Observer) {
start((Observer) listener); // depends on control dependency: [if], data = [none]
} else {
start(new Observer() {
@Override
public void onError(Status error) {
listener.onError(error);
}
@Override
public void onResult(ResolutionResult resolutionResult) {
listener.onAddresses(resolutionResult.getAddresses(), resolutionResult.getAttributes());
}
}); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private static boolean datetimeFormatSpecifiesZone(Slice formatString)
{
boolean quoted = false;
for (char c : formatString.toStringUtf8().toCharArray()) {
if (quoted) {
if (c == '\'') {
quoted = false;
}
continue;
}
switch (c) {
case 'z':
case 'Z':
return true;
case '\'':
// '' (two apostrophes) in a pattern denote single apostrophe and here we interpret this as "start quote" + "end quote".
// This has no impact on method's result value.
quoted = true;
break;
}
}
return false;
} }
|
public class class_name {
private static boolean datetimeFormatSpecifiesZone(Slice formatString)
{
boolean quoted = false;
for (char c : formatString.toStringUtf8().toCharArray()) {
if (quoted) {
if (c == '\'') {
quoted = false; // depends on control dependency: [if], data = [none]
}
continue;
}
switch (c) {
case 'z':
case 'Z':
return true;
case '\'':
// '' (two apostrophes) in a pattern denote single apostrophe and here we interpret this as "start quote" + "end quote".
// This has no impact on method's result value.
quoted = true;
break;
}
}
return false;
} }
|
public class class_name {
public static Class<?> getMapperClass(String msId) {
if (msId.indexOf(".") == -1) {
throw new MapperException("当前MappedStatement的id=" + msId + ",不符合MappedStatement的规则!");
}
String mapperClassStr = msId.substring(0, msId.lastIndexOf("."));
//由于一个接口中的每个方法都会进行下面的操作,因此缓存
Class<?> mapperClass = (Class<?>) CLASS_CACHE.getObject(mapperClassStr);
if(mapperClass != null){
return mapperClass;
}
ClassLoader[] classLoader = getClassLoaders();
for (ClassLoader cl : classLoader) {
if (null != cl) {
try {
mapperClass = Class.forName(mapperClassStr, true, cl);
if (mapperClass != null) {
break;
}
} catch (ClassNotFoundException e) {
// we'll ignore this until all class loaders fail to locate the class
}
}
}
if (mapperClass == null) {
throw new MapperException("class loaders failed to locate the class " + mapperClassStr);
}
CLASS_CACHE.putObject(mapperClassStr, mapperClass);
return mapperClass;
} }
|
public class class_name {
public static Class<?> getMapperClass(String msId) {
if (msId.indexOf(".") == -1) {
throw new MapperException("当前MappedStatement的id=" + msId + ",不符合MappedStatement的规则!");
}
String mapperClassStr = msId.substring(0, msId.lastIndexOf("."));
//由于一个接口中的每个方法都会进行下面的操作,因此缓存
Class<?> mapperClass = (Class<?>) CLASS_CACHE.getObject(mapperClassStr);
if(mapperClass != null){
return mapperClass;
}
ClassLoader[] classLoader = getClassLoaders();
for (ClassLoader cl : classLoader) {
if (null != cl) {
try {
mapperClass = Class.forName(mapperClassStr, true, cl); // depends on control dependency: [try], data = [none]
if (mapperClass != null) {
break;
}
} catch (ClassNotFoundException e) {
// we'll ignore this until all class loaders fail to locate the class
} // depends on control dependency: [catch], data = [none]
}
}
if (mapperClass == null) {
throw new MapperException("class loaders failed to locate the class " + mapperClassStr);
}
CLASS_CACHE.putObject(mapperClassStr, mapperClass);
return mapperClass;
} }
|
public class class_name {
private void doChangeSelectionInList(int moveBy)
{
PlayListEntry [] selected = playList.getSelectedEntries();
if (selected==null || selected.length == 0)
{
playList.setSelectedElement(0);
doMakeIndexVisible(0);
}
else
{
int firstIndex = selected[0].getIndexInPlaylist();
int lastIndex = selected[selected.length - 1].getIndexInPlaylist();
if (moveBy < 0)
{
firstIndex += moveBy;
if (firstIndex<0) firstIndex = 0;
}
else
{
lastIndex += moveBy;
if (lastIndex >= playList.size()) lastIndex = playList.size() - 1;
}
playList.setSelectedElements(firstIndex, lastIndex);
if (moveBy < 0) doMakeIndexVisible(firstIndex); else doMakeIndexVisible(lastIndex);
}
} }
|
public class class_name {
private void doChangeSelectionInList(int moveBy)
{
PlayListEntry [] selected = playList.getSelectedEntries();
if (selected==null || selected.length == 0)
{
playList.setSelectedElement(0); // depends on control dependency: [if], data = [none]
doMakeIndexVisible(0); // depends on control dependency: [if], data = [none]
}
else
{
int firstIndex = selected[0].getIndexInPlaylist();
int lastIndex = selected[selected.length - 1].getIndexInPlaylist();
if (moveBy < 0)
{
firstIndex += moveBy; // depends on control dependency: [if], data = [none]
if (firstIndex<0) firstIndex = 0;
}
else
{
lastIndex += moveBy; // depends on control dependency: [if], data = [none]
if (lastIndex >= playList.size()) lastIndex = playList.size() - 1;
}
playList.setSelectedElements(firstIndex, lastIndex); // depends on control dependency: [if], data = [none]
if (moveBy < 0) doMakeIndexVisible(firstIndex); else doMakeIndexVisible(lastIndex);
}
} }
|
public class class_name {
public int updateByHql(String secondHalfOfHql, Object[] paramValues, Type[] paramTypes){
StringBuilder queryStr = new StringBuilder();
queryStr.append("update ")
.append(this.clazz.getName())
.append(" ");
if (secondHalfOfHql != null){
queryStr.append(secondHalfOfHql);
}
Session session = this.getCurrentSession();
Query query = session.createQuery(queryStr.toString());
setupQuery(query, paramValues, paramTypes, null, null);
return query.executeUpdate();
} }
|
public class class_name {
public int updateByHql(String secondHalfOfHql, Object[] paramValues, Type[] paramTypes){
StringBuilder queryStr = new StringBuilder();
queryStr.append("update ")
.append(this.clazz.getName())
.append(" ");
if (secondHalfOfHql != null){
queryStr.append(secondHalfOfHql); // depends on control dependency: [if], data = [(secondHalfOfHql]
}
Session session = this.getCurrentSession();
Query query = session.createQuery(queryStr.toString());
setupQuery(query, paramValues, paramTypes, null, null);
return query.executeUpdate();
} }
|
public class class_name {
protected ConditionOutcome getResourceOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) {
List<String> found = new ArrayList<>();
for (String location : this.resourceLocations) {
Resource resource = context.getResourceLoader().getResource(location);
if (resource != null && resource.exists()) {
found.add(location);
}
}
if (found.isEmpty()) {
ConditionMessage message = startConditionMessage()
.didNotFind("resource", "resources")
.items(Style.QUOTE, Arrays.asList(this.resourceLocations));
return ConditionOutcome.noMatch(message);
}
ConditionMessage message = startConditionMessage().found("resource", "resources")
.items(Style.QUOTE, found);
return ConditionOutcome.match(message);
} }
|
public class class_name {
protected ConditionOutcome getResourceOutcome(ConditionContext context,
AnnotatedTypeMetadata metadata) {
List<String> found = new ArrayList<>();
for (String location : this.resourceLocations) {
Resource resource = context.getResourceLoader().getResource(location);
if (resource != null && resource.exists()) {
found.add(location); // depends on control dependency: [if], data = [none]
}
}
if (found.isEmpty()) {
ConditionMessage message = startConditionMessage()
.didNotFind("resource", "resources")
.items(Style.QUOTE, Arrays.asList(this.resourceLocations));
return ConditionOutcome.noMatch(message); // depends on control dependency: [if], data = [none]
}
ConditionMessage message = startConditionMessage().found("resource", "resources")
.items(Style.QUOTE, found);
return ConditionOutcome.match(message);
} }
|
public class class_name {
@NonNull
public static SourceParams createBancontactParams(
@IntRange(from = 0) long amount,
@NonNull String name,
@NonNull String returnUrl,
@Nullable String statementDescriptor,
@Nullable String preferredLanguage) {
final SourceParams params = new SourceParams()
.setType(Source.BANCONTACT)
.setCurrency(Source.EURO)
.setAmount(amount)
.setOwner(createSimpleMap(FIELD_NAME, name))
.setRedirect(createSimpleMap(FIELD_RETURN_URL, returnUrl));
if (statementDescriptor != null || preferredLanguage != null) {
final AbstractMap<String, Object> additionalParamsMap = new HashMap<>();
additionalParamsMap.put(FIELD_STATEMENT_DESCRIPTOR, statementDescriptor);
additionalParamsMap.put(FIELD_PREFERRED_LANGUAGE, preferredLanguage);
removeNullAndEmptyParams(additionalParamsMap);
params.setApiParameterMap(additionalParamsMap);
}
return params;
} }
|
public class class_name {
@NonNull
public static SourceParams createBancontactParams(
@IntRange(from = 0) long amount,
@NonNull String name,
@NonNull String returnUrl,
@Nullable String statementDescriptor,
@Nullable String preferredLanguage) {
final SourceParams params = new SourceParams()
.setType(Source.BANCONTACT)
.setCurrency(Source.EURO)
.setAmount(amount)
.setOwner(createSimpleMap(FIELD_NAME, name))
.setRedirect(createSimpleMap(FIELD_RETURN_URL, returnUrl));
if (statementDescriptor != null || preferredLanguage != null) {
final AbstractMap<String, Object> additionalParamsMap = new HashMap<>();
additionalParamsMap.put(FIELD_STATEMENT_DESCRIPTOR, statementDescriptor); // depends on control dependency: [if], data = [none]
additionalParamsMap.put(FIELD_PREFERRED_LANGUAGE, preferredLanguage); // depends on control dependency: [if], data = [none]
removeNullAndEmptyParams(additionalParamsMap); // depends on control dependency: [if], data = [none]
params.setApiParameterMap(additionalParamsMap); // depends on control dependency: [if], data = [none]
}
return params;
} }
|
public class class_name {
@Override
public synchronized void authenticate() throws PortalSecurityException {
int i;
Enumeration e = mySubContexts.elements();
while (e.hasMoreElements()) {
ISecurityContext sctx = ((Entry) e.nextElement()).getCtx();
// The principal and credential are now set for all subcontexts in Authentication
try {
if (sctx instanceof IParentAwareSecurityContext) {
((IParentAwareSecurityContext) sctx).authenticate(this);
} else {
sctx.authenticate();
}
} catch (Exception ex) {
log.error("Exception authenticating subcontext " + sctx, ex);
}
// Stop attempting to authenticate if authenticated and if the property flag is set
if (stopWhenAuthenticated && sctx.isAuthenticated()) {
break;
}
}
// Zero out the actual credentials if it isn't already null
if (this.myOpaqueCredentials.credentialstring != null) {
for (i = 0; i < this.myOpaqueCredentials.credentialstring.length; i++)
this.myOpaqueCredentials.credentialstring[i] = 0;
myOpaqueCredentials.credentialstring = null;
}
return;
} }
|
public class class_name {
@Override
public synchronized void authenticate() throws PortalSecurityException {
int i;
Enumeration e = mySubContexts.elements();
while (e.hasMoreElements()) {
ISecurityContext sctx = ((Entry) e.nextElement()).getCtx();
// The principal and credential are now set for all subcontexts in Authentication
try {
if (sctx instanceof IParentAwareSecurityContext) {
((IParentAwareSecurityContext) sctx).authenticate(this); // depends on control dependency: [if], data = [none]
} else {
sctx.authenticate(); // depends on control dependency: [if], data = [none]
}
} catch (Exception ex) {
log.error("Exception authenticating subcontext " + sctx, ex);
}
// Stop attempting to authenticate if authenticated and if the property flag is set
if (stopWhenAuthenticated && sctx.isAuthenticated()) {
break;
}
}
// Zero out the actual credentials if it isn't already null
if (this.myOpaqueCredentials.credentialstring != null) {
for (i = 0; i < this.myOpaqueCredentials.credentialstring.length; i++)
this.myOpaqueCredentials.credentialstring[i] = 0;
myOpaqueCredentials.credentialstring = null;
}
return;
} }
|
public class class_name {
private boolean isCacheValid()
{
long now = CurrentTime.currentTime();
if ((now - _lastTime < 100) && ! CurrentTime.isTest())
return true;
long oldLastModified = _lastModified;
long oldLength = _length;
long newLastModified = getBacking().getLastModified();
long newLength = getBacking().length();
_lastTime = now;
if (newLastModified == oldLastModified && newLength == oldLength) {
_lastTime = now;
return true;
}
else {
_changeSequence.incrementAndGet();
// If the file has changed, close the old file
clearCache();
_zipEntryCache.clear();
_lastModified = newLastModified;
_length = newLength;
_lastTime = now;
return false;
}
} }
|
public class class_name {
private boolean isCacheValid()
{
long now = CurrentTime.currentTime();
if ((now - _lastTime < 100) && ! CurrentTime.isTest())
return true;
long oldLastModified = _lastModified;
long oldLength = _length;
long newLastModified = getBacking().getLastModified();
long newLength = getBacking().length();
_lastTime = now;
if (newLastModified == oldLastModified && newLength == oldLength) {
_lastTime = now; // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
else {
_changeSequence.incrementAndGet(); // depends on control dependency: [if], data = [none]
// If the file has changed, close the old file
clearCache(); // depends on control dependency: [if], data = [none]
_zipEntryCache.clear(); // depends on control dependency: [if], data = [none]
_lastModified = newLastModified; // depends on control dependency: [if], data = [none]
_length = newLength; // depends on control dependency: [if], data = [none]
_lastTime = now; // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public List<RuleProxyField> clearDerived()
{
List<RuleProxyField> ret = new ArrayList<RuleProxyField>();
List<ProxyObject> proxyObjects = m_session.getProxyObjects();
for (ProxyObject proxyObject: proxyObjects)
{
for (Map.Entry<String,ProxyField> entry: proxyObject.getFieldMap().entrySet())
{
ProxyField proxyField = entry.getValue();
if (proxyField.isDerived())
{
RuleProxyField ruleProxyField = m_ruleProxyFields.get(proxyField);
ret.add(ruleProxyField);
ruleProxyField.reset();
}
}
}
return ret;
} }
|
public class class_name {
public List<RuleProxyField> clearDerived()
{
List<RuleProxyField> ret = new ArrayList<RuleProxyField>();
List<ProxyObject> proxyObjects = m_session.getProxyObjects();
for (ProxyObject proxyObject: proxyObjects)
{
for (Map.Entry<String,ProxyField> entry: proxyObject.getFieldMap().entrySet())
{
ProxyField proxyField = entry.getValue();
if (proxyField.isDerived())
{
RuleProxyField ruleProxyField = m_ruleProxyFields.get(proxyField);
ret.add(ruleProxyField); // depends on control dependency: [if], data = [none]
ruleProxyField.reset(); // depends on control dependency: [if], data = [none]
}
}
}
return ret;
} }
|
public class class_name {
public void purgeBodyBuffers(boolean callClose) {
// the async read for the entire incoming body has finished, discard
// the buffers and pick up with the close sequence
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Discarding body buffers...");
}
// call the clear storage methods as they will release any buffers
// currently held for the body
super.clearStorage();
super.clearTempStorage();
if (callClose) {
this.myLink.close(getVC(), null);
}
} }
|
public class class_name {
public void purgeBodyBuffers(boolean callClose) {
// the async read for the entire incoming body has finished, discard
// the buffers and pick up with the close sequence
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Discarding body buffers..."); // depends on control dependency: [if], data = [none]
}
// call the clear storage methods as they will release any buffers
// currently held for the body
super.clearStorage();
super.clearTempStorage();
if (callClose) {
this.myLink.close(getVC(), null); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public byte[] getBytes() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
workbook.write(baos);
} catch (IOException e) {
new RuntimeException(e);
} finally {
if (baos != null)
try {
baos.close();
} catch (IOException e) {
new RuntimeException(e);
}
}
return baos.toByteArray();
} }
|
public class class_name {
public byte[] getBytes() {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
workbook.write(baos);
// depends on control dependency: [try], data = [none]
} catch (IOException e) {
new RuntimeException(e);
} finally {
// depends on control dependency: [catch], data = [none]
if (baos != null)
try {
baos.close();
// depends on control dependency: [try], data = [none]
} catch (IOException e) {
new RuntimeException(e);
}
// depends on control dependency: [catch], data = [none]
}
return baos.toByteArray();
} }
|
public class class_name {
private Zxid getCommittedZxid(ClusterConfiguration cnf) {
ArrayList<Zxid> zxids = new ArrayList<Zxid>();
LOG.debug("Getting zxid can be committd for cluster configuration {}",
cnf.getVersion());
for (PeerHandler ph : quorumMap.values()) {
Zxid ackZxid = ph.getLastAckedZxid();
if (cnf.contains(ph.getServerId())) {
// Only consider the peer who is in the given configuration.
if (ackZxid != null) {
// Ignores those who haven't acknowledged.
zxids.add(ackZxid);
}
LOG.debug(" - {}'s last acked zxid {}", ph.getServerId(), ackZxid);
}
}
int quorumSize = cnf.getQuorumSize();
if (quorumSize == 0) {
// In one case, there's only one server in cluster, and the server is
// removed. Commit it directly.
return cnf.getVersion();
}
if (zxids.size() < quorumSize) {
// It's impossible to be committed.
return Zxid.ZXID_NOT_EXIST;
}
// Sorts the last ACK zxid of each peer to find one transaction which
// can be committed safely.
Collections.sort(zxids);
return zxids.get(zxids.size() - quorumSize);
} }
|
public class class_name {
private Zxid getCommittedZxid(ClusterConfiguration cnf) {
ArrayList<Zxid> zxids = new ArrayList<Zxid>();
LOG.debug("Getting zxid can be committd for cluster configuration {}",
cnf.getVersion());
for (PeerHandler ph : quorumMap.values()) {
Zxid ackZxid = ph.getLastAckedZxid();
if (cnf.contains(ph.getServerId())) {
// Only consider the peer who is in the given configuration.
if (ackZxid != null) {
// Ignores those who haven't acknowledged.
zxids.add(ackZxid); // depends on control dependency: [if], data = [(ackZxid]
}
LOG.debug(" - {}'s last acked zxid {}", ph.getServerId(), ackZxid); // depends on control dependency: [if], data = [none]
}
}
int quorumSize = cnf.getQuorumSize();
if (quorumSize == 0) {
// In one case, there's only one server in cluster, and the server is
// removed. Commit it directly.
return cnf.getVersion(); // depends on control dependency: [if], data = [none]
}
if (zxids.size() < quorumSize) {
// It's impossible to be committed.
return Zxid.ZXID_NOT_EXIST; // depends on control dependency: [if], data = [none]
}
// Sorts the last ACK zxid of each peer to find one transaction which
// can be committed safely.
Collections.sort(zxids);
return zxids.get(zxids.size() - quorumSize);
} }
|
public class class_name {
public String buildUnionSubQuery(
String typeDiscriminatorColumn,
String[] unionColumns,
Set<String> columnsPresentInTable,
int computedColumnsOffset,
String typeDiscriminatorValue,
String selection,
String groupBy,
String having) {
int unionColumnsCount = unionColumns.length;
String[] projectionIn = new String[unionColumnsCount];
for (int i = 0; i < unionColumnsCount; i++) {
String unionColumn = unionColumns[i];
if (unionColumn.equals(typeDiscriminatorColumn)) {
projectionIn[i] = "'" + typeDiscriminatorValue + "' AS "
+ typeDiscriminatorColumn;
} else if (i <= computedColumnsOffset
|| columnsPresentInTable.contains(unionColumn)) {
projectionIn[i] = unionColumn;
} else {
projectionIn[i] = "NULL AS " + unionColumn;
}
}
return buildQuery(
projectionIn, selection, groupBy, having,
null /* sortOrder */,
null /* limit */);
} }
|
public class class_name {
public String buildUnionSubQuery(
String typeDiscriminatorColumn,
String[] unionColumns,
Set<String> columnsPresentInTable,
int computedColumnsOffset,
String typeDiscriminatorValue,
String selection,
String groupBy,
String having) {
int unionColumnsCount = unionColumns.length;
String[] projectionIn = new String[unionColumnsCount];
for (int i = 0; i < unionColumnsCount; i++) {
String unionColumn = unionColumns[i];
if (unionColumn.equals(typeDiscriminatorColumn)) {
projectionIn[i] = "'" + typeDiscriminatorValue + "' AS "
+ typeDiscriminatorColumn; // depends on control dependency: [if], data = [none]
} else if (i <= computedColumnsOffset
|| columnsPresentInTable.contains(unionColumn)) {
projectionIn[i] = unionColumn; // depends on control dependency: [if], data = [none]
} else {
projectionIn[i] = "NULL AS " + unionColumn; // depends on control dependency: [if], data = [none]
}
}
return buildQuery(
projectionIn, selection, groupBy, having,
null /* sortOrder */,
null /* limit */);
} }
|
public class class_name {
private StringBuffer getExceptionElement(Throwable throwable) {
StringBuffer buf = new StringBuffer(256);
if (!m_writeHtml) {
if (m_showExceptionStackTrace) {
buf.append("aT('");
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0));
String exception = CmsEncoder.escapeXml(CmsException.getStackTraceAsString(throwable));
StringBuffer excBuffer = new StringBuffer(exception.length() + 50);
StringTokenizer tok = new StringTokenizer(exception, "\r\n");
while (tok.hasMoreTokens()) {
excBuffer.append(tok.nextToken());
excBuffer.append(getLineBreak());
}
buf.append(CmsStringUtil.escapeJavaScript(excBuffer.toString()));
buf.append("'); ");
} else {
buf.append("aT('");
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0));
buf.append(CmsStringUtil.escapeJavaScript(throwable.toString()));
buf.append("'); ");
}
m_content.add(buf);
} else {
if (m_showExceptionStackTrace) {
buf.append("<span class='throw'>");
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0));
String exception = CmsEncoder.escapeXml(CmsException.getStackTraceAsString(throwable));
StringBuffer excBuffer = new StringBuffer(exception.length() + 50);
StringTokenizer tok = new StringTokenizer(exception, "\r\n");
while (tok.hasMoreTokens()) {
excBuffer.append(tok.nextToken());
excBuffer.append(getLineBreak());
}
buf.append(excBuffer.toString());
buf.append("</span>");
} else {
buf.append("<span class='throw'>");
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0));
buf.append(throwable.toString());
buf.append("</span>");
buf.append(getLineBreak());
}
}
return buf;
} }
|
public class class_name {
private StringBuffer getExceptionElement(Throwable throwable) {
StringBuffer buf = new StringBuffer(256);
if (!m_writeHtml) {
if (m_showExceptionStackTrace) {
buf.append("aT('");
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0));
String exception = CmsEncoder.escapeXml(CmsException.getStackTraceAsString(throwable));
StringBuffer excBuffer = new StringBuffer(exception.length() + 50);
StringTokenizer tok = new StringTokenizer(exception, "\r\n");
while (tok.hasMoreTokens()) {
excBuffer.append(tok.nextToken());
excBuffer.append(getLineBreak());
}
buf.append(CmsStringUtil.escapeJavaScript(excBuffer.toString()));
buf.append("'); "); // depends on control dependency: [if], data = [none]
} else {
buf.append("aT('");
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0));
buf.append(CmsStringUtil.escapeJavaScript(throwable.toString()));
buf.append("'); "); // depends on control dependency: [if], data = [none]
}
m_content.add(buf); // depends on control dependency: [if], data = [none]
} else {
if (m_showExceptionStackTrace) {
buf.append("<span class='throw'>"); // depends on control dependency: [if], data = [none]
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0)); // depends on control dependency: [if], data = [none]
String exception = CmsEncoder.escapeXml(CmsException.getStackTraceAsString(throwable));
StringBuffer excBuffer = new StringBuffer(exception.length() + 50);
StringTokenizer tok = new StringTokenizer(exception, "\r\n");
while (tok.hasMoreTokens()) {
excBuffer.append(tok.nextToken()); // depends on control dependency: [while], data = [none]
excBuffer.append(getLineBreak()); // depends on control dependency: [while], data = [none]
}
buf.append(excBuffer.toString()); // depends on control dependency: [if], data = [none]
buf.append("</span>"); // depends on control dependency: [if], data = [none]
} else {
buf.append("<span class='throw'>"); // depends on control dependency: [if], data = [none]
buf.append(getMessages().key(Messages.RPT_EXCEPTION_0)); // depends on control dependency: [if], data = [none]
buf.append(throwable.toString()); // depends on control dependency: [if], data = [none]
buf.append("</span>"); // depends on control dependency: [if], data = [none]
buf.append(getLineBreak()); // depends on control dependency: [if], data = [none]
}
}
return buf;
} }
|
public class class_name {
public void onDeleteResponseEvent(ResponseEvent event,
ActivityContextInterface aci) {
if (event.getException() != null) {
if (tracer.isInfoEnabled()) {
tracer.info("Failed to delete " + event.getURI(),
event.getException());
}
getParent().deleteResponse(event.getURI(), 500, null, null);
} else {
final XcapResponse response = event.getResponse();
if (tracer.isInfoEnabled()) {
if (response.getCode() == 200) {
tracer.info("Deleted " + event.getURI() + ". ETag:"
+ response.getETag());
} else {
tracer.info("Failed to delete " + event.getURI()
+ ". Response: " + response);
}
}
getParent().deleteResponse(event.getURI(), response.getCode(),
response.getEntity().getContentAsString(),
response.getETag());
}
} }
|
public class class_name {
public void onDeleteResponseEvent(ResponseEvent event,
ActivityContextInterface aci) {
if (event.getException() != null) {
if (tracer.isInfoEnabled()) {
tracer.info("Failed to delete " + event.getURI(),
event.getException()); // depends on control dependency: [if], data = [none]
}
getParent().deleteResponse(event.getURI(), 500, null, null); // depends on control dependency: [if], data = [null)]
} else {
final XcapResponse response = event.getResponse();
if (tracer.isInfoEnabled()) {
if (response.getCode() == 200) {
tracer.info("Deleted " + event.getURI() + ". ETag:"
+ response.getETag()); // depends on control dependency: [if], data = [none]
} else {
tracer.info("Failed to delete " + event.getURI()
+ ". Response: " + response); // depends on control dependency: [if], data = [none]
}
}
getParent().deleteResponse(event.getURI(), response.getCode(),
response.getEntity().getContentAsString(),
response.getETag()); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static AssertionInfo getAssertion(Message message)
throws SAXException, IOException, ParserConfigurationException {
AssertionInfoMap aim = message.get(AssertionInfoMap.class);
if (aim != null) {
Collection<AssertionInfo> ais = aim
.get(CompressionPolicyBuilder.COMPRESSION);
if (ais == null) {
return null;
}
for (AssertionInfo ai : ais) {
if (ai.getAssertion() instanceof CompressionAssertion) {
return ai;
}
}
}
return null;
} }
|
public class class_name {
public static AssertionInfo getAssertion(Message message)
throws SAXException, IOException, ParserConfigurationException {
AssertionInfoMap aim = message.get(AssertionInfoMap.class);
if (aim != null) {
Collection<AssertionInfo> ais = aim
.get(CompressionPolicyBuilder.COMPRESSION);
if (ais == null) {
return null;
}
for (AssertionInfo ai : ais) {
if (ai.getAssertion() instanceof CompressionAssertion) {
return ai; // depends on control dependency: [if], data = [none]
}
}
}
return null;
} }
|
public class class_name {
static <T> List<T> toList(Class<T> targetClass, Cursor cursor, int offset, int count) {
if (N.isEntity(targetClass)) {
final DataSet ds = extractData(targetClass, cursor, offset, count);
if (ds == null || ds.isEmpty()) {
return new ArrayList<>();
} else {
return ds.toList(targetClass);
}
} else {
return toList(targetClass, cursor, 0, offset, count);
}
} }
|
public class class_name {
static <T> List<T> toList(Class<T> targetClass, Cursor cursor, int offset, int count) {
if (N.isEntity(targetClass)) {
final DataSet ds = extractData(targetClass, cursor, offset, count);
if (ds == null || ds.isEmpty()) {
return new ArrayList<>();
// depends on control dependency: [if], data = [none]
} else {
return ds.toList(targetClass);
// depends on control dependency: [if], data = [none]
}
} else {
return toList(targetClass, cursor, 0, offset, count);
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
protected boolean isGzipEligible(final HttpServletRequest request) {
// request parameter name
if (requestParameterName.length() != 0) {
String forceGzipString = request.getParameter(requestParameterName);
if (forceGzipString != null) {
return Converter.get().toBooleanValue(forceGzipString, false);
}
}
// extract uri
String uri = request.getRequestURI();
if (uri == null) {
return false;
}
uri = uri.toLowerCase();
boolean result = false;
// check uri
if (matches == null) { // match == *
if (extensions == null) { // extensions == *
return true;
}
// extension
String extension = FileNameUtil.getExtension(uri);
if (extension.length() > 0) {
extension = extension.toLowerCase();
if (StringUtil.equalsOne(extension, extensions) != -1) {
result = true;
}
}
} else {
if (wildcards) {
result = Wildcard.matchPathOne(uri, matches) != -1;
} else {
for (String match : matches) {
if (uri.contains(match)) {
result = true;
break;
}
}
}
}
if ((result) && (excludes != null)) {
if (wildcards) {
if (Wildcard.matchPathOne(uri, excludes) != -1) {
result = false;
}
} else {
for (String exclude : excludes) {
if (uri.contains(exclude)) {
result = false; // excludes founded
break;
}
}
}
}
return result;
} }
|
public class class_name {
protected boolean isGzipEligible(final HttpServletRequest request) {
// request parameter name
if (requestParameterName.length() != 0) {
String forceGzipString = request.getParameter(requestParameterName);
if (forceGzipString != null) {
return Converter.get().toBooleanValue(forceGzipString, false); // depends on control dependency: [if], data = [(forceGzipString]
}
}
// extract uri
String uri = request.getRequestURI();
if (uri == null) {
return false; // depends on control dependency: [if], data = [none]
}
uri = uri.toLowerCase();
boolean result = false;
// check uri
if (matches == null) { // match == *
if (extensions == null) { // extensions == *
return true; // depends on control dependency: [if], data = [none]
}
// extension
String extension = FileNameUtil.getExtension(uri);
if (extension.length() > 0) {
extension = extension.toLowerCase(); // depends on control dependency: [if], data = [none]
if (StringUtil.equalsOne(extension, extensions) != -1) {
result = true; // depends on control dependency: [if], data = [none]
}
}
} else {
if (wildcards) {
result = Wildcard.matchPathOne(uri, matches) != -1; // depends on control dependency: [if], data = [none]
} else {
for (String match : matches) {
if (uri.contains(match)) {
result = true; // depends on control dependency: [if], data = [none]
break;
}
}
}
}
if ((result) && (excludes != null)) {
if (wildcards) {
if (Wildcard.matchPathOne(uri, excludes) != -1) {
result = false; // depends on control dependency: [if], data = [none]
}
} else {
for (String exclude : excludes) {
if (uri.contains(exclude)) {
result = false; // excludes founded // depends on control dependency: [if], data = [none]
break;
}
}
}
}
return result;
} }
|
public class class_name {
public boolean[] toBooleanArray() {
boolean[] bits = new boolean[length];
for (int i=0; i < length; i++) {
bits[i] = get(i);
}
return bits;
} }
|
public class class_name {
public boolean[] toBooleanArray() {
boolean[] bits = new boolean[length];
for (int i=0; i < length; i++) {
bits[i] = get(i); // depends on control dependency: [for], data = [i]
}
return bits;
} }
|
public class class_name {
@Override
public Tuple getNext()
throws IOException {
Tuple tuple = null;
try {
if (isBuildingExample) {
isBuildingExample = false; // Terminate on the next iteration
return tupleFactory.newTuple(createPigExample());
}
boolean notDone = reader.nextKeyValue();
if (!notDone) {
return null;
}
ParsedRecord value = reader.getCurrentValue();
if (value != null) {
List<Object> values = new ArrayList<>();
if (onlyWantListOfFields) {
values.add(value.getString(ApacheHttpdLogfileRecordReader.FIELDS));
} else {
for (String fieldName : requestedFields) {
if (fieldName.endsWith(".*")) {
values.add(value.getStringSet(fieldName));
continue;
} else {
EnumSet<Casts> casts = reader.getParser().getCasts(fieldName);
if (casts != null) {
if (casts.contains(Casts.LONG)) {
values.add(value.getLong(fieldName));
continue;
}
if (casts.contains(Casts.DOUBLE)) {
values.add(value.getDouble(fieldName));
continue;
}
}
}
values.add(value.getString(fieldName));
}
}
tuple = tupleFactory.newTuple(values);
}
} catch (InvalidDissectorException | MissingDissectorsException e) {
throw new IOException("Fatal error in the parser", e);
}
return tuple;
} }
|
public class class_name {
@Override
public Tuple getNext()
throws IOException {
Tuple tuple = null;
try {
if (isBuildingExample) {
isBuildingExample = false; // Terminate on the next iteration // depends on control dependency: [if], data = [none]
return tupleFactory.newTuple(createPigExample()); // depends on control dependency: [if], data = [none]
}
boolean notDone = reader.nextKeyValue();
if (!notDone) {
return null; // depends on control dependency: [if], data = [none]
}
ParsedRecord value = reader.getCurrentValue();
if (value != null) {
List<Object> values = new ArrayList<>();
if (onlyWantListOfFields) {
values.add(value.getString(ApacheHttpdLogfileRecordReader.FIELDS)); // depends on control dependency: [if], data = [none]
} else {
for (String fieldName : requestedFields) {
if (fieldName.endsWith(".*")) {
values.add(value.getStringSet(fieldName)); // depends on control dependency: [if], data = [none]
continue;
} else {
EnumSet<Casts> casts = reader.getParser().getCasts(fieldName);
if (casts != null) {
if (casts.contains(Casts.LONG)) {
values.add(value.getLong(fieldName)); // depends on control dependency: [if], data = [none]
continue;
}
if (casts.contains(Casts.DOUBLE)) {
values.add(value.getDouble(fieldName)); // depends on control dependency: [if], data = [none]
continue;
}
}
}
values.add(value.getString(fieldName)); // depends on control dependency: [for], data = [fieldName]
}
}
tuple = tupleFactory.newTuple(values); // depends on control dependency: [if], data = [(value]
}
} catch (InvalidDissectorException | MissingDissectorsException e) {
throw new IOException("Fatal error in the parser", e);
}
return tuple;
} }
|
public class class_name {
protected void processBindings(ObjectMapper jsonMapper, JsonNode root) {
String script = null;
try {
if(root.has("bindings")) {
JsonNode bindingsNode = root.get("bindings");
if(bindingsNode.isArray()) {
String[] jsLines = jsonMapper.reader(String[].class).readValue(bindingsNode);
StringBuilder b = new StringBuilder();
for(String s: jsLines) {
b.append(s).append("\n");
}
script = b.toString();
scriptEngine.eval(script);
LOG.debug("Successfully evaluated [{}] lines of JS in bindings", jsLines.length);
}
}
} catch (Exception ex) {
throw new IllegalArgumentException("Failed to evaluate opentsdb.conf.json javascript binding [" + script + "]", ex);
}
} }
|
public class class_name {
protected void processBindings(ObjectMapper jsonMapper, JsonNode root) {
String script = null;
try {
if(root.has("bindings")) {
JsonNode bindingsNode = root.get("bindings");
if(bindingsNode.isArray()) {
String[] jsLines = jsonMapper.reader(String[].class).readValue(bindingsNode);
StringBuilder b = new StringBuilder();
for(String s: jsLines) {
b.append(s).append("\n"); // depends on control dependency: [for], data = [s]
}
script = b.toString(); // depends on control dependency: [if], data = [none]
scriptEngine.eval(script); // depends on control dependency: [if], data = [none]
LOG.debug("Successfully evaluated [{}] lines of JS in bindings", jsLines.length); // depends on control dependency: [if], data = [none]
}
}
} catch (Exception ex) {
throw new IllegalArgumentException("Failed to evaluate opentsdb.conf.json javascript binding [" + script + "]", ex);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public java.util.List<ServerCertificateMetadata> getServerCertificateMetadataList() {
if (serverCertificateMetadataList == null) {
serverCertificateMetadataList = new com.amazonaws.internal.SdkInternalList<ServerCertificateMetadata>();
}
return serverCertificateMetadataList;
} }
|
public class class_name {
public java.util.List<ServerCertificateMetadata> getServerCertificateMetadataList() {
if (serverCertificateMetadataList == null) {
serverCertificateMetadataList = new com.amazonaws.internal.SdkInternalList<ServerCertificateMetadata>(); // depends on control dependency: [if], data = [none]
}
return serverCertificateMetadataList;
} }
|
public class class_name {
public static SimpleURIReference toURIReference(String pidString) {
SimpleURIReference ref = null;
try {
ref = new SimpleURIReference(new URI(toURI(pidString)));
} catch (URISyntaxException e) {
// assumes pid is well-formed
throw new Error(e);
}
return ref;
} }
|
public class class_name {
public static SimpleURIReference toURIReference(String pidString) {
SimpleURIReference ref = null;
try {
ref = new SimpleURIReference(new URI(toURI(pidString))); // depends on control dependency: [try], data = [none]
} catch (URISyntaxException e) {
// assumes pid is well-formed
throw new Error(e);
} // depends on control dependency: [catch], data = [none]
return ref;
} }
|
public class class_name {
public File[] listFiles(FileFilter filter) {
File[] files = listFiles();
if (filter == null || files == null) {
return files;
}
List<File> result = new ArrayList<File>(files.length);
for (File file : files) {
if (filter.accept(file)) {
result.add(file);
}
}
return result.toArray(new File[result.size()]);
} }
|
public class class_name {
public File[] listFiles(FileFilter filter) {
File[] files = listFiles();
if (filter == null || files == null) {
return files; // depends on control dependency: [if], data = [none]
}
List<File> result = new ArrayList<File>(files.length);
for (File file : files) {
if (filter.accept(file)) {
result.add(file); // depends on control dependency: [if], data = [none]
}
}
return result.toArray(new File[result.size()]);
} }
|
public class class_name {
private static ClassLoader getPlatformClassLoader() {
if (JavaInfo.majorVersion() >= 9) {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
public ClassLoader run() {
ClassLoader pcl = null;
try {
Method getPlatformClassLoader = ClassLoader.class.getMethod("getPlatformClassLoader");
pcl = (ClassLoader) getPlatformClassLoader.invoke(null);
} catch (Throwable t) {
// Log an FFDC.
}
return pcl;
}
});
}
return null;
} }
|
public class class_name {
private static ClassLoader getPlatformClassLoader() {
if (JavaInfo.majorVersion() >= 9) {
return AccessController.doPrivileged(new PrivilegedAction<ClassLoader>() {
@Override
public ClassLoader run() {
ClassLoader pcl = null;
try {
Method getPlatformClassLoader = ClassLoader.class.getMethod("getPlatformClassLoader");
pcl = (ClassLoader) getPlatformClassLoader.invoke(null); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
// Log an FFDC.
} // depends on control dependency: [catch], data = [none]
return pcl;
}
}); // depends on control dependency: [if], data = [none]
}
return null;
} }
|
public class class_name {
public List<FlowEvent> getFlowEvents(FlowKey flowKey) throws IOException {
byte[] startKey =
Bytes.add(flowKeyConverter.toBytes(flowKey), Constants.SEP_BYTES);
Scan scan = new Scan(startKey);
scan.setFilter(new WhileMatchFilter(new PrefixFilter(startKey)));
List<FlowEvent> results = new ArrayList<FlowEvent>();
ResultScanner scanner = null;
Table eventTable = null;
try {
eventTable = hbaseConnection
.getTable(TableName.valueOf(Constants.FLOW_EVENT_TABLE));
scanner = eventTable.getScanner(scan);
for (Result r : scanner) {
FlowEvent event = createEventFromResult(r);
if (event != null) {
results.add(event);
}
}
} finally {
try {
if (scanner != null) {
scanner.close();
}
} finally {
if (eventTable != null) {
eventTable.close();
}
}
}
return results;
} }
|
public class class_name {
public List<FlowEvent> getFlowEvents(FlowKey flowKey) throws IOException {
byte[] startKey =
Bytes.add(flowKeyConverter.toBytes(flowKey), Constants.SEP_BYTES);
Scan scan = new Scan(startKey);
scan.setFilter(new WhileMatchFilter(new PrefixFilter(startKey)));
List<FlowEvent> results = new ArrayList<FlowEvent>();
ResultScanner scanner = null;
Table eventTable = null;
try {
eventTable = hbaseConnection
.getTable(TableName.valueOf(Constants.FLOW_EVENT_TABLE));
scanner = eventTable.getScanner(scan);
for (Result r : scanner) {
FlowEvent event = createEventFromResult(r);
if (event != null) {
results.add(event); // depends on control dependency: [if], data = [(event]
}
}
} finally {
try {
if (scanner != null) {
scanner.close(); // depends on control dependency: [if], data = [none]
}
} finally {
if (eventTable != null) {
eventTable.close(); // depends on control dependency: [if], data = [none]
}
}
}
return results;
} }
|
public class class_name {
public void buildModuleTags(XMLNode node, Content moduleContentTree) {
if (!configuration.nocomment) {
moduleWriter.addModuleTags(moduleContentTree);
}
} }
|
public class class_name {
public void buildModuleTags(XMLNode node, Content moduleContentTree) {
if (!configuration.nocomment) {
moduleWriter.addModuleTags(moduleContentTree); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private void addDescriptor(boolean positive, NccFeature f) {
// avoid adding the same descriptor twice or adding contradicting results
if( positive)
if( distance(f,templatePositive) < 0.05 ) {
return;
}
if( !positive) {
if( distance(f,templateNegative) < 0.05 ) {
return;
}
// a positive positive can have very bad affects on tracking, try to avoid learning a positive
// example as a negative one
if( distance(f,templatePositive) < 0.05 ) {
return;
}
}
if( positive )
templatePositive.add(f);
else
templateNegative.add(f);
} }
|
public class class_name {
private void addDescriptor(boolean positive, NccFeature f) {
// avoid adding the same descriptor twice or adding contradicting results
if( positive)
if( distance(f,templatePositive) < 0.05 ) {
return; // depends on control dependency: [if], data = [none]
}
if( !positive) {
if( distance(f,templateNegative) < 0.05 ) {
return; // depends on control dependency: [if], data = [none]
}
// a positive positive can have very bad affects on tracking, try to avoid learning a positive
// example as a negative one
if( distance(f,templatePositive) < 0.05 ) {
return; // depends on control dependency: [if], data = [none]
}
}
if( positive )
templatePositive.add(f);
else
templateNegative.add(f);
} }
|
public class class_name {
private void initialize() {
this.setContentPane(getJContentPane());
this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
this.setTitle(TITLE);
this.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(WindowEvent winEvt) {
stop();
BrowserDialog.this.setVisible(false);
}
});
pack();
if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
this.setSize(640,480);
}
} }
|
public class class_name {
private void initialize() {
this.setContentPane(getJContentPane());
this.setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
this.setTitle(TITLE);
this.addWindowListener(new java.awt.event.WindowAdapter() {
@Override
public void windowClosing(WindowEvent winEvt) {
stop();
BrowserDialog.this.setVisible(false);
}
});
pack();
if (Model.getSingleton().getOptionsParam().getViewParam().getWmUiHandlingOption() == 0) {
this.setSize(640,480);
// depends on control dependency: [if], data = [0)]
}
} }
|
public class class_name {
public WebElement waitForWebElement(final By by, int minimumNumberOfMatches, int timeout, boolean scroll){
final long endTime = SystemClock.uptimeMillis() + timeout;
while (true) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
searcher.logMatchesFound(by.getValue());
return null;
}
sleeper.sleep();
WebElement webElementToReturn = searcher.searchForWebElement(by, minimumNumberOfMatches);
if(webElementToReturn != null)
return webElementToReturn;
if(scroll) {
scroller.scrollDown();
}
}
} }
|
public class class_name {
public WebElement waitForWebElement(final By by, int minimumNumberOfMatches, int timeout, boolean scroll){
final long endTime = SystemClock.uptimeMillis() + timeout;
while (true) {
final boolean timedOut = SystemClock.uptimeMillis() > endTime;
if (timedOut){
searcher.logMatchesFound(by.getValue()); // depends on control dependency: [if], data = [none]
return null; // depends on control dependency: [if], data = [none]
}
sleeper.sleep(); // depends on control dependency: [while], data = [none]
WebElement webElementToReturn = searcher.searchForWebElement(by, minimumNumberOfMatches);
if(webElementToReturn != null)
return webElementToReturn;
if(scroll) {
scroller.scrollDown(); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public static BufferedImage getLocalBufferedImage(File res) {
try {
BufferedImage read = ImageIO.read(res);
return read;
} catch (FileNotFoundException e) {
logger.error("FileNotFound", e);
} catch (IOException e) {
logger.error("getLocalBufferedImage IO error", e);
}
return null;
} }
|
public class class_name {
public static BufferedImage getLocalBufferedImage(File res) {
try {
BufferedImage read = ImageIO.read(res);
return read; // depends on control dependency: [try], data = [none]
} catch (FileNotFoundException e) {
logger.error("FileNotFound", e);
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
logger.error("getLocalBufferedImage IO error", e);
} // depends on control dependency: [catch], data = [none]
return null;
} }
|
public class class_name {
@SuppressWarnings("unchecked")
private void privateSync(final boolean syncInternal, final boolean forceSyncStore) {
if (readOnly) {
return;
}
final long ts = System.currentTimeMillis();
boolean isDirty = false;
if (!dirtyLeafNodes.isEmpty() || !dirtyInternalNodes.isEmpty()) {
submitRedoMeta(0); // Meta Sync (full recover needed)
}
//
// Write Leaf Nodes
if (!dirtyLeafNodes.isEmpty()) {
isDirty = true;
final Node<K, V>[] dirtyBlocks = dirtyLeafNodes.getValues();
Arrays.sort(dirtyBlocks, dirtyComparatorByID);
for (Node<K, V> node : dirtyBlocks) {
if (node == null) {
break;
}
// if (log.isDebugEnabled()) log.debug("node.id=" + node.id);
dirtyLeafNodes.remove(node.id);
putNodeToStore(node);
if (!node.isDeleted()) {
cacheLeafNodes.put(node.id, node);
}
}
if (!dirtyLeafNodes.isEmpty()) {
dirtyLeafNodes.clear(false); // Clear without shrink
}
}
// Write Internal Nodes
if (syncInternal && !dirtyInternalNodes.isEmpty()) {
isDirty = true;
final Node<K, V>[] dirtyBlocks = dirtyInternalNodes.getValues();
Arrays.sort(dirtyBlocks, dirtyComparatorByID);
for (Node<K, V> node : dirtyBlocks) {
if (node == null) {
break;
}
// if (log.isDebugEnabled()) log.debug("node.id=" + node.id);
dirtyInternalNodes.remove(node.id);
putNodeToStore(node);
if (!node.isDeleted()) {
cacheInternalNodes.put(node.id, node);
}
}
if (!dirtyInternalNodes.isEmpty()) {
dirtyInternalNodes.clear(false); // Clear without shrink
}
}
//
if (isDirty) {
writeMetaData(false);
if (forceSyncStore || !disableAutoSyncStore)
storage.sync();
redoQueue.clear();
redoStore.clear();
}
if (log.isDebugEnabled()) {
final StringBuilder sb = new StringBuilder();
// @formatter:off
sb
.append(this.getClass().getName()).append("::sync()")
.append(" elements=").append(elements)
.append(" Int=").append(maxInternalNodes)
.append(" Leaf=").append(maxLeafNodes)
.append(" dirty{")
.append(" Int=").append(dirtyInternalNodes.size())
.append(" Leaf=").append(dirtyLeafNodes.size())
.append(" }")
.append(" cache{")
.append(" Int=").append(cacheInternalNodes.size())
.append(" Leaf=").append(cacheLeafNodes.size())
.append(" }")
.append(" storage{")
.append(" total=").append(storage.sizeInBlocks())
.append(" free=").append(freeBlocks.cardinality())
.append(" }")
.append(" time=").append(System.currentTimeMillis() - ts);
// @formatter:on
log.debug(sb.toString());
}
// clearWriteCaches();
} }
|
public class class_name {
@SuppressWarnings("unchecked")
private void privateSync(final boolean syncInternal, final boolean forceSyncStore) {
if (readOnly) {
return; // depends on control dependency: [if], data = [none]
}
final long ts = System.currentTimeMillis();
boolean isDirty = false;
if (!dirtyLeafNodes.isEmpty() || !dirtyInternalNodes.isEmpty()) {
submitRedoMeta(0); // Meta Sync (full recover needed) // depends on control dependency: [if], data = [none]
}
//
// Write Leaf Nodes
if (!dirtyLeafNodes.isEmpty()) {
isDirty = true; // depends on control dependency: [if], data = [none]
final Node<K, V>[] dirtyBlocks = dirtyLeafNodes.getValues();
Arrays.sort(dirtyBlocks, dirtyComparatorByID); // depends on control dependency: [if], data = [none]
for (Node<K, V> node : dirtyBlocks) {
if (node == null) {
break;
}
// if (log.isDebugEnabled()) log.debug("node.id=" + node.id);
dirtyLeafNodes.remove(node.id); // depends on control dependency: [for], data = [node]
putNodeToStore(node); // depends on control dependency: [for], data = [node]
if (!node.isDeleted()) {
cacheLeafNodes.put(node.id, node); // depends on control dependency: [if], data = [none]
}
}
if (!dirtyLeafNodes.isEmpty()) {
dirtyLeafNodes.clear(false); // Clear without shrink // depends on control dependency: [if], data = [none]
}
}
// Write Internal Nodes
if (syncInternal && !dirtyInternalNodes.isEmpty()) {
isDirty = true; // depends on control dependency: [if], data = [none]
final Node<K, V>[] dirtyBlocks = dirtyInternalNodes.getValues();
Arrays.sort(dirtyBlocks, dirtyComparatorByID); // depends on control dependency: [if], data = [none]
for (Node<K, V> node : dirtyBlocks) {
if (node == null) {
break;
}
// if (log.isDebugEnabled()) log.debug("node.id=" + node.id);
dirtyInternalNodes.remove(node.id); // depends on control dependency: [for], data = [node]
putNodeToStore(node); // depends on control dependency: [for], data = [node]
if (!node.isDeleted()) {
cacheInternalNodes.put(node.id, node); // depends on control dependency: [if], data = [none]
}
}
if (!dirtyInternalNodes.isEmpty()) {
dirtyInternalNodes.clear(false); // Clear without shrink // depends on control dependency: [if], data = [none]
}
}
//
if (isDirty) {
writeMetaData(false); // depends on control dependency: [if], data = [none]
if (forceSyncStore || !disableAutoSyncStore)
storage.sync();
redoQueue.clear(); // depends on control dependency: [if], data = [none]
redoStore.clear(); // depends on control dependency: [if], data = [none]
}
if (log.isDebugEnabled()) {
final StringBuilder sb = new StringBuilder();
// @formatter:off
sb
.append(this.getClass().getName()).append("::sync()")
.append(" elements=").append(elements)
.append(" Int=").append(maxInternalNodes)
.append(" Leaf=").append(maxLeafNodes)
.append(" dirty{")
.append(" Int=").append(dirtyInternalNodes.size())
.append(" Leaf=").append(dirtyLeafNodes.size())
.append(" }")
.append(" cache{")
.append(" Int=").append(cacheInternalNodes.size())
.append(" Leaf=").append(cacheLeafNodes.size())
.append(" }")
.append(" storage{")
.append(" total=").append(storage.sizeInBlocks())
.append(" free=").append(freeBlocks.cardinality())
.append(" }")
.append(" time=").append(System.currentTimeMillis() - ts); // depends on control dependency: [if], data = [none]
// @formatter:on
log.debug(sb.toString()); // depends on control dependency: [if], data = [none]
}
// clearWriteCaches();
} }
|
public class class_name {
public static String resolveType(String klass,
PackageDescr packageDescr,
PackageRegistry pkgRegistry) {
String arraySuffix = "";
int arrayIndex = klass.indexOf("[");
if (arrayIndex >= 0) {
arraySuffix = klass.substring(arrayIndex);
klass = klass.substring(0, arrayIndex);
}
//look among imports
String temp = klass;
while (temp.length() > 0) {
for (ImportDescr id : packageDescr.getImports()) {
String fqKlass = id.getTarget();
if (fqKlass.endsWith("." + temp)) {
//logger.info("Replace supertype " + sup + " with full name " + id.getTarget());
fqKlass = fqKlass.substring(0, fqKlass.lastIndexOf(temp)) + klass;
return arrayIndex < 0 ? fqKlass : fqKlass + arraySuffix;
}
}
temp = temp.substring(0, Math.max(0, temp.lastIndexOf('.')));
}
//look among local declarations
if (pkgRegistry != null) {
for (String declaredName : pkgRegistry.getPackage().getTypeDeclarations().keySet()) {
if (declaredName.equals(klass)) {
TypeDeclaration typeDeclaration = pkgRegistry.getPackage().getTypeDeclaration(declaredName);
if (typeDeclaration.getTypeClass() != null) {
klass = typeDeclaration.getTypeClass().getName();
}
}
}
}
if ((klass != null) && (!klass.contains(".")) && (packageDescr.getNamespace() != null && !packageDescr.getNamespace().isEmpty())) {
for (AbstractClassTypeDeclarationDescr td : packageDescr.getClassAndEnumDeclarationDescrs()) {
if (klass.equals(td.getTypeName())) {
if (td.getType().getFullName().contains(".")) {
klass = td.getType().getFullName();
}
}
}
}
return arrayIndex < 0 ? klass : klass + arraySuffix;
} }
|
public class class_name {
public static String resolveType(String klass,
PackageDescr packageDescr,
PackageRegistry pkgRegistry) {
String arraySuffix = "";
int arrayIndex = klass.indexOf("[");
if (arrayIndex >= 0) {
arraySuffix = klass.substring(arrayIndex); // depends on control dependency: [if], data = [(arrayIndex]
klass = klass.substring(0, arrayIndex); // depends on control dependency: [if], data = [none]
}
//look among imports
String temp = klass;
while (temp.length() > 0) {
for (ImportDescr id : packageDescr.getImports()) {
String fqKlass = id.getTarget();
if (fqKlass.endsWith("." + temp)) {
//logger.info("Replace supertype " + sup + " with full name " + id.getTarget());
fqKlass = fqKlass.substring(0, fqKlass.lastIndexOf(temp)) + klass; // depends on control dependency: [if], data = [none]
return arrayIndex < 0 ? fqKlass : fqKlass + arraySuffix; // depends on control dependency: [if], data = [none]
}
}
temp = temp.substring(0, Math.max(0, temp.lastIndexOf('.'))); // depends on control dependency: [while], data = [none]
}
//look among local declarations
if (pkgRegistry != null) {
for (String declaredName : pkgRegistry.getPackage().getTypeDeclarations().keySet()) {
if (declaredName.equals(klass)) {
TypeDeclaration typeDeclaration = pkgRegistry.getPackage().getTypeDeclaration(declaredName);
if (typeDeclaration.getTypeClass() != null) {
klass = typeDeclaration.getTypeClass().getName(); // depends on control dependency: [if], data = [none]
}
}
}
}
if ((klass != null) && (!klass.contains(".")) && (packageDescr.getNamespace() != null && !packageDescr.getNamespace().isEmpty())) {
for (AbstractClassTypeDeclarationDescr td : packageDescr.getClassAndEnumDeclarationDescrs()) {
if (klass.equals(td.getTypeName())) {
if (td.getType().getFullName().contains(".")) {
klass = td.getType().getFullName(); // depends on control dependency: [if], data = [none]
}
}
}
}
return arrayIndex < 0 ? klass : klass + arraySuffix;
} }
|
public class class_name {
public void deserialize(ByteBuffer bbf) {
this.clear();
ByteBuffer buffer = bbf.order() == LITTLE_ENDIAN ? bbf : bbf.slice().order(LITTLE_ENDIAN);
final int cookie = buffer.getInt();
if ((cookie & 0xFFFF) != SERIAL_COOKIE && cookie != SERIAL_COOKIE_NO_RUNCONTAINER) {
throw new RuntimeException("I failed to find one of the right cookies. " + cookie);
}
boolean hasRunContainers = (cookie & 0xFFFF) == SERIAL_COOKIE;
this.size = hasRunContainers ? (cookie >>> 16) + 1 : buffer.getInt();
if(this.size > (1<<16)) {
throw new InvalidRoaringFormat("Size too large");
}
if ((this.keys == null) || (this.keys.length < this.size)) {
this.keys = new short[this.size];
this.values = new MappeableContainer[this.size];
}
byte[] bitmapOfRunContainers = null;
boolean hasrun = (cookie & 0xFFFF) == SERIAL_COOKIE;
if (hasrun) {
bitmapOfRunContainers = new byte[(size + 7) / 8];
buffer.get(bitmapOfRunContainers);
}
final short[] keys = new short[this.size];
final int[] cardinalities = new int[this.size];
final boolean[] isBitmap = new boolean[this.size];
for (int k = 0; k < this.size; ++k) {
keys[k] = buffer.getShort();
cardinalities[k] = 1 + (0xFFFF & buffer.getShort());
isBitmap[k] = cardinalities[k] > MappeableArrayContainer.DEFAULT_MAX_SIZE;
if (bitmapOfRunContainers != null && (bitmapOfRunContainers[k / 8] & (1 << (k & 7))) != 0) {
isBitmap[k] = false;
}
}
if ((!hasrun) || (this.size >= NO_OFFSET_THRESHOLD)) {
// skipping the offsets
buffer.position(buffer.position() + this.size * 4);
}
// Reading the containers
for (int k = 0; k < this.size; ++k) {
MappeableContainer container;
if (isBitmap[k]) {
long[] array = new long[MappeableBitmapContainer.MAX_CAPACITY / 64];
buffer.asLongBuffer().get(array);
container = new MappeableBitmapContainer(cardinalities[k], LongBuffer.wrap(array));
buffer.position(buffer.position() + 1024 * 8);
} else if (bitmapOfRunContainers != null
&& ((bitmapOfRunContainers[k / 8] & (1 << (k & 7))) != 0)) {
int nbrruns = toIntUnsigned(buffer.getShort());
int length = 2 * nbrruns;
short[] array = new short[length];
buffer.asShortBuffer().get(array);
container = new MappeableRunContainer(ShortBuffer.wrap(array), nbrruns);
buffer.position(buffer.position() + length * 2);
} else {
int cardinality = cardinalities[k];
short[] array = new short[cardinality];
buffer.asShortBuffer().get(array);
container = new MappeableArrayContainer(ShortBuffer.wrap(array), cardinality);
buffer.position(buffer.position() + cardinality * 2);
}
this.keys[k] = keys[k];
this.values[k] = container;
}
} }
|
public class class_name {
public void deserialize(ByteBuffer bbf) {
this.clear();
ByteBuffer buffer = bbf.order() == LITTLE_ENDIAN ? bbf : bbf.slice().order(LITTLE_ENDIAN);
final int cookie = buffer.getInt();
if ((cookie & 0xFFFF) != SERIAL_COOKIE && cookie != SERIAL_COOKIE_NO_RUNCONTAINER) {
throw new RuntimeException("I failed to find one of the right cookies. " + cookie);
}
boolean hasRunContainers = (cookie & 0xFFFF) == SERIAL_COOKIE;
this.size = hasRunContainers ? (cookie >>> 16) + 1 : buffer.getInt();
if(this.size > (1<<16)) {
throw new InvalidRoaringFormat("Size too large");
}
if ((this.keys == null) || (this.keys.length < this.size)) {
this.keys = new short[this.size]; // depends on control dependency: [if], data = [none]
this.values = new MappeableContainer[this.size]; // depends on control dependency: [if], data = [none]
}
byte[] bitmapOfRunContainers = null;
boolean hasrun = (cookie & 0xFFFF) == SERIAL_COOKIE;
if (hasrun) {
bitmapOfRunContainers = new byte[(size + 7) / 8]; // depends on control dependency: [if], data = [none]
buffer.get(bitmapOfRunContainers); // depends on control dependency: [if], data = [none]
}
final short[] keys = new short[this.size];
final int[] cardinalities = new int[this.size];
final boolean[] isBitmap = new boolean[this.size];
for (int k = 0; k < this.size; ++k) {
keys[k] = buffer.getShort(); // depends on control dependency: [for], data = [k]
cardinalities[k] = 1 + (0xFFFF & buffer.getShort()); // depends on control dependency: [for], data = [k]
isBitmap[k] = cardinalities[k] > MappeableArrayContainer.DEFAULT_MAX_SIZE; // depends on control dependency: [for], data = [k]
if (bitmapOfRunContainers != null && (bitmapOfRunContainers[k / 8] & (1 << (k & 7))) != 0) {
isBitmap[k] = false; // depends on control dependency: [if], data = [none]
}
}
if ((!hasrun) || (this.size >= NO_OFFSET_THRESHOLD)) {
// skipping the offsets
buffer.position(buffer.position() + this.size * 4); // depends on control dependency: [if], data = [none]
}
// Reading the containers
for (int k = 0; k < this.size; ++k) {
MappeableContainer container;
if (isBitmap[k]) {
long[] array = new long[MappeableBitmapContainer.MAX_CAPACITY / 64];
buffer.asLongBuffer().get(array); // depends on control dependency: [if], data = [none]
container = new MappeableBitmapContainer(cardinalities[k], LongBuffer.wrap(array)); // depends on control dependency: [if], data = [none]
buffer.position(buffer.position() + 1024 * 8); // depends on control dependency: [if], data = [none]
} else if (bitmapOfRunContainers != null
&& ((bitmapOfRunContainers[k / 8] & (1 << (k & 7))) != 0)) {
int nbrruns = toIntUnsigned(buffer.getShort());
int length = 2 * nbrruns;
short[] array = new short[length];
buffer.asShortBuffer().get(array); // depends on control dependency: [if], data = [none]
container = new MappeableRunContainer(ShortBuffer.wrap(array), nbrruns); // depends on control dependency: [if], data = [none]
buffer.position(buffer.position() + length * 2); // depends on control dependency: [if], data = [none]
} else {
int cardinality = cardinalities[k];
short[] array = new short[cardinality];
buffer.asShortBuffer().get(array); // depends on control dependency: [if], data = [none]
container = new MappeableArrayContainer(ShortBuffer.wrap(array), cardinality); // depends on control dependency: [if], data = [none]
buffer.position(buffer.position() + cardinality * 2); // depends on control dependency: [if], data = [none]
}
this.keys[k] = keys[k]; // depends on control dependency: [for], data = [k]
this.values[k] = container; // depends on control dependency: [for], data = [k]
}
} }
|
public class class_name {
public void marshall(PutDedicatedIpInPoolRequest putDedicatedIpInPoolRequest, ProtocolMarshaller protocolMarshaller) {
if (putDedicatedIpInPoolRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putDedicatedIpInPoolRequest.getIp(), IP_BINDING);
protocolMarshaller.marshall(putDedicatedIpInPoolRequest.getDestinationPoolName(), DESTINATIONPOOLNAME_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(PutDedicatedIpInPoolRequest putDedicatedIpInPoolRequest, ProtocolMarshaller protocolMarshaller) {
if (putDedicatedIpInPoolRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putDedicatedIpInPoolRequest.getIp(), IP_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(putDedicatedIpInPoolRequest.getDestinationPoolName(), DESTINATIONPOOLNAME_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 Object get(int iRowIndex, int iRecordCount) throws DBException, RemoteException
{
try {
Utility.getLogger().info("EJB get: row= " + iRowIndex + " count= " + iRecordCount);
synchronized (this.getTask())
{
Record gridRecord = this.getMainRecord();
gridRecord.setEditMode(DBConstants.EDIT_NONE); // This will keep me from using the current record (Since cache is handled by the client)
if (iRecordCount == 1)
return this.getAtRow(iRowIndex);
else
{
Vector<Object> objVector = new Vector<Object>();
for (int iRow = iRowIndex; iRecordCount > 0; iRow++, iRecordCount--)
{
Object objData = this.getAtRow(iRow);
objVector.add(objData);
if (!(objData instanceof Vector))
break;
}
return objVector; // Vector of multiple rows
}
}
} catch (DBException ex) {
throw ex;
}
} }
|
public class class_name {
public Object get(int iRowIndex, int iRecordCount) throws DBException, RemoteException
{
try {
Utility.getLogger().info("EJB get: row= " + iRowIndex + " count= " + iRecordCount);
synchronized (this.getTask())
{
Record gridRecord = this.getMainRecord();
gridRecord.setEditMode(DBConstants.EDIT_NONE); // This will keep me from using the current record (Since cache is handled by the client)
if (iRecordCount == 1)
return this.getAtRow(iRowIndex);
else
{
Vector<Object> objVector = new Vector<Object>();
for (int iRow = iRowIndex; iRecordCount > 0; iRow++, iRecordCount--)
{
Object objData = this.getAtRow(iRow);
objVector.add(objData); // depends on control dependency: [for], data = [none]
if (!(objData instanceof Vector))
break;
}
return objVector; // Vector of multiple rows
}
}
} catch (DBException ex) {
throw ex;
}
} }
|
public class class_name {
private NodeSet<OWLClass> nodesToOwlClassNodeSet(Set<au.csiro.ontology.Node> nodes) {
Set<Node<OWLClass>> temp = new HashSet<Node<OWLClass>>();
for (au.csiro.ontology.Node n : nodes) {
temp.add(nodeToOwlClassNode(n));
}
return new OWLClassNodeSet(temp);
} }
|
public class class_name {
private NodeSet<OWLClass> nodesToOwlClassNodeSet(Set<au.csiro.ontology.Node> nodes) {
Set<Node<OWLClass>> temp = new HashSet<Node<OWLClass>>();
for (au.csiro.ontology.Node n : nodes) {
temp.add(nodeToOwlClassNode(n));
// depends on control dependency: [for], data = [n]
}
return new OWLClassNodeSet(temp);
} }
|
public class class_name {
protected final CompletionStage<Void> loadIfNeeded(final InvocationContext ctx, Object key, final FlagAffectedCommand cmd) {
if (skipLoad(cmd, key, ctx)) {
return null;
}
return loadInContext(ctx, key, cmd);
} }
|
public class class_name {
protected final CompletionStage<Void> loadIfNeeded(final InvocationContext ctx, Object key, final FlagAffectedCommand cmd) {
if (skipLoad(cmd, key, ctx)) {
return null; // depends on control dependency: [if], data = [none]
}
return loadInContext(ctx, key, cmd);
} }
|
public class class_name {
private void appendDependentPluginKeys(String pluginKey, Set<String> appendTo) {
for (PluginInfo otherPlugin : getPluginInfos()) {
if (!otherPlugin.getKey().equals(pluginKey)) {
for (PluginInfo.RequiredPlugin requirement : otherPlugin.getRequiredPlugins()) {
if (requirement.getKey().equals(pluginKey)) {
appendTo.add(otherPlugin.getKey());
appendDependentPluginKeys(otherPlugin.getKey(), appendTo);
}
}
}
}
} }
|
public class class_name {
private void appendDependentPluginKeys(String pluginKey, Set<String> appendTo) {
for (PluginInfo otherPlugin : getPluginInfos()) {
if (!otherPlugin.getKey().equals(pluginKey)) {
for (PluginInfo.RequiredPlugin requirement : otherPlugin.getRequiredPlugins()) {
if (requirement.getKey().equals(pluginKey)) {
appendTo.add(otherPlugin.getKey()); // depends on control dependency: [if], data = [none]
appendDependentPluginKeys(otherPlugin.getKey(), appendTo); // depends on control dependency: [if], data = [none]
}
}
}
}
} }
|
public class class_name {
public void setUrl(String url) {
this.url = url;
if (child != null) {
child.destroy();
child = null;
}
if (url.startsWith("http") || !url.endsWith(".fsp")) {
child = new Iframe();
((Iframe) child).setSrc(url);
} else {
child = new Import();
((Import) child).setSrc(url);
}
fullSize(child);
root.addChild(child);
} }
|
public class class_name {
public void setUrl(String url) {
this.url = url;
if (child != null) {
child.destroy(); // depends on control dependency: [if], data = [none]
child = null; // depends on control dependency: [if], data = [none]
}
if (url.startsWith("http") || !url.endsWith(".fsp")) {
child = new Iframe(); // depends on control dependency: [if], data = [none]
((Iframe) child).setSrc(url); // depends on control dependency: [if], data = [none]
} else {
child = new Import(); // depends on control dependency: [if], data = [none]
((Import) child).setSrc(url); // depends on control dependency: [if], data = [none]
}
fullSize(child);
root.addChild(child);
} }
|
public class class_name {
protected void capture3DScreenShot(GVRRenderTarget renderTarget, boolean isMultiview) {
if (mScreenshot3DCallback == null) {
return;
}
final Bitmap[] bitmaps = new Bitmap[6];
renderSixCamerasAndReadback(mMainScene.getMainCameraRig(), bitmaps, renderTarget, isMultiview);
returnScreenshot3DToCaller(mScreenshot3DCallback, bitmaps, mReadbackBufferWidth, mReadbackBufferHeight);
mScreenshot3DCallback = null;
} }
|
public class class_name {
protected void capture3DScreenShot(GVRRenderTarget renderTarget, boolean isMultiview) {
if (mScreenshot3DCallback == null) {
return; // depends on control dependency: [if], data = [none]
}
final Bitmap[] bitmaps = new Bitmap[6];
renderSixCamerasAndReadback(mMainScene.getMainCameraRig(), bitmaps, renderTarget, isMultiview);
returnScreenshot3DToCaller(mScreenshot3DCallback, bitmaps, mReadbackBufferWidth, mReadbackBufferHeight);
mScreenshot3DCallback = null;
} }
|
public class class_name {
public static String extractAccountIdFromObjectKey(String objectKey) {
if (objectKey == null) {
return null;
}
int start = objectKey.lastIndexOf(FORWARD_SLASH);
if (start != -1) {
int end = objectKey.indexOf(UNDER_SCORE, start + FORWARD_SLASH.length());
if (end != -1) {
return objectKey.substring(start + FORWARD_SLASH.length(), end);
}
}
return null;
} }
|
public class class_name {
public static String extractAccountIdFromObjectKey(String objectKey) {
if (objectKey == null) {
return null; // depends on control dependency: [if], data = [none]
}
int start = objectKey.lastIndexOf(FORWARD_SLASH);
if (start != -1) {
int end = objectKey.indexOf(UNDER_SCORE, start + FORWARD_SLASH.length());
if (end != -1) {
return objectKey.substring(start + FORWARD_SLASH.length(), end); // depends on control dependency: [if], data = [none]
}
}
return null;
} }
|
public class class_name {
public void addAttribute(AttributeSpecification specification) {
synchronized (this.attributes) {
if (!this.attributes.contains(specification)) {
this.attributes.add(specification);
if (this.sentAttrSpecifications) {
this.announceAttributes();
}
}
}
} }
|
public class class_name {
public void addAttribute(AttributeSpecification specification) {
synchronized (this.attributes) {
if (!this.attributes.contains(specification)) {
this.attributes.add(specification); // depends on control dependency: [if], data = [none]
if (this.sentAttrSpecifications) {
this.announceAttributes(); // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
Component c = tableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (c instanceof JLabel)
{
JLabel l = (JLabel) c;
l.setHorizontalTextPosition(JLabel.LEFT);
if (column == m_iCurrentSortedColumn)
{
if (l.getIcon() == null)
l.setIcon(getHeaderRendererIcon(m_bCurrentOrder));
}
else
{
if ((l.getIcon() == ASCENDING_ICON)
|| (l.getIcon() == DESCENDING_ICON))
l.setIcon(null);
}
}
return c;
} }
|
public class class_name {
public Component getTableCellRendererComponent(JTable table,
Object value,
boolean isSelected,
boolean hasFocus,
int row,
int column) {
Component c = tableCellRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
if (c instanceof JLabel)
{
JLabel l = (JLabel) c;
l.setHorizontalTextPosition(JLabel.LEFT); // depends on control dependency: [if], data = [none]
if (column == m_iCurrentSortedColumn)
{
if (l.getIcon() == null)
l.setIcon(getHeaderRendererIcon(m_bCurrentOrder));
}
else
{
if ((l.getIcon() == ASCENDING_ICON)
|| (l.getIcon() == DESCENDING_ICON))
l.setIcon(null);
}
}
return c;
} }
|
public class class_name {
public static List<IterableResult<?>> getIterableResults(Result r) {
if(r instanceof IterableResult<?>) {
List<IterableResult<?>> irs = new ArrayList<>(1);
irs.add((IterableResult<?>) r);
return irs;
}
if(r instanceof HierarchicalResult) {
return filterResults(((HierarchicalResult) r).getHierarchy(), r, IterableResult.class);
}
return Collections.emptyList();
} }
|
public class class_name {
public static List<IterableResult<?>> getIterableResults(Result r) {
if(r instanceof IterableResult<?>) {
List<IterableResult<?>> irs = new ArrayList<>(1); // depends on control dependency: [if], data = [)]
irs.add((IterableResult<?>) r); // depends on control dependency: [if], data = [)]
return irs; // depends on control dependency: [if], data = [none]
}
if(r instanceof HierarchicalResult) {
return filterResults(((HierarchicalResult) r).getHierarchy(), r, IterableResult.class); // depends on control dependency: [if], data = [none]
}
return Collections.emptyList();
} }
|
public class class_name {
public Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>> listDataLakeStoreAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName) {
return listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName)
.concatMap(new Func1<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>, Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>>>() {
@Override
public Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>> call(ServiceResponse<Page<DataLakeStoreAccountInfoInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listDataLakeStoreAccountsNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>> listDataLakeStoreAccountsWithServiceResponseAsync(final String resourceGroupName, final String accountName) {
return listDataLakeStoreAccountsSinglePageAsync(resourceGroupName, accountName)
.concatMap(new Func1<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>, Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>>>() {
@Override
public Observable<ServiceResponse<Page<DataLakeStoreAccountInfoInner>>> call(ServiceResponse<Page<DataLakeStoreAccountInfoInner>> 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(listDataLakeStoreAccountsNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public ClassLoader determineActualClassLoader() {
if (classLoader != null) {
return classLoader;
} else if (kieContainer != null) {
return kieContainer.getClassLoader();
}
return getClass().getClassLoader();
} }
|
public class class_name {
public ClassLoader determineActualClassLoader() {
if (classLoader != null) {
return classLoader; // depends on control dependency: [if], data = [none]
} else if (kieContainer != null) {
return kieContainer.getClassLoader(); // depends on control dependency: [if], data = [none]
}
return getClass().getClassLoader();
} }
|
public class class_name {
@Override
public EEnum getIfcWallTypeEnum() {
if (ifcWallTypeEnumEEnum == null) {
ifcWallTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()
.get(1100);
}
return ifcWallTypeEnumEEnum;
} }
|
public class class_name {
@Override
public EEnum getIfcWallTypeEnum() {
if (ifcWallTypeEnumEEnum == null) {
ifcWallTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI).getEClassifiers()
.get(1100);
// depends on control dependency: [if], data = [none]
}
return ifcWallTypeEnumEEnum;
} }
|
public class class_name {
private void readLocalInfilePacket(Buffer buffer, Results results) throws SQLException {
int seq = 2;
buffer.getLengthEncodedNumeric(); //field pos
String fileName = buffer.readStringNullEnd(StandardCharsets.UTF_8);
try {
// Server request the local file (LOCAL DATA LOCAL INFILE)
// We do accept general URLs, too. If the localInfileStream is
// set, use that.
InputStream is;
writer.startPacket(seq);
if (localInfileInputStream == null) {
if (!getUrlParser().getOptions().allowLocalInfile) {
writer.writeEmptyPacket();
reader.getPacket(true);
throw new SQLException(
"Usage of LOCAL INFILE is disabled. To use it enable it via the connection property allowLocalInfile=true",
FEATURE_NOT_SUPPORTED.getSqlState(), -1);
}
//validate all defined interceptors
ServiceLoader<LocalInfileInterceptor> loader = ServiceLoader
.load(LocalInfileInterceptor.class);
for (LocalInfileInterceptor interceptor : loader) {
if (!interceptor.validate(fileName)) {
writer.writeEmptyPacket();
reader.getPacket(true);
throw new SQLException("LOCAL DATA LOCAL INFILE request to send local file named \""
+ fileName + "\" not validated by interceptor \"" + interceptor.getClass().getName()
+ "\"");
}
}
try {
URL url = new URL(fileName);
is = url.openStream();
} catch (IOException ioe) {
try {
is = new FileInputStream(fileName);
} catch (FileNotFoundException f) {
writer.writeEmptyPacket();
reader.getPacket(true);
throw new SQLException("Could not send file : " + f.getMessage(), "22000", -1, f);
}
}
} else {
is = localInfileInputStream;
localInfileInputStream = null;
}
try {
byte[] buf = new byte[8192];
int len;
while ((len = is.read(buf)) > 0) {
writer.startPacket(seq++);
writer.write(buf, 0, len);
writer.flush();
}
writer.writeEmptyPacket();
} catch (IOException ioe) {
throw handleIoException(ioe);
} finally {
is.close();
}
getResult(results);
} catch (IOException e) {
throw handleIoException(e);
}
} }
|
public class class_name {
private void readLocalInfilePacket(Buffer buffer, Results results) throws SQLException {
int seq = 2;
buffer.getLengthEncodedNumeric(); //field pos
String fileName = buffer.readStringNullEnd(StandardCharsets.UTF_8);
try {
// Server request the local file (LOCAL DATA LOCAL INFILE)
// We do accept general URLs, too. If the localInfileStream is
// set, use that.
InputStream is;
writer.startPacket(seq);
if (localInfileInputStream == null) {
if (!getUrlParser().getOptions().allowLocalInfile) {
writer.writeEmptyPacket(); // depends on control dependency: [if], data = [none]
reader.getPacket(true); // depends on control dependency: [if], data = [none]
throw new SQLException(
"Usage of LOCAL INFILE is disabled. To use it enable it via the connection property allowLocalInfile=true",
FEATURE_NOT_SUPPORTED.getSqlState(), -1);
}
//validate all defined interceptors
ServiceLoader<LocalInfileInterceptor> loader = ServiceLoader
.load(LocalInfileInterceptor.class);
for (LocalInfileInterceptor interceptor : loader) {
if (!interceptor.validate(fileName)) {
writer.writeEmptyPacket(); // depends on control dependency: [if], data = [none]
reader.getPacket(true); // depends on control dependency: [if], data = [none]
throw new SQLException("LOCAL DATA LOCAL INFILE request to send local file named \""
+ fileName + "\" not validated by interceptor \"" + interceptor.getClass().getName()
+ "\"");
}
}
try {
URL url = new URL(fileName);
is = url.openStream(); // depends on control dependency: [try], data = [none]
} catch (IOException ioe) {
try {
is = new FileInputStream(fileName); // depends on control dependency: [try], data = [none]
} catch (FileNotFoundException f) {
writer.writeEmptyPacket();
reader.getPacket(true);
throw new SQLException("Could not send file : " + f.getMessage(), "22000", -1, f);
} // depends on control dependency: [catch], data = [none]
} // depends on control dependency: [catch], data = [none]
} else {
is = localInfileInputStream; // depends on control dependency: [if], data = [none]
localInfileInputStream = null; // depends on control dependency: [if], data = [none]
}
try {
byte[] buf = new byte[8192];
int len;
while ((len = is.read(buf)) > 0) {
writer.startPacket(seq++); // depends on control dependency: [while], data = [none]
writer.write(buf, 0, len); // depends on control dependency: [while], data = [none]
writer.flush(); // depends on control dependency: [while], data = [none]
}
writer.writeEmptyPacket(); // depends on control dependency: [try], data = [none]
} catch (IOException ioe) {
throw handleIoException(ioe);
} finally { // depends on control dependency: [catch], data = [none]
is.close();
}
getResult(results);
} catch (IOException e) {
throw handleIoException(e);
}
} }
|
public class class_name {
public float[][] projToLatLon(float[][] from, float[][] to) {
int cnt = from[0].length;
float[] fromXA = from[INDEX_X];
float[] fromYA = from[INDEX_Y];
float[] toLatA = to[INDEX_LAT];
float[] toLonA = to[INDEX_LON];
double toLat, toLon;
for (int i = 0; i < cnt; i++) {
double fromX = fromXA[i];
double fromY = fromYA[i];
fromX = fromX - falseEasting;
fromY = fromY - falseNorthing;
double rho = Math.sqrt(fromX * fromX + fromY * fromY);
double c = 2 * Math.asin(rho / (2 * R));
toLon = lon0;
double temp = 0;
if (Math.abs(rho) > TOLERANCE) {
toLat = Math.asin(Math.cos(c) * sinLat0
+ (fromY * Math.sin(c) * cosLat0 / rho));
if (Math.abs(lat0 - PI_OVER_4) > TOLERANCE) { // not 90 or -90
temp = rho * cosLat0 * Math.cos(c)
- fromY * sinLat0 * Math.sin(c);
toLon = lon0 + Math.atan(fromX * Math.sin(c) / temp);
} else if (Double.compare(lat0, PI_OVER_4) == 0) {
toLon = lon0 + Math.atan(fromX / -fromY);
temp = -fromY;
} else {
toLon = lon0 + Math.atan(fromX / fromY);
temp = fromY;
}
} else {
toLat = lat0;
}
toLat = Math.toDegrees(toLat);
toLon = Math.toDegrees(toLon);
if (temp < 0) {
toLon += 180;
}
toLon = LatLonPointImpl.lonNormal(toLon);
toLatA[i] = (float) toLat;
toLonA[i] = (float) toLon;
}
return to;
} }
|
public class class_name {
public float[][] projToLatLon(float[][] from, float[][] to) {
int cnt = from[0].length;
float[] fromXA = from[INDEX_X];
float[] fromYA = from[INDEX_Y];
float[] toLatA = to[INDEX_LAT];
float[] toLonA = to[INDEX_LON];
double toLat, toLon;
for (int i = 0; i < cnt; i++) {
double fromX = fromXA[i];
double fromY = fromYA[i];
fromX = fromX - falseEasting;
// depends on control dependency: [for], data = [none]
fromY = fromY - falseNorthing;
// depends on control dependency: [for], data = [none]
double rho = Math.sqrt(fromX * fromX + fromY * fromY);
double c = 2 * Math.asin(rho / (2 * R));
toLon = lon0;
// depends on control dependency: [for], data = [none]
double temp = 0;
if (Math.abs(rho) > TOLERANCE) {
toLat = Math.asin(Math.cos(c) * sinLat0
+ (fromY * Math.sin(c) * cosLat0 / rho));
// depends on control dependency: [if], data = [none]
if (Math.abs(lat0 - PI_OVER_4) > TOLERANCE) { // not 90 or -90
temp = rho * cosLat0 * Math.cos(c)
- fromY * sinLat0 * Math.sin(c);
// depends on control dependency: [if], data = [none]
toLon = lon0 + Math.atan(fromX * Math.sin(c) / temp);
// depends on control dependency: [if], data = [none]
} else if (Double.compare(lat0, PI_OVER_4) == 0) {
toLon = lon0 + Math.atan(fromX / -fromY);
// depends on control dependency: [if], data = [none]
temp = -fromY;
// depends on control dependency: [if], data = [none]
} else {
toLon = lon0 + Math.atan(fromX / fromY);
// depends on control dependency: [if], data = [none]
temp = fromY;
// depends on control dependency: [if], data = [none]
}
} else {
toLat = lat0;
// depends on control dependency: [if], data = [none]
}
toLat = Math.toDegrees(toLat);
// depends on control dependency: [for], data = [none]
toLon = Math.toDegrees(toLon);
// depends on control dependency: [for], data = [none]
if (temp < 0) {
toLon += 180;
// depends on control dependency: [if], data = [none]
}
toLon = LatLonPointImpl.lonNormal(toLon);
// depends on control dependency: [for], data = [none]
toLatA[i] = (float) toLat;
// depends on control dependency: [for], data = [i]
toLonA[i] = (float) toLon;
// depends on control dependency: [for], data = [i]
}
return to;
} }
|
public class class_name {
protected UriQueryBuilder generateQueryBuilder() throws StorageException {
final UriQueryBuilder builder = new UriQueryBuilder();
if (!Utility.isNullOrEmpty(this.filterString)) {
builder.add(TableConstants.FILTER, this.filterString);
}
if (this.takeCount != null) {
builder.add(TableConstants.TOP, this.takeCount.toString());
}
if (this.columns != null && this.columns.length > 0) {
final StringBuilder colBuilder = new StringBuilder();
boolean foundRk = false;
boolean foundPk = false;
boolean roundTs = false;
for (int m = 0; m < this.columns.length; m++) {
if (TableConstants.ROW_KEY.equals(this.columns[m])) {
foundRk = true;
}
else if (TableConstants.PARTITION_KEY.equals(this.columns[m])) {
foundPk = true;
}
else if (TableConstants.TIMESTAMP.equals(this.columns[m])) {
roundTs = true;
}
colBuilder.append(this.columns[m]);
if (m < this.columns.length - 1) {
colBuilder.append(",");
}
}
if (!foundPk) {
colBuilder.append(",");
colBuilder.append(TableConstants.PARTITION_KEY);
}
if (!foundRk) {
colBuilder.append(",");
colBuilder.append(TableConstants.ROW_KEY);
}
if (!roundTs) {
colBuilder.append(",");
colBuilder.append(TableConstants.TIMESTAMP);
}
builder.add(TableConstants.SELECT, colBuilder.toString());
}
return builder;
} }
|
public class class_name {
protected UriQueryBuilder generateQueryBuilder() throws StorageException {
final UriQueryBuilder builder = new UriQueryBuilder();
if (!Utility.isNullOrEmpty(this.filterString)) {
builder.add(TableConstants.FILTER, this.filterString);
}
if (this.takeCount != null) {
builder.add(TableConstants.TOP, this.takeCount.toString());
}
if (this.columns != null && this.columns.length > 0) {
final StringBuilder colBuilder = new StringBuilder();
boolean foundRk = false;
boolean foundPk = false;
boolean roundTs = false;
for (int m = 0; m < this.columns.length; m++) {
if (TableConstants.ROW_KEY.equals(this.columns[m])) {
foundRk = true; // depends on control dependency: [if], data = [none]
}
else if (TableConstants.PARTITION_KEY.equals(this.columns[m])) {
foundPk = true; // depends on control dependency: [if], data = [none]
}
else if (TableConstants.TIMESTAMP.equals(this.columns[m])) {
roundTs = true; // depends on control dependency: [if], data = [none]
}
colBuilder.append(this.columns[m]); // depends on control dependency: [for], data = [m]
if (m < this.columns.length - 1) {
colBuilder.append(","); // depends on control dependency: [if], data = [none]
}
}
if (!foundPk) {
colBuilder.append(","); // depends on control dependency: [if], data = [none]
colBuilder.append(TableConstants.PARTITION_KEY); // depends on control dependency: [if], data = [none]
}
if (!foundRk) {
colBuilder.append(","); // depends on control dependency: [if], data = [none]
colBuilder.append(TableConstants.ROW_KEY); // depends on control dependency: [if], data = [none]
}
if (!roundTs) {
colBuilder.append(","); // depends on control dependency: [if], data = [none]
colBuilder.append(TableConstants.TIMESTAMP); // depends on control dependency: [if], data = [none]
}
builder.add(TableConstants.SELECT, colBuilder.toString());
}
return builder;
} }
|
public class class_name {
@Override
public void start() {
if (this.started) {
throw new IllegalStateException("The stub server has been started already.");
}
logger.debug("starting the underlying stub server...");
this.server.registerRequestManager(this);
try {
server.start();
} catch (final Exception ex) {
throw new JadlerException("Stub http server start failure", ex);
}
this.started = true;
} }
|
public class class_name {
@Override
public void start() {
if (this.started) {
throw new IllegalStateException("The stub server has been started already.");
}
logger.debug("starting the underlying stub server...");
this.server.registerRequestManager(this);
try {
server.start(); // depends on control dependency: [try], data = [none]
} catch (final Exception ex) {
throw new JadlerException("Stub http server start failure", ex);
} // depends on control dependency: [catch], data = [none]
this.started = true;
} }
|
public class class_name {
@Override
public void start() throws ChannelException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "start");
}
if (this.stopFlag) {
// only start once
this.stopFlag = false;
if (this.config.isInbound()) {
// Socket is already open, just need to start accepting connections
try {
// PK60924 - check for a restart path requiring the re-init
if (null == this.endPoint.getServerSocket()) {
initializePort();
}
acceptReqProcessor.get().registerPort(this.endPoint);
this.preparingToStop = false;
String IPvType = "IPv4";
if (this.endPoint.getServerSocket().getInetAddress() instanceof Inet6Address) {
IPvType = "IPv6";
}
if (this.config.getHostname() == null) {
this.displayableHostName = "* (" + IPvType + ")";
} else {
this.displayableHostName = this.endPoint.getServerSocket().getInetAddress().getHostName() + " (" + IPvType + ": "
+ this.endPoint.getServerSocket().getInetAddress().getHostAddress() + ")";
}
Tr.info(tc, TCPChannelMessageConstants.TCP_CHANNEL_STARTED,
new Object[] { getExternalName(), this.displayableHostName, String.valueOf(this.endPoint.getListenPort()) });
} catch (IOException e) {
FFDCFilter.processException(e, getClass().getName() + ".start", "100", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "TCP Channel: " + getExternalName() + "- Problem occurred while starting TCP Channel: " + e.getMessage());
}
ChannelException x = new ChannelException("TCP Channel: " + getExternalName() + "- Problem occurred while starting channel: " + e.getMessage());
// Adjust flag so follow up attempt is possible.
this.stopFlag = true;
throw x;
}
}
if (this.config.getDumpStatsInterval() > 0) {
createStatisticsThread();
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "start");
}
} }
|
public class class_name {
@Override
public void start() throws ChannelException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.entry(tc, "start");
}
if (this.stopFlag) {
// only start once
this.stopFlag = false;
if (this.config.isInbound()) {
// Socket is already open, just need to start accepting connections
try {
// PK60924 - check for a restart path requiring the re-init
if (null == this.endPoint.getServerSocket()) {
initializePort(); // depends on control dependency: [if], data = [none]
}
acceptReqProcessor.get().registerPort(this.endPoint);
this.preparingToStop = false;
String IPvType = "IPv4";
if (this.endPoint.getServerSocket().getInetAddress() instanceof Inet6Address) {
IPvType = "IPv6"; // depends on control dependency: [if], data = [none]
}
if (this.config.getHostname() == null) {
this.displayableHostName = "* (" + IPvType + ")"; // depends on control dependency: [if], data = [none]
} else {
this.displayableHostName = this.endPoint.getServerSocket().getInetAddress().getHostName() + " (" + IPvType + ": "
+ this.endPoint.getServerSocket().getInetAddress().getHostAddress() + ")";
}
Tr.info(tc, TCPChannelMessageConstants.TCP_CHANNEL_STARTED,
new Object[] { getExternalName(), this.displayableHostName, String.valueOf(this.endPoint.getListenPort()) }); // depends on control dependency: [if], data = [none]
} catch (IOException e) {
FFDCFilter.processException(e, getClass().getName() + ".start", "100", this);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "TCP Channel: " + getExternalName() + "- Problem occurred while starting TCP Channel: " + e.getMessage()); // depends on control dependency: [if], data = [none]
}
ChannelException x = new ChannelException("TCP Channel: " + getExternalName() + "- Problem occurred while starting channel: " + e.getMessage());
// Adjust flag so follow up attempt is possible.
this.stopFlag = true;
throw x;
}
}
if (this.config.getDumpStatsInterval() > 0) {
createStatisticsThread(); // depends on control dependency: [if], data = [none]
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
Tr.exit(tc, "start"); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
@Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
if (pvalue == null) {
return true;
}
try {
final Object field1Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field1Name);
final Object field2Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field2Name);
if ((field1Value == null
|| field1Value instanceof String && StringUtils.isEmpty((String) field1Value))
&& (field2Value == null
|| field2Value instanceof String && StringUtils.isEmpty((String) field2Value))) {
return true;
}
if (Objects.equals(field1Value, field2Value)) {
switchContext(pcontext);
return false;
}
return true;
} catch (final Exception ignore) {
switchContext(pcontext);
return false;
}
} }
|
public class class_name {
@Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
if (pvalue == null) {
return true; // depends on control dependency: [if], data = [none]
}
try {
final Object field1Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field1Name);
final Object field2Value = BeanPropertyReaderUtil.getNullSaveProperty(pvalue, field2Name);
if ((field1Value == null
|| field1Value instanceof String && StringUtils.isEmpty((String) field1Value))
&& (field2Value == null
|| field2Value instanceof String && StringUtils.isEmpty((String) field2Value))) {
return true; // depends on control dependency: [if], data = [none]
}
if (Objects.equals(field1Value, field2Value)) {
switchContext(pcontext); // depends on control dependency: [if], data = [none]
return false; // depends on control dependency: [if], data = [none]
}
return true; // depends on control dependency: [try], data = [none]
} catch (final Exception ignore) {
switchContext(pcontext);
return false;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
protected void decompressData(ArrayList arr) {
HashMap fstData = null; // The first data record (Map type)
HashMap cprData; // The following data record which will be compressed
for (Object sub : arr) {
if (sub instanceof ArrayList) {
// iterate sub array nodes
decompressData((ArrayList) sub);
} else if (sub instanceof HashMap) {
// iterate sub data nodes
decompressData((HashMap) sub);
// Compress data for current array
if (fstData == null) {
// Get first data node
fstData = (HashMap) sub;
} else {
cprData = (HashMap) sub;
// The omitted data will be recovered to the following map; Only data item (String type) will be processed
for (Object key : fstData.keySet()) {
if (!cprData.containsKey(key)) {
cprData.put(key, fstData.get(key));
}
}
}
} else {
}
}
} }
|
public class class_name {
protected void decompressData(ArrayList arr) {
HashMap fstData = null; // The first data record (Map type)
HashMap cprData; // The following data record which will be compressed
for (Object sub : arr) {
if (sub instanceof ArrayList) {
// iterate sub array nodes
decompressData((ArrayList) sub); // depends on control dependency: [if], data = [none]
} else if (sub instanceof HashMap) {
// iterate sub data nodes
decompressData((HashMap) sub); // depends on control dependency: [if], data = [none]
// Compress data for current array
if (fstData == null) {
// Get first data node
fstData = (HashMap) sub; // depends on control dependency: [if], data = [none]
} else {
cprData = (HashMap) sub; // depends on control dependency: [if], data = [none]
// The omitted data will be recovered to the following map; Only data item (String type) will be processed
for (Object key : fstData.keySet()) {
if (!cprData.containsKey(key)) {
cprData.put(key, fstData.get(key)); // depends on control dependency: [if], data = [none]
}
}
}
} else {
}
}
} }
|
public class class_name {
public String loadSpecification()
{
try
{
specification = gpUtil.getSpecification(spaceKey, getPage().getTitle());
}
catch (GreenPepperServerException e)
{
if(!e.getId().equals(GreenPepperServerErrorKey.SPECIFICATION_NOT_FOUND))
addActionError(e.getId());
}
return SUCCESS;
} }
|
public class class_name {
public String loadSpecification()
{
try
{
specification = gpUtil.getSpecification(spaceKey, getPage().getTitle()); // depends on control dependency: [try], data = [none]
}
catch (GreenPepperServerException e)
{
if(!e.getId().equals(GreenPepperServerErrorKey.SPECIFICATION_NOT_FOUND))
addActionError(e.getId());
} // depends on control dependency: [catch], data = [none]
return SUCCESS;
} }
|
public class class_name {
@Override
protected List<S> reproduction(List<S> population) {
int numberOfParents = crossoverOperator.getNumberOfRequiredParents() ;
checkNumberOfParents(population, numberOfParents);
List<S> offspringPopulation = new ArrayList<>(getMaxPopulationSize());
for (int i = 0; i < getMaxPopulationSize(); i += numberOfParents) {
List<S> parents = new ArrayList<>(numberOfParents);
for (int j = 0; j < numberOfParents; j++) {
parents.add(population.get(i+j));
}
List<S> offspring = crossoverOperator.execute(parents);
for(S s: offspring){
mutationOperator.execute(s);
offspringPopulation.add(s);
}
}
return offspringPopulation;
} }
|
public class class_name {
@Override
protected List<S> reproduction(List<S> population) {
int numberOfParents = crossoverOperator.getNumberOfRequiredParents() ;
checkNumberOfParents(population, numberOfParents);
List<S> offspringPopulation = new ArrayList<>(getMaxPopulationSize());
for (int i = 0; i < getMaxPopulationSize(); i += numberOfParents) {
List<S> parents = new ArrayList<>(numberOfParents);
for (int j = 0; j < numberOfParents; j++) {
parents.add(population.get(i+j)); // depends on control dependency: [for], data = [j]
}
List<S> offspring = crossoverOperator.execute(parents);
for(S s: offspring){
mutationOperator.execute(s); // depends on control dependency: [for], data = [s]
offspringPopulation.add(s); // depends on control dependency: [for], data = [s]
}
}
return offspringPopulation;
} }
|
public class class_name {
public boolean isCorrelated() {
if (opType == OpTypes.TABLE_SUBQUERY && subQuery != null
&& subQuery.isCorrelated()) {
return true;
}
return false;
} }
|
public class class_name {
public boolean isCorrelated() {
if (opType == OpTypes.TABLE_SUBQUERY && subQuery != null
&& subQuery.isCorrelated()) {
return true; // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
public void performTranslation(File gensrcDir, Map<String,Transformer> suffixRules) {
Map<String,Transformer> sr = new HashMap<String,Transformer>();
for (Map.Entry<String,Transformer> e : suffixRules.entrySet()) {
if (e.getValue() != copyFiles &&
e.getValue() != compileJavaPackages) {
sr.put(e.getKey(), e.getValue());
}
}
perform(gensrcDir, sr);
} }
|
public class class_name {
public void performTranslation(File gensrcDir, Map<String,Transformer> suffixRules) {
Map<String,Transformer> sr = new HashMap<String,Transformer>();
for (Map.Entry<String,Transformer> e : suffixRules.entrySet()) {
if (e.getValue() != copyFiles &&
e.getValue() != compileJavaPackages) {
sr.put(e.getKey(), e.getValue()); // depends on control dependency: [if], data = [none]
}
}
perform(gensrcDir, sr);
} }
|
public class class_name {
public void setFillColor(Color color) {
String hex = null;
Double opacity = null;
if (color != null) {
hex = color.getColorHexShorthand();
opacity = new Double(color.getOpacity());
}
setFillColor(hex);
setFillOpacity(opacity);
} }
|
public class class_name {
public void setFillColor(Color color) {
String hex = null;
Double opacity = null;
if (color != null) {
hex = color.getColorHexShorthand(); // depends on control dependency: [if], data = [none]
opacity = new Double(color.getOpacity()); // depends on control dependency: [if], data = [(color]
}
setFillColor(hex);
setFillOpacity(opacity);
} }
|
public class class_name {
public static Uri getFileUri(Activity activity, File file) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return FileProvider.getUriForFile(activity, activity.getPackageName() + ".file.path.share", file);
}
return Uri.fromFile(file);
} }
|
public class class_name {
public static Uri getFileUri(Activity activity, File file) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
return FileProvider.getUriForFile(activity, activity.getPackageName() + ".file.path.share", file); // depends on control dependency: [if], data = [none]
}
return Uri.fromFile(file);
} }
|
public class class_name {
public static String remove(final String s, final String remove) {
if (isEmpty(s) || isEmpty(remove)) {
return s;
}
return replace(s, remove, "", -1);
} }
|
public class class_name {
public static String remove(final String s, final String remove) {
if (isEmpty(s) || isEmpty(remove)) {
return s; // depends on control dependency: [if], data = [none]
}
return replace(s, remove, "", -1);
} }
|
public class class_name {
public static MockMvcFactory of(Object[] controllerOrMockMvcConfigurers) {
List<Object> controllers = new ArrayList<Object>();
List<MockMvcConfigurer> configurers = new ArrayList<MockMvcConfigurer>();
for (Object object : controllerOrMockMvcConfigurers) {
if (object instanceof MockMvcConfigurer) {
configurers.add((MockMvcConfigurer) object);
} else {
controllers.add(object);
}
}
StandaloneMockMvcBuilder mockMvc = MockMvcBuilders.standaloneSetup(controllers.toArray());
if (!configurers.isEmpty()) {
for (MockMvcConfigurer configurer : configurers) {
mockMvc.apply(configurer);
}
}
return new MockMvcFactory(mockMvc);
} }
|
public class class_name {
public static MockMvcFactory of(Object[] controllerOrMockMvcConfigurers) {
List<Object> controllers = new ArrayList<Object>();
List<MockMvcConfigurer> configurers = new ArrayList<MockMvcConfigurer>();
for (Object object : controllerOrMockMvcConfigurers) {
if (object instanceof MockMvcConfigurer) {
configurers.add((MockMvcConfigurer) object); // depends on control dependency: [if], data = [none]
} else {
controllers.add(object); // depends on control dependency: [if], data = [none]
}
}
StandaloneMockMvcBuilder mockMvc = MockMvcBuilders.standaloneSetup(controllers.toArray());
if (!configurers.isEmpty()) {
for (MockMvcConfigurer configurer : configurers) {
mockMvc.apply(configurer); // depends on control dependency: [for], data = [configurer]
}
}
return new MockMvcFactory(mockMvc);
} }
|
public class class_name {
public String getParameterValue(String name) {
NodeList parms = node.getChildNodes();
for (int i = 0; i < parms.getLength(); i++) {
Element parm = (Element) parms.item(i);
if (parm.getTagName().equals(Constants.ELM_PARAMETER)) {
String parmName = parm.getAttribute(Constants.ATT_NAME);
if (parmName.equals(name)) {
return parm.getAttribute(Constants.ATT_VALUE);
}
}
}
// if we get here then neither the fragment nor the channel definition
// provided this parameter
return null;
} }
|
public class class_name {
public String getParameterValue(String name) {
NodeList parms = node.getChildNodes();
for (int i = 0; i < parms.getLength(); i++) {
Element parm = (Element) parms.item(i);
if (parm.getTagName().equals(Constants.ELM_PARAMETER)) {
String parmName = parm.getAttribute(Constants.ATT_NAME);
if (parmName.equals(name)) {
return parm.getAttribute(Constants.ATT_VALUE); // depends on control dependency: [if], data = [none]
}
}
}
// if we get here then neither the fragment nor the channel definition
// provided this parameter
return null;
} }
|
public class class_name {
public XExtension getByPrefix(String prefix) {
for (XExtension ext : extensionList) {
if (ext.getPrefix().equals(prefix)) {
return ext;
}
}
return null;
} }
|
public class class_name {
public XExtension getByPrefix(String prefix) {
for (XExtension ext : extensionList) {
if (ext.getPrefix().equals(prefix)) {
return ext; // depends on control dependency: [if], data = [none]
}
}
return null;
} }
|
public class class_name {
public Observable<ServiceResponse<Page<CertificateItem>>> getCertificatesWithServiceResponseAsync(final String vaultBaseUrl) {
return getCertificatesSinglePageAsync(vaultBaseUrl)
.concatMap(new Func1<ServiceResponse<Page<CertificateItem>>, Observable<ServiceResponse<Page<CertificateItem>>>>() {
@Override
public Observable<ServiceResponse<Page<CertificateItem>>> call(ServiceResponse<Page<CertificateItem>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(getCertificatesNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<Page<CertificateItem>>> getCertificatesWithServiceResponseAsync(final String vaultBaseUrl) {
return getCertificatesSinglePageAsync(vaultBaseUrl)
.concatMap(new Func1<ServiceResponse<Page<CertificateItem>>, Observable<ServiceResponse<Page<CertificateItem>>>>() {
@Override
public Observable<ServiceResponse<Page<CertificateItem>>> call(ServiceResponse<Page<CertificateItem>> 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(getCertificatesNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public void namespaceAfterStartElement(String prefix, String uri)
throws SAXException
{
// hack for XSLTC with finding URI for default namespace
if (m_firstTagNotEmitted && m_firstElementURI == null && m_firstElementName != null)
{
String prefix1 = getPrefixPart(m_firstElementName);
if (prefix1 == null && EMPTYSTRING.equals(prefix))
{
// the elements URI is not known yet, and it
// doesn't have a prefix, and we are currently
// setting the uri for prefix "", so we have
// the uri for the element... lets remember it
m_firstElementURI = uri;
}
}
startPrefixMapping(prefix,uri, false);
} }
|
public class class_name {
public void namespaceAfterStartElement(String prefix, String uri)
throws SAXException
{
// hack for XSLTC with finding URI for default namespace
if (m_firstTagNotEmitted && m_firstElementURI == null && m_firstElementName != null)
{
String prefix1 = getPrefixPart(m_firstElementName);
if (prefix1 == null && EMPTYSTRING.equals(prefix))
{
// the elements URI is not known yet, and it
// doesn't have a prefix, and we are currently
// setting the uri for prefix "", so we have
// the uri for the element... lets remember it
m_firstElementURI = uri; // depends on control dependency: [if], data = [none]
}
}
startPrefixMapping(prefix,uri, false);
} }
|
public class class_name {
public void marshall(LambdaFunctionScheduledEventAttributes lambdaFunctionScheduledEventAttributes, ProtocolMarshaller protocolMarshaller) {
if (lambdaFunctionScheduledEventAttributes == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getId(), ID_BINDING);
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getName(), NAME_BINDING);
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getControl(), CONTROL_BINDING);
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getInput(), INPUT_BINDING);
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getStartToCloseTimeout(), STARTTOCLOSETIMEOUT_BINDING);
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getDecisionTaskCompletedEventId(), DECISIONTASKCOMPLETEDEVENTID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(LambdaFunctionScheduledEventAttributes lambdaFunctionScheduledEventAttributes, ProtocolMarshaller protocolMarshaller) {
if (lambdaFunctionScheduledEventAttributes == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getId(), ID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getControl(), CONTROL_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getInput(), INPUT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getStartToCloseTimeout(), STARTTOCLOSETIMEOUT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(lambdaFunctionScheduledEventAttributes.getDecisionTaskCompletedEventId(), DECISIONTASKCOMPLETEDEVENTID_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 {
@Override
public @Nonnull MachineImage registerImageBundle(@Nonnull ImageCreateOptions options) throws CloudException, InternalException {
APITrace.begin(getProvider(), "Image.registerImageBundle");
try {
if( !MachineImageFormat.AWS.equals(options.getBundleFormat()) ) {
throw new CloudException("Unsupported bundle format: " + options.getBundleFormat());
}
if( options.getBundleLocation() == null ) {
throw new OperationNotSupportedException("A valid bundle location in object storage was not provided");
}
Map<String,String> parameters = getProvider(). getStandardParameters(getProvider(). getContext(), EC2Method.REGISTER_IMAGE);
NodeList blocks;
EC2Method method;
Document doc;
parameters.put("ImageLocation", options.getBundleLocation());
method = new EC2Method(getProvider(), parameters);
try {
doc = method.invoke();
}
catch( EC2Exception e ) {
logger.error(e.getSummary());
throw new CloudException(e);
}
blocks = doc.getElementsByTagName("imageId");
if( blocks.getLength() > 0 ) {
Node imageIdNode = blocks.item(0);
String id = imageIdNode.getFirstChild().getNodeValue().trim();
MachineImage img = getMachineImage(id);
if( img == null ) {
throw new CloudException("Expected to find newly registered machine image '" + id + "', but none was found");
}
return img;
}
throw new CloudException("No machine image was registered, but no error was thrown");
}
finally {
APITrace.end();
}
} }
|
public class class_name {
@Override
public @Nonnull MachineImage registerImageBundle(@Nonnull ImageCreateOptions options) throws CloudException, InternalException {
APITrace.begin(getProvider(), "Image.registerImageBundle");
try {
if( !MachineImageFormat.AWS.equals(options.getBundleFormat()) ) {
throw new CloudException("Unsupported bundle format: " + options.getBundleFormat());
}
if( options.getBundleLocation() == null ) {
throw new OperationNotSupportedException("A valid bundle location in object storage was not provided");
}
Map<String,String> parameters = getProvider(). getStandardParameters(getProvider(). getContext(), EC2Method.REGISTER_IMAGE);
NodeList blocks;
EC2Method method;
Document doc;
parameters.put("ImageLocation", options.getBundleLocation());
method = new EC2Method(getProvider(), parameters);
try {
doc = method.invoke(); // depends on control dependency: [try], data = [none]
}
catch( EC2Exception e ) {
logger.error(e.getSummary());
throw new CloudException(e);
} // depends on control dependency: [catch], data = [none]
blocks = doc.getElementsByTagName("imageId");
if( blocks.getLength() > 0 ) {
Node imageIdNode = blocks.item(0);
String id = imageIdNode.getFirstChild().getNodeValue().trim();
MachineImage img = getMachineImage(id);
if( img == null ) {
throw new CloudException("Expected to find newly registered machine image '" + id + "', but none was found");
}
return img; // depends on control dependency: [if], data = [none]
}
throw new CloudException("No machine image was registered, but no error was thrown");
}
finally {
APITrace.end();
}
} }
|
public class class_name {
public DescribeSpotInstanceRequestsRequest withSpotInstanceRequestIds(String... spotInstanceRequestIds) {
if (this.spotInstanceRequestIds == null) {
setSpotInstanceRequestIds(new com.amazonaws.internal.SdkInternalList<String>(spotInstanceRequestIds.length));
}
for (String ele : spotInstanceRequestIds) {
this.spotInstanceRequestIds.add(ele);
}
return this;
} }
|
public class class_name {
public DescribeSpotInstanceRequestsRequest withSpotInstanceRequestIds(String... spotInstanceRequestIds) {
if (this.spotInstanceRequestIds == null) {
setSpotInstanceRequestIds(new com.amazonaws.internal.SdkInternalList<String>(spotInstanceRequestIds.length)); // depends on control dependency: [if], data = [none]
}
for (String ele : spotInstanceRequestIds) {
this.spotInstanceRequestIds.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
private ArrayList obtainCandidateList(String[] tTokens, String[] uTokens,
double[] tIdfArray, double[] uIdfArray) {
ArrayList candidateList = new ArrayList();
double minStringSize = getMinStringSize(tTokens, uTokens);
for (int t = 0; t < tTokens.length; t++) {
int lastTr = -1;
for (int u = 0, flag = 0; u < uTokens.length && flag == 0; u++) {
int tr = Math.abs(t - u);
if (lastTr >= 0 && lastTr < tr) {
flag = 1;
}
else {
String tTok = tTokens[t], uTok = uTokens[u];
double innerScore = tokenDistance.score(tTok,
uTok);
if (innerScore >= 0.0) {
double matched = 0.0;
if (innerScore == 1.0) {
matched = tTokens[t].length();
}
else {
matched = ( (TagLinkToken) tokenDistance).getMatched();
}
double weightMatched = matched / minStringSize,
weightTFIDF = tIdfArray[t] * uIdfArray[u],
weight = (weightTFIDF + weightMatched) / 2.0;
if (innerScore == 1) {
lastTr = tr;
}
candidateList.add(new Candidates(t, u, innerScore * weight));
}
}
}
}
return candidateList;
} }
|
public class class_name {
private ArrayList obtainCandidateList(String[] tTokens, String[] uTokens,
double[] tIdfArray, double[] uIdfArray) {
ArrayList candidateList = new ArrayList();
double minStringSize = getMinStringSize(tTokens, uTokens);
for (int t = 0; t < tTokens.length; t++) {
int lastTr = -1;
for (int u = 0, flag = 0; u < uTokens.length && flag == 0; u++) {
int tr = Math.abs(t - u);
if (lastTr >= 0 && lastTr < tr) {
flag = 1;
// depends on control dependency: [if], data = [none]
}
else {
String tTok = tTokens[t], uTok = uTokens[u];
double innerScore = tokenDistance.score(tTok,
uTok);
if (innerScore >= 0.0) {
double matched = 0.0;
if (innerScore == 1.0) {
matched = tTokens[t].length();
// depends on control dependency: [if], data = [none]
}
else {
matched = ( (TagLinkToken) tokenDistance).getMatched();
// depends on control dependency: [if], data = [none]
}
double weightMatched = matched / minStringSize,
weightTFIDF = tIdfArray[t] * uIdfArray[u],
weight = (weightTFIDF + weightMatched) / 2.0;
if (innerScore == 1) {
lastTr = tr;
// depends on control dependency: [if], data = [none]
}
candidateList.add(new Candidates(t, u, innerScore * weight));
// depends on control dependency: [if], data = [none]
}
}
}
}
return candidateList;
} }
|
public class class_name {
public void stop() {
if (runnerThread == null) {
return;
}
runnerThread.interrupt();
nsLock.writeLock().lock();
try {
if (runnerThread == null) {
return;
}
this.cancel();
this.close();
while (runnerThread.isAlive()) {
runnerThread.interrupt();
try {
runnerThread.join(1000);
} catch (final Exception e) {
e.printStackTrace();
return;
}
}
runnerThread = null;
} catch (Exception e) {
e.printStackTrace();
} finally {
nsLock.writeLock().unlock();
}
} }
|
public class class_name {
public void stop() {
if (runnerThread == null) {
return; // depends on control dependency: [if], data = [none]
}
runnerThread.interrupt();
nsLock.writeLock().lock();
try {
if (runnerThread == null) {
return; // depends on control dependency: [if], data = [none]
}
this.cancel(); // depends on control dependency: [try], data = [none]
this.close(); // depends on control dependency: [try], data = [none]
while (runnerThread.isAlive()) {
runnerThread.interrupt(); // depends on control dependency: [while], data = [none]
try {
runnerThread.join(1000); // depends on control dependency: [try], data = [none]
} catch (final Exception e) {
e.printStackTrace();
return;
} // depends on control dependency: [catch], data = [none]
}
runnerThread = null; // depends on control dependency: [try], data = [none]
} catch (Exception e) {
e.printStackTrace();
} finally { // depends on control dependency: [catch], data = [none]
nsLock.writeLock().unlock();
}
} }
|
public class class_name {
public String nonpipelineWrite(String key, DataGenerator dataGenerator) {
String value = key + "__" + dataGenerator.getRandomValue() + "__" + key;
String result = this.jedisClient.get().set(key, value);
if (!"OK".equals(result)) {
logger.error("SET_ERROR: GOT " + result + " for SET operation");
throw new RuntimeException(String.format("DynoJedis: value %s for SET operation is NOT VALID", value, key));
}
return result;
} }
|
public class class_name {
public String nonpipelineWrite(String key, DataGenerator dataGenerator) {
String value = key + "__" + dataGenerator.getRandomValue() + "__" + key;
String result = this.jedisClient.get().set(key, value);
if (!"OK".equals(result)) {
logger.error("SET_ERROR: GOT " + result + " for SET operation"); // depends on control dependency: [if], data = [none]
throw new RuntimeException(String.format("DynoJedis: value %s for SET operation is NOT VALID", value, key));
}
return result;
} }
|
public class class_name {
public void marshall(InsertableImage insertableImage, ProtocolMarshaller protocolMarshaller) {
if (insertableImage == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(insertableImage.getDuration(), DURATION_BINDING);
protocolMarshaller.marshall(insertableImage.getFadeIn(), FADEIN_BINDING);
protocolMarshaller.marshall(insertableImage.getFadeOut(), FADEOUT_BINDING);
protocolMarshaller.marshall(insertableImage.getHeight(), HEIGHT_BINDING);
protocolMarshaller.marshall(insertableImage.getImageInserterInput(), IMAGEINSERTERINPUT_BINDING);
protocolMarshaller.marshall(insertableImage.getImageX(), IMAGEX_BINDING);
protocolMarshaller.marshall(insertableImage.getImageY(), IMAGEY_BINDING);
protocolMarshaller.marshall(insertableImage.getLayer(), LAYER_BINDING);
protocolMarshaller.marshall(insertableImage.getOpacity(), OPACITY_BINDING);
protocolMarshaller.marshall(insertableImage.getStartTime(), STARTTIME_BINDING);
protocolMarshaller.marshall(insertableImage.getWidth(), WIDTH_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(InsertableImage insertableImage, ProtocolMarshaller protocolMarshaller) {
if (insertableImage == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(insertableImage.getDuration(), DURATION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getFadeIn(), FADEIN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getFadeOut(), FADEOUT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getHeight(), HEIGHT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getImageInserterInput(), IMAGEINSERTERINPUT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getImageX(), IMAGEX_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getImageY(), IMAGEY_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getLayer(), LAYER_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getOpacity(), OPACITY_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getStartTime(), STARTTIME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(insertableImage.getWidth(), WIDTH_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 boolean isEUI64(boolean partial) {
int segmentCount = getSegmentCount();
int endIndex = addressSegmentIndex + segmentCount;
if(addressSegmentIndex <= 5) {
if(endIndex > 6) {
int index3 = 5 - addressSegmentIndex;
IPv6AddressSegment seg3 = getSegment(index3);
IPv6AddressSegment seg4 = getSegment(index3 + 1);
return seg4.matchesWithMask(0xfe00, 0xff00) && seg3.matchesWithMask(0xff, 0xff);
} else if(partial && endIndex == 6) {
IPv6AddressSegment seg3 = getSegment(5 - addressSegmentIndex);
return seg3.matchesWithMask(0xff, 0xff);
}
} else if(partial && addressSegmentIndex == 6 && endIndex > 6) {
IPv6AddressSegment seg4 = getSegment(6 - addressSegmentIndex);
return seg4.matchesWithMask(0xfe00, 0xff00);
}
return partial;
} }
|
public class class_name {
public boolean isEUI64(boolean partial) {
int segmentCount = getSegmentCount();
int endIndex = addressSegmentIndex + segmentCount;
if(addressSegmentIndex <= 5) {
if(endIndex > 6) {
int index3 = 5 - addressSegmentIndex;
IPv6AddressSegment seg3 = getSegment(index3);
IPv6AddressSegment seg4 = getSegment(index3 + 1);
return seg4.matchesWithMask(0xfe00, 0xff00) && seg3.matchesWithMask(0xff, 0xff); // depends on control dependency: [if], data = [none]
} else if(partial && endIndex == 6) {
IPv6AddressSegment seg3 = getSegment(5 - addressSegmentIndex);
return seg3.matchesWithMask(0xff, 0xff); // depends on control dependency: [if], data = [none]
}
} else if(partial && addressSegmentIndex == 6 && endIndex > 6) {
IPv6AddressSegment seg4 = getSegment(6 - addressSegmentIndex);
return seg4.matchesWithMask(0xfe00, 0xff00); // depends on control dependency: [if], data = [none]
}
return partial;
} }
|
public class class_name {
protected void invalidateCacheEntry(String spaceId, String key, Object data) {
if (isCacheEnabled()) {
putToCache(getCacheName(), calcCacheKey(spaceId, key), data);
}
} }
|
public class class_name {
protected void invalidateCacheEntry(String spaceId, String key, Object data) {
if (isCacheEnabled()) {
putToCache(getCacheName(), calcCacheKey(spaceId, key), data); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public String extractTransition(XEvent event) {
XAttribute attribute = event.getAttributes().get(KEY_TRANSITION);
if (attribute == null) {
return null;
} else {
return ((XAttributeLiteral) attribute).getValue();
}
} }
|
public class class_name {
public String extractTransition(XEvent event) {
XAttribute attribute = event.getAttributes().get(KEY_TRANSITION);
if (attribute == null) {
return null; // depends on control dependency: [if], data = [none]
} else {
return ((XAttributeLiteral) attribute).getValue(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public boolean write(DataOutputStream daOut, boolean bFixedLength)
{
try {
Float flData = (Float)this.getData();
float fData;
if (flData == null)
fData = Float.NaN;
else
fData = flData.floatValue();
daOut.writeFloat(fData);
return true;
} catch (IOException ex) {
ex.printStackTrace();
return false;
}
} }
|
public class class_name {
public boolean write(DataOutputStream daOut, boolean bFixedLength)
{
try {
Float flData = (Float)this.getData();
float fData;
if (flData == null)
fData = Float.NaN;
else
fData = flData.floatValue();
daOut.writeFloat(fData); // depends on control dependency: [try], data = [none]
return true; // depends on control dependency: [try], data = [none]
} catch (IOException ex) {
ex.printStackTrace();
return false;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void readChild(Element element, PrintWriter ps, int level,
String name) {
String nbTab = tabMaker(level);
if (element instanceof Resource) {
Resource resource = (Resource) element;
writeBegin(ps, nbTab, name, level, element.getTypeAsString());
for (Resource.Entry entry : resource) {
Property key = entry.getKey();
Element value = entry.getValue();
level++;
readChild(value, ps, level, key.toString());
level--;
}
writeEnd(ps, nbTab, element.getTypeAsString());
} else {
Property elem = (Property) element;
writeProperties(ps, nbTab, name, element.getTypeAsString(),
elem.toString());
}
} }
|
public class class_name {
public void readChild(Element element, PrintWriter ps, int level,
String name) {
String nbTab = tabMaker(level);
if (element instanceof Resource) {
Resource resource = (Resource) element;
writeBegin(ps, nbTab, name, level, element.getTypeAsString());
// depends on control dependency: [if], data = [none]
for (Resource.Entry entry : resource) {
Property key = entry.getKey();
Element value = entry.getValue();
level++;
// depends on control dependency: [for], data = [none]
readChild(value, ps, level, key.toString());
// depends on control dependency: [for], data = [none]
level--;
// depends on control dependency: [for], data = [none]
}
writeEnd(ps, nbTab, element.getTypeAsString());
// depends on control dependency: [if], data = [none]
} else {
Property elem = (Property) element;
writeProperties(ps, nbTab, name, element.getTypeAsString(),
elem.toString());
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
static PackageInfo getDropboxAppPackage(Context context, Intent intent) {
PackageManager manager = context.getPackageManager();
List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
if (null == infos || 1 != infos.size()) {
// The official app doesn't exist, or only an older version
// is available, or multiple activities are confusing us.
return null;
} else {
// The official app exists. Make sure it's the correct one by
// checking signing keys.
ResolveInfo resolveInfo = manager.resolveActivity(intent, 0);
if (resolveInfo == null) {
return null;
}
final PackageInfo packageInfo;
try {
packageInfo = manager.getPackageInfo(resolveInfo.activityInfo.packageName,
PackageManager.GET_SIGNATURES);
} catch (NameNotFoundException e) {
return null;
}
for (Signature signature : packageInfo.signatures) {
for (String dbSignature : DROPBOX_APP_SIGNATURES) {
if (dbSignature.equals(signature.toCharsString())) {
return packageInfo;
}
}
}
}
return null;
} }
|
public class class_name {
static PackageInfo getDropboxAppPackage(Context context, Intent intent) {
PackageManager manager = context.getPackageManager();
List<ResolveInfo> infos = manager.queryIntentActivities(intent, 0);
if (null == infos || 1 != infos.size()) {
// The official app doesn't exist, or only an older version
// is available, or multiple activities are confusing us.
return null; // depends on control dependency: [if], data = [none]
} else {
// The official app exists. Make sure it's the correct one by
// checking signing keys.
ResolveInfo resolveInfo = manager.resolveActivity(intent, 0);
if (resolveInfo == null) {
return null; // depends on control dependency: [if], data = [none]
}
final PackageInfo packageInfo;
try {
packageInfo = manager.getPackageInfo(resolveInfo.activityInfo.packageName,
PackageManager.GET_SIGNATURES); // depends on control dependency: [try], data = [none]
} catch (NameNotFoundException e) {
return null;
} // depends on control dependency: [catch], data = [none]
for (Signature signature : packageInfo.signatures) {
for (String dbSignature : DROPBOX_APP_SIGNATURES) {
if (dbSignature.equals(signature.toCharsString())) {
return packageInfo; // depends on control dependency: [if], data = [none]
}
}
}
}
return null;
} }
|
public class class_name {
public List<CustomWindowStateType<PortletDescriptor>> getAllCustomWindowState()
{
List<CustomWindowStateType<PortletDescriptor>> list = new ArrayList<CustomWindowStateType<PortletDescriptor>>();
List<Node> nodeList = model.get("custom-window-state");
for(Node node: nodeList)
{
CustomWindowStateType<PortletDescriptor> type = new CustomWindowStateTypeImpl<PortletDescriptor>(this, "custom-window-state", model, node);
list.add(type);
}
return list;
} }
|
public class class_name {
public List<CustomWindowStateType<PortletDescriptor>> getAllCustomWindowState()
{
List<CustomWindowStateType<PortletDescriptor>> list = new ArrayList<CustomWindowStateType<PortletDescriptor>>();
List<Node> nodeList = model.get("custom-window-state");
for(Node node: nodeList)
{
CustomWindowStateType<PortletDescriptor> type = new CustomWindowStateTypeImpl<PortletDescriptor>(this, "custom-window-state", model, node);
list.add(type); // depends on control dependency: [for], data = [none]
}
return list;
} }
|
public class class_name {
public static int dayOfWeek(){
setTime();
int dayofweek = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (dayofweek == 0) {
dayofweek = 7;
}
return dayofweek;
} }
|
public class class_name {
public static int dayOfWeek(){
setTime();
int dayofweek = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (dayofweek == 0) {
dayofweek = 7; // depends on control dependency: [if], data = [none]
}
return dayofweek;
} }
|
public class class_name {
@Override
public void load(UnitDaoFactory unitDaoFactory) {
for (String query : queries) {
unitDaoFactory.getUnitDao().execute(query);
}
} }
|
public class class_name {
@Override
public void load(UnitDaoFactory unitDaoFactory) {
for (String query : queries) {
unitDaoFactory.getUnitDao().execute(query); // depends on control dependency: [for], data = [query]
}
} }
|
public class class_name {
public List<FaceletTaglibTagType<FaceletTaglibType<T>>> getAllTag()
{
List<FaceletTaglibTagType<FaceletTaglibType<T>>> list = new ArrayList<FaceletTaglibTagType<FaceletTaglibType<T>>>();
List<Node> nodeList = childNode.get("tag");
for(Node node: nodeList)
{
FaceletTaglibTagType<FaceletTaglibType<T>> type = new FaceletTaglibTagTypeImpl<FaceletTaglibType<T>>(this, "tag", childNode, node);
list.add(type);
}
return list;
} }
|
public class class_name {
public List<FaceletTaglibTagType<FaceletTaglibType<T>>> getAllTag()
{
List<FaceletTaglibTagType<FaceletTaglibType<T>>> list = new ArrayList<FaceletTaglibTagType<FaceletTaglibType<T>>>();
List<Node> nodeList = childNode.get("tag");
for(Node node: nodeList)
{
FaceletTaglibTagType<FaceletTaglibType<T>> type = new FaceletTaglibTagTypeImpl<FaceletTaglibType<T>>(this, "tag", childNode, node);
list.add(type); // depends on control dependency: [for], data = [none]
}
return list;
} }
|
public class class_name {
@Override
public EEnum getIfcComplexPropertyTemplateTypeEnum() {
if (ifcComplexPropertyTemplateTypeEnumEEnum == null) {
ifcComplexPropertyTemplateTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE
.getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(938);
}
return ifcComplexPropertyTemplateTypeEnumEEnum;
} }
|
public class class_name {
@Override
public EEnum getIfcComplexPropertyTemplateTypeEnum() {
if (ifcComplexPropertyTemplateTypeEnumEEnum == null) {
ifcComplexPropertyTemplateTypeEnumEEnum = (EEnum) EPackage.Registry.INSTANCE
.getEPackage(Ifc4Package.eNS_URI).getEClassifiers().get(938);
// depends on control dependency: [if], data = [none]
}
return ifcComplexPropertyTemplateTypeEnumEEnum;
} }
|
public class class_name {
private Map<String, Object> toMap(CompositeData value) {
Map<String, Object> data = new HashMap<String, Object>();
for(String key : value.getCompositeType().keySet()) {
data.put(key, value.get(key));
}
return data;
} }
|
public class class_name {
private Map<String, Object> toMap(CompositeData value) {
Map<String, Object> data = new HashMap<String, Object>();
for(String key : value.getCompositeType().keySet()) {
data.put(key, value.get(key)); // depends on control dependency: [for], data = [key]
}
return data;
} }
|
public class class_name {
public static ExtendedKeyUsage getExtendedKeyUsage(Set<String> usages)
{
KeyPurposeId[] keyUsages = new KeyPurposeId[usages.size()];
int i = 0;
for (String usage : usages) {
keyUsages[i++] = KeyPurposeId.getInstance(new ASN1ObjectIdentifier(usage));
}
return new ExtendedKeyUsage(keyUsages);
} }
|
public class class_name {
public static ExtendedKeyUsage getExtendedKeyUsage(Set<String> usages)
{
KeyPurposeId[] keyUsages = new KeyPurposeId[usages.size()];
int i = 0;
for (String usage : usages) {
keyUsages[i++] = KeyPurposeId.getInstance(new ASN1ObjectIdentifier(usage)); // depends on control dependency: [for], data = [usage]
}
return new ExtendedKeyUsage(keyUsages);
} }
|
public class class_name {
public void marshall(MaintenanceWindowLambdaParameters maintenanceWindowLambdaParameters, ProtocolMarshaller protocolMarshaller) {
if (maintenanceWindowLambdaParameters == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(maintenanceWindowLambdaParameters.getClientContext(), CLIENTCONTEXT_BINDING);
protocolMarshaller.marshall(maintenanceWindowLambdaParameters.getQualifier(), QUALIFIER_BINDING);
protocolMarshaller.marshall(maintenanceWindowLambdaParameters.getPayload(), PAYLOAD_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(MaintenanceWindowLambdaParameters maintenanceWindowLambdaParameters, ProtocolMarshaller protocolMarshaller) {
if (maintenanceWindowLambdaParameters == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(maintenanceWindowLambdaParameters.getClientContext(), CLIENTCONTEXT_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(maintenanceWindowLambdaParameters.getQualifier(), QUALIFIER_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(maintenanceWindowLambdaParameters.getPayload(), PAYLOAD_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 Map<String, Integer> suggest(String string, int maxCost, int substitutionCost) {
if (StringUtils.isNullOrBlank(string)) {
return Collections.emptyMap();
} else if (containsKey(string)) {
return Maps.map(string, 0);
}
Map<String, Integer> results = new HashMap<>();
int[] current = new int[string.length() + 1];
for (int i = 0; i < current.length; i++) {
current[i] = i;
}
for (TrieNode<V> child : root.children) {
if (child != null) {
search(child, child.nodeChar, string, current, results, maxCost, substitutionCost);
}
}
return results;
} }
|
public class class_name {
public Map<String, Integer> suggest(String string, int maxCost, int substitutionCost) {
if (StringUtils.isNullOrBlank(string)) {
return Collections.emptyMap(); // depends on control dependency: [if], data = [none]
} else if (containsKey(string)) {
return Maps.map(string, 0); // depends on control dependency: [if], data = [none]
}
Map<String, Integer> results = new HashMap<>();
int[] current = new int[string.length() + 1];
for (int i = 0; i < current.length; i++) {
current[i] = i; // depends on control dependency: [for], data = [i]
}
for (TrieNode<V> child : root.children) {
if (child != null) {
search(child, child.nodeChar, string, current, results, maxCost, substitutionCost); // depends on control dependency: [if], data = [(child]
}
}
return results;
} }
|
public class class_name {
public void setNodeDataSizeIfQuotaExists(String repositoryName, String workspaceName, String nodePath, long dataSize)
{
setNodeDataSize(repositoryName, workspaceName, nodePath, dataSize);
try
{
getNodeQuotaOrGroupOfNodesQuota(repositoryName, workspaceName, nodePath);
}
catch (UnknownQuotaLimitException e)
{
removeNodeDataSize(repositoryName, workspaceName, nodePath);
}
} }
|
public class class_name {
public void setNodeDataSizeIfQuotaExists(String repositoryName, String workspaceName, String nodePath, long dataSize)
{
setNodeDataSize(repositoryName, workspaceName, nodePath, dataSize);
try
{
getNodeQuotaOrGroupOfNodesQuota(repositoryName, workspaceName, nodePath); // depends on control dependency: [try], data = [none]
}
catch (UnknownQuotaLimitException e)
{
removeNodeDataSize(repositoryName, workspaceName, nodePath);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private void checkForGenerator(final Class<?> clazz, Field field, GeneratedValue generatedValue, String schemaName)
{
TableGenerator tableGenerator = field.getAnnotation(TableGenerator.class);
SequenceGenerator sequenceGenerator = field.getAnnotation(SequenceGenerator.class);
if (tableGenerator == null || !tableGenerator.name().equals(generatedValue.generator()))
{
tableGenerator = clazz.getAnnotation(TableGenerator.class);
}
if (sequenceGenerator == null || !sequenceGenerator.name().equals(generatedValue.generator()))
{
sequenceGenerator = clazz.getAnnotation(SequenceGenerator.class);
}
if ((tableGenerator == null && sequenceGenerator == null)
|| (tableGenerator != null && !tableGenerator.name().equals(generatedValue.generator()))
|| (sequenceGenerator != null && !sequenceGenerator.name().equals(generatedValue.generator())))
{
throw new RuleValidationException("Unknown Id.generator: " + generatedValue.generator());
}
else if ((tableGenerator != null && !tableGenerator.schema().isEmpty() && !tableGenerator.schema().equals(
schemaName))
|| (sequenceGenerator != null && !sequenceGenerator.schema().isEmpty() && !sequenceGenerator.schema()
.equals(schemaName)))
{
throw new RuleValidationException("Generator " + generatedValue.generator() + " in entity : "
+ clazz.getName() + " has different schema name ,it should be same as entity have");
}
} }
|
public class class_name {
private void checkForGenerator(final Class<?> clazz, Field field, GeneratedValue generatedValue, String schemaName)
{
TableGenerator tableGenerator = field.getAnnotation(TableGenerator.class);
SequenceGenerator sequenceGenerator = field.getAnnotation(SequenceGenerator.class);
if (tableGenerator == null || !tableGenerator.name().equals(generatedValue.generator()))
{
tableGenerator = clazz.getAnnotation(TableGenerator.class); // depends on control dependency: [if], data = [none]
}
if (sequenceGenerator == null || !sequenceGenerator.name().equals(generatedValue.generator()))
{
sequenceGenerator = clazz.getAnnotation(SequenceGenerator.class); // depends on control dependency: [if], data = [none]
}
if ((tableGenerator == null && sequenceGenerator == null)
|| (tableGenerator != null && !tableGenerator.name().equals(generatedValue.generator()))
|| (sequenceGenerator != null && !sequenceGenerator.name().equals(generatedValue.generator())))
{
throw new RuleValidationException("Unknown Id.generator: " + generatedValue.generator());
}
else if ((tableGenerator != null && !tableGenerator.schema().isEmpty() && !tableGenerator.schema().equals(
schemaName))
|| (sequenceGenerator != null && !sequenceGenerator.schema().isEmpty() && !sequenceGenerator.schema()
.equals(schemaName)))
{
throw new RuleValidationException("Generator " + generatedValue.generator() + " in entity : "
+ clazz.getName() + " has different schema name ,it should be same as entity have");
}
} }
|
public class class_name {
private void incrementHeaderCounter() {
this.numberOfHeaders++;
this.headerAddCount++;
if (this.limitNumHeaders < this.numberOfHeaders) {
String msg = "Too many headers in storage: " + this.numberOfHeaders;
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, msg);
}
throw new IllegalArgumentException(msg);
}
} }
|
public class class_name {
private void incrementHeaderCounter() {
this.numberOfHeaders++;
this.headerAddCount++;
if (this.limitNumHeaders < this.numberOfHeaders) {
String msg = "Too many headers in storage: " + this.numberOfHeaders; // depends on control dependency: [if], data = [none]
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, msg); // depends on control dependency: [if], data = [none]
}
throw new IllegalArgumentException(msg);
}
} }
|
public class class_name {
private static void createList( int data[], int k , int level , List<int[]> ret )
{
data[k] = level;
if( level < data.length-1 ) {
for( int i = 0; i < data.length; i++ ) {
if( data[i] == -1 ) {
createList(data,i,level+1,ret);
}
}
} else {
int []copy = new int[data.length];
System.arraycopy(data,0,copy,0,data.length);
ret.add(copy);
}
data[k] = -1;
} }
|
public class class_name {
private static void createList( int data[], int k , int level , List<int[]> ret )
{
data[k] = level;
if( level < data.length-1 ) {
for( int i = 0; i < data.length; i++ ) {
if( data[i] == -1 ) {
createList(data,i,level+1,ret); // depends on control dependency: [if], data = [none]
}
}
} else {
int []copy = new int[data.length];
System.arraycopy(data,0,copy,0,data.length); // depends on control dependency: [if], data = [none]
ret.add(copy); // depends on control dependency: [if], data = [none]
}
data[k] = -1;
} }
|
public class class_name {
@Override
public IPAddress getAddress() throws IncompatibleAddressException {
if(!addressProvider.isInvalid()) { // Avoid the exception the second time with this check
try {
return toAddress();
} catch(AddressStringException e) { /* note that this exception is cached, it is not lost forever */ }
}
return null;
} }
|
public class class_name {
@Override
public IPAddress getAddress() throws IncompatibleAddressException {
if(!addressProvider.isInvalid()) { // Avoid the exception the second time with this check
try {
return toAddress(); // depends on control dependency: [try], data = [none]
} catch(AddressStringException e) { /* note that this exception is cached, it is not lost forever */ } // depends on control dependency: [catch], data = [exception]
}
return null;
} }
|
public class class_name {
static void rcvRequestMsgs(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvRequestMsgs",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 SyncConsumerSessionId
int receivedBytes = request.getInt(); // BIT32 ReceivedBytes
int requestedBytes = request.getInt(); // BIT32 RequestedBytes
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID);
SibTr.debug(tc, "consumerObjectID", consumerObjectID);
SibTr.debug(tc, "receivedBytes", receivedBytes);
SibTr.debug(tc, "requestedBytes", requestedBytes);
}
CATMainConsumer mainConsumer =
((CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectID));
mainConsumer.requestMsgs(requestNumber, receivedBytes, requestedBytes);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvRequestMsgs");
} }
|
public class class_name {
static void rcvRequestMsgs(CommsByteBuffer request, Conversation conversation, int requestNumber,
boolean allocatedFromBufferPool, boolean partOfExchange)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "rcvRequestMsgs",
new Object[]
{
request,
conversation,
"" + requestNumber,
"" + allocatedFromBufferPool
});
short connectionObjectID = request.getShort(); // BIT16 ConnectionObjectId
short consumerObjectID = request.getShort(); // BIT16 SyncConsumerSessionId
int receivedBytes = request.getInt(); // BIT32 ReceivedBytes
int requestedBytes = request.getInt(); // BIT32 RequestedBytes
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
{
SibTr.debug(tc, "connectionObjectID", connectionObjectID); // depends on control dependency: [if], data = [none]
SibTr.debug(tc, "consumerObjectID", consumerObjectID); // depends on control dependency: [if], data = [none]
SibTr.debug(tc, "receivedBytes", receivedBytes); // depends on control dependency: [if], data = [none]
SibTr.debug(tc, "requestedBytes", requestedBytes); // depends on control dependency: [if], data = [none]
}
CATMainConsumer mainConsumer =
((CATMainConsumer) ((ConversationState) conversation.getAttachment()).getObject(consumerObjectID));
mainConsumer.requestMsgs(requestNumber, receivedBytes, requestedBytes);
request.release(allocatedFromBufferPool);
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "rcvRequestMsgs");
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.