id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
48,601
return factory.dumpChannels(); } public ObjectName preRegister(MBeanServer server, ObjectName name) throws Exception { this.server=server; if(factory != null) <BUG>factory.setServer(server); return ObjectName.getInstance(getDomain()); </BUG> } public void postRegister(Boolean registrationDone) {
if (name != null) {//we only create a name if it is empty return name; String objectName = getDomain() + " : service=JChannelFactory"; return ObjectName.getInstance(objectName);
48,602
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.List; <BUG>import java.util.Optional; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandDelete extends FCCommandBase { private static final FlagMapper MAPPER = map -> key -> value -> { map.put(key, value);
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
48,603
.append(Text.of(TextColors.GREEN, "Usage: ")) .append(getUsage(source)) .build()); return CommandResult.empty(); } else if (isIn(REGIONS_ALIASES, parse.args[0])) { <BUG>if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); IRegion region = FGManager.getInstance().getRegion(parse.args[1]); </BUG> boolean isWorldRegion = false; if (region == null) {
String regionName = parse.args[1]; IRegion region = FGManager.getInstance().getRegion(regionName).orElse(null);
48,604
</BUG> isWorldRegion = true; } if (region == null) <BUG>throw new CommandException(Text.of("No region exists with the name \"" + parse.args[1] + "\"!")); if (region instanceof GlobalWorldRegion) { </BUG> throw new CommandException(Text.of("You may not delete the global region!")); }
if (world == null) throw new CommandException(Text.of("No world exists with name \"" + worldName + "\"!")); if (world == null) throw new CommandException(Text.of("Must specify a world!")); region = FGManager.getInstance().getWorldRegion(world, regionName).orElse(null); throw new CommandException(Text.of("No region exists with the name \"" + regionName + "\"!")); if (region instanceof IGlobal) {
48,605
source.getName() + " deleted " + (isWorldRegion ? "world" : "") + "region" ); return CommandResult.success(); } else if (isIn(HANDLERS_ALIASES, parse.args[0])) { if (parse.args.length < 2) throw new CommandException(Text.of("Must specify a name!")); <BUG>IHandler handler = FGManager.getInstance().gethandler(parse.args[1]); if (handler == null) throw new ArgumentParseException(Text.of("No handler exists with that name!"), parse.args[1], 1); if (handler instanceof GlobalHandler)</BUG> throw new CommandException(Text.of("You may not delete the global handler!"));
Optional<IHandler> handlerOpt = FGManager.getInstance().gethandler(parse.args[1]); if (!handlerOpt.isPresent()) IHandler handler = handlerOpt.get(); if (handler instanceof GlobalHandler)
48,606
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
48,607
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index == 1) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
48,608
@Dependency(id = "foxcore") }, description = "A world protection plugin built for SpongeAPI. Requires FoxCore.", authors = {"gravityfox"}, url = "https://github.com/FoxDenStudio/FoxGuard") <BUG>public final class FoxGuardMain { public final Cause pluginCause = Cause.builder().named("plugin", this).build(); private static FoxGuardMain instanceField;</BUG> @Inject private Logger logger;
private static FoxGuardMain instanceField;
48,609
private UserStorageService userStorage; private EconomyService economyService = null; private boolean loaded = false; private FCCommandDispatcher fgDispatcher; public static FoxGuardMain instance() { <BUG>return instanceField; }</BUG> @Listener public void construct(GameConstructionEvent event) { instanceField = this;
} public static Cause getCause() { return instance().pluginCause; }
48,610
return configDirectory; } public boolean isLoaded() { return loaded; } <BUG>public static Cause getCause() { return instance().pluginCause; }</BUG> public EconomyService getEconomyService() { return economyService;
[DELETED]
48,611
import org.spongepowered.api.world.Locatable; import org.spongepowered.api.world.Location; import org.spongepowered.api.world.World; import javax.annotation.Nullable; import java.util.*; <BUG>import java.util.stream.Collectors; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;</BUG> public class CommandHere extends FCCommandBase { private static final String[] PRIORITY_ALIASES = {"priority", "prio", "p"}; private static final FlagMapper MAPPER = map -> key -> value -> {
import java.util.stream.Stream; import static net.foxdenstudio.sponge.foxcore.plugin.util.Aliases.*;
48,612
.excludeCurrent(true) .autoCloseQuotes(true) .parse(); if (parse.current.type.equals(AdvCmdParser.CurrentElement.ElementType.ARGUMENT)) { if (parse.current.index == 0) <BUG>return ImmutableList.of("region", "handler").stream() .filter(new StartsWithPredicate(parse.current.token))</BUG> .map(args -> parse.current.prefix + args) .collect(GuavaCollectors.toImmutableList()); else if (parse.current.index > 0) {
return Stream.of("region", "handler") .filter(new StartsWithPredicate(parse.current.token))
48,613
private static FGStorageManager instance; private final Logger logger = FoxGuardMain.instance().getLogger();</BUG> private final Set<LoadEntry> loaded = new HashSet<>(); private final Path directory = getDirectory(); private final Map<String, Path> worldDirectories; <BUG>private FGStorageManager() { defaultModifiedMap = new CacheMap<>((k, m) -> {</BUG> if (k instanceof IFGObject) { m.put((IFGObject) k, true); return true;
public final HashMap<IFGObject, Boolean> defaultModifiedMap; private final UserStorageService userStorageService; private final Logger logger = FoxGuardMain.instance().getLogger(); userStorageService = FoxGuardMain.instance().getUserStorage(); defaultModifiedMap = new CacheMap<>((k, m) -> {
48,614
String name = fgObject.getName(); Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving handler \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgObject.save(singleDir);
UUID owner = fgObject.getOwner(); boolean isOwned = !owner.equals(SERVER_UUID); Optional<User> userOwner = userStorageService.get(owner); String logName = (userOwner.isPresent() ? userOwner.get().getName() + ":" : "") + (isOwned ? owner + ":" : "") + name; if (fgObject.autoSave()) { Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving handler " + logName + " in directory: " + singleDir);
48,615
if (fgObject.autoSave()) { Path singleDir = dir.resolve(name.toLowerCase()); </BUG> boolean shouldSave = fgObject.shouldSave(); if (force || shouldSave) { <BUG>logger.info((shouldSave ? "S" : "Force s") + "aving world region \"" + name + "\" in directory: " + singleDir); </BUG> constructDirectory(singleDir); try { fgObject.save(singleDir);
Path singleDir = serverDir.resolve(name.toLowerCase()); logger.info((shouldSave ? "S" : "Force s") + "aving world region " + logName + " in directory: " + singleDir);
48,616
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,617
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,618
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,619
.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,620
Map<String, Object> _revisions = ClientTestUtils.getRevisionHistory(revision3, revision2, revision1); doc1.put(CouchConstants._rev, revision3); doc1.put(CouchConstants._revisions, _revisions); List<Response> responses = client.bulkCreateDocs(doc1); Assert.assertEquals(0, responses.size()); <BUG>Map<String, Object> allRevs = client.getDocRevisions(res1.getId(), revision3, JSONUtils.mapStringToObject()); </BUG> int revisionStart = (Integer) ((Map<String, Object>) allRevs.get(CouchConstants._revisions)).get (CouchConstants.start); Assert.assertEquals(3, revisionStart);
Map<String, Object> allRevs = client.getDocRevisions(res1.getId(), revision3, JSONUtils.STRING_MAP_TYPE_DEF);
48,621
Assert.assertEquals("world", doc.get("hello")); Assert.assertTrue(doc.containsKey(CouchConstants._id)); Assert.assertEquals(res.getId(), doc.get(CouchConstants._id)); Assert.assertTrue(doc.containsKey(CouchConstants._rev)); Assert.assertEquals(res.getRev(), doc.get(CouchConstants._rev)); <BUG>} @Test(expected = NoResourceException.class) public void getDocumentInputStream_idNotExist_exception() { client.getDocumentStream("id_not_exist", "1-no_such_rev");</BUG> }
[DELETED]
48,622
import com.cloudant.sync.internal.mazha.DocumentRevs; import com.cloudant.sync.internal.mazha.Response; <BUG>import com.cloudant.sync.internal.documentstore.InternalDocumentRevision; import com.cloudant.sync.internal.documentstore.DocumentRevsList; import com.cloudant.sync.internal.documentstore.MultipartAttachmentWriter; import com.cloudant.sync.documentstore.UnsavedStreamAttachment;</BUG> import com.cloudant.sync.replication.PullFilter; import java.util.Collection; import java.util.List; import java.util.Map;
[DELETED]
48,623
return executeResult; } finally { IOUtils.closeQuietly(errorStream); } } <BUG>private InputStream executeToInputStreamWithRetry(final Callable<ExecuteResult> task) throws CouchException { int attempts = 10; CouchException lastException= null; </BUG> while (attempts-- > 0) {
private <T> T executeWithRetry(final Callable<ExecuteResult> task, InputStreamProcessor<T> processor) throws CouchException lastException = null;
48,624
public boolean contains(String id) { Misc.checkNotNullOrEmpty(id, "id"); URI doc = this.uriHelper.documentUri(id); try { HttpConnection connection = Http.HEAD(doc); <BUG>this.executeToInputStreamWithRetry(connection); return true;</BUG> } catch (Exception e) { return false; }
this.executeWithRetry(connection, new NoOpInputStreamProcessor()); return true;
48,625
final URI doc = this.uriHelper.attachmentUri(id, queries, attachmentName); HttpConnection connection = Http.GET(doc); if (acceptGzip) { connection.requestProperties.put("Accept-Encoding", "gzip"); } <BUG>return executeToInputStreamWithRetry(connection); </BUG> } public void putAttachmentStream(String id, String rev, String attachmentName, String contentType, byte[] attachmentData) { Misc.checkNotNullOrEmpty(id, "id");
return executeWithRetry(connection, processor);
48,626
} else { options.put("attachments", false); options.put("att_encoding_info", true); } options.put("open_revs", JSONUtils.toJson(revisions)); <BUG>return this.getDocument(id, options, JSONUtils.openRevisionList()); }</BUG> public Iterable<DocumentRevsList> bulkReadDocsWithOpenRevisions(List<BulkGetRequest> request, boolean pullAttachmentsInline) { Map<String, Object> options = new HashMap<String, Object>();
return this.getDocument(id, options, JSONUtils.OPEN_REVS_LIST_TYPE_DEF);
48,627
Misc.checkNotNull(rev, "Revision ID"); Map<String, Object> queries = new HashMap<String, Object>(); queries.put("revs", "true"); queries.put("rev", rev); URI findRevs = this.uriHelper.documentUri(id, queries); <BUG>InputStream is = null; try { HttpConnection connection = Http.GET(findRevs); is = this.executeToInputStreamWithRetry(connection); return JSONUtils.fromJson(new InputStreamReader(is, Charset.forName("UTF-8")), type); } finally { closeQuietly(is); }</BUG> }
return executeToJsonObjectWithRetry(connection, type);
48,628
package com.cloudant.sync.internal.replication; import com.cloudant.http.HttpConnectionRequestInterceptor; import com.cloudant.http.HttpConnectionResponseInterceptor; <BUG>import com.cloudant.sync.internal.mazha.ChangesResult; import com.cloudant.sync.internal.mazha.CouchClient; import com.cloudant.sync.internal.mazha.DocumentRevs;</BUG> import com.cloudant.sync.documentstore.Attachment; import com.cloudant.sync.documentstore.Database;
[DELETED]
48,629
attachmentName); if (a != null) { continue; } } <BUG>UnsavedStreamAttachment usa = this.sourceDb .getAttachmentStream(documentRevs.getId(), documentRevs.getRev(), attachmentName, contentType, encoding); preparedAtts.put(attachmentName, this.targetDb.prepareAttachment(usa, length, encodedLength)); }</BUG> }
preparedAtts.put(attachmentName, this.sourceDb.pullAttachmentWithRetry (documentRevs.getId(), documentRevs.getRev(), entry .getKey(), new AttachmentPullProcessor(this .targetDb, entry.getKey(), contentType, encoding, length, encodedLength)));
48,630
import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.service.DispatchContext; <BUG>import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil;</BUG> import org.ofbiz.product.product.ProductContentWrapper; import org.w3c.dom.Document; import org.w3c.dom.Element;
import org.ofbiz.service.ModelService; import org.ofbiz.service.ServiceUtil;
48,631
if (UtilValidate.isEmpty(startPrice)) { GenericValue startPriceValue = EntityUtil.getFirst(EntityUtil.filterByDate(prod.getRelatedByAnd("ProductPrice", UtilMisc.toMap("productPricePurposeId", "EBAY", "productPriceTypeId", "MINIMUM_PRICE")))); if (UtilValidate.isNotEmpty(startPriceValue)) { startPrice = startPriceValue.getString("price"); startPriceCurrencyUomId = startPriceValue.getString("currencyUomId"); <BUG>} else { return ServiceUtil.returnFailure("Unable to find a starting price for auction of product with id [" + prod.getString("productId") + "]");</BUG> } } GenericValue buyItNowPriceValue = EntityUtil.getFirst(EntityUtil.filterByDate(prod.getRelatedByAnd("ProductPrice", UtilMisc.toMap("productPricePurposeId", "EBAY", "productPriceTypeId", "MAXIMUM_PRICE"))));
[DELETED]
48,632
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,633
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,634
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,635
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,636
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,637
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,638
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,639
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,640
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,641
} 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,642
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,643
@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,644
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,645
final String vcsUrl = vcsRoot.getUrl(); final MyRootFilter rootFilter = myOtherVcsFolders.get(vcsUrl); if ((rootFilter != null) && (! rootFilter.accept(file))) { return false; } <BUG>final Boolean excluded = isExcluded(myExcludedFileIndex, file); if (excluded) return false; return true;</BUG> }
return !isExcluded(myExcludedFileIndex, file);
48,646
import org.jitsi.impl.neomedia.device.*; import org.jitsi.service.resources.*; import org.osgi.framework.*; public class AudioDeviceConfigurationListener extends AbstractDeviceConfigurationListener <BUG>{ public AudioDeviceConfigurationListener(</BUG> ConfigurationForm configurationForm) { super(configurationForm);
private CaptureDeviceInfo captureDevice = null; private CaptureDeviceInfo playbackDevice = null; private CaptureDeviceInfo notificationDevice = null; public AudioDeviceConfigurationListener(
48,647
ResourceManagementService resources = NeomediaActivator.getResources(); notificationService.fireNotification( popUpEvent, title, <BUG>device.getName() + "\r\n" </BUG> + resources.getI18NString( "impl.media.configform"
body + "\r\n\r\n"
48,648
import com.intellij.codeInsight.daemon.DaemonCodeAnalyzerSettings; import com.intellij.codeInsight.daemon.HighlightDisplayKey; import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction; import com.intellij.codeInsight.daemon.impl.analysis.HighlightUtil; import com.intellij.codeInsight.intention.IntentionAction; <BUG>import com.intellij.codeInspection.InspectionManager; import com.intellij.codeInspection.LocalInspectionTool; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.codeInspection.ProblemHighlightType;</BUG> import com.intellij.codeInspection.ex.InspectionManagerEx;
import com.intellij.codeInspection.*;
48,649
options.add(new AddNoInspectionDocTagAction(tool, psiElement)); options.add(new AddNoInspectionForClassAction(tool, psiElement)); options.add(new AddSuppressWarningsAnnotationAction(tool, psiElement)); options.add(new AddSuppressWarningsAnnotationForClassAction(tool, psiElement)); options.add(new AddSuppressWarningsAnnotationForAllAction(psiElement)); <BUG>if (problemDescriptor.getFixes() != null) { for (int k = 0; k < problemDescriptor.getFixes().length; k++) {</BUG> QuickFixAction.registerQuickFixAction(highlightInfo, new QuickFixWrapper(problemDescriptor, k), options); } } else {
final LocalQuickFix[] fixes = problemDescriptor.getFixes(); if (fixes != null && fixes.length > 0) { for (int k = 0; k < problemDescriptor.getFixes().length; k++) {
48,650
options.add(new AddNoInspectionForClassAction(tool, psiElement)); options.add(new AddNoInspectionAllForClassAction(psiElement)); options.add(new AddSuppressWarningsAnnotationAction(tool, psiElement)); options.add(new AddSuppressWarningsAnnotationForClassAction(tool, psiElement)); options.add(new AddSuppressWarningsAnnotationForAllAction(psiElement)); <BUG>if (descriptor.getFixes() != null) { for (int k = 0; k < descriptor.getFixes().length; k++) { </BUG> QuickFixAction.registerQuickFixAction(highlightInfo, new QuickFixWrapper(descriptor, k), options); }
final LocalQuickFix[] fixes = problemDescriptor.getFixes(); if (fixes != null && fixes.length > 0) { for (int k = 0; k < problemDescriptor.getFixes().length; k++) { QuickFixAction.registerQuickFixAction(highlightInfo, new QuickFixWrapper(problemDescriptor, k), options);
48,651
onTotal++; } } } double offPrior = MathUtils.binomialProbability(offIsGenotypic, offTotal, p2off[genotypeIndex]); <BUG>double onPrior = MathUtils.binomialProbability(onIsGenotypic, onTotal, p2on[genotypeIndex]); likelihoods[genotypeIndex] = Math.log10(offPrior) + Math.log10(onPrior); </BUG> } return likelihoods;
double logOffPrior = MathUtils.compareDoubles(offPrior, 0.0, 1e-10) == 0 ? Math.log10(Double.MIN_VALUE) : Math.log10(offPrior); double logOnPrior = MathUtils.compareDoubles(onPrior, 0.0, 1e-10) == 0 ? Math.log10(Double.MIN_VALUE) : Math.log10(onPrior); likelihoods[genotypeIndex] += logOffPrior + logOnPrior;
48,652
onTotal++; } } } double offPrior = MathUtils.binomialProbability(offIsGenotypic, offTotal, offNextBestBasePriors.get(genotypes[genotypeIndex])); <BUG>double onPrior = MathUtils.binomialProbability(onIsGenotypic, onTotal, onNextBestBasePriors.get(genotypes[genotypeIndex])); likelihoods[genotypeIndex] += Math.log10(offPrior) + Math.log10(onPrior); </BUG> } this.sort();
double logOffPrior = MathUtils.compareDoubles(offPrior, 0.0, 1e-10) == 0 ? Math.log10(Double.MIN_VALUE) : Math.log10(offPrior); double logOnPrior = MathUtils.compareDoubles(onPrior, 0.0, 1e-10) == 0 ? Math.log10(Double.MIN_VALUE) : Math.log10(onPrior); likelihoods[genotypeIndex] += logOffPrior + logOnPrior;
48,653
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() {
48,654
parent = null; } @SubscribeEvent public void onWorldRenderLast(RenderWorldLastEvent event) throws Throwable { Minecraft mc = Minecraft.getMinecraft(); <BUG>if (mc.thePlayer != null && mc.objectMouseOver != null && !mc.thePlayer.isSneaking()) { </BUG> if (currentMultiblock != null) { BlockPos anchorPos = anchor != null ? anchor : mc.objectMouseOver.getBlockPos(); Multiblock mb = currentMultiblock.getForIndex(0);
if (mc.player != null && mc.objectMouseOver != null && !mc.player.isSneaking()) {
48,655
</BUG> if (currentMultiblock != null) { BlockPos anchorPos = anchor != null ? anchor : mc.objectMouseOver.getBlockPos(); Multiblock mb = currentMultiblock.getForIndex(0); for (MultiblockComponent comp : mb.getComponents()) { <BUG>renderComponent(comp, anchorPos, event.getPartialTicks(), mc.thePlayer); </BUG> } } }
parent = null; @SubscribeEvent public void onWorldRenderLast(RenderWorldLastEvent event) throws Throwable { Minecraft mc = Minecraft.getMinecraft(); if (mc.player != null && mc.objectMouseOver != null && !mc.player.isSneaking()) { renderComponent(comp, anchorPos, event.getPartialTicks(), mc.player);
48,656
double dx = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks; double dy = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks; double dz = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks; BlockPos pos = anchor.add(comp.getRelativePosition()); Minecraft minecraft = Minecraft.getMinecraft(); <BUG>World world = player.worldObj; minecraft.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);</BUG> ForgeHooksClient.setRenderLayer(BlockRenderLayer.CUTOUT); GlStateManager.pushMatrix(); GlStateManager.translate(pos.getX() - dx, pos.getY() - dy, pos.getZ() - dz);
World world = player.world; minecraft.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
48,657
if (maxSize > minSize) { size += rnd.nextInt(maxSize - minSize + 1); } ItemStack result = item.copy(); <BUG>result.stackSize = size; return result;</BUG> } public ResourceLocation getLootTableList() {
result.func_190920_e(size); return result;
48,658
import reborncore.common.util.OreUtil; import reborncore.common.util.RebornPermissions; import reborncore.shields.RebornCoreShields; import reborncore.shields.json.ShieldJsonLoader; import java.io.IOException; <BUG>@Mod(modid = RebornCore.MOD_ID, name = RebornCore.MOD_NAME, version = RebornCore.MOD_VERSION, acceptedMinecraftVersions = "[1.10.2]", dependencies = "required-after:Forge@[12.18.2.2121,);") </BUG> public class RebornCore implements IModInfo { public static final String MOD_NAME = "RebornCore";
@Mod(modid = RebornCore.MOD_ID, name = RebornCore.MOD_NAME, version = RebornCore.MOD_VERSION, acceptedMinecraftVersions = "[1.11]", dependencies = "required-after:forge@[12.18.2.2121,);")
48,659
float factor = 0.05F; entityItem.motionX = rand.nextGaussian() * factor; entityItem.motionY = rand.nextGaussian() * factor + 0.2F; entityItem.motionZ = rand.nextGaussian() * factor; world.spawnEntityInWorld(entityItem); <BUG>itemStack.stackSize = 0; }</BUG> } @Override public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
itemStack.func_190920_e(0);
48,660
if (liquid != null) { int qty = tank.fill(null, liquid, true); if (qty != 0 && !entityplayer.capabilities.isCreativeMode) { <BUG>if (current.stackSize > 1) {</BUG> if (!entityplayer.inventory .addItemStackToInventory(FluidContainerRegistry.drainFluidContainer(current))) {
if (current.func_190916_E() > 1)
48,661
liquid = FluidContainerRegistry.getFluidForFilledItem(filled); if (liquid != null) { if (!entityplayer.capabilities.isCreativeMode) { <BUG>if (current.stackSize > 1) {</BUG> if (!entityplayer.inventory.addItemStackToInventory(filled)) { return false;
if (current.func_190916_E() > 1)
48,662
org.apache.jmeter.protocol.http.control.Header header = (org.apache.jmeter.protocol.http.control.Header) i.next().getObjectValue(); String n = header.getName(); if (! HEADER_CONTENT_LENGTH.equalsIgnoreCase(n)){ <BUG>String v = header.getValue(); request.addHeader(n, v); }</BUG> } }
if (HEADER_HOST.equalsIgnoreCase(n)) { int port = url.getPort(); if (port != -1) { if (port == url.getDefaultPort()) { port = -1; // no need to specify the port if it is the default
48,663
org.apache.jmeter.protocol.http.control.Header header = (org.apache.jmeter.protocol.http.control.Header) i.next().getObjectValue(); String n = header.getName(); if (! HEADER_CONTENT_LENGTH.equalsIgnoreCase(n)){ <BUG>String v = header.getValue(); method.addRequestHeader(n, v); }</BUG> } }
if (HEADER_HOST.equalsIgnoreCase(n)) { method.getParams().setVirtualHost(v); } else {
48,664
import com.amazonaws.services.s3.model.ObjectMetadata; import com.amazonaws.services.s3.model.PutObjectRequest; import com.amazonaws.services.s3.model.S3ObjectSummary; import com.amazonaws.services.s3.transfer.TransferManager; import com.amazonaws.services.s3.transfer.TransferManagerConfiguration; <BUG>import com.amazonaws.util.Base64; import org.apache.commons.codec.digest.DigestUtils;</BUG> import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.ByteArrayInputStream;
import com.google.common.base.Preconditions; import org.apache.commons.codec.digest.DigestUtils;
48,665
protected MovedInHierarchy(Code moveUp, Code moveDown) { this.moveUp = moveUp; this.moveDown = moveDown; } protected void doVisit(@Nullable JavaModelElement oldEl, @Nullable JavaModelElement newEl) { <BUG>if (oldEl == null || newEl == null) { return; } if (oldEl.isInherited() == newEl.isInherited()) { return; } if (!isBothAccessible(oldEl, newEl)) {</BUG> return;
[DELETED]
48,666
public EnumSet<Type> getInterest() { return EnumSet.of(Type.METHOD); } @Override protected void doVisitMethod(@Nullable JavaMethodElement oldMethod, @Nullable JavaMethodElement newMethod) { <BUG>if (oldMethod == null || newMethod == null) { return; } boolean onInterfaces = oldMethod.getParent().getDeclaringElement().getKind() == ElementKind.INTERFACE</BUG> && newMethod.getParent().getDeclaringElement().getKind() == ElementKind.INTERFACE;
if (!isBothAccessible(oldMethod, newMethod)) { assert oldMethod != null; assert newMethod != null; boolean onInterfaces = oldMethod.getParent().getDeclaringElement().getKind() == ElementKind.INTERFACE
48,667
public EnumSet<Type> getInterest() { return EnumSet.of(Type.FIELD); } @Override protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) { <BUG>if (!shouldCheck(oldField, newField)) { </BUG> return; } if (oldField.getDeclaringElement().getConstantValue() == null
if (!isBothAccessible(oldField, newField)) {
48,668
import org.revapi.java.spi.JavaAnnotationElement; public final class Removed extends CheckBase { @Override protected List<Difference> doVisitAnnotation(JavaAnnotationElement oldAnnotation, JavaAnnotationElement newAnnotation) { <BUG>if (oldAnnotation != null && newAnnotation == null) { return Collections.singletonList(</BUG> createDifference(Code.ANNOTATION_REMOVED, Code.attachmentsFor(oldAnnotation, null)) ); }
if (oldAnnotation != null && newAnnotation == null && isAccessible(oldAnnotation.getParent())) { return Collections.singletonList(
48,669
import org.revapi.java.spi.Util; public final class AttributeValueChanged extends CheckBase { @Override protected List<Difference> doVisitAnnotation(JavaAnnotationElement oldElement, JavaAnnotationElement newElement) { <BUG>if (oldElement == null || newElement == null) { return null;</BUG> } AnnotationMirror oldAnnotation = oldElement.getAnnotation(); AnnotationMirror newAnnotation = newElement.getAnnotation();
if (oldElement == null || newElement == null || !isAccessible(newElement.getParent())) { return null;
48,670
public EnumSet<Type> getInterest() { return EnumSet.of(Type.FIELD); } @Override protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) { <BUG>if (!shouldCheck(oldField, newField)) { </BUG> return; } String oldType = Util.toUniqueString(
if (!isBothAccessible(oldField, newField)) {
48,671
} @Override protected void doVisitClass(@Nullable JavaTypeElement oldType, @Nullable JavaTypeElement newType) { if (!isBothAccessible(oldType, newType)) { return; <BUG>} List<? extends TypeMirror> oldSuperTypes = getOldTypeEnvironment().getTypeUtils().directSupertypes(</BUG> oldType.getModelRepresentation()); List<? extends TypeMirror> newSuperTypes = getNewTypeEnvironment().getTypeUtils().directSupertypes( newType.getModelRepresentation());
assert oldType != null; assert newType != null; List<? extends TypeMirror> oldSuperTypes = getOldTypeEnvironment().getTypeUtils().directSupertypes(
48,672
public EnumSet<Type> getInterest() { return EnumSet.of(Type.FIELD); } @Override protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) { <BUG>if (!shouldCheck(oldField, newField)) { </BUG> return; } Object oldC = oldField.getDeclaringElement().getConstantValue();
if (!isBothAccessible(oldField, newField)) {
48,673
public EnumSet<Type> getInterest() { return EnumSet.of(Type.FIELD); } @Override protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) { <BUG>if (oldField == null || newField == null) { return;</BUG> } if (!SERIAL_VERSION_UID_FIELD_NAME.equals(oldField.getDeclaringElement().getSimpleName().toString())) { return;
if (oldField == null || newField == null || !isAccessible(newField.getParent())) {
48,674
public EnumSet<Type> getInterest() { return EnumSet.of(Type.CLASS); } @Override protected void doVisitClass(JavaTypeElement oldType, JavaTypeElement newType) { <BUG>if (oldType == null || newType == null || isBothPrivate(oldType, newType)) { return;</BUG> } List<? extends TypeMirror> newInterfaces = newType.getDeclaringElement().getInterfaces(); List<? extends TypeMirror> oldInterfaces = oldType.getDeclaringElement().getInterfaces();
if (!isBothAccessible(oldType, newType)) { return;
48,675
this.added = added; this.code = code; this.modifier = modifier; } protected final void doVisit(JavaModelElement oldElement, JavaModelElement newElement) { <BUG>if (oldElement == null || newElement == null) { return; } if (isBothPrivate(oldElement, newElement)) { </BUG> return;
if (!isBothAccessible(oldElement, newElement)) {
48,676
import org.revapi.java.spi.JavaAnnotationElement; public final class Added extends CheckBase { @Override protected List<Difference> doVisitAnnotation(JavaAnnotationElement oldAnnotation, JavaAnnotationElement newAnnotation) { <BUG>if (oldAnnotation == null && newAnnotation != null) { return Collections.singletonList(</BUG> createDifference(Code.ANNOTATION_ADDED, Code.attachmentsFor(null, newAnnotation)) ); }
if (oldAnnotation == null && newAnnotation != null && isAccessible(newAnnotation.getParent())) { return Collections.singletonList(
48,677
public EnumSet<Type> getInterest() { return EnumSet.of(Type.FIELD); } @Override protected void doVisitField(JavaFieldElement oldField, JavaFieldElement newField) { <BUG>if (!shouldCheck(oldField, newField)) { </BUG> return; } if (oldField.getDeclaringElement().getConstantValue() != null
if (!isBothAccessible(oldField, newField)) {
48,678
} @Override protected void doVisitClass(@Nullable JavaTypeElement oldType, @Nullable JavaTypeElement newType) { isEnumClass = newType != null && newType.getDeclaringElement().getKind() == ElementKind.ENUM; } <BUG>@Override protected boolean shouldCheck(JavaFieldElement oldField, JavaFieldElement newField) { return isEnumClass && super.shouldCheck(oldField, newField) </BUG> && oldField.getDeclaringElement().getKind() == ElementKind.ENUM_CONSTANT
private boolean shouldCheck(JavaFieldElement oldField, JavaFieldElement newField) { return isEnumClass && isBothAccessible(oldField, newField)
48,679
public EnumSet<Type> getInterest() { return EnumSet.of(Type.CLASS); } @Override protected void doVisitClass(JavaTypeElement oldType, JavaTypeElement newType) { <BUG>if (oldType == null || newType == null) { return;</BUG> } List<TypeMirror> newInterfaces = Util.getAllSuperInterfaces(getNewTypeEnvironment().getTypeUtils(), newType.getModelRepresentation());
if (!isBothAccessible(oldType, newType)) { return;
48,680
import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.locks.ReadWriteLock; <BUG>import java.util.concurrent.locks.ReentrantReadWriteLock; import org.apache.lucene.index.IndexWriter; import org.apache.lucene.index.LiveIndexWriterConfig; import org.apache.lucene.index.Term; import org.apache.lucene.search.IndexSearcher;</BUG> import org.apache.lucene.search.Query;
import org.apache.lucene.index.IndexReader; import org.apache.lucene.search.Collector; import org.apache.lucene.search.IndexSearcher;
48,681
writer.deleteDocuments(query); } public void release(IndexSearcher searcher) throws IOException { manager.release(searcher); } <BUG>public void addCacheEntry(BytesRef hash, QueryCacheEntry ce) { queries.put(hash, ce); } public LiveIndexWriterConfig getConfig() { return this.writer.getConfig(); }</BUG> public static class QueryCacheEntry {
[DELETED]
48,682
public QueryCacheEntry(BytesRef hash, Query matchQuery, Map<String, String> metadata) { this.hash = hash; this.matchQuery = matchQuery; this.metadata = metadata; } <BUG>} public static class SearcherAndQueries { public Map<BytesRef, QueryCacheEntry> queries; public IndexSearcher searcher; } } </BUG>
[DELETED]
48,683
return matcher.getMatches(); } public <T extends QueryMatch> Matches<T> match(InputDocument doc, MatcherFactory<T> factory) throws IOException { return match(DocumentBatch.of(doc), factory); } <BUG>private static IndexSearcher getSearcher(WriterAndCache wacRef, MonitorQueryCollector collector) throws IOException { final WriterAndCache.SearcherAndQueries saq = wacRef.getSearcher(); collector.setQueryMap(saq.queries); return saq.searcher; }</BUG> private <T extends QueryMatch> void match(CandidateMatcher<T> matcher) throws IOException {
[DELETED]
48,684
searcher = getSearcher(wac, collector); Query query = presearcher.buildQuery(matcher.getIndexReader(), termFilters.get(searcher.getIndexReader())); </BUG> buildTime = (System.nanoTime() - buildTime) / 1000000; <BUG>searcher.search(query, collector); } finally { wac.release(searcher);</BUG> }
return matcher.getMatches(); public <T extends QueryMatch> Matches<T> match(InputDocument doc, MatcherFactory<T> factory) throws IOException { return match(DocumentBatch.of(doc), factory); private <T extends QueryMatch> void match(CandidateMatcher<T> matcher) throws IOException { long buildTime = System.nanoTime(); MatchingCollector<T> collector = new MatchingCollector<>(matcher); try (final WriterAndCache.Searcher saq = wac.getSearcher(collector)) { Query query = presearcher.buildQuery(matcher.getIndexReader(), termFilters.get(saq.getIndexReader())); saq.search(query, collector);
48,685
finally { wac.release(searcher);</BUG> } matcher.finish(buildTime, collector.getQueryCount()); } <BUG>public static void match(WriterAndCache wacRef, Query query, MonitorQueryCollector collector) throws IOException { IndexSearcher searcher = null; try { searcher = getSearcher(wacRef, collector); searcher.search(query, collector); } finally { wacRef.release(searcher);</BUG> }
return matcher.getMatches(); public <T extends QueryMatch> Matches<T> match(InputDocument doc, MatcherFactory<T> factory) throws IOException { return match(DocumentBatch.of(doc), factory); private <T extends QueryMatch> void match(CandidateMatcher<T> matcher) throws IOException { long buildTime = System.nanoTime(); MatchingCollector<T> collector = new MatchingCollector<>(matcher); try (final WriterAndCache.Searcher saq = wac.getSearcher(collector)) { Query query = presearcher.buildQuery(matcher.getIndexReader(), termFilters.get(saq.getIndexReader())); buildTime = (System.nanoTime() - buildTime) / 1000000; saq.search(query, collector);
48,686
catch (Exception e) { matcher.reportError(new MatchError(queryId, e)); } } } <BUG>public static abstract class MonitorQueryCollector extends SimpleCollector { </BUG> protected BinaryDocValues hashDV; protected SortedDocValues idDV; protected BinaryDocValues mqDV;
public static abstract class MonitorQueryCollector extends SimpleCollector implements WriterAndCache.WithQueryMap {
48,687
private LocalBroadcastManager mLocalBroadcastManager; private String mActiveDownloadUrlString; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <BUG>setContentView(R.layout.activity_app_details2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</BUG> toolbar.setTitle(""); // Nice and clean toolbar setSupportActionBar(toolbar); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
setContentView(R.layout.app_details2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
48,688
.inflate(R.layout.app_details2_screenshots, parent, false); return new ScreenShotsViewHolder(view); } else if (viewType == VIEWTYPE_WHATS_NEW) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.app_details2_whatsnew, parent, false); <BUG>return new WhatsNewViewHolder(view); } else if (viewType == VIEWTYPE_LINKS) {</BUG> View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.app_details2_links, parent, false); return new ExpandableLinearLayoutViewHolder(view);
} else if (viewType == VIEWTYPE_DONATE) { .inflate(R.layout.app_details2_donate, parent, false); return new DonateViewHolder(view); } else if (viewType == VIEWTYPE_LINKS) {
48,689
import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.util.GroupTestUtil; import com.liferay.portal.util.PortalUtil; import com.liferay.portal.util.UserTestUtil; import com.liferay.portlet.asset.model.AssetEntry; <BUG>import com.liferay.portlet.asset.service.AssetEntryLocalServiceUtil; import com.liferay.portlet.social.util.SocialActivityTestUtil;</BUG> import com.liferay.portlet.social.util.SocialConfigurationUtil; import java.io.InputStream; import org.junit.After;
import com.liferay.portlet.social.util.SocialActivityHierarchyThreadLocal; import com.liferay.portlet.social.util.SocialActivityTestUtil;
48,690
package com.liferay.portlet.social.service; import com.liferay.portal.kernel.test.ExecutionTestListeners; import com.liferay.portal.test.EnvironmentExecutionTestListener; <BUG>import com.liferay.portal.test.LiferayIntegrationJUnitTestRunner; import com.liferay.portal.test.TransactionalExecutionTestListener; </BUG> import com.liferay.portlet.social.model.SocialActivityCounter; import com.liferay.portlet.social.model.SocialActivityCounterConstants;
import com.liferay.portal.test.Sync; import com.liferay.portal.test.SynchronousDestinationExecutionTestListener;
48,691
import org.junit.Test; import org.junit.runner.RunWith; @ExecutionTestListeners( listeners = { EnvironmentExecutionTestListener.class, <BUG>TransactionalExecutionTestListener.class }) @RunWith(LiferayIntegrationJUnitTestRunner.class) public class SocialActivityCounterLocalServiceTest</BUG> extends BaseSocialActivityTestCase {
SynchronousDestinationExecutionTestListener.class @Sync public class SocialActivityCounterLocalServiceTest
48,692
<BUG>package com.liferay.portlet.social.util; import com.liferay.portal.model.Group; import com.liferay.portal.model.User; import com.liferay.portal.util.PortalUtil;</BUG> import com.liferay.portlet.asset.model.AssetEntry;
import com.liferay.portal.kernel.json.JSONFactoryUtil; import com.liferay.portal.kernel.json.JSONObject; import com.liferay.portal.kernel.util.StringPool; import com.liferay.portal.service.ServiceTestUtil; import com.liferay.portal.util.PortalUtil;
48,693
if (name.equals(SocialActivityCounterConstants.NAME_CONTRIBUTION)) { ownerType = SocialActivityCounterConstants.TYPE_CREATOR; } return SocialActivityCounterLocalServiceUtil.fetchLatestActivityCounter( <BUG>groupId, classNameId, classPk, name, ownerType); </BUG> } public static SocialActivityLimit getActivityLimit( long groupId, User user, AssetEntry assetEntry, int activityType,
groupId, classNameId, classPK, name, ownerType);
48,694
import org.jitsi.impl.neomedia.device.*; import org.jitsi.service.resources.*; import org.osgi.framework.*; public class AudioDeviceConfigurationListener extends AbstractDeviceConfigurationListener <BUG>{ public AudioDeviceConfigurationListener(</BUG> ConfigurationForm configurationForm) { super(configurationForm);
private CaptureDeviceInfo captureDevice = null; private CaptureDeviceInfo playbackDevice = null; private CaptureDeviceInfo notificationDevice = null; public AudioDeviceConfigurationListener(
48,695
ResourceManagementService resources = NeomediaActivator.getResources(); notificationService.fireNotification( popUpEvent, title, <BUG>device.getName() + "\r\n" </BUG> + resources.getI18NString( "impl.media.configform"
body + "\r\n\r\n"
48,696
public boolean canChoose(UUID sourceControllerId, Game game) { int count = 0; for (StackObject stackObject: game.getStack()) { if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { count++; <BUG>if (count >= this.minNumberOfTargets) return true; }</BUG> }
if (count >= this.minNumberOfTargets) {
48,697
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { return possibleTargets(sourceControllerId, game); } @Override public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) { <BUG>Set<UUID> possibleTargets = new HashSet<UUID>(); for (StackObject stackObject: game.getStack()) {</BUG> if (game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getControllerId()) && filter.match(stackObject, game)) { possibleTargets.add(stackObject.getId()); }
Set<UUID> possibleTargets = new HashSet<>(); for (StackObject stackObject: game.getStack()) {
48,698
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) { return possibleTargets(sourceControllerId, game); } @Override public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) { <BUG>Set<UUID> possibleTargets = new HashSet<UUID>(); for (StackObject stackObject : game.getStack()) {</BUG> if (stackObject.getStackAbility() != null && (stackObject.getStackAbility() instanceof ActivatedAbility || stackObject.getStackAbility() instanceof TriggeredAbility) && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) { possibleTargets.add(stackObject.getStackAbility().getId()); }
Set<UUID> possibleTargets = new HashSet<>(); for (StackObject stackObject : game.getStack()) {
48,699
import mage.filter.FilterCard; import mage.game.Game; import mage.players.Player; import java.util.HashSet; import java.util.Set; <BUG>import java.util.UUID; public class TargetCard extends TargetObject {</BUG> protected FilterCard filter; protected TargetCard(Zone zone) { this(1, 1, zone, new FilterCard());
import mage.game.events.GameEvent; public class TargetCard extends TargetObject {
48,700
@Override public FilterCard getFilter() { return this.filter; } @Override <BUG>public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) { for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {</BUG> Player player = game.getPlayer(playerId); if (player != null) { switch (zone) {
int possibleTargets = 0; for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {