id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
37,901
assertThat(view.hasKnownFailures(), is(true)); assertThat(view.knownFailures(), contains(rogueAi)); } @Test public void public_api_should_return_reasonable_defaults_for_jobs_that_never_run() throws Exception { <BUG>view = JobView.of( a(job().thatHasNeverRun()), withDefaultConfig());</BUG> assertThat(view.lastBuildNam...
view = a(jobView().of( a(job().thatHasNeverRun())));
37,902
public static RelativeLocation locatedAt(String url) { RelativeLocation location = mock(RelativeLocation.class); when(location.url()).thenReturn(url); return location; } <BUG>public static BuildAugmentor augmentedWith(Class<? extends Augmentation>... augmentationsToSupport) { </BUG> BuildAugmentor augmentor = new Build...
public static BuildAugmentor with(Class<? extends Augmentation>... augmentationsToSupport) {
37,903
import java.text.SimpleDateFormat; import java.util.*; import static com.smartcodeltd.jenkinsci.plugins.buildmonitor.viewmodel.plugins.bfa.AnalysedTest.failureCauseBuildAction; import static com.smartcodeltd.jenkinsci.plugins.buildmonitor.viewmodel.plugins.claim.ClaimedTest.claimBuildAction; import static org.mockito.M...
public class BuildStateRecipe implements Supplier<AbstractBuild<?, ?>> { private AbstractBuild<?, ?> build;
37,904
Calendar timestamp = mock(Calendar.class); when(build.getTimestamp()).thenReturn(timestamp); when(timestamp.getTimeInMillis()).thenReturn(startedAt); return this; } <BUG>public BuildStateRecipe andTook(int minutes) throws Exception{ </BUG> long duration = (long) minutes * 60 * 1000; when(build.getDuration()).thenReturn...
public BuildStateRecipe took(int minutes) throws Exception{
37,905
</BUG> long duration = (long) minutes * 60 * 1000; when(build.getDuration()).thenReturn(duration); return this; } <BUG>public BuildStateRecipe andUsuallyTakes(int minutes) throws Exception{ </BUG> long duration = (long) minutes * 60 * 1000; when(build.getEstimatedDuration()).thenReturn(duration); return this;
Calendar timestamp = mock(Calendar.class); when(build.getTimestamp()).thenReturn(timestamp); when(timestamp.getTimeInMillis()).thenReturn(startedAt); public BuildStateRecipe took(int minutes) throws Exception{ public BuildStateRecipe usuallyTakes(int minutes) throws Exception{
37,906
private static final String AUTHOR = "Adam"; private static final String REASON = "Sorry, I broke it, fixing now"; private static final String FLUX_CAPACITOR_FAILED_AGAIN = "Flux capacitor failed again"; private BuildAugmentor augmentor = new BuildAugmentor(); private Run<?, ?> plainBuild = a(build()); <BUG>private Run...
private Run<?, ?> claimedBuild = a(build().finishedWith(Result.FAILURE).and().wasClaimedBy(AUTHOR, REASON)); private Run<?, ?> failedBuild = a(build().finishedWith(Result.FAILURE).and().knownFailures(FLUX_CAPACITOR_FAILED_AGAIN));
37,907
<BUG>package com.smartcodeltd.jenkinsci.plugins.buildmonitor.viewmodel.syntacticsugar; import java.util.Arrays;</BUG> import java.util.List; public class Loops { public static <T> List<T> asFollows(T... examples) {
import com.google.common.base.Supplier; import com.google.common.base.Suppliers; import com.google.common.collect.Lists; import java.util.Arrays;
37,908
import java.security.KeyManagementException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.UnrecoverableKeyException; <BUG>import java.security.cert.CertificateException; import java.util.ArrayList;</BUG> import java.util.List;...
import java.security.spec.InvalidKeySpecException; import java.util.ArrayList;
37,909
import java.io.File; import java.io.IOException; import java.security.KeyStore; import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; <BUG>import java.security.cert.CertificateException; import org.wiztools.restclient.util.SSLUtil;</BUG> public class SSLKeyStoreBean implements SSLKeySto...
import java.security.spec.InvalidKeySpecException; import org.wiztools.restclient.util.SSLUtil;
37,910
package org.wiztools.restclient.ui.reqssl; <BUG>import java.awt.FlowLayout; import javax.swing.ButtonGroup;</BUG> import javax.swing.JPanel; import javax.swing.JRadioButton; import org.wiztools.restclient.bean.KeyStoreType;
import java.awt.event.ItemListener; import javax.swing.ButtonGroup;
37,911
import java.awt.BorderLayout; import java.awt.FlowLayout; import java.awt.GridLayout; import java.awt.dnd.DropTarget; import java.awt.event.ActionEvent; <BUG>import java.awt.event.ActionListener; import java.io.File;</BUG> import java.text.MessageFormat; import java.util.ArrayList; import java.util.List;
import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.io.File;
37,912
package org.wiztools.restclient.util; import java.io.File; import java.io.FileInputStream; <BUG>import java.io.IOException; import java.security.KeyStore;</BUG> import java.security.KeyStoreException; import java.security.NoSuchAlgorithmException; import java.security.cert.Certificate;
import java.io.ByteArrayInputStream; import java.nio.file.Files; import java.security.KeyFactory; import java.security.KeyStore;
37,913
NoSuchAlgorithmException, CertificateException { KeyStore store = KeyStore.getInstance(KeyStore.getDefaultType());</BUG> store.load(null); if(file != null) { <BUG>try(FileInputStream fis = new FileInputStream(file)) { for (Certificate cert : CertificateFactory.getInstance("X509") .generateCertificates(fis)) { final X5...
KeyStore store = KeyStore.getInstance(type.name()); try(FileInputStream instream = new FileInputStream(file)) { store.load(instream, password);
37,914
import javax.annotation.PostConstruct; import javax.inject.Inject; import javax.swing.JButton; import javax.swing.JLabel; import javax.swing.JPanel; <BUG>import javax.swing.JTextField; import org.wiztools.restclient.bean.SSLKeyStore;</BUG> import org.wiztools.restclient.ui.RCFileView; import org.wiztools.restclient.ui....
import org.wiztools.restclient.bean.KeyStoreType; import org.wiztools.restclient.bean.SSLKeyStore;
37,915
package org.jgroups.tests; import static java.util.concurrent.TimeUnit.SECONDS; <BUG>import java.net.InetAddress; import java.util.concurrent.CountDownLatch;</BUG> import java.util.concurrent.Executor; import java.util.concurrent.Executors; import org.jgroups.Channel;
import java.util.Properties; import java.util.concurrent.CountDownLatch;
37,916
private static void replaceDiscoveryProtocol(JChannel ch) throws Exception { ProtocolStack stack=ch.getProtocolStack(); Protocol discovery=stack.removeProtocol("TCPPING"); if(discovery != null){ Protocol transport = stack.getTransport(); <BUG>MPING mping=new MPING(); mping.setMcastPort(8888); mping.setBindAddr(InetAddr...
InetAddress bindAddress=Util.getBindAddress(new Properties()); mping.setBindAddr(bindAddress); mping.setMulticastAddress("230.1.2.3");
37,917
import org.jgroups.util.Util; import org.testng.annotations.Test; import java.net.InetAddress; import java.util.Arrays; import java.util.Collections; <BUG>import java.util.List; import java.util.concurrent.Semaphore;</BUG> import java.util.concurrent.TimeUnit; @Test(groups=Global.FLUSH,sequential=true) public class Mer...
import java.util.Properties; import java.util.concurrent.Semaphore;
37,918
private void replaceDiscoveryProtocol(JChannel ch) throws Exception { ProtocolStack stack=ch.getProtocolStack(); Protocol discovery=stack.removeProtocol("TCPPING"); if(discovery != null){ Protocol transport = stack.getTransport(); <BUG>MPING mping=new MPING(); mping.setMcastPort(7777); mping.setBindAddr(InetAddress.get...
InetAddress bindAddress=Util.getBindAddress(new Properties()); mping.setBindAddr(bindAddress); mping.setMulticastAddress("230.3.3.3");
37,919
public final class JaxbHelper { private static final Logger LOG = LoggerFactory.getLogger(JaxbHelper.class); private JaxbHelper() { } public static <T> Method getJaxbElementFactoryMethod(CamelContext camelContext, Class<T> type) { <BUG>Method factoryMethod = null; try { for (Method m : getObjectFactory(camelContext, ty...
Class factory = getObjectFactory(camelContext, type); if (factory != null) { for (Method m : factory.getMethods()) { final XmlElementDecl a = m.getAnnotation(XmlElementDecl.class);
37,920
Object unmarshalled = unmarshal(unmarshaller, exchange, value); return castJaxbType(unmarshalled, type); } return null; } <BUG>protected <T> T marshall(Class<T> type, Exchange exchange, Object value) </BUG> throws JAXBException, XMLStreamException, FactoryConfigurationError, TypeConversionException { LOG.trace("Marshal...
protected <T> T marshall(Class<T> type, Exchange exchange, Object value, Method objectFactoryMethod)
37,921
} else { marshaller.marshal(element, stream); } return; } else if (element != null) { <BUG>Method m = JaxbHelper.getJaxbElementFactoryMethod(camelContext, element.getClass()); try { Object toMarshall = m.invoke(JaxbHelper.getObjectFactory(camelContext, element.getClass()).newInstance(), element); if (asXmlStreamWriter...
Method objectFactoryMethod = JaxbHelper.getJaxbElementFactoryMethod(camelContext, element.getClass()); if (objectFactoryMethod != null) { Object instance = objectFactoryMethod.getDeclaringClass().newInstance(); if (instance != null) { Object toMarshall = objectFactoryMethod.invoke(instance, element); if (asXmlStreamWri...
37,922
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.LocalFileSystem; import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.util.Progressable; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AFileSystem extends FileSyste...
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AFileSystem extends FileSystem {
37,923
public void initialize(URI name, Configuration conf) throws IOException { super.initialize(name, conf); uri = URI.create(name.getScheme() + "://" + name.getAuthority()); workingDir = new Path("/user", System.getProperty("user.name")).makeQualified(this.uri, this.getWorkingDirectory()); <BUG>String accessKey = conf.get(...
String accessKey = conf.get(NEW_ACCESS_KEY, conf.get(OLD_ACCESS_KEY, null)); String secretKey = conf.get(NEW_SECRET_KEY, conf.get(OLD_SECRET_KEY, null));
37,924
} else { accessKey = userInfo; } } AWSCredentialsProviderChain credentials = new AWSCredentialsProviderChain( <BUG>new S3ABasicAWSCredentialsProvider(accessKey, secretKey), new InstanceProfileCredentialsProvider(), new S3AAnonymousAWSCredentialsProvider() );</BUG> bucket = name.getHost();
new BasicAWSCredentialsProvider(accessKey, secretKey), new AnonymousAWSCredentialsProvider()
37,925
awsConf.setSocketTimeout(conf.getInt(SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)); </BUG> s3 = new AmazonS3Client(credentials, awsConf); <BUG>maxKeys = conf.getInt(MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS); partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THR...
new InstanceProfileCredentialsProvider(), new AnonymousAWSCredentialsProvider() bucket = name.getHost(); ClientConfiguration awsConf = new ClientConfiguration(); awsConf.setMaxConnections(conf.getInt(NEW_MAXIMUM_CONNECTIONS, conf.getInt(OLD_MAXIMUM_CONNECTIONS, DEFAULT_MAXIMUM_CONNECTIONS))); awsConf.setProtocol(conf.g...
37,926
cannedACL = null; } if (!s3.doesBucketExist(bucket)) { throw new IOException("Bucket " + bucket + " does not exist"); } <BUG>boolean purgeExistingMultipart = conf.getBoolean(PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART); long purgeExistingMultipartAge = conf.getLong(PURGE_EXISTING_MULTIPART_AGE, DEFAULT_...
boolean purgeExistingMultipart = conf.getBoolean(NEW_PURGE_EXISTING_MULTIPART, conf.getBoolean(OLD_PURGE_EXISTING_MULTIPART, DEFAULT_PURGE_EXISTING_MULTIPART)); long purgeExistingMultipartAge = conf.getLong(NEW_PURGE_EXISTING_MULTIPART_AGE, conf.getLong(OLD_PURGE_EXISTING_MULTIPART_AGE, DEFAULT_PURGE_EXISTING_MULTIPART...
37,927
import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; <BUG>import static org.apache.hadoop.fs.s3a.S3AConstants.*; public class S3AOutputStream extends OutputStream {</BUG> private OutputStream backupStream; private File backup...
import static org.apache.hadoop.fs.s3a.Constants.*; public class S3AOutputStream extends OutputStream {
37,928
this.client = client; this.progress = progress; this.fs = fs; this.cannedACL = cannedACL; this.statistics = statistics; <BUG>partSize = conf.getLong(MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD); </BUG> if (conf.get(BUFFER_DIR, null) ...
partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE); partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
37,929
return JetBundle.message("change.function.signature.action.single", getFunctionSignatureString( possibleSignatures.get(0), @NotNull private static List<FunctionDescriptor> computePossibleSignatures(JetNamedFunction functionElement) { <BUG>BindingContext context = KotlinCacheManagerUtil.getDeclarationsFromProject(functi...
BindingContext context = KotlinCacheManagerUtil.getDeclarationsBindingContext(functionElement);
37,930
import org.jetbrains.jet.plugin.project.TargetPlatformDetector; public class KotlinCacheManagerUtil { private KotlinCacheManagerUtil() { } @NotNull <BUG>public static KotlinDeclarationsCache getDeclarationsFromProject(@NotNull JetElement element) { JetFile jetFile = element.getContainingJetFile(); return KotlinCacheMan...
[DELETED]
37,931
public AddFunctionToSupertypeFix(JetNamedFunction element) { super(element); functionsToAdd = generateFunctionsToAdd(element); } private static List<FunctionDescriptor> generateFunctionsToAdd(JetNamedFunction functionElement) { <BUG>BindingContext context = KotlinCacheManagerUtil.getDeclarationsFromProject(functionElem...
BindingContext context = KotlinCacheManagerUtil.getDeclarationsBindingContext(functionElement);
37,932
} public void clear() { throw new UnsupportedOperationException("clear"); } public Object put(final String name, final Object value) { <BUG>final Object oldValue = this.valueMap.get(name); final String key; if ( name.startsWith("_") ) { key = "_" + name; } else { key = name; }</BUG> this.resource.getProperties().put(ke...
final String key = MongoDBResourceProvider.propNameToKey(name);
37,933
this.put(e.getKey(), e.getValue()); } } public Object remove(final Object name) { final Object result = this.valueMap.get(name); <BUG>if ( result != null ) { final String key; if ( name.toString().startsWith("_") ) { key = "_" + name; } else { key = name.toString(); }</BUG> this.resource.getProperties().removeField(key...
final String key = MongoDBResourceProvider.propNameToKey(name.toString());
37,934
}); return archive; } @Test public void testServletAccess() throws Exception { <BUG>Archive<?> procArchive = null; //provider.getClientDeployment("interceptor-processor"); String procName = deployer.deploy(procArchive); try { Archive<?> httpArchive = null; //provider.getClientDeployment("interceptor-endpoint"); String ...
changeStartLevel(context, 3, 10, TimeUnit.SECONDS); deployer.deploy(PROCESSOR_NAME); deployer.deploy(ENDPOINT_NAME);
37,935
builder.addBundleActivator(InterceptorActivator.class); builder.addImportPackages(BundleActivator.class, LifecycleInterceptor.class, HttpService.class); builder.addImportPackages(HttpServlet.class, Servlet.class, Logger.class, VirtualFile.class); return builder.openStream(); } <BUG>}); } if ("interceptor-endpoint".equa...
return archive; @Deployment(name = ENDPOINT_NAME, managed = false, testable = false) public static JavaArchive getEndpointArchive() { final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, ENDPOINT_NAME); archive.addClasses(EndpointServlet.class);
37,936
public void clearCache(Foo foo) { EntityCacheUtil.removeResult(FooModelImpl.ENTITY_CACHE_ENABLED, FooImpl.class, foo.getPrimaryKey()); FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION); FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION); <BUG>clearUniqueFindersCache(foo); </BUG> } @O...
clearUniqueFindersCache((FooModelImpl)foo);
37,937
import org.osgi.util.tracker.ServiceTracker; @ProviderType public class FooLocalServiceUtil { public static blade.servicebuilder.model.Foo addFoo( blade.servicebuilder.model.Foo foo) { <BUG>return getService().addFoo(foo); }</BUG> public static blade.servicebuilder.model.Foo createFoo(long fooId) { return getService()....
public static blade.servicebuilder.model.Foo addFooWithoutId( return getService().addFooWithoutId(foo);
37,938
@Transactional(isolation = Isolation.PORTAL, rollbackFor = { PortalException.class, SystemException.class}) public interface FooLocalService extends BaseLocalService, PersistedModelLocalService { @com.liferay.portal.kernel.search.Indexable(type = IndexableType.REINDEX) <BUG>public blade.servicebuilder.model.Foo addFoo...
blade.servicebuilder.model.Foo foo); public blade.servicebuilder.model.Foo addFooWithoutId( blade.servicebuilder.model.Foo foo);
37,939
private LocalBroadcastManager mLocalBroadcastManager; private String mActiveDownloadUrlString; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <BUG>setContentView(R.layout.activity_app_details2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);</BUG> toolbar.set...
setContentView(R.layout.app_details2); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
37,940
.inflate(R.layout.app_details2_screenshots, parent, false); return new ScreenShotsViewHolder(view); } else if (viewType == VIEWTYPE_WHATS_NEW) { View view = LayoutInflater.from(parent.getContext()) .inflate(R.layout.app_details2_whatsnew, parent, false); <BUG>return new WhatsNewViewHolder(view); } else if (viewType == ...
} else if (viewType == VIEWTYPE_DONATE) { .inflate(R.layout.app_details2_donate, parent, false); return new DonateViewHolder(view); } else if (viewType == VIEWTYPE_LINKS) {
37,941
public static final int gateHeight1 = 144, gateHeight2 = 192; static Map<Integer, BlockPos> gateData = new HashMap<Integer, BlockPos>(); public static void teleport(int gateId, int dim, EntityPlayerMP player) { Location location = null; <BUG>player.timeUntilPortal = 10; //Basically to avoid message spam when something ...
player.timeUntilPortal = player.getPortalCooldown(); //Basically to avoid message spam when something goes wrong
37,942
int x = (int) Math.sqrt(i*d); int z = (int) Math.sqrt(i*(1-d)); if(rand.nextBoolean()) x = -x; if(rand.nextBoolean()) z = -z; BlockPos placement = pos.add(x, 0, z); <BUG>if(player.worldObj.getBiomeForCoordsBody(placement) != BiomeGenMinestuck.mediumOcean) </BUG> location = new Location(player.worldObj.getTopSolidOrLiqu...
if(player.worldObj.getBiomeForCoordsBody(placement) == BiomeGenMinestuck.mediumNormal)
37,943
gatePos = getGatePos(-1, clientDim); if(gatePos == null) {Debug.errorf("Unexpected error: Can't initiaize land gate placement for dimension %d!", clientDim); return;} } if(gatePos.getY() == -1) { <BUG>world.getChunkProvider().loadChunk(gatePos.getX() - 8 >> 4, gatePos.getZ() - 8 >> 4); world.getChunkProvider().loadChu...
world.getChunkProvider().provideChunk(gatePos.getX() - 8 >> 4, gatePos.getZ() - 8 >> 4); world.getChunkProvider().provideChunk(gatePos.getX() + 8 >> 4, gatePos.getZ() - 8 >> 4); world.getChunkProvider().provideChunk(gatePos.getX() - 8 >> 4, gatePos.getZ() + 8 >> 4); world.getChunkProvider().provideChunk(gatePos.getX() ...
37,944
SburbConnection serverConnection = SkaianetHandler.getMainConnection(landConnection.getServerIdentifier(), true); if(serverConnection != null && serverConnection.enteredGame() && MinestuckDimensionHandler.isLandDimension(serverConnection.getClientDimension())) //Last shouldn't be necessary, but just in case something g...
} else player.addChatMessage(new TextComponentTranslation("message.gateMissingLand")); } else Debug.errorf("Unexpected error: Can't find connection for dimension %d!", dim);
37,945
import net.minecraft.potion.PotionEffect; import net.minecraft.server.MinecraftServer; import net.minecraft.server.management.PlayerList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.WorldServer; <BUG>import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.fml.common.FMLCommonHandl...
import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.fml.common.FMLCommonHandler;
37,946
import java.util.Locale; import junit.framework.TestCase; import org.apache.wicket.MarkupContainer; import org.apache.wicket.markup.IMarkupResourceStreamProvider; import org.apache.wicket.markup.html.WebPage; <BUG>import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.TextField;</BUG>...
[DELETED]
37,947
public class AbstractTextComponentConvertEmptyStringsToNullTest extends TestCase { public void test() throws Exception { WicketTester tester = new WicketTester(); <BUG>StringArrayPage page = (StringArrayPage)tester.startPage(StringArrayPage.class); tester.submitForm("form");</BUG> assertNotNull(page.array); assertEqual...
StringArrayPage page = tester.startPage(StringArrayPage.class); tester.submitForm("form");
37,948
@NoArgsConstructor(access = AccessLevel.PACKAGE) class AddColumnMigrator implements SchemaOperationMigrator<AddColumn> { @Override public void migrate(Catalog catalog, RefLog refLog, Version version, AddColumn operation) { String tableName = operation.getTableName(); <BUG>TransitiveTableMirrorer.mirror(catalog, tableMa...
TransitiveTableMirrorer.mirror(catalog, refLog, version, tableName); TableRef tableRef = refLog.getTableRef(version, tableName); catalog.getTable(tableRef.getTableId())
37,949
import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import com.google.common.base.Strings; import com.google.common.collect.Lists; <BUG>import io.quantumdb.core.migration.utils.DataMapping.Transformation; import io.quantumdb.core.migration.utils.DataMappings;</BUG> import io.quantumdb....
[DELETED]
37,950
.append(" pg_class.oid = '" + tableName + "'::regclass AND ") .append(" indrelid = pg_class.oid AND ") .append(" pg_class.relnamespace = pg_namespace.oid AND ") .append(" pg_attribute.attrelid = pg_class.oid AND ") .append(" pg_attribute.attnum = any(pg_index.indkey) ") <BUG>.append(" AND indisprimary") </BUG> .to...
.append(" AND indisprimary")
37,951
return primaryKeyColumns; } private void addForeignKeys(Catalog catalog, String tableName) throws SQLException { String query = new QueryBuilder() .append("SELECT") <BUG>.append(" att2.attname AS referencing_column,") .append(" cl.relname AS referred_table,") </BUG> .append(" att.attname AS referred_column,")
.append(" att2.attname AS referencing_column,") .append(" cl.relname AS referred_table,")
37,952
public void serverShouldProvideAWelcomePage() { Configurator configurator = configurator(); Database database = database(); WebServer webServer = webServer(); webServer.setPort(6666); <BUG>HashSet<String> packages = new HashSet<String>(); packages.add("org.neo4j.server.web"); webServer.addPackages(packages);</BUG> Neo...
webServer.addPackages("org.neo4j.server.web");
37,953
package org.neo4j.server.web; import java.net.URI; import java.net.URISyntaxException; import java.util.Set; public interface WebServer { <BUG>public void addPackages(Set<String> packageNames); public void setPort(int portNo);</BUG> public int getPort(); public void start(); public void shutdown();
public void addPackages(String packageNames); public void setPort(int portNo);
37,954
import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.greaterThan; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertThat; import java.net.URI; <BUG>import java.util.HashSet; import java.util.Set;</BUG> import org.junit.Test; import org.neo4j.server.WebT...
[DELETED]
37,955
ClientResponse response = Client.create().resource("http://localhost:" + portNo + HelloWorldWebResource.ROOT_PATH).entity("Bertrand Russell").type("text/plain").accept("text/plain").post(ClientResponse.class); ws.shutdown(); assertEquals(200, response.getStatus()); assertThat(response.getEntity(String.class), containsS...
[DELETED]
37,956
jetty.setThreadPool(new QueuedThreadPool(maxThreads)); } public URI getBaseUri() throws URISyntaxException { StringBuilder sb = new StringBuilder(); sb.append("http"); <BUG>if(jettyPort == 443) { </BUG> sb.append("s"); } sb.append("://");
if (jettyPort == 443) {
37,957
try { sb.append(InetAddress.getLocalHost().getHostName()); } catch (UnknownHostException e) { sb.append("localhost"); } <BUG>if(jettyPort != 80) { </BUG> sb.append(":"); sb.append(jettyPort); }
if (jettyPort != 80) {
37,958
log.info("Successfully shutdown Neo Server on port [%d], database [%s]", portNo, location); } catch (Exception e) { log.error("Failed to cleanly shutdown Neo Server on port [%d], database [%s]", portNo, location); throw new RuntimeException(e); } <BUG>} public GraphDatabaseService database() {</BUG> return database.db;...
static NeoServer server() { return theServer; public GraphDatabaseService database() {
37,959
else if (t == ANY_CYPHER_OPTION) { r = AnyCypherOption(b, 0); } else if (t == ANY_FUNCTION_INVOCATION) { r = AnyFunctionInvocation(b, 0); <BUG>} else if (t == BULK_IMPORT_QUERY) {</BUG> r = BulkImportQuery(b, 0); } else if (t == CALL) {
else if (t == ARRAY) { r = Array(b, 0); else if (t == BULK_IMPORT_QUERY) {
37,960
if (!r) r = MapLiteral(b, l + 1); if (!r) r = MapProjection(b, l + 1); if (!r) r = CountStar(b, l + 1); if (!r) r = ListComprehension(b, l + 1); if (!r) r = PatternComprehension(b, l + 1); <BUG>if (!r) r = Expression1_12(b, l + 1); if (!r) r = FilterFunctionInvocation(b, l + 1);</BUG> if (!r) r = ExtractFunctionInvocat...
if (!r) r = Array(b, l + 1); if (!r) r = FilterFunctionInvocation(b, l + 1);
37,961
import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.apache.uima.Constants; <BUG>import org.apache.uima.UIMARuntimeException; import org.apache.uima.analysis_engine.AnalysisEngine;</BUG> import org.apache.uima.analysis_engine.AnalysisEngineDescription; import org....
import org.apache.uima.UimaContext; import org.apache.uima.UimaContextHolder; import org.apache.uima.analysis_engine.AnalysisEngine;
37,962
normalizeIsoLangCodes(md); AnalysisEngineMetaData mdCopy = (AnalysisEngineMetaData) md.clone(); if (mdCopy.getUUID() == null) { mdCopy.setUUID(UUIDGenerator.generate()); } <BUG>setMetaData(mdCopy); try {</BUG> mDescription.getDelegateAnalysisEngineSpecifiers(getResourceManager()); if (mDescription.getFlowControllerDecl...
UimaContext prevContext = UimaContextHolder.setContext(getUimaContext()); try {
37,963
new Object[] { getMetaData().getName(), mDescription.getSourceUrl() }); } mDescription.getFlowControllerDeclaration().resolveImports(getResourceManager()); } } catch (InvalidXMLException e) { <BUG>throw new ResourceInitializationException(e); }</BUG> mDescription.validate(getResourceManager()); if (aAdditionalParams ==...
} finally { UimaContextHolder.setContext(prevContext);
37,964
public class UimaContextHolder { private static InheritableThreadLocal<UimaContext> threadLocalContext = new InheritableThreadLocal<UimaContext>(); public static UimaContext getContext() { return threadLocalContext.get(); } <BUG>public static void setContext(UimaContext uimaContext) { threadLocalContext.set(uimaContex...
public static UimaContext setContext(UimaContext uimaContext) { UimaContext prevContext = threadLocalContext.get(); threadLocalContext.set(uimaContext); return prevContext;
37,965
package org.apache.uima.analysis_engine.impl; import java.util.Collections; import java.util.Map; import org.apache.uima.Constants; import org.apache.uima.UIMAFramework; <BUG>import org.apache.uima.UIMA_IllegalStateException; import org.apache.uima.UimaContextAdmin;</BUG> import org.apache.uima.UimaContextHolder; impor...
import org.apache.uima.UimaContext; import org.apache.uima.UimaContextAdmin;
37,966
UimaContextHolder.setContext(getUimaContext()); // for use by POJOs getAnalysisComponent().batchProcessComplete();</BUG> } finally { <BUG>UimaContextHolder.clearContext(); </BUG> exitBatchProcessComplete(); } } public void collectionProcessComplete() throws AnalysisEngineProcessException {
exitProcess(); public void batchProcessComplete() throws AnalysisEngineProcessException { enterBatchProcessComplete(); UimaContext prevContext = UimaContextHolder.setContext(getUimaContext()); // for use by POJOs try { getAnalysisComponent().batchProcessComplete(); UimaContextHolder.setContext(prevContext);
37,967
UimaContextHolder.setContext(getUimaContext()); // for use by POJOs getAnalysisComponent().collectionProcessComplete();</BUG> } finally { <BUG>UimaContextHolder.clearContext(); </BUG> exitCollectionProcessComplete(); } } protected void callAnalysisComponentProcess(final CAS aCAS) throws AnalysisEngineProcessException...
exitBatchProcessComplete(); public void collectionProcessComplete() throws AnalysisEngineProcessException { enterCollectionProcessComplete(); UimaContext prevContext = UimaContextHolder.setContext(getUimaContext()); // for use by POJOs try { getAnalysisComponent().collectionProcessComplete(); UimaContextHolder.setCont...
37,968
throw new AnalysisEngineProcessException(e); } } protected CAS callAnalysisComponentNext() throws AnalysisEngineProcessException, ResultNotSupportedException { <BUG>try { UimaContextHolder.setContext(getUimaContext()); // for use by POJOs AbstractCas absCas = mAnalysisComponent.next();</BUG> getMBean().incrementCASes...
UimaContext prevContext = UimaContextHolder.setContext(getUimaContext()); // for use by POJOs AbstractCas absCas = mAnalysisComponent.next();
37,969
public boolean hasNext() throws AnalysisEngineProcessException { enterProcess(); if (casAvailable) { return true; } <BUG>try { UimaContextHolder.setContext(getUimaContext()); // for use by POJOs casAvailable = mMyAnalysisComponent.hasNext();</BUG> if (!casAvailable) {
UimaContext prevContext = UimaContextHolder.setContext(getUimaContext()); // for use by POJOs casAvailable = mMyAnalysisComponent.hasNext();
37,970
throw (AnalysisEngineProcessException) e; } throw new AnalysisEngineProcessException(e); } finally { <BUG>UimaContextHolder.clearContext(); </BUG> exitProcess(); } }
UimaContextHolder.setContext(prevContext);
37,971
package org.apache.uima.analysis_engine.asb.impl; import java.util.Collection; import java.util.Map; import org.apache.uima.Constants; <BUG>import org.apache.uima.UIMAFramework; import org.apache.uima.UimaContextAdmin;</BUG> import org.apache.uima.UimaContextHolder; import org.apache.uima.analysis_engine.AnalysisEngine...
import org.apache.uima.UimaContext; import org.apache.uima.UimaContextAdmin;
37,972
private boolean mSofaAware; private Object mMBeanServer; private boolean initialized = false; private static final String LOG_RESOURCE_BUNDLE = "org.apache.uima.impl.log_messages"; public boolean initialize(ResourceSpecifier aSpecifier, Map<String, Object> aAdditionalParams) <BUG>throws ResourceInitializationException ...
UimaContext prevContext = UimaContextHolder.getContext(); // Get this early so the restore in correct try {
37,973
logger.setResourceManager(this.getResourceManager()); uimaContext.setLogger(logger); Logger classLogger = getLogger(); classLogger.logrb(Level.CONFIG, this.getClass().getName(), "initialize", LOG_RESOURCE_BUNDLE, "UIMA_flow_controller_init_begin__CONFIG", getMetaData().getName()); <BUG>UimaContextHolder.setContext(getF...
prevContext = UimaContextHolder.setContext(getFlowControllerContext()); // for use by POJOs
37,974
initialized = true; return true; } catch (ResourceConfigurationException e) { throw new ResourceInitializationException(e); } finally { <BUG>UimaContextHolder.clearContext(); </BUG> } } protected void finalize() throws Throwable {
UimaContextHolder.setContext(prevContext);
37,975
super.finalize(); } private FlowControllerContext getFlowControllerContext() { return (FlowControllerContext) getUimaContext(); } <BUG>public void reconfigure() throws ResourceConfigurationException { try { UimaContextHolder.setContext(getFlowControllerContext()); // for use by POJOs </BUG> mFlowController.reconfigure...
UimaContext prevContext = null; prevContext = UimaContextHolder.setContext(getFlowControllerContext()); // for use by POJOs
37,976
UimaContextHolder.setContext(getFlowControllerContext()); // for use by POJOs mFlowController.removeAnalysisEngines(aKeys);</BUG> } finally { <BUG>UimaContextHolder.clearContext(); </BUG> } } private FlowController instantiateFlowController(ResourceCreationSpecifier aDescriptor) throws ResourceInitializationException...
mFlowController.addAnalysisEngines(aKeys); UimaContextHolder.setContext(prevContext); public void removeAnalysisEngines(Collection<String> aKeys) throws AnalysisEngineProcessException { UimaContext prevContext = UimaContextHolder.setContext(getFlowControllerContext()); // for use by POJOs try { mFlowController.removeA...
37,977
AppData data = AppData.getCurrentData(); if (data.getLogType() > 0) { Element nowNode = data.getCurrentNode(); if (nowNode != null) <BUG>{ AppDataLogExecute.printObject(nowNode.addElement(this.getType() + "-result"), result); }</BUG> } }
AppDataLogExecute.printObject(
37,978
public void execute(Connection conn) throws EternaException, SQLException { TimeLogger startTime = new TimeLogger(); Statement stmt = null; <BUG>Throwable error = null; try</BUG> { if (this.hasActiveParam()) {
this.executedResult = -1; try
37,979
throws EternaException, SQLException { TimeLogger startTime = new TimeLogger(); Statement stmt = null; Throwable error = null; <BUG>int result = -1; try</BUG> { if (this.hasActiveParam()) {
this.executedResult = -1; try
37,980
AppData data = AppData.getCurrentData(); if (data.getLogType() > 0) { Element nowNode = data.getCurrentNode(); if (nowNode != null) <BUG>{ AppDataLogExecute.printObject(nowNode.addElement(this.getType() + "-result"), new Integer(result)); }</BUG> } }
AppDataLogExecute.printObject(
37,981
<BUG>package self.micromagic.eterna.dao.impl; import self.micromagic.eterna.dao.Entity;</BUG> import self.micromagic.eterna.dao.EntityItem; import self.micromagic.eterna.security.PermissionSet; import self.micromagic.eterna.share.AbstractGenerator;
import java.util.Iterator; import java.util.Set; import self.micromagic.eterna.dao.Entity;
37,982
package com.vaadin.addon.charts.model; import com.vaadin.addon.charts.model.style.Color; public class DrillUpButtonTheme extends AbstractConfigurationObject { private Color fill; private Color stroke; <BUG>private Number r; public Color getFill() {</BUG> return fill; } public void setFill(Color fill) {
import com.fasterxml.jackson.annotation.JsonProperty; @JsonProperty("stroke-width") private Number strokeWidth; public Color getFill() {
37,983
package com.vaadin.addon.charts.themes; <BUG>import com.vaadin.addon.charts.model.AbstractPlotOptions; import com.vaadin.addon.charts.model.DataLabels; import com.vaadin.addon.charts.model.Hover;</BUG> import com.vaadin.addon.charts.model.States; import com.vaadin.addon.charts.model.style.AxisStyle;
import com.vaadin.addon.charts.model.DataLabelsFunnel; import com.vaadin.addon.charts.model.DataLabelsRange; import com.vaadin.addon.charts.model.Hover;
37,984
package com.vaadin.addon.charts.themes; <BUG>import com.vaadin.addon.charts.model.AbstractPlotOptions; import com.vaadin.addon.charts.model.DataLabels; import com.vaadin.addon.charts.model.Hover;</BUG> import com.vaadin.addon.charts.model.States; import com.vaadin.addon.charts.model.style.AxisStyle;
import com.vaadin.addon.charts.model.DataLabelsFunnel; import com.vaadin.addon.charts.model.DataLabelsRange; import com.vaadin.addon.charts.model.Hover;
37,985
addToMap(inet, netmaskVariableName + "-" + name, netmask); addToMap(inet, "ipaddress-" + name, ipAddress); addToMap(inet, "static-" + name, isStatic); addToMap(inet, "ipv6address-" + name, ipv6Address); addToMap(inet, "ipv6secondaries-" + name, ipv6Secondaries); <BUG>addToMap(inet, "bonding-" + name, bonding); addToMa...
addToMap(inet, bondingTypeVariableName + "-" + name, bonding); addToMap(inet, bondingMasterVariableName + "-" + name, bondingMaster);
37,986
{ public void cast(GameWorld gameWorld, EnemyCharacter enemyCharacter, int spellPoints) { <BUG>System.out.println("Enemy is casting invisibility with spell points of: " + spellPoints); enemyCharacter.getStatusEffects().setStatusEffectTurns(TurnBasedStatusEffects.EFFECT_INVISIBLE, spellPoints); }</BUG> public int getMPC...
StringUtils utils = new StringUtils(); LogRendererFactory.instance().log(utils.UCFirst(enemyCharacter.getLogName()) + " casts invisibility."); LogRendererFactory.instance().log("Enemy becomes invisible.");
37,987
{ public void cast(GameWorld gameWorld, EnemyCharacter enemyCharacter, int spellPoints) { <BUG>System.out.println("Enemy is casting heal with spell points of: " + spellPoints); enemyCharacter.heal(10 * spellPoints); }</BUG> public int getMPCost(int spellPoints) { return Math.max(200 - 10 * spellPoints, 1); }
StringUtils utils = new StringUtils(); LogRendererFactory.instance().log(utils.UCFirst(enemyCharacter.getLogName()) + " casts heal."); LogRendererFactory.instance().log("Enemy heals " + (10 * spellPoints) + " HP.");
37,988
{ public void cast(GameWorld gameWorld, EnemyCharacter enemyCharacter, int spellPoints) { <BUG>System.out.println("Enemy is casting super heal with spell points of: " + spellPoints); enemyCharacter.setHP(enemyCharacter.getMaxHP()); }</BUG> public int getMPCost(int spellPoints) { return Math.max(100 - 10 * spellPoints, ...
StringUtils utils = new StringUtils(); LogRendererFactory.instance().log(utils.UCFirst(enemyCharacter.getLogName()) + " casts super heal."); LogRendererFactory.instance().log("Enemy heals all HP.");
37,989
break; } map.setElement(mainCharacterElement.getRow(), mainCharacterElement.getColumn(), null); MapElementSetter.setElement(map, mainCharacterElement, row, column); } <BUG>System.out.println("Main character final position: " + mainCharacterElement.getRow() + ", " + mainCharacterElement.getColumn()); }</BUG> public int ...
LogRendererFactory.instance().log("Pulled you in.");
37,990
package me.gnat008.perworldinventory.data.serializers; import com.google.gson.Gson; import com.google.gson.JsonObject; import me.gnat008.perworldinventory.PerWorldInventory; import me.gnat008.perworldinventory.config.Settings; <BUG>import me.gnat008.perworldinventory.data.players.PWIPlayer; import org.bukkit.entity.Pla...
import org.bukkit.Bukkit; import org.bukkit.entity.Player;
37,991
root.add("stats", StatSerializer.serialize(player)); if (Settings.getBoolean("player.economy")) root.add("economy", EconomySerializer.serialize(player, plugin.getEconomy())); return gson.toJson(root); } <BUG>public static void deserialize(JsonObject data, Player player, PerWorldInventory plugin) { </BUG> int format = 0...
public static void deserialize(final JsonObject data, final Player player, final PerWorldInventory plugin) {
37,992
package me.gnat008.perworldinventory.data.serializers; import com.google.gson.JsonObject; import me.gnat008.perworldinventory.data.players.PWIPlayer; <BUG>import net.milkbowl.vault.economy.Economy; import org.bukkit.entity.Player;</BUG> public class EconomySerializer { protected EconomySerializer() {} public static Jso...
import org.bukkit.ChatColor; import org.bukkit.entity.Player;
37,993
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args...
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
37,994
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, s...
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
37,995
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task...
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
37,996
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField +...
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
37,997
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.e...
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
37,998
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
37,999
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
38,000
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);