code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
public void marshall(PutLexiconRequest putLexiconRequest, ProtocolMarshaller protocolMarshaller) {
if (putLexiconRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putLexiconRequest.getName(), NAME_BINDING);
protocolMarshaller.marshall(putLexiconRequest.getContent(), CONTENT_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(PutLexiconRequest putLexiconRequest, ProtocolMarshaller protocolMarshaller) {
if (putLexiconRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(putLexiconRequest.getName(), NAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(putLexiconRequest.getContent(), CONTENT_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 JMethod []getDeclaredMethods()
{
SoftReference<JMethod[]> jMethodsRef = _declaredMethodsRef;
JMethod []jMethods = null;
if (jMethodsRef != null) {
jMethods = jMethodsRef.get();
if (jMethods != null)
return jMethods;
}
Method []methods = _class.getDeclaredMethods();
jMethods = new JMethod[methods.length];
for (int i = 0; i < methods.length; i++) {
jMethods[i] = new JMethodWrapper(methods[i], getClassLoader());
}
_declaredMethodsRef = new SoftReference<JMethod[]>(jMethods);
return jMethods;
} }
|
public class class_name {
public JMethod []getDeclaredMethods()
{
SoftReference<JMethod[]> jMethodsRef = _declaredMethodsRef;
JMethod []jMethods = null;
if (jMethodsRef != null) {
jMethods = jMethodsRef.get(); // depends on control dependency: [if], data = [none]
if (jMethods != null)
return jMethods;
}
Method []methods = _class.getDeclaredMethods();
jMethods = new JMethod[methods.length];
for (int i = 0; i < methods.length; i++) {
jMethods[i] = new JMethodWrapper(methods[i], getClassLoader()); // depends on control dependency: [for], data = [i]
}
_declaredMethodsRef = new SoftReference<JMethod[]>(jMethods);
return jMethods;
} }
|
public class class_name {
public AroundInvokeType<MessageDrivenBeanType<T>> getOrCreateAroundInvoke()
{
List<Node> nodeList = childNode.get("around-invoke");
if (nodeList != null && nodeList.size() > 0)
{
return new AroundInvokeTypeImpl<MessageDrivenBeanType<T>>(this, "around-invoke", childNode, nodeList.get(0));
}
return createAroundInvoke();
} }
|
public class class_name {
public AroundInvokeType<MessageDrivenBeanType<T>> getOrCreateAroundInvoke()
{
List<Node> nodeList = childNode.get("around-invoke");
if (nodeList != null && nodeList.size() > 0)
{
return new AroundInvokeTypeImpl<MessageDrivenBeanType<T>>(this, "around-invoke", childNode, nodeList.get(0)); // depends on control dependency: [if], data = [none]
}
return createAroundInvoke();
} }
|
public class class_name {
public static SafeStyleSheet fromConstant(@CompileTimeConstant final String styleSheet) {
if (styleSheet.length() == 0) {
return SafeStyleSheet.EMPTY;
}
for (int i = 0; i < styleSheet.length(); i++) {
if (styleSheet.charAt(i) == '<') {
throw new IllegalArgumentException(
"Forbidden '<' character in style sheet string: " + styleSheet);
}
}
return create(styleSheet);
} }
|
public class class_name {
public static SafeStyleSheet fromConstant(@CompileTimeConstant final String styleSheet) {
if (styleSheet.length() == 0) {
return SafeStyleSheet.EMPTY; // depends on control dependency: [if], data = [none]
}
for (int i = 0; i < styleSheet.length(); i++) {
if (styleSheet.charAt(i) == '<') {
throw new IllegalArgumentException(
"Forbidden '<' character in style sheet string: " + styleSheet);
}
}
return create(styleSheet);
} }
|
public class class_name {
public void setAllowUnsafeSslRenegotiation(boolean allow) {
if (allowUnsafeSslRenegotiation != allow) {
allowUnsafeSslRenegotiation = allow;
setAllowUnsafeSslRenegotiationSystemProperty(allowUnsafeSslRenegotiation);
getConfig().setProperty(ALLOW_UNSAFE_SSL_RENEGOTIATION, allowUnsafeSslRenegotiation);
}
} }
|
public class class_name {
public void setAllowUnsafeSslRenegotiation(boolean allow) {
if (allowUnsafeSslRenegotiation != allow) {
allowUnsafeSslRenegotiation = allow;
// depends on control dependency: [if], data = [none]
setAllowUnsafeSslRenegotiationSystemProperty(allowUnsafeSslRenegotiation);
// depends on control dependency: [if], data = [(allowUnsafeSslRenegotiation]
getConfig().setProperty(ALLOW_UNSAFE_SSL_RENEGOTIATION, allowUnsafeSslRenegotiation);
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void execute(ChannelQueryListener listener) {
addChannelQueryListener(listener);
// Make a local copy to avoid synchronization
Result localResult = result;
// If the query was executed, just call the listener
if (localResult != null) {
listener.queryExecuted(localResult);
} else {
execute();
}
} }
|
public class class_name {
public void execute(ChannelQueryListener listener) {
addChannelQueryListener(listener);
// Make a local copy to avoid synchronization
Result localResult = result;
// If the query was executed, just call the listener
if (localResult != null) {
listener.queryExecuted(localResult); // depends on control dependency: [if], data = [(localResult]
} else {
execute(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public List<MediaRow> getRows(List<Long> ids) {
List<MediaRow> mediaRows = new ArrayList<>();
for (long id : ids) {
UserCustomRow userCustomRow = queryForIdRow(id);
if (userCustomRow != null) {
mediaRows.add(getRow(userCustomRow));
}
}
return mediaRows;
} }
|
public class class_name {
public List<MediaRow> getRows(List<Long> ids) {
List<MediaRow> mediaRows = new ArrayList<>();
for (long id : ids) {
UserCustomRow userCustomRow = queryForIdRow(id);
if (userCustomRow != null) {
mediaRows.add(getRow(userCustomRow)); // depends on control dependency: [if], data = [(userCustomRow]
}
}
return mediaRows;
} }
|
public class class_name {
public boolean isAncestorOf(Concept concept) {
Concept p = concept.parent;
while (p != null) {
if (p == this) {
return true;
} else {
p = p.parent;
}
}
return false;
} }
|
public class class_name {
public boolean isAncestorOf(Concept concept) {
Concept p = concept.parent;
while (p != null) {
if (p == this) {
return true; // depends on control dependency: [if], data = [none]
} else {
p = p.parent; // depends on control dependency: [if], data = [none]
}
}
return false;
} }
|
public class class_name {
protected final void doSleep(double seconds)
{
try
{
long ms = (long)(seconds * 1000l);
Thread.sleep(ms);
}
catch (InterruptedException ie)
{
log.debug("BackgroundProcess thread interuptted.");
}
} }
|
public class class_name {
protected final void doSleep(double seconds)
{
try
{
long ms = (long)(seconds * 1000l);
Thread.sleep(ms);
// depends on control dependency: [try], data = [none]
}
catch (InterruptedException ie)
{
log.debug("BackgroundProcess thread interuptted.");
}
// depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
@Override
protected Collection<Object> elementsOf(Object facetValue) {
int length = Array.getLength(facetValue);
List<Object> list = new ArrayList<>(length);
for (int i = 0; i < length; i++) {
list.add(Array.get(facetValue, i));
}
return list;
} }
|
public class class_name {
@Override
protected Collection<Object> elementsOf(Object facetValue) {
int length = Array.getLength(facetValue);
List<Object> list = new ArrayList<>(length);
for (int i = 0; i < length; i++) {
list.add(Array.get(facetValue, i)); // depends on control dependency: [for], data = [i]
}
return list;
} }
|
public class class_name {
public void sync() {
if (nextTick < 0) {
throw new IllegalStateException("Timer was not started");
}
if (tps <= 0) {
return;
}
try {
// Sleep until the average sleep time is greater than the time remaining until next tick
for (long time1 = getTime(), time2; nextTick - time1 > sleepDurations.average(); time1 = time2) {
Thread.sleep(1);
// Update average sleep time
sleepDurations.add((time2 = getTime()) - time1);
}
// Slowly dampen sleep average if too high to avoid yielding too much
sleepDurations.dampen();
// Yield until the average yield time is greater than the time remaining until next tick
for (long time1 = getTime(), time2; nextTick - time1 > yieldDurations.average(); time1 = time2) {
Thread.yield();
// Update average yield time
yieldDurations.add((time2 = getTime()) - time1);
}
} catch (InterruptedException ignored) {
}
// Schedule next frame, drop frames if it's too late for next frame
nextTick = Math.max(nextTick + 1000000000 / tps, getTime());
} }
|
public class class_name {
public void sync() {
if (nextTick < 0) {
throw new IllegalStateException("Timer was not started");
}
if (tps <= 0) {
return; // depends on control dependency: [if], data = [none]
}
try {
// Sleep until the average sleep time is greater than the time remaining until next tick
for (long time1 = getTime(), time2; nextTick - time1 > sleepDurations.average(); time1 = time2) {
Thread.sleep(1); // depends on control dependency: [for], data = [none]
// Update average sleep time
sleepDurations.add((time2 = getTime()) - time1); // depends on control dependency: [for], data = [time1]
}
// Slowly dampen sleep average if too high to avoid yielding too much
sleepDurations.dampen(); // depends on control dependency: [try], data = [none]
// Yield until the average yield time is greater than the time remaining until next tick
for (long time1 = getTime(), time2; nextTick - time1 > yieldDurations.average(); time1 = time2) {
Thread.yield(); // depends on control dependency: [for], data = [none]
// Update average yield time
yieldDurations.add((time2 = getTime()) - time1); // depends on control dependency: [for], data = [time1]
}
} catch (InterruptedException ignored) {
} // depends on control dependency: [catch], data = [none]
// Schedule next frame, drop frames if it's too late for next frame
nextTick = Math.max(nextTick + 1000000000 / tps, getTime());
} }
|
public class class_name {
public static String getLastTense(Timex3 timex, JCas jcas, Language language) {
RePatternManager rpm = RePatternManager.getInstance(language, false);
String lastTense = "";
// Get the sentence
FSIterator iterSentence = jcas.getAnnotationIndex(Sentence.type).iterator();
Sentence s = new Sentence(jcas);
while (iterSentence.hasNext()) {
s = (Sentence) iterSentence.next();
if ((s.getBegin() <= timex.getBegin())
&& (s.getEnd() >= timex.getEnd())) {
break;
}
}
// Get the tokens
TreeMap<Integer, Token> tmToken = new TreeMap<Integer, Token>();
FSIterator iterToken = jcas.getAnnotationIndex(Token.type).subiterator(s);
while (iterToken.hasNext()) {
Token token = (Token) iterToken.next();
tmToken.put(token.getEnd(), token);
}
// Get the last VERB token
for (Integer tokEnd : tmToken.keySet()) {
if (tokEnd < timex.getBegin()) {
Token token = tmToken.get(tokEnd);
Logger.printDetail("GET LAST TENSE: string:"+token.getCoveredText()+" pos:"+token.getPos());
Logger.printDetail("hmAllRePattern.containsKey(tensePos4PresentFuture):"+rpm.get("tensePos4PresentFuture"));
Logger.printDetail("hmAllRePattern.containsKey(tensePos4Future):"+rpm.get("tensePos4Future"));
Logger.printDetail("hmAllRePattern.containsKey(tensePos4Past):"+rpm.get("tensePos4Past"));
Logger.printDetail("CHECK TOKEN:"+token.getPos());
if (token.getPos() == null) {
}
else if ((rpm.containsKey("tensePos4PresentFuture")) && (token.getPos().matches(rpm.get("tensePos4PresentFuture")))) {
lastTense = "PRESENTFUTURE";
Logger.printDetail("this tense:"+lastTense);
}
else if ((rpm.containsKey("tensePos4Past")) && (token.getPos().matches(rpm.get("tensePos4Past")))) {
lastTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
else if ((rpm.containsKey("tensePos4Future")) && (token.getPos().matches(rpm.get("tensePos4Future")))) {
if (token.getCoveredText().matches(rpm.get("tenseWord4Future"))) {
lastTense = "FUTURE";
Logger.printDetail("this tense:"+lastTense);
}
}
if (token.getCoveredText().equals("since")) {
lastTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
if (token.getCoveredText().equals("depuis")) { // French
lastTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
}
if (lastTense.equals("")) {
if (tokEnd > timex.getEnd()) {
Token token = tmToken.get(tokEnd);
Logger.printDetail("GET NEXT TENSE: string:"+token.getCoveredText()+" pos:"+token.getPos());
Logger.printDetail("hmAllRePattern.containsKey(tensePos4PresentFuture):"+rpm.get("tensePos4PresentFuture"));
Logger.printDetail("hmAllRePattern.containsKey(tensePos4Future):"+rpm.get("tensePos4Future"));
Logger.printDetail("hmAllRePattern.containsKey(tensePos4Past):"+rpm.get("tensePos4Past"));
Logger.printDetail("CHECK TOKEN:"+token.getPos());
if (token.getPos() == null) {
}
else if ((rpm.containsKey("tensePos4PresentFuture")) && (token.getPos().matches(rpm.get("tensePos4PresentFuture")))) {
lastTense = "PRESENTFUTURE";
Logger.printDetail("this tense:"+lastTense);
}
else if ((rpm.containsKey("tensePos4Past")) && (token.getPos().matches(rpm.get("tensePos4Past")))) {
lastTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
else if ((rpm.containsKey("tensePos4Future")) && (token.getPos().matches(rpm.get("tensePos4Future")))) {
if (token.getCoveredText().matches(rpm.get("tenseWord4Future"))) {
lastTense = "FUTURE";
Logger.printDetail("this tense:"+lastTense);
}
}
}
}
}
// check for double POS Constraints (not included in the rule language, yet) TODO
// VHZ VNN and VHZ VNN and VHP VNN and VBP VVN
String prevPos = "";
String longTense = "";
if (lastTense.equals("PRESENTFUTURE")) {
for (Integer tokEnd : tmToken.keySet()) {
if (tokEnd < timex.getBegin()) {
Token token = tmToken.get(tokEnd);
if (("VHZ".equals(prevPos)) || ("VBZ".equals(prevPos)) || ("VHP".equals(prevPos)) || ("VBP".equals(prevPos))
|| (prevPos.equals("VER:pres"))) {
if ("VVN".equals(token.getPos()) || "VER:pper".equals(token.getPos())) {
if ((!(token.getCoveredText().equals("expected"))) && (!(token.getCoveredText().equals("scheduled")))) {
lastTense = "PAST";
longTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
}
}
prevPos = token.getPos();
}
if (longTense.equals("")) {
if (tokEnd > timex.getEnd()) {
Token token = tmToken.get(tokEnd);
if (("VHZ".equals(prevPos)) || ("VBZ".equals(prevPos)) || ("VHP".equals(prevPos)) || ("VBP".equals(prevPos))
|| ("VER:pres".equals(prevPos))) {
if ("VVN".equals(token.getPos()) || "VER:pper".equals(token.getPos())) {
if ((!(token.getCoveredText().equals("expected"))) && (!(token.getCoveredText().equals("scheduled")))) {
lastTense = "PAST";
longTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
}
}
prevPos = token.getPos();
}
}
}
}
// French: VER:pres VER:pper
if (lastTense.equals("PAST")) {
for (Integer tokEnd : tmToken.keySet()) {
if (tokEnd < timex.getBegin()) {
Token token = tmToken.get(tokEnd);
if (("VER:pres".equals(prevPos)) && ("VER:pper".equals(token.getPos()))) {
if (((token.getCoveredText().matches("^prévue?s?$"))) || ((token.getCoveredText().equals("^envisagée?s?$")))) {
lastTense = "FUTURE";
longTense = "FUTURE";
Logger.printDetail("this tense:"+lastTense);
}
}
prevPos = token.getPos();
}
if (longTense.equals("")) {
if (tokEnd > timex.getEnd()) {
Token token = tmToken.get(tokEnd);
if (("VER:pres".equals(prevPos)) && ("VER:pper".equals(token.getPos()))) {
if (((token.getCoveredText().matches("^prévue?s?$"))) || ((token.getCoveredText().equals("^envisagée?s?$")))) {
lastTense = "FUTURE";
longTense = "FUTURE";
Logger.printDetail("this tense:"+lastTense);
}
}
prevPos = token.getPos();
}
}
}
}
Logger.printDetail("TENSE: "+lastTense);
return lastTense;
} }
|
public class class_name {
public static String getLastTense(Timex3 timex, JCas jcas, Language language) {
RePatternManager rpm = RePatternManager.getInstance(language, false);
String lastTense = "";
// Get the sentence
FSIterator iterSentence = jcas.getAnnotationIndex(Sentence.type).iterator();
Sentence s = new Sentence(jcas);
while (iterSentence.hasNext()) {
s = (Sentence) iterSentence.next(); // depends on control dependency: [while], data = [none]
if ((s.getBegin() <= timex.getBegin())
&& (s.getEnd() >= timex.getEnd())) {
break;
}
}
// Get the tokens
TreeMap<Integer, Token> tmToken = new TreeMap<Integer, Token>();
FSIterator iterToken = jcas.getAnnotationIndex(Token.type).subiterator(s);
while (iterToken.hasNext()) {
Token token = (Token) iterToken.next();
tmToken.put(token.getEnd(), token); // depends on control dependency: [while], data = [none]
}
// Get the last VERB token
for (Integer tokEnd : tmToken.keySet()) {
if (tokEnd < timex.getBegin()) {
Token token = tmToken.get(tokEnd);
Logger.printDetail("GET LAST TENSE: string:"+token.getCoveredText()+" pos:"+token.getPos());
Logger.printDetail("hmAllRePattern.containsKey(tensePos4PresentFuture):"+rpm.get("tensePos4PresentFuture"));
Logger.printDetail("hmAllRePattern.containsKey(tensePos4Future):"+rpm.get("tensePos4Future"));
Logger.printDetail("hmAllRePattern.containsKey(tensePos4Past):"+rpm.get("tensePos4Past"));
Logger.printDetail("CHECK TOKEN:"+token.getPos());
if (token.getPos() == null) {
}
else if ((rpm.containsKey("tensePos4PresentFuture")) && (token.getPos().matches(rpm.get("tensePos4PresentFuture")))) {
lastTense = "PRESENTFUTURE";
Logger.printDetail("this tense:"+lastTense);
}
else if ((rpm.containsKey("tensePos4Past")) && (token.getPos().matches(rpm.get("tensePos4Past")))) {
lastTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
else if ((rpm.containsKey("tensePos4Future")) && (token.getPos().matches(rpm.get("tensePos4Future")))) {
if (token.getCoveredText().matches(rpm.get("tenseWord4Future"))) {
lastTense = "FUTURE";
Logger.printDetail("this tense:"+lastTense);
}
}
if (token.getCoveredText().equals("since")) {
lastTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
if (token.getCoveredText().equals("depuis")) { // French
lastTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
}
if (lastTense.equals("")) {
if (tokEnd > timex.getEnd()) {
Token token = tmToken.get(tokEnd);
Logger.printDetail("GET NEXT TENSE: string:"+token.getCoveredText()+" pos:"+token.getPos());
Logger.printDetail("hmAllRePattern.containsKey(tensePos4PresentFuture):"+rpm.get("tensePos4PresentFuture"));
Logger.printDetail("hmAllRePattern.containsKey(tensePos4Future):"+rpm.get("tensePos4Future"));
Logger.printDetail("hmAllRePattern.containsKey(tensePos4Past):"+rpm.get("tensePos4Past"));
Logger.printDetail("CHECK TOKEN:"+token.getPos());
if (token.getPos() == null) {
}
else if ((rpm.containsKey("tensePos4PresentFuture")) && (token.getPos().matches(rpm.get("tensePos4PresentFuture")))) {
lastTense = "PRESENTFUTURE";
Logger.printDetail("this tense:"+lastTense);
}
else if ((rpm.containsKey("tensePos4Past")) && (token.getPos().matches(rpm.get("tensePos4Past")))) {
lastTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
else if ((rpm.containsKey("tensePos4Future")) && (token.getPos().matches(rpm.get("tensePos4Future")))) {
if (token.getCoveredText().matches(rpm.get("tenseWord4Future"))) {
lastTense = "FUTURE";
Logger.printDetail("this tense:"+lastTense);
}
}
}
}
}
// check for double POS Constraints (not included in the rule language, yet) TODO
// VHZ VNN and VHZ VNN and VHP VNN and VBP VVN
String prevPos = "";
String longTense = "";
if (lastTense.equals("PRESENTFUTURE")) {
for (Integer tokEnd : tmToken.keySet()) {
if (tokEnd < timex.getBegin()) {
Token token = tmToken.get(tokEnd);
if (("VHZ".equals(prevPos)) || ("VBZ".equals(prevPos)) || ("VHP".equals(prevPos)) || ("VBP".equals(prevPos))
|| (prevPos.equals("VER:pres"))) {
if ("VVN".equals(token.getPos()) || "VER:pper".equals(token.getPos())) {
if ((!(token.getCoveredText().equals("expected"))) && (!(token.getCoveredText().equals("scheduled")))) {
lastTense = "PAST";
longTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
}
}
prevPos = token.getPos();
}
if (longTense.equals("")) {
if (tokEnd > timex.getEnd()) {
Token token = tmToken.get(tokEnd);
if (("VHZ".equals(prevPos)) || ("VBZ".equals(prevPos)) || ("VHP".equals(prevPos)) || ("VBP".equals(prevPos))
|| ("VER:pres".equals(prevPos))) {
if ("VVN".equals(token.getPos()) || "VER:pper".equals(token.getPos())) {
if ((!(token.getCoveredText().equals("expected"))) && (!(token.getCoveredText().equals("scheduled")))) {
lastTense = "PAST";
longTense = "PAST";
Logger.printDetail("this tense:"+lastTense);
}
}
}
prevPos = token.getPos();
}
}
}
}
// French: VER:pres VER:pper
if (lastTense.equals("PAST")) {
for (Integer tokEnd : tmToken.keySet()) {
if (tokEnd < timex.getBegin()) {
Token token = tmToken.get(tokEnd);
if (("VER:pres".equals(prevPos)) && ("VER:pper".equals(token.getPos()))) {
if (((token.getCoveredText().matches("^prévue?s?$"))) || ((token.getCoveredText().equals("^envisagée?s?$")))) {
lastTense = "FUTURE";
longTense = "FUTURE";
Logger.printDetail("this tense:"+lastTense);
}
}
prevPos = token.getPos();
}
if (longTense.equals("")) {
if (tokEnd > timex.getEnd()) {
Token token = tmToken.get(tokEnd);
if (("VER:pres".equals(prevPos)) && ("VER:pper".equals(token.getPos()))) {
if (((token.getCoveredText().matches("^prévue?s?$"))) || ((token.getCoveredText().equals("^envisagée?s?$")))) {
lastTense = "FUTURE";
longTense = "FUTURE";
Logger.printDetail("this tense:"+lastTense);
}
}
prevPos = token.getPos();
}
}
}
}
Logger.printDetail("TENSE: "+lastTense);
return lastTense;
} }
|
public class class_name {
public List<String> getTemplateNames() {
final List<TemplateData> templateStack = this.context.getTemplateStack();
final List<String> templateNameStack = new ArrayList<String>(templateStack.size());
for (final TemplateData templateData : templateStack) {
templateNameStack.add(templateData.getTemplate());
}
return templateNameStack;
} }
|
public class class_name {
public List<String> getTemplateNames() {
final List<TemplateData> templateStack = this.context.getTemplateStack();
final List<String> templateNameStack = new ArrayList<String>(templateStack.size());
for (final TemplateData templateData : templateStack) {
templateNameStack.add(templateData.getTemplate()); // depends on control dependency: [for], data = [templateData]
}
return templateNameStack;
} }
|
public class class_name {
private Collection<Tuple> getCombinedTuples( List<VarDef> combinedVars, Collection<Tuple> tuples)
{
// Apply any once-only constraints.
Set<Tuple> onceTuples = getOnceTupleDefs( combinedVars);
if( !onceTuples.isEmpty())
{
for( Tuple tuple : tuples)
{
tuple.setOnce( onceTuples.contains( tuple));
}
}
return tuples;
} }
|
public class class_name {
private Collection<Tuple> getCombinedTuples( List<VarDef> combinedVars, Collection<Tuple> tuples)
{
// Apply any once-only constraints.
Set<Tuple> onceTuples = getOnceTupleDefs( combinedVars);
if( !onceTuples.isEmpty())
{
for( Tuple tuple : tuples)
{
tuple.setOnce( onceTuples.contains( tuple)); // depends on control dependency: [for], data = [tuple]
}
}
return tuples;
} }
|
public class class_name {
private boolean isParentSelected() {
if (rootParent instanceof JFrame) {
return ((JFrame) rootParent).isActive();
} else if (rootParent instanceof JDialog) {
return ((JDialog) rootParent).isActive();
} else {
return true;
}
} }
|
public class class_name {
private boolean isParentSelected() {
if (rootParent instanceof JFrame) {
return ((JFrame) rootParent).isActive();
// depends on control dependency: [if], data = [none]
} else if (rootParent instanceof JDialog) {
return ((JDialog) rootParent).isActive();
// depends on control dependency: [if], data = [none]
} else {
return true;
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
@Override
public String[] doDeserializeArray( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) {
FastArrayString jsArray = new FastArrayString();
reader.beginArray();
while ( JsonToken.END_ARRAY != reader.peek() ) {
if ( JsonToken.NULL == reader.peek() ) {
reader.skipValue();
jsArray.push( null );
} else {
jsArray.push( reader.nextString() );
}
}
reader.endArray();
return jsArray.reinterpretCast();
} }
|
public class class_name {
@Override
public String[] doDeserializeArray( JsonReader reader, JsonDeserializationContext ctx, JsonDeserializerParameters params ) {
FastArrayString jsArray = new FastArrayString();
reader.beginArray();
while ( JsonToken.END_ARRAY != reader.peek() ) {
if ( JsonToken.NULL == reader.peek() ) {
reader.skipValue(); // depends on control dependency: [if], data = [none]
jsArray.push( null ); // depends on control dependency: [if], data = [none]
} else {
jsArray.push( reader.nextString() ); // depends on control dependency: [if], data = [none]
}
}
reader.endArray();
return jsArray.reinterpretCast();
} }
|
public class class_name {
public static String formatContentValueForDiffTable(
CmsObject cms,
CmsElementComparison comparison,
String origValue) {
String result = CmsStringUtil.substitute(CmsStringUtil.trimToSize(origValue, 60), "\n", "");
// formatting DateTime
if (comparison instanceof CmsXmlContentElementComparison) {
if (((CmsXmlContentElementComparison)comparison).getType().equals(CmsXmlDateTimeValue.TYPE_NAME)) {
if (CmsStringUtil.isNotEmpty(result)) {
result = CmsDateUtil.getDateTime(
new Date(Long.parseLong(result)),
DateFormat.SHORT,
cms.getRequestContext().getLocale());
}
}
}
return result;
} }
|
public class class_name {
public static String formatContentValueForDiffTable(
CmsObject cms,
CmsElementComparison comparison,
String origValue) {
String result = CmsStringUtil.substitute(CmsStringUtil.trimToSize(origValue, 60), "\n", "");
// formatting DateTime
if (comparison instanceof CmsXmlContentElementComparison) {
if (((CmsXmlContentElementComparison)comparison).getType().equals(CmsXmlDateTimeValue.TYPE_NAME)) {
if (CmsStringUtil.isNotEmpty(result)) {
result = CmsDateUtil.getDateTime(
new Date(Long.parseLong(result)),
DateFormat.SHORT,
cms.getRequestContext().getLocale()); // depends on control dependency: [if], data = [none]
}
}
}
return result;
} }
|
public class class_name {
public String nameInCurrentModel(DMNNode node) {
if (node.getModelNamespace().equals(this.getNamespace())) {
return node.getName();
} else {
Optional<String> lookupAlias = getImportAliasFor(node.getModelNamespace(), node.getModelName());
if (lookupAlias.isPresent()) {
return lookupAlias.get() + "." + node.getName();
} else {
return null;
}
}
} }
|
public class class_name {
public String nameInCurrentModel(DMNNode node) {
if (node.getModelNamespace().equals(this.getNamespace())) {
return node.getName(); // depends on control dependency: [if], data = [none]
} else {
Optional<String> lookupAlias = getImportAliasFor(node.getModelNamespace(), node.getModelName());
if (lookupAlias.isPresent()) {
return lookupAlias.get() + "." + node.getName(); // depends on control dependency: [if], data = [none]
} else {
return null; // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
protected static ICalParameters handleTzidParameter(ICalProperty property, boolean hasTime, WriteContext context) {
ICalParameters parameters = property.getParameters();
//date values don't have timezones
if (!hasTime) {
return parameters;
}
//vCal doesn't use the TZID parameter
if (context.getVersion() == ICalVersion.V1_0) {
return parameters;
}
//floating values don't have timezones
TimezoneInfo tzinfo = context.getTimezoneInfo();
boolean floating = tzinfo.isFloating(property);
if (floating) {
return parameters;
}
TimezoneAssignment tz;
TimezoneAssignment globalTz = context.getGlobalTimezone();
if (globalTz == null) {
tz = tzinfo.getTimezoneToWriteIn(property);
if (tz == null) {
//write in UTC
return parameters;
}
} else {
tz = globalTz;
}
String tzid = null;
VTimezone component = tz.getComponent();
String globalId = tz.getGlobalId();
if (component != null) {
tzid = ValuedProperty.getValue(component.getTimezoneId());
} else if (globalId != null) {
tzid = '/' + globalId;
}
if (tzid == null) {
//should never happen
tzid = tz.getTimeZone().getID();
}
parameters = new ICalParameters(parameters);
parameters.setTimezoneId(tzid);
return parameters;
} }
|
public class class_name {
protected static ICalParameters handleTzidParameter(ICalProperty property, boolean hasTime, WriteContext context) {
ICalParameters parameters = property.getParameters();
//date values don't have timezones
if (!hasTime) {
return parameters; // depends on control dependency: [if], data = [none]
}
//vCal doesn't use the TZID parameter
if (context.getVersion() == ICalVersion.V1_0) {
return parameters; // depends on control dependency: [if], data = [none]
}
//floating values don't have timezones
TimezoneInfo tzinfo = context.getTimezoneInfo();
boolean floating = tzinfo.isFloating(property);
if (floating) {
return parameters; // depends on control dependency: [if], data = [none]
}
TimezoneAssignment tz;
TimezoneAssignment globalTz = context.getGlobalTimezone();
if (globalTz == null) {
tz = tzinfo.getTimezoneToWriteIn(property); // depends on control dependency: [if], data = [none]
if (tz == null) {
//write in UTC
return parameters; // depends on control dependency: [if], data = [none]
}
} else {
tz = globalTz; // depends on control dependency: [if], data = [none]
}
String tzid = null;
VTimezone component = tz.getComponent();
String globalId = tz.getGlobalId();
if (component != null) {
tzid = ValuedProperty.getValue(component.getTimezoneId()); // depends on control dependency: [if], data = [(component]
} else if (globalId != null) {
tzid = '/' + globalId; // depends on control dependency: [if], data = [none]
}
if (tzid == null) {
//should never happen
tzid = tz.getTimeZone().getID(); // depends on control dependency: [if], data = [none]
}
parameters = new ICalParameters(parameters);
parameters.setTimezoneId(tzid);
return parameters;
} }
|
public class class_name {
public static boolean isWhitespace(String str) {
if (str == null) {
return false;
}
int sz = str.length();
for (int i = 0; i < sz; i++) {
if ((Character.isWhitespace(str.charAt(i)) == false)) {
return false;
}
}
return true;
} }
|
public class class_name {
public static boolean isWhitespace(String str) {
if (str == null) {
return false; // depends on control dependency: [if], data = [none]
}
int sz = str.length();
for (int i = 0; i < sz; i++) {
if ((Character.isWhitespace(str.charAt(i)) == false)) {
return false; // depends on control dependency: [if], data = [none]
}
}
return true;
} }
|
public class class_name {
void addTransaction(Transaction t, boolean runSanityChecks) {
unCacheTransactions();
if (transactions == null) {
transactions = new ArrayList<>();
}
t.setParent(this);
if (runSanityChecks && transactions.size() == 0 && !t.isCoinBase())
throw new RuntimeException("Attempted to add a non-coinbase transaction as the first transaction: " + t);
else if (runSanityChecks && transactions.size() > 0 && t.isCoinBase())
throw new RuntimeException("Attempted to add a coinbase transaction when there already is one: " + t);
transactions.add(t);
adjustLength(transactions.size(), t.length);
// Force a recalculation next time the values are needed.
merkleRoot = null;
hash = null;
} }
|
public class class_name {
void addTransaction(Transaction t, boolean runSanityChecks) {
unCacheTransactions();
if (transactions == null) {
transactions = new ArrayList<>(); // depends on control dependency: [if], data = [none]
}
t.setParent(this);
if (runSanityChecks && transactions.size() == 0 && !t.isCoinBase())
throw new RuntimeException("Attempted to add a non-coinbase transaction as the first transaction: " + t);
else if (runSanityChecks && transactions.size() > 0 && t.isCoinBase())
throw new RuntimeException("Attempted to add a coinbase transaction when there already is one: " + t);
transactions.add(t);
adjustLength(transactions.size(), t.length);
// Force a recalculation next time the values are needed.
merkleRoot = null;
hash = null;
} }
|
public class class_name {
public OServerUserConfiguration getUser(final String username) {
OServerUserConfiguration userCfg = null;
if (getServerConfig() != null) {
userCfg = getServerConfig().getUser(username);
}
return userCfg;
} }
|
public class class_name {
public OServerUserConfiguration getUser(final String username) {
OServerUserConfiguration userCfg = null;
if (getServerConfig() != null) {
userCfg = getServerConfig().getUser(username); // depends on control dependency: [if], data = [none]
}
return userCfg;
} }
|
public class class_name {
@Override
public String draw() {
final String[] row = new String[data.length];
for (int i = 0; i < data.length; i++) {
row[i] = Util.pad(data[i], ' ', getTable().getColumnWidth(i), getTable().getOrientation(i));
}
return Util.combine(new String(new char[]{AbstractTabularComponent.BORDER}), SPACE, Util.implode(Util.combine(SPACE, new String(new char[]{AbstractTabularComponent.BORDER}), SPACE), row), SPACE, new String(new char[]{AbstractTabularComponent.BORDER}), NEWLINE);
} }
|
public class class_name {
@Override
public String draw() {
final String[] row = new String[data.length];
for (int i = 0; i < data.length; i++) {
row[i] = Util.pad(data[i], ' ', getTable().getColumnWidth(i), getTable().getOrientation(i)); // depends on control dependency: [for], data = [i]
}
return Util.combine(new String(new char[]{AbstractTabularComponent.BORDER}), SPACE, Util.implode(Util.combine(SPACE, new String(new char[]{AbstractTabularComponent.BORDER}), SPACE), row), SPACE, new String(new char[]{AbstractTabularComponent.BORDER}), NEWLINE);
} }
|
public class class_name {
public static void transaction(Runnable action, boolean readOnly) {
Ctx ctx = Ctxs.get();
boolean newContext = ctx == null;
if (newContext) {
ctx = Ctxs.open("transaction");
}
try {
EntityManager em = ctx.persister();
JPA.with(em).transactional(action, readOnly);
} finally {
if (newContext) {
Ctxs.close();
}
}
} }
|
public class class_name {
public static void transaction(Runnable action, boolean readOnly) {
Ctx ctx = Ctxs.get();
boolean newContext = ctx == null;
if (newContext) {
ctx = Ctxs.open("transaction"); // depends on control dependency: [if], data = [none]
}
try {
EntityManager em = ctx.persister();
JPA.with(em).transactional(action, readOnly); // depends on control dependency: [try], data = [none]
} finally {
if (newContext) {
Ctxs.close(); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
private static Constructor getConstructor()
{
if (_tc.isEntryEnabled()) SibTr.entry(_tc, "getConstructor");
if (_constructor == null)
{
try
{
Class clazz = Class.forName("com.ibm.ws.sib.exitpoint.systemcontext.SystemContextImpl");
_constructor = clazz.getConstructor(new Class[] {JsApiMessage.class});
}
catch (Exception e)
{
com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.exitpoint.systemcontext.SystemContextFactory.getConstructor", "66");
NoSuchMethodError newE = new NoSuchMethodError();
newE.initCause(e);
if (_tc.isEntryEnabled()) SibTr.exit(_tc, "getConstructor", newE);
throw newE;
}
}
if (_tc.isEntryEnabled()) SibTr.exit(_tc, "getConstructor", _constructor);
return _constructor;
} }
|
public class class_name {
private static Constructor getConstructor()
{
if (_tc.isEntryEnabled()) SibTr.entry(_tc, "getConstructor");
if (_constructor == null)
{
try
{
Class clazz = Class.forName("com.ibm.ws.sib.exitpoint.systemcontext.SystemContextImpl");
_constructor = clazz.getConstructor(new Class[] {JsApiMessage.class}); // depends on control dependency: [try], data = [none]
}
catch (Exception e)
{
com.ibm.ws.ffdc.FFDCFilter.processException(e, "com.ibm.ws.sib.exitpoint.systemcontext.SystemContextFactory.getConstructor", "66");
NoSuchMethodError newE = new NoSuchMethodError();
newE.initCause(e);
if (_tc.isEntryEnabled()) SibTr.exit(_tc, "getConstructor", newE);
throw newE;
} // depends on control dependency: [catch], data = [none]
}
if (_tc.isEntryEnabled()) SibTr.exit(_tc, "getConstructor", _constructor);
return _constructor;
} }
|
public class class_name {
public static String encodeByteArray(byte[] byteArray) {
try {
return new String(Base64.encodeBase64(byteArray), UTF8_ENCODING);
} catch(UnsupportedEncodingException e) {
throw new MappingException("Could not encode byteArray to UTF8 encoding", e);
}
} }
|
public class class_name {
public static String encodeByteArray(byte[] byteArray) {
try {
return new String(Base64.encodeBase64(byteArray), UTF8_ENCODING); // depends on control dependency: [try], data = [none]
} catch(UnsupportedEncodingException e) {
throw new MappingException("Could not encode byteArray to UTF8 encoding", e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private void buildCoverTree() {
ArrayList<DistanceSet> pointSet = new ArrayList<>();
ArrayList<DistanceSet> consumedSet = new ArrayList<>();
E point = data[0];
int idx = 0;
double maxDist = -1;
for (int i = 1; i < data.length; i++) {
DistanceSet set = new DistanceSet(i);
double dist = distance.d(point, data[i]);
set.dist.add(dist);
pointSet.add(set);
if (dist > maxDist) {
maxDist = dist;
}
}
root = batchInsert(idx, getScale(maxDist), getScale(maxDist), pointSet, consumedSet);
} }
|
public class class_name {
private void buildCoverTree() {
ArrayList<DistanceSet> pointSet = new ArrayList<>();
ArrayList<DistanceSet> consumedSet = new ArrayList<>();
E point = data[0];
int idx = 0;
double maxDist = -1;
for (int i = 1; i < data.length; i++) {
DistanceSet set = new DistanceSet(i);
double dist = distance.d(point, data[i]);
set.dist.add(dist); // depends on control dependency: [for], data = [none]
pointSet.add(set); // depends on control dependency: [for], data = [none]
if (dist > maxDist) {
maxDist = dist; // depends on control dependency: [if], data = [none]
}
}
root = batchInsert(idx, getScale(maxDist), getScale(maxDist), pointSet, consumedSet);
} }
|
public class class_name {
@XmlTransient
public String combineStringArrayWith(
List<String> listToCombineParam,
String separatorCharsParam) {
String returnValue = UtilGlobal.EMPTY;
int lengthOfSepChars = (separatorCharsParam == null) ? 0 :
separatorCharsParam.length();
if(listToCombineParam != null && !listToCombineParam.isEmpty()) {
StringBuffer concatBuffer = new StringBuffer();
for(String toAdd : listToCombineParam) {
concatBuffer.append(toAdd);
concatBuffer.append(separatorCharsParam);
}
String concatString = concatBuffer.toString();
returnValue = concatString.substring(0, concatString.length() - lengthOfSepChars);
}
return returnValue;
} }
|
public class class_name {
@XmlTransient
public String combineStringArrayWith(
List<String> listToCombineParam,
String separatorCharsParam) {
String returnValue = UtilGlobal.EMPTY;
int lengthOfSepChars = (separatorCharsParam == null) ? 0 :
separatorCharsParam.length();
if(listToCombineParam != null && !listToCombineParam.isEmpty()) {
StringBuffer concatBuffer = new StringBuffer();
for(String toAdd : listToCombineParam) {
concatBuffer.append(toAdd); // depends on control dependency: [for], data = [toAdd]
concatBuffer.append(separatorCharsParam); // depends on control dependency: [for], data = [none]
}
String concatString = concatBuffer.toString();
returnValue = concatString.substring(0, concatString.length() - lengthOfSepChars); // depends on control dependency: [if], data = [none]
}
return returnValue;
} }
|
public class class_name {
public static <A extends Annotation> A getAnnotation(final Class<?> c, final Class<A> type)
{
A result = null;
if (c != null)
{
result = getAnnotationFromType(c, type);
if (result == null)
{
Class<?> superclass = c.getSuperclass();
while (superclass != null)
{
result = getAnnotation(superclass, type);
if (result != null)
break;
superclass = superclass.getSuperclass();
}
}
if (result == null)
{
Class<?>[] interfaces = c.getInterfaces();
for (Class<?> i : interfaces)
{
result = getAnnotation(i, type);
if (result != null)
break;
}
}
}
return result;
} }
|
public class class_name {
public static <A extends Annotation> A getAnnotation(final Class<?> c, final Class<A> type)
{
A result = null;
if (c != null)
{
result = getAnnotationFromType(c, type); // depends on control dependency: [if], data = [(c]
if (result == null)
{
Class<?> superclass = c.getSuperclass();
while (superclass != null)
{
result = getAnnotation(superclass, type); // depends on control dependency: [while], data = [(superclass]
if (result != null)
break;
superclass = superclass.getSuperclass(); // depends on control dependency: [while], data = [none]
}
}
if (result == null)
{
Class<?>[] interfaces = c.getInterfaces();
for (Class<?> i : interfaces)
{
result = getAnnotation(i, type); // depends on control dependency: [for], data = [i]
if (result != null)
break;
}
}
}
return result;
} }
|
public class class_name {
public boolean doProcessing(List<JCCompilationUnit> roots,
List<ClassSymbol> classSymbols,
Iterable<? extends PackageSymbol> pckSymbols,
Log.DeferredDiagnosticHandler deferredDiagnosticHandler) {
final Set<JCCompilationUnit> treesToClean =
Collections.newSetFromMap(new IdentityHashMap<JCCompilationUnit, Boolean>());
//fill already attributed implicit trees:
for (Env<AttrContext> env : enter.getEnvs()) {
treesToClean.add(env.toplevel);
}
Set<PackageSymbol> specifiedPackages = new LinkedHashSet<>();
for (PackageSymbol psym : pckSymbols)
specifiedPackages.add(psym);
this.specifiedPackages = Collections.unmodifiableSet(specifiedPackages);
Round round = new Round(roots, classSymbols, treesToClean, deferredDiagnosticHandler);
boolean errorStatus;
boolean moreToDo;
do {
// Run processors for round n
round.run(false, false);
// Processors for round n have run to completion.
// Check for errors and whether there is more work to do.
errorStatus = round.unrecoverableError();
moreToDo = moreToDo();
round.showDiagnostics(errorStatus || showResolveErrors);
// Set up next round.
// Copy mutable collections returned from filer.
round = round.next(
new LinkedHashSet<>(filer.getGeneratedSourceFileObjects()),
new LinkedHashMap<>(filer.getGeneratedClasses()));
// Check for errors during setup.
if (round.unrecoverableError())
errorStatus = true;
} while (moreToDo && !errorStatus);
// run last round
round.run(true, errorStatus);
round.showDiagnostics(true);
filer.warnIfUnclosedFiles();
warnIfUnmatchedOptions();
/*
* If an annotation processor raises an error in a round,
* that round runs to completion and one last round occurs.
* The last round may also occur because no more source or
* class files have been generated. Therefore, if an error
* was raised on either of the last *two* rounds, the compile
* should exit with a nonzero exit code. The current value of
* errorStatus holds whether or not an error was raised on the
* second to last round; errorRaised() gives the error status
* of the last round.
*/
if (messager.errorRaised()
|| werror && round.warningCount() > 0 && round.errorCount() > 0)
errorStatus = true;
Set<JavaFileObject> newSourceFiles =
new LinkedHashSet<>(filer.getGeneratedSourceFileObjects());
roots = round.roots;
errorStatus = errorStatus || (compiler.errorCount() > 0);
round.finalCompiler();
if (newSourceFiles.size() > 0)
roots = roots.appendList(compiler.parseFiles(newSourceFiles));
errorStatus = errorStatus || (compiler.errorCount() > 0);
// Free resources
this.close();
if (errorStatus && compiler.errorCount() == 0) {
compiler.log.nerrors++;
}
compiler.enterTreesIfNeeded(roots);
if (!taskListener.isEmpty())
taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING));
return true;
} }
|
public class class_name {
public boolean doProcessing(List<JCCompilationUnit> roots,
List<ClassSymbol> classSymbols,
Iterable<? extends PackageSymbol> pckSymbols,
Log.DeferredDiagnosticHandler deferredDiagnosticHandler) {
final Set<JCCompilationUnit> treesToClean =
Collections.newSetFromMap(new IdentityHashMap<JCCompilationUnit, Boolean>());
//fill already attributed implicit trees:
for (Env<AttrContext> env : enter.getEnvs()) {
treesToClean.add(env.toplevel); // depends on control dependency: [for], data = [env]
}
Set<PackageSymbol> specifiedPackages = new LinkedHashSet<>();
for (PackageSymbol psym : pckSymbols)
specifiedPackages.add(psym);
this.specifiedPackages = Collections.unmodifiableSet(specifiedPackages);
Round round = new Round(roots, classSymbols, treesToClean, deferredDiagnosticHandler);
boolean errorStatus;
boolean moreToDo;
do {
// Run processors for round n
round.run(false, false);
// Processors for round n have run to completion.
// Check for errors and whether there is more work to do.
errorStatus = round.unrecoverableError();
moreToDo = moreToDo();
round.showDiagnostics(errorStatus || showResolveErrors);
// Set up next round.
// Copy mutable collections returned from filer.
round = round.next(
new LinkedHashSet<>(filer.getGeneratedSourceFileObjects()),
new LinkedHashMap<>(filer.getGeneratedClasses()));
// Check for errors during setup.
if (round.unrecoverableError())
errorStatus = true;
} while (moreToDo && !errorStatus);
// run last round
round.run(true, errorStatus);
round.showDiagnostics(true);
filer.warnIfUnclosedFiles();
warnIfUnmatchedOptions();
/*
* If an annotation processor raises an error in a round,
* that round runs to completion and one last round occurs.
* The last round may also occur because no more source or
* class files have been generated. Therefore, if an error
* was raised on either of the last *two* rounds, the compile
* should exit with a nonzero exit code. The current value of
* errorStatus holds whether or not an error was raised on the
* second to last round; errorRaised() gives the error status
* of the last round.
*/
if (messager.errorRaised()
|| werror && round.warningCount() > 0 && round.errorCount() > 0)
errorStatus = true;
Set<JavaFileObject> newSourceFiles =
new LinkedHashSet<>(filer.getGeneratedSourceFileObjects());
roots = round.roots;
errorStatus = errorStatus || (compiler.errorCount() > 0);
round.finalCompiler();
if (newSourceFiles.size() > 0)
roots = roots.appendList(compiler.parseFiles(newSourceFiles));
errorStatus = errorStatus || (compiler.errorCount() > 0);
// Free resources
this.close();
if (errorStatus && compiler.errorCount() == 0) {
compiler.log.nerrors++; // depends on control dependency: [if], data = [none]
}
compiler.enterTreesIfNeeded(roots);
if (!taskListener.isEmpty())
taskListener.finished(new TaskEvent(TaskEvent.Kind.ANNOTATION_PROCESSING));
return true;
} }
|
public class class_name {
public void marshall(ExecutionConfiguration executionConfiguration, ProtocolMarshaller protocolMarshaller) {
if (executionConfiguration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(executionConfiguration.getJobTimeoutMinutes(), JOBTIMEOUTMINUTES_BINDING);
protocolMarshaller.marshall(executionConfiguration.getAccountsCleanup(), ACCOUNTSCLEANUP_BINDING);
protocolMarshaller.marshall(executionConfiguration.getAppPackagesCleanup(), APPPACKAGESCLEANUP_BINDING);
protocolMarshaller.marshall(executionConfiguration.getVideoCapture(), VIDEOCAPTURE_BINDING);
protocolMarshaller.marshall(executionConfiguration.getSkipAppResign(), SKIPAPPRESIGN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(ExecutionConfiguration executionConfiguration, ProtocolMarshaller protocolMarshaller) {
if (executionConfiguration == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(executionConfiguration.getJobTimeoutMinutes(), JOBTIMEOUTMINUTES_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(executionConfiguration.getAccountsCleanup(), ACCOUNTSCLEANUP_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(executionConfiguration.getAppPackagesCleanup(), APPPACKAGESCLEANUP_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(executionConfiguration.getVideoCapture(), VIDEOCAPTURE_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(executionConfiguration.getSkipAppResign(), SKIPAPPRESIGN_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static ISREInstall[] getSREInstalls() {
initializeSREs();
LOCK.lock();
try {
return ALL_SRE_INSTALLS.values().toArray(new ISREInstall[ALL_SRE_INSTALLS.size()]);
} finally {
LOCK.unlock();
}
} }
|
public class class_name {
public static ISREInstall[] getSREInstalls() {
initializeSREs();
LOCK.lock();
try {
return ALL_SRE_INSTALLS.values().toArray(new ISREInstall[ALL_SRE_INSTALLS.size()]); // depends on control dependency: [try], data = [none]
} finally {
LOCK.unlock();
}
} }
|
public class class_name {
public static File getFile(Class resourceClass, String fileName) {
try {
return new File(URLDecoder.decode(resourceClass.getResource(fileName).getFile(), "UTF-8"));
} catch (UnsupportedEncodingException e) {
return new File(resourceClass.getResource(fileName).getFile());
}
} }
|
public class class_name {
public static File getFile(Class resourceClass, String fileName) {
try {
return new File(URLDecoder.decode(resourceClass.getResource(fileName).getFile(), "UTF-8")); // depends on control dependency: [try], data = [none]
} catch (UnsupportedEncodingException e) {
return new File(resourceClass.getResource(fileName).getFile());
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public Integer getQuantity(String isbn) {
Integer quantity = null;
if (isbn != null) {
synchronized (librarian) {
quantity = isbns_to_quantities.get(isbn);
}
}
return quantity != null ? quantity : ZERO;
} }
|
public class class_name {
public Integer getQuantity(String isbn) {
Integer quantity = null;
if (isbn != null) {
synchronized (librarian) { // depends on control dependency: [if], data = [none]
quantity = isbns_to_quantities.get(isbn);
}
}
return quantity != null ? quantity : ZERO;
} }
|
public class class_name {
public void markAsAlive(Node node) {
if (!NodeStatus.ALIVE.equals(node.getStatus())) {
socketToNodeMap.get(Utils.toKey(node)).markAsAlive();
sendEvent(node, NodeEventType.MARKED_AS_ALIVE);
}
} }
|
public class class_name {
public void markAsAlive(Node node) {
if (!NodeStatus.ALIVE.equals(node.getStatus())) {
socketToNodeMap.get(Utils.toKey(node)).markAsAlive(); // depends on control dependency: [if], data = [none]
sendEvent(node, NodeEventType.MARKED_AS_ALIVE); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
@Deprecated
protected final boolean areAttributesComparable(Element control, Element test) {
String controlValue, testValue;
Attr[] qualifyingAttributes;
NamedNodeMap namedNodeMap = control.getAttributes();
if (matchesAllAttributes(qualifyingAttrNames)) {
qualifyingAttributes = new Attr[namedNodeMap.getLength()];
for (int n=0; n < qualifyingAttributes.length; ++n) {
qualifyingAttributes[n] = (Attr) namedNodeMap.item(n);
}
} else {
qualifyingAttributes = new Attr[qualifyingAttrNames.length];
for (int n=0; n < qualifyingAttrNames.length; ++n) {
qualifyingAttributes[n] = (Attr) namedNodeMap.getNamedItem(qualifyingAttrNames[n]);
}
}
String nsURI, name;
for (int i=0; i < qualifyingAttributes.length; ++i) {
if (qualifyingAttributes[i] != null) {
nsURI = qualifyingAttributes[i].getNamespaceURI();
controlValue = qualifyingAttributes[i].getNodeValue();
name = qualifyingAttributes[i].getName();
} else {
// cannot be "*" case
nsURI = controlValue = "";
name = qualifyingAttrNames[i];
}
if (nsURI == null || nsURI.length() == 0) {
testValue = test.getAttribute(name);
} else {
testValue = test.getAttributeNS(nsURI, qualifyingAttributes[i].getLocalName());
}
if (controlValue == null) {
if (testValue != null) {
return false;
}
} else {
if (!controlValue.equals(testValue)) {
return false;
}
}
}
return true;
} }
|
public class class_name {
@Deprecated
protected final boolean areAttributesComparable(Element control, Element test) {
String controlValue, testValue;
Attr[] qualifyingAttributes;
NamedNodeMap namedNodeMap = control.getAttributes();
if (matchesAllAttributes(qualifyingAttrNames)) {
qualifyingAttributes = new Attr[namedNodeMap.getLength()]; // depends on control dependency: [if], data = [none]
for (int n=0; n < qualifyingAttributes.length; ++n) {
qualifyingAttributes[n] = (Attr) namedNodeMap.item(n); // depends on control dependency: [for], data = [n]
}
} else {
qualifyingAttributes = new Attr[qualifyingAttrNames.length]; // depends on control dependency: [if], data = [none]
for (int n=0; n < qualifyingAttrNames.length; ++n) {
qualifyingAttributes[n] = (Attr) namedNodeMap.getNamedItem(qualifyingAttrNames[n]); // depends on control dependency: [for], data = [n]
}
}
String nsURI, name;
for (int i=0; i < qualifyingAttributes.length; ++i) {
if (qualifyingAttributes[i] != null) {
nsURI = qualifyingAttributes[i].getNamespaceURI(); // depends on control dependency: [if], data = [none]
controlValue = qualifyingAttributes[i].getNodeValue(); // depends on control dependency: [if], data = [none]
name = qualifyingAttributes[i].getName(); // depends on control dependency: [if], data = [none]
} else {
// cannot be "*" case
nsURI = controlValue = ""; // depends on control dependency: [if], data = [none]
name = qualifyingAttrNames[i]; // depends on control dependency: [if], data = [none]
}
if (nsURI == null || nsURI.length() == 0) {
testValue = test.getAttribute(name); // depends on control dependency: [if], data = [none]
} else {
testValue = test.getAttributeNS(nsURI, qualifyingAttributes[i].getLocalName()); // depends on control dependency: [if], data = [(nsURI]
}
if (controlValue == null) {
if (testValue != null) {
return false; // depends on control dependency: [if], data = [none]
}
} else {
if (!controlValue.equals(testValue)) {
return false; // depends on control dependency: [if], data = [none]
}
}
}
return true;
} }
|
public class class_name {
@Override
public boolean containsKey(K key) {
readLock.lock();
try {
// 不存在或已移除
final CacheObj<K, V> co = cacheMap.get(key);
if (co == null) {
return false;
}
if (false == co.isExpired()) {
// 命中
return true;
}
} finally {
readLock.unlock();
}
// 过期
remove(key, true);
return false;
} }
|
public class class_name {
@Override
public boolean containsKey(K key) {
readLock.lock();
try {
// 不存在或已移除
final CacheObj<K, V> co = cacheMap.get(key);
if (co == null) {
return false; // depends on control dependency: [if], data = [none]
}
if (false == co.isExpired()) {
// 命中
return true; // depends on control dependency: [if], data = [none]
}
} finally {
readLock.unlock();
}
// 过期
remove(key, true);
return false;
} }
|
public class class_name {
public OptionalInt maxByDouble(IntToDoubleFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, i) -> {
double key = keyExtractor.applyAsDouble(i);
if (!box.b || Double.compare(box.d, key) < 0) {
box.b = true;
box.d = key;
box.i = i;
}
}, PrimitiveBox.MAX_DOUBLE).asInt();
} }
|
public class class_name {
public OptionalInt maxByDouble(IntToDoubleFunction keyExtractor) {
return collect(PrimitiveBox::new, (box, i) -> {
double key = keyExtractor.applyAsDouble(i);
if (!box.b || Double.compare(box.d, key) < 0) {
box.b = true; // depends on control dependency: [if], data = [none]
box.d = key; // depends on control dependency: [if], data = [none]
box.i = i; // depends on control dependency: [if], data = [none]
}
}, PrimitiveBox.MAX_DOUBLE).asInt();
} }
|
public class class_name {
private void addUnmatched(@NonNull ArrayMap<View, TransitionValues> unmatchedStart,
@NonNull ArrayMap<View, TransitionValues> unmatchedEnd) {
// Views that only exist in the start Scene
for (int i = 0; i < unmatchedStart.size(); i++) {
mStartValuesList.add(unmatchedStart.valueAt(i));
mEndValuesList.add(null);
}
// Views that only exist in the end Scene
for (int i = 0; i < unmatchedEnd.size(); i++) {
mEndValuesList.add(unmatchedEnd.valueAt(i));
mStartValuesList.add(null);
}
} }
|
public class class_name {
private void addUnmatched(@NonNull ArrayMap<View, TransitionValues> unmatchedStart,
@NonNull ArrayMap<View, TransitionValues> unmatchedEnd) {
// Views that only exist in the start Scene
for (int i = 0; i < unmatchedStart.size(); i++) {
mStartValuesList.add(unmatchedStart.valueAt(i)); // depends on control dependency: [for], data = [i]
mEndValuesList.add(null); // depends on control dependency: [for], data = [none]
}
// Views that only exist in the end Scene
for (int i = 0; i < unmatchedEnd.size(); i++) {
mEndValuesList.add(unmatchedEnd.valueAt(i)); // depends on control dependency: [for], data = [i]
mStartValuesList.add(null); // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
@SuppressWarnings("unchecked")
@Override
public REC previous() {
checkDirection(false);
if (currentRecord != null)
try {
// RETURN LAST LOADED RECORD
return (REC) currentRecord;
} finally {
currentRecord = null;
}
ORecordInternal<?> record = getRecord();
// MOVE BACKWARD IN THE CURRENT CLUSTER
while (hasPrevious()) {
if (currentRecord != null)
try {
// RETURN LAST LOADED RECORD
return (REC) currentRecord;
} finally {
currentRecord = null;
}
if (record == null)
record = readCurrentRecord(null, -1);
if (record != null)
// FOUND
if (include(record))
return (REC) record;
}
record = getTransactionEntry();
if (record != null)
return (REC) record;
throw new NoSuchElementException("Direction: backward, last position was: " + current + ", range: " + beginRange + "-"
+ endRange);
} }
|
public class class_name {
@SuppressWarnings("unchecked")
@Override
public REC previous() {
checkDirection(false);
if (currentRecord != null)
try {
// RETURN LAST LOADED RECORD
return (REC) currentRecord;
// depends on control dependency: [try], data = [none]
} finally {
currentRecord = null;
}
ORecordInternal<?> record = getRecord();
// MOVE BACKWARD IN THE CURRENT CLUSTER
while (hasPrevious()) {
if (currentRecord != null)
try {
// RETURN LAST LOADED RECORD
return (REC) currentRecord;
// depends on control dependency: [try], data = [none]
} finally {
currentRecord = null;
}
if (record == null)
record = readCurrentRecord(null, -1);
if (record != null)
// FOUND
if (include(record))
return (REC) record;
}
record = getTransactionEntry();
if (record != null)
return (REC) record;
throw new NoSuchElementException("Direction: backward, last position was: " + current + ", range: " + beginRange + "-"
+ endRange);
} }
|
public class class_name {
@Override
public boolean remove(final Object iKey, final OIdentifiable value) {
modificationLock.requestModificationLock();
try {
final List<String> words = splitIntoWords(iKey.toString());
boolean removed = false;
for (final String word : words) {
acquireExclusiveLock();
try {
final Set<OIdentifiable> recs = map.get(word);
if (recs != null && !recs.isEmpty()) {
if (recs.remove(value)) {
if (recs.isEmpty())
map.remove(word);
else
map.put(word, recs);
removed = true;
}
}
} finally {
releaseExclusiveLock();
}
}
return removed;
} finally {
modificationLock.releaseModificationLock();
}
} }
|
public class class_name {
@Override
public boolean remove(final Object iKey, final OIdentifiable value) {
modificationLock.requestModificationLock();
try {
final List<String> words = splitIntoWords(iKey.toString());
boolean removed = false;
for (final String word : words) {
acquireExclusiveLock();
// depends on control dependency: [for], data = [none]
try {
final Set<OIdentifiable> recs = map.get(word);
if (recs != null && !recs.isEmpty()) {
if (recs.remove(value)) {
if (recs.isEmpty())
map.remove(word);
else
map.put(word, recs);
removed = true;
// depends on control dependency: [if], data = [none]
}
}
} finally {
releaseExclusiveLock();
}
}
return removed;
// depends on control dependency: [try], data = [none]
} finally {
modificationLock.releaseModificationLock();
}
} }
|
public class class_name {
public java.util.List<AliasConfiguration> getAliases() {
if (aliases == null) {
aliases = new com.amazonaws.internal.SdkInternalList<AliasConfiguration>();
}
return aliases;
} }
|
public class class_name {
public java.util.List<AliasConfiguration> getAliases() {
if (aliases == null) {
aliases = new com.amazonaws.internal.SdkInternalList<AliasConfiguration>(); // depends on control dependency: [if], data = [none]
}
return aliases;
} }
|
public class class_name {
static Style get(final GridParam params) {
final StyleBuilder builder = new StyleBuilder();
final Symbolizer pointSymbolizer = crossSymbolizer("shape://plus", builder, CROSS_SIZE,
params.gridColor);
final Style style = builder.createStyle(pointSymbolizer);
final List<Symbolizer> symbolizers = style.featureTypeStyles().get(0).rules().get(0).symbolizers();
if (params.haloRadius > 0.0) {
Symbolizer halo = crossSymbolizer("cross", builder, CROSS_SIZE + params.haloRadius * 2.0,
params.haloColor);
symbolizers.add(0, halo);
}
return style;
} }
|
public class class_name {
static Style get(final GridParam params) {
final StyleBuilder builder = new StyleBuilder();
final Symbolizer pointSymbolizer = crossSymbolizer("shape://plus", builder, CROSS_SIZE,
params.gridColor);
final Style style = builder.createStyle(pointSymbolizer);
final List<Symbolizer> symbolizers = style.featureTypeStyles().get(0).rules().get(0).symbolizers();
if (params.haloRadius > 0.0) {
Symbolizer halo = crossSymbolizer("cross", builder, CROSS_SIZE + params.haloRadius * 2.0,
params.haloColor);
symbolizers.add(0, halo); // depends on control dependency: [if], data = [none]
}
return style;
} }
|
public class class_name {
private void openCli(SessionContext context, Executor executor) {
CliClient cli = null;
try {
cli = new CliClient(context, executor);
// interactive CLI mode
if (options.getUpdateStatement() == null) {
cli.open();
}
// execute single update statement
else {
final boolean success = cli.submitUpdate(options.getUpdateStatement());
if (!success) {
throw new SqlClientException("Could not submit given SQL update statement to cluster.");
}
}
} finally {
if (cli != null) {
cli.close();
}
}
} }
|
public class class_name {
private void openCli(SessionContext context, Executor executor) {
CliClient cli = null;
try {
cli = new CliClient(context, executor); // depends on control dependency: [try], data = [none]
// interactive CLI mode
if (options.getUpdateStatement() == null) {
cli.open(); // depends on control dependency: [if], data = [none]
}
// execute single update statement
else {
final boolean success = cli.submitUpdate(options.getUpdateStatement());
if (!success) {
throw new SqlClientException("Could not submit given SQL update statement to cluster.");
}
}
} finally {
if (cli != null) {
cli.close(); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
void onInstanceLost(String uniqueIdentifier) {
log(TAG, "instance lost " + uniqueIdentifier);
List<String> queriesIds = results.get(uniqueIdentifier);
if (queriesIds == null) {
return;
}
for (String queryId : queriesIds) {
String[] args = new String[2];
args[0] = queryId;
args[1] = uniqueIdentifier;
Message msg = handler.obtainMessage(SearchMessages.RESULT_LOST,
args);
log(TAG, "sending message RESULT_LOST to handler for queryId: "
+ queryId);
handler.sendMessage(msg);
}
} }
|
public class class_name {
void onInstanceLost(String uniqueIdentifier) {
log(TAG, "instance lost " + uniqueIdentifier);
List<String> queriesIds = results.get(uniqueIdentifier);
if (queriesIds == null) {
return; // depends on control dependency: [if], data = [none]
}
for (String queryId : queriesIds) {
String[] args = new String[2];
args[0] = queryId; // depends on control dependency: [for], data = [queryId]
args[1] = uniqueIdentifier; // depends on control dependency: [for], data = [none]
Message msg = handler.obtainMessage(SearchMessages.RESULT_LOST,
args);
log(TAG, "sending message RESULT_LOST to handler for queryId: "
+ queryId); // depends on control dependency: [for], data = [none]
handler.sendMessage(msg); // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
public static String urlEncode(final String text) throws Exception {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
for (int b : toUTF8Bytes(text)) {
if (b < 0) {
b = 256 + b;
}
if (UNRESERVED_CHARS.get(b)) {
buffer.write(b);
} else {
buffer.write(URL_ESCAPE_CHAR);
char hex1 = Character.toUpperCase(Character.forDigit(
(b >> 4) & 0xF, 16));
char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF,
16));
buffer.write(hex1);
buffer.write(hex2);
}
}
return new String(buffer.toByteArray());
} }
|
public class class_name {
public static String urlEncode(final String text) throws Exception {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
for (int b : toUTF8Bytes(text)) {
if (b < 0) {
b = 256 + b; // depends on control dependency: [if], data = [none]
}
if (UNRESERVED_CHARS.get(b)) {
buffer.write(b); // depends on control dependency: [if], data = [none]
} else {
buffer.write(URL_ESCAPE_CHAR); // depends on control dependency: [if], data = [none]
char hex1 = Character.toUpperCase(Character.forDigit(
(b >> 4) & 0xF, 16));
char hex2 = Character.toUpperCase(Character.forDigit(b & 0xF,
16));
buffer.write(hex1); // depends on control dependency: [if], data = [none]
buffer.write(hex2); // depends on control dependency: [if], data = [none]
}
}
return new String(buffer.toByteArray());
} }
|
public class class_name {
public void initShell(I_CmsShellCommands additionalShellCommands, PrintStream out, PrintStream err) {
// set the output streams
m_out = out;
m_err = err;
// initialize the settings of the user
m_settings = initSettings();
// initialize shell command object
m_shellCommands = new CmsShellCommands();
m_shellCommands.initShellCmsObject(m_cms, this);
// initialize additional shell command object
if (additionalShellCommands != null) {
m_additionalShellCommands = additionalShellCommands;
m_additionalShellCommands.initShellCmsObject(m_cms, this);
m_additionalShellCommands.shellStart();
} else {
m_shellCommands.shellStart();
}
m_commandObjects = new ArrayList<CmsCommandObject>();
if (m_additionalShellCommands != null) {
// get all shell callable methods from the additional shell command object
m_commandObjects.add(new CmsCommandObject(m_additionalShellCommands));
}
// get all shell callable methods from the CmsShellCommands
m_commandObjects.add(new CmsCommandObject(m_shellCommands));
// get all shell callable methods from the CmsRequestContext
m_commandObjects.add(new CmsCommandObject(m_cms.getRequestContext()));
// get all shell callable methods from the CmsObject
m_commandObjects.add(new CmsCommandObject(m_cms));
} }
|
public class class_name {
public void initShell(I_CmsShellCommands additionalShellCommands, PrintStream out, PrintStream err) {
// set the output streams
m_out = out;
m_err = err;
// initialize the settings of the user
m_settings = initSettings();
// initialize shell command object
m_shellCommands = new CmsShellCommands();
m_shellCommands.initShellCmsObject(m_cms, this);
// initialize additional shell command object
if (additionalShellCommands != null) {
m_additionalShellCommands = additionalShellCommands; // depends on control dependency: [if], data = [none]
m_additionalShellCommands.initShellCmsObject(m_cms, this); // depends on control dependency: [if], data = [none]
m_additionalShellCommands.shellStart(); // depends on control dependency: [if], data = [none]
} else {
m_shellCommands.shellStart(); // depends on control dependency: [if], data = [none]
}
m_commandObjects = new ArrayList<CmsCommandObject>();
if (m_additionalShellCommands != null) {
// get all shell callable methods from the additional shell command object
m_commandObjects.add(new CmsCommandObject(m_additionalShellCommands)); // depends on control dependency: [if], data = [(m_additionalShellCommands]
}
// get all shell callable methods from the CmsShellCommands
m_commandObjects.add(new CmsCommandObject(m_shellCommands));
// get all shell callable methods from the CmsRequestContext
m_commandObjects.add(new CmsCommandObject(m_cms.getRequestContext()));
// get all shell callable methods from the CmsObject
m_commandObjects.add(new CmsCommandObject(m_cms));
} }
|
public class class_name {
public boolean addAuthor(String author) {
try {
return add(new Meta(Element.AUTHOR, author));
} catch (DocumentException de) {
throw new ExceptionConverter(de);
}
} }
|
public class class_name {
public boolean addAuthor(String author) {
try {
return add(new Meta(Element.AUTHOR, author)); // depends on control dependency: [try], data = [none]
} catch (DocumentException de) {
throw new ExceptionConverter(de);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public synchronized void onDialogsChanged(boolean isEmpty) {
if (isDialogsEmpty.get() != isEmpty) {
context.getPreferences().putBool("app.dialogs.empty", isEmpty);
isDialogsEmpty.change(isEmpty);
}
if (!isEmpty) {
if (isAppEmpty.get()) {
context.getPreferences().putBool("app.empty", false);
isAppEmpty.change(false);
}
}
} }
|
public class class_name {
public synchronized void onDialogsChanged(boolean isEmpty) {
if (isDialogsEmpty.get() != isEmpty) {
context.getPreferences().putBool("app.dialogs.empty", isEmpty); // depends on control dependency: [if], data = [isEmpty)]
isDialogsEmpty.change(isEmpty); // depends on control dependency: [if], data = [isEmpty)]
}
if (!isEmpty) {
if (isAppEmpty.get()) {
context.getPreferences().putBool("app.empty", false); // depends on control dependency: [if], data = [none]
isAppEmpty.change(false); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public static long hashString(String string) {
long h = 1125899906842597L; // prime
int len = string.length();
for (int i = 0; i < len; i++) {
h = 31 * h + string.charAt(i);
}
return h;
} }
|
public class class_name {
public static long hashString(String string) {
long h = 1125899906842597L; // prime
int len = string.length();
for (int i = 0; i < len; i++) {
h = 31 * h + string.charAt(i); // depends on control dependency: [for], data = [i]
}
return h;
} }
|
public class class_name {
public static Statistics statisticsFor( Statistics[] statistics ) {
int length = statistics.length;
if (length == 0) return EMPTY_STATISTICS;
if (length == 1) return statistics[0] != null ? statistics[0] : EMPTY_STATISTICS;
int count = 0;
long max = Long.MIN_VALUE;
long min = Long.MAX_VALUE;
double mean = 0.0d;
double variance = 0.0d;
// Compute the min, max, and mean ...
for (Statistics stat : statistics) {
if (stat == null) continue;
count += stat.getCount();
max = Math.max(max, stat.getMaximum());
min = Math.min(min, stat.getMinimum());
mean = mean + (stat.getMean() * stat.getCount());
}
mean = mean / count;
// Compute the new variance using the new mean ...
double meanDelta = 0.0d;
for (Statistics stat : statistics) {
if (stat == null) continue;
meanDelta = stat.getMean() - mean;
variance = variance + (stat.getCount() * (stat.getVariance() + (meanDelta * meanDelta)));
}
return new StatisticsImpl(count, min, max, mean, variance);
} }
|
public class class_name {
public static Statistics statisticsFor( Statistics[] statistics ) {
int length = statistics.length;
if (length == 0) return EMPTY_STATISTICS;
if (length == 1) return statistics[0] != null ? statistics[0] : EMPTY_STATISTICS;
int count = 0;
long max = Long.MIN_VALUE;
long min = Long.MAX_VALUE;
double mean = 0.0d;
double variance = 0.0d;
// Compute the min, max, and mean ...
for (Statistics stat : statistics) {
if (stat == null) continue;
count += stat.getCount(); // depends on control dependency: [for], data = [stat]
max = Math.max(max, stat.getMaximum()); // depends on control dependency: [for], data = [stat]
min = Math.min(min, stat.getMinimum()); // depends on control dependency: [for], data = [stat]
mean = mean + (stat.getMean() * stat.getCount()); // depends on control dependency: [for], data = [stat]
}
mean = mean / count;
// Compute the new variance using the new mean ...
double meanDelta = 0.0d;
for (Statistics stat : statistics) {
if (stat == null) continue;
meanDelta = stat.getMean() - mean; // depends on control dependency: [for], data = [stat]
variance = variance + (stat.getCount() * (stat.getVariance() + (meanDelta * meanDelta))); // depends on control dependency: [for], data = [stat]
}
return new StatisticsImpl(count, min, max, mean, variance);
} }
|
public class class_name {
@SuppressWarnings("unchecked")
public <T> void registerCustomSerializer(Class<T> cls, JsonSerializer<T> forType) {
if(customSerializersMap == null) {
customSerializersMap = new HashMap<>();
}
if(cls == null) {
throw new IllegalArgumentException("Class must not be null");
} else if(cls.equals(JsonView.class)) {
throw new IllegalArgumentException("Class cannot be " + JsonView.class);
} else if(customSerializersMap.containsKey(cls)) {
throw new IllegalArgumentException("Class " + cls + " already has a serializer registered (" + customSerializersMap.get(cls) + ")");
}
customSerializersMap.put(cls, (JsonSerializer<Object>) forType);
} }
|
public class class_name {
@SuppressWarnings("unchecked")
public <T> void registerCustomSerializer(Class<T> cls, JsonSerializer<T> forType) {
if(customSerializersMap == null) {
customSerializersMap = new HashMap<>(); // depends on control dependency: [if], data = [none]
}
if(cls == null) {
throw new IllegalArgumentException("Class must not be null");
} else if(cls.equals(JsonView.class)) {
throw new IllegalArgumentException("Class cannot be " + JsonView.class);
} else if(customSerializersMap.containsKey(cls)) {
throw new IllegalArgumentException("Class " + cls + " already has a serializer registered (" + customSerializersMap.get(cls) + ")");
}
customSerializersMap.put(cls, (JsonSerializer<Object>) forType);
} }
|
public class class_name {
public final static int typeNameKeyWordFromMask(int possible_names, int length) {
int kw = KEYWORD_unrecognized;
if (possible_names != IonTokenConstsX.KW_ALL_BITS) {
for (int ii=0; ii<typeNameBits.length; ii++) {
int tb = typeNameBits[ii];
if (tb == possible_names) {
if (typeNameNames[ii].length() == length) {
kw = typeNameKeyWordIds[ii];
}
break;
}
}
}
return kw;
} }
|
public class class_name {
public final static int typeNameKeyWordFromMask(int possible_names, int length) {
int kw = KEYWORD_unrecognized;
if (possible_names != IonTokenConstsX.KW_ALL_BITS) {
for (int ii=0; ii<typeNameBits.length; ii++) {
int tb = typeNameBits[ii];
if (tb == possible_names) {
if (typeNameNames[ii].length() == length) {
kw = typeNameKeyWordIds[ii]; // depends on control dependency: [if], data = [none]
}
break;
}
}
}
return kw;
} }
|
public class class_name {
private void loadClasses(Map infoMap, URL path) throws DiffException {
try {
File jarFile = null;
if(!"file".equals(path.getProtocol()) || path.getHost() != null) {
// If it's not a local file, store it as a temporary jar file.
// java.util.jar.JarFile requires a local file handle.
jarFile = File.createTempFile("jardiff","jar");
// Mark it to be deleted on exit.
jarFile.deleteOnExit();
InputStream in = path.openStream();
OutputStream out = new FileOutputStream(jarFile);
byte[] buffer = new byte[4096];
int i;
while( (i = in.read(buffer,0,buffer.length)) != -1) {
out.write(buffer, 0, i);
}
in.close();
out.close();
} else {
// Else it's a local file, nothing special to do.
jarFile = new File(path.getPath());
}
loadClasses(infoMap, jarFile);
} catch (IOException ioe) {
throw new DiffException(ioe);
}
} }
|
public class class_name {
private void loadClasses(Map infoMap, URL path) throws DiffException {
try {
File jarFile = null;
if(!"file".equals(path.getProtocol()) || path.getHost() != null) {
// If it's not a local file, store it as a temporary jar file.
// java.util.jar.JarFile requires a local file handle.
jarFile = File.createTempFile("jardiff","jar");
// Mark it to be deleted on exit.
jarFile.deleteOnExit();
InputStream in = path.openStream();
OutputStream out = new FileOutputStream(jarFile);
byte[] buffer = new byte[4096];
int i;
while( (i = in.read(buffer,0,buffer.length)) != -1) {
out.write(buffer, 0, i); // depends on control dependency: [while], data = [none]
}
in.close();
out.close();
} else {
// Else it's a local file, nothing special to do.
jarFile = new File(path.getPath());
}
loadClasses(infoMap, jarFile);
} catch (IOException ioe) {
throw new DiffException(ioe);
}
} }
|
public class class_name {
private static long parseIso8601(String date) {
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyyMMdd'T'HHmmss'Z'");
formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
logger.debug("8601date {}", date);
try {
return formatter.parse(date).getTime() / 1000;
} catch (ParseException pe) {
throw new IllegalArgumentException(pe);
}
} }
|
public class class_name {
private static long parseIso8601(String date) {
SimpleDateFormat formatter = new SimpleDateFormat(
"yyyyMMdd'T'HHmmss'Z'");
formatter.setTimeZone(TimeZone.getTimeZone("UTC"));
logger.debug("8601date {}", date);
try {
return formatter.parse(date).getTime() / 1000; // depends on control dependency: [try], data = [none]
} catch (ParseException pe) {
throw new IllegalArgumentException(pe);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void writeAttributes(Iterable<Attribute> attributes) throws IOException {
List<String> attributeNames = Lists.newArrayList();
List<String> attributeLabels = Lists.newArrayList();
for (Attribute attr : attributes) {
attributeNames.add(attr.getName());
if (attr.getLabel() != null) {
attributeLabels.add(attr.getLabel());
} else {
attributeLabels.add(attr.getName());
}
}
writeAttributes(attributeNames, attributeLabels);
} }
|
public class class_name {
public void writeAttributes(Iterable<Attribute> attributes) throws IOException {
List<String> attributeNames = Lists.newArrayList();
List<String> attributeLabels = Lists.newArrayList();
for (Attribute attr : attributes) {
attributeNames.add(attr.getName());
if (attr.getLabel() != null) {
attributeLabels.add(attr.getLabel()); // depends on control dependency: [if], data = [(attr.getLabel()]
} else {
attributeLabels.add(attr.getName()); // depends on control dependency: [if], data = [none]
}
}
writeAttributes(attributeNames, attributeLabels);
} }
|
public class class_name {
@Override
public EClass getIfcRecurrencePattern() {
if (ifcRecurrencePatternEClass == null) {
ifcRecurrencePatternEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(506);
}
return ifcRecurrencePatternEClass;
} }
|
public class class_name {
@Override
public EClass getIfcRecurrencePattern() {
if (ifcRecurrencePatternEClass == null) {
ifcRecurrencePatternEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(506);
// depends on control dependency: [if], data = [none]
}
return ifcRecurrencePatternEClass;
} }
|
public class class_name {
public void ccowJoin() {
if (ccowIsActive()) {
return;
}
if (ccowContextManager == null && ccowEnabled) {
ccowContextManager = new CCOWContextManager();
ccowContextManager.subscribe(this);
ccowContextManager.run("CareWebFramework#", "", true, "*");
}
if (ccowContextManager != null) {
if (!ccowContextManager.isActive()) {
ccowContextManager.resume();
}
init(response -> {
if (response.rejected()) {
ccowContextManager.suspend();
}
updateCCOWStatus();
});
}
} }
|
public class class_name {
public void ccowJoin() {
if (ccowIsActive()) {
return; // depends on control dependency: [if], data = [none]
}
if (ccowContextManager == null && ccowEnabled) {
ccowContextManager = new CCOWContextManager(); // depends on control dependency: [if], data = [none]
ccowContextManager.subscribe(this); // depends on control dependency: [if], data = [none]
ccowContextManager.run("CareWebFramework#", "", true, "*"); // depends on control dependency: [if], data = [none]
}
if (ccowContextManager != null) {
if (!ccowContextManager.isActive()) {
ccowContextManager.resume(); // depends on control dependency: [if], data = [none]
}
init(response -> {
if (response.rejected()) {
ccowContextManager.suspend();
}
updateCCOWStatus(); // depends on control dependency: [if], data = [none]
});
}
} }
|
public class class_name {
private GetOperationResult checkOperation(String operationId) {
String result = "";
GetOperationResult opResult = null;
try {
while (!result.equals("SUCCESS") && !result.equals("FAIL")) {
opResult = getDiscoveryClient().getOperation(new GetOperationRequest().withOperationId(operationId));
result = opResult.getOperation().getStatus();
if (opResult.getOperation().getStatus().equals("SUCCESS")) {
LOG.info("Successfully get operation id " + operationId);
return opResult;
} else {
if (opResult.getOperation().getStatus().equals("FAIL")) {
LOG.error("Error calling aws service for operationId:" + operationId + " error code:" + opResult.getOperation().getErrorCode() + " error message:" + opResult.getOperation().getErrorMessage());
return opResult;
}
}
//TODO make this configurable
Thread.currentThread().sleep(5000); // if you call this to much amazon will rate limit you
}
} catch (InterruptedException e) {
LOG.error("Error polling for aws response operation:", e);
}
return opResult;
} }
|
public class class_name {
private GetOperationResult checkOperation(String operationId) {
String result = "";
GetOperationResult opResult = null;
try {
while (!result.equals("SUCCESS") && !result.equals("FAIL")) {
opResult = getDiscoveryClient().getOperation(new GetOperationRequest().withOperationId(operationId)); // depends on control dependency: [while], data = [none]
result = opResult.getOperation().getStatus(); // depends on control dependency: [while], data = [none]
if (opResult.getOperation().getStatus().equals("SUCCESS")) {
LOG.info("Successfully get operation id " + operationId); // depends on control dependency: [if], data = [none]
return opResult; // depends on control dependency: [if], data = [none]
} else {
if (opResult.getOperation().getStatus().equals("FAIL")) {
LOG.error("Error calling aws service for operationId:" + operationId + " error code:" + opResult.getOperation().getErrorCode() + " error message:" + opResult.getOperation().getErrorMessage()); // depends on control dependency: [if], data = [none]
return opResult; // depends on control dependency: [if], data = [none]
}
}
//TODO make this configurable
Thread.currentThread().sleep(5000); // if you call this to much amazon will rate limit you // depends on control dependency: [while], data = [none]
}
} catch (InterruptedException e) {
LOG.error("Error polling for aws response operation:", e);
} // depends on control dependency: [catch], data = [none]
return opResult;
} }
|
public class class_name {
protected TypeCodec<?> createCodec(GenericType<?> javaType, boolean isJavaCovariant) {
TypeToken<?> token = javaType.__getToken();
if (List.class.isAssignableFrom(token.getRawType())
&& token.getType() instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) token.getType()).getActualTypeArguments();
GenericType<?> elementType = GenericType.of(typeArguments[0]);
TypeCodec<?> elementCodec = codecFor(elementType, isJavaCovariant);
return TypeCodecs.listOf(elementCodec);
} else if (Set.class.isAssignableFrom(token.getRawType())
&& token.getType() instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) token.getType()).getActualTypeArguments();
GenericType<?> elementType = GenericType.of(typeArguments[0]);
TypeCodec<?> elementCodec = codecFor(elementType, isJavaCovariant);
return TypeCodecs.setOf(elementCodec);
} else if (Map.class.isAssignableFrom(token.getRawType())
&& token.getType() instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) token.getType()).getActualTypeArguments();
GenericType<?> keyType = GenericType.of(typeArguments[0]);
GenericType<?> valueType = GenericType.of(typeArguments[1]);
TypeCodec<?> keyCodec = codecFor(keyType, isJavaCovariant);
TypeCodec<?> valueCodec = codecFor(valueType, isJavaCovariant);
return TypeCodecs.mapOf(keyCodec, valueCodec);
}
throw new CodecNotFoundException(null, javaType);
} }
|
public class class_name {
protected TypeCodec<?> createCodec(GenericType<?> javaType, boolean isJavaCovariant) {
TypeToken<?> token = javaType.__getToken();
if (List.class.isAssignableFrom(token.getRawType())
&& token.getType() instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) token.getType()).getActualTypeArguments();
GenericType<?> elementType = GenericType.of(typeArguments[0]);
TypeCodec<?> elementCodec = codecFor(elementType, isJavaCovariant);
return TypeCodecs.listOf(elementCodec); // depends on control dependency: [if], data = [none]
} else if (Set.class.isAssignableFrom(token.getRawType())
&& token.getType() instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) token.getType()).getActualTypeArguments();
GenericType<?> elementType = GenericType.of(typeArguments[0]);
TypeCodec<?> elementCodec = codecFor(elementType, isJavaCovariant);
return TypeCodecs.setOf(elementCodec); // depends on control dependency: [if], data = [none]
} else if (Map.class.isAssignableFrom(token.getRawType())
&& token.getType() instanceof ParameterizedType) {
Type[] typeArguments = ((ParameterizedType) token.getType()).getActualTypeArguments();
GenericType<?> keyType = GenericType.of(typeArguments[0]);
GenericType<?> valueType = GenericType.of(typeArguments[1]);
TypeCodec<?> keyCodec = codecFor(keyType, isJavaCovariant);
TypeCodec<?> valueCodec = codecFor(valueType, isJavaCovariant);
return TypeCodecs.mapOf(keyCodec, valueCodec); // depends on control dependency: [if], data = [none]
}
throw new CodecNotFoundException(null, javaType);
} }
|
public class class_name {
private static List<RangeWithCount> cleanup_(List<RangeWithCount> imed) {
final Comparator<RangeWithCount> cmp = Comparator
.comparing((RangeWithCount range_count) -> range_count.getRange().getFloor())
.thenComparing(Comparator.comparing((RangeWithCount range_count) -> range_count.getRange().getCeil()));
final List<RangeWithCount> result = new ArrayList<>(imed.size());
sort(imed, cmp);
while (imed.size() >= 2) {
final RangeWithCount head = imed.remove(0);
final RangeWithCount succ = imed.get(0);
// Merge adjecent ranges.
if (head.getRange().equals(succ.getRange())) {
succ.setCount(succ.getCount() + head.getCount());
continue;
}
// Move elements from extending range.
if (head.getRange().getFloor() == succ.getRange().getFloor()) {
final double mid = head.getRange().getCeil();
final double ceil = succ.getRange().getCeil();
final double succ_range = succ.getRange().getWidth();
final double succ_left_fraction = (mid - succ.getRange().getFloor()) / succ_range;
final double succ_right_fraction = 1 - succ_left_fraction;
head.setCount(head.getCount() + succ_left_fraction * succ.getCount());
succ.setCount(succ_right_fraction * succ.getCount());
succ.setRange(new Range(mid, ceil));
imed.add(0, head);
sort(imed, cmp);
continue;
}
// Emit disjunt head range.
if (head.getRange().getCeil() <= succ.getRange().getFloor()) {
if (Math.signum(head.getCount()) != 0)
result.add(head);
continue;
}
// head.floor < succ.floor < head.ceil
assert (head.getRange().getFloor() < succ.getRange().getFloor());
assert (succ.getRange().getFloor() < head.getRange().getCeil());
// Head is intersected by succ, split it in two, at the succ.floor boundary.
final double floor = head.getRange().getFloor();
final double ceil = succ.getRange().getFloor();
final double head_range = head.getRange().getWidth();
final double head_left_fraction = (ceil - floor) / head_range;
final double head_right_fraction = 1 - head_left_fraction;
imed.add(0, head);
imed.add(0, new RangeWithCount(new Range(floor, ceil), head_left_fraction * head.getCount()));
head.setRange(new Range(ceil, head.getRange().getCeil()));
head.setCount(head_right_fraction * head.getCount());
sort(imed, cmp);
}
imed.stream()
.filter(rwc -> Math.signum(rwc.getCount()) != 0)
.forEach(result::add);
// Merge adjecent entries, if they have the same distribution.
for (int i = 0; i < result.size() - 1;) {
final RangeWithCount pred = result.get(i);
final RangeWithCount succ = result.get(i + 1);
final double pred_range = pred.getRange().getWidth();
final double succ_range = succ.getRange().getWidth();
if (pred.getRange().getCeil() == succ.getRange().getFloor()
&& pred.getCount() * succ_range == succ.getCount() * pred_range) {
result.remove(i);
succ.setRange(new Range(pred.getRange().getFloor(), succ.getRange().getCeil()));
succ.setCount(succ.getCount() + pred.getCount());
} else {
++i;
}
}
return result;
} }
|
public class class_name {
private static List<RangeWithCount> cleanup_(List<RangeWithCount> imed) {
final Comparator<RangeWithCount> cmp = Comparator
.comparing((RangeWithCount range_count) -> range_count.getRange().getFloor())
.thenComparing(Comparator.comparing((RangeWithCount range_count) -> range_count.getRange().getCeil()));
final List<RangeWithCount> result = new ArrayList<>(imed.size());
sort(imed, cmp);
while (imed.size() >= 2) {
final RangeWithCount head = imed.remove(0);
final RangeWithCount succ = imed.get(0);
// Merge adjecent ranges.
if (head.getRange().equals(succ.getRange())) {
succ.setCount(succ.getCount() + head.getCount()); // depends on control dependency: [if], data = [none]
continue;
}
// Move elements from extending range.
if (head.getRange().getFloor() == succ.getRange().getFloor()) {
final double mid = head.getRange().getCeil();
final double ceil = succ.getRange().getCeil();
final double succ_range = succ.getRange().getWidth();
final double succ_left_fraction = (mid - succ.getRange().getFloor()) / succ_range;
final double succ_right_fraction = 1 - succ_left_fraction;
head.setCount(head.getCount() + succ_left_fraction * succ.getCount()); // depends on control dependency: [if], data = [none]
succ.setCount(succ_right_fraction * succ.getCount()); // depends on control dependency: [if], data = [none]
succ.setRange(new Range(mid, ceil)); // depends on control dependency: [if], data = [none]
imed.add(0, head); // depends on control dependency: [if], data = [none]
sort(imed, cmp); // depends on control dependency: [if], data = [none]
continue;
}
// Emit disjunt head range.
if (head.getRange().getCeil() <= succ.getRange().getFloor()) {
if (Math.signum(head.getCount()) != 0)
result.add(head);
continue;
}
// head.floor < succ.floor < head.ceil
assert (head.getRange().getFloor() < succ.getRange().getFloor()); // depends on control dependency: [while], data = [none]
assert (succ.getRange().getFloor() < head.getRange().getCeil()); // depends on control dependency: [while], data = [none]
// Head is intersected by succ, split it in two, at the succ.floor boundary.
final double floor = head.getRange().getFloor();
final double ceil = succ.getRange().getFloor();
final double head_range = head.getRange().getWidth();
final double head_left_fraction = (ceil - floor) / head_range;
final double head_right_fraction = 1 - head_left_fraction;
imed.add(0, head); // depends on control dependency: [while], data = [none]
imed.add(0, new RangeWithCount(new Range(floor, ceil), head_left_fraction * head.getCount())); // depends on control dependency: [while], data = [none]
head.setRange(new Range(ceil, head.getRange().getCeil())); // depends on control dependency: [while], data = [none]
head.setCount(head_right_fraction * head.getCount()); // depends on control dependency: [while], data = [none]
sort(imed, cmp); // depends on control dependency: [while], data = [none]
}
imed.stream()
.filter(rwc -> Math.signum(rwc.getCount()) != 0)
.forEach(result::add);
// Merge adjecent entries, if they have the same distribution.
for (int i = 0; i < result.size() - 1;) {
final RangeWithCount pred = result.get(i);
final RangeWithCount succ = result.get(i + 1);
final double pred_range = pred.getRange().getWidth();
final double succ_range = succ.getRange().getWidth();
if (pred.getRange().getCeil() == succ.getRange().getFloor()
&& pred.getCount() * succ_range == succ.getCount() * pred_range) {
result.remove(i); // depends on control dependency: [if], data = [none]
succ.setRange(new Range(pred.getRange().getFloor(), succ.getRange().getCeil())); // depends on control dependency: [if], data = [none]
succ.setCount(succ.getCount() + pred.getCount()); // depends on control dependency: [if], data = [none]
} else {
++i; // depends on control dependency: [if], data = [none]
}
}
return result;
} }
|
public class class_name {
public Observable<ServiceResponse<List<ElasticPoolActivityInner>>> listByElasticPoolWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serverName == null) {
throw new IllegalArgumentException("Parameter serverName is required and cannot be null.");
}
if (elasticPoolName == null) {
throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.listByElasticPool(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<ElasticPoolActivityInner>>>>() {
@Override
public Observable<ServiceResponse<List<ElasticPoolActivityInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ElasticPoolActivityInner>> result = listByElasticPoolDelegate(response);
List<ElasticPoolActivityInner> items = null;
if (result.body() != null) {
items = result.body().items();
}
ServiceResponse<List<ElasticPoolActivityInner>> clientResponse = new ServiceResponse<List<ElasticPoolActivityInner>>(items, result.response());
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<List<ElasticPoolActivityInner>>> listByElasticPoolWithServiceResponseAsync(String resourceGroupName, String serverName, String elasticPoolName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (serverName == null) {
throw new IllegalArgumentException("Parameter serverName is required and cannot be null.");
}
if (elasticPoolName == null) {
throw new IllegalArgumentException("Parameter elasticPoolName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.listByElasticPool(this.client.subscriptionId(), resourceGroupName, serverName, elasticPoolName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<ElasticPoolActivityInner>>>>() {
@Override
public Observable<ServiceResponse<List<ElasticPoolActivityInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<ElasticPoolActivityInner>> result = listByElasticPoolDelegate(response);
List<ElasticPoolActivityInner> items = null;
if (result.body() != null) {
items = result.body().items(); // depends on control dependency: [if], data = [none]
}
ServiceResponse<List<ElasticPoolActivityInner>> clientResponse = new ServiceResponse<List<ElasticPoolActivityInner>>(items, result.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 Boolean getPropertyAsBoolean(final String bundleName,
final String key) {
LOG.info("Getting value for key: " + key + " from bundle name: "
+ bundleName);
ResourceBundle bundle = bundles.get(bundleName);
Boolean result = Boolean.FALSE;
try {
result = Boolean.valueOf(bundle.getString(key));
} catch (MissingResourceException e) {
LOG.info("Resource: " + key + " not found!");
}
return result;
} }
|
public class class_name {
public Boolean getPropertyAsBoolean(final String bundleName,
final String key) {
LOG.info("Getting value for key: " + key + " from bundle name: "
+ bundleName);
ResourceBundle bundle = bundles.get(bundleName);
Boolean result = Boolean.FALSE;
try {
result = Boolean.valueOf(bundle.getString(key)); // depends on control dependency: [try], data = [none]
} catch (MissingResourceException e) {
LOG.info("Resource: " + key + " not found!");
} // depends on control dependency: [catch], data = [none]
return result;
} }
|
public class class_name {
public void addLables(JKLocale locale, final Properties lables) {
final Enumeration keys = lables.keys();
while (keys.hasMoreElements()) {
final String key = (String) keys.nextElement();
setProperty(locale, key, lables.getProperty(key));
}
} }
|
public class class_name {
public void addLables(JKLocale locale, final Properties lables) {
final Enumeration keys = lables.keys();
while (keys.hasMoreElements()) {
final String key = (String) keys.nextElement();
setProperty(locale, key, lables.getProperty(key));
// depends on control dependency: [while], data = [none]
}
} }
|
public class class_name {
public void setFastCatchupTimeSecs(long secondsSinceEpoch) {
lock.lock();
try {
checkState(chain == null || !chain.shouldVerifyTransactions(), "Fast catchup is incompatible with fully verifying");
fastCatchupTimeSecs = secondsSinceEpoch;
if (downloadPeer != null) {
downloadPeer.setDownloadParameters(secondsSinceEpoch, bloomFilterMerger.getLastFilter() != null);
}
} finally {
lock.unlock();
}
} }
|
public class class_name {
public void setFastCatchupTimeSecs(long secondsSinceEpoch) {
lock.lock();
try {
checkState(chain == null || !chain.shouldVerifyTransactions(), "Fast catchup is incompatible with fully verifying"); // depends on control dependency: [try], data = [none]
fastCatchupTimeSecs = secondsSinceEpoch; // depends on control dependency: [try], data = [none]
if (downloadPeer != null) {
downloadPeer.setDownloadParameters(secondsSinceEpoch, bloomFilterMerger.getLastFilter() != null); // depends on control dependency: [if], data = [null)]
}
} finally {
lock.unlock();
}
} }
|
public class class_name {
boolean addListenersForMonitor(Object monitor, Set<ProbeListener> listeners) {
listenersLock.writeLock().lock();
try {
if (listenersForMonitor.containsKey(monitor)) {
return false;
}
listenersForMonitor.put(monitor, listeners);
allRegisteredListeners.addAll(listeners);
} finally {
listenersLock.writeLock().unlock();
}
return true;
} }
|
public class class_name {
boolean addListenersForMonitor(Object monitor, Set<ProbeListener> listeners) {
listenersLock.writeLock().lock();
try {
if (listenersForMonitor.containsKey(monitor)) {
return false; // depends on control dependency: [if], data = [none]
}
listenersForMonitor.put(monitor, listeners); // depends on control dependency: [try], data = [none]
allRegisteredListeners.addAll(listeners); // depends on control dependency: [try], data = [none]
} finally {
listenersLock.writeLock().unlock();
}
return true;
} }
|
public class class_name {
protected String keyToString(Object rawKey)
{
if (rawKey instanceof String) {
return (String) rawKey;
}
return String.valueOf(rawKey);
} }
|
public class class_name {
protected String keyToString(Object rawKey)
{
if (rawKey instanceof String) {
return (String) rawKey; // depends on control dependency: [if], data = [none]
}
return String.valueOf(rawKey);
} }
|
public class class_name {
public static void deleteChildren(Node n, AbstractCompiler compiler) {
while (n.hasChildren()) {
deleteNode(n.getFirstChild(), compiler);
}
} }
|
public class class_name {
public static void deleteChildren(Node n, AbstractCompiler compiler) {
while (n.hasChildren()) {
deleteNode(n.getFirstChild(), compiler); // depends on control dependency: [while], data = [none]
}
} }
|
public class class_name {
@Override
public void renderHead(Component component, IHeaderResponse response)
{
super.renderHead(component, response);
JsStatement statement = statement();
if (statement != null)
{
String statementString = statement.render().toString();
if (!Strings.isEmpty(statementString))
{
response.render(OnDomReadyHeaderItem.forScript(statementString));
}
}
} }
|
public class class_name {
@Override
public void renderHead(Component component, IHeaderResponse response)
{
super.renderHead(component, response);
JsStatement statement = statement();
if (statement != null)
{
String statementString = statement.render().toString();
if (!Strings.isEmpty(statementString))
{
response.render(OnDomReadyHeaderItem.forScript(statementString)); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public void marshall(Capacity capacity, ProtocolMarshaller protocolMarshaller) {
if (capacity == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(capacity.getReadCapacityUnits(), READCAPACITYUNITS_BINDING);
protocolMarshaller.marshall(capacity.getWriteCapacityUnits(), WRITECAPACITYUNITS_BINDING);
protocolMarshaller.marshall(capacity.getCapacityUnits(), CAPACITYUNITS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(Capacity capacity, ProtocolMarshaller protocolMarshaller) {
if (capacity == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(capacity.getReadCapacityUnits(), READCAPACITYUNITS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(capacity.getWriteCapacityUnits(), WRITECAPACITYUNITS_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(capacity.getCapacityUnits(), CAPACITYUNITS_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 synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(toCoroutine))
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
// We expect these values to be overwritten during the notify()/wait()
// periods, as other coroutines in this set get their opportunity to run.
m_yield=arg_object;
m_nextCoroutine=toCoroutine;
notify();
while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY)
{
try
{
// System.out.println("waiting...");
wait();
}
catch(java.lang.InterruptedException e)
{
// %TBD% -- Declare? Encapsulate? Ignore? Or
// dance deasil about the program counter?
}
}
if(m_nextCoroutine==NOBODY)
{
// Pass it along
co_exit(thisCoroutine);
// And inform this coroutine that its partners are Going Away
// %REVIEW% Should this throw/return something more useful?
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request");
}
return m_yield;
} }
|
public class class_name {
public synchronized Object co_resume(Object arg_object,int thisCoroutine,int toCoroutine) throws java.lang.NoSuchMethodException
{
if(!m_activeIDs.get(toCoroutine))
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_NOT_AVAIL, new Object[]{Integer.toString(toCoroutine)})); //"Coroutine not available, id="+toCoroutine);
// We expect these values to be overwritten during the notify()/wait()
// periods, as other coroutines in this set get their opportunity to run.
m_yield=arg_object;
m_nextCoroutine=toCoroutine;
notify();
while(m_nextCoroutine != thisCoroutine || m_nextCoroutine==ANYBODY || m_nextCoroutine==NOBODY)
{
try
{
// System.out.println("waiting...");
wait(); // depends on control dependency: [try], data = [none]
}
catch(java.lang.InterruptedException e)
{
// %TBD% -- Declare? Encapsulate? Ignore? Or
// dance deasil about the program counter?
} // depends on control dependency: [catch], data = [none]
}
if(m_nextCoroutine==NOBODY)
{
// Pass it along
co_exit(thisCoroutine);
// And inform this coroutine that its partners are Going Away
// %REVIEW% Should this throw/return something more useful?
throw new java.lang.NoSuchMethodException(XMLMessages.createXMLMessage(XMLErrorResources.ER_COROUTINE_CO_EXIT, null)); //"CoroutineManager recieved co_exit() request");
}
return m_yield;
} }
|
public class class_name {
@Override
public FloatMatrix repmat(final int rowRepeats, final int colRepeats) {
N.checkArgument(rowRepeats > 0 && colRepeats > 0, "rowRepeats=%s and colRepeats=%s must be bigger than 0", rowRepeats, colRepeats);
final float[][] c = new float[rows * rowRepeats][cols * colRepeats];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < colRepeats; j++) {
N.copy(a[i], 0, c[i], j * cols, cols);
}
}
for (int i = 1; i < rowRepeats; i++) {
for (int j = 0; j < rows; j++) {
N.copy(c[j], 0, c[i * rows + j], 0, c[j].length);
}
}
return new FloatMatrix(c);
} }
|
public class class_name {
@Override
public FloatMatrix repmat(final int rowRepeats, final int colRepeats) {
N.checkArgument(rowRepeats > 0 && colRepeats > 0, "rowRepeats=%s and colRepeats=%s must be bigger than 0", rowRepeats, colRepeats);
final float[][] c = new float[rows * rowRepeats][cols * colRepeats];
for (int i = 0; i < rows; i++) {
for (int j = 0; j < colRepeats; j++) {
N.copy(a[i], 0, c[i], j * cols, cols);
// depends on control dependency: [for], data = [j]
}
}
for (int i = 1; i < rowRepeats; i++) {
for (int j = 0; j < rows; j++) {
N.copy(c[j], 0, c[i * rows + j], 0, c[j].length);
// depends on control dependency: [for], data = [j]
}
}
return new FloatMatrix(c);
} }
|
public class class_name {
SortedMap<String, String> readParams() {
SortedMap<String, String> result = new TreeMap<String, String>();
for (Component component : m_paramContainer) {
if (component instanceof ParamLine) {
ParamLine paramLine = (ParamLine)component;
String keyAndValue = paramLine.getValue();
int eqPos = keyAndValue.indexOf("=");
if (eqPos >= 0) {
String key = keyAndValue.substring(0, eqPos);
String value = keyAndValue.substring(eqPos + 1);
result.put(key, value);
}
}
}
return result;
} }
|
public class class_name {
SortedMap<String, String> readParams() {
SortedMap<String, String> result = new TreeMap<String, String>();
for (Component component : m_paramContainer) {
if (component instanceof ParamLine) {
ParamLine paramLine = (ParamLine)component;
String keyAndValue = paramLine.getValue();
int eqPos = keyAndValue.indexOf("=");
if (eqPos >= 0) {
String key = keyAndValue.substring(0, eqPos);
String value = keyAndValue.substring(eqPos + 1);
result.put(key, value); // depends on control dependency: [if], data = [none]
}
}
}
return result;
} }
|
public class class_name {
public void closeLogger(String loggerName) {
if (this.openLoggers.containsKey(loggerName)) {
try {
this.openLoggers.get(loggerName).close();
} catch (Exception e) {
throw new DelegatedRuntimeException(e);
}
this.openLoggers.remove(loggerName);
}
} }
|
public class class_name {
public void closeLogger(String loggerName) {
if (this.openLoggers.containsKey(loggerName)) {
try {
this.openLoggers.get(loggerName).close(); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new DelegatedRuntimeException(e);
} // depends on control dependency: [catch], data = [none]
this.openLoggers.remove(loggerName); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static void validateScriptsCombination(Set<XmLepResourceSubType> scriptTypes,
LepMethod lepMethod,
UrlLepResourceKey compositeResourceKey) {
byte mask = getCombinationMask(scriptTypes, lepMethod, compositeResourceKey);
StringBuilder errors = new StringBuilder();
if (isZero(mask, ZERO_PATTERN_NO_TENANT_AND_DEFAULT_AND_JAVA_CODE)) {
errors.append(String.format("Has no one script of '%s', '%s' or native (java) implementation.",
XmLepResourceSubType.TENANT, XmLepResourceSubType.DEFAULT));
}
if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_BEFORE)) {
if (errors.length() > 0) {
errors.append(" ");
}
errors.append(String.format("Has '%s' script with '%s'.", XmLepResourceSubType.BEFORE, XmLepResourceSubType.AROUND));
}
if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_AFTER)) {
if (errors.length() > 0) {
errors.append(" ");
}
errors.append(String.format("Has '%s' script with '%s'.", XmLepResourceSubType.AROUND, XmLepResourceSubType.AFTER));
}
if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_TENANT)) {
if (errors.length() > 0) {
errors.append(" ");
}
errors.append(String.format("Unallowed combination '%s' and '%s' scripts.", XmLepResourceSubType.AROUND, XmLepResourceSubType.TENANT));
}
if (errors.length() > 0) {
throw new IllegalArgumentException(String.format("Resource key %s has script combination errors. %s",
compositeResourceKey,
errors.toString()));
}
} }
|
public class class_name {
public static void validateScriptsCombination(Set<XmLepResourceSubType> scriptTypes,
LepMethod lepMethod,
UrlLepResourceKey compositeResourceKey) {
byte mask = getCombinationMask(scriptTypes, lepMethod, compositeResourceKey);
StringBuilder errors = new StringBuilder();
if (isZero(mask, ZERO_PATTERN_NO_TENANT_AND_DEFAULT_AND_JAVA_CODE)) {
errors.append(String.format("Has no one script of '%s', '%s' or native (java) implementation.",
XmLepResourceSubType.TENANT, XmLepResourceSubType.DEFAULT));
}
if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_BEFORE)) {
if (errors.length() > 0) {
errors.append(" ");
}
errors.append(String.format("Has '%s' script with '%s'.", XmLepResourceSubType.BEFORE, XmLepResourceSubType.AROUND));
}
if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_AFTER)) {
if (errors.length() > 0) {
errors.append(" ");
}
errors.append(String.format("Has '%s' script with '%s'.", XmLepResourceSubType.AROUND, XmLepResourceSubType.AFTER));
}
if (isSetByPattern(mask, IS_SET_PATTERN_AROUND_AND_TENANT)) {
if (errors.length() > 0) {
errors.append(" ");
}
errors.append(String.format("Unallowed combination '%s' and '%s' scripts.", XmLepResourceSubType.AROUND, XmLepResourceSubType.TENANT)); // depends on control dependency: [if], data = [none]
}
if (errors.length() > 0) {
throw new IllegalArgumentException(String.format("Resource key %s has script combination errors. %s",
compositeResourceKey,
errors.toString()));
}
} }
|
public class class_name {
private void addPostParams(final Request request) {
if (code != null) {
request.addPostParam("Code", code);
}
if (to != null) {
request.addPostParam("To", to);
}
} }
|
public class class_name {
private void addPostParams(final Request request) {
if (code != null) {
request.addPostParam("Code", code); // depends on control dependency: [if], data = [none]
}
if (to != null) {
request.addPostParam("To", to); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void persistTimer(final TimerImpl timer, boolean newTimer) {
if (timer == null) {
return;
}
if (timer.isTimerPersistent()) {
try {
if (timerPersistence.getOptionalValue() == null) {
EJB3_TIMER_LOGGER.timerPersistenceNotEnable();
return;
}
final ContextTransactionManager transactionManager = ContextTransactionManager.getInstance();
Transaction clientTX = transactionManager.getTransaction();
if (newTimer || timer.isCanceled()) {
if( clientTX == null ){
transactionManager.begin();
}
try {
if( newTimer ) timerPersistence.getValue().addTimer(timer);
else timerPersistence.getValue().persistTimer(timer);
if(clientTX == null) transactionManager.commit();
} catch (Exception e){
if(clientTX == null) {
try {
transactionManager.rollback();
} catch (Exception ee){
EjbLogger.EJB3_TIMER_LOGGER.timerUpdateFailedAndRollbackNotPossible(ee);
}
}
throw e;
}
} else {
new TaskPostPersist(timer).persistTimer();
}
} catch (Throwable t) {
this.setRollbackOnly();
throw new RuntimeException(t);
}
}
} }
|
public class class_name {
public void persistTimer(final TimerImpl timer, boolean newTimer) {
if (timer == null) {
return; // depends on control dependency: [if], data = [none]
}
if (timer.isTimerPersistent()) {
try {
if (timerPersistence.getOptionalValue() == null) {
EJB3_TIMER_LOGGER.timerPersistenceNotEnable(); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
final ContextTransactionManager transactionManager = ContextTransactionManager.getInstance();
Transaction clientTX = transactionManager.getTransaction();
if (newTimer || timer.isCanceled()) {
if( clientTX == null ){
transactionManager.begin(); // depends on control dependency: [if], data = [none]
}
try {
if( newTimer ) timerPersistence.getValue().addTimer(timer);
else timerPersistence.getValue().persistTimer(timer);
if(clientTX == null) transactionManager.commit();
} catch (Exception e){
if(clientTX == null) {
try {
transactionManager.rollback(); // depends on control dependency: [try], data = [none]
} catch (Exception ee){
EjbLogger.EJB3_TIMER_LOGGER.timerUpdateFailedAndRollbackNotPossible(ee);
} // depends on control dependency: [catch], data = [none]
}
throw e;
} // depends on control dependency: [catch], data = [none]
} else {
new TaskPostPersist(timer).persistTimer(); // depends on control dependency: [if], data = [none]
}
} catch (Throwable t) {
this.setRollbackOnly();
throw new RuntimeException(t);
} // depends on control dependency: [catch], data = [none]
}
} }
|
public class class_name {
public void learn(SparseArray x, int y) {
if (model == Model.GENERAL) {
throw new UnsupportedOperationException("General-mode Naive Bayes classifier doesn't support online learning.");
}
if (model == Model.MULTINOMIAL) {
for (SparseArray.Entry e : x) {
ntc[y][e.i] += e.x;
nt[y] += e.x;
}
} else if (model == Model.POLYAURN) {
for (SparseArray.Entry e : x) {
ntc[y][e.i] += e.x * 2;
nt[y] += e.x * 2;
}
} else {
for (SparseArray.Entry e : x) {
if (e.x > 0) {
ntc[y][e.i]++;
}
}
}
n++;
nc[y]++;
update();
} }
|
public class class_name {
public void learn(SparseArray x, int y) {
if (model == Model.GENERAL) {
throw new UnsupportedOperationException("General-mode Naive Bayes classifier doesn't support online learning.");
}
if (model == Model.MULTINOMIAL) {
for (SparseArray.Entry e : x) {
ntc[y][e.i] += e.x; // depends on control dependency: [for], data = [e]
nt[y] += e.x; // depends on control dependency: [for], data = [e]
}
} else if (model == Model.POLYAURN) {
for (SparseArray.Entry e : x) {
ntc[y][e.i] += e.x * 2; // depends on control dependency: [for], data = [e]
nt[y] += e.x * 2; // depends on control dependency: [for], data = [e]
}
} else {
for (SparseArray.Entry e : x) {
if (e.x > 0) {
ntc[y][e.i]++; // depends on control dependency: [if], data = [none]
}
}
}
n++;
nc[y]++;
update();
} }
|
public class class_name {
private void readWaypoint(final Element waypoint, final List<GraphObjectMap> resultList) {
final GraphObjectMap item = readPoint(waypoint);
if (item != null) {
resultList.add(item);
}
} }
|
public class class_name {
private void readWaypoint(final Element waypoint, final List<GraphObjectMap> resultList) {
final GraphObjectMap item = readPoint(waypoint);
if (item != null) {
resultList.add(item); // depends on control dependency: [if], data = [(item]
}
} }
|
public class class_name {
@Override
public void handleChannelData(final String action, final JSONArray payload) throws BitfinexClientException {
logger.debug("Got notification callback {}", payload.toString());
if (payload.isEmpty()) {
return;
}
// Test for order error callback
// [0,"n",[null,"on-req",null,null,[null,null,1513970684865000,"tBTCUSD",null,null,0.001,0.001,"EXCHANGE MARKET",null,null,null,null,null,null,null,12940,null,null,null,null,null,null,0,null,null],null,"ERROR","Invalid order: minimum size for BTC/USD is 0.002"]]
if ("on-req".equals(payload.getString(1))) {
final String state = payload.optString(6);
if ("ERROR".equals(state)) {
BitfinexSubmittedOrder exchangeOrder = jsonToBitfinexSubmittedOrder(payload);
submittedOrderConsumer.accept(symbol, exchangeOrder);
}
}
} }
|
public class class_name {
@Override
public void handleChannelData(final String action, final JSONArray payload) throws BitfinexClientException {
logger.debug("Got notification callback {}", payload.toString());
if (payload.isEmpty()) {
return;
}
// Test for order error callback
// [0,"n",[null,"on-req",null,null,[null,null,1513970684865000,"tBTCUSD",null,null,0.001,0.001,"EXCHANGE MARKET",null,null,null,null,null,null,null,12940,null,null,null,null,null,null,0,null,null],null,"ERROR","Invalid order: minimum size for BTC/USD is 0.002"]]
if ("on-req".equals(payload.getString(1))) {
final String state = payload.optString(6);
if ("ERROR".equals(state)) {
BitfinexSubmittedOrder exchangeOrder = jsonToBitfinexSubmittedOrder(payload);
submittedOrderConsumer.accept(symbol, exchangeOrder); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
if(layout.isDrawerOpen(drawer) && !deviceSupportMultiPane()) {
menu.clear();
}
return super.onPrepareOptionsMenu(menu);
} }
|
public class class_name {
@Override
public boolean onPrepareOptionsMenu(Menu menu) {
if(layout.isDrawerOpen(drawer) && !deviceSupportMultiPane()) {
menu.clear(); // depends on control dependency: [if], data = [none]
}
return super.onPrepareOptionsMenu(menu);
} }
|
public class class_name {
public static DocumentMetadataType initDocumentMetadata(DocumentMetadataType documentMetadata) {
// @gml:id
String id = MarshallingUtil.createIdForType(DocumentMetadataType.class);
documentMetadata.setId(id);
// wml2:generationDate
DateTime generationDate = MarshallingUtil.fixedGenerationDate;
if (generationDate == null) {
generationDate = new DateTime(); // Initialized to "now".
}
documentMetadata.setGenerationDate(generationDate.toGregorianCalendar());
return documentMetadata;
} }
|
public class class_name {
public static DocumentMetadataType initDocumentMetadata(DocumentMetadataType documentMetadata) {
// @gml:id
String id = MarshallingUtil.createIdForType(DocumentMetadataType.class);
documentMetadata.setId(id);
// wml2:generationDate
DateTime generationDate = MarshallingUtil.fixedGenerationDate;
if (generationDate == null) {
generationDate = new DateTime(); // Initialized to "now". // depends on control dependency: [if], data = [none]
}
documentMetadata.setGenerationDate(generationDate.toGregorianCalendar());
return documentMetadata;
} }
|
public class class_name {
private void createSections(final BufferedImage IMAGE) {
if (!getSections().isEmpty() && bImage != null) {
final double OUTER_RADIUS = bImage.getWidth() * 0.3411214953f;
final double INNER_RADIUS = isExpandedSectionsEnabled() ? OUTER_RADIUS - bImage.getWidth() * 0.12f : OUTER_RADIUS - bImage.getWidth() * 0.023364486f;
final Ellipse2D INNER = new Ellipse2D.Double(0, 0, 1, 1);
switch (getOrientation()) {
case NORTH_EAST:
INNER.setFrame(-bImage.getWidth() * 0.45, bImage.getWidth() * 0.195, 4 * INNER_RADIUS, 4 * INNER_RADIUS);
break;
case SOUTH_EAST:
INNER.setFrame(-bImage.getWidth() * 0.45, -bImage.getWidth() * 0.45, 4 * INNER_RADIUS, 4 * INNER_RADIUS);
break;
case SOUTH_WEST:
INNER.setFrame(bImage.getWidth() * 0.195, -bImage.getWidth() * 0.45, 4 * INNER_RADIUS, 4 * INNER_RADIUS);
break;
case NORTH_WEST:
default:
final double INNER_OFFSET = isExpandedSectionsEnabled() ? bImage.getWidth() * 0.38 : bImage.getWidth() * 0.195;
INNER.setFrame(INNER_OFFSET, INNER_OFFSET, 4 * INNER_RADIUS, 4 * INNER_RADIUS);
break;
}
double stopAngle;
double startAngle;
final Point2D SECTION_OFFSET = new Point2D.Double(0, 0);
for (Section section : getSections()) {
switch (getOrientation()) {
case NORTH_EAST:
if (!isLogScale()) {
stopAngle = 90 - Math.toDegrees((getMaxValue() - section.getStop() - getMinValue()) * getAngleStep());
startAngle = 90 - Math.toDegrees((getMaxValue() - section.getStart() - getMinValue()) * getAngleStep());
} else {
stopAngle = 90 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStop() - getMinValue()) * getLogAngleStep());
startAngle = 90 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStart() - getMinValue()) * getLogAngleStep());
}
SECTION_OFFSET.setLocation(-bImage.getWidth() * 0.403271028, bImage.getWidth() * 0.148271028);
break;
case SOUTH_EAST:
if (!isLogScale()) {
stopAngle = 0 - Math.toDegrees((getMaxValue() - section.getStop() - getMinValue()) * getAngleStep());
startAngle = 0 - Math.toDegrees((getMaxValue() - section.getStart() - getMinValue()) * getAngleStep());
} else {
stopAngle = 0 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStop() - getMinValue()) * getLogAngleStep());
startAngle = 0 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStart() - getMinValue()) * getLogAngleStep());
}
SECTION_OFFSET.setLocation(-bImage.getWidth() * 0.403271028, -bImage.getWidth() * 0.403271028);
break;
case SOUTH_WEST:
if (!isLogScale()) {
stopAngle = 270 - Math.toDegrees((section.getStop() - getMinValue()) * getAngleStep());
startAngle = 270 - Math.toDegrees((section.getStart() - getMinValue()) * getAngleStep());
} else {
stopAngle = 270 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStop() - getMinValue()) * getLogAngleStep());
startAngle = 270 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStart() - getMinValue()) * getLogAngleStep());
}
SECTION_OFFSET.setLocation(bImage.getWidth() * 0.148271028, -bImage.getWidth() * 0.403271028);
break;
case NORTH_WEST:
default:
if (!isLogScale()) {
stopAngle = 180 - Math.toDegrees((section.getStop() - getMinValue()) * getAngleStep());
startAngle = 180 - Math.toDegrees((section.getStart() - getMinValue()) * getAngleStep());
} else {
stopAngle = 180 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStop() - getMinValue()) * getLogAngleStep());
startAngle = 180 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStart() - getMinValue()) * getLogAngleStep());
}
SECTION_OFFSET.setLocation(bImage.getWidth() * 0.148271028, bImage.getWidth() * 0.148271028);
break;
}
final Arc2D OUTER_ARC = new Arc2D.Double(java.awt.geom.Arc2D.PIE);
OUTER_ARC.setFrame(SECTION_OFFSET.getX(), SECTION_OFFSET.getY(), 4 * OUTER_RADIUS, 4 * OUTER_RADIUS);
OUTER_ARC.setAngleStart(startAngle);
OUTER_ARC.setAngleExtent(stopAngle - startAngle);
final Area SECTION = new Area(OUTER_ARC);
SECTION.subtract(new java.awt.geom.Area(INNER));
section.setSectionArea(SECTION);
}
// Draw the sections
if (isSectionsVisible() && IMAGE != null) {
final Graphics2D G2 = IMAGE.createGraphics();
G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
for (Section section : getSections()) {
G2.setColor(isTransparentAreasEnabled() ? section.getTransparentColor() : section.getColor());
G2.fill(section.getSectionArea());
}
G2.dispose();
}
}
} }
|
public class class_name {
private void createSections(final BufferedImage IMAGE) {
if (!getSections().isEmpty() && bImage != null) {
final double OUTER_RADIUS = bImage.getWidth() * 0.3411214953f;
final double INNER_RADIUS = isExpandedSectionsEnabled() ? OUTER_RADIUS - bImage.getWidth() * 0.12f : OUTER_RADIUS - bImage.getWidth() * 0.023364486f;
final Ellipse2D INNER = new Ellipse2D.Double(0, 0, 1, 1);
switch (getOrientation()) {
case NORTH_EAST:
INNER.setFrame(-bImage.getWidth() * 0.45, bImage.getWidth() * 0.195, 4 * INNER_RADIUS, 4 * INNER_RADIUS); // depends on control dependency: [if], data = [none]
break;
case SOUTH_EAST:
INNER.setFrame(-bImage.getWidth() * 0.45, -bImage.getWidth() * 0.45, 4 * INNER_RADIUS, 4 * INNER_RADIUS); // depends on control dependency: [if], data = [none]
break;
case SOUTH_WEST:
INNER.setFrame(bImage.getWidth() * 0.195, -bImage.getWidth() * 0.45, 4 * INNER_RADIUS, 4 * INNER_RADIUS); // depends on control dependency: [if], data = [none]
break;
case NORTH_WEST:
default:
final double INNER_OFFSET = isExpandedSectionsEnabled() ? bImage.getWidth() * 0.38 : bImage.getWidth() * 0.195;
INNER.setFrame(INNER_OFFSET, INNER_OFFSET, 4 * INNER_RADIUS, 4 * INNER_RADIUS); // depends on control dependency: [if], data = [none]
break;
}
double stopAngle;
double startAngle;
final Point2D SECTION_OFFSET = new Point2D.Double(0, 0);
for (Section section : getSections()) {
switch (getOrientation()) {
case NORTH_EAST:
if (!isLogScale()) {
stopAngle = 90 - Math.toDegrees((getMaxValue() - section.getStop() - getMinValue()) * getAngleStep()); // depends on control dependency: [if], data = [none]
startAngle = 90 - Math.toDegrees((getMaxValue() - section.getStart() - getMinValue()) * getAngleStep()); // depends on control dependency: [if], data = [none]
} else {
stopAngle = 90 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStop() - getMinValue()) * getLogAngleStep()); // depends on control dependency: [if], data = [none]
startAngle = 90 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStart() - getMinValue()) * getLogAngleStep()); // depends on control dependency: [if], data = [none]
}
SECTION_OFFSET.setLocation(-bImage.getWidth() * 0.403271028, bImage.getWidth() * 0.148271028);
break;
case SOUTH_EAST:
if (!isLogScale()) {
stopAngle = 0 - Math.toDegrees((getMaxValue() - section.getStop() - getMinValue()) * getAngleStep()); // depends on control dependency: [if], data = [none]
startAngle = 0 - Math.toDegrees((getMaxValue() - section.getStart() - getMinValue()) * getAngleStep()); // depends on control dependency: [if], data = [none]
} else {
stopAngle = 0 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStop() - getMinValue()) * getLogAngleStep()); // depends on control dependency: [if], data = [none]
startAngle = 0 - Math.toDegrees(UTIL.logOfBase(BASE, getMaxValue() - section.getStart() - getMinValue()) * getLogAngleStep()); // depends on control dependency: [if], data = [none]
}
SECTION_OFFSET.setLocation(-bImage.getWidth() * 0.403271028, -bImage.getWidth() * 0.403271028);
break;
case SOUTH_WEST:
if (!isLogScale()) {
stopAngle = 270 - Math.toDegrees((section.getStop() - getMinValue()) * getAngleStep()); // depends on control dependency: [if], data = [none]
startAngle = 270 - Math.toDegrees((section.getStart() - getMinValue()) * getAngleStep()); // depends on control dependency: [if], data = [none]
} else {
stopAngle = 270 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStop() - getMinValue()) * getLogAngleStep()); // depends on control dependency: [if], data = [none]
startAngle = 270 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStart() - getMinValue()) * getLogAngleStep()); // depends on control dependency: [if], data = [none]
}
SECTION_OFFSET.setLocation(bImage.getWidth() * 0.148271028, -bImage.getWidth() * 0.403271028);
break;
case NORTH_WEST:
default:
if (!isLogScale()) {
stopAngle = 180 - Math.toDegrees((section.getStop() - getMinValue()) * getAngleStep()); // depends on control dependency: [if], data = [none]
startAngle = 180 - Math.toDegrees((section.getStart() - getMinValue()) * getAngleStep()); // depends on control dependency: [if], data = [none]
} else {
stopAngle = 180 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStop() - getMinValue()) * getLogAngleStep()); // depends on control dependency: [if], data = [none]
startAngle = 180 - Math.toDegrees(UTIL.logOfBase(BASE, section.getStart() - getMinValue()) * getLogAngleStep()); // depends on control dependency: [if], data = [none]
}
SECTION_OFFSET.setLocation(bImage.getWidth() * 0.148271028, bImage.getWidth() * 0.148271028);
break;
}
final Arc2D OUTER_ARC = new Arc2D.Double(java.awt.geom.Arc2D.PIE);
OUTER_ARC.setFrame(SECTION_OFFSET.getX(), SECTION_OFFSET.getY(), 4 * OUTER_RADIUS, 4 * OUTER_RADIUS); // depends on control dependency: [for], data = [none]
OUTER_ARC.setAngleStart(startAngle); // depends on control dependency: [for], data = [none]
OUTER_ARC.setAngleExtent(stopAngle - startAngle); // depends on control dependency: [for], data = [none]
final Area SECTION = new Area(OUTER_ARC);
SECTION.subtract(new java.awt.geom.Area(INNER)); // depends on control dependency: [for], data = [none]
section.setSectionArea(SECTION); // depends on control dependency: [for], data = [section]
}
// Draw the sections
if (isSectionsVisible() && IMAGE != null) {
final Graphics2D G2 = IMAGE.createGraphics();
G2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); // depends on control dependency: [if], data = [none]
for (Section section : getSections()) {
G2.setColor(isTransparentAreasEnabled() ? section.getTransparentColor() : section.getColor()); // depends on control dependency: [for], data = [section]
G2.fill(section.getSectionArea()); // depends on control dependency: [for], data = [section]
}
G2.dispose(); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
private String getPath(String url) {
int index = url.indexOf('/', 7);
if (index == -1) {
return url;
}
// Replace the html entities that we want to search for inside paths
String cleansed = url.substring(index + 1);
for (int i = 0; i < SEARCH_LIST.length; i++) {
cleansed = StringUtils.replace(cleansed, SEARCH_LIST[i], REPLACEMENT_LIST[i]);
}
return cleansed;
} }
|
public class class_name {
private String getPath(String url) {
int index = url.indexOf('/', 7);
if (index == -1) {
return url; // depends on control dependency: [if], data = [none]
}
// Replace the html entities that we want to search for inside paths
String cleansed = url.substring(index + 1);
for (int i = 0; i < SEARCH_LIST.length; i++) {
cleansed = StringUtils.replace(cleansed, SEARCH_LIST[i], REPLACEMENT_LIST[i]); // depends on control dependency: [for], data = [i]
}
return cleansed;
} }
|
public class class_name {
public static Predicate<InetAddress> ofCidr(String cidr) {
requireNonNull(cidr, "cidr");
final int delim = cidr.indexOf('/');
checkArgument(delim >= 0, "Invalid CIDR notation: %s", cidr);
final InetAddress baseAddress;
try {
baseAddress = InetAddress.getByName(cidr.substring(0, delim));
} catch (UnknownHostException e) {
throw new IllegalArgumentException("Invalid CIDR notation: " + cidr, e);
}
final String subnetMask = cidr.substring(delim + 1);
checkArgument(!subnetMask.isEmpty(), "Invalid CIDR notation: %s", cidr);
final int maskBits;
if (NetUtil.isValidIpV4Address(subnetMask)) {
maskBits = toMaskBits(subnetMask);
return ofCidr(baseAddress, maskBits, maskBits + 96);
}
try {
maskBits = Integer.parseInt(subnetMask);
} catch (Exception e) {
throw new IllegalArgumentException("Invalid CIDR notation: " + cidr, e);
}
return ofCidr(baseAddress, maskBits, maskBits);
} }
|
public class class_name {
public static Predicate<InetAddress> ofCidr(String cidr) {
requireNonNull(cidr, "cidr");
final int delim = cidr.indexOf('/');
checkArgument(delim >= 0, "Invalid CIDR notation: %s", cidr);
final InetAddress baseAddress;
try {
baseAddress = InetAddress.getByName(cidr.substring(0, delim)); // depends on control dependency: [try], data = [none]
} catch (UnknownHostException e) {
throw new IllegalArgumentException("Invalid CIDR notation: " + cidr, e);
} // depends on control dependency: [catch], data = [none]
final String subnetMask = cidr.substring(delim + 1);
checkArgument(!subnetMask.isEmpty(), "Invalid CIDR notation: %s", cidr);
final int maskBits;
if (NetUtil.isValidIpV4Address(subnetMask)) {
maskBits = toMaskBits(subnetMask); // depends on control dependency: [if], data = [none]
return ofCidr(baseAddress, maskBits, maskBits + 96); // depends on control dependency: [if], data = [none]
}
try {
maskBits = Integer.parseInt(subnetMask); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new IllegalArgumentException("Invalid CIDR notation: " + cidr, e);
} // depends on control dependency: [catch], data = [none]
return ofCidr(baseAddress, maskBits, maskBits);
} }
|
public class class_name {
public GetResourcesResult withItems(Resource... items) {
if (this.items == null) {
setItems(new java.util.ArrayList<Resource>(items.length));
}
for (Resource ele : items) {
this.items.add(ele);
}
return this;
} }
|
public class class_name {
public GetResourcesResult withItems(Resource... items) {
if (this.items == null) {
setItems(new java.util.ArrayList<Resource>(items.length)); // depends on control dependency: [if], data = [none]
}
for (Resource ele : items) {
this.items.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public void marshall(DescribeConfigRuleEvaluationStatusRequest describeConfigRuleEvaluationStatusRequest, ProtocolMarshaller protocolMarshaller) {
if (describeConfigRuleEvaluationStatusRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeConfigRuleEvaluationStatusRequest.getConfigRuleNames(), CONFIGRULENAMES_BINDING);
protocolMarshaller.marshall(describeConfigRuleEvaluationStatusRequest.getNextToken(), NEXTTOKEN_BINDING);
protocolMarshaller.marshall(describeConfigRuleEvaluationStatusRequest.getLimit(), LIMIT_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(DescribeConfigRuleEvaluationStatusRequest describeConfigRuleEvaluationStatusRequest, ProtocolMarshaller protocolMarshaller) {
if (describeConfigRuleEvaluationStatusRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(describeConfigRuleEvaluationStatusRequest.getConfigRuleNames(), CONFIGRULENAMES_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(describeConfigRuleEvaluationStatusRequest.getNextToken(), NEXTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(describeConfigRuleEvaluationStatusRequest.getLimit(), LIMIT_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static Iterable<BoxUser.Info> getUsersInfoForType(final BoxAPIConnection api,
final String filterTerm, final String userType, final String externalAppUserId, final String... fields) {
return new Iterable<BoxUser.Info>() {
public Iterator<BoxUser.Info> iterator() {
QueryStringBuilder builder = new QueryStringBuilder();
if (filterTerm != null) {
builder.appendParam("filter_term", filterTerm);
}
if (userType != null) {
builder.appendParam("user_type", userType);
}
if (externalAppUserId != null) {
builder.appendParam("external_app_user_id", externalAppUserId);
}
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
URL url = USERS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), builder.toString());
return new BoxUserIterator(api, url);
}
};
} }
|
public class class_name {
private static Iterable<BoxUser.Info> getUsersInfoForType(final BoxAPIConnection api,
final String filterTerm, final String userType, final String externalAppUserId, final String... fields) {
return new Iterable<BoxUser.Info>() {
public Iterator<BoxUser.Info> iterator() {
QueryStringBuilder builder = new QueryStringBuilder();
if (filterTerm != null) {
builder.appendParam("filter_term", filterTerm); // depends on control dependency: [if], data = [none]
}
if (userType != null) {
builder.appendParam("user_type", userType); // depends on control dependency: [if], data = [none]
}
if (externalAppUserId != null) {
builder.appendParam("external_app_user_id", externalAppUserId); // depends on control dependency: [if], data = [none]
}
if (fields.length > 0) {
builder.appendParam("fields", fields); // depends on control dependency: [if], data = [none]
}
URL url = USERS_URL_TEMPLATE.buildWithQuery(api.getBaseURL(), builder.toString());
return new BoxUserIterator(api, url);
}
};
} }
|
public class class_name {
@Override
public void removeFailure(K key, StoreAccessException e) {
try {
loaderWriter.delete(key);
} catch(Exception e1) {
throw ExceptionFactory.newCacheWritingException(e1, e);
} finally {
cleanup(key, e);
}
} }
|
public class class_name {
@Override
public void removeFailure(K key, StoreAccessException e) {
try {
loaderWriter.delete(key); // depends on control dependency: [try], data = [none]
} catch(Exception e1) {
throw ExceptionFactory.newCacheWritingException(e1, e);
} finally { // depends on control dependency: [catch], data = [none]
cleanup(key, e);
}
} }
|
public class class_name {
private <T> void bindObjectToJavaNameSpaces(NameSpaceBinder<T> binder,
T bindingObject,
HomeRecord hr,
boolean singleGlobalInterface,
String interfaceName,
int interfaceIndex,
boolean local) throws NamingException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "bindObjectToJavaNameSpaces");
BeanMetaData bmd = hr.getBeanMetaData();
J2EEName j2eeName = bmd.j2eeName;
String beanName = j2eeName.getComponent();
List<String> jndiNames = new ArrayList<String>();
if (hr.bindInterfaceNames()) {
jndiNames.add(beanName + '!' + interfaceName);
}
if (singleGlobalInterface) {
jndiNames.add(beanName);
}
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "names=" + jndiNames + ", global=" + hr.bindToJavaGlobalNameSpace());
// d660700 - Bind to java:global if necessary.
if (hr.bindToJavaGlobalNameSpace()) {
if (bindingObject != null) {
sendBindingMessage(bmd, beanName, interfaceName, interfaceIndex, local);
}
for (String jndiName : jndiNames) {
if (bindingObject != null) {
binder.bindJavaGlobal(jndiName, bindingObject); // F69147.2
}
hr.ivJavaGlobalBindings.add(jndiName);
}
}
// d660700 - Bind to java:app.
for (String jndiName : jndiNames) {
if (bindingObject != null) {
binder.bindJavaApp(jndiName, bindingObject); // F69147.2
}
hr.ivJavaAppBindings.add(jndiName);
}
// d660700 - Bind to java:module.
if (bindingObject != null) {
for (String jndiName : jndiNames) {
binder.bindJavaModule(jndiName, bindingObject); // F69147.2
}
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "bindObjectToJavaNameSpaces");
} }
|
public class class_name {
private <T> void bindObjectToJavaNameSpaces(NameSpaceBinder<T> binder,
T bindingObject,
HomeRecord hr,
boolean singleGlobalInterface,
String interfaceName,
int interfaceIndex,
boolean local) throws NamingException {
final boolean isTraceOn = TraceComponent.isAnyTracingEnabled();
if (isTraceOn && tc.isEntryEnabled())
Tr.entry(tc, "bindObjectToJavaNameSpaces");
BeanMetaData bmd = hr.getBeanMetaData();
J2EEName j2eeName = bmd.j2eeName;
String beanName = j2eeName.getComponent();
List<String> jndiNames = new ArrayList<String>();
if (hr.bindInterfaceNames()) {
jndiNames.add(beanName + '!' + interfaceName);
}
if (singleGlobalInterface) {
jndiNames.add(beanName);
}
if (isTraceOn && tc.isDebugEnabled())
Tr.debug(tc, "names=" + jndiNames + ", global=" + hr.bindToJavaGlobalNameSpace());
// d660700 - Bind to java:global if necessary.
if (hr.bindToJavaGlobalNameSpace()) {
if (bindingObject != null) {
sendBindingMessage(bmd, beanName, interfaceName, interfaceIndex, local);
}
for (String jndiName : jndiNames) {
if (bindingObject != null) {
binder.bindJavaGlobal(jndiName, bindingObject); // F69147.2 // depends on control dependency: [if], data = [none]
}
hr.ivJavaGlobalBindings.add(jndiName);
}
}
// d660700 - Bind to java:app.
for (String jndiName : jndiNames) {
if (bindingObject != null) {
binder.bindJavaApp(jndiName, bindingObject); // F69147.2
}
hr.ivJavaAppBindings.add(jndiName);
}
// d660700 - Bind to java:module.
if (bindingObject != null) {
for (String jndiName : jndiNames) {
binder.bindJavaModule(jndiName, bindingObject); // F69147.2
}
}
if (isTraceOn && tc.isEntryEnabled())
Tr.exit(tc, "bindObjectToJavaNameSpaces");
} }
|
public class class_name {
public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
checkIfOpened();
try
{
if (renameNode(data) <= 0)
{
throw new JCRInvalidItemStateException("(rename) Node not found " + data.getQPath().getAsString() + " "
+ data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
ItemState.RENAMED);
}
}
catch (SQLException e)
{
if (LOG.isDebugEnabled())
{
LOG.error("Property add. Database error: " + e, e);
}
exceptionHandler.handleAddException(e, data);
}
} }
|
public class class_name {
public void rename(NodeData data) throws RepositoryException, UnsupportedOperationException,
InvalidItemStateException, IllegalStateException
{
checkIfOpened();
try
{
if (renameNode(data) <= 0)
{
throw new JCRInvalidItemStateException("(rename) Node not found " + data.getQPath().getAsString() + " "
+ data.getIdentifier() + ". Probably was deleted by another session ", data.getIdentifier(),
ItemState.RENAMED);
}
}
catch (SQLException e)
{
if (LOG.isDebugEnabled())
{
LOG.error("Property add. Database error: " + e, e); // depends on control dependency: [if], data = [none]
}
exceptionHandler.handleAddException(e, data);
}
} }
|
public class class_name {
public static DitaClass getInstance(final Element elem) {
if (elem == null) {
return null;
}
final Attr attr = elem.getAttributeNode(ATTRIBUTE_NAME_CLASS);
if (attr == null) {
return null;
}
return getInstance(attr.getNodeValue());
} }
|
public class class_name {
public static DitaClass getInstance(final Element elem) {
if (elem == null) {
return null; // depends on control dependency: [if], data = [none]
}
final Attr attr = elem.getAttributeNode(ATTRIBUTE_NAME_CLASS);
if (attr == null) {
return null; // depends on control dependency: [if], data = [none]
}
return getInstance(attr.getNodeValue());
} }
|
public class class_name {
@Override
public boolean remove(Object o) {
IAtomContainer atomContainer = (IAtomContainer) o;
// we should never have a null conformer
if (atomContainer == null) return false;
int index = indexOf(atomContainer);
if (index >= 0) {
remove(index);
return true;
}
return false;
} }
|
public class class_name {
@Override
public boolean remove(Object o) {
IAtomContainer atomContainer = (IAtomContainer) o;
// we should never have a null conformer
if (atomContainer == null) return false;
int index = indexOf(atomContainer);
if (index >= 0) {
remove(index); // depends on control dependency: [if], data = [(index]
return true; // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
public List<JAXBElement<String>> getProteinNameAndGeneSymbolAndUniprotId() {
if (proteinNameAndGeneSymbolAndUniprotId == null) {
proteinNameAndGeneSymbolAndUniprotId = new ArrayList<JAXBElement<String>>();
}
return this.proteinNameAndGeneSymbolAndUniprotId;
} }
|
public class class_name {
public List<JAXBElement<String>> getProteinNameAndGeneSymbolAndUniprotId() {
if (proteinNameAndGeneSymbolAndUniprotId == null) {
proteinNameAndGeneSymbolAndUniprotId = new ArrayList<JAXBElement<String>>(); // depends on control dependency: [if], data = [none]
}
return this.proteinNameAndGeneSymbolAndUniprotId;
} }
|
public class class_name {
public static void prepareFilePath(AlluxioURI alluxioPath, String ufsPath, FileSystem fs,
UnderFileSystem ufs) throws AlluxioException, IOException {
AlluxioURI dstPath = new AlluxioURI(ufsPath);
String parentPath = dstPath.getParent().getPath();
// creates the parent folder if it does not exist
if (!ufs.isDirectory(parentPath)) {
// Create ancestor directories from top to the bottom. We cannot use recursive create parents
// here because the permission for the ancestors can be different.
Stack<Pair<String, MkdirsOptions>> ufsDirsToMakeWithOptions = new Stack<>();
AlluxioURI curAlluxioPath = alluxioPath.getParent();
AlluxioURI curUfsPath = dstPath.getParent();
// Stop at Alluxio mount point because the mapped directory in UFS may not exist.
while (curUfsPath != null && !ufs.isDirectory(curUfsPath.toString())
&& curAlluxioPath != null) {
URIStatus curDirStatus = fs.getStatus(curAlluxioPath);
if (curDirStatus.isMountPoint()) {
throw new IOException(ExceptionMessage.UFS_PATH_DOES_NOT_EXIST.getMessage(curUfsPath));
}
ufsDirsToMakeWithOptions.push(new Pair<>(curUfsPath.toString(),
MkdirsOptions.defaults(ServerConfiguration.global()).setCreateParent(false)
.setOwner(curDirStatus.getOwner())
.setGroup(curDirStatus.getGroup())
.setMode(new Mode((short) curDirStatus.getMode()))));
curAlluxioPath = curAlluxioPath.getParent();
curUfsPath = curUfsPath.getParent();
}
while (!ufsDirsToMakeWithOptions.empty()) {
Pair<String, MkdirsOptions> ufsDirAndPerm = ufsDirsToMakeWithOptions.pop();
// UFS mkdirs might fail if the directory is already created. If so, skip the mkdirs
// and assume the directory is already prepared, regardless of permission matching.
if (!ufs.mkdirs(ufsDirAndPerm.getFirst(), ufsDirAndPerm.getSecond())
&& !ufs.isDirectory(ufsDirAndPerm.getFirst())) {
throw new IOException("Failed to create dir: " + ufsDirAndPerm.getFirst());
}
}
}
} }
|
public class class_name {
public static void prepareFilePath(AlluxioURI alluxioPath, String ufsPath, FileSystem fs,
UnderFileSystem ufs) throws AlluxioException, IOException {
AlluxioURI dstPath = new AlluxioURI(ufsPath);
String parentPath = dstPath.getParent().getPath();
// creates the parent folder if it does not exist
if (!ufs.isDirectory(parentPath)) {
// Create ancestor directories from top to the bottom. We cannot use recursive create parents
// here because the permission for the ancestors can be different.
Stack<Pair<String, MkdirsOptions>> ufsDirsToMakeWithOptions = new Stack<>();
AlluxioURI curAlluxioPath = alluxioPath.getParent();
AlluxioURI curUfsPath = dstPath.getParent();
// Stop at Alluxio mount point because the mapped directory in UFS may not exist.
while (curUfsPath != null && !ufs.isDirectory(curUfsPath.toString())
&& curAlluxioPath != null) {
URIStatus curDirStatus = fs.getStatus(curAlluxioPath);
if (curDirStatus.isMountPoint()) {
throw new IOException(ExceptionMessage.UFS_PATH_DOES_NOT_EXIST.getMessage(curUfsPath));
}
ufsDirsToMakeWithOptions.push(new Pair<>(curUfsPath.toString(),
MkdirsOptions.defaults(ServerConfiguration.global()).setCreateParent(false)
.setOwner(curDirStatus.getOwner())
.setGroup(curDirStatus.getGroup())
.setMode(new Mode((short) curDirStatus.getMode())))); // depends on control dependency: [while], data = [(curUfsPath]
curAlluxioPath = curAlluxioPath.getParent(); // depends on control dependency: [while], data = [none]
curUfsPath = curUfsPath.getParent(); // depends on control dependency: [while], data = [none]
}
while (!ufsDirsToMakeWithOptions.empty()) {
Pair<String, MkdirsOptions> ufsDirAndPerm = ufsDirsToMakeWithOptions.pop();
// UFS mkdirs might fail if the directory is already created. If so, skip the mkdirs
// and assume the directory is already prepared, regardless of permission matching.
if (!ufs.mkdirs(ufsDirAndPerm.getFirst(), ufsDirAndPerm.getSecond())
&& !ufs.isDirectory(ufsDirAndPerm.getFirst())) {
throw new IOException("Failed to create dir: " + ufsDirAndPerm.getFirst());
}
}
}
} }
|
public class class_name {
public void onMapViewChanged(MapViewChangedEvent event) {
refreshPixelLength();
// Note: if this.mapWidget is null, pixelLength must be valid
if ( !Double.isNaN(pixelLength) && (0.0 != pixelLength)) {
if (!isScaleItemInitialized) {
scaleItem.clearValue();
updateResolutions();
setDisplayScale(mapView.getCurrentScale() * pixelLength);
} else if (scaleItem.getValueAsString() == null || "".equals(scaleItem.getValueAsString())) {
setDisplayScale(mapView.getCurrentScale() * pixelLength);
} else if (event.isMapResized()) {
updateScaleList();
setDisplayScale(mapView.getCurrentScale() * pixelLength);
} else if (!event.isSameScaleLevel() || scaleItem.getDisplayValue() == null
|| "".equals(scaleItem.getDisplayValue())) {
setDisplayScale(mapView.getCurrentScale() * pixelLength);
}
}
} }
|
public class class_name {
public void onMapViewChanged(MapViewChangedEvent event) {
refreshPixelLength();
// Note: if this.mapWidget is null, pixelLength must be valid
if ( !Double.isNaN(pixelLength) && (0.0 != pixelLength)) {
if (!isScaleItemInitialized) {
scaleItem.clearValue(); // depends on control dependency: [if], data = [none]
updateResolutions(); // depends on control dependency: [if], data = [none]
setDisplayScale(mapView.getCurrentScale() * pixelLength); // depends on control dependency: [if], data = [none]
} else if (scaleItem.getValueAsString() == null || "".equals(scaleItem.getValueAsString())) {
setDisplayScale(mapView.getCurrentScale() * pixelLength); // depends on control dependency: [if], data = [none]
} else if (event.isMapResized()) {
updateScaleList(); // depends on control dependency: [if], data = [none]
setDisplayScale(mapView.getCurrentScale() * pixelLength); // depends on control dependency: [if], data = [none]
} else if (!event.isSameScaleLevel() || scaleItem.getDisplayValue() == null
|| "".equals(scaleItem.getDisplayValue())) {
setDisplayScale(mapView.getCurrentScale() * pixelLength); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public java.util.List<IdDt> getCondition() {
if (myCondition == null) {
myCondition = new java.util.ArrayList<IdDt>();
}
return myCondition;
} }
|
public class class_name {
public java.util.List<IdDt> getCondition() {
if (myCondition == null) {
myCondition = new java.util.ArrayList<IdDt>(); // depends on control dependency: [if], data = [none]
}
return myCondition;
} }
|
public class class_name {
@Override
public byte[] lPop(byte[] key) {
try {
if (isPipelined()) {
pipeline(new JedisResult(pipeline.lpop(key)));
return null;
}
return client.lpop(key);
} catch (Exception ex) {
throw convertException(ex);
}
} }
|
public class class_name {
@Override
public byte[] lPop(byte[] key) {
try {
if (isPipelined()) {
pipeline(new JedisResult(pipeline.lpop(key))); // depends on control dependency: [if], data = [none]
return null; // depends on control dependency: [if], data = [none]
}
return client.lpop(key); // depends on control dependency: [try], data = [none]
} catch (Exception ex) {
throw convertException(ex);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public void deleteKeyspace(KeyspaceImpl keyspace) {
Lock lock = lockManager.getLock(getLockingKey(keyspace));
lock.lock();
try {
if (keyspaceCacheMap.containsKey(keyspace)) {
KeyspaceCacheContainer container = keyspaceCacheMap.remove(keyspace);
container.graph().close();
container.invalidateSessions();
}
} finally {
lock.unlock();
}
} }
|
public class class_name {
public void deleteKeyspace(KeyspaceImpl keyspace) {
Lock lock = lockManager.getLock(getLockingKey(keyspace));
lock.lock();
try {
if (keyspaceCacheMap.containsKey(keyspace)) {
KeyspaceCacheContainer container = keyspaceCacheMap.remove(keyspace);
container.graph().close(); // depends on control dependency: [if], data = [none]
container.invalidateSessions(); // depends on control dependency: [if], data = [none]
}
} finally {
lock.unlock();
}
} }
|
public class class_name {
private static Route route(Object[] delegates) {
Object key = ClassesKey.create(delegates);
Route route = (Route)ROUTE_CACHE.get(key);
if (route == null) {
ROUTE_CACHE.put(key, route = new Route(delegates));
}
return route;
} }
|
public class class_name {
private static Route route(Object[] delegates) {
Object key = ClassesKey.create(delegates);
Route route = (Route)ROUTE_CACHE.get(key);
if (route == null) {
ROUTE_CACHE.put(key, route = new Route(delegates)); // depends on control dependency: [if], data = [none]
}
return route;
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.