code
stringlengths 130
281k
| code_dependency
stringlengths 182
306k
|
|---|---|
public class class_name {
private static int checkWildCard(final SearchableString value, final Literal suffix, final int start) {
for (final int index : value.getIndices(suffix)) {
if (index >= start) {
return index;
}
}
return -1;
} }
|
public class class_name {
private static int checkWildCard(final SearchableString value, final Literal suffix, final int start) {
for (final int index : value.getIndices(suffix)) {
if (index >= start) {
return index; // depends on control dependency: [if], data = [none]
}
}
return -1;
} }
|
public class class_name {
private long[] determinePreferenceVector(Relation<V> relation, DBIDRef id, DBIDs neighborIDs) {
NumberVector p = relation.get(id);
// variances
final int size = neighborIDs.size(), dim = p.getDimensionality();
double[] sumsq = new double[dim];
for(DBIDIter iter = neighborIDs.iter(); iter.valid(); iter.advance()) {
NumberVector o = relation.get(iter);
for(int d = 0; d < dim; d++) {
final double diff = o.doubleValue(d) - p.doubleValue(d);
sumsq[d] += diff * diff;
}
}
// preference vector
long[] preferenceVector = BitsUtil.zero(dim);
for(int d = 0; d < dim; d++) {
if(sumsq[d] < alpha * size) {
BitsUtil.setI(preferenceVector, d);
}
}
return preferenceVector;
} }
|
public class class_name {
private long[] determinePreferenceVector(Relation<V> relation, DBIDRef id, DBIDs neighborIDs) {
NumberVector p = relation.get(id);
// variances
final int size = neighborIDs.size(), dim = p.getDimensionality();
double[] sumsq = new double[dim];
for(DBIDIter iter = neighborIDs.iter(); iter.valid(); iter.advance()) {
NumberVector o = relation.get(iter);
for(int d = 0; d < dim; d++) {
final double diff = o.doubleValue(d) - p.doubleValue(d);
sumsq[d] += diff * diff; // depends on control dependency: [for], data = [d]
}
}
// preference vector
long[] preferenceVector = BitsUtil.zero(dim);
for(int d = 0; d < dim; d++) {
if(sumsq[d] < alpha * size) {
BitsUtil.setI(preferenceVector, d); // depends on control dependency: [if], data = [none]
}
}
return preferenceVector;
} }
|
public class class_name {
public void introduceServiceToTransports(Iterator<? extends BindingDescriptorRegistrationListener> transports) {
while (transports.hasNext()) {
BindingDescriptorRegistrationListener t = transports.next();
boolean eventTransport = t instanceof EventTransport;
boolean includedEventTransport = false;
if (eventTransport) {
// if it's an event transport then we only want to notify if we've been told that the developer wanted to
// bind to this particular transport (since you can have >1 instance of the event transport currently)
if (eventTransports != null && eventTransports.contains(t)) {
includedEventTransport = true;
}
}
if (!eventTransport || includedEventTransport) {
for (BindingDescriptor bindingDescriptor : getBindingDescriptors()) {
t.notify(bindingDescriptor);
}
}
}
} }
|
public class class_name {
public void introduceServiceToTransports(Iterator<? extends BindingDescriptorRegistrationListener> transports) {
while (transports.hasNext()) {
BindingDescriptorRegistrationListener t = transports.next();
boolean eventTransport = t instanceof EventTransport;
boolean includedEventTransport = false;
if (eventTransport) {
// if it's an event transport then we only want to notify if we've been told that the developer wanted to
// bind to this particular transport (since you can have >1 instance of the event transport currently)
if (eventTransports != null && eventTransports.contains(t)) {
includedEventTransport = true; // depends on control dependency: [if], data = [none]
}
}
if (!eventTransport || includedEventTransport) {
for (BindingDescriptor bindingDescriptor : getBindingDescriptors()) {
t.notify(bindingDescriptor); // depends on control dependency: [for], data = [bindingDescriptor]
}
}
}
} }
|
public class class_name {
public static String encodeReserved(String value, FragmentType type, Charset charset) {
/* value is encoded, we need to split it up and skip the parts that are already encoded */
Matcher matcher = PCT_ENCODED_PATTERN.matcher(value);
if (!matcher.find()) {
return encodeChunk(value, type, charset);
}
int length = value.length();
StringBuilder encoded = new StringBuilder(length + 8);
int index = 0;
do {
/* split out the value before the encoded value */
String before = value.substring(index, matcher.start());
/* encode it */
encoded.append(encodeChunk(before, type, charset));
/* append the encoded value */
encoded.append(matcher.group());
/* update the string search index */
index = matcher.end();
} while (matcher.find());
/* append the rest of the string */
String tail = value.substring(index, length);
encoded.append(encodeChunk(tail, type, charset));
return encoded.toString();
} }
|
public class class_name {
public static String encodeReserved(String value, FragmentType type, Charset charset) {
/* value is encoded, we need to split it up and skip the parts that are already encoded */
Matcher matcher = PCT_ENCODED_PATTERN.matcher(value);
if (!matcher.find()) {
return encodeChunk(value, type, charset); // depends on control dependency: [if], data = [none]
}
int length = value.length();
StringBuilder encoded = new StringBuilder(length + 8);
int index = 0;
do {
/* split out the value before the encoded value */
String before = value.substring(index, matcher.start());
/* encode it */
encoded.append(encodeChunk(before, type, charset));
/* append the encoded value */
encoded.append(matcher.group());
/* update the string search index */
index = matcher.end();
} while (matcher.find());
/* append the rest of the string */
String tail = value.substring(index, length);
encoded.append(encodeChunk(tail, type, charset));
return encoded.toString();
} }
|
public class class_name {
public SignUpRequest withValidationData(AttributeType... validationData) {
if (this.validationData == null) {
setValidationData(new java.util.ArrayList<AttributeType>(validationData.length));
}
for (AttributeType ele : validationData) {
this.validationData.add(ele);
}
return this;
} }
|
public class class_name {
public SignUpRequest withValidationData(AttributeType... validationData) {
if (this.validationData == null) {
setValidationData(new java.util.ArrayList<AttributeType>(validationData.length)); // depends on control dependency: [if], data = [none]
}
for (AttributeType ele : validationData) {
this.validationData.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public static List<Document> convert2DocumentList(String folderPath, boolean verbose)
{
long start = System.currentTimeMillis();
List<File> fileList = IOUtil.fileList(folderPath);
List<Document> documentList = new LinkedList<Document>();
int i = 0;
for (File file : fileList)
{
if (verbose) System.out.print(file);
Document document = convert2Document(file);
documentList.add(document);
if (verbose) System.out.println(" " + ++i + " / " + fileList.size());
}
if (verbose)
{
System.out.println(documentList.size());
System.out.printf("花费时间%d ms\n", System.currentTimeMillis() - start);
}
return documentList;
} }
|
public class class_name {
public static List<Document> convert2DocumentList(String folderPath, boolean verbose)
{
long start = System.currentTimeMillis();
List<File> fileList = IOUtil.fileList(folderPath);
List<Document> documentList = new LinkedList<Document>();
int i = 0;
for (File file : fileList)
{
if (verbose) System.out.print(file);
Document document = convert2Document(file);
documentList.add(document); // depends on control dependency: [for], data = [none]
if (verbose) System.out.println(" " + ++i + " / " + fileList.size());
}
if (verbose)
{
System.out.println(documentList.size()); // depends on control dependency: [if], data = [none]
System.out.printf("花费时间%d ms\n", System.currentTimeMillis() - start); // depends on control dependency: [if], data = [none]
}
return documentList;
} }
|
public class class_name {
public HttpUrl url() {
HttpUrl.Builder urlBuilder = HttpUrl.parse(baseUrl()).newBuilder()
.addPathSegment("styles")
.addPathSegment("v1")
.addPathSegment(user())
.addPathSegment(styleId())
.addPathSegment("static")
.addQueryParameter("access_token", accessToken());
List<String> annotations = new ArrayList<>();
if (staticMarkerAnnotations() != null) {
List<String> markerStrings = new ArrayList<>(staticMarkerAnnotations().size());
for (StaticMarkerAnnotation marker : staticMarkerAnnotations()) {
markerStrings.add(marker.url());
}
annotations.addAll(markerStrings);
}
if (staticPolylineAnnotations() != null) {
String[] polylineStringArray = new String[staticPolylineAnnotations().size()];
for (StaticPolylineAnnotation polyline : staticPolylineAnnotations()) {
polylineStringArray[staticPolylineAnnotations().indexOf(polyline)] = polyline.url();
}
annotations.addAll(Arrays.asList(polylineStringArray));
}
if (geoJson() != null) {
annotations.add(String.format(Locale.US, "geojson(%s)", geoJson().toJson()));
}
if (!annotations.isEmpty()) {
urlBuilder.addPathSegment(TextUtils.join(",", annotations.toArray()));
}
urlBuilder.addPathSegment(cameraAuto() ? CAMERA_AUTO
: generateLocationPathSegment());
if (beforeLayer() != null) {
urlBuilder.addQueryParameter(BEFORE_LAYER, beforeLayer());
}
if (!attribution()) {
urlBuilder.addQueryParameter("attribution", "false");
}
if (!logo()) {
urlBuilder.addQueryParameter("logo", "false");
}
// Has to be last segment in URL
urlBuilder.addPathSegment(generateSizePathSegment());
return urlBuilder.build();
} }
|
public class class_name {
public HttpUrl url() {
HttpUrl.Builder urlBuilder = HttpUrl.parse(baseUrl()).newBuilder()
.addPathSegment("styles")
.addPathSegment("v1")
.addPathSegment(user())
.addPathSegment(styleId())
.addPathSegment("static")
.addQueryParameter("access_token", accessToken());
List<String> annotations = new ArrayList<>();
if (staticMarkerAnnotations() != null) {
List<String> markerStrings = new ArrayList<>(staticMarkerAnnotations().size());
for (StaticMarkerAnnotation marker : staticMarkerAnnotations()) {
markerStrings.add(marker.url()); // depends on control dependency: [for], data = [marker]
}
annotations.addAll(markerStrings); // depends on control dependency: [if], data = [none]
}
if (staticPolylineAnnotations() != null) {
String[] polylineStringArray = new String[staticPolylineAnnotations().size()];
for (StaticPolylineAnnotation polyline : staticPolylineAnnotations()) {
polylineStringArray[staticPolylineAnnotations().indexOf(polyline)] = polyline.url(); // depends on control dependency: [for], data = [polyline]
}
annotations.addAll(Arrays.asList(polylineStringArray)); // depends on control dependency: [if], data = [none]
}
if (geoJson() != null) {
annotations.add(String.format(Locale.US, "geojson(%s)", geoJson().toJson())); // depends on control dependency: [if], data = [none]
}
if (!annotations.isEmpty()) {
urlBuilder.addPathSegment(TextUtils.join(",", annotations.toArray())); // depends on control dependency: [if], data = [none]
}
urlBuilder.addPathSegment(cameraAuto() ? CAMERA_AUTO
: generateLocationPathSegment());
if (beforeLayer() != null) {
urlBuilder.addQueryParameter(BEFORE_LAYER, beforeLayer()); // depends on control dependency: [if], data = [none]
}
if (!attribution()) {
urlBuilder.addQueryParameter("attribution", "false"); // depends on control dependency: [if], data = [none]
}
if (!logo()) {
urlBuilder.addQueryParameter("logo", "false"); // depends on control dependency: [if], data = [none]
}
// Has to be last segment in URL
urlBuilder.addPathSegment(generateSizePathSegment());
return urlBuilder.build();
} }
|
public class class_name {
public static List<LatLonPointNoNormalize> connectLatLonPoints(List<LatLonPoint> points) {
LinkedList<LatLonPointNoNormalize> connectedPoints = new LinkedList<>();
for (LatLonPoint point : points) {
double curLat = point.getLatitude();
double curLon = point.getLongitude();
if (!connectedPoints.isEmpty()) {
double prevLon = connectedPoints.getLast().getLongitude();
curLon = LatLonPointImpl.lonNormal(curLon, prevLon);
}
connectedPoints.add(new LatLonPointNoNormalize(curLat, curLon));
}
return connectedPoints;
} }
|
public class class_name {
public static List<LatLonPointNoNormalize> connectLatLonPoints(List<LatLonPoint> points) {
LinkedList<LatLonPointNoNormalize> connectedPoints = new LinkedList<>();
for (LatLonPoint point : points) {
double curLat = point.getLatitude();
double curLon = point.getLongitude();
if (!connectedPoints.isEmpty()) {
double prevLon = connectedPoints.getLast().getLongitude();
curLon = LatLonPointImpl.lonNormal(curLon, prevLon); // depends on control dependency: [if], data = [none]
}
connectedPoints.add(new LatLonPointNoNormalize(curLat, curLon)); // depends on control dependency: [for], data = [none]
}
return connectedPoints;
} }
|
public class class_name {
public static <S extends Storable> OrderingList<S> get(OrderedProperty<S>... orderings) {
OrderingList<S> list = emptyList();
if (orderings != null && orderings.length > 0) {
for (OrderedProperty<S> property : orderings) {
list = list.concat(property);
}
}
return list;
} }
|
public class class_name {
public static <S extends Storable> OrderingList<S> get(OrderedProperty<S>... orderings) {
OrderingList<S> list = emptyList();
if (orderings != null && orderings.length > 0) {
for (OrderedProperty<S> property : orderings) {
list = list.concat(property);
// depends on control dependency: [for], data = [property]
}
}
return list;
} }
|
public class class_name {
public static boolean sameSubject(SubjectNode s1, String s2) {
if (s1 instanceof URIReference) {
return sameResource((URIReference) s1, s2);
} else {
return false;
}
} }
|
public class class_name {
public static boolean sameSubject(SubjectNode s1, String s2) {
if (s1 instanceof URIReference) {
return sameResource((URIReference) s1, s2); // depends on control dependency: [if], data = [none]
} else {
return false; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
@Nullable
private Map<String, Set<String>> getConstrainingInfo(JavaClass cls, Method m) throws ClassNotFoundException {
String methodName = m.getName();
String methodSig = m.getSignature();
{
// First look for the method in interfaces of the class
JavaClass[] infClasses = cls.getInterfaces();
for (JavaClass infCls : infClasses) {
Method infMethod = findMethod(infCls, methodName, methodSig);
if (infMethod != null) {
return buildConstrainingInfo(infCls, infMethod);
}
Map<String, Set<String>> constrainingExs = getConstrainingInfo(infCls, m);
if (constrainingExs != null) {
return constrainingExs;
}
}
}
{
// Next look at the superclass
JavaClass superCls = cls.getSuperClass();
if (superCls == null) {
return null;
}
Method superMethod = findMethod(superCls, methodName, methodSig);
if (superMethod != null) {
return buildConstrainingInfo(superCls, superMethod);
}
// Otherwise recursively call this on the super class
return getConstrainingInfo(superCls, m);
}
} }
|
public class class_name {
@Nullable
private Map<String, Set<String>> getConstrainingInfo(JavaClass cls, Method m) throws ClassNotFoundException {
String methodName = m.getName();
String methodSig = m.getSignature();
{
// First look for the method in interfaces of the class
JavaClass[] infClasses = cls.getInterfaces();
for (JavaClass infCls : infClasses) {
Method infMethod = findMethod(infCls, methodName, methodSig);
if (infMethod != null) {
return buildConstrainingInfo(infCls, infMethod); // depends on control dependency: [if], data = [none]
}
Map<String, Set<String>> constrainingExs = getConstrainingInfo(infCls, m);
if (constrainingExs != null) {
return constrainingExs; // depends on control dependency: [if], data = [none]
}
}
}
{
// Next look at the superclass
JavaClass superCls = cls.getSuperClass();
if (superCls == null) {
return null; // depends on control dependency: [if], data = [none]
}
Method superMethod = findMethod(superCls, methodName, methodSig);
if (superMethod != null) {
return buildConstrainingInfo(superCls, superMethod); // depends on control dependency: [if], data = [none]
}
// Otherwise recursively call this on the super class
return getConstrainingInfo(superCls, m);
}
} }
|
public class class_name {
private <T> SwingWorker<T,T> studioProcess(final int timeout, final Callable<T> c, final UnaryFunction<Callable<T>,T> f) {
final Callable<T> cw = new Callable<T>() {
public T call() {
final FutureTask<T> t = new FutureTask<T>(c);
try {
executor.submit(t);
return t.get(timeout, TimeUnit.SECONDS);
} catch (Exception ex) {
ex.printStackTrace();
} // end of catch
return null;
}
};
return new SwingWorker<T,T>() {
public T doInBackground() throws Exception {
try {
f.apply(cw);
} finally {
model.setProcessing(false);
} // end of finally
return null;
}
};
} }
|
public class class_name {
private <T> SwingWorker<T,T> studioProcess(final int timeout, final Callable<T> c, final UnaryFunction<Callable<T>,T> f) {
final Callable<T> cw = new Callable<T>() {
public T call() {
final FutureTask<T> t = new FutureTask<T>(c);
try {
executor.submit(t); // depends on control dependency: [try], data = [none]
return t.get(timeout, TimeUnit.SECONDS); // depends on control dependency: [try], data = [none]
} catch (Exception ex) {
ex.printStackTrace();
} // end of catch // depends on control dependency: [catch], data = [none]
return null;
}
};
return new SwingWorker<T,T>() {
public T doInBackground() throws Exception {
try {
f.apply(cw);
} finally {
model.setProcessing(false);
} // end of finally
return null;
}
};
} }
|
public class class_name {
static void apply(final String patchId, final Collection<ContentModification> modifications, final PatchEntry patchEntry, final ContentItemFilter filter) {
for (final ContentModification modification : modifications) {
final ContentItem item = modification.getItem();
// Check if we accept the item
if (!filter.accepts(item)) {
continue;
}
final Location location = new Location(item);
final ContentEntry contentEntry = new ContentEntry(patchId, modification);
ContentTaskDefinition definition = patchEntry.get(location);
if (definition == null) {
definition = new ContentTaskDefinition(location, contentEntry, false);
patchEntry.put(location, definition);
} else {
definition.setTarget(contentEntry);
}
}
} }
|
public class class_name {
static void apply(final String patchId, final Collection<ContentModification> modifications, final PatchEntry patchEntry, final ContentItemFilter filter) {
for (final ContentModification modification : modifications) {
final ContentItem item = modification.getItem();
// Check if we accept the item
if (!filter.accepts(item)) {
continue;
}
final Location location = new Location(item);
final ContentEntry contentEntry = new ContentEntry(patchId, modification);
ContentTaskDefinition definition = patchEntry.get(location);
if (definition == null) {
definition = new ContentTaskDefinition(location, contentEntry, false); // depends on control dependency: [if], data = [none]
patchEntry.put(location, definition); // depends on control dependency: [if], data = [none]
} else {
definition.setTarget(contentEntry); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
private void addParallaxView(View view, int pageIndex) {
if (view instanceof ViewGroup) {
// recurse children
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0, childCount = viewGroup.getChildCount(); i < childCount; i++) {
addParallaxView(viewGroup.getChildAt(i), pageIndex);
}
}
ParallaxViewTag tag = (ParallaxViewTag) view.getTag(R.id.parallax_view_tag);
if (tag != null) {
// only track view if it has a parallax tag
tag.index = pageIndex;
parallaxViews.add(view);
}
} }
|
public class class_name {
private void addParallaxView(View view, int pageIndex) {
if (view instanceof ViewGroup) {
// recurse children
ViewGroup viewGroup = (ViewGroup) view;
for (int i = 0, childCount = viewGroup.getChildCount(); i < childCount; i++) {
addParallaxView(viewGroup.getChildAt(i), pageIndex); // depends on control dependency: [for], data = [i]
}
}
ParallaxViewTag tag = (ParallaxViewTag) view.getTag(R.id.parallax_view_tag);
if (tag != null) {
// only track view if it has a parallax tag
tag.index = pageIndex; // depends on control dependency: [if], data = [none]
parallaxViews.add(view); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private VarSymbol getDefinedSerializableFields(ClassSymbol def) {
Names names = def.name.table.names;
/* SERIALIZABLE_FIELDS can be private,
* so must lookup by ClassSymbol, not by ClassDocImpl.
*/
for (Symbol sym : def.members().getSymbolsByName(names.fromString(SERIALIZABLE_FIELDS))) {
if (sym.kind == VAR) {
VarSymbol f = (VarSymbol)sym;
if ((f.flags() & Flags.STATIC) != 0 &&
(f.flags() & Flags.PRIVATE) != 0) {
return f;
}
}
}
return null;
} }
|
public class class_name {
private VarSymbol getDefinedSerializableFields(ClassSymbol def) {
Names names = def.name.table.names;
/* SERIALIZABLE_FIELDS can be private,
* so must lookup by ClassSymbol, not by ClassDocImpl.
*/
for (Symbol sym : def.members().getSymbolsByName(names.fromString(SERIALIZABLE_FIELDS))) {
if (sym.kind == VAR) {
VarSymbol f = (VarSymbol)sym;
if ((f.flags() & Flags.STATIC) != 0 &&
(f.flags() & Flags.PRIVATE) != 0) {
return f; // depends on control dependency: [if], data = [none]
}
}
}
return null;
} }
|
public class class_name {
protected String processFileName(String name) {
int pos = name.lastIndexOf("/");
if (pos >= 0) {
name = name.substring(pos + 1);
}
pos = name.lastIndexOf("\\");
if (pos >= 0) {
name = name.substring(pos + 1);
}
return name;
} }
|
public class class_name {
protected String processFileName(String name) {
int pos = name.lastIndexOf("/");
if (pos >= 0) {
name = name.substring(pos + 1); // depends on control dependency: [if], data = [(pos]
}
pos = name.lastIndexOf("\\");
if (pos >= 0) {
name = name.substring(pos + 1); // depends on control dependency: [if], data = [(pos]
}
return name;
} }
|
public class class_name {
public static <K, T extends ScheduledTask<K>> TaskScheduler<K, T> get(TaskSchedulerType type, Optional<String> name) {
try {
TaskScheduler<K, T> taskScheduler = type.getTaskSchedulerClass().newInstance();
taskScheduler.start(name);
return taskScheduler;
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException("Unable to instantiate task scheduler '" + name + "'.", e);
}
} }
|
public class class_name {
public static <K, T extends ScheduledTask<K>> TaskScheduler<K, T> get(TaskSchedulerType type, Optional<String> name) {
try {
TaskScheduler<K, T> taskScheduler = type.getTaskSchedulerClass().newInstance();
taskScheduler.start(name); // depends on control dependency: [try], data = [none]
return taskScheduler; // depends on control dependency: [try], data = [none]
} catch (InstantiationException | IllegalAccessException e) {
throw new RuntimeException("Unable to instantiate task scheduler '" + name + "'.", e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private void buildJoinTreeForColumn(String aColName, boolean useOuterJoin, UserAlias aUserAlias, Map pathClasses)
{
String pathName = SqlHelper.cleanPath(aColName);
int sepPos = pathName.lastIndexOf(".");
if (sepPos >= 0)
{
getTableAlias(pathName.substring(0, sepPos), useOuterJoin, aUserAlias,
new String[]{pathName.substring(sepPos + 1)}, pathClasses);
}
} }
|
public class class_name {
private void buildJoinTreeForColumn(String aColName, boolean useOuterJoin, UserAlias aUserAlias, Map pathClasses)
{
String pathName = SqlHelper.cleanPath(aColName);
int sepPos = pathName.lastIndexOf(".");
if (sepPos >= 0)
{
getTableAlias(pathName.substring(0, sepPos), useOuterJoin, aUserAlias,
new String[]{pathName.substring(sepPos + 1)}, pathClasses);
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
private static byte[] manifestKeyToBytes(final String key) {
final byte[] bytes = new byte[key.length()];
for (int i = 0; i < key.length(); i++) {
bytes[i] = (byte) Character.toLowerCase(key.charAt(i));
}
return bytes;
} }
|
public class class_name {
private static byte[] manifestKeyToBytes(final String key) {
final byte[] bytes = new byte[key.length()];
for (int i = 0; i < key.length(); i++) {
bytes[i] = (byte) Character.toLowerCase(key.charAt(i)); // depends on control dependency: [for], data = [i]
}
return bytes;
} }
|
public class class_name {
private void initReporter() {
String reporterType =
System.getProperty("net.spy.metrics.reporter.type", DEFAULT_REPORTER_TYPE);
String reporterInterval =
System.getProperty("net.spy.metrics.reporter.interval", DEFAULT_REPORTER_INTERVAL);
String reporterDir =
System.getProperty("net.spy.metrics.reporter.outdir", DEFAULT_REPORTER_OUTDIR);
if(reporterType.equals("console")) {
final ConsoleReporter reporter = ConsoleReporter.forRegistry(registry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.SECONDS)
.build();
reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
} else if (reporterType.equals("jmx")) {
final JmxReporter reporter = JmxReporter.forRegistry(registry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.SECONDS)
.build();
reporter.start();
} else if (reporterType.equals("csv")) {
final CsvReporter reporter = CsvReporter.forRegistry(registry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.SECONDS)
.build(new File(reporterDir));
reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
} else if (reporterType.equals("slf4j")) {
final Slf4jReporter reporter = Slf4jReporter.forRegistry(registry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.SECONDS)
.outputTo(LoggerFactory.getLogger(MetricCollector.class))
.build();
reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS);
} else {
throw new IllegalStateException("Unknown Metrics Reporter Type: " + reporterType);
}
} }
|
public class class_name {
private void initReporter() {
String reporterType =
System.getProperty("net.spy.metrics.reporter.type", DEFAULT_REPORTER_TYPE);
String reporterInterval =
System.getProperty("net.spy.metrics.reporter.interval", DEFAULT_REPORTER_INTERVAL);
String reporterDir =
System.getProperty("net.spy.metrics.reporter.outdir", DEFAULT_REPORTER_OUTDIR);
if(reporterType.equals("console")) {
final ConsoleReporter reporter = ConsoleReporter.forRegistry(registry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.SECONDS)
.build();
reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS); // depends on control dependency: [if], data = [none]
} else if (reporterType.equals("jmx")) {
final JmxReporter reporter = JmxReporter.forRegistry(registry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.SECONDS)
.build();
reporter.start(); // depends on control dependency: [if], data = [none]
} else if (reporterType.equals("csv")) {
final CsvReporter reporter = CsvReporter.forRegistry(registry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.SECONDS)
.build(new File(reporterDir));
reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS); // depends on control dependency: [if], data = [none]
} else if (reporterType.equals("slf4j")) {
final Slf4jReporter reporter = Slf4jReporter.forRegistry(registry)
.convertRatesTo(TimeUnit.SECONDS)
.convertDurationsTo(TimeUnit.SECONDS)
.outputTo(LoggerFactory.getLogger(MetricCollector.class))
.build();
reporter.start(Integer.parseInt(reporterInterval), TimeUnit.SECONDS); // depends on control dependency: [if], data = [none]
} else {
throw new IllegalStateException("Unknown Metrics Reporter Type: " + reporterType);
}
} }
|
public class class_name {
private void addSource(Object entity, Map<String, Object> values, EntityType entityType)
{
Set<Attribute> attributes = entityType.getAttributes();
for (Attribute attrib : attributes)
{
if (!attrib.isAssociation())
{
Object value = PropertyAccessorHelper.getObject(entity, (Field) attrib.getJavaMember());
values.put(((AbstractAttribute) attrib).getJPAColumnName(), value);
}
}
} }
|
public class class_name {
private void addSource(Object entity, Map<String, Object> values, EntityType entityType)
{
Set<Attribute> attributes = entityType.getAttributes();
for (Attribute attrib : attributes)
{
if (!attrib.isAssociation())
{
Object value = PropertyAccessorHelper.getObject(entity, (Field) attrib.getJavaMember());
values.put(((AbstractAttribute) attrib).getJPAColumnName(), value); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public <T> void set(ElementDescriptor<T> property, T value)
{
if (mSet == null)
{
mSet = new HashMap<ElementDescriptor<?>, Object>(16);
}
mSet.put(property, value);
if (mRemove != null)
{
mRemove.remove(property);
}
} }
|
public class class_name {
public <T> void set(ElementDescriptor<T> property, T value)
{
if (mSet == null)
{
mSet = new HashMap<ElementDescriptor<?>, Object>(16); // depends on control dependency: [if], data = [none]
}
mSet.put(property, value);
if (mRemove != null)
{
mRemove.remove(property); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if (MenuConstants.LOGIN.equalsIgnoreCase(strCommand))
{
Task task = this.getTask();
if (task != null)
{
String strUserName = this.getScreenRecord().getField(UserScreenRecord.USER).toString();
String strPassword = this.getScreenRecord().getField(UserScreenRecord.PASSWORD).toString();
String strOldUserID = this.getProperty(DBParams.USER_ID);
int iErrorCode = task.getApplication().login(task, strUserName, strPassword, this.getProperty(DBParams.DOMAIN));
if (iErrorCode == DBConstants.NORMAL_RETURN)
{
if (this.getScreenRecord().getField(UserScreenRecord.SAVEUSER).getState() == true)
if (((Application)task.getApplication()).getMuffinManager() != null)
if (((Application)task.getApplication()).getMuffinManager().isServiceAvailable())
if (this.getProperty(DBParams.USER_ID) != null)
if (!DBConstants.ANON_USER_ID.equalsIgnoreCase(this.getProperty(DBParams.USER_ID)))
((Application)task.getApplication()).getMuffinManager().setMuffin(DBParams.USER_ID, this.getProperty(DBParams.USER_ID));
if ((strOldUserID == null) || (!strOldUserID.equalsIgnoreCase(this.getProperty(DBParams.USER_ID))))
{ // If user changes, clear history and go home
return this.handleCommand(MenuConstants.HOME, sourceSField, iCommandOptions);
}
else
return this.handleCommand(DBConstants.BACK, sourceSField, iCommandOptions);
}
else
{ // Error - Get and display the error
String strError = task.getLastError(iErrorCode);
this.getScreenRecord().getField(UserScreenRecord.STATUS_LINE).setString(strError);
}
}
// May want to add some code here to login if this is used in thick client
return true;
}
else if (UserEntryScreen.CREATE_NEW_USER.equalsIgnoreCase(strCommand))
{
ScreenLocation itsLocation = null;
BasePanel parentScreen = this.getParentScreen();
if ((iCommandOptions & ScreenConstants.USE_NEW_WINDOW) == ScreenConstants.USE_SAME_WINDOW) // Use same window
itsLocation = this.getScreenLocation();
else
parentScreen = Screen.makeWindow(this.getTask().getApplication());
new UserEntryScreen(null, itsLocation, parentScreen, null, 0, null);
// Add here todo (don)
return true;
}
return super.doCommand(strCommand, sourceSField, iCommandOptions);
} }
|
public class class_name {
public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if (MenuConstants.LOGIN.equalsIgnoreCase(strCommand))
{
Task task = this.getTask();
if (task != null)
{
String strUserName = this.getScreenRecord().getField(UserScreenRecord.USER).toString();
String strPassword = this.getScreenRecord().getField(UserScreenRecord.PASSWORD).toString();
String strOldUserID = this.getProperty(DBParams.USER_ID);
int iErrorCode = task.getApplication().login(task, strUserName, strPassword, this.getProperty(DBParams.DOMAIN));
if (iErrorCode == DBConstants.NORMAL_RETURN)
{
if (this.getScreenRecord().getField(UserScreenRecord.SAVEUSER).getState() == true)
if (((Application)task.getApplication()).getMuffinManager() != null)
if (((Application)task.getApplication()).getMuffinManager().isServiceAvailable())
if (this.getProperty(DBParams.USER_ID) != null)
if (!DBConstants.ANON_USER_ID.equalsIgnoreCase(this.getProperty(DBParams.USER_ID)))
((Application)task.getApplication()).getMuffinManager().setMuffin(DBParams.USER_ID, this.getProperty(DBParams.USER_ID));
if ((strOldUserID == null) || (!strOldUserID.equalsIgnoreCase(this.getProperty(DBParams.USER_ID))))
{ // If user changes, clear history and go home
return this.handleCommand(MenuConstants.HOME, sourceSField, iCommandOptions); // depends on control dependency: [if], data = [none]
}
else
return this.handleCommand(DBConstants.BACK, sourceSField, iCommandOptions);
}
else
{ // Error - Get and display the error
String strError = task.getLastError(iErrorCode);
this.getScreenRecord().getField(UserScreenRecord.STATUS_LINE).setString(strError); // depends on control dependency: [if], data = [none]
}
}
// May want to add some code here to login if this is used in thick client
return true; // depends on control dependency: [if], data = [none]
}
else if (UserEntryScreen.CREATE_NEW_USER.equalsIgnoreCase(strCommand))
{
ScreenLocation itsLocation = null;
BasePanel parentScreen = this.getParentScreen();
if ((iCommandOptions & ScreenConstants.USE_NEW_WINDOW) == ScreenConstants.USE_SAME_WINDOW) // Use same window
itsLocation = this.getScreenLocation();
else
parentScreen = Screen.makeWindow(this.getTask().getApplication());
new UserEntryScreen(null, itsLocation, parentScreen, null, 0, null); // depends on control dependency: [if], data = [none]
// Add here todo (don)
return true; // depends on control dependency: [if], data = [none]
}
return super.doCommand(strCommand, sourceSField, iCommandOptions);
} }
|
public class class_name {
private void encodeBytesBody(StringBuffer result, JsJmsBytesMessage msg) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeBytesBody");
byte[] body = msg.getBytes();
if (body != null) {
result.append('~');
HexString.binToHex(body, 0, body.length, result);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "encodeBytesBody");
} }
|
public class class_name {
private void encodeBytesBody(StringBuffer result, JsJmsBytesMessage msg) {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "encodeBytesBody");
byte[] body = msg.getBytes();
if (body != null) {
result.append('~'); // depends on control dependency: [if], data = [none]
HexString.binToHex(body, 0, body.length, result); // depends on control dependency: [if], data = [(body]
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "encodeBytesBody");
} }
|
public class class_name {
public void marshall(HealthCheckCustomConfig healthCheckCustomConfig, ProtocolMarshaller protocolMarshaller) {
if (healthCheckCustomConfig == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(healthCheckCustomConfig.getFailureThreshold(), FAILURETHRESHOLD_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(HealthCheckCustomConfig healthCheckCustomConfig, ProtocolMarshaller protocolMarshaller) {
if (healthCheckCustomConfig == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(healthCheckCustomConfig.getFailureThreshold(), FAILURETHRESHOLD_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 void prune() {
if (children != null) {
List<String> removeList = new ArrayList<String>();
for (Entry<String, DepTreeNode> entry : children.entrySet()) {
DepTreeNode child = entry.getValue();
child.prune();
if ((child.defineDependencies == null && child.requireDependencies == null && child.uri == null)
&& (child.children == null || child.children.isEmpty())) {
removeList.add(entry.getKey());
}
}
for (String key : removeList) {
children.remove(key);
}
}
} }
|
public class class_name {
public void prune() {
if (children != null) {
List<String> removeList = new ArrayList<String>();
for (Entry<String, DepTreeNode> entry : children.entrySet()) {
DepTreeNode child = entry.getValue();
child.prune();
// depends on control dependency: [for], data = [none]
if ((child.defineDependencies == null && child.requireDependencies == null && child.uri == null)
&& (child.children == null || child.children.isEmpty())) {
removeList.add(entry.getKey());
// depends on control dependency: [if], data = [none]
}
}
for (String key : removeList) {
children.remove(key);
// depends on control dependency: [for], data = [key]
}
}
} }
|
public class class_name {
public Map<String, DesignDocument.View> generateViews(
final Object repository) {
final Map<String, DesignDocument.View> views = new HashMap<String, DesignDocument.View>();
final Class<?> repositoryClass = repository.getClass();
final Class<?> handledType = repository instanceof CouchDbRepositorySupport<?> ? ((CouchDbRepositorySupport<?>) repository)
.getHandledType() : null;
createDeclaredViews(views, repositoryClass);
eachMethod(repositoryClass, new Predicate<Method>() {
public boolean apply(Method input) {
if (hasAnnotation(input, GenerateView.class)) {
generateView(views, input, handledType);
}
return false;
}
});
if (handledType != null) {
views.putAll(generateViewsFromPersistentType(handledType));
}
return views;
} }
|
public class class_name {
public Map<String, DesignDocument.View> generateViews(
final Object repository) {
final Map<String, DesignDocument.View> views = new HashMap<String, DesignDocument.View>();
final Class<?> repositoryClass = repository.getClass();
final Class<?> handledType = repository instanceof CouchDbRepositorySupport<?> ? ((CouchDbRepositorySupport<?>) repository)
.getHandledType() : null;
createDeclaredViews(views, repositoryClass);
eachMethod(repositoryClass, new Predicate<Method>() {
public boolean apply(Method input) {
if (hasAnnotation(input, GenerateView.class)) {
generateView(views, input, handledType); // depends on control dependency: [if], data = [none]
}
return false;
}
});
if (handledType != null) {
views.putAll(generateViewsFromPersistentType(handledType)); // depends on control dependency: [if], data = [(handledType]
}
return views;
} }
|
public class class_name {
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
int action = MotionEventCompat.getActionMasked(ev);
if (stopScrollWhenTouch) {
if ((action == MotionEvent.ACTION_DOWN) && isAutoScroll) {
isStopByTouch = true;
stopAutoScroll();
} else if (ev.getAction() == MotionEvent.ACTION_UP && isStopByTouch) {
startAutoScroll();
}
}
if (slideBorderMode == SLIDE_BORDER_MODE_TO_PARENT || slideBorderMode == SLIDE_BORDER_MODE_CYCLE) {
touchX = ev.getX();
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
downX = touchX;
}
int currentItem = getCurrentItem();
PagerAdapter adapter = getAdapter();
int pageCount = adapter == null ? 0 : adapter.getCount();
/**
* current index is first one and slide to right or current index is last one and slide to left.<br/>
* if slide border mode is to parent, then requestDisallowInterceptTouchEvent false.<br/>
* else scroll to last one when current item is first one, scroll to first one when current item is last
* one.
*/
if ((currentItem == 0 && downX <= touchX) || (currentItem == pageCount - 1 && downX >= touchX)) {
if (slideBorderMode == SLIDE_BORDER_MODE_TO_PARENT) {
getParent().requestDisallowInterceptTouchEvent(false);
} else {
if (pageCount > 1) {
setCurrentItem(pageCount - currentItem - 1, isBorderAnimation);
}
getParent().requestDisallowInterceptTouchEvent(true);
}
return super.dispatchTouchEvent(ev);
}
}
/**
* based on https://github.com/youfacepalm comment to fix the issue
* "don't consume touch event when scroll up or down #29"
*/
if (consumeTouch) {
getParent().requestDisallowInterceptTouchEvent(true);
} else {
getParent().requestDisallowInterceptTouchEvent(false);
if (stopScrollWhenTouch)
startAutoScroll();
}
return super.dispatchTouchEvent(ev);
} }
|
public class class_name {
@Override
public boolean dispatchTouchEvent(MotionEvent ev) {
int action = MotionEventCompat.getActionMasked(ev);
if (stopScrollWhenTouch) {
if ((action == MotionEvent.ACTION_DOWN) && isAutoScroll) {
isStopByTouch = true; // depends on control dependency: [if], data = [none]
stopAutoScroll(); // depends on control dependency: [if], data = [none]
} else if (ev.getAction() == MotionEvent.ACTION_UP && isStopByTouch) {
startAutoScroll(); // depends on control dependency: [if], data = [none]
}
}
if (slideBorderMode == SLIDE_BORDER_MODE_TO_PARENT || slideBorderMode == SLIDE_BORDER_MODE_CYCLE) {
touchX = ev.getX(); // depends on control dependency: [if], data = [none]
if (ev.getAction() == MotionEvent.ACTION_DOWN) {
downX = touchX; // depends on control dependency: [if], data = [none]
}
int currentItem = getCurrentItem();
PagerAdapter adapter = getAdapter();
int pageCount = adapter == null ? 0 : adapter.getCount();
/**
* current index is first one and slide to right or current index is last one and slide to left.<br/>
* if slide border mode is to parent, then requestDisallowInterceptTouchEvent false.<br/>
* else scroll to last one when current item is first one, scroll to first one when current item is last
* one.
*/
if ((currentItem == 0 && downX <= touchX) || (currentItem == pageCount - 1 && downX >= touchX)) {
if (slideBorderMode == SLIDE_BORDER_MODE_TO_PARENT) {
getParent().requestDisallowInterceptTouchEvent(false); // depends on control dependency: [if], data = [none]
} else {
if (pageCount > 1) {
setCurrentItem(pageCount - currentItem - 1, isBorderAnimation); // depends on control dependency: [if], data = [(pageCount]
}
getParent().requestDisallowInterceptTouchEvent(true); // depends on control dependency: [if], data = [none]
}
return super.dispatchTouchEvent(ev); // depends on control dependency: [if], data = [none]
}
}
/**
* based on https://github.com/youfacepalm comment to fix the issue
* "don't consume touch event when scroll up or down #29"
*/
if (consumeTouch) {
getParent().requestDisallowInterceptTouchEvent(true); // depends on control dependency: [if], data = [none]
} else {
getParent().requestDisallowInterceptTouchEvent(false); // depends on control dependency: [if], data = [none]
if (stopScrollWhenTouch)
startAutoScroll();
}
return super.dispatchTouchEvent(ev);
} }
|
public class class_name {
public static List<Field> getAllFields(List<Field> fields, Class<?> clazz)
{
for (Field field : clazz.getDeclaredFields())
{
fields.add(field);
}
if (clazz.getSuperclass() != null)
{
fields = getAllFields(fields, clazz.getSuperclass());
}
return fields;
} }
|
public class class_name {
public static List<Field> getAllFields(List<Field> fields, Class<?> clazz)
{
for (Field field : clazz.getDeclaredFields())
{
fields.add(field); // depends on control dependency: [for], data = [field]
}
if (clazz.getSuperclass() != null)
{
fields = getAllFields(fields, clazz.getSuperclass()); // depends on control dependency: [if], data = [none]
}
return fields;
} }
|
public class class_name {
private static Map<String, Method> getAllMethod(Class<?> clazz, Map<String, Method> methods) {
if (clazz == null || clazz == Object.class) {
return methods;
}
Arrays.stream(clazz.getDeclaredMethods()).forEach(method -> {
String key = String.format("%s:%s", method.getName(),
ByteCodeUtils.getMethodDesc(method));
Method m = methods.get(key);
if (m == null || (m.getDeclaringClass().isInterface()
&& !method.getDeclaringClass().isInterface())) {
methods.put(key, method);
}
});
Arrays.stream(clazz.getInterfaces()).forEach(c -> getAllMethod(c, methods));
return getAllMethod(clazz.getSuperclass(), methods);
} }
|
public class class_name {
private static Map<String, Method> getAllMethod(Class<?> clazz, Map<String, Method> methods) {
if (clazz == null || clazz == Object.class) {
return methods; // depends on control dependency: [if], data = [none]
}
Arrays.stream(clazz.getDeclaredMethods()).forEach(method -> {
String key = String.format("%s:%s", method.getName(),
ByteCodeUtils.getMethodDesc(method));
Method m = methods.get(key);
if (m == null || (m.getDeclaringClass().isInterface()
&& !method.getDeclaringClass().isInterface())) {
methods.put(key, method); // depends on control dependency: [if], data = [none]
}
});
Arrays.stream(clazz.getInterfaces()).forEach(c -> getAllMethod(c, methods));
return getAllMethod(clazz.getSuperclass(), methods);
} }
|
public class class_name {
public static String trimLeft(String str)
{
int start = 0;
for (char c : str.toCharArray()) {
if (c != ' ') {
break;
}
start++;
}
return str.substring(start);
} }
|
public class class_name {
public static String trimLeft(String str)
{
int start = 0;
for (char c : str.toCharArray()) {
if (c != ' ') {
break;
}
start++; // depends on control dependency: [for], data = [none]
}
return str.substring(start);
} }
|
public class class_name {
public ListWebsiteCertificateAuthoritiesResult withWebsiteCertificateAuthorities(WebsiteCaSummary... websiteCertificateAuthorities) {
if (this.websiteCertificateAuthorities == null) {
setWebsiteCertificateAuthorities(new java.util.ArrayList<WebsiteCaSummary>(websiteCertificateAuthorities.length));
}
for (WebsiteCaSummary ele : websiteCertificateAuthorities) {
this.websiteCertificateAuthorities.add(ele);
}
return this;
} }
|
public class class_name {
public ListWebsiteCertificateAuthoritiesResult withWebsiteCertificateAuthorities(WebsiteCaSummary... websiteCertificateAuthorities) {
if (this.websiteCertificateAuthorities == null) {
setWebsiteCertificateAuthorities(new java.util.ArrayList<WebsiteCaSummary>(websiteCertificateAuthorities.length)); // depends on control dependency: [if], data = [none]
}
for (WebsiteCaSummary ele : websiteCertificateAuthorities) {
this.websiteCertificateAuthorities.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
static String expandUriComponent(String source, UriTemplateVariables uriVariables) {
if (source == null) {
return null;
}
if (source.indexOf('{') == -1) {
return source;
}
Matcher matcher = NAMES_PATTERN.matcher(source);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
String match = matcher.group(1);
String variableName = getVariableName(match);
Object variableValue = uriVariables.getValue(variableName);
if (UriTemplateVariables.SKIP_VALUE.equals(variableValue)) {
continue;
}
String variableValueString = getVariableValueAsString(variableValue);
String replacement = Matcher.quoteReplacement(variableValueString);
matcher.appendReplacement(sb, replacement);
}
matcher.appendTail(sb);
return sb.toString();
} }
|
public class class_name {
static String expandUriComponent(String source, UriTemplateVariables uriVariables) {
if (source == null) {
return null; // depends on control dependency: [if], data = [none]
}
if (source.indexOf('{') == -1) {
return source; // depends on control dependency: [if], data = [none]
}
Matcher matcher = NAMES_PATTERN.matcher(source);
StringBuffer sb = new StringBuffer();
while (matcher.find()) {
String match = matcher.group(1);
String variableName = getVariableName(match);
Object variableValue = uriVariables.getValue(variableName);
if (UriTemplateVariables.SKIP_VALUE.equals(variableValue)) {
continue;
}
String variableValueString = getVariableValueAsString(variableValue);
String replacement = Matcher.quoteReplacement(variableValueString);
matcher.appendReplacement(sb, replacement); // depends on control dependency: [while], data = [none]
}
matcher.appendTail(sb);
return sb.toString();
} }
|
public class class_name {
protected final Channel fakeChannel() {
if (channel == null) {
channel = new FakeChannel(eventLoop(), alloc(), remoteAddress(), localAddress());
}
return channel;
} }
|
public class class_name {
protected final Channel fakeChannel() {
if (channel == null) {
channel = new FakeChannel(eventLoop(), alloc(), remoteAddress(), localAddress()); // depends on control dependency: [if], data = [none]
}
return channel;
} }
|
public class class_name {
public void exists(String tableName, String columnName, boolean ignoreCase) throws SQLException
{
if (tableName == null) throw new SQLException("TableName was null. You must specify a valid table name.");
if (columnName == null) throw new SQLException("Column name was null. You must specify a valid column name.");
ResultSet columns = getColumns(tableName);
if(columns == null)
{
//columns not in the cache, look them up and cache
try
{
//System.out.println("DBUtility: looking up table: " + tableName);
//System.out.println("Select * from " + tableName + " where 1=0");
PreparedStatement checkTable = m_connection.prepareStatement("Select * from " + tableName + " where 1=0");
columns = checkTable.executeQuery();
putColumns(tableName, columns);
}
catch(SQLException sqle)
{
if (sqle.getMessage().startsWith(m_ORA_EXCEPTION_1000) || sqle.getMessage().startsWith(m_ORA_EXCEPTION_604))
{
System.out.println("Exceeded available Oracle cursors. Resetting connection and trying the SQL statement again...");
resetConnection();
exists(tableName, columnName, ignoreCase);
}
else
{
System.out.println(sqle.getMessage());
throw sqle;
}
}
}
ResultSetMetaData rsMeta = columns.getMetaData();
int iColumns = rsMeta.getColumnCount();
for(int i = 1; i <= iColumns; i++)
{
if(ignoreCase)
{
//ignore case while testing
if(columnName.equalsIgnoreCase(rsMeta.getColumnName(i)))
{
return;
}
}
else
{
//enforce case-sensitive compare
if(columnName.equals(rsMeta.getColumnName(i)))
{
return;
}
}
//System.out.println("Found column: " + rsMeta.getColumnName(i));
}
throw new SQLException("The column '" + columnName + "' was not found in table '" + tableName + "'.");
} }
|
public class class_name {
public void exists(String tableName, String columnName, boolean ignoreCase) throws SQLException
{
if (tableName == null) throw new SQLException("TableName was null. You must specify a valid table name.");
if (columnName == null) throw new SQLException("Column name was null. You must specify a valid column name.");
ResultSet columns = getColumns(tableName);
if(columns == null)
{
//columns not in the cache, look them up and cache
try
{
//System.out.println("DBUtility: looking up table: " + tableName);
//System.out.println("Select * from " + tableName + " where 1=0");
PreparedStatement checkTable = m_connection.prepareStatement("Select * from " + tableName + " where 1=0");
columns = checkTable.executeQuery();
// depends on control dependency: [try], data = [none]
putColumns(tableName, columns);
// depends on control dependency: [try], data = [none]
}
catch(SQLException sqle)
{
if (sqle.getMessage().startsWith(m_ORA_EXCEPTION_1000) || sqle.getMessage().startsWith(m_ORA_EXCEPTION_604))
{
System.out.println("Exceeded available Oracle cursors. Resetting connection and trying the SQL statement again...");
// depends on control dependency: [if], data = [none]
resetConnection();
// depends on control dependency: [if], data = [none]
exists(tableName, columnName, ignoreCase);
// depends on control dependency: [if], data = [none]
}
else
{
System.out.println(sqle.getMessage());
// depends on control dependency: [if], data = [none]
throw sqle;
}
}
// depends on control dependency: [catch], data = [none]
}
ResultSetMetaData rsMeta = columns.getMetaData();
int iColumns = rsMeta.getColumnCount();
for(int i = 1; i <= iColumns; i++)
{
if(ignoreCase)
{
//ignore case while testing
if(columnName.equalsIgnoreCase(rsMeta.getColumnName(i)))
{
return;
// depends on control dependency: [if], data = [none]
}
}
else
{
//enforce case-sensitive compare
if(columnName.equals(rsMeta.getColumnName(i)))
{
return;
// depends on control dependency: [if], data = [none]
}
}
//System.out.println("Found column: " + rsMeta.getColumnName(i));
}
throw new SQLException("The column '" + columnName + "' was not found in table '" + tableName + "'.");
} }
|
public class class_name {
private void ensureNodeVisible(TreePath nodePath) {
Rectangle bounds = getTreeParam().getPathBounds(nodePath);
if (!getTreeParam().getVisibleRect().contains(bounds)) {
// Just do vertical scrolling.
bounds.x = 0;
getTreeParam().scrollRectToVisible(bounds);
}
} }
|
public class class_name {
private void ensureNodeVisible(TreePath nodePath) {
Rectangle bounds = getTreeParam().getPathBounds(nodePath);
if (!getTreeParam().getVisibleRect().contains(bounds)) {
// Just do vertical scrolling.
bounds.x = 0;
// depends on control dependency: [if], data = [none]
getTreeParam().scrollRectToVisible(bounds);
// depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
void submitForm(CmsForm formParam, final Map<String, String> fieldValues, Set<String> editedFields) {
String modelGroupId = null;
if (CmsInheritanceContainerEditor.getInstance() != null) {
CmsInheritanceContainerEditor.getInstance().onSettingsEdited();
}
if (m_contextsWidget != null) {
String newTemplateContexts = m_contextsWidget.getFormValueAsString();
if ((newTemplateContexts == null) || "".equals(newTemplateContexts)) {
newTemplateContexts = CmsTemplateContextInfo.EMPTY_VALUE;
// translate an empty selection to "none"
}
fieldValues.put(CmsTemplateContextInfo.SETTING, newTemplateContexts);
}
final boolean hasFormatterChanges;
if (m_formatterSelect != null) {
fieldValues.put(
CmsFormatterConfig.getSettingsKeyForContainer(m_containerId),
m_formatterSelect.getFormValueAsString());
hasFormatterChanges = true;
} else {
hasFormatterChanges = false;
}
if (m_createNewCheckBox != null) {
m_elementWidget.setCreateNew(m_createNewCheckBox.isChecked());
fieldValues.put(CmsContainerElement.CREATE_AS_NEW, Boolean.toString(m_createNewCheckBox.isChecked()));
}
if (m_modelGroupSelect != null) {
GroupOption group = GroupOption.valueOf(m_modelGroupSelect.getFormValueAsString());
switch (group) {
case disabled:
fieldValues.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.noGroup.name());
fieldValues.put(CmsContainerElement.USE_AS_COPY_MODEL, Boolean.toString(false));
break;
case copy:
fieldValues.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.isModelGroup.name());
fieldValues.put(CmsContainerElement.USE_AS_COPY_MODEL, Boolean.toString(true));
break;
case reuse:
fieldValues.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.isModelGroup.name());
fieldValues.put(CmsContainerElement.USE_AS_COPY_MODEL, Boolean.toString(false));
break;
default:
break;
}
if (group != GroupOption.disabled) {
modelGroupId = CmsContainerpageController.getServerId(m_elementBean.getClientId());
}
}
if ((m_modelGroupBreakUp != null) && m_modelGroupBreakUp.isChecked()) {
fieldValues.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.noGroup.name());
}
final Map<String, String> filteredFieldValues = new HashMap<String, String>();
for (Map.Entry<String, String> entry : fieldValues.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if ((value != null) && (value.length() > 0)) {
filteredFieldValues.put(key, value);
}
}
final String changeModelGroupId = modelGroupId;
m_controller.reloadElementWithSettings(
m_elementWidget,
m_elementBean.getClientId(),
filteredFieldValues,
new I_CmsSimpleCallback<CmsContainerPageElementPanel>() {
public void execute(CmsContainerPageElementPanel result) {
if (isTemplateContextChanged()) {
// if the context multiselect box isn't displayed, of course it can't change values,
// and this code won't be executed.
CmsContainerpageController.get().handleChangeTemplateContext(
result,
filteredFieldValues.get(CmsTemplateContextInfo.SETTING));
}
if (hasFormatterChanges) {
updateCss();
}
if (result.getElement().getInnerHTML().contains(CmsGwtConstants.FORMATTER_RELOAD_MARKER)
&& !CmsContainerpageController.get().isGroupcontainerEditing()) {
CmsContainerpageController.get().reloadPage();
}
if (m_modelGroupSelect != null) {
m_controller.setModelGroupElementId(changeModelGroupId);
}
}
});
} }
|
public class class_name {
void submitForm(CmsForm formParam, final Map<String, String> fieldValues, Set<String> editedFields) {
String modelGroupId = null;
if (CmsInheritanceContainerEditor.getInstance() != null) {
CmsInheritanceContainerEditor.getInstance().onSettingsEdited(); // depends on control dependency: [if], data = [none]
}
if (m_contextsWidget != null) {
String newTemplateContexts = m_contextsWidget.getFormValueAsString();
if ((newTemplateContexts == null) || "".equals(newTemplateContexts)) {
newTemplateContexts = CmsTemplateContextInfo.EMPTY_VALUE; // depends on control dependency: [if], data = [none]
// translate an empty selection to "none"
}
fieldValues.put(CmsTemplateContextInfo.SETTING, newTemplateContexts); // depends on control dependency: [if], data = [none]
}
final boolean hasFormatterChanges;
if (m_formatterSelect != null) {
fieldValues.put(
CmsFormatterConfig.getSettingsKeyForContainer(m_containerId),
m_formatterSelect.getFormValueAsString()); // depends on control dependency: [if], data = [none]
hasFormatterChanges = true; // depends on control dependency: [if], data = [none]
} else {
hasFormatterChanges = false; // depends on control dependency: [if], data = [none]
}
if (m_createNewCheckBox != null) {
m_elementWidget.setCreateNew(m_createNewCheckBox.isChecked()); // depends on control dependency: [if], data = [(m_createNewCheckBox]
fieldValues.put(CmsContainerElement.CREATE_AS_NEW, Boolean.toString(m_createNewCheckBox.isChecked())); // depends on control dependency: [if], data = [(m_createNewCheckBox]
}
if (m_modelGroupSelect != null) {
GroupOption group = GroupOption.valueOf(m_modelGroupSelect.getFormValueAsString());
switch (group) {
case disabled:
fieldValues.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.noGroup.name());
fieldValues.put(CmsContainerElement.USE_AS_COPY_MODEL, Boolean.toString(false));
break;
case copy:
fieldValues.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.isModelGroup.name());
fieldValues.put(CmsContainerElement.USE_AS_COPY_MODEL, Boolean.toString(true));
break;
case reuse:
fieldValues.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.isModelGroup.name());
fieldValues.put(CmsContainerElement.USE_AS_COPY_MODEL, Boolean.toString(false));
break;
default:
break;
}
if (group != GroupOption.disabled) {
modelGroupId = CmsContainerpageController.getServerId(m_elementBean.getClientId()); // depends on control dependency: [if], data = [none]
}
}
if ((m_modelGroupBreakUp != null) && m_modelGroupBreakUp.isChecked()) {
fieldValues.put(CmsContainerElement.MODEL_GROUP_STATE, ModelGroupState.noGroup.name()); // depends on control dependency: [if], data = [none]
}
final Map<String, String> filteredFieldValues = new HashMap<String, String>();
for (Map.Entry<String, String> entry : fieldValues.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
if ((value != null) && (value.length() > 0)) {
filteredFieldValues.put(key, value); // depends on control dependency: [if], data = [none]
}
}
final String changeModelGroupId = modelGroupId;
m_controller.reloadElementWithSettings(
m_elementWidget,
m_elementBean.getClientId(),
filteredFieldValues,
new I_CmsSimpleCallback<CmsContainerPageElementPanel>() {
public void execute(CmsContainerPageElementPanel result) {
if (isTemplateContextChanged()) {
// if the context multiselect box isn't displayed, of course it can't change values,
// and this code won't be executed.
CmsContainerpageController.get().handleChangeTemplateContext(
result,
filteredFieldValues.get(CmsTemplateContextInfo.SETTING)); // depends on control dependency: [if], data = [none]
}
if (hasFormatterChanges) {
updateCss(); // depends on control dependency: [if], data = [none]
}
if (result.getElement().getInnerHTML().contains(CmsGwtConstants.FORMATTER_RELOAD_MARKER)
&& !CmsContainerpageController.get().isGroupcontainerEditing()) {
CmsContainerpageController.get().reloadPage(); // depends on control dependency: [if], data = [none]
}
if (m_modelGroupSelect != null) {
m_controller.setModelGroupElementId(changeModelGroupId); // depends on control dependency: [if], data = [none]
}
}
});
} }
|
public class class_name {
public void marshall(GeoMatchSetSummary geoMatchSetSummary, ProtocolMarshaller protocolMarshaller) {
if (geoMatchSetSummary == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(geoMatchSetSummary.getGeoMatchSetId(), GEOMATCHSETID_BINDING);
protocolMarshaller.marshall(geoMatchSetSummary.getName(), NAME_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(GeoMatchSetSummary geoMatchSetSummary, ProtocolMarshaller protocolMarshaller) {
if (geoMatchSetSummary == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(geoMatchSetSummary.getGeoMatchSetId(), GEOMATCHSETID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(geoMatchSetSummary.getName(), NAME_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 String extractAccessKey(HttpServletRequest request) {
if (request == null) {
return "";
}
String accessKey = "";
String auth = request.getHeader(HttpHeaders.AUTHORIZATION);
boolean isAnonymousRequest = isAnonymousRequest(request);
if (StringUtils.isBlank(auth)) {
auth = request.getParameter("X-Amz-Credential");
if (!StringUtils.isBlank(auth)) {
accessKey = StringUtils.substringBetween(auth, "=", "/");
}
} else {
if (isAnonymousRequest) {
accessKey = StringUtils.substringAfter(auth, "Anonymous").trim();
} else {
accessKey = StringUtils.substringBetween(auth, "=", "/");
}
}
if (isAnonymousRequest && StringUtils.isBlank(accessKey)) {
// try to get access key from parameter
accessKey = request.getParameter("accessKey");
}
return accessKey;
} }
|
public class class_name {
public static String extractAccessKey(HttpServletRequest request) {
if (request == null) {
return ""; // depends on control dependency: [if], data = [none]
}
String accessKey = "";
String auth = request.getHeader(HttpHeaders.AUTHORIZATION);
boolean isAnonymousRequest = isAnonymousRequest(request);
if (StringUtils.isBlank(auth)) {
auth = request.getParameter("X-Amz-Credential"); // depends on control dependency: [if], data = [none]
if (!StringUtils.isBlank(auth)) {
accessKey = StringUtils.substringBetween(auth, "=", "/"); // depends on control dependency: [if], data = [none]
}
} else {
if (isAnonymousRequest) {
accessKey = StringUtils.substringAfter(auth, "Anonymous").trim(); // depends on control dependency: [if], data = [none]
} else {
accessKey = StringUtils.substringBetween(auth, "=", "/"); // depends on control dependency: [if], data = [none]
}
}
if (isAnonymousRequest && StringUtils.isBlank(accessKey)) {
// try to get access key from parameter
accessKey = request.getParameter("accessKey"); // depends on control dependency: [if], data = [none]
}
return accessKey;
} }
|
public class class_name {
@Override
public void deliver(Postcard postcard) {
final SMailPostingMessage message = createMailMessage(postcard);
if (isCancel(postcard)) {
return; // no logging here, only filter knows the reason
}
prepareAddress(postcard, message);
prepareSubject(postcard, message);
prepareBody(postcard, message);
prepareAsync(postcard);
prepareRetry(postcard);
disclosePostingState(postcard, message);
hookPreparedMessage(postcard, message);
if (postcard.isDryrun()) {
logger.debug("*dryrun: postcard={}", postcard); // normal logging here
return;
}
send(postcard, message);
} }
|
public class class_name {
@Override
public void deliver(Postcard postcard) {
final SMailPostingMessage message = createMailMessage(postcard);
if (isCancel(postcard)) {
return; // no logging here, only filter knows the reason // depends on control dependency: [if], data = [none]
}
prepareAddress(postcard, message);
prepareSubject(postcard, message);
prepareBody(postcard, message);
prepareAsync(postcard);
prepareRetry(postcard);
disclosePostingState(postcard, message);
hookPreparedMessage(postcard, message);
if (postcard.isDryrun()) {
logger.debug("*dryrun: postcard={}", postcard); // normal logging here // depends on control dependency: [if], data = [none]
return; // depends on control dependency: [if], data = [none]
}
send(postcard, message);
} }
|
public class class_name {
private void drawPEHeaders() {
long msdosOffset = 0;
long msdosSize = withMinLength(data.getMSDOSHeader().getHeaderSize());
drawPixels(colorMap.get(MSDOS_HEADER), msdosOffset, msdosSize);
long optOffset = data.getOptionalHeader().getOffset();
long optSize = withMinLength(data.getOptionalHeader().getSize());
drawPixels(colorMap.get(OPTIONAL_HEADER), optOffset, optSize);
long coffOffset = data.getCOFFFileHeader().getOffset();
long coffSize = withMinLength(COFFFileHeader.HEADER_SIZE);
drawPixels(colorMap.get(COFF_FILE_HEADER), coffOffset, coffSize);
long tableOffset = data.getSectionTable().getOffset();
long tableSize = data.getSectionTable().getSize();
if (tableSize != 0) {
tableSize = withMinLength(tableSize);
drawPixels(colorMap.get(SECTION_TABLE), tableOffset, tableSize);
}
} }
|
public class class_name {
private void drawPEHeaders() {
long msdosOffset = 0;
long msdosSize = withMinLength(data.getMSDOSHeader().getHeaderSize());
drawPixels(colorMap.get(MSDOS_HEADER), msdosOffset, msdosSize);
long optOffset = data.getOptionalHeader().getOffset();
long optSize = withMinLength(data.getOptionalHeader().getSize());
drawPixels(colorMap.get(OPTIONAL_HEADER), optOffset, optSize);
long coffOffset = data.getCOFFFileHeader().getOffset();
long coffSize = withMinLength(COFFFileHeader.HEADER_SIZE);
drawPixels(colorMap.get(COFF_FILE_HEADER), coffOffset, coffSize);
long tableOffset = data.getSectionTable().getOffset();
long tableSize = data.getSectionTable().getSize();
if (tableSize != 0) {
tableSize = withMinLength(tableSize); // depends on control dependency: [if], data = [(tableSize]
drawPixels(colorMap.get(SECTION_TABLE), tableOffset, tableSize); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public ProvenancedConfusionMatrix<CellFiller> filteredCopy(Predicate<CellFiller> predicate) {
final ImmutableTable.Builder<Symbol, Symbol, List<CellFiller>> newTable =
ImmutableTable.builder();
for (final Cell<Symbol, Symbol, List<CellFiller>> curCell : table.cellSet()) {
final List<CellFiller> newFiller = FluentIterable.from(curCell.getValue())
.filter(predicate).toList();
if (!newFiller.isEmpty()) {
newTable.put(curCell.getRowKey(), curCell.getColumnKey(), newFiller);
}
}
return new ProvenancedConfusionMatrix<CellFiller>(newTable.build());
} }
|
public class class_name {
public ProvenancedConfusionMatrix<CellFiller> filteredCopy(Predicate<CellFiller> predicate) {
final ImmutableTable.Builder<Symbol, Symbol, List<CellFiller>> newTable =
ImmutableTable.builder();
for (final Cell<Symbol, Symbol, List<CellFiller>> curCell : table.cellSet()) {
final List<CellFiller> newFiller = FluentIterable.from(curCell.getValue())
.filter(predicate).toList();
if (!newFiller.isEmpty()) {
newTable.put(curCell.getRowKey(), curCell.getColumnKey(), newFiller); // depends on control dependency: [if], data = [none]
}
}
return new ProvenancedConfusionMatrix<CellFiller>(newTable.build());
} }
|
public class class_name {
private void evict(Node candidate) {
if (data.size() > maximumSize) {
Node evict;
Node victim = head.next;
if (admittor.admit(candidate.key, victim.key)) {
evict = victim;
} else if (adapt(candidate)) {
evict = victim;
} else {
evict = candidate;
feedback.put(candidate.key);
}
data.remove(evict.key);
evict.remove();
policyStats.recordEviction();
}
} }
|
public class class_name {
private void evict(Node candidate) {
if (data.size() > maximumSize) {
Node evict;
Node victim = head.next;
if (admittor.admit(candidate.key, victim.key)) {
evict = victim; // depends on control dependency: [if], data = [none]
} else if (adapt(candidate)) {
evict = victim; // depends on control dependency: [if], data = [none]
} else {
evict = candidate; // depends on control dependency: [if], data = [none]
feedback.put(candidate.key); // depends on control dependency: [if], data = [none]
}
data.remove(evict.key); // depends on control dependency: [if], data = [none]
evict.remove(); // depends on control dependency: [if], data = [none]
policyStats.recordEviction(); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public void addComponentInterceptors(List<InterceptorFactory> factory, int priority, boolean publicOnly) {
for (Method method : (Iterable<Method>)classIndex.getClassMethods()) {
if (publicOnly && !Modifier.isPublic(method.getModifiers())) {
continue;
}
OrderedItemContainer<List<InterceptorFactory>> interceptors = componentInterceptors.get(method);
if (interceptors == null) {
componentInterceptors.put(method, interceptors = new OrderedItemContainer<List<InterceptorFactory>>());
}
interceptors.add(factory, priority);
}
} }
|
public class class_name {
public void addComponentInterceptors(List<InterceptorFactory> factory, int priority, boolean publicOnly) {
for (Method method : (Iterable<Method>)classIndex.getClassMethods()) {
if (publicOnly && !Modifier.isPublic(method.getModifiers())) {
continue;
}
OrderedItemContainer<List<InterceptorFactory>> interceptors = componentInterceptors.get(method);
if (interceptors == null) {
componentInterceptors.put(method, interceptors = new OrderedItemContainer<List<InterceptorFactory>>()); // depends on control dependency: [if], data = [none]
}
interceptors.add(factory, priority); // depends on control dependency: [for], data = [none]
}
} }
|
public class class_name {
@Nonnull
public static EChange setAll (final boolean bResponseCompressionEnabled,
final boolean bResponseGzipEnabled,
final boolean bResponseDeflateEnabled)
{
return s_aRWLock.writeLocked ( () -> {
EChange eChange = EChange.UNCHANGED;
if (s_bResponseCompressionEnabled != bResponseCompressionEnabled)
{
s_bResponseCompressionEnabled = bResponseCompressionEnabled;
eChange = EChange.CHANGED;
LOGGER.info ("ResponseHelper responseCompressEnabled=" + bResponseCompressionEnabled);
}
if (s_bResponseGzipEnabled != bResponseGzipEnabled)
{
s_bResponseGzipEnabled = bResponseGzipEnabled;
eChange = EChange.CHANGED;
LOGGER.info ("ResponseHelper responseGzipEnabled=" + bResponseGzipEnabled);
}
if (s_bResponseDeflateEnabled != bResponseDeflateEnabled)
{
s_bResponseDeflateEnabled = bResponseDeflateEnabled;
eChange = EChange.CHANGED;
LOGGER.info ("ResponseHelper responseDeflateEnabled=" + bResponseDeflateEnabled);
}
return eChange;
});
} }
|
public class class_name {
@Nonnull
public static EChange setAll (final boolean bResponseCompressionEnabled,
final boolean bResponseGzipEnabled,
final boolean bResponseDeflateEnabled)
{
return s_aRWLock.writeLocked ( () -> {
EChange eChange = EChange.UNCHANGED;
if (s_bResponseCompressionEnabled != bResponseCompressionEnabled)
{
s_bResponseCompressionEnabled = bResponseCompressionEnabled; // depends on control dependency: [if], data = [none]
eChange = EChange.CHANGED; // depends on control dependency: [if], data = [none]
LOGGER.info ("ResponseHelper responseCompressEnabled=" + bResponseCompressionEnabled); // depends on control dependency: [if], data = [bResponseCompressionEnabled)]
}
if (s_bResponseGzipEnabled != bResponseGzipEnabled)
{
s_bResponseGzipEnabled = bResponseGzipEnabled; // depends on control dependency: [if], data = [none]
eChange = EChange.CHANGED; // depends on control dependency: [if], data = [none]
LOGGER.info ("ResponseHelper responseGzipEnabled=" + bResponseGzipEnabled); // depends on control dependency: [if], data = [bResponseGzipEnabled)]
}
if (s_bResponseDeflateEnabled != bResponseDeflateEnabled)
{
s_bResponseDeflateEnabled = bResponseDeflateEnabled; // depends on control dependency: [if], data = [none]
eChange = EChange.CHANGED; // depends on control dependency: [if], data = [none]
LOGGER.info ("ResponseHelper responseDeflateEnabled=" + bResponseDeflateEnabled); // depends on control dependency: [if], data = [bResponseDeflateEnabled)]
}
return eChange;
});
} }
|
public class class_name {
private void subset(RuntimeSubexpression sub, int begin, int end) {
int n = sub.number;
assert n > 0;
while (match.size() < (n + 1)) {
match.add(null);
}
match.set(n, new RegMatch(begin, end));
} }
|
public class class_name {
private void subset(RuntimeSubexpression sub, int begin, int end) {
int n = sub.number;
assert n > 0;
while (match.size() < (n + 1)) {
match.add(null); // depends on control dependency: [while], data = [none]
}
match.set(n, new RegMatch(begin, end));
} }
|
public class class_name {
public void invalidate(String id) {
if(lur instanceof EpiLur) {
((EpiLur)lur).remove(id);
} else if(lur instanceof CachingLur) {
((CachingLur<?>)lur).remove(id);
}
} }
|
public class class_name {
public void invalidate(String id) {
if(lur instanceof EpiLur) {
((EpiLur)lur).remove(id); // depends on control dependency: [if], data = [none]
} else if(lur instanceof CachingLur) {
((CachingLur<?>)lur).remove(id); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
protected StateHelper getStateHelper(boolean create)
{
if (_stateHelper != null)
{
return _stateHelper;
}
if (create)
{
_stateHelper = new _DeltaStateHelper(this);
}
return _stateHelper;
} }
|
public class class_name {
protected StateHelper getStateHelper(boolean create)
{
if (_stateHelper != null)
{
return _stateHelper; // depends on control dependency: [if], data = [none]
}
if (create)
{
_stateHelper = new _DeltaStateHelper(this); // depends on control dependency: [if], data = [none]
}
return _stateHelper;
} }
|
public class class_name {
public void closeConnection(String id){
JSONObject packet = new JSONObject();
try {
if (!this.peers.containsKey(id)) return;
PnPeer peer = this.peers.get(id);
peer.hangup();
packet.put(PnRTCMessage.JSON_HANGUP, true);
transmitMessage(id, packet);
mRtcListener.onPeerConnectionClosed(peer);
} catch (JSONException e){
e.printStackTrace();
}
} }
|
public class class_name {
public void closeConnection(String id){
JSONObject packet = new JSONObject();
try {
if (!this.peers.containsKey(id)) return;
PnPeer peer = this.peers.get(id);
peer.hangup(); // depends on control dependency: [try], data = [none]
packet.put(PnRTCMessage.JSON_HANGUP, true); // depends on control dependency: [try], data = [none]
transmitMessage(id, packet); // depends on control dependency: [try], data = [none]
mRtcListener.onPeerConnectionClosed(peer); // depends on control dependency: [try], data = [none]
} catch (JSONException e){
e.printStackTrace();
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
public static INDArray max(INDArray x, INDArray y, INDArray z, int... dimensions) {
if(dimensions == null || dimensions.length == 0) {
validateShapesNoDimCase(x,y,z);
return Nd4j.getExecutioner().exec(new OldMax(x,y,z));
}
return Nd4j.getExecutioner().exec(new BroadcastMax(x,y,z,dimensions));
} }
|
public class class_name {
public static INDArray max(INDArray x, INDArray y, INDArray z, int... dimensions) {
if(dimensions == null || dimensions.length == 0) {
validateShapesNoDimCase(x,y,z); // depends on control dependency: [if], data = [none]
return Nd4j.getExecutioner().exec(new OldMax(x,y,z)); // depends on control dependency: [if], data = [none]
}
return Nd4j.getExecutioner().exec(new BroadcastMax(x,y,z,dimensions));
} }
|
public class class_name {
private static boolean isArrayFromUbiquitousMethod(OpcodeStack.Item item) {
XMethod method = item.getReturnValueOf();
if (method == null) {
return false;
}
FQMethod methodDesc = new FQMethod(method.getClassName().replace('.', '/'), method.getName(), method.getSignature());
return ubiquitousMethods.contains(methodDesc);
} }
|
public class class_name {
private static boolean isArrayFromUbiquitousMethod(OpcodeStack.Item item) {
XMethod method = item.getReturnValueOf();
if (method == null) {
return false; // depends on control dependency: [if], data = [none]
}
FQMethod methodDesc = new FQMethod(method.getClassName().replace('.', '/'), method.getName(), method.getSignature());
return ubiquitousMethods.contains(methodDesc);
} }
|
public class class_name {
private void addText(TextCursor cursor, int limit, ArrayList<MDText> elements) {
if (cursor.currentOffset < limit) {
elements.add(new MDRawText(cursor.text.substring(cursor.currentOffset, limit)));
cursor.currentOffset = limit;
}
} }
|
public class class_name {
private void addText(TextCursor cursor, int limit, ArrayList<MDText> elements) {
if (cursor.currentOffset < limit) {
elements.add(new MDRawText(cursor.text.substring(cursor.currentOffset, limit))); // depends on control dependency: [if], data = [(cursor.currentOffset]
cursor.currentOffset = limit; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static void sleepUninterruptibly(final long timeoutInMillis) {
if (timeoutInMillis <= 0) {
return;
}
boolean interrupted = false;
try {
long remainingNanos = TimeUnit.MILLISECONDS.toNanos(timeoutInMillis);
final long sysNanos = System.nanoTime();
final long end = remainingNanos >= Long.MAX_VALUE - sysNanos ? Long.MAX_VALUE : sysNanos + remainingNanos;
while (true) {
try {
// TimeUnit.sleep() treats negative timeouts just like zero.
TimeUnit.NANOSECONDS.sleep(remainingNanos);
return;
} catch (InterruptedException e) {
interrupted = true;
remainingNanos = end - System.nanoTime();
}
}
} finally {
if (interrupted) {
Thread.currentThread().interrupt();
}
}
} }
|
public class class_name {
public static void sleepUninterruptibly(final long timeoutInMillis) {
if (timeoutInMillis <= 0) {
return;
// depends on control dependency: [if], data = [none]
}
boolean interrupted = false;
try {
long remainingNanos = TimeUnit.MILLISECONDS.toNanos(timeoutInMillis);
final long sysNanos = System.nanoTime();
final long end = remainingNanos >= Long.MAX_VALUE - sysNanos ? Long.MAX_VALUE : sysNanos + remainingNanos;
while (true) {
try {
// TimeUnit.sleep() treats negative timeouts just like zero.
TimeUnit.NANOSECONDS.sleep(remainingNanos);
// depends on control dependency: [try], data = [none]
return;
// depends on control dependency: [try], data = [none]
} catch (InterruptedException e) {
interrupted = true;
remainingNanos = end - System.nanoTime();
}
// depends on control dependency: [catch], data = [none]
}
} finally {
if (interrupted) {
Thread.currentThread().interrupt();
// depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public long getMillisecondsFromId(final Object id, final long offset) {
if (id instanceof String && id.toString().length() >= MAX_LONG_ALPHANUMERIC_VALUE_LENGTH) {
final char[] buffer = new char[MAX_LONG_ALPHANUMERIC_VALUE_LENGTH];
System.arraycopy(
id.toString().toCharArray(), 0, buffer, 0, MAX_LONG_ALPHANUMERIC_VALUE_LENGTH);
final boolean overflow = buffer[0] > '1';
if (overflow) {
buffer[0] -= 2;
}
long value = Long.parseLong(new String(buffer), ALPHA_NUMERIC_CHARSET_SIZE);
if (overflow) {
value -= Long.MAX_VALUE + 1;
}
return value + offset;
}
throw new IllegalArgumentException("'" + id + "' is not an id from this generator");
} }
|
public class class_name {
public long getMillisecondsFromId(final Object id, final long offset) {
if (id instanceof String && id.toString().length() >= MAX_LONG_ALPHANUMERIC_VALUE_LENGTH) {
final char[] buffer = new char[MAX_LONG_ALPHANUMERIC_VALUE_LENGTH];
System.arraycopy(
id.toString().toCharArray(), 0, buffer, 0, MAX_LONG_ALPHANUMERIC_VALUE_LENGTH); // depends on control dependency: [if], data = [none]
final boolean overflow = buffer[0] > '1';
if (overflow) {
buffer[0] -= 2; // depends on control dependency: [if], data = [none]
}
long value = Long.parseLong(new String(buffer), ALPHA_NUMERIC_CHARSET_SIZE);
if (overflow) {
value -= Long.MAX_VALUE + 1; // depends on control dependency: [if], data = [none]
}
return value + offset; // depends on control dependency: [if], data = [none]
}
throw new IllegalArgumentException("'" + id + "' is not an id from this generator");
} }
|
public class class_name {
public int getPixelSize(Component component) {
if (unit == PIXEL) {
return intValue();
} else if (unit == POINT) {
return Sizes.pointAsPixel(intValue(), component);
} else if (unit == INCH) {
return Sizes.inchAsPixel(value, component);
} else if (unit == MILLIMETER) {
return Sizes.millimeterAsPixel(value, component);
} else if (unit == CENTIMETER) {
return Sizes.centimeterAsPixel(value, component);
} else if (unit == DIALOG_UNITS_X) {
return Sizes.dialogUnitXAsPixel(intValue(), component);
} else if (unit == DIALOG_UNITS_Y) {
return Sizes.dialogUnitYAsPixel(intValue(), component);
} else {
throw new IllegalStateException("Invalid unit " + unit);
}
} }
|
public class class_name {
public int getPixelSize(Component component) {
if (unit == PIXEL) {
return intValue(); // depends on control dependency: [if], data = [none]
} else if (unit == POINT) {
return Sizes.pointAsPixel(intValue(), component); // depends on control dependency: [if], data = [none]
} else if (unit == INCH) {
return Sizes.inchAsPixel(value, component); // depends on control dependency: [if], data = [none]
} else if (unit == MILLIMETER) {
return Sizes.millimeterAsPixel(value, component); // depends on control dependency: [if], data = [none]
} else if (unit == CENTIMETER) {
return Sizes.centimeterAsPixel(value, component); // depends on control dependency: [if], data = [none]
} else if (unit == DIALOG_UNITS_X) {
return Sizes.dialogUnitXAsPixel(intValue(), component); // depends on control dependency: [if], data = [none]
} else if (unit == DIALOG_UNITS_Y) {
return Sizes.dialogUnitYAsPixel(intValue(), component); // depends on control dependency: [if], data = [none]
} else {
throw new IllegalStateException("Invalid unit " + unit);
}
} }
|
public class class_name {
public Observable<ServiceResponse<List<EventTypeInner>>> listEventTypesWithServiceResponseAsync(String topicTypeName) {
if (topicTypeName == null) {
throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.listEventTypes(topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<EventTypeInner>>>>() {
@Override
public Observable<ServiceResponse<List<EventTypeInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<EventTypeInner>> result = listEventTypesDelegate(response);
List<EventTypeInner> items = null;
if (result.body() != null) {
items = result.body().items();
}
ServiceResponse<List<EventTypeInner>> clientResponse = new ServiceResponse<List<EventTypeInner>>(items, result.response());
return Observable.just(clientResponse);
} catch (Throwable t) {
return Observable.error(t);
}
}
});
} }
|
public class class_name {
public Observable<ServiceResponse<List<EventTypeInner>>> listEventTypesWithServiceResponseAsync(String topicTypeName) {
if (topicTypeName == null) {
throw new IllegalArgumentException("Parameter topicTypeName is required and cannot be null.");
}
if (this.client.apiVersion() == null) {
throw new IllegalArgumentException("Parameter this.client.apiVersion() is required and cannot be null.");
}
return service.listEventTypes(topicTypeName, this.client.apiVersion(), this.client.acceptLanguage(), this.client.userAgent())
.flatMap(new Func1<Response<ResponseBody>, Observable<ServiceResponse<List<EventTypeInner>>>>() {
@Override
public Observable<ServiceResponse<List<EventTypeInner>>> call(Response<ResponseBody> response) {
try {
ServiceResponse<PageImpl<EventTypeInner>> result = listEventTypesDelegate(response);
List<EventTypeInner> items = null;
if (result.body() != null) {
items = result.body().items(); // depends on control dependency: [if], data = [none]
}
ServiceResponse<List<EventTypeInner>> clientResponse = new ServiceResponse<List<EventTypeInner>>(items, result.response());
return Observable.just(clientResponse); // depends on control dependency: [try], data = [none]
} catch (Throwable t) {
return Observable.error(t);
} // depends on control dependency: [catch], data = [none]
}
});
} }
|
public class class_name {
private String getDataFieldValue(final String dataHeader, final String fieldName) {
String value = null;
String token = String.valueOf((new StringBuffer(String.valueOf(fieldName))).append('=').append('"'));
int pos = dataHeader.indexOf(token);
if (pos > 0) {
int start = pos + token.length();
int end = dataHeader.indexOf('"', start);
if ((start > 0) && (end > 0)) {
value = dataHeader.substring(start, end);
}
}
return value;
} }
|
public class class_name {
private String getDataFieldValue(final String dataHeader, final String fieldName) {
String value = null;
String token = String.valueOf((new StringBuffer(String.valueOf(fieldName))).append('=').append('"'));
int pos = dataHeader.indexOf(token);
if (pos > 0) {
int start = pos + token.length();
int end = dataHeader.indexOf('"', start);
if ((start > 0) && (end > 0)) {
value = dataHeader.substring(start, end); // depends on control dependency: [if], data = [none]
}
}
return value;
} }
|
public class class_name {
@Override
public ISource locate(String path) {
if(path == null || path.isEmpty()) {
return new UnfoundSource();
}
// create file pointer from given path
File file = new File(path);
FileSource fileSource = new FileSource(file);
if(!fileSource.available()) {
return new UnfoundSource(path);
}
return fileSource;
} }
|
public class class_name {
@Override
public ISource locate(String path) {
if(path == null || path.isEmpty()) {
return new UnfoundSource(); // depends on control dependency: [if], data = [none]
}
// create file pointer from given path
File file = new File(path);
FileSource fileSource = new FileSource(file);
if(!fileSource.available()) {
return new UnfoundSource(path); // depends on control dependency: [if], data = [none]
}
return fileSource;
} }
|
public class class_name {
public String findRootPackageForActionPath(final String actionPath) {
if (mappings == null) {
return null;
}
int ndx = -1;
int delta = Integer.MAX_VALUE;
for (int i = 0; i < mappings.length; i++) {
String mapping = mappings[i];
boolean found = false;
if (actionPath.equals(mapping)) {
found = true;
} else {
mapping += StringPool.SLASH;
if (actionPath.startsWith(mapping)) {
found = true;
}
}
if (found) {
int distance = actionPath.length() - mapping.length();
if (distance < delta) {
ndx = i;
delta = distance;
}
}
}
if (ndx == -1) {
return null;
}
return packages[ndx];
} }
|
public class class_name {
public String findRootPackageForActionPath(final String actionPath) {
if (mappings == null) {
return null; // depends on control dependency: [if], data = [none]
}
int ndx = -1;
int delta = Integer.MAX_VALUE;
for (int i = 0; i < mappings.length; i++) {
String mapping = mappings[i];
boolean found = false;
if (actionPath.equals(mapping)) {
found = true; // depends on control dependency: [if], data = [none]
} else {
mapping += StringPool.SLASH; // depends on control dependency: [if], data = [none]
if (actionPath.startsWith(mapping)) {
found = true; // depends on control dependency: [if], data = [none]
}
}
if (found) {
int distance = actionPath.length() - mapping.length();
if (distance < delta) {
ndx = i; // depends on control dependency: [if], data = [none]
delta = distance; // depends on control dependency: [if], data = [none]
}
}
}
if (ndx == -1) {
return null; // depends on control dependency: [if], data = [none]
}
return packages[ndx];
} }
|
public class class_name {
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void rewrite(ArrayList<?> al,
MtasSolrSearchComponent searchComponent) throws IOException {
for (int i = 0; i < al.size(); i++) {
if (al.get(i) instanceof NamedList) {
rewrite((NamedList) al.get(i), searchComponent);
} else if (al.get(i) instanceof ArrayList) {
rewrite((ArrayList) al.get(i), searchComponent);
}
}
} }
|
public class class_name {
@SuppressWarnings({ "unchecked", "rawtypes" })
public static void rewrite(ArrayList<?> al,
MtasSolrSearchComponent searchComponent) throws IOException {
for (int i = 0; i < al.size(); i++) {
if (al.get(i) instanceof NamedList) {
rewrite((NamedList) al.get(i), searchComponent); // depends on control dependency: [if], data = [none]
} else if (al.get(i) instanceof ArrayList) {
rewrite((ArrayList) al.get(i), searchComponent); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public EClass getIfcCurveStyle() {
if (ifcCurveStyleEClass == null) {
ifcCurveStyleEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(137);
}
return ifcCurveStyleEClass;
} }
|
public class class_name {
public EClass getIfcCurveStyle() {
if (ifcCurveStyleEClass == null) {
ifcCurveStyleEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc2x3tc1Package.eNS_URI)
.getEClassifiers().get(137);
// depends on control dependency: [if], data = [none]
}
return ifcCurveStyleEClass;
} }
|
public class class_name {
public void marshall(Core core, ProtocolMarshaller protocolMarshaller) {
if (core == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(core.getCertificateArn(), CERTIFICATEARN_BINDING);
protocolMarshaller.marshall(core.getId(), ID_BINDING);
protocolMarshaller.marshall(core.getSyncShadow(), SYNCSHADOW_BINDING);
protocolMarshaller.marshall(core.getThingArn(), THINGARN_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(Core core, ProtocolMarshaller protocolMarshaller) {
if (core == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(core.getCertificateArn(), CERTIFICATEARN_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(core.getId(), ID_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(core.getSyncShadow(), SYNCSHADOW_BINDING); // depends on control dependency: [try], data = [none]
protocolMarshaller.marshall(core.getThingArn(), THINGARN_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
@Override
protected Object save(final NoSqlSession session, final Object version, final boolean activateAfterSave)
{
try
{
log.debug("save:" + session);
session.willPassivate();
if (!session.isValid())
{
log.debug("save: skip saving invalidated session: id=" + session.getId());
deleteKey(session.getId());
return null;
}
ISerializableSession data;
synchronized (session)
{
data = getSessionFactory().create(session);
}
data.setDomain(_cookieDomain);
data.setPath(_cookiePath);
long longVersion = 1; // default version for new sessions
if (version != null)
{
longVersion = (Long) version + 1L;
}
data.setVersion(longVersion);
try
{
if (!setKey(session.getId(), data))
{
throw (new RuntimeException("unable to set key: data=" + data));
}
}
catch (TranscoderException error)
{
throw (new IllegalArgumentException("unable to serialize session: id=" + session.getId() + ", data="
+ data, error));
}
log.debug("save:db.sessions.update(" + session.getId() + "," + data + ")");
if (activateAfterSave)
{
session.didActivate();
}
return longVersion;
}
catch (Exception e)
{
log.warn(e);
}
return null;
} }
|
public class class_name {
@Override
protected Object save(final NoSqlSession session, final Object version, final boolean activateAfterSave)
{
try
{
log.debug("save:" + session);
session.willPassivate();
if (!session.isValid())
{
log.debug("save: skip saving invalidated session: id=" + session.getId()); // depends on control dependency: [if], data = [none]
deleteKey(session.getId()); // depends on control dependency: [if], data = [none]
return null; // depends on control dependency: [if], data = [none]
}
ISerializableSession data;
synchronized (session)
{
data = getSessionFactory().create(session);
}
data.setDomain(_cookieDomain);
data.setPath(_cookiePath);
long longVersion = 1; // default version for new sessions
if (version != null)
{
longVersion = (Long) version + 1L; // depends on control dependency: [if], data = [none]
}
data.setVersion(longVersion);
try
{
if (!setKey(session.getId(), data))
{
throw (new RuntimeException("unable to set key: data=" + data));
}
}
catch (TranscoderException error)
{
throw (new IllegalArgumentException("unable to serialize session: id=" + session.getId() + ", data="
+ data, error));
} // depends on control dependency: [catch], data = [none]
log.debug("save:db.sessions.update(" + session.getId() + "," + data + ")");
if (activateAfterSave)
{
session.didActivate();
}
return longVersion;
}
catch (Exception e)
{
log.warn(e);
}
return null;
} }
|
public class class_name {
private String timeToStr(Timestamp pobjTS, String pstrFmt)
{
String strRet = null;
SimpleDateFormat dtFmt = null;
try
{
dtFmt = new SimpleDateFormat(pstrFmt);
strRet = dtFmt.format(pobjTS);
}
catch (IllegalArgumentException iae)
{
strRet = "";
}
catch (NullPointerException npe)
{
strRet = "";
}
finally
{
if (dtFmt != null) dtFmt = null;
}
return strRet;
} }
|
public class class_name {
private String timeToStr(Timestamp pobjTS, String pstrFmt)
{
String strRet = null;
SimpleDateFormat dtFmt = null;
try
{
dtFmt = new SimpleDateFormat(pstrFmt);
// depends on control dependency: [try], data = [none]
strRet = dtFmt.format(pobjTS);
// depends on control dependency: [try], data = [none]
}
catch (IllegalArgumentException iae)
{
strRet = "";
}
// depends on control dependency: [catch], data = [none]
catch (NullPointerException npe)
{
strRet = "";
}
// depends on control dependency: [catch], data = [none]
finally
{
if (dtFmt != null) dtFmt = null;
}
return strRet;
} }
|
public class class_name {
public static ModelNode getResults(ModelNode operationResult) {
if (!operationResult.hasDefined(RESULT)) {
return new ModelNode();
}
return operationResult.get(RESULT);
} }
|
public class class_name {
public static ModelNode getResults(ModelNode operationResult) {
if (!operationResult.hasDefined(RESULT)) {
return new ModelNode(); // depends on control dependency: [if], data = [none]
}
return operationResult.get(RESULT);
} }
|
public class class_name {
public static CustomInfo getOrCreateCustomInfo(Message message) {
CustomInfo customInfo = message.get(CustomInfo.class);
if (customInfo == null) {
customInfo = new CustomInfo();
message.put(CustomInfo.class, customInfo);
}
return customInfo;
} }
|
public class class_name {
public static CustomInfo getOrCreateCustomInfo(Message message) {
CustomInfo customInfo = message.get(CustomInfo.class);
if (customInfo == null) {
customInfo = new CustomInfo(); // depends on control dependency: [if], data = [none]
message.put(CustomInfo.class, customInfo); // depends on control dependency: [if], data = [none]
}
return customInfo;
} }
|
public class class_name {
public void ensureNumBuffersReturned(final int minRequiredAvailable) {
if (minRequiredAvailable > this.availableMemory.size() + this.buildSpillRetBufferNumbers) {
throw new IllegalArgumentException("More buffers requested available than totally available.");
}
try {
while (this.availableMemory.size() < minRequiredAvailable) {
this.availableMemory.add(this.buildSpillReturnBuffers.take());
this.buildSpillRetBufferNumbers--;
}
} catch (InterruptedException iex) {
throw new RuntimeException("Hash Join was interrupted.");
}
} }
|
public class class_name {
public void ensureNumBuffersReturned(final int minRequiredAvailable) {
if (minRequiredAvailable > this.availableMemory.size() + this.buildSpillRetBufferNumbers) {
throw new IllegalArgumentException("More buffers requested available than totally available.");
}
try {
while (this.availableMemory.size() < minRequiredAvailable) {
this.availableMemory.add(this.buildSpillReturnBuffers.take()); // depends on control dependency: [while], data = [none]
this.buildSpillRetBufferNumbers--; // depends on control dependency: [while], data = [none]
}
} catch (InterruptedException iex) {
throw new RuntimeException("Hash Join was interrupted.");
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private ELNode.Nodes parseEL() {
StringBuilder buf = new StringBuilder();
ELexpr = new ELNode.Nodes();
while (hasNext()) {
nextToken();
if (curToken instanceof Char) {
if (curToken.toChar() == '}') {
break;
}
buf.append(curToken.toChar());
} else {
// Output whatever is in buffer
if (buf.length() > 0) {
ELexpr.add(new ELNode.ELText(buf.toString()));
}
if (!parseFunction()) {
ELexpr.add(new ELNode.ELText(curToken.toString()));
}
}
}
if (buf.length() > 0) {
ELexpr.add(new ELNode.ELText(buf.toString()));
}
return ELexpr;
} }
|
public class class_name {
private ELNode.Nodes parseEL() {
StringBuilder buf = new StringBuilder();
ELexpr = new ELNode.Nodes();
while (hasNext()) {
nextToken(); // depends on control dependency: [while], data = [none]
if (curToken instanceof Char) {
if (curToken.toChar() == '}') {
break;
}
buf.append(curToken.toChar()); // depends on control dependency: [if], data = [none]
} else {
// Output whatever is in buffer
if (buf.length() > 0) {
ELexpr.add(new ELNode.ELText(buf.toString())); // depends on control dependency: [if], data = [none]
}
if (!parseFunction()) {
ELexpr.add(new ELNode.ELText(curToken.toString())); // depends on control dependency: [if], data = [none]
}
}
}
if (buf.length() > 0) {
ELexpr.add(new ELNode.ELText(buf.toString())); // depends on control dependency: [if], data = [none]
}
return ELexpr;
} }
|
public class class_name {
public static int getArgumentsAndReturnSizes(final String methodDescriptor) {
int argumentsSize = 1;
// Skip the first character, which is always a '('.
int currentOffset = 1;
int currentChar = methodDescriptor.charAt(currentOffset);
// Parse the argument types and compute their size, one at a each loop iteration.
while (currentChar != ')') {
if (currentChar == 'J' || currentChar == 'D') {
currentOffset++;
argumentsSize += 2;
} else {
while (methodDescriptor.charAt(currentOffset) == '[') {
currentOffset++;
}
if (methodDescriptor.charAt(currentOffset++) == 'L') {
// Skip the argument descriptor content.
currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1;
}
argumentsSize += 1;
}
currentChar = methodDescriptor.charAt(currentOffset);
}
currentChar = methodDescriptor.charAt(currentOffset + 1);
if (currentChar == 'V') {
return argumentsSize << 2;
} else {
int returnSize = (currentChar == 'J' || currentChar == 'D') ? 2 : 1;
return argumentsSize << 2 | returnSize;
}
} }
|
public class class_name {
public static int getArgumentsAndReturnSizes(final String methodDescriptor) {
int argumentsSize = 1;
// Skip the first character, which is always a '('.
int currentOffset = 1;
int currentChar = methodDescriptor.charAt(currentOffset);
// Parse the argument types and compute their size, one at a each loop iteration.
while (currentChar != ')') {
if (currentChar == 'J' || currentChar == 'D') {
currentOffset++; // depends on control dependency: [if], data = [none]
argumentsSize += 2; // depends on control dependency: [if], data = [none]
} else {
while (methodDescriptor.charAt(currentOffset) == '[') {
currentOffset++; // depends on control dependency: [while], data = [none]
}
if (methodDescriptor.charAt(currentOffset++) == 'L') {
// Skip the argument descriptor content.
currentOffset = methodDescriptor.indexOf(';', currentOffset) + 1; // depends on control dependency: [if], data = [none]
}
argumentsSize += 1; // depends on control dependency: [if], data = [none]
}
currentChar = methodDescriptor.charAt(currentOffset); // depends on control dependency: [while], data = [none]
}
currentChar = methodDescriptor.charAt(currentOffset + 1);
if (currentChar == 'V') {
return argumentsSize << 2; // depends on control dependency: [if], data = [none]
} else {
int returnSize = (currentChar == 'J' || currentChar == 'D') ? 2 : 1;
return argumentsSize << 2 | returnSize; // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public List<SecurityUserBean> getUsers() {
List<SecurityUserBean> users = new ArrayList<SecurityUserBean>();
for (DuracloudUserDetails user : this.usersTable.values()) {
SecurityUserBean bean = createUserBean(user);
users.add(bean);
}
return users;
} }
|
public class class_name {
public List<SecurityUserBean> getUsers() {
List<SecurityUserBean> users = new ArrayList<SecurityUserBean>();
for (DuracloudUserDetails user : this.usersTable.values()) {
SecurityUserBean bean = createUserBean(user);
users.add(bean); // depends on control dependency: [for], data = [user]
}
return users;
} }
|
public class class_name {
public static List<String> getNativePermissions(int permissionBits, boolean denied) {
List<String> result = new ArrayList<String>();
String prefix = denied ? "opencms:deny-" : "opencms:";
if ((permissionBits & CmsPermissionSet.PERMISSION_READ) != 0) {
result.add(prefix + "read");
}
if ((permissionBits & CmsPermissionSet.PERMISSION_WRITE) != 0) {
result.add(prefix + "write");
}
if ((permissionBits & CmsPermissionSet.PERMISSION_VIEW) != 0) {
result.add(prefix + "view");
}
if ((permissionBits & CmsPermissionSet.PERMISSION_CONTROL) != 0) {
result.add(prefix + "control");
}
if ((permissionBits & CmsPermissionSet.PERMISSION_DIRECT_PUBLISH) != 0) {
result.add(prefix + "publish");
}
return result;
} }
|
public class class_name {
public static List<String> getNativePermissions(int permissionBits, boolean denied) {
List<String> result = new ArrayList<String>();
String prefix = denied ? "opencms:deny-" : "opencms:";
if ((permissionBits & CmsPermissionSet.PERMISSION_READ) != 0) {
result.add(prefix + "read");
// depends on control dependency: [if], data = [none]
}
if ((permissionBits & CmsPermissionSet.PERMISSION_WRITE) != 0) {
result.add(prefix + "write");
// depends on control dependency: [if], data = [none]
}
if ((permissionBits & CmsPermissionSet.PERMISSION_VIEW) != 0) {
result.add(prefix + "view");
// depends on control dependency: [if], data = [none]
}
if ((permissionBits & CmsPermissionSet.PERMISSION_CONTROL) != 0) {
result.add(prefix + "control");
// depends on control dependency: [if], data = [none]
}
if ((permissionBits & CmsPermissionSet.PERMISSION_DIRECT_PUBLISH) != 0) {
result.add(prefix + "publish");
// depends on control dependency: [if], data = [none]
}
return result;
} }
|
public class class_name {
public void makeDebugActions() {
DebugCommands.Category debugHandler = debugCommands.findCategory("Catalogs");
DebugCommands.Action act;
act = new DebugCommands.Action("showCatalogExt", "Show known catalogs") {
public void doAction(DebugCommands.Event e) {
e.pw.printf("numberCatalogs=%d nextCatId=%d%n", numberCatalogs, nextCatId);
e.pw.printf("%nid root lastRead path%n");
CatalogTracker catalogTracker = new CatalogTracker(trackerDir, false, numberCatalogs, 0);
for (CatalogExt cat : catalogTracker.getCatalogs()) {
e.pw.printf("%3d: %5s %s %s%n", cat.getCatId(), cat.isRoot(), CalendarDate.of(cat.getLastRead()), cat.getCatRelLocation());
}
}
};
debugHandler.addAction(act);
act = new DebugCommands.Action("showRoots", "Show root catalogs") {
public void doAction(DebugCommands.Event e) {
StringBuilder sbuff = new StringBuilder();
synchronized (ConfigCatalogInitialization.this) {
for (String catPath : rootCatalogKeys) {
sbuff.append(" catalog= ").append(catPath).append("\n");
//String filename = StringUtil2.unescape(cat.getUriString());
//sbuff.append(" from= ").append(filename).append("\n");
}
}
e.pw.println();
e.pw.println(Escape.html(sbuff.toString()));
}
};
debugHandler.addAction(act);
act = new DebugCommands.Action("showStats", "Show catalog initialization stats") {
public void doAction(DebugCommands.Event e) {
if (callback != null)
e.pw.printf("%n%s%n", Escape.html(callback.toString()));
else
e.pw.printf("N/A%n");
}
};
debugHandler.addAction(act);
} }
|
public class class_name {
public void makeDebugActions() {
DebugCommands.Category debugHandler = debugCommands.findCategory("Catalogs");
DebugCommands.Action act;
act = new DebugCommands.Action("showCatalogExt", "Show known catalogs") {
public void doAction(DebugCommands.Event e) {
e.pw.printf("numberCatalogs=%d nextCatId=%d%n", numberCatalogs, nextCatId);
e.pw.printf("%nid root lastRead path%n");
CatalogTracker catalogTracker = new CatalogTracker(trackerDir, false, numberCatalogs, 0);
for (CatalogExt cat : catalogTracker.getCatalogs()) {
e.pw.printf("%3d: %5s %s %s%n", cat.getCatId(), cat.isRoot(), CalendarDate.of(cat.getLastRead()), cat.getCatRelLocation()); // depends on control dependency: [for], data = [cat]
}
}
};
debugHandler.addAction(act);
act = new DebugCommands.Action("showRoots", "Show root catalogs") {
public void doAction(DebugCommands.Event e) {
StringBuilder sbuff = new StringBuilder();
synchronized (ConfigCatalogInitialization.this) {
for (String catPath : rootCatalogKeys) {
sbuff.append(" catalog= ").append(catPath).append("\n"); // depends on control dependency: [for], data = [catPath]
//String filename = StringUtil2.unescape(cat.getUriString());
//sbuff.append(" from= ").append(filename).append("\n");
}
}
e.pw.println();
e.pw.println(Escape.html(sbuff.toString()));
}
};
debugHandler.addAction(act);
act = new DebugCommands.Action("showStats", "Show catalog initialization stats") {
public void doAction(DebugCommands.Event e) {
if (callback != null)
e.pw.printf("%n%s%n", Escape.html(callback.toString()));
else
e.pw.printf("N/A%n");
}
};
debugHandler.addAction(act);
} }
|
public class class_name {
public static double gradientCoherentNoise3D(double x, double y, double z, int seed, NoiseQuality quality) {
// Create a unit-length cube aligned along an integer boundary. This cube
// surrounds the input point.
int x0 = ((x > 0.0) ? (int) x : (int) x - 1);
int x1 = x0 + 1;
int y0 = ((y > 0.0) ? (int) y : (int) y - 1);
int y1 = y0 + 1;
int z0 = ((z > 0.0) ? (int) z : (int) z - 1);
int z1 = z0 + 1;
// Map the difference between the coordinates of the input value and the
// coordinates of the cube's outer-lower-left vertex onto an S-curve.
double xs, ys, zs;
if (quality == NoiseQuality.FAST) {
xs = (x - (double) x0);
ys = (y - (double) y0);
zs = (z - (double) z0);
} else if (quality == NoiseQuality.STANDARD) {
xs = Utils.sCurve3(x - (double) x0);
ys = Utils.sCurve3(y - (double) y0);
zs = Utils.sCurve3(z - (double) z0);
} else {
xs = Utils.sCurve5(x - (double) x0);
ys = Utils.sCurve5(y - (double) y0);
zs = Utils.sCurve5(z - (double) z0);
}
// Now calculate the noise values at each vertex of the cube. To generate
// the coherent-noise value at the input point, interpolate these eight
// noise values using the S-curve value as the interpolant (trilinear
// interpolation.)
double n0, n1, ix0, ix1, iy0, iy1;
n0 = gradientNoise3D(x, y, z, x0, y0, z0, seed);
n1 = gradientNoise3D(x, y, z, x1, y0, z0, seed);
ix0 = Utils.linearInterp(n0, n1, xs);
n0 = gradientNoise3D(x, y, z, x0, y1, z0, seed);
n1 = gradientNoise3D(x, y, z, x1, y1, z0, seed);
ix1 = Utils.linearInterp(n0, n1, xs);
iy0 = Utils.linearInterp(ix0, ix1, ys);
n0 = gradientNoise3D(x, y, z, x0, y0, z1, seed);
n1 = gradientNoise3D(x, y, z, x1, y0, z1, seed);
ix0 = Utils.linearInterp(n0, n1, xs);
n0 = gradientNoise3D(x, y, z, x0, y1, z1, seed);
n1 = gradientNoise3D(x, y, z, x1, y1, z1, seed);
ix1 = Utils.linearInterp(n0, n1, xs);
iy1 = Utils.linearInterp(ix0, ix1, ys);
return Utils.linearInterp(iy0, iy1, zs);
} }
|
public class class_name {
public static double gradientCoherentNoise3D(double x, double y, double z, int seed, NoiseQuality quality) {
// Create a unit-length cube aligned along an integer boundary. This cube
// surrounds the input point.
int x0 = ((x > 0.0) ? (int) x : (int) x - 1);
int x1 = x0 + 1;
int y0 = ((y > 0.0) ? (int) y : (int) y - 1);
int y1 = y0 + 1;
int z0 = ((z > 0.0) ? (int) z : (int) z - 1);
int z1 = z0 + 1;
// Map the difference between the coordinates of the input value and the
// coordinates of the cube's outer-lower-left vertex onto an S-curve.
double xs, ys, zs;
if (quality == NoiseQuality.FAST) {
xs = (x - (double) x0); // depends on control dependency: [if], data = [none]
ys = (y - (double) y0); // depends on control dependency: [if], data = [none]
zs = (z - (double) z0); // depends on control dependency: [if], data = [none]
} else if (quality == NoiseQuality.STANDARD) {
xs = Utils.sCurve3(x - (double) x0); // depends on control dependency: [if], data = [none]
ys = Utils.sCurve3(y - (double) y0); // depends on control dependency: [if], data = [none]
zs = Utils.sCurve3(z - (double) z0); // depends on control dependency: [if], data = [none]
} else {
xs = Utils.sCurve5(x - (double) x0); // depends on control dependency: [if], data = [none]
ys = Utils.sCurve5(y - (double) y0); // depends on control dependency: [if], data = [none]
zs = Utils.sCurve5(z - (double) z0); // depends on control dependency: [if], data = [none]
}
// Now calculate the noise values at each vertex of the cube. To generate
// the coherent-noise value at the input point, interpolate these eight
// noise values using the S-curve value as the interpolant (trilinear
// interpolation.)
double n0, n1, ix0, ix1, iy0, iy1;
n0 = gradientNoise3D(x, y, z, x0, y0, z0, seed);
n1 = gradientNoise3D(x, y, z, x1, y0, z0, seed);
ix0 = Utils.linearInterp(n0, n1, xs);
n0 = gradientNoise3D(x, y, z, x0, y1, z0, seed);
n1 = gradientNoise3D(x, y, z, x1, y1, z0, seed);
ix1 = Utils.linearInterp(n0, n1, xs);
iy0 = Utils.linearInterp(ix0, ix1, ys);
n0 = gradientNoise3D(x, y, z, x0, y0, z1, seed);
n1 = gradientNoise3D(x, y, z, x1, y0, z1, seed);
ix0 = Utils.linearInterp(n0, n1, xs);
n0 = gradientNoise3D(x, y, z, x0, y1, z1, seed);
n1 = gradientNoise3D(x, y, z, x1, y1, z1, seed);
ix1 = Utils.linearInterp(n0, n1, xs);
iy1 = Utils.linearInterp(ix0, ix1, ys);
return Utils.linearInterp(iy0, iy1, zs);
} }
|
public class class_name {
protected static PropRecord parseMetaData (String path, URL sourceURL)
throws IOException
{
InputStream input = sourceURL.openStream();
BufferedReader bin = new BufferedReader(new InputStreamReader(input));
try {
PropRecord record = new PropRecord(path, sourceURL);
boolean started = false;
String line;
while ((line = bin.readLine()) != null) {
if (line.startsWith(PACKAGE_KEY)) {
record._package = parseValue(line);
started = true;
} else if (line.startsWith(EXTENDS_KEY)) {
record._extends = parseValue(line);
started = true;
} else if (line.startsWith(OVERRIDES_KEY)) {
record._overrides = parseValues(line);
started = true;
} else if (started) {
break;
}
}
return record;
} finally {
StreamUtil.close(bin);
}
} }
|
public class class_name {
protected static PropRecord parseMetaData (String path, URL sourceURL)
throws IOException
{
InputStream input = sourceURL.openStream();
BufferedReader bin = new BufferedReader(new InputStreamReader(input));
try {
PropRecord record = new PropRecord(path, sourceURL);
boolean started = false;
String line;
while ((line = bin.readLine()) != null) {
if (line.startsWith(PACKAGE_KEY)) {
record._package = parseValue(line); // depends on control dependency: [if], data = [none]
started = true; // depends on control dependency: [if], data = [none]
} else if (line.startsWith(EXTENDS_KEY)) {
record._extends = parseValue(line); // depends on control dependency: [if], data = [none]
started = true; // depends on control dependency: [if], data = [none]
} else if (line.startsWith(OVERRIDES_KEY)) {
record._overrides = parseValues(line); // depends on control dependency: [if], data = [none]
started = true; // depends on control dependency: [if], data = [none]
} else if (started) {
break;
}
}
return record;
} finally {
StreamUtil.close(bin);
}
} }
|
public class class_name {
public static MicroserviceConfig readConfig(final String serviceName) {
final Logger logger = LoggerFactory.getLogger(MicroserviceConfig.class);
if (new File(resourceLocation).exists()) {
final String json = IO.read(resourceLocation);
return JsonFactory.fromJson(json, MicroserviceConfig.class);
} else if (resourceLocationEnv != null && new File(resourceLocationEnv).exists()) {
final String json = IO.read(resourceLocationEnv);
return JsonFactory.fromJson(json, MicroserviceConfig.class);
} else {
logger.info("Reading config from classpath as it is not found on file system");
final String qbitEnv = System.getenv("QBIT_ENV");
final String resourceLocationOnClasspath =
qbitEnv != null && !qbitEnv.isEmpty() ? serviceName + "_" + qbitEnv + ".json" :
serviceName + ".json";
final String json = IO.read(Thread.currentThread().getContextClassLoader()
.getResourceAsStream(resourceLocationOnClasspath));
return JsonFactory.fromJson(json, MicroserviceConfig.class);
}
} }
|
public class class_name {
public static MicroserviceConfig readConfig(final String serviceName) {
final Logger logger = LoggerFactory.getLogger(MicroserviceConfig.class);
if (new File(resourceLocation).exists()) {
final String json = IO.read(resourceLocation);
return JsonFactory.fromJson(json, MicroserviceConfig.class); // depends on control dependency: [if], data = [none]
} else if (resourceLocationEnv != null && new File(resourceLocationEnv).exists()) {
final String json = IO.read(resourceLocationEnv);
return JsonFactory.fromJson(json, MicroserviceConfig.class); // depends on control dependency: [if], data = [none]
} else {
logger.info("Reading config from classpath as it is not found on file system"); // depends on control dependency: [if], data = [none]
final String qbitEnv = System.getenv("QBIT_ENV");
final String resourceLocationOnClasspath =
qbitEnv != null && !qbitEnv.isEmpty() ? serviceName + "_" + qbitEnv + ".json" :
serviceName + ".json";
final String json = IO.read(Thread.currentThread().getContextClassLoader()
.getResourceAsStream(resourceLocationOnClasspath));
return JsonFactory.fromJson(json, MicroserviceConfig.class); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
void dbg(String msg) {
if (debug ) {
if (!msg.endsWith(LINE_SEP)) {
System.err.println(LE + msg);
} else {
System.err.print(LE + msg);
}
}
} }
|
public class class_name {
void dbg(String msg) {
if (debug ) {
if (!msg.endsWith(LINE_SEP)) {
System.err.println(LE + msg); // depends on control dependency: [if], data = [none]
} else {
System.err.print(LE + msg); // depends on control dependency: [if], data = [none]
}
}
} }
|
public class class_name {
public java.util.List<String> getReasonCodes() {
if (reasonCodes == null) {
reasonCodes = new com.amazonaws.internal.SdkInternalList<String>();
}
return reasonCodes;
} }
|
public class class_name {
public java.util.List<String> getReasonCodes() {
if (reasonCodes == null) {
reasonCodes = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none]
}
return reasonCodes;
} }
|
public class class_name {
@Override
public void set(int index, boolean value) {
int i = Arrays.binarySearch(trueBits, index);
// bit at index is set to true and shall be set to false
if (i >= 0 && !value) {
int[] tmp = new int[trueBits.length - 1];
System.arraycopy(trueBits, 0, tmp, 0, i);
System.arraycopy(trueBits, i + 1, tmp, i, trueBits.length - i - 1);
trueBits = tmp;
}
// bit at index is set to false and shall be set to true
else if (i < 0 && value) {
int[] tmp = new int[trueBits.length + 1];
System.arraycopy(trueBits, 0, tmp, 0, trueBits.length);
tmp[tmp.length - 1] = index;
trueBits = tmp;
Arrays.sort(trueBits);
}
} }
|
public class class_name {
@Override
public void set(int index, boolean value) {
int i = Arrays.binarySearch(trueBits, index);
// bit at index is set to true and shall be set to false
if (i >= 0 && !value) {
int[] tmp = new int[trueBits.length - 1];
System.arraycopy(trueBits, 0, tmp, 0, i); // depends on control dependency: [if], data = [none]
System.arraycopy(trueBits, i + 1, tmp, i, trueBits.length - i - 1); // depends on control dependency: [if], data = [none]
trueBits = tmp; // depends on control dependency: [if], data = [none]
}
// bit at index is set to false and shall be set to true
else if (i < 0 && value) {
int[] tmp = new int[trueBits.length + 1];
System.arraycopy(trueBits, 0, tmp, 0, trueBits.length); // depends on control dependency: [if], data = [none]
tmp[tmp.length - 1] = index; // depends on control dependency: [if], data = [none]
trueBits = tmp; // depends on control dependency: [if], data = [none]
Arrays.sort(trueBits); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
public static void upto(BigInteger self, Number to, @ClosureParams(FirstParam.class) Closure closure) {
if (to instanceof BigDecimal) {
final BigDecimal one = BigDecimal.valueOf(10, 1);
BigDecimal self1 = new BigDecimal(self);
BigDecimal to1 = (BigDecimal) to;
if (self1.compareTo(to1) <= 0) {
for (BigDecimal i = self1; i.compareTo(to1) <= 0; i = i.add(one)) {
closure.call(i);
}
} else
throw new GroovyRuntimeException(
MessageFormat.format(
"The argument ({0}) to upto() cannot be less than the value ({1}) it''s called on.",
to, self));
} else if (to instanceof BigInteger) {
final BigInteger one = BigInteger.valueOf(1);
BigInteger to1 = (BigInteger) to;
if (self.compareTo(to1) <= 0) {
for (BigInteger i = self; i.compareTo(to1) <= 0; i = i.add(one)) {
closure.call(i);
}
} else
throw new GroovyRuntimeException(
MessageFormat.format("The argument ({0}) to upto() cannot be less than the value ({1}) it''s called on.",
to, self));
} else {
final BigInteger one = BigInteger.valueOf(1);
BigInteger to1 = new BigInteger(to.toString());
if (self.compareTo(to1) <= 0) {
for (BigInteger i = self; i.compareTo(to1) <= 0; i = i.add(one)) {
closure.call(i);
}
} else
throw new GroovyRuntimeException(MessageFormat.format(
"The argument ({0}) to upto() cannot be less than the value ({1}) it''s called on.",
to, self));
}
} }
|
public class class_name {
public static void upto(BigInteger self, Number to, @ClosureParams(FirstParam.class) Closure closure) {
if (to instanceof BigDecimal) {
final BigDecimal one = BigDecimal.valueOf(10, 1);
BigDecimal self1 = new BigDecimal(self);
BigDecimal to1 = (BigDecimal) to;
if (self1.compareTo(to1) <= 0) {
for (BigDecimal i = self1; i.compareTo(to1) <= 0; i = i.add(one)) {
closure.call(i); // depends on control dependency: [for], data = [i]
}
} else
throw new GroovyRuntimeException(
MessageFormat.format(
"The argument ({0}) to upto() cannot be less than the value ({1}) it''s called on.",
to, self));
} else if (to instanceof BigInteger) {
final BigInteger one = BigInteger.valueOf(1);
BigInteger to1 = (BigInteger) to;
if (self.compareTo(to1) <= 0) {
for (BigInteger i = self; i.compareTo(to1) <= 0; i = i.add(one)) {
closure.call(i); // depends on control dependency: [for], data = [i]
}
} else
throw new GroovyRuntimeException(
MessageFormat.format("The argument ({0}) to upto() cannot be less than the value ({1}) it''s called on.",
to, self));
} else {
final BigInteger one = BigInteger.valueOf(1);
BigInteger to1 = new BigInteger(to.toString());
if (self.compareTo(to1) <= 0) {
for (BigInteger i = self; i.compareTo(to1) <= 0; i = i.add(one)) {
closure.call(i); // depends on control dependency: [for], data = [i]
}
} else
throw new GroovyRuntimeException(MessageFormat.format(
"The argument ({0}) to upto() cannot be less than the value ({1}) it''s called on.",
to, self));
}
} }
|
public class class_name {
public int[] getWidths() {
int[] wx = new int[mtxTab.length];
for (int i = 0; i < wx.length; i++) {
wx[i] = (mtxTab[i].getWx());
}
return wx;
} }
|
public class class_name {
public int[] getWidths() {
int[] wx = new int[mtxTab.length];
for (int i = 0; i < wx.length; i++) {
wx[i] = (mtxTab[i].getWx()); // depends on control dependency: [for], data = [i]
}
return wx;
} }
|
public class class_name {
public static String replaceChars(String str, char searchChar, char replaceChar) {
if (str == null) {
return null;
}
return str.replace(searchChar, replaceChar);
} }
|
public class class_name {
public static String replaceChars(String str, char searchChar, char replaceChar) {
if (str == null) {
return null; // depends on control dependency: [if], data = [none]
}
return str.replace(searchChar, replaceChar);
} }
|
public class class_name {
public TrieNode matchPredictor(String search) {
TrieNode cursor = matchEnd(search);
if (cursor.getNumberOfChildren() > 0) {
return cursor;
}
String string = cursor.getString();
if (string.isEmpty()) return null;
return matchPredictor(string.substring(1));
} }
|
public class class_name {
public TrieNode matchPredictor(String search) {
TrieNode cursor = matchEnd(search);
if (cursor.getNumberOfChildren() > 0) {
return cursor; // depends on control dependency: [if], data = [none]
}
String string = cursor.getString();
if (string.isEmpty()) return null;
return matchPredictor(string.substring(1));
} }
|
public class class_name {
public void interpret( Specification specification )
{
stats = new Statistics();
Example table = specification.nextExample();
columns = parseColumns( table );
enterRowMessage = parseEnterRowMessage( table );
for (Example row = table.at( 0, 2 ); row != null && canContinue( stats ); row = row.nextSibling())
{
doRow( row );
if (shouldStop( stats ))
{
row.firstChild().lastSibling().addSibling().annotate(Annotations.stopped());
}
}
specification.exampleDone( stats );
} }
|
public class class_name {
public void interpret( Specification specification )
{
stats = new Statistics();
Example table = specification.nextExample();
columns = parseColumns( table );
enterRowMessage = parseEnterRowMessage( table );
for (Example row = table.at( 0, 2 ); row != null && canContinue( stats ); row = row.nextSibling())
{
doRow( row ); // depends on control dependency: [for], data = [row]
if (shouldStop( stats ))
{
row.firstChild().lastSibling().addSibling().annotate(Annotations.stopped()); // depends on control dependency: [if], data = [none]
}
}
specification.exampleDone( stats );
} }
|
public class class_name {
public static String[] getIPs(String strInterface)
throws UnknownHostException {
try {
boolean toGetIpv4 = true;
if (System.getProperty(PREFER_IPV6_ADDRESS_PROPERTY) != null) {
toGetIpv4 = "false".equals(System
.getProperty(PREFER_IPV6_ADDRESS_PROPERTY));
}
NetworkInterface netIF = NetworkInterface.getByName(strInterface);
if (netIF == null) {
return new String[] { InetAddress.getLocalHost()
.getHostAddress() };
} else {
Vector<String> ips = new Vector<String>();
Enumeration<InetAddress> e = netIF.getInetAddresses();
while (e.hasMoreElements()) {
InetAddress curr = e.nextElement();
if (toGetIpv4 && !(curr instanceof Inet4Address)) {
continue;
}
ips.add(curr.getHostAddress());
}
return ips.toArray(new String[] {});
}
} catch (SocketException e) {
return new String[] { InetAddress.getLocalHost().getHostAddress() };
}
} }
|
public class class_name {
public static String[] getIPs(String strInterface)
throws UnknownHostException {
try {
boolean toGetIpv4 = true;
if (System.getProperty(PREFER_IPV6_ADDRESS_PROPERTY) != null) {
toGetIpv4 = "false".equals(System
.getProperty(PREFER_IPV6_ADDRESS_PROPERTY));
}
NetworkInterface netIF = NetworkInterface.getByName(strInterface);
if (netIF == null) {
return new String[] { InetAddress.getLocalHost()
.getHostAddress() };
} else {
Vector<String> ips = new Vector<String>();
Enumeration<InetAddress> e = netIF.getInetAddresses();
while (e.hasMoreElements()) {
InetAddress curr = e.nextElement();
if (toGetIpv4 && !(curr instanceof Inet4Address)) {
continue;
}
ips.add(curr.getHostAddress()); // depends on control dependency: [while], data = [none]
}
return ips.toArray(new String[] {});
}
} catch (SocketException e) {
return new String[] { InetAddress.getLocalHost().getHostAddress() };
}
} }
|
public class class_name {
private void insertAggExpressionsToAggResultColumns (
List<AbstractExpression> aggColumns, ParsedColInfo cookedCol) {
for (AbstractExpression expr: aggColumns) {
assert(expr instanceof AggregateExpression);
if (expr.hasSubquerySubexpression()) {
throw new PlanningErrorException(
"SQL Aggregate function calls with subquery expression arguments are not allowed.");
}
ParsedColInfo col = new ParsedColInfo();
col.m_expression = expr.clone();
assert(col.m_expression instanceof AggregateExpression);
if (col.m_expression.getExpressionType() == ExpressionType.AGGREGATE_AVG) {
m_hasAverage = true;
}
if (aggColumns.size() == 1 &&
cookedCol.m_expression.equals(aggColumns.get(0))) {
col.m_alias = cookedCol.m_alias;
col.m_tableName = cookedCol.m_tableName;
col.m_tableAlias = cookedCol.m_tableAlias;
col.m_columnName = cookedCol.m_columnName;
if (!m_aggResultColumns.contains(col)) {
m_aggResultColumns.add(col);
}
return;
}
// Try to check complexAggs earlier
m_hasComplexAgg = true;
// Aggregation column use the the hacky stuff
col.m_tableName = TEMP_TABLE_NAME;
col.m_tableAlias = TEMP_TABLE_NAME;
col.m_columnName = "";
if (!m_aggResultColumns.contains(col)) {
m_aggResultColumns.add(col);
}
ExpressionUtil.finalizeValueTypes(col.m_expression);
}
} }
|
public class class_name {
private void insertAggExpressionsToAggResultColumns (
List<AbstractExpression> aggColumns, ParsedColInfo cookedCol) {
for (AbstractExpression expr: aggColumns) {
assert(expr instanceof AggregateExpression); // depends on control dependency: [for], data = [expr]
if (expr.hasSubquerySubexpression()) {
throw new PlanningErrorException(
"SQL Aggregate function calls with subquery expression arguments are not allowed.");
}
ParsedColInfo col = new ParsedColInfo();
col.m_expression = expr.clone(); // depends on control dependency: [for], data = [expr]
assert(col.m_expression instanceof AggregateExpression); // depends on control dependency: [for], data = [expr]
if (col.m_expression.getExpressionType() == ExpressionType.AGGREGATE_AVG) {
m_hasAverage = true; // depends on control dependency: [if], data = [none]
}
if (aggColumns.size() == 1 &&
cookedCol.m_expression.equals(aggColumns.get(0))) {
col.m_alias = cookedCol.m_alias; // depends on control dependency: [if], data = [none]
col.m_tableName = cookedCol.m_tableName; // depends on control dependency: [if], data = [none]
col.m_tableAlias = cookedCol.m_tableAlias; // depends on control dependency: [if], data = [none]
col.m_columnName = cookedCol.m_columnName; // depends on control dependency: [if], data = [none]
if (!m_aggResultColumns.contains(col)) {
m_aggResultColumns.add(col); // depends on control dependency: [if], data = [none]
}
return; // depends on control dependency: [if], data = [none]
}
// Try to check complexAggs earlier
m_hasComplexAgg = true; // depends on control dependency: [for], data = [none]
// Aggregation column use the the hacky stuff
col.m_tableName = TEMP_TABLE_NAME; // depends on control dependency: [for], data = [none]
col.m_tableAlias = TEMP_TABLE_NAME; // depends on control dependency: [for], data = [none]
col.m_columnName = ""; // depends on control dependency: [for], data = [none]
if (!m_aggResultColumns.contains(col)) {
m_aggResultColumns.add(col); // depends on control dependency: [if], data = [none]
}
ExpressionUtil.finalizeValueTypes(col.m_expression); // depends on control dependency: [for], data = [expr]
}
} }
|
public class class_name {
public void marshall(DeleteAliasRequest deleteAliasRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteAliasRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteAliasRequest.getAliasId(), ALIASID_BINDING);
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
}
} }
|
public class class_name {
public void marshall(DeleteAliasRequest deleteAliasRequest, ProtocolMarshaller protocolMarshaller) {
if (deleteAliasRequest == null) {
throw new SdkClientException("Invalid argument passed to marshall(...)");
}
try {
protocolMarshaller.marshall(deleteAliasRequest.getAliasId(), ALIASID_BINDING); // depends on control dependency: [try], data = [none]
} catch (Exception e) {
throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e);
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
private static void addCacheInfoUpdate(CacheStatus cacheStatus) {
long cacheSize = cacheStatus.size;
synchronized (baseDirSize) {
Long dirSize = baseDirSize.get(cacheStatus.getBaseDir());
if( dirSize == null ) {
dirSize = Long.valueOf(cacheSize);
} else {
dirSize += cacheSize;
}
baseDirSize.put(cacheStatus.getBaseDir(), dirSize);
}
synchronized (baseDirNumberSubDir) {
Integer dirSubDir = baseDirNumberSubDir.get(cacheStatus.getBaseDir());
if( dirSubDir == null ) {
dirSubDir = 1;
} else {
dirSubDir += 1;
}
baseDirNumberSubDir.put(cacheStatus.getBaseDir(), dirSubDir);
}
} }
|
public class class_name {
private static void addCacheInfoUpdate(CacheStatus cacheStatus) {
long cacheSize = cacheStatus.size;
synchronized (baseDirSize) {
Long dirSize = baseDirSize.get(cacheStatus.getBaseDir());
if( dirSize == null ) {
dirSize = Long.valueOf(cacheSize); // depends on control dependency: [if], data = [none]
} else {
dirSize += cacheSize; // depends on control dependency: [if], data = [none]
}
baseDirSize.put(cacheStatus.getBaseDir(), dirSize);
}
synchronized (baseDirNumberSubDir) {
Integer dirSubDir = baseDirNumberSubDir.get(cacheStatus.getBaseDir());
if( dirSubDir == null ) {
dirSubDir = 1; // depends on control dependency: [if], data = [none]
} else {
dirSubDir += 1; // depends on control dependency: [if], data = [none]
}
baseDirNumberSubDir.put(cacheStatus.getBaseDir(), dirSubDir);
}
} }
|
public class class_name {
public double getPercentage(T style)
{
int scnt = 0;
int allcnt = 0;
for (Map.Entry<T, Integer> entry : getAll().entrySet())
{
if (entry.getKey().equals(style))
scnt = entry.getValue();
allcnt += entry.getValue();
}
return scnt / (double) allcnt;
} }
|
public class class_name {
public double getPercentage(T style)
{
int scnt = 0;
int allcnt = 0;
for (Map.Entry<T, Integer> entry : getAll().entrySet())
{
if (entry.getKey().equals(style))
scnt = entry.getValue();
allcnt += entry.getValue(); // depends on control dependency: [for], data = [entry]
}
return scnt / (double) allcnt;
} }
|
public class class_name {
public void putAll(Map<KEY, VALUE> mapDataToPut) {
int targetSize = maxSize - mapDataToPut.size();
if (maxSize > 0 && values.size() > targetSize) {
evictToTargetSize(targetSize);
}
Set<Entry<KEY, VALUE>> entries = mapDataToPut.entrySet();
for (Entry<KEY, VALUE> entry : entries) {
put(entry.getKey(), entry.getValue());
}
} }
|
public class class_name {
public void putAll(Map<KEY, VALUE> mapDataToPut) {
int targetSize = maxSize - mapDataToPut.size();
if (maxSize > 0 && values.size() > targetSize) {
evictToTargetSize(targetSize); // depends on control dependency: [if], data = [none]
}
Set<Entry<KEY, VALUE>> entries = mapDataToPut.entrySet();
for (Entry<KEY, VALUE> entry : entries) {
put(entry.getKey(), entry.getValue()); // depends on control dependency: [for], data = [entry]
}
} }
|
public class class_name {
@Override
public void heartbeat() {
// Prepare metadata for the next heartbeat
BlockHeartbeatReport blockReport = mBlockWorker.getReport();
BlockStoreMeta storeMeta = mBlockWorker.getStoreMeta();
// Send the heartbeat and execute the response
Command cmdFromMaster = null;
List<alluxio.grpc.Metric> metrics = new ArrayList<>();
for (Metric metric : MetricsSystem.allWorkerMetrics()) {
metrics.add(metric.toProto());
}
try {
cmdFromMaster = mMasterClient.heartbeat(mWorkerId.get(), storeMeta.getCapacityBytesOnTiers(),
storeMeta.getUsedBytesOnTiers(), blockReport.getRemovedBlocks(),
blockReport.getAddedBlocks(), blockReport.getLostStorage(), metrics);
handleMasterCommand(cmdFromMaster);
mLastSuccessfulHeartbeatMs = System.currentTimeMillis();
} catch (IOException | ConnectionFailedException e) {
// An error occurred, log and ignore it or error if heartbeat timeout is reached
if (cmdFromMaster == null) {
LOG.error("Failed to receive master heartbeat command.", e);
} else {
LOG.error("Failed to receive or execute master heartbeat command: {}",
cmdFromMaster.toString(), e);
}
mMasterClient.disconnect();
if (mHeartbeatTimeoutMs > 0) {
if (System.currentTimeMillis() - mLastSuccessfulHeartbeatMs >= mHeartbeatTimeoutMs) {
if (ServerConfiguration.getBoolean(PropertyKey.TEST_MODE)) {
throw new RuntimeException("Master heartbeat timeout exceeded: " + mHeartbeatTimeoutMs);
}
// TODO(andrew): Propagate the exception to the main thread and exit there.
ProcessUtils.fatalError(LOG, "Master heartbeat timeout exceeded: %d",
mHeartbeatTimeoutMs);
}
}
}
} }
|
public class class_name {
@Override
public void heartbeat() {
// Prepare metadata for the next heartbeat
BlockHeartbeatReport blockReport = mBlockWorker.getReport();
BlockStoreMeta storeMeta = mBlockWorker.getStoreMeta();
// Send the heartbeat and execute the response
Command cmdFromMaster = null;
List<alluxio.grpc.Metric> metrics = new ArrayList<>();
for (Metric metric : MetricsSystem.allWorkerMetrics()) {
metrics.add(metric.toProto()); // depends on control dependency: [for], data = [metric]
}
try {
cmdFromMaster = mMasterClient.heartbeat(mWorkerId.get(), storeMeta.getCapacityBytesOnTiers(),
storeMeta.getUsedBytesOnTiers(), blockReport.getRemovedBlocks(),
blockReport.getAddedBlocks(), blockReport.getLostStorage(), metrics); // depends on control dependency: [try], data = [none]
handleMasterCommand(cmdFromMaster); // depends on control dependency: [try], data = [none]
mLastSuccessfulHeartbeatMs = System.currentTimeMillis(); // depends on control dependency: [try], data = [none]
} catch (IOException | ConnectionFailedException e) {
// An error occurred, log and ignore it or error if heartbeat timeout is reached
if (cmdFromMaster == null) {
LOG.error("Failed to receive master heartbeat command.", e); // depends on control dependency: [if], data = [none]
} else {
LOG.error("Failed to receive or execute master heartbeat command: {}",
cmdFromMaster.toString(), e); // depends on control dependency: [if], data = [none]
}
mMasterClient.disconnect();
if (mHeartbeatTimeoutMs > 0) {
if (System.currentTimeMillis() - mLastSuccessfulHeartbeatMs >= mHeartbeatTimeoutMs) {
if (ServerConfiguration.getBoolean(PropertyKey.TEST_MODE)) {
throw new RuntimeException("Master heartbeat timeout exceeded: " + mHeartbeatTimeoutMs);
}
// TODO(andrew): Propagate the exception to the main thread and exit there.
ProcessUtils.fatalError(LOG, "Master heartbeat timeout exceeded: %d",
mHeartbeatTimeoutMs); // depends on control dependency: [if], data = [none]
}
}
} // depends on control dependency: [catch], data = [none]
} }
|
public class class_name {
@Conditioned
@Lorsque("Je patiente que le fichier nommé '(.*)' soit téléchargé avec un timeout de '(.*)' secondes[\\.|\\?]")
@Then("I wait file named '(.*)' to be downloaded with timeout of '(.*)' seconds[\\.|\\?]")
public void waitDownloadFile(String file, int timeout, List<GherkinStepCondition> conditions) throws InterruptedException, FailureException, TechnicalException {
File f;
int nbTry = 0;
do {
if (nbTry >= timeout) {
new Result.Failure<>(file, Messages.format(Messages.getMessage(Messages.FAIL_MESSAGE_DOWNLOADED_FILE_NOT_FOUND), file), false, Context.getCallBack(Callbacks.RESTART_WEB_DRIVER));
}
Thread.sleep(1000);
f = new File(System.getProperty(USER_DIR) + File.separator + DOWNLOADED_FILES_FOLDER + File.separator + file);
nbTry++;
} while (!(f.exists() && !f.isDirectory()));
logger.debug("File downloaded in {} seconds.", nbTry);
} }
|
public class class_name {
@Conditioned
@Lorsque("Je patiente que le fichier nommé '(.*)' soit téléchargé avec un timeout de '(.*)' secondes[\\.|\\?]")
@Then("I wait file named '(.*)' to be downloaded with timeout of '(.*)' seconds[\\.|\\?]")
public void waitDownloadFile(String file, int timeout, List<GherkinStepCondition> conditions) throws InterruptedException, FailureException, TechnicalException {
File f;
int nbTry = 0;
do {
if (nbTry >= timeout) {
new Result.Failure<>(file, Messages.format(Messages.getMessage(Messages.FAIL_MESSAGE_DOWNLOADED_FILE_NOT_FOUND), file), false, Context.getCallBack(Callbacks.RESTART_WEB_DRIVER)); // depends on control dependency: [if], data = [none]
}
Thread.sleep(1000);
f = new File(System.getProperty(USER_DIR) + File.separator + DOWNLOADED_FILES_FOLDER + File.separator + file);
nbTry++;
} while (!(f.exists() && !f.isDirectory()));
logger.debug("File downloaded in {} seconds.", nbTry);
} }
|
public class class_name {
public static DataSet<Vertex<Long, String>> getVertices(ExecutionEnvironment env) {
List<Vertex<Long, String>> vertices = new ArrayList<>(INPUT_VERTICES.length);
for (String vertex : INPUT_VERTICES) {
String[] tokens = vertex.split(";");
vertices.add(new Vertex<>(Long.parseLong(tokens[0]), tokens[1]));
}
return env.fromCollection(vertices);
} }
|
public class class_name {
public static DataSet<Vertex<Long, String>> getVertices(ExecutionEnvironment env) {
List<Vertex<Long, String>> vertices = new ArrayList<>(INPUT_VERTICES.length);
for (String vertex : INPUT_VERTICES) {
String[] tokens = vertex.split(";");
vertices.add(new Vertex<>(Long.parseLong(tokens[0]), tokens[1])); // depends on control dependency: [for], data = [none]
}
return env.fromCollection(vertices);
} }
|
public class class_name {
public EClass getFontFidelity() {
if (fontFidelityEClass == null) {
fontFidelityEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(504);
}
return fontFidelityEClass;
} }
|
public class class_name {
public EClass getFontFidelity() {
if (fontFidelityEClass == null) {
fontFidelityEClass = (EClass)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(504); // depends on control dependency: [if], data = [none]
}
return fontFidelityEClass;
} }
|
public class class_name {
private void addPossibleSignature(String name, Node node, NodeTraversal t) {
if (node.isFunction()) {
// The node we're looking at is a function, so we can add it directly
addSignature(name, node, t.getSourceName());
} else {
nonMethodProperties.add(name);
}
} }
|
public class class_name {
private void addPossibleSignature(String name, Node node, NodeTraversal t) {
if (node.isFunction()) {
// The node we're looking at is a function, so we can add it directly
addSignature(name, node, t.getSourceName()); // depends on control dependency: [if], data = [none]
} else {
nonMethodProperties.add(name); // depends on control dependency: [if], data = [none]
}
} }
|
public class class_name {
protected boolean readCache() {
if (this.cache != null) {
if (this.cache.isCached(resourceId)) {
byte[] data = this.cache.read(resourceId);
if (data != null) {
setData(data);
return true;
}
}
}
return false;
} }
|
public class class_name {
protected boolean readCache() {
if (this.cache != null) {
if (this.cache.isCached(resourceId)) {
byte[] data = this.cache.read(resourceId);
if (data != null) {
setData(data); // depends on control dependency: [if], data = [(data]
return true; // depends on control dependency: [if], data = [none]
}
}
}
return false;
} }
|
public class class_name {
private CompositeExpression parseWildcardRange() {
if (tokens.positiveLookahead(WILDCARD)) {
tokens.consume();
return gte(versionFor(0, 0, 0));
}
int major = intOf(consumeNextToken(NUMERIC).lexeme);
consumeNextToken(DOT);
if (tokens.positiveLookahead(WILDCARD)) {
tokens.consume();
return gte(versionFor(major)).and(lt(versionFor(major + 1)));
}
int minor = intOf(consumeNextToken(NUMERIC).lexeme);
consumeNextToken(DOT);
consumeNextToken(WILDCARD);
return gte(versionFor(major, minor)).and(lt(versionFor(major, minor + 1)));
} }
|
public class class_name {
private CompositeExpression parseWildcardRange() {
if (tokens.positiveLookahead(WILDCARD)) {
tokens.consume(); // depends on control dependency: [if], data = [none]
return gte(versionFor(0, 0, 0)); // depends on control dependency: [if], data = [none]
}
int major = intOf(consumeNextToken(NUMERIC).lexeme);
consumeNextToken(DOT);
if (tokens.positiveLookahead(WILDCARD)) {
tokens.consume(); // depends on control dependency: [if], data = [none]
return gte(versionFor(major)).and(lt(versionFor(major + 1))); // depends on control dependency: [if], data = [none]
}
int minor = intOf(consumeNextToken(NUMERIC).lexeme);
consumeNextToken(DOT);
consumeNextToken(WILDCARD);
return gte(versionFor(major, minor)).and(lt(versionFor(major, minor + 1)));
} }
|
public class class_name {
public DecreaseReplicaCountRequest withReplicasToRemove(String... replicasToRemove) {
if (this.replicasToRemove == null) {
setReplicasToRemove(new com.amazonaws.internal.SdkInternalList<String>(replicasToRemove.length));
}
for (String ele : replicasToRemove) {
this.replicasToRemove.add(ele);
}
return this;
} }
|
public class class_name {
public DecreaseReplicaCountRequest withReplicasToRemove(String... replicasToRemove) {
if (this.replicasToRemove == null) {
setReplicasToRemove(new com.amazonaws.internal.SdkInternalList<String>(replicasToRemove.length)); // depends on control dependency: [if], data = [none]
}
for (String ele : replicasToRemove) {
this.replicasToRemove.add(ele); // depends on control dependency: [for], data = [ele]
}
return this;
} }
|
public class class_name {
public java.util.List<String> getSnapshotArns() {
if (snapshotArns == null) {
snapshotArns = new com.amazonaws.internal.SdkInternalList<String>();
}
return snapshotArns;
} }
|
public class class_name {
public java.util.List<String> getSnapshotArns() {
if (snapshotArns == null) {
snapshotArns = new com.amazonaws.internal.SdkInternalList<String>(); // depends on control dependency: [if], data = [none]
}
return snapshotArns;
} }
|
public class class_name {
@Override
public int create(String path, @mode_t long mode, FuseFileInfo fi) {
final AlluxioURI uri = mPathResolverCache.getUnchecked(path);
final int flags = fi.flags.get();
LOG.trace("create({}, {}) [Alluxio: {}]", path, Integer.toHexString(flags), uri);
try {
if (mOpenFiles.size() >= MAX_OPEN_FILES) {
LOG.error("Cannot create {}: too many open files (MAX_OPEN_FILES: {})", path,
MAX_OPEN_FILES);
return -ErrorCodes.EMFILE();
}
FileOutStream os = mFileSystem.createFile(uri);
synchronized (mOpenFiles) {
mOpenFiles.add(new OpenFileEntry(mNextOpenFileId, path, null, os));
fi.fh.set(mNextOpenFileId);
// Assuming I will never wrap around (2^64 open files are quite a lot anyway)
mNextOpenFileId += 1;
}
LOG.debug("{} created and opened", path);
} catch (FileAlreadyExistsException e) {
LOG.debug("Failed to create {}, file already exists", path);
return -ErrorCodes.EEXIST();
} catch (InvalidPathException e) {
LOG.debug("Failed to create {}, path is invalid", path);
return -ErrorCodes.ENOENT();
} catch (Throwable t) {
LOG.error("Failed to create {}", path, t);
return AlluxioFuseUtils.getErrorCode(t);
}
return 0;
} }
|
public class class_name {
@Override
public int create(String path, @mode_t long mode, FuseFileInfo fi) {
final AlluxioURI uri = mPathResolverCache.getUnchecked(path);
final int flags = fi.flags.get();
LOG.trace("create({}, {}) [Alluxio: {}]", path, Integer.toHexString(flags), uri);
try {
if (mOpenFiles.size() >= MAX_OPEN_FILES) {
LOG.error("Cannot create {}: too many open files (MAX_OPEN_FILES: {})", path,
MAX_OPEN_FILES); // depends on control dependency: [if], data = [none]
return -ErrorCodes.EMFILE(); // depends on control dependency: [if], data = [none]
}
FileOutStream os = mFileSystem.createFile(uri);
synchronized (mOpenFiles) { // depends on control dependency: [try], data = [none]
mOpenFiles.add(new OpenFileEntry(mNextOpenFileId, path, null, os));
fi.fh.set(mNextOpenFileId);
// Assuming I will never wrap around (2^64 open files are quite a lot anyway)
mNextOpenFileId += 1;
}
LOG.debug("{} created and opened", path); // depends on control dependency: [try], data = [none]
} catch (FileAlreadyExistsException e) {
LOG.debug("Failed to create {}, file already exists", path);
return -ErrorCodes.EEXIST();
} catch (InvalidPathException e) { // depends on control dependency: [catch], data = [none]
LOG.debug("Failed to create {}, path is invalid", path);
return -ErrorCodes.ENOENT();
} catch (Throwable t) { // depends on control dependency: [catch], data = [none]
LOG.error("Failed to create {}", path, t);
return AlluxioFuseUtils.getErrorCode(t);
} // depends on control dependency: [catch], data = [none]
return 0;
} }
|
public class class_name {
public void setShadowRadius(float shadowRadius) {
this.shadowRadius = dpToPx(shadowRadius);
if (isShadowResponsiveEffectEnabled()) {
((ShadowResponsiveDrawer) shadowResponsiveDrawer).setCurrentShadowRadius(getShadowRadius());
}
requestLayout();
LOGGER.trace("Action Button shadow radius changed to: {}", getShadowRadius());
} }
|
public class class_name {
public void setShadowRadius(float shadowRadius) {
this.shadowRadius = dpToPx(shadowRadius);
if (isShadowResponsiveEffectEnabled()) {
((ShadowResponsiveDrawer) shadowResponsiveDrawer).setCurrentShadowRadius(getShadowRadius()); // depends on control dependency: [if], data = [none]
}
requestLayout();
LOGGER.trace("Action Button shadow radius changed to: {}", getShadowRadius());
} }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.