id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
28,701 | import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.LocalFileSystem;
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.permission.FsPermission;
import org.apache.hadoop.util.Progressable;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AFileSystem extends FileSyste... | import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
28,702 | public void initialize(URI name, Configuration conf) throws IOException {
super.initialize(name, conf);
uri = URI.create(name.getScheme() + "://" + name.getAuthority());
workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri,
this.getWorkingDirectory());
<BUG>String accessKey = conf.get(... | String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null));
String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
|
28,703 | } else {
accessKey = userInfo;
}
}
AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain(
<BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey),
new InstanceProfileCredentialsProvider(),
new S3AAnonymousAWSCredentialsProvider()
);</BUG>
bucket = name.getHost();
| new BasicAWSCredentialsProvider(accessKey, secretKey),
new AnonymousAWSCredentialsProvider()
|
28,704 |
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT));
</BUG>
s3 = new AmazonS3Client(credentials, awsConf);
<BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS);
partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THR... | new InstanceProfileCredentialsProvider(),
new AnonymousAWSCredentialsProvider()
bucket = name.getHost();
ClientConfiguration awsConf = new ClientConfiguration();
awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS)));
awsConf.setProtocol(conf.g... |
28,705 | cannedACL = null;
}
if (!s3.doesBucketExist(bucket)) {
throw new IOException("Bucket " + bucket + " does not exist");
}
<BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART);
long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_... | boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART));
long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART... |
28,706 | import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
<BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*;
public class S3AOutputStream extends OutputStream {</BUG>
private OutputStream backupStream;
private File backup... | import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
28,707 | this.client = client;
this.progress = progress;
this.fs = fs;
this.cannedACL = cannedACL;
this.statistics = statistics;
<BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (conf.get(BUFFER_DIR, null) ... | partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
28,708 | private final I18n i18n;
private Filter filter;
ApplicationElement(TodoItemRepository repository, I18n i18n) {
this.repository = repository;
this.i18n = i18n;
<BUG>Elements.Builder builder = new Elements.Builder()
.section().css("todoapp")</BUG>
.header().css("header")
.h(1).innerText(i18n.constants().todos()).end()
.i... | TodoBuilder builder = new TodoBuilder()
.section().css("todoapp")
|
28,709 | import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ElementsBuilderTest {
<BUG>private Elements.Builder builder;
</BUG>
@Before
public void setUp() {
Document document = mock(Document.cla... | private TestableBuilder builder;
|
28,710 | when(document.createParagraphElement()).thenAnswer(invocation -> new StandaloneElement("p"));
when(document.createSelectElement()).thenAnswer(invocation -> new StandaloneInputElement("select"));
when(document.createSpanElement()).thenAnswer(invocation -> new StandaloneElement("span"));
when(document.createTextAreaEleme... | builder = new TestableBuilder(document);
|
28,711 | TodoItemRepository repository = new TodoItemRepository(BEAN_FACTORY);
ApplicationElement application = new ApplicationElement(repository, i18n);
Element body = Browser.getDocument().getBody();
body.appendChild(application.asElement());
body.appendChild(new FooterElement(i18n).asElement());
<BUG>Element e = new MyBuilde... | [DELETED] |
28,712 | @Override
public String toString() {
return (container ? "container" : "simple") + " @ " + level + ": " + element.getTagName();
}
}
<BUG>public static class Builder extends CoreBuilder<Builder>
{
public Builder() {
super(Browser.getDocument());
}
protected Builder(Document document) {
super( document );</BUG>
}
| [DELETED] |
28,713 | return start(document.createElement(tag));
}
public B start(Element element) {
elements.push(new ElementInfo(element, true, level));
level++;
<BUG>return (B) this;
}</BUG>
public B end() {
assertCurrent();
if (level == 0) {
| return that();
|
28,714 | Element closingElement = elements.peek().element;
for (ElementInfo child : children) {
closingElement.appendChild(child.element);
}
level--;
<BUG>return (B) this;
}</BUG>
private String dumpElements() {
return elements.toString();
}
| return that();
|
28,715 | }
public B on(EventType type, EventListener listener) {
assertCurrent();
Element element = elements.peek().element;
type.register(element, listener);
<BUG>return (B) this;
}</BUG>
public B rememberAs(String id) {
assertCurrent();
references.put(id, elements.peek().element);
| public B attr(String name, String value) {
elements.peek().element.setAttribute(name, value);
return that();
|
28,716 | p.y += size - dy;
else
p.y -= dy;
after[i] = new Point(p.x, p.y);
}
<BUG>addUndoPositionInterface.addUndoPosition(elemArray, indices, before, after);
</BUG>
redrawable.redraw();
}
public void allignleft()
| if (addUndoPositionInterface!=null) addUndoPositionInterface.addUndoPosition(elemArray, indices, before, after);
|
28,717 | Point p = stepMeta.getLocation();
before[i] = new Point(p.x, p.y);
stepMeta.setLocation(max, p.y);
after[i] = new Point(max, p.y);
}
<BUG>addUndoPositionInterface.addUndoPosition(elemArray, indices, before, after);
</BUG>
redrawable.redraw();
}
public void alligntop()
| if (addUndoPositionInterface!=null) addUndoPositionInterface.addUndoPosition(elemArray, indices, before, after);
|
28,718 | private String perfMonFile = "/var/log/sdfs/perf.json";
private boolean clusterRackAware = false;
private boolean ext = true;
private boolean awsAim = false;
private boolean genericS3 = false;
<BUG>private boolean accessEnabled = false;
private String accessPath = null;</BUG>
private String cloudUrl;
private boolean re... | private boolean atmosEnabled = false;
private boolean backblazeEnabled = false;
private String accessPath = null;
|
28,719 | this.dirPermissions = cmd.getOptionValue("permissions-folder");
}
if (cmd.hasOption("permissions-owner")) {
this.owner = cmd.getOptionValue("permissions-owner");
}
<BUG>if(cmd.hasOption("compress-metadata")) {
</BUG>
this.mdCompresstion = true;
}
if (cmd.hasOption("chunk-store-data-location")) {
| if (cmd.hasOption("compress-metadata")) {
|
28,720 | System.out.println(cmd.getOptionValue("cloud-access-key"));
System.out.println(cmd.getOptionValue("cloud-secret-key"));
System.out.println(cmd.getOptionValue("cloud-bucket-name"));
System.exit(-1);
}
<BUG>} else if (this.gsEnabled) {
if (cmd.hasOption("cloud-secret-key") && cmd.hasOption("cloud-access-key")</BUG>
&& cm... | } else if (this.gsEnabled || this.atmosEnabled || this.backblazeEnabled) {
if (cmd.hasOption("cloud-secret-key") && cmd.hasOption("cloud-access-key")
|
28,721 | Element aws = (Element) doc.getElementsByTagName("file-store").item(0);
if (aws.hasAttribute("chunkstore-class"))
Main.chunkStoreClass = aws.getAttribute("chunkstore-class");
Main.cloudChunkStore = Boolean.parseBoolean(aws
.getAttribute("enabled"));
<BUG>Main.cloudBucket = aws.getAttribute("bucket-name");
}</BUG>
if (g... | }
|
28,722 | if (HashBlobArchive.REMOVE_FROM_CACHE)
lf.delete();
SDFSLogger.getLog().error("unable to read " + lf.getPath(), e);
}
if (m == null && HashBlobArchive.REMOVE_FROM_CACHE) {
<BUG>Map<String, Long> _m = store.getHashMap(hashid);
Set<String> keys = _m.keySet();
m = new SimpleByteArrayLongMap(lf.getPath(), MAX_HM_SZ, VERSIO... | double z = _m.size() * 1.25;
int sz = new Long(Math.round(z)).intValue();
m = new SimpleByteArrayLongMap(lf.getPath(), sz, VERSION);
|
28,723 | buf.putInt(hash.length);
buf.put(hash);
buf.putInt(chunk.length);
buf.put(chunk);
this.uncompressedLength.addAndGet(al);
<BUG>HashBlobArchive.currentLength.addAndGet(al);
HashBlobArchive.compressedLength.addAndGet(chunk.length);</BUG>
buf.position(0);
ch.write(buf, cp);
} finally {
| [DELETED] |
28,724 | public abstract void close();
public abstract void init(Element config) throws IOException;
public abstract String getName();
public abstract void setName(String name);
public abstract long size();
<BUG>public abstract long compressedSize();
public abstract long maxSize();</BUG>
public abstract void sync() throws IOExc... | public abstract void clearCounters();
public abstract long maxSize();
|
28,725 | private final I18n i18n;
private Filter filter;
ApplicationElement(TodoItemRepository repository, I18n i18n) {
this.repository = repository;
this.i18n = i18n;
<BUG>Elements.Builder builder = new Elements.Builder()
.section().css("todoapp")</BUG>
.header().css("header")
.h(1).innerText(i18n.constants().todos()).end()
.i... | TodoBuilder builder = new TodoBuilder()
.section().css("todoapp")
|
28,726 | import static org.junit.Assert.assertNotNull;
import static org.mockito.Matchers.anyString;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
public class ElementsBuilderTest {
<BUG>private Elements.Builder builder;
</BUG>
@Before
public void setUp() {
Document document = mock(Document.cla... | private TestableBuilder builder;
|
28,727 | when(document.createParagraphElement()).thenAnswer(invocation -> new StandaloneElement("p"));
when(document.createSelectElement()).thenAnswer(invocation -> new StandaloneInputElement("select"));
when(document.createSpanElement()).thenAnswer(invocation -> new StandaloneElement("span"));
when(document.createTextAreaEleme... | builder = new TestableBuilder(document);
|
28,728 | TodoItemRepository repository = new TodoItemRepository(BEAN_FACTORY);
ApplicationElement application = new ApplicationElement(repository, i18n);
Element body = Browser.getDocument().getBody();
body.appendChild(application.asElement());
body.appendChild(new FooterElement(i18n).asElement());
<BUG>Element e = new MyBuilde... | [DELETED] |
28,729 | @Override
public String toString() {
return (container ? "container" : "simple") + " @ " + level + ": " + element.getTagName();
}
}
<BUG>public static class Builder extends CoreBuilder<Builder>
{
public Builder() {
super(Browser.getDocument());
}
protected Builder(Document document) {
super( document );</BUG>
}
| [DELETED] |
28,730 | return start(document.createElement(tag));
}
public B start(Element element) {
elements.push(new ElementInfo(element, true, level));
level++;
<BUG>return (B) this;
}</BUG>
public B end() {
assertCurrent();
if (level == 0) {
| return that();
|
28,731 | Element closingElement = elements.peek().element;
for (ElementInfo child : children) {
closingElement.appendChild(child.element);
}
level--;
<BUG>return (B) this;
}</BUG>
private String dumpElements() {
return elements.toString();
}
| return that();
|
28,732 | }
public B on(EventType type, EventListener listener) {
assertCurrent();
Element element = elements.peek().element;
type.register(element, listener);
<BUG>return (B) this;
}</BUG>
public B rememberAs(String id) {
assertCurrent();
references.put(id, elements.peek().element);
| public B attr(String name, String value) {
elements.peek().element.setAttribute(name, value);
return that();
|
28,733 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoC... | import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
28,734 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
28,735 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
28,736 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.... | import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
28,737 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.t... | public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate()... |
28,738 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangos... | import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
28,739 | import org.apache.commons.lang3.math.NumberUtils;
import org.json.JSONException;
import org.mariotaku.microblog.library.MicroBlog;
import org.mariotaku.microblog.library.MicroBlogException;
import org.mariotaku.microblog.library.twitter.model.RateLimitStatus;
<BUG>import org.mariotaku.microblog.library.twitter.model.St... | import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
28,740 | context.getApplicationContext().sendBroadcast(intent);
}
}
@Nullable
public static Location getCachedLocation(Context context) {
<BUG>if (BuildConfig.DEBUG) {
Log.v(LOGTAG, "Fetching cached location", new Exception());
}</BUG>
Location location = null;
| DebugLog.v(LOGTAG, "Fetching cached location", new Exception());
|
28,741 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBannerImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.form... | if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
28,742 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
twitter.updateProfileBackgroundImage(fileBody, tile);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, S... | twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
28,743 | FileBody fileBody = null;
try {
fileBody = getFileBody(context, imageUri);
return twitter.updateProfileImage(fileBody);
} finally {
<BUG>Utils.closeSilently(fileBody);
if (deleteImage && "file".equals(imageUri.getScheme())) {
final File file = new File(imageUri.getPath());
if (!file.delete()) {
Log.w(LOGTAG, String.for... | twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
28,744 | import org.mariotaku.twidere.receiver.NotificationReceiver;
import org.mariotaku.twidere.service.LengthyOperationsService;
import org.mariotaku.twidere.util.ActivityTracker;
import org.mariotaku.twidere.util.AsyncTwitterWrapper;
import org.mariotaku.twidere.util.DataStoreFunctionsKt;
<BUG>import org.mariotaku.twidere.u... | import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.ImagePreloader;
|
28,745 | final List<InetAddress> addresses = mDns.lookup(host);
for (InetAddress address : addresses) {
c.addRow(new String[]{host, address.getHostAddress()});
}
} catch (final IOException ignore) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, ignore);
}</BUG>
}
| DebugLog.w(LOGTAG, null, ignore);
|
28,746 | for (Location location : twitter.getAvailableTrends()) {
map.put(location);
}
return map.pack();
} catch (final MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
28,747 | import android.content.Context;
import android.content.SharedPreferences;
import android.location.Location;
import android.os.AsyncTask;
import android.support.annotation.NonNull;
<BUG>import android.util.Log;
import org.mariotaku.twidere.BuildConfig;
import org.mariotaku.twidere.Constants;
import org.mariotaku.twidere... | import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.JsonSerializer;
|
28,748 | }
public static LatLng getCachedLatLng(@NonNull final Context context) {
final Context appContext = context.getApplicationContext();
final SharedPreferences prefs = DependencyHolder.Companion.get(context).getPreferences();
if (!prefs.getBoolean(KEY_USAGE_STATISTICS, false)) return null;
<BUG>if (BuildConfig.DEBUG) {
Lo... | DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
|
28,749 | public int destroySavedSearchAsync(final UserKey accountKey, final long searchId) {
final DestroySavedSearchTask task = new DestroySavedSearchTask(accountKey, searchId);
return asyncTaskManager.add(task, true);
}
public int destroyStatusAsync(final UserKey accountKey, final String statusId) {
<BUG>final DestroyStatusTa... | final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
|
28,750 | @Override
public void afterExecute(Bus handler, SingleResponse<Relationship> result) {
if (result.hasData()) {
handler.post(new FriendshipUpdatedEvent(accountKey, userKey, result.getData()));
} else if (result.hasException()) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, "Unable to update friendship", result.getExcepti... | public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
28,751 | MicroBlog microBlog = MicroBlogAPIFactory.getInstance(context, accountId);
if (!Utils.isOfficialCredentials(context, accountId)) continue;
try {
microBlog.setActivitiesAboutMeUnread(cursor);
} catch (MicroBlogException e) {
<BUG>if (BuildConfig.DEBUG) {
Log.w(LOGTAG, e);
}</BUG>
}
| DebugLog.w(LOGTAG, null, e);
|
28,752 | <BUG>package org.gradle.model.internal.inspect;
import com.google.common.collect.ImmutableSet;
import com.google.common.reflect.TypeToken;
import org.gradle.internal.UncheckedException;</BUG>
import org.gradle.internal.reflect.JavaMethod;
| import com.google.common.base.Function;
import com.google.common.base.Joiner;
import com.google.common.collect.Iterables;
import org.gradle.internal.Factory;
import org.gradle.internal.UncheckedException;
|
28,753 | import com.google.common.reflect.TypeToken;
import org.gradle.internal.UncheckedException;</BUG>
import org.gradle.internal.reflect.JavaMethod;
import org.gradle.internal.reflect.JavaReflectionUtil;
import org.gradle.model.InvalidModelRuleDeclarationException;
<BUG>import org.gradle.model.Model;
import org.gradle.model... | import org.gradle.internal.Factory;
import org.gradle.internal.UncheckedException;
import org.gradle.model.Mutate;
import org.gradle.model.RuleSource;
|
28,754 | import org.gradle.model.internal.core.ModelType;
import org.gradle.model.internal.core.rule.Inputs;
import org.gradle.model.internal.core.rule.ModelCreator;
import org.gradle.model.internal.core.rule.describe.MethodModelRuleSourceDescriptor;
import org.gradle.model.internal.core.rule.describe.ModelRuleSourceDescriptor;... | import org.gradle.model.internal.registry.ReflectiveRule;
import java.lang.annotation.Annotation;
import java.lang.reflect.Constructor;
|
28,755 | import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Collections;
import java.util.Set;
<BUG>public class ModelRuleInspector {
public Set<Class<?>> getDeclaredSources(Class<?> container) {</BUG>
Class<?>[] declaredClasses = container.getDeclaredClasses();
... | private final static Set<Class<? extends Annotation>> TYPE_ANNOTATIONS = ImmutableSet.of(Model.class, Mutate.class);
public Set<Class<?>> getDeclaredSources(Class<?> container) {
|
28,756 | modelRegistry.create(modelName, Collections.<String>emptyList(), new ModelCreator<R>() {
public ModelReference<R> getReference() {
return new ModelReference<R>(new ModelPath(modelName), new ModelType<R>(returnType));
}
public R create(Inputs inputs) {
<BUG>T instance = Modifier.isStatic(method.getModifiers()) ? null : ... | T instance = Modifier.isStatic(method.getModifiers()) ? null : toInstance(clazz);
|
28,757 | }
Field[] fields = source.getDeclaredFields();
for (Field field : fields) {
int fieldModifiers = field.getModifiers();
if (!field.isSynthetic() && !(Modifier.isStatic(fieldModifiers) && Modifier.isFinal(fieldModifiers))) {
<BUG>invalid(source, "field " + field.getName() + " is not static final");
</BUG>
}
}
}
| private void creationMethod(ModelRegistry modelRegistry, Method method, Model modelAnnotation) {
if (method.getParameterTypes().length > 0) {
throw new IllegalArgumentException("@Model rules cannot take arguments");
|
28,758 | package org.gradle.model.internal.core.rule;
<BUG>import org.gradle.model.internal.core.ModelElement;
public interface Inputs {
<T> ModelElement<? extends T> get(int i, Class<T> type);
</BUG>
int size();
| import org.gradle.model.internal.core.ModelType;
<T> ModelElement<? extends T> get(int i, ModelType<T> type);
|
28,759 | public class ModelReference<T> {
private final ModelPath path;
private final ModelType<T> type;
public ModelReference(ModelPath path, ModelType<T> type) {
this.path = path;
<BUG>this.type = type;
}</BUG>
public ModelReference(String modelPath, ModelType<T> type) {
this(new ModelPath(modelPath), type);
}
| public static <T> ModelReference<T> of(ModelPath path, ModelType<T> type) {
return new ModelReference<T>(path, type);
|
28,760 | ClientRegistry.registerKeyBinding(burnSecond);
}
public static void registerPackets() {
network = NetworkRegistry.INSTANCE.newSimpleChannel("allomancy");
network.registerMessage(StopFallPacket.Handler.class, StopFallPacket.class, 0, Side.SERVER);
<BUG>network.registerMessage(BecomeMistbornPacket.Handler.class, BecomeMi... | network.registerMessage(AllomancyPowerPacket.Handler.class, AllomancyPowerPacket.class, 1, Side.CLIENT);
|
28,761 | import static java.util.Objects.requireNonNull;
import java.io.Closeable;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collections;
<BUG>import java.util.List;
import java.util.Map;</BUG>
import org.jdbi.v3.core.exception.TransactionException;
import org.jdbi.v3.core.exception.UnableToClos... | [DELETED] |
28,762 | statementBuilder,
sql,
new StatementContext(callConfig, extensionMethod.get()),
Collections.<StatementCustomizer>emptyList());
}
<BUG>public Query<Map<String, Object>> createQuery(String sql) {
ConfigRegistry queryConfig = getConfig().createCopy();
return new Query<>(queryConfig,
new Binding(),
new DefaultMapper(),</BU... | new StatementContext(batchConfig, extensionMethod.get()));
public PreparedBatch prepareBatch(String sql) {
ConfigRegistry batchConfig = getConfig().createCopy();
return new PreparedBatch(batchConfig,
|
28,763 | import org.jdbi.v3.core.array.SqlArrayType;
import org.jdbi.v3.core.array.SqlArrayTypes;
import org.jdbi.v3.core.mapper.ColumnMapper;
import org.jdbi.v3.core.mapper.ColumnMappers;
import org.jdbi.v3.core.mapper.RowMapper;
<BUG>import org.jdbi.v3.core.mapper.RowMappers;
public class ConfigRegistry {</BUG>
private final ... | import org.jdbi.v3.core.util.GenericType;
public class ConfigRegistry {
|
28,764 | package com.cronutils.model.time.generator;
import java.util.Collections;
<BUG>import java.util.List;
import org.apache.commons.lang3.Validate;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.expression.FieldExpression;
public abstract class FieldValueGenerator {
| import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.Validate;
|
28,765 | import java.util.ResourceBundle;
import java.util.function.Function;</BUG>
class DescriptionStrategyFactory {
private DescriptionStrategyFactory() {}
public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) {
<BUG>final Function<Integer, String> nominal = integ... | import java.util.function.Function;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
|
28,766 | return dom;
}
public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(
bundle,
<BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()),
expression</BUG>
);
}
public static Descript... | integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()),
expression
|
28,767 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.mapper.WeekDay;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
| import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.Validate;
import com.cronutils.mapper.WeekDay;
|
28,768 | import com.cronutils.model.field.expression.Between;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.parser.CronParserField;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
impo... | [DELETED] |
28,769 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
| import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import org.apache.commons.lang3.Validate;
import com.cronutils.model.field.CronField;
|
28,770 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
import com.google.common.collect.Lists;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateT... | package com.cronutils.model.time.generator;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import com.cronutils.model.field.CronField;
|
28,771 | class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
private int month;
public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) {
super(cronField);
<BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month");
... | Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" +
" month");
this.year = year;
|
28,772 | package com.cronutils.mapper;
public class ConstantsMapper {
private ConstantsMapper() {}
public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false);
<BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false);
</BUG>
public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true);
public st... | public static final WeekDay JAVA8 = new WeekDay(1, false);
|
28,773 | return nextMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException {
</BUG>
List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear());
TimeNode days = null;
int lowestMonth = months.g... | ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
|
28,774 | boolean questionMarkSupported =
cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK);
if(questionMarkSupported){
return new TimeNode(
generateDayCandidatesQuestionMarkSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefini... | date.getYear(), date.getMonthValue(),
|
28,775 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
28,776 | }
public DateTime lastExecution(DateTime date){
</BUG>
Validate.notNull(date);
try {
<BUG>DateTime previousMatch = previousClosestMatch(date);
</BUG>
if(previousMatch.equals(date)){
previousMatch = previousClosestMatch(date.minusSeconds(1));
}
| public java.time.Duration timeToNextExecution(ZonedDateTime date){
return java.time.Duration.between(date, nextExecution(date));
public ZonedDateTime lastExecution(ZonedDateTime date){
ZonedDateTime previousMatch = previousClosestMatch(date);
|
28,777 | return previousMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>public Duration timeFromLastExecution(DateTime date){
return new Interval(lastExecution(date), date).toDuration();
}
public boolean isMatch(DateTime date){
</BUG>
return nextExecution(lastExecution(date)).equals(da... | [DELETED] |
28,778 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
| import java.time.ZonedDateTime;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cronutils.model.field.CronField;
|
28,779 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
<BUG>import org.joda.time.DateTime;
import org.slf4j.Logger;
i... | package com.cronutils.model.time.generator;
import java.time.ZonedDateTime;
import java.util.List;
import com.cronutils.model.field.CronField;
|
28,780 | private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class);
public EveryFieldValueGenerator(CronField cronField) {
super(cronField);
log.trace(String.format(
"processing \"%s\" at %s",
<BUG>cronField.getExpression().asString(), DateTime.now()
</BUG>
));
}
@Override
| cronField.getExpression().asString(), ZonedDateTime.now()
|
28,781 | import org.mockito.Mockito;
import java.lang.management.GarbageCollectorMXBean;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.TimeUnit;
<BUG>import static org.junit.Assert.assertEquals;
public class GarbageCollectorExportsTest {</BUG>
private GarbageCollectorMXBean mockGcBean1 = Mockito.mo... | import static org.mockito.Mockito.when;
public class GarbageCollectorExportsTest {
|
28,782 | private List<GarbageCollectorMXBean> mockList = Arrays.asList(mockGcBean1, mockGcBean2);
private CollectorRegistry registry = new CollectorRegistry();
private GarbageCollectorExports collectorUnderTest;
@Before
public void setUp() {
<BUG>Mockito.when(mockGcBean1.getName()).thenReturn("MyGC1");
Mockito.when(mockGcBean1.... | collectorUnderTest = new GarbageCollectorExports(mockList).register(registry);
|
28,783 | @Test
public void testGarbageCollectorExports() {
assertEquals(
100L,
registry.getSampleValue(
<BUG>GarbageCollectorExports.COLLECTIONS_COUNT_METRIC,
new String[]{"gc"},</BUG>
new String[]{"MyGC1"}),
.0000001);
assertEquals(
| "jvm_gc_collection_seconds_count",
new String[]{"gc"},
|
28,784 | new String[]{"MyGC1"}),
.0000001);
assertEquals(
10d,
registry.getSampleValue(
<BUG>GarbageCollectorExports.COLLECTIONS_TIME_METRIC,
new String[]{"gc"},</BUG>
new String[]{"MyGC1"}),
.0000001);
assertEquals(
| "jvm_gc_collection_seconds_sum",
new String[]{"gc"},
|
28,785 | new String[]{"MyGC2"}),
.0000001);
assertEquals(
20d,
registry.getSampleValue(
<BUG>GarbageCollectorExports.COLLECTIONS_TIME_METRIC,
new String[]{"gc"},</BUG>
new String[]{"MyGC2"}),
.0000001);
}
| "jvm_gc_collection_seconds_sum",
new String[]{"gc"},
|
28,786 | import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.regex.Pattern;
public class GarbageCollectorExports extends Collector {
<BUG>private static final Pattern WHITESPACE = Pattern.compile("[\\s]+");
static final String COLLECTIONS_COUNT_METRIC = "jvm_gc_collections";
static final S... | [DELETED] |
28,787 | public GarbageCollectorExports() {
this(ManagementFactory.getGarbageCollectorMXBeans());
}
GarbageCollectorExports(List<GarbageCollectorMXBean> garbageCollectors) {
this.garbageCollectors = garbageCollectors;
<BUG>for (final GarbageCollectorMXBean gc : garbageCollectors) {
if (!labelValues.containsKey(gc)) {
String gcN... | public List<MetricFamilySamples> collect() {
|
28,788 | }
public MemoryPoolsExports(MemoryMXBean memoryBean,
List<MemoryPoolMXBean> poolBeans) {
this.memoryBean = memoryBean;
this.poolBeans = poolBeans;
<BUG>for (final MemoryPoolMXBean pool : poolBeans) {
if (!poolLabelValues.containsKey(pool)) {
String gcName = WHITESPACE.matcher(pool.getName()).replaceAll("-");
poolLabelV... | [DELETED] |
28,789 | MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage();
MemoryUsage nonHeapUsage = memoryBean.getNonHeapMemoryUsage();
ArrayList<MetricFamilySamples.Sample> usedSamples = new ArrayList<MetricFamilySamples.Sample>();
usedSamples.add(
new MetricFamilySamples.Sample(
<BUG>MEMORY_USED_METRIC,
MEMORY_LABEL_NAMES,
MEMORY_HE... | [DELETED] |
28,790 |
limitSamples.add(
</BUG>
new MetricFamilySamples.Sample(
<BUG>MEMORY_LIMIT_METRIC,
MEMORY_LABEL_NAMES,
MEMORY_HEAP_LABEL,
heapUsage.getMax() == -1 ? heapUsage.getMax() : heapUsage.getCommitted()));
limitSamples.add(
</BUG>
new MetricFamilySamples.Sample(
| MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage();
MemoryUsage nonHeapUsage = memoryBean.getNonHeapMemoryUsage();
ArrayList<MetricFamilySamples.Sample> usedSamples = new ArrayList<MetricFamilySamples.Sample>();
usedSamples.add(
|
28,791 | import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.servlet.ServletContextHandler;
import org.eclipse.jetty.servlet.ServletHolder;
public class ExampleExporter {
public static void main(String[] args) throws Exception {
<BUG>new StandardExports().register();
Server server = new Server(1234);</BUG>
ServletC... | DefaultExports.initialize();
Server server = new Server(1234);
|
28,792 | package tufts.vue;
import javax.swing.JComponent;
public class FavoritesDataSource extends VueDataSource{
<BUG>private JComponent resourceViewer;
public FavoritesDataSource(String DisplayName){</BUG>
this.setDisplayName(DisplayName);
this.setResourceViewer();
}
| public FavoritesDataSource(){
public FavoritesDataSource(String DisplayName){
|
28,793 | package tufts.vue;
import javax.swing.*;
import java.net.URL;
public class FedoraDataSource extends VueDataSource{
private JComponent resourceViewer;
<BUG>private String address;
private String username;
private String password;
public FedoraDataSource(String DisplayName, String address, String username, String passwo... | private String UserName;
public FedoraDataSource(){
}
public FedoraDataSource(String DisplayName, String address, String username, String password){
|
28,794 | return this.password;
}
public void setResourceViewer(){
try{
this.resourceViewer = new DRViewer("fedora.conf",this.getDisplayName(),this.getDisplayName(),this.getDisplayName(),new URL("http",this.getAddress(),8080,"fedora/"),this.getUserName(),this.getPassword());
<BUG>}catch (Exception ex){};
}</BUG>
public JComponen... | }catch (Exception ex){VueUtil.alert(null,ex.getMessage(),"Error Setting Reseource Viewer");};
|
28,795 | import java.awt.*;
import java.awt.event.*;
import java.util.Vector;
import java.io.File;
import java.io.*;
<BUG>import java.util.*;
import org.exolab.castor.xml.Marshaller;</BUG>
import org.exolab.castor.xml.Unmarshaller;
import org.exolab.castor.xml.MarshalException;
import org.exolab.castor.xml.ValidationException;
| import java.net.URL;
import org.exolab.castor.xml.Marshaller;
|
28,796 | DRBrowser drBrowser;
DataSource activeDataSource;
JPanel resourcesPanel,dataSourcePanel;
String breakTag = "";
public final int ADD_MODE = 0;
<BUG>public final int EDIT_MODE = 1;
JPopupMenu popup; // add edit popup</BUG>
JDialog addEditDialog = null; // The add/edit dialog box.
AbstractAction addAction;//
Abst... | private final static String XML_MAPPING_CURRENT_VERSION_ID = VueResources.getString("mapping.lw.current_version");
private final static URL XML_MAPPING_DEFAULT = VueResources.getURL("mapping.lw.version_" + XML_MAPPING_CURRENT_VERSION_ID);
JPopupMenu popup; // add edit popup
|
28,797 | loadDataSources();
setPopup();
dataSourceList.addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
if ((DataSource)((JList)e.getSource()).getSelectedValue()!=null){
<BUG>if (!(((JList)e.getSource()).getSelectedValue() instanceof String)){
DataSourceViewer.this.setActiv... | System.out.print("do I get here?");
|
28,798 | super.getListCellRendererComponent(list,((DataSource)value).getDisplayName(), index, iss, chf);
}
if (value instanceof FavoritesDataSource){
setIcon(myFavoritesIcon);
this.setPreferredSize(new Dimension(200,20));
<BUG>}
else if (value instanceof String){</BUG>
JPanel linePanel = new JPanel() {
protected void paintCompo... | else if (value instanceof LocalFileDataSource){
setIcon(myComputerIcon);
else if (value instanceof String){
|
28,799 | JScrollPane jsp = (JScrollPane)tpanel.getComponent(1);
int width = jsp.getViewport().getViewSize().width;
g2d.drawLine(0, 3, width-10, 3);
}
};
<BUG>this.setPreferredSize(new Dimension(200,20));
</BUG>
return linePanel;
}
else{
| this.setPreferredSize(new Dimension(200,3));
|
28,800 | marshaller.setMapping(ActionUtil.getDefaultMapping());
marshaller.marshal(favoritesTree);
writer.flush();
writer.close();
} catch (Exception e) {
<BUG>e.printStackTrace();
System.err.println("FavoritesWindow.marshallFavorites: " + e);</BUG>
}
}
public SaveVueJTree unMarshallFavorites(File file) {
| [DELETED] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.