id int64 1 49k | buggy stringlengths 34 37.5k | fixed stringlengths 2 37k |
|---|---|---|
9,401 | import org.apache.cassandra.db.*;
import org.apache.cassandra.db.index.SecondaryIndexManager;</BUG>
import org.apache.cassandra.io.sstable.ColumnStats;
import org.apache.cassandra.io.sstable.SSTableIdentityIterator;
import org.apache.cassandra.io.util.DataOutputBuffer;
<BUG>import org.apache.cassandra.utils.HeapAllocator;
public class PrecompactedRow extends AbstractCompactedRow</BUG>
{
private final ColumnFamily compactedCf;
| import org.apache.cassandra.db.columniterator.IdentityQueryFilter;
import org.apache.cassandra.db.filter.IDiskAtomFilter;
import org.apache.cassandra.db.index.SecondaryIndexManager;
import org.apache.cassandra.utils.CloseableIterator;
import org.apache.cassandra.utils.FBUtilities;
import org.apache.cassandra.utils.MergeIterator;
public class PrecompactedRow extends AbstractCompactedRow
|
9,402 | tombstone = (RangeTombstone)current;
}
else
{
Column column = (Column) current;
<BUG>container.addColumn(column);
if (container.getColumn(column.name()) != column)
indexer.remove(column);
}</BUG>
}
| if (indexer != SecondaryIndexManager.nullUpdater
&& !column.isMarkedForDelete()
&& container.getColumn(column.name()) != column)
|
9,403 | rm.delete(cfName, ByteBufferUtil.bytes("c2"), 9);
rm.apply();
cfs.forceBlockingFlush();
cfs.getCompactionStrategy().getUserDefinedTask(sstablesIncomplete, Integer.MAX_VALUE).execute(null);
ColumnFamily cf = cfs.getColumnFamily(QueryFilter.getIdentityFilter(key3, cfName));
<BUG>Assert.assertTrue(!cf.getColumn(ByteBufferUtil.bytes("c2")).isLive());
</BUG>
Assert.assertEquals(2, cf.getColumnCount());
}
@Test
| Assert.assertFalse(cf.getColumn(ByteBufferUtil.bytes("c2")).isLive());
|
9,404 | <BUG>package org.sonar.api.resources;
import com.google.common.collect.Lists;</BUG>
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.FilenameUtils;
import org.apache.commons.io.filefilter.*;
| import com.google.common.base.Predicate;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.google.common.collect.Lists;
|
9,405 | <BUG>package org.sonar.batch;
import org.apache.commons.io.FileUtils;</BUG>
import org.apache.maven.project.MavenProject;
import org.sonar.api.resources.DefaultProjectFileSystem;
import org.sonar.api.resources.Languages;
| import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import org.apache.commons.io.FileUtils;
|
9,406 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
9,407 | final int lineStride = dst.getScanlineStride();
final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final byte[][] data = dst.getByteDataArrays();
final float[] warpData = new float[2 * dstWidth];
<BUG>int lineOffset = 0;
if (ctable == null) { // source does not have IndexColorModel
if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
9,408 | pixelOffset += pixelStride;
} // COLS LOOP
} // ROWS LOOP
}
} else {// source has IndexColorModel
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| } else if (caseB) {
for (int h = 0; h < dstHeight; h++) {
|
9,409 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
9,410 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
9,411 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
9,412 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final short[][] data = dst.getShortDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
9,413 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
9,414 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final int[][] data = dst.getIntDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
9,415 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
9,416 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final float[][] data = dst.getFloatDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
9,417 | minX = src.getMinX();
maxX = src.getMaxX();
minY = src.getMinY();
maxY = src.getMaxY();
} else {
<BUG>iterSource = RandomIterFactory.create(src, src.getBounds(), TILE_CACHED, ARRAY_CALC);
minX = src.getMinX() + 1; // Left padding
maxX = src.getMaxX() - 2; // Right padding
minY = src.getMinY() + 1; // Top padding
maxY = src.getMaxY() - 2; // Bottom padding
</BUG>
}
| iterSource = getRandomIterator(src, null);
minX = src.getMinX() + leftPad; // Left padding
maxX = src.getMaxX() - rightPad; // Right padding
minY = src.getMinY() + topPad; // Top padding
maxY = src.getMaxY() - bottomPad; // Bottom padding
|
9,418 | final int pixelStride = dst.getPixelStride();
final int[] bandOffsets = dst.getBandOffsets();
final double[][] data = dst.getDoubleDataArrays();
final float[] warpData = new float[2 * dstWidth];
int lineOffset = 0;
<BUG>if (caseA) {
for (int h = 0; h < dstHeight; h++) {</BUG>
int pixelOffset = lineOffset;
lineOffset += lineStride;
warp.warpRect(dst.getX(), dst.getY() + h, dstWidth, 1, warpData);
| if(hasROI && !roiContainsTile && roiIter == null){
throw new IllegalArgumentException("Error on creating the ROI iterator");
}
if (caseA || (caseB && roiContainsTile)) {
for (int h = 0; h < dstHeight; h++) {
|
9,419 | import java.util.Locale;
import java.util.Map;
import java.util.TreeMap;
public class DependencyConvergenceReport
extends AbstractProjectInfoReport
<BUG>{
private List reactorProjects;
private static final int PERCENTAGE = 100;</BUG>
public String getOutputName()
{
| private static final int PERCENTAGE = 100;
private static final List SUPPORTED_FONT_FAMILY_NAMES = Arrays.asList( GraphicsEnvironment
.getLocalGraphicsEnvironment().getAvailableFontFamilyNames() );
|
9,420 | sink.section1();
sink.sectionTitle1();
sink.text( getI18nString( locale, "title" ) );
sink.sectionTitle1_();
Map dependencyMap = getDependencyMap();
<BUG>generateLegend( locale, sink );
generateStats( locale, sink, dependencyMap );
generateConvergence( locale, sink, dependencyMap );
sink.section1_();</BUG>
sink.body_();
| sink.lineBreak();
sink.section1_();
|
9,421 | Iterator it = artifactMap.keySet().iterator();
while ( it.hasNext() )
{
String version = (String) it.next();
sink.tableRow();
<BUG>sink.tableCell();
sink.text( version );</BUG>
sink.tableCell_();
sink.tableCell();
generateVersionDetails( sink, artifactMap, version );
| sink.tableCell( String.valueOf( cellWidth ) + "px" );
sink.text( version );
|
9,422 | sink.tableCell();
sink.text( getI18nString( locale, "legend.shared" ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableCell();
iconError( sink );</BUG>
sink.tableCell_();
sink.tableCell();
sink.text( getI18nString( locale, "legend.different" ) );
| sink.tableCell( "15px" ); // according /images/icon_error_sml.gif
iconError( sink );
|
9,423 | sink.tableCaption();
sink.text( getI18nString( locale, "stats.caption" ) );
sink.tableCaption_();</BUG>
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.subprojects" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
| sink.bold();
sink.bold_();
sink.tableCaption_();
sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.subprojects" ) );
sink.tableHeaderCell_();
|
9,424 | sink.tableCell();
sink.text( String.valueOf( reactorProjects.size() ) );
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.dependencies" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
sink.text( String.valueOf( depCount ) );
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.dependencies" ) );
sink.tableHeaderCell_();
|
9,425 | sink.text( String.valueOf( convergence ) + "%" );
sink.bold_();
sink.tableCell_();
sink.tableRow_();
sink.tableRow();
<BUG>sink.tableHeaderCell();
sink.text( getI18nString( locale, "stats.readyrelease" ) + ":" );
sink.tableHeaderCell_();</BUG>
sink.tableCell();
if ( convergence >= PERCENTAGE && snapshotCount <= 0 )
| sink.tableHeaderCell( headerCellWidth );
sink.text( getI18nString( locale, "stats.readyrelease" ) );
sink.tableHeaderCell_();
|
9,426 | {
ReverseDependencyLink p1 = (ReverseDependencyLink) o1;
ReverseDependencyLink p2 = (ReverseDependencyLink) o2;
return p1.getProject().getId().compareTo( p2.getProject().getId() );
}
<BUG>else
{</BUG>
return 0;
}
}
| iconError( sink );
|
9,427 | package com.cronutils.model.time.generator;
import java.util.Collections;
<BUG>import java.util.List;
import org.apache.commons.lang3.Validate;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.expression.FieldExpression;
public abstract class FieldValueGenerator {
| import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.Validate;
|
9,428 | import java.util.ResourceBundle;
import java.util.function.Function;</BUG>
class DescriptionStrategyFactory {
private DescriptionStrategyFactory() {}
public static DescriptionStrategy daysOfWeekInstance(final ResourceBundle bundle, final FieldExpression expression) {
<BUG>final Function<Integer, String> nominal = integer -> new DateTime().withDayOfWeek(integer).dayOfWeek().getAsText(bundle.getLocale());
</BUG>
NominalDescriptionStrategy dow = new NominalDescriptionStrategy(bundle, nominal, expression);
dow.addDescription(fieldExpression -> {
if (fieldExpression instanceof On) {
| import java.util.function.Function;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
final Function<Integer, String> nominal = integer -> DayOfWeek.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale());
|
9,429 | return dom;
}
public static DescriptionStrategy monthsInstance(final ResourceBundle bundle, final FieldExpression expression) {
return new NominalDescriptionStrategy(
bundle,
<BUG>integer -> new DateTime().withMonthOfYear(integer).monthOfYear().getAsText(bundle.getLocale()),
expression</BUG>
);
}
public static DescriptionStrategy plainInstance(ResourceBundle bundle, final FieldExpression expression) {
| integer -> Month.of(integer).getDisplayName(TextStyle.FULL, bundle.getLocale()),
expression
|
9,430 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.mapper.WeekDay;</BUG>
import com.cronutils.model.field.CronField;
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.constraint.FieldConstraintsBuilder;
| import java.time.LocalDate;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.apache.commons.lang3.Validate;
import com.cronutils.mapper.WeekDay;
|
9,431 | import com.cronutils.model.field.expression.Between;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.parser.CronParserField;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
import java.util.Collections;
import java.util.List;
import java.util.Set;</BUG>
class BetweenDayOfWeekValueGenerator extends FieldValueGenerator {
| [DELETED] |
9,432 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
| import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import org.apache.commons.lang3.Validate;
import com.cronutils.model.field.CronField;
|
9,433 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.CronFieldName;
import com.cronutils.model.field.expression.FieldExpression;
import com.cronutils.model.field.expression.On;
import com.google.common.collect.Lists;
<BUG>import org.apache.commons.lang3.Validate;
import org.joda.time.DateTime;
import java.util.List;</BUG>
class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
| package com.cronutils.model.time.generator;
import java.time.DayOfWeek;
import java.time.LocalDate;
import java.util.List;
import com.cronutils.model.field.CronField;
|
9,434 | class OnDayOfMonthValueGenerator extends FieldValueGenerator {
private int year;
private int month;
public OnDayOfMonthValueGenerator(CronField cronField, int year, int month) {
super(cronField);
<BUG>Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of month");
this.year = year;</BUG>
this.month = month;
}
| Validate.isTrue(CronFieldName.DAY_OF_MONTH.equals(cronField.getField()), "CronField does not belong to day of" +
" month");
this.year = year;
|
9,435 | package com.cronutils.mapper;
public class ConstantsMapper {
private ConstantsMapper() {}
public static final WeekDay QUARTZ_WEEK_DAY = new WeekDay(2, false);
<BUG>public static final WeekDay JODATIME_WEEK_DAY = new WeekDay(1, false);
</BUG>
public static final WeekDay CRONTAB_WEEK_DAY = new WeekDay(1, true);
public static int weekDayMapping(WeekDay source, WeekDay target, int weekday){
return source.mapTo(weekday, target);
| public static final WeekDay JAVA8 = new WeekDay(1, false);
|
9,436 | return nextMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>DateTime nextClosestMatch(DateTime date) throws NoSuchValueException {
</BUG>
List<Integer> year = yearsValueGenerator.generateCandidates(date.getYear(), date.getYear());
TimeNode days = null;
int lowestMonth = months.getValues().get(0);
| ZonedDateTime nextClosestMatch(ZonedDateTime date) throws NoSuchValueException {
|
9,437 | boolean questionMarkSupported =
cronDefinition.getFieldDefinition(DAY_OF_WEEK).getConstraints().getSpecialChars().contains(QUESTION_MARK);
if(questionMarkSupported){
return new TimeNode(
generateDayCandidatesQuestionMarkSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
9,438 | )
);
}else{
return new TimeNode(
generateDayCandidatesQuestionMarkNotSupported(
<BUG>date.getYear(), date.getMonthOfYear(),
</BUG>
((DayOfWeekFieldDefinition)
cronDefinition.getFieldDefinition(DAY_OF_WEEK)
).getMondayDoWValue()
| date.getYear(), date.getMonthValue(),
|
9,439 | }
public DateTime lastExecution(DateTime date){
</BUG>
Validate.notNull(date);
try {
<BUG>DateTime previousMatch = previousClosestMatch(date);
</BUG>
if(previousMatch.equals(date)){
previousMatch = previousClosestMatch(date.minusSeconds(1));
}
| public java.time.Duration timeToNextExecution(ZonedDateTime date){
return java.time.Duration.between(date, nextExecution(date));
public ZonedDateTime lastExecution(ZonedDateTime date){
ZonedDateTime previousMatch = previousClosestMatch(date);
|
9,440 | return previousMatch;
} catch (NoSuchValueException e) {
throw new IllegalArgumentException(e);
}
}
<BUG>public Duration timeFromLastExecution(DateTime date){
return new Interval(lastExecution(date), date).toDuration();
}
public boolean isMatch(DateTime date){
</BUG>
return nextExecution(lastExecution(date)).equals(date);
| [DELETED] |
9,441 | <BUG>package com.cronutils.model.time.generator;
import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
| import java.time.ZonedDateTime;
import java.util.List;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cronutils.model.field.CronField;
|
9,442 | import com.cronutils.model.field.CronField;</BUG>
import com.cronutils.model.field.expression.Every;
import com.cronutils.model.field.expression.FieldExpression;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.Lists;
<BUG>import org.joda.time.DateTime;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;</BUG>
class EveryFieldValueGenerator extends FieldValueGenerator {
| package com.cronutils.model.time.generator;
import java.time.ZonedDateTime;
import java.util.List;
import com.cronutils.model.field.CronField;
|
9,443 | private static final Logger log = LoggerFactory.getLogger(EveryFieldValueGenerator.class);
public EveryFieldValueGenerator(CronField cronField) {
super(cronField);
log.trace(String.format(
"processing \"%s\" at %s",
<BUG>cronField.getExpression().asString(), DateTime.now()
</BUG>
));
}
@Override
| cronField.getExpression().asString(), ZonedDateTime.now()
|
9,444 | this._bottomRight = border._bottomRight;
}
public BorderPropertySet(
float top,
float right,
<BUG>float bottom,
float left</BUG>
) {
this._top = top;
this._right = right;
| float left,
BorderRadiusCorner topLeftCorner,
BorderRadiusCorner topRightCorner,
BorderRadiusCorner bottomRightCorner,
BorderRadiusCorner bottomLeftCorner
|
9,445 | if(exception instanceof Error) throw (Error)exception;
else if(exception instanceof RuntimeException) throw (RuntimeException)exception;
else if(exception instanceof Exception) throw (Exception)exception;
else throw new RuntimeException(exception);
}
<BUG>if(!rsp.wasReceived())
throw new TimeoutException("timeout sending message to " + dest);</BUG>
return rsp.getValue();
}
public <T> NotifyingFuture<T> sendMessageWithFuture(Message msg, RequestOptions options) throws Exception {
| if(!rsp.wasReceived() && !req.responseReceived())
throw new TimeoutException("timeout sending message to " + dest);
|
9,446 | num_received++;
if((responseReceived=(rsp_filter == null) || rsp_filter.isAcceptable(response_value, sender))) {
if(is_exception && response_value instanceof Throwable)
rsp.setException((Throwable)response_value);
else
<BUG>rsp.setValue((T)response_value);
}
rsp.setReceived(responseReceived);
}
if(responseReceived)
num_valid++;
done=responsesComplete() || (rsp_filter != null && !rsp_filter.needMoreResponses());</BUG>
if(responseReceived || done)
| rsp.setReceived(true);
done=responsesComplete() || (rsp_filter != null && !rsp_filter.needMoreResponses());
|
9,447 | finally {
completed.signalAll(); // wakes up execute()
lock.unlock();
}
checkCompletion(this);
<BUG>}
public void suspect(Address suspected_member) {</BUG>
if(suspected_member == null || !suspected_member.equals(target))
return;
lock.lock();
| public boolean responseReceived() {return num_received >= 1;}
public void suspect(Address suspected_member) {
|
9,448 | public static double betterRound(double numIn, int decPlac){
double opOn = Math.round(numIn * Math.pow(10, decPlac)) / Math.pow(10D, decPlac);
return opOn;
}
public static double centerCeil(double numIn, int tiers){
<BUG>return ((numIn > 0) ? Math.ceil(numIn * tiers) : Math.floor(numIn * tiers)) / tiers;
</BUG>
}
public static double findEfficiency(double speedIn, double lowerLimit, double upperLimit){
speedIn = Math.abs(speedIn);
| return ((numIn > 0) ? Math.ceil(numIn * (double) tiers) : Math.floor(numIn * (double) tiers)) / (double) tiers;
|
9,449 | package com.Da_Technomancer.crossroads.API;
import com.Da_Technomancer.crossroads.API.DefaultStorageHelper.DefaultStorage;
import com.Da_Technomancer.crossroads.API.heat.DefaultHeatHandler;
import com.Da_Technomancer.crossroads.API.heat.IHeatHandler;
import com.Da_Technomancer.crossroads.API.magic.DefaultMagicHandler;
<BUG>import com.Da_Technomancer.crossroads.API.magic.IMagicHandler;
import com.Da_Technomancer.crossroads.API.rotary.DefaultRotaryHandler;
import com.Da_Technomancer.crossroads.API.rotary.IRotaryHandler;
</BUG>
import net.minecraftforge.common.capabilities.Capability;
| import com.Da_Technomancer.crossroads.API.rotary.DefaultAxleHandler;
import com.Da_Technomancer.crossroads.API.rotary.DefaultCogHandler;
import com.Da_Technomancer.crossroads.API.rotary.IAxleHandler;
import com.Da_Technomancer.crossroads.API.rotary.ICogHandler;
|
9,450 | import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.common.capabilities.CapabilityInject;
import net.minecraftforge.common.capabilities.CapabilityManager;
public class Capabilities{
@CapabilityInject(IHeatHandler.class)
<BUG>public static Capability<IHeatHandler> HEAT_HANDLER_CAPABILITY = null;
@CapabilityInject(IRotaryHandler.class)
public static Capability<IRotaryHandler> ROTARY_HANDLER_CAPABILITY = null;
</BUG>
@CapabilityInject(IMagicHandler.class)
| @CapabilityInject(IAxleHandler.class)
public static Capability<IAxleHandler> AXLE_HANDLER_CAPABILITY = null;
@CapabilityInject(ICogHandler.class)
public static Capability<ICogHandler> COG_HANDLER_CAPABILITY = null;
|
9,451 | }
public boolean charDeleted(final char c, final PsiFile file, final Editor editor) {
if (myTargetPosition != null) {
final int offset = editor.getCaretModel().getOffset();
if (EditorModificationUtil.calcAfterLineEnd(editor) == 0) {
<BUG>int delta = editor.getCaretModel().getVisualPosition().column - myTargetPosition.column;
editor.getSelectionModel().setSelection(offset - delta, offset);
EditorModificationUtil.deleteSelectedText(editor);
}</BUG>
editor.getCaretModel().moveToLogicalPosition(myTargetPosition);
| assert delta >= 0;
if (offset <= editor.getDocument().getTextLength()) {
|
9,452 | package org.elasticsearch.common.http.client;
import org.apache.lucene.util.IOUtils;
import org.elasticsearch.ElasticsearchTimeoutException;
import org.elasticsearch.Version;
import org.elasticsearch.common.Nullable;
<BUG>import org.elasticsearch.common.SuppressForbidden;
import org.elasticsearch.common.unit.TimeValue;</BUG>
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
| import org.elasticsearch.common.cli.Terminal;
import org.elasticsearch.common.unit.TimeValue;
|
9,453 | package org.elasticsearch.plugins;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Iterators;
<BUG>import org.apache.lucene.util.IOUtils;
import org.elasticsearch.*;
</BUG>
import org.elasticsearch.bootstrap.JarHell;
import org.elasticsearch.common.SuppressForbidden;
| import org.elasticsearch.ElasticsearchTimeoutException;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.Version;
|
9,454 | boolean downloaded = false;
HttpDownloadHelper.DownloadProgress progress;
if (outputMode == OutputMode.SILENT) {
progress = new HttpDownloadHelper.NullProgress();
} else {
<BUG>progress = new HttpDownloadHelper.VerboseProgress(SysOut.getOut());
</BUG>
}
if (!Files.isWritable(environment.pluginsFile())) {
throw new IOException("plugin directory " + environment.pluginsFile() + " is read only");
| progress = new HttpDownloadHelper.VerboseProgress(terminal.writer());
|
9,455 | downloadHelper.download(pluginUrl, pluginFile, progress, this.timeout);
downloaded = true;
} catch (ElasticsearchTimeoutException e) {
throw e;
} catch (Exception e) {
<BUG>log("Failed: " + ExceptionsHelper.detailedMessage(e));
</BUG>
}
} else {
if (PluginHandle.isOfficialPlugin(pluginHandle.repo, pluginHandle.user, pluginHandle.version)) {
| terminal.println("Failed: %s", ExceptionsHelper.detailedMessage(e));
|
9,456 | checkForOfficialPlugins(pluginHandle.name);
}
}
if (!downloaded) {
for (URL url : pluginHandle.urls()) {
<BUG>log("Trying " + url.toExternalForm() + "...");
try {</BUG>
downloadHelper.download(url, pluginFile, progress, this.timeout);
downloaded = true;
break;
| terminal.println("Trying %s ...", url.toExternalForm());
try {
|
9,457 | downloaded = true;
break;
} catch (ElasticsearchTimeoutException e) {
throw e;
} catch (Exception e) {
<BUG>debug("Failed: " + ExceptionsHelper.detailedMessage(e));
</BUG>
}
}
}
| terminal.println(VERBOSE, "Failed: %s", ExceptionsHelper.detailedMessage(e));
|
9,458 | throw new IOException("failed to download out of all possible locations..., use --verbose to get detailed information");
}
Path tmp = unzipToTemporary(pluginFile);
final List<URL> jars = new ArrayList<>();
ClassLoader loader = PluginManager.class.getClassLoader();
<BUG>if (loader instanceof URLClassLoader) {
for (URL url : ((URLClassLoader) loader).getURLs()) {
jars.add(url);
}</BUG>
}
| Collections.addAll(jars, ((URLClassLoader) loader).getURLs());
|
9,459 | Files.copy(file, target, StandardCopyOption.REPLACE_EXISTING);
return FileVisitResult.CONTINUE;
}
});
}
<BUG>log("Installed " + name + " into " + extractLocation.toAbsolutePath());
} catch (Exception e) {
log("failed to extract plugin [" + pluginFile + "]: " + ExceptionsHelper.detailedMessage(e));
</BUG>
return;
| terminal.println("Installed %s into %s", name, extractLocation.toAbsolutePath());
terminal.printError("failed to extract plugin [%s]: %s", pluginFile, ExceptionsHelper.detailedMessage(e));
|
9,460 | Path site = extractLocation.resolve("_site");
Path tmpLocation = environment.pluginsFile().resolve(extractLocation.getFileName() + ".tmp");
Files.move(extractLocation, tmpLocation);
Files.createDirectories(extractLocation);
Files.move(tmpLocation, site);
<BUG>debug("Installed " + name + " into " + site.toAbsolutePath());
</BUG>
}
}
}
| terminal.println(VERBOSE, "Installed " + name + " into " + site.toAbsolutePath());
|
9,461 | PluginHandle pluginHandle = PluginHandle.parse(name);
boolean removed = false;
checkForForbiddenName(pluginHandle.name);
Path pluginToDelete = pluginHandle.extractedDir(environment);
if (Files.exists(pluginToDelete)) {
<BUG>debug("Removing: " + pluginToDelete);
try {</BUG>
IOUtils.rm(pluginToDelete);
} catch (IOException ex){
throw new IOException("Unable to remove " + pluginHandle.name + ". Check file permissions on " +
| terminal.println(VERBOSE, "Removing: %s", pluginToDelete);
try {
|
9,462 | }
@After
public void clearPathHome() {
System.clearProperty("es.default.path.home");
}
<BUG>protected static String[] args(String command) {
</BUG>
if (!Strings.hasLength(command)) {
return Strings.EMPTY_ARRAY;
}
| public static String[] args(String command) {
|
9,463 | import android.content.Intent;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
9,464 | import android.database.ContentObserver;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Bundle;
import android.os.Handler;
<BUG>import android.support.v4.app.NavUtils;
import android.support.v7.app.AppCompatActivity;</BUG>
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.ContextMenu;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.app.AppCompatActivity;
|
9,465 | import android.os.Handler;
import android.os.Looper;
import android.os.PowerManager;
import android.os.PowerManager.WakeLock;
import android.preference.PreferenceManager;
<BUG>import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.Toolbar;</BUG>
import android.util.Log;
import android.view.ContextMenu;
import android.view.KeyEvent;
| import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.Toolbar;
|
9,466 | mAltitude.setOnCheckedChangeListener(mCheckedChangeListener);
mDistance.setOnCheckedChangeListener(mCheckedChangeListener);
mCompass.setOnCheckedChangeListener(mCheckedChangeListener);
mLocation.setOnCheckedChangeListener(mCheckedChangeListener);
builder.setTitle(R.string.dialog_layer_title).setIcon(android.R.drawable.ic_dialog_map).setPositiveButton
<BUG>(R.string.btn_okay, null).setView(view);
</BUG>
dialog = builder.create();
return dialog;
case DIALOG_NOTRACK:
| (android.R.string.ok, null).setView(view);
|
9,467 | package org.xcolab.view.pages.proposals.view;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
<BUG>import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;</BUG>
import org.xcolab.client.contest.pojo.Contest;
import org.xcolab.client.members.pojo.Member;
import org.xcolab.client.proposals.ProposalClientUtil;
| import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
|
9,468 | public class ProposalPointsTabController extends BaseProposalTabController {
private final ProposalsContext proposalsContext;
@Autowired
public ProposalPointsTabController(ProposalsContext proposalsContext) {
this.proposalsContext = proposalsContext;
<BUG>}
public String showProposalDetails(Model model, HttpServletRequest request) {</BUG>
setCommonModelAndPageAttributes(request, model, ProposalTab.POINTS);
Proposal proposal = proposalsContext.getProposal(request);
Contest contest = proposalsContext.getContest(request);
| @GetMapping("/contests/{contestYear}/{contestUrlName}/phase/{phaseId}/{proposalUrlString}/{proposalId}/tab/POINTS")
public String showProposalDetails(Model model, HttpServletRequest request) {
|
9,469 | private String showContestProposalsPage(HttpServletRequest request, HttpServletResponse response,
String contestYear,
String contestUrlName,
String phaseId,
final SortFilterPage sortFilterPage, Model model) {
<BUG>proposalsContext.addPathVariable("contestYear", contestYear);
proposalsContext.addPathVariable("contestUrlName", contestUrlName);
proposalsContext.addPathVariable("phaseId",phaseId);</BUG>
ContestPhase contestPhase = proposalsContext.getContestPhase(request);
Contest contest = proposalsContext.getContest(request);
| [DELETED] |
9,470 | import org.json.JSONArray;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
<BUG>import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;</BUG>
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.portlet.bind.annotation.ResourceMapping;
import org.xcolab.client.contest.OntologyClientUtil;
| import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
|
9,471 | import javax.servlet.http.HttpServletResponse;
@Controller
public class ProposalImpactJSONController {
private final static Logger _log = LoggerFactory.getLogger(ProposalImpactJSONController.class);
@Autowired
<BUG>private ProposalsContext proposalsContext;
public void proposalImpactGetRegions(</BUG>
HttpServletRequest request,
HttpServletResponse response) throws IOException {
Map<OntologyTerm, List<OntologyTerm>> ontologyMap = getOntologyMap(request);
| @GetMapping("/contests/{contestYear}/{contestUrlName}/phase/{phaseId}/{proposalUrlString}/{proposalId}/tab/IMPACT/proposalImpactGetRegions")
public void proposalImpactGetRegions(
|
9,472 | HttpServletRequest request,
HttpServletResponse response) throws IOException {
Map<OntologyTerm, List<OntologyTerm>> ontologyMap = getOntologyMap(request);
List<OntologyTerm> regionTerms = new ArrayList<>(ontologyMap.keySet());
response.getOutputStream().write(ontologyTermListToJSONArray(regionTerms).toString().getBytes());
<BUG>}
public void proposalImpactGetSectorForRegions(</BUG>
HttpServletRequest request,
HttpServletResponse response,
@RequestParam(value = "regionTermId") Long regionTermId) throws IOException {
| @GetMapping("/contests/{contestYear}/{contestUrlName}/phase/{phaseId}/{proposalUrlString}/{proposalId}/tab/IMPACT/proposalImpactGetSectorsForRegion")
public void proposalImpactGetSectorForRegions(
|
9,473 | HttpServletResponse response,
@RequestParam(value = "regionTermId") Long regionTermId) throws IOException {
Map<OntologyTerm, List<OntologyTerm>> ontologyMap = getOntologyMap(request);
List<OntologyTerm> sectorTerms = ontologyMap.get(OntologyClientUtil.getOntologyTerm(regionTermId));
response.getOutputStream().write(ontologyTermListToJSONArray(sectorTerms).toString().getBytes());
<BUG>}
public void proposalImpactGetDataSeries(</BUG>
HttpServletRequest request,
HttpServletResponse response,
@RequestParam(value = "sectorTermId") Long sectorTermId,
| @GetMapping("/contests/{contestYear}/{contestUrlName}/phase/{phaseId}/{proposalUrlString}/{proposalId}/tab/IMPACT/proposalImpactGetDataSeries")
public void proposalImpactGetDataSeries(
|
9,474 | proposalsContext.getContest(request).getContestPK(), e);
JSONObject responseJSON = new JSONObject();
responseJSON.put("success", false);
response.getOutputStream().write(responseJSON.toString().getBytes());
}
<BUG>}
public void proposalImpactSaveDataSeries(</BUG>
HttpServletRequest request,
HttpServletResponse response,
@RequestParam(value = "focusAreaId") Long focusAreaId) throws IOException {
| @PostMapping("/contests/{contestYear}/{contestUrlName}/phase/{phaseId}/{proposalUrlString}/{proposalId}/tab/IMPACT/proposalImpactSaveDataSeries")
public void proposalImpactSaveDataSeries(
|
9,475 | ProposalImpactSeries impactSeries = new ProposalImpactSeries(contest, proposalsContext.getProposal(request), focusArea, requestJson);
Member member = proposalsContext.getMember(request);
impactSeries.persistWithAuthor(member);
responseJSON.put("success", true);
response.getOutputStream().write(responseJSON.toString().getBytes());
<BUG>}
public void proposalImpactDeleteDataSeries(</BUG>
HttpServletRequest request,
HttpServletResponse response,
@RequestParam(value = "focusAreaId") Long focusAreaId) throws IOException {
| @PostMapping("/contests/{contestYear}/{contestUrlName}/phase/{phaseId}/{proposalUrlString}/{proposalId}/tab/IMPACT/proposalImpactDeleteDataSeries")
public void proposalImpactDeleteDataSeries(
|
9,476 | .getImpactProposalAttributes(proposal, focusArea)) {
ProposalsContextUtil.getClients(request).getProposalAttributeClient().deleteProposalAttribute(proposalAttribute.getId_());
}
responseJSON.put("success", true);
response.getOutputStream().write(responseJSON.toString().getBytes());
<BUG>}
public void proposalImpactUpdateAllDataSeries(</BUG>
HttpServletRequest request,
HttpServletResponse response) throws IOException {
JSONObject responseJSON = new JSONObject();
| @PostMapping("/contests/{contestYear}/{contestUrlName}/phase/{phaseId}/{proposalUrlString}/{proposalId}/tab/IMPACT/proposalImpactUpdateAllSeries")
public void proposalImpactUpdateAllDataSeries(
|
9,477 | _log.info("Could not parse input", e);
responseJSON.put("success", false);
responseJSON.put("message", e.getMessage());
}
response.getOutputStream().write(responseJSON.toString().getBytes());
<BUG>}
public void proposalImpactSaveBasicProposalComment(HttpServletRequest request, HttpServletResponse response,</BUG>
@RequestParam(required = false) String impactAuthorComment,
@RequestParam(required = false) String impactIAFComment)
throws IOException {
| @PostMapping("/contests/{contestYear}/{contestUrlName}/phase/{phaseId}/{proposalUrlString}/{proposalId}/tab/IMPACT/proposalImpactSaveBasicProposalComment")
public void proposalImpactSaveBasicProposalComment(HttpServletRequest request, HttpServletResponse response,
|
9,478 | package org.xcolab.view.pages.proposals.view;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
<BUG>import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.RequestParam;</BUG>
import org.xcolab.client.admin.enums.ConfigurationAttributeKey;
import org.xcolab.client.contest.ContestClientUtil;
import org.xcolab.client.contest.exceptions.ContestNotFoundException;
| import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;
|
9,479 | setLinkedProposals(model, proposal, request);
final Contest contest = proposalsContext.getContest(request);
populateMoveHistory(model, proposal, contest, request);
} catch (ContestNotFoundException ignored) {
}
<BUG>return "proposalDetails";
</BUG>
}
private void populateMoveHistory(Model model, Proposal proposal, Contest contest, HttpServletRequest request) {
List<ProposalMoveHistory> sourceMoveHistories = ProposalsContextUtil.getClients(request).getProposalMoveClient()
| return "/proposals/proposalDetails";
|
9,480 | package org.xcolab.view.pages.proposals.view;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
<BUG>import org.springframework.ui.Model;
import org.xcolab.client.contest.ContestClient;</BUG>
import org.xcolab.client.contest.pojo.Contest;
import org.xcolab.client.contest.pojo.phases.ContestPhase;
import org.xcolab.client.members.exceptions.MemberNotFoundException;
| import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.xcolab.client.contest.ContestClient;
|
9,481 | import javax.servlet.http.HttpServletRequest;
@Controller
public class ProposalEvaluationTabController extends BaseProposalTabController {
private final static Logger _log = LoggerFactory.getLogger(ProposalEvaluationTabController.class);
private static final Long AVERAGE_RESULT_ROUND_FACTOR = 10L;
<BUG>private static final String EVALUATION_TAB_VIEW_NAME = "proposalEvaluation";
</BUG>
private final ProposalsContext proposalsContext;
@Autowired
public ProposalEvaluationTabController(ProposalsContext proposalsContext) {
| private static final String EVALUATION_TAB_VIEW_NAME = "/proposals/proposalEvaluation";
|
9,482 | import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
<BUG>import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;</BUG>
import org.springframework.web.bind.annotation.RequestParam;
import org.xcolab.client.contest.ContestClientUtil;
import org.xcolab.client.contest.ImpactClientUtil;
| import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
|
9,483 | proposalImpactScenarioCombinationWrapper.getRegionToProposalSimulationScenarioMap());
}
model.addAttribute("isProposalUsingCombinedScenario", isProposalUsingCombinedScenario);
model.addAttribute("consolidationPossible", isConsolidationPossible);
model.addAttribute("consolidateOptions", getConsolidationOptions());
<BUG>return "integratedProposalImpact";
</BUG>
}
private Map<String, String[]> getConsolidationOptions() {
return getConsolidateOptionsOnGlobalLevel();
| return "/proposals/integratedProposalImpact";
|
9,484 | model.addAttribute("impactSerieses", proposalImpactSeriesList.getImpactSerieses());
Map<OntologyTerm, List<OntologyTerm>> ontologyMap =
new ProposalImpactUtil(contest).calculateAvailableOntologyMap(proposalImpactSeriesList.getImpactSerieses());
model.addAttribute("regionTerms", sortByName(ontologyMap.keySet()));
model.addAttribute("proposalsPermissions", proposalsContext.getPermissions(request));
<BUG>return "basicProposalImpact";
</BUG>
}
private List<ProposalImpactSeries> getImpactTabBasicProposal(Proposal proposalParent,
HttpServletRequest request) {
| return "/proposals/basicProposalImpact";
|
9,485 | public static Long getLong(HttpServletRequest request, String paramName) {
return getLong(request, paramName, null ,0L);
}
public static Long getLong(HttpServletRequest request, String paramName,
HashMap<String, String> pathParameters, Long defaultValue) {
<BUG>String value = request.getParameter(paramName);
if (value != null) {</BUG>
try {
return Long.parseLong(value);
} catch (NumberFormatException e) {
| String value = (request.getAttribute(paramName)!=null)?((String)request.getAttribute(paramName)):(request.getParameter(paramName));
if (value != null) {
|
9,486 | result = 31 * result + (locationData != null ? locationData.hashCode() : 0);
result = 31 * result + (companyCollection != null ? companyCollection.hashCode() : 0);
result = 31 * result + (socialProfileCollection != null ? socialProfileCollection.hashCode() : 0);
result = 31 * result + (segmentCollection != null ? segmentCollection.hashCode() : 0);
result = 31 * result + (tagCollection != null ? tagCollection.hashCode() : 0);
<BUG>result = 31 * result + (updateLastRequestAt ? 1 : 0);
result = 31 * result + (newSession ? 1 : 0);
result = 31 * result + (untag != null ? untag.hashCode() : 0);</BUG>
return result;
}
| result = 31 * result + (updateLastRequestAt != null ? updateLastRequestAt.hashCode() : 0);
result = 31 * result + (newSession != null ? newSession.hashCode() : 0);
result = 31 * result + (untag != null ? untag.hashCode() : 0);
|
9,487 | return resource.post(response, entity);
}
public static <T, R> R update(T entity, String collectionPath, Class<R> response) {
final HttpClient resource = new HttpClient(UriBuilder.newBuilder().path(collectionPath).build());
return resource.post(response, entity);
<BUG>}
public static <T, R> R updatePut(T entity, URI collectionPath, Class<R> response) {</BUG>
final HttpClient resource = new HttpClient(collectionPath);
return resource.put(response, entity);
}
| public static <T, R> R post(T entity, URI path, Class<R> response) {
final HttpClient resource = new HttpClient(path);
public static <T, R> R updatePut(T entity, URI collectionPath, Class<R> response) {
|
9,488 | package io.intercom.api;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
<BUG>import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.collect.Maps;
import java.net.URI;
import java.util.List;</BUG>
import java.util.Map;
| import com.google.common.annotations.VisibleForTesting;
import java.util.HashMap;
import java.util.List;
|
9,489 | package org.neo4j.coreedge.messaging.address;
import java.time.Clock;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
<BUG>import org.neo4j.coreedge.identity.MemberId;
import org.neo4j.logging.Log;
public class UnknownAddressMonitor</BUG>
{
private final Log log;
| import org.neo4j.kernel.impl.util.CappedLogger;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
public class UnknownAddressMonitor
|
9,490 | import org.neo4j.logging.Log;
public class UnknownAddressMonitor</BUG>
{
private final Log log;
private final Clock clock;
<BUG>private final long initialTimeoutMs;
private Map<MemberId,PeriodicLogger> loggers = new ConcurrentHashMap<>();
public UnknownAddressMonitor( Log log, Clock clock, long initialTimeoutMs )
</BUG>
{
| import static java.util.concurrent.TimeUnit.MILLISECONDS;
public class UnknownAddressMonitor
private final long timeLimitMs;
private Map<MemberId,CappedLogger> loggers = new ConcurrentHashMap<>();
public UnknownAddressMonitor( Log log, Clock clock, long timeLimitMs )
|
9,491 | private static final AtomicLongFieldUpdater<Filter> LAST_CHECK =
AtomicLongFieldUpdater.newUpdater( Filter.class, "lastCheck" );
private boolean hasCountLimit;
private int countLimit;
private long timeLimitMillis;
<BUG>private Clock clock;
</BUG>
private boolean filterDuplicates;
private volatile int currentCount;
private volatile long lastCheck;
| private final Clock clock;
|
9,492 | import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import com.appboy.configuration.XmlAppConfigurationProvider;
<BUG>import com.appboy.push.AppboyNotificationUtils;
public final class AppboyGcmReceiver extends BroadcastReceiver {</BUG>
private static final String TAG = String.format("%s.%s", Constants.APPBOY_LOG_TAG_PREFIX, AppboyGcmReceiver.class.getName());
private static final String GCM_RECEIVE_INTENT_ACTION = "com.google.android.c2dm.intent.RECEIVE";
private static final String GCM_REGISTRATION_INTENT_ACTION = "com.google.android.c2dm.intent.REGISTRATION";
| import com.appboy.support.AppboyLogger;
public final class AppboyGcmReceiver extends BroadcastReceiver {
|
9,493 | private static final String GCM_DELETED_MESSAGES_KEY = "deleted_messages";
private static final String GCM_NUMBER_OF_MESSAGES_DELETED_KEY = "total_deleted";
public static final String CAMPAIGN_ID_KEY = Constants.APPBOY_PUSH_CAMPAIGN_ID_KEY;
@Override
public void onReceive(Context context, Intent intent) {
<BUG>Log.i(TAG, String.format("Received broadcast message. Message: %s", intent.toString()));
</BUG>
String action = intent.getAction();
if (GCM_REGISTRATION_INTENT_ACTION.equals(action)) {
XmlAppConfigurationProvider appConfigurationProvider = new XmlAppConfigurationProvider(context);
| AppboyLogger.i(TAG, String.format("Received broadcast message. Message: %s", intent.toString()));
|
9,494 | } else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) {
int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(Constants.APPBOY_PUSH_NOTIFICATION_TAG, notificationId);
} else {
<BUG>Log.w(TAG, String.format("The GCM receiver received a message not sent from Appboy. Ignoring the message."));
</BUG>
}
}
boolean handleRegistrationIntent(Context context, Intent intent) {
| AppboyLogger.w(TAG, String.format("The GCM receiver received a message not sent from Appboy. Ignoring the message."));
|
9,495 | Log.e(TAG, "Device does not support GCM.");
} else if ("INVALID_PARAMETERS".equals(error)) {
Log.e(TAG, "The request sent by the device does not contain the expected parameters. This phone does not " +
"currently support GCM.");
} else {
<BUG>Log.w(TAG, String.format("Received an unrecognised GCM registration error type. Ignoring. Error: %s", error));
</BUG>
}
} else if (registrationId != null) {
Appboy.getInstance(context).registerAppboyPushMessages(registrationId);
| AppboyLogger.w(TAG, String.format("Received an unrecognised GCM registration error type. Ignoring. Error: %s", error));
|
9,496 | } else if (registrationId != null) {
Appboy.getInstance(context).registerAppboyPushMessages(registrationId);
} else if (intent.hasExtra(GCM_UNREGISTERED_KEY)) {
Appboy.getInstance(context).unregisterAppboyPushMessages();
} else {
<BUG>Log.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
</BUG>
"confirmation. Ignoring.");
return false;
}
| AppboyLogger.w(TAG, "The GCM registration message is missing error information, registration id, and unregistration " +
|
9,497 | if (GCM_DELETED_MESSAGES_KEY.equals(messageType)) {
int totalDeleted = intent.getIntExtra(GCM_NUMBER_OF_MESSAGES_DELETED_KEY, -1);
if (totalDeleted == -1) {
Log.e(TAG, String.format("Unable to parse GCM message. Intent: %s", intent.toString()));
} else {
<BUG>Log.i(TAG, String.format("GCM deleted %d messages. Fetch them from Appboy.", totalDeleted));
</BUG>
}
return false;
} else {
| AppboyLogger.i(TAG, String.format("GCM deleted %d messages. Fetch them from Appboy.", totalDeleted));
|
9,498 | package com.appboy;
import android.content.BroadcastReceiver;
import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
<BUG>import android.util.Log;
import android.content.Context;</BUG>
import android.app.Notification;
import android.app.NotificationManager;
import com.appboy.configuration.XmlAppConfigurationProvider;
| import com.appboy.support.AppboyLogger;
import android.content.Context;
|
9,499 | } else if (Constants.APPBOY_CANCEL_NOTIFICATION_ACTION.equals(action) && intent.hasExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG)) {
int notificationId = intent.getIntExtra(Constants.APPBOY_CANCEL_NOTIFICATION_TAG, Constants.APPBOY_DEFAULT_NOTIFICATION_ID);
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.cancel(Constants.APPBOY_PUSH_NOTIFICATION_TAG, notificationId);
} else {
<BUG>Log.w(TAG, String.format("The ADM receiver received a message not sent from Appboy. Ignoring the message."));
</BUG>
}
}
boolean handleRegistrationIntent(Context context, Intent intent) {
| AppboyLogger.w(TAG, String.format("The ADM receiver received a message not sent from Appboy. Ignoring the message."));
|
9,500 | Notification notification = null;
IAppboyNotificationFactory appboyNotificationFactory = AppboyNotificationUtils.getActiveNotificationFactory();
try {
notification = appboyNotificationFactory.createNotification(appConfigurationProvider, context, admExtras, appboyExtras);
} catch(Exception e) {
<BUG>Log.e(TAG, "Failed to create notification.", e);
</BUG>
return false;
}
if (notification == null) {
| AppboyLogger.e(TAG, "Failed to create notification.", e);
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.