code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
public void removeStaleCacheObserver (String cache, StaleCacheObserver observer)
{
ObserverList<StaleCacheObserver> list = _cacheobs.get(cache);
if (list == null) {
return;
}
list.remove(observer);
if (list.isEmpty()) {
_cacheobs.remove(cache);
}
} }
|
public class class_name {
public void removeStaleCacheObserver (String cache, StaleCacheObserver observer)
{
ObserverList<StaleCacheObserver> list = _cacheobs.get(cache);
if (list == null) {
return; // depends on control dependency: [if], data = [none]
}
list.remove(observer);
if (list.isEmpty()) {
_cacheobs.remove(cache); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void run()
{
while (running.get())
{
try
{
Socket socket = ss.accept();
HandlerSocket hs = new HandlerSocket(handler, socket, this);
active.add(hs);
executorService.submit(hs);
}
catch (Exception e)
{
if (running.get())
e.printStackTrace(System.err);
}
}
} }
|
public class class_name {
public void run()
{
while (running.get())
{
try
{
Socket socket = ss.accept();
HandlerSocket hs = new HandlerSocket(handler, socket, this);
active.add(hs); // depends on control dependency: [try], data = [none]
executorService.submit(hs); // depends on control dependency: [try], data = [none]
}
catch (Exception e)
{
if (running.get())
e.printStackTrace(System.err);
} // depends on control dependency: [catch], data = [none]
}
} }
|
public class class_name {
public void clean(final ValidationObject object)
{
if (m_enabled)
{
m_validationEngine.clean(object);
for (ProxyField proxyField:m_history) {
proxyField.expire();
}
}
} }
|
public class class_name {
public void clean(final ValidationObject object)
{
if (m_enabled)
{
m_validationEngine.clean(object); // depends on control dependency: [if], data = [none]
for (ProxyField proxyField:m_history) {
proxyField.expire(); // depends on control dependency: [for], data = [proxyField]
}
}
} }
|
public class class_name {
public void notifyTaskStart(TaskExecutor executor) {
synchronized (listeners) {
int size = listeners.size();
for (int i = 0; i < size; i++) {
TaskListener listenerl = listeners.get(i);
listenerl.onStart(executor);
}
}
} }
|
public class class_name {
public void notifyTaskStart(TaskExecutor executor) {
synchronized (listeners) {
int size = listeners.size();
for (int i = 0; i < size; i++) {
TaskListener listenerl = listeners.get(i);
listenerl.onStart(executor);
// depends on control dependency: [for], data = [none]
}
}
} }
|
public class class_name {
protected void propagateOnMotionOutside(MotionEvent event)
{
if (mEventOptions.contains(EventOptions.SEND_TOUCH_EVENTS))
{
if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS))
{
getGVRContext().getEventManager().sendEvent(this, ITouchEvents.class, "onMotionOutside", this, event);
}
if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null))
{
getGVRContext().getEventManager().sendEvent(mScene, ITouchEvents.class, "onMotionOutside", this, event);
}
}
} }
|
public class class_name {
protected void propagateOnMotionOutside(MotionEvent event)
{
if (mEventOptions.contains(EventOptions.SEND_TOUCH_EVENTS))
{
if (mEventOptions.contains(EventOptions.SEND_TO_LISTENERS))
{
getGVRContext().getEventManager().sendEvent(this, ITouchEvents.class, "onMotionOutside", this, event); // depends on control dependency: [if], data = [none]
}
if (mEventOptions.contains(EventOptions.SEND_TO_SCENE) && (mScene != null))
{
getGVRContext().getEventManager().sendEvent(mScene, ITouchEvents.class, "onMotionOutside", this, event); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public void addAssocBeanExtras(ClassVisitor cv) {
if (isLog(3)) {
String msg = "... add fields";
if (!hasBasicConstructor) {
msg += ", basic constructor";
}
if (!hasMainConstructor) {
msg += ", main constructor";
}
log(msg);
}
if (!hasBasicConstructor) {
// add the assoc bean basic constructor
new TypeQueryAssocBasicConstructor(this, cv, ASSOC_BEAN_BASIC_CONSTRUCTOR_DESC, ASSOC_BEAN_BASIC_SIG).visitCode();
}
if (!hasMainConstructor) {
// add the assoc bean main constructor
new TypeQueryAssocMainConstructor(this, cv, ASSOC_BEAN_MAIN_CONSTRUCTOR_DESC, ASSOC_BEAN_MAIN_SIG).visitCode();
}
} }
|
public class class_name {
public void addAssocBeanExtras(ClassVisitor cv) {
if (isLog(3)) {
String msg = "... add fields";
if (!hasBasicConstructor) {
msg += ", basic constructor"; // depends on control dependency: [if], data = [none]
}
if (!hasMainConstructor) {
msg += ", main constructor"; // depends on control dependency: [if], data = [none]
}
log(msg); // depends on control dependency: [if], data = [none]
}
if (!hasBasicConstructor) {
// add the assoc bean basic constructor
new TypeQueryAssocBasicConstructor(this, cv, ASSOC_BEAN_BASIC_CONSTRUCTOR_DESC, ASSOC_BEAN_BASIC_SIG).visitCode(); // depends on control dependency: [if], data = [none]
}
if (!hasMainConstructor) {
// add the assoc bean main constructor
new TypeQueryAssocMainConstructor(this, cv, ASSOC_BEAN_MAIN_CONSTRUCTOR_DESC, ASSOC_BEAN_MAIN_SIG).visitCode(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public Clause acceptTransformer(TermTransformer transformer)
{
Clause result;
if (transformer instanceof ClauseTransformer)
{
result = ((ClauseTransformer) transformer).transform(this);
}
else
{
result = (Clause) super.acceptTransformer(transformer);
}
if (head != null)
{
result.head = (Functor) head.acceptTransformer(transformer);
}
if (body != null)
{
for (int i = 0; i < body.length; i++)
{
result.body[i] = (Functor) body[i].acceptTransformer(transformer);
}
}
return result;
} }
|
public class class_name {
public Clause acceptTransformer(TermTransformer transformer)
{
Clause result;
if (transformer instanceof ClauseTransformer)
{
result = ((ClauseTransformer) transformer).transform(this); // depends on control dependency: [if], data = [none]
}
else
{
result = (Clause) super.acceptTransformer(transformer); // depends on control dependency: [if], data = [none]
}
if (head != null)
{
result.head = (Functor) head.acceptTransformer(transformer); // depends on control dependency: [if], data = [none]
}
if (body != null)
{
for (int i = 0; i < body.length; i++)
{
result.body[i] = (Functor) body[i].acceptTransformer(transformer); // depends on control dependency: [for], data = [i]
}
}
return result;
} }
|
public class class_name {
public Reflections collect(final InputStream inputStream) {
try {
merge(configuration.getSerializer().read(inputStream));
if (log != null) log.info("Reflections collected metadata from input stream using serializer " + configuration.getSerializer().getClass().getName());
} catch (Exception ex) {
throw new ReflectionsException("could not merge input stream", ex);
}
return this;
} }
|
public class class_name {
public Reflections collect(final InputStream inputStream) {
try {
merge(configuration.getSerializer().read(inputStream));
if (log != null) log.info("Reflections collected metadata from input stream using serializer " + configuration.getSerializer().getClass().getName());
} catch (Exception ex) {
throw new ReflectionsException("could not merge input stream", ex);
} // depends on control dependency: [catch], data = [none]
return this;
} }
|
public class class_name {
static LiteralType parse(LiteralType result, String input) {
result.value=input;
Matcher matcher = CLASS_PATTERN.matcher(input);
while (matcher.find()) {
if (matcher.group(GROUP_SIMPLE_INDEX) != null || matcher.group(GROUP_ARRAY_INDEX) != null || matcher.group(GROUP_TYPE_GENERIC_INDEX) != null) {
result.value = matcher.group(GROUP_SIMPLE_INDEX);
if (result.value == null && matcher.group(GROUP_ARRAY_INDEX) != null) {
result.value = matcher.group(GROUP_ARRAY_INDEX);
result.array = true;
}
if (result.value == null && matcher.group(GROUP_TYPE_GENERIC_INDEX) != null) {
result.value = matcher.group(GROUP_TYPE_GENERIC_INDEX);
result.typeParameter=matcher.group(GROUP_TYPE_PARAMETER_INDEX);
}
if (result.value!=null && result.value.indexOf(".") >= 0) {
// assert: JDK lang
result.rawType = result.value;
if (result.rawType.startsWith("java")) {
// assert: raw type is type defined in jdk
try {
result.resolvedRawType = Class.forName(result.rawType);
} catch (ClassNotFoundException e) {
}
}
} else {
// assert: primitive
result.rawType = result.value;
result.primitive = true;
Class<?> resolved[] = { Byte.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE };
for (Class<?> i : resolved) {
if (result.rawType.equals(i.getSimpleName())) {
result.resolvedRawType = i;
break;
}
}
if (Void.TYPE.getSimpleName().equals(result.rawType))
{
result.resolvedRawType=Void.TYPE;
}
}
}
}
return result;
} }
|
public class class_name {
static LiteralType parse(LiteralType result, String input) {
result.value=input;
Matcher matcher = CLASS_PATTERN.matcher(input);
while (matcher.find()) {
if (matcher.group(GROUP_SIMPLE_INDEX) != null || matcher.group(GROUP_ARRAY_INDEX) != null || matcher.group(GROUP_TYPE_GENERIC_INDEX) != null) {
result.value = matcher.group(GROUP_SIMPLE_INDEX); // depends on control dependency: [if], data = [none]
if (result.value == null && matcher.group(GROUP_ARRAY_INDEX) != null) {
result.value = matcher.group(GROUP_ARRAY_INDEX); // depends on control dependency: [if], data = [none]
result.array = true; // depends on control dependency: [if], data = [none]
}
if (result.value == null && matcher.group(GROUP_TYPE_GENERIC_INDEX) != null) {
result.value = matcher.group(GROUP_TYPE_GENERIC_INDEX); // depends on control dependency: [if], data = [none]
result.typeParameter=matcher.group(GROUP_TYPE_PARAMETER_INDEX); // depends on control dependency: [if], data = [none]
}
if (result.value!=null && result.value.indexOf(".") >= 0) {
// assert: JDK lang
result.rawType = result.value; // depends on control dependency: [if], data = [none]
if (result.rawType.startsWith("java")) {
// assert: raw type is type defined in jdk
try {
result.resolvedRawType = Class.forName(result.rawType); // depends on control dependency: [try], data = [none]
} catch (ClassNotFoundException e) {
} // depends on control dependency: [catch], data = [none]
}
} else {
// assert: primitive
result.rawType = result.value; // depends on control dependency: [if], data = [none]
result.primitive = true; // depends on control dependency: [if], data = [none]
Class<?> resolved[] = { Byte.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE };
for (Class<?> i : resolved) {
if (result.rawType.equals(i.getSimpleName())) {
result.resolvedRawType = i; // depends on control dependency: [if], data = [none]
break;
}
}
if (Void.TYPE.getSimpleName().equals(result.rawType))
{
result.resolvedRawType=Void.TYPE;
}
}
}
}
return result;
} }
|
public class class_name {
public static void write( String content,
Writer writer ) throws IOException {
CheckArg.isNotNull(writer, "destination writer");
boolean error = false;
try {
if (content != null) {
writer.write(content);
}
} catch (IOException e) {
error = true; // this error should be thrown, even if there is an error flushing/closing writer
throw e;
} catch (RuntimeException e) {
error = true; // this error should be thrown, even if there is an error flushing/closing writer
throw e;
} finally {
try {
writer.flush();
} catch (IOException e) {
if (!error) throw e;
} finally {
try {
writer.close();
} catch (IOException e) {
if (!error) throw e;
}
}
}
} }
|
public class class_name {
public static void write( String content,
Writer writer ) throws IOException {
CheckArg.isNotNull(writer, "destination writer");
boolean error = false;
try {
if (content != null) {
writer.write(content); // depends on control dependency: [if], data = [(content]
}
} catch (IOException e) {
error = true; // this error should be thrown, even if there is an error flushing/closing writer
throw e;
} catch (RuntimeException e) {
error = true; // this error should be thrown, even if there is an error flushing/closing writer
throw e;
} finally {
try {
writer.flush(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
if (!error) throw e;
} finally { // depends on control dependency: [catch], data = [none]
try {
writer.close(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
if (!error) throw e;
} // depends on control dependency: [catch], data = [none]
}
}
} }
|
public class class_name {
@SuppressWarnings("unchecked")
private static <T> Converter<Object, T> lookupConversionService(Class from, Class to) {
for (ConversionProvider converter : convServices) {
Converter c = converter.getConverter(from, to);
if (c != null) {
return c;
}
}
return null;
} }
|
public class class_name {
@SuppressWarnings("unchecked")
private static <T> Converter<Object, T> lookupConversionService(Class from, Class to) {
for (ConversionProvider converter : convServices) {
Converter c = converter.getConverter(from, to);
if (c != null) {
return c; // depends on control dependency: [if], data = [none]
}
}
return null;
} }
|
public class class_name {
public static void invokeSwingAction(final Runnable runnable) {
if (SwingUtilities.isEventDispatchThread()) {
runnable.run();
} else {
SwingUtilities.invokeLater(runnable);
}
} }
|
public class class_name {
public static void invokeSwingAction(final Runnable runnable) {
if (SwingUtilities.isEventDispatchThread()) {
runnable.run(); // depends on control dependency: [if], data = [none]
} else {
SwingUtilities.invokeLater(runnable); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public <T> Collection<T> collectAll(InputStream inputStream, Class<T> tClass, JsonPath... paths) {
CollectAllListener<T> listener = new CollectAllListener<T>(jsonProvider, tClass);
SurfingConfiguration.Builder builder = configBuilder();
for (JsonPath jsonPath : paths) {
builder.bind(jsonPath, listener);
}
surf(inputStream, builder.build());
return listener.getCollection();
} }
|
public class class_name {
public <T> Collection<T> collectAll(InputStream inputStream, Class<T> tClass, JsonPath... paths) {
CollectAllListener<T> listener = new CollectAllListener<T>(jsonProvider, tClass);
SurfingConfiguration.Builder builder = configBuilder();
for (JsonPath jsonPath : paths) {
builder.bind(jsonPath, listener); // depends on control dependency: [for], data = [jsonPath]
}
surf(inputStream, builder.build());
return listener.getCollection();
} }
|
public class class_name {
public void parseEndEvents(Element parentElement, ScopeImpl scope) {
for (Element endEventElement : parentElement.elements("endEvent")) {
ActivityImpl activity = createActivityOnScope(endEventElement, scope);
Element errorEventDefinition = endEventElement.element(ERROR_EVENT_DEFINITION);
Element cancelEventDefinition = endEventElement.element(CANCEL_EVENT_DEFINITION);
Element terminateEventDefinition = endEventElement.element("terminateEventDefinition");
Element messageEventDefinitionElement = endEventElement.element(MESSAGE_EVENT_DEFINITION);
Element signalEventDefinition = endEventElement.element(SIGNAL_EVENT_DEFINITION);
Element compensateEventDefinitionElement = endEventElement.element(COMPENSATE_EVENT_DEFINITION);
Element escalationEventDefinition = endEventElement.element(ESCALATION_EVENT_DEFINITION);
if (errorEventDefinition != null) { // error end event
String errorRef = errorEventDefinition.attribute("errorRef");
if (errorRef == null || "".equals(errorRef)) {
addError("'errorRef' attribute is mandatory on error end event", errorEventDefinition);
} else {
Error error = errors.get(errorRef);
if (error != null && (error.getErrorCode() == null || "".equals(error.getErrorCode()))) {
addError(
"'errorCode' is mandatory on errors referenced by throwing error event definitions, but the error '" + error.getId() + "' does not define one.",
errorEventDefinition);
}
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_ERROR);
if(error != null) {
activity.setActivityBehavior(new ErrorEndEventActivityBehavior(error.getErrorCode()));
} else {
activity.setActivityBehavior(new ErrorEndEventActivityBehavior(errorRef));
}
}
} else if (cancelEventDefinition != null) {
if (scope.getProperty(BpmnProperties.TYPE.getName()) == null || !scope.getProperty(BpmnProperties.TYPE.getName()).equals("transaction")) {
addError("end event with cancelEventDefinition only supported inside transaction subprocess", cancelEventDefinition);
} else {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_CANCEL);
activity.setActivityBehavior(new CancelEndEventActivityBehavior());
activity.setActivityStartBehavior(ActivityStartBehavior.INTERRUPT_FLOW_SCOPE);
activity.setProperty(PROPERTYNAME_THROWS_COMPENSATION, true);
activity.setScope(true);
}
} else if (terminateEventDefinition != null) {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_TERMINATE);
activity.setActivityBehavior(new TerminateEndEventActivityBehavior());
activity.setActivityStartBehavior(ActivityStartBehavior.INTERRUPT_FLOW_SCOPE);
} else if (messageEventDefinitionElement != null) {
if (isServiceTaskLike(messageEventDefinitionElement)) {
// CAM-436 same behaviour as service task
ActivityImpl act = parseServiceTaskLike(ActivityTypes.END_EVENT_MESSAGE, messageEventDefinitionElement, scope);
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_MESSAGE);
activity.setActivityBehavior(act.getActivityBehavior());
scope.getActivities().remove(act);
} else {
// default to non behavior if no service task
// properties have been specified
activity.setActivityBehavior(new IntermediateThrowNoneEventActivityBehavior());
}
} else if (signalEventDefinition != null) {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_SIGNAL);
EventSubscriptionDeclaration signalDefinition = parseSignalEventDefinition(signalEventDefinition, true);
activity.setActivityBehavior(new ThrowSignalEventActivityBehavior(signalDefinition));
} else if (compensateEventDefinitionElement != null) {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_COMPENSATION);
CompensateEventDefinition compensateEventDefinition = parseThrowCompensateEventDefinition(compensateEventDefinitionElement, scope);
activity.setActivityBehavior(new CompensationEventActivityBehavior(compensateEventDefinition));
activity.setProperty(PROPERTYNAME_THROWS_COMPENSATION, true);
activity.setScope(true);
} else if(escalationEventDefinition != null) {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_ESCALATION);
Escalation escalation = findEscalationForEscalationEventDefinition(escalationEventDefinition);
if (escalation != null && escalation.getEscalationCode() == null) {
addError("escalation end event must have an 'escalationCode'", escalationEventDefinition);
}
activity.setActivityBehavior(new ThrowEscalationEventActivityBehavior(escalation));
} else { // default: none end event
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_NONE);
activity.setActivityBehavior(new NoneEndEventActivityBehavior());
}
if (activity != null) {
parseActivityInputOutput(endEventElement, activity);
}
parseAsynchronousContinuationForActivity(endEventElement, activity);
parseExecutionListenersOnScope(endEventElement, activity);
for (BpmnParseListener parseListener : parseListeners) {
parseListener.parseEndEvent(endEventElement, scope, activity);
}
}
} }
|
public class class_name {
public void parseEndEvents(Element parentElement, ScopeImpl scope) {
for (Element endEventElement : parentElement.elements("endEvent")) {
ActivityImpl activity = createActivityOnScope(endEventElement, scope);
Element errorEventDefinition = endEventElement.element(ERROR_EVENT_DEFINITION);
Element cancelEventDefinition = endEventElement.element(CANCEL_EVENT_DEFINITION);
Element terminateEventDefinition = endEventElement.element("terminateEventDefinition");
Element messageEventDefinitionElement = endEventElement.element(MESSAGE_EVENT_DEFINITION);
Element signalEventDefinition = endEventElement.element(SIGNAL_EVENT_DEFINITION);
Element compensateEventDefinitionElement = endEventElement.element(COMPENSATE_EVENT_DEFINITION);
Element escalationEventDefinition = endEventElement.element(ESCALATION_EVENT_DEFINITION);
if (errorEventDefinition != null) { // error end event
String errorRef = errorEventDefinition.attribute("errorRef");
if (errorRef == null || "".equals(errorRef)) {
addError("'errorRef' attribute is mandatory on error end event", errorEventDefinition);
} else {
Error error = errors.get(errorRef);
if (error != null && (error.getErrorCode() == null || "".equals(error.getErrorCode()))) {
addError(
"'errorCode' is mandatory on errors referenced by throwing error event definitions, but the error '" + error.getId() + "' does not define one.",
errorEventDefinition); // depends on control dependency: [if], data = [none]
}
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_ERROR); // depends on control dependency: [if], data = [none]
if(error != null) {
activity.setActivityBehavior(new ErrorEndEventActivityBehavior(error.getErrorCode())); // depends on control dependency: [if], data = [(error]
} else {
activity.setActivityBehavior(new ErrorEndEventActivityBehavior(errorRef)); // depends on control dependency: [if], data = [(error]
}
}
} else if (cancelEventDefinition != null) {
if (scope.getProperty(BpmnProperties.TYPE.getName()) == null || !scope.getProperty(BpmnProperties.TYPE.getName()).equals("transaction")) {
addError("end event with cancelEventDefinition only supported inside transaction subprocess", cancelEventDefinition); // depends on control dependency: [if], data = [none]
} else {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_CANCEL); // depends on control dependency: [if], data = [none]
activity.setActivityBehavior(new CancelEndEventActivityBehavior()); // depends on control dependency: [if], data = [none]
activity.setActivityStartBehavior(ActivityStartBehavior.INTERRUPT_FLOW_SCOPE); // depends on control dependency: [if], data = [none]
activity.setProperty(PROPERTYNAME_THROWS_COMPENSATION, true); // depends on control dependency: [if], data = [none]
activity.setScope(true); // depends on control dependency: [if], data = [none]
}
} else if (terminateEventDefinition != null) {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_TERMINATE);
activity.setActivityBehavior(new TerminateEndEventActivityBehavior());
activity.setActivityStartBehavior(ActivityStartBehavior.INTERRUPT_FLOW_SCOPE);
} else if (messageEventDefinitionElement != null) {
if (isServiceTaskLike(messageEventDefinitionElement)) {
// CAM-436 same behaviour as service task
ActivityImpl act = parseServiceTaskLike(ActivityTypes.END_EVENT_MESSAGE, messageEventDefinitionElement, scope);
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_MESSAGE); // depends on control dependency: [if], data = [none]
activity.setActivityBehavior(act.getActivityBehavior()); // depends on control dependency: [if], data = [none]
scope.getActivities().remove(act); // depends on control dependency: [if], data = [none]
} else {
// default to non behavior if no service task
// properties have been specified
activity.setActivityBehavior(new IntermediateThrowNoneEventActivityBehavior()); // depends on control dependency: [if], data = [none]
}
} else if (signalEventDefinition != null) {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_SIGNAL);
EventSubscriptionDeclaration signalDefinition = parseSignalEventDefinition(signalEventDefinition, true);
activity.setActivityBehavior(new ThrowSignalEventActivityBehavior(signalDefinition));
} else if (compensateEventDefinitionElement != null) {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_COMPENSATION);
CompensateEventDefinition compensateEventDefinition = parseThrowCompensateEventDefinition(compensateEventDefinitionElement, scope);
activity.setActivityBehavior(new CompensationEventActivityBehavior(compensateEventDefinition));
activity.setProperty(PROPERTYNAME_THROWS_COMPENSATION, true);
activity.setScope(true);
} else if(escalationEventDefinition != null) {
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_ESCALATION);
Escalation escalation = findEscalationForEscalationEventDefinition(escalationEventDefinition);
if (escalation != null && escalation.getEscalationCode() == null) {
addError("escalation end event must have an 'escalationCode'", escalationEventDefinition); // depends on control dependency: [if], data = [none]
}
activity.setActivityBehavior(new ThrowEscalationEventActivityBehavior(escalation));
} else { // default: none end event
activity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.END_EVENT_NONE);
activity.setActivityBehavior(new NoneEndEventActivityBehavior());
}
if (activity != null) {
parseActivityInputOutput(endEventElement, activity); // depends on control dependency: [if], data = [none]
}
parseAsynchronousContinuationForActivity(endEventElement, activity);
parseExecutionListenersOnScope(endEventElement, activity);
for (BpmnParseListener parseListener : parseListeners) {
parseListener.parseEndEvent(endEventElement, scope, activity); // depends on control dependency: [for], data = [parseListener]
}
}
} }
|
public class class_name {
public static Date getObjectAsDate(FacesContext context, UICalendar calendar, Object value) {
if (value == null) {
return null;
}
if (value instanceof Date) {
return (Date) value;
}
String pattern = calendar.calculatePattern();
if (pattern != null) {
Locale locale = calendar.calculateLocale(context);
if (locale != null) {
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale);
try {
return dateFormat.parse(value.toString());
}
catch (ParseException ex) {
// NO-OP
}
}
}
if (calendar.getConverter() != null) {
try {
Object obj = calendar.getConverter().getAsObject(context, calendar, value.toString());
if (obj instanceof Date) {
return (Date) obj;
}
}
catch (ConverterException ex) {
// NO-OP
}
}
Converter converter = context.getApplication().createConverter(value.getClass());
if (converter != null) {
Object obj = converter.getAsObject(context, calendar, value.toString());
if (obj instanceof Date) {
return (Date) obj;
}
}
// TODO Currently we do not support conversion of jquery datepicker's special dates like 'today' or '+1m +7d'
// See http://api.jqueryui.com/datepicker/#option-maxDate, https://github.com/primefaces/primefaces/issues/4621
return null;
} }
|
public class class_name {
public static Date getObjectAsDate(FacesContext context, UICalendar calendar, Object value) {
if (value == null) {
return null; // depends on control dependency: [if], data = [none]
}
if (value instanceof Date) {
return (Date) value; // depends on control dependency: [if], data = [none]
}
String pattern = calendar.calculatePattern();
if (pattern != null) {
Locale locale = calendar.calculateLocale(context);
if (locale != null) {
SimpleDateFormat dateFormat = new SimpleDateFormat(pattern, locale);
try {
return dateFormat.parse(value.toString()); // depends on control dependency: [try], data = [none]
}
catch (ParseException ex) {
// NO-OP
} // depends on control dependency: [catch], data = [none]
}
}
if (calendar.getConverter() != null) {
try {
Object obj = calendar.getConverter().getAsObject(context, calendar, value.toString());
if (obj instanceof Date) {
return (Date) obj; // depends on control dependency: [if], data = [none]
}
}
catch (ConverterException ex) {
// NO-OP
} // depends on control dependency: [catch], data = [none]
}
Converter converter = context.getApplication().createConverter(value.getClass());
if (converter != null) {
Object obj = converter.getAsObject(context, calendar, value.toString());
if (obj instanceof Date) {
return (Date) obj; // depends on control dependency: [if], data = [none]
}
}
// TODO Currently we do not support conversion of jquery datepicker's special dates like 'today' or '+1m +7d'
// See http://api.jqueryui.com/datepicker/#option-maxDate, https://github.com/primefaces/primefaces/issues/4621
return null;
} }
|
public class class_name {
@SuppressWarnings("unchecked")
public Set<GroovyClass> compile() throws ScriptCompilationException {
final CompilerConfiguration conf = compileConfig != null ? compileConfig: CompilerConfiguration.DEFAULT;
conf.setTolerance(0);
conf.setVerbose(true);
conf.setTargetDirectory(targetDir.toFile());
final ClassLoader buildParentClassloader = parentClassLoader != null ?
parentClassLoader : Thread.currentThread().getContextClassLoader();
GroovyClassLoader groovyClassLoader = AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() {
public GroovyClassLoader run() {
return new GroovyClassLoader(buildParentClassloader, conf, false);
}
});
CompilationUnit unit = new CompilationUnit(conf, null, groovyClassLoader);
Set<String> scriptExtensions = conf.getScriptExtensions();
try {
for (ScriptArchive scriptArchive : scriptArchives) {
Set<String> entryNames = scriptArchive.getArchiveEntryNames();
for (String entryName : entryNames) {
for (String extension : scriptExtensions) {
if (entryName.endsWith(extension)) {
// identified groovy file
unit.addSource(scriptArchive.getEntry(entryName));
}
}
}
}
} catch (IOException e) {
throw new ScriptCompilationException("Exception loading source files", e);
}
for (Path sourceFile : sourceFiles) {
unit.addSource(sourceFile.toFile());
}
try {
unit.compile(Phases.OUTPUT);
} catch (CompilationFailedException e) {
throw new ScriptCompilationException("Exception during script compilation", e);
}
return new HashSet<GroovyClass>(unit.getClasses());
} }
|
public class class_name {
@SuppressWarnings("unchecked")
public Set<GroovyClass> compile() throws ScriptCompilationException {
final CompilerConfiguration conf = compileConfig != null ? compileConfig: CompilerConfiguration.DEFAULT;
conf.setTolerance(0);
conf.setVerbose(true);
conf.setTargetDirectory(targetDir.toFile());
final ClassLoader buildParentClassloader = parentClassLoader != null ?
parentClassLoader : Thread.currentThread().getContextClassLoader();
GroovyClassLoader groovyClassLoader = AccessController.doPrivileged(new PrivilegedAction<GroovyClassLoader>() {
public GroovyClassLoader run() {
return new GroovyClassLoader(buildParentClassloader, conf, false);
}
});
CompilationUnit unit = new CompilationUnit(conf, null, groovyClassLoader);
Set<String> scriptExtensions = conf.getScriptExtensions();
try {
for (ScriptArchive scriptArchive : scriptArchives) {
Set<String> entryNames = scriptArchive.getArchiveEntryNames();
for (String entryName : entryNames) {
for (String extension : scriptExtensions) {
if (entryName.endsWith(extension)) {
// identified groovy file
unit.addSource(scriptArchive.getEntry(entryName)); // depends on control dependency: [if], data = [none]
}
}
}
}
} catch (IOException e) {
throw new ScriptCompilationException("Exception loading source files", e);
}
for (Path sourceFile : sourceFiles) {
unit.addSource(sourceFile.toFile());
}
try {
unit.compile(Phases.OUTPUT);
} catch (CompilationFailedException e) {
throw new ScriptCompilationException("Exception during script compilation", e);
}
return new HashSet<GroovyClass>(unit.getClasses());
} }
|
public class class_name {
private void checkStdinCloses()
{
List<OsxProcess> processes = new ArrayList<>();
// drainTo() is known to be atomic for ArrayBlockingQueue
closeQueue.drainTo(processes);
for (OsxProcess process : processes) {
process.getStdin().close();
}
} }
|
public class class_name {
private void checkStdinCloses()
{
List<OsxProcess> processes = new ArrayList<>();
// drainTo() is known to be atomic for ArrayBlockingQueue
closeQueue.drainTo(processes);
for (OsxProcess process : processes) {
process.getStdin().close(); // depends on control dependency: [for], data = [process]
}
} }
|
public class class_name {
private void makeCurvilinearAxis( NetcdfFile ncfile ) {
List<Variable> vars = ncfile.getRootGroup().getVariables();
String latpp = null, lonpp = null, latU = null, lonU = null, latV = null, lonV = null;
// has to be done twice because there's no guarantee that the
// coordinate variables will be accessed first
List<String> timeDimLL = new ArrayList<>();
List<String> timeDimV = new ArrayList<>();
for( Variable var : vars ) {
if( var.getShortName().startsWith( "Latitude") ) {
// remove time dependency
int[] shape = var.getShape();
if (var.getRank() == 3 && shape[0] == 1) { // remove time dependencies - MAJOR KLUDGE
List<Dimension> dims = var.getDimensions();
if( ! timeDimLL.contains( dims.get( 0 ).getShortName() ))
timeDimLL.add( dims.get( 0 ).getShortName() );
dims.remove(0);
var.setDimensions(dims);
}
// add lat attributes
var.addAttribute(new Attribute("units", "degrees_north"));
var.addAttribute(new Attribute("long_name", "latitude coordinate"));
var.addAttribute(new Attribute("standard_name", "latitude"));
var.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Lat.toString()));
if( var.getShortName().contains( "U_Wind_Component")) {
latU = var.getFullName();
} else if( var.getShortName().contains( "V_Wind_Component")) {
latV = var.getFullName();
} else {
latpp = var.getFullName();
}
} else if( var.getShortName().startsWith( "Longitude" )) {
// remove time dependency
int[] shape = var.getShape();
if (var.getRank() == 3 && shape[0] == 1) { // remove time dependencies - MAJOR KLUDGE
List<Dimension> dims = var.getDimensions();
if( ! timeDimLL.contains( dims.get( 0 ).getShortName() ))
timeDimLL.add( dims.get( 0 ).getShortName() );
dims.remove(0);
var.setDimensions(dims);
}
// add lon attributes
var.addAttribute(new Attribute("units", "degrees_east"));
var.addAttribute(new Attribute("long_name", "longitude coordinate"));
var.addAttribute(new Attribute("standard_name", "longitude"));
var.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Lon.toString()));
if( var.getShortName().contains( "U_Wind_Component")) {
lonU = var.getFullName();
} else if( var.getShortName().contains( "V_Wind_Component")) {
lonV = var.getFullName();
} else {
lonpp = var.getFullName();
}
}
}
// add coordinates attribute to variables
for( Variable var : vars ) {
List<Dimension> dims = var.getDimensions();
if( var.getShortName().startsWith( "U-component") ) {
var.addAttribute(new Attribute("coordinates", latU +" "+ lonU));
if( ! timeDimV.contains( dims.get( 0 ).getShortName() ))
timeDimV.add( dims.get( 0 ).getShortName() );
} else if( var.getShortName().startsWith( "V-component") ) {
var.addAttribute(new Attribute("coordinates", latV +" "+ lonV));
if( ! timeDimV.contains( dims.get( 0 ).getShortName() ))
timeDimV.add( dims.get( 0 ).getShortName() );
// rest of variables default to Pressure_Point
} else {
var.addAttribute(new Attribute("coordinates", latpp +" "+ lonpp));
if( ! timeDimV.contains( dims.get( 0 ).getShortName() ))
timeDimV.add( dims.get( 0 ).getShortName() );
}
}
/* remove Latitude/Longitude time dimension and variable if possible
for( String tdLL : timeDimLL) {
if( timeDimV.contains( tdLL ))
continue;
// else only used with Lat/Lon
ncfile.getRootGroup().removeDimension( tdLL );
ncfile.getRootGroup().removeVariable( tdLL );
} */
} }
|
public class class_name {
private void makeCurvilinearAxis( NetcdfFile ncfile ) {
List<Variable> vars = ncfile.getRootGroup().getVariables();
String latpp = null, lonpp = null, latU = null, lonU = null, latV = null, lonV = null;
// has to be done twice because there's no guarantee that the
// coordinate variables will be accessed first
List<String> timeDimLL = new ArrayList<>();
List<String> timeDimV = new ArrayList<>();
for( Variable var : vars ) {
if( var.getShortName().startsWith( "Latitude") ) {
// remove time dependency
int[] shape = var.getShape();
if (var.getRank() == 3 && shape[0] == 1) { // remove time dependencies - MAJOR KLUDGE
List<Dimension> dims = var.getDimensions();
if( ! timeDimLL.contains( dims.get( 0 ).getShortName() ))
timeDimLL.add( dims.get( 0 ).getShortName() );
dims.remove(0); // depends on control dependency: [if], data = [none]
var.setDimensions(dims); // depends on control dependency: [if], data = [none]
}
// add lat attributes
var.addAttribute(new Attribute("units", "degrees_north")); // depends on control dependency: [if], data = [none]
var.addAttribute(new Attribute("long_name", "latitude coordinate")); // depends on control dependency: [if], data = [none]
var.addAttribute(new Attribute("standard_name", "latitude")); // depends on control dependency: [if], data = [none]
var.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Lat.toString())); // depends on control dependency: [if], data = [none]
if( var.getShortName().contains( "U_Wind_Component")) {
latU = var.getFullName(); // depends on control dependency: [if], data = [none]
} else if( var.getShortName().contains( "V_Wind_Component")) {
latV = var.getFullName(); // depends on control dependency: [if], data = [none]
} else {
latpp = var.getFullName(); // depends on control dependency: [if], data = [none]
}
} else if( var.getShortName().startsWith( "Longitude" )) {
// remove time dependency
int[] shape = var.getShape();
if (var.getRank() == 3 && shape[0] == 1) { // remove time dependencies - MAJOR KLUDGE
List<Dimension> dims = var.getDimensions();
if( ! timeDimLL.contains( dims.get( 0 ).getShortName() ))
timeDimLL.add( dims.get( 0 ).getShortName() );
dims.remove(0); // depends on control dependency: [if], data = [none]
var.setDimensions(dims); // depends on control dependency: [if], data = [none]
}
// add lon attributes
var.addAttribute(new Attribute("units", "degrees_east")); // depends on control dependency: [if], data = [none]
var.addAttribute(new Attribute("long_name", "longitude coordinate")); // depends on control dependency: [if], data = [none]
var.addAttribute(new Attribute("standard_name", "longitude")); // depends on control dependency: [if], data = [none]
var.addAttribute(new Attribute(_Coordinate.AxisType, AxisType.Lon.toString())); // depends on control dependency: [if], data = [none]
if( var.getShortName().contains( "U_Wind_Component")) {
lonU = var.getFullName(); // depends on control dependency: [if], data = [none]
} else if( var.getShortName().contains( "V_Wind_Component")) {
lonV = var.getFullName(); // depends on control dependency: [if], data = [none]
} else {
lonpp = var.getFullName(); // depends on control dependency: [if], data = [none]
}
}
}
// add coordinates attribute to variables
for( Variable var : vars ) {
List<Dimension> dims = var.getDimensions();
if( var.getShortName().startsWith( "U-component") ) {
var.addAttribute(new Attribute("coordinates", latU +" "+ lonU)); // depends on control dependency: [if], data = [none]
if( ! timeDimV.contains( dims.get( 0 ).getShortName() ))
timeDimV.add( dims.get( 0 ).getShortName() );
} else if( var.getShortName().startsWith( "V-component") ) {
var.addAttribute(new Attribute("coordinates", latV +" "+ lonV)); // depends on control dependency: [if], data = [none]
if( ! timeDimV.contains( dims.get( 0 ).getShortName() ))
timeDimV.add( dims.get( 0 ).getShortName() );
// rest of variables default to Pressure_Point
} else {
var.addAttribute(new Attribute("coordinates", latpp +" "+ lonpp)); // depends on control dependency: [if], data = [none]
if( ! timeDimV.contains( dims.get( 0 ).getShortName() ))
timeDimV.add( dims.get( 0 ).getShortName() );
}
}
/* remove Latitude/Longitude time dimension and variable if possible
for( String tdLL : timeDimLL) {
if( timeDimV.contains( tdLL ))
continue;
// else only used with Lat/Lon
ncfile.getRootGroup().removeDimension( tdLL );
ncfile.getRootGroup().removeVariable( tdLL );
} */
} }
|
public class class_name {
public FeatureRow getFeatureRow(GeometryIndex geometryIndex) {
long geomId = geometryIndex.getGeomId();
// Get the row or lock for reading
FeatureRow row = featureRowSync.getRowOrLock(geomId);
if (row == null) {
// Query for the row and set in the sync
try {
row = featureDao.queryForIdRow(geomId);
} finally {
featureRowSync.setRow(geomId, row);
}
}
return row;
} }
|
public class class_name {
public FeatureRow getFeatureRow(GeometryIndex geometryIndex) {
long geomId = geometryIndex.getGeomId();
// Get the row or lock for reading
FeatureRow row = featureRowSync.getRowOrLock(geomId);
if (row == null) {
// Query for the row and set in the sync
try {
row = featureDao.queryForIdRow(geomId); // depends on control dependency: [try], data = [none]
} finally {
featureRowSync.setRow(geomId, row);
}
}
return row;
} }
|
public class class_name {
public void buildInitialLayout(PageLayoutBuilder pageLayout) {
for (Iterator iter = _viewDescriptors.iterator(); iter.hasNext();) {
String viewDescriptorId = (String) iter.next();
pageLayout.addView(viewDescriptorId);
}
} }
|
public class class_name {
public void buildInitialLayout(PageLayoutBuilder pageLayout) {
for (Iterator iter = _viewDescriptors.iterator(); iter.hasNext();) {
String viewDescriptorId = (String) iter.next();
pageLayout.addView(viewDescriptorId); // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
public static String overlay(final String str, String overlay, int start, int end) {
if (str == null) {
return null;
}
if (overlay == null) {
overlay = EMPTY;
}
final int len = str.length();
if (start < 0) {
start = 0;
}
if (start > len) {
start = len;
}
if (end < 0) {
end = 0;
}
if (end > len) {
end = len;
}
if (start > end) {
final int temp = start;
start = end;
end = temp;
}
return str.substring(0, start) +
overlay +
str.substring(end);
} }
|
public class class_name {
public static String overlay(final String str, String overlay, int start, int end) {
if (str == null) {
return null; // depends on control dependency: [if], data = [none]
}
if (overlay == null) {
overlay = EMPTY; // depends on control dependency: [if], data = [none]
}
final int len = str.length();
if (start < 0) {
start = 0; // depends on control dependency: [if], data = [none]
}
if (start > len) {
start = len; // depends on control dependency: [if], data = [none]
}
if (end < 0) {
end = 0; // depends on control dependency: [if], data = [none]
}
if (end > len) {
end = len; // depends on control dependency: [if], data = [none]
}
if (start > end) {
final int temp = start;
start = end; // depends on control dependency: [if], data = [none]
end = temp; // depends on control dependency: [if], data = [none]
}
return str.substring(0, start) +
overlay +
str.substring(end);
} }
|
public class class_name {
@Override
public long getPausedWorkerCount() {
return PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, Long>() {
/**
* {@inheritDoc}
*/
@Override
public Long doWork(final Jedis jedis) throws Exception {
long pausedCount = 0L;
final Set<String> workerNames = jedis.smembers(key(WORKERS));
for (final String workerName : workerNames) {
if (isWorkerInState(workerName, WorkerInfo.State.PAUSED, jedis)) {
pausedCount++;
}
}
return pausedCount;
}
});
} }
|
public class class_name {
@Override
public long getPausedWorkerCount() {
return PoolUtils.doWorkInPoolNicely(this.jedisPool, new PoolWork<Jedis, Long>() {
/**
* {@inheritDoc}
*/
@Override
public Long doWork(final Jedis jedis) throws Exception {
long pausedCount = 0L;
final Set<String> workerNames = jedis.smembers(key(WORKERS));
for (final String workerName : workerNames) {
if (isWorkerInState(workerName, WorkerInfo.State.PAUSED, jedis)) {
pausedCount++; // depends on control dependency: [if], data = [none]
}
}
return pausedCount;
}
});
} }
|
public class class_name {
public static boolean entryEquals(File f1, File f2, String path1, String path2) {
ZipFile zf1 = null;
ZipFile zf2 = null;
try {
zf1 = new ZipFile(f1);
zf2 = new ZipFile(f2);
return doEntryEquals(zf1, zf2, path1, path2);
}
catch (IOException e) {
throw ZipExceptionUtil.rethrow(e);
}
finally {
closeQuietly(zf1);
closeQuietly(zf2);
}
} }
|
public class class_name {
public static boolean entryEquals(File f1, File f2, String path1, String path2) {
ZipFile zf1 = null;
ZipFile zf2 = null;
try {
zf1 = new ZipFile(f1); // depends on control dependency: [try], data = [none]
zf2 = new ZipFile(f2); // depends on control dependency: [try], data = [none]
return doEntryEquals(zf1, zf2, path1, path2); // depends on control dependency: [try], data = [none]
}
catch (IOException e) {
throw ZipExceptionUtil.rethrow(e);
} // depends on control dependency: [catch], data = [none]
finally {
closeQuietly(zf1);
closeQuietly(zf2);
}
} }
|
public class class_name {
private void sendRequest() {
final String queryString = !eventSpinner.isEnabled() ? String.valueOf(queryEditText.getText()) : null;
final String eventString = eventSpinner.isEnabled() ? String.valueOf(String.valueOf(eventSpinner.getSelectedItem())) : null;
final String contextString = String.valueOf(contextEditText.getText());
if (TextUtils.isEmpty(queryString) && TextUtils.isEmpty(eventString)) {
onError(new AIError(getString(R.string.non_empty_query)));
return;
}
final AsyncTask<String, Void, AIResponse> task = new AsyncTask<String, Void, AIResponse>() {
private AIError aiError;
@Override
protected AIResponse doInBackground(final String... params) {
final AIRequest request = new AIRequest();
String query = params[0];
String event = params[1];
if (!TextUtils.isEmpty(query))
request.setQuery(query);
if (!TextUtils.isEmpty(event))
request.setEvent(new AIEvent(event));
final String contextString = params[2];
RequestExtras requestExtras = null;
if (!TextUtils.isEmpty(contextString)) {
final List<AIContext> contexts = Collections.singletonList(new AIContext(contextString));
requestExtras = new RequestExtras(contexts, null);
}
try {
return aiDataService.request(request, requestExtras);
} catch (final AIServiceException e) {
aiError = new AIError(e);
return null;
}
}
@Override
protected void onPostExecute(final AIResponse response) {
if (response != null) {
onResult(response);
} else {
onError(aiError);
}
}
};
task.execute(queryString, eventString, contextString);
} }
|
public class class_name {
private void sendRequest() {
final String queryString = !eventSpinner.isEnabled() ? String.valueOf(queryEditText.getText()) : null;
final String eventString = eventSpinner.isEnabled() ? String.valueOf(String.valueOf(eventSpinner.getSelectedItem())) : null;
final String contextString = String.valueOf(contextEditText.getText());
if (TextUtils.isEmpty(queryString) && TextUtils.isEmpty(eventString)) {
onError(new AIError(getString(R.string.non_empty_query))); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
final AsyncTask<String, Void, AIResponse> task = new AsyncTask<String, Void, AIResponse>() {
private AIError aiError;
@Override
protected AIResponse doInBackground(final String... params) {
final AIRequest request = new AIRequest();
String query = params[0];
String event = params[1];
if (!TextUtils.isEmpty(query))
request.setQuery(query);
if (!TextUtils.isEmpty(event))
request.setEvent(new AIEvent(event));
final String contextString = params[2];
RequestExtras requestExtras = null;
if (!TextUtils.isEmpty(contextString)) {
final List<AIContext> contexts = Collections.singletonList(new AIContext(contextString));
requestExtras = new RequestExtras(contexts, null); // depends on control dependency: [if], data = [none]
}
try {
return aiDataService.request(request, requestExtras); // depends on control dependency: [try], data = [none]
} catch (final AIServiceException e) {
aiError = new AIError(e);
return null;
} // depends on control dependency: [catch], data = [none]
}
@Override
protected void onPostExecute(final AIResponse response) {
if (response != null) {
onResult(response); // depends on control dependency: [if], data = [(response]
} else {
onError(aiError); // depends on control dependency: [if], data = [none]
}
}
};
task.execute(queryString, eventString, contextString);
} }
|
public class class_name {
public static boolean isCoercable(final Class<?> to, final Class<?> from) {
final Class<?> boxedTo = boxClass(to);
final Class<?> boxedFrom = boxClass(from);
if (Number.class.isAssignableFrom(boxedTo)
&& Number.class.isAssignableFrom(boxedFrom)) {
return SIZEOF.get(boxedFrom) <= SIZEOF.get(boxedTo);
}
return boxedTo.isAssignableFrom(boxedFrom);
} }
|
public class class_name {
public static boolean isCoercable(final Class<?> to, final Class<?> from) {
final Class<?> boxedTo = boxClass(to);
final Class<?> boxedFrom = boxClass(from);
if (Number.class.isAssignableFrom(boxedTo)
&& Number.class.isAssignableFrom(boxedFrom)) {
return SIZEOF.get(boxedFrom) <= SIZEOF.get(boxedTo); // depends on control dependency: [if], data = [none]
}
return boxedTo.isAssignableFrom(boxedFrom);
} }
|
public class class_name {
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public static Searcher create(@NonNull final Searchable searchable) {
final String key = searchable.toString();
Searcher instance = instances.get(key);
if (instance == null) {
instance = new Searcher(searchable, key);
instances.put(key, instance);
} else {
throw new IllegalStateException("There is already a Searcher for index " + key + ", you must specify a variant.");
}
return instance;
} }
|
public class class_name {
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public static Searcher create(@NonNull final Searchable searchable) {
final String key = searchable.toString();
Searcher instance = instances.get(key);
if (instance == null) {
instance = new Searcher(searchable, key); // depends on control dependency: [if], data = [none]
instances.put(key, instance); // depends on control dependency: [if], data = [none]
} else {
throw new IllegalStateException("There is already a Searcher for index " + key + ", you must specify a variant.");
}
return instance;
} }
|
public class class_name {
public boolean greaterThan(long val) {
if (isInfinity && posOrNeg) {
return true;
} else if (isInfinity && !posOrNeg) {
return false;
} else {
return this.val > val;
}
} }
|
public class class_name {
public boolean greaterThan(long val) {
if (isInfinity && posOrNeg) {
return true; // depends on control dependency: [if], data = [none]
} else if (isInfinity && !posOrNeg) {
return false; // depends on control dependency: [if], data = [none]
} else {
return this.val > val; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private static void addRecipientSelector(String value, StringBuilder sb) {
if (value != null) {
sb.append(" OR Recipients LIKE '%,").append(value).append(",%'");
}
} }
|
public class class_name {
private static void addRecipientSelector(String value, StringBuilder sb) {
if (value != null) {
sb.append(" OR Recipients LIKE '%,").append(value).append(",%'"); // depends on control dependency: [if], data = [(value]
}
} }
|
public class class_name {
@EventMapping(SearchConstants.SEARCH_RESULTS_QNAME_STRING)
public void handleSearchResult(EventRequest request) {
// UP-3887 Design flaw. Both the searchLauncher portlet instance and the search portlet
// instance receive
// searchRequest and searchResult events because they are in the same portlet code base (to
// share
// autosuggest_handler.jsp and because we have to calculate the search portlet url for the
// ajax call)
// and share the portlet.xml which defines the event handling behavior.
// If this instance is the searchLauncher, ignore the searchResult. The search was submitted
// to the search
// portlet instance.
final String searchLaunchFname =
request.getPreferences().getValue(SEARCH_LAUNCH_FNAME, null);
if (searchLaunchFname != null) {
// Noisy in debug mode so commenting out debug message
// logger.debug("SearchLauncher does not process SearchResponse events so discarding
// message");
return;
}
final Event event = request.getEvent();
final SearchResults portletSearchResults = (SearchResults) event.getValue();
// get the existing portal search result from the session and append
// the results for this event
final String queryId = portletSearchResults.getQueryId();
final PortalSearchResults results = this.getPortalSearchResults(request, queryId);
if (results == null) {
this.logger.warn(
"No PortalSearchResults found for queryId {}, ignoring search results from {}",
queryId,
getSearchResultsSource(portletSearchResults));
return;
}
if (logger.isDebugEnabled()) {
logger.debug(
"For queryId {}, adding {} search results from {}",
queryId,
portletSearchResults.getSearchResult().size(),
getSearchResultsSource(portletSearchResults));
}
final String windowId = portletSearchResults.getWindowId();
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
final IPortletWindowId portletWindowId =
this.portletWindowRegistry.getPortletWindowId(httpServletRequest, windowId);
// Add the other portlet's results to the main search results object
this.addSearchResults(portletSearchResults, results, httpServletRequest, portletWindowId);
} }
|
public class class_name {
@EventMapping(SearchConstants.SEARCH_RESULTS_QNAME_STRING)
public void handleSearchResult(EventRequest request) {
// UP-3887 Design flaw. Both the searchLauncher portlet instance and the search portlet
// instance receive
// searchRequest and searchResult events because they are in the same portlet code base (to
// share
// autosuggest_handler.jsp and because we have to calculate the search portlet url for the
// ajax call)
// and share the portlet.xml which defines the event handling behavior.
// If this instance is the searchLauncher, ignore the searchResult. The search was submitted
// to the search
// portlet instance.
final String searchLaunchFname =
request.getPreferences().getValue(SEARCH_LAUNCH_FNAME, null);
if (searchLaunchFname != null) {
// Noisy in debug mode so commenting out debug message
// logger.debug("SearchLauncher does not process SearchResponse events so discarding
// message");
return; // depends on control dependency: [if], data = [none]
}
final Event event = request.getEvent();
final SearchResults portletSearchResults = (SearchResults) event.getValue();
// get the existing portal search result from the session and append
// the results for this event
final String queryId = portletSearchResults.getQueryId();
final PortalSearchResults results = this.getPortalSearchResults(request, queryId);
if (results == null) {
this.logger.warn(
"No PortalSearchResults found for queryId {}, ignoring search results from {}",
queryId,
getSearchResultsSource(portletSearchResults)); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
if (logger.isDebugEnabled()) {
logger.debug(
"For queryId {}, adding {} search results from {}",
queryId,
portletSearchResults.getSearchResult().size(),
getSearchResultsSource(portletSearchResults)); // depends on control dependency: [if], data = [none]
}
final String windowId = portletSearchResults.getWindowId();
final HttpServletRequest httpServletRequest =
this.portalRequestUtils.getPortletHttpRequest(request);
final IPortletWindowId portletWindowId =
this.portletWindowRegistry.getPortletWindowId(httpServletRequest, windowId);
// Add the other portlet's results to the main search results object
this.addSearchResults(portletSearchResults, results, httpServletRequest, portletWindowId);
} }
|
public class class_name {
public static boolean isEjadi(String str)
{
if (str.startsWith("e") || str.startsWith("E") || str.startsWith("o") || str.startsWith("O") || str.startsWith("e3") || str.startsWith("E3") || str.startsWith("o3") || str.startsWith("O3"))
{
return true;
}
return false;
} }
|
public class class_name {
public static boolean isEjadi(String str)
{
if (str.startsWith("e") || str.startsWith("E") || str.startsWith("o") || str.startsWith("O") || str.startsWith("e3") || str.startsWith("E3") || str.startsWith("o3") || str.startsWith("O3"))
{
return true; // depends on control dependency: [if], data = [none]
}
return false;
} }
|
public class class_name {
public Endpoint getEndpoint(ModuleIdentifier identifier) {
for (Endpoint endpoint : getEndpoints()) {
if (endpoint.getIdentifier().equals(identifier)) {
return endpoint;
}
}
return null;
} }
|
public class class_name {
public Endpoint getEndpoint(ModuleIdentifier identifier) {
for (Endpoint endpoint : getEndpoints()) {
if (endpoint.getIdentifier().equals(identifier)) {
return endpoint; // depends on control dependency: [if], data = [none]
}
}
return null;
} }
|
public class class_name {
public static void init(final AuthAPI authzAPI, AuthzFacade facade) throws Exception {
////////
// Overall APIs
///////
authzAPI.route(HttpMethods.GET,"/api",API.API,new Code(facade,"Document API", true) {
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
Result<Void> r = context.getAPI(trans,resp,authzAPI);
if(r.isOK()) {
resp.setStatus(HttpStatus.OK_200);
} else {
context.error(trans,resp,r);
}
}
});
////////
// Overall Examples
///////
authzAPI.route(HttpMethods.GET,"/api/example/*",API.VOID,new Code(facade,"Document API", true) {
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
String pathInfo = req.getPathInfo();
int question = pathInfo.lastIndexOf('?');
pathInfo = pathInfo.substring(13, question<0?pathInfo.length():question);// IMPORTANT, this is size of "/api/example/"
String nameOrContextType=Symm.base64noSplit.decode(pathInfo);
Result<Void> r = context.getAPIExample(trans,resp,nameOrContextType,
question>=0 && "optional=true".equalsIgnoreCase(req.getPathInfo().substring(question+1))
);
if(r.isOK()) {
resp.setStatus(HttpStatus.OK_200);
} else {
context.error(trans,resp,r);
}
}
});
} }
|
public class class_name {
public static void init(final AuthAPI authzAPI, AuthzFacade facade) throws Exception {
////////
// Overall APIs
///////
authzAPI.route(HttpMethods.GET,"/api",API.API,new Code(facade,"Document API", true) {
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
Result<Void> r = context.getAPI(trans,resp,authzAPI);
if(r.isOK()) {
resp.setStatus(HttpStatus.OK_200); // depends on control dependency: [if], data = [none]
} else {
context.error(trans,resp,r); // depends on control dependency: [if], data = [none]
}
}
});
////////
// Overall Examples
///////
authzAPI.route(HttpMethods.GET,"/api/example/*",API.VOID,new Code(facade,"Document API", true) {
@Override
public void handle(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp) throws Exception {
String pathInfo = req.getPathInfo();
int question = pathInfo.lastIndexOf('?');
pathInfo = pathInfo.substring(13, question<0?pathInfo.length():question);// IMPORTANT, this is size of "/api/example/"
String nameOrContextType=Symm.base64noSplit.decode(pathInfo);
Result<Void> r = context.getAPIExample(trans,resp,nameOrContextType,
question>=0 && "optional=true".equalsIgnoreCase(req.getPathInfo().substring(question+1))
);
if(r.isOK()) {
resp.setStatus(HttpStatus.OK_200);
} else {
context.error(trans,resp,r);
}
}
});
} }
|
public class class_name {
public void setRenderer(GLSurfaceView.Renderer renderer) {
checkRenderThreadState();
if (mEGLConfigChooser == null) {
mEGLConfigChooser = new SimpleEGLConfigChooser(true);
}
if (mEGLContextFactory == null) {
mEGLContextFactory = new DefaultContextFactory();
}
if (mEGLWindowSurfaceFactory == null) {
mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory();
}
mRenderer = renderer;
mGLThread = new GLThread(mThisWeakRef);
mGLThread.start();
} }
|
public class class_name {
public void setRenderer(GLSurfaceView.Renderer renderer) {
checkRenderThreadState();
if (mEGLConfigChooser == null) {
mEGLConfigChooser = new SimpleEGLConfigChooser(true); // depends on control dependency: [if], data = [none]
}
if (mEGLContextFactory == null) {
mEGLContextFactory = new DefaultContextFactory(); // depends on control dependency: [if], data = [none]
}
if (mEGLWindowSurfaceFactory == null) {
mEGLWindowSurfaceFactory = new DefaultWindowSurfaceFactory(); // depends on control dependency: [if], data = [none]
}
mRenderer = renderer;
mGLThread = new GLThread(mThisWeakRef);
mGLThread.start();
} }
|
public class class_name {
public void start() {
FixedSchedulerPool update = new FixedSchedulerPool(poolSize);
if (!pool.compareAndSet(NONE, update)) {
update.shutdown();
}
} }
|
public class class_name {
public void start() {
FixedSchedulerPool update = new FixedSchedulerPool(poolSize);
if (!pool.compareAndSet(NONE, update)) {
update.shutdown(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
@CheckForNull
protected ICompilationUnit getCompilationUnit(IMarker marker) {
IResource res = marker.getResource();
if (res instanceof IFile && res.isAccessible()) {
IJavaElement element = JavaCore.create((IFile) res);
if (element instanceof ICompilationUnit) {
return (ICompilationUnit) element;
}
}
return null;
} }
|
public class class_name {
@CheckForNull
protected ICompilationUnit getCompilationUnit(IMarker marker) {
IResource res = marker.getResource();
if (res instanceof IFile && res.isAccessible()) {
IJavaElement element = JavaCore.create((IFile) res);
if (element instanceof ICompilationUnit) {
return (ICompilationUnit) element; // depends on control dependency: [if], data = [none]
}
}
return null;
} }
|
public class class_name {
public Observable<ServiceResponse<Void>> beginRotateDiskEncryptionKeyWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) {
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 (clusterName == null) {
throw new IllegalArgumentException("Parameter clusterName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
return service.beginRotateDiskEncryptionKey(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = beginRotateDiskEncryptionKeyDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<Void>> beginRotateDiskEncryptionKeyWithServiceResponseAsync(String resourceGroupName, String clusterName, ClusterDiskEncryptionParameters parameters) {
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 (clusterName == null) {
throw new IllegalArgumentException("Parameter clusterName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
if (parameters == null) {
throw new IllegalArgumentException("Parameter parameters is required and cannot be null.");
}
Validator.validate(parameters);
return service.beginRotateDiskEncryptionKey(this.client.subscriptionId(), resourceGroupName, clusterName, this.client.apiVersion(), parameters, this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<Void>>>() {
@Override
public Observable<ServiceResponse<Void>> call(Response<ResponseBody> response) {
try {
ServiceResponse<Void> clientResponse = beginRotateDiskEncryptionKeyDelegate(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 static <T> T readAvroEntity(Decoder decoder, DatumReader<T> reader) {
try {
return reader.read(null, decoder);
} catch (IOException e) {
throw new SerializationException("Could not deserialize Avro entity", e);
}
} }
|
public class class_name {
public static <T> T readAvroEntity(Decoder decoder, DatumReader<T> reader) {
try {
return reader.read(null, decoder); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
throw new SerializationException("Could not deserialize Avro entity", e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static void makeProxy() {
if (currentLocal.get() != null) {
cur().proxyTmp = cur().proxy;
cur().proxy = true;
}
} }
|
public class class_name {
public static void makeProxy() {
if (currentLocal.get() != null) {
cur().proxyTmp = cur().proxy; // depends on control dependency: [if], data = [none]
cur().proxy = true; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
@Override
protected void renderBitmapImage(BitmapMode mode, ImageBase image) {
switch( mode ) {
case UNSAFE: { // this application is configured to use double buffer and could ignore all other modes
VisualizeImageData.colorizeGradient(derivX, derivY, -1, bitmap, bitmapTmp);
} break;
case DOUBLE_BUFFER: {
VisualizeImageData.colorizeGradient(derivX, derivY, -1, bitmapWork, bitmapTmp);
if( bitmapLock.tryLock() ) {
try {
Bitmap tmp = bitmapWork;
bitmapWork = bitmap;
bitmap = tmp;
} finally {
bitmapLock.unlock();
}
}
} break;
}
} }
|
public class class_name {
@Override
protected void renderBitmapImage(BitmapMode mode, ImageBase image) {
switch( mode ) {
case UNSAFE: { // this application is configured to use double buffer and could ignore all other modes
VisualizeImageData.colorizeGradient(derivX, derivY, -1, bitmap, bitmapTmp);
} break;
case DOUBLE_BUFFER: {
VisualizeImageData.colorizeGradient(derivX, derivY, -1, bitmapWork, bitmapTmp);
if( bitmapLock.tryLock() ) {
try {
Bitmap tmp = bitmapWork;
bitmapWork = bitmap; // depends on control dependency: [try], data = [none]
bitmap = tmp; // depends on control dependency: [try], data = [none]
} finally {
bitmapLock.unlock();
}
}
} break;
}
} }
|
public class class_name {
public Observable<ServiceResponse<OperationStatus>> patchClosedListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId, List<WordListObject> subLists) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
}
if (appId == null) {
throw new IllegalArgumentException("Parameter appId is required and cannot be null.");
}
if (versionId == null) {
throw new IllegalArgumentException("Parameter versionId is required and cannot be null.");
}
if (clEntityId == null) {
throw new IllegalArgumentException("Parameter clEntityId is required and cannot be null.");
}
Validator.validate(subLists);
ClosedListModelPatchObject closedListModelPatchObject = new ClosedListModelPatchObject();
closedListModelPatchObject.withSubLists(subLists);
String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint());
return service.patchClosedList(appId, versionId, clEntityId, this.client.acceptLanguage(), closedListModelPatchObject, parameterizedHost, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<OperationStatus>>>() {
@Override
public Observable<ServiceResponse<OperationStatus>> call(Response<ResponseBody> response) {
try {
ServiceResponse<OperationStatus> clientResponse = patchClosedListDelegate(response);
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<OperationStatus>> patchClosedListWithServiceResponseAsync(UUID appId, String versionId, UUID clEntityId, List<WordListObject> subLists) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null.");
}
if (appId == null) {
throw new IllegalArgumentException("Parameter appId is required and cannot be null.");
}
if (versionId == null) {
throw new IllegalArgumentException("Parameter versionId is required and cannot be null.");
}
if (clEntityId == null) {
throw new IllegalArgumentException("Parameter clEntityId is required and cannot be null.");
}
Validator.validate(subLists);
ClosedListModelPatchObject closedListModelPatchObject = new ClosedListModelPatchObject();
closedListModelPatchObject.withSubLists(subLists);
String parameterizedHost = Joiner.on(", ").join("{Endpoint}", this.client.endpoint());
return service.patchClosedList(appId, versionId, clEntityId, this.client.acceptLanguage(), closedListModelPatchObject, parameterizedHost, this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<OperationStatus>>>() {
@Override
public Observable<ServiceResponse<OperationStatus>> call(Response<ResponseBody> response) {
try {
ServiceResponse<OperationStatus> clientResponse = patchClosedListDelegate(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 {
Collection<EdgeIteratorState> addBarrierEdge(long fromId, long toId, IntsRef inEdgeFlags, long nodeFlags, long wayOsmId) {
IntsRef edgeFlags = IntsRef.deepCopyOf(inEdgeFlags);
// clear blocked directions from flags
for (BooleanEncodedValue accessEnc : encodingManager.getAccessEncFromNodeFlags(nodeFlags)) {
accessEnc.setBool(false, edgeFlags, false);
accessEnc.setBool(true, edgeFlags, false);
}
// add edge
barrierNodeIds.clear();
barrierNodeIds.add(fromId);
barrierNodeIds.add(toId);
return addOSMWay(barrierNodeIds, edgeFlags, wayOsmId);
} }
|
public class class_name {
Collection<EdgeIteratorState> addBarrierEdge(long fromId, long toId, IntsRef inEdgeFlags, long nodeFlags, long wayOsmId) {
IntsRef edgeFlags = IntsRef.deepCopyOf(inEdgeFlags);
// clear blocked directions from flags
for (BooleanEncodedValue accessEnc : encodingManager.getAccessEncFromNodeFlags(nodeFlags)) {
accessEnc.setBool(false, edgeFlags, false); // depends on control dependency: [for], data = [accessEnc]
accessEnc.setBool(true, edgeFlags, false); // depends on control dependency: [for], data = [accessEnc]
}
// add edge
barrierNodeIds.clear();
barrierNodeIds.add(fromId);
barrierNodeIds.add(toId);
return addOSMWay(barrierNodeIds, edgeFlags, wayOsmId);
} }
|
public class class_name {
protected int indexFirstOf(char[] s, char delim, int offset) {
if (s == null || s.length == 0) {
return -1;
}
// check boundaries
if (offset < 0) {
offset = 0;
} else if (offset > s.length) {
return -1;
}
for (int i = offset; i < s.length; i++) {
if (s[i] == delim) {
return i;
}
}
return -1;
} }
|
public class class_name {
protected int indexFirstOf(char[] s, char delim, int offset) {
if (s == null || s.length == 0) {
return -1; // depends on control dependency: [if], data = [none]
}
// check boundaries
if (offset < 0) {
offset = 0; // depends on control dependency: [if], data = [none]
} else if (offset > s.length) {
return -1; // depends on control dependency: [if], data = [none]
}
for (int i = offset; i < s.length; i++) {
if (s[i] == delim) {
return i; // depends on control dependency: [if], data = [none]
}
}
return -1;
} }
|
public class class_name {
public T imeAction(TextView.OnEditorActionListener listener) {
if (view instanceof EditText) {
((EditText)view).setOnEditorActionListener(listener);
}
return self();
} }
|
public class class_name {
public T imeAction(TextView.OnEditorActionListener listener) {
if (view instanceof EditText) {
((EditText)view).setOnEditorActionListener(listener); // depends on control dependency: [if], data = [none]
}
return self();
} }
|
public class class_name {
public void marshall(UpdateSecretRequest updateSecretRequest, ProtocolMarshaller protocolMarshaller) {
if (updateSecretRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateSecretRequest.getSecretId(), SECRETID_BINDING);
protocolMarshaller.marshall(updateSecretRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING);
protocolMarshaller.marshall(updateSecretRequest.getDescription(), DESCRIPTION_BINDING);
protocolMarshaller.marshall(updateSecretRequest.getKmsKeyId(), KMSKEYID_BINDING);
protocolMarshaller.marshall(updateSecretRequest.getSecretBinary(), SECRETBINARY_BINDING);
protocolMarshaller.marshall(updateSecretRequest.getSecretString(), SECRETSTRING_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(UpdateSecretRequest updateSecretRequest, ProtocolMarshaller protocolMarshaller) {
if (updateSecretRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(updateSecretRequest.getSecretId(), SECRETID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(updateSecretRequest.getClientRequestToken(), CLIENTREQUESTTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(updateSecretRequest.getDescription(), DESCRIPTION_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(updateSecretRequest.getKmsKeyId(), KMSKEYID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(updateSecretRequest.getSecretBinary(), SECRETBINARY_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(updateSecretRequest.getSecretString(), SECRETSTRING_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 byte[] pad() {
int pos = (int) (msgLength % BYTE_BLOCK_LENGTH);
int padLength = (pos < 56) ? (64 - pos) : (128 - pos);
byte[] pad = new byte[padLength];
// First bit of the padding set to 1
pad[0] = (byte) 0x80;
long bits = msgLength << 3;
int index = padLength - 8;
for (int i = 0; i < 8; i++) {
pad[index++] = (byte) (bits >>> (i << 3));
}
return pad;
} }
|
public class class_name {
private byte[] pad() {
int pos = (int) (msgLength % BYTE_BLOCK_LENGTH);
int padLength = (pos < 56) ? (64 - pos) : (128 - pos);
byte[] pad = new byte[padLength];
// First bit of the padding set to 1
pad[0] = (byte) 0x80;
long bits = msgLength << 3;
int index = padLength - 8;
for (int i = 0; i < 8; i++) {
pad[index++] = (byte) (bits >>> (i << 3)); // depends on control dependency: [for], data = [i]
}
return pad;
} }
|
public class class_name {
public List<ResolvedType> typeParametersFor(Class<?> erasedSupertype) {
ResolvedType type = findSupertype(erasedSupertype);
if (type != null) {
return type.typeParams();
}
return null;
} }
|
public class class_name {
public List<ResolvedType> typeParametersFor(Class<?> erasedSupertype) {
ResolvedType type = findSupertype(erasedSupertype);
if (type != null) {
return type.typeParams(); // depends on control dependency: [if], data = [none]
}
return null;
} }
|
public class class_name {
private String getHierarchyTable(ClassDescriptorDef classDef)
{
ArrayList queue = new ArrayList();
String tableName = null;
queue.add(classDef);
while (!queue.isEmpty())
{
ClassDescriptorDef curClassDef = (ClassDescriptorDef)queue.get(0);
queue.remove(0);
if (curClassDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true))
{
if (tableName != null)
{
if (!tableName.equals(curClassDef.getProperty(PropertyHelper.OJB_PROPERTY_TABLE)))
{
return null;
}
}
else
{
tableName = curClassDef.getProperty(PropertyHelper.OJB_PROPERTY_TABLE);
}
}
for (Iterator it = curClassDef.getExtentClasses(); it.hasNext();)
{
curClassDef = (ClassDescriptorDef)it.next();
if (curClassDef.getReference("super") == null)
{
queue.add(curClassDef);
}
}
}
return tableName;
} }
|
public class class_name {
private String getHierarchyTable(ClassDescriptorDef classDef)
{
ArrayList queue = new ArrayList();
String tableName = null;
queue.add(classDef);
while (!queue.isEmpty())
{
ClassDescriptorDef curClassDef = (ClassDescriptorDef)queue.get(0);
queue.remove(0);
// depends on control dependency: [while], data = [none]
if (curClassDef.getBooleanProperty(PropertyHelper.OJB_PROPERTY_GENERATE_TABLE_INFO, true))
{
if (tableName != null)
{
if (!tableName.equals(curClassDef.getProperty(PropertyHelper.OJB_PROPERTY_TABLE)))
{
return null;
// depends on control dependency: [if], data = [none]
}
}
else
{
tableName = curClassDef.getProperty(PropertyHelper.OJB_PROPERTY_TABLE);
// depends on control dependency: [if], data = [none]
}
}
for (Iterator it = curClassDef.getExtentClasses(); it.hasNext();)
{
curClassDef = (ClassDescriptorDef)it.next();
// depends on control dependency: [for], data = [it]
if (curClassDef.getReference("super") == null)
{
queue.add(curClassDef);
// depends on control dependency: [if], data = [none]
}
}
}
return tableName;
} }
|
public class class_name {
private WekaThreadSafeScorer quickSwitch(UUID modelId, WekaThreadSafeScorer newWekaThreadSafeScorer) {
try { // quick switch - do not do anything inside for performance reasons!!
reloadModelsLock.writeLock().lock();
return wekaThreadSafeScorers.put(modelId, newWekaThreadSafeScorer);
} finally {
reloadModelsLock.writeLock().unlock();
}
} }
|
public class class_name {
private WekaThreadSafeScorer quickSwitch(UUID modelId, WekaThreadSafeScorer newWekaThreadSafeScorer) {
try { // quick switch - do not do anything inside for performance reasons!!
reloadModelsLock.writeLock().lock(); // depends on control dependency: [try], data = [none]
return wekaThreadSafeScorers.put(modelId, newWekaThreadSafeScorer); // depends on control dependency: [try], data = [none]
} finally {
reloadModelsLock.writeLock().unlock();
}
} }
|
public class class_name {
public void appendAttribute(final String name, final Object value) {
write(' ');
write(name);
write("=\"");
if (value instanceof Message) {
appendEscaped(translate(value));
} else if (value != null) {
appendEscaped(value.toString());
}
write('"');
} }
|
public class class_name {
public void appendAttribute(final String name, final Object value) {
write(' ');
write(name);
write("=\"");
if (value instanceof Message) {
appendEscaped(translate(value)); // depends on control dependency: [if], data = [none]
} else if (value != null) {
appendEscaped(value.toString()); // depends on control dependency: [if], data = [(value]
}
write('"');
} }
|
public class class_name {
public void marshall(KinesisFirehoseInput kinesisFirehoseInput, ProtocolMarshaller protocolMarshaller) {
if (kinesisFirehoseInput == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(kinesisFirehoseInput.getResourceARN(), RESOURCEARN_BINDING);
protocolMarshaller.marshall(kinesisFirehoseInput.getRoleARN(), ROLEARN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(KinesisFirehoseInput kinesisFirehoseInput, ProtocolMarshaller protocolMarshaller) {
if (kinesisFirehoseInput == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(kinesisFirehoseInput.getResourceARN(), RESOURCEARN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(kinesisFirehoseInput.getRoleARN(), ROLEARN_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public String colorize(String message){
if(SUPPORTED){
StringBuilder buff = new StringBuilder(start.length()+message.length()+END.length());
buff.append(start).append(message).append(END);
return buff.toString();
}else
return message;
} }
|
public class class_name {
public String colorize(String message){
if(SUPPORTED){
StringBuilder buff = new StringBuilder(start.length()+message.length()+END.length());
buff.append(start).append(message).append(END); // depends on control dependency: [if], data = [none]
return buff.toString(); // depends on control dependency: [if], data = [none]
}else
return message;
} }
|
public class class_name {
private boolean isPrivateHeaderTrusted(HeaderKeys key) {
HttpServiceContextImpl hisc = getServiceContext();
InetAddress remoteAddr = null;
String address = null;
if (hisc != null && (remoteAddr = hisc.getRemoteAddr()) != null) {
address = remoteAddr.getHostAddress();
}
boolean trusted = false;
if (address != null) {
trusted = HttpDispatcher.usePrivateHeaders(address, key.getName());
}
if (!trusted) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "isPrivateHeaderTrusted: " + key.getName() + " is not trusted for host " + address);
}
return false;
}
return true;
} }
|
public class class_name {
private boolean isPrivateHeaderTrusted(HeaderKeys key) {
HttpServiceContextImpl hisc = getServiceContext();
InetAddress remoteAddr = null;
String address = null;
if (hisc != null && (remoteAddr = hisc.getRemoteAddr()) != null) {
address = remoteAddr.getHostAddress(); // depends on control dependency: [if], data = [none]
}
boolean trusted = false;
if (address != null) {
trusted = HttpDispatcher.usePrivateHeaders(address, key.getName()); // depends on control dependency: [if], data = [(address]
}
if (!trusted) {
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "isPrivateHeaderTrusted: " + key.getName() + " is not trusted for host " + address); // depends on control dependency: [if], data = [none]
}
return false; // depends on control dependency: [if], data = [none]
}
return true;
} }
|
public class class_name {
public void execute() {
try {
checkParameters();
// Output directory need to be created if it not exists
if (!Files.exists(output)) {
Files.createDirectories(output);
}
// We need to get the Species object from the CLI name
// This can be the scientific or common name, or the ID
for (Species sp : configuration.getAllSpecies()) {
if (buildCommandOptions.species.equalsIgnoreCase(sp.getScientificName())
|| buildCommandOptions.species.equalsIgnoreCase(sp.getCommonName())
|| buildCommandOptions.species.equalsIgnoreCase(sp.getId())) {
species = sp;
break;
}
}
if (species == null) {
logger.error("Species '{}' not valid", buildCommandOptions.species);
}
if (buildCommandOptions.data != null) {
String[] buildOptions;
if (buildCommandOptions.data.equals("all")) {
buildOptions = species.getData().toArray(new String[0]);
} else {
buildOptions = buildCommandOptions.data.split(",");
}
for (int i = 0; i < buildOptions.length; i++) {
String buildOption = buildOptions[i];
logger.info("Building '{}' data", buildOption);
CellBaseParser parser = null;
switch (buildOption) {
case EtlCommons.GENOME_INFO_DATA:
buildGenomeInfo();
break;
case EtlCommons.GENOME_DATA:
parser = buildGenomeSequence();
break;
case EtlCommons.GENE_DATA:
parser = buildGene();
break;
case EtlCommons.VARIATION_DATA:
parser = buildVariation();
break;
case EtlCommons.VARIATION_FUNCTIONAL_SCORE_DATA:
parser = buildCadd();
break;
case EtlCommons.REGULATION_DATA:
parser = buildRegulation();
break;
case EtlCommons.PROTEIN_DATA:
parser = buildProtein();
break;
case EtlCommons.PPI_DATA:
parser = getInteractionParser();
break;
case EtlCommons.CONSERVATION_DATA:
parser = buildConservation();
break;
case EtlCommons.DRUG_DATA:
parser = buildDrugParser();
break;
case EtlCommons.CLINICAL_VARIANTS_DATA:
parser = buildClinicalVariants();
break;
case EtlCommons.CLINVAR_DATA:
parser = buildClinvar();
break;
case EtlCommons.COSMIC_DATA:
parser = buildCosmic();
break;
case EtlCommons.GWAS_DATA:
parser = buildGwas();
break;
case EtlCommons.STRUCTURAL_VARIANTS_DATA:
parser = buildStructuralVariants();
break;
case EtlCommons.REPEATS_DATA:
parser = buildRepeats();
break;
default:
logger.error("Build option '" + buildCommandOptions.data + "' is not valid");
break;
}
if (parser != null) {
try {
parser.parse();
} catch (Exception e) {
logger.error("Error executing 'build' command " + buildCommandOptions.data + ": " + e.getMessage(), e);
}
parser.disconnect();
}
}
}
} catch (ParameterException e) {
logger.error("Error parsing build command line parameters: " + e.getMessage(), e);
} catch (IOException e) {
logger.error(e.getMessage());
}
} }
|
public class class_name {
public void execute() {
try {
checkParameters(); // depends on control dependency: [try], data = [none]
// Output directory need to be created if it not exists
if (!Files.exists(output)) {
Files.createDirectories(output); // depends on control dependency: [if], data = [none]
}
// We need to get the Species object from the CLI name
// This can be the scientific or common name, or the ID
for (Species sp : configuration.getAllSpecies()) {
if (buildCommandOptions.species.equalsIgnoreCase(sp.getScientificName())
|| buildCommandOptions.species.equalsIgnoreCase(sp.getCommonName())
|| buildCommandOptions.species.equalsIgnoreCase(sp.getId())) {
species = sp; // depends on control dependency: [if], data = [none]
break;
}
}
if (species == null) {
logger.error("Species '{}' not valid", buildCommandOptions.species); // depends on control dependency: [if], data = [none]
}
if (buildCommandOptions.data != null) {
String[] buildOptions;
if (buildCommandOptions.data.equals("all")) {
buildOptions = species.getData().toArray(new String[0]); // depends on control dependency: [if], data = [none]
} else {
buildOptions = buildCommandOptions.data.split(","); // depends on control dependency: [if], data = [none]
}
for (int i = 0; i < buildOptions.length; i++) {
String buildOption = buildOptions[i];
logger.info("Building '{}' data", buildOption); // depends on control dependency: [for], data = [none]
CellBaseParser parser = null;
switch (buildOption) {
case EtlCommons.GENOME_INFO_DATA:
buildGenomeInfo();
break;
case EtlCommons.GENOME_DATA:
parser = buildGenomeSequence();
break;
case EtlCommons.GENE_DATA:
parser = buildGene();
break;
case EtlCommons.VARIATION_DATA:
parser = buildVariation();
break;
case EtlCommons.VARIATION_FUNCTIONAL_SCORE_DATA:
parser = buildCadd();
break;
case EtlCommons.REGULATION_DATA:
parser = buildRegulation();
break;
case EtlCommons.PROTEIN_DATA:
parser = buildProtein();
break;
case EtlCommons.PPI_DATA:
parser = getInteractionParser();
break;
case EtlCommons.CONSERVATION_DATA:
parser = buildConservation();
break;
case EtlCommons.DRUG_DATA:
parser = buildDrugParser();
break;
case EtlCommons.CLINICAL_VARIANTS_DATA:
parser = buildClinicalVariants();
break;
case EtlCommons.CLINVAR_DATA:
parser = buildClinvar();
break;
case EtlCommons.COSMIC_DATA:
parser = buildCosmic();
break;
case EtlCommons.GWAS_DATA:
parser = buildGwas();
break;
case EtlCommons.STRUCTURAL_VARIANTS_DATA:
parser = buildStructuralVariants();
break;
case EtlCommons.REPEATS_DATA:
parser = buildRepeats();
break;
default:
logger.error("Build option '" + buildCommandOptions.data + "' is not valid");
break;
}
if (parser != null) {
try {
parser.parse(); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
logger.error("Error executing 'build' command " + buildCommandOptions.data + ": " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
parser.disconnect(); // depends on control dependency: [if], data = [none]
}
}
}
} catch (ParameterException e) {
logger.error("Error parsing build command line parameters: " + e.getMessage(), e);
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
logger.error(e.getMessage());
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
protected static List<Element> getElements(final Element parent, final String tagName) {
List<Element> elements = new ArrayList<Element>();
NodeList nodes = parent.getElementsByTagName(tagName);
for (int i = 0; i < nodes.getLength(); i++) {
org.w3c.dom.Node node = nodes.item(i);
if (node instanceof Element) {
elements.add(Element.class.cast(node));
}
}
return elements;
} }
|
public class class_name {
protected static List<Element> getElements(final Element parent, final String tagName) {
List<Element> elements = new ArrayList<Element>();
NodeList nodes = parent.getElementsByTagName(tagName);
for (int i = 0; i < nodes.getLength(); i++) {
org.w3c.dom.Node node = nodes.item(i);
if (node instanceof Element) {
elements.add(Element.class.cast(node));
// depends on control dependency: [if], data = [none]
}
}
return elements;
} }
|
public class class_name {
public static <V> void copyWithFlowControl(final Iterator<V> source,
final CallStreamObserver<V> target) {
Preconditions.checkNotNull(source, "source");
Preconditions.checkNotNull(target, "target");
final class FlowControllingOnReadyHandler implements Runnable {
private boolean completed;
@Override
public void run() {
if (completed) {
return;
}
while (target.isReady() && source.hasNext()) {
target.onNext(source.next());
}
if (!source.hasNext()) {
completed = true;
target.onCompleted();
}
}
}
target.setOnReadyHandler(new FlowControllingOnReadyHandler());
} }
|
public class class_name {
public static <V> void copyWithFlowControl(final Iterator<V> source,
final CallStreamObserver<V> target) {
Preconditions.checkNotNull(source, "source");
Preconditions.checkNotNull(target, "target");
final class FlowControllingOnReadyHandler implements Runnable {
private boolean completed;
@Override
public void run() {
if (completed) {
return; // depends on control dependency: [if], data = [none]
}
while (target.isReady() && source.hasNext()) {
target.onNext(source.next()); // depends on control dependency: [while], data = [none]
}
if (!source.hasNext()) {
completed = true; // depends on control dependency: [if], data = [none]
target.onCompleted(); // depends on control dependency: [if], data = [none]
}
}
}
target.setOnReadyHandler(new FlowControllingOnReadyHandler());
} }
|
public class class_name {
public FlowStep deleteFlowStepViewRule(FlowStepRule flowStepRuleParam)
{
if(flowStepRuleParam != null && this.serviceTicket != null)
{
flowStepRuleParam.setServiceTicket(this.serviceTicket);
}
return new FlowStep(this.postJson(
flowStepRuleParam, WS.Path.FlowStepRule.Version1.flowStepRuleDeleteView()));
} }
|
public class class_name {
public FlowStep deleteFlowStepViewRule(FlowStepRule flowStepRuleParam)
{
if(flowStepRuleParam != null && this.serviceTicket != null)
{
flowStepRuleParam.setServiceTicket(this.serviceTicket); // depends on control dependency: [if], data = [none]
}
return new FlowStep(this.postJson(
flowStepRuleParam, WS.Path.FlowStepRule.Version1.flowStepRuleDeleteView()));
} }
|
public class class_name {
public static XWPFTemplate compile(InputStream inputStream, Configure config) {
try {
XWPFTemplate instance = new XWPFTemplate();
instance.config = config;
instance.doc = new NiceXWPFDocument(inputStream);
instance.visitor = new TemplateVisitor(instance.config);
instance.eleTemplates = instance.visitor.visitDocument(instance.doc);
return instance;
} catch (IOException e) {
logger.error("Compile template failed", e);
throw new ResolverException("Compile template failed");
}
} }
|
public class class_name {
public static XWPFTemplate compile(InputStream inputStream, Configure config) {
try {
XWPFTemplate instance = new XWPFTemplate();
instance.config = config; // depends on control dependency: [try], data = [none]
instance.doc = new NiceXWPFDocument(inputStream); // depends on control dependency: [try], data = [none]
instance.visitor = new TemplateVisitor(instance.config); // depends on control dependency: [try], data = [none]
instance.eleTemplates = instance.visitor.visitDocument(instance.doc); // depends on control dependency: [try], data = [none]
return instance; // depends on control dependency: [try], data = [none]
} catch (IOException e) {
logger.error("Compile template failed", e);
throw new ResolverException("Compile template failed");
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static Map<String, Set<String>> expand(Map<String, Set<String>> viewToPropNames) {
Set<String> baseProps = viewToPropNames.get(PropertyView.BASE_VIEW);
if (baseProps == null) {
baseProps = ImmutableSet.of();
}
if (!SquigglyConfig.isFilterImplicitlyIncludeBaseFieldsInView()) {
// make an exception for full view
Set<String> fullView = viewToPropNames.get(PropertyView.FULL_VIEW);
if (fullView != null) {
fullView.addAll(baseProps);
}
return viewToPropNames;
}
for (Map.Entry<String, Set<String>> entry : viewToPropNames.entrySet()) {
String viewName = entry.getKey();
Set<String> propNames = entry.getValue();
if (!PropertyView.BASE_VIEW.equals(viewName)) {
propNames.addAll(baseProps);
}
}
return viewToPropNames;
} }
|
public class class_name {
private static Map<String, Set<String>> expand(Map<String, Set<String>> viewToPropNames) {
Set<String> baseProps = viewToPropNames.get(PropertyView.BASE_VIEW);
if (baseProps == null) {
baseProps = ImmutableSet.of(); // depends on control dependency: [if], data = [none]
}
if (!SquigglyConfig.isFilterImplicitlyIncludeBaseFieldsInView()) {
// make an exception for full view
Set<String> fullView = viewToPropNames.get(PropertyView.FULL_VIEW);
if (fullView != null) {
fullView.addAll(baseProps); // depends on control dependency: [if], data = [none]
}
return viewToPropNames; // depends on control dependency: [if], data = [none]
}
for (Map.Entry<String, Set<String>> entry : viewToPropNames.entrySet()) {
String viewName = entry.getKey();
Set<String> propNames = entry.getValue();
if (!PropertyView.BASE_VIEW.equals(viewName)) {
propNames.addAll(baseProps); // depends on control dependency: [if], data = [none]
}
}
return viewToPropNames;
} }
|
public class class_name {
private Drawable getActivityIcon(ComponentName component) {
PackageManager pm = mContext.getPackageManager();
final ActivityInfo activityInfo;
try {
activityInfo = pm.getActivityInfo(component, PackageManager.GET_META_DATA);
} catch (NameNotFoundException ex) {
Log.w(LOG_TAG, ex.toString());
return null;
}
int iconId = activityInfo.getIconResource();
if (iconId == 0) return null;
String pkg = component.getPackageName();
Drawable drawable = pm.getDrawable(pkg, iconId, activityInfo.applicationInfo);
if (drawable == null) {
Log.w(LOG_TAG, "Invalid icon resource " + iconId + " for "
+ component.flattenToShortString());
return null;
}
return drawable;
} }
|
public class class_name {
private Drawable getActivityIcon(ComponentName component) {
PackageManager pm = mContext.getPackageManager();
final ActivityInfo activityInfo;
try {
activityInfo = pm.getActivityInfo(component, PackageManager.GET_META_DATA); // depends on control dependency: [try], data = [none]
} catch (NameNotFoundException ex) {
Log.w(LOG_TAG, ex.toString());
return null;
} // depends on control dependency: [catch], data = [none]
int iconId = activityInfo.getIconResource();
if (iconId == 0) return null;
String pkg = component.getPackageName();
Drawable drawable = pm.getDrawable(pkg, iconId, activityInfo.applicationInfo);
if (drawable == null) {
Log.w(LOG_TAG, "Invalid icon resource " + iconId + " for "
+ component.flattenToShortString()); // depends on control dependency: [if], data = [none]
return null; // depends on control dependency: [if], data = [none]
}
return drawable;
} }
|
public class class_name {
public java.util.List<ProcessType> getProcesses() {
if (processes == null) {
processes = new com.amazonaws.internal.SdkInternalList<ProcessType>();
}
return processes;
} }
|
public class class_name {
public java.util.List<ProcessType> getProcesses() {
if (processes == null) {
processes = new com.amazonaws.internal.SdkInternalList<ProcessType>(); // depends on control dependency: [if], data = [none]
}
return processes;
} }
|
public class class_name {
@Nullable
public static Age fromPanasonicString(@NotNull String s)
{
if (s.length() != 19 || s.startsWith("9999:99:99"))
return null;
try {
int years = Integer.parseInt(s.substring(0, 4));
int months = Integer.parseInt(s.substring(5, 7));
int days = Integer.parseInt(s.substring(8, 10));
int hours = Integer.parseInt(s.substring(11, 13));
int minutes = Integer.parseInt(s.substring(14, 16));
int seconds = Integer.parseInt(s.substring(17, 19));
return new Age(years, months, days, hours, minutes, seconds);
}
catch (NumberFormatException ignored)
{
return null;
}
} }
|
public class class_name {
@Nullable
public static Age fromPanasonicString(@NotNull String s)
{
if (s.length() != 19 || s.startsWith("9999:99:99"))
return null;
try {
int years = Integer.parseInt(s.substring(0, 4));
int months = Integer.parseInt(s.substring(5, 7));
int days = Integer.parseInt(s.substring(8, 10));
int hours = Integer.parseInt(s.substring(11, 13));
int minutes = Integer.parseInt(s.substring(14, 16));
int seconds = Integer.parseInt(s.substring(17, 19));
return new Age(years, months, days, hours, minutes, seconds); // depends on control dependency: [try], data = [none]
}
catch (NumberFormatException ignored)
{
return null;
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private GraphMLDecorator getGraphMLDecorator(Result<?> result) {
String graphMLDecorator = result.getRule().getReport().getProperties().getProperty(GRAPHML_DECORATOR);
Class<? extends GraphMLDecorator> decoratorClass;
if (graphMLDecorator != null) {
decoratorClass = classHelper.getType(graphMLDecorator);
} else {
decoratorClass = defaultDecoratorClass;
}
return classHelper.createInstance(decoratorClass);
} }
|
public class class_name {
private GraphMLDecorator getGraphMLDecorator(Result<?> result) {
String graphMLDecorator = result.getRule().getReport().getProperties().getProperty(GRAPHML_DECORATOR);
Class<? extends GraphMLDecorator> decoratorClass;
if (graphMLDecorator != null) {
decoratorClass = classHelper.getType(graphMLDecorator); // depends on control dependency: [if], data = [(graphMLDecorator]
} else {
decoratorClass = defaultDecoratorClass; // depends on control dependency: [if], data = [none]
}
return classHelper.createInstance(decoratorClass);
} }
|
public class class_name {
protected Element findAndReplaceSimpleElement(Counter counter, Element parent, String name, String text,
String defaultValue)
{
if ((defaultValue != null) && (text != null) && defaultValue.equals(text))
{
Element element = parent.getChild(name, parent.getNamespace());
// if exist and is default value or if doesn't exist.. just keep the
// way it is..
if (((element != null) && defaultValue.equals(element.getText())) || (element == null))
{
return element;
}
}
boolean shouldExist = (text != null) && (text.trim().length() > 0);
Element element = updateElement(counter, parent, name, shouldExist);
if (shouldExist)
{
element.setText(text);
}
return element;
} }
|
public class class_name {
protected Element findAndReplaceSimpleElement(Counter counter, Element parent, String name, String text,
String defaultValue)
{
if ((defaultValue != null) && (text != null) && defaultValue.equals(text))
{
Element element = parent.getChild(name, parent.getNamespace());
// if exist and is default value or if doesn't exist.. just keep the
// way it is..
if (((element != null) && defaultValue.equals(element.getText())) || (element == null))
{
return element; // depends on control dependency: [if], data = [none]
}
}
boolean shouldExist = (text != null) && (text.trim().length() > 0);
Element element = updateElement(counter, parent, name, shouldExist);
if (shouldExist)
{
element.setText(text); // depends on control dependency: [if], data = [none]
}
return element;
} }
|
public class class_name {
private SecureUTF8String hashTheData(SecureUTF8String masterPassword, SecureUTF8String data, Account account)
throws Exception {
final SecureUTF8String output = new SecureUTF8String();
final SecureUTF8String secureIteration = new SecureUTF8String();
SecureUTF8String intermediateOutput = null;
int count = 0;
final int length = account.getLength();
try {
while (output.size() < length) {
if (count == 0) {
intermediateOutput = runAlgorithm(masterPassword, data, account);
} else {
// add ye bit'o chaos
secureIteration.replace(masterPassword);
secureIteration.append(NEW_LINE);
secureIteration.append(new SecureCharArray(Integer.toString(count)));
intermediateOutput = runAlgorithm(secureIteration, data, account);
secureIteration.erase();
}
output.append(intermediateOutput);
intermediateOutput.erase();
count++;
}
} catch (Exception e) {
output.erase();
throw e;
} finally {
if (intermediateOutput != null)
intermediateOutput.erase();
secureIteration.erase();
}
return output;
} }
|
public class class_name {
private SecureUTF8String hashTheData(SecureUTF8String masterPassword, SecureUTF8String data, Account account)
throws Exception {
final SecureUTF8String output = new SecureUTF8String();
final SecureUTF8String secureIteration = new SecureUTF8String();
SecureUTF8String intermediateOutput = null;
int count = 0;
final int length = account.getLength();
try {
while (output.size() < length) {
if (count == 0) {
intermediateOutput = runAlgorithm(masterPassword, data, account); // depends on control dependency: [if], data = [none]
} else {
// add ye bit'o chaos
secureIteration.replace(masterPassword); // depends on control dependency: [if], data = [none]
secureIteration.append(NEW_LINE); // depends on control dependency: [if], data = [none]
secureIteration.append(new SecureCharArray(Integer.toString(count))); // depends on control dependency: [if], data = [(count]
intermediateOutput = runAlgorithm(secureIteration, data, account); // depends on control dependency: [if], data = [none]
secureIteration.erase(); // depends on control dependency: [if], data = [none]
}
output.append(intermediateOutput); // depends on control dependency: [while], data = [none]
intermediateOutput.erase(); // depends on control dependency: [while], data = [none]
count++; // depends on control dependency: [while], data = [none]
}
} catch (Exception e) {
output.erase();
throw e;
} finally {
if (intermediateOutput != null)
intermediateOutput.erase();
secureIteration.erase();
}
return output;
} }
|
public class class_name {
public String toCamelUpperCase(String inputParam) {
if(inputParam == null)
{
return null;
}
if(inputParam.isEmpty())
{
return EMPTY;
}
char[] original = inputParam.toCharArray();
StringBuilder titleCase =
new StringBuilder(Character.toString(
Character.toLowerCase(original[0])));
boolean nextTitleCase = false;
for(int index = 1;index < original.length;index++)
{
char c = original[index];
if (Character.isSpaceChar(c)) {
nextTitleCase = true;
continue;
}
//Just add...
else if (nextTitleCase) {
c = Character.toTitleCase(c);
nextTitleCase = false;
}
titleCase.append(c);
}
return titleCase.toString();
} }
|
public class class_name {
public String toCamelUpperCase(String inputParam) {
if(inputParam == null)
{
return null; // depends on control dependency: [if], data = [none]
}
if(inputParam.isEmpty())
{
return EMPTY; // depends on control dependency: [if], data = [none]
}
char[] original = inputParam.toCharArray();
StringBuilder titleCase =
new StringBuilder(Character.toString(
Character.toLowerCase(original[0])));
boolean nextTitleCase = false;
for(int index = 1;index < original.length;index++)
{
char c = original[index];
if (Character.isSpaceChar(c)) {
nextTitleCase = true; // depends on control dependency: [if], data = [none]
continue;
}
//Just add...
else if (nextTitleCase) {
c = Character.toTitleCase(c); // depends on control dependency: [if], data = [none]
nextTitleCase = false; // depends on control dependency: [if], data = [none]
}
titleCase.append(c); // depends on control dependency: [for], data = [none]
}
return titleCase.toString();
} }
|
public class class_name {
@Override
public List<String> getList(final String key) {
return retrieve(new Callable<List<String>>() {
@Override
public List<String> call() throws Exception {
try {
return configuration.getStringList(key);
} catch (ConfigException.WrongType e) {
// Not a list.
String s = get(key);
if (s != null) {
return ImmutableList.of(s);
} else {
throw new IllegalArgumentException("Cannot create a list for the key '" + key + "'", e);
}
}
}
}, Collections.<String>emptyList());
} }
|
public class class_name {
@Override
public List<String> getList(final String key) {
return retrieve(new Callable<List<String>>() {
@Override
public List<String> call() throws Exception {
try {
return configuration.getStringList(key);
} catch (ConfigException.WrongType e) {
// Not a list.
String s = get(key);
if (s != null) {
return ImmutableList.of(s); // depends on control dependency: [if], data = [(s]
} else {
throw new IllegalArgumentException("Cannot create a list for the key '" + key + "'", e);
}
}
}
}, Collections.<String>emptyList());
} }
|
public class class_name {
public RouteBuilder put(){
if(!methods.contains(HttpMethod.PUT)){
methods.add(HttpMethod.PUT);
}
return this;
} }
|
public class class_name {
public RouteBuilder put(){
if(!methods.contains(HttpMethod.PUT)){
methods.add(HttpMethod.PUT); // depends on control dependency: [if], data = [none]
}
return this;
} }
|
public class class_name {
@Override
protected String newValue(final String currentValue, final String cssClass)
{
if (currentValue != null)
{
return currentValue.replaceAll(cssClass, "");
}
return "";
} }
|
public class class_name {
@Override
protected String newValue(final String currentValue, final String cssClass)
{
if (currentValue != null)
{
return currentValue.replaceAll(cssClass, ""); // depends on control dependency: [if], data = [none]
}
return "";
} }
|
public class class_name {
public GetDedicatedIpsResult withDedicatedIps(DedicatedIp... dedicatedIps) {
if (this.dedicatedIps == null) {
setDedicatedIps(new java.util.ArrayList<DedicatedIp>(dedicatedIps.length));
}
for (DedicatedIp ele : dedicatedIps) {
this.dedicatedIps.add(ele);
}
return this;
} }
|
public class class_name {
public GetDedicatedIpsResult withDedicatedIps(DedicatedIp... dedicatedIps) {
if (this.dedicatedIps == null) {
setDedicatedIps(new java.util.ArrayList<DedicatedIp>(dedicatedIps.length)); // depends on control dependency: [if], data = [none]
}
for (DedicatedIp ele : dedicatedIps) {
this.dedicatedIps.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public <T extends AbstractJaxb> boolean remove(T target) {
String id = target.getId();
if (id == null) {
for (int i = 0; i < 256; i++) {
id = UUID.randomUUID().toString();
if (this.getById(id) == null) {
target.setId(id);
break;
}
}
}
return RemoveByIdUtil.removeById(id, this);
} }
|
public class class_name {
public <T extends AbstractJaxb> boolean remove(T target) {
String id = target.getId();
if (id == null) {
for (int i = 0; i < 256; i++) {
id = UUID.randomUUID().toString(); // depends on control dependency: [for], data = [none]
if (this.getById(id) == null) {
target.setId(id); // depends on control dependency: [if], data = [none]
break;
}
}
}
return RemoveByIdUtil.removeById(id, this);
} }
|
public class class_name {
@SafeVarargs
public final <T> Stream<T> streamAll(final String sql, final StatementSetter statementSetter,
final JdbcUtil.BiRecordGetter<T, RuntimeException> recordGetter, final JdbcSettings jdbcSettings, final Object... parameters) {
checkJdbcSettingsForAllQuery(jdbcSettings);
if (jdbcSettings == null || N.isNullOrEmpty(jdbcSettings.getQueryWithDataSources())) {
return stream(sql, statementSetter, recordGetter, jdbcSettings, parameters);
}
final Collection<String> dss = jdbcSettings.getQueryWithDataSources();
return Stream.of(dss).map(new Function<String, JdbcSettings>() {
@Override
public JdbcSettings apply(String ds) {
return jdbcSettings.copy().setQueryWithDataSources(null).setQueryWithDataSource(ds);
}
}).__(new Function<Stream<JdbcSettings>, Stream<JdbcSettings>>() {
@Override
public Stream<JdbcSettings> apply(Stream<JdbcSettings> s) {
return jdbcSettings.isQueryInParallel() ? s.parallel(dss.size()) : s;
}
}).flatMap(new Function<JdbcSettings, Stream<T>>() {
@Override
public Stream<T> apply(JdbcSettings newJdbcSettings) {
return stream(sql, statementSetter, recordGetter, newJdbcSettings, parameters);
}
});
} }
|
public class class_name {
@SafeVarargs
public final <T> Stream<T> streamAll(final String sql, final StatementSetter statementSetter,
final JdbcUtil.BiRecordGetter<T, RuntimeException> recordGetter, final JdbcSettings jdbcSettings, final Object... parameters) {
checkJdbcSettingsForAllQuery(jdbcSettings);
if (jdbcSettings == null || N.isNullOrEmpty(jdbcSettings.getQueryWithDataSources())) {
return stream(sql, statementSetter, recordGetter, jdbcSettings, parameters);
// depends on control dependency: [if], data = [none]
}
final Collection<String> dss = jdbcSettings.getQueryWithDataSources();
return Stream.of(dss).map(new Function<String, JdbcSettings>() {
@Override
public JdbcSettings apply(String ds) {
return jdbcSettings.copy().setQueryWithDataSources(null).setQueryWithDataSource(ds);
}
}).__(new Function<Stream<JdbcSettings>, Stream<JdbcSettings>>() {
@Override
public Stream<JdbcSettings> apply(Stream<JdbcSettings> s) {
return jdbcSettings.isQueryInParallel() ? s.parallel(dss.size()) : s;
}
}).flatMap(new Function<JdbcSettings, Stream<T>>() {
@Override
public Stream<T> apply(JdbcSettings newJdbcSettings) {
return stream(sql, statementSetter, recordGetter, newJdbcSettings, parameters);
}
});
} }
|
public class class_name {
private void expandActivePath(int size) {
if (activePath.length < size) {
final int p = activePath.length;
activePath = java.util.Arrays.copyOf(activePath, size);
nextArcOffset = java.util.Arrays.copyOf(nextArcOffset, size);
for (int i = p; i < size; i++) {
nextArcOffset[i] = activePath[i] = allocateState(/* assume max labels count */MAX_LABELS);
}
}
} }
|
public class class_name {
private void expandActivePath(int size) {
if (activePath.length < size) {
final int p = activePath.length;
activePath = java.util.Arrays.copyOf(activePath, size); // depends on control dependency: [if], data = [size)]
nextArcOffset = java.util.Arrays.copyOf(nextArcOffset, size); // depends on control dependency: [if], data = [size)]
for (int i = p; i < size; i++) {
nextArcOffset[i] = activePath[i] = allocateState(/* assume max labels count */MAX_LABELS); // depends on control dependency: [for], data = [i]
}
}
} }
|
public class class_name {
public static <T> T applyAdvice(final Class<T> targetClass) {
Class adviceClass = cache.get(targetClass);
if (adviceClass == null) {
// advice not yet created
adviceClass = PROXY_PROXETTA.proxy().setTarget(targetClass).define();
cache.put(targetClass, adviceClass);
}
// create new advice instance and injects target instance to it
try {
Object advice = ClassUtil.newInstance(adviceClass);
Field field = adviceClass.getField("$___target$0");
field.set(advice, targetClass);
return (T) advice;
} catch (Exception ex) {
throw new ProxettaException(ex);
}
} }
|
public class class_name {
public static <T> T applyAdvice(final Class<T> targetClass) {
Class adviceClass = cache.get(targetClass);
if (adviceClass == null) {
// advice not yet created
adviceClass = PROXY_PROXETTA.proxy().setTarget(targetClass).define(); // depends on control dependency: [if], data = [none]
cache.put(targetClass, adviceClass); // depends on control dependency: [if], data = [none]
}
// create new advice instance and injects target instance to it
try {
Object advice = ClassUtil.newInstance(adviceClass);
Field field = adviceClass.getField("$___target$0");
field.set(advice, targetClass); // depends on control dependency: [try], data = [none]
return (T) advice; // depends on control dependency: [try], data = [none]
} catch (Exception ex) {
throw new ProxettaException(ex);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
@SuppressWarnings( { "UnusedDeclaration" } )
public void setFilesetmanifest( FilesetManifestConfig config )
{
filesetManifestConfig = config;
mergeManifestsMain = FilesetManifestConfig.merge == config;
if ( ( filesetManifestConfig != null ) && filesetManifestConfig != FilesetManifestConfig.skip )
{
doubleFilePass = true;
}
} }
|
public class class_name {
@SuppressWarnings( { "UnusedDeclaration" } )
public void setFilesetmanifest( FilesetManifestConfig config )
{
filesetManifestConfig = config;
mergeManifestsMain = FilesetManifestConfig.merge == config;
if ( ( filesetManifestConfig != null ) && filesetManifestConfig != FilesetManifestConfig.skip )
{
doubleFilePass = true; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private Expr parseAccessExpression(EnclosingScope scope, boolean terminated) {
int start = index;
Expr lhs = parseTermExpression(scope, terminated);
Token token;
while ((token = tryAndMatchOnLine(LeftSquare)) != null
|| (token = tryAndMatch(terminated, Dot, MinusGreater, ColonColon)) != null) {
switch (token.kind) {
case LeftSquare:
// NOTE: expression guaranteed to be terminated by ']'.
Expr rhs = parseAdditiveExpression(scope, true);
// This is a plain old array access expression
match(RightSquare);
lhs = new Expr.ArrayAccess(Type.Void, lhs, rhs);
break;
case MinusGreater:
lhs = new Expr.Dereference(Type.Void, lhs);
// Fall through
case Dot:
// At this point, we could have a field access, or a
// method/function invocation. Therefore, we start by
// parsing the field access and then check whether or not its an
// invocation.
lhs = parseDotAccess(lhs, scope, terminated);
break;
case ColonColon:
// At this point, we have a qualified access.
index = start;
lhs = parseQualifiedAccess(scope, terminated);
break;
}
// Attached source information
lhs = annotateSourceLocation(lhs,start);
}
return lhs;
} }
|
public class class_name {
private Expr parseAccessExpression(EnclosingScope scope, boolean terminated) {
int start = index;
Expr lhs = parseTermExpression(scope, terminated);
Token token;
while ((token = tryAndMatchOnLine(LeftSquare)) != null
|| (token = tryAndMatch(terminated, Dot, MinusGreater, ColonColon)) != null) {
switch (token.kind) {
case LeftSquare:
// NOTE: expression guaranteed to be terminated by ']'.
Expr rhs = parseAdditiveExpression(scope, true);
// This is a plain old array access expression
match(RightSquare);
lhs = new Expr.ArrayAccess(Type.Void, lhs, rhs);
break;
case MinusGreater:
lhs = new Expr.Dereference(Type.Void, lhs);
// Fall through
case Dot:
// At this point, we could have a field access, or a
// method/function invocation. Therefore, we start by
// parsing the field access and then check whether or not its an
// invocation.
lhs = parseDotAccess(lhs, scope, terminated);
break;
case ColonColon:
// At this point, we have a qualified access.
index = start;
lhs = parseQualifiedAccess(scope, terminated);
break;
}
// Attached source information
lhs = annotateSourceLocation(lhs,start); // depends on control dependency: [while], data = [none]
}
return lhs;
} }
|
public class class_name {
@Deprecated
public boolean sendHintSerial(Node failedNode, Version version, Slop slop) {
boolean persisted = false;
for(Node node: handoffStrategy.routeHint(failedNode)) {
int nodeId = node.getId();
if(!failedNodes.contains(node) && failureDetector.isAvailable(node)) {
if(logger.isDebugEnabled())
logger.debug("Trying to send hint to " + nodeId + " for key " + slop.getKey());
Store<ByteArray, Slop, byte[]> slopStore = slopStores.get(nodeId);
Utils.notNull(slopStore);
long startNs = System.nanoTime();
try {
if(logger.isDebugEnabled())
logger.debug("Slop attempt to write " + slop.getKey() + " (keyRef: "
+ System.identityHashCode(slop.getKey()) + ") for "
+ failedNode + " to node " + node);
// No transform needs to applied to the slop
slopStore.put(slop.makeKey(), new Versioned<Slop>(slop, version), null);
persisted = true;
failureDetector.recordSuccess(node, (System.nanoTime() - startNs)
/ Time.NS_PER_MS);
if(logger.isTraceEnabled())
logger.trace("Finished hinted handoff for " + failedNode
+ " wrote slop to " + node);
break;
} catch(UnreachableStoreException e) {
failureDetector.recordException(node, (System.nanoTime() - startNs)
/ Time.NS_PER_MS, e);
logger.warn("Error during hinted handoff. Will try another node", e);
} catch(IllegalStateException e) {
logger.warn("Error during hinted handoff. Will try another node", e);
} catch(ObsoleteVersionException e) {
logger.debug(e, e);
} catch(Exception e) {
logger.error("Unknown exception. Will try another node" + e);
}
if(logger.isDebugEnabled())
logger.debug("Slop write of key " + slop.getKey() + " (keyRef: "
+ System.identityHashCode(slop.getKey()) + ") for " + failedNode
+ " to node " + node + (persisted ? " succeeded" : " failed")
+ " in " + (System.nanoTime() - startNs) + " ns");
} else {
if(logger.isDebugEnabled()) {
logger.debug("Skipping node " + nodeId);
}
}
}
if(!persisted) {
logger.error("Slop write of key " + slop.getKey() + " (keyRef: "
+ System.identityHashCode(slop.getKey()) + ") for " + failedNode
+ " was not written.");
}
return persisted;
} }
|
public class class_name {
@Deprecated
public boolean sendHintSerial(Node failedNode, Version version, Slop slop) {
boolean persisted = false;
for(Node node: handoffStrategy.routeHint(failedNode)) {
int nodeId = node.getId();
if(!failedNodes.contains(node) && failureDetector.isAvailable(node)) {
if(logger.isDebugEnabled())
logger.debug("Trying to send hint to " + nodeId + " for key " + slop.getKey());
Store<ByteArray, Slop, byte[]> slopStore = slopStores.get(nodeId);
Utils.notNull(slopStore); // depends on control dependency: [if], data = [none]
long startNs = System.nanoTime();
try {
if(logger.isDebugEnabled())
logger.debug("Slop attempt to write " + slop.getKey() + " (keyRef: "
+ System.identityHashCode(slop.getKey()) + ") for "
+ failedNode + " to node " + node);
// No transform needs to applied to the slop
slopStore.put(slop.makeKey(), new Versioned<Slop>(slop, version), null); // depends on control dependency: [try], data = [none]
persisted = true; // depends on control dependency: [try], data = [none]
failureDetector.recordSuccess(node, (System.nanoTime() - startNs)
/ Time.NS_PER_MS); // depends on control dependency: [try], data = [none]
if(logger.isTraceEnabled())
logger.trace("Finished hinted handoff for " + failedNode
+ " wrote slop to " + node);
break;
} catch(UnreachableStoreException e) {
failureDetector.recordException(node, (System.nanoTime() - startNs)
/ Time.NS_PER_MS, e);
logger.warn("Error during hinted handoff. Will try another node", e);
} catch(IllegalStateException e) { // depends on control dependency: [catch], data = [none]
logger.warn("Error during hinted handoff. Will try another node", e);
} catch(ObsoleteVersionException e) { // depends on control dependency: [catch], data = [none]
logger.debug(e, e);
} catch(Exception e) { // depends on control dependency: [catch], data = [none]
logger.error("Unknown exception. Will try another node" + e);
} // depends on control dependency: [catch], data = [none]
if(logger.isDebugEnabled())
logger.debug("Slop write of key " + slop.getKey() + " (keyRef: "
+ System.identityHashCode(slop.getKey()) + ") for " + failedNode
+ " to node " + node + (persisted ? " succeeded" : " failed")
+ " in " + (System.nanoTime() - startNs) + " ns");
} else {
if(logger.isDebugEnabled()) {
logger.debug("Skipping node " + nodeId); // depends on control dependency: [if], data = [none]
}
}
}
if(!persisted) {
logger.error("Slop write of key " + slop.getKey() + " (keyRef: "
+ System.identityHashCode(slop.getKey()) + ") for " + failedNode
+ " was not written.");
}
return persisted; // depends on control dependency: [if], data = [none]
} }
|
public class class_name {
private static List<Word> selectBest(List<List<Word>> candidateWords){
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("开始从多个识别结果中选择一个最佳的结果:{}", candidateWords);
}
Map<List<Word>, Integer> map = new ConcurrentHashMap<>();
AtomicInteger i = new AtomicInteger();
candidateWords.stream().forEach(candidateWord -> {
if(LOGGER.isDebugEnabled()) {
LOGGER.debug(i.incrementAndGet() + "、开始处理:" + candidateWord);
}
//词性标注
PartOfSpeechTagging.process(candidateWord);
//根据词性标注的结果进行评分
StringBuilder seq = new StringBuilder();
candidateWord.forEach(word -> seq.append(word.getPartOfSpeech().getPos().charAt(0)).append(" "));
String seqStr = seq.toString();
AtomicInteger score = new AtomicInteger();
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("词序列:{} 的词性序列:{}", candidateWord, seqStr);
}
POS_SEQ.keySet().stream().forEach(pos_seq -> {
if (seqStr.contains(pos_seq)) {
int sc = POS_SEQ.get(pos_seq);
if(LOGGER.isDebugEnabled()) {
LOGGER.debug(pos_seq + "词序增加分值:" + sc);
}
score.addAndGet(sc);
}
});
score.addAndGet(-candidateWord.size());
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("长度的负值也作为分值:" + (-candidateWord.size()));
LOGGER.debug("评分结果:" + score.get());
}
map.put(candidateWord, score.get());
});
//选择分值最高的
List<Word> result = map.entrySet().stream().sorted((a,b)->b.getValue().compareTo(a.getValue())).map(e->e.getKey()).collect(Collectors.toList()).get(0);
if(LOGGER.isDebugEnabled()){
LOGGER.debug("选择结果:"+result);
}
return result;
} }
|
public class class_name {
private static List<Word> selectBest(List<List<Word>> candidateWords){
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("开始从多个识别结果中选择一个最佳的结果:{}", candidateWords); // depends on control dependency: [if], data = [none]
}
Map<List<Word>, Integer> map = new ConcurrentHashMap<>();
AtomicInteger i = new AtomicInteger();
candidateWords.stream().forEach(candidateWord -> {
if(LOGGER.isDebugEnabled()) {
LOGGER.debug(i.incrementAndGet() + "、开始处理:" + candidateWord);
}
//词性标注
PartOfSpeechTagging.process(candidateWord);
//根据词性标注的结果进行评分
StringBuilder seq = new StringBuilder();
candidateWord.forEach(word -> seq.append(word.getPartOfSpeech().getPos().charAt(0)).append(" "));
String seqStr = seq.toString();
AtomicInteger score = new AtomicInteger();
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("词序列:{} 的词性序列:{}", candidateWord, seqStr);
}
POS_SEQ.keySet().stream().forEach(pos_seq -> {
if (seqStr.contains(pos_seq)) {
int sc = POS_SEQ.get(pos_seq);
if(LOGGER.isDebugEnabled()) {
LOGGER.debug(pos_seq + "词序增加分值:" + sc); // depends on control dependency: [if], data = [none]
}
score.addAndGet(sc);
}
});
score.addAndGet(-candidateWord.size());
if(LOGGER.isDebugEnabled()) {
LOGGER.debug("长度的负值也作为分值:" + (-candidateWord.size()));
LOGGER.debug("评分结果:" + score.get());
}
map.put(candidateWord, score.get());
});
//选择分值最高的
List<Word> result = map.entrySet().stream().sorted((a,b)->b.getValue().compareTo(a.getValue())).map(e->e.getKey()).collect(Collectors.toList()).get(0);
if(LOGGER.isDebugEnabled()){
LOGGER.debug("选择结果:"+result);
}
return result;
} }
|
public class class_name {
private void createTimeout(IAbstractAsyncFuture future, long delay, boolean isRead) {
if (AsyncProperties.disableTimeouts) {
return;
}
// create the timeout time, while not holding the lock
long timeoutTime =
(System.currentTimeMillis() + delay + Timer.timeoutRoundup)
& Timer.timeoutResolution;
synchronized (future.getCompletedSemaphore()) {
// make sure it didn't complete while we were getting here
if (!future.isCompleted()) {
timer.createTimeoutRequest(timeoutTime, this.callback, future);
}
}
} }
|
public class class_name {
private void createTimeout(IAbstractAsyncFuture future, long delay, boolean isRead) {
if (AsyncProperties.disableTimeouts) {
return; // depends on control dependency: [if], data = [none]
}
// create the timeout time, while not holding the lock
long timeoutTime =
(System.currentTimeMillis() + delay + Timer.timeoutRoundup)
& Timer.timeoutResolution;
synchronized (future.getCompletedSemaphore()) {
// make sure it didn't complete while we were getting here
if (!future.isCompleted()) {
timer.createTimeoutRequest(timeoutTime, this.callback, future); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
@Override public void close() throws IOException
{
long skippedLast = 0;
if (m_remaining > 0)
{
skippedLast = skip(m_remaining);
while (m_remaining > 0 && skippedLast > 0)
{
skippedLast = skip(m_remaining);
}
}
} }
|
public class class_name {
@Override public void close() throws IOException
{
long skippedLast = 0;
if (m_remaining > 0)
{
skippedLast = skip(m_remaining);
while (m_remaining > 0 && skippedLast > 0)
{
skippedLast = skip(m_remaining); // depends on control dependency: [while], data = [(m_remaining]
}
}
} }
|
public class class_name {
public static List<List<Point2D_I32>> labelToClusters( GrayS32 labelImage ,
int numLabels ,
FastQueue<Point2D_I32> queue )
{
List<List<Point2D_I32>> ret = new ArrayList<>();
for( int i = 0; i < numLabels+1; i++ ) {
ret.add( new ArrayList<Point2D_I32>() );
}
if( queue == null ) {
queue = new FastQueue<>(numLabels, Point2D_I32.class, true);
} else
queue.reset();
for( int y = 0; y < labelImage.height; y++ ) {
int start = labelImage.startIndex + y*labelImage.stride;
int end = start + labelImage.width;
for( int index = start; index < end; index++ ) {
int v = labelImage.data[index];
if( v > 0 ) {
Point2D_I32 p = queue.grow();
p.set(index-start,y);
ret.get(v).add(p);
}
}
}
// first list is a place holder and should be empty
if( ret.get(0).size() != 0 )
throw new RuntimeException("BUG!");
ret.remove(0);
return ret;
} }
|
public class class_name {
public static List<List<Point2D_I32>> labelToClusters( GrayS32 labelImage ,
int numLabels ,
FastQueue<Point2D_I32> queue )
{
List<List<Point2D_I32>> ret = new ArrayList<>();
for( int i = 0; i < numLabels+1; i++ ) {
ret.add( new ArrayList<Point2D_I32>() ); // depends on control dependency: [for], data = [none]
}
if( queue == null ) {
queue = new FastQueue<>(numLabels, Point2D_I32.class, true); // depends on control dependency: [if], data = [none]
} else
queue.reset();
for( int y = 0; y < labelImage.height; y++ ) {
int start = labelImage.startIndex + y*labelImage.stride;
int end = start + labelImage.width;
for( int index = start; index < end; index++ ) {
int v = labelImage.data[index];
if( v > 0 ) {
Point2D_I32 p = queue.grow();
p.set(index-start,y); // depends on control dependency: [if], data = [none]
ret.get(v).add(p); // depends on control dependency: [if], data = [none]
}
}
}
// first list is a place holder and should be empty
if( ret.get(0).size() != 0 )
throw new RuntimeException("BUG!");
ret.remove(0);
return ret;
} }
|
public class class_name {
protected void bindCollection(ToMany property, Collection collection,
PersistentClass owner, InFlightMetadataCollector mappings, String path, String sessionFactoryBeanName) {
// set role
String propertyName = getNameForPropertyAndPath(property, path);
collection.setRole(qualify(property.getOwner().getName(), propertyName));
PropertyConfig pc = getPropertyConfig(property);
// configure eager fetching
final FetchMode fetchMode = pc.getFetchMode();
if (fetchMode == FetchMode.JOIN) {
collection.setFetchMode(FetchMode.JOIN);
}
else if (pc.getFetchMode() != null) {
collection.setFetchMode(pc.getFetchMode());
}
else {
collection.setFetchMode(FetchMode.DEFAULT);
}
if (pc.getCascade() != null) {
collection.setOrphanDelete(pc.getCascade().equals(CASCADE_ALL_DELETE_ORPHAN));
}
// if it's a one-to-many mapping
if (shouldBindCollectionWithForeignKey(property)) {
OneToMany oneToMany = new OneToMany(metadataBuildingContext, collection.getOwner());
collection.setElement(oneToMany);
bindOneToMany((org.grails.datastore.mapping.model.types.OneToMany) property, oneToMany, mappings);
} else {
bindCollectionTable(property, mappings, collection, owner.getTable(), sessionFactoryBeanName);
if (!property.isOwningSide()) {
collection.setInverse(true);
}
}
if (pc.getBatchSize() != null) {
collection.setBatchSize(pc.getBatchSize());
}
// set up second pass
if (collection instanceof org.hibernate.mapping.Set) {
mappings.addSecondPass(new GrailsCollectionSecondPass(property, mappings, collection, sessionFactoryBeanName));
}
else if (collection instanceof org.hibernate.mapping.List) {
mappings.addSecondPass(new ListSecondPass(property, mappings, collection, sessionFactoryBeanName));
}
else if (collection instanceof org.hibernate.mapping.Map) {
mappings.addSecondPass(new MapSecondPass(property, mappings, collection, sessionFactoryBeanName));
}
else { // Collection -> Bag
mappings.addSecondPass(new GrailsCollectionSecondPass(property, mappings, collection, sessionFactoryBeanName));
}
} }
|
public class class_name {
protected void bindCollection(ToMany property, Collection collection,
PersistentClass owner, InFlightMetadataCollector mappings, String path, String sessionFactoryBeanName) {
// set role
String propertyName = getNameForPropertyAndPath(property, path);
collection.setRole(qualify(property.getOwner().getName(), propertyName));
PropertyConfig pc = getPropertyConfig(property);
// configure eager fetching
final FetchMode fetchMode = pc.getFetchMode();
if (fetchMode == FetchMode.JOIN) {
collection.setFetchMode(FetchMode.JOIN); // depends on control dependency: [if], data = [FetchMode.JOIN)]
}
else if (pc.getFetchMode() != null) {
collection.setFetchMode(pc.getFetchMode()); // depends on control dependency: [if], data = [(pc.getFetchMode()]
}
else {
collection.setFetchMode(FetchMode.DEFAULT); // depends on control dependency: [if], data = [none]
}
if (pc.getCascade() != null) {
collection.setOrphanDelete(pc.getCascade().equals(CASCADE_ALL_DELETE_ORPHAN)); // depends on control dependency: [if], data = [(pc.getCascade()]
}
// if it's a one-to-many mapping
if (shouldBindCollectionWithForeignKey(property)) {
OneToMany oneToMany = new OneToMany(metadataBuildingContext, collection.getOwner());
collection.setElement(oneToMany); // depends on control dependency: [if], data = [none]
bindOneToMany((org.grails.datastore.mapping.model.types.OneToMany) property, oneToMany, mappings); // depends on control dependency: [if], data = [none]
} else {
bindCollectionTable(property, mappings, collection, owner.getTable(), sessionFactoryBeanName); // depends on control dependency: [if], data = [none]
if (!property.isOwningSide()) {
collection.setInverse(true); // depends on control dependency: [if], data = [none]
}
}
if (pc.getBatchSize() != null) {
collection.setBatchSize(pc.getBatchSize()); // depends on control dependency: [if], data = [(pc.getBatchSize()]
}
// set up second pass
if (collection instanceof org.hibernate.mapping.Set) {
mappings.addSecondPass(new GrailsCollectionSecondPass(property, mappings, collection, sessionFactoryBeanName)); // depends on control dependency: [if], data = [none]
}
else if (collection instanceof org.hibernate.mapping.List) {
mappings.addSecondPass(new ListSecondPass(property, mappings, collection, sessionFactoryBeanName)); // depends on control dependency: [if], data = [none]
}
else if (collection instanceof org.hibernate.mapping.Map) {
mappings.addSecondPass(new MapSecondPass(property, mappings, collection, sessionFactoryBeanName)); // depends on control dependency: [if], data = [none]
}
else { // Collection -> Bag
mappings.addSecondPass(new GrailsCollectionSecondPass(property, mappings, collection, sessionFactoryBeanName)); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static void decodeFileToFile(String infile, String outfile) throws IOException {
byte[] decoded = Base64.decodeFromFile(infile);
java.io.OutputStream out = null;
try{
out = new java.io.BufferedOutputStream(new FileOutputStream(outfile));
out.write(decoded);
} catch (IOException e) {
throw e; // Catch and release to execute finally{}
} finally {
try {
if (out != null) {
out.close();
}
} catch (Exception ex) {
}
}
} }
|
public class class_name {
public static void decodeFileToFile(String infile, String outfile) throws IOException {
byte[] decoded = Base64.decodeFromFile(infile);
java.io.OutputStream out = null;
try{
out = new java.io.BufferedOutputStream(new FileOutputStream(outfile));
out.write(decoded);
} catch (IOException e) {
throw e; // Catch and release to execute finally{}
} finally {
try {
if (out != null) {
out.close(); // depends on control dependency: [if], data = [none]
}
} catch (Exception ex) {
} // depends on control dependency: [catch], data = [none]
}
} }
|
public class class_name {
public DashPackage withPeriodTriggers(PeriodTriggersElement... periodTriggers) {
java.util.ArrayList<String> periodTriggersCopy = new java.util.ArrayList<String>(periodTriggers.length);
for (PeriodTriggersElement value : periodTriggers) {
periodTriggersCopy.add(value.toString());
}
if (getPeriodTriggers() == null) {
setPeriodTriggers(periodTriggersCopy);
} else {
getPeriodTriggers().addAll(periodTriggersCopy);
}
return this;
} }
|
public class class_name {
public DashPackage withPeriodTriggers(PeriodTriggersElement... periodTriggers) {
java.util.ArrayList<String> periodTriggersCopy = new java.util.ArrayList<String>(periodTriggers.length);
for (PeriodTriggersElement value : periodTriggers) {
periodTriggersCopy.add(value.toString()); // depends on control dependency: [for], data = [value]
}
if (getPeriodTriggers() == null) {
setPeriodTriggers(periodTriggersCopy); // depends on control dependency: [if], data = [none]
} else {
getPeriodTriggers().addAll(periodTriggersCopy); // depends on control dependency: [if], data = [none]
}
return this;
} }
|
public class class_name {
private static void appendParam(final OmdbParameters params, final Param key, StringBuilder sb) {
if (params.has(key)) {
sb.append(DELIMITER_SUBSEQUENT).append(key.getValue()).append(params.get(key));
}
} }
|
public class class_name {
private static void appendParam(final OmdbParameters params, final Param key, StringBuilder sb) {
if (params.has(key)) {
sb.append(DELIMITER_SUBSEQUENT).append(key.getValue()).append(params.get(key)); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
protected static Span guess(Span span) {
if (span == null) {
return null;
}
long guessValue;
if (span.getWidth() > 1) {
guessValue = span.getBegin() + (span.getWidth() / 2);
}
else {
guessValue = span.getBegin();
}
Span guess = new Span(guessValue, guessValue);
return guess;
} }
|
public class class_name {
protected static Span guess(Span span) {
if (span == null) {
return null; // depends on control dependency: [if], data = [none]
}
long guessValue;
if (span.getWidth() > 1) {
guessValue = span.getBegin() + (span.getWidth() / 2); // depends on control dependency: [if], data = [(span.getWidth()]
}
else {
guessValue = span.getBegin(); // depends on control dependency: [if], data = [none]
}
Span guess = new Span(guessValue, guessValue);
return guess;
} }
|
public class class_name {
private void printLog() {
Logger.Builder builder = new Logger.Builder();
String tag = tagView.getText().toString();
if (!TextUtils.isEmpty(tag)) {
builder.tag(tag);
}
if (threadInfo.isChecked()) {
builder.t();
} else {
builder.nt();
}
if (stackTraceInfo.isChecked()) {
builder.st(STACK_TRACE_DEPTHS[stackTraceDepth.getSelectedItemPosition()]);
} else {
builder.nst();
}
if (border.isChecked()) {
builder.b();
} else {
builder.nb();
}
// Print the log to view, logcat and file.
if (hasPermission) {
builder.printers(
viewPrinter,
new AndroidPrinter(),
XLogSampleApplication.globalFilePrinter);
} else {
builder.printers(
viewPrinter,
new AndroidPrinter());
}
Logger logger = builder.build();
int levelPosition = levelView.getSelectedItemPosition();
int level = LEVELS[levelPosition];
switch (level) {
case LogLevel.VERBOSE:
logger.v(MESSAGE);
break;
case LogLevel.DEBUG:
logger.d(MESSAGE);
break;
case LogLevel.INFO:
logger.i(MESSAGE);
break;
case LogLevel.WARN:
logger.w(MESSAGE);
break;
case LogLevel.ERROR:
logger.e(MESSAGE);
break;
}
} }
|
public class class_name {
private void printLog() {
Logger.Builder builder = new Logger.Builder();
String tag = tagView.getText().toString();
if (!TextUtils.isEmpty(tag)) {
builder.tag(tag); // depends on control dependency: [if], data = [none]
}
if (threadInfo.isChecked()) {
builder.t(); // depends on control dependency: [if], data = [none]
} else {
builder.nt(); // depends on control dependency: [if], data = [none]
}
if (stackTraceInfo.isChecked()) {
builder.st(STACK_TRACE_DEPTHS[stackTraceDepth.getSelectedItemPosition()]); // depends on control dependency: [if], data = [none]
} else {
builder.nst(); // depends on control dependency: [if], data = [none]
}
if (border.isChecked()) {
builder.b(); // depends on control dependency: [if], data = [none]
} else {
builder.nb(); // depends on control dependency: [if], data = [none]
}
// Print the log to view, logcat and file.
if (hasPermission) {
builder.printers(
viewPrinter,
new AndroidPrinter(),
XLogSampleApplication.globalFilePrinter); // depends on control dependency: [if], data = [none]
} else {
builder.printers(
viewPrinter,
new AndroidPrinter()); // depends on control dependency: [if], data = [none]
}
Logger logger = builder.build();
int levelPosition = levelView.getSelectedItemPosition();
int level = LEVELS[levelPosition];
switch (level) {
case LogLevel.VERBOSE:
logger.v(MESSAGE);
break;
case LogLevel.DEBUG:
logger.d(MESSAGE);
break;
case LogLevel.INFO:
logger.i(MESSAGE);
break;
case LogLevel.WARN:
logger.w(MESSAGE);
break;
case LogLevel.ERROR:
logger.e(MESSAGE);
break;
}
} }
|
public class class_name {
public void resolveExpressionTypes(Session session) {
for (int i = 0; i < indexStartAggregates; i++) {
Expression e = exprColumns[i];
e.resolveTypes(session, null);
if (e.getType() == OpTypes.ROW) {
throw Error.error(ErrorCode.X_42564);
}
}
for (int i = 0, len = rangeVariables.length; i < len; i++) {
Expression e = rangeVariables[i].nonIndexJoinCondition;
if (e != null) {
e.resolveTypes(session, null);
if (e.getDataType() != Type.SQL_BOOLEAN) {
throw Error.error(ErrorCode.X_42568);
}
}
}
if (queryCondition != null) {
queryCondition.resolveTypes(session, null);
if (queryCondition.getDataType() != Type.SQL_BOOLEAN) {
throw Error.error(ErrorCode.X_42568);
}
if (queryCondition.opType == OpTypes.VALUE) {
if (!((boolean)queryCondition.valueData)) { // WHERE false => LIMIT 0
SortAndSlice sortAndSlice = new SortAndSlice();
ExpressionValue limit0 = new ExpressionValue(ValuePool.INTEGER_0, Type.SQL_INTEGER);
ExpressionValue offset = new ExpressionValue(ValuePool.INTEGER_0, Type.SQL_INTEGER);
sortAndSlice.addLimitCondition(new ExpressionOp(OpTypes.LIMIT, offset, limit0));
addSortAndSlice(sortAndSlice);
}
// Leave out the original WHERE condition no matter it is WHERE true or WHERE false.
queryCondition = null;
}
else {
// A VoltDB extension to guard against abuse of aggregates in subqueries.
// Make sure no aggregates in WHERE clause
tempSet.clear();
Expression.collectAllExpressions(
tempSet, queryCondition, Expression.aggregateFunctionSet,
Expression.subqueryExpressionSet);
if (!tempSet.isEmpty()) {
// A top level WHERE clause can't have aggregate expressions.
// In theory, a subquery WHERE clause may have aggregate
// expressions in some edge cases where they reference only
// columns from parent query(s).
// Even these should be restricted to cases where the subquery
// is evaluated after the parent agg, such as from the HAVING
// or SELECT clause of the parent query defining the columns.
// TO be safe, VoltDB doesn't support ANY cases of aggs of
// parent columns. All this code block does is choose between
// two error messages for two different unsupported cases.
if ( ! isTopLevel) {
HsqlList columnSet = new OrderedHashSet();
Iterator aggIt = tempSet.iterator();
while (aggIt.hasNext()) {
Expression nextAggr = (Expression) aggIt.next();
Expression.collectAllExpressions(columnSet, nextAggr,
Expression.columnExpressionSet, Expression.emptyExpressionSet);
}
Iterator columnIt = columnSet.iterator();
while (columnIt.hasNext()) {
Expression nextColumn = (Expression) columnIt.next();
assert(nextColumn instanceof ExpressionColumn);
ExpressionColumn nextColumnEx = (ExpressionColumn) nextColumn;
String tableName = nextColumnEx.rangeVariable.rangeTable.tableName.name;
String tableAlias = (nextColumnEx.rangeVariable.tableAlias != null) ?
nextColumnEx.rangeVariable.tableAlias.name : null;
boolean resolved = false;
for (RangeVariable rv : rangeVariables) {
if (rv.rangeTable.tableName.name.equals(tableName)) {
if (rv.tableAlias == null && tableAlias == null) {
resolved = true;
} else if (rv.tableAlias != null && tableAlias != null) {
resolved = tableAlias.equals(rv.tableAlias.name);
}
}
}
if (!resolved) {
throw Error.error(ErrorCode.X_47001);
}
}
}
// If we get here it means that WHERE expression has an aggregate expression
// with local columns
throw Error.error(ErrorCode.X_47000);
}
// End of VoltDB extension
}
}
if (havingCondition != null) {
havingCondition.resolveTypes(session, null);
if (havingCondition.getDataType() != Type.SQL_BOOLEAN) {
throw Error.error(ErrorCode.X_42568);
}
}
} }
|
public class class_name {
public void resolveExpressionTypes(Session session) {
for (int i = 0; i < indexStartAggregates; i++) {
Expression e = exprColumns[i];
e.resolveTypes(session, null); // depends on control dependency: [for], data = [none]
if (e.getType() == OpTypes.ROW) {
throw Error.error(ErrorCode.X_42564);
}
}
for (int i = 0, len = rangeVariables.length; i < len; i++) {
Expression e = rangeVariables[i].nonIndexJoinCondition;
if (e != null) {
e.resolveTypes(session, null); // depends on control dependency: [if], data = [null)]
if (e.getDataType() != Type.SQL_BOOLEAN) {
throw Error.error(ErrorCode.X_42568);
}
}
}
if (queryCondition != null) {
queryCondition.resolveTypes(session, null); // depends on control dependency: [if], data = [null)]
if (queryCondition.getDataType() != Type.SQL_BOOLEAN) {
throw Error.error(ErrorCode.X_42568);
}
if (queryCondition.opType == OpTypes.VALUE) {
if (!((boolean)queryCondition.valueData)) { // WHERE false => LIMIT 0
SortAndSlice sortAndSlice = new SortAndSlice();
ExpressionValue limit0 = new ExpressionValue(ValuePool.INTEGER_0, Type.SQL_INTEGER);
ExpressionValue offset = new ExpressionValue(ValuePool.INTEGER_0, Type.SQL_INTEGER);
sortAndSlice.addLimitCondition(new ExpressionOp(OpTypes.LIMIT, offset, limit0)); // depends on control dependency: [if], data = [none]
addSortAndSlice(sortAndSlice); // depends on control dependency: [if], data = [none]
}
// Leave out the original WHERE condition no matter it is WHERE true or WHERE false.
queryCondition = null; // depends on control dependency: [if], data = [none]
}
else {
// A VoltDB extension to guard against abuse of aggregates in subqueries.
// Make sure no aggregates in WHERE clause
tempSet.clear(); // depends on control dependency: [if], data = [none]
Expression.collectAllExpressions(
tempSet, queryCondition, Expression.aggregateFunctionSet,
Expression.subqueryExpressionSet); // depends on control dependency: [if], data = [none]
if (!tempSet.isEmpty()) {
// A top level WHERE clause can't have aggregate expressions.
// In theory, a subquery WHERE clause may have aggregate
// expressions in some edge cases where they reference only
// columns from parent query(s).
// Even these should be restricted to cases where the subquery
// is evaluated after the parent agg, such as from the HAVING
// or SELECT clause of the parent query defining the columns.
// TO be safe, VoltDB doesn't support ANY cases of aggs of
// parent columns. All this code block does is choose between
// two error messages for two different unsupported cases.
if ( ! isTopLevel) {
HsqlList columnSet = new OrderedHashSet();
Iterator aggIt = tempSet.iterator();
while (aggIt.hasNext()) {
Expression nextAggr = (Expression) aggIt.next();
Expression.collectAllExpressions(columnSet, nextAggr,
Expression.columnExpressionSet, Expression.emptyExpressionSet); // depends on control dependency: [while], data = [none]
}
Iterator columnIt = columnSet.iterator();
while (columnIt.hasNext()) {
Expression nextColumn = (Expression) columnIt.next();
assert(nextColumn instanceof ExpressionColumn); // depends on control dependency: [while], data = [none]
ExpressionColumn nextColumnEx = (ExpressionColumn) nextColumn;
String tableName = nextColumnEx.rangeVariable.rangeTable.tableName.name;
String tableAlias = (nextColumnEx.rangeVariable.tableAlias != null) ?
nextColumnEx.rangeVariable.tableAlias.name : null;
boolean resolved = false;
for (RangeVariable rv : rangeVariables) {
if (rv.rangeTable.tableName.name.equals(tableName)) {
if (rv.tableAlias == null && tableAlias == null) {
resolved = true; // depends on control dependency: [if], data = [none]
} else if (rv.tableAlias != null && tableAlias != null) {
resolved = tableAlias.equals(rv.tableAlias.name); // depends on control dependency: [if], data = [(rv.tableAlias]
}
}
}
if (!resolved) {
throw Error.error(ErrorCode.X_47001);
}
}
}
// If we get here it means that WHERE expression has an aggregate expression
// with local columns
throw Error.error(ErrorCode.X_47000);
}
// End of VoltDB extension
}
}
if (havingCondition != null) {
havingCondition.resolveTypes(session, null); // depends on control dependency: [if], data = [null)]
if (havingCondition.getDataType() != Type.SQL_BOOLEAN) {
throw Error.error(ErrorCode.X_42568);
}
}
} }
|
public class class_name {
public ConfigurableApplicationContext createApplicationContext() {
try {
// first try to create annotation config application context
Class<?>[] annotatedClasses = new Class<?>[resources.length];
for (int i = 0; i < resources.length; i++) {
annotatedClasses[i] = this.classLoader.loadClass(resources[i]);
}
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(annotatedClasses);
context.setParent(parent);
context.setClassLoader(classLoader);
return context;
} catch (ClassNotFoundException e) {
// create generic application context
GenericApplicationContext context = new GenericApplicationContext(parent);
context.setClassLoader(classLoader);
ResourceLoader resourceLoader = new DefaultResourceLoader(classLoader);
context.setResourceLoader(resourceLoader);
BeanDefinitionReader reader = new XmlBeanDefinitionReader(context);
for (String resource : resources) {
reader.loadBeanDefinitions(resourceLoader.getResource(resource));
}
context.refresh();
return context;
}
} }
|
public class class_name {
public ConfigurableApplicationContext createApplicationContext() {
try {
// first try to create annotation config application context
Class<?>[] annotatedClasses = new Class<?>[resources.length];
for (int i = 0; i < resources.length; i++) {
annotatedClasses[i] = this.classLoader.loadClass(resources[i]);
}
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(annotatedClasses);
context.setParent(parent);
// depends on control dependency: [try], data = [none]
context.setClassLoader(classLoader);
// depends on control dependency: [try], data = [none]
return context;
// depends on control dependency: [try], data = [none]
} catch (ClassNotFoundException e) {
// create generic application context
GenericApplicationContext context = new GenericApplicationContext(parent);
context.setClassLoader(classLoader);
ResourceLoader resourceLoader = new DefaultResourceLoader(classLoader);
context.setResourceLoader(resourceLoader);
BeanDefinitionReader reader = new XmlBeanDefinitionReader(context);
for (String resource : resources) {
reader.loadBeanDefinitions(resourceLoader.getResource(resource));
// depends on control dependency: [for], data = [resource]
}
context.refresh();
return context;
}
// depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static OSymmetricKey fromFile(final String algorithm, final String path) {
String base64Key = null;
try {
java.io.FileInputStream fis = null;
try {
fis = new java.io.FileInputStream(OSystemVariableResolver.resolveSystemVariables(path));
return fromStream(algorithm, fis);
} finally {
if (fis != null)
fis.close();
}
} catch (Exception ex) {
throw OException.wrapException(new OSecurityException("OSymmetricKey.fromFile() Exception: " + ex.getMessage()), ex);
}
} }
|
public class class_name {
public static OSymmetricKey fromFile(final String algorithm, final String path) {
String base64Key = null;
try {
java.io.FileInputStream fis = null;
try {
fis = new java.io.FileInputStream(OSystemVariableResolver.resolveSystemVariables(path)); // depends on control dependency: [try], data = [none]
return fromStream(algorithm, fis); // depends on control dependency: [try], data = [none]
} finally {
if (fis != null)
fis.close();
}
} catch (Exception ex) {
throw OException.wrapException(new OSecurityException("OSymmetricKey.fromFile() Exception: " + ex.getMessage()), ex);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static boolean hasLimitOrOrder(VoltXMLElement xmlElement) {
String names[] = {"limit", "offset", "ordercolumns"};
for (String name : names) {
List<VoltXMLElement> elements = xmlElement.findChildren(name);
if (!elements.isEmpty()) {
return true;
}
}
return false;
} }
|
public class class_name {
private static boolean hasLimitOrOrder(VoltXMLElement xmlElement) {
String names[] = {"limit", "offset", "ordercolumns"};
for (String name : names) {
List<VoltXMLElement> elements = xmlElement.findChildren(name);
if (!elements.isEmpty()) {
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} }
|
public class class_name {
public Key< byte[]> start( final PrivateKey key) throws NoSuchAlgorithmException, InvalidKeyException {
final Signature signature = Signature.getInstance( key.getAlgorithm());
signature.initSign( key);
final Key< byte[]> object = new Key< byte[]>();
consumers.put( object, new Consumer< byte[]>() {
public void consume( final ByteBuffer buffer) {
try {
signature.update( buffer);
} catch ( Exception e) {
throw new RuntimeException( e);
}
}
public byte[] finish() {
try {
return signature.sign();
} catch ( Exception e) {
throw new RuntimeException( e);
}
}
});
return object;
} }
|
public class class_name {
public Key< byte[]> start( final PrivateKey key) throws NoSuchAlgorithmException, InvalidKeyException {
final Signature signature = Signature.getInstance( key.getAlgorithm());
signature.initSign( key);
final Key< byte[]> object = new Key< byte[]>();
consumers.put( object, new Consumer< byte[]>() {
public void consume( final ByteBuffer buffer) {
try {
signature.update( buffer); // depends on control dependency: [try], data = [none]
} catch ( Exception e) {
throw new RuntimeException( e);
} // depends on control dependency: [catch], data = [none]
}
public byte[] finish() {
try {
return signature.sign(); // depends on control dependency: [try], data = [none]
} catch ( Exception e) {
throw new RuntimeException( e);
} // depends on control dependency: [catch], data = [none]
}
});
return object;
} }
|
public class class_name {
public void visit() {
String[] properties = resolveProperties(source, declared);
for (String name : properties) {
if (name == null) {
continue;
}
if (!rules.match(name, blacklist)) {
continue;
}
Object value;
String propertyName = name;
if (isSourceMap) {
propertyName = LEFT_SQ_BRACKET + name + RIGHT_SQ_BRACKET;
}
if (declared) {
value = BeanUtil.declared.getProperty(source, propertyName);
} else {
value = BeanUtil.pojo.getProperty(source, propertyName);
}
if (value == null && ignoreNullValues) {
continue;
}
if (value instanceof String && StringUtil.isEmpty((String) value)) {
continue;
}
visitProperty(name, value);
}
} }
|
public class class_name {
public void visit() {
String[] properties = resolveProperties(source, declared);
for (String name : properties) {
if (name == null) {
continue;
}
if (!rules.match(name, blacklist)) {
continue;
}
Object value;
String propertyName = name;
if (isSourceMap) {
propertyName = LEFT_SQ_BRACKET + name + RIGHT_SQ_BRACKET; // depends on control dependency: [if], data = [none]
}
if (declared) {
value = BeanUtil.declared.getProperty(source, propertyName); // depends on control dependency: [if], data = [none]
} else {
value = BeanUtil.pojo.getProperty(source, propertyName); // depends on control dependency: [if], data = [none]
}
if (value == null && ignoreNullValues) {
continue;
}
if (value instanceof String && StringUtil.isEmpty((String) value)) {
continue;
}
visitProperty(name, value); // depends on control dependency: [for], data = [name]
}
} }
|
public class class_name {
public void addWords(Collection<String> words){
if(false == (words instanceof Set)){
words = new HashSet<>(words);
}
for (String word : words) {
addWord(word);
}
} }
|
public class class_name {
public void addWords(Collection<String> words){
if(false == (words instanceof Set)){
words = new HashSet<>(words); // depends on control dependency: [if], data = [none]
}
for (String word : words) {
addWord(word); // depends on control dependency: [for], data = [word]
}
} }
|
public class class_name {
public void applyToClient (Name username, final ClientOp clop)
{
resolveClientObject(username, new ClientResolutionListener() {
public void clientResolved (Name username, ClientObject clobj) {
try {
clop.apply(clobj);
} catch (Exception e) {
log.warning("Client op failed", "username", username, "clop", clop, e);
} finally {
releaseClientObject(username);
}
}
public void resolutionFailed (Name username, Exception reason) {
clop.resolutionFailed(reason);
}
});
} }
|
public class class_name {
public void applyToClient (Name username, final ClientOp clop)
{
resolveClientObject(username, new ClientResolutionListener() {
public void clientResolved (Name username, ClientObject clobj) {
try {
clop.apply(clobj); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
log.warning("Client op failed", "username", username, "clop", clop, e);
} finally { // depends on control dependency: [catch], data = [none]
releaseClientObject(username);
}
}
public void resolutionFailed (Name username, Exception reason) {
clop.resolutionFailed(reason);
}
});
} }
|
public class class_name {
public static Optional<String> resolveJavaTypeName(ModelType modelType, ModelNode value) {
Optional<String> result = Optional.empty();
if(ModelType.STRING == modelType)
{
result = Optional.of("java.lang.String");
}
else if(ModelType.INT == modelType)
{
result = Optional.of("java.lang.Integer");
}
else if(ModelType.LONG == modelType)
{
result = Optional.of("java.lang.Long");
}
else if(ModelType.BOOLEAN == modelType)
{
result = Optional.of("java.lang.Boolean");
}
else if(ModelType.DOUBLE == modelType)
{
result = Optional.of("java.lang.Double");
}
else if(ModelType.BIG_DECIMAL == modelType )
{
result = Optional.of("java.math.BigDecimal");
}
else if (ModelType.OBJECT == modelType) {
result = Optional.of("java.util.Map");
}
else if (ModelType.LIST == modelType) {
result = Optional.of("java.util.List<" + resolveValueType(value) + ">");
}
else
{
logger.warning("Unsupported type "+modelType);
}
return result;
} }
|
public class class_name {
public static Optional<String> resolveJavaTypeName(ModelType modelType, ModelNode value) {
Optional<String> result = Optional.empty();
if(ModelType.STRING == modelType)
{
result = Optional.of("java.lang.String"); // depends on control dependency: [if], data = [none]
}
else if(ModelType.INT == modelType)
{
result = Optional.of("java.lang.Integer"); // depends on control dependency: [if], data = [none]
}
else if(ModelType.LONG == modelType)
{
result = Optional.of("java.lang.Long"); // depends on control dependency: [if], data = [none]
}
else if(ModelType.BOOLEAN == modelType)
{
result = Optional.of("java.lang.Boolean"); // depends on control dependency: [if], data = [none]
}
else if(ModelType.DOUBLE == modelType)
{
result = Optional.of("java.lang.Double"); // depends on control dependency: [if], data = [none]
}
else if(ModelType.BIG_DECIMAL == modelType )
{
result = Optional.of("java.math.BigDecimal"); // depends on control dependency: [if], data = [none]
}
else if (ModelType.OBJECT == modelType) {
result = Optional.of("java.util.Map"); // depends on control dependency: [if], data = [none]
}
else if (ModelType.LIST == modelType) {
result = Optional.of("java.util.List<" + resolveValueType(value) + ">"); // depends on control dependency: [if], data = [none]
}
else
{
logger.warning("Unsupported type "+modelType); // depends on control dependency: [if], data = [modelType)]
}
return result;
} }
|
public class class_name {
protected void bindElementDescription(BindingFactory factory, CodeElementExtractor.ElementDescription... descriptions) {
for (final CodeElementExtractor.ElementDescription description : descriptions) {
bindTypeReferences(factory,
description.getBuilderInterfaceType(),
description.getBuilderImplementationType(),
description.getBuilderCustomImplementationType());
}
} }
|
public class class_name {
protected void bindElementDescription(BindingFactory factory, CodeElementExtractor.ElementDescription... descriptions) {
for (final CodeElementExtractor.ElementDescription description : descriptions) {
bindTypeReferences(factory,
description.getBuilderInterfaceType(),
description.getBuilderImplementationType(),
description.getBuilderCustomImplementationType()); // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
public static boolean[] asBooleanArray(Collection collection) {
boolean[] result = new boolean[collection.size()];
int i = 0;
for (Object c : collection) {
result[i++] = asBoolean(c);
}
return result;
} }
|
public class class_name {
public static boolean[] asBooleanArray(Collection collection) {
boolean[] result = new boolean[collection.size()];
int i = 0;
for (Object c : collection) {
result[i++] = asBoolean(c); // depends on control dependency: [for], data = [c]
}
return result;
} }
|
public class class_name {
protected void processUrl(final String url) {
try {
final Result result = mProcessor.processUrl(url);
post(new Runnable() {
@Override
public void run() {
if (isAttachedToWindow()) {
postProcessUrl(url, result);
}
}
});
} catch (Throwable ex) {
if (LOGGING) {
Log.wtf(LOG_TAG, ex);
}
}
} }
|
public class class_name {
protected void processUrl(final String url) {
try {
final Result result = mProcessor.processUrl(url);
post(new Runnable() {
@Override
public void run() {
if (isAttachedToWindow()) {
postProcessUrl(url, result); // depends on control dependency: [if], data = [none]
}
}
}); // depends on control dependency: [try], data = [none]
} catch (Throwable ex) {
if (LOGGING) {
Log.wtf(LOG_TAG, ex); // depends on control dependency: [if], data = [none]
}
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public final <T extends IInvoice, TL extends AInvTxLn<T>>
TL findCreateTaxLine(final Map<String, Object> pReqVars, final T pInv,
final List<TL> pInvTxLns, final Tax pTax, final boolean pNeedFind,
final IFactorySimple<TL> pFctInvTxLn) throws Exception {
TL itl = null;
//find same line to add amount:
for (TL tl : pInvTxLns) {
if (tl.getTax() != null
&& tl.getTax().getItsId().equals(pTax.getItsId())) {
if (!pNeedFind) {
throw new Exception("Algorithm error!!!");
}
itl = tl;
break;
}
}
//find and enable disabled line:
for (TL tl : pInvTxLns) {
if (tl.getTax() == null) {
itl = tl;
itl.setTax(pTax);
break;
}
}
if (itl == null) {
itl = pFctInvTxLn.create(pReqVars);
itl.setItsOwner(pInv);
itl.setIsNew(true);
itl.setTax(pTax);
pInvTxLns.add(itl);
}
return itl;
} }
|
public class class_name {
public final <T extends IInvoice, TL extends AInvTxLn<T>>
TL findCreateTaxLine(final Map<String, Object> pReqVars, final T pInv,
final List<TL> pInvTxLns, final Tax pTax, final boolean pNeedFind,
final IFactorySimple<TL> pFctInvTxLn) throws Exception {
TL itl = null;
//find same line to add amount:
for (TL tl : pInvTxLns) {
if (tl.getTax() != null
&& tl.getTax().getItsId().equals(pTax.getItsId())) {
if (!pNeedFind) {
throw new Exception("Algorithm error!!!");
}
itl = tl; // depends on control dependency: [if], data = [none]
break;
}
}
//find and enable disabled line:
for (TL tl : pInvTxLns) {
if (tl.getTax() == null) {
itl = tl; // depends on control dependency: [if], data = [none]
itl.setTax(pTax); // depends on control dependency: [if], data = [none]
break;
}
}
if (itl == null) {
itl = pFctInvTxLn.create(pReqVars);
itl.setItsOwner(pInv);
itl.setIsNew(true);
itl.setTax(pTax);
pInvTxLns.add(itl);
}
return itl;
} }
|
public class class_name {
public final void genericMethodOrConstructorRest() throws RecognitionException {
int genericMethodOrConstructorRest_StartIndex = input.index();
try {
if ( state.backtracking>0 && alreadyParsedRule(input, 24) ) { return; }
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:5: ( ( type | 'void' ) Identifier methodDeclaratorRest | Identifier constructorDeclaratorRest )
int alt38=2;
int LA38_0 = input.LA(1);
if ( (LA38_0==Identifier) ) {
int LA38_1 = input.LA(2);
if ( (LA38_1==Identifier||LA38_1==47||LA38_1==53||LA38_1==59) ) {
alt38=1;
}
else if ( (LA38_1==36) ) {
alt38=2;
}
else {
if (state.backtracking>0) {state.failed=true; return;}
int nvaeMark = input.mark();
try {
input.consume();
NoViableAltException nvae =
new NoViableAltException("", 38, 1, input);
throw nvae;
} finally {
input.rewind(nvaeMark);
}
}
}
else if ( (LA38_0==65||LA38_0==67||LA38_0==71||LA38_0==77||LA38_0==85||LA38_0==92||LA38_0==94||LA38_0==105||LA38_0==118) ) {
alt38=1;
}
else {
if (state.backtracking>0) {state.failed=true; return;}
NoViableAltException nvae =
new NoViableAltException("", 38, 0, input);
throw nvae;
}
switch (alt38) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:7: ( type | 'void' ) Identifier methodDeclaratorRest
{
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:7: ( type | 'void' )
int alt37=2;
int LA37_0 = input.LA(1);
if ( (LA37_0==Identifier||LA37_0==65||LA37_0==67||LA37_0==71||LA37_0==77||LA37_0==85||LA37_0==92||LA37_0==94||LA37_0==105) ) {
alt37=1;
}
else if ( (LA37_0==118) ) {
alt37=2;
}
else {
if (state.backtracking>0) {state.failed=true; return;}
NoViableAltException nvae =
new NoViableAltException("", 37, 0, input);
throw nvae;
}
switch (alt37) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:8: type
{
pushFollow(FOLLOW_type_in_genericMethodOrConstructorRest801);
type();
state._fsp--;
if (state.failed) return;
}
break;
case 2 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:15: 'void'
{
match(input,118,FOLLOW_118_in_genericMethodOrConstructorRest805); if (state.failed) return;
}
break;
}
match(input,Identifier,FOLLOW_Identifier_in_genericMethodOrConstructorRest808); if (state.failed) return;
pushFollow(FOLLOW_methodDeclaratorRest_in_genericMethodOrConstructorRest810);
methodDeclaratorRest();
state._fsp--;
if (state.failed) return;
}
break;
case 2 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:380:7: Identifier constructorDeclaratorRest
{
match(input,Identifier,FOLLOW_Identifier_in_genericMethodOrConstructorRest818); if (state.failed) return;
pushFollow(FOLLOW_constructorDeclaratorRest_in_genericMethodOrConstructorRest820);
constructorDeclaratorRest();
state._fsp--;
if (state.failed) return;
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
if ( state.backtracking>0 ) { memoize(input, 24, genericMethodOrConstructorRest_StartIndex); }
}
} }
|
public class class_name {
public final void genericMethodOrConstructorRest() throws RecognitionException {
int genericMethodOrConstructorRest_StartIndex = input.index();
try {
if ( state.backtracking>0 && alreadyParsedRule(input, 24) ) { return; } // depends on control dependency: [if], data = [none]
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:5: ( ( type | 'void' ) Identifier methodDeclaratorRest | Identifier constructorDeclaratorRest )
int alt38=2;
int LA38_0 = input.LA(1);
if ( (LA38_0==Identifier) ) {
int LA38_1 = input.LA(2);
if ( (LA38_1==Identifier||LA38_1==47||LA38_1==53||LA38_1==59) ) {
alt38=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA38_1==36) ) {
alt38=2; // depends on control dependency: [if], data = [none]
}
else {
if (state.backtracking>0) {state.failed=true; return;} // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none]
int nvaeMark = input.mark();
try {
input.consume(); // depends on control dependency: [try], data = [none]
NoViableAltException nvae =
new NoViableAltException("", 38, 1, input);
throw nvae;
} finally {
input.rewind(nvaeMark);
}
}
}
else if ( (LA38_0==65||LA38_0==67||LA38_0==71||LA38_0==77||LA38_0==85||LA38_0==92||LA38_0==94||LA38_0==105||LA38_0==118) ) {
alt38=1; // depends on control dependency: [if], data = [none]
}
else {
if (state.backtracking>0) {state.failed=true; return;} // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none]
NoViableAltException nvae =
new NoViableAltException("", 38, 0, input);
throw nvae;
}
switch (alt38) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:7: ( type | 'void' ) Identifier methodDeclaratorRest
{
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:7: ( type | 'void' )
int alt37=2;
int LA37_0 = input.LA(1);
if ( (LA37_0==Identifier||LA37_0==65||LA37_0==67||LA37_0==71||LA37_0==77||LA37_0==85||LA37_0==92||LA37_0==94||LA37_0==105) ) {
alt37=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA37_0==118) ) {
alt37=2; // depends on control dependency: [if], data = [none]
}
else {
if (state.backtracking>0) {state.failed=true; return;} // depends on control dependency: [if], data = [none] // depends on control dependency: [if], data = [none]
NoViableAltException nvae =
new NoViableAltException("", 37, 0, input);
throw nvae;
}
switch (alt37) {
case 1 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:8: type
{
pushFollow(FOLLOW_type_in_genericMethodOrConstructorRest801);
type();
state._fsp--;
if (state.failed) return;
}
break;
case 2 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:379:15: 'void'
{
match(input,118,FOLLOW_118_in_genericMethodOrConstructorRest805); if (state.failed) return;
}
break;
}
match(input,Identifier,FOLLOW_Identifier_in_genericMethodOrConstructorRest808); if (state.failed) return;
pushFollow(FOLLOW_methodDeclaratorRest_in_genericMethodOrConstructorRest810);
methodDeclaratorRest();
state._fsp--;
if (state.failed) return;
}
break;
case 2 :
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:380:7: Identifier constructorDeclaratorRest
{
match(input,Identifier,FOLLOW_Identifier_in_genericMethodOrConstructorRest818); if (state.failed) return;
pushFollow(FOLLOW_constructorDeclaratorRest_in_genericMethodOrConstructorRest820);
constructorDeclaratorRest();
state._fsp--;
if (state.failed) return;
}
break;
}
}
catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
finally {
// do for sure before leaving
if ( state.backtracking>0 ) { memoize(input, 24, genericMethodOrConstructorRest_StartIndex); } // depends on control dependency: [if], data = [none]
}
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.