id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
45,301 | rollupCappedDatabases.add(new CappedDatabase(file, sizeKb, ticker));
}
this.rollupCappedDatabases = ImmutableList.copyOf(rollupCappedDatabases);
traceCappedDatabase = new CappedDatabase(new File(dataDir, "trace-detail.capped.db"),
storageConfig.traceCappedDatabaseSizeMb() * 1024, ticker);
<BUG>agentDao = new AgentDao(dataSource);
</BUG>
transactionTypeDao = new TransactionTypeDao(dataSource);
rollupLevelService = new RollupLevelService(configRepository, clock);
FullQueryTextDao fullQueryTextDao = new FullQueryTextDao(dataSource);
| environmentDao = new EnvironmentDao(dataSource);
|
45,302 | traceDao = new TraceDao(dataSource, traceCappedDatabase, transactionTypeDao,
fullQueryTextDao, traceAttributeNameDao);
GaugeNameDao gaugeNameDao = new GaugeNameDao(dataSource);
gaugeValueDao = new GaugeValueDao(dataSource, gaugeNameDao, clock);
repoAdmin = new RepoAdminImpl(dataSource, rollupCappedDatabases, traceCappedDatabase,
<BUG>configRepository, agentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
</BUG>
fullQueryTextDao, traceAttributeNameDao);
if (backgroundExecutor == null) {
reaperRunnable = null;
| configRepository, environmentDao, gaugeValueDao, gaugeNameDao, transactionTypeDao,
|
45,303 | new TraceCappedDatabaseStats(traceCappedDatabase),
"org.glowroot:type=TraceCappedDatabase");
platformMBeanServerLifecycle.lazyRegisterMBean(new H2DatabaseStats(dataSource),
"org.glowroot:type=H2Database");
}
<BUG>public AgentDao getAgentDao() {
return agentDao;
</BUG>
}
public TransactionTypeRepository getTransactionTypeRepository() {
| public EnvironmentDao getEnvironmentDao() {
return environmentDao;
|
45,304 | package org.glowroot.agent.embedded.init;
import java.io.Closeable;
import java.io.File;
<BUG>import java.lang.instrument.Instrumentation;
import java.util.Map;</BUG>
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
| import java.util.List;
import java.util.Map;
|
45,305 | import java.util.concurrent.ScheduledExecutorService;
import javax.annotation.Nullable;
import com.google.common.base.MoreObjects;
import com.google.common.base.Stopwatch;
import com.google.common.base.Supplier;
<BUG>import com.google.common.base.Ticker;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;</BUG>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.glowroot.agent.collector.Collector.AgentConfigUpdater;
| import com.google.common.collect.ImmutableList;
import org.checkerframework.checker.nullness.qual.MonotonicNonNull;
|
45,306 | import org.glowroot.agent.init.EnvironmentCreator;
import org.glowroot.agent.init.GlowrootThinAgentInit;
import org.glowroot.agent.init.JRebelWorkaround;
import org.glowroot.agent.util.LazyPlatformMBeanServer;
import org.glowroot.common.live.LiveAggregateRepository.LiveAggregateRepositoryNop;
<BUG>import org.glowroot.common.live.LiveTraceRepository.LiveTraceRepositoryNop;
import org.glowroot.common.repo.ConfigRepository;
import org.glowroot.common.util.Clock;</BUG>
import org.glowroot.common.util.OnlyUsedByTests;
import org.glowroot.ui.CreateUiModuleBuilder;
| import org.glowroot.common.repo.AgentRepository;
import org.glowroot.common.repo.ImmutableAgentRollup;
import org.glowroot.common.util.Clock;
|
45,307 | SimpleRepoModule simpleRepoModule = new SimpleRepoModule(dataSource,
dataDir, clock, ticker, configRepository, backgroundExecutor);
simpleRepoModule.registerMBeans(new PlatformMBeanServerLifecycleImpl(
agentModule.getLazyPlatformMBeanServer()));
CollectorImpl collectorImpl = new CollectorImpl(
<BUG>simpleRepoModule.getAgentDao(), simpleRepoModule.getAggregateDao(),
simpleRepoModule.getTraceDao(),</BUG>
simpleRepoModule.getGaugeValueDao());
collectorProxy.setInstance(collectorImpl);
collectorImpl.init(baseDir, EnvironmentCreator.create(glowrootVersion),
| simpleRepoModule.getEnvironmentDao(),
simpleRepoModule.getTraceDao(),
|
45,308 | .baseDir(baseDir)
.glowrootDir(glowrootDir)
.ticker(ticker)
.clock(clock)
.liveJvmService(agentModule.getLiveJvmService())
<BUG>.configRepository(simpleRepoModule.getConfigRepository())
.agentRepository(simpleRepoModule.getAgentDao())
</BUG>
.transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository())
.traceAttributeNameRepository(
| .agentRepository(new AgentRepositoryImpl())
.environmentRepository(simpleRepoModule.getEnvironmentDao())
|
45,309 | .baseDir(baseDir)
.glowrootDir(glowrootDir)
.ticker(ticker)
.clock(clock)
.liveJvmService(null)
<BUG>.configRepository(simpleRepoModule.getConfigRepository())
.agentRepository(simpleRepoModule.getAgentDao())
</BUG>
.transactionTypeRepository(simpleRepoModule.getTransactionTypeRepository())
.traceAttributeNameRepository(
| .liveJvmService(agentModule.getLiveJvmService())
.agentRepository(new AgentRepositoryImpl())
.environmentRepository(simpleRepoModule.getEnvironmentDao())
|
45,310 | }
@Override
public void lazyRegisterMBean(Object object, String name) {
lazyPlatformMBeanServer.lazyRegisterMBean(object, name);
}
<BUG>}
}
</BUG>
| void initEmbeddedServer() throws Exception {
if (simpleRepoModule == null) {
return;
|
45,311 | List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs());
for (GaugeConfig loopConfig : configs) {
if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) {
throw new DuplicateMBeanObjectNameException();
}
<BUG>}
String version = Versions.getVersion(gaugeConfig);
for (GaugeConfig loopConfig : configs) {
if (Versions.getVersion(loopConfig.toProto()).equals(version)) {
throw new IllegalStateException("This exact gauge already exists");
}
}
configs.add(GaugeConfig.create(gaugeConfig));</BUG>
configService.updateGaugeConfigs(configs);
| [DELETED] |
45,312 | configService.updateGaugeConfigs(configs);
}
}
@Override
public void updateGaugeConfig(String agentId, AgentConfig.GaugeConfig gaugeConfig,
<BUG>String priorVersion) throws Exception {
synchronized (writeLock) {</BUG>
List<GaugeConfig> configs = Lists.newArrayList(configService.getGaugeConfigs());
boolean found = false;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
| GaugeConfig config = GaugeConfig.create(gaugeConfig);
synchronized (writeLock) {
|
45,313 | boolean found = false;
for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(priorVersion)) {
<BUG>i.set(GaugeConfig.create(gaugeConfig));
found = true;
break;</BUG>
} else if (loopConfig.mbeanObjectName().equals(gaugeConfig.getMbeanObjectName())) {
throw new DuplicateMBeanObjectNameException();
| i.set(config);
|
45,314 | boolean found = false;
for (ListIterator<PluginConfig> i = configs.listIterator(); i.hasNext();) {
PluginConfig loopPluginConfig = i.next();
if (pluginId.equals(loopPluginConfig.id())) {
String loopVersion = Versions.getVersion(loopPluginConfig.toProto());
<BUG>checkVersionsEqual(loopVersion, priorVersion);
PluginDescriptor pluginDescriptor = getPluginDescriptor(pluginId);
i.set(PluginConfig.create(pluginDescriptor, properties));</BUG>
found = true;
break;
| for (ListIterator<GaugeConfig> i = configs.listIterator(); i.hasNext();) {
GaugeConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(version)) {
i.remove();
|
45,315 | boolean found = false;
for (ListIterator<InstrumentationConfig> i = configs.listIterator(); i.hasNext();) {
InstrumentationConfig loopConfig = i.next();
String loopVersion = Versions.getVersion(loopConfig.toProto());
if (loopVersion.equals(priorVersion)) {
<BUG>i.set(InstrumentationConfig.create(instrumentationConfig));
found = true;
break;
}</BUG>
}
| i.set(config);
} else if (loopConfig.equals(config)) {
throw new IllegalStateException("This exact instrumentation already exists");
|
45,316 | package org.glowroot.agent.embedded.init;
import java.io.File;
import java.util.List;
import org.glowroot.agent.collector.Collector;
<BUG>import org.glowroot.agent.embedded.repo.AgentDao;
import org.glowroot.agent.embedded.repo.AggregateDao;
import org.glowroot.agent.embedded.repo.GaugeValueDao;</BUG>
import org.glowroot.agent.embedded.repo.TraceDao;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
| import org.glowroot.agent.embedded.repo.EnvironmentDao;
import org.glowroot.agent.embedded.repo.GaugeValueDao;
|
45,317 | </BUG>
private final AggregateDao aggregateDao;
private final TraceDao traceDao;
private final GaugeValueDao gaugeValueDao;
<BUG>CollectorImpl(AgentDao agentDao, AggregateDao aggregateRepository, TraceDao traceRepository,
GaugeValueDao gaugeValueRepository) {
this.agentDao = agentDao;</BUG>
this.aggregateDao = aggregateRepository;
this.traceDao = traceRepository;
| import org.glowroot.wire.api.model.CollectorServiceOuterClass.Environment;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.GaugeValue;
import org.glowroot.wire.api.model.CollectorServiceOuterClass.LogEvent;
import org.glowroot.wire.api.model.TraceOuterClass.Trace;
class CollectorImpl implements Collector {
private final EnvironmentDao agentDao;
CollectorImpl(EnvironmentDao agentDao, AggregateDao aggregateRepository,
TraceDao traceRepository, GaugeValueDao gaugeValueRepository) {
this.agentDao = agentDao;
|
45,318 | "for example `100M size` for " +
"limiting logical log space on disk to 100Mb," +
" or `200k txs` for limiting the number of transactions to keep to 200 000", matches( ANY ) ) );
public static final Setting<String> lock_manager = setting( "lock_manager", Settings.STRING, "" );
public static final Setting<Boolean> deferred_locking =
<BUG>setting( "deferred_locking", Settings.BOOLEAN, Settings.FALSE );
</BUG>
public static final Setting<String> tracer =
setting( "dbms.tracer", Settings.STRING, (String) null ); // 'null' default.
public static final Setting<String> editionName = setting( "edition", Settings.STRING, "Community" );
| setting( "deferred_locking", Settings.BOOLEAN, Settings.TRUE );
|
45,319 | this.resourceId = resourceId;
}
@Override
public boolean equals( Object o )
{
<BUG>if ( this == o )
{ return true; }
if ( o == null || getClass() != o.getClass() )
{ return false; }
Resource resource = (Resource) o;
if ( resourceId != resource.resourceId )
{ return false; }
return resourceType.equals( resource.resourceType );</BUG>
}
| return true;
return false;
|
45,320 | exclusive.remove( new Resource( resourceType, resourceId ) );
}
@Override
public void releaseAll()
{
<BUG>throw new UnsupportedOperationException();
</BUG>
}
@Override
public void prepare()
| throw new UnsupportedOperationException( "Should not be needed" );
|
45,321 | import com.intellij.psi.impl.PsiElementBase;
import com.intellij.psi.impl.source.SourceTreeToPsiMap;
import com.intellij.psi.impl.source.tree.TreeElement;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.PsiTreeUtil;
<BUG>import com.intellij.psi.util.PsiUtilCore;
import com.intellij.util.IncorrectOperationException;</BUG>
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
| import com.intellij.util.ArrayUtil;
import com.intellij.util.IncorrectOperationException;
|
45,322 | public int getTextLength() {
String text = getText();
return text == null ? 0 : text.length();
}
@Override
<BUG>public PsiElement findElementAt(int offset) {
PsiElement mirrorAt = getMirror().findElementAt(offset);
</BUG>
while (true) {
if (mirrorAt == null) return null;
| PsiElement mirror = getMirror();
if (mirror == null) return null;
PsiElement mirrorAt = mirror.findElementAt(offset);
|
45,323 | if (elementAt != null) return elementAt;
mirrorAt = mirrorAt.getParent();
}
}
@Override
<BUG>public PsiReference findReferenceAt(int offset) {
PsiReference mirrorRef = getMirror().findReferenceAt(offset);
</BUG>
if (mirrorRef == null) return null;
PsiElement mirrorElement = mirrorRef.getElement();
| PsiElement mirror = getMirror();
if (mirror == null) return null;
PsiReference mirrorRef = mirror.findReferenceAt(offset);
|
45,324 | return buffer.toString();
}
@Override
@NotNull
public char[] textToCharArray() {
<BUG>return getMirror().textToCharArray();
}</BUG>
@Override
public boolean textMatches(@NotNull CharSequence text) {
return getText().equals(text.toString());
| PsiElement mirror = getMirror();
return mirror != null ? mirror.textToCharArray() : ArrayUtil.EMPTY_CHAR_ARRAY;
|
45,325 | if (FaweCache.hasData(id)) {
return (id << 4) + block.getMetaFromState(ibd);
} else {
return id << 4;
}
<BUG>}
@Override
public boolean isChunkLoaded(World world, int x, int z) {
return world.getChunkProvider().getLoadedChunk(x, z) != null;</BUG>
}
| [DELETED] |
45,326 | fieldSection.setAccessible(true);
fieldSection.set(section, palette);
}
@Override
public void sendChunk(int x, int z, int bitMask) {
<BUG>if (!isChunkLoaded(x, z)) {
return;
}
sendChunk(getChunk(getImpWorld(), x, z), bitMask);</BUG>
}
| [DELETED] |
45,327 | if (FaweCache.hasData(id)) {
return (id << 4) + block.getMetaFromState(ibd);
} else {
return id << 4;
}
<BUG>}
@Override
public boolean isChunkLoaded(World world, int x, int z) {
return world.getChunkProvider().getLoadedChunk(x, z) != null;</BUG>
}
| [DELETED] |
45,328 | fieldSection.setAccessible(true);
fieldSection.set(section, palette);
}
@Override
public void sendChunk(int x, int z, int bitMask) {
<BUG>if (!isChunkLoaded(x, z)) {
return;
}
sendChunk(getChunk(getImpWorld(), x, z), bitMask);</BUG>
}
| [DELETED] |
45,329 | public PdfTextStyle(String config) {
Assert.hasText(config);
String[] split = config.split(",");
Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");
fontSize = Integer.parseInt(split[0]);
<BUG>font = resolveStandard14Name(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG>
}
public int getFontSize() {
return fontSize;
| font = getFont(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));
|
45,330 | }
public void attachView(@NonNull V view) {
this.view = view;
onViewAttached(view);
}
<BUG>public void detachView() {
onViewDetached();
this.view = null;</BUG>
}
public V getView() {
| this.view = null;
|
45,331 | public final class PresenterLoader<P extends BasePresenter> extends Loader<P> {
@NonNull
private final PresenterFactory<P> factory;
@Nullable
private P presenter;
<BUG>public PresenterLoader(@NonNull Context context, @NonNull PresenterFactory<P> factory) {
</BUG>
super(context);
this.factory = factory;
}
| protected PresenterLoader(@NonNull Context context, @NonNull PresenterFactory<P> factory) {
|
45,332 | import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.Loader;
<BUG>import android.support.v7.app.AppCompatActivity;
import io.blackbox_vision.mvphelpers.logic.factory.PresenterFactory;</BUG>
import io.blackbox_vision.mvphelpers.logic.presenter.BasePresenter;
import io.blackbox_vision.mvphelpers.logic.view.BaseView;
import io.blackbox_vision.mvphelpers.ui.loader.PresenterLoader;
| import android.util.Log;
import io.blackbox_vision.mvphelpers.logic.factory.PresenterFactory;
|
45,333 | import android.os.Bundle;
import android.support.annotation.LayoutRes;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
<BUG>import android.support.v4.content.Loader;
import android.view.LayoutInflater;</BUG>
import android.view.View;
import android.view.ViewGroup;
import io.blackbox_vision.mvphelpers.logic.factory.PresenterFactory;
| import android.util.Log;
import android.view.LayoutInflater;
|
45,334 | import io.blackbox_vision.mvphelpers.logic.factory.PresenterFactory;
import io.blackbox_vision.mvphelpers.logic.presenter.BasePresenter;
import io.blackbox_vision.mvphelpers.logic.view.BaseView;
import io.blackbox_vision.mvphelpers.ui.loader.PresenterLoader;
import static android.support.v4.app.LoaderManager.LoaderCallbacks;
<BUG>public abstract class BaseFragment<P extends BasePresenter<V>, V extends BaseView> extends Fragment
implements LoaderCallbacks<P> {
private static final int LOADER_ID = 201;</BUG>
protected P presenter;
| public abstract class BaseFragment<P extends BasePresenter<V>, V extends BaseView> extends Fragment implements LoaderCallbacks<P> {
private static final String TAG = BaseFragment.class.getSimpleName();
private static final int LOADER_ID = 201;
|
45,335 | package org.dontpanic.spanners.users.data;
<BUG>import javax.persistence.Entity;
import javax.persistence.Id;
</BUG>
@Entity
public class User {
| import javax.persistence.*;
|
45,336 | public DocumentFile getDocumentFile(String docId, File file)
throws FileNotFoundException {
DocumentFile documentFile = null;
if(docId.startsWith(ROOT_ID_SECONDARY)){
String newDocId = docId.substring(ROOT_ID_SECONDARY.length());
<BUG>Uri uri = getRootId(newDocId);
</BUG>
if(null == uri){
return DocumentFile.fromFile(file);
}
| Uri uri = getRootUri(newDocId);
|
45,337 | return treeUri;
}
List<UriPermission> permissions = mContext.getContentResolver().getPersistedUriPermissions();
for (UriPermission permission :
permissions) {
<BUG>String treeRootId = getRootId(permission.getUri());
</BUG>
if(docId.startsWith(treeRootId)){
treeUri = permission.getUri();
secondaryRoots.put(tag, treeUri);
| String treeRootId = getRootUri(permission.getUri());
|
45,338 | if(data != null && data.getData() != null) {
Uri uri = data.getData();
if (Utils.hasKitKat()) {
activity.getContentResolver().takePersistableUriPermission(uri,
Intent.FLAG_GRANT_READ_URI_PERMISSION | Intent.FLAG_GRANT_WRITE_URI_PERMISSION);
<BUG>RootsCache.updateRoots(activity, ExternalStorageProvider.AUTHORITY);
}
return true;</BUG>
}
}
| String rootId = ExternalStorageProvider.ROOT_ID_SECONDARY + getRootUri(uri);
ExternalStorageProvider.notifyDocumentsChanged(activity, rootId);
return true;
|
45,339 | throw new IllegalStateException("Failed to touch " + file);
}
} catch (Exception e) {
throw new IllegalStateException("Failed to touch " + file + ": " + e);
}
<BUG>}
return getDocIdForRootFile(new RootFile(path, displayName));</BUG>
}
@Override
public String renameDocument(String documentId, String displayName) throws FileNotFoundException {
| notifyDocumentsChanged(docId);
return getDocIdForRootFile(new RootFile(path, displayName));
|
45,340 | final RootFile after = new RootFile(before.getParent(), displayName);
if(!RootCommands.renameRootTarget(before, after)){
throw new IllegalStateException("Failed to rename " + before);
}
final String afterDocId = getDocIdForRootFile(new RootFile(after.getParent(), displayName));
<BUG>if (!TextUtils.equals(documentId, afterDocId)) {
return afterDocId;</BUG>
} else {
return null;
}
| notifyDocumentsChanged(documentId);
return afterDocId;
|
45,341 | final RootFile before = getRootFileForDocId(sourceDocumentId);
final RootFile after = getRootFileForDocId(targetParentDocumentId);
if (!RootCommands.moveCopyRoot(before.getPath(), after.getPath())) {
throw new IllegalStateException("Failed to copy " + before);
}
<BUG>return getDocIdForRootFile(after);
}</BUG>
@Override
public String moveDocument(String sourceDocumentId, String sourceParentDocumentId, String targetParentDocumentId) throws FileNotFoundException {
final RootFile before = getRootFileForDocId(sourceDocumentId);
| final String afterDocId = getDocIdForRootFile(after);
notifyDocumentsChanged(afterDocId);
return afterDocId;
|
45,342 | final RootFile after = new RootFile(getRootFileForDocId(targetParentDocumentId).getPath(), before.getName());
if(!RootCommands.renameRootTarget(before, after)){
throw new IllegalStateException("Failed to rename " + before);
}
final String afterDocId = getDocIdForRootFile(after);
<BUG>if (!TextUtils.equals(sourceDocumentId, afterDocId)) {
return afterDocId;</BUG>
} else {
return null;
}
| notifyDocumentsChanged(afterDocId);
return afterDocId;
|
45,343 | import static dev.dworks.apps.anexplorer.model.DocumentsContract.getRootId;
import static dev.dworks.apps.anexplorer.model.DocumentsContract.getSearchDocumentsQuery;
import static dev.dworks.apps.anexplorer.model.DocumentsContract.getTreeDocumentId;
import static dev.dworks.apps.anexplorer.model.DocumentsContract.isTreeUri;
public abstract class DocumentsProvider extends ContentProvider {
<BUG>private static final String TAG = "DocumentsProvider";
private static final int MATCH_ROOTS = 1;</BUG>
private static final int MATCH_ROOT = 2;
private static final int MATCH_RECENT = 3;
private static final int MATCH_SEARCH = 4;
| public static final String DIRECTORY_SEPERATOR = "/";
public static final String ROOT_SEPERATOR = ":";
private static final int MATCH_ROOTS = 1;
|
45,344 | final File file = getFileForDocId(docId);
DocumentFile documentFile = getDocumentFile(docId, file);
if (!documentFile.delete()) {
throw new IllegalStateException("Failed to delete " + file);
}
<BUG>FileUtils.removeMediaStore(getContext(), file);
}</BUG>
@Override
public String renameDocument(String docId, String displayName) throws FileNotFoundException {
displayName = FileUtils.buildValidFatFilename(displayName);
| notifyDocumentsChanged(docId);
|
45,345 | final File before = getFileForDocId(sourceDocumentId);
final File after = getFileForDocId(targetParentDocumentId);
if (!FileUtils.moveFile(before, after, null)) {
throw new IllegalStateException("Failed to copy " + before);
}
<BUG>return getDocIdForFile(after);
}</BUG>
@Override
public String moveDocument(String sourceDocumentId, String sourceParentDocumentId,
String targetParentDocumentId)
| final String afterDocId = getDocIdForFile(after);
notifyDocumentsChanged(afterDocId);
return afterDocId;
|
45,346 | if (after.exists()) {
throw new IllegalStateException("Already exists " + after);
}
if (!before.renameTo(after)) {
throw new IllegalStateException("Failed to move to " + after);
<BUG>} else {
FileUtils.updateMediaStore(getContext(), before.getPath());</BUG>
}
return getDocIdForFile(after);
}
| notifyDocumentsChanged(targetParentDocumentId);
FileUtils.updateMediaStore(getContext(), before.getPath());
|
45,347 | for (String documentId : documentIds){
files.add(getFileForDocId(documentId));
}
if (!FileUtils.compressFile(fileFrom, files)) {
throw new IllegalStateException("Failed to extract " + fileFrom);
<BUG>}
return getDocIdForFile(fileFrom);</BUG>
}
@Override
public String uncompressDocument(String documentId) throws FileNotFoundException {
| notifyDocumentsChanged(parentDocumentId);
return getDocIdForFile(fileFrom);
|
45,348 | import dev.dworks.apps.anexplorer.model.DocumentsContract.Document;
import dev.dworks.apps.anexplorer.model.DocumentsContract.Root;
@SuppressLint("DefaultLocale")
public class AppsProvider extends DocumentsProvider {
public static final String AUTHORITY = BuildConfig.APPLICATION_ID + ".apps.documents";
<BUG>public static final String ROOT_ID_APP = "apps";
public static final String ROOT_ID_PROCESS = "process";
</BUG>
private static final String[] DEFAULT_ROOT_PROJECTION = new String[] {
| public static final String ROOT_ID_APP = "apps:";
public static final String ROOT_ID_PROCESS = "process:";
|
45,349 | return result;
}
@Override
public Cursor querySearchDocuments(String rootId, String query, String[] projection) throws FileNotFoundException {
final MatrixCursor result = new MatrixCursor(resolveDocumentProjection(projection));
<BUG>if (ROOT_ID_APP.equals(rootId)) {
List<PackageInfo> allAppList = packageManager.getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES);</BUG>
for (PackageInfo packageInfo : allAppList) {
includeAppFromPackage(result, rootId, packageInfo, query.toLowerCase());
}
| if(rootId.startsWith(ROOT_ID_APP)) {
List<PackageInfo> allAppList = packageManager.getInstalledPackages(PackageManager.GET_UNINSTALLED_PACKAGES);
|
45,350 | return appInfo.flags != 0
&& ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0
|| (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0);
}
public static String getDocIdForApp(String rootId, String packageName){
<BUG>return rootId + ":" + packageName;
}</BUG>
public static String getPackageForDocId(String docId){
final int splitIndex = docId.indexOf(':', 1);
final String packageName = docId.substring(splitIndex + 1);
| return rootId + packageName;
|
45,351 | }</BUG>
public static String getPackageForDocId(String docId){
final int splitIndex = docId.indexOf(':', 1);
final String packageName = docId.substring(splitIndex + 1);
return packageName;
<BUG>}
public static String getRootIdForDocId(String docId){
final int splitIndex = docId.indexOf(':', 1);
final String tag = docId.substring(0, splitIndex);
return tag;</BUG>
}
| return appInfo.flags != 0
&& ((appInfo.flags & ApplicationInfo.FLAG_UPDATED_SYSTEM_APP) != 0
|| (appInfo.flags & ApplicationInfo.FLAG_SYSTEM) == 0);
public static String getDocIdForApp(String rootId, String packageName){
return rootId + packageName;
|
45,352 | 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;
|
45,353 | 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());
|
45,354 | 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);
|
45,355 | 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);
|
45,356 | 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);
|
45,357 | 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;
|
45,358 | 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);
|
45,359 | 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);
|
45,360 | 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;
|
45,361 | }
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);
|
45,362 | 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);
|
45,363 | @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);
|
45,364 | 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);
|
45,365 | import org.jetbrains.android.compiler.tools.AndroidDxRunner;
import org.jetbrains.android.util.AndroidCommonUtils;
import org.jetbrains.android.util.AndroidCompilerMessageKind;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
<BUG>import org.jetbrains.jps.ProjectPaths;
import org.jetbrains.jps.android.builder.AndroidBuildTarget;
</BUG>
import org.jetbrains.jps.android.model.JpsAndroidDexCompilerConfiguration;
import org.jetbrains.jps.android.model.JpsAndroidExtensionService;
| import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.android.builder.AndroidDexBuildTarget;
|
45,366 | import org.jetbrains.jps.android.model.JpsAndroidModuleExtension;
import org.jetbrains.jps.android.model.JpsAndroidSdkProperties;
import org.jetbrains.jps.builders.BuildOutputConsumer;
import org.jetbrains.jps.builders.BuildRootDescriptor;
import org.jetbrains.jps.builders.DirtyFilesHolder;
<BUG>import org.jetbrains.jps.builders.java.JavaModuleBuildTargetType;
import org.jetbrains.jps.cmdline.ClasspathBootstrap;
import org.jetbrains.jps.incremental.*;
</BUG>
import org.jetbrains.jps.incremental.messages.BuildMessage;
| import org.jetbrains.jps.builders.FileProcessor;
import org.jetbrains.jps.incremental.CompileContext;
import org.jetbrains.jps.incremental.ExternalProcessUtil;
import org.jetbrains.jps.incremental.ProjectBuildException;
import org.jetbrains.jps.incremental.TargetBuilder;
|
45,367 | </BUG>
if (dexOutputDir == null) {
return false;
}
<BUG>final File classesDir = projectPaths.getModuleOutputDir(module, false);
if (classesDir == null || !classesDir.isDirectory()) {
context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.INFO, AndroidJpsBundle
.message("android.jps.warnings.dex.no.compiled.files", module.getName())));
return true;
}
final Set<String> externalLibraries = AndroidJpsUtil.getExternalLibraries(context, module, platform);</BUG>
final ProGuardOptions proGuardOptions = AndroidJpsUtil.getProGuardConfigIfShouldRun(context, extension);
| if (platform == null) {
File dexOutputDir = AndroidJpsUtil.getDirectoryForIntermediateArtifacts(context, module);
dexOutputDir = AndroidJpsUtil.createDirIfNotExist(dexOutputDir, context, DEX_BUILDER_NAME);
|
45,368 | int i = 0;
for (String filePath : fileSet) {
files[i++] = FileUtil.toSystemDependentName(filePath);
}
context.processMessage(new ProgressMessage(AndroidJpsBundle.message("android.jps.progress.dex", module.getName())));
<BUG>if (!runDex(platform, dexOutputDir.getPath(), files, context, module)) {
dexStateStorage.update(module.getName(), null);
return false;</BUG>
}
| success = runDex(platform, dexOutputDir.getPath(), files, context, module);
|
45,369 | @SuppressWarnings("deprecation")
final String dxJarPath = FileUtil.toSystemDependentName(platform.getTarget().getPath(IAndroidTarget.DX_JAR));
final File dxJar = new File(dxJarPath);
if (!dxJar.isFile()) {
context.processMessage(
<BUG>new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.ERROR, AndroidJpsBundle.message("android.jps.cannot.find.file", dxJarPath)));
</BUG>
return false;
}
final String outFilePath = outputDir + File.separatorChar + AndroidCommonUtils.CLASSES_FILE_NAME;
| new CompilerMessage(DEX_BUILDER_NAME, BuildMessage.Kind.ERROR, AndroidJpsBundle.message("android.jps.cannot.find.file", dxJarPath)));
|
45,370 | final List<String> classPath = new ArrayList<String>();
classPath.add(ClasspathBootstrap.getResourcePath(AndroidDxRunner.class));
classPath.add(ClasspathBootstrap.getResourcePath(FileUtilRt.class));
final File outFile = new File(outFilePath);
if (outFile.exists() && !outFile.delete()) {
<BUG>context.processMessage(new CompilerMessage(BUILDER_NAME, BuildMessage.Kind.WARNING,
</BUG>
AndroidJpsBundle.message("android.jps.cannot.delete.file", outFilePath)));
}
final JpsSdk<JpsSimpleElement<JpsAndroidSdkProperties>> sdk = platform.getSdk();
| context.processMessage(new CompilerMessage(DEX_BUILDER_NAME, BuildMessage.Kind.WARNING,
|
45,371 | context.processMessage(new ProgressMessage(AndroidJpsBundle.message("android.jps.progress.proguard", module.getName())));
final Map<AndroidCompilerMessageKind, List<String>> messages =
AndroidCommonUtils.launchProguard(platform.getTarget(), platform.getSdkToolsRevision(), platform.getSdk().getHomePath(),
proguardCfgPaths, includeSystemProguardCfg, inputJarOsPath, externalJarOsPaths,
outputJarPath, logsDirOsPath);
<BUG>AndroidJpsUtil.addMessages(context, messages, BUILDER_NAME, module.getName());
final boolean success = messages.get(AndroidCompilerMessageKind.ERROR).isEmpty();
proguardStateStorage.update(module.getName(), success ? newState : null);
if (success) {
final Timestamps timestamps = context.getProjectDescriptor().timestamps.getStorage();
for (File file : proguardCfgFiles) {
timestamps.saveStamp(file, new ModuleBuildTarget(module, JavaModuleBuildTargetType.PRODUCTION), file.lastModified());</BUG>
}
| AndroidJpsUtil.addMessages(context, messages, PRO_GUARD_BUILDER_NAME, module.getName());
return messages.get(AndroidCompilerMessageKind.ERROR).isEmpty()
? Pair.create(true, newState) : null;
|
45,372 | package org.jetbrains.jps.android;
import com.intellij.openapi.util.io.FileUtil;
import org.jetbrains.android.util.AndroidCommonUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
<BUG>import org.jetbrains.jps.android.builder.AndroidBuildTarget;
</BUG>
import org.jetbrains.jps.android.model.JpsAndroidModuleExtension;
import org.jetbrains.jps.android.model.impl.JpsAndroidFinalPackageElement;
import org.jetbrains.jps.builders.BuildTarget;
| import org.jetbrains.jps.android.builder.AndroidPackagingBuildTarget;
|
45,373 | import org.jetbrains.jps.model.java.impl.JpsJavaDependenciesEnumerationHandler;
import org.jetbrains.jps.model.library.JpsLibrary;
import org.jetbrains.jps.model.library.JpsLibraryRoot;
import org.jetbrains.jps.model.library.JpsOrderRootType;
import org.jetbrains.jps.model.library.sdk.JpsSdk;
<BUG>import org.jetbrains.jps.model.module.*;
import java.io.*;</BUG>
import java.util.*;
import java.util.regex.Matcher;
public class AndroidJpsUtil {
| import org.jetbrains.jps.model.serialization.JpsModelSerializationDataService;
import org.jetbrains.jps.util.JpsPathUtil;
import java.io.*;
|
45,374 | final boolean recursive = shouldProcessDependenciesRecursively(module);
processClasspath(context, module, processor, new HashSet<String>(), false, recursive);
</BUG>
}
<BUG>private static void processClasspath(@NotNull CompileContext context,
</BUG>
@NotNull final JpsModule module,
@NotNull final AndroidDependencyProcessor processor,
@NotNull final Set<String> visitedModules,
final boolean exportedLibrariesOnly,
| processClasspath(paths, module, processor, new HashSet<String>(), false, recursive);
private static void processClasspath(@NotNull BuildDataPaths paths,
|
45,375 | }
}
}
else if (processor.isToProcess(AndroidDependencyType.JAVA_MODULE_OUTPUT_DIR) &&
depExtension == null &&
<BUG>depClassDir != null &&
depClassDir.isDirectory()) {</BUG>
processor.processJavaModuleOutputDirectory(depClassDir);
}
| if (processor.isToProcess(AndroidDependencyType.ANDROID_LIBRARY_OUTPUT_DIRECTORY)) {
if (depClassDir != null) {
processor.processAndroidLibraryOutputDirectory(depClassDir);
depClassDir != null) {
|
45,376 |
depClassDir.isDirectory()) {</BUG>
processor.processJavaModuleOutputDirectory(depClassDir);
}
if (recursive) {
<BUG>processClasspath(context, depModule, processor, visitedModules, !depLibrary || exportedLibrariesOnly, recursive);
</BUG>
}
}
}
| if (processor.isToProcess(AndroidDependencyType.ANDROID_LIBRARY_OUTPUT_DIRECTORY)) {
if (depClassDir != null) {
processor.processAndroidLibraryOutputDirectory(depClassDir);
else if (processor.isToProcess(AndroidDependencyType.JAVA_MODULE_OUTPUT_DIR) &&
depExtension == null &&
depClassDir != null) {
processClasspath(paths, depModule, processor, visitedModules, !depLibrary || exportedLibrariesOnly, recursive);
|
45,377 | context.processMessage(new CompilerMessage(builderName, BuildMessage.Kind.ERROR,
AndroidJpsBundle.message("android.jps.errors.sdk.not.specified", module.getName())));
return null;</BUG>
}
final IAndroidTarget target = parseAndroidTarget(sdk, context, builderName);
<BUG>if (target == null) {
context.processMessage(new CompilerMessage(builderName, BuildMessage.Kind.ERROR,
AndroidJpsBundle.message("android.jps.errors.sdk.invalid", module.getName())));
return null;</BUG>
}
| return null;
if (context != null) {
return null;
|
45,378 | package org.jetbrains.jps.android;
import org.jetbrains.annotations.NotNull;
<BUG>import org.jetbrains.jps.android.builder.AndroidBuildTarget;
import org.jetbrains.jps.builders.BuildTargetType;</BUG>
import org.jetbrains.jps.incremental.BuilderService;
import org.jetbrains.jps.incremental.ModuleLevelBuilder;
| import org.jetbrains.jps.android.builder.AndroidDexBuildTarget;
import org.jetbrains.jps.android.builder.AndroidPackagingBuildTarget;
import org.jetbrains.jps.builders.BuildTargetType;
|
45,379 | import java.util.Arrays;
import java.util.List;
public class AndroidBuilderService extends BuilderService {
@Override
public List<? extends BuildTargetType<?>> getTargetTypes() {
<BUG>return Arrays.asList(AndroidBuildTarget.TargetType.DEX, AndroidBuildTarget.TargetType.PACKAGING);
}</BUG>
@NotNull
@Override
public List<? extends ModuleLevelBuilder> createModuleLevelBuilders() {
| return Arrays.<BuildTargetType<?>>asList(
AndroidDexBuildTarget.MyTargetType.INSTANCE,
AndroidPackagingBuildTarget.MyTargetType.INSTANCE);
}
|
45,380 | import org.jetbrains.android.util.AndroidNativeLibData;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.jps.ProjectPaths;
<BUG>import org.jetbrains.jps.android.builder.AndroidBuildTarget;
</BUG>
import org.jetbrains.jps.android.model.JpsAndroidModuleExtension;
import org.jetbrains.jps.builders.BuildOutputConsumer;
import org.jetbrains.jps.builders.BuildRootDescriptor;
| import org.jetbrains.jps.android.builder.AndroidPackagingBuildTarget;
|
45,381 | import org.jetbrains.jps.model.module.JpsModule;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.*;
<BUG>public class AndroidPackagingBuilder extends TargetBuilder<BuildRootDescriptor, AndroidBuildTarget> {
</BUG>
@NonNls private static final String BUILDER_NAME = "Android Packager";
@NonNls private static final String RELEASE_SUFFIX = ".release";
@NonNls private static final String UNSIGNED_SUFFIX = ".unsigned";
| public class AndroidPackagingBuilder extends TargetBuilder<BuildRootDescriptor, AndroidPackagingBuildTarget> {
|
45,382 | </BUG>
@NonNls private static final String BUILDER_NAME = "Android Packager";
@NonNls private static final String RELEASE_SUFFIX = ".release";
@NonNls private static final String UNSIGNED_SUFFIX = ".unsigned";
public AndroidPackagingBuilder() {
<BUG>super(Collections.singletonList(AndroidBuildTarget.TargetType.PACKAGING));
</BUG>
}
@NotNull
@Override
| import org.jetbrains.jps.model.module.JpsModule;
import java.io.File;
import java.io.FileFilter;
import java.io.IOException;
import java.util.*;
public class AndroidPackagingBuilder extends TargetBuilder<BuildRootDescriptor, AndroidPackagingBuildTarget> {
super(Collections.singletonList(AndroidPackagingBuildTarget.MyTargetType.INSTANCE));
|
45,383 | @Override
public String getPresentableName() {
return BUILDER_NAME;
}
@Override
<BUG>public void build(@NotNull AndroidBuildTarget target,
@NotNull DirtyFilesHolder<BuildRootDescriptor, AndroidBuildTarget> holder,
</BUG>
@NotNull BuildOutputConsumer outputConsumer,
| public void build(@NotNull AndroidPackagingBuildTarget target,
@NotNull DirtyFilesHolder<BuildRootDescriptor, AndroidPackagingBuildTarget> holder,
|
45,384 | public String welcome(Model model) {
model.addAttribute("info",infoSer.getInfo());
return "index";
}
@GetMapping("/login")
<BUG>public String login(HttpServletRequest request, Model model) {
String result = request.getParameter("result");</BUG>
if (result != null && result.equals("fail")) {
model.addAttribute("success", 0);
}
| model.addAttribute("avatar", infoSer.getInfo().getAvatar());
String result = request.getParameter("result");
|
45,385 | import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
<BUG>import org.springframework.cache.annotation.EnableCaching;
import org.springframework.transaction.annotation.EnableTransactionManagement;
@SpringBootApplication
@EnableTransactionManagement// 开启注解事务管理,等同于xml配置文件中的<tx:annotation-driven/></BUG>
@EnableCaching
| @SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
|
45,386 | import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
<BUG>import org.springframework.test.context.ContextConfiguration;
import org.springframework.transaction.PlatformTransactionManager;</BUG>
@Documented
@Inherited
@Retention(RetentionPolicy.RUNTIME)
| [DELETED] |
45,387 | import java.util.List;
import java.util.Map;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.BeansException;
<BUG>import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils;
import org.springframework.core.annotation.AnnotationUtils;</BUG>
import org.springframework.test.annotation.NotTransactional;
import org.springframework.test.annotation.Rollback;
| import org.springframework.beans.factory.BeanFactoryUtils;
import org.springframework.beans.factory.ListableBeanFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.core.annotation.AnnotationUtils;
|
45,388 | Throwable afterTransactionException = null;
List<Method> methods = getAnnotatedMethods(testContext.getTestClass(), AfterTransaction.class);
for (Method method : methods) {
try {
if (logger.isDebugEnabled()) {
<BUG>logger.debug("Executing @AfterTransaction method [" + method + "] for test context [" + testContext
+ "]");</BUG>
}
method.invoke(testContext.getTestInstance());
| logger.debug("Executing @AfterTransaction method [" + method + "] for test context " + testContext);
|
45,389 | Throwable targetException = ex.getTargetException();
if (afterTransactionException == null) {
afterTransactionException = targetException;
}
logger.error("Exception encountered while executing @AfterTransaction method [" + method
<BUG>+ "] for test context [" + testContext + "]", targetException);
}</BUG>
catch (Exception ex) {
if (afterTransactionException == null) {
afterTransactionException = ex;
| + "] for test context " + testContext, targetException);
|
45,390 | catch (Exception ex) {
if (afterTransactionException == null) {
afterTransactionException = ex;
}
logger.error("Exception encountered while executing @AfterTransaction method [" + method
<BUG>+ "] for test context [" + testContext + "]", ex);
}</BUG>
}
if (afterTransactionException != null) {
ReflectionUtils.rethrowException(afterTransactionException);
| + "] for test context " + testContext, ex);
|
45,391 | Rollback rollbackAnnotation = testContext.getTestMethod().getAnnotation(Rollback.class);
if (rollbackAnnotation != null) {
boolean rollbackOverride = rollbackAnnotation.value();
if (logger.isDebugEnabled()) {
logger.debug("Method-level @Rollback(" + rollbackOverride + ") overrides default rollback [" + rollback
<BUG>+ "] for test context [" + testContext + "]");
}</BUG>
rollback = rollbackOverride;
}
else {
| + "] for test context " + testContext);
|
45,392 | rollback = rollbackOverride;
}
else {
if (logger.isDebugEnabled()) {
logger.debug("No method-level @Rollback override: using default rollback [" + rollback
<BUG>+ "] for test context [" + testContext + "]");
}</BUG>
}
return rollback;
}
| + "] for test context " + testContext);
|
45,393 | if (config != null) {
transactionManagerName = config.transactionManager();
defaultRollback = config.defaultRollback();
}
else {
<BUG>transactionManagerName = (String) AnnotationUtils.getDefaultValue(annotationType, "transactionManager");
defaultRollback = (Boolean) AnnotationUtils.getDefaultValue(annotationType, "defaultRollback");
}</BUG>
TransactionConfigurationAttributes configAttributes = new TransactionConfigurationAttributes(
transactionManagerName, defaultRollback);
| transactionManagerName = DEFAULT_TRANSACTION_MANAGER_NAME;
defaultRollback = DEFAULT_DEFAULT_ROLLBACK;
|
45,394 | 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 {
|
45,395 | 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 {
|
45,396 | import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
<BUG>import com.google.common.collect.Iterables;
public class ByonLocationResolverTest {
private static final Logger log = LoggerFactory.getLogger(ByonLocationResolverTest.class);</BUG>
private BrooklynProperties brooklynProperties;
private LocalManagementContext managementContext;
| public class
private static final Logger log = LoggerFactory.getLogger(ByonLocationResolverTest.class);
|
45,397 | ImmutableSet.of(new UserHostTuple("myuser", "1.1.1.1"), new UserHostTuple("bob", "1.1.1.1")));
}
@Test
public void testResolvesUserArg2() throws Exception {
String spec = "byon(hosts=\"1.1.1.1\",user=bob)";
<BUG>FixedListMachineProvisioningLocation<SshMachineLocation> ll = resolve(spec);
SshMachineLocation l = ll.obtain();
</BUG>
Assert.assertEquals("bob", l.getUser());
}
| FixedListMachineProvisioningLocation<MachineLocation> ll = resolve(spec);
SshMachineLocation l = (SshMachineLocation)ll.obtain();
|
45,398 | package brooklyn.location.basic;
import java.net.InetAddress;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
<BUG>import org.slf4j.LoggerFactory;
import brooklyn.location.Location;
import brooklyn.location.LocationSpec;
import brooklyn.management.internal.LocalLocationManager;</BUG>
import brooklyn.util.JavaGroovyEquivalents;
| import brooklyn.config.ConfigKey;
import brooklyn.entity.basic.ConfigKeys;
import brooklyn.location.MachineLocation;
import brooklyn.management.internal.LocalLocationManager;
|
45,399 | throw new IllegalArgumentException("Invalid location '"+spec+"'; at least one host must be defined");
}
if (hostAddresses.isEmpty()) {
throw new IllegalArgumentException("Invalid location '"+spec+"'; at least one host must be defined");
}
<BUG>List<SshMachineLocation> machines = Lists.newArrayList();
for (String host : hostAddresses) {</BUG>
String userHere = user;
String hostHere = host;
if (host.contains("@")) {
| List<MachineLocation> machines = Lists.newArrayList();
for (String host : hostAddresses) {
|
45,400 | try {
InetAddress.getByName(hostHere.trim());
} catch (Exception e) {
throw new IllegalArgumentException("Invalid host '"+hostHere+"' specified in '"+spec+"': "+e);
}
<BUG>LocationSpec<SshMachineLocation> locationSpec = LocationSpec.create(SshMachineLocation.class)
</BUG>
.configure("address", hostHere.trim())
.configureIfNotNull(LocalLocationManager.CREATE_UNMANAGED, config.get(LocalLocationManager.CREATE_UNMANAGED));
if (JavaGroovyEquivalents.groovyTruth(userHere)) {
| LocationSpec<? extends MachineLocation> locationSpec = LocationSpec.create(locationClass)
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.