id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
43,501 | Element closingElement = elements.peek().element;
for (ElementInfo child : children) {
closingElement.appendChild(child.element);
}
level--;
<BUG>return (B) this;
}</BUG>
private String dumpElements() {
return elements.toString();
}
| return that();
|
43,502 | }
public B on(EventType type, EventListener listener) {
assertCurrent();
Element element = elements.peek().element;
type.register(element, listener);
<BUG>return (B) this;
}</BUG>
public B rememberAs(String id) {
assertCurrent();
references.put(id, elements.peek().element);
| public B attr(String name, String value) {
elements.peek().element.setAttribute(name, value);
return that();
|
43,503 | 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;
|
43,504 | 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;
|
43,505 | 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"),
|
43,506 | 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] |
43,507 | 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) {
|
43,508 | 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;
|
43,509 | }
return canonicalURL;</BUG>
}
}
Group group = GroupLocalServiceUtil.getGroup(groupId);
<BUG>String groupFriendlyURL = PortalUtil.getGroupFriendlyURL(
group, GetterUtil.getBoolean(privateLayoutParam), themeDisplay);
if (Validator.isNotNull(themeDisplay.getDoAsUserId())) {
groupFriendlyURL = HttpUtil.setParameter(
groupFriendlyURL, "doAsUserId", themeDisplay.getDoAsUserId());
}
return groupFriendlyURL;</BUG>
}
| return PortalUtil.getGroupFriendlyURL(
|
43,510 | package com.easytoolsoft.easyreport.web.controller.common;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping(value = "/error")
<BUG>public class ErrorController extends AbstractController {
@RequestMapping(value = {"/404"})</BUG>
public String error404() {
return "/error/404";
}
| public class ErrorController {
@RequestMapping(value = {"/404"})
|
43,511 | .answerGapText("verbannen", "_RESPONSE_1")
.saveAnswer().nextAnswer()
.answerGapText(",", "_RESPONSE_1")
.answerGapText("", "_RESPONSE_2")
.answerGapText("", "_RESPONSE_3")
<BUG>.saveAnswer().nextAnswer()
.answerMultipleChoice("Deutschland", "Brasilien", "S\u00FCdafrika")
.saveAnswer().nextAnswer()
.answerSingleChoice("Italien")
.saveAnswer().nextAnswer()
.answerCorrectKPrim("Deutschland", "Uruguay")</BUG>
.answerIncorrectKPrim("Frankreich", "Spanien")
| [DELETED] |
43,512 | 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 FileSystem {</BUG>
private URI uri;
private Path workingDir;
private AmazonS3Client s3;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AFileSystem extends FileSystem {
|
43,513 | 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(ACCESS_KEY, null);
String secretKey = conf.get(SECRET_KEY, null);
</BUG>
String userInfo = name.getUserInfo();
| 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));
|
43,514 | } 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()
|
43,515 |
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_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
</BUG>
if (partSize < 5 * 1024 * 1024) {
| 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.getBoolean(NEW_SECURE_CONNECTIONS, conf.getBoolean(OLD_SECURE_CONNECTIONS, DEFAULT_SECURE_CONNECTIONS)) ? Protocol.HTTPS : Protocol.HTTP);
awsConf.setMaxErrorRetry(conf.getInt(NEW_MAX_ERROR_RETRIES, conf.getInt(OLD_MAX_ERROR_RETRIES, DEFAULT_MAX_ERROR_RETRIES)));
awsConf.setSocketTimeout(conf.getInt(NEW_SOCKET_TIMEOUT, conf.getInt(OLD_SOCKET_TIMEOUT, DEFAULT_SOCKET_TIMEOUT)));
maxKeys = conf.getInt(NEW_MAX_PAGING_KEYS, conf.getInt(OLD_MAX_PAGING_KEYS, DEFAULT_MAX_PAGING_KEYS));
partSize = conf.getLong(NEW_MULTIPART_SIZE, conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE));
partSizeThreshold = conf.getInt(NEW_MIN_MULTIPART_THRESHOLD, conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD));
|
43,516 | 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_PURGE_EXISTING_MULTIPART_AGE);
</BUG>
if (purgeExistingMultipart) {
| 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_AGE));
|
43,517 | 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 backupFile;
private boolean closed;
| import static org.apache.hadoop.fs.s3a.Constants.*;
public class S3AOutputStream extends OutputStream {
|
43,518 | 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) != null) {
| partSize = conf.getLong(OLD_MULTIPART_SIZE, DEFAULT_MULTIPART_SIZE);
partSizeThreshold = conf.getInt(OLD_MIN_MULTIPART_THRESHOLD, DEFAULT_MIN_MULTIPART_THRESHOLD);
|
43,519 | if (inner.queue().offer(value)) {
drain();
}
else {
inner.cancel();
<BUG>innerError(inner, Exceptions.failWithOverflow());
}</BUG>
}
@Override
public void innerError(MergeSequentialInner<R> inner, Throwable e) {
| onError(Operators.onOperatorError(null, Exceptions.failWithOverflow("Queue is full?!"), value));
|
43,520 | AtomicIntegerFieldUpdater.newUpdater(WindowExactSubscriber.class, "once");
int index;
Subscription s;
UnicastProcessor<T> window;
boolean done;
<BUG>public WindowExactSubscriber(Subscriber<? super Flux<T>> actual,
int size,</BUG>
Supplier<? extends Queue<T>> processorQueueSupplier) {
this.actual = actual;
this.size = size;
| int size,
|
43,521 | package reactor.core.publisher;
import java.util.Objects;
import java.util.Queue;
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater;
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
<BUG>import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
import java.util.function.Function;</BUG>
import java.util.function.Supplier;
import org.reactivestreams.Publisher;
import org.reactivestreams.Subscriber;
| import java.util.function.BiPredicate;
import java.util.function.Function;
|
43,522 | final Function<? super T, ? extends Publisher<? extends R>> mapper;
final Supplier<? extends Queue<Object>> queueSupplier;
final int bufferSize;
static final SwitchMapInner<Object> CANCELLED_INNER =
new SwitchMapInner<>(null, 0, Long.MAX_VALUE);
<BUG>public FluxSwitchMap(Publisher<? extends T> source,
Function<? super T, ? extends Publisher<? extends R>> mapper,</BUG>
Supplier<? extends Queue<Object>> queueSupplier,
int bufferSize) {
super(source);
| Function<? super T, ? extends Publisher<? extends R>> mapper,
|
43,523 | bufferSize));
}
static final class SwitchMapMain<T, R> implements Subscriber<T>, Subscription {
final Subscriber<? super R> actual;
final Function<? super T, ? extends Publisher<? extends R>> mapper;
<BUG>final Queue<Object> queue;
final int bufferSize;</BUG>
Subscription s;
volatile boolean done;
volatile Throwable error;
| final BiPredicate<Object, Object> queueBiAtomic;
final int bufferSize;
|
43,524 | static final AtomicLongFieldUpdater<SwitchMapMain> INDEX =
AtomicLongFieldUpdater.newUpdater(SwitchMapMain.class, "index");
volatile int active;
@SuppressWarnings("rawtypes")
static final AtomicIntegerFieldUpdater<SwitchMapMain> ACTIVE =
<BUG>AtomicIntegerFieldUpdater.newUpdater(SwitchMapMain.class, "active");
public SwitchMapMain(Subscriber<? super R> actual,
Function<? super T, ? extends Publisher<? extends R>> mapper,</BUG>
Queue<Object> queue,
int bufferSize) {
| @SuppressWarnings("unchecked")
Function<? super T, ? extends Publisher<? extends R>> mapper,
|
43,525 | extends FluxSource<T, C> {
final Publisher<U> start;
final Function<? super U, ? extends Publisher<V>> end;
final Supplier<C> bufferSupplier;
final Supplier<? extends Queue<C>> queueSupplier;
<BUG>public FluxBufferStartEnd(Publisher<? extends T> source,
Publisher<U> start,</BUG>
Function<? super U, ? extends Publisher<V>> end,
Supplier<C> bufferSupplier,
Supplier<? extends Queue<C>> queueSupplier) {
| Publisher<U> start,
|
43,526 | volatile int open;
@SuppressWarnings("rawtypes")
static final AtomicIntegerFieldUpdater<BufferStartEndMainSubscriber> OPEN =
AtomicIntegerFieldUpdater.newUpdater(BufferStartEndMainSubscriber.class,
"open");
<BUG>public BufferStartEndMainSubscriber(Subscriber<? super C> actual,
Supplier<C> bufferSupplier,</BUG>
Queue<C> queue,
Function<? super U, ? extends Publisher<V>> end) {
this.actual = actual;
| Supplier<C> bufferSupplier,
|
43,527 | public final <U, V, C extends Collection<? super T>> Flux<C> buffer(Publisher<U>
bucketOpening,
Function<? super U, ? extends Publisher<V>> closeSelector,
Supplier<C> bufferSupplier) {
return onAssembly(new FluxBufferStartEnd<>(this, bucketOpening, closeSelector,
<BUG>bufferSupplier, QueueSupplier.xs()));
}</BUG>
public final Flux<List<T>> buffer(Duration timespan) {
return bufferMillis(timespan.toMillis(), Schedulers.timer());
}
| bufferSupplier, QueueSupplier.unbounded(QueueSupplier.XS_BUFFER_SIZE)));
|
43,528 | return groupBy(keyMapper, valueMapper, QueueSupplier.SMALL_BUFFER_SIZE);
}
public final <K, V> Flux<GroupedFlux<K, V>> groupBy(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends V> valueMapper, int prefetch) {
return onAssembly(new FluxGroupBy<>(this, keyMapper, valueMapper,
<BUG>QueueSupplier.small(),
QueueSupplier.unbounded(), prefetch));
}</BUG>
public final <TRight, TLeftEnd, TRightEnd, R> Flux<R> groupJoin(
| QueueSupplier.unbounded(prefetch),
QueueSupplier.unbounded(prefetch), prefetch));
|
43,529 | return sampleFirst(t -> Mono.delayMillis(timespan));
}
public final Flux<T> sampleMillis(long timespan) {
return sample(intervalMillis(timespan));
}
<BUG>public final <U> Flux<T> sampleTimeout(Function<? super T, ? extends Publisher<U>> throttlerFactory) {
return onAssembly(new FluxSampleTimeout<>(this,
throttlerFactory,
QueueSupplier.unbounded(QueueSupplier.XS_BUFFER_SIZE)));</BUG>
}
| return sampleTimeout(throttlerFactory, QueueSupplier.XS_BUFFER_SIZE);
|
43,530 | throttlerFactory,
QueueSupplier.unbounded(QueueSupplier.XS_BUFFER_SIZE)));</BUG>
}
public final <U> Flux<T> sampleTimeout(Function<? super T, ? extends Publisher<U>>
throttlerFactory, int maxConcurrency) {
<BUG>if(maxConcurrency == Integer.MAX_VALUE){
return sampleTimeout(throttlerFactory);
}</BUG>
return onAssembly(new FluxSampleTimeout<>(this, throttlerFactory,
QueueSupplier.get(maxConcurrency)));
| return sampleFirst(t -> Mono.delayMillis(timespan));
public final Flux<T> sampleMillis(long timespan) {
return sample(intervalMillis(timespan));
public final <U> Flux<T> sampleTimeout(Function<? super T, ? extends Publisher<U>> throttlerFactory) {
return sampleTimeout(throttlerFactory, QueueSupplier.XS_BUFFER_SIZE);
|
43,531 | public final Flux<GroupedFlux<T, T>> windowUntil(Predicate<T> boundaryTrigger, boolean cutBefore) {
return windowUntil(boundaryTrigger, cutBefore, QueueSupplier.SMALL_BUFFER_SIZE);
}
public final Flux<GroupedFlux<T, T>> windowUntil(Predicate<T> boundaryTrigger, boolean cutBefore, int prefetch) {
return onAssembly(new FluxWindowPredicate<>(this,
<BUG>QueueSupplier.get(prefetch),
QueueSupplier.unbounded(),
prefetch,</BUG>
boundaryTrigger,
| QueueSupplier.unbounded(prefetch),
QueueSupplier.unbounded(prefetch),
prefetch,
|
43,532 | public final Flux<GroupedFlux<T, T>> windowWhile(Predicate<T> inclusionPredicate) {
return windowWhile(inclusionPredicate, QueueSupplier.SMALL_BUFFER_SIZE);
}
public final Flux<GroupedFlux<T, T>> windowWhile(Predicate<T> inclusionPredicate, int prefetch) {
return onAssembly(new FluxWindowPredicate<>(this,
<BUG>QueueSupplier.get(prefetch),
QueueSupplier.unbounded(),
prefetch,</BUG>
inclusionPredicate,
| QueueSupplier.unbounded(prefetch),
QueueSupplier.unbounded(prefetch),
prefetch,
|
43,533 | package reactor.core;
import java.util.Objects;
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater;
<BUG>public abstract class Exceptions {
public static final boolean CANCEL_STACKTRACE =
Boolean.parseBoolean(System.getProperty("reactor.trace.cancel", "false"));</BUG>
@SuppressWarnings("ThrowableInstanceNeverThrown")
| @Deprecated
public static final boolean CANCEL_STACKTRACE = true;
|
43,534 | public static UnsupportedOperationException errorCallbackNotImplemented(Throwable cause) {
Objects.requireNonNull(cause, "cause");
return new ErrorCallbackNotImplemented(cause);
}
public static RuntimeException failWithCancel() {
<BUG>return CANCEL_STACKTRACE ? new CancelException() : CancelException.INSTANCE;
}</BUG>
public static IllegalStateException failWithOverflow() {
return new OverflowException("The receiver is overrun by more signals than expected (bounded queue...)");
}
| return new CancelException();
|
43,535 | return this;
}
private static final long serialVersionUID = 2491425227432776143L;
}
static final class CancelException extends BubblingException {
<BUG>@SuppressWarnings("ThrowableInstanceNeverThrown")
public static final CancelException INSTANCE = new CancelException();
private CancelException() {
super("The subscriber has denied dispatching");
}
@Override
public synchronized Throwable fillInStackTrace() {
return CANCEL_STACKTRACE ? super.fillInStackTrace() : this;</BUG>
}
| [DELETED] |
43,536 | import reactor.core.Exceptions;
final class FluxWindowBoundary<T, U> extends FluxSource<T, Flux<T>> {
final Publisher<U> other;
final Supplier<? extends Queue<T>> processorQueueSupplier;
final Supplier<? extends Queue<Object>> drainQueueSupplier;
<BUG>public FluxWindowBoundary(Publisher<? extends T> source, Publisher<U> other,
Supplier<? extends Queue<T>> processorQueueSupplier,</BUG>
Supplier<? extends Queue<Object>> drainQueueSupplier) {
super(source);
this.other = Objects.requireNonNull(other, "other");
| Supplier<? extends Queue<T>> processorQueueSupplier,
|
43,537 | static final int STATE_HAS_NEXT_NO_VALUE = 0;
static final int STATE_HAS_NEXT_HAS_VALUE = 1;
static final int STATE_NO_NEXT = 2;
static final int STATE_CALL_HAS_NEXT = 3;
T current;
<BUG>public IterableSubscription(Subscriber<? super T> actual,
Iterator<? extends T> iterator) {</BUG>
this.actual = actual;
this.iterator = iterator;
}
| Iterator<? extends T> iterator) {
|
43,538 | long index;
volatile int wip;
@SuppressWarnings("rawtypes")
static final AtomicIntegerFieldUpdater<BufferSkipSubscriber> WIP =
AtomicIntegerFieldUpdater.newUpdater(BufferSkipSubscriber.class, "wip");
<BUG>public BufferSkipSubscriber(Subscriber<? super C> actual,
int size,</BUG>
int skip,
Supplier<C> bufferSupplier) {
this.actual = actual;
| int size,
|
43,539 | this.size = size;
this.skip = skip;
this.bufferSupplier = bufferSupplier;
}
@Override
<BUG>public void request(long n) {
if (wip == 0 && WIP.compareAndSet(this, 0, 1)) {</BUG>
long u = Operators.multiplyCap(n, size);
long v = Operators.multiplyCap(skip - size, n - 1);
s.request(Operators.addCap(u, v));
| if (!Operators.validate(n)) {
return;
if (wip == 0 && WIP.compareAndSet(this, 0, 1)) {
|
43,540 | volatile boolean done;
volatile int wip;
@SuppressWarnings("rawtypes")
static final AtomicIntegerFieldUpdater<BufferAsyncSink> WIP =
AtomicIntegerFieldUpdater.newUpdater(BufferAsyncSink.class, "wip");
<BUG>public BufferAsyncSink(Subscriber<? super T> actual, int capacityHint) {
super(actual);</BUG>
this.queue = QueueSupplier.<T>unbounded(capacityHint).get();
}
@Override
| public SerializedSink(BaseSink<T> sink) {
this.sink = sink;
this.queue = QueueSupplier.<T>unbounded(QueueSupplier.XS_BUFFER_SIZE).get();
|
43,541 | <BUG>package org.xwiki.rendering;
import org.xwiki.rendering.internal.macro.html.HTMLMacro;</BUG>
import org.xwiki.rendering.macro.Macro;
import org.xwiki.rendering.macro.MacroExecutionException;
import org.xwiki.rendering.macro.html.HTMLMacroParameters;
| import org.jmock.Mock;
import org.xwiki.bridge.DocumentAccessBridge;
import org.xwiki.bridge.DocumentNameSerializer;
import org.xwiki.component.embed.EmbeddableComponentManager;
import org.xwiki.rendering.internal.macro.html.HTMLMacro;
|
43,542 | {
@Override
protected void setUp() throws Exception
{
super.setUp();
<BUG>getComponentManager().registerComponent(MockDocumentAccessBridge.getComponentDescriptor());
getComponentManager().registerComponent(MockDocumentNameSerializer.getComponentDescriptor());
}</BUG>
public void testHTMLMacroWhenNonInlineContentInInlineContext() throws Exception
{
| Mock mockDocumentAccessBridge = mock(DocumentAccessBridge.class);
((EmbeddableComponentManager) getComponentManager()).registerComponent(DocumentAccessBridge.class,
mockDocumentAccessBridge.proxy());
Mock mockDocumentNameSerializer = mock(DocumentNameSerializer.class);
((EmbeddableComponentManager) getComponentManager()).registerComponent(DocumentNameSerializer.class,
mockDocumentNameSerializer.proxy());
}
|
43,543 | package org.qcri.rheem.core.function;
import org.qcri.rheem.core.optimizer.ProbabilisticDoubleInterval;
<BUG>import org.qcri.rheem.core.optimizer.costs.LoadEstimator;
</BUG>
import org.qcri.rheem.core.types.BasicDataUnitType;
import org.qcri.rheem.core.types.DataUnitType;
import java.util.Optional;
| import org.qcri.rheem.core.optimizer.costs.LoadProfileEstimator;
|
43,544 | private final SerializableFunction<Input, Iterable<Output>> javaImplementation;
private ProbabilisticDoubleInterval selectivity;
public FlatMapDescriptor(SerializableFunction<Input, Iterable<Output>> javaImplementation,
Class<Input> inputTypeClass,
Class<Output> outputTypeClass) {
<BUG>this(javaImplementation, inputTypeClass, outputTypeClass, null);
</BUG>
}
public FlatMapDescriptor(SerializableFunction<Input, Iterable<Output>> javaImplementation,
Class<Input> inputTypeClass,
| this(javaImplementation, inputTypeClass, outputTypeClass, (ProbabilisticDoubleInterval) null);
|
43,545 | }</BUG>
public FlatMapDescriptor(SerializableFunction<Input, Iterable<Output>> javaImplementation,
Class<Input> inputTypeClass,
Class<Output> outputTypeClass,
<BUG>LoadEstimator cpuLoadEstimator,
LoadEstimator ramLoadEstimator) {
this(javaImplementation,
inputTypeClass,
outputTypeClass,
null,
cpuLoadEstimator,
ramLoadEstimator);</BUG>
}
| ProbabilisticDoubleInterval selectivity) {
this(javaImplementation, inputTypeClass, outputTypeClass, selectivity, null);
|
43,546 | package org.qcri.rheem.basic.operators;
import org.qcri.rheem.core.function.TransformationDescriptor;
<BUG>import org.qcri.rheem.core.optimizer.costs.DefaultLoadEstimator;
import org.qcri.rheem.core.plan.rheemplan.UnarySink;</BUG>
import org.qcri.rheem.core.types.DataSetType;
import java.util.Objects;
public class TextFileSink<T> extends UnarySink<T> {
| import org.qcri.rheem.core.optimizer.costs.NestableLoadProfileEstimator;
import org.qcri.rheem.core.plan.rheemplan.UnarySink;
|
43,547 | this(
textFileUrl,
new TransformationDescriptor<>(
Objects::toString,
typeClass,
<BUG>String.class,
new DefaultLoadEstimator(1, 1, .99d, (in, out) -> 10 * in[0]),
new DefaultLoadEstimator(1, 1, .99d, (in, out) -> 1000)
)</BUG>
);
| new NestableLoadProfileEstimator(
|
43,548 | package org.qcri.rheem.core.function;
import org.qcri.rheem.core.optimizer.ProbabilisticDoubleInterval;
<BUG>import org.qcri.rheem.core.optimizer.costs.LoadEstimator;
</BUG>
import org.qcri.rheem.core.types.BasicDataUnitType;
import org.qcri.rheem.core.types.DataUnitType;
import java.util.Optional;
| import org.qcri.rheem.core.optimizer.costs.LoadProfileEstimator;
|
43,549 | private final SerializableFunction<Iterable<Input>, Iterable<Output>> javaImplementation;
private ProbabilisticDoubleInterval selectivity;
public MapPartitionsDescriptor(SerializableFunction<Iterable<Input>, Iterable<Output>> javaImplementation,
Class<Input> inputTypeClass,
Class<Output> outputTypeClass) {
<BUG>this(javaImplementation, inputTypeClass, outputTypeClass, null);
</BUG>
}
public MapPartitionsDescriptor(SerializableFunction<Iterable<Input>, Iterable<Output>> javaImplementation,
Class<Input> inputTypeClass,
| this(javaImplementation, inputTypeClass, outputTypeClass, (ProbabilisticDoubleInterval) null);
|
43,550 | package org.qcri.rheem.core.function;
import org.qcri.rheem.core.optimizer.ProbabilisticDoubleInterval;
<BUG>import org.qcri.rheem.core.optimizer.costs.LoadEstimator;
</BUG>
import org.qcri.rheem.core.types.BasicDataUnitType;
import java.util.Optional;
public class PredicateDescriptor<Input> extends FunctionDescriptor {
| import org.qcri.rheem.core.optimizer.costs.LoadProfileEstimator;
|
43,551 | private final SerializablePredicate<Input> javaImplementation;
private String sqlImplementation;
private ProbabilisticDoubleInterval selectivity;
public PredicateDescriptor(SerializablePredicate<Input> javaImplementation,
Class<Input> inputTypeClass) {
<BUG>this(javaImplementation, inputTypeClass, null);
</BUG>
}
public PredicateDescriptor(SerializablePredicate<Input> javaImplementation,
Class<Input> inputTypeClass,
| this(javaImplementation, inputTypeClass, (ProbabilisticDoubleInterval) null);
|
43,552 | package org.qcri.rheem.core.function;
<BUG>import org.qcri.rheem.core.optimizer.costs.LoadEstimator;
import org.qcri.rheem.core.types.BasicDataUnitType;</BUG>
import org.qcri.rheem.core.types.DataUnitGroupType;
import org.qcri.rheem.core.types.DataUnitType;
import java.util.Iterator;
| import org.qcri.rheem.core.optimizer.costs.LoadProfileEstimator;
import org.qcri.rheem.core.optimizer.costs.NestableLoadProfileEstimator;
import org.qcri.rheem.core.types.BasicDataUnitType;
|
43,553 | CloudantClient client = CloudantClientHelper.newTestAddressClient()
.proxyURL(server.url("/").url())
.proxyUser(mockProxyUser)
.proxyPassword(mockProxyPass)
.build();
<BUG>client.executeRequest(Http.GET(client.getBaseUri()));
RecordedRequest request = server.takeRequest(10, TimeUnit.SECONDS);</BUG>
String proxyAuthHeader = request.getHeader("Proxy-Authorization");
assertNotNull("The Proxy-Authorization header should be present", proxyAuthHeader);
Matcher m = Pattern.compile("Basic (.*)", Pattern
| String response = client.executeRequest(Http.GET(client.getBaseUri())).responseAsString();
assertTrue("There should be no response body on the mock response", response.isEmpty());
RecordedRequest request = server.takeRequest(10, TimeUnit.SECONDS);
|
43,554 | import com.cloudant.http.HttpConnection;
import com.cloudant.test.main.RequiresDB;
import com.cloudant.tests.util.CloudantClientResource;
import com.cloudant.tests.util.DatabaseResource;
import com.cloudant.tests.util.Utils;
<BUG>import org.apache.commons.codec.binary.Base64;
import org.junit.BeforeClass;</BUG>
import org.junit.ClassRule;
import org.junit.Test;
import org.junit.experimental.categories.Category;
| import org.apache.commons.io.IOUtils;
import org.junit.BeforeClass;
|
43,555 | Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain");
Document doc = db.find(Document.class, response.getId());
assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), "foo.txt"));
<BUG>InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
int n;
while ((n = in.read()) != -1) {
bytesOut.write(n);
}
bytesOut.flush();
in.close();</BUG>
byte[] bytesFromDB = bytesOut.toByteArray();
| try {
IOUtils.copy(in, bytesOut);
assertArrayEquals(bytesToDB, bytesFromDB);
} finally {
in.close();
|
43,556 | .getRev());
Document doc = db.find(Document.class, response.getId(), response.getRev());
assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), "foo.txt"));
<BUG>InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
int n;
while ((n = in.read()) != -1) {
bytesOut.write(n);
}
bytesOut.flush();
in.close();</BUG>
byte[] bytesFromDB = bytesOut.toByteArray();
| try {
IOUtils.copy(in, bytesOut);
assertArrayEquals(bytesToDB, bytesFromDB);
} finally {
in.close();
|
43,557 | assertNull("There should be no error saving the attachment", attResponse.getError());
Document doc = db.find(Document.class, response.getId(), attResponse.getRev());
assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), attResponse.getRev(), "foo.txt"));
<BUG>InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
int n;
while ((n = in.read()) != -1) {
bytesOut.write(n);
}
bytesOut.flush();
in.close();</BUG>
byte[] bytesFromDB = bytesOut.toByteArray();
| try {
IOUtils.copy(in, bytesOut);
assertArrayEquals(bytesToDB, bytesFromDB);
} finally {
in.close();
|
43,558 | Response response = db.saveAttachment(bytesIn, "foo.txt", "text/plain", null, null);
Document doc = db.find(Document.class, response.getId());
assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), "foo.txt"));
<BUG>InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
int n;
while ((n = in.read()) != -1) {
bytesOut.write(n);
}
bytesOut.flush();
in.close();</BUG>
byte[] bytesFromDB = bytesOut.toByteArray();
| try {
IOUtils.copy(in, bytesOut);
assertArrayEquals(bytesToDB, bytesFromDB);
} finally {
in.close();
|
43,559 | assertEquals("The saved document ID should match", docId, response.getId());
Document doc = db.find(Document.class, response.getId());
assertTrue(doc.getAttachments().containsKey("foo.txt"));
HttpConnection conn = Http.GET(new DatabaseURIHelper(db.getDBUri())
.attachmentUri(response.getId(), "foo.txt"));
<BUG>InputStream in = clientResource.get().executeRequest(conn).responseAsInputStream();
ByteArrayOutputStream bytesOut = new ByteArrayOutputStream();
int n;
while ((n = in.read()) != -1) {
bytesOut.write(n);
}
bytesOut.flush();
in.close();</BUG>
byte[] bytesFromDB = bytesOut.toByteArray();
| try {
IOUtils.copy(in, bytesOut);
assertArrayEquals(bytesToDB, bytesFromDB);
} finally {
in.close();
|
43,560 | }
bytesOut.flush();
in.close();</BUG>
byte[] bytesFromDB = bytesOut.toByteArray();
<BUG>assertArrayEquals(bytesToDB, bytesFromDB);
}</BUG>
@Test(expected = IllegalArgumentException.class)
public void attachmentStandaloneNullDocNonNullRev() {
byte[] bytesToDB = "binary data".getBytes();
ByteArrayInputStream bytesIn = new ByteArrayInputStream(bytesToDB);
| [DELETED] |
43,561 | server.start();
server.enqueue(new MockResponse());
try {
CloudantClient client = CloudantClientHelper.newMockWebServerClientBuilder(server)
.build();
<BUG>client.executeRequest(createPost(client.getBaseUri(), null, "application/json"));
String userAgentHeader = server.takeRequest(10, TimeUnit.SECONDS)</BUG>
.getHeader("User-Agent");
assertNotNull("The User-Agent header should be present on the request",
| String response = client.executeRequest(createPost(client.getBaseUri(), null,
"application/json")).responseAsString();
assertTrue("There should be no response body on the mock response", response.isEmpty());
String userAgentHeader = server.takeRequest(10, TimeUnit.SECONDS)
|
43,562 | 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);
|
43,563 | 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(
|
43,564 | class LexerMatch {
private final List<Terminal> terminals;
LexerMatch() { this.terminals = null; }
LexerMatch(final List<Terminal> terminals) { this.terminals = terminals; }
public List<Terminal> getTerminals() { return this.terminals; }
<BUG>public void append(final Terminal terminal) {this.terminals.add(terminal);}
}</BUG>
abstract class TokenMatchCallback implements Callable<LexerMatch> {
protected Terminal terminal;
| public void add(final Terminal terminal) {this.terminals.add(terminal);}
public void addAll(final List<Terminal> terminals) {this.terminals.addAll(terminals);}
public void addAll(final LexerMatch match) {this.terminals.addAll(match.getTerminals());}
|
43,565 | } else {
updateMemo();
callback.updateMemo();
}
dismiss();
<BUG>}else{
</BUG>
Toast.makeText(getActivity(), getString(R.string.toast_memo_empty), Toast.LENGTH_SHORT).show();
}
}
| [DELETED] |
43,566 | }
@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);
|
43,567 | 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);
|
43,568 | 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(
|
43,569 | 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 {
|
43,570 | 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;
|
43,571 | 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) {
|
43,572 | 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;
|
43,573 | package com.projecttango.examples.java.augmentedreality;
import com.google.atap.tangoservice.Tango;
import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoCameraIntrinsics;
import com.google.atap.tangoservice.TangoConfig;
<BUG>import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoEvent;</BUG>
import com.google.atap.tangoservice.TangoOutOfDateException;
import com.google.atap.tangoservice.TangoPoseData;
import com.google.atap.tangoservice.TangoXyzIjData;
| import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
|
43,574 | super.onResume();
if (!mIsConnected) {
mTango = new Tango(AugmentedRealityActivity.this, new Runnable() {
@Override
public void run() {
<BUG>try {
connectTango();</BUG>
setupRenderer();
mIsConnected = true;
} catch (TangoOutOfDateException e) {
| TangoSupport.initialize();
connectTango();
|
43,575 | if (lastFramePose.statusCode == TangoPoseData.POSE_VALID) {
mRenderer.updateRenderCameraPose(lastFramePose, mExtrinsics);
mCameraPoseTimestamp = lastFramePose.timestamp;</BUG>
} else {
<BUG>Log.w(TAG, "Can't get device pose at time: " + mRgbTimestampGlThread);
}</BUG>
}
}
}
@Override
| mRenderer.updateRenderCameraPose(lastFramePose);
mCameraPoseTimestamp = lastFramePose.timestamp;
Log.w(TAG, "Can't get device pose at time: " +
|
43,576 | import org.rajawali3d.materials.Material;
import org.rajawali3d.materials.methods.DiffuseMethod;
import org.rajawali3d.materials.textures.ATexture;
import org.rajawali3d.materials.textures.StreamingTexture;
import org.rajawali3d.materials.textures.Texture;
<BUG>import org.rajawali3d.math.Matrix4;
import org.rajawali3d.math.vector.Vector3;</BUG>
import org.rajawali3d.primitives.ScreenQuad;
import org.rajawali3d.primitives.Sphere;
import org.rajawali3d.renderer.RajawaliRenderer;
| import org.rajawali3d.math.Quaternion;
import org.rajawali3d.math.vector.Vector3;
|
43,577 | translationMoon.setRepeatMode(Animation.RepeatMode.INFINITE);
translationMoon.setTransformable3D(moon);
getCurrentScene().registerAnimation(translationMoon);
translationMoon.play();
}
<BUG>public void updateRenderCameraPose(TangoPoseData devicePose, DeviceExtrinsics extrinsics) {
Pose cameraPose = ScenePoseCalculator.toOpenGlCameraPose(devicePose, extrinsics);
getCurrentCamera().setRotation(cameraPose.getOrientation());
getCurrentCamera().setPosition(cameraPose.getPosition());
}</BUG>
public int getTextureId() {
| public void updateRenderCameraPose(TangoPoseData cameraPose) {
float[] rotation = cameraPose.getRotationAsFloats();
float[] translation = cameraPose.getTranslationAsFloats();
Quaternion quaternion = new Quaternion(rotation[3], rotation[0], rotation[1], rotation[2]);
getCurrentCamera().setRotation(quaternion.conjugate());
getCurrentCamera().setPosition(translation[0], translation[1], translation[2]);
|
43,578 | package com.projecttango.examples.java.helloareadescription;
import com.google.atap.tangoservice.Tango;
<BUG>import com.google.atap.tangoservice.Tango.OnTangoUpdateListener;
import com.google.atap.tangoservice.TangoConfig;</BUG>
import com.google.atap.tangoservice.TangoCoordinateFramePair;
import com.google.atap.tangoservice.TangoErrorException;
import com.google.atap.tangoservice.TangoEvent;
| import com.google.atap.tangoservice.TangoAreaDescriptionMetaData;
import com.google.atap.tangoservice.TangoConfig;
|
43,579 | public static final Icon ABSTRACT_CLASS_ICON = IconLoader.getIcon("/nodes/abstractClass.png");
public static final Icon JUNIT_TEST_CLASS_ICON = IconLoader.getIcon("/nodes/junitTestClass.png");
public static final Icon ANNOTATION_TYPE_ICON = IconLoader.getIcon("/nodes/annotationtype.png");
public static final Icon ENUM_ICON = IconLoader.getIcon("/nodes/enum.png");
public static final Icon INTERFACE_ICON = IconLoader.getIcon("/nodes/interface.png");
<BUG>public static final Icon METHOD_ICON = IconLoader.getIcon("/nodes/method.png");
public static final Icon ABSTRACT_METHOD_ICON = IconLoader.getIcon("/nodes/abstractMethod.png");</BUG>
public static final Icon FIELD_ICON = IconLoader.getIcon("/nodes/field.png");
public static final Icon PARAMETER_ICON = IconLoader.getIcon("/nodes/parameter.png");
public static final Icon VARIABLE_ICON = IconLoader.getIcon("/nodes/variable.png");
| public static final Icon FUNCTION_ICON = METHOD_ICON;
public static final Icon ABSTRACT_METHOD_ICON = IconLoader.getIcon("/nodes/abstractMethod.png");
|
43,580 | return TypeConversionUtil.isAssignable(this, type);
}
public boolean isConvertibleFrom(@NotNull PsiType type) {
return TypeConversionUtil.areTypesConvertible(type, this);
}
<BUG>public abstract boolean equalsToText(@NonNls String text);
public static PsiClassType getJavaLangObject(PsiManager manager, GlobalSearchScope resolveScope) {</BUG>
return JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createTypeByFQClassName(CommonClassNames.JAVA_LANG_OBJECT, resolveScope);
}
public static PsiClassType getJavaLangClass(PsiManager manager, GlobalSearchScope resolveScope) {
| @NotNull
public static PsiClassType getJavaLangObject(PsiManager manager, GlobalSearchScope resolveScope) {
|
43,581 | public static PsiClassType getJavaLangClass(PsiManager manager, GlobalSearchScope resolveScope) {
return JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createTypeByFQClassName(CommonClassNames.JAVA_LANG_CLASS, resolveScope);
}
public static PsiClassType getJavaLangTrowable(PsiManager manager, GlobalSearchScope resolveScope) {
return JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createTypeByFQClassName(CommonClassNames.JAVA_LANG_THROWABLE, resolveScope);
<BUG>}
public static PsiClassType getJavaLangString(PsiManager manager, GlobalSearchScope resolveScope) {</BUG>
return JavaPsiFacade.getInstance(manager.getProject()).getElementFactory().createTypeByFQClassName(CommonClassNames.JAVA_LANG_STRING, resolveScope);
}
public static PsiClassType getJavaLangError(PsiManager manager, GlobalSearchScope resolveScope) {
| @NotNull
public static PsiClassType getJavaLangString(PsiManager manager, GlobalSearchScope resolveScope) {
|
43,582 | public ReportElement getBase() {
return base;
}
@Override
public float print(PDDocument document, PDPageContentStream stream, int pageNumber, float startX, float startY, float allowedWidth) throws IOException {
<BUG>PDPage currPage = (PDPage) document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, true, false);
</BUG>
base.print(document, pageStream, pageNo, x, y, width);
pageStream.close();
| PDPage currPage = document.getDocumentCatalog().getPages().get(pageNo);
PDPageContentStream pageStream = new PDPageContentStream(document, currPage, PDPageContentStream.AppendMode.APPEND, false);
|
43,583 | public PdfTextStyle(String config) {
Assert.hasText(config);
String[] split = config.split(",");
Assert.isTrue(split.length == 3, "config must look like: 10,Times-Roman,#000000");
fontSize = Integer.parseInt(split[0]);
<BUG>font = resolveStandard14Name(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));</BUG>
}
public int getFontSize() {
return fontSize;
| font = getFont(split[1]);
color = new Color(Integer.valueOf(split[2].substring(1), 16));
|
43,584 | package cc.catalysts.boot.report.pdf.elements;
import cc.catalysts.boot.report.pdf.config.PdfTextStyle;
import cc.catalysts.boot.report.pdf.utils.ReportAlignType;
import org.apache.pdfbox.pdmodel.PDPageContentStream;
<BUG>import org.apache.pdfbox.pdmodel.font.PDFont;
import org.slf4j.Logger;</BUG>
import org.slf4j.LoggerFactory;
import org.springframework.util.StringUtils;
import java.io.IOException;
| import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.apache.pdfbox.util.Matrix;
import org.slf4j.Logger;
|
43,585 | addTextSimple(stream, textConfig, textX, nextLineY, "");
return nextLineY;
}
try {
<BUG>String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, fixedText);
</BUG>
float x = calculateAlignPosition(textX, align, textConfig, allowedWidth, split[0]);
if (!underline) {
addTextSimple(stream, textConfig, x, nextLineY, split[0]);
} else {
| String[] split = splitText(textConfig.getFont(), textConfig.getFontSize(), allowedWidth, text);
|
43,586 | public static void addTextSimple(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
try {
stream.setFont(textConfig.getFont(), textConfig.getFontSize());
stream.setNonStrokingColor(textConfig.getColor());
stream.beginText();
<BUG>stream.newLineAtOffset(textX, textY);
stream.showText(text);</BUG>
} catch (Exception e) {
LOG.warn("Could not add text: " + e.getClass() + " - " + e.getMessage());
}
| stream.setTextMatrix(new Matrix(1,0,0,1, textX, textY));
stream.showText(text);
|
43,587 | public static void addTextSimpleUnderlined(PDPageContentStream stream, PdfTextStyle textConfig, float textX, float textY, String text) {
addTextSimple(stream, textConfig, textX, textY, text);
try {
float lineOffset = textConfig.getFontSize() / 8F;
stream.setStrokingColor(textConfig.getColor());
<BUG>stream.setLineWidth(0.5F);
stream.drawLine(textX, textY - lineOffset, textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
</BUG>
stream.stroke();
} catch (IOException e) {
| stream.moveTo(textX, textY - lineOffset);
stream.lineTo(textX + getTextWidth(textConfig.getFont(), textConfig.getFontSize(), text), textY - lineOffset);
|
43,588 | list.add(text.length());
return list;
}
public static String[] splitText(PDFont font, int fontSize, float allowedWidth, String text) {
String endPart = "";
<BUG>String shortenedText = text;
List<String> breakSplitted = Arrays.asList(shortenedText.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {</BUG>
String[] splittedFirst = splitText(font, fontSize, allowedWidth, breakSplitted.get(0));
StringBuilder remaining = new StringBuilder(splittedFirst[1] == null ? "" : splittedFirst[1] + "\n");
| List<String> breakSplitted = Arrays.asList(text.split("(\\r\\n)|(\\n)|(\\n\\r)")).stream().collect(Collectors.toList());
if (breakSplitted.size() > 1) {
|
43,589 | package cc.catalysts.boot.report.pdf.elements;
import org.apache.pdfbox.pdmodel.PDDocument;
<BUG>import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
import java.io.IOException;</BUG>
import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedList;
| import org.apache.pdfbox.pdmodel.PDPageContentStream;
import java.io.IOException;
|
43,590 | import com.intellij.openapi.util.TextRange;
import com.intellij.psi.*;
import com.intellij.psi.codeStyle.CodeStyleManager;
import com.intellij.psi.util.FileTypeUtils;
import com.intellij.util.IncorrectOperationException;
<BUG>import org.jetbrains.annotations.NonNls;
public class JavaWithIfExpressionSurrounder extends JavaBooleanExpressionSurrounder {</BUG>
@Override
public boolean isApplicable(PsiExpression expr) {
if (!super.isApplicable(expr)) return false;
| import org.jetbrains.annotations.NotNull;
public class JavaWithIfExpressionSurrounder extends JavaBooleanExpressionSurrounder {
|
43,591 | import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.lang.reflect.Type;
import java.util.Collection;
import java.util.Map;
<BUG>import java.util.Set;
import java.util.concurrent.TimeUnit;</BUG>
import java.util.concurrent.atomic.AtomicLong;
import javax.annotation.Nullable;
public class DistributedStreamService extends AbstractStreamService {
| import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.TimeUnit;
|
43,592 | private final NotificationService notificationService;
private final NotificationFeedManager feedManager;
private final Set<StreamLeaderListener> leaderListeners;
private final int instanceId;
private Cancellable leaderListenerCancellable;
<BUG>private final Map<String, StreamSizeAggregator> aggregators;
</BUG>
private Cancellable heartbeatsSubscription;
private boolean isInit;
private Supplier<Discoverable> discoverableSupplier;
| private final ConcurrentMap<String, StreamSizeAggregator> aggregators;
|
43,593 | this.streamFeed = new NotificationFeed.Builder()
.setNamespace(Constants.DEFAULT_NAMESPACE)
.setCategory(Constants.Notification.Stream.STREAM_FEED_CATEGORY)
.setName(streamName)
.build();
<BUG>this.truncationSubscription = getStreamCoordinatorClient().addListener(streamName, new StreamPropertyListener() {
@Override
public void generationChanged(String streamName, int generation) {
reset();
}
});</BUG>
}
| [DELETED] |
43,594 | return;
}
streamWriterSizes.put(instanceId, lastSize + nbBytes);
checkSendNotification();
}
<BUG>@Override
public void cancel() {
truncationSubscription.cancel();
}</BUG>
private void checkSendNotification() {
| [DELETED] |
43,595 | publishNotification(sum);
} finally {
streamBaseCount.set(sum);
}
}
<BUG>}
private void reset() {
streamWriterSizes.clear();
streamBaseCount.set(0);</BUG>
}
| [DELETED] |
43,596 | import com.google.common.collect.Maps;
import com.google.inject.Inject;
import org.apache.twill.common.Cancellable;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<BUG>import java.util.Map;
import java.util.concurrent.atomic.AtomicLong;</BUG>
public class LocalStreamService extends AbstractStreamService {
private static final Logger LOG = LoggerFactory.getLogger(LocalStreamService.class);
private final NotificationService notificationService;
| import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.AtomicLong;
|
43,597 | private static final Logger LOG = LoggerFactory.getLogger(LocalStreamService.class);
private final NotificationService notificationService;
private final StreamAdmin streamAdmin;
private final StreamWriterSizeCollector streamWriterSizeCollector;
private final StreamMetaStore streamMetaStore;
<BUG>private final Map<String, Aggregator> aggregators;
</BUG>
private boolean isInit;
@Inject
public LocalStreamService(StreamCoordinatorClient streamCoordinatorClient,
| private final ConcurrentMap<String, StreamSizeAggregator> aggregators;
|
43,598 | }</BUG>
}
@Override
protected void doShutdown() throws Exception {
<BUG>for (Aggregator aggregator : aggregators.values()) {
aggregator.cancel();
</BUG>
}
}
| protected void initialize() throws Exception {
for (StreamSpecification streamSpec : streamMetaStore.listStreams()) {
StreamConfig config = streamAdmin.getConfig(streamSpec.getName());
long filesSize = StreamUtils.fetchStreamFilesSize(config);
createSizeAggregator(streamSpec.getName(), filesSize);
for (StreamSizeAggregator streamSizeAggregator : aggregators.values()) {
streamSizeAggregator.cancel();
|
43,599 | package org.eclipse.emf.compare.ide.ui.tests.unit;
<BUG>import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;</BUG>
import java.io.File;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
| [DELETED] |
43,600 | resolver.dispose();
super.tearDown();
}
@Test
public void testScopeNoDependencies() throws Exception {
<BUG>StorageTraversal traversal = resolver.resolveLocalModel(iFile1, monitor);
assertEquals(1, traversal.getStorages().size());
assertTrue(traversal.getStorages().contains(iFile1));
traversal = resolver.resolveLocalModel(iFile2, monitor);
assertEquals(1, traversal.getStorages().size());
assertTrue(traversal.getStorages().contains(iFile2));
traversal = resolver.resolveLocalModel(iFile3, monitor);
assertEquals(1, traversal.getStorages().size());
assertTrue(traversal.getStorages().contains(iFile3));</BUG>
}
| [DELETED] |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.