conflict_resolution
stringlengths
27
16k
<<<<<<< import com.scottlogic.deg.generator.inputs.validation.ProfileVisitor; import com.scottlogic.deg.generator.inputs.validation.VisitableProfileElement; ======= import com.scottlogic.deg.generator.inputs.RuleInformation; >>>>>>> import com.scottlogic.deg.generator.inputs.validation.ProfileVisitor; import com.scottlogic.deg.generator.inputs.validation.VisitableProfileElement; import com.scottlogic.deg.generator.inputs.RuleInformation; <<<<<<< @Override public void accept(ProfileVisitor visitor) { visitor.visit(this); } ======= @Override public Set<RuleInformation> getRules() { return rules; } @Override public AtomicConstraint withRules(Set<RuleInformation> rules) { return new IsInSetConstraint(this.field, this.legalValues, rules); } >>>>>>> @Override public void accept(ProfileVisitor visitor) { visitor.visit(this); } @Override public Set<RuleInformation> getRules() { return rules; } @Override public AtomicConstraint withRules(Set<RuleInformation> rules) { return new IsInSetConstraint(this.field, this.legalValues, rules); }
<<<<<<< .withNumericRestrictions( LinearRestrictionsFactory.createNumericRestrictions( ======= .withRestrictions( new NumericRestrictions( >>>>>>> .withRestrictions( LinearRestrictionsFactory.createNumericRestrictions(
<<<<<<< @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsLessThanOrEqualToConstantConstraint constraint = (IsLessThanOrEqualToConstantConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } ======= @Override public String toString() { return String.format("`%s` <= %s", field.name, referenceValue); } >>>>>>> @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsLessThanOrEqualToConstantConstraint constraint = (IsLessThanOrEqualToConstantConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } @Override public String toString() { return String.format("`%s` <= %s", field.name, referenceValue); }
<<<<<<< import com.scottlogic.deg.generator.walker.routes.ExhaustiveProducer; import com.scottlogic.deg.generator.walker.routes.RowSpecRouteProducer; import com.scottlogic.deg.profile.v0_1.ProfileSchemaValidator; ======= import com.scottlogic.deg.schemas.v0_1.ProfileSchemaValidator; >>>>>>> import com.scottlogic.deg.profile.v0_1.ProfileSchemaValidator;
<<<<<<< import com.scottlogic.deg.generator.profile.constraints.atomic.AtomicConstraint; import com.scottlogic.deg.profile.custom.CustomConstraintFactory; ======= import com.scottlogic.deg.profile.dtos.FieldDTO; >>>>>>> import com.scottlogic.deg.generator.profile.constraints.atomic.AtomicConstraint; import com.scottlogic.deg.profile.custom.CustomConstraintFactory; import com.scottlogic.deg.profile.dtos.FieldDTO; <<<<<<< Collection<Constraint> customConstraints = profileDTO.fields.stream() .filter(fieldDTO -> fieldDTO.generator != null) .map(fieldDTO -> customConstraintFactory.create(profileFields.getByName(fieldDTO.name), fieldDTO.generator)) .collect(Collectors.toList()); if (!nullableConstraints.isEmpty()) { rules.add(new Rule(new RuleInformation("nullable-rules"), nullableConstraints)); ======= if (!nonNullableConstraints.isEmpty()) { rules.add(new Rule(new RuleInformation("nullable-rules"), nonNullableConstraints)); >>>>>>> Collection<Constraint> customConstraints = profileDTO.fields.stream() .filter(fieldDTO -> fieldDTO.generator != null) .map(fieldDTO -> customConstraintFactory.create(profileFields.getByName(fieldDTO.name), fieldDTO.generator)) .collect(Collectors.toList()); if (!nonNullableConstraints.isEmpty()) { rules.add(new Rule(new RuleInformation("nullable-rules"), nonNullableConstraints));
<<<<<<< import org.apache.thrift.TBase; ======= import voldemort.serialization.avro.AvroGenericSerializer; import voldemort.serialization.avro.AvroReflectiveSerializer; import voldemort.serialization.avro.AvroSpecificSerializer; >>>>>>> import org.apache.thrift.TBase; import voldemort.serialization.avro.AvroGenericSerializer; import voldemort.serialization.avro.AvroReflectiveSerializer; import voldemort.serialization.avro.AvroSpecificSerializer; <<<<<<< return new ThriftSerializer<TBase<?>>(serializerDef.getCurrentSchemaInfo()); ======= return new ThriftSerializer<TBase>(serializerDef.getCurrentSchemaInfo()); } else if(name.equals(AVRO_GENERIC_TYPE_NAME)) { return new AvroGenericSerializer(serializerDef.getCurrentSchemaInfo()); } else if(name.equals(AVRO_SPECIFIC_TYPE_NAME)) { return new AvroSpecificSerializer(serializerDef.getCurrentSchemaInfo()); } else if(name.equals(AVRO_REFLECTIVE_TYPE_NAME)) { return new AvroReflectiveSerializer(serializerDef.getCurrentSchemaInfo()); >>>>>>> return new ThriftSerializer<TBase<?>>(serializerDef.getCurrentSchemaInfo()); } else if(name.equals(AVRO_GENERIC_TYPE_NAME)) { return new AvroGenericSerializer(serializerDef.getCurrentSchemaInfo()); } else if(name.equals(AVRO_SPECIFIC_TYPE_NAME)) { return new AvroSpecificSerializer(serializerDef.getCurrentSchemaInfo()); } else if(name.equals(AVRO_REFLECTIVE_TYPE_NAME)) { return new AvroReflectiveSerializer(serializerDef.getCurrentSchemaInfo());
<<<<<<< import com.scottlogic.deg.common.profile.constraints.atomic.IsOfTypeConstraint; import com.scottlogic.deg.generator.restrictions.TypeRestrictions; import com.scottlogic.deg.generator.restrictions.linear.DateTimeRestrictions; ======= import com.scottlogic.deg.generator.restrictions.DateTimeRestrictions; import com.scottlogic.deg.generator.restrictions.DateTimeRestrictionsMerger; >>>>>>> import com.scottlogic.deg.generator.restrictions.linear.DateTimeRestrictions; <<<<<<< import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MAX_LIMIT; import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MIN_LIMIT; ======= import static com.scottlogic.deg.common.profile.Types.DATETIME; import static com.scottlogic.deg.common.profile.Types.NUMERIC; >>>>>>> import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MAX_LIMIT; import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MIN_LIMIT; import static com.scottlogic.deg.common.profile.Types.DATETIME; import static com.scottlogic.deg.common.profile.Types.NUMERIC; <<<<<<< left = FieldSpec.Empty.withDateTimeRestrictions(new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT)); right = FieldSpec.Empty.withDateTimeRestrictions(new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT)); ======= left = FieldSpec.fromType(DATETIME).withDateTimeRestrictions(new DateTimeRestrictions()); right = FieldSpec.fromType(DATETIME).withDateTimeRestrictions(new DateTimeRestrictions()); >>>>>>> left = FieldSpec.fromType(DATETIME).withDateTimeRestrictions(new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT)); right = FieldSpec.fromType(DATETIME).withDateTimeRestrictions(new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT));
<<<<<<< final LinearRestrictions<OffsetDateTime> dateTimeRestrictions = createDateTimeRestrictions(DATETIME_MIN_LIMIT, new Limit<>(referenceValue.getValue(), true)); return FieldSpec.fromRestriction(dateTimeRestrictions); ======= final LinearRestrictions<OffsetDateTime> dateTimeRestrictions = createDateTimeRestrictions(DATETIME_MIN_LIMIT, new Limit<>(referenceValue, true)); return FieldSpecFactory.fromRestriction(dateTimeRestrictions); >>>>>>> final LinearRestrictions<OffsetDateTime> dateTimeRestrictions = createDateTimeRestrictions(DATETIME_MIN_LIMIT, new Limit<>(referenceValue.getValue(), true)); return FieldSpecFactory.fromRestriction(dateTimeRestrictions);
<<<<<<< @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsBeforeOrEqualToConstantDateTimeConstraint constraint = (IsBeforeOrEqualToConstantDateTimeConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } ======= @Override public String toString() { return String.format("`%s` <= %s", field.name, referenceValue); } >>>>>>> @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsBeforeOrEqualToConstantDateTimeConstraint constraint = (IsBeforeOrEqualToConstantDateTimeConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } @Override public String toString() { return String.format("`%s` <= %s", field.name, referenceValue); }
<<<<<<< ======= import com.scottlogic.deg.generator.generation.databags.DataBagValue; import com.scottlogic.deg.generator.restrictions.linear.Limit; >>>>>>> import com.scottlogic.deg.generator.generation.databags.DataBagValue; import com.scottlogic.deg.generator.restrictions.linear.Limit;
<<<<<<< import static com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions.NUMERIC_MAX_LIMIT; import static com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions.NUMERIC_MIN_LIMIT; ======= import static com.scottlogic.deg.common.profile.Types.*; >>>>>>> import static com.scottlogic.deg.common.profile.Types.*; import static com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions.NUMERIC_MAX_LIMIT; import static com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions.NUMERIC_MIN_LIMIT; <<<<<<< NumericRestrictions numericRestrictions = new NumericRestrictions( new Limit<>(new BigDecimal(10), false), new Limit<>(new BigDecimal(30), false)); TypeRestrictions typeRestrictions = new TypeRestrictions(Collections.singletonList( IsOfTypeConstraint.Types.NUMERIC )); FieldSpec fieldSpecWithTypedNumericRestrictionsAndNullNotDisallowed = FieldSpec.Empty .withNumericRestrictions(numericRestrictions) .withTypeRestrictions(typeRestrictions); ======= NumericRestrictions numericRestrictions = new NumericRestrictions() {{ min = new NumericLimit<>(new BigDecimal(10), false); max = new NumericLimit<>(new BigDecimal(30), false); }}; FieldSpec fieldSpecWithTypedNumericRestrictionsAndNullNotDisallowed = FieldSpec.fromType(NUMERIC) .withNumericRestrictions(numericRestrictions); >>>>>>> NumericRestrictions numericRestrictions = new NumericRestrictions( new Limit<>(new BigDecimal(10), false), new Limit<>(new BigDecimal(30), false)); FieldSpec fieldSpecWithTypedNumericRestrictionsAndNullNotDisallowed = FieldSpec.fromType(NUMERIC) .withNumericRestrictions(numericRestrictions); <<<<<<< DateTimeRestrictions datetimeRestrictions = new DateTimeRestrictions( new Limit<>(OffsetDateTime.MIN, false), new Limit<>(OffsetDateTime.MAX, false) ); TypeRestrictions typeRestrictions = new TypeRestrictions(Collections.singletonList( IsOfTypeConstraint.Types.DATETIME )); FieldSpec fieldSpecInSetWithTypedDateTimeRestrictionsAndNullNotDisallowed = FieldSpec.Empty .withDateTimeRestrictions(datetimeRestrictions) .withTypeRestrictions(typeRestrictions); ======= DateTimeRestrictions datetimeRestrictions = new DateTimeRestrictions() {{ min = new DateTimeLimit(OffsetDateTime.MIN, false); max = new DateTimeLimit(OffsetDateTime.MAX, false); }}; FieldSpec fieldSpecInSetWithTypedDateTimeRestrictionsAndNullNotDisallowed = FieldSpec.fromType(DATETIME) .withDateTimeRestrictions(datetimeRestrictions); >>>>>>> DateTimeRestrictions datetimeRestrictions = new DateTimeRestrictions( new Limit<>(OffsetDateTime.MIN, false), new Limit<>(OffsetDateTime.MAX, false) ); FieldSpec fieldSpecInSetWithTypedDateTimeRestrictionsAndNullNotDisallowed = FieldSpec.fromType(DATETIME) .withDateTimeRestrictions(datetimeRestrictions); <<<<<<< FieldSpec fieldSpec = FieldSpec.Empty.withNumericRestrictions( new NumericRestrictions(new Limit<>(new BigDecimal(0), false), new Limit<>(new BigDecimal("1E+18"), false)) ).withTypeRestrictions( new TypeRestrictions( Collections.singletonList(IsOfTypeConstraint.Types.NUMERIC) ) ======= FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions() {{ min = new NumericLimit<>(new BigDecimal(0), false); max = new NumericLimit<>(new BigDecimal("1E+18"), false); }} >>>>>>> FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions(new Limit<>(new BigDecimal(0), false), new Limit<>(new BigDecimal("1E+18"), false)) <<<<<<< FieldSpec fieldSpec = FieldSpec.Empty.withNumericRestrictions( new NumericRestrictions(new Limit<>(new BigDecimal("15.00000000000000000001"), false), new Limit<>(new BigDecimal("15.00000000000000000010"), false)) ).withTypeRestrictions( new TypeRestrictions( Collections.singletonList(IsOfTypeConstraint.Types.NUMERIC) ) ======= FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions() {{ min = new NumericLimit<>(new BigDecimal("15.00000000000000000001"), false); max = new NumericLimit<>(new BigDecimal("15.00000000000000000010"), false); }} >>>>>>> FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions(new Limit<>(new BigDecimal("15.00000000000000000001"), false), new Limit<>(new BigDecimal("15.00000000000000000010"), false)) <<<<<<< NumericRestrictions restrictions = new NumericRestrictions( new Limit<>(new BigDecimal("15"), false), new Limit<>(new BigDecimal("16"), false), 2); FieldSpec fieldSpec = FieldSpec.Empty.withNumericRestrictions( ======= NumericRestrictions restrictions = new NumericRestrictions(2); restrictions.min = new NumericLimit<>(new BigDecimal("15"), false); restrictions.max = new NumericLimit<>(new BigDecimal("16"), false); FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( >>>>>>> NumericRestrictions restrictions = new NumericRestrictions( new Limit<>(new BigDecimal("15"), false), new Limit<>(new BigDecimal("16"), false), 2); FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( <<<<<<< FieldSpec fieldSpec = FieldSpec.Empty.withNumericRestrictions( new NumericRestrictions(NUMERIC_MIN_LIMIT, NUMERIC_MAX_LIMIT) ).withTypeRestrictions( new TypeRestrictions( Collections.singletonList(IsOfTypeConstraint.Types.NUMERIC) ) ======= FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions() >>>>>>> FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions(NUMERIC_MIN_LIMIT, NUMERIC_MAX_LIMIT) <<<<<<< FieldSpec fieldSpec = FieldSpec.Empty.withNumericRestrictions( new NumericRestrictions(NUMERIC_MIN_LIMIT, new Limit<>(new BigDecimal("150.5"), false)) ).withTypeRestrictions( new TypeRestrictions( Collections.singletonList(IsOfTypeConstraint.Types.NUMERIC) ) ======= FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions() {{ max = new NumericLimit<>(new BigDecimal("150.5"), false); }} >>>>>>> FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions(NUMERIC_MIN_LIMIT, new Limit<>(new BigDecimal("150.5"), false)) <<<<<<< FieldSpec fieldSpec = FieldSpec.Empty.withNumericRestrictions( new NumericRestrictions( new Limit<>(new BigDecimal("1.1E-30"), false), new Limit<>(new BigDecimal("1.5E-20"), false)) ).withTypeRestrictions( new TypeRestrictions( Collections.singletonList(IsOfTypeConstraint.Types.NUMERIC) ) ======= FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions() {{ min = new NumericLimit<>(new BigDecimal("1.1E-30"), false); max = new NumericLimit<>(new BigDecimal("1.5E-20"), false); }} >>>>>>> FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions( new Limit<>(new BigDecimal("1.1E-30"), false), new Limit<>(new BigDecimal("1.5E-20"), false)) <<<<<<< FieldSpec fieldSpec = FieldSpec.Empty.withNumericRestrictions( new NumericRestrictions( new Limit<>(new BigDecimal("-3E-20"), false), new Limit<>(new BigDecimal("3E-20"), false)) ).withTypeRestrictions( new TypeRestrictions( Collections.singletonList(IsOfTypeConstraint.Types.NUMERIC) ) ======= FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions() {{ min = new NumericLimit<>(new BigDecimal("-3E-20"), false); max = new NumericLimit<>(new BigDecimal("3E-20"), false); }} >>>>>>> FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions( new Limit<>(new BigDecimal("-3E-20"), false), new Limit<>(new BigDecimal("3E-20"), false))
<<<<<<< import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MAX_LIMIT; import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MIN_LIMIT; ======= import static com.scottlogic.deg.common.profile.Types.*; >>>>>>> import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MAX_LIMIT; import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MIN_LIMIT; import static com.scottlogic.deg.common.profile.Types.*;
<<<<<<< private Profile getProfile(Path path) throws IOException, InvalidProfileException { ConstraintReaderMapEntrySource[] mappingProviders = { new CoreAtomicTypesConstraintReaderSource(), new FinancialTypesConstraintReaderSource(), new PersonalDataTypesConstraintReaderSource() }; BaseConstraintReaderMap readerMap = new BaseConstraintReaderMap(Arrays.stream(mappingProviders)); return new JsonProfileReader(readerMap).read(path); ======= private Profile getProfile(Path path) throws IOException { return new JsonProfileReader().read(path); >>>>>>> private Profile getProfile(Path path) throws IOException { ConstraintReaderMapEntrySource[] mappingProviders = { new CoreAtomicTypesConstraintReaderSource(), new FinancialTypesConstraintReaderSource(), new PersonalDataTypesConstraintReaderSource() }; BaseConstraintReaderMap readerMap = new BaseConstraintReaderMap(Arrays.stream(mappingProviders)); return new JsonProfileReader(readerMap).read(path);
<<<<<<< DateTimeRestrictions restrictions = new DateTimeRestrictions(limit, limit); return FieldSpec.Empty.withDateTimeRestrictions(restrictions); ======= DateTimeRestrictions restrictions = new DateTimeRestrictions(); restrictions.min = limit; restrictions.max = limit; return FieldSpec.fromType(DATETIME).withDateTimeRestrictions(restrictions); >>>>>>> DateTimeRestrictions restrictions = new DateTimeRestrictions(limit, limit); return FieldSpec.fromType(DATETIME).withDateTimeRestrictions(restrictions);
<<<<<<< @Override public String toString() { return String.format("`%s` <= %s", field.name, referenceValue); } ======= @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsLessThanOrEqualToConstantConstraint constraint = (IsLessThanOrEqualToConstantConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } >>>>>>> @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsLessThanOrEqualToConstantConstraint constraint = (IsLessThanOrEqualToConstantConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } @Override public String toString() { return String.format("`%s` <= %s", field.name, referenceValue); }
<<<<<<< import com.scottlogic.deg.generator.generation.databags.IDataBagSource; import com.scottlogic.deg.generator.generation.field_value_sources.CombiningFieldValueSource; import com.scottlogic.deg.generator.generation.field_value_sources.IFieldValueSource; import com.scottlogic.deg.generator.restrictions.FieldSpec; ======= import com.scottlogic.deg.generator.generation.databags.DataBagSource; import com.scottlogic.deg.generator.generation.field_value_sources.*; import com.scottlogic.deg.generator.restrictions.*; >>>>>>> import com.scottlogic.deg.generator.generation.databags.DataBagSource; import com.scottlogic.deg.generator.generation.field_value_sources.CombiningFieldValueSource; import com.scottlogic.deg.generator.generation.field_value_sources.FieldValueSource; import com.scottlogic.deg.generator.restrictions.FieldSpec; <<<<<<< List<IFieldValueSource> fieldValueSources = this.sourceFactory.getFieldValueSources(this.spec); ======= List<FieldValueSource> fieldValueSources = getAllApplicableValueSources(); >>>>>>> List<FieldValueSource> fieldValueSources = this.sourceFactory.getFieldValueSources(this.spec); <<<<<<< private Iterable<Object> getDataValues(IFieldValueSource source, GenerationConfig.DataGenerationType dataType) { ======= private List<FieldValueSource> getAllApplicableValueSources() { List<FieldValueSource> validSources = new ArrayList<>(); // check nullability... if (determineNullabilityAndDecideWhetherToHalt(validSources)) return validSources; // if there's a whitelist, we can just output that if (spec.getSetRestrictions() != null) { Set<?> whitelist = spec.getSetRestrictions().getWhitelist(); if (whitelist != null) { return Collections.singletonList( new CannedValuesFieldValueSource( new ArrayList<>(whitelist))); } } TypeRestrictions typeRestrictions = spec.getTypeRestrictions() != null ? spec.getTypeRestrictions() : DataTypeRestrictions.all; if (typeRestrictions.isTypeAllowed(IsOfTypeConstraint.Types.NUMERIC)) { NumericRestrictions restrictions = spec.getNumericRestrictions() == null ? new NumericRestrictions() : spec.getNumericRestrictions(); int numericScale = spec.getGranularityRestrictions() != null ? spec.getGranularityRestrictions().getNumericScale() : 0; if (numericScale == 0) { validSources.add( new IntegerFieldValueSource( restrictions, getBlacklist())); } else { validSources.add( new RealNumberFieldValueSource( restrictions, getBlacklist(), numericScale)); } } if (typeRestrictions.isTypeAllowed(IsOfTypeConstraint.Types.STRING)) { StringRestrictions stringRestrictions = spec.getStringRestrictions(); if (stringRestrictions != null && (stringRestrictions.stringGenerator != null)) { Set<Object> blacklist = getBlacklist(); final StringGenerator generator; if (blacklist.size() > 0) { RegexStringGenerator blacklistGenerator = RegexStringGenerator.createFromBlacklist(blacklist); generator = stringRestrictions.stringGenerator.intersect(blacklistGenerator); } else { generator = stringRestrictions.stringGenerator; } validSources.add(generator.asFieldValueSource()); } else { // todo: move default interesting values into the string field value source validSources.add(CannedValuesFieldValueSource.of("Lorem Ipsum")); } } if (typeRestrictions.isTypeAllowed(IsOfTypeConstraint.Types.TEMPORAL)) { DateTimeRestrictions restrictions = spec.getDateTimeRestrictions(); validSources.add(new TemporalFieldValueSource( restrictions != null ? restrictions : new DateTimeRestrictions(), getBlacklist())); } return validSources; } private Iterable<Object> getDataValues(FieldValueSource source, GenerationConfig.DataGenerationType dataType) { >>>>>>> private Iterable<Object> getDataValues(FieldValueSource source, GenerationConfig.DataGenerationType dataType) { <<<<<<< } ======= private boolean determineNullabilityAndDecideWhetherToHalt(List<FieldValueSource> fieldValueSources) { FieldValueSource nullOnlySource = new CannedValuesFieldValueSource(Collections.singletonList(null)); if (spec.getNullRestrictions() != null) { if (spec.getNullRestrictions().nullness == NullRestrictions.Nullness.MUST_BE_NULL) { // if *always* null, add a null-only source and signal that no other sources are needed fieldValueSources.add(nullOnlySource); return true; } else if (spec.getNullRestrictions().nullness == NullRestrictions.Nullness.MUST_NOT_BE_NULL) { // if *never* null, add nothing and signal that source generation should continue return false; } } // if none of the above, the field is nullable fieldValueSources.add(nullOnlySource); return false; } private Set<Object> getBlacklist() { if (spec.getSetRestrictions() == null) return Collections.emptySet(); return new HashSet<>(spec.getSetRestrictions().getBlacklist()); } } >>>>>>> }
<<<<<<< import com.scottlogic.deg.common.util.HeterogeneousTypeContainer; import com.scottlogic.deg.generator.restrictions.linear.DateTimeRestrictions; import com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions; ======= >>>>>>> import com.scottlogic.deg.generator.restrictions.linear.DateTimeRestrictions; import com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions;
<<<<<<< import com.scottlogic.deg.generator.decisiontree.test_utils.EqualityComparer; ======= import com.scottlogic.deg.schemas.v3.RuleDTO; >>>>>>> import com.scottlogic.deg.generator.decisiontree.test_utils.EqualityComparer; import com.scottlogic.deg.schemas.v3.RuleDTO;
<<<<<<< import com.scottlogic.deg.generator.generation.SystemOutDataGeneratorMonitor; import com.scottlogic.deg.generator.generation.combination_strategies.ExhaustiveCombinationStrategy; import com.scottlogic.deg.generator.generation.combination_strategies.FieldExhaustiveCombinationStrategy; ======= >>>>>>> import com.scottlogic.deg.generator.generation.SystemOutDataGeneratorMonitor; <<<<<<< new ExhaustiveCombinationStrategy()); ======= combinationType); >>>>>>> combinationType);
<<<<<<< FieldSpecSource fieldSpecSource = FieldSpecSource.Empty; FieldSpec fieldSpecMustBeNull = FieldSpec.mustBeNull(fieldSpecSource); ======= NullRestrictions nullRestrictions = new NullRestrictions(Nullness.MUST_BE_NULL); FieldSpec fieldSpecMustBeNull = FieldSpec.Empty .withNullRestrictions(nullRestrictions); >>>>>>> FieldSpec fieldSpecMustBeNull = FieldSpec.mustBeNull(); <<<<<<< ), FieldSpecSource.Empty ).withNotNull( FieldSpecSource.Empty ======= ) ).withNullRestrictions( new NullRestrictions(Nullness.MUST_NOT_BE_NULL) >>>>>>> ) ).withNotNull(
<<<<<<< ======= import com.scottlogic.deg.common.profile.constraints.atomic.*; >>>>>>> <<<<<<< import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf; ======= import static org.hamcrest.CoreMatchers.*; >>>>>>> import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.instanceOf;
<<<<<<< import com.scottlogic.deg.generator.fieldspecs.RowSpec; import com.scottlogic.deg.generator.walker.reductive.FieldCollection; import com.scottlogic.deg.generator.walker.reductive.FieldCollectionFactory; import com.scottlogic.deg.generator.walker.reductive.IterationVisualiser; import com.scottlogic.deg.generator.walker.reductive.ReductiveDecisionTreeAdapter; ======= import com.scottlogic.deg.generator.restrictions.RowSpec; import com.scottlogic.deg.generator.walker.reductive.*; >>>>>>> import com.scottlogic.deg.generator.fieldspecs.RowSpec; import com.scottlogic.deg.generator.walker.reductive.*;
<<<<<<< import com.scottlogic.deg.generator.inputs.validation.ProfileVisitor; import com.scottlogic.deg.generator.inputs.validation.VisitableProfileElement; ======= import com.scottlogic.deg.generator.inputs.RuleInformation; >>>>>>> import com.scottlogic.deg.generator.inputs.validation.ProfileVisitor; import com.scottlogic.deg.generator.inputs.validation.VisitableProfileElement; import com.scottlogic.deg.generator.inputs.RuleInformation; <<<<<<< @Override public void accept(ProfileVisitor visitor) { visitor.visit(this); } ======= @Override public Set<RuleInformation> getRules() { return rules; } @Override public AtomicConstraint withRules(Set<RuleInformation> rules) { return new IsGreaterThanOrEqualToConstantConstraint(this.field, this.referenceValue, rules); } >>>>>>> @Override public void accept(ProfileVisitor visitor) { visitor.visit(this); } @Override public Set<RuleInformation> getRules() { return rules; } @Override public AtomicConstraint withRules(Set<RuleInformation> rules) { return new IsGreaterThanOrEqualToConstantConstraint(this.field, this.referenceValue, rules); }
<<<<<<< @Override public String toString() { return String.format("`%s` >= %s", field.name, referenceValue); } ======= @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsGreaterThanOrEqualToConstantConstraint constraint = (IsGreaterThanOrEqualToConstantConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } >>>>>>> @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsGreaterThanOrEqualToConstantConstraint constraint = (IsGreaterThanOrEqualToConstantConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } @Override public String toString() { return String.format("`%s` >= %s", field.name, referenceValue); }
<<<<<<< import com.scottlogic.deg.generator.restrictions.linear.DateTimeRestrictions; import com.scottlogic.deg.generator.restrictions.linear.Limit; import com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions; import com.scottlogic.deg.generator.utils.SetUtils; ======= >>>>>>> import com.scottlogic.deg.generator.restrictions.linear.DateTimeRestrictions; import com.scottlogic.deg.generator.restrictions.linear.Limit; import com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions; import com.scottlogic.deg.generator.utils.SetUtils; <<<<<<< import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MAX_LIMIT; import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MIN_LIMIT; ======= import static com.scottlogic.deg.common.profile.Types.*; >>>>>>> import static com.scottlogic.deg.common.profile.Types.*; import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MAX_LIMIT; import static com.scottlogic.deg.generator.utils.Defaults.DATETIME_MIN_LIMIT; <<<<<<< ======= void equals_fieldSpecNumericRestrictionsNotNullAndOtherObjectNumericRestrictionsNull_returnsFalse() { FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions()); boolean result = fieldSpec.equals(FieldSpec.fromType(NUMERIC)); assertFalse( "Expected that when the field spec numeric restrictions is not null and the other object numeric restrictions are null a false value is returned but was true", result ); } @Test void equals_fieldSpecNumericRestrictionsNullAndOtherObjectNumericRestrictionsNotNull_returnsFalse() { FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC); boolean result = fieldSpec.equals( FieldSpec.fromType(NUMERIC).withNumericRestrictions( new NumericRestrictions()) ); assertFalse( "Expected that when the field spec does not have numeric restrictions and the other object has numeric restricitons are false value should be returned but was true", result ); } @Test >>>>>>> <<<<<<< NumericRestrictions firstFieldSpecRestrictions = new NumericRestrictions( new Limit<>(new BigDecimal(1), false), new Limit<>(new BigDecimal(20), false)); FieldSpec fieldSpec = FieldSpec.Empty.withNumericRestrictions(firstFieldSpecRestrictions); ======= NumericRestrictions firstFieldSpecRestrictions = new NumericRestrictions(); firstFieldSpecRestrictions.min = new NumericLimit<>(new BigDecimal(1), false); firstFieldSpecRestrictions.max = new NumericLimit<>(new BigDecimal(20), false); FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions(firstFieldSpecRestrictions); >>>>>>> NumericRestrictions firstFieldSpecRestrictions = new NumericRestrictions( new Limit<>(new BigDecimal(1), false), new Limit<>(new BigDecimal(20), false)); FieldSpec fieldSpec = FieldSpec.fromType(NUMERIC).withNumericRestrictions(firstFieldSpecRestrictions); <<<<<<< NumericRestrictions numeric = new NumericRestrictions(new Limit<>(BigDecimal.TEN, true), NumericRestrictions.NUMERIC_MAX_LIMIT); FieldSpec spec = FieldSpec.Empty.withNumericRestrictions(numeric); ======= NumericRestrictions numeric = new NumericRestrictions(); FieldSpec spec = FieldSpec.fromType(NUMERIC).withNumericRestrictions(numeric); >>>>>>> NumericRestrictions numeric = new NumericRestrictions(new Limit<>(BigDecimal.TEN, true), NumericRestrictions.NUMERIC_MAX_LIMIT); FieldSpec spec = FieldSpec.fromType(NUMERIC).withNumericRestrictions(numeric); <<<<<<< DateTimeRestrictions dateTime = new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT); FieldSpec spec = FieldSpec.Empty.withDateTimeRestrictions(dateTime); ======= DateTimeRestrictions dateTime = new DateTimeRestrictions(); FieldSpec spec = FieldSpec.fromType(DATETIME).withDateTimeRestrictions(dateTime); >>>>>>> DateTimeRestrictions dateTime = new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT); FieldSpec spec = FieldSpec.fromType(DATETIME).withDateTimeRestrictions(dateTime);
<<<<<<< import com.scottlogic.deg.generator.constraints.ConstraintRule; import com.scottlogic.deg.generator.generation.IStringGenerator; ======= import com.scottlogic.deg.generator.generation.StringGenerator; >>>>>>> import com.scottlogic.deg.generator.constraints.ConstraintRule; import com.scottlogic.deg.generator.generation.StringGenerator;
<<<<<<< bind(JavaUtilRandomNumberGenerator.class).toInstance(new JavaUtilRandomNumberGenerator(LocalDateTime.now().getNano())); ======= bind(ProfileProvider.class).in(Singleton.class); >>>>>>> bind(JavaUtilRandomNumberGenerator.class).toInstance(new JavaUtilRandomNumberGenerator(LocalDateTime.now().getNano())); bind(ProfileProvider.class).in(Singleton.class);
<<<<<<< import com.scottlogic.deg.generator.restrictions.*; import com.scottlogic.deg.generator.restrictions.linear.*; ======= import com.scottlogic.deg.generator.restrictions.StringRestrictions; import com.scottlogic.deg.generator.restrictions.TypedRestrictions; import com.scottlogic.deg.generator.restrictions.linear.DateTimeRestrictions; import com.scottlogic.deg.generator.restrictions.linear.Limit; import com.scottlogic.deg.generator.restrictions.linear.NumericRestrictions; >>>>>>> import com.scottlogic.deg.generator.restrictions.*; import com.scottlogic.deg.generator.restrictions.linear.*; <<<<<<< LinearRestrictions<BigDecimal> restrictions = mock(LinearRestrictions.class); FieldSpec augmentedFieldSpec = original.withNumericRestrictions(restrictions); ======= NumericRestrictions restrictions = mock(NumericRestrictions.class); FieldSpec augmentedFieldSpec = original.withRestrictions(restrictions); >>>>>>> LinearRestrictions<BigDecimal> restrictions = mock(LinearRestrictions.class); FieldSpec augmentedFieldSpec = original.withRestrictions(restrictions); <<<<<<< LinearRestrictions<OffsetDateTime> restrictions = mock(LinearRestrictions.class); FieldSpec augmentedFieldSpec = original.withDateTimeRestrictions(restrictions); ======= DateTimeRestrictions restrictions = mock(DateTimeRestrictions.class); FieldSpec augmentedFieldSpec = original.withRestrictions(restrictions); >>>>>>> LinearRestrictions<OffsetDateTime> restrictions = mock(LinearRestrictions.class); FieldSpec augmentedFieldSpec = original.withRestrictions(restrictions); <<<<<<< ======= public void fieldSpecsWithEqualNumericRestrictionsShouldBeEqual() { NumericRestrictions aRestrictions = new MockNumericRestrictions(true); NumericRestrictions bRestrictions = new MockNumericRestrictions(true); FieldSpec a = FieldSpec.fromType(NUMERIC).withRestrictions(aRestrictions); FieldSpec b = FieldSpec.fromType(NUMERIC).withRestrictions(bRestrictions); Assert.assertThat(a, equalTo(b)); Assert.assertThat(a.hashCode(), equalTo(b.hashCode())); } @Test public void fieldSpecsWithUnequalNumericRestrictionsShouldBeUnequal() { NumericRestrictions aRestrictions = new MockNumericRestrictions(false); NumericRestrictions bRestrictions = new MockNumericRestrictions(false); FieldSpec a = FieldSpec.fromType(NUMERIC).withRestrictions(aRestrictions); FieldSpec b = FieldSpec.fromType(NUMERIC).withRestrictions(bRestrictions); Assert.assertThat(a, not(equalTo(b))); } @Test >>>>>>> <<<<<<< ======= public void fieldSpecsWithEqualDateTimeRestrictionsShouldBeEqual() { DateTimeRestrictions aRestrictions = new MockDateTimeRestrictions(true); DateTimeRestrictions bRestrictions = new MockDateTimeRestrictions(true); FieldSpec a = FieldSpec.fromType(DATETIME).withRestrictions(aRestrictions); FieldSpec b = FieldSpec.fromType(DATETIME).withRestrictions(bRestrictions); Assert.assertThat(a, equalTo(b)); Assert.assertThat(a.hashCode(), equalTo(b.hashCode())); } @Test public void fieldSpecsWithUnequalDateTimeRestrictionsShouldBeUnequal() { DateTimeRestrictions aRestrictions = new MockDateTimeRestrictions(false); DateTimeRestrictions bRestrictions = new MockDateTimeRestrictions(false); FieldSpec a = FieldSpec.fromType(DATETIME).withRestrictions(aRestrictions); FieldSpec b = FieldSpec.fromType(DATETIME).withRestrictions(bRestrictions); Assert.assertThat(a, not(equalTo(b))); } @Test >>>>>>> <<<<<<< LinearRestrictions<BigDecimal> numeric = LinearRestrictionsFactory.createNumericRestrictions(new Limit<>(BigDecimal.TEN, true), NUMERIC_MAX_LIMIT); FieldSpec spec = FieldSpec.fromType(NUMERIC).withNumericRestrictions(numeric); ======= NumericRestrictions numeric = new NumericRestrictions(new Limit<>(BigDecimal.TEN, true), NUMERIC_MAX_LIMIT); FieldSpec spec = FieldSpec.fromType(NUMERIC).withRestrictions(numeric); >>>>>>> LinearRestrictions<BigDecimal> numeric = LinearRestrictionsFactory.createNumericRestrictions(new Limit<>(BigDecimal.TEN, true), NUMERIC_MAX_LIMIT); FieldSpec spec = FieldSpec.fromType(NUMERIC).withRestrictions(numeric); <<<<<<< LinearRestrictions<OffsetDateTime> dateTime = LinearRestrictionsFactory.createDateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT); FieldSpec spec = FieldSpec.fromType(DATETIME).withDateTimeRestrictions(dateTime); ======= DateTimeRestrictions dateTime = new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT); FieldSpec spec = FieldSpec.fromType(DATETIME).withRestrictions(dateTime); >>>>>>> LinearRestrictions<OffsetDateTime> dateTime = LinearRestrictionsFactory.createDateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT); FieldSpec spec = FieldSpec.fromType(DATETIME).withRestrictions(dateTime);
<<<<<<< import com.scottlogic.datahelix.generator.common.ValidationException; ======= import com.google.inject.Inject; >>>>>>> import com.google.inject.Inject; <<<<<<< public DistributedList<Object> setFromFile(File file) { InputStream streamFromPath = createStreamFromPath(file); DistributedList<String> names = CsvInputStreamReader.retrieveLines(streamFromPath); closeStream(streamFromPath); ======= private final CsvInputStreamReaderFactory csvReaderFactory; @Inject public FileReader(CsvInputStreamReaderFactory csvReaderFactory) { this.csvReaderFactory = csvReaderFactory; } public DistributedList<Object> setFromFile(String file) { CsvInputReader reader = csvReaderFactory.getReaderForFile(file); DistributedList<String> names = reader.retrieveLines(); >>>>>>> private final CsvInputStreamReaderFactory csvReaderFactory; @Inject public FileReader(CsvInputStreamReaderFactory csvReaderFactory) { this.csvReaderFactory = csvReaderFactory; } public DistributedList<Object> setFromFile(File file) { CsvInputReader reader = csvReaderFactory.getReaderForFile(file); DistributedList<String> names = reader.retrieveLines(); <<<<<<< public DistributedList<String> listFromMapFile(File file, String key) { InputStream streamFromPath = createStreamFromPath(file); DistributedList<String> names = CsvInputStreamReader.retrieveLines(streamFromPath, key); closeStream(streamFromPath); ======= public DistributedList<String> listFromMapFile(String file, String key) { CsvInputReader reader = csvReaderFactory.getReaderForFile(file); DistributedList<String> names = reader.retrieveLines(key); >>>>>>> public DistributedList<String> listFromMapFile(File file, String key) { CsvInputReader reader = csvReaderFactory.getReaderForFile(file); DistributedList<String> names = reader.retrieveLines(key); <<<<<<< private static InputStream createStreamFromPath(File path) { try { return new FileInputStream(path); } catch (FileNotFoundException e) { throw new ValidationException(e.getMessage()); } } private static void closeStream(InputStream stream) { try { stream.close(); } catch (IOException e) { throw new UncheckedIOException(e); } } ======= >>>>>>>
<<<<<<< private FieldSpec constructGreaterThanConstraint(Number limitValue, boolean inclusive, boolean negate) { final NumericRestrictions numericRestrictions; ======= private FieldSpec constructGreaterThanConstraint(Field field, Number limitValue, boolean inclusive, boolean negate) { final NumericRestrictions numericRestrictions = new NumericRestrictions(); >>>>>>> private FieldSpec constructGreaterThanConstraint(Field field, Number limitValue, boolean inclusive, boolean negate) { NumericRestrictions numericRestrictions; <<<<<<< private FieldSpec constructLessThanConstraint(Number limitValue, boolean inclusive, boolean negate) { NumericRestrictions numericRestrictions; ======= private FieldSpec constructLessThanConstraint(Field field, Number limitValue, boolean inclusive, boolean negate) { final NumericRestrictions numericRestrictions = new NumericRestrictions(); >>>>>>> private FieldSpec constructLessThanConstraint(Field field, Number limitValue, boolean inclusive, boolean negate) { final NumericRestrictions numericRestrictions; <<<<<<< return FieldSpec.Empty.withNumericRestrictions(new NumericRestrictions(NUMERIC_MIN_LIMIT, NUMERIC_MAX_LIMIT, constraint.granularity.getNumericGranularity().scale())); ======= return FieldSpec.fromType(field.getType()).withNumericRestrictions(new NumericRestrictions(constraint.granularity.getNumericGranularity().scale())); >>>>>>> return FieldSpec.fromType(field.getType()) .withNumericRestrictions( new NumericRestrictions( NUMERIC_MIN_LIMIT, NUMERIC_MAX_LIMIT, constraint.granularity.getNumericGranularity().scale())); <<<<<<< return FieldSpec.Empty.withDateTimeRestrictions(new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT, constraint.granularity.getGranularity())); ======= return FieldSpec.fromType(field.getType()).withDateTimeRestrictions(new DateTimeRestrictions(constraint.granularity.getGranularity())); >>>>>>> return FieldSpec.fromType(field.getType()).withDateTimeRestrictions(new DateTimeRestrictions(DATETIME_MIN_LIMIT, DATETIME_MAX_LIMIT, constraint.granularity.getGranularity())); <<<<<<< private FieldSpec constructIsAfterConstraint(OffsetDateTime limit, boolean inclusive, boolean negate) { ======= private FieldSpec constructIsAfterConstraint(Field field, OffsetDateTime limit, boolean inclusive, boolean negate) { final DateTimeRestrictions dateTimeRestrictions = new DateTimeRestrictions(); >>>>>>> private FieldSpec constructIsAfterConstraint(Field field, OffsetDateTime limit, boolean inclusive, boolean negate) { <<<<<<< private FieldSpec constructIsBeforeConstraint(OffsetDateTime limit, boolean inclusive, boolean negate) { ======= private FieldSpec constructIsBeforeConstraint(Field field, OffsetDateTime limit, boolean inclusive, boolean negate) { final DateTimeRestrictions dateTimeRestrictions = new DateTimeRestrictions(); >>>>>>> private FieldSpec constructIsBeforeConstraint(Field field, OffsetDateTime limit, boolean inclusive, boolean negate) {
<<<<<<< @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; StringHasLengthConstraint constraint = (StringHasLengthConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } ======= @Override public String toString() { return String.format("`%s` length = %s", field.name, referenceValue); } >>>>>>> @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; StringHasLengthConstraint constraint = (StringHasLengthConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } @Override public String toString() { return String.format("`%s` length = %s", field.name, referenceValue); }
<<<<<<< @Override public String toString(){ return String.format("`%s` matches /%s/", field.name, regex); } ======= @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MatchesRegexConstraint constraint = (MatchesRegexConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(regex.toString(), constraint.regex.toString()); } @Override public int hashCode(){ return Objects.hash(field, regex.toString()); } >>>>>>> @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; MatchesRegexConstraint constraint = (MatchesRegexConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(regex.toString(), constraint.regex.toString()); } @Override public int hashCode(){ return Objects.hash(field, regex.toString()); } @Override public String toString(){ return String.format("`%s` matches /%s/", field.name, regex); }
<<<<<<< import com.scottlogic.deg.generator.Field; import com.scottlogic.deg.generator.Profile; import com.scottlogic.deg.generator.ProfileFields; import com.scottlogic.deg.generator.Rule; ======= import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.scottlogic.deg.generator.Field; import com.scottlogic.deg.generator.Profile; import com.scottlogic.deg.generator.ProfileFields; import com.scottlogic.deg.generator.Rule; >>>>>>> import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.scottlogic.deg.generator.Field; import com.scottlogic.deg.generator.Profile; import com.scottlogic.deg.generator.ProfileFields; import com.scottlogic.deg.generator.Rule; <<<<<<< import com.scottlogic.deg.generator.decisiontree.tree_partitioning.StandardTreePartitioner; ======= import com.scottlogic.deg.generator.decisiontree.tree_partitioning.TreePartitioner; >>>>>>> import com.scottlogic.deg.generator.decisiontree.tree_partitioning.StandardTreePartitioner; <<<<<<< import com.scottlogic.deg.generator.walker.CartesianProductDecisionTreeWalker; ======= import org.junit.Assert; >>>>>>> import com.scottlogic.deg.generator.walker.CartesianProductDecisionTreeWalker; import org.junit.Assert; <<<<<<< static List <List<Object>> getDEGGeneratedData( List<Field> profileFields, List<IConstraint> constraints, GenerationConfig.DataGenerationType generationStrategy, GenerationConfig.TreeWalkerType walkerType) { return getGeneratedDataAsList(profileFields, constraints, generationStrategy, walkerType) ======= static List<List<Object>> getDEGGeneratedData(List<Field> profileFields, List<IConstraint> constraints, GenerationConfig.DataGenerationType generationStrategy) { return getGeneratedDataAsList(profileFields, constraints, generationStrategy) >>>>>>> static List<List<Object>> getDEGGeneratedData( List<Field> profileFields, List<IConstraint> constraints, GenerationConfig.DataGenerationType generationStrategy, GenerationConfig.TreeWalkerType walkerType) { return getGeneratedDataAsList(profileFields, constraints, generationStrategy, walkerType)
<<<<<<< @Override public String toString() { return String.format("`%s` length < %d", field.name, referenceValue); } ======= @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsStringShorterThanConstraint constraint = (IsStringShorterThanConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } >>>>>>> @Override public boolean equals(Object o){ if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; IsStringShorterThanConstraint constraint = (IsStringShorterThanConstraint) o; return Objects.equals(field, constraint.field) && Objects.equals(referenceValue, constraint.referenceValue); } @Override public int hashCode(){ return Objects.hash(field, referenceValue); } @Override public String toString() { return String.format("`%s` length < %d", field.name, referenceValue); }
<<<<<<< import com.scottlogic.deg.profile.reader.*; ======= import com.scottlogic.deg.generator.utils.FileUtils; import com.scottlogic.deg.generator.utils.FileUtilsImpl; import com.scottlogic.deg.profile.reader.JsonProfileReader; import com.scottlogic.deg.profile.reader.ProfileReader; >>>>>>> import com.scottlogic.deg.profile.reader.*; import com.scottlogic.deg.generator.utils.FileUtils; import com.scottlogic.deg.generator.utils.FileUtilsImpl; import com.scottlogic.deg.profile.reader.JsonProfileReader; import com.scottlogic.deg.profile.reader.ProfileReader; <<<<<<< bind(AtomicConstraintReaderLookup.class).to(BaseCatalogAtomicConstraintReaderLookup.class); bind(ConstraintReader.class).to(MainConstraintReader.class); ======= bind(FileUtils.class).to(FileUtilsImpl.class); >>>>>>> bind(AtomicConstraintReaderLookup.class).to(BaseCatalogAtomicConstraintReaderLookup.class); bind(ConstraintReader.class).to(MainConstraintReader.class); bind(FileUtils.class).to(FileUtilsImpl.class);
<<<<<<< ======= Constituent cEquivalentInParseView = parse.getConstituentsCoveringToken(c.getStartSpan()).get(0); >>>>>>>
<<<<<<< import android.app.ProgressDialog; import android.content.Context; ======= >>>>>>> <<<<<<< import android.net.Uri; import android.os.AsyncTask; import android.os.Build; ======= >>>>>>> <<<<<<< import android.util.Xml; import android.view.*; ======= import android.view.ContextMenu; >>>>>>> import android.view.ContextMenu; <<<<<<< ======= import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; >>>>>>> import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; <<<<<<< import yuku.afw.storage.Preferences; import yuku.afw.widget.EasyAdapter; import yuku.alkitab.base.App; import yuku.alkitab.base.IsiActivity; ======= import yuku.alkitab.base.App; >>>>>>> import yuku.alkitab.base.App; <<<<<<< import yuku.alkitab.base.storage.Db; import yuku.alkitab.base.storage.Prefkey; import yuku.alkitab.base.util.BackupManager; import yuku.alkitab.base.util.Sqlitil; import yuku.alkitab.debug.R; import yuku.alkitab.model.Bookmark2; import yuku.alkitab.model.Label; ======= import yuku.alkitab.debug.R; import yuku.alkitab.model.Label; import yuku.alkitab.model.Marker; >>>>>>> import yuku.alkitab.debug.R; import yuku.alkitab.model.Label; import yuku.alkitab.model.Marker;
<<<<<<< import junit.framework.TestCase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; ======= import org.junit.Before; import org.junit.Test; >>>>>>> import org.junit.Before; import org.junit.Test; import junit.framework.TestCase; import org.slf4j.Logger; import org.slf4j.LoggerFactory; <<<<<<< public class TreeGrepTest extends TestCase { private static Logger logger = LoggerFactory.getLogger(TreeGrepTest.class); ======= public class TreeGrepTest { >>>>>>> public class TreeGrepTest { private static Logger logger = LoggerFactory.getLogger(TreeGrepTest.class);
<<<<<<< private static Logger logger = LoggerFactory.getLogger(ACE_NW_Reader.class); ======= /** * TODO: make the compiled patterns static fields. */ >>>>>>> private static Logger logger = LoggerFactory.getLogger(ACE_NW_Reader.class); /** * TODO: make the compiled patterns static fields. */
<<<<<<< import org.slf4j.Logger; import org.slf4j.LoggerFactory; ======= import org.junit.Before; import org.junit.Test; >>>>>>> import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; <<<<<<< public class TreeTest extends TestCase { private static Logger logger = LoggerFactory.getLogger(TreeTest.class); ======= public class TreeTest { >>>>>>> public class TreeTest { private static Logger logger = LoggerFactory.getLogger(TreeTest.class);
<<<<<<< String method = "makeprobs"; ======= String method = "wikidata"; >>>>>>> String method = "wikidata"; <<<<<<< /** This trains a model from a file and writes the productions to file. This is intended primarily as a way to measure WAVE. Use this in tandem with makedata(). */ private static void makeprobs(String trainfile, String trainlang, String testlang) throws IOException{ List<Example> training = Utils.readWikiData(trainfile); SPModel model = new SPModel(training); model.Train(5); model.WriteProbs("probs-" + trainlang + "-" + testlang + ".txt"); } ======= >>>>>>> /** This trains a model from a file and writes the productions to file. This is intended primarily as a way to measure WAVE. Use this in tandem with makedata(). */ private static void makeprobs(String trainfile, String trainlang, String testlang) throws IOException{ List<Example> training = Utils.readWikiData(trainfile); SPModel model = new SPModel(training); model.Train(5); model.WriteProbs("probs-" + trainlang + "-" + testlang + ".txt"); } <<<<<<< listlines.add(0, "# " + langB + "\t" + langA + "\n"); ======= listlines.add(0, "# " + langA + "\t" + langB + "\n"); >>>>>>> listlines.add(0, "# " + langB + "\t" + langA + "\n");
<<<<<<< <<<<<<< HEAD // FIXME: out variables... is exampleCounts actually used anywhere??? //List<List<Pair<Pair<String, String>, Double>>> exampleCounts = new ArrayList<>(); probs = new SparseDoubleVector<>(Program.MakeRawAlignmentTable(maxSubstringLength1, maxSubstringLength2, trainingTriples, null, Program.WeightingMode.None, WikiTransliteration.NormalizationMode.None, false)); ======= // FIXME: is exampleCounts actually used anywhere??? List<List<Pair<Pair<String, String>, Double>>> exampleCounts = new ArrayList<>(); ======= >>>>>>> // FIXME: out variables... is exampleCounts actually used anywhere??? //List<List<Pair<Pair<String, String>, Double>>> exampleCounts = new ArrayList<>(); probs = new SparseDoubleVector<>(Program.MakeRawAlignmentTable(maxSubstringLength1, maxSubstringLength2, trainingTriples, null, Program.WeightingMode.None, WikiTransliteration.NormalizationMode.None, false)); <<<<<<< >>>>>>> dff36e31160cde38cde88529386e8d04be716bc2 ======= // this just normalizes by the source string. >>>>>>> // this just normalizes by the source string.
<<<<<<< import org.slf4j.Logger; import org.slf4j.LoggerFactory; ======= import org.junit.Before; import org.junit.Test; >>>>>>> import org.junit.Before; import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory; <<<<<<< public class TextAnnotationSerializationTest extends TestCase { private static Logger logger = LoggerFactory.getLogger(TextAnnotationSerializationTest.class); ======= import static org.junit.Assert.*; public class TextAnnotationSerializationTest { >>>>>>> import static org.junit.Assert.*; public class TextAnnotationSerializationTest { private static Logger logger = LoggerFactory.getLogger(TextAnnotationSerializationTest.class); <<<<<<< public void setUp() throws Exception { super.setUp(); logger.info(rawText); ======= @Before public void init() throws Exception { System.out.println(rawText); >>>>>>> @Before public void init() throws Exception { System.out.println(rawText);
<<<<<<< ======= import yuku.androidsdk.searchbar.SearchBar; >>>>>>> <<<<<<< ======= View empty; TextView tSearchTips; SearchBar searchBar; >>>>>>> View empty; TextView tSearchTips; <<<<<<< searchView = V.get(Search2Activity.this, R.id.searchView); searchView.setSubmitButtonEnabled(true); searchView.setOnQueryTextListener(new OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query1) { search(query1); return true; } @Override public boolean onQueryTextChange(String newText) { return false; } }); ======= { SpannableStringBuilder sb = new SpannableStringBuilder(tSearchTips.getText()); while (true) { final int pos = TextUtils.indexOf(sb, "[q]"); if (pos < 0) break; sb.replace(pos, pos + 3, "\""); } tSearchTips.setText(sb); } if (usingSearchView()) { api11_compat = new Api11_compat(); api11_compat.configureSearchView(); } else { searchBar = V.get(this, R.id.searchBar); ((ViewGroup) panelFilter.getParent()).removeView(panelFilter); searchBar.setBottomView(panelFilter); searchBar.setOnSearchListener(new SearchBar.OnSearchListener() { @Override public void onSearch(SearchBar searchBar, Editable text) { search(text.toString()); } }); // the background of the search bar is bright, so let's make all text black cFilterOlds.setTextColor(0xff000000); cFilterNews.setTextColor(0xff000000); cFilterSingleBook.setTextColor(0xff000000); tFilterAdvanced.setTextColor(0xff000000); } empty.setBackgroundColor(S.applied.backgroundColor); >>>>>>> searchView = V.get(Search2Activity.this, R.id.searchView); searchView.setSubmitButtonEnabled(true); searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() { @Override public boolean onQueryTextSubmit(String query1) { search(query1); return true; } @Override public boolean onQueryTextChange(String newText) { return false; } }); { SpannableStringBuilder sb = new SpannableStringBuilder(tSearchTips.getText()); while (true) { final int pos = TextUtils.indexOf(sb, "[q]"); if (pos < 0) break; sb.replace(pos, pos + 3, "\""); } tSearchTips.setText(sb); } empty.setBackgroundColor(S.applied.backgroundColor); <<<<<<< ======= lsSearchResults.setEmptyView(empty); Appearances.applyTextAppearance(tSearchTips); >>>>>>> lsSearchResults.setEmptyView(empty); Appearances.applyTextAppearance(tSearchTips); <<<<<<< bEditFilter.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { ======= bEditFilter.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { >>>>>>> bEditFilter.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { <<<<<<< protected Query getQuery() { Query res = new Query(); res.query_string = searchView.getQuery().toString(); ======= protected Search2Engine.Query getQuery() { Search2Engine.Query res = new Search2Engine.Query(); if (!usingSearchView()) { res.query_string = searchBar.getText().toString(); } else { res.query_string = api11_compat.getSearchViewQuery(); } >>>>>>> protected Search2Engine.Query getQuery() { Search2Engine.Query res = new Search2Engine.Query(); res.query_string = searchView.getQuery().toString(); <<<<<<< inputManager.hideSoftInputFromWindow(searchView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); searchView.clearFocus(); lsSearchResults.requestFocus(); ======= if (!usingSearchView()) { inputManager.hideSoftInputFromWindow(searchBar.getSearchField().getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); } else { api11_compat.hideSoftInputFromSearchView(inputManager); lsSearchResults.requestFocus(); } } else { final Jumper jumper = new Jumper(query); CharSequence noresult = getText(R.string.search_no_result); noresult = TextUtils.expandTemplate(noresult, query); final int fallbackAri = shouldShowFallback(jumper); if (fallbackAri != 0) { final SpannableStringBuilder sb = new SpannableStringBuilder(); sb.append(noresult); sb.append("\n\n"); CharSequence fallback = getText(R.string.search_no_result_fallback); fallback = TextUtils.expandTemplate(fallback, S.activeVersion.reference(fallbackAri)); sb.append(fallback); tSearchTips.setText(sb); tSearchTips.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { if (Ari.toVerse(fallbackAri) == 0) { startActivity(Launcher.openAppAtBibleLocation(fallbackAri)); } else { startActivity(Launcher.openAppAtBibleLocationWithVerseSelected(fallbackAri)); } } }); } else { tSearchTips.setText(noresult); tSearchTips.setClickable(false); tSearchTips.setOnClickListener(null); } >>>>>>> inputManager.hideSoftInputFromWindow(searchView.getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); searchView.clearFocus(); lsSearchResults.requestFocus(); } else { final Jumper jumper = new Jumper(query); CharSequence noresult = getText(R.string.search_no_result); noresult = TextUtils.expandTemplate(noresult, query); final int fallbackAri = shouldShowFallback(jumper); if (fallbackAri != 0) { final SpannableStringBuilder sb = new SpannableStringBuilder(); sb.append(noresult); sb.append("\n\n"); CharSequence fallback = getText(R.string.search_no_result_fallback); fallback = TextUtils.expandTemplate(fallback, S.activeVersion.reference(fallbackAri)); sb.append(fallback); tSearchTips.setText(sb); tSearchTips.setOnClickListener(new View.OnClickListener() { @Override public void onClick(final View v) { if (Ari.toVerse(fallbackAri) == 0) { startActivity(Launcher.openAppAtBibleLocation(fallbackAri)); } else { startActivity(Launcher.openAppAtBibleLocationWithVerseSelected(fallbackAri)); } } }); } else { tSearchTips.setText(noresult); tSearchTips.setClickable(false); tSearchTips.setOnClickListener(null); } <<<<<<< } ======= } /** * @return ari not 0 if fallback is to be shown */ int shouldShowFallback(final Jumper jumper) { if (!jumper.getParseSucceeded()) { return 0; } final int chapter_1 = jumper.getChapter(); if (chapter_1 == 0) return 0; final Version version = S.activeVersion; final int bookId = jumper.getBookId(version.getConsecutiveBooks()); if (bookId == -1) return 0; final Book book = version.getBook(bookId); if (book == null) return 0; if (chapter_1 > book.chapter_count) return 0; final int verse_1 = jumper.getVerse(); if (verse_1 != 0 && verse_1 > book.verse_counts[chapter_1 - 1]) return 0; return Ari.encode(bookId, chapter_1, verse_1); } >>>>>>> } /** * @return ari not 0 if fallback is to be shown */ int shouldShowFallback(final Jumper jumper) { if (!jumper.getParseSucceeded()) { return 0; } final int chapter_1 = jumper.getChapter(); if (chapter_1 == 0) return 0; final Version version = S.activeVersion; final int bookId = jumper.getBookId(version.getConsecutiveBooks()); if (bookId == -1) return 0; final Book book = version.getBook(bookId); if (book == null) return 0; if (chapter_1 > book.chapter_count) return 0; final int verse_1 = jumper.getVerse(); if (verse_1 != 0 && verse_1 > book.verse_counts[chapter_1 - 1]) return 0; return Ari.encode(bookId, chapter_1, verse_1); }
<<<<<<< // load up the models ModelLoader.load(rm, rm.getString("modelName"), false); if (args[0].equalsIgnoreCase("-annotate")) { NETagPlain.init(); NETagPlain.tagData(args[1], args[2]); } if (args[0].equalsIgnoreCase("-demo")) { String input = ""; while (!input.equalsIgnoreCase("quit")) { input = Keyboard.readLine(); if (input.equalsIgnoreCase("quit")) System.exit(0); String res = NETagPlain.tagLine(input, (NETaggerLevel1) ParametersForLbjCode.currentParameters.taggerLevel1, (NETaggerLevel2) ParametersForLbjCode.currentParameters.taggerLevel2); res = NETagPlain.insertHtmlColors(res); StringTokenizer st = new StringTokenizer(res); StringBuilder output = new StringBuilder(); while (st.hasMoreTokens()) { String s = st.nextToken(); output.append(" ").append(s); } logger.info(output.toString()); } } if (args[0].equalsIgnoreCase("-test")) NETesterMultiDataset.test(args[1], false, cp.labelsToIgnoreInEvaluation, cp.labelsToAnonymizeInEvaluation); if (args[0].equalsIgnoreCase("-dumpFeatures")) NETesterMultiDataset.dumpFeaturesLabeledData(args[1], args[2]); ======= >>>>>>> <<<<<<< LearningCurveMultiDataset.getLearningCurve(-1, args[1], args[2], false); if (args[0].equalsIgnoreCase("-trainFixedIterations")) ======= LearningCurveMultiDataset.getLearningCurve(-1, args[1], args[2]); else if (args[0].equalsIgnoreCase("-trainFixedIterations")) >>>>>>> LearningCurveMultiDataset.getLearningCurve(-1, args[1], args[2], false); else if (args[0].equalsIgnoreCase("-trainFixedIterations")) <<<<<<< args[3], false); ======= args[3]); else { // load up the models ModelLoader.load(rm, rm.getString("modelName")); if (args[0].equalsIgnoreCase("-annotate")) { NETagPlain.init(); NETagPlain.tagData(args[1], args[2]); } if (args[0].equalsIgnoreCase("-demo")) { String input = ""; while (!input.equalsIgnoreCase("quit")) { input = Keyboard.readLine(); if (input.equalsIgnoreCase("quit")) System.exit(0); String res = NETagPlain.tagLine(input, (NETaggerLevel1) ParametersForLbjCode.currentParameters.taggerLevel1, (NETaggerLevel2) ParametersForLbjCode.currentParameters.taggerLevel2); res = NETagPlain.insertHtmlColors(res); StringTokenizer st = new StringTokenizer(res); StringBuilder output = new StringBuilder(); while (st.hasMoreTokens()) { String s = st.nextToken(); output.append(" ").append(s); } logger.info(output.toString()); } } if (args[0].equalsIgnoreCase("-test")) NETesterMultiDataset.test(args[1], false, cp.labelsToIgnoreInEvaluation, cp.labelsToAnonymizeInEvaluation); if (args[0].equalsIgnoreCase("-dumpFeatures")) NETesterMultiDataset.dumpFeaturesLabeledData(args[1], args[2]); } >>>>>>> args[3], false); else { // load up the models ModelLoader.load(rm, rm.getString("modelName"), true); if (args[0].equalsIgnoreCase("-annotate")) { NETagPlain.init(); NETagPlain.tagData(args[1], args[2]); } if (args[0].equalsIgnoreCase("-demo")) { String input = ""; while (!input.equalsIgnoreCase("quit")) { input = Keyboard.readLine(); if (input.equalsIgnoreCase("quit")) System.exit(0); String res = NETagPlain.tagLine(input, (NETaggerLevel1) ParametersForLbjCode.currentParameters.taggerLevel1, (NETaggerLevel2) ParametersForLbjCode.currentParameters.taggerLevel2); res = NETagPlain.insertHtmlColors(res); StringTokenizer st = new StringTokenizer(res); StringBuilder output = new StringBuilder(); while (st.hasMoreTokens()) { String s = st.nextToken(); output.append(" ").append(s); } logger.info(output.toString()); } } if (args[0].equalsIgnoreCase("-test")) NETesterMultiDataset.test(args[1], false, cp.labelsToIgnoreInEvaluation, cp.labelsToAnonymizeInEvaluation); if (args[0].equalsIgnoreCase("-dumpFeatures")) NETesterMultiDataset.dumpFeaturesLabeledData(args[1], args[2]); }
<<<<<<< public static final String TIMEX3 = "TIMEX3"; ======= public static final String NER_ERE = "NER_ERE"; public static final String MENTION_ERE = "MENTION_ERE"; public static final String COREF_ERE = "COREF_ERE"; >>>>>>> public static final String NER_ERE = "NER_ERE"; public static final String MENTION_ERE = "MENTION_ERE"; public static final String COREF_ERE = "COREF_ERE"; public static final String TIMEX3 = "TIMEX3";
<<<<<<< import org.slf4j.Logger; import org.slf4j.LoggerFactory; ======= import org.junit.Test; >>>>>>> import org.junit.Test; import org.slf4j.Logger; import org.slf4j.LoggerFactory;
<<<<<<< log.debug("Loading {} from classpath", resourceFile); // List<URL> list = IOUtils.lsResources(ResourceUtilities.class, resourceFile); // if (list.isEmpty()) { // System.err.println("Could not load " + resourceFile); // System.exit(-1); // } // URL fileURL = list.get(0); // URLConnection connection = fileURL.openConnection(); // stream = connection.getInputStream(); stream = ResourceUtilities.class.getResourceAsStream("/"+resourceFile); ======= logger.debug("Loading {} from classpath", resourceFile); List<URL> list = IOUtils.lsResources(ResourceUtilities.class, resourceFile); if (list.isEmpty()) { logger.error("Could not load " + resourceFile); System.exit(-1); } URL fileURL = list.get(0); URLConnection connection = fileURL.openConnection(); stream = connection.getInputStream(); >>>>>>> logger.debug("Loading {} from classpath", resourceFile); stream = ResourceUtilities.class.getResourceAsStream("/"+resourceFile);
<<<<<<< short replFactor = 1; MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); ======= MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); >>>>>>> short replFactor = 1; MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(2).build(); <<<<<<< String block = DFSTestUtil.getFirstBlock(fs, file1).getBlockName(); int blockFilesCorrupted = cluster.corruptBlockOnDataNodes(block); assertEquals("Corrupted too few blocks", replFactor, blockFilesCorrupted); ======= ExtendedBlock block = DFSTestUtil.getFirstBlock(fs, file1); cluster.corruptBlockOnDataNodes(block); >>>>>>> ExtendedBlock block = DFSTestUtil.getFirstBlock(fs, file1); int blockFilesCorrupted = cluster.corruptBlockOnDataNodes(block); assertEquals("Corrupted too few blocks", replFactor, blockFilesCorrupted);
<<<<<<< ======= import org.apache.hadoop.hdfs.protocol.ExtendedBlock; import org.apache.hadoop.hdfs.protocol.LocatedBlocks; >>>>>>> import org.apache.hadoop.hdfs.protocol.ExtendedBlock; <<<<<<< cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(1) .format(false).build(); ======= cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(1) .format(false).build(); >>>>>>> cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(1) .format(false).build(); <<<<<<< public void testBlockCorruptionPolicy() throws Exception { ======= public static boolean corruptReplica(ExtendedBlock blk, int replica) throws IOException { return MiniDFSCluster.corruptBlockOnDataNode(replica, blk); } public void testBlockCorruptionPolicy() throws IOException { >>>>>>> public static boolean corruptReplica(ExtendedBlock blk, int replica) throws IOException { return MiniDFSCluster.corruptReplica(replica, blk); } public void testBlockCorruptionPolicy() throws IOException { <<<<<<< conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 30L); conf.setLong(DFSConfigKeys.DFS_NAMENODE_REPLICATION_INTERVAL_KEY, 3); conf.setLong(DFSConfigKeys.DFS_HEARTBEAT_INTERVAL_KEY, 3L); ======= conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 30L); conf.setLong(DFSConfigKeys.DFS_NAMENODE_REPLICATION_INTERVAL_KEY, 30); conf.setLong(DFSConfigKeys.DFS_HEARTBEAT_INTERVAL_KEY, 30L); >>>>>>> conf.setLong(DFSConfigKeys.DFS_BLOCKREPORT_INTERVAL_MSEC_KEY, 30L); conf.setLong(DFSConfigKeys.DFS_NAMENODE_REPLICATION_INTERVAL_KEY, 3); conf.setLong(DFSConfigKeys.DFS_HEARTBEAT_INTERVAL_KEY, 3L); <<<<<<< Block blk = DFSTestUtil.getFirstBlock(fs, file1); String block = blk.getBlockName(); ======= ExtendedBlock blk = DFSTestUtil.getFirstBlock(fs, file1); dfsClient = new DFSClient(new InetSocketAddress("localhost", cluster.getNameNodePort()), conf); blocks = dfsClient.getNamenode(). getBlockLocations(file1.toString(), 0, Long.MAX_VALUE); replicaCount = blocks.get(0).getLocations().length; >>>>>>> ExtendedBlock block = DFSTestUtil.getFirstBlock(fs, file1); <<<<<<< if (cluster.corruptReplica(block, i)) { ======= if (corruptReplica(blk, i)) >>>>>>> if (corruptReplica(block, i)) { <<<<<<< DFSTestUtil.waitCorruptReplicas(fs, cluster.getNamesystem(), file1, blk, numCorruptReplicas); ======= int corruptReplicaSize = cluster.getNamesystem(). numCorruptReplicas(blk.getLocalBlock()); while (corruptReplicaSize != numCorruptReplicas) { try { IOUtils.copyBytes(fs.open(file1), new IOUtils.NullOutputStream(), conf, true); } catch (IOException e) { } try { LOG.info("Looping until expected " + numCorruptReplicas + " are " + "reported. Current reported " + corruptReplicaSize); Thread.sleep(1000); } catch (InterruptedException ignore) { } corruptReplicaSize = cluster.getNamesystem(). numCorruptReplicas(blk.getLocalBlock()); } >>>>>>> DFSTestUtil.waitCorruptReplicas(fs, cluster.getNamesystem(), file1, block, numCorruptReplicas); <<<<<<< DFSTestUtil.waitCorruptReplicas(fs, cluster.getNamesystem(), file1, blk, 0); ======= corruptReplicaSize = cluster.getNamesystem(). numCorruptReplicas(blk.getLocalBlock()); while (corruptReplicaSize != 0 || replicaCount != numReplicas) { try { LOG.info("Looping until corrupt replica is invalidated"); Thread.sleep(1000); } catch (InterruptedException ignore) { } corruptReplicaSize = cluster.getNamesystem(). numCorruptReplicas(blk.getLocalBlock()); blocks = dfsClient.getNamenode(). getBlockLocations(file1.toString(), 0, Long.MAX_VALUE); replicaCount = blocks.get(0).getLocations().length; } // Make sure block is healthy assertTrue(corruptReplicaSize == 0); assertTrue(replicaCount == numReplicas); assertTrue(blocks.get(0).isCorrupt() == false); >>>>>>> DFSTestUtil.waitCorruptReplicas(fs, cluster.getNamesystem(), file1, block, 0); <<<<<<< // Restart the cluster, add a node, and check that the truncated block is // handled correctly cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(REPLICATION_FACTOR) .format(false) .build(); cluster.startDataNodes(conf, 1, true, null, null); cluster.waitActive(); // now we have 3 datanodes ======= // restart the cluster cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(REPLICATION_FACTOR) .format(false) .build(); cluster.startDataNodes(conf, 1, true, null, null); cluster.waitActive(); // now we have 3 datanodes >>>>>>> // Restart the cluster, add a node, and check that the truncated block is // handled correctly cluster = new MiniDFSCluster.Builder(conf) .numDataNodes(REPLICATION_FACTOR) .format(false) .build(); cluster.startDataNodes(conf, 1, true, null, null); cluster.waitActive(); // now we have 3 datanodes <<<<<<< static boolean changeReplicaLength(String blockName, int dnIndex, int lenDelta) throws IOException { File baseDir = new File(MiniDFSCluster.getBaseDirectory(), "data"); for (int i=dnIndex*2; i<dnIndex*2+2; i++) { File blockFile = new File(baseDir, "data" + (i+1) + MiniDFSCluster.FINALIZED_DIR_NAME + blockName); if (blockFile.exists()) { RandomAccessFile raFile = new RandomAccessFile(blockFile, "rw"); long origLen = raFile.length(); raFile.setLength(origLen + lenDelta); raFile.close(); LOG.info("assigned length " + (origLen + lenDelta) + " to block file " + blockFile.getPath() + " on datanode " + dnIndex); return true; } ======= static boolean changeReplicaLength(ExtendedBlock blk, int dnIndex, int lenDelta) throws IOException { File blockFile = MiniDFSCluster.getBlockFile(dnIndex, blk); if (blockFile != null && blockFile.exists()) { RandomAccessFile raFile = new RandomAccessFile(blockFile, "rw"); raFile.setLength(raFile.length()+lenDelta); raFile.close(); return true; >>>>>>> static boolean changeReplicaLength(ExtendedBlock blk, int dnIndex, int lenDelta) throws IOException { File blockFile = MiniDFSCluster.getBlockFile(dnIndex, blk); if (blockFile != null && blockFile.exists()) { RandomAccessFile raFile = new RandomAccessFile(blockFile, "rw"); raFile.setLength(raFile.length()+lenDelta); raFile.close(); return true; <<<<<<< private static void waitForBlockDeleted(String blockName, int dnIndex, long timeout) throws IOException, TimeoutException, InterruptedException { File baseDir = new File(MiniDFSCluster.getBaseDirectory(), "data"); File blockFile1 = new File(baseDir, "data" + (2*dnIndex+1) + MiniDFSCluster.FINALIZED_DIR_NAME + blockName); File blockFile2 = new File(baseDir, "data" + (2*dnIndex+2) + MiniDFSCluster.FINALIZED_DIR_NAME + blockName); long failtime = System.currentTimeMillis() + ((timeout > 0) ? timeout : Long.MAX_VALUE); while (blockFile1.exists() || blockFile2.exists()) { if (failtime < System.currentTimeMillis()) { throw new TimeoutException("waited too long for blocks to be deleted: " + blockFile1.getPath() + (blockFile1.exists() ? " still exists; " : " is absent; ") + blockFile2.getPath() + (blockFile2.exists() ? " still exists." : " is absent.")); } ======= private static void waitForBlockDeleted(ExtendedBlock blk, int dnIndex) throws IOException, InterruptedException { File blockFile = MiniDFSCluster.getBlockFile(dnIndex, blk); while (blockFile != null) { >>>>>>> private static void waitForBlockDeleted(ExtendedBlock blk, int dnIndex, long timeout) throws IOException, TimeoutException, InterruptedException { File blockFile = MiniDFSCluster.getBlockFile(dnIndex, blk); long failtime = System.currentTimeMillis() + ((timeout > 0) ? timeout : Long.MAX_VALUE); while (blockFile != null && blockFile.exists()) { if (failtime < System.currentTimeMillis()) { throw new TimeoutException("waited too long for blocks to be deleted: " + blockFile.getPath() + (blockFile.exists() ? " still exists; " : " is absent; ")); }
<<<<<<< ======= if(isBlockTokenEnabled && needBlockToken) { setBlockTokens(locatedblocks); } >>>>>>> if(isBlockTokenEnabled && needBlockToken) { setBlockTokens(locatedblocks); } <<<<<<< // // Create a LocatedBlock object for the last block of the file // to be returned to the client. Return null if the file does not // have a partial block at the end. // LocatedBlock lb = null; synchronized (this) { INodeFileUnderConstruction file = (INodeFileUnderConstruction)dir.getFileINode(src); BlockInfo lastBlock = file.getLastBlock(); if (lastBlock != null) { assert lastBlock == blockManager.getStoredBlock(lastBlock) : "last block of the file is not in blocksMap"; if (file.getPreferredBlockSize() > lastBlock.getNumBytes()) { long fileLength = file.computeContentSummary().getLength(); DatanodeDescriptor[] targets = blockManager.getNodes(lastBlock); // remove the replica locations of this block from the node for (int i = 0; i < targets.length; i++) { targets[i].removeBlock(lastBlock); } // convert last block to under-construction and set its locations blockManager.convertLastBlockToUnderConstruction(file, targets); lb = new LocatedBlock(getExtendedBlock(lastBlock), targets, fileLength-lastBlock.getNumBytes()); if (isBlockTokenEnabled) { lb.setBlockToken(blockTokenSecretManager.generateToken(lb.getBlock(), EnumSet.of(BlockTokenSecretManager.AccessMode.WRITE))); } // Remove block from replication queue. blockManager.updateNeededReplications(lastBlock, 0, 0); // remove this block from the list of pending blocks to be deleted. // This reduces the possibility of triggering HADOOP-1349. // for (DatanodeDescriptor dd : targets) { String datanodeId = dd.getStorageID(); blockManager.removeFromInvalidates(datanodeId, lastBlock); } } } } ======= >>>>>>> <<<<<<< public synchronized boolean abandonBlock(ExtendedBlock b, String src, String holder) ======= public boolean abandonBlock(Block b, String src, String holder) >>>>>>> public boolean abandonBlock(ExtendedBlock b, String src, String holder) <<<<<<< checkBlock(b); ======= writeLock(); try { >>>>>>> writeLock(); try { <<<<<<< synchronized void commitBlockSynchronization(ExtendedBlock lastblock, ======= void commitBlockSynchronization(Block lastblock, >>>>>>> void commitBlockSynchronization(ExtendedBlock lastblock, <<<<<<< public synchronized void processReport(DatanodeID nodeID, String poolId, BlockListAsLongs newReport) throws IOException { checkPoolId(poolId); ======= public void processReport(DatanodeID nodeID, BlockListAsLongs newReport ) throws IOException { writeLock(); try { >>>>>>> public void processReport(DatanodeID nodeID, String poolId, BlockListAsLongs newReport) throws IOException { writeLock(); try { <<<<<<< public synchronized void blockReceived(DatanodeID nodeID, String poolId, ======= public void blockReceived(DatanodeID nodeID, >>>>>>> public void blockReceived(DatanodeID nodeID, String poolId, <<<<<<< checkPoolId(poolId); ======= writeLock(); try { >>>>>>> writeLock(); try {
<<<<<<< /** Layout versions of 0.20.203 release */ public static final int[] LAYOUT_VERSIONS_203 = {-19, -31}; ======= // last layout version that is before federation public static final int LAST_PRE_FEDERATION_LAYOUT_VERSION = -30; >>>>>>> // last layout version that is before federation public static final int LAST_PRE_FEDERATION_LAYOUT_VERSION = -30; /** Layout versions of 0.20.203 release */ public static final int[] LAYOUT_VERSIONS_203 = {-19, -31}; <<<<<<< public static final String STORAGE_DIR_CURRENT = "current"; private static final String STORAGE_DIR_PREVIOUS = "previous"; private static final String STORAGE_TMP_REMOVED = "removed.tmp"; private static final String STORAGE_TMP_PREVIOUS = "previous.tmp"; private static final String STORAGE_TMP_FINALIZED = "finalized.tmp"; private static final String STORAGE_TMP_LAST_CKPT = "lastcheckpoint.tmp"; private static final String STORAGE_PREVIOUS_CKPT = "previous.checkpoint"; ======= public static final String STORAGE_DIR_CURRENT = "current"; public static final String STORAGE_DIR_PREVIOUS = "previous"; public static final String STORAGE_TMP_REMOVED = "removed.tmp"; public static final String STORAGE_TMP_PREVIOUS = "previous.tmp"; public static final String STORAGE_TMP_FINALIZED = "finalized.tmp"; public static final String STORAGE_TMP_LAST_CKPT = "lastcheckpoint.tmp"; public static final String STORAGE_PREVIOUS_CKPT = "previous.checkpoint"; >>>>>>> public static final String STORAGE_DIR_CURRENT = "current"; public static final String STORAGE_DIR_PREVIOUS = "previous"; public static final String STORAGE_TMP_REMOVED = "removed.tmp"; public static final String STORAGE_TMP_PREVIOUS = "previous.tmp"; public static final String STORAGE_TMP_FINALIZED = "finalized.tmp"; public static final String STORAGE_TMP_LAST_CKPT = "lastcheckpoint.tmp"; public static final String STORAGE_PREVIOUS_CKPT = "previous.checkpoint";
<<<<<<< import VASSAL.build.module.GameState; import VASSAL.build.module.properties.PropertySource; import VASSAL.command.ChangePiece; import VASSAL.search.AbstractImageFinder; import VASSAL.search.ImageSearchTarget; import VASSAL.tools.NamedKeyStroke; import VASSAL.search.SearchTarget; import VASSAL.tools.ProblemDialog; ======= import VASSAL.i18n.Resources; >>>>>>> import VASSAL.build.module.GameState; import VASSAL.build.module.properties.PropertySource; import VASSAL.command.ChangePiece; import VASSAL.search.AbstractImageFinder; import VASSAL.search.ImageSearchTarget; import VASSAL.tools.NamedKeyStroke; import VASSAL.search.SearchTarget; import VASSAL.tools.ProblemDialog; import VASSAL.i18n.Resources; <<<<<<< /** * {@link ImageSearchTarget} * Adds all images used by this component AND any children to the collection * @param s Collection to add image names to */ public void addImageNamesRecursively(Collection<String> s) { addLocalImageNames(s); if (piece instanceof ImageSearchTarget) { ((ImageSearchTarget)piece).addImageNamesRecursively(s); } } ======= /** * Test if this Decorator's Class, Type and State are equal to another trait. * * Implementations of this method should compare the individual values of the fields that * make up the Decorators Type and State. Implementations should NOT compare the values * returned by myGetType() or myGetState(). * * This method is intended to be used by Unit Tests to verify that a trait * is unchanged after going through a process such as serialization/deserialization. * * @param o Object to compare this Decorator to * @return true if the Class, type and state all match */ public boolean testEquals(Object o) { return this.equals(o); } /** * Build a description of a trait of the form * Type - Description * Where Type is the translated trait type description and Description * is a supplied additional description * * @param i18nKey Translation key for trait type description * @param description Optional additional description * @return Combined description */ protected String buildDescription(String i18nKey, String description) { return buildDescription(i18nKey) + ((description == null || description.isEmpty()) ? "" : (" - " + description)); } protected String buildDescription(String i18nKey) { return Resources.getString(i18nKey); } >>>>>>> /** * {@link ImageSearchTarget} * Adds all images used by this component AND any children to the collection * @param s Collection to add image names to */ public void addImageNamesRecursively(Collection<String> s) { addLocalImageNames(s); if (piece instanceof ImageSearchTarget) { ((ImageSearchTarget)piece).addImageNamesRecursively(s); } /** * Test if this Decorator's Class, Type and State are equal to another trait. * * Implementations of this method should compare the individual values of the fields that * make up the Decorators Type and State. Implementations should NOT compare the values * returned by myGetType() or myGetState(). * * This method is intended to be used by Unit Tests to verify that a trait * is unchanged after going through a process such as serialization/deserialization. * * @param o Object to compare this Decorator to * @return true if the Class, type and state all match */ public boolean testEquals(Object o) { return this.equals(o); } /** * Build a description of a trait of the form * Type - Description * Where Type is the translated trait type description and Description * is a supplied additional description * * @param i18nKey Translation key for trait type description * @param description Optional additional description * @return Combined description */ protected String buildDescription(String i18nKey, String description) { return buildDescription(i18nKey) + ((description == null || description.isEmpty()) ? "" : (" - " + description)); } protected String buildDescription(String i18nKey) { return Resources.getString(i18nKey); }
<<<<<<< if (activateKey.length() > 0) { data.add(activateCommand, prefix + Resources.getString("Editor.Embellishment.activate_command")); ======= if (canBeActivated()) { data.add(activateCommand, prefix + "Activate command"); >>>>>>> if (canBeActivated()) { data.add(activateCommand, prefix + Resources.getString("Editor.Embellishment.activate_command"));
<<<<<<< ======= private void resetReadingPlan() { new AlertDialogWrapper.Builder(this) .setMessage(R.string.rp_reset) .setPositiveButton(R.string.ok, (dialog, which) -> { int firstUnreadDay = findFirstUnreadDay(); Calendar calendar = GregorianCalendar.getInstance(); calendar.add(Calendar.DATE, -firstUnreadDay); S.getDb().updateReadingPlanStartDate(readingPlan.info.id, calendar.getTime().getTime()); loadReadingPlan(readingPlan.info.id); loadDayNumber(); readingPlanAdapter.load(); readingPlanAdapter.notifyDataSetChanged(); updateButtonStatus(); }) .setNegativeButton(R.string.cancel, null) .show(); } >>>>>>>
<<<<<<< import VASSAL.search.HTMLImageFinder; ======= import net.miginfocom.swing.MigLayout; >>>>>>> import VASSAL.search.HTMLImageFinder; import net.miginfocom.swing.MigLayout;
<<<<<<< fc.setFileFilter(new ExtensionFileFilter(Resources.getString("Editor.TranslateVassalWindow.property_files"), new String[]{".properties"})); //NON-NLS fc.setCurrentDirectory(Info.getHomeDir()); ======= fc.setFileFilter(new ExtensionFileFilter("Property Files", new String[]{".properties"})); fc.setCurrentDirectory(Info.getConfDir()); >>>>>>> fc.setFileFilter(new ExtensionFileFilter(Resources.getString("Editor.TranslateVassalWindow.property_files"), new String[]{".properties"})); //NON-NLS fc.setCurrentDirectory(Info.getConfDir());
<<<<<<< System.err.println("VASSAL: " + e.getMessage()); //NON-NLS ======= System.err.println("VASSAL: " + e.getMessage()); e.printStackTrace(); >>>>>>> System.err.println("VASSAL: " + e.getMessage()); //NON-NLS e.printStackTrace(); <<<<<<< System.err.println("VASSAL: " + e.getMessage()); //NON-NLS ======= System.err.println("VASSAL: " + e.getMessage()); e.printStackTrace(); >>>>>>> System.err.println("VASSAL: " + e.getMessage()); //NON-NLS e.printStackTrace(); <<<<<<< logger.error("Unable to open socket for loopback device", e); //NON-NLS ======= logger.error("VASSAL: Unable to open socket for loopback device", e); >>>>>>> logger.error("VASSAL: Unable to open socket for loopback device", e); //NON-NLS
<<<<<<< ======= private static final Color CLEAR = new Color(0, 0, 0, 0); public Board() { } >>>>>>> private static final Color CLEAR = new Color(0, 0, 0, 0);
<<<<<<< // AYAT. bukan judul perikop. int verse_1 = id + 1; ======= // VERSE. not pericope >>>>>>> // VERSE. not pericope int verse_1 = id + 1; <<<<<<< int ari = Ari.encode(book_.bookId, chapter_1_, verse_1); String text = verses_.getVerse(id); String verseNumberText = verses_.getVerseNumberText(id); boolean dontPutSpacingBefore = (position > 0 && itemPointer_[position - 1] < 0) || position == 0; VerseRenderer.render(lText, lVerseNumber, ari, text, verseNumberText, highlightColor, checked, dontPutSpacingBefore, withXref, xrefListener_, owner_); ======= // This has been determined that this is a verse not a pericope, now it's time to determine // whether this verse uses formatting if (text.length() > 0 && text.charAt(0) == '@') { // second char must be '@', if not it's wrong if (text.charAt(1) != '@') { throw new RuntimeException("Second char is not '@'. Verse text: " + text); //$NON-NLS-1$ } boolean dontPutSpacingBefore = (position > 0 && itemPointer_[position - 1] < 0) || position == 0; tiledVerseDisplay(lText, lVerseNumber, id + 1, text, highlightColor, checked, dontPutSpacingBefore); } else { simpleVerseDisplay(lText, lVerseNumber, id + 1, text, highlightColor, checked); } >>>>>>> int ari = Ari.encode(book_.bookId, chapter_1_, verse_1); String text = verses_.getVerse(id); String verseNumberText = verses_.getVerseNumberText(id); boolean dontPutSpacingBefore = (position > 0 && itemPointer_[position - 1] < 0) || position == 0; VerseRenderer.render(lText, lVerseNumber, ari, text, verseNumberText, highlightColor, checked, dontPutSpacingBefore, withXref, xrefListener_, owner_); <<<<<<< ======= /** * @param dontPutSpacingBefore this verse is right after a pericope title or on the 0th position */ private static void tiledVerseDisplay(TextView lText, TextView lVerseNumber, int verse_1, String text, int highlightColor, boolean checked, boolean dontPutSpacingBefore) { // @@ = start a verse containing paragraphs or formatting // @0 = start with indent 0 [paragraph] // @1 = start with indent 1 [paragraph] // @2 = start with indent 2 [paragraph] // @3 = start with indent 3 [paragraph] // @4 = start with indent 4 [paragraph] // @6 = start of red text [formatting] // @5 = end of red text [formatting] // @9 = start of italic [formatting] // @7 = end of italic [formatting] // @8 = put a blank line to the next verse [formatting] // @^ = start-of-paragraph marker // optimization, to prevent repeated calls to charAt() char[] text_c = text.toCharArray(); /** * '0'..'4', '^' indent 0..4 or new para * -1 undefined */ int paraType = -1; /** * position of start of paragraph */ int startPara = 0; /** * position of start red marker */ int startRed = -1; /** * position of start italic marker */ int startItalic = -1; SpannableStringBuilder s = new SpannableStringBuilder(); // this has two uses // - to check whether a verse number has been written // - to check whether we need to put a new line when encountering a new para int startPosAfterVerseNumber = 0; String verseNumber_s = Integer.toString(verse_1); int pos = 2; // we start after "@@" // write verse number inline only when no @[1234^] on the beginning of text if (text_c.length >= 4 && text_c[pos] == '@' && (text_c[pos+1] == '^' || (text_c[pos+1] >= '1' && text_c[pos+1] <= '4'))) { // don't write verse number now } else { s.append(verseNumber_s); s.setSpan(new VerseNumberSpan(!checked), 0, s.length(), 0); s.append(" "); startPosAfterVerseNumber = s.length(); } // initialize lVerseNumber to have no padding first lVerseNumber.setPadding(0, 0, 0, 0); while (true) { if (pos >= text_c.length) { break; } int nextAt = text.indexOf('@', pos); if (nextAt == -1) { // no more, just append till the end of everything and exit s.append(text, pos, text.length()); break; } // insert all text until the nextAt if (nextAt != pos) /* optimization */ { s.append(text, pos, nextAt); pos = nextAt; } pos++; // just in case if (pos >= text_c.length) { break; } char marker = text_c[pos]; switch (marker) { case '0': case '1': case '2': case '3': case '4': case '^': // apply previous applyParaStyle(s, paraType, startPara, verse_1, startPosAfterVerseNumber > 0, dontPutSpacingBefore && startPara <= startPosAfterVerseNumber, startPara <= startPosAfterVerseNumber, lVerseNumber); if (s.length() > startPosAfterVerseNumber) { s.append("\n"); } // store current paraType = marker; startPara = s.length(); break; case '6': startRed = s.length(); break; case '9': startItalic = s.length(); break; case '5': if (startRed != -1) { if (!checked) { s.setSpan(new ForegroundColorSpan(S.applied.fontRedColor), startRed, s.length(), 0); } startRed = -1; } break; case '7': if (startItalic != -1) { s.setSpan(new StyleSpan(Typeface.ITALIC), startItalic, s.length(), 0); startItalic = -1; } break; case '8': s.append("\n"); break; } pos++; } // apply unapplied applyParaStyle(s, paraType, startPara, verse_1, startPosAfterVerseNumber > 0, dontPutSpacingBefore && startPara <= startPosAfterVerseNumber, startPara <= startPosAfterVerseNumber, lVerseNumber); if (highlightColor != 0) { s.setSpan(new BackgroundColorSpan(highlightColor), startPosAfterVerseNumber == 0? 0: verseNumber_s.length() + 1, s.length(), 0); } lText.setText(s); // show verse on lVerseNumber if not shown in lText yet if (startPosAfterVerseNumber > 0) { lVerseNumber.setText(""); //$NON-NLS-1$ } else { lVerseNumber.setText(verseNumber_s); Appearances.applyVerseNumberAppearance(lVerseNumber); if (checked) { lVerseNumber.setTextColor(0xff000000); // override with black! } } } /** * @param paraType if -1, will apply the same thing as when paraType is 0 and firstLineWithVerseNumber is true. * @param firstLineWithVerseNumber If this is formatting for the first paragraph of a verse and that paragraph contains a verse number, so we can apply more lefty first-line indent. * This only applies if the paraType is 0. * @param dontPutSpacingBefore if this paragraph is just after pericope title or on the 0th position, in this case we don't apply paragraph spacing before. * @return whether we should put a top-spacing to the detached verse number too */ private static void applyParaStyle(SpannableStringBuilder sb, int paraType, int startPara, int verse_1, boolean firstLineWithVerseNumber, boolean dontPutSpacingBefore, boolean firstParagraph, TextView lVerseNumber) { int len = sb.length(); if (startPara == len) return; switch (paraType) { case -1: sb.setSpan(createLeadingMarginSpan(0, S.applied.indentParagraphRest), startPara, len, 0); break; case '0': if (firstLineWithVerseNumber) { sb.setSpan(createLeadingMarginSpan(0, S.applied.indentParagraphRest), startPara, len, 0); } else { sb.setSpan(createLeadingMarginSpan(S.applied.indentParagraphRest), startPara, len, 0); } break; case '1': sb.setSpan(createLeadingMarginSpan(S.applied.indentSpacing1 + (verse_1 >= 100 ? S.applied.indentSpacingExtra : 0)), startPara, len, 0); break; case '2': sb.setSpan(createLeadingMarginSpan(S.applied.indentSpacing2 + (verse_1 >= 100 ? S.applied.indentSpacingExtra : 0)), startPara, len, 0); break; case '3': sb.setSpan(createLeadingMarginSpan(S.applied.indentSpacing3 + (verse_1 >= 100 ? S.applied.indentSpacingExtra : 0)), startPara, len, 0); break; case '4': sb.setSpan(createLeadingMarginSpan(S.applied.indentSpacing4 + (verse_1 >= 100 ? S.applied.indentSpacingExtra : 0)), startPara, len, 0); break; case '^': if (!dontPutSpacingBefore) { sb.setSpan(new ParagraphSpacingBefore(S.applied.paragraphSpacingBefore), startPara, len, 0); if (firstParagraph) { lVerseNumber.setPadding(0, S.applied.paragraphSpacingBefore, 0, 0); } } sb.setSpan(createLeadingMarginSpan(S.applied.indentParagraphFirst, S.applied.indentParagraphRest), startPara, len, 0); break; } } protected static void simpleVerseDisplay(TextView lText, TextView lVerseNumber, int verse_1, String text, int highlightColor, boolean checked) { // initialize lVerseNumber to have no padding first lVerseNumber.setPadding(0, 0, 0, 0); SpannableStringBuilder s = new SpannableStringBuilder(); // verse number String verse_s = Integer.toString(verse_1); s.append(verse_s).append(" ").append(text); s.setSpan(new VerseNumberSpan(!checked), 0, verse_s.length(), 0); // teks s.setSpan(createLeadingMarginSpan(0, S.applied.indentParagraphRest), 0, s.length(), 0); if (highlightColor != 0) { s.setSpan(new BackgroundColorSpan(highlightColor), verse_s.length() + 1, s.length(), 0); } lText.setText(s); lVerseNumber.setText(""); } >>>>>>>
<<<<<<< protected static final java.util.Map<String, ExpressionInterpreter> cache = new HashMap<>(); @Override ======= protected static HashMap<String, ExpressionInterpreter> cache = new HashMap<>(); >>>>>>> protected static final java.util.Map<String, ExpressionInterpreter> cache = new HashMap<>(); @Override <<<<<<< @Override ======= >>>>>>> @Override <<<<<<< ======= >>>>>>> <<<<<<< for (final Map map : maps) { for (final GamePiece piece : map.getAllPieces()) { ======= for (Map map : getMapList(mapName, sourcePiece)) { for (GamePiece piece : map.getAllPieces()) { >>>>>>> for (final Map map : getMapList(mapName, sourcePiece)) { for (final GamePiece piece : map.getAllPieces()) { <<<<<<< int result = 0; final List<Map> maps = getMapList(mapName, sourcePiece); final PieceFilter filter = matchString == null ? null : new PropertyExpression(unescape(matchString)).getFilter(sourcePiece); for (final Map map : maps) { for (final GamePiece piece : map.getAllPieces()) { ======= for (Map map : getMapList(mapName, sourcePiece)) { for (GamePiece piece : map.getAllPieces()) { >>>>>>> int result = 0; for (final Map map : getMapList(mapName, sourcePiece)) { for (final GamePiece piece : map.getAllPieces()) {
<<<<<<< /** The {@link Prefs} key for the user's real name */ public static final String REAL_NAME = "RealName"; //$NON-NLS-1$ /** The {@link Prefs} key for the user's secret name */ public static final String SECRET_NAME = "SecretName"; //$NON-NLS-1$ /** The {@link Prefs} key for the user's personal info */ public static final String PERSONAL_INFO = "Profile"; //$NON-NLS-1$ ======= public static final String MODULE_NAME_PROPERTY = "ModuleName"; public static final String MODULE_VERSION_PROPERTY = "ModuleVersion"; public static final String MODULE_DESCRIPTION_PROPERTY = "ModuleDescription"; public static final String MODULE_OTHER1_PROPERTY = "ModuleOther1"; public static final String MODULE_OTHER2_PROPERTY = "ModuleOther2"; public static final String MODULE_VASSAL_VERSION_CREATED_PROPERTY = "VassalVersionCreated"; public static final String MODULE_VASSAL_VERSION_RUNNING_PROPERTY = "VassalVersionRunning"; private static char COMMAND_SEPARATOR = KeyEvent.VK_ESCAPE; // Last type of game save/load for our current game //public static final String SAVED_GAME = "saved"; //public static final String LOADED_GAME = "loaded"; //public static final String REPLAYED_GAME = "replayed"; //public static final String REPLAYING_GAME = "replaying"; //public static final String LOGGING_GAME = "logging"; //public static final String LOGGED_GAME = "logged"; //public static final String NEW_GAME = "new"; // Last type of game save/load for our current game public enum GameFileMode { SAVED_GAME("saved"), LOADED_GAME("loaded"), REPLAYED_GAME("replayed"), REPLAYING_GAME("replaying"), LOGGING_GAME("logging"), LOGGED_GAME("logged"), NEW_GAME("new"); private final String prettyName; >>>>>>> /** The {@link Prefs} key for the user's real name */ public static final String REAL_NAME = "RealName"; //$NON-NLS-1$ /** The {@link Prefs} key for the user's secret name */ public static final String SECRET_NAME = "SecretName"; //$NON-NLS-1$ /** The {@link Prefs} key for the user's personal info */ public static final String PERSONAL_INFO = "Profile"; //$NON-NLS-1$ public static final String MODULE_NAME_PROPERTY = "ModuleName"; public static final String MODULE_VERSION_PROPERTY = "ModuleVersion"; public static final String MODULE_DESCRIPTION_PROPERTY = "ModuleDescription"; public static final String MODULE_OTHER1_PROPERTY = "ModuleOther1"; public static final String MODULE_OTHER2_PROPERTY = "ModuleOther2"; public static final String MODULE_VASSAL_VERSION_CREATED_PROPERTY = "VassalVersionCreated"; public static final String MODULE_VASSAL_VERSION_RUNNING_PROPERTY = "VassalVersionRunning"; private static char COMMAND_SEPARATOR = KeyEvent.VK_ESCAPE; // Last type of game save/load for our current game //public static final String SAVED_GAME = "saved"; //public static final String LOADED_GAME = "loaded"; //public static final String REPLAYED_GAME = "replayed"; //public static final String REPLAYING_GAME = "replaying"; //public static final String LOGGING_GAME = "logging"; //public static final String LOGGED_GAME = "logged"; //public static final String NEW_GAME = "new"; // Last type of game save/load for our current game public enum GameFileMode { SAVED_GAME("saved"), LOADED_GAME("loaded"), REPLAYED_GAME("replayed"), REPLAYING_GAME("replaying"), LOGGING_GAME("logging"), LOGGED_GAME("logged"), NEW_GAME("new"); private final String prettyName; <<<<<<< private String moduleVersion = "0.0"; //$NON-NLS-1$ private String vassalVersionCreated = "0.0"; //$NON-NLS-1$ private String gameName = DEFAULT_NAME; private String localizedGameName = null; private String description = ""; private String lastSavedConfiguration; private FileChooser fileChooser; private FileDialog fileDialog; private final MutablePropertiesContainer propsContainer = new Impl(); private final PropertyChangeListener repaintOnPropertyChange = ======= protected String moduleVersion = "0.0"; //$NON-NLS-1$ protected String vassalVersionCreated = "0.0"; //$NON-NLS-1$ protected String moduleOther1 = ""; protected String moduleOther2 = ""; protected String gameName = DEFAULT_NAME; protected String localizedGameName = null; protected String description = ""; protected String lastSavedConfiguration; protected FileChooser fileChooser; protected FileDialog fileDialog; protected MutablePropertiesContainer propsContainer = new Impl(); protected PropertyChangeListener repaintOnPropertyChange = >>>>>>> private String moduleVersion = "0.0"; //$NON-NLS-1$ private String vassalVersionCreated = "0.0"; //$NON-NLS-1$ private String moduleOther1 = ""; private String moduleOther2 = ""; private String gameName = DEFAULT_NAME; private String localizedGameName = null; private String description = ""; private String lastSavedConfiguration; private FileChooser fileChooser; private FileDialog fileDialog; private final MutablePropertiesContainer propsContainer = new Impl(); private final PropertyChangeListener repaintOnPropertyChange = <<<<<<< private void initServer() { ChatServerFactory.register(OfficialNodeClientFactory.OFFICIAL_TYPE, new OfficialNodeClientFactory()); ======= protected void initServer() { final OfficialNodeClientFactory oncf = new OfficialNodeClientFactory(); ChatServerFactory.register(OfficialNodeClientFactory.OFFICIAL_TYPE, oncf); >>>>>>> private void initServer() { final OfficialNodeClientFactory oncf = new OfficialNodeClientFactory(); ChatServerFactory.register(OfficialNodeClientFactory.OFFICIAL_TYPE, oncf); <<<<<<< private void initFrame() { final Rectangle screen = VASSAL.Info.getScreenBounds(frame); ======= protected void initFrame() { final Rectangle screen = SwingUtils.getScreenBounds(frame); >>>>>>> private void initFrame() { final Rectangle screen = SwingUtils.getScreenBounds(frame); <<<<<<< ======= >>>>>>>
<<<<<<< ======= import VASSAL.i18n.Resources; import VASSAL.tools.ScrollPane; >>>>>>> import VASSAL.i18n.Resources; import VASSAL.tools.ScrollPane;
<<<<<<< lastSave = save; ======= setModified(false); GameModule.getGameModule().warn(Resources.getString("GameState.game_saved")); //$NON-NLS-1$ >>>>>>> lastSave = save; GameModule.getGameModule().warn(Resources.getString("GameState.game_saved")); //$NON-NLS-1$
<<<<<<< drawLabel(g, pt, label, hAlign, vAlign, 0, 0, 0, false); } /** * Next, we go to this intermediate method, which deals with a couple of things (like deciding whether we're drawing in * HTML mode or not) and then calls the LabelUtils to do the Hard Work. * @param g our graphics object * @param pt Point for drawing label, based on hAlign/Valign. (but if objectWidth > 0 then the "x" part identifies the left part of our master object) * @param label Text we shall draw * @param hAlign Horizontal alignment (left, right, center) * @param vAlign Vertical alignment (top, bottom, center) * @param objectWidth 0 for default, or optional width of master object we are to draw text label within * @param minWidth 0 for default, or minimum width of text label * @param extraBorder 0 for default, or number of extra pixels of border (expands size of label drawn) * @param skipBox If true, ONLY draws the text, with no box or background (for filling in existing combine-o-rama boxes) */ protected void drawLabel(Graphics g, Point pt, String label, int hAlign, int vAlign, int objectWidth, int minWidth, int extraBorder, boolean skipBox) { if (label != null) { final Color labelFgColor = fgColor == null ? Color.black : fgColor; final Graphics2D g2d = (Graphics2D) g; g2d.addRenderingHints(SwingUtils.FONT_HINTS); ======= if (label != null && fgColor != null) { Graphics2D g2d = (Graphics2D) g; >>>>>>> drawLabel(g, pt, label, hAlign, vAlign, 0, 0, 0, false); } /** * Next, we go to this intermediate method, which deals with a couple of things (like deciding whether we're drawing in * HTML mode or not) and then calls the LabelUtils to do the Hard Work. * @param g our graphics object * @param pt Point for drawing label, based on hAlign/Valign. (but if objectWidth > 0 then the "x" part identifies the left part of our master object) * @param label Text we shall draw * @param hAlign Horizontal alignment (left, right, center) * @param vAlign Vertical alignment (top, bottom, center) * @param objectWidth 0 for default, or optional width of master object we are to draw text label within * @param minWidth 0 for default, or minimum width of text label * @param extraBorder 0 for default, or number of extra pixels of border (expands size of label drawn) * @param skipBox If true, ONLY draws the text, with no box or background (for filling in existing combine-o-rama boxes) */ protected void drawLabel(Graphics g, Point pt, String label, int hAlign, int vAlign, int objectWidth, int minWidth, int extraBorder, boolean skipBox) { if (label != null && fgColor != null) { final Graphics2D g2d = (Graphics2D) g; g2d.addRenderingHints(SwingUtils.FONT_HINTS); <<<<<<< // If HTML is enabled in the checkbox, OR the text has an explicit <html> tag surrounding it, we use HTML. if ((label.length() > 0) && (enableHTML || ((label.length() > 6) && "<html>".equalsIgnoreCase(label.substring(0, 6))))) { //NON-NLS LabelUtils.drawHTMLLabel(g, label, pt.x, pt.y, g.getFont(), hAlign, vAlign, labelFgColor, (skipBox ? null : bgColor), (skipBox ? null : labelFgColor), map.getComponent(), objectWidth, extraTextPadding, minWidth, extraBorder); } else { LabelUtils.drawLabel(g, label, pt.x, pt.y, g.getFont(), hAlign, vAlign, labelFgColor, (skipBox ? null : bgColor), (skipBox ? null : labelFgColor), objectWidth, extraTextPadding, minWidth, extraBorder); } ======= LabelUtils.drawLabel(g, label, pt.x, pt.y, g.getFont(), hAlign, vAlign, fgColor, bgColor, fgColor); >>>>>>> // If HTML is enabled in the checkbox, OR the text has an explicit <html> tag surrounding it, we use HTML. if ((label.length() > 0) && (enableHTML || ((label.length() > 6) && "<html>".equalsIgnoreCase(label.substring(0, 6))))) { //NON-NLS LabelUtils.drawHTMLLabel(g, label, pt.x, pt.y, g.getFont(), hAlign, vAlign, fgColor, (skipBox ? null : bgColor), (skipBox ? null : fgColor), map.getComponent(), objectWidth, extraTextPadding, minWidth, extraBorder); } else { LabelUtils.drawLabel(g, label, pt.x, pt.y, g.getFont(), hAlign, vAlign, fgColor, (skipBox ? null : bgColor), (skipBox ? null : fgColor), objectWidth, extraTextPadding, minWidth, extraBorder); }
<<<<<<< { "1.2.3", 1, 2, 3 }, { "1.2.3.4", 1, 2, 3, 4 }, { "1.2.3-svn7890", 1, 2, 3, -2, null }, { "1.2.3-rc3", 1, 2, 3, -2, null }, { "foobarbaz", null }, { "1.2.foo", 1, 2, null }, { "1.2-foo", 1, 2, -2, null }, { "3.0b6", 3, 0, null }, { "3.3.1-test", 3, 3, 1, -2, 0 }, { "3.3.1-test-80", 3, 3, 1, -2, 0, 80 }, { "3.3.1-test-80-gf8ef2523", 3, 3, 1, -2, 0, 80 } ======= { "1.2.3", 1, 2, 3 }, { "1.2.3.4", 1, 2, 3, 4 }, { "1.2.3-rc3", 1, 2, 3, -2, null }, { "foobarbaz", null }, { "1.2.foo", 1, 2, null }, { "1.2-foo", 1, 2, -2, null }, { "3.0b6", 3, 0, null }, { "3.3.0-beta4", 3, 3, 0, -2, 9453 }, { "3.3.0-beta4-80", 3, 3, 0, -2, 9453, 80 }, { "3.3.0-beta4-80-gf8ef2523", 3, 3, 0, -2, 9453, 80 } >>>>>>> { "1.2.3", 1, 2, 3 }, { "1.2.3.4", 1, 2, 3, 4 }, { "1.2.3-rc3", 1, 2, 3, -2, null }, { "foobarbaz", null }, { "1.2.foo", 1, 2, null }, { "1.2-foo", 1, 2, -2, null }, { "3.0b6", 3, 0, null }, { "3.3.1-test", 3, 3, 1, -2, 0 }, { "3.3.1-test-80", 3, 3, 1, -2, 0, 80 }, { "3.3.1-test-80-gf8ef2523", 3, 3, 1, -2, 0, 80 }
<<<<<<< import android.content.DialogInterface.OnClickListener; ======= import android.content.Intent; >>>>>>> import android.content.DialogInterface.OnClickListener; import android.content.Intent;
<<<<<<< @Override public void onDismiss(final DialogInterface dialog) { super.onDismiss(dialog); if (onDismissListener != null) { onDismissListener.onDismiss(dialog); } } ======= public static VersesDialog newCompareInstance(final int ari) { VersesDialog res = new VersesDialog(); Bundle args = new Bundle(); args.putInt(EXTRA_ari, ari); args.putBoolean(EXTRA_compareMode, true); res.setArguments(args); return res; } >>>>>>> @Override public void onDismiss(final DialogInterface dialog) { super.onDismiss(dialog); if (onDismissListener != null) { onDismissListener.onDismiss(dialog); } } public static VersesDialog newCompareInstance(final int ari) { VersesDialog res = new VersesDialog(); Bundle args = new Bundle(); args.putInt(EXTRA_ari, ari); args.putBoolean(EXTRA_compareMode, true); res.setArguments(args); return res; }
<<<<<<< // Let the subclass do its thing. doStopServer(); ======= >>>>>>> <<<<<<< // Ignore this (something creative here?) ======= // Ignore this (something creative here?) } catch (SWTException se){ // device is disposed when shutting down, we hope >>>>>>> // Ignore this (something creative here?) } catch (SWTException se){ // device is disposed when shutting down, we hope
<<<<<<< lsText = V.get(this, R.id.lsSplit0); lsSplit1 = V.get(this, R.id.lsSplit1); tSplitEmpty = V.get(this, R.id.tSplitEmpty); splitRoot = V.get(this, R.id.splitRoot); splitHandle = V.get(this, R.id.splitHandle); splitHandleButton = V.get(this, R.id.splitHandleButton); bGoto = V.get(this, R.id.bTuju); bLeft = V.get(this, R.id.bKiri); bRight = V.get(this, R.id.bKanan); ======= lsText = V.get(this, R.id.lsIsi); bGoto = V.get(this, R.id.bGoto); bLeft = V.get(this, R.id.bLeft); bRight = V.get(this, R.id.bRight); titleContainer = V.get(this, R.id.panelTitle); lTitle = V.get(this, R.id.lTitle); bContextMenu = V.get(this, R.id.bContext); >>>>>>> lsText = V.get(this, R.id.lsSplit0); lsSplit1 = V.get(this, R.id.lsSplit1); tSplitEmpty = V.get(this, R.id.tSplitEmpty); splitRoot = V.get(this, R.id.splitRoot); splitHandle = V.get(this, R.id.splitHandle); splitHandleButton = V.get(this, R.id.splitHandleButton); bGoto = V.get(this, R.id.bGoto); bLeft = V.get(this, R.id.bLeft); bRight = V.get(this, R.id.bRight); <<<<<<< CharSequence prepareTextForCopyShare(IntArrayList selectedVerses_1, CharSequence reference) { ======= public void onFakeContextMenuSelected(FakeContextMenu menu, Item item) { IntArrayList selected = getSelectedVerses_1(); if (selected.size() == 0) return; CharSequence reference = referenceFromSelectedVerses(selected); // the main verse (0 if not exist), which is only when only one verse is selected int mainVerse_1 = 0; if (selected.size() == 1) { mainVerse_1 = selected.get(0); } if (item == menu.menuCopyVerse) { // copy, can be multiple CharSequence textToCopy = prepareTextForCopyShare(selected, reference); U.copyToClipboard(textToCopy); uncheckAll(); Toast.makeText(this, getString(R.string.alamat_sudah_disalin, reference), Toast.LENGTH_SHORT).show(); } else if (item == menu.menuAddBookmark) { if (mainVerse_1 == 0) { // no main verse, scroll to show the relevant one! mainVerse_1 = selected.get(0); scrollToShowVerse(mainVerse_1); } final int ari = Ari.encode(S.activeBook.bookId, this.chapter_1, mainVerse_1); TypeBookmarkDialog dialog = new TypeBookmarkDialog(this, S.reference(S.activeBook, this.chapter_1, mainVerse_1), ari); dialog.setListener(new TypeBookmarkDialog.Listener() { @Override public void onOk() { uncheckAll(); verseAdapter_.loadAttributeMap(); } }); dialog.show(); } else if (item == menu.menuAddNote) { if (mainVerse_1 == 0) { // no main verse, scroll to show the relevant one! mainVerse_1 = selected.get(0); scrollToShowVerse(mainVerse_1); } TypeNoteDialog dialog = new TypeNoteDialog(IsiActivity.this, S.activeBook, this.chapter_1, mainVerse_1, new TypeNoteDialog.Listener() { @Override public void onDone() { uncheckAll(); verseAdapter_.loadAttributeMap(); } }); dialog.show(); } else if (item == menu.menuAddHighlight) { final int ari_bookchapter = Ari.encode(S.activeBook.bookId, this.chapter_1, 0); int colorRgb = S.getDb().getHighlightColorRgb(ari_bookchapter, selected); new TypeHighlightDialog(this, ari_bookchapter, selected, new TypeHighlightDialog.Listener() { @Override public void onOk(int colorRgb) { uncheckAll(); verseAdapter_.loadAttributeMap(); } }, colorRgb, reference).show(); } else if (item == menu.menuShare) { CharSequence textToShare = prepareTextForCopyShare(selected, reference); String verseUrl; if (selected.size() == 1) { verseUrl = S.createVerseUrl(S.activeBook, this.chapter_1, String.valueOf(selected.get(0))); } else { StringBuilder sb2 = new StringBuilder(); S.writeVerseRange(selected, sb2); verseUrl = S.createVerseUrl(S.activeBook, this.chapter_1, sb2.toString()); // use verse range } Intent intent = new Intent(Intent.ACTION_SEND); intent.setType("text/plain"); //$NON-NLS-1$ intent.putExtra(Intent.EXTRA_SUBJECT, reference); intent.putExtra(Intent.EXTRA_TEXT, textToShare.toString()); intent.putExtra(EXTRA_verseUrl, verseUrl); startActivityForResult(ShareActivity.createIntent(intent, getString(R.string.bagikan_alamat, reference)), REQCODE_share); uncheckAll(); } else if (item == menu.menuEsvsbasal) { final int ari = Ari.encode(S.activeBook.bookId, this.chapter_1, mainVerse_1); try { Intent intent = new Intent("yuku.esvsbasal.action.GOTO"); //$NON-NLS-1$ intent.putExtra("ari", ari); //$NON-NLS-1$ startActivity(intent); } catch (Exception e) { Log.e(TAG, "ESVSB starting", e); //$NON-NLS-1$ } } } private CharSequence prepareTextForCopyShare(IntArrayList selectedVerses_1, CharSequence reference) { >>>>>>> CharSequence prepareTextForCopyShare(IntArrayList selectedVerses_1, CharSequence reference) { <<<<<<< lsSplit1.setCacheColorHint(S.applied.backgroundColor); ======= // on Holo theme, the button background is quite transparent, so we need to adjust button text color // to dark one if user chooses to use a light background color. if (Build.VERSION.SDK_INT >= 11) { if (S.applied.backgroundBrightness > 0.7f) { bGoto.setTextColor(0xff000000); // black } else { bGoto.setTextColor(0xfff3f3f3); // default button text color on Holo } } } // appliance of hide navigation { View navigationPanel = findViewById(R.id.panelNavigation); if (Preferences.getBoolean(getString(R.string.pref_tanpaNavigasi_key), getResources().getBoolean(R.bool.pref_tanpaNavigasi_default))) { navigationPanel.setVisibility(View.GONE); titleContainer.setVisibility(View.VISIBLE); } else { navigationPanel.setVisibility(View.VISIBLE); titleContainer.setVisibility(View.GONE); } >>>>>>> lsSplit1.setCacheColorHint(S.applied.backgroundColor); <<<<<<< case R.id.menuEdisi: openVersionDialog(); return true; case R.id.menuSplitVersion: openSplitVersionDialog(); ======= case R.id.menuVersions: openVersionsDialog(); >>>>>>> case R.id.menuVersions: openVersionsDialog(); return true; case R.id.menuSplitVersion: openSplitVersionDialog(); <<<<<<< private void menuSearch2_click() { startActivityForResult(Search2Activity.createIntent(search2_query, search2_results, search2_selectedPosition, this.activeBook.bookId), REQCODE_search); ======= private void menuSearch_click() { startActivityForResult(Search2Activity.createIntent(search2_query, search2_results, search2_selectedPosition, S.activeBook.bookId), REQCODE_search); >>>>>>> private void menuSearch_click() { startActivityForResult(Search2Activity.createIntent(search2_query, search2_results, search2_selectedPosition, this.activeBook.bookId), REQCODE_search); <<<<<<< String reference = book.reference(chapter_1, verse_1); TypeBookmarkDialog dialog = new TypeBookmarkDialog(IsiActivity.this, reference, ari); ======= String reference = S.reference(S.activeVersion, ari); TypeBookmarkDialog dialog = new TypeBookmarkDialog(IsiActivity.this, reference, ari); >>>>>>> String reference = book.reference(chapter_1, verse_1); TypeBookmarkDialog dialog = new TypeBookmarkDialog(IsiActivity.this, reference, ari);
<<<<<<< * @param useCache boolean value. Whether or not to use the cache for feature extraction. */ public void setUseCache(boolean useCache) { ib.setUseCache(useCache); } /** ======= * Spits back the verification result string * @return */ public String getVerificationResultString(){ return verifier.getResultString(); } /** >>>>>>> * Spits back the verification result string * @return */ public String getVerificationResultString(){ return verifier.getResultString(); } /** * @param useCache boolean value. Whether or not to use the cache for feature extraction. */ public void setUseCache(boolean useCache) { ib.setUseCache(useCache); } /** <<<<<<< FullAPI test = new FullAPI.Builder().cfdPath("./jsan_resources/feature_sets/writeprints_feature_set_limited.xml") .psPath("./jsan_resources/problem_sets/enron_demo.xml").classifierPath("weka.classifiers.functions.SMO") .numThreads(4).analysisType(analysisType.CROSS_VALIDATION).useDocTitles(false).build(); ======= SMO s = new SMO(); s.setBuildLogisticModels(true); FullAPI test = new FullAPI.Builder().cfdPath("C:/Users/Mordio/workspace/research/featureSets/writeprints_feature_set_limited.xml") .psPath("C:/Users/Mordio/Downloads/Work/modifiedVerify.xml").classifier(s) .numThreads(8).analysisType(analysisType.TRAIN_TEST_UNKNOWN).useDocTitles(true).isSparse(false).verifierName("Distractorless").build(); >>>>>>> FullAPI test = new FullAPI.Builder().cfdPath("./jsan_resources/feature_sets/writeprints_feature_set_limited.xml") .psPath("./jsan_resources/problem_sets/enron_demo.xml").classifierPath("weka.classifiers.functions.SMO") .numThreads(4).analysisType(analysisType.CROSS_VALIDATION).useDocTitles(false).build(); <<<<<<< //test.calcInfoGain(); //test.applyInfoGain(1500); test.prepareAnalyzer(); test.run(); System.out.println(test.getClassificationAccuracy()); System.out.println(test.getStatString()); ======= Verifier v = new DistractorlessVerifier(test.getTrainingInstances(), test.getTestInstances(),0.17, false); v.verify(); System.out.println(v.getResultString()); >>>>>>> //test.calcInfoGain(); //test.applyInfoGain(1500); test.prepareAnalyzer(); test.run(); System.out.println(test.getClassificationAccuracy()); System.out.println(test.getStatString());
<<<<<<< @Override public List<Trace> findTracesByDuration(String serviceId, Date startTime, int durationMin, int durationMax, int num){ Map<String, Object> map = new HashMap<String, Object>(); map.put("serviceId", serviceId); map.put("startTime", startTime); map.put("num", num); map.put("durationMin", durationMin); map.put("durationMax", durationMax); return (List<Trace>) sqlSession.selectList("findTracesByDuration", map); } @Override public List<Trace> findTracesEx(String serviceId, Date startTime, int num) { Map<String, Object> map = new HashMap<String, Object>(); map.put("startTime", startTime); map.put("num", num); map.put("serviceId", serviceId); return (List<Trace>) sqlSession.selectList("findTracesEx", map); } ======= @Override public void addTrace(Trace t) { sqlSession.insert("addTrace",t); } >>>>>>> @Override public List<Trace> findTracesByDuration(String serviceId, Date startTime, int durationMin, int durationMax, int num){ Map<String, Object> map = new HashMap<String, Object>(); map.put("serviceId", serviceId); map.put("startTime", startTime); map.put("num", num); map.put("durationMin", durationMin); map.put("durationMax", durationMax); return (List<Trace>) sqlSession.selectList("findTracesByDuration", map); } @Override public List<Trace> findTracesEx(String serviceId, Date startTime, int num) { Map<String, Object> map = new HashMap<String, Object>(); map.put("startTime", startTime); map.put("num", num); map.put("serviceId", serviceId); return (List<Trace>) sqlSession.selectList("findTracesEx", map); } public void addTrace(Trace t) { sqlSession.insert("addTrace",t); }
<<<<<<< private InsertService insertService; private ArrayBlockingQueue<List<Span>> queue = new ArrayBlockingQueue<List<Span>>(1024); ======= private ArrayBlockingQueue<List<Span>> queue = new ArrayBlockingQueue<List<Span>>(10000); >>>>>>> private ArrayBlockingQueue<List<Span>> queue = new ArrayBlockingQueue<List<Span>>(1024);
<<<<<<< if (!Arrays.equals(msg.getGenesisHash(), config.getGenesis().getHash()) || msg.getProtocolVersion() != getVersion().getCode()) { ======= if (!Arrays.equals(msg.getGenesisHash(), config.getGenesis().getHash())) { >>>>>>> if (!Arrays.equals(msg.getGenesisHash(), config.getGenesis().getHash())) { <<<<<<< "Peer %s: [ %s, %16s, ping %6s ms, difficulty %s, best block %s ]", getVersion(), ======= "Peer %s: [ %s, %16s, ping %6s ms, difficulty %s, best block %s ]: %s", version, >>>>>>> "Peer %s: [ %s, %16s, ping %6s ms, difficulty %s, best block %s ]: %s", getVersion(),
<<<<<<< ======= import org.ethereum.config.SystemProperties; import org.ethereum.core.*; import org.ethereum.db.BlockStore; import org.ethereum.listener.CompositeEthereumListener; >>>>>>> <<<<<<< ======= import org.ethereum.listener.EthereumListenerAdapter; import org.ethereum.net.server.ChannelManager; import org.ethereum.net.submit.TransactionExecutor; import org.ethereum.net.submit.TransactionTask; import org.ethereum.sync.SyncManager; import org.ethereum.sync.SyncQueue; >>>>>>> import org.ethereum.config.SystemProperties; import org.ethereum.core.*; import org.ethereum.listener.CompositeEthereumListener; import org.ethereum.listener.EthereumListenerAdapter; <<<<<<< ======= private static final int BLOCKS_LACK_MAX_HITS = 5; private int blocksLackHits = 0; protected SyncStateName syncState = IDLE; protected boolean syncDone = false; protected boolean processTransactions = false; protected byte[] bestHash; private Block bestBlock; private EthereumListener listener = new EthereumListenerAdapter() { @Override public void onBlock(Block block, List<TransactionReceipt> receipts) { bestBlock = block; } }; /** * Last block hash to be asked from the peer, * its usage depends on Eth version * * @see Eth60 * @see Eth61 * @see Eth62 */ protected byte[] lastHashToAsk; protected int maxHashesAsk; protected final SyncStatistics syncStats = new SyncStatistics(); /** * The number above which blocks are treated as NEW, * filled by data gained from NewBlockHashes and NewBlock messages */ protected long newBlockLowerNumber = Long.MAX_VALUE; >>>>>>> protected Block bestBlock; protected EthereumListener listener = new EthereumListenerAdapter() { @Override public void onBlock(Block block, List<TransactionReceipt> receipts) { bestBlock = block; } }; protected int maxHashesAsk; <<<<<<< ======= @PostConstruct private void init() { maxHashesAsk = config.maxHashesAsk(); bestBlock = blockchain.getBestBlock(); ethereumListener.addListener(listener); } >>>>>>> @PostConstruct private void init() { maxHashesAsk = config.maxHashesAsk(); bestBlock = blockchain.getBestBlock(); ethereumListener.addListener(listener); } <<<<<<< logger.debug("handlerRemoved: kill timers in EthHandler"); ======= loggerNet.debug("handlerRemoved: kill timers in EthHandler"); ethereumListener.removeListener(listener); >>>>>>> logger.debug("handlerRemoved: kill timers in EthHandler"); ethereumListener.removeListener(listener); <<<<<<< ======= /** * Checking if peer is using the same genesis, protocol and network</li> * * @param msg is the StatusMessage * @param ctx the ChannelHandlerContext */ private void processStatus(StatusMessage msg, ChannelHandlerContext ctx) throws InterruptedException { channel.getNodeStatistics().ethHandshake(msg); ethereumListener.onEthStatusUpdated(channel, msg); try { if (!Arrays.equals(msg.getGenesisHash(), Blockchain.GENESIS_HASH) || msg.getProtocolVersion() != version.getCode()) { loggerNet.info("Removing EthHandler for {} due to protocol incompatibility", ctx.channel().remoteAddress()); ethState = EthState.STATUS_FAILED; disconnect(ReasonCode.INCOMPATIBLE_PROTOCOL); ctx.pipeline().remove(this); // Peer is not compatible for the 'eth' sub-protocol return; } else if (msg.getNetworkId() != config.networkId()) { ethState = EthState.STATUS_FAILED; disconnect(ReasonCode.NULL_IDENTITY); return; } else if (peerDiscoveryMode) { loggerNet.debug("Peer discovery mode: STATUS received, disconnecting..."); disconnect(ReasonCode.REQUESTED); ctx.close().sync(); ctx.disconnect().sync(); return; } } catch (NoSuchElementException e) { loggerNet.debug("EthHandler already removed"); return; } ethState = EthState.STATUS_SUCCEEDED; bestHash = msg.getBestHash(); } protected void sendStatus() { byte protocolVersion = version.getCode(); int networkId = config.networkId(); BigInteger totalDifficulty = blockchain.getTotalDifficulty(); byte[] bestHash = bestBlock.getHash(); StatusMessage msg = new StatusMessage(protocolVersion, networkId, ByteUtil.bigIntegerToBytes(totalDifficulty), bestHash, Blockchain.GENESIS_HASH); sendMessage(msg); } /* * The wire gets data for signed transactions and * sends it to the net. */ @Override public void sendTransaction(List<Transaction> txs) { TransactionsMessage msg = new TransactionsMessage(txs); sendMessage(msg); } private void processTransactions(TransactionsMessage msg) { if(!processTransactions) { return; } List<Transaction> txSet = msg.getTransactions(); pendingState.addWireTransactions(txSet); } public void sendNewBlock(Block block) { BigInteger parentTD = blockstore.getTotalDifficultyForHash(block.getParentHash()); byte[] td = ByteUtil.bigIntegerToBytes(parentTD.add(new BigInteger(1, block.getDifficulty()))); NewBlockMessage msg = new NewBlockMessage(block, td); sendMessage(msg); } public abstract void sendNewBlockHashes(Block block); private void processNewBlock(NewBlockMessage newBlockMessage) { Block newBlock = newBlockMessage.getBlock(); loggerSync.info("New block received: block.index [{}]", newBlock.getNumber()); // skip new block if TD is lower than ours if (isLessThan(newBlockMessage.getDifficultyAsBigInt(), blockchain.getTotalDifficulty())) { loggerSync.trace( "New block difficulty lower than ours: [{}] vs [{}], skip", newBlockMessage.getDifficultyAsBigInt(), blockchain.getTotalDifficulty() ); return; } channel.getNodeStatistics().setEthTotalDifficulty(newBlockMessage.getDifficultyAsBigInt()); bestHash = newBlock.getHash(); // adding block to the queue // there will be decided how to // connect it to the chain queue.addNew(newBlock, channel.getNodeId()); if (newBlockLowerNumber == Long.MAX_VALUE) { newBlockLowerNumber = newBlock.getNumber(); } } >>>>>>>
<<<<<<< ======= protected void removeFilter() { adapter.getFilter().filter(null); currentlyUsedFilter = null; setTitleAndNothingText(); } protected void applyFilter(String query) { currentlyUsedFilter = query; filterUsingCurrentlyUsedFilter(); setTitleAndNothingText(); } void filterUsingCurrentlyUsedFilter() { final ProgressDialog pd = ProgressDialog.show(this, null, getString(R.string.bl_filtering_titiktiga), true, false); adapter.getFilter().filter(currentlyUsedFilter, new FilterListener() { @Override public void onFilterComplete(int count) { pd.dismiss(); } }); } @SuppressWarnings("deprecation") void replaceCursor() { if (cursor != null) { stopManagingCursor(cursor); } cursor = S.getDb().listMarkers(filter_kind, filter_labelId, sort_column, sort_ascending); startManagingCursor(cursor); if (adapter != null) { adapter.changeCursor(cursor); } } >>>>>>> <<<<<<< if (filter_kind == Db.Bookmark2.kind_bookmark) { TypeBookmarkDialog dialog = new TypeBookmarkDialog(this, bookmark._id); ======= if (filter_kind == Marker.Kind.bookmark) { TypeBookmarkDialog dialog = new TypeBookmarkDialog(this, info.id); >>>>>>> if (filter_kind == Marker.Kind.bookmark) { TypeBookmarkDialog dialog = new TypeBookmarkDialog(this, bookmark._id); <<<<<<< /** The real work of filtering happens here */ public static List<Bookmark2> filterEngine(List<Bookmark2> allBookmarks, int filter_kind, String[] tokens) { List<Bookmark2> res = new ArrayList<>(); if (tokens == null || tokens.length == 0) { res.addAll(allBookmarks); return res; ======= class BukmakListAdapter extends CursorAdapter { BukmakFilterQueryProvider filterQueryProvider; // must also modify FilterQueryProvider below!!! private int col__id; private int col_ari; private int col_caption; private int col_createTime; private int col_modifyTime; ////////////////////////////// BukmakListAdapter(Context context, Cursor cursor) { super(context, cursor, false); getColumnIndexes(); setFilterQueryProvider(filterQueryProvider = new BukmakFilterQueryProvider()); >>>>>>> /** The real work of filtering happens here */ public static List<Marker> filterEngine(List<Marker> allMarkers, Marker.Kind filter_kind, String[] tokens) { List<Marker> res = new ArrayList<>(); if (tokens == null || tokens.length == 0) { res.addAll(allMarkers); return res; <<<<<<< if (verseText == null) { verseText = getString(R.string.generic_verse_not_available_in_this_version); } else { verseText = U.removeSpecialCodes(verseText); } final String caption = bookmark.caption; if (filter_kind == Db.Bookmark2.kind_bookmark) { lCaption.setText(currentlyUsedFilter != null? Search2Engine.hilite(caption, tokens, hiliteColor): caption); ======= verseText = U.removeSpecialCodes(verseText); String caption = cursor.getString(col_caption); if (filter_kind == Marker.Kind.bookmark) { lCaption.setText(currentlyUsedFilter != null? Search2Engine.hilite(caption, filterQueryProvider.getTokens(), hiliteColor): caption); >>>>>>> if (verseText == null) { verseText = getString(R.string.generic_verse_not_available_in_this_version); } else { verseText = U.removeSpecialCodes(verseText); } final String caption = bookmark.caption; if (filter_kind == Marker.Kind.bookmark) { lCaption.setText(currentlyUsedFilter != null? Search2Engine.hilite(caption, tokens, hiliteColor): caption); <<<<<<< final List<Label> labels = S.getDb().listLabelsByBookmarkId(bookmark._id); ======= long _id = cursor.getLong(col__id); List<Label> labels = S.getDb().listLabelsByMarkerId(_id); >>>>>>> List<Label> labels = S.getDb().listLabelsByMarkerId(bookmark._id); <<<<<<< } else if (filter_kind == Db.Bookmark2.kind_note) { ======= } else if (filter_kind == Marker.Kind.note) { >>>>>>> } else if (filter_kind == Marker.Kind.note) { <<<<<<< } else if (filter_kind == Db.Bookmark2.kind_highlight) { ======= } else if (filter_kind == Marker.Kind.highlight) { >>>>>>> } else if (filter_kind == Marker.Kind.highlight) { <<<<<<< ======= } class BukmakFilterQueryProvider implements FilterQueryProvider { private String[] tokens; public String[] getTokens() { return tokens; } @Override public Cursor runQuery(CharSequence constraint) { if (constraint == null || constraint.length() == 0) { this.tokens = null; return S.getDb().listMarkers(filter_kind, filter_labelId, sort_column, sort_ascending); } String[] tokens = QueryTokenizer.tokenize(constraint.toString()); for (int i = 0; i < tokens.length; i++) { tokens[i] = tokens[i].toLowerCase(Locale.getDefault()); } this.tokens = tokens; MatrixCursor res = new MatrixCursor(new String[] {BaseColumns._ID, Db.Marker.ari, Db.Marker.caption, Db.Marker.createTime, Db.Marker.modifyTime}); Cursor c = S.getDb().listMarkers(filter_kind, filter_labelId, sort_column, sort_ascending); try { int col__id = c.getColumnIndexOrThrow(BaseColumns._ID); int col_ari = c.getColumnIndexOrThrow(Db.Marker.ari); int col_caption = c.getColumnIndexOrThrow(Db.Marker.caption); int col_createTime = c.getColumnIndexOrThrow(Db.Marker.createTime); int col_modifyTime = c.getColumnIndexOrThrow(Db.Marker.modifyTime); while (c.moveToNext()) { boolean fulfills = false; String caption = c.getString(col_caption); if (filter_kind != Marker.Kind.highlight) { // "caption" in highlights only stores color information, so it's useless to check String tulisan_lc = caption.toLowerCase(Locale.getDefault()); if (Search2Engine.satisfiesQuery(tulisan_lc, tokens)) { fulfills = true; } } int ari = c.getInt(col_ari); if (!fulfills) { // try the verse text! String verseText = S.activeVersion.loadVerseText(ari); String verseText_lc = verseText.toLowerCase(Locale.getDefault()); if (Search2Engine.satisfiesQuery(verseText_lc, tokens)) { fulfills = true; } } if (fulfills) { res.newRow() .add(c.getLong(col__id)) .add(ari) .add(caption) .add(c.getInt(col_createTime)) .add(c.getInt(col_modifyTime)); } } } finally { c.close(); } >>>>>>>
<<<<<<< if (this.ari == 0 && bukmak != null) { this.ari = bukmak.ari; this.alamat = S.activeVersion.reference(bukmak.ari); ======= if (this.ari == 0 && bookmark != null) { this.ari = bookmark.ari; this.reference = S.reference(S.activeVersion, bookmark.ari); >>>>>>> if (this.ari == 0 && bookmark != null) { this.ari = bookmark.ari; this.reference = S.activeVersion.reference(bookmark.ari); <<<<<<< .setTitle(alamat) .setIcon(R.drawable.ic_attr_bookmark) ======= .setTitle(reference) .setIcon(R.drawable.attribute_type_bookmark) >>>>>>> .setTitle(reference) .setIcon(R.drawable.ic_attr_bookmark)
<<<<<<< import org.ethereum.net.swarm.bzz.BzzHandler; ======= import org.ethereum.util.FileUtil; >>>>>>> import org.ethereum.net.swarm.bzz.BzzHandler; import org.ethereum.util.FileUtil;
<<<<<<< @Override public boolean eip198() { return true; } ======= @Override public boolean eip206() { return true; } @Override public boolean eip211() { return true; } >>>>>>> @Override public boolean eip198() { return true; } @Override public boolean eip206() { return true; } @Override public boolean eip211() { return true; }
<<<<<<< import org.ethereum.config.CommonConfig; import org.ethereum.config.SystemProperties; ======= import org.ethereum.config.SystemProperties; >>>>>>> import org.ethereum.config.SystemProperties; import org.ethereum.config.CommonConfig; import org.ethereum.config.SystemProperties; <<<<<<< import org.ethereum.listener.EthereumListenerAdapter; ======= import org.ethereum.listener.EthereumListener.PendingTransactionState; >>>>>>> import org.ethereum.listener.EthereumListener.PendingTransactionState; import org.ethereum.listener.EthereumListenerAdapter; <<<<<<< import static java.math.BigInteger.ZERO; import static org.ethereum.util.BIUtil.toBI; ======= import static org.ethereum.config.SystemProperties.CONFIG; import static org.ethereum.listener.EthereumListener.PendingTransactionState.*; >>>>>>> import static org.ethereum.config.SystemProperties.CONFIG; import static org.ethereum.listener.EthereumListener.PendingTransactionState.*; import static java.math.BigInteger.ZERO; import static org.ethereum.util.BIUtil.toBI; <<<<<<< synchronized (wireTransactions) { for (PendingTransaction tx : wireTransactions) if (blockNumber - tx.getBlockNumber() > config.txOutdatedThreshold()) outdated.add(tx); ======= for (PendingTransaction tx : pendingTransactions) { if (blockNumber - tx.getBlockNumber() > config.txOutdatedThreshold()) { outdated.add(tx); fireTxUpdate(createDroppedReceipt(tx.getTransaction(), "Tx was not included into last " + CONFIG.txOutdatedThreshold() + " blocks"), DROPPED, getBestBlock()); } >>>>>>> for (PendingTransaction tx : pendingTransactions) { if (blockNumber - tx.getBlockNumber() > config.txOutdatedThreshold()) { outdated.add(tx); fireTxUpdate(createDroppedReceipt(tx.getTransaction(), "Tx was not included into last " + CONFIG.txOutdatedThreshold() + " blocks"), DROPPED, getBestBlock()); }
<<<<<<< public boolean eip198() { return false; } @Override ======= public boolean eip206() { return false; } @Override public boolean eip211() { return false; } @Override >>>>>>> public boolean eip198() { return false; } @Override public boolean eip206() { return false; } @Override public boolean eip211() { return false; } @Override
<<<<<<< @Override public Repository getSnapshotTo(byte[] root) { throw new UnsupportedOperationException(); } ======= public Repository getOriginRepository() { return (repository instanceof RepositoryTrack) ? ((RepositoryTrack) repository).getOriginRepository() : repository; } >>>>>>> @Override public Repository getSnapshotTo(byte[] root) { throw new UnsupportedOperationException(); } public Repository getOriginRepository() { return (repository instanceof RepositoryTrack) ? ((RepositoryTrack) repository).getOriginRepository() : repository; }
<<<<<<< } switch (op) { case DELEGATECALL: if (!blockchainConfig.getConstants().hasDelegateCallOpcode()) { // opcode since Homestead release only throw Program.Exception.invalidOpCode(program.getCurrentOp()); } break; case REVERT: if (!blockchainConfig.eip140()) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); } break; case RETURNDATACOPY: case RETURNDATASIZE: if (!blockchainConfig.eip211()) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); } break; ======= } else if (op == DELEGATECALL) { // opcode since Homestead release only if (!blockchainConfig.getConstants().hasDelegateCallOpcode()) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); } } else if (op == REVERT) { // opcode since Bizantium HF only if (!blockchainConfig.eip206()) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); } >>>>>>> } else if (op == DELEGATECALL) { // opcode since Homestead release only if (!blockchainConfig.getConstants().hasDelegateCallOpcode()) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); } } else if (op == REVERT) { // opcode since Bizantium HF only if (!blockchainConfig.eip140()) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); } } switch (op) { case DELEGATECALL: if (!blockchainConfig.getConstants().hasDelegateCallOpcode()) { // opcode since Homestead release only throw Program.Exception.invalidOpCode(program.getCurrentOp()); } break; case REVERT: if (!blockchainConfig.eip206()) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); } break; case RETURNDATACOPY: case RETURNDATASIZE: if (!blockchainConfig.eip211()) { throw Program.Exception.invalidOpCode(program.getCurrentOp()); } break;
<<<<<<< @Test public void testSegmentedLogging() throws Exception { deploy("logging"); save(ProcessConfiguration.builder() .build()); RunnerConfiguration runnerCfg = RunnerConfiguration.builder() .logging(LoggingConfiguration.builder() .segmentedLogDir(segmentedLogDir.toAbsolutePath().toString()) .build()) .build(); byte[] log = run(runnerCfg); assertLog(log, ".*this goes directly into the stdout.*"); List<Path> paths = Files.list(segmentedLogDir).collect(Collectors.toList()); assertNotEquals(0, paths.size()); } ======= @Test public void testInitiator() throws Exception { deploy("initiator"); Map<String, Object> initiator = new HashMap<>(); initiator.put("username", "test"); initiator.put("displayName", "Test User"); save(ProcessConfiguration.builder() .initiator(initiator) .putArguments("name", "${initiator.displayName}") .build()); byte[] log = start(); assertLog(log, ".*Test User.*"); } >>>>>>> @Test public void testInitiator() throws Exception { deploy("initiator"); Map<String, Object> initiator = new HashMap<>(); initiator.put("username", "test"); initiator.put("displayName", "Test User"); save(ProcessConfiguration.builder() .initiator(initiator) .putArguments("name", "${initiator.displayName}") .build()); byte[] log = start(); assertLog(log, ".*Test User.*"); } @Test public void testSegmentedLogging() throws Exception { deploy("logging"); save(ProcessConfiguration.builder() .build()); RunnerConfiguration runnerCfg = RunnerConfiguration.builder() .logging(LoggingConfiguration.builder() .segmentedLogDir(segmentedLogDir.toAbsolutePath().toString()) .build()) .build(); byte[] log = run(runnerCfg); assertLog(log, ".*this goes directly into the stdout.*"); List<Path> paths = Files.list(segmentedLogDir).collect(Collectors.toList()); assertNotEquals(0, paths.size()); }
<<<<<<< public boolean isHiveImpersonation(String datasource) { return Boolean.parseBoolean(Optional.ofNullable(properties.getProperty("hive.jdbc.impersonation." + datasource)).orElse("false")); } ======= public Optional<String> getWebhdfsProxyUser(String datasource) { return Optional.ofNullable(properties.getProperty(String.format("webhdfs.proxy.user.%s", datasource))); } public Optional<String> getWebhdfsProxyPassword(String datasource) { return Optional.ofNullable(properties.getProperty(String.format("webhdfs.proxy.password.%s", datasource))); } public Optional<String> getDatabaseType() { return Optional.ofNullable(properties.getProperty("database.type")); } public String getMysqlHost() { return PropertiesUtil.getParam(properties, "mysql.host"); } public String getMysqlPort() { return PropertiesUtil.getParam(properties, "mysql.port"); } public String getMysqlDatabase() { return PropertiesUtil.getParam(properties, "mysql.database"); } public String getMysqlUser() { return PropertiesUtil.getParam(properties, "mysql.user"); } public String getMysqlPassword() { return PropertiesUtil.getParam(properties, "mysql.password"); } >>>>>>> public boolean isHiveImpersonation(String datasource) { return Boolean.parseBoolean(Optional.ofNullable(properties.getProperty("hive.jdbc.impersonation." + datasource)).orElse("false")); } public Optional<String> getWebhdfsProxyUser(String datasource) { return Optional.ofNullable(properties.getProperty(String.format("webhdfs.proxy.user.%s", datasource))); } public Optional<String> getWebhdfsProxyPassword(String datasource) { return Optional.ofNullable(properties.getProperty(String.format("webhdfs.proxy.password.%s", datasource))); } public Optional<String> getDatabaseType() { return Optional.ofNullable(properties.getProperty("database.type")); } public String getMysqlHost() { return PropertiesUtil.getParam(properties, "mysql.host"); } public String getMysqlPort() { return PropertiesUtil.getParam(properties, "mysql.port"); } public String getMysqlDatabase() { return PropertiesUtil.getParam(properties, "mysql.database"); } public String getMysqlUser() { return PropertiesUtil.getParam(properties, "mysql.user"); } public String getMysqlPassword() { return PropertiesUtil.getParam(properties, "mysql.password"); }
<<<<<<< ======= import javax.money.MonetaryOperator; >>>>>>> <<<<<<< ======= } private static double getInternalDouble(MonetaryAmount amount) { if (amount.getClass() == Money.class) { return ((Money) amount).asNumber().doubleValue(); } long fractionNumerator = amount.getAmountFractionNumerator(); long divisor = amount.getAmountFractionDenominator() / SCALING_DENOMINATOR; double fraction = ((double) fractionNumerator) / divisor / SCALING_DENOMINATOR; return amount.getAmountWhole() + fraction; >>>>>>> <<<<<<< private static double getInternalDouble(MonetaryAmount<?> amount) { return amount.getNumber(BigDecimal.class).doubleValue(); } ======= >>>>>>> <<<<<<< public FastMoney with(MonetaryOperator adjuster) { return adjuster.apply(this); ======= public FastMoney with(MonetaryOperator adjuster) { return (FastMoney) adjuster.apply(this); >>>>>>>
<<<<<<< <T1> T1 getProperty(Property property, T1 defaultValue); ======= <T> T getProperty(int property, T defaultValue); >>>>>>> <T1> T1 getProperty(int property, T1 defaultValue);
<<<<<<< return createGoToR(fileSpec, destination).put(PdfName.NewWindow, new PdfBoolean(newWindow)); ======= return new PdfAction().put(PdfName.S, PdfName.GoToR).put(PdfName.F, fileSpec.getPdfObject()). put(PdfName.D, destination.getPdfObject()).put(PdfName.NewWindow, PdfBoolean.valueOf(newWindow)); >>>>>>> return createGoToR(fileSpec, destination).put(PdfName.NewWindow, PdfBoolean.valueOf(newWindow)); <<<<<<< PdfAction action = createLaunch(fileSpec, newWindow); ======= PdfAction action = new PdfAction().put(PdfName.S, PdfName.Launch).put(PdfName.NewWindow, PdfBoolean.valueOf(newWindow)); if (fileSpec != null) { action.put(PdfName.F, fileSpec.getPdfObject()); } >>>>>>> PdfAction action = createLaunch(fileSpec, newWindow);
<<<<<<< getBackingElem().setLang(new PdfString(language)); ======= backingElem.setLang(new PdfString(language, PdfEncodings.UNICODE_BIG)); >>>>>>> getBackingElem().setLang(new PdfString(language, PdfEncodings.UNICODE_BIG)); <<<<<<< getBackingElem().setActualText(new PdfString(actualText)); ======= backingElem.setActualText(new PdfString(actualText, PdfEncodings.UNICODE_BIG)); >>>>>>> getBackingElem().setActualText(new PdfString(actualText, PdfEncodings.UNICODE_BIG)); <<<<<<< getBackingElem().setAlt(new PdfString(alternateDescription)); ======= backingElem.setAlt(new PdfString(alternateDescription, PdfEncodings.UNICODE_BIG)); >>>>>>> getBackingElem().setAlt(new PdfString(alternateDescription, PdfEncodings.UNICODE_BIG)); <<<<<<< getBackingElem().setE(new PdfString(expansion)); ======= backingElem.setE(new PdfString(expansion, PdfEncodings.UNICODE_BIG)); >>>>>>> getBackingElem().setE(new PdfString(expansion, PdfEncodings.UNICODE_BIG));
<<<<<<< * See ISO-320001 12.5.6, “Annotation Types” for the reference to the possible types. * ======= * See ISO-320001 12.5.6, "Annotation Types" for the reference to the possible types. >>>>>>> * See ISO-320001 12.5.6, "Annotation Types" for the reference to the possible types. * <<<<<<< * Resets a flag that specifies a characteristic of the annotation to disabled state (see ISO-320001 12.5.3, “Annotation Flags”). * ======= * Resets a flag that specifies a characteristic of the annotation to disabled state (see ISO-320001 12.5.3, "Annotation Flags"). >>>>>>> * Resets a flag that specifies a characteristic of the annotation to disabled state (see ISO-320001 12.5.3, "Annotation Flags"). * <<<<<<< * corresponding to different appearance states of the annotation. See ISO-320001 12.5.5, “Appearance Streams”. * ======= * corresponding to different appearance states of the annotation. See ISO-320001 12.5.5, "Appearance Streams". >>>>>>> * corresponding to different appearance states of the annotation. See ISO-320001 12.5.5, "Appearance Streams". * <<<<<<< * The array may have a fourth element, an optional dash array (see ISO-320001 8.4.3.6, “Line Dash Pattern”). * ======= * The array may have a fourth element, an optional dash array (see ISO-320001 8.4.3.6, "Line Dash Pattern"). >>>>>>> * The array may have a fourth element, an optional dash array (see ISO-320001 8.4.3.6, "Line Dash Pattern"). * <<<<<<< * (see ISO-320001 14.7.4.4, “Finding Structure Elements from Content Items”). * ======= * (see ISO-320001 14.7.4.4, "Finding Structure Elements from Content Items"). >>>>>>> * (see ISO-320001 14.7.4.4, "Finding Structure Elements from Content Items"). * <<<<<<< * The annotation rectangle, defining the location of the annotation on the page in default user space units. * * @param array a {@link PdfArray} which specifies a rectangle by two diagonally opposite corners. * Typically, the array is of form [llx lly urx ury]. * @return this {@link PdfAnnotation} instance. ======= * @deprecated Supported only for: * {@link PdfLinkAnnotation}, {@link PdfFreeTextAnnotation}, {@link PdfLineAnnotation}, {@link PdfSquareAnnotation}, * {@link PdfCircleAnnotation}, {@link PdfPolyGeomAnnotation}, {@link PdfInkAnnotation}, {@link PdfWidgetAnnotation} * will be removed in 7.1 * * Setter for the annotation's preset dashed border style. This property has affect only if {@link PdfAnnotation#STYLE_DASHED} * style was used for the annotation border style (see {@link PdfAnnotation#setBorderStyle(PdfName)}. * See ISO-320001 8.4.3.6, "Line Dash Pattern" for the format in which dash pattern shall be specified. * @param dashPattern a dash array defining a pattern of dashes and gaps that * shall be used in drawing a dashed border. * @return this {@link PdfAnnotation} instance. >>>>>>> * The annotation rectangle, defining the location of the annotation on the page in default user space units. * * @param array a {@link PdfArray} which specifies a rectangle by two diagonally opposite corners. * Typically, the array is of form [llx lly urx ury]. * @return this {@link PdfAnnotation} instance. <<<<<<< * PDF 2.0. A language identifier overriding the document’s language identifier to * specify the natural language for all text in the annotation except where overridden by * other explicit language specifications * * @param lang language identifier * @return this {@link PdfAnnotation} instance ======= * Annotation title. For example for markup annotations, the title is the text label that shall be displayed in the * title bar of the annotation’s pop-up window when open and active. For movie annotation Movie actions * (ISO-320001 12.6.4.9, "Movie Actions") may use this title to reference the movie annotation. * @return {@link PdfString} which value is an annotation title or null if it isn't specifed. >>>>>>> * PDF 2.0. A language identifier overriding the document’s language identifier to * specify the natural language for all text in the annotation except where overridden by * other explicit language specifications * * @param lang language identifier * @return this {@link PdfAnnotation} instance
<<<<<<< // TODO // for (int i = col; i < col + cell.getPropertyAsInteger(Property.COLSPAN); i++) { // bordersHandler.horizontalBorders.get(rowN + 1).set(i, collapsedWithTableBorder); // } ======= for (int i = col; i < col + cell.getPropertyAsInteger(Property.COLSPAN); i++) { horizontalBorders.get(row + (hasContent ? 1 : 0)).set(i, collapsedWithTableBorder); } >>>>>>> // TODO // for (int i = col; i < col + cell.getPropertyAsInteger(Property.COLSPAN); i++) { // bordersHandler.horizontalBorders.get(row + (hasContent ? 1 : 0)).set(i, collapsedWithTableBorder); // } <<<<<<< // TODO // if (null != cellSplit) { // for (int j = col; j < col + cellOverflow.getPropertyAsInteger(Property.COLSPAN); j++) { // splitResult[0].horizontalBorders.get(row + (hasContent ? 1 : 0)).set(j, currentRow[col].getBorders()[2]); // } // } ======= if (null != cellSplit) { for (int j = col; j < col + cellOverflow.getPropertyAsInteger(Property.COLSPAN); j++) { splitResult[0].horizontalBorders.get(row + (hasContent ? 1 : 0)).set(j, getCollapsedBorder(currentRow[col].getBorders()[2], borders[2])); } } >>>>>>> // TODO // if (null != cellSplit) { // for (int j = col; j < col + cellOverflow.getPropertyAsInteger(Property.COLSPAN); j++) { // splitResult[0].horizontalBorders.get(row + (hasContent ? 1 : 0)).set(j, getCollapsedBorder(currentRow[col].getBorders()[2], borders[2])); // } // } <<<<<<< // TODO // for (int j = col; j < col + currentRow[col].getPropertyAsInteger(Property.COLSPAN); j++) { // horizontalBorders.get(row + (hasContent ? 1 : 0)).set(j, currentRow[col].getBorders()[2]); // } ======= for (int j = col; j < col + currentRow[col].getPropertyAsInteger(Property.COLSPAN); j++) { horizontalBorders.get(row + (hasContent ? 1 : 0)).set(j, getCollapsedBorder(currentRow[col].getBorders()[2], borders[2])); } >>>>>>> // TODO // for (int j = col; j < col + currentRow[col].getPropertyAsInteger(Property.COLSPAN); j++) { // horizontalBorders.get(row + (hasContent ? 1 : 0)).set(j, getCollapsedBorder(currentRow[col].getBorders()[2], borders[2])); // } <<<<<<< ======= // important to invoke on each new page private void updateFirstRowBorders(int colN) { int col = 0; int row = 0; List<Border> topBorders = horizontalBorders.get(0); topBorders.clear(); while (col < colN) { if (null != rows.get(row)[col]) { // we may have deleted collapsed border property trying to process the row as last on the page Border collapsedBottomBorder = null; int colspan = (int) rows.get(row)[col].getPropertyAsInteger(Property.COLSPAN); for (int i = col; i < col + colspan; i++) { topBorders.add(rows.get(row)[col].getBorders()[0]); collapsedBottomBorder = getCollapsedBorder(collapsedBottomBorder, horizontalBorders.get(row + 1).get(i)); } rows.get(row)[col].setBorders(collapsedBottomBorder, 2); col += colspan; row = 0; } else { if (0 == row) { horizontalBorders.get(1).set(col, Border.NO_BORDER); } row++; if (row == rows.size()) { break; } } } } // collapse with table border or header bottom borders private void correctFirstRowTopBorders(Border tableBorder, int colN) { int col = 0; int row = 0; List<Border> topBorders = horizontalBorders.get(0); List<Border> bordersToBeCollapsedWith = null != headerRenderer ? headerRenderer.horizontalBorders.get(headerRenderer.horizontalBorders.size() - 1) : new ArrayList<Border>(); if (null == headerRenderer) { for (col = 0; col < colN; col++) { bordersToBeCollapsedWith.add(tableBorder); } } col = 0; while (col < colN) { if (null != rows.get(row)[col] && row + 1 <= (int) rows.get(row)[col].getPropertyAsInteger(Property.ROWSPAN)) { Border oldTopBorder = rows.get(row)[col].getBorders()[0]; Border resultCellTopBorder = null; Border collapsedBorder = null; int colspan = (int) rows.get(row)[col].getPropertyAsInteger(Property.COLSPAN); for (int i = col; i < col + colspan; i++) { collapsedBorder = getCollapsedBorder(oldTopBorder, bordersToBeCollapsedWith.get(i)); if (null == topBorders.get(i) || (null != collapsedBorder && topBorders.get(i).getWidth() < collapsedBorder.getWidth())) { topBorders.set(i, collapsedBorder); } if (null == resultCellTopBorder || (null != collapsedBorder && resultCellTopBorder.getWidth() < collapsedBorder.getWidth())) { resultCellTopBorder = collapsedBorder; } } rows.get(row)[col].setBorders(resultCellTopBorder, 0); col += colspan; row = 0; } else { row++; if (row == rows.size()) { break; } } } if (null != headerRenderer) { headerRenderer.horizontalBorders.set(headerRenderer.horizontalBorders.size() - 1, topBorders); } } private void collapseAllBordersAndEmptyRows(Border[] tableBorders, int startRow, int finishRow, int colN) { CellRenderer[] currentRow; int[] rowsToDelete = new int[colN]; for (int row = startRow; row <= finishRow; row++) { currentRow = rows.get(row); boolean hasCells = false; for (int col = 0; col < colN; col++) { if (null != currentRow[col]) { int colspan = (int) currentRow[col].getPropertyAsInteger(Property.COLSPAN); prepareBuildingBordersArrays(currentRow[col], tableBorders, colN, row, col); buildBordersArrays(currentRow[col], row, col); hasCells = true; if (rowsToDelete[col] > 0) { int rowspan = (int) currentRow[col].getPropertyAsInteger(Property.ROWSPAN) - rowsToDelete[col]; if (rowspan < 1) { Logger logger = LoggerFactory.getLogger(TableRenderer.class); logger.warn(LogMessageConstant.UNEXPECTED_BEHAVIOUR_DURING_TABLE_ROW_COLLAPSING); rowspan = 1; } currentRow[col].setProperty(Property.ROWSPAN, rowspan); } for (int i = 0; i < colspan; i++) { rowsToDelete[col + i] = 0; } col += colspan - 1; } else { if (horizontalBorders.get(row).size() <= col) { horizontalBorders.get(row).add(null); } } } if (!hasCells) { rows.remove(currentRow); row--; finishRow--; for (int i = 0; i < colN; i++) { rowsToDelete[i]++; } if (row == finishRow) { Logger logger = LoggerFactory.getLogger(TableRenderer.class); logger.warn(LogMessageConstant.LAST_ROW_IS_NOT_COMPLETE); } } } } private void initializeBorders(List<Border> lastFlushedRowBottomBorder, boolean isFirstOnPage) { // initialize borders if (null == horizontalBorders) { horizontalBorders = new ArrayList<>(); horizontalBorders.add(new ArrayList<Border>(lastFlushedRowBottomBorder)); verticalBorders = new ArrayList<>(); } // The first row on the page shouldn't collapse with the last on the previous one if (0 != lastFlushedRowBottomBorder.size() && isFirstOnPage) { horizontalBorders.get(0).clear(); } } private float getMaxTopWidth(Border tableTopBorder) { float width = null == tableTopBorder ? 0 : tableTopBorder.getWidth(); List<Border> topBorders = horizontalBorders.get(0); if (0 != topBorders.size()) { for (Border border : topBorders) { if (null != border) { if (border.getWidth() > width) { width = border.getWidth(); } } } } return width; } private float getMaxRightWidth(Border tableRightBorder) { float width = null == tableRightBorder ? 0 : tableRightBorder.getWidth(); if (0 != verticalBorders.size()) { List<Border> rightBorders = verticalBorders.get(verticalBorders.size() - 1); if (0 != rightBorders.size()) { for (Border border : rightBorders) { if (null != border) { if (border.getWidth() > width) { width = border.getWidth(); } } } } } return width; } private float getMaxLeftWidth(Border tableLeftBorder) { float width = null == tableLeftBorder ? 0 : tableLeftBorder.getWidth(); if (0 != verticalBorders.size()) { List<Border> leftBorders = verticalBorders.get(0); if (0 != leftBorders.size()) { for (Border border : leftBorders) { if (null != border) { if (border.getWidth() > width) { width = border.getWidth(); } } } } } return width; } private boolean[] collapseFooterBorders(List<Border> tableBottomBorders, int colNum, int rowNum) { boolean[] useFooterBorders = new boolean[colNum]; int row = 0; int col = 0; while (col < colNum) { if (null != footerRenderer.rows.get(row)[col]) { Border oldBorder = footerRenderer.rows.get(row)[col].getBorders()[0]; Border maxBorder = oldBorder; for (int k = col; k < col + footerRenderer.rows.get(row)[col].getModelElement().getColspan(); k++) { Border collapsedBorder = tableBottomBorders.get(k); if (null != collapsedBorder && (null == oldBorder || collapsedBorder.getWidth() >= oldBorder.getWidth())) { if (null == maxBorder || maxBorder.getWidth() < collapsedBorder.getWidth()) { maxBorder = collapsedBorder; } } else { useFooterBorders[k] = true; } } footerRenderer.rows.get(row)[col].setBorders(maxBorder, 0); col += footerRenderer.rows.get(row)[col].getModelElement().getColspan(); row = 0; } else { row++; if (row == rowNum) { break; } } } return useFooterBorders; } private void fixFooterBorders(List<Border> tableBottomBorders, int colNum, int rowNum, boolean[] useFooterBorders) { int j = 0; int i = 0; while (i < colNum) { if (null != footerRenderer.rows.get(j)[i]) { for (int k = i; k < i + footerRenderer.rows.get(j)[i].getModelElement().getColspan(); k++) { if (!useFooterBorders[k]) { footerRenderer.horizontalBorders.get(j).set(k, tableBottomBorders.get(k)); } } i += footerRenderer.rows.get(j)[i].getModelElement().getColspan(); j = 0; } else { j++; if (j == rowNum) { break; } } } } >>>>>>>
<<<<<<< <T1> T1 getProperty(Property property); ======= <T> T getProperty(int property); >>>>>>> <T1> T1 getProperty(int property); <<<<<<< <T1> T1 getOwnProperty(Property property); ======= <T> T getOwnProperty(int property); >>>>>>> <T1> T1 getOwnProperty(int property); <<<<<<< <T1> T1 getDefaultProperty(Property property); ======= <T> T getDefaultProperty(int property); >>>>>>> <T1> T1 getDefaultProperty(int property); <<<<<<< void setProperty(Property property, Object value); ======= <T extends Type> T setProperty(int property, Object value); >>>>>>> void setProperty(int property, Object value);
<<<<<<< import com.itextpdf.kernel.colors.Color; ======= import com.itextpdf.kernel.color.ColorConstants; >>>>>>> import com.itextpdf.kernel.colors.ColorConstants; <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); <<<<<<< doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(Color.ORANGE, 2)).addCell("Is my occupied area correct?")); ======= doc.add(new Table(1).setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?")); >>>>>>> doc.add(new Table(UnitValue.createPercentArray(1)).useAllAvailableWidth().setBorder(new SolidBorder(ColorConstants.ORANGE, 2)).addCell("Is my occupied area correct?"));
<<<<<<< import com.itextpdf.kernel.color.Color; import com.itextpdf.kernel.geom.Rectangle; import com.itextpdf.kernel.pdf.annot.PdfTextAnnotation; import com.itextpdf.kernel.pdf.canvas.PdfCanvas; import com.itextpdf.kernel.pdf.filespec.PdfFileSpec; ======= import com.itextpdf.kernel.font.PdfFontFactory; import com.itextpdf.kernel.pdf.canvas.PdfCanvas; >>>>>>> import com.itextpdf.kernel.color.Color; import com.itextpdf.kernel.geom.Rectangle; import com.itextpdf.kernel.pdf.annot.PdfTextAnnotation; import com.itextpdf.kernel.font.PdfFontFactory; import com.itextpdf.kernel.pdf.canvas.PdfCanvas; import com.itextpdf.kernel.pdf.filespec.PdfFileSpec;
<<<<<<< public <T1> T1 getDefaultProperty(Property property) { ======= public <T> T getDefaultProperty(int property) { >>>>>>> public <T1> T1 getDefaultProperty(int property) { <<<<<<< case HORIZONTAL_SCALING: return (T1) Float.valueOf(1); ======= case Property.HORIZONTAL_SCALING: return (T) Float.valueOf(1); >>>>>>> case Property.HORIZONTAL_SCALING: return (T1) Float.valueOf(1);
<<<<<<< public SSLContext create(List<Path> pathCertificates, Path pathPrivateKey) throws Exception { X509Certificate[] chain = pathCertificates.stream().map(path -> { ======= public SSLContext create(List<Path> pathCertificate, Path pathPrivateKey, List<Path> pathTrustAnchors) throws Exception { X509Certificate[] chain = pathCertificate.stream().map((path) -> { >>>>>>> public SSLContext create(List<Path> pathCertificates, Path pathPrivateKey, List<Path> pathTrustAnchors) throws Exception { X509Certificate[] chain = pathCertificates.stream().map((path) -> { <<<<<<< private static X509Certificate generateCertificateFromDER(Path path) throws CertificateException, IOException { return generateCertificateFromDER(Files.readAllBytes(path)); } ======= private static TrustManager[] getTrustManagers(KeyStore trustStore) throws NoSuchAlgorithmException, KeyStoreException { if (trustStore == null) { return null; } TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); tmf.init(trustStore); return tmf.getTrustManagers(); } >>>>>>> private static X509Certificate generateCertificateFromDER(Path path) throws CertificateException, IOException { return generateCertificateFromDER(Files.readAllBytes(path)); } private static TrustManager[] getTrustManagers(KeyStore trustStore) throws NoSuchAlgorithmException, KeyStoreException { if (trustStore == null) { return null; } TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); tmf.init(trustStore); return tmf.getTrustManagers(); }
<<<<<<< public <T1> T1 getDefaultProperty(Property property) { ======= public <T> T getDefaultProperty(int property) { >>>>>>> public <T1> T1 getDefaultProperty(int property) { <<<<<<< case LIST_SYMBOL_PRE_TEXT: return (T1) ""; case LIST_SYMBOL_POST_TEXT: return (T1) ". "; ======= case Property.LIST_SYMBOL_PRE_TEXT: return (T) ""; case Property.LIST_SYMBOL_POST_TEXT: return (T) ". "; >>>>>>> case Property.LIST_SYMBOL_PRE_TEXT: return (T1) ""; case Property.LIST_SYMBOL_POST_TEXT: return (T1) ". ";
<<<<<<< public <T1> T1 getDefaultProperty(Property property) { ======= public <T> T getDefaultProperty(int property) { >>>>>>> public <T1> T1 getDefaultProperty(int property) { <<<<<<< case BORDER: return (T1) DEFAULT_BORDER; case PADDING_BOTTOM: case PADDING_LEFT: case PADDING_RIGHT: case PADDING_TOP: return (T1) Float.valueOf(2); ======= case Property.BORDER: return (T) DEFAULT_BORDER; case Property.PADDING_BOTTOM: case Property.PADDING_LEFT: case Property.PADDING_RIGHT: case Property.PADDING_TOP: return (T) Float.valueOf(2); >>>>>>> case Property.BORDER: return (T1) DEFAULT_BORDER; case Property.PADDING_BOTTOM: case Property.PADDING_LEFT: case Property.PADDING_RIGHT: case Property.PADDING_TOP: return (T1) Float.valueOf(2);
<<<<<<< public Paragraph setFixedLeading(float leading) { setProperty(Property.LEADING, new Property.Leading(Property.Leading.FIXED, leading)); return this; ======= public <T extends Paragraph> T setFixedLeading(float leading) { setProperty(Property.LEADING, new Leading(Leading.FIXED, leading)); return (T) this; >>>>>>> public Paragraph setFixedLeading(float leading) { setProperty(Property.LEADING, new Leading(Leading.FIXED, leading)); return this; <<<<<<< public Paragraph setMultipliedLeading(float leading) { setProperty(Property.LEADING, new Property.Leading(Property.Leading.MULTIPLIED, leading)); return this; ======= public <T extends Paragraph> T setMultipliedLeading(float leading) { setProperty(Property.LEADING, new Leading(Leading.MULTIPLIED, leading)); return (T) this; >>>>>>> public Paragraph setMultipliedLeading(float leading) { setProperty(Property.LEADING, new Leading(Leading.MULTIPLIED, leading)); return this;
<<<<<<< * If {@param keepWaiting} is true then a newly created tag will retain the connection with given ======= * If {@code keepConnectedToTag} is true then a newly created tag will retain the connection with given >>>>>>> * If {@code keepWaiting} is true then a newly created tag will retain the connection with given