id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
24,001 | e.printStackTrace();
}
filePlayback=null;
}
@Override
<BUG>public void stop() { if ( filePlayback!=null ) filePlayback.stop(); }
void initFiles() throws FileNotFoundException {</BUG>
if ((dataDir.length() != 0) && !dataDir.endsWith("/")) { dataDir = dataDir + "/"; } // guard path if needed
String samples_str = dataDir ... | @Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; }
void initFiles() throws FileNotFoundException {
|
24,002 | public class BufferMonitor extends Thread implements FieldtripBufferMonitor {
public static final String TAG = BufferMonitor.class.toString();
private final Context context;
private final SparseArray<BufferConnectionInfo> clients = new SparseArray<BufferConnectionInfo>();
private final BufferInfo info;
<BUG>private fin... | [DELETED] |
24,003 | public static final String CLIENT_INFO_TIME = "c_time";
public static final String CLIENT_INFO_WAITTIMEOUT = "c_waitTimeout";
public static final String CLIENT_INFO_CONNECTED = "c_connected";
public static final String CLIENT_INFO_CHANGED = "c_changed";
public static final String CLIENT_INFO_DIFF = "c_diff";
<BUG>publi... | public static final int THREAD_INFO_TYPE = 0;
|
24,004 | package nl.dcc.buffer_bci.bufferclientsservice;
import android.os.Parcel;
import android.os.Parcelable;
<BUG>import nl.dcc.buffer_bci.bufferservicecontroller.C;
public class ThreadInfo implements Parcelable {</BUG>
public static final Creator<ThreadInfo> CREATOR = new Creator<ThreadInfo>() {
@Override
public ThreadInfo... | import nl.dcc.buffer_bci.C;
public class ThreadInfo implements Parcelable {
|
24,005 | this.delayedReferences = new HashMap<String, List<String>>();
this.delayedBundles = new LinkedList<Bundle>();
importProviders = new LinkedHashMap<String, ImportProvider>();
importProviders.put(EXT_JCR_XML, null);
importProviders.put(EXT_JSON, JsonReader.PROVIDER);
<BUG>importProviders.put(EXT_XJSON, XJsonReader.PROVIDE... | importProviders.put(EXT_XJSON, JsonReader.PROVIDER);
importProviders.put(EXT_XML, XmlReader.PROVIDER);
|
24,006 | package org.apache.sling.jcr.resource.internal.loader;
import java.io.BufferedInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
<BUG>import java.io.InputStream;
import java.util.Iterator;
</BUG>
import javax.jcr.PropertyType;
import org.apache.sling.commons.json.JSONArray;
| import java.util.HashSet;
import java.util.Set;
|
24,007 | value = null;
}
} else {
property.setValue(String.valueOf(value));
}
<BUG>property.setType((type != null) ? type : this.getType(value));
return property;</BUG>
}
protected String getType(Object object) {
if (object instanceof Double || object instanceof Float) {
| property.setType(getType(value));
return property;
|
24,008 | 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 {
|
24,009 | 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));
|
24,010 | } 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()
|
24,011 |
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... |
24,012 | 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... |
24,013 | 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 {
|
24,014 | 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);
|
24,015 | assertEquals(0, found[0]);
for (int i = 1; i < 12; i++) {
assertEquals(1, found[i]);
}
}
<BUG>public void testSelectGroubyVarbinary() throws IOException, ProcCallException {
</BUG>
Client client = this.getClient();
VoltTable vt;
loaderNxNb(client, 0);
| public void testSelectGroupbyVarbinary() throws IOException, ProcCallException {
|
24,016 | loadF(client, 0);
String qs = "select sum(F_VAL1), sum(F_VAL2), sum(F_VAL3) from F";
vt = client.callProcedure("@AdHoc", qs).getResults()[0];
System.out.println("testDistributedSum result: " + vt);
assertTrue(vt.getRowCount() == 1);
<BUG>while (vt.advanceRow()) {
Integer sum1 = (Integer) vt.get(0, VoltType.INTEGER);</B... | vt.advanceRow();
Integer sum1 = (Integer) vt.get(0, VoltType.INTEGER);
|
24,017 | long start, elapsed;
VoltTable vt;
Client client = this.getClient();
if (this.isHSQL())
return;
<BUG>loadInOrder(client);
start = System.currentTimeMillis();
vt = client.callProcedure("OrderByOneIndex").getResults()[0];
</BUG>
elapsed = System.currentTimeMillis() - start;
| for (int testSillyCase = 0; testSillyCase < 2; ++testSillyCase) {
vt = client.callProcedure("OrderByOneIndex", testSillyCase).getResults()[0];
|
24,018 | while (vt.advanceRow()) {
int b = (Integer) vt.get(1, VoltType.INTEGER);
int c = (Integer) vt.get(2, VoltType.INTEGER);
int d = (Integer) vt.get(3, VoltType.INTEGER);
assertTrue(b == c && c == d && b <= it);
<BUG>it = b;
}</BUG>
}
public void testAggOrderByGroupBy() throws Exception
{
| [DELETED] |
24,019 | if (alertId == null || alertId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("Alert Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
PrincipalUser owner = validateAndGetOwner(req, null);
Alert alert = alertService.findAlertByPrimaryKey(alertId);
<BUG>if (alert != ... | if (alert != null && !alert.isShared()) {
if(alert != null){
return AlertDto.transformToDto(alert);
|
24,020 | if (alertId == null || alertId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("Alert Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
PrincipalUser owner = validateAndGetOwner(req, null);
Alert alert = alertService.findAlertByPrimaryKey(alertId);
<BUG>if (alert != ... | if (alert != null && !alert.isShared()) {
if(alert != null){
return AlertDto.transformToDto(alert);
|
24,021 | if (notificationId == null || notificationId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("Notification Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
PrincipalUser owner = validateAndGetOwner(req, null);
Alert alert = alertService.findAlertByPrimaryKey(alertId... | if (alert != null && !alert.isShared()) {
for (Notification notification : alert.getNotifications()) {
|
24,022 | if (triggerId == null || triggerId.compareTo(BigInteger.ZERO) < 1) {
throw new WebApplicationException("Trigger Id cannot be null and must be a positive non-zero number.", Status.BAD_REQUEST);
}
PrincipalUser owner = validateAndGetOwner(req, null);
Alert alert = alertService.findAlertByPrimaryKey(alertId);
<BUG>if (ale... | if (alert != null && !alert.isShared()) {
for (Trigger trigger : alert.getTriggers()) {
|
24,023 | 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;
|
24,024 | 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());
|
24,025 | 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);
|
24,026 | 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);
|
24,027 | 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);
|
24,028 | 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;
|
24,029 | 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);
|
24,030 | 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);
|
24,031 | 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;
|
24,032 | }
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);
|
24,033 | 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);
|
24,034 | @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);
|
24,035 | 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);
|
24,036 | import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import androi... | import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
24,037 | import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
imp... | import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
24,038 | import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.preference.PreferenceManager;
<BUG>import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.Toolbar;</BUG>
import android.util.Log;
import andro... | import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.Toolbar;
|
24,039 | mAltitude.setOnCheckedChangeListener(mCheckedChangeListener);
mDistance.setOnCheckedChangeListener(mCheckedChangeListener);
mCompass.setOnCheckedChangeListener(mCheckedChangeListener);
mLocation.setOnCheckedChangeListener(mCheckedChangeListener);
builder.setTitle(R.string.dialog_layer_title).setIcon(android.R.drawable.... | (android.R.string.ok, null).setView(view);
|
24,040 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args... | return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
24,041 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, s... | return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
24,042 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task... | Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
24,043 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField +... | Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
24,044 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.e... | Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
24,045 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
24,046 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
24,047 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
24,048 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() ... | TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
24,049 | 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 {
|
24,050 | 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));
|
24,051 | } 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()
|
24,052 |
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... |
24,053 | 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... |
24,054 | 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 {
|
24,055 | 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);
|
24,056 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args... | return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
24,057 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, s... | return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
24,058 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task... | Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
24,059 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField +... | Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
24,060 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.e... | Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
24,061 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
24,062 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
24,063 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
24,064 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() ... | TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
24,065 | package com.milaboratory.mixcr.assembler;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
<BUG>import com.fasterxml.jackson.annotation.JsonProperty;
import io.repseq.core.GeneFeature;
import com.milaboratory... | import com.milaboratory.core.sequence.quality.QualityAggregationType;
import com.milaboratory.mixcr.vdjaligners.VDJCAlignerParameters;
|
24,066 | import com.milaboratory.core.sequence.SequenceQuality;
import com.milaboratory.core.tree.MutationGuide;
import com.milaboratory.core.tree.NeighborhoodIterator;
import com.milaboratory.core.tree.SequenceTreeMap;
import com.milaboratory.mixcr.basictypes.*;
<BUG>import io.repseq.core.*;
import com.milaboratory.util.CanRep... | import com.milaboratory.mixcr.vdjaligners.VDJCAlignerParameters;
import com.milaboratory.util.CanReportProgress;
|
24,067 | import com.milaboratory.util.HashFunctions;
import com.milaboratory.util.RandomUtil;
import gnu.trove.iterator.TObjectFloatIterator;
import gnu.trove.map.hash.TIntIntHashMap;
import gnu.trove.map.hash.TObjectFloatHashMap;
<BUG>import gnu.trove.procedure.TObjectProcedure;
import java.util.*;</BUG>
import java.util.concu... | import io.repseq.core.GeneFeature;
import io.repseq.core.*;
import java.util.*;
|
24,068 | private final HashMap<VDJCGeneId, VDJCGene> usedGenes = new HashMap<>();
volatile CanReportProgress progressReporter;
private CloneAssemblerListener listener;
volatile boolean deferredExists = false;
volatile boolean preClusteringDone = false;
<BUG>final TIntIntHashMap preClustered = new TIntIntHashMap();
public static... | final EnumMap<GeneType, GeneFeature> featuresToAlign;
public static final Factory<ArrayList<CloneAccumulatorContainer>> LIST_FACTORY = new Factory<ArrayList<CloneAccumulatorContainer>>() {
|
24,069 | @Override
public ArrayList<CloneAccumulatorContainer> create() {
return new ArrayList<>(1);
}
};
<BUG>public CloneAssembler(CloneAssemblerParameters parameters, boolean logAssemblerEvents, Collection<VDJCGene> genes) {
this.parameters = parameters.clone();
if (!logAssemblerEvents && !parameters.isMappingEnabled())</BU... | public CloneAssembler(CloneAssemblerParameters parameters, boolean logAssemblerEvents, Collection<VDJCGene> genes, EnumMap<GeneType, GeneFeature> featuresToAlign) {
if (!parameters.isComplete())
throw new IllegalArgumentException("Not complete parameters");
this.featuresToAlign = featuresToAlign;
if (!logAssemblerEvent... |
24,070 | deferredAlignmentsLogger.close();
}
public CloneSet getCloneSet() {
EnumMap<GeneType, GeneFeature> features = new EnumMap<>(GeneType.class);
for (GeneType geneType : GeneType.values()) {
<BUG>GeneFeature gf = parameters.cloneFactoryParameters.getFeatureToAlign(geneType);
if (gf != null)</BUG>
features.put(geneType, gf)... | GeneFeature gf = featuresToAlign.get(geneType);
if (gf != null)
|
24,071 | return progress == sourceSize;
}
void buildClones() {
CloneFactory cloneFactory =
new CloneFactory(parameters.getCloneFactoryParameters(),
<BUG>parameters.getAssemblingFeatures(), usedGenes);
</BUG>
Collection<CloneAccumulator> source;
if (clusteredClonesAccumulators != null)
source = clusteredClonesAccumulators;
| parameters.getAssemblingFeatures(), usedGenes, featuresToAlign);
|
24,072 | EnumMap<GeneType, VDJCHit[]> hits = new EnumMap<>(GeneType.class);
for (GeneType geneType : GeneType.VJC_REFERENCE) {
VJCClonalAlignerParameters vjcParameters = parameters.getVJCParameters(geneType);
if (vjcParameters == null)
continue;
<BUG>GeneFeature featureToAlign = vjcParameters.getFeatureToAlign();
TObjectFloatHa... | GeneFeature featureToAlign = featuresToAlign.get(geneType);
TObjectFloatHashMap<VDJCGeneId> geneScores = accumulator.geneScores.get(geneType);
|
24,073 | SModelReference reference = LanguageAspect.STRUCTURE.get(node.getConceptLanguage());
reference = reference.update();
return node.getModel().getUsedVersion(reference);
}
public static int getReferenceToNodeVersion(SNode node, SModelReference targetModelReference) {
<BUG>if (targetModelReference == null) { //target model... | [DELETED] |
24,074 | context.setAuthCache(authCache);
ApacheHttpClient4Engine engine = new ApacheHttpClient4Engine(httpclient, context);
ResteasyClient client = new ResteasyClientBuilder().httpEngine(engine).build();
client.register(JacksonJaxbJsonProvider.class);
client.register(JacksonObjectMapperProvider.class);
<BUG>client.register(Req... | client.register(RestRequestFilter.class);
client.register(RestResponseFilter.class);
|
24,075 | import org.hawkular.alerts.api.model.condition.Condition;
import org.hawkular.inventory.api.model.CanonicalPath;
import org.hawkular.inventory.api.model.Tenant;
import org.hawkular.inventory.json.DetypedPathDeserializer;
import org.hawkular.inventory.json.InventoryJacksonConfig;
<BUG>import org.hawkular.inventory.json.... | import org.hawkular.inventory.json.mixins.model.CanonicalPathMixin;
|
24,076 | }
@RootTask
static Task<Exec.Result> exec(String parameter, int number) {
Task<String> task1 = MyTask.create(parameter);
Task<Integer> task2 = Adder.create(number, number + 2);
<BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh")
.in(() -> task1)</BUG>
.in(() -> task2)
.process(Exec.exec((str, i) -> args... | return Task.named("exec", "/bin/sh").ofType(Exec.Result.class)
.in(() -> task1)
|
24,077 | return args;
}
static class MyTask {
static final int PLUS = 10;
static Task<String> create(String parameter) {
<BUG>return Task.ofType(String.class).named("MyTask", parameter)
.in(() -> Adder.create(parameter.length(), PLUS))</BUG>
.in(() -> Fib.create(parameter.length()))
.process((sum, fib) -> something(parameter, s... | return Task.named("MyTask", parameter).ofType(String.class)
.in(() -> Adder.create(parameter.length(), PLUS))
|
24,078 | final String instanceField = "from instance";
final TaskContext context = TaskContext.inmem();
final AwaitingConsumer<String> val = new AwaitingConsumer<>();
@Test
public void shouldJavaUtilSerialize() throws Exception {
<BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39)
.process(() -> 9999L);
Task... | Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class)
Task<String> task2 = Task.named("Baz", 40).ofType(String.class)
.in(() -> task1)
|
24,079 | assertEquals(des.id().name(), "Baz");
assertEquals(val.awaitAndGet(), "[9999] hello 10004");
}
@Test(expected = NotSerializableException.class)
public void shouldNotSerializeWithInstanceFieldReference() throws Exception {
<BUG>Task<String> task = Task.ofType(String.class).named("WithRef")
.process(() -> instanceField +... | Task<String> task = Task.named("WithRef").ofType(String.class)
.process(() -> instanceField + " causes an outer reference");
|
24,080 | serialize(task);
}
@Test
public void shouldSerializeWithLocalReference() throws Exception {
String local = instanceField;
<BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef")
.process(() -> local + " won't cause an outer reference");</BUG>
serialize(task);
Task<String> des = deserialize();
context.e... | Task<String> task = Task.named("WithLocalRef").ofType(String.class)
.process(() -> local + " won't cause an outer reference");
|
24,081 | }
@RootTask
public static Task<String> standardArgs(int first, String second) {
firstInt = first;
secondString = second;
<BUG>return Task.ofType(String.class).named("StandardArgs", first, second)
.process(() -> second + " " + first * 100);</BUG>
}
@Test
public void shouldParseFlags() throws Exception {
| return Task.named("StandardArgs", first, second).ofType(String.class)
.process(() -> second + " " + first * 100);
|
24,082 | assertThat(parsedEnum, is(CustomEnum.BAR));
}
@RootTask
public static Task<String> enums(CustomEnum enm) {
parsedEnum = enm;
<BUG>return Task.ofType(String.class).named("Enums", enm)
.process(enm::toString);</BUG>
}
@Test
public void shouldParseCustomTypes() throws Exception {
| return Task.named("Enums", enm).ofType(String.class)
.process(enm::toString);
|
24,083 | assertThat(parsedType.content, is("blarg parsed for you!"));
}
@RootTask
public static Task<String> customType(CustomType myType) {
parsedType = myType;
<BUG>return Task.ofType(String.class).named("Types", myType.content)
.process(() -> myType.content);</BUG>
}
public enum CustomEnum {
BAR
| return Task.named("Types", myType.content).ofType(String.class)
.process(() -> myType.content);
|
24,084 | TaskContext taskContext = TaskContext.inmem();
TaskContext.Value<Long> value = taskContext.evaluate(fib92);
value.consume(f92 -> System.out.println("fib(92) = " + f92));
}
static Task<Long> create(long n) {
<BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n);
</BUG>
if (n < 2) {
return fib
.process(() ... | TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
|
24,085 | import java.net.URLClassLoader;
import java.util.List;
import java.util.regex.Pattern;
import org.apache.tools.ant.AntClassLoader;
import org.eclipse.jetty.util.PatternMatcher;
<BUG>import org.eclipse.jetty.util.resource.Resource;
import org.eclipse.jetty.webapp.WebAppContext;
import org.eclipse.jetty.webapp.WebInfConf... | import org.eclipse.jetty.webapp.WebAppClassLoader;
import org.eclipse.jetty.webapp.WebXmlConfiguration;
public class AntWebInfConfiguration extends WebInfConfiguration
|
24,086 | import org.openstreetmap.josm.plugins.mapillary.MapillaryImage;
import org.openstreetmap.josm.plugins.mapillary.MapillaryLayer;
import org.openstreetmap.josm.plugins.mapillary.gui.MapillaryMainDialog;
import org.openstreetmap.josm.plugins.mapillary.history.MapillaryRecord;
import org.openstreetmap.josm.plugins.mapillar... | import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryProperties;
public class SelectMode extends AbstractMode {
|
24,087 | create(country, company, fullname, lastname, description);
throw new DummyException("This method failed");
}
public void create(String country, String company, String fullname, String lastname, String description) {
DistinguishedName dn = new DistinguishedName();
<BUG>dn.add("c", country);
</BUG>
dn.add("ou", company);... | dn.add("ou", country);
|
24,088 | jdbcTemplate.update("insert into PERSON values(?, ?, ?)", new Object[] { fullname, lastname, description });
}
public void update(String dn, String fullname, String lastname, String description) {
DirContextAdapter ctx = (DirContextAdapter) ldapTemplate.lookup(dn);
ctx.setAttributeValue("sn", lastname);
<BUG>ctx.setAtt... | ldapTemplate.modifyAttributes(ctx);
|
24,089 | update(dn, fullname, lastname, description);
throw new DummyException("This method failed.");
}
public void updateAndRename(String dn, String newDn, String description) {
DirContextAdapter ctx = (DirContextAdapter) ldapTemplate.lookup(dn);
<BUG>ctx.setAttributeValue("description", description);
ctx.update();
ldapTempla... | ldapTemplate.modifyAttributes(ctx);
|
24,090 | @Attribute(name = "telephoneNumber")
private String telephoneNumber;
@DnAttribute(value="ou", index=1)
@Transient
private String company;
<BUG>@DnAttribute(value="c", index=0)
</BUG>
@Transient
private String country;
public Name getDn() {
| @DnAttribute(value="ou", index=0)
|
24,091 | package org.springframework.ldap.itest;
import org.junit.After;
import org.junit.Before;
<BUG>import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;</BUG>
import org.springframework.ldap.core.DirContextAdapter;
import org.springframework.ldap.core.DirContextOperations;
import org.springfr... | import org.junit.experimental.categories.Category;
import org.springframework.beans.factory.annotation.Autowired;
|
24,092 | import static junit.framework.Assert.assertEquals;
@ContextConfiguration(locations = {"/conf/ldapTemplateTestContext.xml"})
public class InvalidBackslashITest extends AbstractLdapTemplateIntegrationTest {
@Autowired
private LdapTemplate tested;
<BUG>private static LdapName DN = LdapUtils.newLdapName("cn=Some\\\\Person6... | private static LdapName DN = LdapUtils.newLdapName("cn=Some\\\\Person6,ou=company1,ou=Sweden");
|
24,093 | }
@After
public void cleanup() throws Exception {
tested.unbind(DN);
}
<BUG>@Test
public void testSearchForDnSpoiledByCompositeName() throws InvalidNameException {</BUG>
List result = tested.search("", "(sn=Person6)", new AbstractContextMapper() {
@Override
protected Object doMapFromContext(DirContextOperations ctx) {
| @Category(NoAdTest.class)
public void testSearchForDnSpoiledByCompositeName() throws InvalidNameException {
|
24,094 | List result = tested.search("", "(sn=Person6)", new AbstractContextMapper() {
@Override
protected Object doMapFromContext(DirContextOperations ctx) {
LdapName dn = (LdapName) ctx.getDn();
Rdn rdn = LdapUtils.getRdn(dn, "cn");
<BUG>assertEquals("cn=Some\\\\Person6,ou=company1,c=Sweden", dn.toString());
</BUG>
assertEqua... | assertEquals("cn=Some\\\\Person6,ou=company1,ou=Sweden", dn.toString());
|
24,095 | @Transactional
public class DummyDaoLdapAndHibernateImpl extends HibernateDaoSupport implements OrgPersonDao {
private LdapTemplate ldapTemplate;
public void create(OrgPerson person) {
DistinguishedName dn = new DistinguishedName();
<BUG>dn.add("c", person.getCountry());
</BUG>
dn.add("ou", person.getCompany());
dn.add... | dn.add("ou", person.getCountry());
|
24,096 | this.update(person);
throw new DummyException("This method failed");
}
public void updateAndRename(String dn, String newDn, String updatedDescription) {
DirContextAdapter ctx = (DirContextAdapter) ldapTemplate.lookup(dn);
<BUG>ctx.setAttributeValue("description", updatedDescription);
ctx.update();
ldapTemplate.rebind(d... | ldapTemplate.modifyAttributes(ctx);
|
24,097 | throw new DummyException("This method failed");
}
public void create(String country, String company, String fullname,
String lastname, String description) {
DistinguishedName dn = new DistinguishedName();
<BUG>dn.add("c", country);
</BUG>
dn.add("ou", company);
dn.add("cn", fullname);
DirContextAdapter ctx = new DirCon... | dn.add("ou", country);
|
24,098 | update(dn, fullname, lastname, description);
throw new DummyException("This method failed.");
}
public void updateAndRename(String dn, String newDn, String description) {
DirContextAdapter ctx = (DirContextAdapter) ldapTemplate.lookup(dn);
<BUG>ctx.setAttributeValue("description", description);
ctx.update();
ldapTempla... | ldapTemplate.modifyAttributes(ctx);
|
24,099 | package org.springframework.ldap.itest;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ldap.core.AttributesMapper;
import org.springframework.ldap.core.LdapTemplate;
<BUG>import org.springframework.ldap.itest.Person;
import org.springframework.ldap.itest... | [DELETED] |
24,100 | return new String[] {"/conf/ldapTemplateTestContext.xml"};
}
@Test
public void testSearch_AttributeMapper() throws Exception {
AttributesMapper mapper = new PersonAttributesMapper();
<BUG>List result = tested.search("ou=company1,c=Sweden", "(&(objectclass=person)(sn=Person2))", mapper);
</BUG>
assertEquals(1, result.si... | List result = tested.search("ou=company1,ou=Sweden", "(&(objectclass=person)(sn=Person2))", mapper);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.