id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
14,001 | Weaver currentWeaver = weaverService.getCurrentWeaver();
WaitJoin waitJoin = waitJoinService.get(lecture.getName(), weaver);
if(lecture != null //μμ²μκ° μͺ½μ§λ₯Ό 보λ΄κ³ κ΄λ¦¬μκ° μΉμΈμ νλ κ²½μ°
&& waitJoinService.isOkJoin(waitJoin, lecture.getCreatorName(), currentWeaver)
&& lecture.getCreatorName().equals(currentWeaver.getId())
<BUG>&& waitJoinService.deleteLectureWaitJoin(waitJoin, lecture, currentWeaver)){
Post post = new Post(currentWeaver, //κ΄λ¦¬μκ° κ°μ
μμκ² λ³΄λ΄λ λ©μΈμ§</BUG>
"κ΄λ¦¬μ "+lecture.getCreatorName()+"λμ κ°μλͺ
:"+
lectureName+
"μ κ°μ
μ΄ κ±°μ λμμ΅λλ€.",
| && waitJoinService.deleteWaitJoin(waitJoin, lecture, currentWeaver)){
Post post = new Post(currentWeaver, //κ΄λ¦¬μκ° κ°μ
μμκ² λ³΄λ΄λ λ©μΈμ§
|
14,002 | postService.add(post,null);
return "redirect:/lecture/"+lectureName+"/weaver";
}else if(lecture != null //κ΄λ¦¬μκ° μͺ½μ§λ₯Ό 보λ΄κ³ κ°μ
μκ° κ±°μ νλ κ²½μ°
&& waitJoinService.isOkJoin(waitJoin, lecture.getCreatorName(), currentWeaver)
&& !lecture.getCreatorName().equals(currentWeaver.getId())
<BUG>&& waitJoinService.deleteLectureWaitJoin(waitJoin, lecture, currentWeaver)){
Post post = new Post(currentWeaver, //κ°μ
μκ° κ΄λ¦¬μμκ² λ³΄λ΄λ λ©μΈμ§</BUG>
currentWeaver.getId()+"λμ΄ κ°μλͺ
:"+
"<a href='/lecture/"+lectureName+"'>"+
lectureName+
| && waitJoinService.deleteWaitJoin(waitJoin, lecture, currentWeaver)){
Post post = new Post(currentWeaver, //κ°μ
μκ° κ΄λ¦¬μμκ² λ³΄λ΄λ λ©μΈμ§
|
14,003 | @PathVariable("creatorName") String creatorName,
@PathVariable("weaver") String weaver) {
Project project = projectService.get(creatorName+"/"+projectName);
Weaver waitingWeaver = weaverService.get(weaver);
Weaver proposer = weaverService.getCurrentWeaver();
<BUG>if(waitJoinService.isCreateProjectWaitJoin(project, waitingWeaver, proposer)){
Weaver projectCreator = weaverService.get(project.getCreatorName());</BUG>
String title ="νλ‘μ νΈλͺ
:"+creatorName+"/"+projectName+"μ κ°μ
μ΄λλ₯Ό </a><a href='/project/"+creatorName+"/"+projectName+"/weaver/"+weaver+"/join-ok'>μΉλ½νμκ² μ΅λκΉ?</a> "
+ "μλλ©΄ <a href='/project/"+creatorName+"/"+projectName+"/weaver/"+weaver+"/join-cancel'>κ±°μ νμκ² μ΅λκΉ?</a><a>";
Post post = new Post(projectCreator,
| if(waitJoinService.isCreateWaitJoin(project, waitingWeaver, proposer)){
Weaver projectCreator = weaverService.get(project.getCreatorName());
|
14,004 | @RequestMapping("/{creatorName}/{projectName}/join") //λ³ΈμΈμ΄ μ§μ μ μ²
public String join( @PathVariable("projectName") String projectName,
@PathVariable("creatorName") String creatorName) {
Project project = projectService.get(creatorName+"/"+projectName);
Weaver waitingWeaver = weaverService.getCurrentWeaver();
<BUG>if(waitJoinService.isCreateProjectWaitJoin(project, waitingWeaver, waitingWeaver)){
String title = waitingWeaver.getId()+"λμ΄ νλ‘μ νΈλͺ
:"+creatorName+"/"+projectName+"μ κ°μ
μ μ²μ </a><a href='/project/"+creatorName+"/"+projectName+"/weaver/"+waitingWeaver.getId()+"/join-ok'>μΉλ½νμκ² μ΅λκΉ?</a> "</BUG>
+ "μλλ©΄ <a href='/project/"+creatorName+"/"+projectName+"/weaver/"+waitingWeaver.getId()+"/join-cancel'>κ±°μ νμκ² μ΅λκΉ?</a><a>";
Post post = new Post(waitingWeaver,
title,
| if(waitJoinService.isCreateWaitJoin(project, waitingWeaver, waitingWeaver)){
String title = waitingWeaver.getId()+"λμ΄ νλ‘μ νΈλͺ
:"+creatorName+"/"+projectName+"μ κ°μ
μ μ²μ </a><a href='/project/"+creatorName+"/"+projectName+"/weaver/"+waitingWeaver.getId()+"/join-ok'>μΉλ½νμκ² μ΅λκΉ?</a> "
|
14,005 | postService.add(post,null);
return "redirect:/project/"+creatorName+"/"+projectName+"/weaver";
}else if(project != null //κ΄λ¦¬μκ° μͺ½μ§λ₯Ό 보λ΄κ³ κ°μ
μκ° μΉμΈμ νλ κ²½μ°
&& waitJoinService.isOkJoin(waitJoin, project.getCreatorName(), currentWeaver)
&& !project.getCreatorName().equals(currentWeaver.getId())
<BUG>&& waitJoinService.deleteProjectWaitJoin(waitJoin, project, currentWeaver)){
project.addJoinWeaver(currentWeaver); //νλ‘μ νΈ λͺ©λ‘μ μΆκ°</BUG>
currentWeaver.addPass(pass);
weaverService.update(currentWeaver);
projectService.update(project);
| && waitJoinService.deleteWaitJoin(waitJoin, project, currentWeaver)){
project.addJoinWeaver(currentWeaver); //νλ‘μ νΈ λͺ©λ‘μ μΆκ°
|
14,006 | </BUG>
}
return "redirect:/";//μλ±ν μ¬λμ΄ λ€μ΄μ¬λ κ·Έλ₯ λλ €λ³΄λ
}
<BUG>@RequestMapping("/{creatorName}/projectName}/weaver/{weaver}/join-cancel") //νλ‘μ νΈμ κ°μ
μΉμΈ μ·¨μ
</BUG>
public String joinCancel(@PathVariable("projectName") String projectName,
@PathVariable("creatorName") String creatorName,@PathVariable("weaver") String weaver) {
Project project = projectService.get(creatorName+"/"+projectName);
Weaver currentWeaver = weaverService.getCurrentWeaver();
| currentWeaver.getId()+"λμ΄ νλ‘μ νΈλͺ
:"+creatorName+"/"+projectName+
"λ₯Ό κ°μ
μ΄λλ₯Ό μλ½νμ
¨μ΅λλ€!",
"",
tagService.stringToTagList("@"+project.getName()+",κ°μ
")); //@νλ‘μ νΈλͺ
,κ°μ
νκ·Έλ₯Ό κ±Έμ΄μ€
postService.add(post,null);
return "redirect:/project/"+creatorName+"/"+projectName+"/weaver";
@RequestMapping("/{creatorName}/{projectName}/weaver/{weaver}/join-cancel") // νλ‘μ νΈ κ°μ
μΉμΈ
|
14,007 | Weaver currentWeaver = weaverService.getCurrentWeaver();
WaitJoin waitJoin = waitJoinService.get(project.getName(), weaver);
if(project != null //μμ²μκ° μͺ½μ§λ₯Ό 보λ΄κ³ κ΄λ¦¬μκ° μΉμΈμ νλ κ²½μ°
&& waitJoinService.isOkJoin(waitJoin, project.getCreatorName(), currentWeaver)
&& project.getCreatorName().equals(currentWeaver.getId())
<BUG>&& waitJoinService.deleteProjectWaitJoin(waitJoin, project, currentWeaver)){
Post post = new Post(currentWeaver, //κ΄λ¦¬μκ° κ°μ
μμκ² λ³΄λ΄λ λ©μΈμ§</BUG>
"κ΄λ¦¬μ "+project.getCreatorName()+"λμ νλ‘μ νΈλͺ
:"+
creatorName+"/"+projectName+
"μ κ°μ
μ΄ κ±°μ λμμ΅λλ€.",
| && waitJoinService.deleteWaitJoin(waitJoin, project, currentWeaver)){
Post post = new Post(currentWeaver, //κ΄λ¦¬μκ° κ°μ
μμκ² λ³΄λ΄λ λ©μΈμ§
|
14,008 | postService.add(post,null);
return "redirect:/project/"+creatorName+"/"+projectName+"/weaver";
}else if(project != null //κ΄λ¦¬μκ° μͺ½μ§λ₯Ό 보λ΄κ³ κ°μ
μκ° κ±°μ νλ κ²½μ°
&& waitJoinService.isOkJoin(waitJoin, project.getCreatorName(), currentWeaver)
&& !project.getCreatorName().equals(currentWeaver.getId())
<BUG>&& waitJoinService.deleteProjectWaitJoin(waitJoin, project, currentWeaver)){
Post post = new Post(currentWeaver, //κ°μ
μκ° κ΄λ¦¬μμκ² λ³΄λ΄λ λ©μΈμ§</BUG>
currentWeaver.getId()+"λμ΄ νλ‘μ νΈλͺ
:"+creatorName+"/"+projectName+
"λ₯Ό κ°μ
μ΄λλ₯Ό κ±°μ νμ
¨μ΅λλ€.",
"",
| && waitJoinService.deleteWaitJoin(waitJoin, project, currentWeaver)){
Post post = new Post(currentWeaver, //κ°μ
μκ° κ΄λ¦¬μμκ² λ³΄λ΄λ λ©μΈμ§
|
14,009 | currentWeaver.getId()+"λμ΄ νλ‘μ νΈλͺ
:"+creatorName+"/"+projectName+
"λ₯Ό κ°μ
μ΄λλ₯Ό κ±°μ νμ
¨μ΅λλ€.",
"",
tagService.stringToTagList("$"+project.getCreatorName()));
postService.add(post,null);
<BUG>return "redirect:/project/"+creatorName+"/"+projectName+"/manage";
}</BUG>
return "redirect:/";//μλ±ν μ¬λμ΄ λ€μ΄μ¬λ κ·Έλ₯ λλ €λ³΄λ
}
@RequestMapping(value="/{creatorName}/{projectName}/{branchName}/upload" , method=RequestMethod.POST)
| return "redirect:/";
|
14,010 | String projectName = new String();
if (uri.split("/").length>3){
projectName= uri.split("/")[2]+"/"+uri.split("/")[3];
}else
return true;
<BUG>if(uri.endsWith("/join-ok") ||uri.endsWith("/join") || projectName.startsWith("sort:") || projectName.startsWith("tags:"))
</BUG>
return true;
Weaver weaver = weaverService.getCurrentWeaver();
Project project = projectService.get(projectName);
| if(uri.endsWith("/join-cancel") || uri.endsWith("/join-ok") ||uri.endsWith("/join") || projectName.startsWith("sort:") || projectName.startsWith("tags:"))
|
14,011 | package de.simonscholz;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
<BUG>import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;</BUG>
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
| import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.core.runtime.jobs.Job;
|
14,012 | package de.simonscholz;
import java.util.Arrays;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
<BUG>import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.ICompilationUnit;</BUG>
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.CompilationUnit;
| import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jdt.core.ICompilationUnit;
|
14,013 | package de.simonscholz.junit4converter;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
<BUG>import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jdt.core.ICompilationUnit;</BUG>
import org.eclipse.jdt.core.IOpenable;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.dom.AST;
| import org.eclipse.core.runtime.SubMonitor;
import org.eclipse.jdt.core.ICompilationUnit;
|
14,014 | }
if (modifiedDocument) {
ICompilationUnit adapter = (ICompilationUnit) astRoot
.getJavaElement().getAdapter(IOpenable.class);
if (adapter != null) {
<BUG>saveChanges(adapter, monitor, rewriter, importRewrite);
</BUG>
}
}
}
| saveChanges(adapter, subMonitor.newChild(1), rewriter, importRewrite);
|
14,015 | listRewrite.insertFirst(testAnnotation, null);
}
}
protected void removeAnnotation(ASTRewrite rewriter,
MethodDeclaration methodDeclaration, String annotationName) {
<BUG>List modifiers = methodDeclaration.modifiers();
</BUG>
for (Object object : modifiers) {
if (object instanceof Annotation) {
Annotation annotation = (Annotation) object;
| List<?> modifiers = methodDeclaration.modifiers();
|
14,016 | rewriter.remove(annotation, null);
}
}
}
}
<BUG>protected boolean isAnnotationExisting(List modifiers, String annotationName) {
</BUG>
for (Object modifier : modifiers) {
if (modifier instanceof Annotation) {
Annotation markerAnnotation = (Annotation) modifier;
| protected boolean isAnnotationExisting(List<?> modifiers, String annotationName) {
|
14,017 | import com.google.common.collect.Multimap;
import com.google.common.collect.SetMultimap;
import com.liferay.portal.kernel.json.JSONArray;
import com.liferay.portal.kernel.json.JSONFactoryUtil;
import com.liferay.portal.kernel.json.JSONObject;
<BUG>import org.eclipse.sw360.datahandler.common.CommonUtils;
import org.eclipse.sw360.datahandler.common.ThriftEnumUtils;</BUG>
import org.eclipse.sw360.datahandler.thrift.RequestStatus;
import org.eclipse.sw360.datahandler.thrift.ThriftClients;
import org.eclipse.sw360.datahandler.thrift.attachments.Attachment;
| import org.eclipse.sw360.datahandler.common.SW360Constants;
import org.eclipse.sw360.datahandler.common.ThriftEnumUtils;
|
14,018 | public static final String TYPE_USER = "user";
public static final String TYPE_COMPONENT = "component";
public static final String TYPE_RELEASE = "release";
public static final String TYPE_ATTACHMENT = "attachment";
public static final String TYPE_PROJECT = "project";
<BUG>public static final String TYPE_MODERATION = "moderation";
public static final Map<String, String> MAP_FULLTEXT_SEARCH_NAME =</BUG>
ImmutableMap.<String, String>builder()
.put(TYPE_LICENSE, "fullname")
.put(TYPE_TODO, "text")
| public static final String CLEARING_TEAM_UNKNOWN = "unknown";
public static final Map<String, String> MAP_FULLTEXT_SEARCH_NAME =
|
14,019 | import org.eclipse.sw360.datahandler.thrift.components.ComponentType;
import org.eclipse.sw360.datahandler.thrift.components.Release;
import org.eclipse.sw360.datahandler.thrift.components.ReleaseLink;
import org.eclipse.sw360.datahandler.thrift.projects.Project;
import org.eclipse.sw360.datahandler.thrift.projects.ProjectLink;
<BUG>import org.eclipse.sw360.datahandler.thrift.projects.ProjectRelationship;
import org.eclipse.sw360.datahandler.thrift.vendors.Vendor;</BUG>
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
| import org.eclipse.sw360.datahandler.thrift.projects.ProjectType;
import org.eclipse.sw360.datahandler.thrift.vendors.Vendor;
|
14,020 | ReleaseLink releaseLinkR2A = new ReleaseLink("R2A", "vendor", "component2", "releaseA").setComment("used").setNodeId("R2A_1");
ReleaseLink releaseLinkR2B = new ReleaseLink("R2B", "vendor", "component2", "releaseB").setComment("considered for use").setNodeId("R2B_1");
ProjectLink link3 = new ProjectLink("P3", "project3")
.setRelation(ProjectRelationship.REFERRED)
.setNodeId("P3_1")
<BUG>.setParentNodeId("P2_1")
.setTreeLevel(2)</BUG>
.setLinkedReleases(Arrays.asList(releaseLinkR2A, releaseLinkR2B))
.setSubprojects(Collections.emptyList());
ProjectLink link4 = new ProjectLink("P4", "project4")
| .setProjectType(ProjectType.CUSTOMER)
.setTreeLevel(2)
|
14,021 | .setLinkedReleases(Arrays.asList(releaseLinkR2A, releaseLinkR2B))
.setSubprojects(Collections.emptyList());
ProjectLink link4 = new ProjectLink("P4", "project4")
.setRelation(ProjectRelationship.CONTAINED)
.setNodeId("P4_1")
<BUG>.setParentNodeId("P2_1")
.setTreeLevel(2)</BUG>
.setSubprojects(Collections.emptyList());
ProjectLink link2 = new ProjectLink("P2", "project2")
.setRelation(ProjectRelationship.CONTAINED)
| .setProjectType(ProjectType.CUSTOMER)
.setTreeLevel(2)
|
14,022 | package org.eclipse.sw360.datahandler.thrift;
import com.google.common.base.Function;
<BUG>import com.google.common.collect.FluentIterable;
import org.eclipse.sw360.datahandler.thrift.attachments.AttachmentContent;</BUG>
import org.eclipse.sw360.datahandler.thrift.components.Component;
import org.eclipse.sw360.datahandler.thrift.components.Release;
import org.eclipse.sw360.datahandler.thrift.licenses.*;
| import org.eclipse.sw360.datahandler.common.SW360Constants;
import org.eclipse.sw360.datahandler.thrift.attachments.AttachmentContent;
|
14,023 | package org.hisp.dhis.android.core.program;
import android.database.Cursor;
import org.hisp.dhis.android.core.common.Call;
import org.hisp.dhis.android.core.common.Payload;
<BUG>import org.hisp.dhis.android.core.data.api.Fields;
import org.hisp.dhis.android.core.data.database.DatabaseAdapter;</BUG>
import org.hisp.dhis.android.core.dataelement.DataElement;
import org.hisp.dhis.android.core.option.OptionSet;
import org.hisp.dhis.android.core.relationship.RelationshipType;
| import org.hisp.dhis.android.core.data.api.Filter;
import org.hisp.dhis.android.core.data.database.DatabaseAdapter;
|
14,024 | package org.glowroot.agent.config;
import com.google.common.collect.ImmutableList;
<BUG>import org.immutables.value.Value;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;</BUG>
@Value.Immutable
public abstract class UiConfig {
@Value.Default
| import org.glowroot.common.config.ConfigDefaults;
import org.glowroot.wire.api.model.AgentConfigOuterClass.AgentConfig;
|
14,025 | class RepoAdminImpl implements RepoAdmin {
private final DataSource dataSource;
private final List<CappedDatabase> rollupCappedDatabases;
private final CappedDatabase traceCappedDatabase;
private final ConfigRepository configRepository;
<BUG>private final AgentDao agentDao;
</BUG>
private final GaugeValueDao gaugeValueDao;
private final GaugeNameDao gaugeNameDao;
private final TransactionTypeDao transactionTypeDao;
| private final EnvironmentDao agentDao;
|
14,026 | private final TransactionTypeDao transactionTypeDao;
private final FullQueryTextDao fullQueryTextDao;
private final TraceAttributeNameDao traceAttributeNameDao;
RepoAdminImpl(DataSource dataSource, List<CappedDatabase> rollupCappedDatabases,
CappedDatabase traceCappedDatabase, ConfigRepository configRepository,
<BUG>AgentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
</BUG>
TransactionTypeDao transactionTypeDao, FullQueryTextDao fullQueryTextDao,
TraceAttributeNameDao traceAttributeNameDao) {
this.dataSource = dataSource;
| EnvironmentDao agentDao, GaugeValueDao gaugeValueDao, GaugeNameDao gaugeNameDao,
|
14,027 | this.fullQueryTextDao = fullQueryTextDao;
this.traceAttributeNameDao = traceAttributeNameDao;
}
@Override
public void deleteAllData() throws Exception {
<BUG>Environment environment = agentDao.readEnvironment("");
dataSource.deleteAll();</BUG>
agentDao.reinitAfterDeletingDatabase();
gaugeValueDao.reinitAfterDeletingDatabase();
gaugeNameDao.invalidateCache();
| Environment environment = agentDao.read("");
dataSource.deleteAll();
|
14,028 | public class SimpleRepoModule {
private static final long SNAPSHOT_REAPER_PERIOD_MINUTES = 5;
private final DataSource dataSource;
private final ImmutableList<CappedDatabase> rollupCappedDatabases;
private final CappedDatabase traceCappedDatabase;
<BUG>private final AgentDao agentDao;
private final TransactionTypeDao transactionTypeDao;</BUG>
private final AggregateDao aggregateDao;
private final TraceAttributeNameDao traceAttributeNameDao;
private final TraceDao traceDao;
| private final EnvironmentDao environmentDao;
private final TransactionTypeDao transactionTypeDao;
|
14,029 | 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);
|
14,030 | 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,
|
14,031 | 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;
|
14,032 | 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;
|
14,033 | 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;
|
14,034 | 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;
|
14,035 | 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(),
|
14,036 | .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())
|
14,037 | .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())
|
14,038 | }
@Override
public void lazyRegisterMBean(Object object, String name) {
lazyPlatformMBeanServer.lazyRegisterMBean(object, name);
}
<BUG>}
}
</BUG>
| void initEmbeddedServer() throws Exception {
if (simpleRepoModule == null) {
return;
|
14,039 | 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] |
14,040 | 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) {
|
14,041 | 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);
|
14,042 | 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();
|
14,043 | 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");
|
14,044 | 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;
|
14,045 | </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;
|
14,046 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
14,047 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
14,048 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
14,049 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
14,050 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
14,051 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
14,052 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
14,053 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
14,054 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
setOutlineProvider(ViewOutlineProvider.BOUNDS);
}
}
@Override
<BUG>public void draw(@NonNull Canvas canvas) {
if (cornerRadius > 0 && getWidth() > 0 && getHeight() > 0 && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH) {</BUG>
int saveCount = canvas.saveLayer(0, 0, getWidth(), getHeight(), null, Canvas.ALL_SAVE_FLAG);
super.draw(canvas);
paint.setXfermode(pdMode);
| drawCalled = true;
if (cornerRadius > 0 && getWidth() > 0 && getHeight() > 0 && Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH) {
|
14,055 | import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.DigestOutputStream;
import java.security.MessageDigest;
<BUG>import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;</BUG>
public final class PatchUtils {
| import java.text.DateFormat;
import java.util.Date;
import java.util.List;
|
14,056 | package org.jboss.as.patching.runner;
<BUG>import org.jboss.as.boot.DirectoryStructure;
import org.jboss.as.patching.LocalPatchInfo;</BUG>
import org.jboss.as.patching.PatchInfo;
import org.jboss.as.patching.PatchLogger;
import org.jboss.as.patching.PatchMessages;
| import static org.jboss.as.patching.runner.PatchUtils.generateTimestamp;
import org.jboss.as.patching.CommonAttributes;
import org.jboss.as.patching.LocalPatchInfo;
|
14,057 | private static final String PATH_DELIMITER = "/";
public static final byte[] NO_CONTENT = PatchingTask.NO_CONTENT;
enum Element {
ADDED_BUNDLE("added-bundle"),
ADDED_MISC_CONTENT("added-misc-content"),
<BUG>ADDED_MODULE("added-module"),
BUNDLES("bundles"),</BUG>
CUMULATIVE("cumulative"),
DESCRIPTION("description"),
MISC_FILES("misc-files"),
| APPLIES_TO_VERSION("applies-to-version"),
BUNDLES("bundles"),
|
14,058 | final int count = reader.getAttributeCount();
for (int i = 0; i < count; i++) {
final String value = reader.getAttributeValue(i);
final Attribute attribute = Attribute.forName(reader.getAttributeLocalName(i));
switch (attribute) {
<BUG>case APPLIES_TO_VERSION:
builder.addAppliesTo(value);
break;</BUG>
case RESULTING_VERSION:
if(type == Patch.PatchType.CUMULATIVE) {
| [DELETED] |
14,059 | final StringBuilder path = new StringBuilder();
for(final String p : item.getPath()) {
path.append(p).append(PATH_DELIMITER);
}
path.append(item.getName());
<BUG>writer.writeAttribute(Attribute.PATH.name, path.toString());
if(type != ModificationType.REMOVE) {</BUG>
writer.writeAttribute(Attribute.HASH.name, bytesToHexString(item.getContentHash()));
}
if(type != ModificationType.ADD) {
| if (item.isDirectory()) {
writer.writeAttribute(Attribute.DIRECTORY.name, "true");
if(type != ModificationType.REMOVE) {
|
14,060 | package org.jboss.as.patching;
import org.jboss.as.controller.OperationFailedException;
import org.jboss.as.patching.runner.PatchingException;
import org.jboss.logging.Messages;
import org.jboss.logging.annotations.Message;
<BUG>import org.jboss.logging.annotations.MessageBundle;
import java.io.IOException;</BUG>
import java.util.List;
@MessageBundle(projectCode = "JBAS")
public interface PatchMessages {
| import org.jboss.logging.annotations.Cause;
import java.io.IOException;
|
14,061 | import org.apache.tinkerpop.gremlin.structure.Element;
import org.apache.tinkerpop.gremlin.structure.Graph;
import org.apache.tinkerpop.gremlin.structure.Property;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
<BUG>import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
import org.neo4j.driver.v1.Statement;</BUG>
import org.neo4j.driver.v1.Value;
import org.neo4j.driver.v1.Values;
import org.neo4j.driver.v1.types.Relationship;
| import org.neo4j.driver.v1.Record;
import org.neo4j.driver.v1.Statement;
|
14,062 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
14,063 | }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_memo);
<BUG>ChinaPhoneHelper.setStatusBar(this,true);
</BUG>
topicId = getIntent().getLongExtra("topicId", -1);
if (topicId == -1) {
finish();
| ChinaPhoneHelper.setStatusBar(this, true);
|
14,064 | MemoEntry.COLUMN_REF_TOPIC__ID + " = ?"
, new String[]{String.valueOf(topicId)});
}
public Cursor selectMemo(long topicId) {
Cursor c = db.query(MemoEntry.TABLE_NAME, null, MemoEntry.COLUMN_REF_TOPIC__ID + " = ?", new String[]{String.valueOf(topicId)}, null, null,
<BUG>MemoEntry._ID + " DESC", null);
</BUG>
if (c != null) {
c.moveToFirst();
}
| MemoEntry.COLUMN_ORDER + " ASC", null);
|
14,065 | MemoEntry._ID + " = ?",
new String[]{String.valueOf(memoId)});
}
public long updateMemoContent(long memoId, String memoContent) {
ContentValues values = new ContentValues();
<BUG>values.put(MemoEntry.COLUMN_CONTENT, memoContent);
return db.update(</BUG>
MemoEntry.TABLE_NAME,
values,
MemoEntry._ID + " = ?",
| return db.update(
|
14,066 | import android.widget.RelativeLayout;
import android.widget.TextView;
import com.kiminonawa.mydiary.R;
import com.kiminonawa.mydiary.db.DBManager;
import com.kiminonawa.mydiary.shared.EditMode;
<BUG>import com.kiminonawa.mydiary.shared.ThemeManager;
import java.util.List;
public class MemoAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> implements EditMode {
</BUG>
private List<MemoEntity> memoList;
| import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter;
public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
|
14,067 | private DBManager dbManager;
private boolean isEditMode = false;
private EditMemoDialogFragment.MemoCallback callback;
private static final int TYPE_HEADER = 0;
private static final int TYPE_ITEM = 1;
<BUG>public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback) {
this.mActivity = activity;</BUG>
this.topicId = topicId;
this.memoList = memoList;
| public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) {
super(recyclerView);
this.mActivity = activity;
|
14,068 | this.memoList = memoList;
this.dbManager = dbManager;
this.callback = callback;
}
@Override
<BUG>public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
</BUG>
View view;
if (isEditMode) {
if (viewType == TYPE_HEADER) {
| public DragSortAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
|
14,069 | editMemoDialogFragment.show(mActivity.getSupportFragmentManager(), "editMemoDialogFragment");
}
});
}
}
<BUG>protected class MemoViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private View rootView;
private TextView TV_memo_item_content;</BUG>
private ImageView IV_memo_item_delete;
| protected class MemoViewHolder extends DragSortAdapter.ViewHolder implements View.OnClickListener, View.OnLongClickListener {
private ImageView IV_memo_item_dot;
private TextView TV_memo_item_content;
|
14,070 | import net.sf.ehcache.config.CacheConfiguration.TransactionalMode;
import net.sf.ehcache.config.PersistenceConfiguration;
import net.sf.ehcache.config.PersistenceConfiguration.Strategy;
import net.sf.ehcache.store.MemoryStoreEvictionPolicy;
import uk.ac.rdg.resc.edal.catalogue.DataCatalogue;
<BUG>import uk.ac.rdg.resc.edal.catalogue.SimpleLayerNameMapper;
import uk.ac.rdg.resc.edal.catalogue.jaxb.VariableConfig;</BUG>
import uk.ac.rdg.resc.edal.dataset.Dataset;
import uk.ac.rdg.resc.edal.dataset.DatasetFactory;
import uk.ac.rdg.resc.edal.exceptions.EdalException;
| import uk.ac.rdg.resc.edal.catalogue.jaxb.DatasetConfig;
import uk.ac.rdg.resc.edal.catalogue.jaxb.VariableConfig;
|
14,071 | NcwmsDynamicService dynamicService = null;
for (NcwmsDynamicService testDynamicService : ((NcwmsConfig) config).getDynamicServices()) {
if (layerName.startsWith(testDynamicService.getAlias())) {
dynamicService = testDynamicService;
}
<BUG>}
return dynamicService;</BUG>
}
@Override
public LayerNameMapper getLayerNameMapper() {
| if (!dynamicService.getIdMatchPattern().matcher(layerName).matches()) {
return null;
return dynamicService;
|
14,072 | selenium.click(RuntimeVariables.replace("//b"));
selenium.waitForPageToLoad("30000");
selenium.click(RuntimeVariables.replace(
"//input[@value='Add Subfolder']"));
selenium.waitForPageToLoad("30000");
<BUG>selenium.typeKeys("_31_name", RuntimeVariables.replace("Test Image.jpg"));
selenium.type("_31_name", RuntimeVariables.replace("Test Image.jpg"));
</BUG>
selenium.type("_31_description",
RuntimeVariables.replace("Image Name Title Folder Test"));
| selenium.type("_31_name", RuntimeVariables.replace("Test1 Image1.jpg"));
|
14,073 | return intern(new StringIdItem(new CstString(string)));
}
public StringIdItem intern(CstString string) {
return intern(new StringIdItem(string));
}
<BUG>public StringIdItem intern(StringIdItem string) {
</BUG>
if (string == null) {
throw new NullPointerException("string == null");
}
| public synchronized StringIdItem intern(StringIdItem string) {
|
14,074 | return already;
}
strings.put(value, string);
return string;
}
<BUG>public void intern(CstNat nat) {
</BUG>
intern(nat.getName());
intern(nat.getDescriptor());
}
| public synchronized void intern(CstNat nat) {
|
14,075 | out.annotate(4, "proto_ids_off: " + Hex.u4(offset));
}
out.writeInt(sz);
out.writeInt(offset);
}
<BUG>public ProtoIdItem intern(Prototype prototype) {
</BUG>
if (prototype == null) {
throw new NullPointerException("prototype == null");
}
| public synchronized ProtoIdItem intern(Prototype prototype) {
|
14,076 | } catch (NullPointerException ex) {
throw new NullPointerException("item == null");
}
items.add(item);
}
<BUG>public <T extends OffsettedItem> T intern(T item) {
</BUG>
throwIfPrepared();
OffsettedItem result = interns.get(item);
if (result != null) {
| public synchronized <T extends OffsettedItem> T intern(T item) {
|
14,077 | out.annotate(4, "type_ids_off: " + Hex.u4(offset));
}
out.writeInt(sz);
out.writeInt(offset);
}
<BUG>public TypeIdItem intern(Type type) {
</BUG>
if (type == null) {
throw new NullPointerException("type == null");
}
| public synchronized TypeIdItem intern(Type type) {
|
14,078 | import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
<BUG>import java.util.TreeMap;
import java.util.concurrent.Callable;</BUG>
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
| import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.Callable;
|
14,079 | if (args.incremental && !anyFilesProcessed) {
return 0; // this was a no-op incremental build
}
byte[] outArray = null;
if (!outputDex.isEmpty() || (args.humanOutName != null)) {
<BUG>outArray = writeDex();
</BUG>
if (outArray == null) {
return 2;
}
| outArray = writeDex(outputDex);
|
14,080 | DxConsole.err.println("\ntrouble processing \"" + name + "\":\n\n" +
IN_RE_CORE_CLASSES);
errors.incrementAndGet();
throw new StopProcessing();
}
<BUG>private static byte[] writeDex() {
</BUG>
byte[] outArray = null;
try {
try {
| private static byte[] writeDex(DexFile outputDex) {
|
14,081 | if (minimalMainDex && (mainDexListFile == null || !multiDex)) {
System.err.println(MINIMAL_MAIN_DEX_OPTION + " is only supported in combination with "
+ MULTI_DEX_OPTION + " and " + MAIN_DEX_LIST_OPTION);
throw new UsageException();
}
<BUG>if (multiDex && numThreads != 1) {
System.out.println(NUM_THREADS_OPTION + " is ignored when used with "
+ MULTI_DEX_OPTION);
numThreads = 1;
}</BUG>
if (multiDex && incremental) {
| [DELETED] |
14,082 | log.debugf("Connection '%s' now opened.", connectionId);
registeredConnections.put(connectionId, proxy);
connectionOpened(connectionId, "", null);
}
private void writeHeader(final Channel channel) throws IOException {
<BUG>DataOutputStream dos = new DataOutputStream(channel.writeMessage());
</BUG>
try {
dos.writeBytes("JMX");
byte[] versions = Versions.getSupportedVersions();
| CancellableDataOutputStream dos = new CancellableDataOutputStream(channel.writeMessage());
|
14,083 | dos.write(versions);
if (Version.isSnapshot()) {
dos.write(SNAPSHOT);
} else {
dos.write(STABLE);
<BUG>}
} finally {</BUG>
dos.close();
}
}
| } catch (IOException e) {
dos.cancel();
throw e;
} finally {
|
14,084 | package com.cronutils.model.time.generator;
import java.util.Collections;
<BUG>import java.util.List;
import org.apache.commons.lang3.Validate;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.expression.FieldExpression;
public abstract class FieldValueGenerator {
| import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.Validate;
|
14,085 | import java.util.ResourceBundle;
import java.util.function.Function;</BUG>
class DescriptionStrategyFactory {
private DescriptionStrategyFactory() {}
public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) {
<BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale());
</BUG>
NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression);
dow.addDescription(fieldExpression -> {
if (fieldExpression instanceof On) {
| import java.util.function.Function;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
|
14,086 | return dom;
}
public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(
bundle,
<BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()),
expression</BUG>
);
}
public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
| integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()),
expression
|
14,087 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.mapper.WeekDay;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
| import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.Validate;
import com.cronutils.mapper.WeekDay;
|
14,088 | import com.cronutils.model.field.expression.Between;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.parser.CronParserField;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
import java.util.Collections;
import java.util.List;
import java.util.Set;</BUG>
class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
| [DELETED] |
14,089 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
| import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import org.apache.commons.lang3.Validate;
import com.cronutils.model.field.CronField;
|
14,090 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
import com.google.common.collect.Lists;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
import java.util.List;</BUG>
class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
| package com.cronutils.model.time.generator;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import com.cronutils.model.field.CronField;
|
14,091 | class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
private int month;
public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) {
super(cronField);
<BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month");
this.year = year;</BUG>
this.month = month;
}
| Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" +
" month");
this.year = year;
|
14,092 | package com.cronutils.mapper;
public class ConstantsMapper {
private ConstantsMapper() {}
public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false);
<BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false);
</BUG>
public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true);
public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){
return source.mapTo(weekday, target);
| public static final WeekDay JAVA8 = new WeekDay(1, false);
|
14,093 | return nextMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException {
</BUG>
List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear());
TimeNode days = null;
int lowestMonth = months.getValues().get(0);
| ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
|
14,094 | boolean questionMarkSupported =
cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK);
if(questionMarkSupported){
return new TimeNode(
generateDayCandidatesQuestionMarkSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
14,095 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
14,096 | }
public DateTime lastExecution(DateTime date){
</BUG>
Validate.notNull(date);
try {
<BUG>DateTime previousMatch = previousClosestMatch(date);
</BUG>
if(previousMatch.equals(date)){
previousMatch = previousClosestMatch(date.minusSeconds(1));
}
| public java.time.Duration timeToNextExecution(ZonedDateTime date){
return java.time.Duration.between(date, nextExecution(date));
public ZonedDateTime lastExecution(ZonedDateTime date){
ZonedDateTime previousMatch = previousClosestMatch(date);
|
14,097 | return previousMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>public Duration timeFromLastExecution(DateTime date){
return new Interval(lastExecution(date), date).toDuration();
}
public boolean isMatch(DateTime date){
</BUG>
return nextExecution(lastExecution(date)).equals(date);
| [DELETED] |
14,098 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
| import java.time.ZonedDateTime;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cronutils.model.field.CronField;
|
14,099 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
<BUG>import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;</BUG>
class EveryFieldValueGenerator extends FieldValueGenerator {
| package com.cronutils.model.time.generator;
import java.time.ZonedDateTime;
import java.util.List;
import com.cronutils.model.field.CronField;
|
14,100 | private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class);
public EveryFieldValueGenerator(CronField cronField) {
super(cronField);
log.trace(String.format(
"processing \"%s\" at %s",
<BUG>cronField.getExpression().asString(), DateTime.now()
</BUG>
));
}
@Override
| cronField.getExpression().asString(), ZonedDateTime.now()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.