id
int64 1
49k
| buggy
stringlengths 34
37.5k
| fixed
stringlengths 2
37k
|
|---|---|---|
48,201
|
public synchronized void loadRegionLinks() {
logger.info("Loading region links");
try (DB mainDB = DBMaker.fileDB(directory.resolve("regions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getRegion(entry.getKey());
if (region != null) {
logger.info("Loading links for region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
|
Optional<IRegion> regionOpt = FGManager.getInstance().getRegion(entry.getKey());
if (regionOpt.isPresent()) {
IRegion region = regionOpt.get();
logger.info("Loading links for region \"" + region.getName() + "\"");
|
48,202
|
public synchronized void loadWorldRegionLinks(World world) {
logger.info("Loading world region links for world \"" + world.getName() + "\"");
try (DB mainDB = DBMaker.fileDB(worldDirectories.get(world.getName()).resolve("wregions.foxdb").normalize().toString()).make()) {
Map<String, String> linksMap = mainDB.hashMap("links", Serializer.STRING, Serializer.STRING).createOrOpen();
linksMap.entrySet().forEach(entry -> {
<BUG>IRegion region = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (region != null) {
logger.info("Loading links for world region \"" + region.getName() + "\"");</BUG>
String handlersString = entry.getValue();
|
Optional<IWorldRegion> regionOpt = FGManager.getInstance().getWorldRegion(world, entry.getKey());
if (regionOpt.isPresent()) {
IWorldRegion region = regionOpt.get();
logger.info("Loading links for world region \"" + region.getName() + "\"");
|
48,203
|
StringBuilder builder = new StringBuilder();
for (Iterator<IHandler> it = handlers.iterator(); it.hasNext(); ) {
builder.append(it.next().getName());
if (it.hasNext()) builder.append(",");
}
<BUG>return builder.toString();
}</BUG>
private final class LoadEntry {
public final String name;
public final Type type;
|
public enum Type {
REGION, WREGION, HANDLER
|
48,204
|
.autoCloseQuotes(true)
.leaveFinalAsIs(true)
.parse();
if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) {
if (parse.current.index == 0)
<BUG>return ImmutableList.of("region", "worldregion", "handler", "controller").stream()
</BUG>
.filter(new StartsWithPredicate(parse.current.token))
.collect(GuavaCollectors.toImmutableList());
else if (parse.current.index == 1) {
|
return Stream.of("region", "worldregion", "handler", "controller")
|
48,205
|
package org.fcrepo.camel.indexing.solr;
<BUG>import static org.apache.commons.lang3.StringUtils.isBlank;
import com.fasterxml.jackson.databind.ObjectMapper;</BUG>
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
|
import static org.fcrepo.camel.FcrepoHeaders.FCREPO_BASE_URL;
import static org.fcrepo.camel.FcrepoHeaders.FCREPO_IDENTIFIER;
import static org.apache.camel.Exchange.CONTENT_TYPE;
import static org.apache.camel.Exchange.HTTP_METHOD;
import com.fasterxml.jackson.databind.ObjectMapper;
|
48,206
|
import com.fasterxml.jackson.databind.ObjectMapper;</BUG>
import com.fasterxml.jackson.databind.node.ObjectNode;
import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
<BUG>import org.fcrepo.camel.FcrepoHeaders;
import org.fcrepo.camel.JmsHeaders;</BUG>
public class SolrDeleteProcessor implements Processor {
public void process(final Exchange exchange) throws Exception {
final Message in = exchange.getIn();
|
package org.fcrepo.camel.indexing.solr;
import static org.fcrepo.camel.FcrepoHeaders.FCREPO_BASE_URL;
import static org.fcrepo.camel.FcrepoHeaders.FCREPO_IDENTIFIER;
import static org.apache.camel.Exchange.CONTENT_TYPE;
import static org.apache.camel.Exchange.HTTP_METHOD;
import com.fasterxml.jackson.databind.ObjectMapper;
|
48,207
|
String serialize() {
StringBuilder builder = new StringBuilder();
final Class<?> dtoInterface = getDtoInterface();
final String dtoInterfaceName = dtoInterface.getCanonicalName();
emitPreamble(dtoInterface, builder);
<BUG>List<Method> getters = getDtoGetters(dtoInterface);
emitFields(getters, builder);
</BUG>
emitGettersAndSetters(getters, builder);
List<Method> inheritedGetters = getInheritedDtoGetters(dtoInterface);
|
Set<String> superGetterNames = getSuperGetterNames(dtoInterface);
emitFields(getters, builder, superGetterNames);
|
48,208
|
if (isList(returnTypeClass) || isMap(returnTypeClass)) {
builder.append(" ");
builder.append(getEnsureName(fieldName));
builder.append("();\n");
}
<BUG>builder.append(" return ");
emitReturn(getter, fieldName, builder);
builder.append(";\n }\n\n");
</BUG>
}
|
builder.append(" return (").append(returnType).append(")(");
builder.append(");\n }\n\n");
|
48,209
|
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
<BUG>import java.util.Map;
abstract class DtoImpl {</BUG>
protected static final String COPY_JSONS_PARAM = "copyJsons";
private final Class<?> dtoInterface;
private final DtoTemplate enclosingTemplate;
|
import java.util.Set;
abstract class DtoImpl {
|
48,210
|
package org.eclipse.che.dto.server;
import org.eclipse.che.dto.shared.JsonStringMap;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
<BUG>import com.google.gson.JsonElement;
import java.util.Collection;</BUG>
import java.util.Map;
import java.util.Set;
public class JsonStringMapImpl<T> implements JsonStringMap<T> {
|
import java.io.Writer;
import java.util.Collection;
|
48,211
|
package org.eclipse.che.dto.server;
import org.eclipse.che.dto.shared.JsonArray;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
<BUG>import com.google.gson.JsonElement;
import java.util.Collection;</BUG>
import java.util.Iterator;
import java.util.List;
import java.util.ListIterator;
|
import java.io.Writer;
import java.util.Collection;
|
48,212
|
import java.io.OutputStreamWriter;
import java.io.Writer;
import java.lang.annotation.Annotation;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
<BUG>import java.nio.charset.Charset;
import java.util.LinkedHashSet;</BUG>
import java.util.List;
import java.util.Set;
@Singleton
|
import java.nio.charset.StandardCharsets;
import java.util.LinkedHashSet;
|
48,213
|
import org.eclipse.xtext.common.types.JvmParameterizedTypeReference;
import org.eclipse.xtext.common.types.JvmTypeParameter;
import org.eclipse.xtext.common.types.JvmTypeReference;
import org.eclipse.xtext.common.types.JvmVisibility;
import org.eclipse.xtext.common.types.TypesFactory;
<BUG>import org.eclipse.xtext.common.types.TypesPackage;
import org.eclipse.xtext.util.Pair;</BUG>
import org.eclipse.xtext.xbase.featurecalls.IdentifiableSimpleNameProvider;
import org.eclipse.xtext.xbase.jvmmodel.IJvmModelAssociations;
import org.eclipse.xtext.xbase.jvmmodel.IJvmModelAssociator;
|
import org.eclipse.xtext.util.IAcceptor;
import org.eclipse.xtext.util.Pair;
|
48,214
|
import org.eclipse.xtext.xbase.featurecalls.IdentifiableSimpleNameProvider;
import org.eclipse.xtext.xbase.jvmmodel.IJvmModelAssociations;
import org.eclipse.xtext.xbase.jvmmodel.IJvmModelAssociator;
import org.eclipse.xtext.xbase.jvmmodel.IJvmModelInferrer;
import org.eclipse.xtext.xtend2.dispatch.DispatchingSupport;
<BUG>import org.eclipse.xtext.xtend2.resource.Xtend2Resource;
import org.eclipse.xtext.xtend2.xtend2.XtendField;
import org.eclipse.xtext.xtend2.xtend2.XtendClass;</BUG>
import org.eclipse.xtext.xtend2.xtend2.XtendFile;
import org.eclipse.xtext.xtend2.xtend2.XtendFunction;
|
import org.eclipse.xtext.xtend2.xtend2.XtendClass;
|
48,215
|
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.Status;
import org.mariotaku.sqliteqb.library.AllColumns;</BUG>
import org.mariotaku.sqliteqb.library.Columns;
import org.mariotaku.sqliteqb.library.Columns.Column;
import org.mariotaku.sqliteqb.library.Expression;
|
import org.mariotaku.pickncrop.library.PNCUtils;
import org.mariotaku.sqliteqb.library.AllColumns;
|
48,216
|
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());
|
48,217
|
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.format("Unable to delete %s", file));
}</BUG>
}
|
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
48,218
|
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, String.format("Unable to delete %s", file));
}</BUG>
}
|
twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
48,219
|
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.format("Unable to delete %s", file));
}</BUG>
}
|
twitter.updateProfileBannerImage(fileBody);
if (deleteImage) {
Utils.deleteMedia(context, imageUri);
|
48,220
|
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.util.DataStoreUtils;
import org.mariotaku.twidere.util.ImagePreloader;</BUG>
import org.mariotaku.twidere.util.InternalTwitterContentUtils;
import org.mariotaku.twidere.util.JsonSerializer;
import org.mariotaku.twidere.util.NotificationManagerWrapper;
|
import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.ImagePreloader;
|
48,221
|
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);
|
48,222
|
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);
|
48,223
|
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.util.JsonSerializer;</BUG>
import org.mariotaku.twidere.util.Utils;
|
import org.mariotaku.twidere.util.DebugLog;
import org.mariotaku.twidere.util.JsonSerializer;
|
48,224
|
}
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) {
Log.d(HotMobiLogger.LOGTAG, "getting cached location");
}</BUG>
final Location location = Utils.getCachedLocation(appContext);
|
DebugLog.d(HotMobiLogger.LOGTAG, "getting cached location", null);
|
48,225
|
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 DestroyStatusTask task = new DestroyStatusTask(context,accountKey, statusId);
</BUG>
return asyncTaskManager.add(task, true);
}
public int destroyUserListAsync(final UserKey accountKey, final String listId) {
|
final DestroyStatusTask task = new DestroyStatusTask(context, accountKey, statusId);
|
48,226
|
@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.getException());
}</BUG>
}
|
public UserKey[] getAccountKeys() {
return DataStoreUtils.getActivatedAccountKeys(context);
|
48,227
|
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);
|
48,228
|
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
<BUG>import java.net.URL;
</BUG>
import java.util.concurrent.TimeUnit;
import static org.elasticsearch.test.ElasticsearchIntegrationTest.*;
import static org.hamcrest.CoreMatchers.is;
|
import java.net.URI;
|
48,229
|
deletePluginsFolder();
}
@Test
public void testLocalPluginInstallSingleFolder() throws Exception {
String pluginName = "plugin-test";
<BUG>URL url = PluginManagerTests.class.getResource("plugin_single_folder.zip");
downloadAndExtract(pluginName, "file://" + url.getFile());
</BUG>
cluster().startNode(SETTINGS);
|
@Before
public void beforeTest() {
URI uri = URI.create(PluginManagerTests.class.getResource("plugin_single_folder.zip").toString());
downloadAndExtract(pluginName, "file://" + uri.getPath());
|
48,230
|
assertPluginAvailable(pluginName);
}
@Test
public void testLocalPluginInstallSiteFolder() throws Exception {
String pluginName = "plugin-test";
<BUG>URL url = PluginManagerTests.class.getResource("plugin_folder_site.zip");
downloadAndExtract(pluginName, "file://" + url.getFile());
</BUG>
String nodeName = cluster().startNode(SETTINGS);
|
URI uri = URI.create(PluginManagerTests.class.getResource("plugin_folder_site.zip").toString());
downloadAndExtract(pluginName, "file://" + uri.getPath());
|
48,231
|
assertPluginAvailable(pluginName);
}
@Test
public void testLocalPluginWithoutFolders() throws Exception {
String pluginName = "plugin-test";
<BUG>URL url = PluginManagerTests.class.getResource("plugin_without_folders.zip");
downloadAndExtract(pluginName, "file://" + url.getFile());
</BUG>
cluster().startNode(SETTINGS);
|
public void testLocalPluginInstallSiteFolder() throws Exception {
URI uri = URI.create(PluginManagerTests.class.getResource("plugin_folder_site.zip").toString());
downloadAndExtract(pluginName, "file://" + uri.getPath());
String nodeName = cluster().startNode(SETTINGS);
|
48,232
|
assertPluginAvailable(pluginName);
}
@Test
public void testLocalPluginFolderAndFile() throws Exception {
String pluginName = "plugin-test";
<BUG>URL url = PluginManagerTests.class.getResource("plugin_folder_file.zip");
downloadAndExtract(pluginName, "file://" + url.getFile());
</BUG>
cluster().startNode(SETTINGS);
|
public void testLocalPluginInstallSiteFolder() throws Exception {
URI uri = URI.create(PluginManagerTests.class.getResource("plugin_folder_site.zip").toString());
downloadAndExtract(pluginName, "file://" + uri.getPath());
String nodeName = cluster().startNode(SETTINGS);
|
48,233
|
public void testInstallPluginNull() throws IOException {
pluginManager(null).downloadAndExtract("");
}
@Test
public void testInstallPlugin() throws IOException {
<BUG>PluginManager pluginManager = pluginManager("file://".concat(PluginManagerTests.class.getResource("plugin_with_classfile.zip").getFile()));
pluginManager.downloadAndExtract("plugin");</BUG>
File[] plugins = pluginManager.getListInstalledPlugins();
assertThat(plugins, notNullValue());
assertThat(plugins.length, is(1));
|
PluginManager pluginManager = pluginManager("file://".concat(
URI.create(PluginManagerTests.class.getResource("plugin_with_classfile.zip").toString()).getPath()));
pluginManager.downloadAndExtract("plugin");
|
48,234
|
private void deletePluginsFolder() {
FileSystemUtils.deleteRecursively(new File(PLUGIN_DIR));
}
@Test
public void testRemovePlugin() throws Exception {
<BUG>singlePluginInstallAndRemove("plugintest", "file://".concat(PluginManagerTests.class.getResource("plugin_without_folders.zip").getFile()));
singlePluginInstallAndRemove("groupid/plugintest/1.0.0", "file://".concat(PluginManagerTests.class.getResource("plugin_without_folders.zip").getFile()));
singlePluginInstallAndRemove("groupid/plugintest", "file://".concat(PluginManagerTests.class.getResource("plugin_without_folders.zip").getFile()));
}</BUG>
@Test(expected = ElasticsearchIllegalArgumentException.class)
|
singlePluginInstallAndRemove("plugintest", "file://".concat(
URI.create(PluginManagerTests.class.getResource("plugin_without_folders.zip").toString()).getPath()));
singlePluginInstallAndRemove("groupid/plugintest/1.0.0", "file://".concat(
URI.create(PluginManagerTests.class.getResource("plugin_without_folders.zip").toString()).getPath()));
singlePluginInstallAndRemove("groupid/plugintest", "file://".concat(
URI.create(PluginManagerTests.class.getResource("plugin_without_folders.zip").toString()).getPath()));
|
48,235
|
<BUG>package dr.evolution.tree;
import jebl.evolution.trees.RootedTree;
public class SPPathDifferenceMetric {</BUG>
public SPPathDifferenceMetric() {
}
|
import dr.evolution.io.Importer;
import dr.evolution.io.NewickImporter;
import java.io.IOException;
import java.util.ArrayList;
public class SPPathDifferenceMetric {
|
48,236
|
import jebl.evolution.trees.RootedTree;
public class SPPathDifferenceMetric {</BUG>
public SPPathDifferenceMetric() {
}
public double getMetric(Tree tree1, Tree tree2) {
<BUG>int dim = tree1.getExternalNodeCount()*(tree1.getExternalNodeCount()-1);
</BUG>
double[] pathOne = new double[dim];
double[] pathTwo = new double[dim];
if (tree1.getExternalNodeCount() != tree2.getExternalNodeCount()) {
|
import java.io.IOException;
import java.util.ArrayList;
public class SPPathDifferenceMetric {
int dim = (tree1.getExternalNodeCount()-2)*(tree1.getExternalNodeCount()-1);
|
48,237
|
double[] pathTwo = new double[dim];
if (tree1.getExternalNodeCount() != tree2.getExternalNodeCount()) {
throw new RuntimeException("Different number of taxa in both trees.");
} else {
for (int i = 0; i < tree1.getExternalNodeCount(); i++) {
<BUG>if (tree1.getNodeTaxon(tree1.getExternalNode(i)) != tree2.getNodeTaxon(tree2.getExternalNode(i))) {
throw new RuntimeException("Mismatch between taxa in both trees: " + tree1.getNodeTaxon(tree1.getExternalNode(i)) + " vs. " + tree2.getNodeTaxon(tree2.getExternalNode(i)));
</BUG>
}
|
if (!tree1.getNodeTaxon(tree1.getExternalNode(i)).getId().equals(tree2.getNodeTaxon(tree2.getExternalNode(i)).getId())) {
throw new RuntimeException("Mismatch between taxa in both trees: " + tree1.getNodeTaxon(tree1.getExternalNode(i)).getId() + " vs. " + tree2.getNodeTaxon(tree2.getExternalNode(i)).getId());
|
48,238
|
index++;
}
}
index = 0;
for (int i = 0; i < tree2.getExternalNodeCount(); i++) {
<BUG>for (int j = i; j < tree2.getExternalNodeCount(); j++) {
</BUG>
NodeRef nodeOne = tree2.getExternalNode(i);
NodeRef nodeTwo = tree2.getExternalNode(j);
NodeRef MRCA = Tree.Utils.getCommonAncestor(tree2, nodeOne, nodeTwo);
|
for (int j = i+1; j < tree2.getExternalNodeCount(); j++) {
|
48,239
|
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 FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
|
import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
48,240
|
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(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
|
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));
|
48,241
|
} 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()
|
48,242
|
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_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
|
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.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
48,243
|
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_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
|
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_AGE));
|
48,244
|
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 backupFile;
private boolean closed;
|
import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
48,245
|
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) != null) {
|
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
48,246
|
return updatedAt;
}
public List<String> getUsers() {
return users;
}
<BUG>public void addUser(String s) {
users.add(s);
}
public void addGroup(String s) {
groups.add(s);
}</BUG>
public List<String> getGroups() {
|
public Dto addUser(String s) {
return this;
public Dto addGroup(String s) {
return this;
|
48,247
|
import org.broadinstitute.sting.oneoffprojects.walkers.association.statistics.casecontrol.ZStatistic;
import org.broadinstitute.sting.utils.collections.Pair;
import org.broadinstitute.sting.utils.pileup.PileupElement;
import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
public class MateOtherContig extends ZStatistic {
<BUG>public int getWindowSize() { return 200; }
public int slideByValue() { return 25; }
</BUG>
public boolean usePreviouslySeenReads() { return false; }
|
public int getWindowSize() { return 100; }
public int slideByValue() { return 10; }
|
48,248
|
import org.broadinstitute.sting.utils.MannWhitneyU;
import org.broadinstitute.sting.utils.MathUtils;
import org.broadinstitute.sting.utils.QualityUtils;
import org.broadinstitute.sting.utils.WilcoxonRankSum;
import org.broadinstitute.sting.utils.collections.Pair;
<BUG>public class AssociationTestRunner {
static Normal standardNormal = new Normal(0.0,1.0,null);
public static String runTests(AssociationContext context) {</BUG>
List<String> results = new ArrayList<String>();
if ( context instanceof TStatistic) {
|
final static int MAX_Q_VALUE = 2000;
private static int pToQ(double p) {
return Math.min((int) Math.floor(QualityUtils.phredScaleErrorRate(p)),MAX_Q_VALUE);
}
public static String runTests(AssociationContext context) {
|
48,249
|
import org.broadinstitute.sting.oneoffprojects.walkers.association.statistics.casecontrol.UStatistic;
import org.broadinstitute.sting.utils.pileup.PileupElement;
import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
import java.util.ArrayList;
import java.util.Collection;
<BUG>public class ReadIndels extends TStatistic {
</BUG>
public Collection<Number> map(ReadBackedPileup rbp) {
ArrayList<Integer> indelElements = new ArrayList<Integer>(rbp.size());
for (PileupElement e : rbp ) {
|
public class ReadIndels extends UStatistic {
|
48,250
|
import org.broadinstitute.sting.utils.pileup.ReadBackedPileup;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
public class InsertSizeDistribution extends TStatistic {
<BUG>public int getWindowSize() { return 200; }
public int slideByValue() { return 25; }
</BUG>
public boolean usePreviouslySeenReads() { return false; }
|
public int getWindowSize() { return 100; }
public int slideByValue() { return 10; }
|
48,251
|
private static final Icon ICON = null;
private static Logger LOG = Logger.getLogger(MakeFieldStatic_Action.class);
public MakeFieldStatic_Action() {
super("Make Field Static", "", ICON);
this.setIsAlwaysVisible(false);
<BUG>this.setExecuteOutsideCommand(false);
</BUG>
}
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) {
return RefactoringUtil.isApplicable(RefactoringUtil.getRefactoringByClassName("jetbrains.mps.baseLanguage.refactorings" + "." + "MakeFieldStatic"), ((SNode) MapSequence.fromMap(_params).get("target")));
|
this.setExecuteOutsideCommand(true);
|
48,252
|
private static final Icon ICON = null;
private static Logger LOG = Logger.getLogger(MoveStaticField_Action.class);
public MoveStaticField_Action() {
super("Move Static Field", "", ICON);
this.setIsAlwaysVisible(false);
<BUG>this.setExecuteOutsideCommand(false);
</BUG>
}
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) {
return RefactoringUtil.isApplicable(RefactoringUtil.getRefactoringByClassName("jetbrains.mps.baseLanguage.refactorings" + "." + "MoveStaticField"), ((SNode) MapSequence.fromMap(_params).get("target")));
|
this.setExecuteOutsideCommand(true);
|
48,253
|
private static final Icon ICON = null;
private static Logger LOG = Logger.getLogger(MoveStaticMethod_Action.class);
public MoveStaticMethod_Action() {
super("Move Static Method", "", ICON);
this.setIsAlwaysVisible(false);
<BUG>this.setExecuteOutsideCommand(false);
</BUG>
}
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) {
return RefactoringUtil.isApplicable(RefactoringUtil.getRefactoringByClassName("jetbrains.mps.baseLanguage.refactorings" + "." + "MoveStaticMethod"), ((SNode) MapSequence.fromMap(_params).get("target")));
|
this.setExecuteOutsideCommand(true);
|
48,254
|
private static final Icon ICON = null;
private static Logger LOG = Logger.getLogger(ConvertAnonymousClass_Action.class);
public ConvertAnonymousClass_Action() {
super("Convert Anonymous Class", "", ICON);
this.setIsAlwaysVisible(false);
<BUG>this.setExecuteOutsideCommand(false);
</BUG>
}
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) {
return RefactoringUtil.isApplicable(RefactoringUtil.getRefactoringByClassName("jetbrains.mps.baseLanguage.refactorings" + "." + "ConvertAnonymousClass"), ((SNode) MapSequence.fromMap(_params).get("target")));
|
this.setExecuteOutsideCommand(true);
|
48,255
|
private static final Icon ICON = null;
private static Logger LOG = Logger.getLogger(MakeFieldFinal_Action.class);
public MakeFieldFinal_Action() {
super("Make Field Final", "", ICON);
this.setIsAlwaysVisible(false);
<BUG>this.setExecuteOutsideCommand(false);
</BUG>
}
public boolean isApplicable(AnActionEvent event, final Map<String, Object> _params) {
return RefactoringUtil.isApplicable(RefactoringUtil.getRefactoringByClassName("jetbrains.mps.baseLanguage.refactorings" + "." + "MakeFieldFinal"), ((SNode) MapSequence.fromMap(_params).get("target")));
|
this.setExecuteOutsideCommand(true);
|
48,256
|
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 FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
|
import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
48,257
|
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(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
|
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));
|
48,258
|
} 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()
|
48,259
|
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_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
|
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.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
48,260
|
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_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
|
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_AGE));
|
48,261
|
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 backupFile;
private boolean closed;
|
import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
48,262
|
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) != null) {
|
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
48,263
|
package fi.dy.masa.enderutilities.config;
<BUG>import java.io.File;
import net.minecraft.util.math.MathHelper;
import net.minecraftforge.common.config.Configuration;</BUG>
import net.minecraftforge.common.config.Property;
import net.minecraftforge.fml.client.event.ConfigChangedEvent.OnConfigChangedEvent;
|
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import net.minecraftforge.common.config.ConfigCategory;
import net.minecraftforge.common.config.Configuration;
|
48,264
|
public static boolean buildersWandUseTranslucentGhostBlocks;
public static int buildersWandBlocksPerTick;
public static int buildersWandReplaceBlocksPerTick;
public static float buildersWandGhostBlockAlpha;
public static float buildersWandMaxBlockHardness;
<BUG>public static int enderBucketCapacity;
public static int harvestLevelEnderAlloyAdvanced;
public static int portalFrameCheckLimit;
public static int portalLoopCheckLimit;
public static int portalAreaCheckLimit;
public static boolean useEnderCharge;</BUG>
public static boolean enderBowAllowPlayers;
|
[DELETED]
|
48,265
|
public static int portalAreaCheckLimit;
public static boolean useEnderCharge;</BUG>
public static boolean enderBowAllowPlayers;
public static boolean enderBowAllowSelfTP;
public static boolean enderLassoAllowPlayers;
<BUG>public static String enderBagListType;
</BUG>
public static String[] enderBagBlacklist;
public static String[] enderBagWhitelist;
public static String[] teleportBlacklist;
|
public static boolean buildersWandUseTranslucentGhostBlocks;
public static int buildersWandBlocksPerTick;
public static int buildersWandReplaceBlocksPerTick;
public static float buildersWandGhostBlockAlpha;
public static float buildersWandMaxBlockHardness;
public static boolean enderBagListTypeIsWhitelist;
|
48,266
|
@EventHandler
public void preInit(FMLPreInitializationEvent event)
{
instance = this;
logger = event.getModLog();
<BUG>ConfigReader.loadConfigsAll(event.getSuggestedConfigurationFile());
EnderUtilitiesItems.init(); // Initialize and register mod items and item recipes</BUG>
EnderUtilitiesBlocks.init(); // Initialize and register mod blocks and block recipes
PacketHandler.init(); // Initialize network stuff
|
ConfigReader.loadConfigsFromFile(event.getSuggestedConfigurationFile());
ModRegistry.checkLoadedMods();
EnderUtilitiesItems.init(); // Initialize and register mod items and item recipes
|
48,267
|
public void init(FMLInitializationEvent event)
{
proxy.registerColorHandlers();
}
@EventHandler
<BUG>public void postInit(FMLPostInitializationEvent event)
{
Registry.registerEnderbagLists();
Registry.registerTeleportBlacklist();
ModRegistry.checkLoadedMods();
}
@EventHandler</BUG>
public void onServerStartingEvent(FMLServerStartingEvent event)
|
[DELETED]
|
48,268
|
ModRegistry.checkLoadedMods();
}
@EventHandler</BUG>
public void onServerStartingEvent(FMLServerStartingEvent event)
<BUG>{
ChunkLoading.getInstance().init();</BUG>
EnergyBridgeTracker.readFromDisk();
}
@EventHandler
public void onMissingMappingEvent(FMLMissingMappingsEvent event)
|
public void init(FMLInitializationEvent event)
proxy.registerColorHandlers();
ConfigReader.reLoadAllConfigs(true);
ChunkLoading.getInstance().init();
|
48,269
|
package fi.dy.masa.enderutilities.config;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.gui.GuiScreen;
<BUG>import net.minecraftforge.common.config.ConfigElement;
import net.minecraftforge.fml.client.config.GuiConfig;</BUG>
import net.minecraftforge.fml.client.config.IConfigElement;
import fi.dy.masa.enderutilities.reference.Reference;
public class EnderUtilitiesConfigGui extends GuiConfig
|
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.client.config.GuiConfig;
|
48,270
|
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
<BUG>import fi.dy.masa.enderutilities.config.Configs;
import fi.dy.masa.enderutilities.item.base.IChunkLoadingItem;</BUG>
import fi.dy.masa.enderutilities.item.base.IKeyBound;
import fi.dy.masa.enderutilities.item.base.IModule;
import fi.dy.masa.enderutilities.item.base.ItemLocationBoundModular;
|
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;
import fi.dy.masa.enderutilities.item.base.IChunkLoadingItem;
|
48,271
|
</BUG>
import fi.dy.masa.enderutilities.util.nbt.OwnerData;
import fi.dy.masa.enderutilities.util.nbt.TargetData;
import fi.dy.masa.enderutilities.util.nbt.UtilItemModular;
<BUG>import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import net.minecraftforge.items.CapabilityItemHandler;</BUG>
public class ItemEnderBag extends ItemLocationBoundModular implements IChunkLoadingItem, IKeyBound
{
|
import fi.dy.masa.enderutilities.item.base.ItemModule.ModuleType;
import fi.dy.masa.enderutilities.item.part.ItemEnderCapacitor;
import fi.dy.masa.enderutilities.item.part.ItemLinkCrystal;
import fi.dy.masa.enderutilities.reference.Reference;
import fi.dy.masa.enderutilities.reference.ReferenceNames;
import fi.dy.masa.enderutilities.registry.BlackLists;
|
48,272
|
this.maxsize = maxsize;
}
public int size() {
return this.instack.size();
}
<BUG>public synchronized void push(final E element, Long weight) {
if (this.instack.contains(element)) return;
List<E> l = this.onstack.get(weight);</BUG>
if (l == null) {
|
public void push(final E element, Long weight) {
if (!this.instack.add(element)) return;
synchronized (this.onstack) {
List<E> l = this.onstack.get(weight);
|
48,273
|
l.add(element);
this.onstack.put(weight, l);
} else {
l.add(element);
}
<BUG>this.instack.add(element);
if (this.maxsize <= 0) return;
while ((this.onstack.size() > 0) && (this.onstack.size() > this.maxsize)) {
</BUG>
this.onstack.remove(this.onstack.lastKey());
|
[DELETED]
|
48,274
|
String receiverUserName = getUserName(
activity.getReceiverUserId(), themeDisplay);
int activityType = activity.getType();
MBMessage message = MBMessageLocalServiceUtil.getMessage(
activity.getClassPK());
<BUG>String link =
themeDisplay.getPortalURL() + themeDisplay.getPathMain() +
"/message_boards/find_message?messageId=" +
message.getMessageId();
String titlePattern = null;</BUG>
if (activityType == MBActivityKeys.ADD_MESSAGE) {
|
StringBuilder sb = new StringBuilder(4);
sb.append(themeDisplay.getPortalURL());
sb.append(themeDisplay.getPathMain());
sb.append("/message_boards/find_message?messageId=");
sb.append(message.getMessageId());
String link = sb.toString();
String titlePattern = null;
|
48,275
|
any(RetentionClassUpdate.class)).thenReturn(true);
PowerMockito.doNothing().when(NamespaceRetentionAction.class, "delete",
same(connection), anyString(), anyString());
ArgumentCaptor<String> nsCaptor = ArgumentCaptor.forClass(String.class);
ArgumentCaptor<String> rcCaptor = ArgumentCaptor.forClass(String.class);
<BUG>when(broker.getPrefix()).thenReturn(PREFIX);
when(catalog.findServiceDefinition(NAMESPACE_SERVICE_ID))
.thenReturn(namespaceServiceFixture());
ecs.changeNamespacePlan(NAMESPACE, NAMESPACE_SERVICE_ID, NAMESPACE_PLAN_ID2, params);
Mockito.verify(catalog, times(1)).findServiceDefinition(NAMESPACE_SERVICE_ID);</BUG>
PowerMockito.verifyStatic();
|
ServiceDefinitionProxy service = namespaceServiceFixture();
PlanProxy plan = service.findPlan(NAMESPACE_PLAN_ID2);
ecs.changeNamespacePlan(NAMESPACE, service, plan , params);
|
48,276
|
any(RetentionClassUpdate.class));
ArgumentCaptor<String> nsCaptor = ArgumentCaptor.forClass(String.class);
ArgumentCaptor<String> rcCaptor = ArgumentCaptor.forClass(String.class);
ArgumentCaptor<RetentionClassUpdate> updateCaptor = ArgumentCaptor
.forClass(RetentionClassUpdate.class);
<BUG>when(broker.getPrefix()).thenReturn(PREFIX);
when(catalog.findServiceDefinition(NAMESPACE_SERVICE_ID))
.thenReturn(namespaceServiceFixture());
ecs.changeNamespacePlan(NAMESPACE, NAMESPACE_SERVICE_ID, NAMESPACE_PLAN_ID2, params);
Mockito.verify(catalog, times(1)).findServiceDefinition(NAMESPACE_SERVICE_ID);</BUG>
PowerMockito.verifyStatic();
|
ServiceDefinitionProxy service = namespaceServiceFixture();
PlanProxy plan = service.findPlan(NAMESPACE_PLAN_ID2);
ecs.changeNamespacePlan(NAMESPACE, service, plan, params);
|
48,277
|
.thenReturn(namespaceServiceFixture());
ServiceDefinitionProxy service = ecs
.lookupServiceDefinition(NAMESPACE_SERVICE_ID);
assertEquals(NAMESPACE_SERVICE_ID, service.getId());
}
<BUG>@Test
public void testlookupPlan() throws EcsManagementClientException {
ServiceDefinitionProxy service = bucketServiceFixture();
PlanProxy plan = ecs
.lookupPlan(service, BUCKET_PLAN_ID1);
assertEquals(BUCKET_PLAN_ID1, plan.getId());
}</BUG>
@Test(expected = EcsManagementClientException.class)
|
[DELETED]
|
48,278
|
@Test(expected = EcsManagementClientException.class)
public void testLookupMissingServiceDefinitionFails()
throws EcsManagementClientException {
ecs.lookupServiceDefinition(NAMESPACE_SERVICE_ID);
}
<BUG>@Test(expected = EcsManagementClientException.class)
public void testLookupMissingPlanFails()
throws EcsManagementClientException {
ServiceDefinitionProxy service = bucketServiceFixture();
ecs.lookupPlan(service, NAMESPACE_PLAN_ID1);</BUG>
}
|
[DELETED]
|
48,279
|
new ServiceInstance(bucketCreateRequestFixture(params)));
instSvc.updateServiceInstance(bucketUpdateRequestFixture(params));
verify(repository, times(1)).find(BUCKET_NAME);
verify(repository, times(1)).delete(BUCKET_NAME);
verify(repository, times(1)).save(any(ServiceInstance.class));
<BUG>verify(ecs, times(1)).changeBucketPlan(BUCKET_NAME,
BUCKET_SERVICE_ID, BUCKET_PLAN_ID1);
}</BUG>
@Test
|
verify(ecs, times(1)).changeBucketPlan(eq(BUCKET_NAME),
any(ServiceDefinitionProxy.class), any(PlanProxy.class));
}
|
48,280
|
String planId = request.getPlanId();
Map<String, Object> params = request.getParameters();
try {
ServiceDefinitionProxy service = ecs
.lookupServiceDefinition(serviceDefinitionId);
<BUG>PlanProxy plan = ecs.lookupPlan(service, planId);
String serviceType = (String) service.getServiceSettings()</BUG>
.get(SERVICE_TYPE);
if (BUCKET.equals(serviceType)) {
ecs.createBucket(serviceInstanceId, service, plan);
|
PlanProxy plan = service.findPlan(planId);
String serviceType = (String) service.getServiceSettings()
|
48,281
|
String bucketName = broker.getRepositoryBucket();
String userName = broker.getRepositoryUser();
if (!bucketExists(bucketName)) {
ServiceDefinitionProxy service = lookupServiceDefinition(
broker.getRepositoryServiceId());
<BUG>PlanProxy plan = lookupPlan(service, broker.getRepositoryPlanId());
createBucket(bucketName, service, plan);
}</BUG>
if (!userExists(userName)) {
UserSecretKey secretKey = createUser(userName);
|
createBucket(bucketName, service,
service.findPlan(broker.getRepositoryPlanId()));
}
|
48,282
|
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 android.view.ContextMenu;
|
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
48,283
|
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;
import android.view.ContextMenu;
|
import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
48,284
|
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 android.view.ContextMenu;
import android.view.KeyEvent;
|
import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.Toolbar;
|
48,285
|
mAltitude.setOnCheckedChangeListener(mCheckedChangeListener);
mDistance.setOnCheckedChangeListener(mCheckedChangeListener);
mCompass.setOnCheckedChangeListener(mCheckedChangeListener);
mLocation.setOnCheckedChangeListener(mCheckedChangeListener);
builder.setTitle(R.string.dialog_layer_title).setIcon(android.R.drawable.ic_dialog_map).setPositiveButton
<BUG>(R.string.btn_okay, null).setView(view);
</BUG>
dialog = builder.create();
return dialog;
case DIALOG_NOTRACK:
|
(android.R.string.ok, null).setView(view);
|
48,286
|
interpB.setROIdata(roiBounds, roiIter);
if (nod == null) {
nod = interpB.getNoDataRange();
}
if (destNod == null) {
<BUG>destNod = interpB.getDestinationNoData();
</BUG>
}
}
if (nod != null) {
|
destNod = new double[]{interpB.getDestinationNoData()};
|
48,287
|
s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,288
|
dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,289
|
s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,290
|
final int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
final int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
}
}
} else {
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,291
|
dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,292
|
for (int k2 = 0; k2 < dst_num_bands; k2++) {
int s00 = srcDataArrays[k2][posx + posy + bandOffsets[k2]];
int s01 = srcDataArrays[k2][posxhigh + posy + bandOffsets[k2]];
int s10 = srcDataArrays[k2][posx + posyhigh + bandOffsets[k2]];
int s11 = srcDataArrays[k2][posxhigh + posyhigh + bandOffsets[k2]];
<BUG>int w00 = byteLookupTable[s00&0xFF] == destinationNoDataByte ? 0 : 1;
int w01 = byteLookupTable[s01&0xFF] == destinationNoDataByte ? 0 : 1;
int w10 = byteLookupTable[s10&0xFF] == destinationNoDataByte ? 0 : 1;
int w11 = byteLookupTable[s11&0xFF] == destinationNoDataByte ? 0 : 1;
</BUG>
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
|
int w00 = byteLookupTable[k2][s00&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
int w01 = byteLookupTable[k2][s01&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
int w10 = byteLookupTable[k2][s10&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
int w11 = byteLookupTable[k2][s11&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
|
48,293
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = (byte) (intResult & 0xff);
}
}
} else if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
}
}
if (fracx < fracdx1) {
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,294
|
s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,295
|
int w11 = w11index < roiDataLength ? roiDataArray[w11index] & 0xff : 0;
if (baseIndex > roiDataLength || w00 == 0
|| (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0)) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
}
}
} else {
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,296
|
final int s00 = srcDataArrays[k2][posx + posy + bandOffsets[k2]];
final int s01 = srcDataArrays[k2][posxhigh + posy + bandOffsets[k2]];
final int s10 = srcDataArrays[k2][posx + posyhigh + bandOffsets[k2]];
final int s11 = srcDataArrays[k2][posxhigh + posyhigh
+ bandOffsets[k2]];
<BUG>w00 = byteLookupTable[s00&0xFF] == destinationNoDataByte ? 0 : 1;
w01 = byteLookupTable[s01&0xFF] == destinationNoDataByte ? 0 : 1;
w10 = byteLookupTable[s10&0xFF] == destinationNoDataByte ? 0 : 1;
w11 = byteLookupTable[s11&0xFF] == destinationNoDataByte ? 0 : 1;
</BUG>
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
|
w00 = byteLookupTable[k2][s00&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w01 = byteLookupTable[k2][s01&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w10 = byteLookupTable[k2][s10&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w11 = byteLookupTable[k2][s11&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
|
48,297
|
dstPixelOffset += dstPixelStride;
}
if (setDestinationNoData && clipMinX <= clipMaxX) {
for (int x = clipMaxX; x < dst_max_x; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
}
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,298
|
s_ix = startPts[0].x;
s_iy = startPts[0].y;
if (setDestinationNoData) {
for (int x = dst_min_x; x < clipMinX; x++) {
for (int k2 = 0; k2 < dst_num_bands; k2++)
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
dstPixelOffset += dstPixelStride;
}
} else
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,299
|
int w10 = roiIter.getSample(x0, y0 + 1, 0) & 0xff;
int w11 = roiIter.getSample(x0 + 1, y0 + 1, 0) & 0xff;
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
if (setDestinationNoData) {
for (int k2 = 0; k2 < dst_num_bands; k2++) {
<BUG>dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte;
</BUG>
}
}
} else {
|
dstDataArrays[k2][dstPixelOffset + dstBandOffsets[k2]] = destinationNoDataByte[k2];
|
48,300
|
+ bandOffsets[k2]];
final int s10 = srcDataArrays[k2][posx + posyhigh
+ bandOffsets[k2]];
final int s11 = srcDataArrays[k2][posxhigh + posyhigh
+ bandOffsets[k2]];
<BUG>w00 = byteLookupTable[s00&0xFF] == destinationNoDataByte ? 0 : 1;
w01 = byteLookupTable[s01&0xFF] == destinationNoDataByte ? 0 : 1;
w10 = byteLookupTable[s10&0xFF] == destinationNoDataByte ? 0 : 1;
w11 = byteLookupTable[s11&0xFF] == destinationNoDataByte ? 0 : 1;
</BUG>
if (w00 == 0 && w01 == 0 && w10 == 0 && w11 == 0) {
|
w00 = byteLookupTable[k2][s00&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w01 = byteLookupTable[k2][s01&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w10 = byteLookupTable[k2][s10&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
w11 = byteLookupTable[k2][s11&0xFF] == destinationNoDataByte[k2] ? 0 : 1;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.