code stringlengths 130 281k | code_dependency stringlengths 182 306k |
|---|---|
public class class_name {
boolean updateMessages(final JSONArray inboxMessages){
boolean haveUpdates = false;
ArrayList<CTMessageDAO> newMessages = new ArrayList<>();
for(int i=0;i<inboxMessages.length();i++){
try {
CTMessageDAO messageDAO = CTMessageDAO.initWithJSON(inboxMessages.getJSONObject(i), this.userId);
if (messageDAO == null) {
continue;
}
if (!videoSupported && messageDAO.containsVideoOrAudio()) {
Logger.d("Dropping inbox message containing video/audio as app does not support video. For more information checkout CleverTap documentation.");
continue;
}
newMessages.add(messageDAO);
Logger.v("Inbox Message for message id - "+messageDAO.getId()+" added");
}catch (JSONException e){
Logger.d("Unable to update notification inbox messages - "+e.getLocalizedMessage());
}
}
if(newMessages.size() > 0) {
this.dbAdapter.upsertMessages(newMessages);
haveUpdates = true;
Logger.v("New Notification Inbox messages added");
synchronized (messagesLock) {
this.messages = this.dbAdapter.getMessages(this.userId);
trimMessages();
}
}
return haveUpdates;
} } | public class class_name {
boolean updateMessages(final JSONArray inboxMessages){
boolean haveUpdates = false;
ArrayList<CTMessageDAO> newMessages = new ArrayList<>();
for(int i=0;i<inboxMessages.length();i++){
try {
CTMessageDAO messageDAO = CTMessageDAO.initWithJSON(inboxMessages.getJSONObject(i), this.userId);
if (messageDAO == null) {
continue;
}
if (!videoSupported && messageDAO.containsVideoOrAudio()) {
Logger.d("Dropping inbox message containing video/audio as app does not support video. For more information checkout CleverTap documentation."); // depends on control dependency: [if], data = [none]
continue;
}
newMessages.add(messageDAO); // depends on control dependency: [try], data = [none]
Logger.v("Inbox Message for message id - "+messageDAO.getId()+" added"); // depends on control dependency: [try], data = [none]
}catch (JSONException e){
Logger.d("Unable to update notification inbox messages - "+e.getLocalizedMessage());
} // depends on control dependency: [catch], data = [none]
}
if(newMessages.size() > 0) {
this.dbAdapter.upsertMessages(newMessages); // depends on control dependency: [if], data = [none]
haveUpdates = true; // depends on control dependency: [if], data = [none]
Logger.v("New Notification Inbox messages added"); // depends on control dependency: [if], data = [none]
synchronized (messagesLock) { // depends on control dependency: [if], data = [none]
this.messages = this.dbAdapter.getMessages(this.userId);
trimMessages();
}
}
return haveUpdates;
} } |
public class class_name {
public static Mono<Void> whenDelayError(Publisher<?>... sources) {
if (sources.length == 0) {
return empty();
}
if (sources.length == 1) {
return empty(sources[0]);
}
return onAssembly(new MonoWhen(true, sources));
} } | public class class_name {
public static Mono<Void> whenDelayError(Publisher<?>... sources) {
if (sources.length == 0) {
return empty(); // depends on control dependency: [if], data = [none]
}
if (sources.length == 1) {
return empty(sources[0]); // depends on control dependency: [if], data = [none]
}
return onAssembly(new MonoWhen(true, sources));
} } |
public class class_name {
public Subject createSubject(final String authenticationContextName) {
AuthenticationContext context;
if (authenticationContextName != null && !authenticationContextName.isEmpty()) {
final ServiceContainer container = this.currentServiceContainer();
final ServiceName authContextServiceName = AUTHENTICATION_CONTEXT_RUNTIME_CAPABILITY.getCapabilityServiceName(authenticationContextName);
context = (AuthenticationContext) container.getRequiredService(authContextServiceName).getValue();
}
else {
context = getAuthenticationContext();
}
final Subject subject = this.createSubject(context);
if (ROOT_LOGGER.isTraceEnabled()) {
ROOT_LOGGER.subject(subject, Integer.toHexString(System.identityHashCode(subject)));
}
return subject;
} } | public class class_name {
public Subject createSubject(final String authenticationContextName) {
AuthenticationContext context;
if (authenticationContextName != null && !authenticationContextName.isEmpty()) {
final ServiceContainer container = this.currentServiceContainer();
final ServiceName authContextServiceName = AUTHENTICATION_CONTEXT_RUNTIME_CAPABILITY.getCapabilityServiceName(authenticationContextName);
context = (AuthenticationContext) container.getRequiredService(authContextServiceName).getValue(); // depends on control dependency: [if], data = [none]
}
else {
context = getAuthenticationContext(); // depends on control dependency: [if], data = [none]
}
final Subject subject = this.createSubject(context);
if (ROOT_LOGGER.isTraceEnabled()) {
ROOT_LOGGER.subject(subject, Integer.toHexString(System.identityHashCode(subject))); // depends on control dependency: [if], data = [none]
}
return subject;
} } |
public class class_name {
private static int createAcceptablePort() {
synchronized (random) {
final int FIRST_PORT;
final int LAST_PORT;
int freeAbove = HIGHEST_PORT - ephemeralRangeDetector.getHighestEphemeralPort();
int freeBelow = max(0, ephemeralRangeDetector.getLowestEphemeralPort() - START_OF_USER_PORTS);
if (freeAbove > freeBelow) {
FIRST_PORT = ephemeralRangeDetector.getHighestEphemeralPort();
LAST_PORT = 65535;
} else {
FIRST_PORT = 1024;
LAST_PORT = ephemeralRangeDetector.getLowestEphemeralPort();
}
if (FIRST_PORT == LAST_PORT) {
return FIRST_PORT;
}
if (FIRST_PORT > LAST_PORT) {
throw new UnsupportedOperationException("Could not find ephemeral port to use");
}
final int randomInt = random.nextInt();
final int portWithoutOffset = Math.abs(randomInt % (LAST_PORT - FIRST_PORT + 1));
return portWithoutOffset + FIRST_PORT;
}
} } | public class class_name {
private static int createAcceptablePort() {
synchronized (random) {
final int FIRST_PORT;
final int LAST_PORT;
int freeAbove = HIGHEST_PORT - ephemeralRangeDetector.getHighestEphemeralPort();
int freeBelow = max(0, ephemeralRangeDetector.getLowestEphemeralPort() - START_OF_USER_PORTS);
if (freeAbove > freeBelow) {
FIRST_PORT = ephemeralRangeDetector.getHighestEphemeralPort(); // depends on control dependency: [if], data = [none]
LAST_PORT = 65535; // depends on control dependency: [if], data = [none]
} else {
FIRST_PORT = 1024; // depends on control dependency: [if], data = [none]
LAST_PORT = ephemeralRangeDetector.getLowestEphemeralPort(); // depends on control dependency: [if], data = [none]
}
if (FIRST_PORT == LAST_PORT) {
return FIRST_PORT; // depends on control dependency: [if], data = [none]
}
if (FIRST_PORT > LAST_PORT) {
throw new UnsupportedOperationException("Could not find ephemeral port to use");
}
final int randomInt = random.nextInt();
final int portWithoutOffset = Math.abs(randomInt % (LAST_PORT - FIRST_PORT + 1));
return portWithoutOffset + FIRST_PORT;
}
} } |
public class class_name {
private StringBuilder buildElementCollectionValue(Field field, Object record, MetamodelImpl metaModel,
Attribute attribute)
{
StringBuilder elementCollectionValueBuilder = new StringBuilder();
EmbeddableType embeddableKey = metaModel.embeddable(((AbstractAttribute) attribute).getBindableJavaType());
((AbstractAttribute) attribute).getJavaMember();
Object value = PropertyAccessorHelper.getObject(record, field);
boolean isPresent = false;
if (Collection.class.isAssignableFrom(field.getType()))
{
if (value instanceof Collection)
{
Collection collection = ((Collection) value);
isPresent = true;
if (List.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.OPEN_SQUARE_BRACKET);
}
if (Set.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.OPEN_CURLY_BRACKET);
}
for (Object o : collection)
{
// Allowing null values.
// build embedded value
if (o != null)
{
StringBuilder embeddedValueBuilder = new StringBuilder(Constants.OPEN_CURLY_BRACKET);
for (Field embeddableColumn : ((AbstractAttribute) attribute).getBindableJavaType()
.getDeclaredFields())
{
if (!ReflectUtils.isTransientOrStatic(embeddableColumn))
{
AbstractAttribute subAttribute = (AbstractAttribute) embeddableKey
.getAttribute(embeddableColumn.getName());
if (metaModel.isEmbeddable(subAttribute.getBindableJavaType()))
{
// construct map; recursive
// send attribute
if (embeddableColumn.getType().isAnnotationPresent(ElementCollection.class))
{
// build element collection value
StringBuilder elementCollectionValue = buildElementCollectionValue(
embeddableColumn, o, metaModel, (Attribute) subAttribute);
appendColumnName(embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn
.getName()))).getJPAColumnName());
embeddedValueBuilder.append(Constants.COLON);
embeddedValueBuilder.append(elementCollectionValue);
}
else
{
buildEmbeddedValue(o, metaModel, embeddedValueBuilder,
(SingularAttribute) subAttribute);
}
}
else
{
// append key value
appendColumnName(
embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn.getName())))
.getJPAColumnName());
embeddedValueBuilder.append(Constants.COLON);
appendColumnValue(embeddedValueBuilder, o, embeddableColumn);
}
embeddedValueBuilder.append(Constants.COMMA);
}
}
// strip last char and append '}'
embeddedValueBuilder.deleteCharAt(embeddedValueBuilder.length() - 1);
embeddedValueBuilder.append(Constants.CLOSE_CURLY_BRACKET);
// add to columnbuilder and builder
elementCollectionValueBuilder.append(embeddedValueBuilder);
// end if
}
elementCollectionValueBuilder.append(Constants.COMMA);
}
if (!collection.isEmpty())
{
elementCollectionValueBuilder.deleteCharAt(elementCollectionValueBuilder.length() - 1);
}
if (List.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.CLOSE_SQUARE_BRACKET);
}
if (Set.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.CLOSE_CURLY_BRACKET);
}
return elementCollectionValueBuilder;
}
return null;
}
else if (Map.class.isAssignableFrom(field.getType()))
{
if (value instanceof Map)
{
Map map = ((Map) value);
isPresent = true;
elementCollectionValueBuilder.append(Constants.OPEN_CURLY_BRACKET);
for (Object mapKey : map.keySet())
{
Object mapValue = map.get(mapKey);
// Allowing null keys.
// key is basic type.. no support for embeddable keys
appendValue(elementCollectionValueBuilder, mapKey != null ? mapKey.getClass() : null, mapKey, false);
elementCollectionValueBuilder.append(Constants.COLON);
// Allowing null values.
if (mapValue != null)
{
StringBuilder embeddedValueBuilder = new StringBuilder(Constants.OPEN_CURLY_BRACKET);
for (Field embeddableColumn : ((AbstractAttribute) attribute).getBindableJavaType()
.getDeclaredFields())
{
if (!ReflectUtils.isTransientOrStatic(embeddableColumn))
{
AbstractAttribute subAttribute = (AbstractAttribute) embeddableKey
.getAttribute(embeddableColumn.getName());
if (metaModel.isEmbeddable(subAttribute.getBindableJavaType()))
{
// construct map; recursive
// send attribute
if (embeddableColumn.getType().isAnnotationPresent(ElementCollection.class))
{
// build element collection value
StringBuilder elementCollectionValue = buildElementCollectionValue(
embeddableColumn, mapValue, metaModel, (Attribute) subAttribute);
appendColumnName(embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn
.getName()))).getJPAColumnName());
embeddedValueBuilder.append(Constants.COLON);
embeddedValueBuilder.append(elementCollectionValue);
}
else
{
buildEmbeddedValue(mapValue, metaModel, embeddedValueBuilder,
(SingularAttribute) subAttribute);
}
}
else
{
// append key value
appendColumnName(
embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn.getName())))
.getJPAColumnName());
embeddedValueBuilder.append(Constants.COLON);
appendColumnValue(embeddedValueBuilder, mapValue, embeddableColumn);
}
embeddedValueBuilder.append(Constants.COMMA);
}
}
// strip last char and append '}'
embeddedValueBuilder.deleteCharAt(embeddedValueBuilder.length() - 1);
embeddedValueBuilder.append(Constants.CLOSE_CURLY_BRACKET);
// add to columnbuilder and builder
elementCollectionValueBuilder.append(embeddedValueBuilder);
// end if
}
elementCollectionValueBuilder.append(Constants.COMMA);
}
if (!map.isEmpty())
{
elementCollectionValueBuilder.deleteCharAt(elementCollectionValueBuilder.length() - 1);
}
elementCollectionValueBuilder.append(Constants.CLOSE_CURLY_BRACKET);
return elementCollectionValueBuilder;
}
return null;
}
return null;
} } | public class class_name {
private StringBuilder buildElementCollectionValue(Field field, Object record, MetamodelImpl metaModel,
Attribute attribute)
{
StringBuilder elementCollectionValueBuilder = new StringBuilder();
EmbeddableType embeddableKey = metaModel.embeddable(((AbstractAttribute) attribute).getBindableJavaType());
((AbstractAttribute) attribute).getJavaMember();
Object value = PropertyAccessorHelper.getObject(record, field);
boolean isPresent = false;
if (Collection.class.isAssignableFrom(field.getType()))
{
if (value instanceof Collection)
{
Collection collection = ((Collection) value);
isPresent = true; // depends on control dependency: [if], data = [none]
if (List.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.OPEN_SQUARE_BRACKET); // depends on control dependency: [if], data = [none]
}
if (Set.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.OPEN_CURLY_BRACKET); // depends on control dependency: [if], data = [none]
}
for (Object o : collection)
{
// Allowing null values.
// build embedded value
if (o != null)
{
StringBuilder embeddedValueBuilder = new StringBuilder(Constants.OPEN_CURLY_BRACKET);
for (Field embeddableColumn : ((AbstractAttribute) attribute).getBindableJavaType()
.getDeclaredFields())
{
if (!ReflectUtils.isTransientOrStatic(embeddableColumn))
{
AbstractAttribute subAttribute = (AbstractAttribute) embeddableKey
.getAttribute(embeddableColumn.getName());
if (metaModel.isEmbeddable(subAttribute.getBindableJavaType()))
{
// construct map; recursive
// send attribute
if (embeddableColumn.getType().isAnnotationPresent(ElementCollection.class))
{
// build element collection value
StringBuilder elementCollectionValue = buildElementCollectionValue(
embeddableColumn, o, metaModel, (Attribute) subAttribute);
appendColumnName(embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn
.getName()))).getJPAColumnName()); // depends on control dependency: [if], data = [none]
embeddedValueBuilder.append(Constants.COLON); // depends on control dependency: [if], data = [none]
embeddedValueBuilder.append(elementCollectionValue); // depends on control dependency: [if], data = [none]
}
else
{
buildEmbeddedValue(o, metaModel, embeddedValueBuilder,
(SingularAttribute) subAttribute); // depends on control dependency: [if], data = [none]
}
}
else
{
// append key value
appendColumnName(
embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn.getName())))
.getJPAColumnName()); // depends on control dependency: [if], data = [none]
embeddedValueBuilder.append(Constants.COLON); // depends on control dependency: [if], data = [none]
appendColumnValue(embeddedValueBuilder, o, embeddableColumn); // depends on control dependency: [if], data = [none]
}
embeddedValueBuilder.append(Constants.COMMA); // depends on control dependency: [if], data = [none]
}
}
// strip last char and append '}'
embeddedValueBuilder.deleteCharAt(embeddedValueBuilder.length() - 1); // depends on control dependency: [if], data = [none]
embeddedValueBuilder.append(Constants.CLOSE_CURLY_BRACKET); // depends on control dependency: [if], data = [none]
// add to columnbuilder and builder
elementCollectionValueBuilder.append(embeddedValueBuilder); // depends on control dependency: [if], data = [none]
// end if
}
elementCollectionValueBuilder.append(Constants.COMMA); // depends on control dependency: [for], data = [o]
}
if (!collection.isEmpty())
{
elementCollectionValueBuilder.deleteCharAt(elementCollectionValueBuilder.length() - 1); // depends on control dependency: [if], data = [none]
}
if (List.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.CLOSE_SQUARE_BRACKET); // depends on control dependency: [if], data = [none]
}
if (Set.class.isAssignableFrom(field.getType()))
{
elementCollectionValueBuilder.append(Constants.CLOSE_CURLY_BRACKET); // depends on control dependency: [if], data = [none]
}
return elementCollectionValueBuilder; // depends on control dependency: [if], data = [none]
}
return null; // depends on control dependency: [if], data = [none]
}
else if (Map.class.isAssignableFrom(field.getType()))
{
if (value instanceof Map)
{
Map map = ((Map) value);
isPresent = true; // depends on control dependency: [if], data = [none]
elementCollectionValueBuilder.append(Constants.OPEN_CURLY_BRACKET); // depends on control dependency: [if], data = [none]
for (Object mapKey : map.keySet())
{
Object mapValue = map.get(mapKey);
// Allowing null keys.
// key is basic type.. no support for embeddable keys
appendValue(elementCollectionValueBuilder, mapKey != null ? mapKey.getClass() : null, mapKey, false); // depends on control dependency: [for], data = [mapKey]
elementCollectionValueBuilder.append(Constants.COLON); // depends on control dependency: [for], data = [none]
// Allowing null values.
if (mapValue != null)
{
StringBuilder embeddedValueBuilder = new StringBuilder(Constants.OPEN_CURLY_BRACKET);
for (Field embeddableColumn : ((AbstractAttribute) attribute).getBindableJavaType()
.getDeclaredFields())
{
if (!ReflectUtils.isTransientOrStatic(embeddableColumn))
{
AbstractAttribute subAttribute = (AbstractAttribute) embeddableKey
.getAttribute(embeddableColumn.getName());
if (metaModel.isEmbeddable(subAttribute.getBindableJavaType()))
{
// construct map; recursive
// send attribute
if (embeddableColumn.getType().isAnnotationPresent(ElementCollection.class))
{
// build element collection value
StringBuilder elementCollectionValue = buildElementCollectionValue(
embeddableColumn, mapValue, metaModel, (Attribute) subAttribute);
appendColumnName(embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn
.getName()))).getJPAColumnName()); // depends on control dependency: [if], data = [none]
embeddedValueBuilder.append(Constants.COLON); // depends on control dependency: [if], data = [none]
embeddedValueBuilder.append(elementCollectionValue); // depends on control dependency: [if], data = [none]
}
else
{
buildEmbeddedValue(mapValue, metaModel, embeddedValueBuilder,
(SingularAttribute) subAttribute); // depends on control dependency: [if], data = [none]
}
}
else
{
// append key value
appendColumnName(
embeddedValueBuilder,
((AbstractAttribute) (embeddableKey.getAttribute(embeddableColumn.getName())))
.getJPAColumnName()); // depends on control dependency: [if], data = [none]
embeddedValueBuilder.append(Constants.COLON); // depends on control dependency: [if], data = [none]
appendColumnValue(embeddedValueBuilder, mapValue, embeddableColumn); // depends on control dependency: [if], data = [none]
}
embeddedValueBuilder.append(Constants.COMMA); // depends on control dependency: [if], data = [none]
}
}
// strip last char and append '}'
embeddedValueBuilder.deleteCharAt(embeddedValueBuilder.length() - 1); // depends on control dependency: [if], data = [none]
embeddedValueBuilder.append(Constants.CLOSE_CURLY_BRACKET); // depends on control dependency: [if], data = [none]
// add to columnbuilder and builder
elementCollectionValueBuilder.append(embeddedValueBuilder); // depends on control dependency: [if], data = [none]
// end if
}
elementCollectionValueBuilder.append(Constants.COMMA); // depends on control dependency: [for], data = [none]
}
if (!map.isEmpty())
{
elementCollectionValueBuilder.deleteCharAt(elementCollectionValueBuilder.length() - 1); // depends on control dependency: [if], data = [none]
}
elementCollectionValueBuilder.append(Constants.CLOSE_CURLY_BRACKET); // depends on control dependency: [if], data = [none]
return elementCollectionValueBuilder; // depends on control dependency: [if], data = [none]
}
return null; // depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
private TimephasedCost[] splitFirstDay(ProjectCalendar calendar, TimephasedCost assignment)
{
TimephasedCost[] result = new TimephasedCost[2];
//
// Retrieve data used to calculate the pro-rata work split
//
Date assignmentStart = assignment.getStart();
Date assignmentFinish = assignment.getFinish();
Duration calendarWork = calendar.getWork(assignmentStart, assignmentFinish, TimeUnit.MINUTES);
if (calendarWork.getDuration() != 0)
{
//
// Split the first day
//
Date splitFinish;
double splitCost;
if (calendar.isWorkingDate(assignmentStart))
{
Date splitStart = assignmentStart;
Date splitFinishTime = calendar.getFinishTime(splitStart);
splitFinish = DateHelper.setTime(splitStart, splitFinishTime);
Duration calendarSplitWork = calendar.getWork(splitStart, splitFinish, TimeUnit.MINUTES);
splitCost = (assignment.getTotalAmount().doubleValue() * calendarSplitWork.getDuration()) / calendarWork.getDuration();
TimephasedCost split = new TimephasedCost();
split.setStart(splitStart);
split.setFinish(splitFinish);
split.setTotalAmount(Double.valueOf(splitCost));
result[0] = split;
}
else
{
splitFinish = assignmentStart;
splitCost = 0;
}
//
// Split the remainder
//
Date splitStart = calendar.getNextWorkStart(splitFinish);
splitFinish = assignmentFinish;
TimephasedCost split;
if (splitStart.getTime() > splitFinish.getTime())
{
split = null;
}
else
{
splitCost = assignment.getTotalAmount().doubleValue() - splitCost;
split = new TimephasedCost();
split.setStart(splitStart);
split.setFinish(splitFinish);
split.setTotalAmount(Double.valueOf(splitCost));
split.setAmountPerDay(assignment.getAmountPerDay());
}
result[1] = split;
}
return result;
} } | public class class_name {
private TimephasedCost[] splitFirstDay(ProjectCalendar calendar, TimephasedCost assignment)
{
TimephasedCost[] result = new TimephasedCost[2];
//
// Retrieve data used to calculate the pro-rata work split
//
Date assignmentStart = assignment.getStart();
Date assignmentFinish = assignment.getFinish();
Duration calendarWork = calendar.getWork(assignmentStart, assignmentFinish, TimeUnit.MINUTES);
if (calendarWork.getDuration() != 0)
{
//
// Split the first day
//
Date splitFinish;
double splitCost;
if (calendar.isWorkingDate(assignmentStart))
{
Date splitStart = assignmentStart;
Date splitFinishTime = calendar.getFinishTime(splitStart);
splitFinish = DateHelper.setTime(splitStart, splitFinishTime); // depends on control dependency: [if], data = [none]
Duration calendarSplitWork = calendar.getWork(splitStart, splitFinish, TimeUnit.MINUTES);
splitCost = (assignment.getTotalAmount().doubleValue() * calendarSplitWork.getDuration()) / calendarWork.getDuration(); // depends on control dependency: [if], data = [none]
TimephasedCost split = new TimephasedCost();
split.setStart(splitStart); // depends on control dependency: [if], data = [none]
split.setFinish(splitFinish); // depends on control dependency: [if], data = [none]
split.setTotalAmount(Double.valueOf(splitCost)); // depends on control dependency: [if], data = [none]
result[0] = split; // depends on control dependency: [if], data = [none]
}
else
{
splitFinish = assignmentStart; // depends on control dependency: [if], data = [none]
splitCost = 0; // depends on control dependency: [if], data = [none]
}
//
// Split the remainder
//
Date splitStart = calendar.getNextWorkStart(splitFinish);
splitFinish = assignmentFinish; // depends on control dependency: [if], data = [none]
TimephasedCost split;
if (splitStart.getTime() > splitFinish.getTime())
{
split = null; // depends on control dependency: [if], data = [none]
}
else
{
splitCost = assignment.getTotalAmount().doubleValue() - splitCost; // depends on control dependency: [if], data = [none]
split = new TimephasedCost(); // depends on control dependency: [if], data = [none]
split.setStart(splitStart); // depends on control dependency: [if], data = [none]
split.setFinish(splitFinish); // depends on control dependency: [if], data = [none]
split.setTotalAmount(Double.valueOf(splitCost)); // depends on control dependency: [if], data = [none]
split.setAmountPerDay(assignment.getAmountPerDay()); // depends on control dependency: [if], data = [none]
}
result[1] = split; // depends on control dependency: [if], data = [none]
}
return result;
} } |
public class class_name {
static int mergeExplicitPolicy(int explicitPolicy, X509CertImpl currCert,
boolean finalCert) throws CertPathValidatorException
{
if ((explicitPolicy > 0) && !X509CertImpl.isSelfIssued(currCert)) {
explicitPolicy--;
}
try {
PolicyConstraintsExtension polConstExt
= currCert.getPolicyConstraintsExtension();
if (polConstExt == null)
return explicitPolicy;
int require =
polConstExt.get(PolicyConstraintsExtension.REQUIRE).intValue();
if (debug != null) {
debug.println("PolicyChecker.mergeExplicitPolicy() "
+ "require Index from cert = " + require);
}
if (!finalCert) {
if (require != -1) {
if ((explicitPolicy == -1) || (require < explicitPolicy)) {
explicitPolicy = require;
}
}
} else {
if (require == 0)
explicitPolicy = require;
}
} catch (IOException e) {
if (debug != null) {
debug.println("PolicyChecker.mergeExplicitPolicy "
+ "unexpected exception");
e.printStackTrace();
}
throw new CertPathValidatorException(e);
}
return explicitPolicy;
} } | public class class_name {
static int mergeExplicitPolicy(int explicitPolicy, X509CertImpl currCert,
boolean finalCert) throws CertPathValidatorException
{
if ((explicitPolicy > 0) && !X509CertImpl.isSelfIssued(currCert)) {
explicitPolicy--;
}
try {
PolicyConstraintsExtension polConstExt
= currCert.getPolicyConstraintsExtension();
if (polConstExt == null)
return explicitPolicy;
int require =
polConstExt.get(PolicyConstraintsExtension.REQUIRE).intValue();
if (debug != null) {
debug.println("PolicyChecker.mergeExplicitPolicy() "
+ "require Index from cert = " + require); // depends on control dependency: [if], data = [none]
}
if (!finalCert) {
if (require != -1) {
if ((explicitPolicy == -1) || (require < explicitPolicy)) {
explicitPolicy = require; // depends on control dependency: [if], data = [none]
}
}
} else {
if (require == 0)
explicitPolicy = require;
}
} catch (IOException e) {
if (debug != null) {
debug.println("PolicyChecker.mergeExplicitPolicy "
+ "unexpected exception"); // depends on control dependency: [if], data = [none]
e.printStackTrace(); // depends on control dependency: [if], data = [none]
}
throw new CertPathValidatorException(e);
}
return explicitPolicy;
} } |
public class class_name {
public void doInvocationCollaboratorsPreInvoke(IInvocationCollaborator[] webAppInvocationCollaborators, WebComponentMetaData cmd,
ServletRequest request, ServletResponse response)
{
if (webAppInvCollabs != null && !webAppInvCollabs.isEmpty())
{
for (WebAppInvocationCollaborator inv : webAppInvCollabs)
{
inv.preInvoke(cmd,request,response);
}
}
} } | public class class_name {
public void doInvocationCollaboratorsPreInvoke(IInvocationCollaborator[] webAppInvocationCollaborators, WebComponentMetaData cmd,
ServletRequest request, ServletResponse response)
{
if (webAppInvCollabs != null && !webAppInvCollabs.isEmpty())
{
for (WebAppInvocationCollaborator inv : webAppInvCollabs)
{
inv.preInvoke(cmd,request,response); // depends on control dependency: [for], data = [inv]
}
}
} } |
public class class_name {
public static Object transformResult(Object result) {
if (java8MethodIsArray == null || !(result instanceof Map)) {
return result;
}
// PATCH BY MAT ABOUT NASHORN RETURNING VALUE FOR ARRAYS.
try {
if ((Boolean) java8MethodIsArray.invoke(result)) {
List<?> partial = new ArrayList(((Map) result).values());
List<Object> finalResult = new ArrayList<Object>();
for (Object o : partial) {
finalResult.add(transformResult(o));
}
return finalResult;
} else {
Map<Object, Object> mapResult = (Map) result;
List<Object> keys = new ArrayList<Object>(mapResult.keySet());
for (Object key : keys) {
mapResult.put(key, transformResult(mapResult.get(key)));
}
return mapResult;
}
} catch (Exception e) {
OLogManager.instance().error(OCommandExecutorUtility.class, "", e);
}
return result;
} } | public class class_name {
public static Object transformResult(Object result) {
if (java8MethodIsArray == null || !(result instanceof Map)) {
return result; // depends on control dependency: [if], data = [none]
}
// PATCH BY MAT ABOUT NASHORN RETURNING VALUE FOR ARRAYS.
try {
if ((Boolean) java8MethodIsArray.invoke(result)) {
List<?> partial = new ArrayList(((Map) result).values());
List<Object> finalResult = new ArrayList<Object>();
for (Object o : partial) {
finalResult.add(transformResult(o)); // depends on control dependency: [for], data = [o]
}
return finalResult; // depends on control dependency: [if], data = [none]
} else {
Map<Object, Object> mapResult = (Map) result;
List<Object> keys = new ArrayList<Object>(mapResult.keySet());
for (Object key : keys) {
mapResult.put(key, transformResult(mapResult.get(key))); // depends on control dependency: [for], data = [key]
}
return mapResult; // depends on control dependency: [if], data = [none]
}
} catch (Exception e) {
OLogManager.instance().error(OCommandExecutorUtility.class, "", e);
} // depends on control dependency: [catch], data = [none]
return result;
} } |
public class class_name {
public boolean validate(String username, String password) {
// If username matches
if (username != null && password != null
&& username.equals(this.username)) {
switch (encoding) {
// If plain text, just compare
case PLAIN_TEXT:
// Compare plaintext
return password.equals(this.password);
// If hased with MD5, hash password and compare
case MD5:
// Compare hashed password
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
String hashedPassword = getHexString(digest.digest(password.getBytes("UTF-8")));
return hashedPassword.equals(this.password.toUpperCase());
}
catch (UnsupportedEncodingException e) {
throw new UnsupportedOperationException("Unexpected lack of UTF-8 support.", e);
}
catch (NoSuchAlgorithmException e) {
throw new UnsupportedOperationException("Unexpected lack of MD5 support.", e);
}
}
} // end validation check
return false;
} } | public class class_name {
public boolean validate(String username, String password) {
// If username matches
if (username != null && password != null
&& username.equals(this.username)) {
switch (encoding) {
// If plain text, just compare
case PLAIN_TEXT:
// Compare plaintext
return password.equals(this.password);
// If hased with MD5, hash password and compare
case MD5:
// Compare hashed password
try {
MessageDigest digest = MessageDigest.getInstance("MD5");
String hashedPassword = getHexString(digest.digest(password.getBytes("UTF-8")));
return hashedPassword.equals(this.password.toUpperCase()); // depends on control dependency: [try], data = [none]
}
catch (UnsupportedEncodingException e) {
throw new UnsupportedOperationException("Unexpected lack of UTF-8 support.", e);
} // depends on control dependency: [catch], data = [none]
catch (NoSuchAlgorithmException e) {
throw new UnsupportedOperationException("Unexpected lack of MD5 support.", e);
} // depends on control dependency: [catch], data = [none]
}
} // end validation check
return false;
} } |
public class class_name {
@Override
public Discriminator getDiscriminator() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "getDiscriminator called erroneously on TCPChannel");
}
return null;
} } | public class class_name {
@Override
public Discriminator getDiscriminator() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "getDiscriminator called erroneously on TCPChannel"); // depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
public void add(double x)
{
if (Double.isNaN(mean))//fist case
{
mean = x;
variance = 0;
}
else//general case
{
//first update stnd deviation
variance = (1-smoothing)*(variance + smoothing*Math.pow(x-mean, 2));
mean = (1-smoothing)*mean + smoothing*x;
}
} } | public class class_name {
public void add(double x)
{
if (Double.isNaN(mean))//fist case
{
mean = x; // depends on control dependency: [if], data = [none]
variance = 0; // depends on control dependency: [if], data = [none]
}
else//general case
{
//first update stnd deviation
variance = (1-smoothing)*(variance + smoothing*Math.pow(x-mean, 2)); // depends on control dependency: [if], data = [none]
mean = (1-smoothing)*mean + smoothing*x; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private Timestamp convertFieldValueToTimestamp(final Field field,
final ExportContainer exportContainer) {
if (field.getType().equals(LocalDateTime.class)) {
return convertToTimestamp(parseDateTime(exportContainer.getExportValue()));
} else if (field.getType().equals(LocalDate.class)) {
return convertToTimestamp(parseDate(exportContainer.getExportValue()));
} else if (field.getType().equals(LocalTime.class)) {
return convertToTimestamp(parseTime(exportContainer.getExportValue()));
} else if (field.getType().equals(Date.class)) {
return convertToTimestamp(parseSimpleDateLong(exportContainer.getExportValue()));
} else if (field.getType().equals(Timestamp.class)) {
return Timestamp.valueOf(exportContainer.getExportValue());
}
return null;
} } | public class class_name {
private Timestamp convertFieldValueToTimestamp(final Field field,
final ExportContainer exportContainer) {
if (field.getType().equals(LocalDateTime.class)) {
return convertToTimestamp(parseDateTime(exportContainer.getExportValue())); // depends on control dependency: [if], data = [none]
} else if (field.getType().equals(LocalDate.class)) {
return convertToTimestamp(parseDate(exportContainer.getExportValue())); // depends on control dependency: [if], data = [none]
} else if (field.getType().equals(LocalTime.class)) {
return convertToTimestamp(parseTime(exportContainer.getExportValue())); // depends on control dependency: [if], data = [none]
} else if (field.getType().equals(Date.class)) {
return convertToTimestamp(parseSimpleDateLong(exportContainer.getExportValue())); // depends on control dependency: [if], data = [none]
} else if (field.getType().equals(Timestamp.class)) {
return Timestamp.valueOf(exportContainer.getExportValue()); // depends on control dependency: [if], data = [none]
}
return null;
} } |
public class class_name {
public void onKeyPress(KeyPressEvent event) {
Widget widget = (Widget)event.getSource();
int unicodeCharCode = event.getUnicodeCharCode();
char keyCode = event.getCharCode();
if (widget == m_tbHexColor) {
// Disallow non-hex in hexadecimal boxes
if ((!Character.isDigit(keyCode))
&& (unicodeCharCode != 'A')
&& (unicodeCharCode != 'a')
&& (unicodeCharCode != 'B')
&& (unicodeCharCode != 'b')
&& (unicodeCharCode != 'C')
&& (unicodeCharCode != 'c')
&& (unicodeCharCode != 'D')
&& (unicodeCharCode != 'd')
&& (unicodeCharCode != 'E')
&& (unicodeCharCode != 'e')
&& (unicodeCharCode != 'F')
&& (unicodeCharCode != 'f')
&& (unicodeCharCode != KeyCodes.KEY_TAB)
&& (unicodeCharCode != (char)KeyCodes.KEY_BACKSPACE)
&& (unicodeCharCode != (char)KeyCodes.KEY_DELETE)
&& (unicodeCharCode != (char)KeyCodes.KEY_ENTER)
&& (unicodeCharCode != (char)KeyCodes.KEY_HOME)
&& (unicodeCharCode != (char)KeyCodes.KEY_END)
&& (unicodeCharCode != (char)KeyCodes.KEY_LEFT)
&& (unicodeCharCode != (char)KeyCodes.KEY_UP)
&& (unicodeCharCode != (char)KeyCodes.KEY_RIGHT)
&& (unicodeCharCode != (char)KeyCodes.KEY_DOWN)) {
((TextBox)widget).cancelKey();
}
} else {
// Disallow non-numerics in numeric boxes
if ((!Character.isDigit(keyCode))
&& (keyCode != (char)KeyCodes.KEY_TAB)
&& (keyCode != (char)KeyCodes.KEY_BACKSPACE)
&& (keyCode != (char)KeyCodes.KEY_DELETE)
&& (keyCode != (char)KeyCodes.KEY_ENTER)
&& (keyCode != (char)KeyCodes.KEY_HOME)
&& (keyCode != (char)KeyCodes.KEY_END)
&& (keyCode != (char)KeyCodes.KEY_LEFT)
&& (keyCode != (char)KeyCodes.KEY_UP)
&& (keyCode != (char)KeyCodes.KEY_RIGHT)
&& (keyCode != (char)KeyCodes.KEY_DOWN)) {
((TextBox)widget).cancelKey();
}
}
} } | public class class_name {
public void onKeyPress(KeyPressEvent event) {
Widget widget = (Widget)event.getSource();
int unicodeCharCode = event.getUnicodeCharCode();
char keyCode = event.getCharCode();
if (widget == m_tbHexColor) {
// Disallow non-hex in hexadecimal boxes
if ((!Character.isDigit(keyCode))
&& (unicodeCharCode != 'A')
&& (unicodeCharCode != 'a')
&& (unicodeCharCode != 'B')
&& (unicodeCharCode != 'b')
&& (unicodeCharCode != 'C')
&& (unicodeCharCode != 'c')
&& (unicodeCharCode != 'D')
&& (unicodeCharCode != 'd')
&& (unicodeCharCode != 'E')
&& (unicodeCharCode != 'e')
&& (unicodeCharCode != 'F')
&& (unicodeCharCode != 'f')
&& (unicodeCharCode != KeyCodes.KEY_TAB)
&& (unicodeCharCode != (char)KeyCodes.KEY_BACKSPACE)
&& (unicodeCharCode != (char)KeyCodes.KEY_DELETE)
&& (unicodeCharCode != (char)KeyCodes.KEY_ENTER)
&& (unicodeCharCode != (char)KeyCodes.KEY_HOME)
&& (unicodeCharCode != (char)KeyCodes.KEY_END)
&& (unicodeCharCode != (char)KeyCodes.KEY_LEFT)
&& (unicodeCharCode != (char)KeyCodes.KEY_UP)
&& (unicodeCharCode != (char)KeyCodes.KEY_RIGHT)
&& (unicodeCharCode != (char)KeyCodes.KEY_DOWN)) {
((TextBox)widget).cancelKey();
// depends on control dependency: [if], data = [none]
}
} else {
// Disallow non-numerics in numeric boxes
if ((!Character.isDigit(keyCode))
&& (keyCode != (char)KeyCodes.KEY_TAB)
&& (keyCode != (char)KeyCodes.KEY_BACKSPACE)
&& (keyCode != (char)KeyCodes.KEY_DELETE)
&& (keyCode != (char)KeyCodes.KEY_ENTER)
&& (keyCode != (char)KeyCodes.KEY_HOME)
&& (keyCode != (char)KeyCodes.KEY_END)
&& (keyCode != (char)KeyCodes.KEY_LEFT)
&& (keyCode != (char)KeyCodes.KEY_UP)
&& (keyCode != (char)KeyCodes.KEY_RIGHT)
&& (keyCode != (char)KeyCodes.KEY_DOWN)) {
((TextBox)widget).cancelKey();
// depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public void generate() throws IOException {
final Document doc = DocumentFactory.getInstance().createDocument();
final Element root = doc.addElement("project");
//iterate through entities in correct order
for (final ResourceXMLParser.Entity entity : entities) {
if (NODE_ENTITY_TAG.equals(entity.getResourceType())) {
final Element ent = genEntityCommon(root, entity);
genNode(ent, entity);
}
}
if (null != file) {
FileOutputStream out=new FileOutputStream(file);
try{
serializeDocToStream(out, doc);
}finally{
out.close();
}
} else if (null != output) {
serializeDocToStream(output, doc);
}
} } | public class class_name {
public void generate() throws IOException {
final Document doc = DocumentFactory.getInstance().createDocument();
final Element root = doc.addElement("project");
//iterate through entities in correct order
for (final ResourceXMLParser.Entity entity : entities) {
if (NODE_ENTITY_TAG.equals(entity.getResourceType())) {
final Element ent = genEntityCommon(root, entity);
genNode(ent, entity); // depends on control dependency: [if], data = [none]
}
}
if (null != file) {
FileOutputStream out=new FileOutputStream(file);
try{
serializeDocToStream(out, doc); // depends on control dependency: [try], data = [none]
}finally{
out.close();
}
} else if (null != output) {
serializeDocToStream(output, doc);
}
} } |
public class class_name {
public void setReferences(Map<String, List<UniqueId>> references) {
if (references != null) {
this.references = new HashMap<>(references);
} else {
this.references = null;
}
} } | public class class_name {
public void setReferences(Map<String, List<UniqueId>> references) {
if (references != null) {
this.references = new HashMap<>(references); // depends on control dependency: [if], data = [(references]
} else {
this.references = null; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public boolean matches(String expected, String actual) {
boolean result;
// Be graceful with empty strings
if (actual == null) {
actual = "";
}
if (isBooleanCommand()) {
result = "true".equals(actual);
} else if (expected.startsWith(REGEXP)) {
final String regex = trim(removeStartIgnoreCase(expected, REGEXP));
result = Pattern.compile(regex, Pattern.DOTALL).matcher(actual).matches();
} else if (expected.startsWith(REGEXPI)) {
final String regex = trim(removeStartIgnoreCase(expected, REGEXPI));
result = Pattern.compile(regex, Pattern.DOTALL | Pattern.CASE_INSENSITIVE).matcher(actual).matches();
} else if (expected.startsWith(EXACT)){
final String str = trim(removeStartIgnoreCase(expected, EXACT));
result = str.equals(actual);
} else {
// "glob:"
final String pattern;
if (expected.startsWith(GLOB)) {
pattern = trim(removeStartIgnoreCase(expected, GLOB));
} else {
pattern = expected;
}
result = globToRegExp(pattern).matcher(actual).matches();
}
if (isNegateCommand()) {
result = !result;
}
return result;
} } | public class class_name {
public boolean matches(String expected, String actual) {
boolean result;
// Be graceful with empty strings
if (actual == null) {
actual = ""; // depends on control dependency: [if], data = [none]
}
if (isBooleanCommand()) {
result = "true".equals(actual); // depends on control dependency: [if], data = [none]
} else if (expected.startsWith(REGEXP)) {
final String regex = trim(removeStartIgnoreCase(expected, REGEXP));
result = Pattern.compile(regex, Pattern.DOTALL).matcher(actual).matches(); // depends on control dependency: [if], data = [none]
} else if (expected.startsWith(REGEXPI)) {
final String regex = trim(removeStartIgnoreCase(expected, REGEXPI));
result = Pattern.compile(regex, Pattern.DOTALL | Pattern.CASE_INSENSITIVE).matcher(actual).matches(); // depends on control dependency: [if], data = [none]
} else if (expected.startsWith(EXACT)){
final String str = trim(removeStartIgnoreCase(expected, EXACT));
result = str.equals(actual); // depends on control dependency: [if], data = [none]
} else {
// "glob:"
final String pattern;
if (expected.startsWith(GLOB)) {
pattern = trim(removeStartIgnoreCase(expected, GLOB)); // depends on control dependency: [if], data = [none]
} else {
pattern = expected; // depends on control dependency: [if], data = [none]
}
result = globToRegExp(pattern).matcher(actual).matches(); // depends on control dependency: [if], data = [none]
}
if (isNegateCommand()) {
result = !result; // depends on control dependency: [if], data = [none]
}
return result;
} } |
public class class_name {
@Override
public void close()
{
if(workbook != null)
workbook.close();
try
{
if(writableWorkbook != null)
writableWorkbook.close();
}
catch(IOException e)
{
}
catch(WriteException e)
{
}
} } | public class class_name {
@Override
public void close()
{
if(workbook != null)
workbook.close();
try
{
if(writableWorkbook != null)
writableWorkbook.close();
}
catch(IOException e)
{
} // depends on control dependency: [catch], data = [none]
catch(WriteException e)
{
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
protected JavascriptVarBuilder encodeRow(final FacesContext context, final String rowKey,
final JavascriptVarBuilder jsData, final JavascriptVarBuilder jsRowStyle,
final JavascriptVarBuilder jsStyle, final JavascriptVarBuilder jsReadOnly, final Sheet sheet,
final int rowIndex) throws IOException {
// encode rowStyle (if any)
final String rowStyleClass = sheet.getRowStyleClass();
if (rowStyleClass == null) {
jsRowStyle.appendArrayValue("null", false);
}
else {
jsRowStyle.appendArrayValue(rowStyleClass, true);
}
// data is array of array of data
final JavascriptVarBuilder jsRow = new JavascriptVarBuilder(null, false);
int renderCol = 0;
for (int col = 0; col < sheet.getColumns().size(); col++) {
final SheetColumn column = sheet.getColumns().get(col);
if (!column.isRendered()) {
continue;
}
// render data value
final String value = sheet.getRenderValueForCell(context, rowKey, col);
jsRow.appendArrayValue(value, true);
// custom style
final String styleClass = column.getStyleClass();
if (styleClass != null) {
jsStyle.appendRowColProperty(rowIndex, renderCol, styleClass, true);
}
// read only per cell
final boolean readOnly = column.isReadonlyCell();
if (readOnly) {
jsReadOnly.appendRowColProperty(rowIndex, renderCol, "true", true);
}
renderCol++;
}
// close row and append to jsData
jsData.appendArrayValue(jsRow.closeVar().toString(), false);
return jsData;
} } | public class class_name {
protected JavascriptVarBuilder encodeRow(final FacesContext context, final String rowKey,
final JavascriptVarBuilder jsData, final JavascriptVarBuilder jsRowStyle,
final JavascriptVarBuilder jsStyle, final JavascriptVarBuilder jsReadOnly, final Sheet sheet,
final int rowIndex) throws IOException {
// encode rowStyle (if any)
final String rowStyleClass = sheet.getRowStyleClass();
if (rowStyleClass == null) {
jsRowStyle.appendArrayValue("null", false);
}
else {
jsRowStyle.appendArrayValue(rowStyleClass, true);
}
// data is array of array of data
final JavascriptVarBuilder jsRow = new JavascriptVarBuilder(null, false);
int renderCol = 0;
for (int col = 0; col < sheet.getColumns().size(); col++) {
final SheetColumn column = sheet.getColumns().get(col);
if (!column.isRendered()) {
continue;
}
// render data value
final String value = sheet.getRenderValueForCell(context, rowKey, col);
jsRow.appendArrayValue(value, true);
// custom style
final String styleClass = column.getStyleClass();
if (styleClass != null) {
jsStyle.appendRowColProperty(rowIndex, renderCol, styleClass, true); // depends on control dependency: [if], data = [none]
}
// read only per cell
final boolean readOnly = column.isReadonlyCell();
if (readOnly) {
jsReadOnly.appendRowColProperty(rowIndex, renderCol, "true", true); // depends on control dependency: [if], data = [none]
}
renderCol++;
}
// close row and append to jsData
jsData.appendArrayValue(jsRow.closeVar().toString(), false);
return jsData;
} } |
public class class_name {
public static String resolveWidgetVar(String expression, UIComponent component) {
UIComponent resolvedComponent = SearchExpressionFacade.resolveComponent(
FacesContext.getCurrentInstance(),
component,
expression);
if (resolvedComponent instanceof Widget) {
return "PF('" + ((Widget) resolvedComponent).resolveWidgetVar() + "')";
}
else {
throw new FacesException("Component with clientId " + resolvedComponent.getClientId() + " is not a Widget");
}
} } | public class class_name {
public static String resolveWidgetVar(String expression, UIComponent component) {
UIComponent resolvedComponent = SearchExpressionFacade.resolveComponent(
FacesContext.getCurrentInstance(),
component,
expression);
if (resolvedComponent instanceof Widget) {
return "PF('" + ((Widget) resolvedComponent).resolveWidgetVar() + "')"; // depends on control dependency: [if], data = [none]
}
else {
throw new FacesException("Component with clientId " + resolvedComponent.getClientId() + " is not a Widget");
}
} } |
public class class_name {
public static long getUriSize(String urlStr) {
HttpURLConnection conn = null;
try {
URL url = new URL(urlStr);
conn = (HttpURLConnection) url.openConnection();
conn.setRequestMethod("HEAD");
conn.getInputStream();
return conn.getContentLengthLong();
} catch (IOException e) {
log.debug("Error", e);
return -1;
} finally {
if (conn!=null) {
conn.disconnect();
}
}
} } | public class class_name {
public static long getUriSize(String urlStr) {
HttpURLConnection conn = null;
try {
URL url = new URL(urlStr);
conn = (HttpURLConnection) url.openConnection(); // depends on control dependency: [try], data = [none]
conn.setRequestMethod("HEAD"); // depends on control dependency: [try], data = [none]
conn.getInputStream(); // depends on control dependency: [try], data = [none]
return conn.getContentLengthLong(); // depends on control dependency: [try], data = [none]
} catch (IOException e) {
log.debug("Error", e);
return -1;
} finally { // depends on control dependency: [catch], data = [none]
if (conn!=null) {
conn.disconnect(); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public List<IndexHolder> getUniqueIndexHolders() {
List<IndexHolder> result = newArrayList();
for (IndexHolder ih : indexHoldersByName.values()) {
if (ih.isUnique()) {
result.add(ih);
}
}
return result;
} } | public class class_name {
public List<IndexHolder> getUniqueIndexHolders() {
List<IndexHolder> result = newArrayList();
for (IndexHolder ih : indexHoldersByName.values()) {
if (ih.isUnique()) {
result.add(ih); // depends on control dependency: [if], data = [none]
}
}
return result;
} } |
public class class_name {
public String[][] toWordTagNerArray(NERTagSet tagSet)
{
List<String[]> tupleList = Utility.convertSentenceToNER(this, tagSet);
String[][] result = new String[3][tupleList.size()];
Iterator<String[]> iterator = tupleList.iterator();
for (int i = 0; i < result[0].length; i++)
{
String[] tuple = iterator.next();
for (int j = 0; j < 3; ++j)
{
result[j][i] = tuple[j];
}
}
return result;
} } | public class class_name {
public String[][] toWordTagNerArray(NERTagSet tagSet)
{
List<String[]> tupleList = Utility.convertSentenceToNER(this, tagSet);
String[][] result = new String[3][tupleList.size()];
Iterator<String[]> iterator = tupleList.iterator();
for (int i = 0; i < result[0].length; i++)
{
String[] tuple = iterator.next();
for (int j = 0; j < 3; ++j)
{
result[j][i] = tuple[j]; // depends on control dependency: [for], data = [j]
}
}
return result;
} } |
public class class_name {
@SuppressWarnings("unchecked")
public void addWriter(RecordWriter<SerializationDelegate<T>> writer)
{
// avoid using the array-list here to reduce one level of object indirection
if (this.writers == null) {
this.writers = new RecordWriter[] {writer};
}
else {
RecordWriter<SerializationDelegate<T>>[] ws = new RecordWriter[this.writers.length + 1];
System.arraycopy(this.writers, 0, ws, 0, this.writers.length);
ws[this.writers.length] = writer;
this.writers = ws;
}
} } | public class class_name {
@SuppressWarnings("unchecked")
public void addWriter(RecordWriter<SerializationDelegate<T>> writer)
{
// avoid using the array-list here to reduce one level of object indirection
if (this.writers == null) {
this.writers = new RecordWriter[] {writer}; // depends on control dependency: [if], data = [none]
}
else {
RecordWriter<SerializationDelegate<T>>[] ws = new RecordWriter[this.writers.length + 1];
System.arraycopy(this.writers, 0, ws, 0, this.writers.length); // depends on control dependency: [if], data = [(this.writers]
ws[this.writers.length] = writer; // depends on control dependency: [if], data = [none]
this.writers = ws; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public void run()
{
// Guard against direct invocation of start().
if(fXMLReader==null) return;
if(DEBUG)System.out.println("IncrementalSAXSource_Filter parse thread launched");
// Initially assume we'll run successfully.
Object arg=Boolean.FALSE;
// For the duration of this operation, all coroutine handshaking
// will occur in the co_yield method. That's the nice thing about
// coroutines; they give us a way to hand off control from the
// middle of a synchronous method.
try
{
fXMLReader.parse(fXMLReaderInputSource);
}
catch(IOException ex)
{
arg=ex;
}
catch(StopException ex)
{
// Expected and harmless
if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception");
}
catch (SAXException ex)
{
Exception inner=ex.getException();
if(inner instanceof StopException){
// Expected and harmless
if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception");
}
else
{
// Unexpected malfunction
if(DEBUG)
{
System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner);
inner.printStackTrace();
}
arg=ex;
}
} // end parse
// Mark as no longer running in thread.
fXMLReader=null;
try
{
// Mark as done and yield control to the controller coroutine
fNoMoreEvents=true;
fCoroutineManager.co_exit_to(arg, fSourceCoroutineID,
fControllerCoroutineID);
}
catch(java.lang.NoSuchMethodException e)
{
// Shouldn't happen unless we've miscoded our coroutine logic
// "CPO, shut down the garbage smashers on the detention level!"
e.printStackTrace(System.err);
fCoroutineManager.co_exit(fSourceCoroutineID);
}
} } | public class class_name {
public void run()
{
// Guard against direct invocation of start().
if(fXMLReader==null) return;
if(DEBUG)System.out.println("IncrementalSAXSource_Filter parse thread launched");
// Initially assume we'll run successfully.
Object arg=Boolean.FALSE;
// For the duration of this operation, all coroutine handshaking
// will occur in the co_yield method. That's the nice thing about
// coroutines; they give us a way to hand off control from the
// middle of a synchronous method.
try
{
fXMLReader.parse(fXMLReaderInputSource); // depends on control dependency: [try], data = [none]
}
catch(IOException ex)
{
arg=ex;
} // depends on control dependency: [catch], data = [none]
catch(StopException ex)
{
// Expected and harmless
if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception");
} // depends on control dependency: [catch], data = [none]
catch (SAXException ex)
{
Exception inner=ex.getException();
if(inner instanceof StopException){
// Expected and harmless
if(DEBUG)System.out.println("Active IncrementalSAXSource_Filter normal stop exception");
}
else
{
// Unexpected malfunction
if(DEBUG)
{
System.out.println("Active IncrementalSAXSource_Filter UNEXPECTED SAX exception: "+inner); // depends on control dependency: [if], data = [none]
inner.printStackTrace(); // depends on control dependency: [if], data = [none]
}
arg=ex; // depends on control dependency: [if], data = [none]
}
} // end parse // depends on control dependency: [catch], data = [none]
// Mark as no longer running in thread.
fXMLReader=null;
try
{
// Mark as done and yield control to the controller coroutine
fNoMoreEvents=true; // depends on control dependency: [try], data = [none]
fCoroutineManager.co_exit_to(arg, fSourceCoroutineID,
fControllerCoroutineID); // depends on control dependency: [try], data = [none]
}
catch(java.lang.NoSuchMethodException e)
{
// Shouldn't happen unless we've miscoded our coroutine logic
// "CPO, shut down the garbage smashers on the detention level!"
e.printStackTrace(System.err);
fCoroutineManager.co_exit(fSourceCoroutineID);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
private boolean isExcluded(File file) {
ArrayList<Pattern> excludes = OpenCms.getWorkplaceManager().getSynchronizeExcludePatterns();
for (Pattern pattern : excludes) {
if (pattern.matcher(file.getName()).find()) {
m_report.print(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_SUCCESSION_1,
String.valueOf(m_count++)),
I_CmsReport.FORMAT_NOTE);
m_report.print(Messages.get().container(Messages.RPT_EXCLUDING_0), I_CmsReport.FORMAT_NOTE);
m_report.println(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_ARGUMENT_1,
file.getAbsolutePath().replace("\\", "/")));
return true;
}
}
return false;
} } | public class class_name {
private boolean isExcluded(File file) {
ArrayList<Pattern> excludes = OpenCms.getWorkplaceManager().getSynchronizeExcludePatterns();
for (Pattern pattern : excludes) {
if (pattern.matcher(file.getName()).find()) {
m_report.print(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_SUCCESSION_1,
String.valueOf(m_count++)),
I_CmsReport.FORMAT_NOTE); // depends on control dependency: [if], data = [none]
m_report.print(Messages.get().container(Messages.RPT_EXCLUDING_0), I_CmsReport.FORMAT_NOTE); // depends on control dependency: [if], data = [none]
m_report.println(
org.opencms.report.Messages.get().container(
org.opencms.report.Messages.RPT_ARGUMENT_1,
file.getAbsolutePath().replace("\\", "/"))); // depends on control dependency: [if], data = [none]
return true; // depends on control dependency: [if], data = [none]
}
}
return false;
} } |
public class class_name {
public void setConfigurations(java.util.Collection<MatchmakingConfiguration> configurations) {
if (configurations == null) {
this.configurations = null;
return;
}
this.configurations = new java.util.ArrayList<MatchmakingConfiguration>(configurations);
} } | public class class_name {
public void setConfigurations(java.util.Collection<MatchmakingConfiguration> configurations) {
if (configurations == null) {
this.configurations = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.configurations = new java.util.ArrayList<MatchmakingConfiguration>(configurations);
} } |
public class class_name {
public void marshall(GetDeploymentConfigRequest getDeploymentConfigRequest, ProtocolMarshaller protocolMarshaller) {
if (getDeploymentConfigRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getDeploymentConfigRequest.getDeploymentConfigName(), DEPLOYMENTCONFIGNAME_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(GetDeploymentConfigRequest getDeploymentConfigRequest, ProtocolMarshaller protocolMarshaller) {
if (getDeploymentConfigRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(getDeploymentConfigRequest.getDeploymentConfigName(), DEPLOYMENTCONFIGNAME_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 {
static Matrix[] octaveSVDS(File matrix, int dimensions) {
try {
// create the octave file for executing
File octaveFile = File.createTempFile("octave-svds",".m");
File uOutput = File.createTempFile("octave-svds-U",".dat");
File sOutput = File.createTempFile("octave-svds-S",".dat");
File vOutput = File.createTempFile("octave-svds-V",".dat");
octaveFile.deleteOnExit();
uOutput.deleteOnExit();
sOutput.deleteOnExit();
vOutput.deleteOnExit();
// Print the customized Octave program to a file.
PrintWriter pw = new PrintWriter(octaveFile);
pw.println(
"Z = load('" + matrix.getAbsolutePath() + "','-ascii');\n" +
"A = spconvert(Z);\n" +
"% Remove the raw data file to save space\n" +
"clear Z;\n" +
"[U, S, V] = svds(A, " + dimensions + " );\n" +
"save(\"-ascii\", \"" + uOutput.getAbsolutePath() + "\", \"U\");\n" +
"save(\"-ascii\", \"" + sOutput.getAbsolutePath() + "\", \"S\");\n" +
"save(\"-ascii\", \"" + vOutput.getAbsolutePath() + "\", \"V\");\n" +
"fprintf('Octave Finished\\n');\n");
pw.close();
// build a command line where octave executes the previously
// constructed file
String commandLine = "octave " + octaveFile.getAbsolutePath();
SVD_LOGGER.fine(commandLine);
Process octave = Runtime.getRuntime().exec(commandLine);
BufferedReader br = new BufferedReader(
new InputStreamReader(octave.getInputStream()));
BufferedReader stderr = new BufferedReader(
new InputStreamReader(octave.getErrorStream()));
// capture the output
StringBuilder output = new StringBuilder("Octave svds output:\n");
for (String line = null; (line = br.readLine()) != null; ) {
output.append(line).append("\n");
}
SVD_LOGGER.fine(output.toString());
int exitStatus = octave.waitFor();
SVD_LOGGER.fine("Octave svds exit status: " + exitStatus);
// If Octave was successful in generating the files, return them.
if (exitStatus == 0) {
// Octave returns the matrices in U, S, V, with none of
// transposed. To ensure consistence, transpose the V matrix
return new Matrix[] {
// load U in memory, since that is what most algorithms will be
// using (i.e. it is the word space)
MatrixIO.readMatrix(uOutput, Format.DENSE_TEXT,
Type.DENSE_IN_MEMORY),
// Sigma only has n values for an n^2 matrix, so make it sparse
MatrixIO.readMatrix(sOutput, Format.DENSE_TEXT,
Type.SPARSE_ON_DISK),
// V could be large, so just keep it on disk. Furthermore,
// Octave does not transpose V, so transpose it
MatrixIO.readMatrix(vOutput, Format.DENSE_TEXT,
Type.DENSE_ON_DISK, true)
};
}
else {
StringBuilder sb = new StringBuilder();
for (String line = null; (line = stderr.readLine()) != null; ) {
sb.append(line).append("\n");
}
// warning or error?
SVD_LOGGER.warning("Octave exited with error status. " +
"stderr:\n" + sb.toString());
}
} catch (IOException ioe) {
SVD_LOGGER.log(Level.SEVERE, "Octave svds", ioe);
} catch (InterruptedException ie) {
SVD_LOGGER.log(Level.SEVERE, "Octave svds", ie);
}
throw new UnsupportedOperationException(
"Octave svds is not correctly installed on this system");
} } | public class class_name {
static Matrix[] octaveSVDS(File matrix, int dimensions) {
try {
// create the octave file for executing
File octaveFile = File.createTempFile("octave-svds",".m");
File uOutput = File.createTempFile("octave-svds-U",".dat");
File sOutput = File.createTempFile("octave-svds-S",".dat");
File vOutput = File.createTempFile("octave-svds-V",".dat");
octaveFile.deleteOnExit(); // depends on control dependency: [try], data = [none]
uOutput.deleteOnExit(); // depends on control dependency: [try], data = [none]
sOutput.deleteOnExit(); // depends on control dependency: [try], data = [none]
vOutput.deleteOnExit(); // depends on control dependency: [try], data = [none]
// Print the customized Octave program to a file.
PrintWriter pw = new PrintWriter(octaveFile);
pw.println(
"Z = load('" + matrix.getAbsolutePath() + "','-ascii');\n" +
"A = spconvert(Z);\n" +
"% Remove the raw data file to save space\n" +
"clear Z;\n" +
"[U, S, V] = svds(A, " + dimensions + " );\n" +
"save(\"-ascii\", \"" + uOutput.getAbsolutePath() + "\", \"U\");\n" +
"save(\"-ascii\", \"" + sOutput.getAbsolutePath() + "\", \"S\");\n" +
"save(\"-ascii\", \"" + vOutput.getAbsolutePath() + "\", \"V\");\n" +
"fprintf('Octave Finished\\n');\n"); // depends on control dependency: [try], data = [none]
pw.close(); // depends on control dependency: [try], data = [none]
// build a command line where octave executes the previously
// constructed file
String commandLine = "octave " + octaveFile.getAbsolutePath();
SVD_LOGGER.fine(commandLine); // depends on control dependency: [try], data = [none]
Process octave = Runtime.getRuntime().exec(commandLine);
BufferedReader br = new BufferedReader(
new InputStreamReader(octave.getInputStream()));
BufferedReader stderr = new BufferedReader(
new InputStreamReader(octave.getErrorStream()));
// capture the output
StringBuilder output = new StringBuilder("Octave svds output:\n");
for (String line = null; (line = br.readLine()) != null; ) {
output.append(line).append("\n"); // depends on control dependency: [for], data = [line]
}
SVD_LOGGER.fine(output.toString()); // depends on control dependency: [try], data = [none]
int exitStatus = octave.waitFor();
SVD_LOGGER.fine("Octave svds exit status: " + exitStatus); // depends on control dependency: [try], data = [none]
// If Octave was successful in generating the files, return them.
if (exitStatus == 0) {
// Octave returns the matrices in U, S, V, with none of
// transposed. To ensure consistence, transpose the V matrix
return new Matrix[] {
// load U in memory, since that is what most algorithms will be
// using (i.e. it is the word space)
MatrixIO.readMatrix(uOutput, Format.DENSE_TEXT,
Type.DENSE_IN_MEMORY),
// Sigma only has n values for an n^2 matrix, so make it sparse
MatrixIO.readMatrix(sOutput, Format.DENSE_TEXT,
Type.SPARSE_ON_DISK),
// V could be large, so just keep it on disk. Furthermore,
// Octave does not transpose V, so transpose it
MatrixIO.readMatrix(vOutput, Format.DENSE_TEXT,
Type.DENSE_ON_DISK, true)
}; // depends on control dependency: [if], data = [none]
}
else {
StringBuilder sb = new StringBuilder();
for (String line = null; (line = stderr.readLine()) != null; ) {
sb.append(line).append("\n"); // depends on control dependency: [for], data = [line]
}
// warning or error?
SVD_LOGGER.warning("Octave exited with error status. " +
"stderr:\n" + sb.toString()); // depends on control dependency: [if], data = [none]
}
} catch (IOException ioe) {
SVD_LOGGER.log(Level.SEVERE, "Octave svds", ioe);
} catch (InterruptedException ie) { // depends on control dependency: [catch], data = [none]
SVD_LOGGER.log(Level.SEVERE, "Octave svds", ie);
} // depends on control dependency: [catch], data = [none]
throw new UnsupportedOperationException(
"Octave svds is not correctly installed on this system");
} } |
public class class_name {
@Override
public boolean isActive(Object context, Profile profile) {
if(context == null || profile == null) {
StringBuilder builder = new StringBuilder()
.append("Failed to determine profile active profiles. ");
if(context == null)
builder.append("Context cannot be null. ");
if(profile == null)
builder.append("Profile cannot be null. ");
throw new IllegalArgumentException(builder.toString());
}
if(context.getClass().isAnnotationPresent(IncludeProfiles.class)) {
IncludeProfiles profiles = context.getClass().getAnnotation(IncludeProfiles.class);
Profile[] activeProfiles = profiles.value();
for (Profile currentProfile : activeProfiles)
if(currentProfile.equals(profile)) return true;
return false;
}
if(context.getClass().isAnnotationPresent(ExcludeProfiles.class)) {
ExcludeProfiles profiles = context.getClass().getAnnotation(ExcludeProfiles.class);
Profile[] inactiveProfiles = profiles.value();
for (Profile currentProfile : inactiveProfiles)
if(currentProfile.equals(profile)) return false;
return true;
}
else {
return true;
}
} } | public class class_name {
@Override
public boolean isActive(Object context, Profile profile) {
if(context == null || profile == null) {
StringBuilder builder = new StringBuilder()
.append("Failed to determine profile active profiles. ");
if(context == null)
builder.append("Context cannot be null. ");
if(profile == null)
builder.append("Profile cannot be null. ");
throw new IllegalArgumentException(builder.toString());
}
if(context.getClass().isAnnotationPresent(IncludeProfiles.class)) {
IncludeProfiles profiles = context.getClass().getAnnotation(IncludeProfiles.class);
Profile[] activeProfiles = profiles.value();
for (Profile currentProfile : activeProfiles)
if(currentProfile.equals(profile)) return true;
return false; // depends on control dependency: [if], data = [none]
}
if(context.getClass().isAnnotationPresent(ExcludeProfiles.class)) {
ExcludeProfiles profiles = context.getClass().getAnnotation(ExcludeProfiles.class);
Profile[] inactiveProfiles = profiles.value();
for (Profile currentProfile : inactiveProfiles)
if(currentProfile.equals(profile)) return false;
return true; // depends on control dependency: [if], data = [none]
}
else {
return true; // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public boolean isInState(JComponent c) {
while (c != null && !(c instanceof JScrollBar)) {
c = (JComponent) c.getParent();
}
if (c != null) {
Object clientProperty = c.getClientProperty("SeaGlass.Override.ScrollBarButtonsTogether");
if (clientProperty != null && clientProperty instanceof Boolean) {
return (Boolean) clientProperty;
}
}
return UIManager.getBoolean("SeaGlass.ScrollBarButtonsTogether");
} } | public class class_name {
public boolean isInState(JComponent c) {
while (c != null && !(c instanceof JScrollBar)) {
c = (JComponent) c.getParent(); // depends on control dependency: [while], data = [none]
}
if (c != null) {
Object clientProperty = c.getClientProperty("SeaGlass.Override.ScrollBarButtonsTogether");
if (clientProperty != null && clientProperty instanceof Boolean) {
return (Boolean) clientProperty; // depends on control dependency: [if], data = [none]
}
}
return UIManager.getBoolean("SeaGlass.ScrollBarButtonsTogether");
} } |
public class class_name {
public void waitAllTasks() {
synchronized (this.tasks) {
while (this.hasTaskPending()) {
try {
this.tasks.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
synchronized (this.tasksReachesZero) {
if (this.runningTasks > 0) {
try {
this.tasksReachesZero.wait();
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}
} } | public class class_name {
public void waitAllTasks() {
synchronized (this.tasks) {
while (this.hasTaskPending()) {
try {
this.tasks.wait(); // depends on control dependency: [try], data = [none]
} catch (InterruptedException e) {
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
}
synchronized (this.tasksReachesZero) {
if (this.runningTasks > 0) {
try {
this.tasksReachesZero.wait(); // depends on control dependency: [try], data = [none]
} catch (InterruptedException e) {
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
}
}
}
} } |
public class class_name {
public String createToken(final Principal principal, final List<Permission> permissions) {
final Date today = new Date();
final JwtBuilder jwtBuilder = Jwts.builder();
jwtBuilder.setSubject(principal.getName());
jwtBuilder.setIssuer(ISSUER);
jwtBuilder.setIssuedAt(today);
jwtBuilder.setExpiration(addDays(today, 7));
if (permissions != null) {
jwtBuilder.claim("permissions", permissions.stream()
.map(Permission::getName)
.collect(Collectors.joining(","))
);
}
return jwtBuilder.signWith(SignatureAlgorithm.HS256, key).compact();
} } | public class class_name {
public String createToken(final Principal principal, final List<Permission> permissions) {
final Date today = new Date();
final JwtBuilder jwtBuilder = Jwts.builder();
jwtBuilder.setSubject(principal.getName());
jwtBuilder.setIssuer(ISSUER);
jwtBuilder.setIssuedAt(today);
jwtBuilder.setExpiration(addDays(today, 7));
if (permissions != null) {
jwtBuilder.claim("permissions", permissions.stream()
.map(Permission::getName)
.collect(Collectors.joining(","))
); // depends on control dependency: [if], data = [none]
}
return jwtBuilder.signWith(SignatureAlgorithm.HS256, key).compact();
} } |
public class class_name {
private AttributeDescr enabled(AttributeSupportBuilder<?> as) throws RecognitionException {
AttributeDescrBuilder<?> attribute = null;
try {
// 'enabled'
match(input,
DRL6Lexer.ID,
DroolsSoftKeywords.ENABLED,
null,
DroolsEditorType.KEYWORD);
if (state.failed)
return null;
if (state.backtracking == 0) {
attribute = helper.start((DescrBuilder<?, ?>) as,
AttributeDescrBuilder.class,
DroolsSoftKeywords.ENABLED);
}
boolean hasParen = input.LA(1) == DRL6Lexer.LEFT_PAREN;
int first = input.index();
if (hasParen) {
match(input,
DRL6Lexer.LEFT_PAREN,
null,
null,
DroolsEditorType.SYMBOL);
if (state.failed)
return null;
}
String value = conditionalExpression();
if (state.failed)
return null;
if (hasParen) {
match(input,
DRL6Lexer.RIGHT_PAREN,
null,
null,
DroolsEditorType.SYMBOL);
if (state.failed)
return null;
}
if (state.backtracking == 0) {
if (hasParen) {
value = input.toString(first,
input.LT(-1).getTokenIndex());
}
attribute.value(value);
attribute.type(AttributeDescr.Type.EXPRESSION);
}
} finally {
if (attribute != null) {
helper.end(AttributeDescrBuilder.class,
attribute);
}
}
return attribute != null ? attribute.getDescr() : null;
} } | public class class_name {
private AttributeDescr enabled(AttributeSupportBuilder<?> as) throws RecognitionException {
AttributeDescrBuilder<?> attribute = null;
try {
// 'enabled'
match(input,
DRL6Lexer.ID,
DroolsSoftKeywords.ENABLED,
null,
DroolsEditorType.KEYWORD);
if (state.failed)
return null;
if (state.backtracking == 0) {
attribute = helper.start((DescrBuilder<?, ?>) as,
AttributeDescrBuilder.class,
DroolsSoftKeywords.ENABLED); // depends on control dependency: [if], data = [none]
}
boolean hasParen = input.LA(1) == DRL6Lexer.LEFT_PAREN;
int first = input.index();
if (hasParen) {
match(input,
DRL6Lexer.LEFT_PAREN,
null,
null,
DroolsEditorType.SYMBOL); // depends on control dependency: [if], data = [none]
if (state.failed)
return null;
}
String value = conditionalExpression();
if (state.failed)
return null;
if (hasParen) {
match(input,
DRL6Lexer.RIGHT_PAREN,
null,
null,
DroolsEditorType.SYMBOL); // depends on control dependency: [if], data = [none]
if (state.failed)
return null;
}
if (state.backtracking == 0) {
if (hasParen) {
value = input.toString(first,
input.LT(-1).getTokenIndex()); // depends on control dependency: [if], data = [none]
}
attribute.value(value); // depends on control dependency: [if], data = [none]
attribute.type(AttributeDescr.Type.EXPRESSION); // depends on control dependency: [if], data = [none]
}
} finally {
if (attribute != null) {
helper.end(AttributeDescrBuilder.class,
attribute); // depends on control dependency: [if], data = [none]
}
}
return attribute != null ? attribute.getDescr() : null;
} } |
public class class_name {
public void addFilter(Filter filter)
{
if (filter.isTaskFilter())
{
m_taskFilters.add(filter);
}
if (filter.isResourceFilter())
{
m_resourceFilters.add(filter);
}
m_filtersByName.put(filter.getName(), filter);
m_filtersByID.put(filter.getID(), filter);
} } | public class class_name {
public void addFilter(Filter filter)
{
if (filter.isTaskFilter())
{
m_taskFilters.add(filter); // depends on control dependency: [if], data = [none]
}
if (filter.isResourceFilter())
{
m_resourceFilters.add(filter); // depends on control dependency: [if], data = [none]
}
m_filtersByName.put(filter.getName(), filter);
m_filtersByID.put(filter.getID(), filter);
} } |
public class class_name {
public java.util.List<JobWatermark> getWatermarks() {
if (watermarks == null) {
watermarks = new com.amazonaws.internal.SdkInternalList<JobWatermark>();
}
return watermarks;
} } | public class class_name {
public java.util.List<JobWatermark> getWatermarks() {
if (watermarks == null) {
watermarks = new com.amazonaws.internal.SdkInternalList<JobWatermark>(); // depends on control dependency: [if], data = [none]
}
return watermarks;
} } |
public class class_name {
public void marshall(DeviceSummary deviceSummary, ProtocolMarshaller protocolMarshaller) {
if (deviceSummary == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deviceSummary.getDeviceId(), DEVICEID_BINDING);
protocolMarshaller.marshall(deviceSummary.getDeviceStatus(), DEVICESTATUS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(DeviceSummary deviceSummary, ProtocolMarshaller protocolMarshaller) {
if (deviceSummary == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deviceSummary.getDeviceId(), DEVICEID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(deviceSummary.getDeviceStatus(), DEVICESTATUS_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 JsCodeBuilder addChunksToOutputVar(List<? extends Expression> codeChunks) {
if (currOutputVarIsInited) {
Expression rhs = CodeChunkUtils.concatChunks(codeChunks);
rhs.collectRequires(requireCollector);
appendLine(currOutputVar.plusEquals(rhs).getCode());
} else {
Expression rhs = CodeChunkUtils.concatChunksForceString(codeChunks);
rhs.collectRequires(requireCollector);
append(
VariableDeclaration.builder(currOutputVar.singleExprOrName().getText())
.setRhs(rhs)
.build());
setOutputVarInited();
}
return this;
} } | public class class_name {
public JsCodeBuilder addChunksToOutputVar(List<? extends Expression> codeChunks) {
if (currOutputVarIsInited) {
Expression rhs = CodeChunkUtils.concatChunks(codeChunks);
rhs.collectRequires(requireCollector); // depends on control dependency: [if], data = [none]
appendLine(currOutputVar.plusEquals(rhs).getCode()); // depends on control dependency: [if], data = [none]
} else {
Expression rhs = CodeChunkUtils.concatChunksForceString(codeChunks);
rhs.collectRequires(requireCollector); // depends on control dependency: [if], data = [none]
append(
VariableDeclaration.builder(currOutputVar.singleExprOrName().getText())
.setRhs(rhs)
.build()); // depends on control dependency: [if], data = [none]
setOutputVarInited(); // depends on control dependency: [if], data = [none]
}
return this;
} } |
public class class_name {
public Span[] tokenizePos(String d) {
Span[] tokens = split(d);
newTokens.clear();
tokProbs.clear();
for (int i = 0, il = tokens.length; i < il; i++) {
Span s = tokens[i];
String tok = d.substring(s.getStart(), s.getEnd());
// Can't tokenize single characters
if (tok.length() < 2) {
newTokens.add(s);
tokProbs.add(ONE);
}
else if (useAlphaNumericOptimization() && alphaNumeric.matcher(tok).matches()) {
newTokens.add(s);
tokProbs.add(ONE);
}
else {
int start = s.getStart();
int end = s.getEnd();
final int origStart = s.getStart();
double tokenProb = 1.0;
for (int j = origStart + 1; j < end; j++) {
double[] probs =
model.eval(cg.getContext(new ObjectIntPair(tok, j - origStart)));
String best = model.getBestOutcome(probs);
//System.err.println("TokenizerME: "+tok.substring(0,j-origStart)+"^"+tok.substring(j-origStart)+" "+best+" "+probs[model.getIndex(best)]);
tokenProb *= probs[model.getIndex(best)];
if (best.equals(TokContextGenerator.SPLIT)) {
newTokens.add(new Span(start, j));
tokProbs.add(new Double(tokenProb));
start = j;
tokenProb = 1.0;
}
}
newTokens.add(new Span(start, end));
tokProbs.add(new Double(tokenProb));
}
}
Span[] spans = new Span[newTokens.size()];
newTokens.toArray(spans);
return spans;
} } | public class class_name {
public Span[] tokenizePos(String d) {
Span[] tokens = split(d);
newTokens.clear();
tokProbs.clear();
for (int i = 0, il = tokens.length; i < il; i++) {
Span s = tokens[i];
String tok = d.substring(s.getStart(), s.getEnd());
// Can't tokenize single characters
if (tok.length() < 2) {
newTokens.add(s); // depends on control dependency: [if], data = [none]
tokProbs.add(ONE); // depends on control dependency: [if], data = [none]
}
else if (useAlphaNumericOptimization() && alphaNumeric.matcher(tok).matches()) {
newTokens.add(s); // depends on control dependency: [if], data = [none]
tokProbs.add(ONE); // depends on control dependency: [if], data = [none]
}
else {
int start = s.getStart();
int end = s.getEnd();
final int origStart = s.getStart();
double tokenProb = 1.0;
for (int j = origStart + 1; j < end; j++) {
double[] probs =
model.eval(cg.getContext(new ObjectIntPair(tok, j - origStart)));
String best = model.getBestOutcome(probs);
//System.err.println("TokenizerME: "+tok.substring(0,j-origStart)+"^"+tok.substring(j-origStart)+" "+best+" "+probs[model.getIndex(best)]);
tokenProb *= probs[model.getIndex(best)]; // depends on control dependency: [for], data = [none]
if (best.equals(TokContextGenerator.SPLIT)) {
newTokens.add(new Span(start, j)); // depends on control dependency: [if], data = [none]
tokProbs.add(new Double(tokenProb)); // depends on control dependency: [if], data = [none]
start = j; // depends on control dependency: [if], data = [none]
tokenProb = 1.0; // depends on control dependency: [if], data = [none]
}
}
newTokens.add(new Span(start, end)); // depends on control dependency: [if], data = [none]
tokProbs.add(new Double(tokenProb)); // depends on control dependency: [if], data = [none]
}
}
Span[] spans = new Span[newTokens.size()];
newTokens.toArray(spans);
return spans;
} } |
public class class_name {
@Override
public boolean isValid(T value) {
int length = 0;
if (value instanceof Map<?, ?>) {
length = ((Map<?, ?>) value).size();
} else if (value instanceof Collection<?>) {
length = ((Collection<?>) value).size();
} else if (value instanceof Object[]) {
length = ((Object[]) value).length;
} else if (value != null) {
length = value.toString().length();
}
return length >= minValue && length <= maxValue;
} } | public class class_name {
@Override
public boolean isValid(T value) {
int length = 0;
if (value instanceof Map<?, ?>) {
length = ((Map<?, ?>) value).size(); // depends on control dependency: [if], data = [)]
} else if (value instanceof Collection<?>) {
length = ((Collection<?>) value).size(); // depends on control dependency: [if], data = [)]
} else if (value instanceof Object[]) {
length = ((Object[]) value).length; // depends on control dependency: [if], data = [none]
} else if (value != null) {
length = value.toString().length(); // depends on control dependency: [if], data = [none]
}
return length >= minValue && length <= maxValue;
} } |
public class class_name {
public void removeEmptySubtrees(CmsTreeNode<I_CmsContextMenuItem> root) {
List<CmsTreeNode<I_CmsContextMenuItem>> children = root.getChildren();
if ((root.getData() != null) && root.getData().isLeafItem()) {
children.clear();
} else {
Iterator<CmsTreeNode<I_CmsContextMenuItem>> iter = children.iterator();
while (iter.hasNext()) {
CmsTreeNode<I_CmsContextMenuItem> node = iter.next();
removeEmptySubtrees(node);
if ((node.getData() != null) && !node.getData().isLeafItem() && (node.getChildren().size() == 0)) {
iter.remove();
}
}
}
} } | public class class_name {
public void removeEmptySubtrees(CmsTreeNode<I_CmsContextMenuItem> root) {
List<CmsTreeNode<I_CmsContextMenuItem>> children = root.getChildren();
if ((root.getData() != null) && root.getData().isLeafItem()) {
children.clear(); // depends on control dependency: [if], data = [none]
} else {
Iterator<CmsTreeNode<I_CmsContextMenuItem>> iter = children.iterator();
while (iter.hasNext()) {
CmsTreeNode<I_CmsContextMenuItem> node = iter.next();
removeEmptySubtrees(node); // depends on control dependency: [while], data = [none]
if ((node.getData() != null) && !node.getData().isLeafItem() && (node.getChildren().size() == 0)) {
iter.remove(); // depends on control dependency: [if], data = [none]
}
}
}
} } |
public class class_name {
private Object[] createTargetArray(OpenType pElementType, int pLength) {
if (pElementType instanceof SimpleType) {
try {
SimpleType simpleType = (SimpleType) pElementType;
Class elementClass = Class.forName(simpleType.getClassName());
return (Object[]) Array.newInstance(elementClass, pLength);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Can't find class " + pElementType.getClassName() +
" for instantiating array: " + e.getMessage(),e);
}
} else if (pElementType instanceof CompositeType) {
return new CompositeData[pLength];
} else {
throw new UnsupportedOperationException("Unsupported array element type: " + pElementType);
}
} } | public class class_name {
private Object[] createTargetArray(OpenType pElementType, int pLength) {
if (pElementType instanceof SimpleType) {
try {
SimpleType simpleType = (SimpleType) pElementType;
Class elementClass = Class.forName(simpleType.getClassName()); // depends on control dependency: [try], data = [none]
return (Object[]) Array.newInstance(elementClass, pLength); // depends on control dependency: [try], data = [none]
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException("Can't find class " + pElementType.getClassName() +
" for instantiating array: " + e.getMessage(),e);
} // depends on control dependency: [catch], data = [none]
} else if (pElementType instanceof CompositeType) {
return new CompositeData[pLength]; // depends on control dependency: [if], data = [none]
} else {
throw new UnsupportedOperationException("Unsupported array element type: " + pElementType);
}
} } |
public class class_name {
static public MailVetterDailyNotificationTask scheduleTask(
CouchDesignDocument serverDesignDoc
,MailNotification mailNotification
){
Timer timer = new Timer();
MailVetterDailyNotificationTask installedTask = new MailVetterDailyNotificationTask(
timer
,serverDesignDoc
,mailNotification
);
Calendar calendar = Calendar.getInstance(); // now
Date now = calendar.getTime();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date start = calendar.getTime();
while( start.getTime() < now.getTime() ){
start = new Date( start.getTime() + DAILY_PERIOD );
}
if( true ) {
timer.schedule(installedTask, start, DAILY_PERIOD);
// } else {
// This code to test with a shorter period
// start = new Date( now.getTime() + (1000*30) );
// timer.schedule(installedTask, start, 1000 * 30);
}
// Log
{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startString = sdf.format(start);
logger.info("Vetter daily notifications set to start at: "+startString);
}
return installedTask;
} } | public class class_name {
static public MailVetterDailyNotificationTask scheduleTask(
CouchDesignDocument serverDesignDoc
,MailNotification mailNotification
){
Timer timer = new Timer();
MailVetterDailyNotificationTask installedTask = new MailVetterDailyNotificationTask(
timer
,serverDesignDoc
,mailNotification
);
Calendar calendar = Calendar.getInstance(); // now
Date now = calendar.getTime();
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
calendar.set(Calendar.MILLISECOND, 0);
Date start = calendar.getTime();
while( start.getTime() < now.getTime() ){
start = new Date( start.getTime() + DAILY_PERIOD ); // depends on control dependency: [while], data = [( start.getTime()]
}
if( true ) {
timer.schedule(installedTask, start, DAILY_PERIOD); // depends on control dependency: [if], data = [none]
// } else {
// This code to test with a shorter period
// start = new Date( now.getTime() + (1000*30) );
// timer.schedule(installedTask, start, 1000 * 30);
}
// Log
{
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String startString = sdf.format(start);
logger.info("Vetter daily notifications set to start at: "+startString);
}
return installedTask;
} } |
public class class_name {
public boolean crossoverCheck(HttpServletRequest req, HttpSession session) {
boolean collab = false;
if (req != null) {
collab = ((IExtendedRequest) req).getRunningCollaborators();
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE))
LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "crossoverCheck", "" + collab);
}
if (!collab) {
if (!session.isNew()) { // don't check new sessions cuz incoming id may be invalid
String inUseSessionId = getCurrentSessionId();
if (inUseSessionId != null) { // we're on dispatch thread, not user thread or tbw/inval thread
if (!(inUseSessionId.equals(session.getId()))) {
return true;
}
}
}
}//PK80539 exit
return false;
} } | public class class_name {
public boolean crossoverCheck(HttpServletRequest req, HttpSession session) {
boolean collab = false;
if (req != null) {
collab = ((IExtendedRequest) req).getRunningCollaborators(); // depends on control dependency: [if], data = [none]
if (com.ibm.ejs.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_CORE.isLoggable(Level.FINE))
LoggingUtil.SESSION_LOGGER_CORE.logp(Level.FINE, methodClassName, "crossoverCheck", "" + collab);
}
if (!collab) {
if (!session.isNew()) { // don't check new sessions cuz incoming id may be invalid
String inUseSessionId = getCurrentSessionId();
if (inUseSessionId != null) { // we're on dispatch thread, not user thread or tbw/inval thread
if (!(inUseSessionId.equals(session.getId()))) {
return true; // depends on control dependency: [if], data = [none]
}
}
}
}//PK80539 exit
return false;
} } |
public class class_name {
public void marshall(RespondActivityTaskFailedRequest respondActivityTaskFailedRequest, ProtocolMarshaller protocolMarshaller) {
if (respondActivityTaskFailedRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(respondActivityTaskFailedRequest.getTaskToken(), TASKTOKEN_BINDING);
protocolMarshaller.marshall(respondActivityTaskFailedRequest.getReason(), REASON_BINDING);
protocolMarshaller.marshall(respondActivityTaskFailedRequest.getDetails(), DETAILS_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(RespondActivityTaskFailedRequest respondActivityTaskFailedRequest, ProtocolMarshaller protocolMarshaller) {
if (respondActivityTaskFailedRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(respondActivityTaskFailedRequest.getTaskToken(), TASKTOKEN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(respondActivityTaskFailedRequest.getReason(), REASON_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(respondActivityTaskFailedRequest.getDetails(), DETAILS_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 {
void eitherZeroOrOneOrAddress(String command) {
if (!isAddressCommand && !(isZeroCommand ^ isOneCommand)) {
throwException(CMD + command + ": (zero|one) specified incorrectly");
}
if (isAddressCommand && (isZeroCommand || isOneCommand)) {
throwException(CMD + command + ": cannot specify address with (zero|one)");
}
} } | public class class_name {
void eitherZeroOrOneOrAddress(String command) {
if (!isAddressCommand && !(isZeroCommand ^ isOneCommand)) {
throwException(CMD + command + ": (zero|one) specified incorrectly"); // depends on control dependency: [if], data = [none]
}
if (isAddressCommand && (isZeroCommand || isOneCommand)) {
throwException(CMD + command + ": cannot specify address with (zero|one)"); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private void checkNotClosed() throws SIConnectionUnavailableException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkNotClosed");
//Synchronize on the closed object to prevent it being changed while we check it.
synchronized (this)
{
if (_closed)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkNotClosed", "Connection Closed exception");
SIMPConnectionUnavailableException e = new SIMPConnectionUnavailableException(
nls_cwsik.getFormattedMessage(
"DELIVERY_ERROR_SIRC_22", // OBJECT_CLOSED_ERROR_CWSIP0091
new Object[] { _messageProcessor.getMessagingEngineName() },
null));
e.setExceptionReason(SIRCConstants.SIRC0022_OBJECT_CLOSED_ERROR);
e.setExceptionInserts(new String[] { _messageProcessor.getMessagingEngineName() });
throw e;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkNotClosed");
} } | public class class_name {
private void checkNotClosed() throws SIConnectionUnavailableException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "checkNotClosed");
//Synchronize on the closed object to prevent it being changed while we check it.
synchronized (this)
{
if (_closed)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkNotClosed", "Connection Closed exception");
SIMPConnectionUnavailableException e = new SIMPConnectionUnavailableException(
nls_cwsik.getFormattedMessage(
"DELIVERY_ERROR_SIRC_22", // OBJECT_CLOSED_ERROR_CWSIP0091
new Object[] { _messageProcessor.getMessagingEngineName() },
null));
e.setExceptionReason(SIRCConstants.SIRC0022_OBJECT_CLOSED_ERROR); // depends on control dependency: [if], data = [none]
e.setExceptionInserts(new String[] { _messageProcessor.getMessagingEngineName() }); // depends on control dependency: [if], data = [none]
throw e;
}
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.exit(tc, "checkNotClosed");
} } |
public class class_name {
public Object superRemove(Object id) {
if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[SUPER_REMOVE]);
}
Object o = super.remove(id);
if (o != null) {
removeFromRecentlyInvalidatedList((String) id);
}
return o;
} } | public class class_name {
public Object superRemove(Object id) {
if (com.ibm.websphere.ras.TraceComponent.isAnyTracingEnabled() && LoggingUtil.SESSION_LOGGER_WAS.isLoggable(Level.FINE)) {
LoggingUtil.SESSION_LOGGER_WAS.entering(methodClassName, methodNames[SUPER_REMOVE]); // depends on control dependency: [if], data = [none]
}
Object o = super.remove(id);
if (o != null) {
removeFromRecentlyInvalidatedList((String) id); // depends on control dependency: [if], data = [none]
}
return o;
} } |
public class class_name {
public void setRequestProperty(String key, Object value) {
if (value != null) {
if (requestProperties == null) {
requestProperties = new HashMap<>();
}
requestProperties.put(key, value);
}
} } | public class class_name {
public void setRequestProperty(String key, Object value) {
if (value != null) {
if (requestProperties == null) {
requestProperties = new HashMap<>(); // depends on control dependency: [if], data = [none]
}
requestProperties.put(key, value); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public boolean remove(ESigItem item) {
boolean result = items.remove(item);
if (result) {
removed(item);
}
return result;
} } | public class class_name {
public boolean remove(ESigItem item) {
boolean result = items.remove(item);
if (result) {
removed(item); // depends on control dependency: [if], data = [none]
}
return result;
} } |
public class class_name {
public static Set<String> getResourceNames(File dir) {
Set<String> resourceNames = new HashSet<String>();
// If the path is not valid throw an exception
String[] resArray = dir.list();
if (resArray != null) {
// Make the returned dirs end with '/', to match a servletcontext
// behavior.
for (int i = 0; i < resArray.length; i++) {
if (new File(dir, resArray[i]).isDirectory())
resArray[i] += '/';
}
resourceNames.addAll(Arrays.asList(resArray));
}
return resourceNames;
} } | public class class_name {
public static Set<String> getResourceNames(File dir) {
Set<String> resourceNames = new HashSet<String>();
// If the path is not valid throw an exception
String[] resArray = dir.list();
if (resArray != null) {
// Make the returned dirs end with '/', to match a servletcontext
// behavior.
for (int i = 0; i < resArray.length; i++) {
if (new File(dir, resArray[i]).isDirectory())
resArray[i] += '/';
}
resourceNames.addAll(Arrays.asList(resArray)); // depends on control dependency: [if], data = [(resArray]
}
return resourceNames;
} } |
public class class_name {
public static final XPathFactory newInstance() {
try {
return newInstance(DEFAULT_OBJECT_MODEL_URI);
}
catch (XPathFactoryConfigurationException xpathFactoryConfigurationException) {
throw new RuntimeException(
"XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
+ DEFAULT_OBJECT_MODEL_URI
+ " with the XPathFactoryConfigurationException: "
+ xpathFactoryConfigurationException.toString()
);
}
} } | public class class_name {
public static final XPathFactory newInstance() {
try {
return newInstance(DEFAULT_OBJECT_MODEL_URI); // depends on control dependency: [try], data = [none]
}
catch (XPathFactoryConfigurationException xpathFactoryConfigurationException) {
throw new RuntimeException(
"XPathFactory#newInstance() failed to create an XPathFactory for the default object model: "
+ DEFAULT_OBJECT_MODEL_URI
+ " with the XPathFactoryConfigurationException: "
+ xpathFactoryConfigurationException.toString()
);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public long guessNextBGZFBlockStart(long beg, long end)
throws IOException
{
// Buffer what we need to go through. Since the max size of a BGZF block
// is 0xffff (64K), and we might be just one byte off from the start of
// the previous one, we need 0xfffe bytes for the start, and then 0xffff
// for the block we're looking for.
byte[] arr = new byte[2*0xffff - 1];
this.seekableInFile.seek(beg);
int totalRead = 0;
for (int left = Math.min((int)(end - beg), arr.length); left > 0;) {
final int r = inFile.read(arr, totalRead, left);
if (r < 0)
break;
totalRead += r;
left -= r;
}
arr = Arrays.copyOf(arr, totalRead);
this.in = new ByteArraySeekableStream(arr);
final BlockCompressedInputStream bgzf =
new BlockCompressedInputStream(this.in);
bgzf.setCheckCrcs(true);
final int firstBGZFEnd = Math.min((int)(end - beg), 0xffff);
for (int pos = 0;;) {
pos = guessNextBGZFPos(pos, firstBGZFEnd);
if (pos < 0)
return end;
try {
// Seek in order to trigger decompression of the block and a CRC
// check.
bgzf.seek((long)pos << 16);
// This has to catch Throwable, because it's possible to get an
// OutOfMemoryError due to an overly large size.
} catch (Throwable e) {
// Guessed BGZF position incorrectly: try the next guess.
++pos;
continue;
}
return beg + pos;
}
} } | public class class_name {
public long guessNextBGZFBlockStart(long beg, long end)
throws IOException
{
// Buffer what we need to go through. Since the max size of a BGZF block
// is 0xffff (64K), and we might be just one byte off from the start of
// the previous one, we need 0xfffe bytes for the start, and then 0xffff
// for the block we're looking for.
byte[] arr = new byte[2*0xffff - 1];
this.seekableInFile.seek(beg);
int totalRead = 0;
for (int left = Math.min((int)(end - beg), arr.length); left > 0;) {
final int r = inFile.read(arr, totalRead, left);
if (r < 0)
break;
totalRead += r;
left -= r;
}
arr = Arrays.copyOf(arr, totalRead);
this.in = new ByteArraySeekableStream(arr);
final BlockCompressedInputStream bgzf =
new BlockCompressedInputStream(this.in);
bgzf.setCheckCrcs(true);
final int firstBGZFEnd = Math.min((int)(end - beg), 0xffff);
for (int pos = 0;;) {
pos = guessNextBGZFPos(pos, firstBGZFEnd);
if (pos < 0)
return end;
try {
// Seek in order to trigger decompression of the block and a CRC
// check.
bgzf.seek((long)pos << 16); // depends on control dependency: [try], data = [none]
// This has to catch Throwable, because it's possible to get an
// OutOfMemoryError due to an overly large size.
} catch (Throwable e) {
// Guessed BGZF position incorrectly: try the next guess.
++pos;
continue;
} // depends on control dependency: [catch], data = [none]
return beg + pos;
}
} } |
public class class_name {
protected Query[] buildPrefetchQueries(Collection proxies, Collection realSubjects)
{
Collection queries = new ArrayList();
Collection idsSubset;
Object proxy;
IndirectionHandler handler;
Identity id;
Class realClass;
HashMap classToIds = new HashMap();
Class topLevelClass = getItemClassDescriptor().getClassOfObject();
PersistenceBroker pb = getBroker();
ObjectCache cache = pb.serviceObjectCache();
for (Iterator it = proxies.iterator(); it.hasNext(); )
{
proxy = it.next();
handler = ProxyHelper.getIndirectionHandler(proxy);
if (handler == null)
{
continue;
}
id = handler.getIdentity();
if (cache.lookup(id) != null)
{
realSubjects.add(pb.getObjectByIdentity(id));
continue;
}
realClass = id.getObjectsRealClass();
if (realClass == null)
{
realClass = Object.class; // to remember that the real class is unknown
}
idsSubset = (HashSet) classToIds.get(realClass);
if (idsSubset == null)
{
idsSubset = new HashSet();
classToIds.put(realClass, idsSubset);
}
idsSubset.add(id);
if (idsSubset.size() == pkLimit)
{
Query query;
if (realClass == Object.class)
{
query = buildPrefetchQuery(topLevelClass, idsSubset, true);
}
else
{
query = buildPrefetchQuery(realClass, idsSubset, false);
}
queries.add(query);
idsSubset.clear();
}
}
for (Iterator it = classToIds.entrySet().iterator(); it.hasNext(); )
{
Map.Entry entry = (Map.Entry) it.next();
realClass = (Class) entry.getKey();
idsSubset = (HashSet) entry.getValue();
if (idsSubset.size() > 0)
{
Query query;
if (realClass == Object.class)
{
query = buildPrefetchQuery(topLevelClass, idsSubset, true);
}
else
{
query = buildPrefetchQuery(realClass, idsSubset, false);
}
queries.add(query);
}
}
return (Query[]) queries.toArray(new Query[queries.size()]);
} } | public class class_name {
protected Query[] buildPrefetchQueries(Collection proxies, Collection realSubjects)
{
Collection queries = new ArrayList();
Collection idsSubset;
Object proxy;
IndirectionHandler handler;
Identity id;
Class realClass;
HashMap classToIds = new HashMap();
Class topLevelClass = getItemClassDescriptor().getClassOfObject();
PersistenceBroker pb = getBroker();
ObjectCache cache = pb.serviceObjectCache();
for (Iterator it = proxies.iterator(); it.hasNext(); )
{
proxy = it.next();
// depends on control dependency: [for], data = [it]
handler = ProxyHelper.getIndirectionHandler(proxy);
// depends on control dependency: [for], data = [none]
if (handler == null)
{
continue;
}
id = handler.getIdentity();
// depends on control dependency: [for], data = [none]
if (cache.lookup(id) != null)
{
realSubjects.add(pb.getObjectByIdentity(id));
// depends on control dependency: [if], data = [none]
continue;
}
realClass = id.getObjectsRealClass();
// depends on control dependency: [for], data = [none]
if (realClass == null)
{
realClass = Object.class; // to remember that the real class is unknown
// depends on control dependency: [if], data = [none]
}
idsSubset = (HashSet) classToIds.get(realClass);
// depends on control dependency: [for], data = [none]
if (idsSubset == null)
{
idsSubset = new HashSet();
// depends on control dependency: [if], data = [none]
classToIds.put(realClass, idsSubset);
// depends on control dependency: [if], data = [none]
}
idsSubset.add(id);
// depends on control dependency: [for], data = [none]
if (idsSubset.size() == pkLimit)
{
Query query;
if (realClass == Object.class)
{
query = buildPrefetchQuery(topLevelClass, idsSubset, true);
// depends on control dependency: [if], data = [none]
}
else
{
query = buildPrefetchQuery(realClass, idsSubset, false);
// depends on control dependency: [if], data = [(realClass]
}
queries.add(query);
// depends on control dependency: [if], data = [none]
idsSubset.clear();
// depends on control dependency: [if], data = [none]
}
}
for (Iterator it = classToIds.entrySet().iterator(); it.hasNext(); )
{
Map.Entry entry = (Map.Entry) it.next();
realClass = (Class) entry.getKey();
// depends on control dependency: [for], data = [none]
idsSubset = (HashSet) entry.getValue();
// depends on control dependency: [for], data = [none]
if (idsSubset.size() > 0)
{
Query query;
if (realClass == Object.class)
{
query = buildPrefetchQuery(topLevelClass, idsSubset, true);
// depends on control dependency: [if], data = [none]
}
else
{
query = buildPrefetchQuery(realClass, idsSubset, false);
// depends on control dependency: [if], data = [(realClass]
}
queries.add(query);
// depends on control dependency: [if], data = [none]
}
}
return (Query[]) queries.toArray(new Query[queries.size()]);
} } |
public class class_name {
@Pure
@SuppressWarnings("resource")
public static InputStream getResourceAsStream(Class<?> classname, String path) {
if (classname == null) {
return null;
}
InputStream is = getResourceAsStream(classname.getClassLoader(), classname.getPackage(), path);
if (is == null) {
is = getResourceAsStream(classname.getClassLoader(), path);
}
return is;
} } | public class class_name {
@Pure
@SuppressWarnings("resource")
public static InputStream getResourceAsStream(Class<?> classname, String path) {
if (classname == null) {
return null; // depends on control dependency: [if], data = [none]
}
InputStream is = getResourceAsStream(classname.getClassLoader(), classname.getPackage(), path);
if (is == null) {
is = getResourceAsStream(classname.getClassLoader(), path); // depends on control dependency: [if], data = [none]
}
return is;
} } |
public class class_name {
public DataMediaSource findById(Long dataMediaSourceId) {
Assert.assertNotNull(dataMediaSourceId);
List<DataMediaSource> dataMediaSources = listByIds(dataMediaSourceId);
if (dataMediaSources.size() != 1) {
String exceptionCause = "query dataMediaSourceId:" + dataMediaSourceId + " but return "
+ dataMediaSources.size() + " dataMediaSource.";
logger.error("ERROR ## " + exceptionCause);
throw new ManagerException(exceptionCause);
}
return dataMediaSources.get(0);
} } | public class class_name {
public DataMediaSource findById(Long dataMediaSourceId) {
Assert.assertNotNull(dataMediaSourceId);
List<DataMediaSource> dataMediaSources = listByIds(dataMediaSourceId);
if (dataMediaSources.size() != 1) {
String exceptionCause = "query dataMediaSourceId:" + dataMediaSourceId + " but return "
+ dataMediaSources.size() + " dataMediaSource.";
logger.error("ERROR ## " + exceptionCause); // depends on control dependency: [if], data = [none]
throw new ManagerException(exceptionCause);
}
return dataMediaSources.get(0);
} } |
public class class_name {
private boolean isValidReturnValueType(ExpressionTree tree, VisitorState state) {
Type returnType = null;
if (tree instanceof MethodInvocationTree) {
returnType = getReturnType(((JCMethodInvocation) tree).getMethodSelect());
} else if (tree instanceof MemberReferenceTree) {
// Get the return type of the target referenced interface
returnType =
state.getTypes().findDescriptorType(((JCMemberReference) tree).type).getReturnType();
}
if (returnType != null) {
return capturedTypeAllowed(returnType, state);
}
return true;
} } | public class class_name {
private boolean isValidReturnValueType(ExpressionTree tree, VisitorState state) {
Type returnType = null;
if (tree instanceof MethodInvocationTree) {
returnType = getReturnType(((JCMethodInvocation) tree).getMethodSelect()); // depends on control dependency: [if], data = [none]
} else if (tree instanceof MemberReferenceTree) {
// Get the return type of the target referenced interface
returnType =
state.getTypes().findDescriptorType(((JCMemberReference) tree).type).getReturnType(); // depends on control dependency: [if], data = [none]
}
if (returnType != null) {
return capturedTypeAllowed(returnType, state); // depends on control dependency: [if], data = [(returnType]
}
return true;
} } |
public class class_name {
private LNGIntVector generateBlockingClause(final LNGBooleanVector modelFromSolver, final LNGIntVector relevantVars) {
final LNGIntVector blockingClause;
if (relevantVars != null) {
blockingClause = new LNGIntVector(relevantVars.size());
for (int i = 0; i < relevantVars.size(); i++) {
final int varIndex = relevantVars.get(i);
if (varIndex != -1) {
final boolean varAssignment = modelFromSolver.get(varIndex);
blockingClause.push(varAssignment ? (varIndex * 2) ^ 1 : varIndex * 2);
}
}
} else {
blockingClause = new LNGIntVector(modelFromSolver.size());
for (int i = 0; i < modelFromSolver.size(); i++) {
final boolean varAssignment = modelFromSolver.get(i);
blockingClause.push(varAssignment ? (i * 2) ^ 1 : i * 2);
}
}
return blockingClause;
} } | public class class_name {
private LNGIntVector generateBlockingClause(final LNGBooleanVector modelFromSolver, final LNGIntVector relevantVars) {
final LNGIntVector blockingClause;
if (relevantVars != null) {
blockingClause = new LNGIntVector(relevantVars.size()); // depends on control dependency: [if], data = [(relevantVars]
for (int i = 0; i < relevantVars.size(); i++) {
final int varIndex = relevantVars.get(i);
if (varIndex != -1) {
final boolean varAssignment = modelFromSolver.get(varIndex);
blockingClause.push(varAssignment ? (varIndex * 2) ^ 1 : varIndex * 2); // depends on control dependency: [if], data = [(varIndex]
}
}
} else {
blockingClause = new LNGIntVector(modelFromSolver.size()); // depends on control dependency: [if], data = [none]
for (int i = 0; i < modelFromSolver.size(); i++) {
final boolean varAssignment = modelFromSolver.get(i);
blockingClause.push(varAssignment ? (i * 2) ^ 1 : i * 2); // depends on control dependency: [for], data = [i]
}
}
return blockingClause;
} } |
public class class_name {
private String preReleaseIdentifier() {
checkForEmptyIdentifier();
CharType boundary = nearestCharType(DOT, PLUS, EOI);
if (chars.positiveLookaheadBefore(boundary, LETTER, HYPHEN)) {
return alphanumericIdentifier();
} else {
return numericIdentifier();
}
} } | public class class_name {
private String preReleaseIdentifier() {
checkForEmptyIdentifier();
CharType boundary = nearestCharType(DOT, PLUS, EOI);
if (chars.positiveLookaheadBefore(boundary, LETTER, HYPHEN)) {
return alphanumericIdentifier(); // depends on control dependency: [if], data = [none]
} else {
return numericIdentifier(); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
protected void shiftConflictingKeys(int gapSlot) {
final KType[] keys = Intrinsics.<KType[]> cast(this.keys);
final VType[] values = Intrinsics.<VType[]> cast(this.values);
final int mask = this.mask;
// Perform shifts of conflicting keys to fill in the gap.
int distance = 0;
while (true) {
final int slot = (gapSlot + (++distance)) & mask;
final KType existing = keys[slot];
if (Intrinsics.<KType> isEmpty(existing)) {
break;
}
final int idealSlot = hashKey(existing);
final int shift = (slot - idealSlot) & mask;
if (shift >= distance) {
// Entry at this position was originally at or before the gap slot.
// Move the conflict-shifted entry to the gap's position and repeat the procedure
// for any entries to the right of the current position, treating it
// as the new gap.
keys[gapSlot] = existing;
values[gapSlot] = values[slot];
gapSlot = slot;
distance = 0;
}
}
// Mark the last found gap slot without a conflict as empty.
keys[gapSlot] = Intrinsics.<KType> empty();
values[gapSlot] = Intrinsics.<VType> empty();
assigned--;
} } | public class class_name {
protected void shiftConflictingKeys(int gapSlot) {
final KType[] keys = Intrinsics.<KType[]> cast(this.keys);
final VType[] values = Intrinsics.<VType[]> cast(this.values);
final int mask = this.mask;
// Perform shifts of conflicting keys to fill in the gap.
int distance = 0;
while (true) {
final int slot = (gapSlot + (++distance)) & mask;
final KType existing = keys[slot];
if (Intrinsics.<KType> isEmpty(existing)) {
break;
}
final int idealSlot = hashKey(existing);
final int shift = (slot - idealSlot) & mask;
if (shift >= distance) {
// Entry at this position was originally at or before the gap slot.
// Move the conflict-shifted entry to the gap's position and repeat the procedure
// for any entries to the right of the current position, treating it
// as the new gap.
keys[gapSlot] = existing; // depends on control dependency: [if], data = [none]
values[gapSlot] = values[slot]; // depends on control dependency: [if], data = [none]
gapSlot = slot; // depends on control dependency: [if], data = [none]
distance = 0; // depends on control dependency: [if], data = [none]
}
}
// Mark the last found gap slot without a conflict as empty.
keys[gapSlot] = Intrinsics.<KType> empty();
values[gapSlot] = Intrinsics.<VType> empty();
assigned--;
} } |
public class class_name {
public void setTargetGroups(java.util.Collection<TargetGroupInfo> targetGroups) {
if (targetGroups == null) {
this.targetGroups = null;
return;
}
this.targetGroups = new com.amazonaws.internal.SdkInternalList<TargetGroupInfo>(targetGroups);
} } | public class class_name {
public void setTargetGroups(java.util.Collection<TargetGroupInfo> targetGroups) {
if (targetGroups == null) {
this.targetGroups = null; // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
this.targetGroups = new com.amazonaws.internal.SdkInternalList<TargetGroupInfo>(targetGroups);
} } |
public class class_name {
static void loadFromOrigin(JobContext origin) {
if (origin.bag_.isEmpty()) {
return;
}
ActContext<?> actContext = ActContext.Base.currentContext();
if (null != actContext) {
Locale locale = (Locale) origin.bag_.get("locale");
if (null != locale) {
actContext.locale(locale);
}
H.Session session = (H.Session) origin.bag_.get("session");
if (null != session) {
actContext.attribute("__session", session);
}
}
} } | public class class_name {
static void loadFromOrigin(JobContext origin) {
if (origin.bag_.isEmpty()) {
return; // depends on control dependency: [if], data = [none]
}
ActContext<?> actContext = ActContext.Base.currentContext();
if (null != actContext) {
Locale locale = (Locale) origin.bag_.get("locale");
if (null != locale) {
actContext.locale(locale); // depends on control dependency: [if], data = [locale)]
}
H.Session session = (H.Session) origin.bag_.get("session");
if (null != session) {
actContext.attribute("__session", session); // depends on control dependency: [if], data = [session)]
}
}
} } |
public class class_name {
public static <V> V defaultIfException(
StatementWithReturnValue<V> statement,
Class<? extends Throwable> exceptionType, V defaultValue) {
try {
return statement.evaluate();
} catch (RuntimeException e) {
if (exceptionType.isAssignableFrom(e.getClass()))
return defaultValue;
else
throw e;
} catch (Error e) {
if (exceptionType.isAssignableFrom(e.getClass()))
return defaultValue;
else
throw e;
} catch (Throwable e) {
if (exceptionType.isAssignableFrom(e.getClass()))
return defaultValue;
else
throw new WrappedException(e);
}
} } | public class class_name {
public static <V> V defaultIfException(
StatementWithReturnValue<V> statement,
Class<? extends Throwable> exceptionType, V defaultValue) {
try {
return statement.evaluate(); // depends on control dependency: [try], data = [none]
} catch (RuntimeException e) {
if (exceptionType.isAssignableFrom(e.getClass()))
return defaultValue;
else
throw e;
} catch (Error e) { // depends on control dependency: [catch], data = [none]
if (exceptionType.isAssignableFrom(e.getClass()))
return defaultValue;
else
throw e;
} catch (Throwable e) { // depends on control dependency: [catch], data = [none]
if (exceptionType.isAssignableFrom(e.getClass()))
return defaultValue;
else
throw new WrappedException(e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
private JTextField getUrlText()
{
if (urlText == null)
{
urlText = new JTextField();
urlText.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent e)
{
displayURL(urlText.getText());
}
});
}
return urlText;
} } | public class class_name {
private JTextField getUrlText()
{
if (urlText == null)
{
urlText = new JTextField(); // depends on control dependency: [if], data = [none]
urlText.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent e)
{
displayURL(urlText.getText());
}
}); // depends on control dependency: [if], data = [none]
}
return urlText;
} } |
public class class_name {
Table CONSTRAINT_COLUMN_USAGE() {
Table t = sysTables[CONSTRAINT_COLUMN_USAGE];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[CONSTRAINT_COLUMN_USAGE]);
addColumn(t, "TABLE_CATALOG", SQL_IDENTIFIER);
addColumn(t, "TABLE_SCHEMA", SQL_IDENTIFIER);
addColumn(t, "TABLE_NAME", SQL_IDENTIFIER); // not null
addColumn(t, "COLUMN_NAME", SQL_IDENTIFIER); // not null
addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER);
addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER);
addColumn(t, "CONSTRAINT_NAME", SQL_IDENTIFIER); // not null
HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
sysTableHsqlNames[CONSTRAINT_COLUMN_USAGE].name, false,
SchemaObject.INDEX);
t.createPrimaryKey(name, new int[] {
0, 1, 2, 3, 4, 5, 6
}, false);
return t;
}
// column number mappings
final int table_catalog = 0;
final int table_schems = 1;
final int table_name = 2;
final int column_name = 3;
final int constraint_catalog = 4;
final int constraint_schema = 5;
final int constraint_name = 6;
//
PersistentStore store = database.persistentStoreCollection.getStore(t);
// calculated column values
String constraintCatalog;
String constraintSchema;
String constraintName;
// Intermediate holders
Iterator tables;
Table table;
Constraint[] constraints;
int constraintCount;
Constraint constraint;
Iterator iterator;
Object[] row;
// Initialization
tables =
database.schemaManager.databaseObjectIterator(SchemaObject.TABLE);
// Do it.
while (tables.hasNext()) {
table = (Table) tables.next();
if (table.isView()
|| !session.getGrantee().isFullyAccessibleByRole(table)) {
continue;
}
constraints = table.getConstraints();
constraintCount = constraints.length;
constraintCatalog = database.getCatalogName().name;
constraintSchema = table.getSchemaName().name;
// process constraints
for (int i = 0; i < constraintCount; i++) {
constraint = constraints[i];
constraintName = constraint.getName().name;
switch (constraint.getConstraintType()) {
case Constraint.CHECK : {
OrderedHashSet expressions =
constraint.getCheckColumnExpressions();
if (expressions == null) {
break;
}
iterator = expressions.iterator();
// calculate distinct column references
while (iterator.hasNext()) {
ExpressionColumn expr =
(ExpressionColumn) iterator.next();
HsqlName name = expr.getBaseColumnHsqlName();
if (name.type != SchemaObject.COLUMN) {
continue;
}
row = t.getEmptyRowData();
row[table_catalog] =
database.getCatalogName().name;
row[table_schems] = name.schema.name;
row[table_name] = name.parent.name;
row[column_name] = name.name;
row[constraint_catalog] = constraintCatalog;
row[constraint_schema] = constraintSchema;
row[constraint_name] = constraintName;
try {
t.insertSys(store, row);
} catch (HsqlException e) {}
}
break;
}
case Constraint.UNIQUE :
case Constraint.PRIMARY_KEY :
case Constraint.FOREIGN_KEY : {
Table target = table;
int[] cols = constraint.getMainColumns();
if (constraint.getConstraintType()
== Constraint.FOREIGN_KEY) {
target = constraint.getMain();
}
/*
checkme - it seems foreign key columns are not included
but columns of the referenced unique constraint are included
if (constraint.getType() == Constraint.FOREIGN_KEY) {
for (int j = 0; j < cols.length; j++) {
row = t.getEmptyRowData();
Table mainTable = constraint.getMain();
row[table_catalog] = database.getCatalog();
row[table_schems] =
mainTable.getSchemaName().name;
row[table_name] = mainTable.getName().name;
row[column_name] = mainTable.getColumn(
cols[j]).columnName.name;
row[constraint_catalog] = constraintCatalog;
row[constraint_schema] = constraintSchema;
row[constraint_name] = constraintName;
try {
t.insertSys(row);
} catch (HsqlException e) {}
}
cols = constraint.getRefColumns();
}
*/
for (int j = 0; j < cols.length; j++) {
row = t.getEmptyRowData();
row[table_catalog] =
database.getCatalogName().name;
row[table_schems] = constraintSchema;
row[table_name] = target.getName().name;
row[column_name] =
target.getColumn(cols[j]).getName().name;
row[constraint_catalog] = constraintCatalog;
row[constraint_schema] = constraintSchema;
row[constraint_name] = constraintName;
try {
t.insertSys(store, row);
} catch (HsqlException e) {}
}
//
}
}
}
}
return t;
} } | public class class_name {
Table CONSTRAINT_COLUMN_USAGE() {
Table t = sysTables[CONSTRAINT_COLUMN_USAGE];
if (t == null) {
t = createBlankTable(sysTableHsqlNames[CONSTRAINT_COLUMN_USAGE]); // depends on control dependency: [if], data = [none]
addColumn(t, "TABLE_CATALOG", SQL_IDENTIFIER); // depends on control dependency: [if], data = [(t]
addColumn(t, "TABLE_SCHEMA", SQL_IDENTIFIER); // depends on control dependency: [if], data = [(t]
addColumn(t, "TABLE_NAME", SQL_IDENTIFIER); // not null // depends on control dependency: [if], data = [(t]
addColumn(t, "COLUMN_NAME", SQL_IDENTIFIER); // not null // depends on control dependency: [if], data = [(t]
addColumn(t, "CONSTRAINT_CATALOG", SQL_IDENTIFIER); // depends on control dependency: [if], data = [(t]
addColumn(t, "CONSTRAINT_SCHEMA", SQL_IDENTIFIER); // depends on control dependency: [if], data = [(t]
addColumn(t, "CONSTRAINT_NAME", SQL_IDENTIFIER); // not null // depends on control dependency: [if], data = [(t]
HsqlName name = HsqlNameManager.newInfoSchemaObjectName(
sysTableHsqlNames[CONSTRAINT_COLUMN_USAGE].name, false,
SchemaObject.INDEX);
t.createPrimaryKey(name, new int[] {
0, 1, 2, 3, 4, 5, 6
}, false); // depends on control dependency: [if], data = [none]
return t; // depends on control dependency: [if], data = [none]
}
// column number mappings
final int table_catalog = 0;
final int table_schems = 1;
final int table_name = 2;
final int column_name = 3;
final int constraint_catalog = 4;
final int constraint_schema = 5;
final int constraint_name = 6;
//
PersistentStore store = database.persistentStoreCollection.getStore(t);
// calculated column values
String constraintCatalog;
String constraintSchema;
String constraintName;
// Intermediate holders
Iterator tables;
Table table;
Constraint[] constraints;
int constraintCount;
Constraint constraint;
Iterator iterator;
Object[] row;
// Initialization
tables =
database.schemaManager.databaseObjectIterator(SchemaObject.TABLE);
// Do it.
while (tables.hasNext()) {
table = (Table) tables.next(); // depends on control dependency: [while], data = [none]
if (table.isView()
|| !session.getGrantee().isFullyAccessibleByRole(table)) {
continue;
}
constraints = table.getConstraints(); // depends on control dependency: [while], data = [none]
constraintCount = constraints.length; // depends on control dependency: [while], data = [none]
constraintCatalog = database.getCatalogName().name; // depends on control dependency: [while], data = [none]
constraintSchema = table.getSchemaName().name; // depends on control dependency: [while], data = [none]
// process constraints
for (int i = 0; i < constraintCount; i++) {
constraint = constraints[i]; // depends on control dependency: [for], data = [i]
constraintName = constraint.getName().name; // depends on control dependency: [for], data = [none]
switch (constraint.getConstraintType()) {
case Constraint.CHECK : {
OrderedHashSet expressions =
constraint.getCheckColumnExpressions();
if (expressions == null) {
break;
}
iterator = expressions.iterator(); // depends on control dependency: [for], data = [none]
// calculate distinct column references
while (iterator.hasNext()) {
ExpressionColumn expr =
(ExpressionColumn) iterator.next();
HsqlName name = expr.getBaseColumnHsqlName();
if (name.type != SchemaObject.COLUMN) {
continue;
}
row = t.getEmptyRowData(); // depends on control dependency: [while], data = [none]
row[table_catalog] =
database.getCatalogName().name; // depends on control dependency: [while], data = [none]
row[table_schems] = name.schema.name; // depends on control dependency: [while], data = [none]
row[table_name] = name.parent.name; // depends on control dependency: [while], data = [none]
row[column_name] = name.name; // depends on control dependency: [while], data = [none]
row[constraint_catalog] = constraintCatalog; // depends on control dependency: [while], data = [none]
row[constraint_schema] = constraintSchema; // depends on control dependency: [while], data = [none]
row[constraint_name] = constraintName; // depends on control dependency: [while], data = [none]
try {
t.insertSys(store, row); // depends on control dependency: [try], data = [none]
} catch (HsqlException e) {} // depends on control dependency: [catch], data = [none]
}
break;
}
case Constraint.UNIQUE :
case Constraint.PRIMARY_KEY :
case Constraint.FOREIGN_KEY : {
Table target = table;
int[] cols = constraint.getMainColumns();
if (constraint.getConstraintType()
== Constraint.FOREIGN_KEY) {
target = constraint.getMain(); // depends on control dependency: [if], data = [none]
}
/*
checkme - it seems foreign key columns are not included
but columns of the referenced unique constraint are included
if (constraint.getType() == Constraint.FOREIGN_KEY) {
for (int j = 0; j < cols.length; j++) {
row = t.getEmptyRowData();
Table mainTable = constraint.getMain();
row[table_catalog] = database.getCatalog();
row[table_schems] =
mainTable.getSchemaName().name;
row[table_name] = mainTable.getName().name;
row[column_name] = mainTable.getColumn(
cols[j]).columnName.name;
row[constraint_catalog] = constraintCatalog;
row[constraint_schema] = constraintSchema;
row[constraint_name] = constraintName;
try {
t.insertSys(row);
} catch (HsqlException e) {}
}
cols = constraint.getRefColumns();
}
*/
for (int j = 0; j < cols.length; j++) {
row = t.getEmptyRowData(); // depends on control dependency: [for], data = [none]
row[table_catalog] =
database.getCatalogName().name; // depends on control dependency: [for], data = [none]
row[table_schems] = constraintSchema; // depends on control dependency: [for], data = [none]
row[table_name] = target.getName().name; // depends on control dependency: [for], data = [none]
row[column_name] =
target.getColumn(cols[j]).getName().name; // depends on control dependency: [for], data = [none]
row[constraint_catalog] = constraintCatalog; // depends on control dependency: [for], data = [none]
row[constraint_schema] = constraintSchema; // depends on control dependency: [for], data = [none]
row[constraint_name] = constraintName; // depends on control dependency: [for], data = [none]
try {
t.insertSys(store, row); // depends on control dependency: [try], data = [none]
} catch (HsqlException e) {} // depends on control dependency: [catch], data = [none]
}
//
}
}
}
}
return t;
} } |
public class class_name {
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern,
String columnNamePattern)
throws SQLException {
Options options = urlParser.getOptions();
String sql = "SELECT TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, TABLE_NAME, COLUMN_NAME,"
+ dataTypeClause("COLUMN_TYPE") + " DATA_TYPE,"
+ columnTypeClause(options) + " TYPE_NAME, "
+ " CASE DATA_TYPE"
+ " WHEN 'time' THEN "
+ (datePrecisionColumnExist
? "IF(DATETIME_PRECISION = 0, 10, CAST(11 + DATETIME_PRECISION as signed integer))" : "10")
+ " WHEN 'date' THEN 10"
+ " WHEN 'datetime' THEN "
+ (datePrecisionColumnExist
? "IF(DATETIME_PRECISION = 0, 19, CAST(20 + DATETIME_PRECISION as signed integer))" : "19")
+ " WHEN 'timestamp' THEN "
+ (datePrecisionColumnExist
? "IF(DATETIME_PRECISION = 0, 19, CAST(20 + DATETIME_PRECISION as signed integer))" : "19")
+ (options.yearIsDateType ? "" : " WHEN 'year' THEN 5")
+ " ELSE "
+ " IF(NUMERIC_PRECISION IS NULL, LEAST(CHARACTER_MAXIMUM_LENGTH," + Integer.MAX_VALUE
+ "), NUMERIC_PRECISION) "
+ " END"
+ " COLUMN_SIZE, 65535 BUFFER_LENGTH, "
+ " CONVERT (CASE DATA_TYPE"
+ " WHEN 'year' THEN " + (options.yearIsDateType ? "NUMERIC_SCALE" : "0")
+ " WHEN 'tinyint' THEN " + (options.tinyInt1isBit ? "0" : "NUMERIC_SCALE")
+ " ELSE NUMERIC_SCALE END, UNSIGNED INTEGER) DECIMAL_DIGITS,"
+ " 10 NUM_PREC_RADIX, IF(IS_NULLABLE = 'yes',1,0) NULLABLE,COLUMN_COMMENT REMARKS,"
+ " COLUMN_DEFAULT COLUMN_DEF, 0 SQL_DATA_TYPE, 0 SQL_DATETIME_SUB, "
+ " LEAST(CHARACTER_OCTET_LENGTH," + Integer.MAX_VALUE + ") CHAR_OCTET_LENGTH,"
+ " ORDINAL_POSITION, IS_NULLABLE, NULL SCOPE_CATALOG, NULL SCOPE_SCHEMA, NULL SCOPE_TABLE, NULL SOURCE_DATA_TYPE,"
+ " IF(EXTRA = 'auto_increment','YES','NO') IS_AUTOINCREMENT, "
+ " IF(EXTRA in ('VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED') ,'YES','NO') IS_GENERATEDCOLUMN "
+ " FROM INFORMATION_SCHEMA.COLUMNS WHERE "
+ catalogCond("TABLE_SCHEMA", catalog)
+ " AND "
+ patternCond("TABLE_NAME", tableNamePattern)
+ " AND "
+ patternCond("COLUMN_NAME", columnNamePattern)
+ " ORDER BY TABLE_CAT, TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION";
try {
return executeQuery(sql);
} catch (SQLException sqlException) {
if (sqlException.getMessage().contains("Unknown column 'DATETIME_PRECISION'")) {
datePrecisionColumnExist = false;
return getColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern);
}
throw sqlException;
}
} } | public class class_name {
public ResultSet getColumns(String catalog, String schemaPattern, String tableNamePattern,
String columnNamePattern)
throws SQLException {
Options options = urlParser.getOptions();
String sql = "SELECT TABLE_SCHEMA TABLE_CAT, NULL TABLE_SCHEM, TABLE_NAME, COLUMN_NAME,"
+ dataTypeClause("COLUMN_TYPE") + " DATA_TYPE,"
+ columnTypeClause(options) + " TYPE_NAME, "
+ " CASE DATA_TYPE"
+ " WHEN 'time' THEN "
+ (datePrecisionColumnExist
? "IF(DATETIME_PRECISION = 0, 10, CAST(11 + DATETIME_PRECISION as signed integer))" : "10")
+ " WHEN 'date' THEN 10"
+ " WHEN 'datetime' THEN "
+ (datePrecisionColumnExist
? "IF(DATETIME_PRECISION = 0, 19, CAST(20 + DATETIME_PRECISION as signed integer))" : "19")
+ " WHEN 'timestamp' THEN "
+ (datePrecisionColumnExist
? "IF(DATETIME_PRECISION = 0, 19, CAST(20 + DATETIME_PRECISION as signed integer))" : "19")
+ (options.yearIsDateType ? "" : " WHEN 'year' THEN 5")
+ " ELSE "
+ " IF(NUMERIC_PRECISION IS NULL, LEAST(CHARACTER_MAXIMUM_LENGTH," + Integer.MAX_VALUE
+ "), NUMERIC_PRECISION) "
+ " END"
+ " COLUMN_SIZE, 65535 BUFFER_LENGTH, "
+ " CONVERT (CASE DATA_TYPE"
+ " WHEN 'year' THEN " + (options.yearIsDateType ? "NUMERIC_SCALE" : "0")
+ " WHEN 'tinyint' THEN " + (options.tinyInt1isBit ? "0" : "NUMERIC_SCALE")
+ " ELSE NUMERIC_SCALE END, UNSIGNED INTEGER) DECIMAL_DIGITS,"
+ " 10 NUM_PREC_RADIX, IF(IS_NULLABLE = 'yes',1,0) NULLABLE,COLUMN_COMMENT REMARKS,"
+ " COLUMN_DEFAULT COLUMN_DEF, 0 SQL_DATA_TYPE, 0 SQL_DATETIME_SUB, "
+ " LEAST(CHARACTER_OCTET_LENGTH," + Integer.MAX_VALUE + ") CHAR_OCTET_LENGTH,"
+ " ORDINAL_POSITION, IS_NULLABLE, NULL SCOPE_CATALOG, NULL SCOPE_SCHEMA, NULL SCOPE_TABLE, NULL SOURCE_DATA_TYPE,"
+ " IF(EXTRA = 'auto_increment','YES','NO') IS_AUTOINCREMENT, "
+ " IF(EXTRA in ('VIRTUAL', 'PERSISTENT', 'VIRTUAL GENERATED', 'STORED GENERATED') ,'YES','NO') IS_GENERATEDCOLUMN "
+ " FROM INFORMATION_SCHEMA.COLUMNS WHERE "
+ catalogCond("TABLE_SCHEMA", catalog)
+ " AND "
+ patternCond("TABLE_NAME", tableNamePattern)
+ " AND "
+ patternCond("COLUMN_NAME", columnNamePattern)
+ " ORDER BY TABLE_CAT, TABLE_SCHEM, TABLE_NAME, ORDINAL_POSITION";
try {
return executeQuery(sql);
} catch (SQLException sqlException) {
if (sqlException.getMessage().contains("Unknown column 'DATETIME_PRECISION'")) {
datePrecisionColumnExist = false; // depends on control dependency: [if], data = [none]
return getColumns(catalog, schemaPattern, tableNamePattern, columnNamePattern); // depends on control dependency: [if], data = [none]
}
throw sqlException;
}
} } |
public class class_name {
public static void insertFromStringArray(final String[] stringValues,
final DeviceAttribute deviceAttributeWritten, final int dimX, final int dimY)
throws DevFailed {
// by default for xdim = 1, send the first value.
String firsString = "";
Double numericalValue = Double.NaN;
try {
numericalValue = Double.valueOf(firsString);
} catch (final Exception e) {
numericalValue = Double.NaN;
}
if (stringValues.length > 0) {
firsString = stringValues[0];
}
if (stringValues.length > dimX * dimY) {
Except.throw_exception("TANGO_WRONG_DATA_ERROR", "size of array " + stringValues.length
+ " is too great",
"AttributeHelper.insertFromShortArray(String[] values,deviceAttributeWritten)");
}
switch (deviceAttributeWritten.getType()) {
case TangoConst.Tango_DEV_SHORT:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.shortValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_SHORT",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_USHORT:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert_us(numericalValue.shortValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_USHORT",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_CHAR:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEV_CHAR not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEV_UCHAR:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert_uc(numericalValue.shortValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_UCHAR",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_LONG:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.intValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_LONG",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_ULONG:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert_ul(numericalValue.longValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_ULONG",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_LONG64:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEV_LONG64 not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEV_ULONG64:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert_u64(numericalValue.longValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_ULONG64",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_INT:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.intValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_INT",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_FLOAT:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.floatValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_FLOAT",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_DOUBLE:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.doubleValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_DOUBLE",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_STRING:
deviceAttributeWritten.insert(firsString);
break;
case TangoConst.Tango_DEV_BOOLEAN:
if (!numericalValue.isNaN()) {
if (numericalValue.doubleValue() == 1) {
deviceAttributeWritten.insert(true);
} else {
deviceAttributeWritten.insert(false);
}
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_BOOLEAN",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_STATE:
if (!numericalValue.isNaN()) {
final DevState[] devStateValues = new DevState[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
devStateValues[i] = DevState.from_int(Short.valueOf(stringValues[i])
.intValue());
} catch (final org.omg.CORBA.BAD_PARAM badParam) {
devStateValues[i] = DevState.UNKNOWN;
}
}
deviceAttributeWritten.insert(devStateValues);
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_STATE",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
// Array input type
case TangoConst.Tango_DEVVAR_SHORTARRAY:
final short[] shortValues = new short[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
shortValues[i] = Double.valueOf(stringValues[i]).shortValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_SHORTARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert(shortValues);
} else {
deviceAttributeWritten.insert(shortValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_USHORTARRAY:
final short[] ushortValues = new short[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
ushortValues[i] = Double.valueOf(stringValues[i]).shortValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_USHORTARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert_uc(ushortValues);
} else {
deviceAttributeWritten.insert_uc(ushortValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_CHARARRAY:
final byte[] byteValues = new byte[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
byteValues[i] = Double.valueOf(stringValues[i]).byteValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_CHARARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
deviceAttributeWritten.insert_uc(byteValues, dimX, dimY);
break;
case TangoConst.Tango_DEVVAR_LONGARRAY:
final int[] longValues = new int[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
longValues[i] = Double.valueOf(stringValues[i]).intValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_LONGARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert(longValues);
} else {
deviceAttributeWritten.insert(longValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_ULONGARRAY:
final long[] ulongValues = new long[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
ulongValues[i] = Double.valueOf(stringValues[i]).longValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_LONGARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert_ul(ulongValues);
} else {
deviceAttributeWritten.insert_ul(ulongValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_LONG64ARRAY:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEVVAR_LONG64ARRAY not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEVVAR_ULONG64ARRAY:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEVVAR_ULONG64ARRAY not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEVVAR_FLOATARRAY:
final float[] floatValues = new float[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
floatValues[i] = Double.valueOf(stringValues[i]).floatValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_FLOATARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert(floatValues);
} else {
deviceAttributeWritten.insert(floatValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_DOUBLEARRAY:
final double[] doubleValues = new double[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
doubleValues[i] = Double.valueOf(stringValues[i]).doubleValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_DOUBLEARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert(doubleValues);
} else {
deviceAttributeWritten.insert(doubleValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_STRINGARRAY:
if (dimY == 0) {
deviceAttributeWritten.insert(stringValues);
} else {
deviceAttributeWritten.insert(stringValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_LONGSTRINGARRAY:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEVVAR_LONGSTRINGARRAY not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEVVAR_DOUBLESTRINGARRAY:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEVVAR_DOUBLESTRINGARRAY not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
default:
Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
+ deviceAttributeWritten.getType() + " not supported",
"AttributeHelper.insertFromStringArray(String[] value,deviceAttributeWritten)");
break;
}
} } | public class class_name {
public static void insertFromStringArray(final String[] stringValues,
final DeviceAttribute deviceAttributeWritten, final int dimX, final int dimY)
throws DevFailed {
// by default for xdim = 1, send the first value.
String firsString = "";
Double numericalValue = Double.NaN;
try {
numericalValue = Double.valueOf(firsString);
} catch (final Exception e) {
numericalValue = Double.NaN;
}
if (stringValues.length > 0) {
firsString = stringValues[0];
}
if (stringValues.length > dimX * dimY) {
Except.throw_exception("TANGO_WRONG_DATA_ERROR", "size of array " + stringValues.length
+ " is too great",
"AttributeHelper.insertFromShortArray(String[] values,deviceAttributeWritten)");
}
switch (deviceAttributeWritten.getType()) {
case TangoConst.Tango_DEV_SHORT:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.shortValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_SHORT",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_USHORT:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert_us(numericalValue.shortValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_USHORT",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_CHAR:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEV_CHAR not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEV_UCHAR:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert_uc(numericalValue.shortValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_UCHAR",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_LONG:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.intValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_LONG",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_ULONG:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert_ul(numericalValue.longValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_ULONG",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_LONG64:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEV_LONG64 not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEV_ULONG64:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert_u64(numericalValue.longValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_ULONG64",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_INT:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.intValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_INT",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_FLOAT:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.floatValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_FLOAT",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_DOUBLE:
if (!numericalValue.isNaN()) {
deviceAttributeWritten.insert(numericalValue.doubleValue());
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_DOUBLE",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_STRING:
deviceAttributeWritten.insert(firsString);
break;
case TangoConst.Tango_DEV_BOOLEAN:
if (!numericalValue.isNaN()) {
if (numericalValue.doubleValue() == 1) {
deviceAttributeWritten.insert(true); // depends on control dependency: [if], data = [none]
} else {
deviceAttributeWritten.insert(false); // depends on control dependency: [if], data = [none]
}
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_BOOLEAN",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
case TangoConst.Tango_DEV_STATE:
if (!numericalValue.isNaN()) {
final DevState[] devStateValues = new DevState[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
devStateValues[i] = DevState.from_int(Short.valueOf(stringValues[i])
.intValue()); // depends on control dependency: [try], data = [none]
} catch (final org.omg.CORBA.BAD_PARAM badParam) {
devStateValues[i] = DevState.UNKNOWN;
} // depends on control dependency: [catch], data = [none]
}
deviceAttributeWritten.insert(devStateValues);
} else {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR", firsString
+ " is not a Tango_DEV_STATE",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
break;
// Array input type
case TangoConst.Tango_DEVVAR_SHORTARRAY:
final short[] shortValues = new short[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
shortValues[i] = Double.valueOf(stringValues[i]).shortValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_SHORTARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert(shortValues);
} else {
deviceAttributeWritten.insert(shortValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_USHORTARRAY:
final short[] ushortValues = new short[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
ushortValues[i] = Double.valueOf(stringValues[i]).shortValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_USHORTARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert_uc(ushortValues);
} else {
deviceAttributeWritten.insert_uc(ushortValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_CHARARRAY:
final byte[] byteValues = new byte[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
byteValues[i] = Double.valueOf(stringValues[i]).byteValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_CHARARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
deviceAttributeWritten.insert_uc(byteValues, dimX, dimY);
break;
case TangoConst.Tango_DEVVAR_LONGARRAY:
final int[] longValues = new int[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
longValues[i] = Double.valueOf(stringValues[i]).intValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_LONGARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert(longValues);
} else {
deviceAttributeWritten.insert(longValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_ULONGARRAY:
final long[] ulongValues = new long[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
ulongValues[i] = Double.valueOf(stringValues[i]).longValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_LONGARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert_ul(ulongValues);
} else {
deviceAttributeWritten.insert_ul(ulongValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_LONG64ARRAY:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEVVAR_LONG64ARRAY not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEVVAR_ULONG64ARRAY:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEVVAR_ULONG64ARRAY not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEVVAR_FLOATARRAY:
final float[] floatValues = new float[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
floatValues[i] = Double.valueOf(stringValues[i]).floatValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_FLOATARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert(floatValues);
} else {
deviceAttributeWritten.insert(floatValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_DOUBLEARRAY:
final double[] doubleValues = new double[stringValues.length];
for (int i = 0; i < stringValues.length; i++) {
try {
doubleValues[i] = Double.valueOf(stringValues[i]).doubleValue();
} catch (final Exception e) {
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input is not a Tango_DEVVAR_DOUBLEARRAY",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
}
}
if (dimY == 0) {
deviceAttributeWritten.insert(doubleValues);
} else {
deviceAttributeWritten.insert(doubleValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_STRINGARRAY:
if (dimY == 0) {
deviceAttributeWritten.insert(stringValues);
} else {
deviceAttributeWritten.insert(stringValues, dimX, dimY);
}
break;
case TangoConst.Tango_DEVVAR_LONGSTRINGARRAY:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEVVAR_LONGSTRINGARRAY not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
case TangoConst.Tango_DEVVAR_DOUBLESTRINGARRAY:
Except
.throw_exception("TANGO_WRONG_DATA_ERROR",
"input type Tango_DEVVAR_DOUBLESTRINGARRAY not supported",
"AttributeHelper.insertFromStringArray(String[] values,deviceAttributeWritten)");
break;
default:
Except.throw_exception("TANGO_WRONG_DATA_ERROR", "input type "
+ deviceAttributeWritten.getType() + " not supported",
"AttributeHelper.insertFromStringArray(String[] value,deviceAttributeWritten)");
break;
}
} } |
public class class_name {
protected double[][] extractFeaturesInternal(BufferedImage image) {
ImageFloat32 boofcvImage = ConvertBufferedImage.convertFromSingle(image, null, ImageFloat32.class);
// create the SURF detector and descriptor in BoofCV v0.15
ConfigFastHessian conf = new ConfigFastHessian(detectThreshold, 2, maxFeaturesPerScale, 2, 9, 4, 4);
DetectDescribePoint<ImageFloat32, SurfFeature> surf = FactoryDetectDescribe.surfStable(conf, null,
null, ImageFloat32.class);
// specify the image to process
surf.detect(boofcvImage);
int numPoints = surf.getNumberOfFeatures();
double[][] descriptions = new double[numPoints][SURFLength];
for (int i = 0; i < numPoints; i++) {
descriptions[i] = surf.getDescription(i).getValue();
}
return descriptions;
} } | public class class_name {
protected double[][] extractFeaturesInternal(BufferedImage image) {
ImageFloat32 boofcvImage = ConvertBufferedImage.convertFromSingle(image, null, ImageFloat32.class);
// create the SURF detector and descriptor in BoofCV v0.15
ConfigFastHessian conf = new ConfigFastHessian(detectThreshold, 2, maxFeaturesPerScale, 2, 9, 4, 4);
DetectDescribePoint<ImageFloat32, SurfFeature> surf = FactoryDetectDescribe.surfStable(conf, null,
null, ImageFloat32.class);
// specify the image to process
surf.detect(boofcvImage);
int numPoints = surf.getNumberOfFeatures();
double[][] descriptions = new double[numPoints][SURFLength];
for (int i = 0; i < numPoints; i++) {
descriptions[i] = surf.getDescription(i).getValue();
// depends on control dependency: [for], data = [i]
}
return descriptions;
} } |
public class class_name {
public static ScalesResult getScalesResult(final Relation<? extends SpatialComparable> rel) {
Collection<ScalesResult> scas = ResultUtil.filterResults(rel.getHierarchy(), rel, ScalesResult.class);
if(scas.isEmpty()) {
final ScalesResult newsca = new ScalesResult(rel);
ResultUtil.addChildResult(rel, newsca);
return newsca;
}
return scas.iterator().next();
} } | public class class_name {
public static ScalesResult getScalesResult(final Relation<? extends SpatialComparable> rel) {
Collection<ScalesResult> scas = ResultUtil.filterResults(rel.getHierarchy(), rel, ScalesResult.class);
if(scas.isEmpty()) {
final ScalesResult newsca = new ScalesResult(rel);
ResultUtil.addChildResult(rel, newsca); // depends on control dependency: [if], data = [none]
return newsca; // depends on control dependency: [if], data = [none]
}
return scas.iterator().next();
} } |
public class class_name {
protected void processLevelInjections(final BuildData buildData, final Level level, final Document doc, final Element node,
final DocBookXMLPreProcessor xmlPreProcessor) {
final boolean useFixedUrls = buildData.isUseFixedUrls();
// Process the injection points
if (buildData.getInjectionOptions().isInjectionAllowed()) {
xmlPreProcessor.processPrerequisiteInjections(level, doc, node, useFixedUrls);
xmlPreProcessor.processLinkListRelationshipInjections(level, doc, node, useFixedUrls);
xmlPreProcessor.processSeeAlsoInjections(level, doc, node, useFixedUrls);
}
} } | public class class_name {
protected void processLevelInjections(final BuildData buildData, final Level level, final Document doc, final Element node,
final DocBookXMLPreProcessor xmlPreProcessor) {
final boolean useFixedUrls = buildData.isUseFixedUrls();
// Process the injection points
if (buildData.getInjectionOptions().isInjectionAllowed()) {
xmlPreProcessor.processPrerequisiteInjections(level, doc, node, useFixedUrls); // depends on control dependency: [if], data = [none]
xmlPreProcessor.processLinkListRelationshipInjections(level, doc, node, useFixedUrls); // depends on control dependency: [if], data = [none]
xmlPreProcessor.processSeeAlsoInjections(level, doc, node, useFixedUrls); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
public static String bundleToString(Bundle bundle) {
if (bundle == null) {
return "null";
}
StringBuilder b = new StringBuilder(128);
b.append("Bundle[{");
bundleToShortString(bundle, b);
b.append("}]");
return b.toString();
} } | public class class_name {
public static String bundleToString(Bundle bundle) {
if (bundle == null) {
return "null"; // depends on control dependency: [if], data = [none]
}
StringBuilder b = new StringBuilder(128);
b.append("Bundle[{");
bundleToShortString(bundle, b);
b.append("}]");
return b.toString();
} } |
public class class_name {
public static AbstractHtml findOneTagByAttribute(final boolean parallel,
final String attributeName, final String attributeValue,
final AbstractHtml... fromTags) throws NullValueException {
if (attributeName == null) {
throw new NullValueException(
"The attributeName should not be null");
}
if (attributeValue == null) {
throw new NullValueException(
"The attributeValue should not be null");
}
if (fromTags == null) {
throw new NullValueException("The fromTags should not be null");
}
final Collection<Lock> locks = getReadLocks(fromTags);
for (final Lock lock : locks) {
lock.lock();
}
try {
final Stream<AbstractHtml> stream = getAllNestedChildrenIncludingParent(
parallel, fromTags);
final Optional<AbstractHtml> any = stream.filter(child -> {
final AbstractAttribute attr = child
.getAttributeByName(attributeName);
return attr != null
&& attributeValue.equals(attr.getAttributeValue());
}).findAny();
if (any.isPresent()) {
return any.get();
}
return null;
} finally {
for (final Lock lock : locks) {
lock.unlock();
}
}
} } | public class class_name {
public static AbstractHtml findOneTagByAttribute(final boolean parallel,
final String attributeName, final String attributeValue,
final AbstractHtml... fromTags) throws NullValueException {
if (attributeName == null) {
throw new NullValueException(
"The attributeName should not be null");
}
if (attributeValue == null) {
throw new NullValueException(
"The attributeValue should not be null");
}
if (fromTags == null) {
throw new NullValueException("The fromTags should not be null");
}
final Collection<Lock> locks = getReadLocks(fromTags);
for (final Lock lock : locks) {
lock.lock(); // depends on control dependency: [for], data = [lock]
}
try {
final Stream<AbstractHtml> stream = getAllNestedChildrenIncludingParent(
parallel, fromTags);
final Optional<AbstractHtml> any = stream.filter(child -> {
final AbstractAttribute attr = child
.getAttributeByName(attributeName);
return attr != null
&& attributeValue.equals(attr.getAttributeValue());
}).findAny();
if (any.isPresent()) {
return any.get(); // depends on control dependency: [if], data = [none]
}
return null;
} finally {
for (final Lock lock : locks) {
lock.unlock(); // depends on control dependency: [for], data = [lock]
}
}
} } |
public class class_name {
public static Cluster getCluster(ConsumerBootstrap consumerBootstrap) {
try {
ConsumerConfig consumerConfig = consumerBootstrap.getConsumerConfig();
ExtensionClass<Cluster> ext = ExtensionLoaderFactory.getExtensionLoader(Cluster.class)
.getExtensionClass(consumerConfig.getCluster());
if (ext == null) {
throw ExceptionUtils.buildRuntime("consumer.cluster",
consumerConfig.getCluster(), "Unsupported cluster of client!");
}
return ext.getExtInstance(new Class[] { ConsumerBootstrap.class },
new Object[] { consumerBootstrap });
} catch (SofaRpcRuntimeException e) {
throw e;
} catch (Throwable e) {
throw new SofaRpcRuntimeException(e.getMessage(), e);
}
} } | public class class_name {
public static Cluster getCluster(ConsumerBootstrap consumerBootstrap) {
try {
ConsumerConfig consumerConfig = consumerBootstrap.getConsumerConfig();
ExtensionClass<Cluster> ext = ExtensionLoaderFactory.getExtensionLoader(Cluster.class)
.getExtensionClass(consumerConfig.getCluster());
if (ext == null) {
throw ExceptionUtils.buildRuntime("consumer.cluster",
consumerConfig.getCluster(), "Unsupported cluster of client!");
}
return ext.getExtInstance(new Class[] { ConsumerBootstrap.class },
new Object[] { consumerBootstrap }); // depends on control dependency: [try], data = [none]
} catch (SofaRpcRuntimeException e) {
throw e;
} catch (Throwable e) { // depends on control dependency: [catch], data = [none]
throw new SofaRpcRuntimeException(e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public Form getAncestor(
Form formToGetAncestorForParam,
boolean includeFieldDataParam,
boolean includeTableFieldsParam) {
if (formToGetAncestorForParam != null && this.serviceTicket != null) {
formToGetAncestorForParam.setServiceTicket(this.serviceTicket);
}
try {
return new Form(
this.postJson(formToGetAncestorForParam,
WS.Path.SQLUtil.Version1.getAncestor(
includeFieldDataParam,
includeTableFieldsParam)));
}
//JSON Issue...
catch (JSONException e) {
throw new FluidClientException(e.getMessage(), e,
FluidClientException.ErrorCode.JSON_PARSING);
}
} } | public class class_name {
public Form getAncestor(
Form formToGetAncestorForParam,
boolean includeFieldDataParam,
boolean includeTableFieldsParam) {
if (formToGetAncestorForParam != null && this.serviceTicket != null) {
formToGetAncestorForParam.setServiceTicket(this.serviceTicket); // depends on control dependency: [if], data = [none]
}
try {
return new Form(
this.postJson(formToGetAncestorForParam,
WS.Path.SQLUtil.Version1.getAncestor(
includeFieldDataParam,
includeTableFieldsParam))); // depends on control dependency: [try], data = [none]
}
//JSON Issue...
catch (JSONException e) {
throw new FluidClientException(e.getMessage(), e,
FluidClientException.ErrorCode.JSON_PARSING);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
@SuppressWarnings("deprecation")
public static void evaluate(final Map<String, Object> context,
final Cell cell, final ExpressionEngine engine) {
if ((cell != null) && (cell.getCellTypeEnum() == CellType.STRING)) {
String strValue = cell.getStringCellValue();
if (isUserFormula(strValue)) {
evaluateUserFormula(cell, strValue);
} else {
evaluateNormalCells(cell, strValue, context, engine);
}
}
} } | public class class_name {
@SuppressWarnings("deprecation")
public static void evaluate(final Map<String, Object> context,
final Cell cell, final ExpressionEngine engine) {
if ((cell != null) && (cell.getCellTypeEnum() == CellType.STRING)) {
String strValue = cell.getStringCellValue();
if (isUserFormula(strValue)) {
evaluateUserFormula(cell, strValue);
// depends on control dependency: [if], data = [none]
} else {
evaluateNormalCells(cell, strValue, context, engine);
// depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
private ManagementGroupVertex getCandidateVertex(final TraversalEntry te, final boolean forward) {
while (true) {
if (forward) {
// No more outgoing edges to consider
if (te.getCurrentEdge() >= te.getGroupVertex().getNumberOfForwardEdges()) {
break;
}
} else {
// No more outgoing edges to consider
if (te.getCurrentEdge() >= te.getGroupVertex().getNumberOfBackwardEdges()) {
break;
}
}
ManagementGroupVertex tmp = null;
if (forward) {
tmp = te.getGroupVertex().getForwardEdge(te.getCurrentEdge()).getTarget();
} else {
tmp = te.getGroupVertex().getBackwardEdge(te.getCurrentEdge()).getSource();
}
// Increase the current edge index by one
te.increaseCurrentEdge();
// If stage >= 0, tmp must be in the same stage as te.getGroupVertex()
if (this.stage >= 0) {
if (tmp.getStageNumber() != this.stage) {
continue;
}
}
if (!this.alreadyVisited.contains(tmp)) {
return tmp;
}
}
return null;
} } | public class class_name {
private ManagementGroupVertex getCandidateVertex(final TraversalEntry te, final boolean forward) {
while (true) {
if (forward) {
// No more outgoing edges to consider
if (te.getCurrentEdge() >= te.getGroupVertex().getNumberOfForwardEdges()) {
break;
}
} else {
// No more outgoing edges to consider
if (te.getCurrentEdge() >= te.getGroupVertex().getNumberOfBackwardEdges()) {
break;
}
}
ManagementGroupVertex tmp = null;
if (forward) {
tmp = te.getGroupVertex().getForwardEdge(te.getCurrentEdge()).getTarget(); // depends on control dependency: [if], data = [none]
} else {
tmp = te.getGroupVertex().getBackwardEdge(te.getCurrentEdge()).getSource(); // depends on control dependency: [if], data = [none]
}
// Increase the current edge index by one
te.increaseCurrentEdge(); // depends on control dependency: [while], data = [none]
// If stage >= 0, tmp must be in the same stage as te.getGroupVertex()
if (this.stage >= 0) {
if (tmp.getStageNumber() != this.stage) {
continue;
}
}
if (!this.alreadyVisited.contains(tmp)) {
return tmp; // depends on control dependency: [if], data = [none]
}
}
return null;
} } |
public class class_name {
public void processSkeleton( BinaryFast binary, int[][] kernel ) {
int oldForeEdge = 0;
int oldBackEdge = 0;
while( !(binary.getForegroundEdgePixels().size() == oldForeEdge && binary.getBackgroundEdgePixels().size() == oldBackEdge) ) {
oldForeEdge = binary.getForegroundEdgePixels().size();
oldBackEdge = binary.getBackgroundEdgePixels().size();
for( int i = 0; i < kernel.length; ++i ) {
binary = thinBinaryRep(binary, kernel[i]);
binary.generateBackgroundEdgeFromForegroundEdge();
}
}
} } | public class class_name {
public void processSkeleton( BinaryFast binary, int[][] kernel ) {
int oldForeEdge = 0;
int oldBackEdge = 0;
while( !(binary.getForegroundEdgePixels().size() == oldForeEdge && binary.getBackgroundEdgePixels().size() == oldBackEdge) ) {
oldForeEdge = binary.getForegroundEdgePixels().size(); // depends on control dependency: [while], data = [none]
oldBackEdge = binary.getBackgroundEdgePixels().size(); // depends on control dependency: [while], data = [none]
for( int i = 0; i < kernel.length; ++i ) {
binary = thinBinaryRep(binary, kernel[i]); // depends on control dependency: [for], data = [i]
binary.generateBackgroundEdgeFromForegroundEdge(); // depends on control dependency: [for], data = [none]
}
}
} } |
public class class_name {
public void validateStaticConfiguration()
{
int failedConfigCount = 0;
if (allConfigDescriptors == null) {
log.warn("No config descriptors found. If you don't have any configurations installed, this warning can be ignored");
return;
}
for (ConfigDescriptor desc : allConfigDescriptors) {
try {
log.trace("Checking static config for property {}, with default value of {}",
desc.getConfigName(), desc.getDefaultValue());
PropertyIdentifier propertyId = getIdentifier(desc);
TypeLiteral<PropertyAccessor<?>> accessorKey =
(TypeLiteral<PropertyAccessor<?>>) TypeLiteral.get(
Types.newParameterizedType(PropertyAccessor.class, desc.getConfigType()));
Provider<PropertyAccessor<?>> propertyAccessor = injector.getProvider(Key.get(accessorKey, propertyId));
propertyAccessor.get();
}
catch (ProvisionException ex) {
++failedConfigCount;
log.warn("Failed static config check for property {}", desc.getConfigName(), ex);
}
}
if (failedConfigCount > 0) {
throw new ConfigException("{} of {} configuration values failed static config checks",
failedConfigCount,
allConfigDescriptors.size());
}
} } | public class class_name {
public void validateStaticConfiguration()
{
int failedConfigCount = 0;
if (allConfigDescriptors == null) {
log.warn("No config descriptors found. If you don't have any configurations installed, this warning can be ignored"); // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
for (ConfigDescriptor desc : allConfigDescriptors) {
try {
log.trace("Checking static config for property {}, with default value of {}",
desc.getConfigName(), desc.getDefaultValue()); // depends on control dependency: [try], data = [none]
PropertyIdentifier propertyId = getIdentifier(desc);
TypeLiteral<PropertyAccessor<?>> accessorKey =
(TypeLiteral<PropertyAccessor<?>>) TypeLiteral.get(
Types.newParameterizedType(PropertyAccessor.class, desc.getConfigType())); // depends on control dependency: [try], data = [none]
Provider<PropertyAccessor<?>> propertyAccessor = injector.getProvider(Key.get(accessorKey, propertyId)); // depends on control dependency: [try], data = [none]
propertyAccessor.get(); // depends on control dependency: [try], data = [none]
}
catch (ProvisionException ex) {
++failedConfigCount;
log.warn("Failed static config check for property {}", desc.getConfigName(), ex);
} // depends on control dependency: [catch], data = [none]
}
if (failedConfigCount > 0) {
throw new ConfigException("{} of {} configuration values failed static config checks",
failedConfigCount,
allConfigDescriptors.size());
}
} } |
public class class_name {
public synchronized void putSIMessageHandles(SIMessageHandle[] siMsgHandles)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "putSIMessageHandles", siMsgHandles);
putInt(siMsgHandles.length);
for (int handleIndex = 0; handleIndex < siMsgHandles.length; ++handleIndex)
{
JsMessageHandle jsHandle = (JsMessageHandle)siMsgHandles[handleIndex];
putLong(jsHandle.getSystemMessageValue());
put(jsHandle.getSystemMessageSourceUuid().toByteArray());
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "message handle: "+siMsgHandles[handleIndex]);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "putSIMessageHandles");
} } | public class class_name {
public synchronized void putSIMessageHandles(SIMessageHandle[] siMsgHandles)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "putSIMessageHandles", siMsgHandles);
putInt(siMsgHandles.length);
for (int handleIndex = 0; handleIndex < siMsgHandles.length; ++handleIndex)
{
JsMessageHandle jsHandle = (JsMessageHandle)siMsgHandles[handleIndex];
putLong(jsHandle.getSystemMessageValue()); // depends on control dependency: [for], data = [none]
put(jsHandle.getSystemMessageSourceUuid().toByteArray()); // depends on control dependency: [for], data = [none]
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) SibTr.debug(this, tc, "message handle: "+siMsgHandles[handleIndex]);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "putSIMessageHandles");
} } |
public class class_name {
public static double TopsoeDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
double den = p[i] + q[i];
r += p[i] * Math.log(2 * p[i] / den) + q[i] * Math.log(2 * q[i] / den);
}
}
return r;
} } | public class class_name {
public static double TopsoeDivergence(double[] p, double[] q) {
double r = 0;
for (int i = 0; i < p.length; i++) {
if (p[i] != 0 && q[i] != 0) {
double den = p[i] + q[i];
r += p[i] * Math.log(2 * p[i] / den) + q[i] * Math.log(2 * q[i] / den); // depends on control dependency: [if], data = [none]
}
}
return r;
} } |
public class class_name {
public ActivityHandle getActivityHandle(Object arg0) {
if (arg0 instanceof HttpClientNIORequestActivityImpl) {
HttpClientNIORequestActivityHandle handle = new HttpClientNIORequestActivityHandle(
((HttpClientNIORequestActivityImpl) arg0).getId());
if (activities.containsKey(handle)) {
return handle;
}
}
return null;
} } | public class class_name {
public ActivityHandle getActivityHandle(Object arg0) {
if (arg0 instanceof HttpClientNIORequestActivityImpl) {
HttpClientNIORequestActivityHandle handle = new HttpClientNIORequestActivityHandle(
((HttpClientNIORequestActivityImpl) arg0).getId());
if (activities.containsKey(handle)) {
return handle;
// depends on control dependency: [if], data = [none]
}
}
return null;
} } |
public class class_name {
@Override
public int countByC_ERC(long companyId, String externalReferenceCode) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_C_ERC;
Object[] finderArgs = new Object[] { companyId, externalReferenceCode };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler(3);
query.append(_SQL_COUNT_CPDEFINITION_WHERE);
query.append(_FINDER_COLUMN_C_ERC_COMPANYID_2);
boolean bindExternalReferenceCode = false;
if (externalReferenceCode == null) {
query.append(_FINDER_COLUMN_C_ERC_EXTERNALREFERENCECODE_1);
}
else if (externalReferenceCode.equals("")) {
query.append(_FINDER_COLUMN_C_ERC_EXTERNALREFERENCECODE_3);
}
else {
bindExternalReferenceCode = true;
query.append(_FINDER_COLUMN_C_ERC_EXTERNALREFERENCECODE_2);
}
String sql = query.toString();
Session session = null;
try {
session = openSession();
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
qPos.add(companyId);
if (bindExternalReferenceCode) {
qPos.add(externalReferenceCode);
}
count = (Long)q.uniqueResult();
finderCache.putResult(finderPath, finderArgs, count);
}
catch (Exception e) {
finderCache.removeResult(finderPath, finderArgs);
throw processException(e);
}
finally {
closeSession(session);
}
}
return count.intValue();
} } | public class class_name {
@Override
public int countByC_ERC(long companyId, String externalReferenceCode) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_C_ERC;
Object[] finderArgs = new Object[] { companyId, externalReferenceCode };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler(3);
query.append(_SQL_COUNT_CPDEFINITION_WHERE); // depends on control dependency: [if], data = [none]
query.append(_FINDER_COLUMN_C_ERC_COMPANYID_2); // depends on control dependency: [if], data = [none]
boolean bindExternalReferenceCode = false;
if (externalReferenceCode == null) {
query.append(_FINDER_COLUMN_C_ERC_EXTERNALREFERENCECODE_1); // depends on control dependency: [if], data = [none]
}
else if (externalReferenceCode.equals("")) {
query.append(_FINDER_COLUMN_C_ERC_EXTERNALREFERENCECODE_3); // depends on control dependency: [if], data = [none]
}
else {
bindExternalReferenceCode = true; // depends on control dependency: [if], data = [none]
query.append(_FINDER_COLUMN_C_ERC_EXTERNALREFERENCECODE_2); // depends on control dependency: [if], data = [none]
}
String sql = query.toString();
Session session = null;
try {
session = openSession(); // depends on control dependency: [try], data = [none]
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
qPos.add(companyId); // depends on control dependency: [try], data = [none]
if (bindExternalReferenceCode) {
qPos.add(externalReferenceCode); // depends on control dependency: [if], data = [none]
}
count = (Long)q.uniqueResult(); // depends on control dependency: [try], data = [none]
finderCache.putResult(finderPath, finderArgs, count); // depends on control dependency: [try], data = [none]
}
catch (Exception e) {
finderCache.removeResult(finderPath, finderArgs);
throw processException(e);
} // depends on control dependency: [catch], data = [none]
finally {
closeSession(session);
}
}
return count.intValue();
} } |
public class class_name {
public void setPeriod(ReadableInstant start, ReadableInstant end) {
if (start == end) {
setPeriod(0L);
} else {
long startMillis = DateTimeUtils.getInstantMillis(start);
long endMillis = DateTimeUtils.getInstantMillis(end);
Chronology chrono = DateTimeUtils.getIntervalChronology(start, end);
setPeriod(startMillis, endMillis, chrono);
}
} } | public class class_name {
public void setPeriod(ReadableInstant start, ReadableInstant end) {
if (start == end) {
setPeriod(0L); // depends on control dependency: [if], data = [none]
} else {
long startMillis = DateTimeUtils.getInstantMillis(start);
long endMillis = DateTimeUtils.getInstantMillis(end);
Chronology chrono = DateTimeUtils.getIntervalChronology(start, end);
setPeriod(startMillis, endMillis, chrono); // depends on control dependency: [if], data = [(start]
}
} } |
public class class_name {
private void processProvideCall(NodeTraversal t, Node n, Node parent) {
checkState(n.isCall());
Node left = n.getFirstChild();
Node arg = left.getNext();
if (verifyProvide(left, arg)) {
String ns = arg.getString();
maybeAddNameToSymbolTable(left);
maybeAddStringToSymbolTable(arg);
if (providedNames.containsKey(ns)) {
ProvidedName previouslyProvided = providedNames.get(ns);
if (!previouslyProvided.isExplicitlyProvided() || previouslyProvided.isPreviouslyProvided) {
previouslyProvided.addProvide(parent, t.getModule(), true);
} else {
String explicitSourceName = previouslyProvided.explicitNode.getSourceFileName();
compiler.report(
JSError.make(
n, ProcessClosurePrimitives.DUPLICATE_NAMESPACE_ERROR, ns, explicitSourceName));
}
} else {
registerAnyProvidedPrefixes(ns, parent, t.getModule());
providedNames.put(
ns,
new ProvidedName(
ns, parent, t.getModule(), /* explicit= */ true, /* fromPreviousProvide= */ false));
}
}
} } | public class class_name {
private void processProvideCall(NodeTraversal t, Node n, Node parent) {
checkState(n.isCall());
Node left = n.getFirstChild();
Node arg = left.getNext();
if (verifyProvide(left, arg)) {
String ns = arg.getString();
maybeAddNameToSymbolTable(left); // depends on control dependency: [if], data = [none]
maybeAddStringToSymbolTable(arg); // depends on control dependency: [if], data = [none]
if (providedNames.containsKey(ns)) {
ProvidedName previouslyProvided = providedNames.get(ns);
if (!previouslyProvided.isExplicitlyProvided() || previouslyProvided.isPreviouslyProvided) {
previouslyProvided.addProvide(parent, t.getModule(), true); // depends on control dependency: [if], data = [none]
} else {
String explicitSourceName = previouslyProvided.explicitNode.getSourceFileName();
compiler.report(
JSError.make(
n, ProcessClosurePrimitives.DUPLICATE_NAMESPACE_ERROR, ns, explicitSourceName)); // depends on control dependency: [if], data = [none]
}
} else {
registerAnyProvidedPrefixes(ns, parent, t.getModule()); // depends on control dependency: [if], data = [none]
providedNames.put(
ns,
new ProvidedName(
ns, parent, t.getModule(), /* explicit= */ true, /* fromPreviousProvide= */ false)); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
private void copy(OutputStream out, File in) throws IOException {
FileInputStream inStream = null;
try {
inStream = new FileInputStream(in);
byte[] buffer = new byte[4096];
int len;
while ((len = inStream.read(buffer)) != -1) {
out.write(buffer, 0, len);
}
} finally {
if (inStream != null) {
inStream.close();
}
}
} } | public class class_name {
private void copy(OutputStream out, File in) throws IOException {
FileInputStream inStream = null;
try {
inStream = new FileInputStream(in);
byte[] buffer = new byte[4096];
int len;
while ((len = inStream.read(buffer)) != -1) {
out.write(buffer, 0, len); // depends on control dependency: [while], data = [none]
}
} finally {
if (inStream != null) {
inStream.close(); // depends on control dependency: [if], data = [none]
}
}
} } |
public class class_name {
public final void mRULE_ID() throws RecognitionException {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSARL.g:48763:9: ( ( '^' )? ( RULE_IDENTIFIER_START | RULE_UNICODE_ESCAPE ) ( RULE_IDENTIFIER_PART | RULE_UNICODE_ESCAPE )* )
// InternalSARL.g:48763:11: ( '^' )? ( RULE_IDENTIFIER_START | RULE_UNICODE_ESCAPE ) ( RULE_IDENTIFIER_PART | RULE_UNICODE_ESCAPE )*
{
// InternalSARL.g:48763:11: ( '^' )?
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0=='^') ) {
alt1=1;
}
switch (alt1) {
case 1 :
// InternalSARL.g:48763:11: '^'
{
match('^');
}
break;
}
// InternalSARL.g:48763:16: ( RULE_IDENTIFIER_START | RULE_UNICODE_ESCAPE )
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0=='$'||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')||(LA2_0>='\u00A2' && LA2_0<='\u00A5')||LA2_0=='\u00AA'||LA2_0=='\u00B5'||LA2_0=='\u00BA'||(LA2_0>='\u00C0' && LA2_0<='\u00D6')||(LA2_0>='\u00D8' && LA2_0<='\u00F6')||(LA2_0>='\u00F8' && LA2_0<='\u0236')||(LA2_0>='\u0250' && LA2_0<='\u02C1')||(LA2_0>='\u02C6' && LA2_0<='\u02D1')||(LA2_0>='\u02E0' && LA2_0<='\u02E4')||LA2_0=='\u02EE'||LA2_0=='\u037A'||LA2_0=='\u0386'||(LA2_0>='\u0388' && LA2_0<='\u038A')||LA2_0=='\u038C'||(LA2_0>='\u038E' && LA2_0<='\u03A1')||(LA2_0>='\u03A3' && LA2_0<='\u03CE')||(LA2_0>='\u03D0' && LA2_0<='\u03F5')||(LA2_0>='\u03F7' && LA2_0<='\u03FB')||(LA2_0>='\u0400' && LA2_0<='\u0481')||(LA2_0>='\u048A' && LA2_0<='\u04CE')||(LA2_0>='\u04D0' && LA2_0<='\u04F5')||(LA2_0>='\u04F8' && LA2_0<='\u04F9')||(LA2_0>='\u0500' && LA2_0<='\u050F')||(LA2_0>='\u0531' && LA2_0<='\u0556')||LA2_0=='\u0559'||(LA2_0>='\u0561' && LA2_0<='\u0587')||(LA2_0>='\u05D0' && LA2_0<='\u05EA')||(LA2_0>='\u05F0' && LA2_0<='\u05F2')||(LA2_0>='\u0621' && LA2_0<='\u063A')||(LA2_0>='\u0640' && LA2_0<='\u064A')||(LA2_0>='\u066E' && LA2_0<='\u066F')||(LA2_0>='\u0671' && LA2_0<='\u06D3')||LA2_0=='\u06D5'||(LA2_0>='\u06E5' && LA2_0<='\u06E6')||(LA2_0>='\u06EE' && LA2_0<='\u06EF')||(LA2_0>='\u06FA' && LA2_0<='\u06FC')||LA2_0=='\u06FF'||LA2_0=='\u0710'||(LA2_0>='\u0712' && LA2_0<='\u072F')||(LA2_0>='\u074D' && LA2_0<='\u074F')||(LA2_0>='\u0780' && LA2_0<='\u07A5')||LA2_0=='\u07B1'||(LA2_0>='\u0904' && LA2_0<='\u0939')||LA2_0=='\u093D'||LA2_0=='\u0950'||(LA2_0>='\u0958' && LA2_0<='\u0961')||(LA2_0>='\u0985' && LA2_0<='\u098C')||(LA2_0>='\u098F' && LA2_0<='\u0990')||(LA2_0>='\u0993' && LA2_0<='\u09A8')||(LA2_0>='\u09AA' && LA2_0<='\u09B0')||LA2_0=='\u09B2'||(LA2_0>='\u09B6' && LA2_0<='\u09B9')||LA2_0=='\u09BD'||(LA2_0>='\u09DC' && LA2_0<='\u09DD')||(LA2_0>='\u09DF' && LA2_0<='\u09E1')||(LA2_0>='\u09F0' && LA2_0<='\u09F3')||(LA2_0>='\u0A05' && LA2_0<='\u0A0A')||(LA2_0>='\u0A0F' && LA2_0<='\u0A10')||(LA2_0>='\u0A13' && LA2_0<='\u0A28')||(LA2_0>='\u0A2A' && LA2_0<='\u0A30')||(LA2_0>='\u0A32' && LA2_0<='\u0A33')||(LA2_0>='\u0A35' && LA2_0<='\u0A36')||(LA2_0>='\u0A38' && LA2_0<='\u0A39')||(LA2_0>='\u0A59' && LA2_0<='\u0A5C')||LA2_0=='\u0A5E'||(LA2_0>='\u0A72' && LA2_0<='\u0A74')||(LA2_0>='\u0A85' && LA2_0<='\u0A8D')||(LA2_0>='\u0A8F' && LA2_0<='\u0A91')||(LA2_0>='\u0A93' && LA2_0<='\u0AA8')||(LA2_0>='\u0AAA' && LA2_0<='\u0AB0')||(LA2_0>='\u0AB2' && LA2_0<='\u0AB3')||(LA2_0>='\u0AB5' && LA2_0<='\u0AB9')||LA2_0=='\u0ABD'||LA2_0=='\u0AD0'||(LA2_0>='\u0AE0' && LA2_0<='\u0AE1')||LA2_0=='\u0AF1'||(LA2_0>='\u0B05' && LA2_0<='\u0B0C')||(LA2_0>='\u0B0F' && LA2_0<='\u0B10')||(LA2_0>='\u0B13' && LA2_0<='\u0B28')||(LA2_0>='\u0B2A' && LA2_0<='\u0B30')||(LA2_0>='\u0B32' && LA2_0<='\u0B33')||(LA2_0>='\u0B35' && LA2_0<='\u0B39')||LA2_0=='\u0B3D'||(LA2_0>='\u0B5C' && LA2_0<='\u0B5D')||(LA2_0>='\u0B5F' && LA2_0<='\u0B61')||LA2_0=='\u0B71'||LA2_0=='\u0B83'||(LA2_0>='\u0B85' && LA2_0<='\u0B8A')||(LA2_0>='\u0B8E' && LA2_0<='\u0B90')||(LA2_0>='\u0B92' && LA2_0<='\u0B95')||(LA2_0>='\u0B99' && LA2_0<='\u0B9A')||LA2_0=='\u0B9C'||(LA2_0>='\u0B9E' && LA2_0<='\u0B9F')||(LA2_0>='\u0BA3' && LA2_0<='\u0BA4')||(LA2_0>='\u0BA8' && LA2_0<='\u0BAA')||(LA2_0>='\u0BAE' && LA2_0<='\u0BB5')||(LA2_0>='\u0BB7' && LA2_0<='\u0BB9')||LA2_0=='\u0BF9'||(LA2_0>='\u0C05' && LA2_0<='\u0C0C')||(LA2_0>='\u0C0E' && LA2_0<='\u0C10')||(LA2_0>='\u0C12' && LA2_0<='\u0C28')||(LA2_0>='\u0C2A' && LA2_0<='\u0C33')||(LA2_0>='\u0C35' && LA2_0<='\u0C39')||(LA2_0>='\u0C60' && LA2_0<='\u0C61')||(LA2_0>='\u0C85' && LA2_0<='\u0C8C')||(LA2_0>='\u0C8E' && LA2_0<='\u0C90')||(LA2_0>='\u0C92' && LA2_0<='\u0CA8')||(LA2_0>='\u0CAA' && LA2_0<='\u0CB3')||(LA2_0>='\u0CB5' && LA2_0<='\u0CB9')||LA2_0=='\u0CBD'||LA2_0=='\u0CDE'||(LA2_0>='\u0CE0' && LA2_0<='\u0CE1')||(LA2_0>='\u0D05' && LA2_0<='\u0D0C')||(LA2_0>='\u0D0E' && LA2_0<='\u0D10')||(LA2_0>='\u0D12' && LA2_0<='\u0D28')||(LA2_0>='\u0D2A' && LA2_0<='\u0D39')||(LA2_0>='\u0D60' && LA2_0<='\u0D61')||(LA2_0>='\u0D85' && LA2_0<='\u0D96')||(LA2_0>='\u0D9A' && LA2_0<='\u0DB1')||(LA2_0>='\u0DB3' && LA2_0<='\u0DBB')||LA2_0=='\u0DBD'||(LA2_0>='\u0DC0' && LA2_0<='\u0DC6')||(LA2_0>='\u0E01' && LA2_0<='\u0E30')||(LA2_0>='\u0E32' && LA2_0<='\u0E33')||(LA2_0>='\u0E3F' && LA2_0<='\u0E46')||(LA2_0>='\u0E81' && LA2_0<='\u0E82')||LA2_0=='\u0E84'||(LA2_0>='\u0E87' && LA2_0<='\u0E88')||LA2_0=='\u0E8A'||LA2_0=='\u0E8D'||(LA2_0>='\u0E94' && LA2_0<='\u0E97')||(LA2_0>='\u0E99' && LA2_0<='\u0E9F')||(LA2_0>='\u0EA1' && LA2_0<='\u0EA3')||LA2_0=='\u0EA5'||LA2_0=='\u0EA7'||(LA2_0>='\u0EAA' && LA2_0<='\u0EAB')||(LA2_0>='\u0EAD' && LA2_0<='\u0EB0')||(LA2_0>='\u0EB2' && LA2_0<='\u0EB3')||LA2_0=='\u0EBD'||(LA2_0>='\u0EC0' && LA2_0<='\u0EC4')||LA2_0=='\u0EC6'||(LA2_0>='\u0EDC' && LA2_0<='\u0EDD')||LA2_0=='\u0F00'||(LA2_0>='\u0F40' && LA2_0<='\u0F47')||(LA2_0>='\u0F49' && LA2_0<='\u0F6A')||(LA2_0>='\u0F88' && LA2_0<='\u0F8B')||(LA2_0>='\u1000' && LA2_0<='\u1021')||(LA2_0>='\u1023' && LA2_0<='\u1027')||(LA2_0>='\u1029' && LA2_0<='\u102A')||(LA2_0>='\u1050' && LA2_0<='\u1055')||(LA2_0>='\u10A0' && LA2_0<='\u10C5')||(LA2_0>='\u10D0' && LA2_0<='\u10F8')||(LA2_0>='\u1100' && LA2_0<='\u1159')||(LA2_0>='\u115F' && LA2_0<='\u11A2')||(LA2_0>='\u11A8' && LA2_0<='\u11F9')||(LA2_0>='\u1200' && LA2_0<='\u1206')||(LA2_0>='\u1208' && LA2_0<='\u1246')||LA2_0=='\u1248'||(LA2_0>='\u124A' && LA2_0<='\u124D')||(LA2_0>='\u1250' && LA2_0<='\u1256')||LA2_0=='\u1258'||(LA2_0>='\u125A' && LA2_0<='\u125D')||(LA2_0>='\u1260' && LA2_0<='\u1286')||LA2_0=='\u1288'||(LA2_0>='\u128A' && LA2_0<='\u128D')||(LA2_0>='\u1290' && LA2_0<='\u12AE')||LA2_0=='\u12B0'||(LA2_0>='\u12B2' && LA2_0<='\u12B5')||(LA2_0>='\u12B8' && LA2_0<='\u12BE')||LA2_0=='\u12C0'||(LA2_0>='\u12C2' && LA2_0<='\u12C5')||(LA2_0>='\u12C8' && LA2_0<='\u12CE')||(LA2_0>='\u12D0' && LA2_0<='\u12D6')||(LA2_0>='\u12D8' && LA2_0<='\u12EE')||(LA2_0>='\u12F0' && LA2_0<='\u130E')||LA2_0=='\u1310'||(LA2_0>='\u1312' && LA2_0<='\u1315')||(LA2_0>='\u1318' && LA2_0<='\u131E')||(LA2_0>='\u1320' && LA2_0<='\u1346')||(LA2_0>='\u1348' && LA2_0<='\u135A')||(LA2_0>='\u13A0' && LA2_0<='\u13F4')||(LA2_0>='\u1401' && LA2_0<='\u166C')||(LA2_0>='\u166F' && LA2_0<='\u1676')||(LA2_0>='\u1681' && LA2_0<='\u169A')||(LA2_0>='\u16A0' && LA2_0<='\u16EA')||(LA2_0>='\u16EE' && LA2_0<='\u16F0')||(LA2_0>='\u1700' && LA2_0<='\u170C')||(LA2_0>='\u170E' && LA2_0<='\u1711')||(LA2_0>='\u1720' && LA2_0<='\u1731')||(LA2_0>='\u1740' && LA2_0<='\u1751')||(LA2_0>='\u1760' && LA2_0<='\u176C')||(LA2_0>='\u176E' && LA2_0<='\u1770')||(LA2_0>='\u1780' && LA2_0<='\u17B3')||LA2_0=='\u17D7'||(LA2_0>='\u17DB' && LA2_0<='\u17DC')||(LA2_0>='\u1820' && LA2_0<='\u1877')||(LA2_0>='\u1880' && LA2_0<='\u18A8')||(LA2_0>='\u1900' && LA2_0<='\u191C')||(LA2_0>='\u1950' && LA2_0<='\u196D')||(LA2_0>='\u1970' && LA2_0<='\u1974')||(LA2_0>='\u1D00' && LA2_0<='\u1D6B')||(LA2_0>='\u1E00' && LA2_0<='\u1E9B')||(LA2_0>='\u1EA0' && LA2_0<='\u1EF9')||(LA2_0>='\u1F00' && LA2_0<='\u1F15')||(LA2_0>='\u1F18' && LA2_0<='\u1F1D')||(LA2_0>='\u1F20' && LA2_0<='\u1F45')||(LA2_0>='\u1F48' && LA2_0<='\u1F4D')||(LA2_0>='\u1F50' && LA2_0<='\u1F57')||LA2_0=='\u1F59'||LA2_0=='\u1F5B'||LA2_0=='\u1F5D'||(LA2_0>='\u1F5F' && LA2_0<='\u1F7D')||(LA2_0>='\u1F80' && LA2_0<='\u1FB4')||(LA2_0>='\u1FB6' && LA2_0<='\u1FBC')||LA2_0=='\u1FBE'||(LA2_0>='\u1FC2' && LA2_0<='\u1FC4')||(LA2_0>='\u1FC6' && LA2_0<='\u1FCC')||(LA2_0>='\u1FD0' && LA2_0<='\u1FD3')||(LA2_0>='\u1FD6' && LA2_0<='\u1FDB')||(LA2_0>='\u1FE0' && LA2_0<='\u1FEC')||(LA2_0>='\u1FF2' && LA2_0<='\u1FF4')||(LA2_0>='\u1FF6' && LA2_0<='\u1FFC')||(LA2_0>='\u203F' && LA2_0<='\u2040')||LA2_0=='\u2054'||LA2_0=='\u2071'||LA2_0=='\u207F'||(LA2_0>='\u20A0' && LA2_0<='\u20B1')||LA2_0=='\u2102'||LA2_0=='\u2107'||(LA2_0>='\u210A' && LA2_0<='\u2113')||LA2_0=='\u2115'||(LA2_0>='\u2119' && LA2_0<='\u211D')||LA2_0=='\u2124'||LA2_0=='\u2126'||LA2_0=='\u2128'||(LA2_0>='\u212A' && LA2_0<='\u212D')||(LA2_0>='\u212F' && LA2_0<='\u2131')||(LA2_0>='\u2133' && LA2_0<='\u2139')||(LA2_0>='\u213D' && LA2_0<='\u213F')||(LA2_0>='\u2145' && LA2_0<='\u2149')||(LA2_0>='\u2160' && LA2_0<='\u2183')||(LA2_0>='\u3005' && LA2_0<='\u3007')||(LA2_0>='\u3021' && LA2_0<='\u3029')||(LA2_0>='\u3031' && LA2_0<='\u3035')||(LA2_0>='\u3038' && LA2_0<='\u303C')||(LA2_0>='\u3041' && LA2_0<='\u3096')||(LA2_0>='\u309D' && LA2_0<='\u309F')||(LA2_0>='\u30A1' && LA2_0<='\u30FF')||(LA2_0>='\u3105' && LA2_0<='\u312C')||(LA2_0>='\u3131' && LA2_0<='\u318E')||(LA2_0>='\u31A0' && LA2_0<='\u31B7')||(LA2_0>='\u31F0' && LA2_0<='\u31FF')||(LA2_0>='\u3400' && LA2_0<='\u4DB5')||(LA2_0>='\u4E00' && LA2_0<='\u9FA5')||(LA2_0>='\uA000' && LA2_0<='\uA48C')||(LA2_0>='\uAC00' && LA2_0<='\uD7A3')||(LA2_0>='\uF900' && LA2_0<='\uFA2D')||(LA2_0>='\uFA30' && LA2_0<='\uFA6A')||(LA2_0>='\uFB00' && LA2_0<='\uFB06')||(LA2_0>='\uFB13' && LA2_0<='\uFB17')||LA2_0=='\uFB1D'||(LA2_0>='\uFB1F' && LA2_0<='\uFB28')||(LA2_0>='\uFB2A' && LA2_0<='\uFB36')||(LA2_0>='\uFB38' && LA2_0<='\uFB3C')||LA2_0=='\uFB3E'||(LA2_0>='\uFB40' && LA2_0<='\uFB41')||(LA2_0>='\uFB43' && LA2_0<='\uFB44')||(LA2_0>='\uFB46' && LA2_0<='\uFBB1')||(LA2_0>='\uFBD3' && LA2_0<='\uFD3D')||(LA2_0>='\uFD50' && LA2_0<='\uFD8F')||(LA2_0>='\uFD92' && LA2_0<='\uFDC7')||(LA2_0>='\uFDF0' && LA2_0<='\uFDFC')||(LA2_0>='\uFE33' && LA2_0<='\uFE34')||(LA2_0>='\uFE4D' && LA2_0<='\uFE4F')||LA2_0=='\uFE69'||(LA2_0>='\uFE70' && LA2_0<='\uFE74')||(LA2_0>='\uFE76' && LA2_0<='\uFEFC')||LA2_0=='\uFF04'||(LA2_0>='\uFF21' && LA2_0<='\uFF3A')||LA2_0=='\uFF3F'||(LA2_0>='\uFF41' && LA2_0<='\uFF5A')||(LA2_0>='\uFF65' && LA2_0<='\uFFBE')||(LA2_0>='\uFFC2' && LA2_0<='\uFFC7')||(LA2_0>='\uFFCA' && LA2_0<='\uFFCF')||(LA2_0>='\uFFD2' && LA2_0<='\uFFD7')||(LA2_0>='\uFFDA' && LA2_0<='\uFFDC')||(LA2_0>='\uFFE0' && LA2_0<='\uFFE1')||(LA2_0>='\uFFE5' && LA2_0<='\uFFE6')) ) {
alt2=1;
}
else if ( (LA2_0=='\\') ) {
alt2=2;
}
else {
NoViableAltException nvae =
new NoViableAltException("", 2, 0, input);
throw nvae;
}
switch (alt2) {
case 1 :
// InternalSARL.g:48763:17: RULE_IDENTIFIER_START
{
mRULE_IDENTIFIER_START();
}
break;
case 2 :
// InternalSARL.g:48763:39: RULE_UNICODE_ESCAPE
{
mRULE_UNICODE_ESCAPE();
}
break;
}
// InternalSARL.g:48763:60: ( RULE_IDENTIFIER_PART | RULE_UNICODE_ESCAPE )*
loop3:
do {
int alt3=3;
int LA3_0 = input.LA(1);
if ( ((LA3_0>='\u0000' && LA3_0<='\b')||(LA3_0>='\u000E' && LA3_0<='\u001B')||LA3_0=='$'||(LA3_0>='0' && LA3_0<='9')||(LA3_0>='A' && LA3_0<='Z')||LA3_0=='_'||(LA3_0>='a' && LA3_0<='z')||(LA3_0>='\u007F' && LA3_0<='\u009F')||(LA3_0>='\u00A2' && LA3_0<='\u00A5')||LA3_0=='\u00AA'||LA3_0=='\u00AD'||LA3_0=='\u00B5'||LA3_0=='\u00BA'||(LA3_0>='\u00C0' && LA3_0<='\u00D6')||(LA3_0>='\u00D8' && LA3_0<='\u00F6')||(LA3_0>='\u00F8' && LA3_0<='\u0236')||(LA3_0>='\u0250' && LA3_0<='\u02C1')||(LA3_0>='\u02C6' && LA3_0<='\u02D1')||(LA3_0>='\u02E0' && LA3_0<='\u02E4')||LA3_0=='\u02EE'||(LA3_0>='\u0300' && LA3_0<='\u0357')||(LA3_0>='\u035D' && LA3_0<='\u036F')||LA3_0=='\u037A'||LA3_0=='\u0386'||(LA3_0>='\u0388' && LA3_0<='\u038A')||LA3_0=='\u038C'||(LA3_0>='\u038E' && LA3_0<='\u03A1')||(LA3_0>='\u03A3' && LA3_0<='\u03CE')||(LA3_0>='\u03D0' && LA3_0<='\u03F5')||(LA3_0>='\u03F7' && LA3_0<='\u03FB')||(LA3_0>='\u0400' && LA3_0<='\u0481')||(LA3_0>='\u0483' && LA3_0<='\u0486')||(LA3_0>='\u048A' && LA3_0<='\u04CE')||(LA3_0>='\u04D0' && LA3_0<='\u04F5')||(LA3_0>='\u04F8' && LA3_0<='\u04F9')||(LA3_0>='\u0500' && LA3_0<='\u050F')||(LA3_0>='\u0531' && LA3_0<='\u0556')||LA3_0=='\u0559'||(LA3_0>='\u0561' && LA3_0<='\u0587')||(LA3_0>='\u0591' && LA3_0<='\u05A1')||(LA3_0>='\u05A3' && LA3_0<='\u05B9')||(LA3_0>='\u05BB' && LA3_0<='\u05BD')||LA3_0=='\u05BF'||(LA3_0>='\u05C1' && LA3_0<='\u05C2')||LA3_0=='\u05C4'||(LA3_0>='\u05D0' && LA3_0<='\u05EA')||(LA3_0>='\u05F0' && LA3_0<='\u05F2')||(LA3_0>='\u0600' && LA3_0<='\u0603')||(LA3_0>='\u0610' && LA3_0<='\u0615')||(LA3_0>='\u0621' && LA3_0<='\u063A')||(LA3_0>='\u0640' && LA3_0<='\u0658')||(LA3_0>='\u0660' && LA3_0<='\u0669')||(LA3_0>='\u066E' && LA3_0<='\u06D3')||(LA3_0>='\u06D5' && LA3_0<='\u06DD')||(LA3_0>='\u06DF' && LA3_0<='\u06E8')||(LA3_0>='\u06EA' && LA3_0<='\u06FC')||LA3_0=='\u06FF'||(LA3_0>='\u070F' && LA3_0<='\u074A')||(LA3_0>='\u074D' && LA3_0<='\u074F')||(LA3_0>='\u0780' && LA3_0<='\u07B1')||(LA3_0>='\u0901' && LA3_0<='\u0939')||(LA3_0>='\u093C' && LA3_0<='\u094D')||(LA3_0>='\u0950' && LA3_0<='\u0954')||(LA3_0>='\u0958' && LA3_0<='\u0963')||(LA3_0>='\u0966' && LA3_0<='\u096F')||(LA3_0>='\u0981' && LA3_0<='\u0983')||(LA3_0>='\u0985' && LA3_0<='\u098C')||(LA3_0>='\u098F' && LA3_0<='\u0990')||(LA3_0>='\u0993' && LA3_0<='\u09A8')||(LA3_0>='\u09AA' && LA3_0<='\u09B0')||LA3_0=='\u09B2'||(LA3_0>='\u09B6' && LA3_0<='\u09B9')||(LA3_0>='\u09BC' && LA3_0<='\u09C4')||(LA3_0>='\u09C7' && LA3_0<='\u09C8')||(LA3_0>='\u09CB' && LA3_0<='\u09CD')||LA3_0=='\u09D7'||(LA3_0>='\u09DC' && LA3_0<='\u09DD')||(LA3_0>='\u09DF' && LA3_0<='\u09E3')||(LA3_0>='\u09E6' && LA3_0<='\u09F3')||(LA3_0>='\u0A01' && LA3_0<='\u0A03')||(LA3_0>='\u0A05' && LA3_0<='\u0A0A')||(LA3_0>='\u0A0F' && LA3_0<='\u0A10')||(LA3_0>='\u0A13' && LA3_0<='\u0A28')||(LA3_0>='\u0A2A' && LA3_0<='\u0A30')||(LA3_0>='\u0A32' && LA3_0<='\u0A33')||(LA3_0>='\u0A35' && LA3_0<='\u0A36')||(LA3_0>='\u0A38' && LA3_0<='\u0A39')||LA3_0=='\u0A3C'||(LA3_0>='\u0A3E' && LA3_0<='\u0A42')||(LA3_0>='\u0A47' && LA3_0<='\u0A48')||(LA3_0>='\u0A4B' && LA3_0<='\u0A4D')||(LA3_0>='\u0A59' && LA3_0<='\u0A5C')||LA3_0=='\u0A5E'||(LA3_0>='\u0A66' && LA3_0<='\u0A74')||(LA3_0>='\u0A81' && LA3_0<='\u0A83')||(LA3_0>='\u0A85' && LA3_0<='\u0A8D')||(LA3_0>='\u0A8F' && LA3_0<='\u0A91')||(LA3_0>='\u0A93' && LA3_0<='\u0AA8')||(LA3_0>='\u0AAA' && LA3_0<='\u0AB0')||(LA3_0>='\u0AB2' && LA3_0<='\u0AB3')||(LA3_0>='\u0AB5' && LA3_0<='\u0AB9')||(LA3_0>='\u0ABC' && LA3_0<='\u0AC5')||(LA3_0>='\u0AC7' && LA3_0<='\u0AC9')||(LA3_0>='\u0ACB' && LA3_0<='\u0ACD')||LA3_0=='\u0AD0'||(LA3_0>='\u0AE0' && LA3_0<='\u0AE3')||(LA3_0>='\u0AE6' && LA3_0<='\u0AEF')||LA3_0=='\u0AF1'||(LA3_0>='\u0B01' && LA3_0<='\u0B03')||(LA3_0>='\u0B05' && LA3_0<='\u0B0C')||(LA3_0>='\u0B0F' && LA3_0<='\u0B10')||(LA3_0>='\u0B13' && LA3_0<='\u0B28')||(LA3_0>='\u0B2A' && LA3_0<='\u0B30')||(LA3_0>='\u0B32' && LA3_0<='\u0B33')||(LA3_0>='\u0B35' && LA3_0<='\u0B39')||(LA3_0>='\u0B3C' && LA3_0<='\u0B43')||(LA3_0>='\u0B47' && LA3_0<='\u0B48')||(LA3_0>='\u0B4B' && LA3_0<='\u0B4D')||(LA3_0>='\u0B56' && LA3_0<='\u0B57')||(LA3_0>='\u0B5C' && LA3_0<='\u0B5D')||(LA3_0>='\u0B5F' && LA3_0<='\u0B61')||(LA3_0>='\u0B66' && LA3_0<='\u0B6F')||LA3_0=='\u0B71'||(LA3_0>='\u0B82' && LA3_0<='\u0B83')||(LA3_0>='\u0B85' && LA3_0<='\u0B8A')||(LA3_0>='\u0B8E' && LA3_0<='\u0B90')||(LA3_0>='\u0B92' && LA3_0<='\u0B95')||(LA3_0>='\u0B99' && LA3_0<='\u0B9A')||LA3_0=='\u0B9C'||(LA3_0>='\u0B9E' && LA3_0<='\u0B9F')||(LA3_0>='\u0BA3' && LA3_0<='\u0BA4')||(LA3_0>='\u0BA8' && LA3_0<='\u0BAA')||(LA3_0>='\u0BAE' && LA3_0<='\u0BB5')||(LA3_0>='\u0BB7' && LA3_0<='\u0BB9')||(LA3_0>='\u0BBE' && LA3_0<='\u0BC2')||(LA3_0>='\u0BC6' && LA3_0<='\u0BC8')||(LA3_0>='\u0BCA' && LA3_0<='\u0BCD')||LA3_0=='\u0BD7'||(LA3_0>='\u0BE7' && LA3_0<='\u0BEF')||LA3_0=='\u0BF9'||(LA3_0>='\u0C01' && LA3_0<='\u0C03')||(LA3_0>='\u0C05' && LA3_0<='\u0C0C')||(LA3_0>='\u0C0E' && LA3_0<='\u0C10')||(LA3_0>='\u0C12' && LA3_0<='\u0C28')||(LA3_0>='\u0C2A' && LA3_0<='\u0C33')||(LA3_0>='\u0C35' && LA3_0<='\u0C39')||(LA3_0>='\u0C3E' && LA3_0<='\u0C44')||(LA3_0>='\u0C46' && LA3_0<='\u0C48')||(LA3_0>='\u0C4A' && LA3_0<='\u0C4D')||(LA3_0>='\u0C55' && LA3_0<='\u0C56')||(LA3_0>='\u0C60' && LA3_0<='\u0C61')||(LA3_0>='\u0C66' && LA3_0<='\u0C6F')||(LA3_0>='\u0C82' && LA3_0<='\u0C83')||(LA3_0>='\u0C85' && LA3_0<='\u0C8C')||(LA3_0>='\u0C8E' && LA3_0<='\u0C90')||(LA3_0>='\u0C92' && LA3_0<='\u0CA8')||(LA3_0>='\u0CAA' && LA3_0<='\u0CB3')||(LA3_0>='\u0CB5' && LA3_0<='\u0CB9')||(LA3_0>='\u0CBC' && LA3_0<='\u0CC4')||(LA3_0>='\u0CC6' && LA3_0<='\u0CC8')||(LA3_0>='\u0CCA' && LA3_0<='\u0CCD')||(LA3_0>='\u0CD5' && LA3_0<='\u0CD6')||LA3_0=='\u0CDE'||(LA3_0>='\u0CE0' && LA3_0<='\u0CE1')||(LA3_0>='\u0CE6' && LA3_0<='\u0CEF')||(LA3_0>='\u0D02' && LA3_0<='\u0D03')||(LA3_0>='\u0D05' && LA3_0<='\u0D0C')||(LA3_0>='\u0D0E' && LA3_0<='\u0D10')||(LA3_0>='\u0D12' && LA3_0<='\u0D28')||(LA3_0>='\u0D2A' && LA3_0<='\u0D39')||(LA3_0>='\u0D3E' && LA3_0<='\u0D43')||(LA3_0>='\u0D46' && LA3_0<='\u0D48')||(LA3_0>='\u0D4A' && LA3_0<='\u0D4D')||LA3_0=='\u0D57'||(LA3_0>='\u0D60' && LA3_0<='\u0D61')||(LA3_0>='\u0D66' && LA3_0<='\u0D6F')||(LA3_0>='\u0D82' && LA3_0<='\u0D83')||(LA3_0>='\u0D85' && LA3_0<='\u0D96')||(LA3_0>='\u0D9A' && LA3_0<='\u0DB1')||(LA3_0>='\u0DB3' && LA3_0<='\u0DBB')||LA3_0=='\u0DBD'||(LA3_0>='\u0DC0' && LA3_0<='\u0DC6')||LA3_0=='\u0DCA'||(LA3_0>='\u0DCF' && LA3_0<='\u0DD4')||LA3_0=='\u0DD6'||(LA3_0>='\u0DD8' && LA3_0<='\u0DDF')||(LA3_0>='\u0DF2' && LA3_0<='\u0DF3')||(LA3_0>='\u0E01' && LA3_0<='\u0E3A')||(LA3_0>='\u0E3F' && LA3_0<='\u0E4E')||(LA3_0>='\u0E50' && LA3_0<='\u0E59')||(LA3_0>='\u0E81' && LA3_0<='\u0E82')||LA3_0=='\u0E84'||(LA3_0>='\u0E87' && LA3_0<='\u0E88')||LA3_0=='\u0E8A'||LA3_0=='\u0E8D'||(LA3_0>='\u0E94' && LA3_0<='\u0E97')||(LA3_0>='\u0E99' && LA3_0<='\u0E9F')||(LA3_0>='\u0EA1' && LA3_0<='\u0EA3')||LA3_0=='\u0EA5'||LA3_0=='\u0EA7'||(LA3_0>='\u0EAA' && LA3_0<='\u0EAB')||(LA3_0>='\u0EAD' && LA3_0<='\u0EB9')||(LA3_0>='\u0EBB' && LA3_0<='\u0EBD')||(LA3_0>='\u0EC0' && LA3_0<='\u0EC4')||LA3_0=='\u0EC6'||(LA3_0>='\u0EC8' && LA3_0<='\u0ECD')||(LA3_0>='\u0ED0' && LA3_0<='\u0ED9')||(LA3_0>='\u0EDC' && LA3_0<='\u0EDD')||LA3_0=='\u0F00'||(LA3_0>='\u0F18' && LA3_0<='\u0F19')||(LA3_0>='\u0F20' && LA3_0<='\u0F29')||LA3_0=='\u0F35'||LA3_0=='\u0F37'||LA3_0=='\u0F39'||(LA3_0>='\u0F3E' && LA3_0<='\u0F47')||(LA3_0>='\u0F49' && LA3_0<='\u0F6A')||(LA3_0>='\u0F71' && LA3_0<='\u0F84')||(LA3_0>='\u0F86' && LA3_0<='\u0F8B')||(LA3_0>='\u0F90' && LA3_0<='\u0F97')||(LA3_0>='\u0F99' && LA3_0<='\u0FBC')||LA3_0=='\u0FC6'||(LA3_0>='\u1000' && LA3_0<='\u1021')||(LA3_0>='\u1023' && LA3_0<='\u1027')||(LA3_0>='\u1029' && LA3_0<='\u102A')||(LA3_0>='\u102C' && LA3_0<='\u1032')||(LA3_0>='\u1036' && LA3_0<='\u1039')||(LA3_0>='\u1040' && LA3_0<='\u1049')||(LA3_0>='\u1050' && LA3_0<='\u1059')||(LA3_0>='\u10A0' && LA3_0<='\u10C5')||(LA3_0>='\u10D0' && LA3_0<='\u10F8')||(LA3_0>='\u1100' && LA3_0<='\u1159')||(LA3_0>='\u115F' && LA3_0<='\u11A2')||(LA3_0>='\u11A8' && LA3_0<='\u11F9')||(LA3_0>='\u1200' && LA3_0<='\u1206')||(LA3_0>='\u1208' && LA3_0<='\u1246')||LA3_0=='\u1248'||(LA3_0>='\u124A' && LA3_0<='\u124D')||(LA3_0>='\u1250' && LA3_0<='\u1256')||LA3_0=='\u1258'||(LA3_0>='\u125A' && LA3_0<='\u125D')||(LA3_0>='\u1260' && LA3_0<='\u1286')||LA3_0=='\u1288'||(LA3_0>='\u128A' && LA3_0<='\u128D')||(LA3_0>='\u1290' && LA3_0<='\u12AE')||LA3_0=='\u12B0'||(LA3_0>='\u12B2' && LA3_0<='\u12B5')||(LA3_0>='\u12B8' && LA3_0<='\u12BE')||LA3_0=='\u12C0'||(LA3_0>='\u12C2' && LA3_0<='\u12C5')||(LA3_0>='\u12C8' && LA3_0<='\u12CE')||(LA3_0>='\u12D0' && LA3_0<='\u12D6')||(LA3_0>='\u12D8' && LA3_0<='\u12EE')||(LA3_0>='\u12F0' && LA3_0<='\u130E')||LA3_0=='\u1310'||(LA3_0>='\u1312' && LA3_0<='\u1315')||(LA3_0>='\u1318' && LA3_0<='\u131E')||(LA3_0>='\u1320' && LA3_0<='\u1346')||(LA3_0>='\u1348' && LA3_0<='\u135A')||(LA3_0>='\u1369' && LA3_0<='\u1371')||(LA3_0>='\u13A0' && LA3_0<='\u13F4')||(LA3_0>='\u1401' && LA3_0<='\u166C')||(LA3_0>='\u166F' && LA3_0<='\u1676')||(LA3_0>='\u1681' && LA3_0<='\u169A')||(LA3_0>='\u16A0' && LA3_0<='\u16EA')||(LA3_0>='\u16EE' && LA3_0<='\u16F0')||(LA3_0>='\u1700' && LA3_0<='\u170C')||(LA3_0>='\u170E' && LA3_0<='\u1714')||(LA3_0>='\u1720' && LA3_0<='\u1734')||(LA3_0>='\u1740' && LA3_0<='\u1753')||(LA3_0>='\u1760' && LA3_0<='\u176C')||(LA3_0>='\u176E' && LA3_0<='\u1770')||(LA3_0>='\u1772' && LA3_0<='\u1773')||(LA3_0>='\u1780' && LA3_0<='\u17D3')||LA3_0=='\u17D7'||(LA3_0>='\u17DB' && LA3_0<='\u17DD')||(LA3_0>='\u17E0' && LA3_0<='\u17E9')||(LA3_0>='\u180B' && LA3_0<='\u180D')||(LA3_0>='\u1810' && LA3_0<='\u1819')||(LA3_0>='\u1820' && LA3_0<='\u1877')||(LA3_0>='\u1880' && LA3_0<='\u18A9')||(LA3_0>='\u1900' && LA3_0<='\u191C')||(LA3_0>='\u1920' && LA3_0<='\u192B')||(LA3_0>='\u1930' && LA3_0<='\u193B')||(LA3_0>='\u1946' && LA3_0<='\u196D')||(LA3_0>='\u1970' && LA3_0<='\u1974')||(LA3_0>='\u1D00' && LA3_0<='\u1D6B')||(LA3_0>='\u1E00' && LA3_0<='\u1E9B')||(LA3_0>='\u1EA0' && LA3_0<='\u1EF9')||(LA3_0>='\u1F00' && LA3_0<='\u1F15')||(LA3_0>='\u1F18' && LA3_0<='\u1F1D')||(LA3_0>='\u1F20' && LA3_0<='\u1F45')||(LA3_0>='\u1F48' && LA3_0<='\u1F4D')||(LA3_0>='\u1F50' && LA3_0<='\u1F57')||LA3_0=='\u1F59'||LA3_0=='\u1F5B'||LA3_0=='\u1F5D'||(LA3_0>='\u1F5F' && LA3_0<='\u1F7D')||(LA3_0>='\u1F80' && LA3_0<='\u1FB4')||(LA3_0>='\u1FB6' && LA3_0<='\u1FBC')||LA3_0=='\u1FBE'||(LA3_0>='\u1FC2' && LA3_0<='\u1FC4')||(LA3_0>='\u1FC6' && LA3_0<='\u1FCC')||(LA3_0>='\u1FD0' && LA3_0<='\u1FD3')||(LA3_0>='\u1FD6' && LA3_0<='\u1FDB')||(LA3_0>='\u1FE0' && LA3_0<='\u1FEC')||(LA3_0>='\u1FF2' && LA3_0<='\u1FF4')||(LA3_0>='\u1FF6' && LA3_0<='\u1FFC')||(LA3_0>='\u200C' && LA3_0<='\u200F')||(LA3_0>='\u202A' && LA3_0<='\u202E')||(LA3_0>='\u203F' && LA3_0<='\u2040')||LA3_0=='\u2054'||(LA3_0>='\u2060' && LA3_0<='\u2063')||(LA3_0>='\u206A' && LA3_0<='\u206F')||LA3_0=='\u2071'||LA3_0=='\u207F'||(LA3_0>='\u20A0' && LA3_0<='\u20B1')||(LA3_0>='\u20D0' && LA3_0<='\u20DC')||LA3_0=='\u20E1'||(LA3_0>='\u20E5' && LA3_0<='\u20EA')||LA3_0=='\u2102'||LA3_0=='\u2107'||(LA3_0>='\u210A' && LA3_0<='\u2113')||LA3_0=='\u2115'||(LA3_0>='\u2119' && LA3_0<='\u211D')||LA3_0=='\u2124'||LA3_0=='\u2126'||LA3_0=='\u2128'||(LA3_0>='\u212A' && LA3_0<='\u212D')||(LA3_0>='\u212F' && LA3_0<='\u2131')||(LA3_0>='\u2133' && LA3_0<='\u2139')||(LA3_0>='\u213D' && LA3_0<='\u213F')||(LA3_0>='\u2145' && LA3_0<='\u2149')||(LA3_0>='\u2160' && LA3_0<='\u2183')||(LA3_0>='\u3005' && LA3_0<='\u3007')||(LA3_0>='\u3021' && LA3_0<='\u302F')||(LA3_0>='\u3031' && LA3_0<='\u3035')||(LA3_0>='\u3038' && LA3_0<='\u303C')||(LA3_0>='\u3041' && LA3_0<='\u3096')||(LA3_0>='\u3099' && LA3_0<='\u309A')||(LA3_0>='\u309D' && LA3_0<='\u309F')||(LA3_0>='\u30A1' && LA3_0<='\u30FF')||(LA3_0>='\u3105' && LA3_0<='\u312C')||(LA3_0>='\u3131' && LA3_0<='\u318E')||(LA3_0>='\u31A0' && LA3_0<='\u31B7')||(LA3_0>='\u31F0' && LA3_0<='\u31FF')||(LA3_0>='\u3400' && LA3_0<='\u4DB5')||(LA3_0>='\u4E00' && LA3_0<='\u9FA5')||(LA3_0>='\uA000' && LA3_0<='\uA48C')||(LA3_0>='\uAC00' && LA3_0<='\uD7A3')||(LA3_0>='\uF900' && LA3_0<='\uFA2D')||(LA3_0>='\uFA30' && LA3_0<='\uFA6A')||(LA3_0>='\uFB00' && LA3_0<='\uFB06')||(LA3_0>='\uFB13' && LA3_0<='\uFB17')||(LA3_0>='\uFB1D' && LA3_0<='\uFB28')||(LA3_0>='\uFB2A' && LA3_0<='\uFB36')||(LA3_0>='\uFB38' && LA3_0<='\uFB3C')||LA3_0=='\uFB3E'||(LA3_0>='\uFB40' && LA3_0<='\uFB41')||(LA3_0>='\uFB43' && LA3_0<='\uFB44')||(LA3_0>='\uFB46' && LA3_0<='\uFBB1')||(LA3_0>='\uFBD3' && LA3_0<='\uFD3D')||(LA3_0>='\uFD50' && LA3_0<='\uFD8F')||(LA3_0>='\uFD92' && LA3_0<='\uFDC7')||(LA3_0>='\uFDF0' && LA3_0<='\uFDFC')||(LA3_0>='\uFE00' && LA3_0<='\uFE0F')||(LA3_0>='\uFE20' && LA3_0<='\uFE23')||(LA3_0>='\uFE33' && LA3_0<='\uFE34')||(LA3_0>='\uFE4D' && LA3_0<='\uFE4F')||LA3_0=='\uFE69'||(LA3_0>='\uFE70' && LA3_0<='\uFE74')||(LA3_0>='\uFE76' && LA3_0<='\uFEFC')||LA3_0=='\uFEFF'||LA3_0=='\uFF04'||(LA3_0>='\uFF10' && LA3_0<='\uFF19')||(LA3_0>='\uFF21' && LA3_0<='\uFF3A')||LA3_0=='\uFF3F'||(LA3_0>='\uFF41' && LA3_0<='\uFF5A')||(LA3_0>='\uFF65' && LA3_0<='\uFFBE')||(LA3_0>='\uFFC2' && LA3_0<='\uFFC7')||(LA3_0>='\uFFCA' && LA3_0<='\uFFCF')||(LA3_0>='\uFFD2' && LA3_0<='\uFFD7')||(LA3_0>='\uFFDA' && LA3_0<='\uFFDC')||(LA3_0>='\uFFE0' && LA3_0<='\uFFE1')||(LA3_0>='\uFFE5' && LA3_0<='\uFFE6')||(LA3_0>='\uFFF9' && LA3_0<='\uFFFB')) ) {
alt3=1;
}
else if ( (LA3_0=='\\') ) {
alt3=2;
}
switch (alt3) {
case 1 :
// InternalSARL.g:48763:61: RULE_IDENTIFIER_PART
{
mRULE_IDENTIFIER_PART();
}
break;
case 2 :
// InternalSARL.g:48763:82: RULE_UNICODE_ESCAPE
{
mRULE_UNICODE_ESCAPE();
}
break;
default :
break loop3;
}
} while (true);
}
state.type = _type;
state.channel = _channel;
}
finally {
}
} } | public class class_name {
public final void mRULE_ID() throws RecognitionException {
try {
int _type = RULE_ID;
int _channel = DEFAULT_TOKEN_CHANNEL;
// InternalSARL.g:48763:9: ( ( '^' )? ( RULE_IDENTIFIER_START | RULE_UNICODE_ESCAPE ) ( RULE_IDENTIFIER_PART | RULE_UNICODE_ESCAPE )* )
// InternalSARL.g:48763:11: ( '^' )? ( RULE_IDENTIFIER_START | RULE_UNICODE_ESCAPE ) ( RULE_IDENTIFIER_PART | RULE_UNICODE_ESCAPE )*
{
// InternalSARL.g:48763:11: ( '^' )?
int alt1=2;
int LA1_0 = input.LA(1);
if ( (LA1_0=='^') ) {
alt1=1; // depends on control dependency: [if], data = [none]
}
switch (alt1) {
case 1 :
// InternalSARL.g:48763:11: '^'
{
match('^');
}
break;
}
// InternalSARL.g:48763:16: ( RULE_IDENTIFIER_START | RULE_UNICODE_ESCAPE )
int alt2=2;
int LA2_0 = input.LA(1);
if ( (LA2_0=='$'||(LA2_0>='A' && LA2_0<='Z')||LA2_0=='_'||(LA2_0>='a' && LA2_0<='z')||(LA2_0>='\u00A2' && LA2_0<='\u00A5')||LA2_0=='\u00AA'||LA2_0=='\u00B5'||LA2_0=='\u00BA'||(LA2_0>='\u00C0' && LA2_0<='\u00D6')||(LA2_0>='\u00D8' && LA2_0<='\u00F6')||(LA2_0>='\u00F8' && LA2_0<='\u0236')||(LA2_0>='\u0250' && LA2_0<='\u02C1')||(LA2_0>='\u02C6' && LA2_0<='\u02D1')||(LA2_0>='\u02E0' && LA2_0<='\u02E4')||LA2_0=='\u02EE'||LA2_0=='\u037A'||LA2_0=='\u0386'||(LA2_0>='\u0388' && LA2_0<='\u038A')||LA2_0=='\u038C'||(LA2_0>='\u038E' && LA2_0<='\u03A1')||(LA2_0>='\u03A3' && LA2_0<='\u03CE')||(LA2_0>='\u03D0' && LA2_0<='\u03F5')||(LA2_0>='\u03F7' && LA2_0<='\u03FB')||(LA2_0>='\u0400' && LA2_0<='\u0481')||(LA2_0>='\u048A' && LA2_0<='\u04CE')||(LA2_0>='\u04D0' && LA2_0<='\u04F5')||(LA2_0>='\u04F8' && LA2_0<='\u04F9')||(LA2_0>='\u0500' && LA2_0<='\u050F')||(LA2_0>='\u0531' && LA2_0<='\u0556')||LA2_0=='\u0559'||(LA2_0>='\u0561' && LA2_0<='\u0587')||(LA2_0>='\u05D0' && LA2_0<='\u05EA')||(LA2_0>='\u05F0' && LA2_0<='\u05F2')||(LA2_0>='\u0621' && LA2_0<='\u063A')||(LA2_0>='\u0640' && LA2_0<='\u064A')||(LA2_0>='\u066E' && LA2_0<='\u066F')||(LA2_0>='\u0671' && LA2_0<='\u06D3')||LA2_0=='\u06D5'||(LA2_0>='\u06E5' && LA2_0<='\u06E6')||(LA2_0>='\u06EE' && LA2_0<='\u06EF')||(LA2_0>='\u06FA' && LA2_0<='\u06FC')||LA2_0=='\u06FF'||LA2_0=='\u0710'||(LA2_0>='\u0712' && LA2_0<='\u072F')||(LA2_0>='\u074D' && LA2_0<='\u074F')||(LA2_0>='\u0780' && LA2_0<='\u07A5')||LA2_0=='\u07B1'||(LA2_0>='\u0904' && LA2_0<='\u0939')||LA2_0=='\u093D'||LA2_0=='\u0950'||(LA2_0>='\u0958' && LA2_0<='\u0961')||(LA2_0>='\u0985' && LA2_0<='\u098C')||(LA2_0>='\u098F' && LA2_0<='\u0990')||(LA2_0>='\u0993' && LA2_0<='\u09A8')||(LA2_0>='\u09AA' && LA2_0<='\u09B0')||LA2_0=='\u09B2'||(LA2_0>='\u09B6' && LA2_0<='\u09B9')||LA2_0=='\u09BD'||(LA2_0>='\u09DC' && LA2_0<='\u09DD')||(LA2_0>='\u09DF' && LA2_0<='\u09E1')||(LA2_0>='\u09F0' && LA2_0<='\u09F3')||(LA2_0>='\u0A05' && LA2_0<='\u0A0A')||(LA2_0>='\u0A0F' && LA2_0<='\u0A10')||(LA2_0>='\u0A13' && LA2_0<='\u0A28')||(LA2_0>='\u0A2A' && LA2_0<='\u0A30')||(LA2_0>='\u0A32' && LA2_0<='\u0A33')||(LA2_0>='\u0A35' && LA2_0<='\u0A36')||(LA2_0>='\u0A38' && LA2_0<='\u0A39')||(LA2_0>='\u0A59' && LA2_0<='\u0A5C')||LA2_0=='\u0A5E'||(LA2_0>='\u0A72' && LA2_0<='\u0A74')||(LA2_0>='\u0A85' && LA2_0<='\u0A8D')||(LA2_0>='\u0A8F' && LA2_0<='\u0A91')||(LA2_0>='\u0A93' && LA2_0<='\u0AA8')||(LA2_0>='\u0AAA' && LA2_0<='\u0AB0')||(LA2_0>='\u0AB2' && LA2_0<='\u0AB3')||(LA2_0>='\u0AB5' && LA2_0<='\u0AB9')||LA2_0=='\u0ABD'||LA2_0=='\u0AD0'||(LA2_0>='\u0AE0' && LA2_0<='\u0AE1')||LA2_0=='\u0AF1'||(LA2_0>='\u0B05' && LA2_0<='\u0B0C')||(LA2_0>='\u0B0F' && LA2_0<='\u0B10')||(LA2_0>='\u0B13' && LA2_0<='\u0B28')||(LA2_0>='\u0B2A' && LA2_0<='\u0B30')||(LA2_0>='\u0B32' && LA2_0<='\u0B33')||(LA2_0>='\u0B35' && LA2_0<='\u0B39')||LA2_0=='\u0B3D'||(LA2_0>='\u0B5C' && LA2_0<='\u0B5D')||(LA2_0>='\u0B5F' && LA2_0<='\u0B61')||LA2_0=='\u0B71'||LA2_0=='\u0B83'||(LA2_0>='\u0B85' && LA2_0<='\u0B8A')||(LA2_0>='\u0B8E' && LA2_0<='\u0B90')||(LA2_0>='\u0B92' && LA2_0<='\u0B95')||(LA2_0>='\u0B99' && LA2_0<='\u0B9A')||LA2_0=='\u0B9C'||(LA2_0>='\u0B9E' && LA2_0<='\u0B9F')||(LA2_0>='\u0BA3' && LA2_0<='\u0BA4')||(LA2_0>='\u0BA8' && LA2_0<='\u0BAA')||(LA2_0>='\u0BAE' && LA2_0<='\u0BB5')||(LA2_0>='\u0BB7' && LA2_0<='\u0BB9')||LA2_0=='\u0BF9'||(LA2_0>='\u0C05' && LA2_0<='\u0C0C')||(LA2_0>='\u0C0E' && LA2_0<='\u0C10')||(LA2_0>='\u0C12' && LA2_0<='\u0C28')||(LA2_0>='\u0C2A' && LA2_0<='\u0C33')||(LA2_0>='\u0C35' && LA2_0<='\u0C39')||(LA2_0>='\u0C60' && LA2_0<='\u0C61')||(LA2_0>='\u0C85' && LA2_0<='\u0C8C')||(LA2_0>='\u0C8E' && LA2_0<='\u0C90')||(LA2_0>='\u0C92' && LA2_0<='\u0CA8')||(LA2_0>='\u0CAA' && LA2_0<='\u0CB3')||(LA2_0>='\u0CB5' && LA2_0<='\u0CB9')||LA2_0=='\u0CBD'||LA2_0=='\u0CDE'||(LA2_0>='\u0CE0' && LA2_0<='\u0CE1')||(LA2_0>='\u0D05' && LA2_0<='\u0D0C')||(LA2_0>='\u0D0E' && LA2_0<='\u0D10')||(LA2_0>='\u0D12' && LA2_0<='\u0D28')||(LA2_0>='\u0D2A' && LA2_0<='\u0D39')||(LA2_0>='\u0D60' && LA2_0<='\u0D61')||(LA2_0>='\u0D85' && LA2_0<='\u0D96')||(LA2_0>='\u0D9A' && LA2_0<='\u0DB1')||(LA2_0>='\u0DB3' && LA2_0<='\u0DBB')||LA2_0=='\u0DBD'||(LA2_0>='\u0DC0' && LA2_0<='\u0DC6')||(LA2_0>='\u0E01' && LA2_0<='\u0E30')||(LA2_0>='\u0E32' && LA2_0<='\u0E33')||(LA2_0>='\u0E3F' && LA2_0<='\u0E46')||(LA2_0>='\u0E81' && LA2_0<='\u0E82')||LA2_0=='\u0E84'||(LA2_0>='\u0E87' && LA2_0<='\u0E88')||LA2_0=='\u0E8A'||LA2_0=='\u0E8D'||(LA2_0>='\u0E94' && LA2_0<='\u0E97')||(LA2_0>='\u0E99' && LA2_0<='\u0E9F')||(LA2_0>='\u0EA1' && LA2_0<='\u0EA3')||LA2_0=='\u0EA5'||LA2_0=='\u0EA7'||(LA2_0>='\u0EAA' && LA2_0<='\u0EAB')||(LA2_0>='\u0EAD' && LA2_0<='\u0EB0')||(LA2_0>='\u0EB2' && LA2_0<='\u0EB3')||LA2_0=='\u0EBD'||(LA2_0>='\u0EC0' && LA2_0<='\u0EC4')||LA2_0=='\u0EC6'||(LA2_0>='\u0EDC' && LA2_0<='\u0EDD')||LA2_0=='\u0F00'||(LA2_0>='\u0F40' && LA2_0<='\u0F47')||(LA2_0>='\u0F49' && LA2_0<='\u0F6A')||(LA2_0>='\u0F88' && LA2_0<='\u0F8B')||(LA2_0>='\u1000' && LA2_0<='\u1021')||(LA2_0>='\u1023' && LA2_0<='\u1027')||(LA2_0>='\u1029' && LA2_0<='\u102A')||(LA2_0>='\u1050' && LA2_0<='\u1055')||(LA2_0>='\u10A0' && LA2_0<='\u10C5')||(LA2_0>='\u10D0' && LA2_0<='\u10F8')||(LA2_0>='\u1100' && LA2_0<='\u1159')||(LA2_0>='\u115F' && LA2_0<='\u11A2')||(LA2_0>='\u11A8' && LA2_0<='\u11F9')||(LA2_0>='\u1200' && LA2_0<='\u1206')||(LA2_0>='\u1208' && LA2_0<='\u1246')||LA2_0=='\u1248'||(LA2_0>='\u124A' && LA2_0<='\u124D')||(LA2_0>='\u1250' && LA2_0<='\u1256')||LA2_0=='\u1258'||(LA2_0>='\u125A' && LA2_0<='\u125D')||(LA2_0>='\u1260' && LA2_0<='\u1286')||LA2_0=='\u1288'||(LA2_0>='\u128A' && LA2_0<='\u128D')||(LA2_0>='\u1290' && LA2_0<='\u12AE')||LA2_0=='\u12B0'||(LA2_0>='\u12B2' && LA2_0<='\u12B5')||(LA2_0>='\u12B8' && LA2_0<='\u12BE')||LA2_0=='\u12C0'||(LA2_0>='\u12C2' && LA2_0<='\u12C5')||(LA2_0>='\u12C8' && LA2_0<='\u12CE')||(LA2_0>='\u12D0' && LA2_0<='\u12D6')||(LA2_0>='\u12D8' && LA2_0<='\u12EE')||(LA2_0>='\u12F0' && LA2_0<='\u130E')||LA2_0=='\u1310'||(LA2_0>='\u1312' && LA2_0<='\u1315')||(LA2_0>='\u1318' && LA2_0<='\u131E')||(LA2_0>='\u1320' && LA2_0<='\u1346')||(LA2_0>='\u1348' && LA2_0<='\u135A')||(LA2_0>='\u13A0' && LA2_0<='\u13F4')||(LA2_0>='\u1401' && LA2_0<='\u166C')||(LA2_0>='\u166F' && LA2_0<='\u1676')||(LA2_0>='\u1681' && LA2_0<='\u169A')||(LA2_0>='\u16A0' && LA2_0<='\u16EA')||(LA2_0>='\u16EE' && LA2_0<='\u16F0')||(LA2_0>='\u1700' && LA2_0<='\u170C')||(LA2_0>='\u170E' && LA2_0<='\u1711')||(LA2_0>='\u1720' && LA2_0<='\u1731')||(LA2_0>='\u1740' && LA2_0<='\u1751')||(LA2_0>='\u1760' && LA2_0<='\u176C')||(LA2_0>='\u176E' && LA2_0<='\u1770')||(LA2_0>='\u1780' && LA2_0<='\u17B3')||LA2_0=='\u17D7'||(LA2_0>='\u17DB' && LA2_0<='\u17DC')||(LA2_0>='\u1820' && LA2_0<='\u1877')||(LA2_0>='\u1880' && LA2_0<='\u18A8')||(LA2_0>='\u1900' && LA2_0<='\u191C')||(LA2_0>='\u1950' && LA2_0<='\u196D')||(LA2_0>='\u1970' && LA2_0<='\u1974')||(LA2_0>='\u1D00' && LA2_0<='\u1D6B')||(LA2_0>='\u1E00' && LA2_0<='\u1E9B')||(LA2_0>='\u1EA0' && LA2_0<='\u1EF9')||(LA2_0>='\u1F00' && LA2_0<='\u1F15')||(LA2_0>='\u1F18' && LA2_0<='\u1F1D')||(LA2_0>='\u1F20' && LA2_0<='\u1F45')||(LA2_0>='\u1F48' && LA2_0<='\u1F4D')||(LA2_0>='\u1F50' && LA2_0<='\u1F57')||LA2_0=='\u1F59'||LA2_0=='\u1F5B'||LA2_0=='\u1F5D'||(LA2_0>='\u1F5F' && LA2_0<='\u1F7D')||(LA2_0>='\u1F80' && LA2_0<='\u1FB4')||(LA2_0>='\u1FB6' && LA2_0<='\u1FBC')||LA2_0=='\u1FBE'||(LA2_0>='\u1FC2' && LA2_0<='\u1FC4')||(LA2_0>='\u1FC6' && LA2_0<='\u1FCC')||(LA2_0>='\u1FD0' && LA2_0<='\u1FD3')||(LA2_0>='\u1FD6' && LA2_0<='\u1FDB')||(LA2_0>='\u1FE0' && LA2_0<='\u1FEC')||(LA2_0>='\u1FF2' && LA2_0<='\u1FF4')||(LA2_0>='\u1FF6' && LA2_0<='\u1FFC')||(LA2_0>='\u203F' && LA2_0<='\u2040')||LA2_0=='\u2054'||LA2_0=='\u2071'||LA2_0=='\u207F'||(LA2_0>='\u20A0' && LA2_0<='\u20B1')||LA2_0=='\u2102'||LA2_0=='\u2107'||(LA2_0>='\u210A' && LA2_0<='\u2113')||LA2_0=='\u2115'||(LA2_0>='\u2119' && LA2_0<='\u211D')||LA2_0=='\u2124'||LA2_0=='\u2126'||LA2_0=='\u2128'||(LA2_0>='\u212A' && LA2_0<='\u212D')||(LA2_0>='\u212F' && LA2_0<='\u2131')||(LA2_0>='\u2133' && LA2_0<='\u2139')||(LA2_0>='\u213D' && LA2_0<='\u213F')||(LA2_0>='\u2145' && LA2_0<='\u2149')||(LA2_0>='\u2160' && LA2_0<='\u2183')||(LA2_0>='\u3005' && LA2_0<='\u3007')||(LA2_0>='\u3021' && LA2_0<='\u3029')||(LA2_0>='\u3031' && LA2_0<='\u3035')||(LA2_0>='\u3038' && LA2_0<='\u303C')||(LA2_0>='\u3041' && LA2_0<='\u3096')||(LA2_0>='\u309D' && LA2_0<='\u309F')||(LA2_0>='\u30A1' && LA2_0<='\u30FF')||(LA2_0>='\u3105' && LA2_0<='\u312C')||(LA2_0>='\u3131' && LA2_0<='\u318E')||(LA2_0>='\u31A0' && LA2_0<='\u31B7')||(LA2_0>='\u31F0' && LA2_0<='\u31FF')||(LA2_0>='\u3400' && LA2_0<='\u4DB5')||(LA2_0>='\u4E00' && LA2_0<='\u9FA5')||(LA2_0>='\uA000' && LA2_0<='\uA48C')||(LA2_0>='\uAC00' && LA2_0<='\uD7A3')||(LA2_0>='\uF900' && LA2_0<='\uFA2D')||(LA2_0>='\uFA30' && LA2_0<='\uFA6A')||(LA2_0>='\uFB00' && LA2_0<='\uFB06')||(LA2_0>='\uFB13' && LA2_0<='\uFB17')||LA2_0=='\uFB1D'||(LA2_0>='\uFB1F' && LA2_0<='\uFB28')||(LA2_0>='\uFB2A' && LA2_0<='\uFB36')||(LA2_0>='\uFB38' && LA2_0<='\uFB3C')||LA2_0=='\uFB3E'||(LA2_0>='\uFB40' && LA2_0<='\uFB41')||(LA2_0>='\uFB43' && LA2_0<='\uFB44')||(LA2_0>='\uFB46' && LA2_0<='\uFBB1')||(LA2_0>='\uFBD3' && LA2_0<='\uFD3D')||(LA2_0>='\uFD50' && LA2_0<='\uFD8F')||(LA2_0>='\uFD92' && LA2_0<='\uFDC7')||(LA2_0>='\uFDF0' && LA2_0<='\uFDFC')||(LA2_0>='\uFE33' && LA2_0<='\uFE34')||(LA2_0>='\uFE4D' && LA2_0<='\uFE4F')||LA2_0=='\uFE69'||(LA2_0>='\uFE70' && LA2_0<='\uFE74')||(LA2_0>='\uFE76' && LA2_0<='\uFEFC')||LA2_0=='\uFF04'||(LA2_0>='\uFF21' && LA2_0<='\uFF3A')||LA2_0=='\uFF3F'||(LA2_0>='\uFF41' && LA2_0<='\uFF5A')||(LA2_0>='\uFF65' && LA2_0<='\uFFBE')||(LA2_0>='\uFFC2' && LA2_0<='\uFFC7')||(LA2_0>='\uFFCA' && LA2_0<='\uFFCF')||(LA2_0>='\uFFD2' && LA2_0<='\uFFD7')||(LA2_0>='\uFFDA' && LA2_0<='\uFFDC')||(LA2_0>='\uFFE0' && LA2_0<='\uFFE1')||(LA2_0>='\uFFE5' && LA2_0<='\uFFE6')) ) {
alt2=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA2_0=='\\') ) {
alt2=2; // depends on control dependency: [if], data = [none]
}
else {
NoViableAltException nvae =
new NoViableAltException("", 2, 0, input);
throw nvae;
}
switch (alt2) {
case 1 :
// InternalSARL.g:48763:17: RULE_IDENTIFIER_START
{
mRULE_IDENTIFIER_START();
}
break;
case 2 :
// InternalSARL.g:48763:39: RULE_UNICODE_ESCAPE
{
mRULE_UNICODE_ESCAPE();
}
break;
}
// InternalSARL.g:48763:60: ( RULE_IDENTIFIER_PART | RULE_UNICODE_ESCAPE )*
loop3:
do {
int alt3=3;
int LA3_0 = input.LA(1);
if ( ((LA3_0>='\u0000' && LA3_0<='\b')||(LA3_0>='\u000E' && LA3_0<='\u001B')||LA3_0=='$'||(LA3_0>='0' && LA3_0<='9')||(LA3_0>='A' && LA3_0<='Z')||LA3_0=='_'||(LA3_0>='a' && LA3_0<='z')||(LA3_0>='\u007F' && LA3_0<='\u009F')||(LA3_0>='\u00A2' && LA3_0<='\u00A5')||LA3_0=='\u00AA'||LA3_0=='\u00AD'||LA3_0=='\u00B5'||LA3_0=='\u00BA'||(LA3_0>='\u00C0' && LA3_0<='\u00D6')||(LA3_0>='\u00D8' && LA3_0<='\u00F6')||(LA3_0>='\u00F8' && LA3_0<='\u0236')||(LA3_0>='\u0250' && LA3_0<='\u02C1')||(LA3_0>='\u02C6' && LA3_0<='\u02D1')||(LA3_0>='\u02E0' && LA3_0<='\u02E4')||LA3_0=='\u02EE'||(LA3_0>='\u0300' && LA3_0<='\u0357')||(LA3_0>='\u035D' && LA3_0<='\u036F')||LA3_0=='\u037A'||LA3_0=='\u0386'||(LA3_0>='\u0388' && LA3_0<='\u038A')||LA3_0=='\u038C'||(LA3_0>='\u038E' && LA3_0<='\u03A1')||(LA3_0>='\u03A3' && LA3_0<='\u03CE')||(LA3_0>='\u03D0' && LA3_0<='\u03F5')||(LA3_0>='\u03F7' && LA3_0<='\u03FB')||(LA3_0>='\u0400' && LA3_0<='\u0481')||(LA3_0>='\u0483' && LA3_0<='\u0486')||(LA3_0>='\u048A' && LA3_0<='\u04CE')||(LA3_0>='\u04D0' && LA3_0<='\u04F5')||(LA3_0>='\u04F8' && LA3_0<='\u04F9')||(LA3_0>='\u0500' && LA3_0<='\u050F')||(LA3_0>='\u0531' && LA3_0<='\u0556')||LA3_0=='\u0559'||(LA3_0>='\u0561' && LA3_0<='\u0587')||(LA3_0>='\u0591' && LA3_0<='\u05A1')||(LA3_0>='\u05A3' && LA3_0<='\u05B9')||(LA3_0>='\u05BB' && LA3_0<='\u05BD')||LA3_0=='\u05BF'||(LA3_0>='\u05C1' && LA3_0<='\u05C2')||LA3_0=='\u05C4'||(LA3_0>='\u05D0' && LA3_0<='\u05EA')||(LA3_0>='\u05F0' && LA3_0<='\u05F2')||(LA3_0>='\u0600' && LA3_0<='\u0603')||(LA3_0>='\u0610' && LA3_0<='\u0615')||(LA3_0>='\u0621' && LA3_0<='\u063A')||(LA3_0>='\u0640' && LA3_0<='\u0658')||(LA3_0>='\u0660' && LA3_0<='\u0669')||(LA3_0>='\u066E' && LA3_0<='\u06D3')||(LA3_0>='\u06D5' && LA3_0<='\u06DD')||(LA3_0>='\u06DF' && LA3_0<='\u06E8')||(LA3_0>='\u06EA' && LA3_0<='\u06FC')||LA3_0=='\u06FF'||(LA3_0>='\u070F' && LA3_0<='\u074A')||(LA3_0>='\u074D' && LA3_0<='\u074F')||(LA3_0>='\u0780' && LA3_0<='\u07B1')||(LA3_0>='\u0901' && LA3_0<='\u0939')||(LA3_0>='\u093C' && LA3_0<='\u094D')||(LA3_0>='\u0950' && LA3_0<='\u0954')||(LA3_0>='\u0958' && LA3_0<='\u0963')||(LA3_0>='\u0966' && LA3_0<='\u096F')||(LA3_0>='\u0981' && LA3_0<='\u0983')||(LA3_0>='\u0985' && LA3_0<='\u098C')||(LA3_0>='\u098F' && LA3_0<='\u0990')||(LA3_0>='\u0993' && LA3_0<='\u09A8')||(LA3_0>='\u09AA' && LA3_0<='\u09B0')||LA3_0=='\u09B2'||(LA3_0>='\u09B6' && LA3_0<='\u09B9')||(LA3_0>='\u09BC' && LA3_0<='\u09C4')||(LA3_0>='\u09C7' && LA3_0<='\u09C8')||(LA3_0>='\u09CB' && LA3_0<='\u09CD')||LA3_0=='\u09D7'||(LA3_0>='\u09DC' && LA3_0<='\u09DD')||(LA3_0>='\u09DF' && LA3_0<='\u09E3')||(LA3_0>='\u09E6' && LA3_0<='\u09F3')||(LA3_0>='\u0A01' && LA3_0<='\u0A03')||(LA3_0>='\u0A05' && LA3_0<='\u0A0A')||(LA3_0>='\u0A0F' && LA3_0<='\u0A10')||(LA3_0>='\u0A13' && LA3_0<='\u0A28')||(LA3_0>='\u0A2A' && LA3_0<='\u0A30')||(LA3_0>='\u0A32' && LA3_0<='\u0A33')||(LA3_0>='\u0A35' && LA3_0<='\u0A36')||(LA3_0>='\u0A38' && LA3_0<='\u0A39')||LA3_0=='\u0A3C'||(LA3_0>='\u0A3E' && LA3_0<='\u0A42')||(LA3_0>='\u0A47' && LA3_0<='\u0A48')||(LA3_0>='\u0A4B' && LA3_0<='\u0A4D')||(LA3_0>='\u0A59' && LA3_0<='\u0A5C')||LA3_0=='\u0A5E'||(LA3_0>='\u0A66' && LA3_0<='\u0A74')||(LA3_0>='\u0A81' && LA3_0<='\u0A83')||(LA3_0>='\u0A85' && LA3_0<='\u0A8D')||(LA3_0>='\u0A8F' && LA3_0<='\u0A91')||(LA3_0>='\u0A93' && LA3_0<='\u0AA8')||(LA3_0>='\u0AAA' && LA3_0<='\u0AB0')||(LA3_0>='\u0AB2' && LA3_0<='\u0AB3')||(LA3_0>='\u0AB5' && LA3_0<='\u0AB9')||(LA3_0>='\u0ABC' && LA3_0<='\u0AC5')||(LA3_0>='\u0AC7' && LA3_0<='\u0AC9')||(LA3_0>='\u0ACB' && LA3_0<='\u0ACD')||LA3_0=='\u0AD0'||(LA3_0>='\u0AE0' && LA3_0<='\u0AE3')||(LA3_0>='\u0AE6' && LA3_0<='\u0AEF')||LA3_0=='\u0AF1'||(LA3_0>='\u0B01' && LA3_0<='\u0B03')||(LA3_0>='\u0B05' && LA3_0<='\u0B0C')||(LA3_0>='\u0B0F' && LA3_0<='\u0B10')||(LA3_0>='\u0B13' && LA3_0<='\u0B28')||(LA3_0>='\u0B2A' && LA3_0<='\u0B30')||(LA3_0>='\u0B32' && LA3_0<='\u0B33')||(LA3_0>='\u0B35' && LA3_0<='\u0B39')||(LA3_0>='\u0B3C' && LA3_0<='\u0B43')||(LA3_0>='\u0B47' && LA3_0<='\u0B48')||(LA3_0>='\u0B4B' && LA3_0<='\u0B4D')||(LA3_0>='\u0B56' && LA3_0<='\u0B57')||(LA3_0>='\u0B5C' && LA3_0<='\u0B5D')||(LA3_0>='\u0B5F' && LA3_0<='\u0B61')||(LA3_0>='\u0B66' && LA3_0<='\u0B6F')||LA3_0=='\u0B71'||(LA3_0>='\u0B82' && LA3_0<='\u0B83')||(LA3_0>='\u0B85' && LA3_0<='\u0B8A')||(LA3_0>='\u0B8E' && LA3_0<='\u0B90')||(LA3_0>='\u0B92' && LA3_0<='\u0B95')||(LA3_0>='\u0B99' && LA3_0<='\u0B9A')||LA3_0=='\u0B9C'||(LA3_0>='\u0B9E' && LA3_0<='\u0B9F')||(LA3_0>='\u0BA3' && LA3_0<='\u0BA4')||(LA3_0>='\u0BA8' && LA3_0<='\u0BAA')||(LA3_0>='\u0BAE' && LA3_0<='\u0BB5')||(LA3_0>='\u0BB7' && LA3_0<='\u0BB9')||(LA3_0>='\u0BBE' && LA3_0<='\u0BC2')||(LA3_0>='\u0BC6' && LA3_0<='\u0BC8')||(LA3_0>='\u0BCA' && LA3_0<='\u0BCD')||LA3_0=='\u0BD7'||(LA3_0>='\u0BE7' && LA3_0<='\u0BEF')||LA3_0=='\u0BF9'||(LA3_0>='\u0C01' && LA3_0<='\u0C03')||(LA3_0>='\u0C05' && LA3_0<='\u0C0C')||(LA3_0>='\u0C0E' && LA3_0<='\u0C10')||(LA3_0>='\u0C12' && LA3_0<='\u0C28')||(LA3_0>='\u0C2A' && LA3_0<='\u0C33')||(LA3_0>='\u0C35' && LA3_0<='\u0C39')||(LA3_0>='\u0C3E' && LA3_0<='\u0C44')||(LA3_0>='\u0C46' && LA3_0<='\u0C48')||(LA3_0>='\u0C4A' && LA3_0<='\u0C4D')||(LA3_0>='\u0C55' && LA3_0<='\u0C56')||(LA3_0>='\u0C60' && LA3_0<='\u0C61')||(LA3_0>='\u0C66' && LA3_0<='\u0C6F')||(LA3_0>='\u0C82' && LA3_0<='\u0C83')||(LA3_0>='\u0C85' && LA3_0<='\u0C8C')||(LA3_0>='\u0C8E' && LA3_0<='\u0C90')||(LA3_0>='\u0C92' && LA3_0<='\u0CA8')||(LA3_0>='\u0CAA' && LA3_0<='\u0CB3')||(LA3_0>='\u0CB5' && LA3_0<='\u0CB9')||(LA3_0>='\u0CBC' && LA3_0<='\u0CC4')||(LA3_0>='\u0CC6' && LA3_0<='\u0CC8')||(LA3_0>='\u0CCA' && LA3_0<='\u0CCD')||(LA3_0>='\u0CD5' && LA3_0<='\u0CD6')||LA3_0=='\u0CDE'||(LA3_0>='\u0CE0' && LA3_0<='\u0CE1')||(LA3_0>='\u0CE6' && LA3_0<='\u0CEF')||(LA3_0>='\u0D02' && LA3_0<='\u0D03')||(LA3_0>='\u0D05' && LA3_0<='\u0D0C')||(LA3_0>='\u0D0E' && LA3_0<='\u0D10')||(LA3_0>='\u0D12' && LA3_0<='\u0D28')||(LA3_0>='\u0D2A' && LA3_0<='\u0D39')||(LA3_0>='\u0D3E' && LA3_0<='\u0D43')||(LA3_0>='\u0D46' && LA3_0<='\u0D48')||(LA3_0>='\u0D4A' && LA3_0<='\u0D4D')||LA3_0=='\u0D57'||(LA3_0>='\u0D60' && LA3_0<='\u0D61')||(LA3_0>='\u0D66' && LA3_0<='\u0D6F')||(LA3_0>='\u0D82' && LA3_0<='\u0D83')||(LA3_0>='\u0D85' && LA3_0<='\u0D96')||(LA3_0>='\u0D9A' && LA3_0<='\u0DB1')||(LA3_0>='\u0DB3' && LA3_0<='\u0DBB')||LA3_0=='\u0DBD'||(LA3_0>='\u0DC0' && LA3_0<='\u0DC6')||LA3_0=='\u0DCA'||(LA3_0>='\u0DCF' && LA3_0<='\u0DD4')||LA3_0=='\u0DD6'||(LA3_0>='\u0DD8' && LA3_0<='\u0DDF')||(LA3_0>='\u0DF2' && LA3_0<='\u0DF3')||(LA3_0>='\u0E01' && LA3_0<='\u0E3A')||(LA3_0>='\u0E3F' && LA3_0<='\u0E4E')||(LA3_0>='\u0E50' && LA3_0<='\u0E59')||(LA3_0>='\u0E81' && LA3_0<='\u0E82')||LA3_0=='\u0E84'||(LA3_0>='\u0E87' && LA3_0<='\u0E88')||LA3_0=='\u0E8A'||LA3_0=='\u0E8D'||(LA3_0>='\u0E94' && LA3_0<='\u0E97')||(LA3_0>='\u0E99' && LA3_0<='\u0E9F')||(LA3_0>='\u0EA1' && LA3_0<='\u0EA3')||LA3_0=='\u0EA5'||LA3_0=='\u0EA7'||(LA3_0>='\u0EAA' && LA3_0<='\u0EAB')||(LA3_0>='\u0EAD' && LA3_0<='\u0EB9')||(LA3_0>='\u0EBB' && LA3_0<='\u0EBD')||(LA3_0>='\u0EC0' && LA3_0<='\u0EC4')||LA3_0=='\u0EC6'||(LA3_0>='\u0EC8' && LA3_0<='\u0ECD')||(LA3_0>='\u0ED0' && LA3_0<='\u0ED9')||(LA3_0>='\u0EDC' && LA3_0<='\u0EDD')||LA3_0=='\u0F00'||(LA3_0>='\u0F18' && LA3_0<='\u0F19')||(LA3_0>='\u0F20' && LA3_0<='\u0F29')||LA3_0=='\u0F35'||LA3_0=='\u0F37'||LA3_0=='\u0F39'||(LA3_0>='\u0F3E' && LA3_0<='\u0F47')||(LA3_0>='\u0F49' && LA3_0<='\u0F6A')||(LA3_0>='\u0F71' && LA3_0<='\u0F84')||(LA3_0>='\u0F86' && LA3_0<='\u0F8B')||(LA3_0>='\u0F90' && LA3_0<='\u0F97')||(LA3_0>='\u0F99' && LA3_0<='\u0FBC')||LA3_0=='\u0FC6'||(LA3_0>='\u1000' && LA3_0<='\u1021')||(LA3_0>='\u1023' && LA3_0<='\u1027')||(LA3_0>='\u1029' && LA3_0<='\u102A')||(LA3_0>='\u102C' && LA3_0<='\u1032')||(LA3_0>='\u1036' && LA3_0<='\u1039')||(LA3_0>='\u1040' && LA3_0<='\u1049')||(LA3_0>='\u1050' && LA3_0<='\u1059')||(LA3_0>='\u10A0' && LA3_0<='\u10C5')||(LA3_0>='\u10D0' && LA3_0<='\u10F8')||(LA3_0>='\u1100' && LA3_0<='\u1159')||(LA3_0>='\u115F' && LA3_0<='\u11A2')||(LA3_0>='\u11A8' && LA3_0<='\u11F9')||(LA3_0>='\u1200' && LA3_0<='\u1206')||(LA3_0>='\u1208' && LA3_0<='\u1246')||LA3_0=='\u1248'||(LA3_0>='\u124A' && LA3_0<='\u124D')||(LA3_0>='\u1250' && LA3_0<='\u1256')||LA3_0=='\u1258'||(LA3_0>='\u125A' && LA3_0<='\u125D')||(LA3_0>='\u1260' && LA3_0<='\u1286')||LA3_0=='\u1288'||(LA3_0>='\u128A' && LA3_0<='\u128D')||(LA3_0>='\u1290' && LA3_0<='\u12AE')||LA3_0=='\u12B0'||(LA3_0>='\u12B2' && LA3_0<='\u12B5')||(LA3_0>='\u12B8' && LA3_0<='\u12BE')||LA3_0=='\u12C0'||(LA3_0>='\u12C2' && LA3_0<='\u12C5')||(LA3_0>='\u12C8' && LA3_0<='\u12CE')||(LA3_0>='\u12D0' && LA3_0<='\u12D6')||(LA3_0>='\u12D8' && LA3_0<='\u12EE')||(LA3_0>='\u12F0' && LA3_0<='\u130E')||LA3_0=='\u1310'||(LA3_0>='\u1312' && LA3_0<='\u1315')||(LA3_0>='\u1318' && LA3_0<='\u131E')||(LA3_0>='\u1320' && LA3_0<='\u1346')||(LA3_0>='\u1348' && LA3_0<='\u135A')||(LA3_0>='\u1369' && LA3_0<='\u1371')||(LA3_0>='\u13A0' && LA3_0<='\u13F4')||(LA3_0>='\u1401' && LA3_0<='\u166C')||(LA3_0>='\u166F' && LA3_0<='\u1676')||(LA3_0>='\u1681' && LA3_0<='\u169A')||(LA3_0>='\u16A0' && LA3_0<='\u16EA')||(LA3_0>='\u16EE' && LA3_0<='\u16F0')||(LA3_0>='\u1700' && LA3_0<='\u170C')||(LA3_0>='\u170E' && LA3_0<='\u1714')||(LA3_0>='\u1720' && LA3_0<='\u1734')||(LA3_0>='\u1740' && LA3_0<='\u1753')||(LA3_0>='\u1760' && LA3_0<='\u176C')||(LA3_0>='\u176E' && LA3_0<='\u1770')||(LA3_0>='\u1772' && LA3_0<='\u1773')||(LA3_0>='\u1780' && LA3_0<='\u17D3')||LA3_0=='\u17D7'||(LA3_0>='\u17DB' && LA3_0<='\u17DD')||(LA3_0>='\u17E0' && LA3_0<='\u17E9')||(LA3_0>='\u180B' && LA3_0<='\u180D')||(LA3_0>='\u1810' && LA3_0<='\u1819')||(LA3_0>='\u1820' && LA3_0<='\u1877')||(LA3_0>='\u1880' && LA3_0<='\u18A9')||(LA3_0>='\u1900' && LA3_0<='\u191C')||(LA3_0>='\u1920' && LA3_0<='\u192B')||(LA3_0>='\u1930' && LA3_0<='\u193B')||(LA3_0>='\u1946' && LA3_0<='\u196D')||(LA3_0>='\u1970' && LA3_0<='\u1974')||(LA3_0>='\u1D00' && LA3_0<='\u1D6B')||(LA3_0>='\u1E00' && LA3_0<='\u1E9B')||(LA3_0>='\u1EA0' && LA3_0<='\u1EF9')||(LA3_0>='\u1F00' && LA3_0<='\u1F15')||(LA3_0>='\u1F18' && LA3_0<='\u1F1D')||(LA3_0>='\u1F20' && LA3_0<='\u1F45')||(LA3_0>='\u1F48' && LA3_0<='\u1F4D')||(LA3_0>='\u1F50' && LA3_0<='\u1F57')||LA3_0=='\u1F59'||LA3_0=='\u1F5B'||LA3_0=='\u1F5D'||(LA3_0>='\u1F5F' && LA3_0<='\u1F7D')||(LA3_0>='\u1F80' && LA3_0<='\u1FB4')||(LA3_0>='\u1FB6' && LA3_0<='\u1FBC')||LA3_0=='\u1FBE'||(LA3_0>='\u1FC2' && LA3_0<='\u1FC4')||(LA3_0>='\u1FC6' && LA3_0<='\u1FCC')||(LA3_0>='\u1FD0' && LA3_0<='\u1FD3')||(LA3_0>='\u1FD6' && LA3_0<='\u1FDB')||(LA3_0>='\u1FE0' && LA3_0<='\u1FEC')||(LA3_0>='\u1FF2' && LA3_0<='\u1FF4')||(LA3_0>='\u1FF6' && LA3_0<='\u1FFC')||(LA3_0>='\u200C' && LA3_0<='\u200F')||(LA3_0>='\u202A' && LA3_0<='\u202E')||(LA3_0>='\u203F' && LA3_0<='\u2040')||LA3_0=='\u2054'||(LA3_0>='\u2060' && LA3_0<='\u2063')||(LA3_0>='\u206A' && LA3_0<='\u206F')||LA3_0=='\u2071'||LA3_0=='\u207F'||(LA3_0>='\u20A0' && LA3_0<='\u20B1')||(LA3_0>='\u20D0' && LA3_0<='\u20DC')||LA3_0=='\u20E1'||(LA3_0>='\u20E5' && LA3_0<='\u20EA')||LA3_0=='\u2102'||LA3_0=='\u2107'||(LA3_0>='\u210A' && LA3_0<='\u2113')||LA3_0=='\u2115'||(LA3_0>='\u2119' && LA3_0<='\u211D')||LA3_0=='\u2124'||LA3_0=='\u2126'||LA3_0=='\u2128'||(LA3_0>='\u212A' && LA3_0<='\u212D')||(LA3_0>='\u212F' && LA3_0<='\u2131')||(LA3_0>='\u2133' && LA3_0<='\u2139')||(LA3_0>='\u213D' && LA3_0<='\u213F')||(LA3_0>='\u2145' && LA3_0<='\u2149')||(LA3_0>='\u2160' && LA3_0<='\u2183')||(LA3_0>='\u3005' && LA3_0<='\u3007')||(LA3_0>='\u3021' && LA3_0<='\u302F')||(LA3_0>='\u3031' && LA3_0<='\u3035')||(LA3_0>='\u3038' && LA3_0<='\u303C')||(LA3_0>='\u3041' && LA3_0<='\u3096')||(LA3_0>='\u3099' && LA3_0<='\u309A')||(LA3_0>='\u309D' && LA3_0<='\u309F')||(LA3_0>='\u30A1' && LA3_0<='\u30FF')||(LA3_0>='\u3105' && LA3_0<='\u312C')||(LA3_0>='\u3131' && LA3_0<='\u318E')||(LA3_0>='\u31A0' && LA3_0<='\u31B7')||(LA3_0>='\u31F0' && LA3_0<='\u31FF')||(LA3_0>='\u3400' && LA3_0<='\u4DB5')||(LA3_0>='\u4E00' && LA3_0<='\u9FA5')||(LA3_0>='\uA000' && LA3_0<='\uA48C')||(LA3_0>='\uAC00' && LA3_0<='\uD7A3')||(LA3_0>='\uF900' && LA3_0<='\uFA2D')||(LA3_0>='\uFA30' && LA3_0<='\uFA6A')||(LA3_0>='\uFB00' && LA3_0<='\uFB06')||(LA3_0>='\uFB13' && LA3_0<='\uFB17')||(LA3_0>='\uFB1D' && LA3_0<='\uFB28')||(LA3_0>='\uFB2A' && LA3_0<='\uFB36')||(LA3_0>='\uFB38' && LA3_0<='\uFB3C')||LA3_0=='\uFB3E'||(LA3_0>='\uFB40' && LA3_0<='\uFB41')||(LA3_0>='\uFB43' && LA3_0<='\uFB44')||(LA3_0>='\uFB46' && LA3_0<='\uFBB1')||(LA3_0>='\uFBD3' && LA3_0<='\uFD3D')||(LA3_0>='\uFD50' && LA3_0<='\uFD8F')||(LA3_0>='\uFD92' && LA3_0<='\uFDC7')||(LA3_0>='\uFDF0' && LA3_0<='\uFDFC')||(LA3_0>='\uFE00' && LA3_0<='\uFE0F')||(LA3_0>='\uFE20' && LA3_0<='\uFE23')||(LA3_0>='\uFE33' && LA3_0<='\uFE34')||(LA3_0>='\uFE4D' && LA3_0<='\uFE4F')||LA3_0=='\uFE69'||(LA3_0>='\uFE70' && LA3_0<='\uFE74')||(LA3_0>='\uFE76' && LA3_0<='\uFEFC')||LA3_0=='\uFEFF'||LA3_0=='\uFF04'||(LA3_0>='\uFF10' && LA3_0<='\uFF19')||(LA3_0>='\uFF21' && LA3_0<='\uFF3A')||LA3_0=='\uFF3F'||(LA3_0>='\uFF41' && LA3_0<='\uFF5A')||(LA3_0>='\uFF65' && LA3_0<='\uFFBE')||(LA3_0>='\uFFC2' && LA3_0<='\uFFC7')||(LA3_0>='\uFFCA' && LA3_0<='\uFFCF')||(LA3_0>='\uFFD2' && LA3_0<='\uFFD7')||(LA3_0>='\uFFDA' && LA3_0<='\uFFDC')||(LA3_0>='\uFFE0' && LA3_0<='\uFFE1')||(LA3_0>='\uFFE5' && LA3_0<='\uFFE6')||(LA3_0>='\uFFF9' && LA3_0<='\uFFFB')) ) {
alt3=1; // depends on control dependency: [if], data = [none]
}
else if ( (LA3_0=='\\') ) {
alt3=2; // depends on control dependency: [if], data = [none]
}
switch (alt3) {
case 1 :
// InternalSARL.g:48763:61: RULE_IDENTIFIER_PART
{
mRULE_IDENTIFIER_PART();
}
break;
case 2 :
// InternalSARL.g:48763:82: RULE_UNICODE_ESCAPE
{
mRULE_UNICODE_ESCAPE();
}
break;
default :
break loop3;
}
} while (true);
}
state.type = _type;
state.channel = _channel;
}
finally {
}
} } |
public class class_name {
private double degreeToNumber( String value ) {
double number = -1;
String[] valueSplit = value.trim().split(":"); //$NON-NLS-1$
if (valueSplit.length == 3) {
// deg:min:sec.ss
double deg = Double.parseDouble(valueSplit[0]);
double min = Double.parseDouble(valueSplit[1]);
double sec = Double.parseDouble(valueSplit[2]);
number = deg + min / 60.0 + sec / 60.0 / 60.0;
} else if (valueSplit.length == 2) {
// deg:min
double deg = Double.parseDouble(valueSplit[0]);
double min = Double.parseDouble(valueSplit[1]);
number = deg + min / 60.0;
} else if (valueSplit.length == 1) {
// deg
number = Double.parseDouble(valueSplit[0]);
}
return number;
} } | public class class_name {
private double degreeToNumber( String value ) {
double number = -1;
String[] valueSplit = value.trim().split(":"); //$NON-NLS-1$
if (valueSplit.length == 3) {
// deg:min:sec.ss
double deg = Double.parseDouble(valueSplit[0]);
double min = Double.parseDouble(valueSplit[1]);
double sec = Double.parseDouble(valueSplit[2]);
number = deg + min / 60.0 + sec / 60.0 / 60.0; // depends on control dependency: [if], data = [none]
} else if (valueSplit.length == 2) {
// deg:min
double deg = Double.parseDouble(valueSplit[0]);
double min = Double.parseDouble(valueSplit[1]);
number = deg + min / 60.0; // depends on control dependency: [if], data = [none]
} else if (valueSplit.length == 1) {
// deg
number = Double.parseDouble(valueSplit[0]); // depends on control dependency: [if], data = [none]
}
return number;
} } |
public class class_name {
public void marshall(S3Destination s3Destination, ProtocolMarshaller protocolMarshaller) {
if (s3Destination == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(s3Destination.getBucketName(), BUCKETNAME_BINDING);
protocolMarshaller.marshall(s3Destination.getPrefix(), PREFIX_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} } | public class class_name {
public void marshall(S3Destination s3Destination, ProtocolMarshaller protocolMarshaller) {
if (s3Destination == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(s3Destination.getBucketName(), BUCKETNAME_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(s3Destination.getPrefix(), PREFIX_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} } |
public class class_name {
public static double quantile(double val, double loc, double scale, double shape) {
if(shape == 0.) {
return loc - scale * FastMath.log((1 - val) / val);
}
return loc + scale * (1 - FastMath.pow((1 - val) / val, shape)) / shape;
} } | public class class_name {
public static double quantile(double val, double loc, double scale, double shape) {
if(shape == 0.) {
return loc - scale * FastMath.log((1 - val) / val); // depends on control dependency: [if], data = [none]
}
return loc + scale * (1 - FastMath.pow((1 - val) / val, shape)) / shape;
} } |
public class class_name {
@Override
public String getInUseSessionID(ServletRequest req, SessionAffinityContext sac) {
String id = null;
if (sac.isRequestedSessionIDFromSSL() && req != null) {
id = getActualSSLSessionId(req);
} else {
// We may have been dispatched and a previous app created a session.
// If so, the Id will be in the response id, and we need to use it
id = sac.getResponseSessionID();
if (id == null) {
id = sac.getRequestedSessionID();
}
}
return id;
} } | public class class_name {
@Override
public String getInUseSessionID(ServletRequest req, SessionAffinityContext sac) {
String id = null;
if (sac.isRequestedSessionIDFromSSL() && req != null) {
id = getActualSSLSessionId(req); // depends on control dependency: [if], data = [none]
} else {
// We may have been dispatched and a previous app created a session.
// If so, the Id will be in the response id, and we need to use it
id = sac.getResponseSessionID(); // depends on control dependency: [if], data = [none]
if (id == null) {
id = sac.getRequestedSessionID(); // depends on control dependency: [if], data = [none]
}
}
return id;
} } |
public class class_name {
public static boolean isGrpcContentType(String contentType) {
if (contentType == null) {
return false;
}
if (CONTENT_TYPE_GRPC.length() > contentType.length()) {
return false;
}
contentType = contentType.toLowerCase();
if (!contentType.startsWith(CONTENT_TYPE_GRPC)) {
// Not a gRPC content-type.
return false;
}
if (contentType.length() == CONTENT_TYPE_GRPC.length()) {
// The strings match exactly.
return true;
}
// The contentType matches, but is longer than the expected string.
// We need to support variations on the content-type (e.g. +proto, +json) as defined by the
// gRPC wire spec.
char nextChar = contentType.charAt(CONTENT_TYPE_GRPC.length());
return nextChar == '+' || nextChar == ';';
} } | public class class_name {
public static boolean isGrpcContentType(String contentType) {
if (contentType == null) {
return false; // depends on control dependency: [if], data = [none]
}
if (CONTENT_TYPE_GRPC.length() > contentType.length()) {
return false; // depends on control dependency: [if], data = [none]
}
contentType = contentType.toLowerCase();
if (!contentType.startsWith(CONTENT_TYPE_GRPC)) {
// Not a gRPC content-type.
return false; // depends on control dependency: [if], data = [none]
}
if (contentType.length() == CONTENT_TYPE_GRPC.length()) {
// The strings match exactly.
return true; // depends on control dependency: [if], data = [none]
}
// The contentType matches, but is longer than the expected string.
// We need to support variations on the content-type (e.g. +proto, +json) as defined by the
// gRPC wire spec.
char nextChar = contentType.charAt(CONTENT_TYPE_GRPC.length());
return nextChar == '+' || nextChar == ';';
} } |
public class class_name {
@Override
public SchemaManager getSchemaManager(Map<String, Object> externalProperty)
{
setExternalProperties(externalProperty);
if (schemaManager == null)
{
initializePropertyReader();
schemaManager = new HBaseSchemaManager(HBaseClientFactory.class.getName(), externalProperty,
kunderaMetadata);
}
return schemaManager;
} } | public class class_name {
@Override
public SchemaManager getSchemaManager(Map<String, Object> externalProperty)
{
setExternalProperties(externalProperty);
if (schemaManager == null)
{
initializePropertyReader();
// depends on control dependency: [if], data = [none]
schemaManager = new HBaseSchemaManager(HBaseClientFactory.class.getName(), externalProperty,
kunderaMetadata);
// depends on control dependency: [if], data = [none]
}
return schemaManager;
} } |
public class class_name {
public void setCustomTickLabelsEnabled(final boolean ENABLED) {
if (null == customTickLabelsEnabled) {
_customTickLabelsEnabled = ENABLED;
fireUpdateEvent(REDRAW_EVENT);
} else {
customTickLabelsEnabled.set(ENABLED);
}
} } | public class class_name {
public void setCustomTickLabelsEnabled(final boolean ENABLED) {
if (null == customTickLabelsEnabled) {
_customTickLabelsEnabled = ENABLED; // depends on control dependency: [if], data = [none]
fireUpdateEvent(REDRAW_EVENT); // depends on control dependency: [if], data = [none]
} else {
customTickLabelsEnabled.set(ENABLED); // depends on control dependency: [if], data = [none]
}
} } |
public class class_name {
private void showColumn(TableColumn column) {
// Ignore changes to the TableColumnModel made by the TableColumnManager
columnModel.removeColumnModelListener(this);
// Add the column to the end of the table
columnModel.addColumn(column);
// Move the column to its position before it was hidden.
// (Multiple columns may be hidden so we need to find the first
// visible column before this column so the column can be moved
// to the appropriate position)
int position = allColumns.indexOf(column);
int from = columnModel.getColumnCount() - 1;
int to = 0;
for (int i = position - 1; i > -1; i--) {
try {
TableColumn visibleColumn = allColumns.get(i);
to = columnModel.getColumnIndex(visibleColumn.getHeaderValue()) + 1;
break;
} catch (IllegalArgumentException e) {
}
}
columnModel.moveColumn(from, to);
columnModel.addColumnModelListener(this);
} } | public class class_name {
private void showColumn(TableColumn column) {
// Ignore changes to the TableColumnModel made by the TableColumnManager
columnModel.removeColumnModelListener(this);
// Add the column to the end of the table
columnModel.addColumn(column);
// Move the column to its position before it was hidden.
// (Multiple columns may be hidden so we need to find the first
// visible column before this column so the column can be moved
// to the appropriate position)
int position = allColumns.indexOf(column);
int from = columnModel.getColumnCount() - 1;
int to = 0;
for (int i = position - 1; i > -1; i--) {
try {
TableColumn visibleColumn = allColumns.get(i);
to = columnModel.getColumnIndex(visibleColumn.getHeaderValue()) + 1;
// depends on control dependency: [try], data = [none]
break;
} catch (IllegalArgumentException e) {
}
// depends on control dependency: [catch], data = [none]
}
columnModel.moveColumn(from, to);
columnModel.addColumnModelListener(this);
} } |
public class class_name {
public static String createTableFromSchema( ASpatialDb db, SimpleFeatureType schema, String newTableName,
boolean avoidSpatialIndex ) throws Exception {
GeometryDescriptor geometryDescriptor = schema.getGeometryDescriptor();
ADatabaseSyntaxHelper dsh = db.getType().getDatabaseSyntaxHelper();
List<String> attrSql = new ArrayList<String>();
List<AttributeDescriptor> attributeDescriptors = schema.getAttributeDescriptors();
for( AttributeDescriptor attributeDescriptor : attributeDescriptors ) {
String attrName = attributeDescriptor.getLocalName();
if (attributeDescriptor instanceof GeometryDescriptor) {
continue;
} else if (attrName.equalsIgnoreCase(ASpatialDb.PK_UID)) {
continue;
}
Class< ? > binding = attributeDescriptor.getType().getBinding();
if (binding.isAssignableFrom(Double.class) || binding.isAssignableFrom(Float.class)) {
attrSql.add(attrName + " " + dsh.REAL());
} else if (binding.isAssignableFrom(Long.class) || binding.isAssignableFrom(Integer.class)) {
attrSql.add(attrName + " " + dsh.INTEGER());
} else if (binding.isAssignableFrom(String.class)) {
attrSql.add(attrName + " " + dsh.TEXT());
} else {
attrSql.add(attrName + " " + dsh.TEXT());
}
}
String typeString = null;
org.opengis.feature.type.GeometryType type = geometryDescriptor.getType();
Class< ? > binding = type.getBinding();
if (binding.isAssignableFrom(MultiPolygon.class)) {
typeString = "MULTIPOLYGON";
} else if (binding.isAssignableFrom(Polygon.class)) {
typeString = "POLYGON";
} else if (binding.isAssignableFrom(MultiLineString.class)) {
typeString = "MULTILINESTRING";
} else if (binding.isAssignableFrom(LineString.class)) {
typeString = "LINESTRING";
} else if (binding.isAssignableFrom(MultiPoint.class)) {
typeString = "MULTIPOINT";
} else if (binding.isAssignableFrom(Point.class)) {
typeString = "POINT";
}
if (typeString != null) {
String codeFromCrs = CrsUtilities.getCodeFromCrs(schema.getCoordinateReferenceSystem());
if (codeFromCrs == null || codeFromCrs.toLowerCase().contains("null")) {
codeFromCrs = "4326"; // fallback on 4326
}
codeFromCrs = codeFromCrs.replaceFirst("EPSG:", "");
if (db instanceof SpatialiteDb) {
SpatialiteDb spatialiteDb = (SpatialiteDb) db;
spatialiteDb.createTable(newTableName, attrSql.toArray(new String[0]));
spatialiteDb.addGeometryXYColumnAndIndex(newTableName, GEOMFIELD_FOR_SHAPEFILE, typeString, codeFromCrs,
avoidSpatialIndex);
} else if (db instanceof PostgisDb) {
PostgisDb postgisDb = (PostgisDb) db;
postgisDb.createTable(newTableName, attrSql.toArray(new String[0]));
postgisDb.addGeometryXYColumnAndIndex(newTableName, GEOMFIELD_FOR_SHAPEFILE, typeString, codeFromCrs,
avoidSpatialIndex);
} else if (db instanceof H2GisDb) {
H2GisDb spatialiteDb = (H2GisDb) db;
String typeStringExtra = typeString;
// String typeStringExtra = "GEOMETRY(" + typeString + "," + codeFromCrs + ")";
attrSql.add(GEOMFIELD_FOR_SHAPEFILE + " " + typeStringExtra);
String[] array = attrSql.toArray(new String[0]);
spatialiteDb.createTable(newTableName, array);
spatialiteDb.addSrid(newTableName, codeFromCrs, GEOMFIELD_FOR_SHAPEFILE);
if (!avoidSpatialIndex)
spatialiteDb.createSpatialIndex(newTableName, GEOMFIELD_FOR_SHAPEFILE);
}
} else {
db.createTable(newTableName, attrSql.toArray(new String[0]));
}
return newTableName;
} } | public class class_name {
public static String createTableFromSchema( ASpatialDb db, SimpleFeatureType schema, String newTableName,
boolean avoidSpatialIndex ) throws Exception {
GeometryDescriptor geometryDescriptor = schema.getGeometryDescriptor();
ADatabaseSyntaxHelper dsh = db.getType().getDatabaseSyntaxHelper();
List<String> attrSql = new ArrayList<String>();
List<AttributeDescriptor> attributeDescriptors = schema.getAttributeDescriptors();
for( AttributeDescriptor attributeDescriptor : attributeDescriptors ) {
String attrName = attributeDescriptor.getLocalName();
if (attributeDescriptor instanceof GeometryDescriptor) {
continue;
} else if (attrName.equalsIgnoreCase(ASpatialDb.PK_UID)) {
continue;
}
Class< ? > binding = attributeDescriptor.getType().getBinding();
if (binding.isAssignableFrom(Double.class) || binding.isAssignableFrom(Float.class)) {
attrSql.add(attrName + " " + dsh.REAL()); // depends on control dependency: [if], data = [none]
} else if (binding.isAssignableFrom(Long.class) || binding.isAssignableFrom(Integer.class)) {
attrSql.add(attrName + " " + dsh.INTEGER()); // depends on control dependency: [if], data = [none]
} else if (binding.isAssignableFrom(String.class)) {
attrSql.add(attrName + " " + dsh.TEXT()); // depends on control dependency: [if], data = [none]
} else {
attrSql.add(attrName + " " + dsh.TEXT()); // depends on control dependency: [if], data = [none]
}
}
String typeString = null;
org.opengis.feature.type.GeometryType type = geometryDescriptor.getType();
Class< ? > binding = type.getBinding();
if (binding.isAssignableFrom(MultiPolygon.class)) {
typeString = "MULTIPOLYGON";
} else if (binding.isAssignableFrom(Polygon.class)) {
typeString = "POLYGON";
} else if (binding.isAssignableFrom(MultiLineString.class)) {
typeString = "MULTILINESTRING";
} else if (binding.isAssignableFrom(LineString.class)) {
typeString = "LINESTRING";
} else if (binding.isAssignableFrom(MultiPoint.class)) {
typeString = "MULTIPOINT";
} else if (binding.isAssignableFrom(Point.class)) {
typeString = "POINT";
}
if (typeString != null) {
String codeFromCrs = CrsUtilities.getCodeFromCrs(schema.getCoordinateReferenceSystem());
if (codeFromCrs == null || codeFromCrs.toLowerCase().contains("null")) {
codeFromCrs = "4326"; // fallback on 4326
}
codeFromCrs = codeFromCrs.replaceFirst("EPSG:", "");
if (db instanceof SpatialiteDb) {
SpatialiteDb spatialiteDb = (SpatialiteDb) db;
spatialiteDb.createTable(newTableName, attrSql.toArray(new String[0]));
spatialiteDb.addGeometryXYColumnAndIndex(newTableName, GEOMFIELD_FOR_SHAPEFILE, typeString, codeFromCrs,
avoidSpatialIndex);
} else if (db instanceof PostgisDb) {
PostgisDb postgisDb = (PostgisDb) db;
postgisDb.createTable(newTableName, attrSql.toArray(new String[0]));
postgisDb.addGeometryXYColumnAndIndex(newTableName, GEOMFIELD_FOR_SHAPEFILE, typeString, codeFromCrs,
avoidSpatialIndex);
} else if (db instanceof H2GisDb) {
H2GisDb spatialiteDb = (H2GisDb) db;
String typeStringExtra = typeString;
// String typeStringExtra = "GEOMETRY(" + typeString + "," + codeFromCrs + ")";
attrSql.add(GEOMFIELD_FOR_SHAPEFILE + " " + typeStringExtra);
String[] array = attrSql.toArray(new String[0]);
spatialiteDb.createTable(newTableName, array);
spatialiteDb.addSrid(newTableName, codeFromCrs, GEOMFIELD_FOR_SHAPEFILE);
if (!avoidSpatialIndex)
spatialiteDb.createSpatialIndex(newTableName, GEOMFIELD_FOR_SHAPEFILE);
}
} else {
db.createTable(newTableName, attrSql.toArray(new String[0]));
}
return newTableName;
} } |
public class class_name {
public void setUseJavaClassPath(boolean isUse) {
if (isUse) {
String classPath = System.getProperty("java.class.path");
String separator = System.getProperty("path.separator");
String[] strings = classPath.split(separator);
for (String path : strings) {
addPath(path);
}
}
} } | public class class_name {
public void setUseJavaClassPath(boolean isUse) {
if (isUse) {
String classPath = System.getProperty("java.class.path");
String separator = System.getProperty("path.separator");
String[] strings = classPath.split(separator);
for (String path : strings) {
addPath(path); // depends on control dependency: [for], data = [path]
}
}
} } |
public class class_name {
public long acquireExecutionMemory(long required, MemoryConsumer consumer) {
assert(required >= 0);
assert(consumer != null);
MemoryMode mode = consumer.getMode();
// If we are allocating Tungsten pages off-heap and receive a request to allocate on-heap
// memory here, then it may not make sense to spill since that would only end up freeing
// off-heap memory. This is subject to change, though, so it may be risky to make this
// optimization now in case we forget to undo it late when making changes.
synchronized (this) {
long got = memoryManager.acquireExecutionMemory(required, taskAttemptId, mode);
// Try to release memory from other consumers first, then we can reduce the frequency of
// spilling, avoid to have too many spilled files.
if (got < required) {
// Call spill() on other consumers to release memory
// Sort the consumers according their memory usage. So we avoid spilling the same consumer
// which is just spilled in last few times and re-spilling on it will produce many small
// spill files.
TreeMap<Long, List<MemoryConsumer>> sortedConsumers = new TreeMap<>();
for (MemoryConsumer c: consumers) {
if (c != consumer && c.getUsed() > 0 && c.getMode() == mode) {
long key = c.getUsed();
List<MemoryConsumer> list =
sortedConsumers.computeIfAbsent(key, k -> new ArrayList<>(1));
list.add(c);
}
}
while (!sortedConsumers.isEmpty()) {
// Get the consumer using the least memory more than the remaining required memory.
Map.Entry<Long, List<MemoryConsumer>> currentEntry =
sortedConsumers.ceilingEntry(required - got);
// No consumer has used memory more than the remaining required memory.
// Get the consumer of largest used memory.
if (currentEntry == null) {
currentEntry = sortedConsumers.lastEntry();
}
List<MemoryConsumer> cList = currentEntry.getValue();
MemoryConsumer c = cList.get(cList.size() - 1);
try {
long released = c.spill(required - got, consumer);
if (released > 0) {
logger.debug("Task {} released {} from {} for {}", taskAttemptId,
Utils.bytesToString(released), c, consumer);
got += memoryManager.acquireExecutionMemory(required - got, taskAttemptId, mode);
if (got >= required) {
break;
}
} else {
cList.remove(cList.size() - 1);
if (cList.isEmpty()) {
sortedConsumers.remove(currentEntry.getKey());
}
}
} catch (ClosedByInterruptException e) {
// This called by user to kill a task (e.g: speculative task).
logger.error("error while calling spill() on " + c, e);
throw new RuntimeException(e.getMessage());
} catch (IOException e) {
logger.error("error while calling spill() on " + c, e);
// checkstyle.off: RegexpSinglelineJava
throw new SparkOutOfMemoryError("error while calling spill() on " + c + " : "
+ e.getMessage());
// checkstyle.on: RegexpSinglelineJava
}
}
}
// call spill() on itself
if (got < required) {
try {
long released = consumer.spill(required - got, consumer);
if (released > 0) {
logger.debug("Task {} released {} from itself ({})", taskAttemptId,
Utils.bytesToString(released), consumer);
got += memoryManager.acquireExecutionMemory(required - got, taskAttemptId, mode);
}
} catch (ClosedByInterruptException e) {
// This called by user to kill a task (e.g: speculative task).
logger.error("error while calling spill() on " + consumer, e);
throw new RuntimeException(e.getMessage());
} catch (IOException e) {
logger.error("error while calling spill() on " + consumer, e);
// checkstyle.off: RegexpSinglelineJava
throw new SparkOutOfMemoryError("error while calling spill() on " + consumer + " : "
+ e.getMessage());
// checkstyle.on: RegexpSinglelineJava
}
}
consumers.add(consumer);
logger.debug("Task {} acquired {} for {}", taskAttemptId, Utils.bytesToString(got), consumer);
return got;
}
} } | public class class_name {
public long acquireExecutionMemory(long required, MemoryConsumer consumer) {
assert(required >= 0);
assert(consumer != null);
MemoryMode mode = consumer.getMode();
// If we are allocating Tungsten pages off-heap and receive a request to allocate on-heap
// memory here, then it may not make sense to spill since that would only end up freeing
// off-heap memory. This is subject to change, though, so it may be risky to make this
// optimization now in case we forget to undo it late when making changes.
synchronized (this) {
long got = memoryManager.acquireExecutionMemory(required, taskAttemptId, mode);
// Try to release memory from other consumers first, then we can reduce the frequency of
// spilling, avoid to have too many spilled files.
if (got < required) {
// Call spill() on other consumers to release memory
// Sort the consumers according their memory usage. So we avoid spilling the same consumer
// which is just spilled in last few times and re-spilling on it will produce many small
// spill files.
TreeMap<Long, List<MemoryConsumer>> sortedConsumers = new TreeMap<>();
for (MemoryConsumer c: consumers) {
if (c != consumer && c.getUsed() > 0 && c.getMode() == mode) {
long key = c.getUsed();
List<MemoryConsumer> list =
sortedConsumers.computeIfAbsent(key, k -> new ArrayList<>(1));
list.add(c); // depends on control dependency: [if], data = [none]
}
}
while (!sortedConsumers.isEmpty()) {
// Get the consumer using the least memory more than the remaining required memory.
Map.Entry<Long, List<MemoryConsumer>> currentEntry =
sortedConsumers.ceilingEntry(required - got);
// No consumer has used memory more than the remaining required memory.
// Get the consumer of largest used memory.
if (currentEntry == null) {
currentEntry = sortedConsumers.lastEntry(); // depends on control dependency: [if], data = [none]
}
List<MemoryConsumer> cList = currentEntry.getValue();
MemoryConsumer c = cList.get(cList.size() - 1);
try {
long released = c.spill(required - got, consumer);
if (released > 0) {
logger.debug("Task {} released {} from {} for {}", taskAttemptId,
Utils.bytesToString(released), c, consumer); // depends on control dependency: [if], data = [none]
got += memoryManager.acquireExecutionMemory(required - got, taskAttemptId, mode); // depends on control dependency: [if], data = [none]
if (got >= required) {
break;
}
} else {
cList.remove(cList.size() - 1); // depends on control dependency: [if], data = [none]
if (cList.isEmpty()) {
sortedConsumers.remove(currentEntry.getKey()); // depends on control dependency: [if], data = [none]
}
}
} catch (ClosedByInterruptException e) {
// This called by user to kill a task (e.g: speculative task).
logger.error("error while calling spill() on " + c, e);
throw new RuntimeException(e.getMessage());
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
logger.error("error while calling spill() on " + c, e);
// checkstyle.off: RegexpSinglelineJava
throw new SparkOutOfMemoryError("error while calling spill() on " + c + " : "
+ e.getMessage());
// checkstyle.on: RegexpSinglelineJava
} // depends on control dependency: [catch], data = [none]
}
}
// call spill() on itself
if (got < required) {
try {
long released = consumer.spill(required - got, consumer);
if (released > 0) {
logger.debug("Task {} released {} from itself ({})", taskAttemptId,
Utils.bytesToString(released), consumer); // depends on control dependency: [if], data = [none]
got += memoryManager.acquireExecutionMemory(required - got, taskAttemptId, mode); // depends on control dependency: [if], data = [none]
}
} catch (ClosedByInterruptException e) {
// This called by user to kill a task (e.g: speculative task).
logger.error("error while calling spill() on " + consumer, e);
throw new RuntimeException(e.getMessage());
} catch (IOException e) { // depends on control dependency: [catch], data = [none]
logger.error("error while calling spill() on " + consumer, e);
// checkstyle.off: RegexpSinglelineJava
throw new SparkOutOfMemoryError("error while calling spill() on " + consumer + " : "
+ e.getMessage());
// checkstyle.on: RegexpSinglelineJava
} // depends on control dependency: [catch], data = [none]
}
consumers.add(consumer);
logger.debug("Task {} acquired {} for {}", taskAttemptId, Utils.bytesToString(got), consumer);
return got;
}
} } |
public class class_name {
@Override
public boolean moveToPosition(int position) {
boolean moved = false;
if (position < invalidPositions.size()) {
currentPosition = position;
int invalidPosition = invalidPositions.get(currentPosition);
moved = cursor.moveToPosition(invalidPosition);
}
return moved;
} } | public class class_name {
@Override
public boolean moveToPosition(int position) {
boolean moved = false;
if (position < invalidPositions.size()) {
currentPosition = position; // depends on control dependency: [if], data = [none]
int invalidPosition = invalidPositions.get(currentPosition);
moved = cursor.moveToPosition(invalidPosition); // depends on control dependency: [if], data = [none]
}
return moved;
} } |
public class class_name {
static PlainDate from(
UnixTime ut,
ZonalOffset offset
) {
long localSeconds = ut.getPosixTime() + offset.getIntegralAmount();
int localNanos = ut.getNanosecond() + offset.getFractionalAmount();
if (localNanos < 0) {
localSeconds--;
} else if (localNanos >= 1000000000) {
localSeconds++;
}
long mjd =
EpochDays.MODIFIED_JULIAN_DATE.transform(
MathUtils.floorDivide(localSeconds, 86400),
EpochDays.UNIX);
long packedDate = GregorianMath.toPackedDate(mjd);
return PlainDate.of(
GregorianMath.readYear(packedDate),
GregorianMath.readMonth(packedDate),
GregorianMath.readDayOfMonth(packedDate)
);
} } | public class class_name {
static PlainDate from(
UnixTime ut,
ZonalOffset offset
) {
long localSeconds = ut.getPosixTime() + offset.getIntegralAmount();
int localNanos = ut.getNanosecond() + offset.getFractionalAmount();
if (localNanos < 0) {
localSeconds--; // depends on control dependency: [if], data = [none]
} else if (localNanos >= 1000000000) {
localSeconds++; // depends on control dependency: [if], data = [none]
}
long mjd =
EpochDays.MODIFIED_JULIAN_DATE.transform(
MathUtils.floorDivide(localSeconds, 86400),
EpochDays.UNIX);
long packedDate = GregorianMath.toPackedDate(mjd);
return PlainDate.of(
GregorianMath.readYear(packedDate),
GregorianMath.readMonth(packedDate),
GregorianMath.readDayOfMonth(packedDate)
);
} } |
public class class_name {
public void requestModificationLock() {
lock.readLock().lock();
if (!veto)
return;
if (throwException) {
lock.readLock().unlock();
throw new OModificationOperationProhibitedException("Modification requests are prohibited");
}
boolean wasInterrupted = false;
Thread thread = Thread.currentThread();
waiters.add(thread);
while (veto) {
LockSupport.park(this);
if (Thread.interrupted())
wasInterrupted = true;
}
waiters.remove(thread);
if (wasInterrupted)
thread.interrupt();
} } | public class class_name {
public void requestModificationLock() {
lock.readLock().lock();
if (!veto)
return;
if (throwException) {
lock.readLock().unlock();
// depends on control dependency: [if], data = [none]
throw new OModificationOperationProhibitedException("Modification requests are prohibited");
}
boolean wasInterrupted = false;
Thread thread = Thread.currentThread();
waiters.add(thread);
while (veto) {
LockSupport.park(this);
// depends on control dependency: [while], data = [none]
if (Thread.interrupted())
wasInterrupted = true;
}
waiters.remove(thread);
if (wasInterrupted)
thread.interrupt();
} } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.