id
int64
1
49k
buggy
stringlengths
34
37.5k
fixed
stringlengths
2
37k
8,501
return intern(new StringIdItem(new CstString(string))); } public StringIdItem intern(CstString string) { return intern(new StringIdItem(string)); } <BUG>public StringIdItem intern(StringIdItem string) { </BUG> if (string == null) { throw new NullPointerException("string == null"); }
public synchronized StringIdItem intern(StringIdItem string) {
8,502
return already; } strings.put(value, string); return string; } <BUG>public void intern(CstNat nat) { </BUG> intern(nat.getName()); intern(nat.getDescriptor()); }
public synchronized void intern(CstNat nat) {
8,503
out.annotate(4, "proto_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); } <BUG>public ProtoIdItem intern(Prototype prototype) { </BUG> if (prototype == null) { throw new NullPointerException("prototype == null"); }
public synchronized ProtoIdItem intern(Prototype prototype) {
8,504
} catch (NullPointerException ex) { throw new NullPointerException("item == null"); } items.add(item); } <BUG>public <T extends OffsettedItem> T intern(T item) { </BUG> throwIfPrepared(); OffsettedItem result = interns.get(item); if (result != null) {
public synchronized <T extends OffsettedItem> T intern(T item) {
8,505
out.annotate(4, "type_ids_off: " + Hex.u4(offset)); } out.writeInt(sz); out.writeInt(offset); } <BUG>public TypeIdItem intern(Type type) { </BUG> if (type == null) { throw new NullPointerException("type == null"); }
public synchronized TypeIdItem intern(Type type) {
8,506
import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; <BUG>import java.util.TreeMap; import java.util.concurrent.Callable;</BUG> import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors;
import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.Callable;
8,507
if (args.incremental && !anyFilesProcessed) { return 0; // this was a no-op incremental build } byte[] outArray = null; if (!outputDex.isEmpty() || (args.humanOutName != null)) { <BUG>outArray = writeDex(); </BUG> if (outArray == null) { return 2; }
outArray = writeDex(outputDex);
8,508
DxConsole.err.println("\ntrouble processing \"" + name + "\":\n\n" + IN_RE_CORE_CLASSES); errors.incrementAndGet(); throw new StopProcessing(); } <BUG>private static byte[] writeDex() { </BUG> byte[] outArray = null; try { try {
private static byte[] writeDex(DexFile outputDex) {
8,509
if (minimalMainDex && (mainDexListFile == null || !multiDex)) { System.err.println(MINIMAL_MAIN_DEX_OPTION + " is only supported in combination with " + MULTI_DEX_OPTION + " and " + MAIN_DEX_LIST_OPTION); throw new UsageException(); } <BUG>if (multiDex && numThreads != 1) { System.out.println(NUM_THREADS_OPTION + " is ignored when used with " + MULTI_DEX_OPTION); numThreads = 1; }</BUG> if (multiDex && incremental) {
[DELETED]
8,510
); } if (result == IncompatibleTypes.ARRAY_AND_NON_ARRAY || result == IncompatibleTypes.ARRAY_AND_OBJECT) { bugAccumulator.accumulateBug(new BugInstance(this, "EC_ARRAY_AND_NONARRAY", result.getPriority() + priorityModifier) .addClassAndMethod(methodGen, sourceFile) <BUG>.addFoundAndExpectedType(rhsType_, lhsType_), SourceLineAnnotation.fromVisitedInstruction(this.classContext, methodGen, sourceFile, location.getHandle())</BUG> ); } else if (result == IncompatibleTypes.INCOMPATIBLE_CLASSES) { String lhsSig = lhsType_.getSignature();
.addFoundAndExpectedType(rhsType_, lhsType_) .addSomeSourceForTopTwoStackValues(classContext, method, location), SourceLineAnnotation.fromVisitedInstruction(this.classContext, methodGen, sourceFile, location.getHandle())
8,511
System.out.println(change); } } }; @Override <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { return (child) -> {
protected Callback<VChild, Void> copyIntoCallback()
8,512
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
8,513
VEVENT ("VEVENT", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_END, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, PropertyType.EXCEPTION_DATE_TIMES, <BUG>PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,</BUG> PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS, PropertyType.SUMMARY, PropertyType.TIME_TRANSPARENCY, PropertyType.UNIQUE_IDENTIFIER,
PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER, PropertyType.PRIORITY,
8,514
VTODO ("VTODO", Arrays.asList(PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.CATEGORIES, PropertyType.CLASSIFICATION, PropertyType.COMMENT, PropertyType.CONTACT, PropertyType.DATE_TIME_COMPLETED, PropertyType.DATE_TIME_CREATED, PropertyType.DATE_TIME_DUE, PropertyType.DATE_TIME_STAMP, PropertyType.DATE_TIME_START, PropertyType.DESCRIPTION, PropertyType.DURATION, <BUG>PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.IANA_PROPERTY, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,</BUG> PropertyType.PERCENT_COMPLETE, PropertyType.PRIORITY, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_IDENTIFIER, PropertyType.RELATED_TO, PropertyType.RECURRENCE_RULE, PropertyType.REQUEST_STATUS, PropertyType.RESOURCES, PropertyType.SEQUENCE, PropertyType.STATUS,
PropertyType.EXCEPTION_DATE_TIMES, PropertyType.GEOGRAPHIC_POSITION, PropertyType.LAST_MODIFIED, PropertyType.LOCATION, PropertyType.NON_STANDARD, PropertyType.ORGANIZER,
8,515
throw new RuntimeException("not implemented"); } }, DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, <BUG>PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,</BUG> PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class) {
PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM,
8,516
throw new RuntimeException("not implemented"); } }, VALARM ("VALARM", Arrays.asList(PropertyType.ACTION, PropertyType.ATTACHMENT, PropertyType.ATTENDEE, PropertyType.DESCRIPTION, <BUG>PropertyType.DURATION, PropertyType.IANA_PROPERTY, PropertyType.NON_STANDARD, PropertyType.REPEAT_COUNT, PropertyType.SUMMARY, PropertyType.TRIGGER),</BUG> VAlarm.class) { @Override
DAYLIGHT_SAVING_TIME ("DAYLIGHT", Arrays.asList(PropertyType.COMMENT, PropertyType.DATE_TIME_START, PropertyType.NON_STANDARD, PropertyType.RECURRENCE_DATE_TIMES, PropertyType.RECURRENCE_RULE, PropertyType.TIME_ZONE_NAME, PropertyType.TIME_ZONE_OFFSET_FROM, PropertyType.TIME_ZONE_OFFSET_TO), DaylightSavingTime.class)
8,517
private ContentLineStrategy contentLineGenerator; protected void setContentLineGenerator(ContentLineStrategy contentLineGenerator) { this.contentLineGenerator = contentLineGenerator; } <BUG>protected Callback<VChild, Void> copyChildCallback() </BUG> { throw new RuntimeException("Can't copy children. copyChildCallback isn't overridden in subclass." + this.getClass()); };
protected Callback<VChild, Void> copyIntoCallback()
8,518
import jfxtras.labs.icalendarfx.properties.calendar.Version; import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty; public enum CalendarProperty { CALENDAR_SCALE ("CALSCALE", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), CalendarScale.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), CalendarScale.class)
8,519
CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); } }, METHOD ("METHOD", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Method.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
8,520
} list.add(new NonStandardProperty((NonStandardProperty) child)); } }, PRODUCT_IDENTIFIER ("PRODID", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), ProductIdentifier.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
public void copyChild(VChild child, VCalendar destination) CalendarScale calendarScale = (CalendarScale) child; destination.setCalendarScale(calendarScale); METHOD ("METHOD", Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Method.class)
8,521
ProductIdentifier productIdentifier = (ProductIdentifier) child; destination.setProductIdentifier(productIdentifier); } }, VERSION ("VERSION", <BUG>Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD, ParameterType.IANA_PARAMETER), Version.class)</BUG> { @Override public VChild parse(VCalendar vCalendar, String contentLine)
Arrays.asList(ParameterType.VALUE_DATA_TYPES, ParameterType.NON_STANDARD), Version.class)
8,522
package jfxtras.labs.icalendarfx.components; import jfxtras.labs.icalendarfx.properties.component.descriptive.Comment; <BUG>import jfxtras.labs.icalendarfx.properties.component.misc.IANAProperty; import jfxtras.labs.icalendarfx.properties.component.misc.UnknownProperty;</BUG> import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceDates; import jfxtras.labs.icalendarfx.properties.component.recurrence.RecurrenceRule;
import jfxtras.labs.icalendarfx.properties.component.misc.NonStandardProperty;
8,523
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
8,524
this.startPos = startPos; } public interface Entry< T> { void setTag( int tag); void setSize( int size); <BUG>void setCount( int count); void setOffset( int offset);</BUG> void setValues( T values); T getValues(); int getTag();
void incCount( int count); void setOffset( int offset);
8,525
protected int offset; protected T values; public void setTag( Tag tag) { this.tag = tag.getCode(); } public void setTag( int tag) { this.tag = tag; } public void setSize( int size) { this.size = size; } <BUG>public void setCount( int count) { this.count = count; } public void setOffset( int offset) { this.offset = offset; }</BUG> protected abstract void typeCheck(T values); public void setValues( T values) { if (values.getClass().isArray()) {
public void incCount( int count) { this.count += count; } public void setOffset( int offset) { this.offset = offset; }
8,526
} @RootTask static Task<Exec.Result> exec(String parameter, int number) { Task<String> task1 = MyTask.create(parameter); Task<Integer> task2 = Adder.create(number, number + 2); <BUG>return Task.ofType(Exec.Result.class).named("exec", "/bin/sh") .in(() -> task1)</BUG> .in(() -> task2) .process(Exec.exec((str, i) -> args("/bin/sh", "-c", "\"echo " + i + "\""))); }
return Task.named("exec", "/bin/sh").ofType(Exec.Result.class) .in(() -> task1)
8,527
return args; } static class MyTask { static final int PLUS = 10; static Task<String> create(String parameter) { <BUG>return Task.ofType(String.class).named("MyTask", parameter) .in(() -> Adder.create(parameter.length(), PLUS))</BUG> .in(() -> Fib.create(parameter.length())) .process((sum, fib) -> something(parameter, sum, fib)); }
return Task.named("MyTask", parameter).ofType(String.class) .in(() -> Adder.create(parameter.length(), PLUS))
8,528
final String instanceField = "from instance"; final TaskContext context = TaskContext.inmem(); final AwaitingConsumer<String> val = new AwaitingConsumer<>(); @Test public void shouldJavaUtilSerialize() throws Exception { <BUG>Task<Long> task1 = Task.ofType(Long.class).named("Foo", "Bar", 39) .process(() -> 9999L); Task<String> task2 = Task.ofType(String.class).named("Baz", 40) .in(() -> task1)</BUG> .ins(() -> singletonList(task1))
Task<Long> task1 = Task.named("Foo", "Bar", 39).ofType(Long.class) Task<String> task2 = Task.named("Baz", 40).ofType(String.class) .in(() -> task1)
8,529
assertEquals(des.id().name(), "Baz"); assertEquals(val.awaitAndGet(), "[9999] hello 10004"); } @Test(expected = NotSerializableException.class) public void shouldNotSerializeWithInstanceFieldReference() throws Exception { <BUG>Task<String> task = Task.ofType(String.class).named("WithRef") .process(() -> instanceField + " causes an outer reference");</BUG> serialize(task); } @Test
Task<String> task = Task.named("WithRef").ofType(String.class) .process(() -> instanceField + " causes an outer reference");
8,530
serialize(task); } @Test public void shouldSerializeWithLocalReference() throws Exception { String local = instanceField; <BUG>Task<String> task = Task.ofType(String.class).named("WithLocalRef") .process(() -> local + " won't cause an outer reference");</BUG> serialize(task); Task<String> des = deserialize(); context.evaluate(des).consume(val);
Task<String> task = Task.named("WithLocalRef").ofType(String.class) .process(() -> local + " won't cause an outer reference");
8,531
} @RootTask public static Task<String> standardArgs(int first, String second) { firstInt = first; secondString = second; <BUG>return Task.ofType(String.class).named("StandardArgs", first, second) .process(() -> second + " " + first * 100);</BUG> } @Test public void shouldParseFlags() throws Exception {
return Task.named("StandardArgs", first, second).ofType(String.class) .process(() -> second + " " + first * 100);
8,532
assertThat(parsedEnum, is(CustomEnum.BAR)); } @RootTask public static Task<String> enums(CustomEnum enm) { parsedEnum = enm; <BUG>return Task.ofType(String.class).named("Enums", enm) .process(enm::toString);</BUG> } @Test public void shouldParseCustomTypes() throws Exception {
return Task.named("Enums", enm).ofType(String.class) .process(enm::toString);
8,533
assertThat(parsedType.content, is("blarg parsed for you!")); } @RootTask public static Task<String> customType(CustomType myType) { parsedType = myType; <BUG>return Task.ofType(String.class).named("Types", myType.content) .process(() -> myType.content);</BUG> } public enum CustomEnum { BAR
return Task.named("Types", myType.content).ofType(String.class) .process(() -> myType.content);
8,534
TaskContext taskContext = TaskContext.inmem(); TaskContext.Value<Long> value = taskContext.evaluate(fib92); value.consume(f92 -> System.out.println("fib(92) = " + f92)); } static Task<Long> create(long n) { <BUG>TaskBuilder<Long> fib = Task.ofType(Long.class).named("Fib", n); </BUG> if (n < 2) { return fib .process(() -> n);
TaskBuilder<Long> fib = Task.named("Fib", n).ofType(Long.class);
8,535
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;
8,536
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());
8,537
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
8,538
<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;
8,539
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]
8,540
<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;
8,541
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;
8,542
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;
8,543
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);
8,544
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 {
8,545
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(),
8,546
) ); }else{ return new TimeNode( generateDayCandidatesQuestionMarkNotSupported( <BUG>date.getYear(), date.getMonthOfYear(), </BUG> ((DayOfWeekFieldDefinition) cronDefinition.getFieldDefinition(DAY_OF_WEEK) ).getMondayDoWValue()
date.getYear(), date.getMonthValue(),
8,547
} 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);
8,548
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]
8,549
<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;
8,550
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;
8,551
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()
8,552
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
8,553
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++) {
8,554
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++) {
8,555
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
8,556
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++) {
8,557
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
8,558
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++) {
8,559
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
8,560
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++) {
8,561
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
8,562
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++) {
8,563
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
8,564
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++) {
8,565
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;
8,566
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;
8,567
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"),
8,568
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]
8,569
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) {
8,570
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;
8,571
package org.apache.felix.webconsole.internal.compendium; import java.io.IOException; import java.io.PrintWriter; <BUG>import java.util.Arrays; import java.util.Collections; import java.util.Dictionary; import java.util.Iterator; import java.util.TreeMap; import java.util.TreeSet;</BUG> import javax.servlet.http.HttpServletRequest;
import java.util.*; import javax.servlet.ServletException;
8,572
import java.util.Iterator; import java.util.TreeMap; import java.util.TreeSet;</BUG> import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; <BUG>import org.apache.felix.scr.Component; import org.apache.felix.scr.Reference; import org.apache.felix.scr.ScrService;</BUG> import org.apache.felix.webconsole.internal.BaseWebConsolePlugin;
package org.apache.felix.webconsole.internal.compendium; import java.io.IOException; import java.io.PrintWriter; import java.util.*; import javax.servlet.ServletException; import org.apache.felix.scr.*;
8,573
import org.apache.felix.scr.Reference; import org.apache.felix.scr.ScrService;</BUG> import org.apache.felix.webconsole.internal.BaseWebConsolePlugin; import org.apache.felix.webconsole.internal.Util; import org.apache.felix.webconsole.internal.servlet.OsgiManager; <BUG>import org.json.JSONException; import org.json.JSONWriter; </BUG> import org.osgi.framework.Constants; import org.osgi.framework.ServiceReference;
package org.apache.felix.webconsole.internal.compendium; import java.io.IOException; import java.io.PrintWriter; import java.util.*; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.felix.scr.*; import org.json.*;
8,574
public static final String NAME = "components"; public static final String LABEL = "Components"; public static final String COMPONENT_ID = "componentId"; public static final String OPERATION = "action"; public static final String OPERATION_ENABLE = "enable"; <BUG>public static final String OPERATION_DISABLE = "disable"; private static final String SCR_SERVICE = ScrService.class.getName();</BUG> public String getTitle() { return LABEL;
public static final String OPERATION_EDIT = "edit"; private static final String SCR_SERVICE = ScrService.class.getName();
8,575
jw.endObject(); jw.endArray();</BUG> if ( details ) { gatherComponentDetails( jw, component ); <BUG>} jw.endObject();</BUG> } private void gatherComponentDetails( JSONWriter jw, Component component ) throws JSONException {
private void action( JSONWriter jw, boolean enabled, String op, String opLabel, String image ) throws JSONException jw.object(); jw.key( "enabled" ).value( enabled ); jw.key( "name" ).value( opLabel ); jw.key( "link" ).value( op ); jw.key( "image" ).value( image );
8,576
name = ( String ) boundRefs[j].getProperty( Constants.SERVICE_DESCRIPTION ); } } if ( name != null ) { <BUG>buf.append( " (" ); buf.append( name ); buf.append( ")" ); } }</BUG> }
b.append( " (" ); b.append( name ); b.append( ")" ); buf.put(b.toString());
8,577
return Character.isJavaIdentifierPart(Character.toCodePoint((char)_input.LA(-2), (char)_input.LA(-1))); } return true; } public static final String _serializedATN = <BUG>"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2y\u04b6\b\1\b\1\4"+ </BUG> "\2\t\2\4\3\t\3\4\4\t\4\4\5\t\5\4\6\t\6\4\7\t\7\4\b\t\b\4\t\t\t\4\n\t\n"+ "\4\13\t\13\4\f\t\f\4\r\t\r\4\16\t\16\4\17\t\17\4\20\t\20\4\21\t\21\4\22"+ "\t\22\4\23\t\23\4\24\t\24\4\25\t\25\4\26\t\26\4\27\t\27\4\30\t\30\4\31"+
"\3\u0430\ud6d1\u8206\uad2d\u4417\uaef1\u8d80\uaadd\2z\u04bb\b\1\b\1\4"+
8,578
Assert.assertEquals(treeBucket.getLeftSibling().getPageIndex(), -1); Assert.assertEquals(treeBucket.getRightSibling().getPageIndex(), -1); directMemory.free(pointer); } public void testSearch() throws Exception { <BUG>long seed = System.currentTimeMillis(); </BUG> System.out.println("testSearch seed : " + seed); TreeSet<Long> keys = new TreeSet<Long>(); Random random = new Random(seed);
long seed = 1381299802658L;// System.currentTimeMillis();
8,579
OLongSerializer.INSTANCE, OLinkSerializer.INSTANCE, ODurablePage.TrackMode.FULL); int index = 0; Map<Long, Integer> keyIndexMap = new HashMap<Long, Integer>(); for (Long key : keys) { if (!treeBucket.addEntry(index, <BUG>new OSBTreeBonsaiBucket.SBTreeEntry<Long, OIdentifiable>(new OBonsaiBucketPointer(random.nextInt(Integer.MAX_VALUE)), new OBonsaiBucketPointer(random.nextInt(Integer.MAX_VALUE)), key, null), true)) </BUG> break; keyIndexMap.put(key, index);
new OSBTreeBonsaiBucket.SBTreeEntry<Long, OIdentifiable>(new OBonsaiBucketPointer(random.nextInt(Integer.MAX_VALUE), 8192 * 2), new OBonsaiBucketPointer(random.nextInt(Integer.MAX_VALUE), 8192 * 2), key, null), true))
8,580
long pointer = directMemory.allocate(OGlobalConfiguration.DISK_CACHE_PAGE_SIZE.getValueAsInteger() * 1024); OSBTreeBonsaiBucket<Long, OIdentifiable> treeBucket = new OSBTreeBonsaiBucket<Long, OIdentifiable>(pointer, 0, false, OLongSerializer.INSTANCE, OLinkSerializer.INSTANCE, ODurablePage.TrackMode.FULL); int index = 0; for (Long key : keys) { <BUG>if (!treeBucket.addEntry(index, new OSBTreeBonsaiBucket.SBTreeEntry<Long, OIdentifiable>(new OBonsaiBucketPointer(index), new OBonsaiBucketPointer(index + 1), key, null), true)) </BUG> break; index++;
Map<Long, Integer> keyIndexMap = new HashMap<Long, Integer>(); if (!treeBucket.addEntry(index, new OSBTreeBonsaiBucket.SBTreeEntry<Long, OIdentifiable>(new OBonsaiBucketPointer(random.nextInt(Integer.MAX_VALUE), 8192 * 2), new OBonsaiBucketPointer(random.nextInt(Integer.MAX_VALUE), 8192 * 2), key, null), true)) keyIndexMap.put(key, index);
8,581
addedKeys++; } for (Map.Entry<Long, Integer> keyIndexEntry : keyIndexMap.entrySet()) { OSBTreeBonsaiBucket.SBTreeEntry<Long, OIdentifiable> entry = treeBucket.getEntry(keyIndexEntry.getValue()); Assert.assertEquals(entry, <BUG>new OSBTreeBonsaiBucket.SBTreeEntry<Long, OIdentifiable>(new OBonsaiBucketPointer(keyIndexEntry.getValue()), new OBonsaiBucketPointer(keyIndexEntry.getValue() + 1), keyIndexEntry.getKey(), null)); </BUG> }
new OSBTreeBonsaiBucket.SBTreeEntry<Long, OIdentifiable>(new OBonsaiBucketPointer(keyIndexEntry.getValue(), 8192 * 2), new OBonsaiBucketPointer(keyIndexEntry.getValue() + 1, 8192 * 2), keyIndexEntry.getKey(), null));
8,582
import com.orientechnologies.orient.core.storage.impl.local.paginated.OStorageTransaction; import com.orientechnologies.orient.core.storage.impl.local.paginated.wal.OWriteAheadLog; public class OSBTreeBonsai<K, V> extends ODurableComponent { private static final OAlwaysLessKey ALWAYS_LESS_KEY = new OAlwaysLessKey(); private static final OAlwaysGreaterKey ALWAYS_GREATER_KEY = new OAlwaysGreaterKey(); <BUG>private OBonsaiBucketPointer rootBucketPointer = new OBonsaiBucketPointer(0); private final Comparator<? super K> comparator = ODefaultComparator.INSTANCE;</BUG> private OStorageLocalAbstract storage; private String name; private final String dataFileExtension;
private OBonsaiBucketPointer rootBucketPointer; private final Comparator<? super K> comparator = ODefaultComparator.INSTANCE;
8,583
OCacheEntry rootCacheEntry; if (rootIndex < 0) rootCacheEntry = diskCache.allocateNewPage(fileId); else rootCacheEntry = diskCache.load(fileId, rootIndex, false); <BUG>rootBucketPointer = new OBonsaiBucketPointer(rootCacheEntry.getPageIndex()); </BUG> OCachePointer rootPointer = rootCacheEntry.getCachePointer(); rootPointer.acquireExclusiveLock(); try {
rootBucketPointer = new OBonsaiBucketPointer(rootCacheEntry.getPageIndex(), 8192 * 2);
8,584
final int startRightIndex = splitLeaf ? indexToSplit : indexToSplit + 1; for (int i = startRightIndex; i < bucketSize; i++) rightEntries.add(bucketToSplit.getEntry(i)); if (!bucketPointer.equals(rootBucketPointer)) { OCacheEntry rightBucketEntry = diskCache.allocateNewPage(fileId); <BUG>final OBonsaiBucketPointer rightBucketPointer = new OBonsaiBucketPointer(rightBucketEntry.getPageIndex()); </BUG> OCachePointer rightPointer = rightBucketEntry.getCachePointer(); rightPointer.acquireExclusiveLock(); try {
final OBonsaiBucketPointer rightBucketPointer = new OBonsaiBucketPointer(rightBucketEntry.getPageIndex(), 8192 * 2);
8,585
LOWEST_BOUNDARY } private static final class PagePathItemUnit { private final OBonsaiBucketPointer bucketPointer; private final int itemIndex; <BUG>private PagePathItemUnit(long pageIndex, int itemIndex) { this.bucketPointer = new OBonsaiBucketPointer(pageIndex); this.itemIndex = itemIndex; }</BUG> private PagePathItemUnit(OBonsaiBucketPointer bucketPointer, int itemIndex) {
[DELETED]
8,586
private static final int MAX_ENTREE_SIZE = OGlobalConfiguration.SBTREE_MAX_ENTREE_SIZE.getValueAsInteger(); private static final int FREE_POINTER_OFFSET = WAL_POSITION_OFFSET + OLongSerializer.LONG_SIZE; private static final int SIZE_OFFSET = FREE_POINTER_OFFSET + OIntegerSerializer.INT_SIZE; private static final int IS_LEAF_OFFSET = SIZE_OFFSET + OIntegerSerializer.INT_SIZE; private static final int LEFT_SIBLING_OFFSET = IS_LEAF_OFFSET + OByteSerializer.BYTE_SIZE; <BUG>private static final int RIGHT_SIBLING_OFFSET = LEFT_SIBLING_OFFSET + OLongSerializer.LONG_SIZE; private static final int TREE_SIZE_OFFSET = RIGHT_SIBLING_OFFSET + OLongSerializer.LONG_SIZE; private static final int KEY_SERIALIZER_OFFSET = TREE_SIZE_OFFSET + OLongSerializer.LONG_SIZE;</BUG> private static final int VALUE_SERIALIZER_OFFSET = KEY_SERIALIZER_OFFSET + OByteSerializer.BYTE_SIZE; private static final int POSITIONS_ARRAY_OFFSET = VALUE_SERIALIZER_OFFSET + OByteSerializer.BYTE_SIZE;
private static final int RIGHT_SIBLING_OFFSET = LEFT_SIBLING_OFFSET + OLongSerializer.LONG_SIZE private static final int TREE_SIZE_OFFSET = RIGHT_SIBLING_OFFSET + OLongSerializer.LONG_SIZE private static final int KEY_SERIALIZER_OFFSET = TREE_SIZE_OFFSET + OLongSerializer.LONG_SIZE;
8,587
K key = keySerializer.deserializeFromDirectMemory(directMemory, pagePointer + offset + entryPosition); entryPosition += keySerializer.getObjectSizeInDirectMemory(directMemory, pagePointer + offset + entryPosition); V value = valueSerializer.deserializeFromDirectMemory(directMemory, pagePointer + offset + entryPosition); return new SBTreeEntry<K, V>(OBonsaiBucketPointer.NULL, OBonsaiBucketPointer.NULL, key, value); } else { <BUG>OBonsaiBucketPointer leftChild = new OBonsaiBucketPointer(getLongValue(offset + entryPosition)); entryPosition += OLongSerializer.LONG_SIZE; OBonsaiBucketPointer rightChild = new OBonsaiBucketPointer(getLongValue(offset + entryPosition)); entryPosition += OLongSerializer.LONG_SIZE; K key = keySerializer.deserializeFromDirectMemory(directMemory, pagePointer + offset + entryPosition);</BUG> return new SBTreeEntry<K, V>(leftChild, rightChild, key, null);
OBonsaiBucketPointer leftChild = getBucketPointer(offset + entryPosition); entryPosition += OLongSerializer.LONG_SIZE + OIntegerSerializer.INT_SIZE; OBonsaiBucketPointer rightChild = getBucketPointer(offset + entryPosition); entryPosition += OLongSerializer.LONG_SIZE + OIntegerSerializer.INT_SIZE;
8,588
else valueSize = valueSerializer.getObjectSize(treeEntry.value); entrySize += valueSize; checkEntreeSize(entrySize); } else <BUG>entrySize += 2 * OLongSerializer.LONG_SIZE; int size = size();</BUG> int freePointer = getIntValue(offset + FREE_POINTER_OFFSET); if (freePointer - entrySize < (size + 1) * OIntegerSerializer.INT_SIZE + POSITIONS_ARRAY_OFFSET) return false;
entrySize += 2 * (OLongSerializer.LONG_SIZE + OIntegerSerializer.INT_SIZE); int size = size();
8,589
freePointer += keySize; byte[] serializedValue = new byte[valueSize]; valueSerializer.serializeNative(treeEntry.value, serializedValue, 0); setBinaryValue(offset + freePointer, serializedValue); } else { <BUG>setLongValue(offset + freePointer, treeEntry.leftChild.getPageIndex()); freePointer += OLongSerializer.LONG_SIZE; setLongValue(offset + freePointer, treeEntry.rightChild.getPageIndex()); freePointer += OLongSerializer.LONG_SIZE; byte[] serializedKey = new byte[keySize];</BUG> keySerializer.serializeNative(treeEntry.key, serializedKey, 0);
setBucketPointer(offset + freePointer, treeEntry.leftChild); freePointer += OLongSerializer.LONG_SIZE + OIntegerSerializer.INT_SIZE; setBucketPointer(offset + freePointer, treeEntry.rightChild); freePointer += OLongSerializer.LONG_SIZE + OIntegerSerializer.INT_SIZE; byte[] serializedKey = new byte[keySize];
8,590
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;
8,591
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;
8,592
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"),
8,593
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]
8,594
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) {
8,595
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;
8,596
import org.eclipse.jetty.server.handler.ContextHandlerCollection; import org.eclipse.jetty.server.nio.SelectChannelConnector;</BUG> import org.eclipse.jetty.server.session.HashSessionManager; import org.eclipse.jetty.server.session.SessionHandler; <BUG>import org.eclipse.jetty.server.ssl.SslConnector; import org.eclipse.jetty.server.ssl.SslSelectChannelConnector;</BUG> import org.eclipse.jetty.servlet.FilterHolder; import org.eclipse.jetty.servlet.ServletContextHandler; import org.eclipse.jetty.servlet.ServletHolder; import org.eclipse.jetty.servlets.CrossOriginFilter;
[DELETED]
8,597
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception { CometdEndpoint endpoint = new CometdEndpoint(this, uri, remaining, parameters); setProperties(endpoint, parameters); return endpoint; } <BUG>public void connect(CometdProducerConsumer prodcon) throws Exception { CometdEndpoint endpoint = prodcon.getEndpoint();</BUG> String connectorKey = endpoint.getProtocol() + ":" + endpoint.getUri().getHost() + ":" + endpoint.getPort(); synchronized (connectors) { ConnectorRef connectorRef = connectors.get(connectorKey);
Server server = null; CometdEndpoint endpoint = prodcon.getEndpoint();
8,598
if ("cometds".equals(endpoint.getProtocol())) { connector = getSslSocketConnector(); </BUG> } else { <BUG>connector = new SelectChannelConnector(); </BUG> } connector.setPort(endpoint.getPort()); connector.setHost(endpoint.getUri().getHost()); if ("localhost".equalsIgnoreCase(endpoint.getUri().getHost())) {
connector = getSslSocketConnector(server); connector = new ServerConnector(server);
8,599
import java.util.HashSet; import java.util.Set; import org.apache.camel.Exchange; import org.apache.camel.Message; import org.apache.camel.Processor; <BUG>import org.apache.camel.component.cometd.CometdConsumer.ConsumerService; import org.cometd.bayeux.server.LocalSession;</BUG> import org.cometd.bayeux.server.ServerChannel; import org.cometd.bayeux.server.ServerMessage; import org.cometd.bayeux.server.ServerSession;
import org.cometd.bayeux.MarkedReference; import org.cometd.bayeux.server.LocalSession;
8,600
import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; import static org.junit.Assert.assertEquals; <BUG>import static org.mockito.Matchers.anyString; import static org.mockito.Mockito.mock;</BUG> import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @RunWith(MockitoJUnitRunner.class)
import static org.mockito.Matchers.anyObject; import static org.mockito.Mockito.mock;