code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
public PoolResizeOptions withOcpDate(DateTime ocpDate) {
if (ocpDate == null) {
this.ocpDate = null;
} else {
this.ocpDate = new DateTimeRfc1123(ocpDate);
}
return this;
} }
|
public class class_name {
public PoolResizeOptions withOcpDate(DateTime ocpDate) {
if (ocpDate == null) {
this.ocpDate = null; // depends on control dependency: [if], data = [none]
} else {
this.ocpDate = new DateTimeRfc1123(ocpDate); // depends on control dependency: [if], data = [(ocpDate]
}
return this;
} }
|
public class class_name {
@Override
public EClass getIfcIrregularTimeSeries() {
if (ifcIrregularTimeSeriesEClass == null) {
ifcIrregularTimeSeriesEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(328);
}
return ifcIrregularTimeSeriesEClass;
} }
|
public class class_name {
@Override
public EClass getIfcIrregularTimeSeries() {
if (ifcIrregularTimeSeriesEClass == null) {
ifcIrregularTimeSeriesEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(328);
// depends on control dependency: [if], data = [none]
}
return ifcIrregularTimeSeriesEClass;
} }
|
public class class_name {
public static <T> T run(HTablePool pool, byte[] tableName, HTableRunnable<T> runnable)
throws IOException {
HTableInterface hTable = null;
try {
hTable = pool.getTable(tableName);
return runnable.runWith(hTable);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
} else {
throw new RuntimeException(e);
}
} finally {
if (hTable != null) {
pool.putTable(hTable);
}
}
} }
|
public class class_name {
public static <T> T run(HTablePool pool, byte[] tableName, HTableRunnable<T> runnable)
throws IOException {
HTableInterface hTable = null;
try {
hTable = pool.getTable(tableName);
return runnable.runWith(hTable);
} catch (Exception e) {
if (e instanceof IOException) {
throw (IOException) e;
} else {
throw new RuntimeException(e);
}
} finally {
if (hTable != null) {
pool.putTable(hTable); // depends on control dependency: [if], data = [(hTable]
}
}
} }
|
public class class_name {
private void correctMergedCell(final Sheet sheet, final RecordOperation recordOperation, final List<CellRangeAddress> mergedRegionList) {
if(recordOperation.isNotExecuteRecordOperation()) {
return;
}
// 操作をしていないセルの範囲の取得
final CellRangeAddress notOperateRange = new CellRangeAddress(
recordOperation.getTopLeftPoisitoin().y,
recordOperation.getBottomRightPosition().y - recordOperation.getCountInsertRecord(),
recordOperation.getTopLeftPoisitoin().x,
recordOperation.getBottomRightPosition().x
);
for(CellRangeAddress mergedRange : mergedRegionList) {
if(notOperateRange.getLastRow() >= mergedRange.getFirstRow()) {
// 行の追加・削除をしている上方の範囲の場合
continue;
} else {
/*
* 追加・削除をしている下方の範囲の場合、影響を受けているため修正する。
* ネストしている場合は、追加と削除の両方を行っているので考慮する
*/
if(recordOperation.isInsertRecord() || recordOperation.isDeleteRecord()) {
//
CellRangeAddress correctedRange = new CellRangeAddress(
mergedRange.getFirstRow() + recordOperation.getCountInsertRecord() - recordOperation.getCountDeleteRecord(),
mergedRange.getLastRow() + recordOperation.getCountInsertRecord() - recordOperation.getCountDeleteRecord(),
mergedRange.getFirstColumn(),
mergedRange.getLastColumn());
if(!isOverMergedRegion(sheet, correctedRange)) {
sheet.addMergedRegion(correctedRange);
}
}
}
}
} }
|
public class class_name {
private void correctMergedCell(final Sheet sheet, final RecordOperation recordOperation, final List<CellRangeAddress> mergedRegionList) {
if(recordOperation.isNotExecuteRecordOperation()) {
return;
// depends on control dependency: [if], data = [none]
}
// 操作をしていないセルの範囲の取得
final CellRangeAddress notOperateRange = new CellRangeAddress(
recordOperation.getTopLeftPoisitoin().y,
recordOperation.getBottomRightPosition().y - recordOperation.getCountInsertRecord(),
recordOperation.getTopLeftPoisitoin().x,
recordOperation.getBottomRightPosition().x
);
for(CellRangeAddress mergedRange : mergedRegionList) {
if(notOperateRange.getLastRow() >= mergedRange.getFirstRow()) {
// 行の追加・削除をしている上方の範囲の場合
continue;
} else {
/*
* 追加・削除をしている下方の範囲の場合、影響を受けているため修正する。
* ネストしている場合は、追加と削除の両方を行っているので考慮する
*/
if(recordOperation.isInsertRecord() || recordOperation.isDeleteRecord()) {
//
CellRangeAddress correctedRange = new CellRangeAddress(
mergedRange.getFirstRow() + recordOperation.getCountInsertRecord() - recordOperation.getCountDeleteRecord(),
mergedRange.getLastRow() + recordOperation.getCountInsertRecord() - recordOperation.getCountDeleteRecord(),
mergedRange.getFirstColumn(),
mergedRange.getLastColumn());
if(!isOverMergedRegion(sheet, correctedRange)) {
sheet.addMergedRegion(correctedRange);
// depends on control dependency: [if], data = [none]
}
}
}
}
} }
|
public class class_name {
private void mergeRows(ExcelRows excelRowsAnn, Cell templateCell, int itemSize) {
val tmplCellRowIndex = templateCell.getRowIndex();
for (val ann : excelRowsAnn.mergeRows()) {
val fr = ann.fromRef();
val cellRef = PoiUtil.isFullCellReference(fr) ? fr : fr + (tmplCellRowIndex + 1);
val fromCell = PoiUtil.findCell(sheet, cellRef);
val lastRow = tmplCellRowIndex + itemSize - 1;
if (ann.type() == MergeType.Direct) {
val fromRow = fromCell.getRow().getRowNum();
directMergeRows(ann, fromRow, lastRow, fromCell.getColumnIndex());
} else if (ann.type() == MergeType.SameValue) {
sameValueMergeRows(ann, itemSize, fromCell);
}
}
} }
|
public class class_name {
private void mergeRows(ExcelRows excelRowsAnn, Cell templateCell, int itemSize) {
val tmplCellRowIndex = templateCell.getRowIndex();
for (val ann : excelRowsAnn.mergeRows()) {
val fr = ann.fromRef();
val cellRef = PoiUtil.isFullCellReference(fr) ? fr : fr + (tmplCellRowIndex + 1);
val fromCell = PoiUtil.findCell(sheet, cellRef);
val lastRow = tmplCellRowIndex + itemSize - 1;
if (ann.type() == MergeType.Direct) {
val fromRow = fromCell.getRow().getRowNum();
directMergeRows(ann, fromRow, lastRow, fromCell.getColumnIndex()); // depends on control dependency: [if], data = [none]
} else if (ann.type() == MergeType.SameValue) {
sameValueMergeRows(ann, itemSize, fromCell); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public Map<String, String> parse(Map<String, String> style) {
Map<String, String> mapRtn = new HashMap<String, String>();
String height = style.get(HEIGHT);
if (CssUtils.isNum(height)) {
mapRtn.put(HEIGHT, height);
}
return mapRtn;
} }
|
public class class_name {
public Map<String, String> parse(Map<String, String> style) {
Map<String, String> mapRtn = new HashMap<String, String>();
String height = style.get(HEIGHT);
if (CssUtils.isNum(height)) {
mapRtn.put(HEIGHT, height); // depends on control dependency: [if], data = [none]
}
return mapRtn;
} }
|
public class class_name {
public Node addChild(Node n) {
if (!this.children.containsKey(n.getToken())) {
this.children.put(n.getToken(),n);
n.setParent(this);
return n;
} else {
return (Node)this.children.get(n.getToken());
}
} }
|
public class class_name {
public Node addChild(Node n) {
if (!this.children.containsKey(n.getToken())) {
this.children.put(n.getToken(),n); // depends on control dependency: [if], data = [none]
n.setParent(this); // depends on control dependency: [if], data = [none]
return n; // depends on control dependency: [if], data = [none]
} else {
return (Node)this.children.get(n.getToken()); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
void andNot(LongBitSet other) {
int pos = Math.min(numWords, other.numWords);
while (--pos >= 0) {
bits[pos] &= ~other.bits[pos];
}
} }
|
public class class_name {
void andNot(LongBitSet other) {
int pos = Math.min(numWords, other.numWords);
while (--pos >= 0) {
bits[pos] &= ~other.bits[pos];
// depends on control dependency: [while], data = [none]
}
} }
|
public class class_name {
public void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate)
{
if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
{
throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
}
try
{
// anyway set local update in progress
localUpdateInProgress = updateInProgress;
if (persitentUpdate)
{
setUpdateInProgress.run(new Boolean(updateInProgress));
}
for (IndexUpdateMonitorListener listener : listeners)
{
listener.onUpdateInProgressChange(updateInProgress);
}
}
catch (CacheException e)
{
LOG.error("Fail to change updateInProgress mode to " + updateInProgress, e);
}
} }
|
public class class_name {
public void setUpdateInProgress(boolean updateInProgress, boolean persitentUpdate)
{
if (IndexerIoMode.READ_ONLY == modeHandler.getMode())
{
throw new IllegalStateException("Unable to set updateInProgress value in IndexerIoMode.READ_ONLY mode");
}
try
{
// anyway set local update in progress
localUpdateInProgress = updateInProgress; // depends on control dependency: [try], data = [none]
if (persitentUpdate)
{
setUpdateInProgress.run(new Boolean(updateInProgress)); // depends on control dependency: [if], data = [none]
}
for (IndexUpdateMonitorListener listener : listeners)
{
listener.onUpdateInProgressChange(updateInProgress); // depends on control dependency: [for], data = [listener]
}
}
catch (CacheException e)
{
LOG.error("Fail to change updateInProgress mode to " + updateInProgress, e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static <E> int binarySearch(List<? extends E> list, @Nullable E key,
Comparator<? super E> comparator, KeyPresentBehavior presentBehavior,
KeyAbsentBehavior absentBehavior) {
checkNotNull(comparator);
checkNotNull(list);
checkNotNull(presentBehavior);
checkNotNull(absentBehavior);
if (!(list instanceof RandomAccess)) {
list = Lists.newArrayList(list);
}
// TODO(user): benchmark when it's best to do a linear search
int lower = 0;
int upper = list.size() - 1;
while (lower <= upper) {
int middle = (lower + upper) >>> 1;
int c = comparator.compare(key, list.get(middle));
if (c < 0) {
upper = middle - 1;
} else if (c > 0) {
lower = middle + 1;
} else {
return lower + presentBehavior.resultIndex(
comparator, key, list.subList(lower, upper + 1), middle - lower);
}
}
return absentBehavior.resultIndex(lower);
} }
|
public class class_name {
public static <E> int binarySearch(List<? extends E> list, @Nullable E key,
Comparator<? super E> comparator, KeyPresentBehavior presentBehavior,
KeyAbsentBehavior absentBehavior) {
checkNotNull(comparator);
checkNotNull(list);
checkNotNull(presentBehavior);
checkNotNull(absentBehavior);
if (!(list instanceof RandomAccess)) {
list = Lists.newArrayList(list); // depends on control dependency: [if], data = [none]
}
// TODO(user): benchmark when it's best to do a linear search
int lower = 0;
int upper = list.size() - 1;
while (lower <= upper) {
int middle = (lower + upper) >>> 1;
int c = comparator.compare(key, list.get(middle));
if (c < 0) {
upper = middle - 1; // depends on control dependency: [if], data = [none]
} else if (c > 0) {
lower = middle + 1; // depends on control dependency: [if], data = [none]
} else {
return lower + presentBehavior.resultIndex(
comparator, key, list.subList(lower, upper + 1), middle - lower); // depends on control dependency: [if], data = [none]
}
}
return absentBehavior.resultIndex(lower);
} }
|
public class class_name {
public String getOptimizerPlanAsJSON(Plan plan) throws Exception {
synchronized (this.lock) {
// check if we start a session dedicated for this execution
final boolean shutDownAtEnd;
if (this.nephele == null) {
// we start a session just for us now
shutDownAtEnd = true;
start();
} else {
// we use the existing session
shutDownAtEnd = false;
}
try {
PactCompiler pc = new PactCompiler(new DataStatistics());
OptimizedPlan op = pc.compile(plan);
PlanJSONDumpGenerator gen = new PlanJSONDumpGenerator();
return gen.getOptimizerPlanAsJSON(op);
}
finally {
if (shutDownAtEnd) {
stop();
}
}
}
} }
|
public class class_name {
public String getOptimizerPlanAsJSON(Plan plan) throws Exception {
synchronized (this.lock) {
// check if we start a session dedicated for this execution
final boolean shutDownAtEnd;
if (this.nephele == null) {
// we start a session just for us now
shutDownAtEnd = true; // depends on control dependency: [if], data = [none]
start(); // depends on control dependency: [if], data = [none]
} else {
// we use the existing session
shutDownAtEnd = false; // depends on control dependency: [if], data = [none]
}
try {
PactCompiler pc = new PactCompiler(new DataStatistics());
OptimizedPlan op = pc.compile(plan);
PlanJSONDumpGenerator gen = new PlanJSONDumpGenerator();
return gen.getOptimizerPlanAsJSON(op); // depends on control dependency: [try], data = [none]
}
finally {
if (shutDownAtEnd) {
stop(); // depends on control dependency: [if], data = [none]
}
}
}
} }
|
public class class_name {
private int[] predictForwardBackward(int[][] x) {
int n = x.length; // length of sequence
TrellisNode[][] trellis = getTrellis(x);
double[] scaling = new double[n];
forward(trellis, scaling);
backward(trellis);
int[] label = new int[n];
double[] p = new double[numClasses];
for (int i = 0; i < n; i++) {
TrellisNode[] ti = trellis[i];
for (int j = 0; j < numClasses; j++) {
TrellisNode tij = ti[j];
p[j] = tij.alpha * tij.beta;
}
double max = Double.NEGATIVE_INFINITY;
for (int j = 0; j < numClasses; j++) {
if (max < p[j]) {
max = p[j];
label[i] = j;
}
}
}
return label;
} }
|
public class class_name {
private int[] predictForwardBackward(int[][] x) {
int n = x.length; // length of sequence
TrellisNode[][] trellis = getTrellis(x);
double[] scaling = new double[n];
forward(trellis, scaling);
backward(trellis);
int[] label = new int[n];
double[] p = new double[numClasses];
for (int i = 0; i < n; i++) {
TrellisNode[] ti = trellis[i];
for (int j = 0; j < numClasses; j++) {
TrellisNode tij = ti[j];
p[j] = tij.alpha * tij.beta; // depends on control dependency: [for], data = [j]
}
double max = Double.NEGATIVE_INFINITY;
for (int j = 0; j < numClasses; j++) {
if (max < p[j]) {
max = p[j]; // depends on control dependency: [if], data = [none]
label[i] = j; // depends on control dependency: [if], data = [none]
}
}
}
return label;
} }
|
public class class_name {
public Pattern<T, F> where(IterativeCondition<F> condition) {
Preconditions.checkNotNull(condition, "The condition cannot be null.");
ClosureCleaner.clean(condition, true);
if (this.condition == null) {
this.condition = condition;
} else {
this.condition = new RichAndCondition<>(this.condition, condition);
}
return this;
} }
|
public class class_name {
public Pattern<T, F> where(IterativeCondition<F> condition) {
Preconditions.checkNotNull(condition, "The condition cannot be null.");
ClosureCleaner.clean(condition, true);
if (this.condition == null) {
this.condition = condition; // depends on control dependency: [if], data = [none]
} else {
this.condition = new RichAndCondition<>(this.condition, condition); // depends on control dependency: [if], data = [(this.condition]
}
return this;
} }
|
public class class_name {
private void mapSerialFieldTagImplsToFieldDocImpls(FieldDocImpl spfDoc,
DocEnv env,
ClassSymbol def) {
Names names = def.name.table.names;
SerialFieldTag[] sfTag = spfDoc.serialFieldTags();
for (int i = 0; i < sfTag.length; i++) {
if (sfTag[i].fieldName() == null || sfTag[i].fieldType() == null) // ignore malformed @serialField tags
continue;
Name fieldName = names.fromString(sfTag[i].fieldName());
// Look for a FieldDocImpl that is documented by serialFieldTagImpl.
for (Scope.Entry e = def.members().lookup(fieldName); e.scope != null; e = e.next()) {
if (e.sym.kind == Kinds.VAR) {
VarSymbol f = (VarSymbol)e.sym;
FieldDocImpl fdi = env.getFieldDoc(f);
((SerialFieldTagImpl)(sfTag[i])).mapToFieldDocImpl(fdi);
break;
}
}
}
} }
|
public class class_name {
private void mapSerialFieldTagImplsToFieldDocImpls(FieldDocImpl spfDoc,
DocEnv env,
ClassSymbol def) {
Names names = def.name.table.names;
SerialFieldTag[] sfTag = spfDoc.serialFieldTags();
for (int i = 0; i < sfTag.length; i++) {
if (sfTag[i].fieldName() == null || sfTag[i].fieldType() == null) // ignore malformed @serialField tags
continue;
Name fieldName = names.fromString(sfTag[i].fieldName());
// Look for a FieldDocImpl that is documented by serialFieldTagImpl.
for (Scope.Entry e = def.members().lookup(fieldName); e.scope != null; e = e.next()) {
if (e.sym.kind == Kinds.VAR) {
VarSymbol f = (VarSymbol)e.sym;
FieldDocImpl fdi = env.getFieldDoc(f);
((SerialFieldTagImpl)(sfTag[i])).mapToFieldDocImpl(fdi); // depends on control dependency: [if], data = [none]
break;
}
}
}
} }
|
public class class_name {
public Principal getCallerPrincipal(boolean useRealm, String realm, boolean web, boolean isJaspiEnabled) {
Subject subject = subjectManager.getCallerSubject();
if (subject == null) {
return null;
}
SubjectHelper subjectHelper = new SubjectHelper();
if (subjectHelper.isUnauthenticated(subject) && web) {
return null;
}
if (isJaspiEnabled) {
Principal principal = getPrincipalFromWSCredential(subjectHelper, subject);
if (principal != null) {
return principal;
}
}
String securityName = getSecurityNameFromWSCredential(subjectHelper, subject);
if (securityName == null) {
return null;
}
Principal jsonWebToken = MpJwtHelper.getJsonWebTokenPricipal(subject);
if (jsonWebToken != null) {
return jsonWebToken;
}
Set<WSPrincipal> principals = subject.getPrincipals(WSPrincipal.class);
if (principals.size() > 1) {
multiplePrincipalsError(principals);
}
WSPrincipal wsPrincipal = null;
if (!principals.isEmpty()) {
String principalName = createPrincipalName(useRealm, realm, securityName);
wsPrincipal = principals.iterator().next();
wsPrincipal = new WSPrincipal(principalName, wsPrincipal.getAccessId(), wsPrincipal.getAuthenticationMethod());
}
return wsPrincipal;
} }
|
public class class_name {
public Principal getCallerPrincipal(boolean useRealm, String realm, boolean web, boolean isJaspiEnabled) {
Subject subject = subjectManager.getCallerSubject();
if (subject == null) {
return null; // depends on control dependency: [if], data = [none]
}
SubjectHelper subjectHelper = new SubjectHelper();
if (subjectHelper.isUnauthenticated(subject) && web) {
return null; // depends on control dependency: [if], data = [none]
}
if (isJaspiEnabled) {
Principal principal = getPrincipalFromWSCredential(subjectHelper, subject);
if (principal != null) {
return principal; // depends on control dependency: [if], data = [none]
}
}
String securityName = getSecurityNameFromWSCredential(subjectHelper, subject);
if (securityName == null) {
return null; // depends on control dependency: [if], data = [none]
}
Principal jsonWebToken = MpJwtHelper.getJsonWebTokenPricipal(subject);
if (jsonWebToken != null) {
return jsonWebToken; // depends on control dependency: [if], data = [none]
}
Set<WSPrincipal> principals = subject.getPrincipals(WSPrincipal.class);
if (principals.size() > 1) {
multiplePrincipalsError(principals); // depends on control dependency: [if], data = [none]
}
WSPrincipal wsPrincipal = null;
if (!principals.isEmpty()) {
String principalName = createPrincipalName(useRealm, realm, securityName);
wsPrincipal = principals.iterator().next(); // depends on control dependency: [if], data = [none]
wsPrincipal = new WSPrincipal(principalName, wsPrincipal.getAccessId(), wsPrincipal.getAuthenticationMethod()); // depends on control dependency: [if], data = [none]
}
return wsPrincipal;
} }
|
public class class_name {
public static float getFloat(final String key, final float def) {
try {
return systemRoot.getFloat(fixKey(key), def);
} catch (final Exception e) {
// just eat the exception to avoid any system
// crash on system issues
return def;
}
} }
|
public class class_name {
public static float getFloat(final String key, final float def) {
try {
return systemRoot.getFloat(fixKey(key), def); // depends on control dependency: [try], data = [none]
} catch (final Exception e) {
// just eat the exception to avoid any system
// crash on system issues
return def;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void loadFromYAML(final InputStream is) throws IOException {
lock.writeLock().lock();
try {
final YAMLFactory f = new YAMLFactory();
final YAMLParser jp = f.createParser(is);
configureJsonParser(jp);
if (jp.nextToken() == JsonToken.START_OBJECT) {
traverseJSON(jp, null);
}
} finally {
lock.writeLock().unlock();
}
} }
|
public class class_name {
public void loadFromYAML(final InputStream is) throws IOException {
lock.writeLock().lock();
try {
final YAMLFactory f = new YAMLFactory();
final YAMLParser jp = f.createParser(is);
configureJsonParser(jp);
if (jp.nextToken() == JsonToken.START_OBJECT) {
traverseJSON(jp, null); // depends on control dependency: [if], data = [none]
}
} finally {
lock.writeLock().unlock();
}
} }
|
public class class_name {
private Node parseAndRecordTypeNode(
JsDocToken token,
int lineno,
int startCharno,
boolean matchingLC,
boolean onlyParseSimpleNames) {
Node typeNode;
if (onlyParseSimpleNames) {
typeNode = parseTypeNameAnnotation(token);
} else {
typeNode = parseTypeExpressionAnnotation(token);
}
recordTypeNode(lineno, startCharno, typeNode, matchingLC);
return typeNode;
} }
|
public class class_name {
private Node parseAndRecordTypeNode(
JsDocToken token,
int lineno,
int startCharno,
boolean matchingLC,
boolean onlyParseSimpleNames) {
Node typeNode;
if (onlyParseSimpleNames) {
typeNode = parseTypeNameAnnotation(token); // depends on control dependency: [if], data = [none]
} else {
typeNode = parseTypeExpressionAnnotation(token); // depends on control dependency: [if], data = [none]
}
recordTypeNode(lineno, startCharno, typeNode, matchingLC);
return typeNode;
} }
|
public class class_name {
public final void forControl() throws RecognitionException {
VarDecl_stack.push(new VarDecl_scope());
int forControl_StartIndex = input.index();
increaseLevel();
VarDecl_stack.peek().descr = new JavaLocalDeclarationDescr();
try {
if ( state.backtracking>0 && alreadyParsedRule(input, 100) ) { return; }
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1051:5: ( forVarControl | ( forInit )? ';' ( expression )? ';' ( forUpdate )? )
int alt135=2;
alt135 = dfa135.predict(input);
switch (alt135) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1051:7: forVarControl
{
pushFollow(FOLLOW_forVarControl_in_forControl4558);
forVarControl();
state._fsp--;
if (state.failed) return;
}
break;
case 2 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:7: ( forInit )? ';' ( expression )? ';' ( forUpdate )?
{
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:7: ( forInit )?
int alt132=2;
int LA132_0 = input.LA(1);
if ( ((LA132_0 >= CharacterLiteral && LA132_0 <= DecimalLiteral)||LA132_0==FloatingPointLiteral||(LA132_0 >= HexLiteral && LA132_0 <= Identifier)||(LA132_0 >= OctalLiteral && LA132_0 <= StringLiteral)||LA132_0==29||LA132_0==36||(LA132_0 >= 40 && LA132_0 <= 41)||(LA132_0 >= 44 && LA132_0 <= 45)||LA132_0==53||LA132_0==58||LA132_0==65||LA132_0==67||(LA132_0 >= 70 && LA132_0 <= 71)||LA132_0==77||(LA132_0 >= 79 && LA132_0 <= 80)||(LA132_0 >= 82 && LA132_0 <= 83)||LA132_0==85||LA132_0==92||LA132_0==94||(LA132_0 >= 97 && LA132_0 <= 98)||LA132_0==105||LA132_0==108||LA132_0==111||LA132_0==115||LA132_0==118||LA132_0==126) ) {
alt132=1;
}
switch (alt132) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:7: forInit
{
pushFollow(FOLLOW_forInit_in_forControl4566);
forInit();
state._fsp--;
if (state.failed) return;
}
break;
}
match(input,52,FOLLOW_52_in_forControl4569); if (state.failed) return;
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:20: ( expression )?
int alt133=2;
int LA133_0 = input.LA(1);
if ( ((LA133_0 >= CharacterLiteral && LA133_0 <= DecimalLiteral)||LA133_0==FloatingPointLiteral||(LA133_0 >= HexLiteral && LA133_0 <= Identifier)||(LA133_0 >= OctalLiteral && LA133_0 <= StringLiteral)||LA133_0==29||LA133_0==36||(LA133_0 >= 40 && LA133_0 <= 41)||(LA133_0 >= 44 && LA133_0 <= 45)||LA133_0==53||LA133_0==65||LA133_0==67||(LA133_0 >= 70 && LA133_0 <= 71)||LA133_0==77||(LA133_0 >= 79 && LA133_0 <= 80)||LA133_0==82||LA133_0==85||LA133_0==92||LA133_0==94||(LA133_0 >= 97 && LA133_0 <= 98)||LA133_0==105||LA133_0==108||LA133_0==111||LA133_0==115||LA133_0==118||LA133_0==126) ) {
alt133=1;
}
switch (alt133) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:20: expression
{
pushFollow(FOLLOW_expression_in_forControl4571);
expression();
state._fsp--;
if (state.failed) return;
}
break;
}
match(input,52,FOLLOW_52_in_forControl4574); if (state.failed) return;
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:36: ( forUpdate )?
int alt134=2;
int LA134_0 = input.LA(1);
if ( ((LA134_0 >= CharacterLiteral && LA134_0 <= DecimalLiteral)||LA134_0==FloatingPointLiteral||(LA134_0 >= HexLiteral && LA134_0 <= Identifier)||(LA134_0 >= OctalLiteral && LA134_0 <= StringLiteral)||LA134_0==29||LA134_0==36||(LA134_0 >= 40 && LA134_0 <= 41)||(LA134_0 >= 44 && LA134_0 <= 45)||LA134_0==53||LA134_0==65||LA134_0==67||(LA134_0 >= 70 && LA134_0 <= 71)||LA134_0==77||(LA134_0 >= 79 && LA134_0 <= 80)||LA134_0==82||LA134_0==85||LA134_0==92||LA134_0==94||(LA134_0 >= 97 && LA134_0 <= 98)||LA134_0==105||LA134_0==108||LA134_0==111||LA134_0==115||LA134_0==118||LA134_0==126) ) {
alt134=1;
}
switch (alt134) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:36: forUpdate
{
pushFollow(FOLLOW_forUpdate_in_forControl4576);
forUpdate();
state._fsp--;
if (state.failed) return;
}
break;
}
}
break;
}
if ( state.backtracking==0 ) {
addLocalDeclaration( VarDecl_stack.peek().descr );
decreaseLevel();
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
if ( state.backtracking>0 ) { memoize(input, 100, forControl_StartIndex); }
VarDecl_stack.pop();
}
} }
|
public class class_name {
public final void forControl() throws RecognitionException {
VarDecl_stack.push(new VarDecl_scope());
int forControl_StartIndex = input.index();
increaseLevel();
VarDecl_stack.peek().descr = new JavaLocalDeclarationDescr();
try {
if ( state.backtracking>0 && alreadyParsedRule(input, 100) ) { return; } // depends on control dependency: [if], data = [none]
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1051:5: ( forVarControl | ( forInit )? ';' ( expression )? ';' ( forUpdate )? )
int alt135=2;
alt135 = dfa135.predict(input);
switch (alt135) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1051:7: forVarControl
{
pushFollow(FOLLOW_forVarControl_in_forControl4558);
forVarControl();
state._fsp--;
if (state.failed) return;
}
break;
case 2 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:7: ( forInit )? ';' ( expression )? ';' ( forUpdate )?
{
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:7: ( forInit )?
int alt132=2;
int LA132_0 = input.LA(1);
if ( ((LA132_0 >= CharacterLiteral && LA132_0 <= DecimalLiteral)||LA132_0==FloatingPointLiteral||(LA132_0 >= HexLiteral && LA132_0 <= Identifier)||(LA132_0 >= OctalLiteral && LA132_0 <= StringLiteral)||LA132_0==29||LA132_0==36||(LA132_0 >= 40 && LA132_0 <= 41)||(LA132_0 >= 44 && LA132_0 <= 45)||LA132_0==53||LA132_0==58||LA132_0==65||LA132_0==67||(LA132_0 >= 70 && LA132_0 <= 71)||LA132_0==77||(LA132_0 >= 79 && LA132_0 <= 80)||(LA132_0 >= 82 && LA132_0 <= 83)||LA132_0==85||LA132_0==92||LA132_0==94||(LA132_0 >= 97 && LA132_0 <= 98)||LA132_0==105||LA132_0==108||LA132_0==111||LA132_0==115||LA132_0==118||LA132_0==126) ) {
alt132=1; // depends on control dependency: [if], data = [none]
}
switch (alt132) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:7: forInit
{
pushFollow(FOLLOW_forInit_in_forControl4566);
forInit();
state._fsp--;
if (state.failed) return;
}
break;
}
match(input,52,FOLLOW_52_in_forControl4569); if (state.failed) return;
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:20: ( expression )?
int alt133=2;
int LA133_0 = input.LA(1);
if ( ((LA133_0 >= CharacterLiteral && LA133_0 <= DecimalLiteral)||LA133_0==FloatingPointLiteral||(LA133_0 >= HexLiteral && LA133_0 <= Identifier)||(LA133_0 >= OctalLiteral && LA133_0 <= StringLiteral)||LA133_0==29||LA133_0==36||(LA133_0 >= 40 && LA133_0 <= 41)||(LA133_0 >= 44 && LA133_0 <= 45)||LA133_0==53||LA133_0==65||LA133_0==67||(LA133_0 >= 70 && LA133_0 <= 71)||LA133_0==77||(LA133_0 >= 79 && LA133_0 <= 80)||LA133_0==82||LA133_0==85||LA133_0==92||LA133_0==94||(LA133_0 >= 97 && LA133_0 <= 98)||LA133_0==105||LA133_0==108||LA133_0==111||LA133_0==115||LA133_0==118||LA133_0==126) ) {
alt133=1; // depends on control dependency: [if], data = [none]
}
switch (alt133) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:20: expression
{
pushFollow(FOLLOW_expression_in_forControl4571);
expression();
state._fsp--;
if (state.failed) return;
}
break;
}
match(input,52,FOLLOW_52_in_forControl4574); if (state.failed) return;
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:36: ( forUpdate )?
int alt134=2;
int LA134_0 = input.LA(1);
if ( ((LA134_0 >= CharacterLiteral && LA134_0 <= DecimalLiteral)||LA134_0==FloatingPointLiteral||(LA134_0 >= HexLiteral && LA134_0 <= Identifier)||(LA134_0 >= OctalLiteral && LA134_0 <= StringLiteral)||LA134_0==29||LA134_0==36||(LA134_0 >= 40 && LA134_0 <= 41)||(LA134_0 >= 44 && LA134_0 <= 45)||LA134_0==53||LA134_0==65||LA134_0==67||(LA134_0 >= 70 && LA134_0 <= 71)||LA134_0==77||(LA134_0 >= 79 && LA134_0 <= 80)||LA134_0==82||LA134_0==85||LA134_0==92||LA134_0==94||(LA134_0 >= 97 && LA134_0 <= 98)||LA134_0==105||LA134_0==108||LA134_0==111||LA134_0==115||LA134_0==118||LA134_0==126) ) {
alt134=1; // depends on control dependency: [if], data = [none]
}
switch (alt134) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:1052:36: forUpdate
{
pushFollow(FOLLOW_forUpdate_in_forControl4576);
forUpdate();
state._fsp--;
if (state.failed) return;
}
break;
}
}
break;
}
if ( state.backtracking==0 ) {
addLocalDeclaration( VarDecl_stack.peek().descr ); // depends on control dependency: [if], data = [none]
decreaseLevel(); // depends on control dependency: [if], data = [none]
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
if ( state.backtracking>0 ) { memoize(input, 100, forControl_StartIndex); } // depends on control dependency: [if], data = [none]
VarDecl_stack.pop();
}
} }
|
public class class_name {
private static Date getSentDate(MimeMessage msg, Date defaultVal) {
if (msg == null) {
return defaultVal;
}
try {
Date sentDate = msg.getSentDate();
if (sentDate == null) {
return defaultVal;
} else {
return sentDate;
}
} catch (MessagingException me) {
return new Date();
}
} }
|
public class class_name {
private static Date getSentDate(MimeMessage msg, Date defaultVal) {
if (msg == null) {
return defaultVal;
// depends on control dependency: [if], data = [none]
}
try {
Date sentDate = msg.getSentDate();
if (sentDate == null) {
return defaultVal;
// depends on control dependency: [if], data = [none]
} else {
return sentDate;
// depends on control dependency: [if], data = [none]
}
} catch (MessagingException me) {
return new Date();
}
// depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void prepareTransferMastership(int partitionId, int hostId) {
synchronized(m_dataSourcesByPartition) {
Map<String, ExportDataSource> partitionDataSourceMap = m_dataSourcesByPartition.get(partitionId);
// this case happens when there are no export tables
if (partitionDataSourceMap == null) {
return;
}
for (ExportDataSource eds : partitionDataSourceMap.values()) {
eds.prepareTransferMastership(hostId);
}
}
} }
|
public class class_name {
public void prepareTransferMastership(int partitionId, int hostId) {
synchronized(m_dataSourcesByPartition) {
Map<String, ExportDataSource> partitionDataSourceMap = m_dataSourcesByPartition.get(partitionId);
// this case happens when there are no export tables
if (partitionDataSourceMap == null) {
return; // depends on control dependency: [if], data = [none]
}
for (ExportDataSource eds : partitionDataSourceMap.values()) {
eds.prepareTransferMastership(hostId); // depends on control dependency: [for], data = [eds]
}
}
} }
|
public class class_name {
private Format getFormat(String desc)
{
if (registry != null)
{
String name = desc;
String args = "";
int i = desc.indexOf(START_FMT);
if (i > 0)
{
name = desc.substring(0, i).trim();
args = desc.substring(i + 1).trim();
}
FormatFactory factory = registry.get(name);
if (factory != null)
{
return factory.getFormat(name, args, getLocale());
}
}
return null;
} }
|
public class class_name {
private Format getFormat(String desc)
{
if (registry != null)
{
String name = desc;
String args = "";
int i = desc.indexOf(START_FMT);
if (i > 0)
{
name = desc.substring(0, i).trim(); // depends on control dependency: [if], data = [none]
args = desc.substring(i + 1).trim(); // depends on control dependency: [if], data = [(i]
}
FormatFactory factory = registry.get(name);
if (factory != null)
{
return factory.getFormat(name, args, getLocale()); // depends on control dependency: [if], data = [none]
}
}
return null;
} }
|
public class class_name {
public Layer setDepth(float depth) {
float oldDepth = this.depth;
if (depth != oldDepth) {
this.depth = depth;
if (parent != null) parent.depthChanged(this, oldDepth);
}
return this;
} }
|
public class class_name {
public Layer setDepth(float depth) {
float oldDepth = this.depth;
if (depth != oldDepth) {
this.depth = depth; // depends on control dependency: [if], data = [none]
if (parent != null) parent.depthChanged(this, oldDepth);
}
return this;
} }
|
public class class_name {
@Deprecated
public boolean verify(String hostname, SSLSession session) {
if (!sslMode.verifyPeerName()) {
return true;
}
return PGjdbcHostnameVerifier.INSTANCE.verify(hostname, session);
} }
|
public class class_name {
@Deprecated
public boolean verify(String hostname, SSLSession session) {
if (!sslMode.verifyPeerName()) {
return true; // depends on control dependency: [if], data = [none]
}
return PGjdbcHostnameVerifier.INSTANCE.verify(hostname, session);
} }
|
public class class_name {
public final boolean isReconfigurable(WSConnectionRequestInfoImpl cri, boolean reauth)
{
// The CRI is only reconfigurable if all fields which cannot be changed already match.
// Although sharding keys can sometimes be changed via connection.setShardingKey,
// the spec does not guarantee that this method will allow all sharding keys
// (even ones that are known to be valid) to be set on any connection. It leaves open
// the possibility that the JDBC driver implementation can decide not to allow switching
// between certain sharding keys. Given that we don't have any way of knowing in
// advance that a switching will be accepted (without preemptively trying to change it),
// we must consider sharding keys to be non-reconfigurable for the purposes of
// selecting a connection from the pool.
if (reauth)
{
return ivConfigID == cri.ivConfigID;
} else {
return match(ivUserName, cri.ivUserName) &&
match(ivPassword, cri.ivPassword) &&
match(ivShardingKey, cri.ivShardingKey) &&
match(ivSuperShardingKey, cri.ivSuperShardingKey) &&
ivConfigID == cri.ivConfigID;
}
} }
|
public class class_name {
public final boolean isReconfigurable(WSConnectionRequestInfoImpl cri, boolean reauth)
{
// The CRI is only reconfigurable if all fields which cannot be changed already match.
// Although sharding keys can sometimes be changed via connection.setShardingKey,
// the spec does not guarantee that this method will allow all sharding keys
// (even ones that are known to be valid) to be set on any connection. It leaves open
// the possibility that the JDBC driver implementation can decide not to allow switching
// between certain sharding keys. Given that we don't have any way of knowing in
// advance that a switching will be accepted (without preemptively trying to change it),
// we must consider sharding keys to be non-reconfigurable for the purposes of
// selecting a connection from the pool.
if (reauth)
{
return ivConfigID == cri.ivConfigID; // depends on control dependency: [if], data = [none]
} else {
return match(ivUserName, cri.ivUserName) &&
match(ivPassword, cri.ivPassword) &&
match(ivShardingKey, cri.ivShardingKey) &&
match(ivSuperShardingKey, cri.ivSuperShardingKey) &&
ivConfigID == cri.ivConfigID; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
protected List<StatementGroup> getStatementGroups() {
ArrayList<StatementGroup> result = new ArrayList<>(
this.statements.size());
for (ArrayList<Statement> statementList : this.statements.values()) {
result.add(factory.getStatementGroup(statementList));
}
return result;
} }
|
public class class_name {
protected List<StatementGroup> getStatementGroups() {
ArrayList<StatementGroup> result = new ArrayList<>(
this.statements.size());
for (ArrayList<Statement> statementList : this.statements.values()) {
result.add(factory.getStatementGroup(statementList)); // depends on control dependency: [for], data = [statementList]
}
return result;
} }
|
public class class_name {
public List<LocaleEncodingMappingListType<WebFragmentDescriptor>> getAllLocaleEncodingMappingList()
{
List<LocaleEncodingMappingListType<WebFragmentDescriptor>> list = new ArrayList<LocaleEncodingMappingListType<WebFragmentDescriptor>>();
List<Node> nodeList = model.get("locale-encoding-mapping-list");
for(Node node: nodeList)
{
LocaleEncodingMappingListType<WebFragmentDescriptor> type = new LocaleEncodingMappingListTypeImpl<WebFragmentDescriptor>(this, "locale-encoding-mapping-list", model, node);
list.add(type);
}
return list;
} }
|
public class class_name {
public List<LocaleEncodingMappingListType<WebFragmentDescriptor>> getAllLocaleEncodingMappingList()
{
List<LocaleEncodingMappingListType<WebFragmentDescriptor>> list = new ArrayList<LocaleEncodingMappingListType<WebFragmentDescriptor>>();
List<Node> nodeList = model.get("locale-encoding-mapping-list");
for(Node node: nodeList)
{
LocaleEncodingMappingListType<WebFragmentDescriptor> type = new LocaleEncodingMappingListTypeImpl<WebFragmentDescriptor>(this, "locale-encoding-mapping-list", model, node);
list.add(type); // depends on control dependency: [for], data = [none]
}
return list;
} }
|
public class class_name {
private void createFile(String filename, int position, String content, Hashtable properties) {
String vfsFileName = (String)m_fileIndex.get(filename.replace('\\', '/'));
if (vfsFileName != null) {
try {
m_report.print(Messages.get().container(Messages.RPT_CREATE_FILE_0), I_CmsReport.FORMAT_NOTE);
m_report.print(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_ARGUMENT_1,
vfsFileName));
m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
// check if we have to set the navpos property.
if ((properties.get(CmsPropertyDefinition.PROPERTY_NAVPOS) == null)
&& (properties.get(CmsPropertyDefinition.PROPERTY_NAVTEXT) != null)) {
// set the position in the folder as navpos
// we have to add one to the position, since it is counted from 0
properties.put(CmsPropertyDefinition.PROPERTY_NAVPOS, (position + 1) + "");
}
// create new XML page
Locale locale = CmsLocaleManager.getLocale(m_locale);
CmsXmlPage page = new CmsXmlPage(locale, OpenCms.getSystemInfo().getDefaultEncoding());
page.addValue(m_element, locale);
page.setStringValue(m_cmsObject, m_element, locale, content);
// check links
CmsLinkTable linkTable = page.getLinkTable(m_element, locale);
Iterator i = linkTable.iterator();
while (i.hasNext()) {
CmsLink link = (CmsLink)i.next();
String target = link.getTarget();
// do only update internal links
if (link.isInternal()) {
target = m_cmsObject.getRequestContext().getFileTranslator().translateResource(target);
// update link
link.updateLink(target, link.getAnchor(), link.getQuery());
link.checkConsistency(m_cmsObject);
}
}
// marshal XML page and get the content
byte[] contentByteArray = page.marshal();
List oldProperties = new ArrayList();
int xmlPageId = OpenCms.getResourceManager().getResourceType(
CmsResourceTypeXmlPage.getStaticTypeName()).getTypeId();
if (!m_overwrite) {
m_cmsObject.createResource(vfsFileName, xmlPageId, contentByteArray, new ArrayList());
} else {
try {
// try if the file is there
oldProperties = m_cmsObject.readPropertyObjects(vfsFileName, false);
CmsLock lock = m_cmsObject.getLock(vfsFileName);
if (lock.getType() != CmsLockType.EXCLUSIVE) {
m_cmsObject.lockResource(vfsFileName);
}
m_cmsObject.deleteResource(vfsFileName, CmsResource.DELETE_PRESERVE_SIBLINGS);
} catch (CmsException e) {
// the file did not exist, so we do not have to delete it
} finally {
// create the new resource
m_report.print(Messages.get().container(Messages.RPT_OVERWRITE_0), I_CmsReport.FORMAT_NOTE);
m_report.print(
org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
m_cmsObject.createResource(vfsFileName, xmlPageId, contentByteArray, new ArrayList());
}
}
// create all properties and put them in an ArrayList
Iterator it = properties.entrySet().iterator();
List propertyList = new ArrayList();
while (it.hasNext()) {
// get property and value
Map.Entry entry = (Map.Entry)it.next();
String propertyKey = (String)entry.getKey();
String propertyVal = (String)entry.getValue();
// create new Property Object
CmsProperty property = new CmsProperty(propertyKey, propertyVal, propertyVal);
// create implicitly if Property doesn't exist already
property.setAutoCreatePropertyDefinition(true);
// add new property to the list
propertyList.add(property);
}
// try to write the properties
try {
m_cmsObject.writePropertyObjects(vfsFileName, propertyList);
// write the old properties if available
m_cmsObject.writePropertyObjects(vfsFileName, oldProperties);
} catch (CmsException e1) {
e1.printStackTrace();
}
m_report.println(
org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
I_CmsReport.FORMAT_OK);
} catch (CmsException e) {
m_report.println(e);
LOG.error(e.getLocalizedMessage(), e);
}
}
} }
|
public class class_name {
private void createFile(String filename, int position, String content, Hashtable properties) {
String vfsFileName = (String)m_fileIndex.get(filename.replace('\\', '/'));
if (vfsFileName != null) {
try {
m_report.print(Messages.get().container(Messages.RPT_CREATE_FILE_0), I_CmsReport.FORMAT_NOTE); // depends on control dependency: [try], data = [none]
m_report.print(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_ARGUMENT_1,
vfsFileName)); // depends on control dependency: [try], data = [none]
m_report.print(org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0)); // depends on control dependency: [try], data = [none]
// check if we have to set the navpos property.
if ((properties.get(CmsPropertyDefinition.PROPERTY_NAVPOS) == null)
&& (properties.get(CmsPropertyDefinition.PROPERTY_NAVTEXT) != null)) {
// set the position in the folder as navpos
// we have to add one to the position, since it is counted from 0
properties.put(CmsPropertyDefinition.PROPERTY_NAVPOS, (position + 1) + ""); // depends on control dependency: [if], data = [none]
}
// create new XML page
Locale locale = CmsLocaleManager.getLocale(m_locale);
CmsXmlPage page = new CmsXmlPage(locale, OpenCms.getSystemInfo().getDefaultEncoding());
page.addValue(m_element, locale); // depends on control dependency: [try], data = [none]
page.setStringValue(m_cmsObject, m_element, locale, content); // depends on control dependency: [try], data = [none]
// check links
CmsLinkTable linkTable = page.getLinkTable(m_element, locale);
Iterator i = linkTable.iterator();
while (i.hasNext()) {
CmsLink link = (CmsLink)i.next();
String target = link.getTarget();
// do only update internal links
if (link.isInternal()) {
target = m_cmsObject.getRequestContext().getFileTranslator().translateResource(target); // depends on control dependency: [if], data = [none]
// update link
link.updateLink(target, link.getAnchor(), link.getQuery()); // depends on control dependency: [if], data = [none]
link.checkConsistency(m_cmsObject); // depends on control dependency: [if], data = [none]
}
}
// marshal XML page and get the content
byte[] contentByteArray = page.marshal();
List oldProperties = new ArrayList();
int xmlPageId = OpenCms.getResourceManager().getResourceType(
CmsResourceTypeXmlPage.getStaticTypeName()).getTypeId();
if (!m_overwrite) {
m_cmsObject.createResource(vfsFileName, xmlPageId, contentByteArray, new ArrayList()); // depends on control dependency: [if], data = [none]
} else {
try {
// try if the file is there
oldProperties = m_cmsObject.readPropertyObjects(vfsFileName, false); // depends on control dependency: [try], data = [none]
CmsLock lock = m_cmsObject.getLock(vfsFileName);
if (lock.getType() != CmsLockType.EXCLUSIVE) {
m_cmsObject.lockResource(vfsFileName); // depends on control dependency: [if], data = [none]
}
m_cmsObject.deleteResource(vfsFileName, CmsResource.DELETE_PRESERVE_SIBLINGS); // depends on control dependency: [try], data = [none]
} catch (CmsException e) {
// the file did not exist, so we do not have to delete it
} finally { // depends on control dependency: [catch], data = [none]
// create the new resource
m_report.print(Messages.get().container(Messages.RPT_OVERWRITE_0), I_CmsReport.FORMAT_NOTE);
m_report.print(
org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_DOTS_0));
m_cmsObject.createResource(vfsFileName, xmlPageId, contentByteArray, new ArrayList());
}
}
// create all properties and put them in an ArrayList
Iterator it = properties.entrySet().iterator();
List propertyList = new ArrayList();
while (it.hasNext()) {
// get property and value
Map.Entry entry = (Map.Entry)it.next();
String propertyKey = (String)entry.getKey();
String propertyVal = (String)entry.getValue();
// create new Property Object
CmsProperty property = new CmsProperty(propertyKey, propertyVal, propertyVal);
// create implicitly if Property doesn't exist already
property.setAutoCreatePropertyDefinition(true); // depends on control dependency: [while], data = [none]
// add new property to the list
propertyList.add(property); // depends on control dependency: [while], data = [none]
}
// try to write the properties
try {
m_cmsObject.writePropertyObjects(vfsFileName, propertyList); // depends on control dependency: [try], data = [none]
// write the old properties if available
m_cmsObject.writePropertyObjects(vfsFileName, oldProperties); // depends on control dependency: [try], data = [none]
} catch (CmsException e1) {
e1.printStackTrace();
} // depends on control dependency: [catch], data = [none]
m_report.println(
org.opencms.report.Messages.get().container(org.opencms.report.Messages.RPT_OK_0),
I_CmsReport.FORMAT_OK); // depends on control dependency: [try], data = [none]
} catch (CmsException e) {
m_report.println(e);
LOG.error(e.getLocalizedMessage(), e);
} // depends on control dependency: [catch], data = [none]
}
} }
|
public class class_name {
public Collection<Utterance> call(final AnalysisRequest request) {
ClientResponse response = null;
try {
response = service.type(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.post(ClientResponse.class, request);
return response.getEntity(new GenericType<Collection<Utterance>>() {});
}
finally {
// belt and braces
if (response != null) {
//noinspection OverlyBroadCatchBlock
try { response.close(); }
catch (final Throwable ignored) { /* do nothing */ }
}
}
} }
|
public class class_name {
public Collection<Utterance> call(final AnalysisRequest request) {
ClientResponse response = null;
try {
response = service.type(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
.post(ClientResponse.class, request); // depends on control dependency: [try], data = [none]
return response.getEntity(new GenericType<Collection<Utterance>>() {}); // depends on control dependency: [try], data = [none]
}
finally {
// belt and braces
if (response != null) {
//noinspection OverlyBroadCatchBlock
try { response.close(); } // depends on control dependency: [try], data = [none]
catch (final Throwable ignored) { /* do nothing */ } // depends on control dependency: [catch], data = [none]
}
}
} }
|
public class class_name {
private static TypeMirror getBaseDaoTypeMirror(Entity entity) {
if(entity != null) {
try {
entity.baseDaoClass();
} catch (MirroredTypeException mte) {
return mte.getTypeMirror();
}
}
return null;
} }
|
public class class_name {
private static TypeMirror getBaseDaoTypeMirror(Entity entity) {
if(entity != null) {
try {
entity.baseDaoClass(); // depends on control dependency: [try], data = [none]
} catch (MirroredTypeException mte) {
return mte.getTypeMirror();
} // depends on control dependency: [catch], data = [none]
}
return null;
} }
|
public class class_name {
public void deleteUIDMeta(final UIDMeta meta) {
if (search != null) {
search.deleteUIDMeta(meta).addErrback(new PluginError());
}
} }
|
public class class_name {
public void deleteUIDMeta(final UIDMeta meta) {
if (search != null) {
search.deleteUIDMeta(meta).addErrback(new PluginError()); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions) {
return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, experimentsListByWorkspaceOptions)
.concatMap(new Func1<ServiceResponse<Page<ExperimentInner>>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(ServiceResponse<Page<ExperimentInner>> page) {
String nextPageLink = page.body().nextPageLink();
if (nextPageLink == null) {
return Observable.just(page);
}
return Observable.just(page).concatWith(listByWorkspaceNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<Page<ExperimentInner>>> listByWorkspaceWithServiceResponseAsync(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions) {
return listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, experimentsListByWorkspaceOptions)
.concatMap(new Func1<ServiceResponse<Page<ExperimentInner>>, Observable<ServiceResponse<Page<ExperimentInner>>>>() {
@Override
public Observable<ServiceResponse<Page<ExperimentInner>>> call(ServiceResponse<Page<ExperimentInner>> 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(listByWorkspaceNextWithServiceResponseAsync(nextPageLink));
}
});
} }
|
public class class_name {
public void rollback()
{
TxId txId = null;
// Check if in a higher transactional mode than none, otherwise commit does nothing.
if (!getIsolationLevel().equals(IsolationLevel.None))
{
// Extract the current transaction id.
txId = TxManager.getTxIdFromThread();
// Check that this transaction has made changes to be rolled back.
List<TxOperation> alterations = txWrites.get(txId);
if (alterations != null)
{
// Loop through all the writes that the transaction wants to apply to the resource.
for (TxOperation nextAlteration : alterations)
{
// Cancel the operation.
nextAlteration.cancel(false);
}
}
// Discard all the changes that the transaction was going to make.
txWrites.remove(txId);
}
} }
|
public class class_name {
public void rollback()
{
TxId txId = null;
// Check if in a higher transactional mode than none, otherwise commit does nothing.
if (!getIsolationLevel().equals(IsolationLevel.None))
{
// Extract the current transaction id.
txId = TxManager.getTxIdFromThread(); // depends on control dependency: [if], data = [none]
// Check that this transaction has made changes to be rolled back.
List<TxOperation> alterations = txWrites.get(txId);
if (alterations != null)
{
// Loop through all the writes that the transaction wants to apply to the resource.
for (TxOperation nextAlteration : alterations)
{
// Cancel the operation.
nextAlteration.cancel(false); // depends on control dependency: [for], data = [nextAlteration]
}
}
// Discard all the changes that the transaction was going to make.
txWrites.remove(txId); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static void deleteDirectories(FileSystem fs, List<String> directoriesToDelete, boolean recursive, boolean moveToTrash) throws IOException {
for (String directory : directoriesToDelete) {
if (moveToTrash) {
moveToTrash(fs, new Path(directory));
} else {
deletePath(fs, new Path(directory), recursive);
}
}
} }
|
public class class_name {
public static void deleteDirectories(FileSystem fs, List<String> directoriesToDelete, boolean recursive, boolean moveToTrash) throws IOException {
for (String directory : directoriesToDelete) {
if (moveToTrash) {
moveToTrash(fs, new Path(directory)); // depends on control dependency: [if], data = [none]
} else {
deletePath(fs, new Path(directory), recursive); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public List<RawProperty> getExperimentalProperties(String name) {
/*
* Note: The returned list is not backed by the parent component because
* this would allow RawProperty objects without the specified name to be
* added to the list.
*/
List<RawProperty> toReturn = new ArrayList<RawProperty>();
for (RawProperty property : getExperimentalProperties()) {
if (property.getName().equalsIgnoreCase(name)) {
toReturn.add(property);
}
}
return Collections.unmodifiableList(toReturn);
} }
|
public class class_name {
public List<RawProperty> getExperimentalProperties(String name) {
/*
* Note: The returned list is not backed by the parent component because
* this would allow RawProperty objects without the specified name to be
* added to the list.
*/
List<RawProperty> toReturn = new ArrayList<RawProperty>();
for (RawProperty property : getExperimentalProperties()) {
if (property.getName().equalsIgnoreCase(name)) {
toReturn.add(property); // depends on control dependency: [if], data = [none]
}
}
return Collections.unmodifiableList(toReturn);
} }
|
public class class_name {
void setAllPluginPassiveScannersEnabled(boolean enabled) {
for (PluginPassiveScanner scanner : getPluginPassiveScanners()) {
scanner.setEnabled(enabled);
scanner.save();
}
} }
|
public class class_name {
void setAllPluginPassiveScannersEnabled(boolean enabled) {
for (PluginPassiveScanner scanner : getPluginPassiveScanners()) {
scanner.setEnabled(enabled); // depends on control dependency: [for], data = [scanner]
scanner.save(); // depends on control dependency: [for], data = [scanner]
}
} }
|
public class class_name {
protected Label readLabel(final int bytecodeOffset, final Label[] labels) {
if (labels[bytecodeOffset] == null) {
labels[bytecodeOffset] = new Label();
}
return labels[bytecodeOffset];
} }
|
public class class_name {
protected Label readLabel(final int bytecodeOffset, final Label[] labels) {
if (labels[bytecodeOffset] == null) {
labels[bytecodeOffset] = new Label(); // depends on control dependency: [if], data = [none]
}
return labels[bytecodeOffset];
} }
|
public class class_name {
public static Object invokeStaticMethod(final Class<?> clazz, final String methodName, final Class<?>[] parameterTypes, final Object[] parameterValues) {
Method method = getStaticMethod(clazz, methodName, parameterTypes);
if (method == null) {
throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + clazz + "]");
}
try {
return method.invoke(clazz, parameterValues);
} catch (Exception e) {
throw convertReflectionExceptionToUnchecked(e);
}
} }
|
public class class_name {
public static Object invokeStaticMethod(final Class<?> clazz, final String methodName, final Class<?>[] parameterTypes, final Object[] parameterValues) {
Method method = getStaticMethod(clazz, methodName, parameterTypes);
if (method == null) {
throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + clazz + "]");
}
try {
return method.invoke(clazz, parameterValues); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw convertReflectionExceptionToUnchecked(e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
protected boolean acceptFile(final File file) {
if (!file.isFile()) {
return false; // ignore non-files
}
String fileName = file.getName();
if (ignoreDotFiles) {
if (fileName.startsWith(StringPool.DOT)) {
return false; // ignore hidden files
}
}
if (patterns == null) {
return true;
}
return Wildcard.matchOne(fileName, patterns) != -1;
} }
|
public class class_name {
protected boolean acceptFile(final File file) {
if (!file.isFile()) {
return false; // ignore non-files // depends on control dependency: [if], data = [none]
}
String fileName = file.getName();
if (ignoreDotFiles) {
if (fileName.startsWith(StringPool.DOT)) {
return false; // ignore hidden files // depends on control dependency: [if], data = [none]
}
}
if (patterns == null) {
return true; // depends on control dependency: [if], data = [none]
}
return Wildcard.matchOne(fileName, patterns) != -1;
} }
|
public class class_name {
private GrantedAuthority getGrantedAuthority(String attribute) {
if (isConvertAttributeToLowerCase()) {
attribute = attribute.toLowerCase(Locale.getDefault());
}
else if (isConvertAttributeToUpperCase()) {
attribute = attribute.toUpperCase(Locale.getDefault());
}
if (isAddPrefixIfAlreadyExisting() || !attribute.startsWith(getAttributePrefix())) {
return new SimpleGrantedAuthority(getAttributePrefix() + attribute);
}
else {
return new SimpleGrantedAuthority(attribute);
}
} }
|
public class class_name {
private GrantedAuthority getGrantedAuthority(String attribute) {
if (isConvertAttributeToLowerCase()) {
attribute = attribute.toLowerCase(Locale.getDefault()); // depends on control dependency: [if], data = [none]
}
else if (isConvertAttributeToUpperCase()) {
attribute = attribute.toUpperCase(Locale.getDefault()); // depends on control dependency: [if], data = [none]
}
if (isAddPrefixIfAlreadyExisting() || !attribute.startsWith(getAttributePrefix())) {
return new SimpleGrantedAuthority(getAttributePrefix() + attribute); // depends on control dependency: [if], data = [none]
}
else {
return new SimpleGrantedAuthority(attribute); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void setChildren(final Set<AbstractHtml> children) {
if (children == null || children.size() == 0) {
removeAllChildren();
} else {
addInnerHtmls(children.toArray(new AbstractHtml[children.size()]));
}
} }
|
public class class_name {
public void setChildren(final Set<AbstractHtml> children) {
if (children == null || children.size() == 0) {
removeAllChildren(); // depends on control dependency: [if], data = [none]
} else {
addInnerHtmls(children.toArray(new AbstractHtml[children.size()])); // depends on control dependency: [if], data = [(children]
}
} }
|
public class class_name {
public void writeTo(final OutputStream out, final HttpProgressListener progressListener) throws IOException {
// start
final int size = size();
final int callbackSize = progressListener.callbackSize(size);
int count = 0; // total count
int step = 0; // step is offset in current chunk
progressListener.transferred(count);
// loop
for (Object o : list) {
if (o instanceof FastByteBuffer) {
FastByteBuffer fastByteBuffer = (FastByteBuffer) o;
byte[] bytes = fastByteBuffer.toArray();
int offset = 0;
while (offset < bytes.length) {
// calc the remaining sending chunk size
int chunk = callbackSize - step;
// check if this chunk size fits the bytes array
if (offset + chunk > bytes.length) {
chunk = bytes.length - offset;
}
// writes the chunk
out.write(bytes, offset, chunk);
offset += chunk;
step += chunk;
count += chunk;
// listener
if (step >= callbackSize) {
progressListener.transferred(count);
step -= callbackSize;
}
}
}
else if (o instanceof Uploadable) {
Uploadable uploadable = (Uploadable) o;
InputStream inputStream = uploadable.openInputStream();
int remaining = uploadable.getSize();
try {
while (remaining > 0) {
// calc the remaining sending chunk size
int chunk = callbackSize - step;
// check if this chunk size fits the remaining size
if (chunk > remaining) {
chunk = remaining;
}
// writes remaining chunk
StreamUtil.copy(inputStream, out, chunk);
remaining -= chunk;
step += chunk;
count += chunk;
// listener
if (step >= callbackSize) {
progressListener.transferred(count);
step -= callbackSize;
}
}
}
finally {
StreamUtil.close(inputStream);
}
}
}
// end
if (step != 0) {
progressListener.transferred(count);
}
} }
|
public class class_name {
public void writeTo(final OutputStream out, final HttpProgressListener progressListener) throws IOException {
// start
final int size = size();
final int callbackSize = progressListener.callbackSize(size);
int count = 0; // total count
int step = 0; // step is offset in current chunk
progressListener.transferred(count);
// loop
for (Object o : list) {
if (o instanceof FastByteBuffer) {
FastByteBuffer fastByteBuffer = (FastByteBuffer) o;
byte[] bytes = fastByteBuffer.toArray();
int offset = 0;
while (offset < bytes.length) {
// calc the remaining sending chunk size
int chunk = callbackSize - step;
// check if this chunk size fits the bytes array
if (offset + chunk > bytes.length) {
chunk = bytes.length - offset; // depends on control dependency: [if], data = [none]
}
// writes the chunk
out.write(bytes, offset, chunk); // depends on control dependency: [while], data = [none]
offset += chunk; // depends on control dependency: [while], data = [none]
step += chunk; // depends on control dependency: [while], data = [none]
count += chunk; // depends on control dependency: [while], data = [none]
// listener
if (step >= callbackSize) {
progressListener.transferred(count); // depends on control dependency: [if], data = [none]
step -= callbackSize; // depends on control dependency: [if], data = [none]
}
}
}
else if (o instanceof Uploadable) {
Uploadable uploadable = (Uploadable) o;
InputStream inputStream = uploadable.openInputStream();
int remaining = uploadable.getSize();
try {
while (remaining > 0) {
// calc the remaining sending chunk size
int chunk = callbackSize - step;
// check if this chunk size fits the remaining size
if (chunk > remaining) {
chunk = remaining; // depends on control dependency: [if], data = [none]
}
// writes remaining chunk
StreamUtil.copy(inputStream, out, chunk); // depends on control dependency: [while], data = [none]
remaining -= chunk; // depends on control dependency: [while], data = [none]
step += chunk; // depends on control dependency: [while], data = [none]
count += chunk; // depends on control dependency: [while], data = [none]
// listener
if (step >= callbackSize) {
progressListener.transferred(count); // depends on control dependency: [if], data = [none]
step -= callbackSize; // depends on control dependency: [if], data = [none]
}
}
}
finally {
StreamUtil.close(inputStream);
}
}
}
// end
if (step != 0) {
progressListener.transferred(count);
}
} }
|
public class class_name {
public static List<StringContext> getContextsFromExamples(List<CcgExample> examples) {
List<StringContext> contexts = Lists.newArrayList();
for (CcgExample example : examples) {
AnnotatedSentence sentence = example.getSentence();
int numTerminals = sentence.size();
for (int i = 0; i < numTerminals; i++) {
for (int j = i; j < numTerminals; j++) {
contexts.add(new StringContext(i, j, sentence));
}
}
}
return contexts;
} }
|
public class class_name {
public static List<StringContext> getContextsFromExamples(List<CcgExample> examples) {
List<StringContext> contexts = Lists.newArrayList();
for (CcgExample example : examples) {
AnnotatedSentence sentence = example.getSentence();
int numTerminals = sentence.size();
for (int i = 0; i < numTerminals; i++) {
for (int j = i; j < numTerminals; j++) {
contexts.add(new StringContext(i, j, sentence)); // depends on control dependency: [for], data = [j]
}
}
}
return contexts;
} }
|
public class class_name {
public static IAtomContainer project(List<CDKRMap> rMapList, IAtomContainer graph, int key) {
IAtomContainer atomContainer = graph.getBuilder().newInstance(IAtomContainer.class);
Map<IAtom, IAtom> table = new HashMap<IAtom, IAtom>();
IAtom atom1;
IAtom atom2;
IAtom atom;
IBond bond;
for (Iterator<CDKRMap> i = rMapList.iterator(); i.hasNext();) {
CDKRMap rMap = i.next();
if (key == CDKMCS.ID1) {
bond = graph.getBond(rMap.getId1());
} else {
bond = graph.getBond(rMap.getId2());
}
atom = bond.getBegin();
atom1 = table.get(atom);
if (atom1 == null) {
try {
atom1 = (IAtom) atom.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
atomContainer.addAtom(atom1);
table.put(atom, atom1);
}
atom = bond.getEnd();
atom2 = table.get(atom);
if (atom2 == null) {
try {
atom2 = (IAtom) atom.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
atomContainer.addAtom(atom2);
table.put(atom, atom2);
}
IBond newBond = graph.getBuilder().newInstance(IBond.class, atom1, atom2, bond.getOrder());
newBond.setFlag(CDKConstants.ISAROMATIC, bond.getFlag(CDKConstants.ISAROMATIC));
atomContainer.addBond(newBond);
}
return atomContainer;
} }
|
public class class_name {
public static IAtomContainer project(List<CDKRMap> rMapList, IAtomContainer graph, int key) {
IAtomContainer atomContainer = graph.getBuilder().newInstance(IAtomContainer.class);
Map<IAtom, IAtom> table = new HashMap<IAtom, IAtom>();
IAtom atom1;
IAtom atom2;
IAtom atom;
IBond bond;
for (Iterator<CDKRMap> i = rMapList.iterator(); i.hasNext();) {
CDKRMap rMap = i.next();
if (key == CDKMCS.ID1) {
bond = graph.getBond(rMap.getId1()); // depends on control dependency: [if], data = [none]
} else {
bond = graph.getBond(rMap.getId2()); // depends on control dependency: [if], data = [none]
}
atom = bond.getBegin(); // depends on control dependency: [for], data = [none]
atom1 = table.get(atom); // depends on control dependency: [for], data = [none]
if (atom1 == null) {
try {
atom1 = (IAtom) atom.clone(); // depends on control dependency: [try], data = [none]
} catch (CloneNotSupportedException e) {
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
atomContainer.addAtom(atom1); // depends on control dependency: [if], data = [(atom1]
table.put(atom, atom1); // depends on control dependency: [if], data = [none]
}
atom = bond.getEnd(); // depends on control dependency: [for], data = [none]
atom2 = table.get(atom); // depends on control dependency: [for], data = [none]
if (atom2 == null) {
try {
atom2 = (IAtom) atom.clone(); // depends on control dependency: [try], data = [none]
} catch (CloneNotSupportedException e) {
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
atomContainer.addAtom(atom2); // depends on control dependency: [if], data = [(atom2]
table.put(atom, atom2); // depends on control dependency: [if], data = [none]
}
IBond newBond = graph.getBuilder().newInstance(IBond.class, atom1, atom2, bond.getOrder());
newBond.setFlag(CDKConstants.ISAROMATIC, bond.getFlag(CDKConstants.ISAROMATIC)); // depends on control dependency: [for], data = [none]
atomContainer.addBond(newBond); // depends on control dependency: [for], data = [none]
}
return atomContainer;
} }
|
public class class_name {
static void registerAdditionalModules(
final ObjectMapper objectMapper,
final Function<String, String> propertyAccessor) {
final String moduleClassNames = propertyAccessor.apply("commons.object-mapper-additional-module-class-names");
if (moduleClassNames != null) {
for (final String moduleClassName : moduleClassNames.split(",")) {
registerModule(objectMapper, moduleClassName);
}
}
} }
|
public class class_name {
static void registerAdditionalModules(
final ObjectMapper objectMapper,
final Function<String, String> propertyAccessor) {
final String moduleClassNames = propertyAccessor.apply("commons.object-mapper-additional-module-class-names");
if (moduleClassNames != null) {
for (final String moduleClassName : moduleClassNames.split(",")) {
registerModule(objectMapper, moduleClassName); // depends on control dependency: [for], data = [moduleClassName]
}
}
} }
|
public class class_name {
private void updateBeanValueForColumnInRow(final WTableRowRenderer rowRenderer,
final UIContext rowContext,
final List<Integer> rowIndex, final int col, final TableModel model) {
// The actual component is wrapped in a renderer wrapper, so we have to fetch it from that
WComponent renderer = ((Container) rowRenderer.getRenderer(col)).getChildAt(0);
UIContextHolder.pushContext(rowContext);
try {
// If the column is a Container then call updateBeanValue to let the column renderer and its children update
// the "bean" returned by getValueAt(row, col)
if (renderer instanceof Container) {
WebUtilities.updateBeanValue(renderer);
} else if (renderer instanceof DataBound) { // Update Databound renderer
Object oldValue = model.getValueAt(rowIndex, col);
Object newValue = ((DataBound) renderer).getData();
if (!Util.equals(oldValue, newValue)) {
model.setValueAt(newValue, rowIndex, col);
}
}
} finally {
UIContextHolder.popContext();
}
} }
|
public class class_name {
private void updateBeanValueForColumnInRow(final WTableRowRenderer rowRenderer,
final UIContext rowContext,
final List<Integer> rowIndex, final int col, final TableModel model) {
// The actual component is wrapped in a renderer wrapper, so we have to fetch it from that
WComponent renderer = ((Container) rowRenderer.getRenderer(col)).getChildAt(0);
UIContextHolder.pushContext(rowContext);
try {
// If the column is a Container then call updateBeanValue to let the column renderer and its children update
// the "bean" returned by getValueAt(row, col)
if (renderer instanceof Container) {
WebUtilities.updateBeanValue(renderer); // depends on control dependency: [if], data = [none]
} else if (renderer instanceof DataBound) { // Update Databound renderer
Object oldValue = model.getValueAt(rowIndex, col);
Object newValue = ((DataBound) renderer).getData();
if (!Util.equals(oldValue, newValue)) {
model.setValueAt(newValue, rowIndex, col); // depends on control dependency: [if], data = [none]
}
}
} finally {
UIContextHolder.popContext();
}
} }
|
public class class_name {
static Node getExceptionHandler(Node n) {
for (Node cur = n;
!cur.isScript() && !cur.isFunction();
cur = cur.getParent()) {
Node catchNode = getCatchHandlerForBlock(cur);
if (catchNode != null) {
return catchNode;
}
}
return null;
} }
|
public class class_name {
static Node getExceptionHandler(Node n) {
for (Node cur = n;
!cur.isScript() && !cur.isFunction();
cur = cur.getParent()) {
Node catchNode = getCatchHandlerForBlock(cur);
if (catchNode != null) {
return catchNode; // depends on control dependency: [if], data = [none]
}
}
return null;
} }
|
public class class_name {
private void load() {
Iterator iterator = loaders.iterator();
while (iterator.hasNext()) {
MacroLoader loader = (MacroLoader) iterator.next();
loader.setRepository(this);
log.debug("Loading from: " + loader.getClass());
loader.loadPlugins(this);
}
} }
|
public class class_name {
private void load() {
Iterator iterator = loaders.iterator();
while (iterator.hasNext()) {
MacroLoader loader = (MacroLoader) iterator.next();
loader.setRepository(this); // depends on control dependency: [while], data = [none]
log.debug("Loading from: " + loader.getClass()); // depends on control dependency: [while], data = [none]
loader.loadPlugins(this); // depends on control dependency: [while], data = [none]
}
} }
|
public class class_name {
public synchronized ExecutorService getBatchThreadPool() {
if (batchThreadPool == null) {
batchThreadPool = Executors
.newCachedThreadPool(ThreadUtil.getThreadFactory(BATCH_POOL_THREAD_NAME_PATTERN, true));
}
return batchThreadPool;
} }
|
public class class_name {
public synchronized ExecutorService getBatchThreadPool() {
if (batchThreadPool == null) {
batchThreadPool = Executors
.newCachedThreadPool(ThreadUtil.getThreadFactory(BATCH_POOL_THREAD_NAME_PATTERN, true)); // depends on control dependency: [if], data = [none]
}
return batchThreadPool;
} }
|
public class class_name {
private void sortByTargetColumn() {
this.list.setComparator(new ViewerComparator() {
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 != null && e2 != null) {
return e1.toString().compareToIgnoreCase(e2.toString());
}
return super.compare(viewer, e1, e2);
}
@Override
public boolean isSorterProperty(Object element, String property) {
return true;
}
});
this.sort = Column.TARGET;
} }
|
public class class_name {
private void sortByTargetColumn() {
this.list.setComparator(new ViewerComparator() {
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
if (e1 != null && e2 != null) {
return e1.toString().compareToIgnoreCase(e2.toString()); // depends on control dependency: [if], data = [none]
}
return super.compare(viewer, e1, e2);
}
@Override
public boolean isSorterProperty(Object element, String property) {
return true;
}
});
this.sort = Column.TARGET;
} }
|
public class class_name {
public UpdateAuthorizerRequest withIdentitySource(String... identitySource) {
if (this.identitySource == null) {
setIdentitySource(new java.util.ArrayList<String>(identitySource.length));
}
for (String ele : identitySource) {
this.identitySource.add(ele);
}
return this;
} }
|
public class class_name {
public UpdateAuthorizerRequest withIdentitySource(String... identitySource) {
if (this.identitySource == null) {
setIdentitySource(new java.util.ArrayList<String>(identitySource.length)); // depends on control dependency: [if], data = [none]
}
for (String ele : identitySource) {
this.identitySource.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public String gaTypeAccessor(final TypeRef ele) {
String _switchResult = null;
EObject _eContainer = ele.eContainer();
final EObject cnt = _eContainer;
boolean _matched = false;
if (cnt instanceof AbstractElement) {
_matched=true;
String _gaRuleElementAccessor = this.gaRuleElementAccessor(((AbstractElement)cnt));
_switchResult = (_gaRuleElementAccessor + ".getType()");
}
if (!_matched) {
if (cnt instanceof AbstractRule) {
_matched=true;
String _gaRuleAccessor = this.gaRuleAccessor(((AbstractRule)cnt));
_switchResult = (_gaRuleAccessor + ".getType()");
}
}
if (!_matched) {
String _name = ele.eContainer().eClass().getName();
String _plus = ("<error: unknown type " + _name);
_switchResult = (_plus + ">");
}
return _switchResult;
} }
|
public class class_name {
public String gaTypeAccessor(final TypeRef ele) {
String _switchResult = null;
EObject _eContainer = ele.eContainer();
final EObject cnt = _eContainer;
boolean _matched = false;
if (cnt instanceof AbstractElement) {
_matched=true; // depends on control dependency: [if], data = [none]
String _gaRuleElementAccessor = this.gaRuleElementAccessor(((AbstractElement)cnt));
_switchResult = (_gaRuleElementAccessor + ".getType()"); // depends on control dependency: [if], data = [none]
}
if (!_matched) {
if (cnt instanceof AbstractRule) {
_matched=true; // depends on control dependency: [if], data = [none]
String _gaRuleAccessor = this.gaRuleAccessor(((AbstractRule)cnt));
_switchResult = (_gaRuleAccessor + ".getType()"); // depends on control dependency: [if], data = [none]
}
}
if (!_matched) {
String _name = ele.eContainer().eClass().getName();
String _plus = ("<error: unknown type " + _name);
_switchResult = (_plus + ">"); // depends on control dependency: [if], data = [none]
}
return _switchResult;
} }
|
public class class_name {
private void updateDatabase() {
if (getMainConfig().getInt("Database.dbVersion") == 0) {
alertOldDbVersion(0, 1);
//We first check if we have the DB version in the database. If we do, we have a old layout in our hands
String value = getStorageHandler().getStorageEngine().getConfigEntry("dbVersion");
if (value != null) {
//We have a old database, do the whole conversion
try {
new OldFormatConverter().run();
getMainConfig().setValue("Database.dbVersion", 1);
sendConsoleMessage(Level.INFO, "Updated to Revision 1!");
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
} else {
getMainConfig().setValue("Database.dbVersion", 1);
sendConsoleMessage(Level.INFO, "Updated to Revision 1!");
}
} else if (getMainConfig().getInt("Database.dbVersion") == -1) {
alertOldDbVersion(-1,1);
try {
new OldFormatConverter().step2();
getMainConfig().setValue("Database.dbVersion", 1);
sendConsoleMessage(Level.INFO, "Updated to Revision 1!");
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
}
} }
|
public class class_name {
private void updateDatabase() {
if (getMainConfig().getInt("Database.dbVersion") == 0) {
alertOldDbVersion(0, 1); // depends on control dependency: [if], data = [none]
//We first check if we have the DB version in the database. If we do, we have a old layout in our hands
String value = getStorageHandler().getStorageEngine().getConfigEntry("dbVersion");
if (value != null) {
//We have a old database, do the whole conversion
try {
new OldFormatConverter().run(); // depends on control dependency: [try], data = [none]
getMainConfig().setValue("Database.dbVersion", 1); // depends on control dependency: [try], data = [none]
sendConsoleMessage(Level.INFO, "Updated to Revision 1!"); // depends on control dependency: [try], data = [none]
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
e.printStackTrace();
} catch (ParseException e) { // depends on control dependency: [catch], data = [none]
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
} else {
getMainConfig().setValue("Database.dbVersion", 1); // depends on control dependency: [if], data = [none]
sendConsoleMessage(Level.INFO, "Updated to Revision 1!"); // depends on control dependency: [if], data = [none]
}
} else if (getMainConfig().getInt("Database.dbVersion") == -1) {
alertOldDbVersion(-1,1); // depends on control dependency: [if], data = [none]
try {
new OldFormatConverter().step2(); // depends on control dependency: [try], data = [none]
getMainConfig().setValue("Database.dbVersion", 1); // depends on control dependency: [try], data = [none]
sendConsoleMessage(Level.INFO, "Updated to Revision 1!"); // depends on control dependency: [try], data = [none]
} catch (SQLException e) {
e.printStackTrace();
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
e.printStackTrace();
} catch (ParseException e) { // depends on control dependency: [catch], data = [none]
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
}
} }
|
public class class_name {
@Override
public double[][] processQueryResults(DoubleDBIDList results, Relation<? extends NumberVector> database, int k) {
final int dim = RelationUtil.dimensionality(database);
final CovarianceMatrix cmat = new CovarianceMatrix(dim);
// avoid bad parameters
k = k <= results.size() ? k : results.size();
// find maximum distance
double maxdist = 0.0, stddev = 0.0;
{
int i = 0;
for(DoubleDBIDListIter it = results.iter(); it.valid() && i < k; it.advance(), k++) {
final double dist = it.doubleValue();
stddev += dist * dist;
if(dist > maxdist) {
maxdist = dist;
}
}
if(maxdist == 0.0) {
maxdist = 1.0;
}
stddev = FastMath.sqrt(stddev / k);
}
// calculate weighted PCA
int i = 0;
for(DoubleDBIDListIter it = results.iter(); it.valid() && i < k; it.advance(), k++) {
final double dist = it.doubleValue();
NumberVector obj = database.get(it);
double weight = weightfunction.getWeight(dist, maxdist, stddev);
cmat.put(obj, weight);
}
return cmat.destroyToPopulationMatrix();
} }
|
public class class_name {
@Override
public double[][] processQueryResults(DoubleDBIDList results, Relation<? extends NumberVector> database, int k) {
final int dim = RelationUtil.dimensionality(database);
final CovarianceMatrix cmat = new CovarianceMatrix(dim);
// avoid bad parameters
k = k <= results.size() ? k : results.size();
// find maximum distance
double maxdist = 0.0, stddev = 0.0;
{
int i = 0;
for(DoubleDBIDListIter it = results.iter(); it.valid() && i < k; it.advance(), k++) {
final double dist = it.doubleValue();
stddev += dist * dist; // depends on control dependency: [for], data = [none]
if(dist > maxdist) {
maxdist = dist; // depends on control dependency: [if], data = [none]
}
}
if(maxdist == 0.0) {
maxdist = 1.0; // depends on control dependency: [if], data = [none]
}
stddev = FastMath.sqrt(stddev / k);
}
// calculate weighted PCA
int i = 0;
for(DoubleDBIDListIter it = results.iter(); it.valid() && i < k; it.advance(), k++) {
final double dist = it.doubleValue();
NumberVector obj = database.get(it);
double weight = weightfunction.getWeight(dist, maxdist, stddev);
cmat.put(obj, weight); // depends on control dependency: [for], data = [none]
}
return cmat.destroyToPopulationMatrix();
} }
|
public class class_name {
boolean cancel(int downloadId) {
synchronized (currentRequests) {
for (DownloadRequest request : currentRequests) {
if (request.downloadId() == downloadId) {
request.cancel();
return true;
}
}
}
return false;
} }
|
public class class_name {
boolean cancel(int downloadId) {
synchronized (currentRequests) {
for (DownloadRequest request : currentRequests) {
if (request.downloadId() == downloadId) {
request.cancel(); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
}
}
return false;
} }
|
public class class_name {
public static ICommonsList <Date> computeFireTimesBetween (final IOperableTrigger trigg,
final ICalendar cal,
final Date from,
final Date to)
{
final ICommonsList <Date> lst = new CommonsArrayList <> ();
final IOperableTrigger t = trigg.clone ();
if (t.getNextFireTime () == null)
{
t.setStartTime (from);
t.setEndTime (to);
t.computeFirstFireTime (cal);
}
while (true)
{
final Date d = t.getNextFireTime ();
if (d != null)
{
if (d.before (from))
{
t.triggered (cal);
continue;
}
if (d.after (to))
{
break;
}
lst.add (d);
t.triggered (cal);
}
else
{
break;
}
}
return lst;
} }
|
public class class_name {
public static ICommonsList <Date> computeFireTimesBetween (final IOperableTrigger trigg,
final ICalendar cal,
final Date from,
final Date to)
{
final ICommonsList <Date> lst = new CommonsArrayList <> ();
final IOperableTrigger t = trigg.clone ();
if (t.getNextFireTime () == null)
{
t.setStartTime (from); // depends on control dependency: [if], data = [none]
t.setEndTime (to); // depends on control dependency: [if], data = [none]
t.computeFirstFireTime (cal); // depends on control dependency: [if], data = [none]
}
while (true)
{
final Date d = t.getNextFireTime ();
if (d != null)
{
if (d.before (from))
{
t.triggered (cal); // depends on control dependency: [if], data = [none]
continue;
}
if (d.after (to))
{
break;
}
lst.add (d); // depends on control dependency: [if], data = [(d]
t.triggered (cal); // depends on control dependency: [if], data = [none]
}
else
{
break;
}
}
return lst;
} }
|
public class class_name {
private PrintWriter getWriter(OutputStream os) throws IOException {
if (os instanceof WrapperOutputStream) {
OutputStream out = ((WrapperOutputStream) os).unwrapRecursively();
if (out instanceof FilteredOutputStream) {
FilteredOutputStream filteredStream = (FilteredOutputStream) out;
return new PrintWriter(new IgnoreCloseWriter(filteredStream.asWriter()));
}
}
return new PrintWriter(new BufferedWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8)));
} }
|
public class class_name {
private PrintWriter getWriter(OutputStream os) throws IOException {
if (os instanceof WrapperOutputStream) {
OutputStream out = ((WrapperOutputStream) os).unwrapRecursively();
if (out instanceof FilteredOutputStream) {
FilteredOutputStream filteredStream = (FilteredOutputStream) out;
return new PrintWriter(new IgnoreCloseWriter(filteredStream.asWriter())); // depends on control dependency: [if], data = [none]
}
}
return new PrintWriter(new BufferedWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8)));
} }
|
public class class_name {
@SuppressWarnings("unchecked")
public Object transform(final Object obj) {
if (obj != null && !(obj instanceof BeanMap)) {
Class clazz = obj.getClass();
if (clazz.isArray()) {
return _transform((Object[]) obj);
} else if (obj instanceof Map) {
return _transform((Map) obj);
} else if (obj instanceof List) {
return _transform((List) obj);
} else if (obj instanceof Set) {
return _transform((Set) obj);
} else if (obj instanceof Collection) {
return _transform((Collection) obj);
} else if (obj instanceof Iterable) {
return _transform((Iterable) obj);
} else if (obj instanceof Iterator) {
return _transform((Iterator) obj);
} else if (needTransform(obj)) {
return onTransform(obj);
}
}
return obj;
} }
|
public class class_name {
@SuppressWarnings("unchecked")
public Object transform(final Object obj) {
if (obj != null && !(obj instanceof BeanMap)) {
Class clazz = obj.getClass();
if (clazz.isArray()) {
return _transform((Object[]) obj); // depends on control dependency: [if], data = [none]
} else if (obj instanceof Map) {
return _transform((Map) obj); // depends on control dependency: [if], data = [none]
} else if (obj instanceof List) {
return _transform((List) obj); // depends on control dependency: [if], data = [none]
} else if (obj instanceof Set) {
return _transform((Set) obj); // depends on control dependency: [if], data = [none]
} else if (obj instanceof Collection) {
return _transform((Collection) obj); // depends on control dependency: [if], data = [none]
} else if (obj instanceof Iterable) {
return _transform((Iterable) obj); // depends on control dependency: [if], data = [none]
} else if (obj instanceof Iterator) {
return _transform((Iterator) obj); // depends on control dependency: [if], data = [none]
} else if (needTransform(obj)) {
return onTransform(obj); // depends on control dependency: [if], data = [none]
}
}
return obj;
} }
|
public class class_name {
private void processHeadersEnd(ChannelHandlerContext ctx, Http2Stream stream, FullHttpMessage msg,
boolean endOfStream) {
if (endOfStream) {
// Release if the msg from the map is different from the object being forwarded up the pipeline.
fireChannelRead(ctx, msg, getMessage(stream) != msg, stream);
} else {
putMessage(stream, msg);
}
} }
|
public class class_name {
private void processHeadersEnd(ChannelHandlerContext ctx, Http2Stream stream, FullHttpMessage msg,
boolean endOfStream) {
if (endOfStream) {
// Release if the msg from the map is different from the object being forwarded up the pipeline.
fireChannelRead(ctx, msg, getMessage(stream) != msg, stream); // depends on control dependency: [if], data = [none]
} else {
putMessage(stream, msg); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public ImageApiProfile merge(ImageApiProfile other) {
ImageApiProfile merged = new ImageApiProfile();
streamNotNull(this.features).forEach(merged::addFeature);
streamNotNull(other.features).forEach(merged::addFeature);
streamNotNull(this.formats).forEach(merged::addFormat);
streamNotNull(other.formats).forEach(merged::addFormat);
streamNotNull(this.qualities).forEach(merged::addQuality);
streamNotNull(other.qualities).forEach(merged::addQuality);
if (this.maxWidth != null && other.maxWidth == null) {
merged.maxWidth = this.maxWidth;
} else if (this.maxWidth == null && other.maxWidth != null) {
merged.maxWidth = other.maxWidth;
} else if (this.maxWidth != null) {
merged.maxWidth = Math.min(this.maxWidth, other.maxWidth);
}
if (this.maxHeight != null && other.maxHeight == null) {
merged.maxHeight = this.maxHeight;
} else if (this.maxHeight == null && other.maxHeight != null) {
merged.maxHeight = other.maxHeight;
} else if (this.maxHeight != null) {
merged.maxHeight = Math.min(this.maxHeight, other.maxHeight);
}
if (this.maxArea != null && other.maxArea == null) {
merged.maxArea = this.maxArea;
} else if (this.maxArea == null && other.maxArea != null) {
merged.maxArea = other.maxArea;
} else if (this.maxArea != null) {
merged.maxArea = Math.min(this.maxArea, other.maxArea);
}
return merged;
} }
|
public class class_name {
public ImageApiProfile merge(ImageApiProfile other) {
ImageApiProfile merged = new ImageApiProfile();
streamNotNull(this.features).forEach(merged::addFeature);
streamNotNull(other.features).forEach(merged::addFeature);
streamNotNull(this.formats).forEach(merged::addFormat);
streamNotNull(other.formats).forEach(merged::addFormat);
streamNotNull(this.qualities).forEach(merged::addQuality);
streamNotNull(other.qualities).forEach(merged::addQuality);
if (this.maxWidth != null && other.maxWidth == null) {
merged.maxWidth = this.maxWidth; // depends on control dependency: [if], data = [none]
} else if (this.maxWidth == null && other.maxWidth != null) {
merged.maxWidth = other.maxWidth; // depends on control dependency: [if], data = [none]
} else if (this.maxWidth != null) {
merged.maxWidth = Math.min(this.maxWidth, other.maxWidth); // depends on control dependency: [if], data = [(this.maxWidth]
}
if (this.maxHeight != null && other.maxHeight == null) {
merged.maxHeight = this.maxHeight; // depends on control dependency: [if], data = [none]
} else if (this.maxHeight == null && other.maxHeight != null) {
merged.maxHeight = other.maxHeight; // depends on control dependency: [if], data = [none]
} else if (this.maxHeight != null) {
merged.maxHeight = Math.min(this.maxHeight, other.maxHeight); // depends on control dependency: [if], data = [(this.maxHeight]
}
if (this.maxArea != null && other.maxArea == null) {
merged.maxArea = this.maxArea; // depends on control dependency: [if], data = [none]
} else if (this.maxArea == null && other.maxArea != null) {
merged.maxArea = other.maxArea; // depends on control dependency: [if], data = [none]
} else if (this.maxArea != null) {
merged.maxArea = Math.min(this.maxArea, other.maxArea); // depends on control dependency: [if], data = [(this.maxArea]
}
return merged;
} }
|
public class class_name {
int getSize() {
int size = 8;
if (value != 0) {
cw.newUTF8("ConstantValue");
size += 8;
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0
&& (cw.version & 0xffff) < Opcodes.V1_5)
{
cw.newUTF8("Synthetic");
size += 6;
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
cw.newUTF8("Deprecated");
size += 6;
}
if (ClassReader.SIGNATURES && signature != 0) {
cw.newUTF8("Signature");
size += 8;
}
if (ClassReader.ANNOTATIONS && anns != null) {
cw.newUTF8("RuntimeVisibleAnnotations");
size += 8 + anns.getSize();
}
if (ClassReader.ANNOTATIONS && ianns != null) {
cw.newUTF8("RuntimeInvisibleAnnotations");
size += 8 + ianns.getSize();
}
if (attrs != null) {
size += attrs.getSize(cw, null, 0, -1, -1);
}
return size;
} }
|
public class class_name {
int getSize() {
int size = 8;
if (value != 0) {
cw.newUTF8("ConstantValue"); // depends on control dependency: [if], data = [none]
size += 8; // depends on control dependency: [if], data = [none]
}
if ((access & Opcodes.ACC_SYNTHETIC) != 0
&& (cw.version & 0xffff) < Opcodes.V1_5)
{
cw.newUTF8("Synthetic"); // depends on control dependency: [if], data = [none]
size += 6; // depends on control dependency: [if], data = [none]
}
if ((access & Opcodes.ACC_DEPRECATED) != 0) {
cw.newUTF8("Deprecated"); // depends on control dependency: [if], data = [none]
size += 6; // depends on control dependency: [if], data = [none]
}
if (ClassReader.SIGNATURES && signature != 0) {
cw.newUTF8("Signature"); // depends on control dependency: [if], data = [none]
size += 8; // depends on control dependency: [if], data = [none]
}
if (ClassReader.ANNOTATIONS && anns != null) {
cw.newUTF8("RuntimeVisibleAnnotations"); // depends on control dependency: [if], data = [none]
size += 8 + anns.getSize(); // depends on control dependency: [if], data = [none]
}
if (ClassReader.ANNOTATIONS && ianns != null) {
cw.newUTF8("RuntimeInvisibleAnnotations"); // depends on control dependency: [if], data = [none]
size += 8 + ianns.getSize(); // depends on control dependency: [if], data = [none]
}
if (attrs != null) {
size += attrs.getSize(cw, null, 0, -1, -1); // depends on control dependency: [if], data = [none]
}
return size;
} }
|
public class class_name {
@Override
public int getStartLevel() {
int result = _startLevel.get();
if (result == -1) {
result = ProvisionerConstants.LEVEL_FEATURE_CONTAINERS;
// Directive names are in the attributes map, but end with a colon
String phase = _rawAttributes.get("start-phase:");
result = setStartLevel(phase, result);
if (!!!_startLevel.compareAndSet(-1, result)) {
result = _startLevel.get();
}
}
return result;
} }
|
public class class_name {
@Override
public int getStartLevel() {
int result = _startLevel.get();
if (result == -1) {
result = ProvisionerConstants.LEVEL_FEATURE_CONTAINERS; // depends on control dependency: [if], data = [none]
// Directive names are in the attributes map, but end with a colon
String phase = _rawAttributes.get("start-phase:");
result = setStartLevel(phase, result); // depends on control dependency: [if], data = [none]
if (!!!_startLevel.compareAndSet(-1, result)) {
result = _startLevel.get(); // depends on control dependency: [if], data = [none]
}
}
return result;
} }
|
public class class_name {
public static void deregisterTx(Session tx) {
if (tx == null) {
return;
}
synchronized (allFields) {
for (TransientField<?> f: allFields.keySet()) {
//returns null if key does not exist.
synchronized (f) {
if (f.txMap.containsKey(tx)) {
f.txMap.remove(tx).clear();
}
}
}
}
} }
|
public class class_name {
public static void deregisterTx(Session tx) {
if (tx == null) {
return;
// depends on control dependency: [if], data = [none]
}
synchronized (allFields) {
for (TransientField<?> f: allFields.keySet()) {
//returns null if key does not exist.
synchronized (f) {
// depends on control dependency: [for], data = [f]
if (f.txMap.containsKey(tx)) {
f.txMap.remove(tx).clear();
// depends on control dependency: [if], data = [none]
}
}
}
}
} }
|
public class class_name {
public static boolean match(String pattern, String str) {
char[] patArr = pattern.toCharArray();
char[] strArr = str.toCharArray();
int patIdxStart = 0;
int patIdxEnd = patArr.length - 1;
int strIdxStart = 0;
int strIdxEnd = strArr.length - 1;
char ch;
boolean containsStar = pattern.contains("*");
if (!containsStar) {
// No '*'s, so we make a shortcut
if (patIdxEnd != strIdxEnd) {
return false; // Pattern and string do not have the same size
}
for (int i = 0; i <= patIdxEnd; i++) {
ch = patArr[i];
if (ch != '?') {
if (ch != strArr[i]) {
return false;// Character mismatch
}
}
}
return true; // String matches against pattern
}
if (patIdxEnd == 0) {
return true; // Pattern contains only '*', which matches anything
}
// Process characters before first star
while ((ch = patArr[patIdxStart]) != '*' && strIdxStart <= strIdxEnd) {
if (ch != '?') {
if (ch != strArr[strIdxStart]) {
return false;// Character mismatch
}
}
patIdxStart++;
strIdxStart++;
}
if (strIdxStart > strIdxEnd) {
// All characters in the string are used. Check if only '*'s are
// left in the pattern. If so, we succeeded. Otherwise failure.
for (int i = patIdxStart; i <= patIdxEnd; i++) {
if (patArr[i] != '*') {
return false;
}
}
return true;
}
// Process characters after last star
while ((ch = patArr[patIdxEnd]) != '*' && strIdxStart <= strIdxEnd) {
if (ch != '?') {
if (ch != strArr[strIdxEnd]) {
return false;// Character mismatch
}
}
patIdxEnd--;
strIdxEnd--;
}
if (strIdxStart > strIdxEnd) {
// All characters in the string are used. Check if only '*'s are
// left in the pattern. If so, we succeeded. Otherwise failure.
for (int i = patIdxStart; i <= patIdxEnd; i++) {
if (patArr[i] != '*') {
return false;
}
}
return true;
}
// process pattern between stars. padIdxStart and patIdxEnd point
// always to a '*'.
while (patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd) {
int patIdxTmp = -1;
for (int i = patIdxStart + 1; i <= patIdxEnd; i++) {
if (patArr[i] == '*') {
patIdxTmp = i;
break;
}
}
if (patIdxTmp == patIdxStart + 1) {
// Two stars next to each other, skip the first one.
patIdxStart++;
continue;
}
// Find the pattern between padIdxStart & padIdxTmp in str between
// strIdxStart & strIdxEnd
int patLength = (patIdxTmp - patIdxStart - 1);
int strLength = (strIdxEnd - strIdxStart + 1);
int foundIdx = -1;
strLoop: for (int i = 0; i <= strLength - patLength; i++) {
for (int j = 0; j < patLength; j++) {
ch = patArr[patIdxStart + j + 1];
if (ch != '?') {
if (ch != strArr[strIdxStart + i + j]) {
continue strLoop;
}
}
}
foundIdx = strIdxStart + i;
break;
}
if (foundIdx == -1) {
return false;
}
patIdxStart = patIdxTmp;
strIdxStart = foundIdx + patLength;
}
// All characters in the string are used. Check if only '*'s are left
// in the pattern. If so, we succeeded. Otherwise failure.
for (int i = patIdxStart; i <= patIdxEnd; i++) {
if (patArr[i] != '*') {
return false;
}
}
return true;
} }
|
public class class_name {
public static boolean match(String pattern, String str) {
char[] patArr = pattern.toCharArray();
char[] strArr = str.toCharArray();
int patIdxStart = 0;
int patIdxEnd = patArr.length - 1;
int strIdxStart = 0;
int strIdxEnd = strArr.length - 1;
char ch;
boolean containsStar = pattern.contains("*");
if (!containsStar) {
// No '*'s, so we make a shortcut
if (patIdxEnd != strIdxEnd) {
return false; // Pattern and string do not have the same size // depends on control dependency: [if], data = [none]
}
for (int i = 0; i <= patIdxEnd; i++) {
ch = patArr[i]; // depends on control dependency: [for], data = [i]
if (ch != '?') {
if (ch != strArr[i]) {
return false;// Character mismatch // depends on control dependency: [if], data = [none]
}
}
}
return true; // String matches against pattern // depends on control dependency: [if], data = [none]
}
if (patIdxEnd == 0) {
return true; // Pattern contains only '*', which matches anything // depends on control dependency: [if], data = [none]
}
// Process characters before first star
while ((ch = patArr[patIdxStart]) != '*' && strIdxStart <= strIdxEnd) {
if (ch != '?') {
if (ch != strArr[strIdxStart]) {
return false;// Character mismatch // depends on control dependency: [if], data = [none]
}
}
patIdxStart++; // depends on control dependency: [while], data = [none]
strIdxStart++; // depends on control dependency: [while], data = [none]
}
if (strIdxStart > strIdxEnd) {
// All characters in the string are used. Check if only '*'s are
// left in the pattern. If so, we succeeded. Otherwise failure.
for (int i = patIdxStart; i <= patIdxEnd; i++) {
if (patArr[i] != '*') {
return false; // depends on control dependency: [if], data = [none]
}
}
return true; // depends on control dependency: [if], data = [none]
}
// Process characters after last star
while ((ch = patArr[patIdxEnd]) != '*' && strIdxStart <= strIdxEnd) {
if (ch != '?') {
if (ch != strArr[strIdxEnd]) {
return false;// Character mismatch // depends on control dependency: [if], data = [none]
}
}
patIdxEnd--; // depends on control dependency: [while], data = [none]
strIdxEnd--; // depends on control dependency: [while], data = [none]
}
if (strIdxStart > strIdxEnd) {
// All characters in the string are used. Check if only '*'s are
// left in the pattern. If so, we succeeded. Otherwise failure.
for (int i = patIdxStart; i <= patIdxEnd; i++) {
if (patArr[i] != '*') {
return false; // depends on control dependency: [if], data = [none]
}
}
return true; // depends on control dependency: [if], data = [none]
}
// process pattern between stars. padIdxStart and patIdxEnd point
// always to a '*'.
while (patIdxStart != patIdxEnd && strIdxStart <= strIdxEnd) {
int patIdxTmp = -1;
for (int i = patIdxStart + 1; i <= patIdxEnd; i++) {
if (patArr[i] == '*') {
patIdxTmp = i; // depends on control dependency: [if], data = [none]
break;
}
}
if (patIdxTmp == patIdxStart + 1) {
// Two stars next to each other, skip the first one.
patIdxStart++; // depends on control dependency: [if], data = [none]
continue;
}
// Find the pattern between padIdxStart & padIdxTmp in str between
// strIdxStart & strIdxEnd
int patLength = (patIdxTmp - patIdxStart - 1);
int strLength = (strIdxEnd - strIdxStart + 1);
int foundIdx = -1;
strLoop: for (int i = 0; i <= strLength - patLength; i++) {
for (int j = 0; j < patLength; j++) {
ch = patArr[patIdxStart + j + 1]; // depends on control dependency: [for], data = [j]
if (ch != '?') {
if (ch != strArr[strIdxStart + i + j]) {
continue strLoop;
}
}
}
foundIdx = strIdxStart + i; // depends on control dependency: [for], data = [i]
break;
}
if (foundIdx == -1) {
return false; // depends on control dependency: [if], data = [none]
}
patIdxStart = patIdxTmp; // depends on control dependency: [while], data = [none]
strIdxStart = foundIdx + patLength; // depends on control dependency: [while], data = [none]
}
// All characters in the string are used. Check if only '*'s are left
// in the pattern. If so, we succeeded. Otherwise failure.
for (int i = patIdxStart; i <= patIdxEnd; i++) {
if (patArr[i] != '*') {
return false; // depends on control dependency: [if], data = [none]
}
}
return true;
} }
|
public class class_name {
private void renderCombinedAutoCompleteScripts()
{
final StringBuilder combinedScript = new StringBuilder();
final EnumSet<AutoCompleteBehavior.Type> types = EnumSet.noneOf(AutoCompleteBehavior.Type.class);
for (final AutoCompleteHeaderItem curItem : this.autoCompleteItems) {
for (final AutoCompleteBehavior.Type type : curItem.getTypes()) {
if (!types.contains(type)) {
types.add(type);
}
}
combinedScript.append("\n");
combinedScript.append(curItem.getJavaScript());
combinedScript.append(";");
}
if (combinedScript.length() > 0) {
if (RequestCycle.get().getActiveRequestHandler() instanceof AjaxRequestHandler) {
super.render(new OnDomReadyHeaderItem(AutoCompleteHeaderItem.writeJavaScript(
combinedScript.append("\n"), types, false)));
} else {
super.render(AutoCompleteHeaderItem.forScript(combinedScript.append("\n").toString(), types));
}
}
} }
|
public class class_name {
private void renderCombinedAutoCompleteScripts()
{
final StringBuilder combinedScript = new StringBuilder();
final EnumSet<AutoCompleteBehavior.Type> types = EnumSet.noneOf(AutoCompleteBehavior.Type.class);
for (final AutoCompleteHeaderItem curItem : this.autoCompleteItems) {
for (final AutoCompleteBehavior.Type type : curItem.getTypes()) {
if (!types.contains(type)) {
types.add(type); // depends on control dependency: [if], data = [none]
}
}
combinedScript.append("\n"); // depends on control dependency: [for], data = [none]
combinedScript.append(curItem.getJavaScript()); // depends on control dependency: [for], data = [curItem]
combinedScript.append(";"); // depends on control dependency: [for], data = [none]
}
if (combinedScript.length() > 0) {
if (RequestCycle.get().getActiveRequestHandler() instanceof AjaxRequestHandler) {
super.render(new OnDomReadyHeaderItem(AutoCompleteHeaderItem.writeJavaScript(
combinedScript.append("\n"), types, false))); // depends on control dependency: [if], data = [none]
} else {
super.render(AutoCompleteHeaderItem.forScript(combinedScript.append("\n").toString(), types)); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
private Multimap<String, I_CmsFormatterBean> getFormattersByType() {
if (m_formattersByType == null) {
ArrayListMultimap<String, I_CmsFormatterBean> formattersByType = ArrayListMultimap.create();
for (I_CmsFormatterBean formatter : m_formatters.values()) {
for (String typeName : formatter.getResourceTypeNames()) {
formattersByType.put(typeName, formatter);
}
}
m_formattersByType = formattersByType;
}
Multimap<String, I_CmsFormatterBean> result = Multimaps.unmodifiableMultimap(m_formattersByType);
return result;
} }
|
public class class_name {
private Multimap<String, I_CmsFormatterBean> getFormattersByType() {
if (m_formattersByType == null) {
ArrayListMultimap<String, I_CmsFormatterBean> formattersByType = ArrayListMultimap.create();
for (I_CmsFormatterBean formatter : m_formatters.values()) {
for (String typeName : formatter.getResourceTypeNames()) {
formattersByType.put(typeName, formatter); // depends on control dependency: [for], data = [typeName]
}
}
m_formattersByType = formattersByType; // depends on control dependency: [if], data = [none]
}
Multimap<String, I_CmsFormatterBean> result = Multimaps.unmodifiableMultimap(m_formattersByType);
return result;
} }
|
public class class_name {
private static boolean initCache() {
if (CHRONOS_BY_ID.get("ISO") == null) {
// Initialization is incomplete
// Register built-in Chronologies
/* /* J2ObjC removed: Only "gregorian" and "julian" calendars are supported.
registerChrono(HijrahChronology.INSTANCE);
registerChrono(JapaneseChronology.INSTANCE);
registerChrono(MinguoChronology.INSTANCE);
registerChrono(ThaiBuddhistChronology.INSTANCE); */
// Register Chronologies from the ServiceLoader
@SuppressWarnings("rawtypes")
ServiceLoader<AbstractChronology> loader = ServiceLoader.load(AbstractChronology.class, null);
for (AbstractChronology chrono : loader) {
String id = chrono.getId();
if (id.equals("ISO") || registerChrono(chrono) != null) {
// Log the attempt to replace an existing Chronology
PlatformLogger logger = PlatformLogger.getLogger("java.time.chrono");
logger.warning("Ignoring duplicate Chronology, from ServiceLoader configuration " + id);
}
}
// finally, register IsoChronology to mark initialization is complete
registerChrono(IsoChronology.INSTANCE);
return true;
}
return false;
} }
|
public class class_name {
private static boolean initCache() {
if (CHRONOS_BY_ID.get("ISO") == null) {
// Initialization is incomplete
// Register built-in Chronologies
/* /* J2ObjC removed: Only "gregorian" and "julian" calendars are supported.
registerChrono(HijrahChronology.INSTANCE);
registerChrono(JapaneseChronology.INSTANCE);
registerChrono(MinguoChronology.INSTANCE);
registerChrono(ThaiBuddhistChronology.INSTANCE); */
// Register Chronologies from the ServiceLoader
@SuppressWarnings("rawtypes")
ServiceLoader<AbstractChronology> loader = ServiceLoader.load(AbstractChronology.class, null);
for (AbstractChronology chrono : loader) {
String id = chrono.getId();
if (id.equals("ISO") || registerChrono(chrono) != null) {
// Log the attempt to replace an existing Chronology
PlatformLogger logger = PlatformLogger.getLogger("java.time.chrono");
logger.warning("Ignoring duplicate Chronology, from ServiceLoader configuration " + id); // depends on control dependency: [if], data = [none]
}
}
// finally, register IsoChronology to mark initialization is complete
registerChrono(IsoChronology.INSTANCE); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
@Override
protected FormatWriter createWriter(final OutputStream outputStream,
final FormatLogger logger) {
try {
return new DSMLFormatWriter(outputStream);
} catch (final IOException e) {
logger.logError("Could not create and intialise the DSML writer", e);
}
return null;
} }
|
public class class_name {
@Override
protected FormatWriter createWriter(final OutputStream outputStream,
final FormatLogger logger) {
try {
return new DSMLFormatWriter(outputStream); // depends on control dependency: [try], data = [none]
} catch (final IOException e) {
logger.logError("Could not create and intialise the DSML writer", e);
} // depends on control dependency: [catch], data = [none]
return null;
} }
|
public class class_name {
public <I extends Renderable, O> Renderer<? super I, ? extends O> getRenderer(final I renderable,
final Class<? extends RenderingFormat<? extends O>> renderingFormat) {
RendererSelection bestMatch = null;
final Collection<RendererBeanDescriptor<?>> descriptors =
_descriptorProvider.getRendererBeanDescriptorsForRenderingFormat(renderingFormat);
for (final RendererBeanDescriptor<?> descriptor : descriptors) {
final RendererSelection rendererMatch = isRendererMatch(descriptor, renderable, bestMatch);
if (rendererMatch != null) {
bestMatch = rendererMatch;
}
}
if (bestMatch == null) {
logger.warn("Didn't find any matches for renderable {} (format={})", renderable, renderingFormat);
return null;
}
@SuppressWarnings("unchecked") final Renderer<? super I, ? extends O> renderer =
(Renderer<? super I, ? extends O>) bestMatch.getRenderer();
if (logger.isInfoEnabled()) {
logger.info("Returning renderer '{}' for renderable '{}' in format '{}'",
new Object[] { renderer, renderable.getClass().getName(), renderingFormat.getName() });
}
return renderer;
} }
|
public class class_name {
public <I extends Renderable, O> Renderer<? super I, ? extends O> getRenderer(final I renderable,
final Class<? extends RenderingFormat<? extends O>> renderingFormat) {
RendererSelection bestMatch = null;
final Collection<RendererBeanDescriptor<?>> descriptors =
_descriptorProvider.getRendererBeanDescriptorsForRenderingFormat(renderingFormat);
for (final RendererBeanDescriptor<?> descriptor : descriptors) {
final RendererSelection rendererMatch = isRendererMatch(descriptor, renderable, bestMatch);
if (rendererMatch != null) {
bestMatch = rendererMatch; // depends on control dependency: [if], data = [none]
}
}
if (bestMatch == null) {
logger.warn("Didn't find any matches for renderable {} (format={})", renderable, renderingFormat);
return null;
}
@SuppressWarnings("unchecked") final Renderer<? super I, ? extends O> renderer =
(Renderer<? super I, ? extends O>) bestMatch.getRenderer();
if (logger.isInfoEnabled()) {
logger.info("Returning renderer '{}' for renderable '{}' in format '{}'",
new Object[] { renderer, renderable.getClass().getName(), renderingFormat.getName() }); // depends on control dependency: [if], data = [none]
}
return renderer;
} }
|
public class class_name {
public String[] arrayDefaultString(final Object[] target, final Object defaultValue) {
if (target == null) {
return null;
}
final String[] result = new String[target.length];
for (int i = 0; i < target.length; i++) {
result[i] = defaultString(target[i], defaultValue);
}
return result;
} }
|
public class class_name {
public String[] arrayDefaultString(final Object[] target, final Object defaultValue) {
if (target == null) {
return null; // depends on control dependency: [if], data = [none]
}
final String[] result = new String[target.length];
for (int i = 0; i < target.length; i++) {
result[i] = defaultString(target[i], defaultValue); // depends on control dependency: [for], data = [i]
}
return result;
} }
|
public class class_name {
static boolean referencesSuper(Node n) {
Node curr = n.getFirstChild();
while (curr != null) {
if (containsType(curr, Token.SUPER, node -> !node.isClass())) {
return true;
}
curr = curr.getNext();
}
return false;
} }
|
public class class_name {
static boolean referencesSuper(Node n) {
Node curr = n.getFirstChild();
while (curr != null) {
if (containsType(curr, Token.SUPER, node -> !node.isClass())) {
return true; // depends on control dependency: [if], data = [none]
}
curr = curr.getNext(); // depends on control dependency: [while], data = [none]
}
return false;
} }
|
public class class_name {
public CmsImageScaler getDownScaler(CmsImageScaler downScaler) {
if (!isDownScaleRequired(downScaler)) {
// no down scaling is required
return null;
}
int downHeight = downScaler.getHeight();
int downWidth = downScaler.getWidth();
int height = getHeight();
int width = getWidth();
if (((height > width) && (downHeight < downWidth)) || ((width > height) && (downWidth < downHeight))) {
// adjust orientation
downHeight = downWidth;
downWidth = downScaler.getHeight();
}
if (width > downWidth) {
// width is too large, re-calculate height
float scale = (float)downWidth / (float)width;
downHeight = Math.round(height * scale);
} else if (height > downHeight) {
// height is too large, re-calculate width
float scale = (float)downHeight / (float)height;
downWidth = Math.round(width * scale);
} else {
// something is wrong, don't down scale
return null;
}
// now create and initialize the result scaler
return new CmsImageScaler(downScaler, downWidth, downHeight);
} }
|
public class class_name {
public CmsImageScaler getDownScaler(CmsImageScaler downScaler) {
if (!isDownScaleRequired(downScaler)) {
// no down scaling is required
return null; // depends on control dependency: [if], data = [none]
}
int downHeight = downScaler.getHeight();
int downWidth = downScaler.getWidth();
int height = getHeight();
int width = getWidth();
if (((height > width) && (downHeight < downWidth)) || ((width > height) && (downWidth < downHeight))) {
// adjust orientation
downHeight = downWidth; // depends on control dependency: [if], data = [none]
downWidth = downScaler.getHeight(); // depends on control dependency: [if], data = [none]
}
if (width > downWidth) {
// width is too large, re-calculate height
float scale = (float)downWidth / (float)width;
downHeight = Math.round(height * scale); // depends on control dependency: [if], data = [none]
} else if (height > downHeight) {
// height is too large, re-calculate width
float scale = (float)downHeight / (float)height;
downWidth = Math.round(width * scale); // depends on control dependency: [if], data = [none]
} else {
// something is wrong, don't down scale
return null; // depends on control dependency: [if], data = [none]
}
// now create and initialize the result scaler
return new CmsImageScaler(downScaler, downWidth, downHeight);
} }
|
public class class_name {
public static void shutdownActive(ShutdownModeAmp mode,
ExitCode exitCode,
String msg,
Result<String> result)
{
ShutdownSystem shutdown = _activeService.get();
if (shutdown != null) {
shutdown.shutdown(mode, exitCode, msg, result);
return;
}
shutdown = getCurrent();
if (shutdown != null) {
shutdown.shutdown(mode, exitCode, msg, result);
return;
}
msg = ShutdownSystem.class.getSimpleName() + " is not active:\n " + msg;
log.warning(msg);
System.out.println(msg);
if (result != null) {
result.ok(msg);
}
} }
|
public class class_name {
public static void shutdownActive(ShutdownModeAmp mode,
ExitCode exitCode,
String msg,
Result<String> result)
{
ShutdownSystem shutdown = _activeService.get();
if (shutdown != null) {
shutdown.shutdown(mode, exitCode, msg, result); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
shutdown = getCurrent();
if (shutdown != null) {
shutdown.shutdown(mode, exitCode, msg, result); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
msg = ShutdownSystem.class.getSimpleName() + " is not active:\n " + msg;
log.warning(msg);
System.out.println(msg);
if (result != null) {
result.ok(msg); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public Observable<ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders>> getWithServiceResponseAsync(String poolId, String nodeId, ComputeNodeGetOptions computeNodeGetOptions) {
if (this.client.batchUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null.");
}
if (poolId == null) {
throw new IllegalArgumentException("Parameter poolId is required and cannot be null.");
}
if (nodeId == null) {
throw new IllegalArgumentException("Parameter nodeId is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(computeNodeGetOptions);
String select = null;
if (computeNodeGetOptions != null) {
select = computeNodeGetOptions.select();
}
Integer timeout = null;
if (computeNodeGetOptions != null) {
timeout = computeNodeGetOptions.timeout();
}
UUID clientRequestId = null;
if (computeNodeGetOptions != null) {
clientRequestId = computeNodeGetOptions.clientRequestId();
}
Boolean returnClientRequestId = null;
if (computeNodeGetOptions != null) {
returnClientRequestId = computeNodeGetOptions.returnClientRequestId();
}
DateTime ocpDate = null;
if (computeNodeGetOptions != null) {
ocpDate = computeNodeGetOptions.ocpDate();
}
String parameterizedHost = Joiner.on(", ").join("{batchUrl}", this.client.batchUrl());
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate);
}
return service.get(poolId, nodeId, this.client.apiVersion(), this.client.acceptLanguage(), select, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, parameterizedHost, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders>>>() {
@Override
public Observable<ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders>> call(Response<ResponseBody> response) {
try {
ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders> clientResponse = getDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} }
|
public class class_name {
public Observable<ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders>> getWithServiceResponseAsync(String poolId, String nodeId, ComputeNodeGetOptions computeNodeGetOptions) {
if (this.client.batchUrl() == null) {
throw new IllegalArgumentException("Parameter this.client.batchUrl() is required and cannot be null.");
}
if (poolId == null) {
throw new IllegalArgumentException("Parameter poolId is required and cannot be null.");
}
if (nodeId == null) {
throw new IllegalArgumentException("Parameter nodeId is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
Validator.validate(computeNodeGetOptions);
String select = null;
if (computeNodeGetOptions != null) {
select = computeNodeGetOptions.select(); // depends on control dependency: [if], data = [none]
}
Integer timeout = null;
if (computeNodeGetOptions != null) {
timeout = computeNodeGetOptions.timeout(); // depends on control dependency: [if], data = [none]
}
UUID clientRequestId = null;
if (computeNodeGetOptions != null) {
clientRequestId = computeNodeGetOptions.clientRequestId(); // depends on control dependency: [if], data = [none]
}
Boolean returnClientRequestId = null;
if (computeNodeGetOptions != null) {
returnClientRequestId = computeNodeGetOptions.returnClientRequestId(); // depends on control dependency: [if], data = [none]
}
DateTime ocpDate = null;
if (computeNodeGetOptions != null) {
ocpDate = computeNodeGetOptions.ocpDate(); // depends on control dependency: [if], data = [none]
}
String parameterizedHost = Joiner.on(", ").join("{batchUrl}", this.client.batchUrl());
DateTimeRfc1123 ocpDateConverted = null;
if (ocpDate != null) {
ocpDateConverted = new DateTimeRfc1123(ocpDate); // depends on control dependency: [if], data = [(ocpDate]
}
return service.get(poolId, nodeId, this.client.apiVersion(), this.client.acceptLanguage(), select, timeout, clientRequestId, returnClientRequestId, ocpDateConverted, parameterizedHost, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders>>>() {
@Override
public Observable<ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders>> call(Response<ResponseBody> response) {
try {
ServiceResponseWithHeaders<ComputeNode, ComputeNodeGetHeaders> clientResponse = getDelegate(response);
return Observable.just(clientResponse); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
return Observable.error(t);
} // depends on control dependency: [catch], data = [none]
}
});
} }
|
public class class_name {
public synchronized void unregisterSessionManager(Object key) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[UNREGISTER_SESSION_MANAGER], "registryKey= " + key);
}
_genericSessionManagers.remove(key);
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[UNREGISTER_SESSION_MANAGER]);
}
} }
|
public class class_name {
public synchronized void unregisterSessionManager(Object key) {
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_CORE.entering(methodClassName, methodNames[UNREGISTER_SESSION_MANAGER], "registryKey= " + key); // depends on control dependency: [if], data = [none]
}
_genericSessionManagers.remove(key);
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_CORE.exiting(methodClassName, methodNames[UNREGISTER_SESSION_MANAGER]); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
protected static OptionalThing<ClassificationMeta> nativeFindMeta(Class<?> defmetaType, String classificationName) { // old method
assertArgumentNotNull("defmetaType", defmetaType);
assertArgumentNotNull("classificationName", classificationName);
final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(defmetaType);
final String methodName = "find";
final Method method;
try {
method = beanDesc.getMethod(methodName, new Class<?>[] { String.class });
} catch (BeanMethodNotFoundException e) {
String msg = "Failed to get the method " + methodName + "() of the def-meta type: " + defmetaType;
throw new ClassificationMetaFindMethodNotFoundException(msg, e);
}
@SuppressWarnings("unchecked")
OptionalThing<ClassificationMeta> opt =
(OptionalThing<ClassificationMeta>) DfReflectionUtil.invokeStatic(method, new Object[] { classificationName });
return opt;
} }
|
public class class_name {
protected static OptionalThing<ClassificationMeta> nativeFindMeta(Class<?> defmetaType, String classificationName) { // old method
assertArgumentNotNull("defmetaType", defmetaType);
assertArgumentNotNull("classificationName", classificationName);
final BeanDesc beanDesc = BeanDescFactory.getBeanDesc(defmetaType);
final String methodName = "find";
final Method method;
try {
method = beanDesc.getMethod(methodName, new Class<?>[] { String.class }); // depends on control dependency: [try], data = [none]
} catch (BeanMethodNotFoundException e) {
String msg = "Failed to get the method " + methodName + "() of the def-meta type: " + defmetaType;
throw new ClassificationMetaFindMethodNotFoundException(msg, e);
} // depends on control dependency: [catch], data = [none]
@SuppressWarnings("unchecked")
OptionalThing<ClassificationMeta> opt =
(OptionalThing<ClassificationMeta>) DfReflectionUtil.invokeStatic(method, new Object[] { classificationName });
return opt;
} }
|
public class class_name {
public static <T extends AbsListView> RxAction<T, String> setFilterText() {
return new RxAction<T, String>() {
@Override
public void call(T view, String filterText) {
if (TextUtils.isEmpty(filterText)) {
view.clearTextFilter();
} else {
view.setFilterText(filterText);
}
}
};
} }
|
public class class_name {
public static <T extends AbsListView> RxAction<T, String> setFilterText() {
return new RxAction<T, String>() {
@Override
public void call(T view, String filterText) {
if (TextUtils.isEmpty(filterText)) {
view.clearTextFilter(); // depends on control dependency: [if], data = [none]
} else {
view.setFilterText(filterText); // depends on control dependency: [if], data = [none]
}
}
};
} }
|
public class class_name {
public HttpContext service(HttpRequest request,HttpResponse response)
throws IOException, HttpException
{
String host=request.getHost();
if (_requestsPerGC>0 && _gcRequests++>_requestsPerGC)
{
_gcRequests=0;
System.gc();
}
while (true)
{
PathMap contextMap=(PathMap)_virtualHostMap.get(host);
if (contextMap!=null)
{
List contextLists =contextMap.getMatches(request.getPath());
if(contextLists!=null)
{
if(log.isTraceEnabled())log.trace("Contexts at "+request.getPath()+": "+contextLists);
for (int i=0;i<contextLists.size();i++)
{
Map.Entry entry=
(Map.Entry)
contextLists.get(i);
List contextList = (List)entry.getValue();
for (int j=0;j<contextList.size();j++)
{
HttpContext context=
(HttpContext)contextList.get(j);
if(log.isDebugEnabled())log.debug("Try "+context+","+j);
context.handle(request,response);
if (request.isHandled())
return context;
}
}
}
}
// try no host
if (host==null)
break;
host=null;
}
synchronized(this)
{
if (_notFoundContext==null)
{
_notFoundContext=new HttpContext();
_notFoundContext.setContextPath("/");
_notFoundContext.setHttpServer(this);
try
{
_notFoundContext
.addHandler((NotFoundHandler)Class.forName
("org.browsermob.proxy.jetty.http.handler.RootNotFoundHandler").newInstance());
}
catch (Exception e)
{
_notFoundContext.addHandler(new NotFoundHandler());
}
addComponent(_notFoundContext);
try{_notFoundContext.start();}catch(Exception e){log.warn(LogSupport.EXCEPTION,e);}
}
_notFoundContext.handle(request,response);
if (!request.isHandled())
response.sendError(HttpResponse.__404_Not_Found);
return _notFoundContext;
}
} }
|
public class class_name {
public HttpContext service(HttpRequest request,HttpResponse response)
throws IOException, HttpException
{
String host=request.getHost();
if (_requestsPerGC>0 && _gcRequests++>_requestsPerGC)
{
_gcRequests=0;
System.gc();
}
while (true)
{
PathMap contextMap=(PathMap)_virtualHostMap.get(host);
if (contextMap!=null)
{
List contextLists =contextMap.getMatches(request.getPath());
if(contextLists!=null)
{
if(log.isTraceEnabled())log.trace("Contexts at "+request.getPath()+": "+contextLists);
for (int i=0;i<contextLists.size();i++)
{
Map.Entry entry=
(Map.Entry)
contextLists.get(i);
List contextList = (List)entry.getValue();
for (int j=0;j<contextList.size();j++)
{
HttpContext context=
(HttpContext)contextList.get(j);
if(log.isDebugEnabled())log.debug("Try "+context+","+j);
context.handle(request,response); // depends on control dependency: [for], data = [none]
if (request.isHandled())
return context;
}
}
}
}
// try no host
if (host==null)
break;
host=null;
}
synchronized(this)
{
if (_notFoundContext==null)
{
_notFoundContext=new HttpContext();
_notFoundContext.setContextPath("/");
_notFoundContext.setHttpServer(this);
try
{
_notFoundContext
.addHandler((NotFoundHandler)Class.forName
("org.browsermob.proxy.jetty.http.handler.RootNotFoundHandler").newInstance());
}
catch (Exception e)
{
_notFoundContext.addHandler(new NotFoundHandler());
}
addComponent(_notFoundContext);
try{_notFoundContext.start();}catch(Exception e){log.warn(LogSupport.EXCEPTION,e);}
}
_notFoundContext.handle(request,response);
if (!request.isHandled())
response.sendError(HttpResponse.__404_Not_Found);
return _notFoundContext;
}
} }
|
public class class_name {
private static boolean shouldRetry(JsonObject errorJson) {
if (errorJson == null) return false;
Integer code = errorJson.getInt(ERROR_FIELD_CODE);
String msg = errorJson.getString(ERROR_FIELD_MSG);
if (code == null || msg == null) return false;
if (code == 4050 || code == 4070 ||
(code == 5000 && msg.contains(ERROR_5000_SPECIFIC_MESSAGE))) {
return true;
}
return false;
} }
|
public class class_name {
private static boolean shouldRetry(JsonObject errorJson) {
if (errorJson == null) return false;
Integer code = errorJson.getInt(ERROR_FIELD_CODE);
String msg = errorJson.getString(ERROR_FIELD_MSG);
if (code == null || msg == null) return false;
if (code == 4050 || code == 4070 ||
(code == 5000 && msg.contains(ERROR_5000_SPECIFIC_MESSAGE))) {
return true; // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
public static AppIdNamespace parseEncodedAppIdNamespace( String encodedAppIdNamespace ) {
if ( encodedAppIdNamespace == null ) {
throw new IllegalArgumentException( "appIdNamespaceString may not be null" );
}
int index = encodedAppIdNamespace.indexOf( NamespaceResources.NAMESPACE_SEPARATOR );
if ( index == -1 ) {
return new AppIdNamespace( encodedAppIdNamespace, "" );
}
String appId = encodedAppIdNamespace.substring( 0, index );
String namespace = encodedAppIdNamespace.substring( index + 1 );
if ( namespace.length() == 0 ) {
throw new IllegalArgumentException(
"encodedAppIdNamespace with empty namespace may not contain a '" +
NamespaceResources.NAMESPACE_SEPARATOR + "'" );
}
return new AppIdNamespace( appId, namespace );
} }
|
public class class_name {
public static AppIdNamespace parseEncodedAppIdNamespace( String encodedAppIdNamespace ) {
if ( encodedAppIdNamespace == null ) {
throw new IllegalArgumentException( "appIdNamespaceString may not be null" );
}
int index = encodedAppIdNamespace.indexOf( NamespaceResources.NAMESPACE_SEPARATOR );
if ( index == -1 ) {
return new AppIdNamespace( encodedAppIdNamespace, "" ); // depends on control dependency: [if], data = [none]
}
String appId = encodedAppIdNamespace.substring( 0, index );
String namespace = encodedAppIdNamespace.substring( index + 1 );
if ( namespace.length() == 0 ) {
throw new IllegalArgumentException(
"encodedAppIdNamespace with empty namespace may not contain a '" +
NamespaceResources.NAMESPACE_SEPARATOR + "'" );
}
return new AppIdNamespace( appId, namespace );
} }
|
public class class_name {
public java.util.List<ElasticGpus> getElasticGpuSet() {
if (elasticGpuSet == null) {
elasticGpuSet = new com.amazonaws.internal.SdkInternalList<ElasticGpus>();
}
return elasticGpuSet;
} }
|
public class class_name {
public java.util.List<ElasticGpus> getElasticGpuSet() {
if (elasticGpuSet == null) {
elasticGpuSet = new com.amazonaws.internal.SdkInternalList<ElasticGpus>(); // depends on control dependency: [if], data = [none]
}
return elasticGpuSet;
} }
|
public class class_name {
public static String formatDuration(final long startTime, final long endTime) {
if (startTime == -1) {
return "-";
}
final long durationMS;
if (endTime == -1) {
durationMS = System.currentTimeMillis() - startTime;
} else {
durationMS = endTime - startTime;
}
long seconds = durationMS / 1000;
if (seconds < 60) {
return seconds + " sec";
}
long minutes = seconds / 60;
seconds %= 60;
if (minutes < 60) {
return minutes + "m " + seconds + "s";
}
long hours = minutes / 60;
minutes %= 60;
if (hours < 24) {
return hours + "h " + minutes + "m " + seconds + "s";
}
final long days = hours / 24;
hours %= 24;
return days + "d " + hours + "h " + minutes + "m";
} }
|
public class class_name {
public static String formatDuration(final long startTime, final long endTime) {
if (startTime == -1) {
return "-"; // depends on control dependency: [if], data = [none]
}
final long durationMS;
if (endTime == -1) {
durationMS = System.currentTimeMillis() - startTime; // depends on control dependency: [if], data = [none]
} else {
durationMS = endTime - startTime; // depends on control dependency: [if], data = [none]
}
long seconds = durationMS / 1000;
if (seconds < 60) {
return seconds + " sec"; // depends on control dependency: [if], data = [none]
}
long minutes = seconds / 60;
seconds %= 60;
if (minutes < 60) {
return minutes + "m " + seconds + "s"; // depends on control dependency: [if], data = [none]
}
long hours = minutes / 60;
minutes %= 60;
if (hours < 24) {
return hours + "h " + minutes + "m " + seconds + "s"; // depends on control dependency: [if], data = [none]
}
final long days = hours / 24;
hours %= 24;
return days + "d " + hours + "h " + minutes + "m";
} }
|
public class class_name {
@Override
public void init(Vertx vertx, Context context) {
super.init(vertx, context);
try {
// Create the real verticle and init
realVerticle = createRealVerticle();
realVerticle.init(vertx, context);
} catch (Throwable t) {
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
throw new RuntimeException(t);
}
} }
|
public class class_name {
@Override
public void init(Vertx vertx, Context context) {
super.init(vertx, context);
try {
// Create the real verticle and init
realVerticle = createRealVerticle(); // depends on control dependency: [try], data = [none]
realVerticle.init(vertx, context); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
throw new RuntimeException(t);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static Length[] parseStrokeDashArray(String val)
{
TextScanner scan = new TextScanner(val);
scan.skipWhitespace();
if (scan.empty())
return null;
Length dash = scan.nextLength();
if (dash == null)
return null;
if (dash.isNegative())
return null;
float sum = dash.floatValue();
List<Length> dashes = new ArrayList<>();
dashes.add(dash);
while (!scan.empty())
{
scan.skipCommaWhitespace();
dash = scan.nextLength();
if (dash == null) // must have hit something unexpected
return null;
if (dash.isNegative())
return null;
dashes.add(dash);
sum += dash.floatValue();
}
// Spec (section 11.4) says if the sum of dash lengths is zero, it should
// be treated as "none" ie a solid stroke.
if (sum == 0f)
return null;
return dashes.toArray(new Length[dashes.size()]);
} }
|
public class class_name {
private static Length[] parseStrokeDashArray(String val)
{
TextScanner scan = new TextScanner(val);
scan.skipWhitespace();
if (scan.empty())
return null;
Length dash = scan.nextLength();
if (dash == null)
return null;
if (dash.isNegative())
return null;
float sum = dash.floatValue();
List<Length> dashes = new ArrayList<>();
dashes.add(dash);
while (!scan.empty())
{
scan.skipCommaWhitespace();
// depends on control dependency: [while], data = [none]
dash = scan.nextLength();
// depends on control dependency: [while], data = [none]
if (dash == null) // must have hit something unexpected
return null;
if (dash.isNegative())
return null;
dashes.add(dash);
// depends on control dependency: [while], data = [none]
sum += dash.floatValue();
// depends on control dependency: [while], data = [none]
}
// Spec (section 11.4) says if the sum of dash lengths is zero, it should
// be treated as "none" ie a solid stroke.
if (sum == 0f)
return null;
return dashes.toArray(new Length[dashes.size()]);
} }
|
public class class_name {
public void recoverFromStopSync(AlluxioURI uri, long mountId) {
if (mSyncPathStatus.containsKey(uri)) {
// nothing to recover from, since the syncPathStatus still contains syncPoint
return;
}
try {
// the init sync thread has been removed, to reestablish sync, we need to sync again
MountTable.Resolution resolution = mMountTable.resolve(uri);
startInitSync(uri, resolution);
launchPollingThread(resolution.getMountId(), SyncInfo.INVALID_TXID);
} catch (Throwable t) {
LOG.warn("Recovering from stop syncing failed {}", t);
}
} }
|
public class class_name {
public void recoverFromStopSync(AlluxioURI uri, long mountId) {
if (mSyncPathStatus.containsKey(uri)) {
// nothing to recover from, since the syncPathStatus still contains syncPoint
return; // depends on control dependency: [if], data = [none]
}
try {
// the init sync thread has been removed, to reestablish sync, we need to sync again
MountTable.Resolution resolution = mMountTable.resolve(uri);
startInitSync(uri, resolution); // depends on control dependency: [try], data = [none]
launchPollingThread(resolution.getMountId(), SyncInfo.INVALID_TXID); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
LOG.warn("Recovering from stop syncing failed {}", t);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private void computeSubClusterSplit(final int[][] subDesignation,
int originalCluster, List<DataPoint> listOfDataPointsInCluster, DataSet fullDataSet,
int[] fullDesignations, final int[][] originalPositions,
final double[] splitEvaluation,
PriorityQueue<Integer> clusterToSplit, boolean parallel)
{
subDesignation[originalCluster] = new int[listOfDataPointsInCluster.size()];
int pos = 0;
for(int i = 0; i < fullDataSet.size(); i++)
{
if(fullDesignations[i] != originalCluster)
continue;
originalPositions[originalCluster][pos++] = i;
}
//Cluster the sub cluster
SimpleDataSet dpSubC1DataSet = new SimpleDataSet(listOfDataPointsInCluster);
try
{
baseClusterer.cluster(dpSubC1DataSet, 2, parallel, subDesignation[originalCluster]);
splitEvaluation[originalCluster] = clusterEvaluation.evaluate(subDesignation[originalCluster], dpSubC1DataSet);
clusterToSplit.add(originalCluster);
}
catch (ClusterFailureException ex)
{
splitEvaluation[originalCluster] = Double.POSITIVE_INFINITY;
}
} }
|
public class class_name {
private void computeSubClusterSplit(final int[][] subDesignation,
int originalCluster, List<DataPoint> listOfDataPointsInCluster, DataSet fullDataSet,
int[] fullDesignations, final int[][] originalPositions,
final double[] splitEvaluation,
PriorityQueue<Integer> clusterToSplit, boolean parallel)
{
subDesignation[originalCluster] = new int[listOfDataPointsInCluster.size()];
int pos = 0;
for(int i = 0; i < fullDataSet.size(); i++)
{
if(fullDesignations[i] != originalCluster)
continue;
originalPositions[originalCluster][pos++] = i; // depends on control dependency: [for], data = [i]
}
//Cluster the sub cluster
SimpleDataSet dpSubC1DataSet = new SimpleDataSet(listOfDataPointsInCluster);
try
{
baseClusterer.cluster(dpSubC1DataSet, 2, parallel, subDesignation[originalCluster]); // depends on control dependency: [try], data = [none]
splitEvaluation[originalCluster] = clusterEvaluation.evaluate(subDesignation[originalCluster], dpSubC1DataSet); // depends on control dependency: [try], data = [none]
clusterToSplit.add(originalCluster); // depends on control dependency: [try], data = [none]
}
catch (ClusterFailureException ex)
{
splitEvaluation[originalCluster] = Double.POSITIVE_INFINITY;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public DescribeDirectConnectGatewayAssociationProposalsResult withDirectConnectGatewayAssociationProposals(
DirectConnectGatewayAssociationProposal... directConnectGatewayAssociationProposals) {
if (this.directConnectGatewayAssociationProposals == null) {
setDirectConnectGatewayAssociationProposals(new com.amazonaws.internal.SdkInternalList<DirectConnectGatewayAssociationProposal>(
directConnectGatewayAssociationProposals.length));
}
for (DirectConnectGatewayAssociationProposal ele : directConnectGatewayAssociationProposals) {
this.directConnectGatewayAssociationProposals.add(ele);
}
return this;
} }
|
public class class_name {
public DescribeDirectConnectGatewayAssociationProposalsResult withDirectConnectGatewayAssociationProposals(
DirectConnectGatewayAssociationProposal... directConnectGatewayAssociationProposals) {
if (this.directConnectGatewayAssociationProposals == null) {
setDirectConnectGatewayAssociationProposals(new com.amazonaws.internal.SdkInternalList<DirectConnectGatewayAssociationProposal>(
directConnectGatewayAssociationProposals.length)); // depends on control dependency: [if], data = [none]
}
for (DirectConnectGatewayAssociationProposal ele : directConnectGatewayAssociationProposals) {
this.directConnectGatewayAssociationProposals.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public void setCacheSecurityGroups(java.util.Collection<CacheSecurityGroup> cacheSecurityGroups) {
if (cacheSecurityGroups == null) {
this.cacheSecurityGroups = null;
return;
}
this.cacheSecurityGroups = new com.amazonaws.internal.SdkInternalList<CacheSecurityGroup>(cacheSecurityGroups);
} }
|
public class class_name {
public void setCacheSecurityGroups(java.util.Collection<CacheSecurityGroup> cacheSecurityGroups) {
if (cacheSecurityGroups == null) {
this.cacheSecurityGroups = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.cacheSecurityGroups = new com.amazonaws.internal.SdkInternalList<CacheSecurityGroup>(cacheSecurityGroups);
} }
|
public class class_name {
public void paintStripesAndGrid(SeaGlassContext context, Graphics g, JComponent c, int width, int height, int top) {
int rh = table.getRowHeight();
int n = table.getRowCount();
int row = Math.abs(top / rh);
// if (true) return;
// TableCellRenderer renderer =
// table.getDefaultRenderer(java.lang.Object.class);
// Paint the background, including stripes if requested.
if (alternateColor != null) {
// Fill the viewport with background color.
// Rossi: Ugly broken hack to make the first column white instead of blue.
// To see how the new blue table headers look like.
// This is should be done by modifying the "for loop" instead.
g.setColor(alternateColor);
g.fillRect(0, 0, width, height);
// Now check if we need to paint some stripes
g.setColor(table.getBackground());
// Paint table rows to fill the viewport.
for (int y = top + row * rh, ymax = height; y < ymax; y += rh) {
if (row % 2 == 0) {
g.fillRect(0, y, width, rh);
}
row++;
}
} else {
// Fill the viewport with the background color of the table
g.setColor(table.getBackground());
g.fillRect(0, 0, c.getWidth(), c.getHeight());
}
SynthGraphicsUtils synthG = context.getStyle().getGraphicsUtils(context);
// Paint the horizontal grid lines
if (table.getShowHorizontalLines()) {
g.setColor(table.getGridColor());
row = Math.abs(top / rh);
int y = top + row * rh + rh - 1;
while (y < height) {
synthG.drawLine(context, "Table.grid", g, 0, y, width, y);
y += rh;
}
}
// Paint the vertical grid lines
if (table.getShowVerticalLines()) {
g.setColor(table.getGridColor());
TableColumnModel cm = table.getColumnModel();
n = cm.getColumnCount();
int y = top + row * rh;
;
int x = -1;
for (int i = 0; i < n; i++) {
TableColumn col = cm.getColumn(i);
x += col.getWidth();
synthG.drawLine(context, "Table.grid", g, x, y, x, height);
}
}
} }
|
public class class_name {
public void paintStripesAndGrid(SeaGlassContext context, Graphics g, JComponent c, int width, int height, int top) {
int rh = table.getRowHeight();
int n = table.getRowCount();
int row = Math.abs(top / rh);
// if (true) return;
// TableCellRenderer renderer =
// table.getDefaultRenderer(java.lang.Object.class);
// Paint the background, including stripes if requested.
if (alternateColor != null) {
// Fill the viewport with background color.
// Rossi: Ugly broken hack to make the first column white instead of blue.
// To see how the new blue table headers look like.
// This is should be done by modifying the "for loop" instead.
g.setColor(alternateColor); // depends on control dependency: [if], data = [(alternateColor]
g.fillRect(0, 0, width, height); // depends on control dependency: [if], data = [none]
// Now check if we need to paint some stripes
g.setColor(table.getBackground()); // depends on control dependency: [if], data = [none]
// Paint table rows to fill the viewport.
for (int y = top + row * rh, ymax = height; y < ymax; y += rh) {
if (row % 2 == 0) {
g.fillRect(0, y, width, rh); // depends on control dependency: [if], data = [none]
}
row++; // depends on control dependency: [for], data = [none]
}
} else {
// Fill the viewport with the background color of the table
g.setColor(table.getBackground()); // depends on control dependency: [if], data = [none]
g.fillRect(0, 0, c.getWidth(), c.getHeight()); // depends on control dependency: [if], data = [none]
}
SynthGraphicsUtils synthG = context.getStyle().getGraphicsUtils(context);
// Paint the horizontal grid lines
if (table.getShowHorizontalLines()) {
g.setColor(table.getGridColor()); // depends on control dependency: [if], data = [none]
row = Math.abs(top / rh); // depends on control dependency: [if], data = [none]
int y = top + row * rh + rh - 1;
while (y < height) {
synthG.drawLine(context, "Table.grid", g, 0, y, width, y); // depends on control dependency: [while], data = [none]
y += rh; // depends on control dependency: [while], data = [none]
}
}
// Paint the vertical grid lines
if (table.getShowVerticalLines()) {
g.setColor(table.getGridColor()); // depends on control dependency: [if], data = [none]
TableColumnModel cm = table.getColumnModel();
n = cm.getColumnCount(); // depends on control dependency: [if], data = [none]
int y = top + row * rh;
;
int x = -1;
for (int i = 0; i < n; i++) {
TableColumn col = cm.getColumn(i);
x += col.getWidth(); // depends on control dependency: [for], data = [none]
synthG.drawLine(context, "Table.grid", g, x, y, x, height); // depends on control dependency: [for], data = [none]
}
}
} }
|
public class class_name {
public void speak (ClientObject caller, final ChatChannel channel, String message, byte mode)
{
BodyObject body = _locator.forClient(caller);
final UserMessage umsg = new UserMessage(body.getVisibleName(), null, message, mode);
// if we're hosting this channel, dispatch it directly
if (_channels.containsKey(channel)) {
dispatchSpeak(channel, umsg);
return;
}
// if we're resolving this channel, queue up our message for momentary deliver
List<UserMessage> msgs = _resolving.get(channel);
if (msgs != null) {
msgs.add(umsg);
return;
}
// forward the speak request to the server that hosts the channel in question
_peerMan.invokeNodeAction(new ChannelAction(channel) {
@Override protected void execute () {
_channelMan.dispatchSpeak(_channel, umsg);
}
}, new Runnable() {
public void run () {
_resolving.put(channel, Lists.newArrayList(umsg));
resolveAndDispatch(channel);
}
});
} }
|
public class class_name {
public void speak (ClientObject caller, final ChatChannel channel, String message, byte mode)
{
BodyObject body = _locator.forClient(caller);
final UserMessage umsg = new UserMessage(body.getVisibleName(), null, message, mode);
// if we're hosting this channel, dispatch it directly
if (_channels.containsKey(channel)) {
dispatchSpeak(channel, umsg); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
// if we're resolving this channel, queue up our message for momentary deliver
List<UserMessage> msgs = _resolving.get(channel);
if (msgs != null) {
msgs.add(umsg); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
// forward the speak request to the server that hosts the channel in question
_peerMan.invokeNodeAction(new ChannelAction(channel) {
@Override protected void execute () {
_channelMan.dispatchSpeak(_channel, umsg);
}
}, new Runnable() {
public void run () {
_resolving.put(channel, Lists.newArrayList(umsg));
resolveAndDispatch(channel);
}
});
} }
|
public class class_name {
Connection getSingleConnection() {
Connection connection = null;
try {
Class.forName(driver);
connection = DriverManager.getConnection(url, user, password);
} catch (SQLException e) {
throw new InitializationException("Could not initialize the connection", e);
} catch (ClassNotFoundException e) {
throw new InitializationException("Could not find the driver class", e);
}
return connection;
} }
|
public class class_name {
Connection getSingleConnection() {
Connection connection = null;
try {
Class.forName(driver);
connection = DriverManager.getConnection(url, user, password);
} catch (SQLException e) {
throw new InitializationException("Could not initialize the connection", e);
} catch (ClassNotFoundException e) { // depends on control dependency: [catch], data = [none]
throw new InitializationException("Could not find the driver class", e);
} // depends on control dependency: [catch], data = [none]
return connection;
} }
|
public class class_name {
public BoundingBox getBoundingBox() {
if (this.boundingBox == null) {
double minLatitude = Math.max(MercatorProjection.LATITUDE_MIN, MercatorProjection.tileYToLatitude(tileY + 1, zoomLevel));
double minLongitude = Math.max(-180, MercatorProjection.tileXToLongitude(this.tileX, zoomLevel));
double maxLatitude = Math.min(MercatorProjection.LATITUDE_MAX, MercatorProjection.tileYToLatitude(this.tileY, zoomLevel));
double maxLongitude = Math.min(180, MercatorProjection.tileXToLongitude(tileX + 1, zoomLevel));
if (maxLongitude == -180) {
// fix for dateline crossing, where the right tile starts at -180 and causes an invalid bbox
maxLongitude = 180;
}
this.boundingBox = new BoundingBox(minLatitude, minLongitude, maxLatitude, maxLongitude);
}
return this.boundingBox;
} }
|
public class class_name {
public BoundingBox getBoundingBox() {
if (this.boundingBox == null) {
double minLatitude = Math.max(MercatorProjection.LATITUDE_MIN, MercatorProjection.tileYToLatitude(tileY + 1, zoomLevel));
double minLongitude = Math.max(-180, MercatorProjection.tileXToLongitude(this.tileX, zoomLevel));
double maxLatitude = Math.min(MercatorProjection.LATITUDE_MAX, MercatorProjection.tileYToLatitude(this.tileY, zoomLevel));
double maxLongitude = Math.min(180, MercatorProjection.tileXToLongitude(tileX + 1, zoomLevel));
if (maxLongitude == -180) {
// fix for dateline crossing, where the right tile starts at -180 and causes an invalid bbox
maxLongitude = 180; // depends on control dependency: [if], data = [none]
}
this.boundingBox = new BoundingBox(minLatitude, minLongitude, maxLatitude, maxLongitude); // depends on control dependency: [if], data = [none]
}
return this.boundingBox;
} }
|
public class class_name {
public AllWindowedStream<T, TimeWindow> timeWindowAll(Time size, Time slide) {
if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) {
return windowAll(SlidingProcessingTimeWindows.of(size, slide));
} else {
return windowAll(SlidingEventTimeWindows.of(size, slide));
}
} }
|
public class class_name {
public AllWindowedStream<T, TimeWindow> timeWindowAll(Time size, Time slide) {
if (environment.getStreamTimeCharacteristic() == TimeCharacteristic.ProcessingTime) {
return windowAll(SlidingProcessingTimeWindows.of(size, slide)); // depends on control dependency: [if], data = [none]
} else {
return windowAll(SlidingEventTimeWindows.of(size, slide)); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void marshall(PipelineObject pipelineObject, ProtocolMarshaller protocolMarshaller) {
if (pipelineObject == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(pipelineObject.getId(), ID_BINDING);
protocolMarshaller.marshall(pipelineObject.getName(), NAME_BINDING);
protocolMarshaller.marshall(pipelineObject.getFields(), FIELDS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(PipelineObject pipelineObject, ProtocolMarshaller protocolMarshaller) {
if (pipelineObject == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(pipelineObject.getId(), ID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(pipelineObject.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(pipelineObject.getFields(), FIELDS_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 List<Polyline> toPolylines(CompoundCurve compoundCurve) {
List<Polyline> lines = new ArrayList<>();
MultiPolylineOptions polylines = new MultiPolylineOptions();
for (LineString lineString : compoundCurve.getLineStrings()) {
Polyline polyline = toPolyline(lineString);
lines.add(polyline);
}
return lines;
} }
|
public class class_name {
public List<Polyline> toPolylines(CompoundCurve compoundCurve) {
List<Polyline> lines = new ArrayList<>();
MultiPolylineOptions polylines = new MultiPolylineOptions();
for (LineString lineString : compoundCurve.getLineStrings()) {
Polyline polyline = toPolyline(lineString);
lines.add(polyline); // depends on control dependency: [for], data = [none]
}
return lines;
} }
|
public class class_name {
public void shutDown() {
if (m_offlineIndexThread != null) {
m_offlineIndexThread.shutDown();
}
if (m_offlineHandler != null) {
OpenCms.removeCmsEventListener(m_offlineHandler);
}
Iterator<I_CmsSearchIndex> i = m_indexes.iterator();
while (i.hasNext()) {
I_CmsSearchIndex index = i.next();
index.shutDown();
index = null;
}
m_indexes.clear();
shutDownSolrContainer();
if (CmsLog.INIT.isInfoEnabled()) {
CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SHUTDOWN_MANAGER_0));
}
} }
|
public class class_name {
public void shutDown() {
if (m_offlineIndexThread != null) {
m_offlineIndexThread.shutDown(); // depends on control dependency: [if], data = [none]
}
if (m_offlineHandler != null) {
OpenCms.removeCmsEventListener(m_offlineHandler); // depends on control dependency: [if], data = [(m_offlineHandler]
}
Iterator<I_CmsSearchIndex> i = m_indexes.iterator();
while (i.hasNext()) {
I_CmsSearchIndex index = i.next();
index.shutDown(); // depends on control dependency: [while], data = [none]
index = null; // depends on control dependency: [while], data = [none]
}
m_indexes.clear();
shutDownSolrContainer();
if (CmsLog.INIT.isInfoEnabled()) {
CmsLog.INIT.info(Messages.get().getBundle().key(Messages.INIT_SHUTDOWN_MANAGER_0)); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public List<Decision<Flow<T>>> getAllDecision()
{
List<Decision<Flow<T>>> list = new ArrayList<Decision<Flow<T>>>();
List<Node> nodeList = childNode.get("decision");
for(Node node: nodeList)
{
Decision<Flow<T>> type = new DecisionImpl<Flow<T>>(this, "decision", childNode, node);
list.add(type);
}
return list;
} }
|
public class class_name {
public List<Decision<Flow<T>>> getAllDecision()
{
List<Decision<Flow<T>>> list = new ArrayList<Decision<Flow<T>>>();
List<Node> nodeList = childNode.get("decision");
for(Node node: nodeList)
{
Decision<Flow<T>> type = new DecisionImpl<Flow<T>>(this, "decision", childNode, node);
list.add(type); // depends on control dependency: [for], data = [none]
}
return list;
} }
|
public class class_name {
final Object[] actorProxyFor(final Class<?>[] protocol, final Actor actor, final Mailbox mailbox) {
final Object[] proxies = new Object[protocol.length];
for (int idx = 0; idx < protocol.length; ++idx) {
proxies[idx] = actorProxyFor(protocol[idx], actor, mailbox);
}
return proxies;
} }
|
public class class_name {
final Object[] actorProxyFor(final Class<?>[] protocol, final Actor actor, final Mailbox mailbox) {
final Object[] proxies = new Object[protocol.length];
for (int idx = 0; idx < protocol.length; ++idx) {
proxies[idx] = actorProxyFor(protocol[idx], actor, mailbox); // depends on control dependency: [for], data = [idx]
}
return proxies;
} }
|
public class class_name {
@Override
public boolean canGenerateReport() {
populateSettings();
boolean isCapable = false;
for (Artifact a : getProject().getArtifacts()) {
if (!getArtifactScopeExcluded().passes(a.getScope())) {
isCapable = true;
break;
}
}
return isCapable;
} }
|
public class class_name {
@Override
public boolean canGenerateReport() {
populateSettings();
boolean isCapable = false;
for (Artifact a : getProject().getArtifacts()) {
if (!getArtifactScopeExcluded().passes(a.getScope())) {
isCapable = true; // depends on control dependency: [if], data = [none]
break;
}
}
return isCapable;
} }
|
public class class_name {
public static <T> void copy(T pSource, T pTtarget) {
Method[] vMethods = pSource.getClass().getMethods();
for (int i = 0; i < vMethods.length; i++) {
if (vMethods[i].getDeclaringClass().equals(Object.class)) {
continue;
}
if (vMethods[i].getName().startsWith("get")) {
String vMethodName = "set" + vMethods[i].getName().substring(3);
try {
Method vMethod = pTtarget.getClass().getMethod(vMethodName, vMethods[i].getReturnType());
if (null == vMethod) {
continue;
}
Object vValue = vMethods[i].invoke(pSource);
if (null != vValue) {
vMethod.invoke(pTtarget, vValue);
}
} catch (Exception e) {
LogHelper.error("", "复制对象错误", "ModelHelper.copy", e);
}
}
}
} }
|
public class class_name {
public static <T> void copy(T pSource, T pTtarget) {
Method[] vMethods = pSource.getClass().getMethods();
for (int i = 0; i < vMethods.length; i++) {
if (vMethods[i].getDeclaringClass().equals(Object.class)) {
continue;
}
if (vMethods[i].getName().startsWith("get")) {
String vMethodName = "set" + vMethods[i].getName().substring(3);
try {
Method vMethod = pTtarget.getClass().getMethod(vMethodName, vMethods[i].getReturnType());
if (null == vMethod) {
continue;
}
Object vValue = vMethods[i].invoke(pSource);
if (null != vValue) {
vMethod.invoke(pTtarget, vValue); // depends on control dependency: [if], data = [vValue)]
}
} catch (Exception e) {
LogHelper.error("", "复制对象错误", "ModelHelper.copy", e);
} // depends on control dependency: [catch], data = [none]
}
}
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.