id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
24,601
public static class FakeArtifactHandler extends DefaultArtifactHandler { private final String extension; public FakeArtifactHandler(final String type, final String extension) { <BUG>super(Preconditions.checkNotNull(type)); this.extension = Preconditions.checkNotNull(extension); }</BUG> @Override public String getExtens...
super(checkNotNull(type)); this.extension = checkNotNull(extension); }
24,602
@Override public String getExtension() { return extension; } } <BUG>protected ArtifactRepository getDeploymentRepository(final MavenSession mavenSession) throws MojoExecutionException</BUG> { final ArtifactRepository repo = mavenSession.getCurrentProject().getDistributionManagementArtifactRepository(); if (repo == null...
protected ArtifactRepository getDeploymentRepository() throws MojoExecutionException
24,603
} @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)
24,604
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))
24,605
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)
24,606
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");
24,607
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");
24,608
} @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);
24,609
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);
24,610
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);
24,611
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() ...
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
24,612
protected AbstractBinding binding; protected WSSecTimestamp timestampEl; protected String mainSigId; protected List<WSEncryptionPart> sigConfList; protected Set<WSEncryptionPart> encryptedTokensList = new HashSet<WSEncryptionPart>(); <BUG>protected Map<AbstractToken, Object> endEncSuppTokMap; protected Map<AbstractToke...
protected List<SupportingToken> endEncSuppTokList; protected List<SupportingToken> endSuppTokList; protected List<SupportingToken> sgndEndEncSuppTokList; protected List<SupportingToken> sgndEndSuppTokList; protected List<byte[]> signatures = new ArrayList<byte[]>();
24,613
if (suppTokens.isEncryptedToken()) { WSEncryptionPart part = new WSEncryptionPart(id, "Element"); part.setElement(clone); encryptedTokensList.add(part); } <BUG>if (secToken.getX509Certificate() == null) { ret.put(token, new WSSecurityTokenHolder(wssConfig, secToken)); } else {</BUG> WSSecSignature sig = new WSSecSigna...
ret.add( new SupportingToken(token, new WSSecurityTokenHolder(wssConfig, secToken)) } else {
24,614
sig.prepare(saaj.getSOAPPart(), secToken.getCrypto(), secHeader); } catch (WSSecurityException e) { LOG.log(Level.FINE, e.getMessage(), e); throw new Fault(e); } <BUG>ret.put(token, sig); }</BUG> } else if (token instanceof X509Token) { WSSecSignature sig = getSignatureBuilder(suppTokens, token, endorse); Element bstEl...
ret.add(new SupportingToken(token, sig));
24,615
if (endorse) { WSSecUsernameToken utBuilder = addDKUsernameToken(token, true); if (utBuilder != null) { utBuilder.prepare(saaj.getSOAPPart()); addSupportingElement(utBuilder.getUsernameTokenElement()); <BUG>ret.put(token, utBuilder); if (encryptedToken) {</BUG> WSEncryptionPart part = new WSEncryptionPart(utBuilder.get...
ret.add(new SupportingToken(token, utBuilder)); if (encryptedToken) {
24,616
} else { WSSecUsernameToken utBuilder = addUsernameToken(token); if (utBuilder != null) { utBuilder.prepare(saaj.getSOAPPart()); addSupportingElement(utBuilder.getUsernameTokenElement()); <BUG>ret.put(token, utBuilder); if (encryptedToken</BUG> || MessageUtils.getContextualBoolean(message, SecurityConstants.ALWAYS_ENCR...
ret.add(new SupportingToken(token, utBuilder)); if (encryptedToken
24,617
if (isSigProtect) { WSEncryptionPart part = new WSEncryptionPart(sig.getId(), "Element"); encryptedTokensList.add(part); } } catch (WSSecurityException e) { <BUG>policyNotAsserted(ent.getKey(), e); </BUG> } } else if (tempTok instanceof WSSecurityTokenHolder) { SecurityToken token = ((WSSecurityTokenHolder)tempTok).get...
policyNotAsserted(supportingToken.getToken(), e);
24,618
SecurityToken token = ((WSSecurityTokenHolder)tempTok).getToken(); if (isTokenProtection) { sigParts.add(new WSEncryptionPart(token.getId())); } try { <BUG>if (ent.getKey().getDerivedKeys() == DerivedKeys.RequireDerivedKeys) { doSymmSignatureDerived(ent.getKey(), token, sigParts, isTokenProtection); } else { doSymmSig...
if (supportingToken.getToken().getDerivedKeys() == DerivedKeys.RequireDerivedKeys) { doSymmSignatureDerived(supportingToken.getToken(), token, sigParts, doSymmSignature(supportingToken.getToken(), token, sigParts, isTokenProtection);
24,619
sigParts.add(new WSEncryptionPart(secToken.getId())); } try { byte[] secret = utBuilder.getDerivedKey(); secToken.setSecret(secret); <BUG>if (ent.getKey().getDerivedKeys() == DerivedKeys.RequireDerivedKeys) { doSymmSignatureDerived(ent.getKey(), secToken, sigParts, isTokenProtection); } else { doSymmSignature(ent.getK...
if (supportingToken.getToken().getDerivedKeys() == DerivedKeys.RequireDerivedKeys) { doSymmSignatureDerived(supportingToken.getToken(), secToken, sigParts, doSymmSignature(supportingToken.getToken(), secToken, sigParts, isTokenProtection);
24,620
sigProtect = ((AsymmetricBinding)binding).isEncryptSignature(); } else if (binding instanceof SymmetricBinding) { tokenProtect = ((SymmetricBinding)binding).isProtectTokens(); sigProtect = ((SymmetricBinding)binding).isEncryptSignature(); } <BUG>endSuppTokMap.putAll(endEncSuppTokMap); doEndorsedSignatures(endSuppTokMa...
endSuppTokList.addAll(endEncSuppTokList); doEndorsedSignatures(endSuppTokList, tokenProtect, sigProtect); sgndEndSuppTokList.addAll(sgndEndEncSuppTokList); doEndorsedSignatures(sgndEndSuppTokList, tokenProtect, sigProtect);
24,621
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 ...
import java.text.DateFormat; import java.util.Date; import java.util.List;
24,622
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;
24,623
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"), MIS...
APPLIES_TO_VERSION("applies-to-version"), BUNDLES("bundles"),
24,624
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_VE...
[DELETED]
24,625
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, bytesToHex...
if (item.isDirectory()) { writer.writeAttribute(Attribute.DIRECTORY.name, "true"); if(type != ModificationType.REMOVE) {
24,626
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> impor...
import org.jboss.logging.annotations.Cause; import java.io.IOException;
24,627
import org.junit.experimental.categories.Category; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import java.math.BigInteger; import java.util.ArrayList; <BUG>import java.util.Collection; import static com.n1analytics.paillier.TestConfiguration.CONFIGURATIONS;</BUG> import static com.n1analyt...
import java.util.Random; import static com.n1analytics.paillier.TestConfiguration.CONFIGURATIONS;
24,628
@RunWith(Parameterized.class) @Category(SlowTests.class) public class AdditionTest { private PaillierContext context; private PaillierPrivateKey privateKey; <BUG>static private int maxIteration = 100; @Parameterized.Parameters</BUG> public static Collection<Object[]> configurations() { Collection<Object[]> configuratio...
static private int MAX_ITERATIONS = TestConfiguration.MAX_ITERATIONS; @Parameterized.Parameters
24,629
} }}; BinaryAdder4 binaryAdders4[] = new BinaryAdder4[]{new BinaryAdder4() {</BUG> @Override public EncodedNumber eval(EncodedNumber arg1, EncodedNumber arg2) { return arg1.add(arg2); } <BUG>}, new BinaryAdder4() { @Override</BUG> public EncodedNumber eval(EncodedNumber arg1, EncodedNumber arg2) {
}, new EncodedToEncodedAdder() { return arg2.add(arg1);
24,630
return context.add(arg2, arg1); } }}; <BUG>void testDoubleAddition(BinaryAdder1 adder) { double a, b, plainResult, decodedResult, tolerance; EncryptedNumber ciphertTextA, ciphertTextB, encryptedResult; EncodedNumber decryptedResult; for(int i = 0; i < maxIteration; i++) { a = randomFiniteDouble();</BUG> b = randomFini...
@Test public void testDoubleAddition() { EncryptedNumber cipherTextA, cipherTextA_obf, cipherTextB, cipherTextB_obf, encryptedResult; EncodedNumber encodedA, encodedB, encodedResult, decryptedResult; Random rnd = new Random(); int maxExponentDiff = (int)(0.5 * context.getPublicKey().getModulus().bitLength() / (Math.log...
24,631
@RunWith(Parameterized.class) @Category(SlowTests.class) public class DivisionTest { private PaillierContext context; private PaillierPrivateKey privateKey; <BUG>static private int maxIteration = 100; @Parameters</BUG> public static Collection<Object[]> configurations() { Collection<Object[]> configurationParams = new ...
static private int maxIteration = TestConfiguration.MAX_ITERATIONS; @Parameters
24,632
return transformAssignment(op, leftTerm, expr, rhs); } JCExpression transformAssignment(Node op, Term leftTerm, JCExpression expr, JCExpression rhs) { JCExpression result = null; TypedDeclaration decl = (TypedDeclaration) ((Tree.Primary)leftTerm).getDeclaration(); <BUG>boolean variable = decl.isVariable(); if (decl.isT...
at(op); result = makeSetter(rhs, makeFQIdent(decl.getContainer().getQualifiedNameString()), Util.quoteIfJavaKeyword(decl.getName()), Util.getSetterName(decl.getName()));
24,633
if (decl == null) { return make().Erroneous(List.<JCTree>nil()); } if (decl instanceof Getter) { if (decl.isToplevel()) { <BUG>result = make().Apply( List.<JCTree.JCExpression>nil(), makeSelect(makeFQIdent(decl.getContainer().getQualifiedNameString()), Util.quoteIfJavaKeyword(decl.getName()), Util.getGetterName(decl.ge...
result = makeGetter(makeFQIdent(decl.getContainer().getQualifiedNameString()), Util.quoteIfJavaKeyword(decl.getName()), Util.getGetterName(decl.getName()));
24,634
result = makeIdentOrSelect(primaryExpr, Util.quoteMethodName(decl.getName())); } } if (result == null) { if (Util.isErasedAttribute(decl.getName())) { <BUG>result = make().Apply(null, makeIdentOrSelect(primaryExpr, Util.quoteMethodName(decl.getName())), List.<JCExpression>nil());</BUG> } else {
result = makeGetter(primaryExpr, Util.quoteMethodName(decl.getName()));
24,635
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
24,636
} @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);
24,637
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 != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
24,638
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(
24,639
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.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
24,640
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, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
24,641
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) {
24,642
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;
24,643
import java.util.List; import java.util.logging.Level;</BUG> import java.util.logging.LogRecord; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.Around; <BUG>import org.aspectj.lang.annotation.Aspect; import org.junit.After;</BUG> import org.junit.Assert; import org.junit.Before; public ...
import java.util.Map; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; import java.util.logging.Level; import org.jgroups.Receiver; import org.junit.After;
24,644
import org.junit.Assert; import org.junit.Before; public class BaseClusterTestCase { @Before public void setUp() { <BUG>_captureHandler = JDKLoggerTestUtil.configureJDKLogger( </BUG> ClusterBase.class.getName(), Level.OFF); } @After
_clusterBaseCaptureHandler = JDKLoggerTestUtil.configureJDKLogger(
24,645
@Around("call(* org.jgroups.JChannel.send(..))") public Object throwException(ProceedingJoinPoint proceedingJoinPoint) </BUG> throws Throwable { throw new Exception(); <BUG>} }</BUG> protected void assertLogger( List<LogRecord> logRecords, String message, Class<?> exceptionClass) { if (message == null) {
public Object send(ProceedingJoinPoint proceedingJoinPoint) private static Exception _connectException;
24,646
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 {
24,647
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));
24,648
} 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()
24,649
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...
24,650
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...
24,651
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 {
24,652
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);
24,653
package org.camunda.bpm.extension.example.reactor; <BUG>import org.camunda.bpm.engine.delegate.DelegateTask; import org.camunda.bpm.engine.delegate.TaskListener;</BUG> import org.camunda.bpm.engine.runtime.ProcessInstance; import org.camunda.bpm.engine.task.Task; import org.camunda.bpm.engine.test.Deployment;
[DELETED]
24,654
import org.camunda.bpm.extension.reactor.bus.CamundaSelector; import org.camunda.bpm.extension.reactor.listener.SubscriberTaskListener;</BUG> import reactor.bus.EventBus; @CamundaSelector(type = "userTask", event = TaskListener.EVENTNAME_CREATE) <BUG>public class TaskCreateListener extends SubscriberTaskListener { pub...
public class TaskCreateListener implements TaskListener { public TaskCreateListener(CamundaEventBus eventBus) { eventBus.register(this); }
24,655
package org.camunda.bpm.extension.example.reactor; import org.camunda.bpm.engine.ProcessEngineConfiguration; import org.camunda.bpm.engine.impl.cfg.StandaloneInMemProcessEngineConfiguration; <BUG>import org.camunda.bpm.extension.reactor.CamundaReactor; import org.camunda.bpm.extension.reactor.plugin.ReactorProcessEngin...
import org.camunda.bpm.extension.reactor.bus.CamundaEventBus; import org.camunda.bpm.extension.reactor.plugin.ReactorProcessEnginePlugin;
24,656
</BUG> this.jobExecutorActivate = false; } }; <BUG>private final EventBus eventBus = CamundaReactor.eventBus(); </BUG> public void init() { new TaskCreateListener(eventBus); new TaskAssignListener(); }
public static final String GROUP_2 = "group2"; public static final String GROUP_3 = "group3"; public static ProcessEngineConfiguration CONFIGURATION = new StandaloneInMemProcessEngineConfiguration() { this.databaseSchemaUpdate = DB_SCHEMA_UPDATE_TRUE; this.getProcessEnginePlugins().add(CamundaReactor.plugin()); private...
24,657
logger.warn("failed to resolve local host, fallback to loopback", e); localAddressX = InetAddress.getLoopbackAddress(); } localAddress = localAddressX; } <BUG>public static Boolean defaultReuseAddress() { return Constants.WINDOWS ? null : true; </BUG> }
public static boolean defaultReuseAddress() { return Constants.WINDOWS ? false : true;
24,658
protected final String publishHost; protected final boolean detailedErrorsEnabled; protected int publishPort; protected final String tcpNoDelay; protected final String tcpKeepAlive; <BUG>protected final Boolean reuseAddress; </BUG> protected final ByteSizeValue tcpSendBufferSize; protected final ByteSizeValue tcpReceiv...
protected final boolean reuseAddress;
24,659
Assert.assertEquals(0, goAwayInfo.getLastStreamId()); Assert.assertSame(SessionStatus.OK, goAwayInfo.getSessionStatus()); latch.countDown(); } }; <BUG>Session session = startClient(startServer(serverSessionFrameListener), null); </BUG> session.syn(SPDY.V2, new SynInfo(true), null); session.goAway(SPDY.V2); Assert.asser...
Session session = startClient(startSPDYServer(serverSessionFrameListener), null);
24,660
stream.data(new ByteBufferDataInfo(buffer, true)); } }; } }; <BUG>final Session session = startClient(startServer(serverSessionFrameListener), null); </BUG> final int iterations = 50; final int count = 50; final Headers headers = new Headers();
final Session session = startClient(startSPDYServer(serverSessionFrameListener), null);
24,661
} @Test public void testClientEnforcingIdleTimeoutWithUnrespondedStream() throws Exception { final CountDownLatch latch = new CountDownLatch(1); <BUG>InetSocketAddress address = startServer(new ServerSessionFrameListener.Adapter() </BUG> { @Override public void onGoAway(Session session, GoAwayInfo goAwayInfo)
}); server.addConnector(connector); int maxIdleTime = 1000; connector.setMaxIdleTime(maxIdleTime); server.start(); Session session = startClient(new InetSocketAddress("localhost", connector.getLocalPort()), new Session.FrameListener.Adapter()
24,662
package org.eclipse.jetty.spdy; <BUG>import java.net.InetSocketAddress; import org.eclipse.jetty.server.Server;</BUG> import org.eclipse.jetty.spdy.api.Session; import org.eclipse.jetty.spdy.api.server.ServerSessionFrameListener; import org.eclipse.jetty.spdy.nio.SPDYClient;
import org.eclipse.jetty.server.Handler; import org.eclipse.jetty.server.Server;
24,663
} }; protected Server server; protected SPDYClient.Factory clientFactory; protected SPDYServerConnector connector; <BUG>protected InetSocketAddress startServer(ServerSessionFrameListener listener) throws Exception </BUG> { server = new Server(); connector = newSPDYServerConnector(listener);
protected InetSocketAddress startSPDYServer(ServerSessionFrameListener listener) throws Exception
24,664
stream.reply(new ReplyInfo(new Headers(), true)); synLatch.countDown(); return null; } }; <BUG>Session session = startClient(startServer(serverSessionFrameListener), null); </BUG> final CountDownLatch streamCreatedLatch = new CountDownLatch(1); final CountDownLatch streamRemovedLatch = new CountDownLatch(1); session.ad...
Session session = startClient(startSPDYServer(serverSessionFrameListener), null);
24,665
dataLatch.countDown(); } }; } }; <BUG>Session session = startClient(startServer(serverSessionFrameListener), null); </BUG> final CountDownLatch streamRemovedLatch = new CountDownLatch(1); session.addListener(new Session.StreamListener.Adapter() {
Session session = startClient(startSPDYServer(serverSessionFrameListener), null);
24,666
stream.getSession().flush(); stream.data(new StringDataInfo(data2, true)); return null; } }; <BUG>Session session = startClient(startServer(serverSessionFrameListener), null); </BUG> final CountDownLatch replyLatch = new CountDownLatch(1); final CountDownLatch dataLatch1 = new CountDownLatch(1); final CountDownLatch da...
Session session = startClient(startSPDYServer(serverSessionFrameListener), null);
24,667
serverDataLatch.countDown(); } }; } }; <BUG>startClient(startServer(serverSessionFrameListener), clientSessionFrameListener); </BUG> Assert.assertTrue(synLatch.await(5, TimeUnit.SECONDS)); Assert.assertTrue(replyLatch.await(5, TimeUnit.SECONDS)); Assert.assertTrue(serverDataLatch.await(5, TimeUnit.SECONDS));
startClient(startSPDYServer(serverSessionFrameListener), clientSessionFrameListener);
24,668
Assert.assertTrue(stream.isClosed()); } }; } }; <BUG>Session session = startClient(startServer(serverSessionFrameListener), null); </BUG> final CountDownLatch latch = new CountDownLatch(1); session.syn(SPDY.V2, new SynInfo(false), new Stream.FrameListener.Adapter() {
Session session = startClient(startSPDYServer(serverSessionFrameListener), null);
24,669
return childState == null </BUG> ? null <BUG>: childState.getEditor(); </BUG> } @Override public TransientNodeState getTransientState() { return transientState;
sourceParent.copy(sourceName, destParent, destName); jsop.append("*\"").append(path(sourcePath)).append("\":\"") .append(path(destPath)).append('"'); public KernelNodeStateEditor edit(String path) { TransientKernelNodeState state = getTransientState(path); return state == null : state.getEditor();
24,670
AddNode(String parentPath, String name) { this.parentPath = parentPath; this.name = name; } @Override <BUG>void apply(KernelNodeStateEditor editor) { for (String element : PathUtils.elements(parentPath)) { editor = editor.edit(element); } editor.addNode(name);</BUG> }
[DELETED]
24,671
private final String path; RemoveNode(String path) { this.path = path; } @Override <BUG>void apply(KernelNodeStateEditor editor) { for (String element : PathUtils.elements(PathUtils.getParentPath(path))) { editor = editor.edit(element); } editor.removeNode(PathUtils.getName(path));</BUG> }
[DELETED]
24,672
this.propertyName = name; this.propertyValue = value; } @Override void apply(KernelNodeStateEditor editor) { <BUG>for (String element : PathUtils.elements(parentPath)) { editor = editor.edit(element); } editor.setProperty(propertyName, propertyValue); </BUG> }
[DELETED]
24,673
this.parentPath = parentPath; this.name = name; } @Override void apply(KernelNodeStateEditor editor) { <BUG>for (String element : PathUtils.elements(parentPath)) { editor = editor.edit(element); } editor.removeProperty(name); </BUG> }
this.propertyName = name; this.propertyValue = value;
24,674
} else { updateMemo(); callback.updateMemo(); } dismiss(); <BUG>}else{ </BUG> Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show(); } }
[DELETED]
24,675
} @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);
24,676
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 != nu...
MemoEntry.COLUMN_ORDER + " ASC", null);
24,677
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(
24,678
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.A...
import com.marshalchen.ultimaterecyclerview.dragsortadapter.DragSortAdapter; public class MemoAdapter extends DragSortAdapter<DragSortAdapter.ViewHolder> implements EditMode {
24,679
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, EditMe...
public MemoAdapter(FragmentActivity activity, long topicId, List<MemoEntity> memoList, DBManager dbManager, EditMemoDialogFragment.MemoCallback callback, RecyclerView recyclerView) { super(recyclerView); this.mActivity = activity;
24,680
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) {
24,681
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;
24,682
entry.setValue(((GrailsParameterMap)entry.getValue()).clone()); } } return new GrailsParameterMap(clonedMap, request); } <BUG>} private Object getParameterValue(Map requestMap, String key) {</BUG> Object paramValue = requestMap.get(key); if (paramValue instanceof String[]) { if (((String[])paramValue).length == 1) {
public void addParametersFrom(GrailsParameterMap otherMap) { this.wrappedMap.putAll((GrailsParameterMap)otherMap.clone()); private Object getParameterValue(Map requestMap, String key) {
24,683
import org.springframework.web.servlet.handler.DispatcherServletWebRequest; import org.springframework.web.servlet.support.RequestContextUtils; import org.springframework.web.util.UrlPathHelper; public class GrailsWebRequest extends DispatcherServletWebRequest implements ParameterInitializationCallback { private Grails...
private GrailsParameterMap originalParams; private GrailsHttpSession session;
24,684
@SuppressWarnings({ "unchecked", "rawtypes" }) protected void copyParamsFromPreviousRequest(RequestAttributes previousRequestAttributes, GrailsWebRequest requestAttributes) { if (!(previousRequestAttributes instanceof GrailsWebRequest)) { return; } <BUG>Map previousParams = ((GrailsWebRequest)previousRequestAttributes)...
requestAttributes.addParametersFrom(((GrailsWebRequest)previousRequestAttributes).getParams());
24,685
package fi.nls.oskari.statistics.eurostat; import fi.nls.oskari.cache.JedisManager; <BUG>import fi.nls.oskari.control.statistics.data.IdNamePair; import fi.nls.oskari.control.statistics.data.StatisticalIndicator; import fi.nls.oskari.control.statistics.data.StatisticalIndicatorDataModel; import fi.nls.oskari.control....
import fi.nls.oskari.control.statistics.data.*; import fi.nls.oskari.control.statistics.plugins.StatisticalDatasourcePlugin;
24,686
import java.util.*; public class EurostatIndicatorsParser { private final static Logger LOG = LogFactory.getLogger(EurostatIndicatorsParser.class); SimpleNamespaceContext NAMESPACE_CTX = new SimpleNamespaceContext(); private EurostatConfig config; <BUG>private EurostatStatisticalIndicatorLayer layer; public EurostatInd...
private StatisticalDatasourcePlugin plugin; public EurostatIndicatorsParser(StatisticalDatasourcePlugin plugin, EurostatConfig config) throws java.io.IOException { this.plugin = plugin; NAMESPACE_CTX.addNamespace(XMLConstants.DEFAULT_NS_PREFIX, "http://www.sdmx.org/resources/sdmxml/schemas/v2_1");
24,687
NAMESPACE_CTX.addNamespace("xml", "http://www.w3.org/XML/1998/namespace"); NAMESPACE_CTX.addNamespace("mes", "http://www.sdmx.org/resources/sdmxml/schemas/v2_1/message"); NAMESPACE_CTX.addNamespace("str", "http://www.sdmx.org/resources/sdmxml/schemas/v2_1/structure"); NAMESPACE_CTX.addNamespace("com", "http://www.sdmx....
public boolean setMetadata(StatisticalIndicator indicator, String dataStructureID) throws Exception {
24,688
private StatisticalDatasource source = null; private DataSourceUpdater updater = null; private static final Logger LOG = LogFactory.getLogger(StatisticalDatasourcePlugin.class); private static final ObjectMapper MAPPER = new ObjectMapper(); public abstract void update(); <BUG>public Map<String, IndicatorValue> getIndic...
public abstract Map<String, IndicatorValue> getIndicatorValues(StatisticalIndicator indicator, StatisticalIndicatorDataModel params, StatisticalIndicatorLayer regionset);
24,689
} public String getId() { return id; } public Boolean isPublic() { <BUG>return isPublic; }</BUG> public void addLayer(StatisticalIndicatorLayer layer) { layers.add(layer); }
public void setPublic(boolean isPublic) { this.isPublic = isPublic;
24,690
<BUG>package fi.nls.oskari.statistics.eurostat; import org.json.JSONObject; public class EurostatConfig {</BUG> private long datasourceId; private String url;
import fi.nls.oskari.control.statistics.data.StatisticalIndicatorDataDimension; import fi.nls.oskari.control.statistics.data.StatisticalIndicatorDataModel; import fi.nls.oskari.util.IOHelper; import java.util.HashMap; import java.util.Map; public class EurostatConfig {
24,691
} @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)
24,692
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))
24,693
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)
24,694
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");
24,695
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");
24,696
} @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);
24,697
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);
24,698
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);
24,699
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() ...
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
24,700
public MethodCallExprContext(MethodCallExpr wrappedNode, TypeSolver typeSolver) { super(wrappedNode, typeSolver); } @Override public Optional<Type> solveGenericType(String name, TypeSolver typeSolver) { <BUG>Type typeOfScope = JavaParserFacade.get(typeSolver).getType(wrappedNode.getScope().get()); Optional<Type> res = ...
Type typeOfScope = JavaParserFacade.get(typeSolver).getType(wrappedNode.getScope()); Optional<Type> res = typeOfScope.asReferenceType().getGenericParameterByName(name);