id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
47,301
return context.add(arg2, arg1); } }}; <BUG>void testDoubleAddition(BinaryAdder1 adder) { double a, b, plainResult, decodedResult, tolerance; EncryptedNumber ciphertTextA, ciphertTextB, encryptedResult; EncodedNumber decryptedResult; for(int i = 0; i < maxIteration; i++) { a = randomFiniteDouble();</BUG> b = randomFiniteDouble();
@Test public void testDoubleAddition() { EncryptedNumber cipherTextA, cipherTextA_obf, cipherTextB, cipherTextB_obf, encryptedResult; EncodedNumber encodedA, encodedB, encodedResult, decryptedResult; Random rnd = new Random(); int maxExponentDiff = (int)(0.5 * context.getPublicKey().getModulus().bitLength() / (Math.log(context.getBase()) / Math.log(2))); for(int i = 0; i < MAX_ITERATIONS; i++) { a = randomFiniteDouble();
47,302
@RunWith(Parameterized.class) @Category(SlowTests.class) public class DivisionTest { private PaillierContext context; private PaillierPrivateKey privateKey; <BUG>static private int maxIteration = 100; @Parameters</BUG> public static Collection<Object[]> configurations() { Collection<Object[]> configurationParams = new ArrayList<>(); for(TestConfiguration[] confs : CONFIGURATIONS) {
static private int maxIteration = TestConfiguration.MAX_ITERATIONS; @Parameters
47,303
import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.isRevisionsEntry; import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.removePrevious; import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.setHasBinary; import static org.apache.jackrabbit.oak.plugins.document.NodeDocument.setPrevious; import static org.apache.jackrabbit.oak.plugins.document.util.Utils.PROPERTY_OR_DELETED; <BUG>import static org.apache.jackrabbit.oak.plugins.document.util.Utils.getPreviousIdFor; class SplitOperations {</BUG> private static final Logger LOG = LoggerFactory.getLogger(SplitOperations.class); private static final int GARBAGE_LIMIT = Integer.getInteger("oak.documentMK.garbage.limit", 1000); private static final Predicate<Long> BINARY_FOR_SPLIT_THRESHOLD = new Predicate<Long>() {
import static org.apache.jackrabbit.oak.plugins.document.util.Utils.isCommitted; class SplitOperations {
47,304
numValues++; } else { if (context.getClusterId() != entry.getKey().getClusterId()) { continue; } <BUG>if (doc.isCommitted(entry.getKey()) && !mostRecentRevs.contains(entry.getKey())) {</BUG> revisions.put(entry.getKey(), entry.getValue()); numValues++; trackHigh(entry.getKey());
if (isCommitted(context.getCommitValue(entry.getKey(), doc)) && !mostRecentRevs.contains(entry.getKey())) {
47,305
if (splitRevs.contains(r)) { commitRoot.put(r, entry.getValue()); numValues++; } else if (r.getClusterId() == context.getClusterId() && !changes.contains(r)) { <BUG>if (mostRecent && doc.isCommitted(r)) { mostRecent = false;</BUG> } else if (isGarbage(r)) { addGarbage(r, COMMIT_ROOT); }
if (mostRecent && isCommitted(context.getCommitValue(r, doc))) { mostRecent = false;
47,306
import org.apache.jackrabbit.oak.plugins.document.UpdateOp.Key; import org.apache.jackrabbit.oak.plugins.document.UpdateOp.Operation; import org.apache.jackrabbit.oak.plugins.document.util.Utils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; <BUG>import static com.google.common.base.Preconditions.checkNotNull; import static org.apache.jackrabbit.oak.plugins.document.util.Utils.isPropertyName;</BUG> class Collision { private static final Logger LOG = LoggerFactory.getLogger(Collision.class); private final NodeDocument document;
import static org.apache.jackrabbit.oak.plugins.document.util.Utils.isCommitted; import static org.apache.jackrabbit.oak.plugins.document.util.Utils.isPropertyName;
47,307
return theirRev; } NodeDocument newDoc = Collection.NODES.newDocument(store); document.deepCopy(newDoc); UpdateUtils.applyChanges(newDoc, ourOp); <BUG>if (!markCommitRoot(newDoc, ourRev, theirRev, store)) { </BUG> throw new IllegalStateException("Unable to annotate our revision " + "with collision marker. Our revision: " + ourRev + ", document:\n" + newDoc.format());
if (!markCommitRoot(newDoc, ourRev, theirRev, store, context)) {
47,308
throwNoCommitRootException(revision, document); } } UpdateOp op = new UpdateOp(Utils.getIdFromPath(commitRootPath), false); NodeDocument commitRoot = store.find(Collection.NODES, op.getId()); <BUG>if (commitRoot.isCommitted(revision)) { return false;</BUG> } if (commitRoot.getLocalMap(NodeDocument.COLLISIONS).containsKey(revision)) { return true;
if (isCommitted(context.getCommitValue(revision, commitRoot))) { return false;
47,309
</BUG> assertTrue(col.isConflicting()); op = new UpdateOp(id, false); op.setMapEntry("p", c, "b"); <BUG>col = new Collision(doc, r1, op, c); </BUG> assertTrue(col.isConflicting()); b = ns.getRoot().builder(); b.child("test").setProperty("p", "b"); Revision r2 = merge(ns, b).getRevision(ns.getClusterId());
assertNotNull(r1); NodeDocument doc = getDocument(store, id); Revision c = ns.newRevision(); UpdateOp op = new UpdateOp(id, true); NodeDocument.setDeleted(op, c, false); Collision col = new Collision(doc, r1, op, c, ns); col = new Collision(doc, r1, op, c, ns);
47,310
if ("true".equals(value)) { return null; } return newestRev; } <BUG>boolean isValidRevision(@Nonnull RevisionContext context, </BUG> @Nonnull Revision rev, @Nullable String commitValue, @Nonnull RevisionVector readRevision,
private boolean isValidRevision(@Nonnull RevisionContext context,
47,311
if (context.getBranches().getBranch(readRevision) == null && !readRevision.isBranch()) { revision = resolveCommitRevision(revision, commitValue); return !readRevision.isRevisionNewer(revision); } else { <BUG>if (commitValue.equals(getCommitValue(readRevision.getBranchRevision().asTrunkRevision()))) { return !readRevision.isRevisionNewer(revision);</BUG> } } } else {
Revision tr = readRevision.getBranchRevision().asTrunkRevision(); if (commitValue.equals(context.getCommitValue(tr, this))) {
47,312
import static com.google.common.collect.Iterables.filter; import static com.google.common.collect.Maps.filterKeys; import static java.util.Collections.singletonList; import static org.apache.jackrabbit.oak.plugins.document.Collection.JOURNAL; import static org.apache.jackrabbit.oak.plugins.document.Collection.NODES; <BUG>import static org.apache.jackrabbit.oak.plugins.document.util.Utils.PROPERTY_OR_DELETED; import java.util.Iterator;</BUG> import java.util.Map; import java.util.concurrent.locks.ReentrantLock; import javax.annotation.CheckForNull;
import static org.apache.jackrabbit.oak.plugins.document.util.Utils.isCommitted; import static org.apache.jackrabbit.oak.plugins.document.util.Utils.resolveCommitRevision; import java.util.Iterator;
47,313
ClusterPredicate cp = new ClusterPredicate(clusterId); Revision lastModified = null; for (String property : Sets.filter(doc.keySet(), PROPERTY_OR_DELETED)) { Map<Revision, String> valueMap = doc.getLocalMap(property); for (Map.Entry<Revision, String> entry : filterKeys(valueMap, cp).entrySet()) { <BUG>Revision rev = entry.getKey(); if (doc.isCommitted(rev)) { lastModified = Utils.max(lastModified, doc.getCommitRevision(rev)); </BUG> break;
String cv = nodeStore.getCommitValue(rev, doc); if (isCommitted(cv)) { lastModified = Utils.max(lastModified, resolveCommitRevision(rev, cv));
47,314
} @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("/bin/sh", "-c", "\"echo " + i + "\""))); }
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
47,315
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, sum, fib)); }
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
47,316
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<String> task2 = Task.ofType(String.class).named("Baz", 40) .in(() -> task1)</BUG> .ins(() -> singletonList(task1))
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
47,317
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 + " causes an outer reference");</BUG> serialize(task); } @Test
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
47,318
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.evaluate(des).consume(val);
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
47,319
} @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);
47,320
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);
47,321
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);
47,322
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(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
47,323
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 + "samples"; String events_str = dataDir + "events";
@Override public boolean isrunning(){ if ( filePlayback!=null ) return filePlayback.isrunning(); return false; } void initFiles() throws FileNotFoundException {
47,324
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 final BroadcastReceiver mMessageReceiver = new BroadcastReceiver() { @Override public void onReceive(final Context context, final Intent intent) { if (intent.getIntExtra(C.MESSAGE_TYPE, -1) == C.UPDATE_REQUEST) { Log.i(TAG, "Received update request."); sendAllInfo(); } } };</BUG> private boolean run = true;
[DELETED]
47,325
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>public static final int UPDATE_REQUEST = 0; </BUG> public static final int UPDATE = 1; public static final int REQUEST_PUT_HEADER = 2; public static final int REQUEST_FLUSH_HEADER = 3;
public static final int THREAD_INFO_TYPE = 0;
47,326
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 createFromParcel(final Parcel in) {
import nl.dcc.buffer_bci.C; public class ThreadInfo implements Parcelable {
47,327
package com.easytoolsoft.easyreport.web.controller.common; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; @Controller @RequestMapping(value = "/error") <BUG>public class ErrorController extends AbstractController { @RequestMapping(value = {"/404"})</BUG> public String error404() { return "/error/404"; }
public class ErrorController { @RequestMapping(value = {"/404"})
47,328
import de.vanita5.twittnuker.receiver.NotificationReceiver; import de.vanita5.twittnuker.service.LengthyOperationsService; import de.vanita5.twittnuker.util.ActivityTracker; import de.vanita5.twittnuker.util.AsyncTwitterWrapper; import de.vanita5.twittnuker.util.DataStoreFunctionsKt; <BUG>import de.vanita5.twittnuker.util.DataStoreUtils; import de.vanita5.twittnuker.util.ImagePreloader;</BUG> import de.vanita5.twittnuker.util.InternalTwitterContentUtils; import de.vanita5.twittnuker.util.JsonSerializer; import de.vanita5.twittnuker.util.NotificationManagerWrapper;
import de.vanita5.twittnuker.util.DebugLog; import de.vanita5.twittnuker.util.ImagePreloader;
47,329
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);
47,330
@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);
47,331
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);
47,332
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);
47,333
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);
47,334
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);
47,335
import de.vanita5.twittnuker.annotation.CustomTabType; import de.vanita5.twittnuker.library.MicroBlog; import de.vanita5.twittnuker.library.MicroBlogException; import de.vanita5.twittnuker.library.twitter.model.RateLimitStatus; import de.vanita5.twittnuker.library.twitter.model.Status; <BUG>import de.vanita5.twittnuker.fragment.AbsStatusesFragment; 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;
47,336
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());
47,337
import java.util.List; import java.util.Map.Entry; import javax.inject.Singleton; import okhttp3.Dns; @Singleton <BUG>public class TwidereDns implements Constants, Dns { </BUG> private static final String RESOLVER_LOGTAG = "TwittnukerDns"; private final SharedPreferences mHostMapping; private final SharedPreferencesWrapper mPreferences;
public class TwidereDns implements Dns, Constants {
47,338
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);
47,339
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;
47,340
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());
47,341
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);
47,342
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);
47,343
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);
47,344
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;
47,345
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);
47,346
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);
47,347
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;
47,348
} 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);
47,349
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);
47,350
@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);
47,351
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);
47,352
package org.apache.maven.project; import java.util.ArrayList; import java.util.List; import org.apache.maven.artifact.InvalidRepositoryException; <BUG>import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionException;</BUG> import org.apache.maven.model.Model; import org.apache.maven.model.Repository; import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.apache.maven.artifact.repository.RepositoryRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionException;
47,353
else { return new ArrayList<ArtifactRepository>(); } } <BUG>public ClassRealm createProjectRealm( Model model, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )</BUG> throws ArtifactResolutionException {
public ClassRealm createProjectRealm( Model model, RepositoryRequest repositoryRequest )
47,354
import java.util.List; import java.util.Set; import org.apache.maven.ArtifactFilterManager; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.InvalidRepositoryException; <BUG>import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionException;</BUG> import org.apache.maven.artifact.resolver.ArtifactResolutionRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionResult; import org.apache.maven.artifact.resolver.ResolutionErrorHandler;
import org.apache.maven.artifact.repository.RepositoryRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionException;
47,355
artifactRepositories.addAll( externalRepositories ); } artifactRepositories = repositorySystem.getEffectiveRepositories( artifactRepositories ); return artifactRepositories; } <BUG>public ClassRealm createProjectRealm( Model model, ArtifactRepository localRepository, List<ArtifactRepository> remoteRepositories )</BUG> throws ArtifactResolutionException {
public ClassRealm createProjectRealm( Model model, RepositoryRequest repositoryRequest )
47,356
for ( Extension extension : build.getExtensions() ) { Artifact artifact = repositorySystem.createArtifact( extension.getGroupId(), extension.getArtifactId(), extension.getVersion(), "jar" ); <BUG>populateRealm( projectRealm, artifact, null, localRepository, remoteRepositories ); </BUG> } for ( Plugin plugin : extensionPlugins ) {
populateRealm( projectRealm, artifact, null, repositoryRequest );
47,357
Set<Artifact> dependencies = new LinkedHashSet<Artifact>(); for ( Dependency dependency : plugin.getDependencies() ) { dependencies.add( repositorySystem.createDependencyArtifact( dependency ) ); } <BUG>populateRealm( projectRealm, artifact, dependencies, localRepository, remoteRepositories ); </BUG> } try {
populateRealm( projectRealm, artifact, dependencies, repositoryRequest );
47,358
package org.apache.maven.project; import java.util.List; import org.apache.maven.artifact.InvalidRepositoryException; <BUG>import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionException;</BUG> import org.apache.maven.model.Model; import org.apache.maven.model.Repository; import org.codehaus.plexus.classworlds.realm.ClassRealm;
import org.apache.maven.artifact.repository.RepositoryRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionException;
47,359
package org.apache.maven.project; import java.util.List; <BUG>import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.resolver.ArtifactResolutionException;</BUG> import org.apache.maven.model.Model; import org.apache.maven.model.building.AbstractModelBuildingListener; import org.apache.maven.model.building.ModelBuildingEvent;
import org.apache.maven.artifact.repository.DefaultRepositoryRequest; import org.apache.maven.artifact.repository.RepositoryRequest; import org.apache.maven.artifact.resolver.ArtifactResolutionException;
47,360
} if ( event.getRequest().isProcessPlugins() ) { try { <BUG>projectRealm = projectBuildingHelper.createProjectRealm( model, projectBuildingRequest.getLocalRepository(), pluginRepositories ); }</BUG> catch ( ArtifactResolutionException e )
this.projectBuildingHelper = projectBuildingHelper; if ( projectBuildingRequest == null )
47,361
this.enchantedEquipped = enchantedEquipped; setText(); } public AddCountersControllerEffect(final AddCountersControllerEffect effect) { super(effect); <BUG>if (effect.counter != null) this.counter = effect.counter.copy(); this.enchantedEquipped = effect.enchantedEquipped;</BUG> }
if (effect.counter != null) { this.enchantedEquipped = effect.enchantedEquipped;
47,362
Permanent enchantment = game.getPermanent(source.getSourceId()); if (enchantment != null && enchantment.getAttachedTo() != null) { UUID eUuid = enchantment.getAttachedTo(); Permanent permanent = game.getPermanent(eUuid); if (permanent != null) { <BUG>uuid = permanent.getControllerId(); } else return false; } else return false; }</BUG> Player player = game.getPlayer(uuid);
} else { } } else { } }
47,363
private void setText() { if (counter.getCount() > 1) { StringBuilder sb = new StringBuilder(); sb.append("its controller gets ").append(Integer.toString(counter.getCount())).append(" ").append(counter.getName()).append(" counters"); staticText = sb.toString(); <BUG>} else staticText = "its controller gets a " + counter.getName() + " counter"; }</BUG> @Override
} else { } }
47,364
import java.io.Serializable; import java.util.ArrayList; import java.util.List; import mage.game.draft.DraftCube; public class LimitedOptions implements Serializable { <BUG>protected List<String> sets = new ArrayList<String>(); protected int constructionTime;</BUG> protected String draftCubeName; protected DraftCube draftCube; protected int numberBoosters;
protected List<String> sets = new ArrayList<>(); protected int constructionTime;
47,365
package mage.abilities.effects.common.counter; import java.util.List; <BUG>import java.util.UUID; import mage.constants.Outcome;</BUG> import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.counters.Counter;
import mage.MageObject; import mage.constants.Outcome;
47,366
import mage.abilities.Ability; import mage.abilities.effects.OneShotEffect; import mage.counters.Counter; import mage.filter.FilterPermanent; import mage.game.Game; <BUG>import mage.game.permanent.Permanent; public class AddCountersAllEffect extends OneShotEffect<AddCountersAllEffect> { private Counter counter; private FilterPermanent filter; </BUG> public AddCountersAllEffect(Counter counter, FilterPermanent filter) {
import mage.players.Player; private final Counter counter; private final FilterPermanent filter;
47,367
this.counter = effect.counter.copy(); this.filter = effect.filter.copy(); } @Override public boolean apply(Game game, Ability source) { <BUG>boolean applied = false; if (counter != null) {</BUG> UUID controllerId = source.getControllerId(); List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(); for (Permanent permanent : permanents) {
Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { if (counter != null) {
47,368
import mage.abilities.effects.OneShotEffect; import mage.counters.Counter; import mage.game.Game; import mage.game.permanent.Permanent; import mage.players.Player; <BUG>import java.util.UUID; import mage.abilities.Mode;</BUG> import mage.abilities.dynamicvalue.DynamicValue; import mage.abilities.dynamicvalue.common.StaticValue; import mage.counters.CounterType;
import mage.MageObject; import mage.abilities.Mode;
47,369
this.counter = effect.counter.copy(); } this.amount = effect.amount; } @Override <BUG>public boolean apply(Game game, Ability source) { int affectedTargets = 0;</BUG> for (UUID uuid : targetPointer.getTargets(game, source)) { Permanent permanent = game.getPermanent(uuid); if (permanent != null) {
Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = game.getObject(source.getSourceId()); if (controller != null && sourceObject != null) { int affectedTargets = 0;
47,370
if (permanent != null) { if (counter != null) { Counter newCounter = counter.copy(); newCounter.add(amount.calculate(game, source)); permanent.addCounters(newCounter, game); <BUG>affectedTargets ++; }</BUG> } else { Player player = game.getPlayer(uuid); if (player != null) {
game.informPlayers(new StringBuilder(sourceObject.getName()).append(": ") .append(controller.getName()).append(" puts ") .append(counter.getCount()).append(" ").append(counter.getName().toLowerCase()) .append(" counter on ").append(permanent.getName()).toString()); }
47,371
protected void doPost( HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { Root root = (Root) request.getAttribute("root"); <BUG>Tree tree = (Tree) request.getAttribute("tree"); ObjectMapper mapper = new ObjectMapper();</BUG> JsonNode node = mapper.readTree(request.getInputStream()); if (node.isObject()) { post(node, tree);
String path = (String) request.getAttribute("path"); for (String name : PathUtils.elements(path)) { tree = tree.addChild(name); } ObjectMapper mapper = new ObjectMapper();
47,372
import edu.umd.cs.findbugs.BugReporter; import edu.umd.cs.findbugs.BytecodeScanningDetector; import edu.umd.cs.findbugs.OpcodeStack; import edu.umd.cs.findbugs.ba.ClassContext; public class CharsetIssues extends BytecodeScanningDetector { <BUG>private static final String CHARSET_SIG = "Ljava/nio/charset/Charset;"; </BUG> private static final Map<FQMethod, Integer> REPLACEABLE_ENCODING_METHODS; private static final Map<FQMethod, Integer> UNREPLACEABLE_ENCODING_METHODS; public static final Set<String> STANDARD_JDK7_ENCODINGS = UnmodifiableSet.create("US-ASCII", "ISO-8859-1", "UTF-8", "UTF-16BE", "UTF-16LE", "UTF-16");
private static final String CHARSET_SIG = SignatureUtils.classToSignature("java/nio/charset/Charset");
47,373
new XMLPattern(Pattern.compile("^[\"']>.*"), true), new XMLPattern(Pattern.compile(".*<!\\[CDATA\\[.*", Pattern.CASE_INSENSITIVE), true), new XMLPattern(Pattern.compile(".*\\]\\]>.*"), true), new XMLPattern(Pattern.compile(".*xmlns:.*"), true) ); <BUG>private static final String CBX_MIN_REPORTABLE_ITEMS = "fb-contrib.cbx.minxmlitems"; private BugReporter bugReporter;</BUG> private OpcodeStack stack; private int xmlItemCount = 0; private int xmlConfidentCount = 0;
private static final SignatureBuilder XML_SIG_BUILDER = new SignatureBuilder().withParamTypes(Values.SLASHED_JAVA_LANG_STRING); private BugReporter bugReporter;
47,374
if (seen == INVOKESPECIAL) { String clsName = getClassConstantOperand(); if (Values.isAppendableStringClassName(clsName)) { String methodName = getNameConstantOperand(); String methodSig = getSigConstantOperand(); <BUG>if (Values.CONSTRUCTOR.equals(methodName) && new SignatureBuilder().withParamTypes(Values.SLASHED_JAVA_LANG_STRING).withReturnType(clsName).toString().equals(methodSig) && (stack.getStackDepth() > 0)) { </BUG> OpcodeStack.Item itm = stack.getStackItem(0); strCon = (String) itm.getConstant(); }
if (Values.CONSTRUCTOR.equals(methodName) && XML_SIG_BUILDER.withReturnType(clsName).toString().equals(methodSig) && (stack.getStackDepth() > 0)) {
47,375
} else if (seen == INVOKEVIRTUAL) { String clsName = getClassConstantOperand(); if (Values.isAppendableStringClassName(clsName)) { String methodName = getNameConstantOperand(); String methodSig = getSigConstantOperand(); <BUG>if ("append".equals(methodName) && new SignatureBuilder().withParamTypes(Values.SLASHED_JAVA_LANG_STRING).withReturnType(clsName).toString().equals(methodSig) && (stack.getStackDepth() > 0)) { </BUG> OpcodeStack.Item itm = stack.getStackItem(0); strCon = (String) itm.getConstant(); }
if ("append".equals(methodName) && XML_SIG_BUILDER.withReturnType(clsName).toString().equals(methodSig) && (stack.getStackDepth() > 0)) {
47,376
Values.SIG_PRIMITIVE_CHAR, Values.SIG_PRIMITIVE_FLOAT, Values.SIG_PRIMITIVE_DOUBLE, Values.SIG_PRIMITIVE_BOOLEAN, Values.SIG_VOID, "", null ); private static final Set<String> TWO_SLOT_TYPES = UnmodifiableSet.create(Values.SIG_PRIMITIVE_LONG, Values.SIG_PRIMITIVE_DOUBLE); private static final Pattern CLASS_COMPONENT_DELIMITER = Pattern.compile("\\$"); <BUG>private static final Pattern ANONYMOUS_COMPONENT = Pattern.compile("^[1-9][0-9]{0,9}$"); private SignatureUtils() {</BUG> } public static boolean isInheritedMethod(JavaClass cls, String methodName, String signature) throws ClassNotFoundException { JavaClass[] infs = cls.getAllInterfaces();
private static final String ECLIPSE_WEIRD_SIG_CHARS = "!+"; private SignatureUtils() {
47,377
if ((limit - start) == 0) { return Collections.emptyList(); } List<String> parmSignatures = new ArrayList<>(); int sigStart = start; <BUG>for (int i = start; i < limit; i++) { char c = methodSignature.charAt(i); String parmSignature; if (c != Values.SIG_ARRAY_PREFIX.charAt(0)) { if (c == Values.SIG_QUALIFIED_CLASS_PREFIX_CHAR) {</BUG> int semiPos = methodSignature.indexOf(Values.SIG_QUALIFIED_CLASS_SUFFIX_CHAR, i + 1);
return Collections.emptyMap(); Map<Integer, String> slotIndexToParms = new LinkedHashMap<>(); int slot = methodIsStatic ? 0 : 1; if (!methodSignature.startsWith(Values.SIG_ARRAY_PREFIX, i)) { String parmSignature = null; if (methodSignature.startsWith(Values.SIG_QUALIFIED_CLASS_PREFIX, i)) {
47,378
private static List<CompareSpec> compareClasses; static { try { compareClasses = UnmodifiableList.create( new CompareSpec("java/lang/Comparable", new MethodInfo("compareTo", 1, Values.SIG_PRIMITIVE_INT)), <BUG>new CompareSpec("java/util/Comparator", new MethodInfo("compare", 2, Values.SIG_PRIMITIVE_INT)) </BUG> ); } catch (ClassNotFoundException e) { }
new CompareSpec(Values.SLASHED_JAVA_UTIL_COMPARATOR, new MethodInfo("compare", 2, Values.SIG_PRIMITIVE_INT))
47,379
private static final Set<String> objectSigs = UnmodifiableSet.create( "equals(Ljava/lang/Object;)", "finalize()", "getClass()", "hashCode()", "notify()", "notifyAll()", "toString()", "wait", "wait(J)", "wait(JI)"); private final BugReporter bugReporter; private OpcodeStack stack; private Map<Integer, String[]> localClassTypes; <BUG>private Map<String, String[]> fieldClassTypes; public ReflectionOnObjectMethods(BugReporter bugReporter) {</BUG> this.bugReporter = bugReporter; } @Override
private final SignatureBuilder sigWithoutReturn = new SignatureBuilder().withoutReturnType(); public ReflectionOnObjectMethods(BugReporter bugReporter) {
47,380
new SignatureBuilder().withParamTypes(Values.SIG_PRIMITIVE_INT).withReturnType(HashMap.class).toString())); cfm.add(new FQMethod("com/google/common/collect/Maps", "newLinkedHashMap", noParamsReturnType(LinkedHashMap.class))); cfm.add(new FQMethod("com/google/common/collect/Maps", "newConcurrentMap", noParamsReturnType(ConcurrentHashMap.class))); cfm.add(new FQMethod("com/google/common/collect/Maps", "newTreeMap", noParamsReturnType(TreeMap.class))); cfm.add(new FQMethod("com/google/common/collect/Maps", "newTreeMap", <BUG>new SignatureBuilder().withParamTypes(Comparator.class).withReturnType(TreeMap.class).toString())); </BUG> cfm.add(new FQMethod("com/google/common/collect/Maps", "newIdentityHashMap", noParamsReturnType(IdentityHashMap.class))); collectionFactoryMethods = Collections.<FQMethod> unmodifiableSet(cfm); }
new SignatureBuilder().withParamTypes(Values.SLASHED_JAVA_UTIL_COMPARATOR).withReturnType(TreeMap.class).toString()));
47,381
} else if (matches.length == 0) { errors.add(new IOException("Input Pattern " + p + " matches 0 files")); } else { for (FileStatus globStat: matches) { if (globStat.isDirectory()) { <BUG>for(FileStatus stat: fs.listStatus(globStat.getPath(), inputFilter)) { if (recursive && stat.isDirectory()) { addInputPathRecursively(result, fs, stat.getPath(), inputFilter); } else { result.add(stat); }</BUG> }
RemoteIterator<LocatedFileStatus> iter = fs.listLocatedStatus(globStat.getPath()); while (iter.hasNext()) { LocatedFileStatus stat = iter.next(); if (inputFilter.accept(stat.getPath())) { addInputPathRecursively(result, fs, stat.getPath(),
47,382
FileSystem fs = paths[i].getFileSystem(conf); Path p = fs.makeQualified(paths[i]); newpaths.add(p); }</BUG> for (MultiPathFilter onepool : pools) { <BUG>ArrayList<Path> myPaths = new ArrayList<Path>(); for (Iterator<Path> iter = newpaths.iterator(); iter.hasNext();) { Path p = iter.next(); if (onepool.accept(p)) { </BUG> myPaths.add(p); // add it to my output set
List<InputSplit> splits = new ArrayList<InputSplit>(); if (stats.size() == 0) { return splits; } ArrayList<FileStatus> myPaths = new ArrayList<FileStatus>(); for (Iterator<FileStatus> iter = stats.iterator(); iter.hasNext();) { FileStatus p = iter.next(); if (onepool.accept(p.getPath())) {
47,383
new HashMap<String, List<OneBlockInfo>>(); HashMap<OneBlockInfo, String[]> blockToNodes = new HashMap<OneBlockInfo, String[]>(); HashMap<String, List<OneBlockInfo>> nodeToBlocks = new HashMap<String, List<OneBlockInfo>>(); <BUG>files = new OneFileInfo[paths.length]; if (paths.length == 0) { return;</BUG> }
files = new OneFileInfo[stats.size()]; if (stats.size() == 0) { return;
47,384
TaskAttemptContext context) throws IOException; @VisibleForTesting static class OneFileInfo { private long fileSize; // size of the file private OneBlockInfo[] blocks; // all blocks in this file <BUG>OneFileInfo(Path path, Configuration conf, </BUG> boolean isSplitable, HashMap<String, List<OneBlockInfo>> rackToBlocks, HashMap<OneBlockInfo, String[]> blockToNodes,
OneFileInfo(FileStatus stat, Configuration conf,
47,385
HashMap<OneBlockInfo, String[]> blockToNodes, HashMap<String, List<OneBlockInfo>> nodeToBlocks, HashMap<String, Set<String>> rackToNodes, long maxSize) throws IOException { <BUG>this.fileSize = 0; FileSystem fs = path.getFileSystem(conf); FileStatus stat = fs.getFileStatus(path); BlockLocation[] locations = fs.getFileBlockLocations(stat, 0, stat.getLen());</BUG> if (locations == null) {
BlockLocation[] locations; if (stat instanceof LocatedFileStatus) { locations = ((LocatedFileStatus) stat).getBlockLocations(); } else { FileSystem fs = stat.getPath().getFileSystem(conf); locations = fs.getFileBlockLocations(stat, 0, stat.getLen()); }
47,386
locations = new BlockLocation[] { new BlockLocation() }; } if (!isSplitable) { blocks = new OneBlockInfo[1]; fileSize = stat.getLen(); <BUG>blocks[0] = new OneBlockInfo(path, 0, fileSize, locations[0] .getHosts(), locations[0].getTopologyPaths()); </BUG> } else {
blocks[0] = new OneBlockInfo(stat.getPath(), 0, fileSize, locations[0].getHosts(), locations[0].getTopologyPaths());
47,387
myLength = left / 2; } else { myLength = Math.min(maxSize, left); } } <BUG>OneBlockInfo oneblock = new OneBlockInfo(path, myOffset, myLength, locations[i].getHosts(), locations[i] .getTopologyPaths()); </BUG> left -= myLength;
OneBlockInfo oneblock = new OneBlockInfo(stat.getPath(), myOffset, myLength, locations[i].getHosts(), locations[i].getTopologyPaths());
47,388
this.racks[i] = (new NodeBase(topologyPaths[i])).getNetworkLocation(); } } } protected BlockLocation[] getFileBlockLocations( <BUG>FileSystem fs, FileStatus stat) throws IOException { return fs.getFileBlockLocations(stat, 0, stat.getLen());</BUG> } private static void addHostToRack(HashMap<String, Set<String>> rackToNodes, String rack, String host) {
if (stat instanceof LocatedFileStatus) { return ((LocatedFileStatus) stat).getBlockLocations(); return fs.getFileBlockLocations(stat, 0, stat.getLen());
47,389
import org.apache.commons.logging.LogFactory; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.classification.InterfaceStability; import org.apache.hadoop.fs.BlockLocation; import org.apache.hadoop.fs.FileStatus; <BUG>import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.PathFilter; import org.apache.hadoop.mapreduce.security.TokenCache;</BUG> import org.apache.hadoop.net.NetworkTopology;
import org.apache.hadoop.fs.LocatedFileStatus; import org.apache.hadoop.fs.RemoteIterator; import org.apache.hadoop.mapreduce.security.TokenCache;
47,390
} else if (matches.length == 0) { errors.add(new IOException("Input Pattern " + p + " matches 0 files")); } else { for (FileStatus globStat: matches) { if (globStat.isDirectory()) { <BUG>for(FileStatus stat: fs.listStatus(globStat.getPath(), inputFilter)) { if (recursive && stat.isDirectory()) { addInputPathRecursively(result, fs, stat.getPath(), inputFilter); } else { result.add(stat); }</BUG> }
RemoteIterator<LocatedFileStatus> iter = fs.listLocatedStatus(globStat.getPath()); while (iter.hasNext()) { LocatedFileStatus stat = iter.next(); if (inputFilter.accept(stat.getPath())) { addInputPathRecursively(result, fs, stat.getPath(),
47,391
String[] splitHosts = getSplitHosts(blkLocations, length - bytesRemaining, bytesRemaining, clusterMap); splits.add(makeSplit(path, length - bytesRemaining, bytesRemaining, splitHosts)); } <BUG>} else if (length != 0) { String[] splitHosts = getSplitHosts(blkLocations,0,length,clusterMap); splits.add(makeSplit(path, 0, length, splitHosts)); } else {</BUG> splits.add(makeSplit(path, 0, length, new String[0]));
[DELETED]
47,392
if (parent != null) { super.createControl(parent, styles); } } @Override <BUG>public void setDocument(IDocument document, IAnnotationModel annotationModel) { super.setDocument(document, annotationModel); ((IXtextDocument) getDocument()).addModelListener(this);</BUG> } @Override
if (getDocument() != null) ((IXtextDocument) getDocument()).removeModelListener(this); if (document != null) ((IXtextDocument) getDocument()).addModelListener(this);
47,393
timeWarp = new OwnLabel(getFormattedTimeWrap(), skin, "warp"); timeWarp.setName("time warp"); Container wrapWrapper = new Container(timeWarp); wrapWrapper.width(60f * GlobalConf.SCALE_FACTOR); wrapWrapper.align(Align.center); <BUG>VerticalGroup timeGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR); </BUG> HorizontalGroup dateGroup = new HorizontalGroup(); dateGroup.space(4 * GlobalConf.SCALE_FACTOR); dateGroup.addActor(date);
VerticalGroup timeGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR).padTop(3 * GlobalConf.SCALE_FACTOR);
47,394
focusListScrollPane.setFadeScrollBars(false); focusListScrollPane.setScrollingDisabled(true, false); focusListScrollPane.setHeight(tree ? 200 * GlobalConf.SCALE_FACTOR : 100 * GlobalConf.SCALE_FACTOR); focusListScrollPane.setWidth(160); } <BUG>VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).space(3 * GlobalConf.SCALE_FACTOR); </BUG> objectsGroup.addActor(searchBox); if (focusListScrollPane != null) { objectsGroup.addActor(focusListScrollPane);
VerticalGroup objectsGroup = new VerticalGroup().align(Align.left).columnAlign(Align.left).space(3 * GlobalConf.SCALE_FACTOR);
47,395
headerGroup.addActor(expandIcon); headerGroup.addActor(detachIcon); addActor(headerGroup); expandIcon.setChecked(expanded); } <BUG>public void expand() { </BUG> if (!expandIcon.isChecked()) { expandIcon.setChecked(true); }
public void expandPane() {
47,396
</BUG> if (!expandIcon.isChecked()) { expandIcon.setChecked(true); } } <BUG>public void collapse() { </BUG> if (expandIcon.isChecked()) { expandIcon.setChecked(false); }
headerGroup.addActor(expandIcon); headerGroup.addActor(detachIcon); addActor(headerGroup); expandIcon.setChecked(expanded); public void expandPane() { public void collapsePane() {
47,397
}); playstop.addListener(new TextTooltip(txt("gui.tooltip.playstop"), skin)); TimeComponent timeComponent = new TimeComponent(skin, ui); timeComponent.initialize(); CollapsiblePane time = new CollapsiblePane(ui, txt("gui.time"), timeComponent.getActor(), skin, true, playstop); <BUG>time.align(Align.left); mainActors.add(time);</BUG> panes.put(timeComponent.getClass().getSimpleName(), time); if (Constants.desktop) { recCamera = new OwnImageButton(skin, "rec");
time.align(Align.left).columnAlign(Align.left); mainActors.add(time);
47,398
panes.put(visualEffectsComponent.getClass().getSimpleName(), visualEffects); ObjectsComponent objectsComponent = new ObjectsComponent(skin, ui); objectsComponent.setSceneGraph(sg); objectsComponent.initialize(); CollapsiblePane objects = new CollapsiblePane(ui, txt("gui.objects"), objectsComponent.getActor(), skin, false); <BUG>objects.align(Align.left); mainActors.add(objects);</BUG> panes.put(objectsComponent.getClass().getSimpleName(), objects); GaiaComponent gaiaComponent = new GaiaComponent(skin, ui); gaiaComponent.initialize();
objects.align(Align.left).columnAlign(Align.left); mainActors.add(objects);
47,399
if (Constants.desktop) { MusicComponent musicComponent = new MusicComponent(skin, ui); musicComponent.initialize(); Actor[] musicActors = MusicActorsManager.getMusicActors() != null ? MusicActorsManager.getMusicActors().getActors(skin) : null; CollapsiblePane music = new CollapsiblePane(ui, txt("gui.music"), musicComponent.getActor(), skin, true, musicActors); <BUG>music.align(Align.left); mainActors.add(music);</BUG> panes.put(musicComponent.getClass().getSimpleName(), music); } Button switchWebgl = new OwnTextButton(txt("gui.webgl.back"), skin, "link");
music.align(Align.left).columnAlign(Align.left); mainActors.add(music);
47,400
Bundle savedInstanceState) { final View rootView = inflater.inflate(R.layout.tab_qibla, container, false); final QiblaCompassView qiblaCompassView = (QiblaCompassView)rootView.findViewById(R.id.qibla_compass); qiblaCompassView.setConstants(((TextView)rootView.findViewById(R.id.bearing_north)), getText(R.string.bearing_north), ((TextView)rootView.findViewById(R.id.bearing_qibla)), getText(R.string.bearing_qibla)); <BUG>sOrientationListener = new SensorListener() { </BUG> public void onSensorChanged(int s, float v[]) { float northDirection = v[SensorManager.DATA_X]; qiblaCompassView.setDirections(northDirection, sQiblaDirection);
sOrientationListener = new android.hardware.SensorListener() {