conflict_resolution
stringlengths
27
16k
<<<<<<< Accumulator.accumulate( ======= accumulators.accumulate( executor, >>>>>>> Accumulator.accumulate( executor,
<<<<<<< import java.util.function.Function; ======= import java.io.Serializable; >>>>>>> import java.io.Serializable; import java.util.function.Function; <<<<<<< * @version 1.6 &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> <<<<<<< * @deprecated Use {@link #of(Genotype, java.util.function.Function, java.util.function.Function, int)} * instead. */ @Deprecated public static <G extends Gene<?, G>, C extends Comparable<? super C>> Phenotype<G, C> valueOf( final Genotype<G> genotype, final Function<Genotype<G>, C> fitnessFunction, final int generation ) { return of(genotype, fitnessFunction, generation); } /** ======= >>>>>>> <<<<<<< * XML object serialization * ************************************************************************/ @SuppressWarnings({ "unchecked", "rawtypes" }) static final XMLFormat<Phenotype> XML = new XMLFormat<Phenotype>(Phenotype.class) { private static final String GENERATION = "generation"; private static final String FITNESS = "fitness"; private static final String RAW_FITNESS = "raw-fitness"; @Override public Phenotype newInstance( final Class<Phenotype> cls, final InputElement xml ) throws XMLStreamException { final int generation = xml.getAttribute(GENERATION, 0); final Genotype genotype = xml.getNext(); final Phenotype pt = new Phenotype( genotype, a -> a, a -> a, generation ); pt._fitness = xml.get(FITNESS); pt._rawFitness = xml.get(RAW_FITNESS); return pt; } @Override public void write(final Phenotype pt, final OutputElement xml) throws XMLStreamException { xml.setAttribute(GENERATION, pt._generation); xml.add(pt._genotype); xml.add(pt.getFitness(), FITNESS); xml.add(pt.getRawFitness(), RAW_FITNESS); } @Override public void read(final InputElement xml, final Phenotype gt) { } }; /* ************************************************************************* ======= >>>>>>> <<<<<<< Genotype.Model.Adapter.unmarshal(m.genotype), a -> a, a -> a, ======= Genotype.Model.ADAPTER.unmarshal(m.genotype), functions.Identity(), functions.Identity(), >>>>>>> Genotype.Model.ADAPTER.unmarshal(m.genotype), a -> a, a -> a,
<<<<<<< * @version 2.0 &mdash; <em>$Date: 2014-04-16 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-07-10 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-07-11 $</em> <<<<<<< /** * <p> * <img * src="doc-files/uniform-pdf.gif" * alt="f(x)=\left\{\begin{matrix} * \frac{1}{max-min} & for & x \in [min, max] \\ * 0 & & otherwise \\ * \end{matrix}\right." * > * </p> * * @author <a href="mailto:[email protected]">Franz Wilhelmstötter</a> * @since 1.0 * @version 2.0 &mdash; <em>$Date: 2014-04-16 $</em> */ static final class PDF<N extends Number & Comparable<? super N>> implements Function<N, Double>, Serializable { private static final long serialVersionUID = 2L; private final double _min; private final double _max; private final Double _probability; public PDF(final Range<N> domain) { _min = domain.getMin().doubleValue(); _max = domain.getMax().doubleValue(); _probability = 1.0/(_max - _min); } @Override public Double apply(final N value) { final double x = value.doubleValue(); double result = 0.0; if (x >= _min && x <= _max) { result = _probability; } return result; } @Override public String toString() { return format(Locale.ENGLISH, "p(x) = %s", _probability); } } /** * <p> * <img * src="doc-files/uniform-cdf.gif" * alt="f(x)=\left\{\begin{matrix} * 0 & for & x < min \\ * \frac{x-min}{max-min} & for & x \in [min, max] \\ * 1 & for & x > max \\ * \end{matrix}\right." * > * </p> * * @author <a href="mailto:[email protected]">Franz Wilhelmstötter</a> * @since 1.0 * @version 2.0 &mdash; <em>$Date: 2014-04-16 $</em> */ static final class CDF<N extends Number & Comparable<? super N>> implements Function<N, Double>, Serializable { private static final long serialVersionUID = 2L; private final double _min; private final double _max; private final double _divisor; public CDF(final Range<N> domain) { _min = domain.getMin().doubleValue(); _max = domain.getMax().doubleValue(); _divisor = _max - _min; assert (_divisor > 0); } @Override public Double apply(final N value) { final double x = value.doubleValue(); double result = 0.0; if (x < _min) { result = 0.0; } else if (x > _max) { result = 1.0; } else { result = (x - _min)/_divisor; } return result; } @Override public String toString() { return format( Locale.ENGLISH, "P(x) = (x - %1$s)/(%2$s - %1$s)", _min, _max ); } } ======= >>>>>>>
<<<<<<< /* * Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source ======= /** * Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source >>>>>>> /* * Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
<<<<<<< /* * Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source ======= /** * Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source >>>>>>> /* * Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
<<<<<<< import org.jenetics.util.Accumulator.MinMax; import org.jenetics.util.IO; import org.jenetics.util.LCG64ShiftRandom; ======= >>>>>>> <<<<<<< ======= import org.jenetics.util.Scoped; import org.jenetics.util.accumulators.MinMax; >>>>>>> import org.jenetics.util.Scoped; import org.jenetics.util.accumulators.MinMax; <<<<<<< * @version <em>$Date: 2013-09-10 $</em> ======= * @version <em>$Date: 2014-02-15 $</em> >>>>>>> * @version <em>$Date: 2014-03-07 $</em> <<<<<<< public void objectSerializationCompatibility() throws IOException { final Random random = new LCG64ShiftRandom.ThreadSafe(0); LocalContext.enter(); try { RandomRegistry.setRandom(random); final Object chromosome = new Integer64Chromosome(Integer.MIN_VALUE, Integer.MAX_VALUE, 500); final String resource = "/org/jenetics/Integer64Chromosome.object"; try (InputStream in = getClass().getResourceAsStream(resource)) { final Object object = IO.object.read(in); Assert.assertEquals(object, chromosome); } } finally { LocalContext.exit(); } } @Test public void xmlSerializationCompatibility() throws IOException { final Random random = new LCG64ShiftRandom.ThreadSafe(0); LocalContext.enter(); try { RandomRegistry.setRandom(random); final Object chromosome = new Integer64Chromosome(Integer.MIN_VALUE, Integer.MAX_VALUE, 500); final String resource = "/org/jenetics/Integer64Chromosome.xml"; try (InputStream in = getClass().getResourceAsStream(resource)) { final Object object = IO.xml.read(in); Assert.assertEquals(object, chromosome); } } finally { LocalContext.exit(); } } private static String Source = "/home/fwilhelm/Workspace/Development/Projects/Jenetics/" + "org.jenetics/src/test/resources/org/jenetics/"; public static void main(final String[] args) throws Exception { final Random random = new LCG64ShiftRandom.ThreadSafe(0); LocalContext.enter(); try { RandomRegistry.setRandom(random); Object c = new Integer64Chromosome(Integer.MIN_VALUE, Integer.MAX_VALUE, 500); IO.xml.write(c, Source + "Integer64Chromosome.xml"); IO.object.write(c, Source + "Integer64Chromosome.object"); } finally { LocalContext.exit(); } } } ======= public void firstGeneConverter() { final Integer64Chromosome c = getFactory().newInstance(); Assert.assertEquals(Integer64Chromosome.Gene.apply(c), c.getGene(0)); } @Test public void geneConverter() { final Integer64Chromosome c = getFactory().newInstance(); for (int i = 0; i < c.length(); ++i) { Assert.assertEquals( Integer64Chromosome.Gene(i).apply(c), c.getGene(i) ); } } @Test public void genesConverter() { final Integer64Chromosome c = getFactory().newInstance(); Assert.assertEquals( Integer64Chromosome.Genes.apply(c), c.toSeq() ); } } >>>>>>> public void firstGeneConverter() { final Integer64Chromosome c = getFactory().newInstance(); Assert.assertEquals(Integer64Chromosome.Gene.apply(c), c.getGene(0)); } @Test public void geneConverter() { final Integer64Chromosome c = getFactory().newInstance(); for (int i = 0; i < c.length(); ++i) { Assert.assertEquals( Integer64Chromosome.Gene(i).apply(c), c.getGene(i) ); } } @Test public void genesConverter() { final Integer64Chromosome c = getFactory().newInstance(); Assert.assertEquals( Integer64Chromosome.Genes.apply(c), c.toSeq() ); } }
<<<<<<< if (parameter == null) { parameter = derivative.getParameter(); } Transform transform = (Transform) xo.getChild(Transform.class); ======= Transform transform = parseTransform(xo); >>>>>>> if (parameter == null) { parameter = derivative.getParameter(); } Transform transform = parseTransform(xo);
<<<<<<< * @version 1.0 &mdash; <em>$Date: 2013-09-10 $</em> ======= * @version 1.0 &mdash; <em>$Date: 2013-12-02 $</em> >>>>>>> * @version 1.0 &mdash; <em>$Date: 2013-12-18 $</em> <<<<<<< ======= * Return an alterer which does nothing. * * @return an alterer which does nothing. */ public static <G extends Gene<?, G>> Alterer<G> Null() { return new Alterer<G>() { @Override public <C extends Comparable<? super C>> int alter( final Population<G, C> population, final int generation ) { return 0; } @Override public int hashCode() { return hashCodeOf(getClass()).value(); } @Override public boolean equals(final Object obj) { return obj == this || obj != null && obj.getClass() == getClass(); } @Override public String toString() { return "Alterer.Null"; } }; } public static final double DEFAULT_ALTER_PROBABILITY = 0.2; /** >>>>>>>
<<<<<<< import static org.jenetics.internal.math.arithmetic.normalize; import static org.jenetics.internal.util.array.shuffle; ======= >>>>>>> import static org.jenetics.internal.math.arithmetic.normalize; import static org.jenetics.internal.util.array.shuffle; <<<<<<< * @version <em>$Date: 2014-08-26 $</em> ======= * @version <em>$Date: 2014-08-27 $</em> >>>>>>> * @version <em>$Date: 2014-08-27 $</em> <<<<<<< ======= public static void shuffle(final double[] array, final Random random) { for (int i = array.length; --i >=0;) { swap(array, i, random.nextInt(array.length)); } } public static void swap(final double[] array, final int i, final int j) { final double temp = array[i]; array[i] = array[j]; array[j] = temp; } >>>>>>>
<<<<<<< import java.util.function.Supplier; ======= import java.io.Serializable; >>>>>>> import java.util.function.Supplier; import java.io.Serializable; <<<<<<< * @version 1.6 &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-03-30 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> <<<<<<< /** * Create a new chromosome with the {@link CharacterGene#DEFAULT_CHARACTERS} * char set as valid characters. * * @param length the {@code length} of the new chromosome. * @throws IllegalArgumentException if the {@code length} is smaller than * one. * * @deprecated Use {@link #of(int)} instead. */ @Deprecated public CharacterChromosome(final int length) { this(DEFAULT_CHARACTERS, length); } /** * Create a new chromosome from the given genes (given as string). * * @param genes the character genes. * @param validCharacters the valid characters. * @throws IllegalArgumentException if the genes string is empty. * * @deprecated Use {@link #of(String, org.jenetics.util.CharSeq)} instead. */ @Deprecated public CharacterChromosome(final String genes, final CharSeq validCharacters) { super( new Array<CharacterGene>(genes.length()).fill(new Supplier<CharacterGene>() { private int _index = 0; @Override public CharacterGene get() { return CharacterGene.of( genes.charAt(_index++), validCharacters ); } }).toISeq() ); _validCharacters = validCharacters; } /** * Create a new chromosome from the given genes (given as string). * * @param genes the character genes. * @throws IllegalArgumentException if the genes string is empty. * * @deprecated Use {@link #of(String)} instead. */ @Deprecated public CharacterChromosome(final String genes) { this(genes, DEFAULT_CHARACTERS); } /** * Return a more specific view of this chromosome factory. * * @return a more specific view of this chromosome factory. * * @deprecated No longer needed after adding new factory methods to the * {@link Array} class. */ @Deprecated @SuppressWarnings("unchecked") public Factory<CharacterChromosome> asFactory() { return (Factory<CharacterChromosome>)(Object)this; } ======= >>>>>>> <<<<<<< ======= /* ************************************************************************* * Property access methods * ************************************************************************/ /** * Return a {@link Function} which returns the gene array from this * {@link Chromosome}. */ public static final Function<Chromosome<CharacterGene>, ISeq<CharacterGene>> Genes = AbstractChromosome.genes(); /** * Return a {@link Function} which returns the first {@link Gene} from this * {@link Chromosome}. */ public static final Function<Chromosome<CharacterGene>, CharacterGene> Gene = AbstractChromosome.gene(); /** * Return a {@link Function} which returns the {@link Gene} with the given * {@code index} from this {@link Chromosome}. * * @param index the gene index within the chromosome * @return a function witch returns the gene at the given index */ public static Function<Chromosome<CharacterGene>, CharacterGene> Gene(final int index) { return AbstractChromosome.gene(index); } >>>>>>>
<<<<<<< ======= import static java.lang.String.format; import static java.util.Objects.requireNonNull; import static org.jenetics.util.functions.Null; import static org.jenetics.util.object.Verify; >>>>>>> <<<<<<< * @version 1.0 &mdash; <em>$Date: 2013-07-12 $</em> ======= * @version 1.0 &mdash; <em>$Date: 2013-09-01 $</em> >>>>>>> * @version 1.0 &mdash; <em>$Date: 2013-09-08 $</em>
<<<<<<< /* * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source ======= /** * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source >>>>>>> /* * Copyright (C) 2012-2017 52°North Initiative for Geospatial Open Source <<<<<<< import org.n52.svalbard.util.GmlHelper; ======= import org.n52.sos.exception.CodedException; import org.n52.sos.ogc.gml.time.TimeInstant; import org.n52.sos.ogc.om.StreamingValue; import org.n52.sos.ogc.ows.OwsExceptionReport; import org.n52.sos.request.AbstractObservationRequest; import org.n52.sos.request.GetObservationRequest; import org.n52.sos.util.GmlHelper; >>>>>>> import org.n52.svalbard.util.GmlHelper; <<<<<<< public HibernateSeriesStreamingValue(ConnectionProvider connectionProvider, DaoFactory daoFactory, GetObservationRequest request, long series) throws OwsExceptionReport { super(connectionProvider, daoFactory, request); this.series = series; this.seriesValueDAO = daoFactory.getValueDAO(); this.seriesValueTimeDAO = daoFactory.getValueTimeDAO(); ======= public HibernateSeriesStreamingValue(AbstractObservationRequest request, long series, boolean duplicated) throws CodedException { super(request); this.series.add(series); this.duplicated = duplicated; this.seriesValueDAO = DaoFactory.getInstance().getValueDAO(); this.seriesValueTimeDAO = DaoFactory.getInstance().getValueTimeDAO(); >>>>>>> public HibernateSeriesStreamingValue(ConnectionProvider connectionProvider, DaoFactory daoFactory, GetObservationRequest request, long series, boolean duplicated) throws OwsExceptionReport { super(connectionProvider, daoFactory, request); this.series = series; this.seriesValueDAO = daoFactory.getValueDAO(); this.seriesValueTimeDAO = daoFactory.getValueTimeDAO(); this.duplicated = duplicated;
<<<<<<< * @version 1.0 &mdash; <em>$Date: 2013-02-13 $</em> ======= * @version 1.0 &mdash; <em>$Date: 2013-03-06 $</em> >>>>>>> * @version 1.0 &mdash; <em>$Date: 2013-03-26 $</em> <<<<<<< ======= interface Function2<T1, T2, R> { R apply(T1 t1, T2 t2); } */ @Override public boolean contains(final Object element) { return indexOf(element) != -1; } >>>>>>>
<<<<<<< * @version <em>$Date: 2014-01-20 $</em> ======= * @version <em>$Date: 2014-08-01 $</em> >>>>>>> * @version <em>$Date: 2014-12-28 $</em> <<<<<<< ======= public void sameByteLongValueSequence(final Random rand1, final Random rand2) { final byte[] bytes = new byte[8]; for (int i = 0; i < 1234; ++i) { rand1.nextBytes(bytes); org.jenetics.internal.util.bit.reverse(bytes); Assert.assertEquals(org.jenetics.internal.util.bit.toLong(bytes), rand2.nextLong()); } } @Test(dataProvider = "seededPRNGPair") >>>>>>> public void sameByteLongValueSequence(final Random rand1, final Random rand2) { final byte[] bytes = new byte[8]; for (int i = 0; i < 1234; ++i) { rand1.nextBytes(bytes); org.jenetics.internal.util.bit.reverse(bytes); Assert.assertEquals(org.jenetics.internal.util.bit.toLong(bytes), rand2.nextLong()); } } @Test(dataProvider = "seededPRNGPair")
<<<<<<< import dr.evolution.datatype.*; import dr.evolution.tree.*; ======= >>>>>>> import dr.evolution.datatype.*; import dr.evolution.tree.*;
<<<<<<< import org.jenetics.util.Accumulator.MinMax; ======= >>>>>>> import org.jenetics.util.Accumulator.MinMax; <<<<<<< * @version <em>$Date: 2013-03-26 $</em> ======= * @version <em>$Date: 2013-09-01 $</em> >>>>>>> * @version <em>$Date: 2013-09-08 $</em>
<<<<<<< import org.jenetics.util.IO; import org.jenetics.util.LCG64ShiftRandom; import org.jenetics.util.RandomRegistry; import org.jenetics.util.Scoped; ======= >>>>>>> import org.jenetics.util.IO; import org.jenetics.util.LCG64ShiftRandom; import org.jenetics.util.RandomRegistry; import org.jenetics.util.Scoped; <<<<<<< * @version <em>$Date: 2014-02-04 $</em> ======= * @version <em>$Date: 2014-02-15 $</em> >>>>>>> * @version <em>$Date: 2014-02-15 $</em> <<<<<<< @Test public void objectSerializationCompatibility() throws IOException { final Random random = new LCG64ShiftRandom.ThreadSafe(0); try (Scoped<Random> scope = RandomRegistry.with(random)) { final BitChromosome chromosome = new BitChromosome(5000, 0.5); final String resource = "/org/jenetics/BitChromosome.object"; try (InputStream in = getClass().getResourceAsStream(resource)) { final Object object = IO.object.read(in); Assert.assertEquals(chromosome, object); } } } @Test public void xmlSerializationCompatibility() throws IOException { final Random random = new LCG64ShiftRandom.ThreadSafe(0); try (Scoped<Random> scope = RandomRegistry.with(random)) { final BitChromosome chromosome = new BitChromosome(5000, 0.5); final String resource = "/org/jenetics/BitChromosome.xml"; try (InputStream in = getClass().getResourceAsStream(resource)) { final Object object = IO.xml.read(in); Assert.assertEquals(chromosome, object); } } } } ======= } >>>>>>> }
<<<<<<< * @version 1.0 &mdash; <em>$Date: 2013-12-18 $</em> ======= * @version 1.6 &mdash; <em>$Date: 2014-03-04 $</em> >>>>>>> * @version 1.6 &mdash; <em>$Date: 2014-03-07 $</em> <<<<<<< public CharacterChromosome(final int length) { super( new Array<CharacterGene>(length).fill( () -> CharacterGene.valueOf(CharacterGene.DEFAULT_CHARACTERS) ).toISeq() ); _validCharacters = CharacterGene.DEFAULT_CHARACTERS; _valid = true; ======= @Deprecated public CharacterChromosome(final ISeq<CharacterGene> genes) { super(genes); _validCharacters = genes.get(0).getValidCharacters(); >>>>>>> @Deprecated public CharacterChromosome(final ISeq<CharacterGene> genes) { super(genes); _validCharacters = genes.get(0).getValidCharacters(); <<<<<<< super( new Array<CharacterGene>(length).fill( () -> CharacterGene.valueOf(validCharacters) ).toISeq() ); _validCharacters = validCharacters; ======= this(CharacterGene.seq(validCharacters, length)); >>>>>>> this(CharacterGene.seq(validCharacters, length)); <<<<<<< @Override public CharacterGene get() { final char c = genes.charAt(_index++); if (!validCharacters.contains(c)) { throw new IllegalArgumentException(format( "Character '%s' not in valid characters %s", c, validCharacters )); } return CharacterGene.valueOf(c, validCharacters); ======= @Override public CharacterGene newInstance() { return CharacterGene.of( genes.charAt(_index++), validCharacters ); >>>>>>> @Override public CharacterGene newInstance() { return CharacterGene.of( genes.charAt(_index++), validCharacters ); <<<<<<< ======= /** * Create a new chromosome with the {@link CharacterGene#DEFAULT_CHARACTERS} * char set as valid characters. * * @param length the {@code length} of the new chromosome. * @throws IllegalArgumentException if the {@code length} is smaller than * one. */ public static CharacterChromosome of(final int length) { return new CharacterChromosome( CharacterGene.seq(DEFAULT_CHARACTERS, length) ); } /** * Create a new chromosome from the given genes (given as string). * * @param alleles the character genes. * @param validChars the valid characters. * @throws IllegalArgumentException if the genes string is empty. */ public static CharacterChromosome of( final String alleles, final CharSeq validChars ) { final Array<CharacterGene> genes = new Array<>(alleles.length()); genes.fill(GeneFactory(alleles, validChars)); return new CharacterChromosome(genes.toISeq()); } private static Factory<CharacterGene> GeneFactory(final String alleles, final CharSeq validChars) { return new Factory<CharacterGene>() { private int _index = 0; @Override public CharacterGene newInstance() { return CharacterGene.of( alleles.charAt(_index++), validChars ); } }; } /** * Create a new chromosome from the given genes (given as string). * * @param alleles the character genes. * @throws IllegalArgumentException if the genes string is empty. */ public static CharacterChromosome of(final String alleles) { return of(alleles, DEFAULT_CHARACTERS); } /* ************************************************************************* * Property access methods * ************************************************************************/ /** * Return a {@link Function} which returns the gene array from this * {@link Chromosome}. */ public static final Function<Chromosome<CharacterGene>, ISeq<CharacterGene>> Genes = AbstractChromosome.genes(); /** * Return a {@link Function} which returns the first {@link Gene} from this * {@link Chromosome}. */ public static final Function<Chromosome<CharacterGene>, CharacterGene> Gene = AbstractChromosome.gene(); /** * Return a {@link Function} which returns the {@link Gene} with the given * {@code index} from this {@link Chromosome}. */ public static Function<Chromosome<CharacterGene>, CharacterGene> Gene(final int index) { return AbstractChromosome.gene(index); } /* ************************************************************************* * Java object serialization * ************************************************************************/ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.writeInt(length()); out.writeObject(_validCharacters); for (CharacterGene gene : _genes) { out.writeChar(gene.getAllele().charValue()); } } private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final int length = in.readInt(); _validCharacters = (CharSeq)in.readObject(); final Array<CharacterGene> genes = new Array<>(length); for (int i = 0; i < length; ++i) { final CharacterGene gene = CharacterGene.of( in.readChar(), _validCharacters ); genes.set(i, gene); } _genes = genes.toISeq(); } >>>>>>> /** * Create a new chromosome with the {@link CharacterGene#DEFAULT_CHARACTERS} * char set as valid characters. * * @param length the {@code length} of the new chromosome. * @throws IllegalArgumentException if the {@code length} is smaller than * one. */ public static CharacterChromosome of(final int length) { return new CharacterChromosome( CharacterGene.seq(DEFAULT_CHARACTERS, length) ); } /** * Create a new chromosome from the given genes (given as string). * * @param alleles the character genes. * @param validChars the valid characters. * @throws IllegalArgumentException if the genes string is empty. */ public static CharacterChromosome of( final String alleles, final CharSeq validChars ) { final Array<CharacterGene> genes = new Array<>(alleles.length()); genes.fill(GeneFactory(alleles, validChars)); return new CharacterChromosome(genes.toISeq()); } private static Factory<CharacterGene> GeneFactory(final String alleles, final CharSeq validChars) { return new Factory<CharacterGene>() { private int _index = 0; @Override public CharacterGene newInstance() { return CharacterGene.of( alleles.charAt(_index++), validChars ); } }; } /** * Create a new chromosome from the given genes (given as string). * * @param alleles the character genes. * @throws IllegalArgumentException if the genes string is empty. */ public static CharacterChromosome of(final String alleles) { return of(alleles, DEFAULT_CHARACTERS); } /* ************************************************************************* * Property access methods * ************************************************************************/ /** * Return a {@link Function} which returns the gene array from this * {@link Chromosome}. */ public static final Function<Chromosome<CharacterGene>, ISeq<CharacterGene>> Genes = AbstractChromosome.genes(); /** * Return a {@link Function} which returns the first {@link Gene} from this * {@link Chromosome}. */ public static final Function<Chromosome<CharacterGene>, CharacterGene> Gene = AbstractChromosome.gene(); /** * Return a {@link Function} which returns the {@link Gene} with the given * {@code index} from this {@link Chromosome}. */ public static Function<Chromosome<CharacterGene>, CharacterGene> Gene(final int index) { return AbstractChromosome.gene(index); } /* ************************************************************************* * Java object serialization * ************************************************************************/ private void writeObject(final ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.writeInt(length()); out.writeObject(_validCharacters); for (CharacterGene gene : _genes) { out.writeChar(gene.getAllele().charValue()); } } private void readObject(final ObjectInputStream in) throws IOException, ClassNotFoundException { in.defaultReadObject(); final int length = in.readInt(); _validCharacters = (CharSeq)in.readObject(); final Array<CharacterGene> genes = new Array<>(length); for (int i = 0; i < length; ++i) { final CharacterGene gene = CharacterGene.of( in.readChar(), _validCharacters ); genes.set(i, gene); } _genes = genes.toISeq(); }
<<<<<<< import org.jenetics.util.Scoped; ======= import org.jenetics.util.Function; >>>>>>> import org.jenetics.util.Scoped; <<<<<<< * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-04-12 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-04-14 $</em> <<<<<<< a -> a, Optimize.MAXIMUM ======= functions.<C>Identity(), optimization, executor >>>>>>> a -> a, optimization, executor <<<<<<< a -> a, optimization ======= functions.<C>Identity(), optimization, Concurrency.commonPool() ); } /** * Create a new genetic algorithm. By default the GA tries to maximize the * fitness function. * * @param genotypeFactory the genotype factory this GA is working with. * @param fitnessFunction the fitness function this GA is using. * @param executor the {@link java.util.concurrent.Executor} used for * executing the parallelizable parts of the code. * @throws NullPointerException if one of the arguments is {@code null}. */ public GeneticAlgorithm( final Factory<Genotype<G>> genotypeFactory, final Function<? super Genotype<G>, ? extends C> fitnessFunction, final Executor executor ) { this( genotypeFactory, fitnessFunction, functions.<C>Identity(), Optimize.MAXIMUM, executor ); } /** * Create a new genetic algorithm. By default the GA tries to maximize the * fitness function. * * @param genotypeFactory the genotype factory this GA is working with. * @param fitnessFunction the fitness function this GA is using. * @throws NullPointerException if one of the arguments is {@code null}. */ public GeneticAlgorithm( final Factory<Genotype<G>> genotypeFactory, final Function<? super Genotype<G>, ? extends C> fitnessFunction ) { this( genotypeFactory, fitnessFunction, functions.<C>Identity(), Optimize.MAXIMUM, Concurrency.commonPool() ); } /** * Create a new genetic algorithm. By default the GA tries to maximize the * fitness function. * * @param genotypeFactory the genotype factory this GA is working with. * @param fitnessFunction the fitness function this GA is using. * @param fitnessScaler the fitness scaler this GA is using. * @param executor the {@link java.util.concurrent.Executor} used for * executing the parallelizable parts of the code. * @throws NullPointerException if one of the arguments is {@code null}. */ public GeneticAlgorithm( final Factory<Genotype<G>> genotypeFactory, final Function<? super Genotype<G>, ? extends C> fitnessFunction, final Function<? super C, ? extends C> fitnessScaler, final Executor executor ) { this( genotypeFactory, fitnessFunction, fitnessScaler, Optimize.MAXIMUM, executor >>>>>>> functions.<C>Identity(), optimization, Concurrency.commonPool() ); } /** * Create a new genetic algorithm. By default the GA tries to maximize the * fitness function. * * @param genotypeFactory the genotype factory this GA is working with. * @param fitnessFunction the fitness function this GA is using. * @param executor the {@link java.util.concurrent.Executor} used for * executing the parallelizable parts of the code. * @throws NullPointerException if one of the arguments is {@code null}. */ public GeneticAlgorithm( final Factory<Genotype<G>> genotypeFactory, final Function<? super Genotype<G>, ? extends C> fitnessFunction, final Executor executor ) { this( genotypeFactory, fitnessFunction, a -> a, Optimize.MAXIMUM, executor ); } /** * Create a new genetic algorithm. By default the GA tries to maximize the * fitness function. * * @param genotypeFactory the genotype factory this GA is working with. * @param fitnessFunction the fitness function this GA is using. * @throws NullPointerException if one of the arguments is {@code null}. */ public GeneticAlgorithm( final Factory<Genotype<G>> genotypeFactory, final Function<? super Genotype<G>, ? extends C> fitnessFunction ) { this( genotypeFactory, fitnessFunction, a -> a, Optimize.MAXIMUM, Concurrency.commonPool() ); } /** * Create a new genetic algorithm. By default the GA tries to maximize the * fitness function. * * @param genotypeFactory the genotype factory this GA is working with. * @param fitnessFunction the fitness function this GA is using. * @param fitnessScaler the fitness scaler this GA is using. * @param executor the {@link java.util.concurrent.Executor} used for * executing the parallelizable parts of the code. * @throws NullPointerException if one of the arguments is {@code null}. */ public GeneticAlgorithm( final Factory<Genotype<G>> genotypeFactory, final Function<? super Genotype<G>, ? extends C> fitnessFunction, final Function<? super C, ? extends C> fitnessScaler, final Executor executor ) { this( genotypeFactory, fitnessFunction, fitnessScaler, Optimize.MAXIMUM, executor
<<<<<<< * @version 1.0 &mdash; <em>$Date: 2013-12-18 $</em> ======= * @version 1.0 &mdash; <em>$Date: 2014-03-01 $</em> >>>>>>> * @version 1.0 &mdash; <em>$Date: 2014-03-07 $</em> <<<<<<< ======= * Return an alterer which does nothing. * * @return an alterer which does nothing. */ public static <G extends Gene<?, G>> Alterer<G> Null() { return new Alterer<G>() { @Override public <C extends Comparable<? super C>> int alter( final Population<G, C> population, final int generation ) { return 0; } @Override public int hashCode() { return HashBuilder.of(getClass()).value(); } @Override public boolean equals(final Object obj) { return obj == this || obj != null && obj.getClass() == getClass(); } @Override public String toString() { return "Alterer.Null"; } }; } public static final double DEFAULT_ALTER_PROBABILITY = 0.2; /** >>>>>>>
<<<<<<< * @version @__version__@ &mdash; <em>$Date: 2014-02-04 $</em> ======= * @version 1.2 &mdash; <em>$Date: 2014-02-15 $</em> >>>>>>> * @version @__version__@ &mdash; <em>$Date: 2014-02-15 $</em> <<<<<<< private static final class Scope<R extends Random> implements Scoped<R> { private final Thread _thread; private final R _random; Scope(final Thread thread, final R random) { _thread = requireNonNull(thread); _random = requireNonNull(random); } @Override public R get() { return _random; } @Override public void close() { if (_thread != Thread.currentThread()) { throw new IllegalStateException( "Try to close scope by a different thread." ); } LocalContext.exit(); } } } ======= } >>>>>>> private static final class Scope<R extends Random> implements Scoped<R> { private final Thread _thread; private final R _random; Scope(final Thread thread, final R random) { _thread = requireNonNull(thread); _random = requireNonNull(random); } @Override public R get() { return _random; } @Override public void close() { if (_thread != Thread.currentThread()) { throw new IllegalStateException( "Try to close scope by a different thread." ); } LocalContext.exit(); } } }
<<<<<<< * @version @__version__@ &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> >>>>>>> * @version @__version__@ &mdash; <em>$Date: 2014-03-31 $</em> <<<<<<< * {@code (index < 0 || index >= size())}. ======= * (index &lt; 0 || index &gt;= size()). >>>>>>> * (index &lt; 0 || index &gt;= size()). <<<<<<< * Return an iterator with the new type {@code B}. * * @param <B> the component type of the returned type. * @param mapper the converter for converting from {@code T} to {@code B}. * @return the iterator of the converted type. * @throws NullPointerException if the given {@code converter} is * {@code null}. */ public default <B> Iterator<B> iterator( final Function<? super T, ? extends B> mapper ) { return new SeqMappedIteratorAdapter<>(this, mapper); } /** ======= >>>>>>> * Return an iterator with the new type {@code B}. * * @param <B> the component type of the returned type. * @param mapper the converter for converting from {@code T} to {@code B}. * @return the iterator of the converted type. * @throws NullPointerException if the given {@code converter} is * {@code null}. */ public default <B> Iterator<B> iterator( final Function<? super T, ? extends B> mapper ) { return new SeqMappedIteratorAdapter<>(this, mapper); } /**
<<<<<<< ======= import org.jscience.mathematics.number.Float64; import org.jenetics.util.Function; >>>>>>> import org.jscience.mathematics.number.Float64; import org.jenetics.util.Function; <<<<<<< * @version <em>$Date: 2013-09-08 $</em> ======= * @version <em>$Date: 2014-02-17 $</em> >>>>>>> * @version <em>$Date: 2014-03-07 $</em>
<<<<<<< import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Retention; import java.lang.annotation.Target; import java.util.function.Function; ======= >>>>>>> <<<<<<< import org.jscience.mathematics.number.Float64; import org.jscience.mathematics.number.Integer64; ======= >>>>>>> <<<<<<< * @version 1.6 &mdash; <em>$Date: 2014-03-07 $</em> * @since 1.6 ======= * @version 1.6 &mdash; <em>$Date: 2014-03-27 $</em> * @since 2.0 >>>>>>> * @version 1.6 &mdash; <em>$Date: 2014-03-31 $</em> * @since 2.0
<<<<<<< import dr.inference.hmc.PathGradient; ======= import dr.inference.model.Likelihood; >>>>>>> import dr.inference.hmc.PathGradient; import dr.inference.model.Likelihood; <<<<<<< import dr.math.matrixAlgebra.ReadableVector; import dr.math.matrixAlgebra.WrappedVector; ======= >>>>>>> import dr.math.MultivariateFunction; import dr.math.NumericalDerivative; import dr.math.matrixAlgebra.ReadableVector; import dr.math.matrixAlgebra.WrappedVector; <<<<<<< this.runtimeOptions = runtimeOptions; this.stepSize = runtimeOptions.initialStepSize; this.preconditioning = preconditioningType.factory(gradientProvider, transform); this.leapFrogEngine = (transform != null ? new LeapFrogEngine.WithTransform(parameter, transform, getDefaultInstabilityHandler(),preconditioning) : new LeapFrogEngine.Default(parameter, getDefaultInstabilityHandler(), preconditioning)); ======= this.runtimeOptions = runtimeOptions; this.stepSize = runtimeOptions.initialStepSize; this.preconditioning = preconditioningType.factory(gradientProvider, transform); this.parameter = parameter; this.mask = buildMask(maskParameter); this.transform = transform; >>>>>>> this.runtimeOptions = runtimeOptions; this.stepSize = runtimeOptions.initialStepSize; this.preconditioning = preconditioningType.factory(gradientProvider, transform); this.parameter = parameter; this.mask = buildMask(maskParameter); this.transform = transform; <<<<<<< private boolean shouldUpdatePreconditioning() { return ((runtimeOptions.preconditioningUpdateFrequency > 0) && (((getCount() % runtimeOptions.preconditioningUpdateFrequency == 0) && (getCount() > runtimeOptions.preconditioningDelay)) || (getCount() == runtimeOptions.preconditioningDelay))); ======= private boolean shouldUpdatePreconditioning() { return ((runtimeOptions.preconditioningUpdateFrequency > 0) && (((getCount() % runtimeOptions.preconditioningUpdateFrequency == 0) && (getCount() > runtimeOptions.preconditioningDelay)) || (getCount() == runtimeOptions.preconditioningDelay))); } private static double[] buildMask(Parameter maskParameter) { if (maskParameter == null) return null; double[] mask = new double[maskParameter.getDimension()]; for (int i = 0; i < mask.length; ++i) { mask[i] = (maskParameter.getParameterValue(i) == 0.0) ? 0.0 : 1.0; } return mask; >>>>>>> private boolean shouldUpdatePreconditioning() { return ((runtimeOptions.preconditioningUpdateFrequency > 0) && (((getCount() % runtimeOptions.preconditioningUpdateFrequency == 0) && (getCount() > runtimeOptions.preconditioningDelay)) || (getCount() == runtimeOptions.preconditioningDelay))); } private static double[] buildMask(Parameter maskParameter) { if (maskParameter == null) return null; double[] mask = new double[maskParameter.getDimension()]; for (int i = 0; i < mask.length; ++i) { mask[i] = (maskParameter.getParameterValue(i) == 0.0) ? 0.0 : 1.0; } return mask; <<<<<<< if (shouldUpdatePreconditioning()) { preconditioning.updateMass(); } ======= throw new RuntimeException("Should not be executed"); } @Override public double doOperation(Likelihood joint) { if (shouldCheckStepSize()) { checkStepSize(); } if (shouldCheckGradient()) { checkGradient(joint); } if (shouldUpdatePreconditioning()) { preconditioning.updateMass(); } >>>>>>> throw new RuntimeException("Should not be executed"); } @Override public double doOperation(Likelihood joint) { if (shouldCheckStepSize()) { checkStepSize(); } if (shouldCheckGradient()) { checkGradient(joint); } if (shouldUpdatePreconditioning()) { preconditioning.updateMass(); } <<<<<<< public static class Options { final double initialStepSize; final int nSteps; final double randomStepCountFraction; final int preconditioningUpdateFrequency; final int preconditioningDelay; public Options(double initialStepSize, int nSteps, double randomStepCountFraction, int preconditioningUpdateFrequency, int preconditioningDelay) { this.initialStepSize = initialStepSize; this.nSteps = nSteps; this.randomStepCountFraction = randomStepCountFraction; this.preconditioningUpdateFrequency = preconditioningUpdateFrequency; this.preconditioningDelay = preconditioningDelay; } } ======= public static class Options { final double initialStepSize; final int nSteps; final double randomStepCountFraction; final int preconditioningUpdateFrequency; final int preconditioningDelay; final int gradientCheckCount; final double gradientCheckTolerance; final int checkStepSizeMaxIterations; final double checkStepSizeReductionFactor; public Options(double initialStepSize, int nSteps, double randomStepCountFraction, int preconditioningUpdateFrequency, int preconditioningDelay, int gradientCheckCount, double gradientCheckTolerance, int checkStepSizeMaxIterations, double checkStepSizeReductionFactor) { this.initialStepSize = initialStepSize; this.nSteps = nSteps; this.randomStepCountFraction = randomStepCountFraction; this.preconditioningUpdateFrequency = preconditioningUpdateFrequency; this.preconditioningDelay = preconditioningDelay; this.gradientCheckCount = gradientCheckCount; this.gradientCheckTolerance = gradientCheckTolerance; this.checkStepSizeMaxIterations = checkStepSizeMaxIterations; this.checkStepSizeReductionFactor = checkStepSizeReductionFactor; } } >>>>>>> public static class Options { final double initialStepSize; final int nSteps; final double randomStepCountFraction; final int preconditioningUpdateFrequency; final int preconditioningDelay; final int gradientCheckCount; final double gradientCheckTolerance; final int checkStepSizeMaxIterations; final double checkStepSizeReductionFactor; public Options(double initialStepSize, int nSteps, double randomStepCountFraction, int preconditioningUpdateFrequency, int preconditioningDelay, int gradientCheckCount, double gradientCheckTolerance, int checkStepSizeMaxIterations, double checkStepSizeReductionFactor) { this.initialStepSize = initialStepSize; this.nSteps = nSteps; this.randomStepCountFraction = randomStepCountFraction; this.preconditioningUpdateFrequency = preconditioningUpdateFrequency; this.preconditioningDelay = preconditioningDelay; this.gradientCheckCount = gradientCheckCount; this.gradientCheckTolerance = gradientCheckTolerance; this.checkStepSizeMaxIterations = checkStepSizeMaxIterations; this.checkStepSizeReductionFactor = checkStepSizeReductionFactor; } } <<<<<<< double getKineticEnergy(ReadableVector momentum) { final int dim = momentum.getDim(); double energy = 0.0; for (int i = 0; i < dim; i++) { energy += momentum.get(i) * preconditioning.getVelocity(i, momentum); } return energy / 2.0; } private double leapFrog() throws NumericInstabilityException { ======= double getKineticEnergy(ReadableVector momentum) { >>>>>>> double getKineticEnergy(ReadableVector momentum) { <<<<<<< ======= private double leapFrog() throws NumericInstabilityException { if (DEBUG) { System.err.println("HMC step size: " + stepSize); } >>>>>>> private double leapFrog() throws NumericInstabilityException { if (DEBUG) { System.err.println("HMC step size: " + stepSize); } <<<<<<< final WrappedVector momentum = preconditioning.drawInitialMomentum(); ======= final WrappedVector momentum = mask(preconditioning.drawInitialMomentum(), mask); >>>>>>> final WrappedVector momentum = mask(preconditioning.drawInitialMomentum(), mask); <<<<<<< leapFrogEngine.updateMomentum(position, momentum.getBuffer(), gradientProvider.getGradientLogDensity(), stepSize / 2); ======= leapFrogEngine.updateMomentum(position, momentum.getBuffer(), mask(gradientProvider.getGradientLogDensity(), mask), stepSize / 2); >>>>>>> leapFrogEngine.updateMomentum(position, momentum.getBuffer(), mask(gradientProvider.getGradientLogDensity(), mask), stepSize / 2); <<<<<<< double[] getLastGradient(); double[] getLastPosition(); ======= double[] getLastGradient(); double[] getLastPosition(); >>>>>>> double[] getLastGradient(); double[] getLastPosition(); <<<<<<< this.preconditioning = preconditioning; ======= this.preconditioning = preconditioning; this.mask = mask; >>>>>>> this.preconditioning = preconditioning; this.mask = mask; <<<<<<< public double[] getLastGradient() { return lastGradient; } @Override public double[] getLastPosition() { return lastPosition; } @Override ======= public double[] getLastGradient() { return lastGradient; } @Override public double[] getLastPosition() { return lastPosition; } @Override >>>>>>> public double[] getLastGradient() { return lastGradient; } @Override public double[] getLastPosition() { return lastPosition; } @Override <<<<<<< final int dim = position.length; for (int j = 0; j < dim; ++j) { parameter.setParameterValueQuietly(j, position[j]); } parameter.fireParameterChangedEvent(); // Does not seem to work with MaskedParameter ======= ReadableVector.Utils.setParameter(position, parameter); // May not work with MaskedParameter? >>>>>>> ReadableVector.Utils.setParameter(position, parameter); // May not work with MaskedParameter? <<<<<<< private WithTransform(Parameter parameter, Transform transform, InstabilityHandler instabilityHandler, MassPreconditioner preconditioning) { super(parameter, instabilityHandler, preconditioning); ======= private WithTransform(Parameter parameter, Transform transform, InstabilityHandler instabilityHandler, MassPreconditioner preconditioning, double[] mask) { super(parameter, instabilityHandler, preconditioning, mask); >>>>>>> private WithTransform(Parameter parameter, Transform transform, InstabilityHandler instabilityHandler, MassPreconditioner preconditioning, double[] mask) { super(parameter, instabilityHandler, preconditioning, mask);
<<<<<<< * @version 1.6 &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-04-12 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-04-16 $</em> <<<<<<< /** * @author <a href="mailto:[email protected]">Franz Wilhelmstötter</a> * @version 1.0 &mdash; <em>$Date: 2014-03-07 $</em> */ private static final class NonClosableOutputStream extends OutputStream { private final OutputStream _adoptee; public NonClosableOutputStream(final OutputStream adoptee) { _adoptee = adoptee; } @Override public void close() throws IOException { //Ignore close call. _adoptee.flush(); } @Override public void flush() throws IOException { _adoptee.flush(); } @Override public String toString() { return _adoptee.toString(); } @Override public void write(byte[] b, int off, int len) throws IOException { _adoptee.write(b, off, len); } @Override public void write(byte[] b) throws IOException { _adoptee.write(b); } @Override public void write(int b) throws IOException { _adoptee.write(b); } } /** * @author <a href="mailto:[email protected]">Franz Wilhelmstötter</a> * @version 1.0 &mdash; <em>$Date: 2014-03-07 $</em> */ private static final class NonClosableInputStream extends InputStream { private final InputStream _adoptee; public NonClosableInputStream(final InputStream adoptee) { _adoptee = adoptee; } @Override public int available() throws IOException { return _adoptee.available(); } @Override public void close() throws IOException { } @Override public void mark(int readlimit) { _adoptee.mark(readlimit); } @Override public boolean markSupported() { return _adoptee.markSupported(); } @Override public int read() throws IOException { return _adoptee.read(); } @Override public int read(byte[] b, int off, int len) throws IOException { return _adoptee.read(b, off, len); } @Override public int read(byte[] b) throws IOException { return _adoptee.read(b); } @Override public void reset() throws IOException { _adoptee.reset(); } @Override public long skip(long n) throws IOException { return _adoptee.skip(n); } } ======= >>>>>>>
<<<<<<< ======= import static org.jenetics.TestUtils.newDoubleGenePopulation; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; >>>>>>> import static org.jenetics.TestUtils.newDoubleGenePopulation; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; <<<<<<< import org.jscience.mathematics.number.Float64; ======= import javolution.xml.XMLSerializable; >>>>>>> import javolution.xml.XMLSerializable; <<<<<<< * @version <em>$Date: 2014-01-31 $</em> ======= * @version <em>$Date: 2014-02-11 $</em> >>>>>>> * @version <em>$Date: 2014-02-14 $</em> <<<<<<< private static final class Continuous implements Function<Genotype<Float64Gene>, Float64>, ======= private static final class Continous implements Function<Genotype<DoubleGene>, Double>, >>>>>>> private static final class Continous implements Function<Genotype<DoubleGene>, Double>, <<<<<<< private static final Function<Genotype<Float64Gene>, Float64> _cf = new Continuous(); private static Phenotype<Float64Gene, Float64> pt(double value) { return Phenotype.valueOf(Genotype.valueOf( new Float64Chromosome(Float64Gene.valueOf(value, 0, 10)) ), _cf, 0).evaluate(); ======= private static final Function<Genotype<DoubleGene>, Double> _cf = new Continous(); private static Phenotype<DoubleGene, Double> pt(double value) { return Phenotype.valueOf(Genotype.valueOf(DoubleChromosome.of(DoubleGene.of(value, 0, 10))), _cf, 0); >>>>>>> private static final Function<Genotype<DoubleGene>, Double> _cf = new Continous(); private static Phenotype<DoubleGene, Double> pt(double value) { return Phenotype.valueOf(Genotype.valueOf(DoubleChromosome.of(DoubleGene.of(value, 0, 10))), _cf, 0); <<<<<<< ======= @Test public void phenotypeXMLSerialization() throws IOException { final Population<DoubleGene, Double> population = new Population<>(); for (int i = 0; i < 1000; ++i) { population.add(pt(Math.random()*9.0)); } final ByteArrayOutputStream out = new ByteArrayOutputStream(); IO.xml.write(population, out); final byte[] data = out.toByteArray(); final ByteArrayInputStream in = new ByteArrayInputStream(data); @SuppressWarnings("unchecked") final Population<DoubleGene, Double> copy = (Population<DoubleGene, Double>)IO.xml.read(XMLSerializable.class, in); for (int i = 1; i < population.size(); ++i) { Assert.assertSame( copy.get(i - 1).getFitnessFunction(), copy.get(i).getFitnessFunction() ); Assert.assertSame( copy.get(i - 1).getFitnessScaler(), copy.get(i).getFitnessScaler() ); } } @Test public void xmlSerialization() throws IOException { final Population<DoubleGene, Double> population = newDoubleGenePopulation(23, 34, 123); Serialize.xml.test(population); } @Test public void objectSerialization() throws IOException { final Population<DoubleGene, Double> population = newDoubleGenePopulation(23, 34, 123); Serialize.object.test(population); } >>>>>>>
<<<<<<< final var result = genotype.toSeq() .map(gt -> mutate(gt, p, random)); ======= final ISeq<MutatorResult<Chromosome<G>>> result = genotype.stream() .map(gt -> mutate(gt, p, random)) .collect(ISeq.toISeq()); >>>>>>> final var result = genotype.stream() .map(gt -> mutate(gt, p, random)) .collect(ISeq.toISeq());
<<<<<<< import org.jenetics.internal.util.IntRef; ======= >>>>>>> <<<<<<< * @version 3.0 &mdash; <em>$Date: 2014-08-30 $</em> ======= * @version 3.0 &mdash; <em>$Date: 2014-10-25 $</em> >>>>>>> * @version 3.0 &mdash; <em>$Date: 2014-10-30 $</em> <<<<<<< public final int alter( final Population<G, C> population, final int generation ======= public final int alter( final Population<G, C> population, final long generation >>>>>>> public final int alter( final Population<G, C> population, final long generation
<<<<<<< private List<CodeType> getNames(final SFSpatialSamplingFeatureType spatialSamplingFeature) throws OwsExceptionReport { final int length = spatialSamplingFeature.getNameArray().length; final List<CodeType> names = new ArrayList<>(length); for (int i = 0; i < length; i++) { final Object decodedElement = CodingHelper.decodeXmlObject(spatialSamplingFeature.getNameArray(i)); if (decodedElement instanceof CodeType) { names.add((CodeType) decodedElement); } } return names; } ======= >>>>>>>
<<<<<<< * @version 1.3 &mdash; <em>$Date: 2013-07-12 $</em> ======= * @version 1.4 &mdash; <em>$Date: 2013-09-01 $</em> >>>>>>> * @version 1.4 &mdash; <em>$Date: 2013-09-08 $</em> <<<<<<< ======= * Test whether the given array is sorted in ascending order. * * @param seq the array to test. * @return {@code true} if the given {@code array} is sorted in ascending * order, {@code false} otherwise. * @throws NullPointerException if the given array or one of it's element is * {@code null}. */ public static <T extends Object & Comparable<? super T>> boolean isSorted(final Seq<T> seq) { boolean sorted = true; for (int i = 0, n = seq.length() - 1; i < n && sorted; ++i) { sorted = seq.get(i).compareTo(seq.get(i + 1)) <= 0; } return sorted; } /** * Test whether the given array is sorted in ascending order. The order of * the array elements is defined by the given comparator. * * @param seq the array to test. * @param comparator the comparator which defines the order. * @return {@code true} if the given {@code array} is sorted in ascending * order, {@code false} otherwise. * @throws NullPointerException if the given array or one of it's element or * the comparator is {@code null}. */ public static <T> boolean isSorted( final Seq<T> seq, final Comparator<? super T> comparator ) { boolean sorted = true; for (int i = 0, n = seq.length() - 1; i < n && sorted; ++i) { sorted = comparator.compare(seq.get(i), seq.get(i + 1)) <= 0; } return sorted; } /** >>>>>>> <<<<<<< ======= * Calculates a random permutation. * * @param p the permutation array. * @throws NullPointerException if the permutation array is {@code null}. * * @deprecated Not used in the <i>Jenetics</i> library. Will be removed. */ @Deprecated public static int[] permutation(final int[] p) { return permutation(p, RandomRegistry.getRandom()); } /** * Calculates a random permutation. * * @param p the permutation array. * @param random the random number generator. * @throws NullPointerException if the permutation array or the random number * generator is {@code null}. * * @deprecated Not used in the <i>Jenetics</i> library. Will be removed. */ @Deprecated public static int[] permutation(final int[] p, final Random random) { requireNonNull(p, "Permutation array"); requireNonNull(random, "Random"); for (int i = 0; i < p.length; ++i) { p[i] = i; } shuffle(p, random); return p; } /** * Calculates the permutation with the given {@code rank}. * * <p> * <em>Authors:</em> * FORTRAN77 original version by Albert Nijenhuis, Herbert Wilf. This * version based on the C++ version by John Burkardt. * </p> * * <p><em><a href="https://people.scs.fsu.edu/~burkardt/c_src/subset/subset.html"> * Reference:</a></em> * Albert Nijenhuis, Herbert Wilf, * Combinatorial Algorithms for Computers and Calculators, * Second Edition, * Academic Press, 1978, * ISBN: 0-12-519260-6, * LC: QA164.N54. * </p> * * @param p the permutation array. * @param rank the permutation rank. * @throws NullPointerException it the permutation array is {@code null}. * @throws IllegalArgumentException if {@code rank < 1}. * * @deprecated Not used in the <i>Jenetics</i> library. Will be removed. */ @Deprecated public static int[] permutation(final int[] p, final long rank) { requireNonNull(p, "Permutation array"); if (rank < 1) { throw new IllegalArgumentException(format( "Rank smaler than 1: %s", rank )); } Arrays.fill(p, 0); long jrank = rank - 1; for (int i = 1; i <= p.length; ++i) { int iprev = p.length + 1 - i; int irem = (int)(jrank%iprev); jrank = jrank/iprev; int j = 0; int jdir = 0; if ((jrank%2) == 1) { j = 0; jdir = 1; } else { j = p.length + 1; jdir = -1; } int icount = 0; do { j = j + jdir; if (p[j - 1] == 0) { ++icount; } } while (irem >= icount); p[j - 1] = iprev; } return p; } /** >>>>>>>
<<<<<<< @Test public void dashDashEmpty() { class Arguments { @Parameter public List<String> mainParameters = new ArrayList<>(); } Arguments a = new Arguments(); new JCommander(a, "--"); Assert.assertTrue(a.mainParameters.isEmpty()); } @Test public void dashDashDashDash() { class Arguments { @Parameter public List<String> mainParameters = new ArrayList<>(); } Arguments a = new Arguments(); new JCommander(a, "--", "--"); Assert.assertEquals(a.mainParameters.size(), 1); Assert.assertEquals(a.mainParameters.get(0), "--"); } public void dashDashParameter() { class Arguments { @Parameter(names = { "-name" }) public String name; @Parameter public List<String> mainParameters; ======= public void dashDashParameter() { class Parameters { @Parameter(names = {"-name"}) public String name; @Parameter public List<String> mainParameters; } Parameters a = new Parameters(); new JCommander(a, "-name", "theName", "--", "param1", "param2"); Assert.assertEquals(a.name, "theName"); Assert.assertEquals(a.mainParameters.size(), 2); Assert.assertEquals(a.mainParameters.get(0), "param1"); Assert.assertEquals(a.mainParameters.get(1), "param2"); >>>>>>> @Test public void dashDashEmpty() { class Parameters { @Parameter public List<String> mainParameters = new ArrayList<>(); } Parameters a = new Parameters(); new JCommander(a, "--"); Assert.assertTrue(a.mainParameters.isEmpty()); } @Test public void dashDashDashDash() { class Parameters { @Parameter public List<String> mainParameters = new ArrayList<>(); } Parameters a = new Parameters(); new JCommander(a, "--", "--"); Assert.assertEquals(a.mainParameters.size(), 1); Assert.assertEquals(a.mainParameters.get(0), "--"); } public void dashDashParameter() { class Parameters { @Parameter(names = { "-name" }) public String name; @Parameter public List<String> mainParameters; } Parameters a = new Parameters(); new JCommander(a, "-name", "theName", "--", "param1", "param2"); Assert.assertEquals(a.name, "theName"); Assert.assertEquals(a.mainParameters.size(), 2); Assert.assertEquals(a.mainParameters.get(0), "param1"); Assert.assertEquals(a.mainParameters.get(1), "param2");
<<<<<<< ======= import org.jenetics.internal.util.HashBuilder; import org.jenetics.util.Function; >>>>>>> import org.jenetics.internal.util.HashBuilder; import org.jenetics.util.Function; <<<<<<< * @version 1.0 &mdash; <em>$Date: 2013-12-18 $</em> ======= * @version 1.0 &mdash; <em>$Date: 2014-03-05 $</em> * * @deprecated Will be removed in next major version, respectively replaced with * a variant which will be parametrized with {@code Double}s. >>>>>>> * @version 1.0 &mdash; <em>$Date: 2014-03-07 $</em> * * @deprecated Will be removed in next major version, respectively replaced with * a variant which will be parametrized with {@code Double}s.
<<<<<<< import java.time.Duration; import java.time.format.DateTimeParseException; import javolution.lang.Immutable; import javolution.xml.XMLFormat; import javolution.xml.XMLSerializable; import javolution.xml.stream.XMLStreamException; import org.jscience.mathematics.number.Float64; import org.jscience.mathematics.number.Integer64; ======= import java.io.Serializable; >>>>>>> import java.io.Serializable; <<<<<<< import org.jenetics.util.Accumulator; import org.jenetics.util.Accumulator.MinMax; ======= import org.jenetics.util.Duration; >>>>>>> import org.jenetics.util.Duration; <<<<<<< * @version @__version__@ &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> <<<<<<< * @version 1.0 &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> <<<<<<< * @version @__version__@ &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> <<<<<<< ======= private static final Duration ZERO = Duration.ofNanos(0); >>>>>>> private static final Duration ZERO = Duration.ofNanos(0); <<<<<<< public final FinalReference<Duration> execution = new FinalReference<>(Duration.ZERO); ======= public final FinalReference<Duration> execution = new FinalReference<>(ZERO); >>>>>>> public final FinalReference<Duration> execution = new FinalReference<>(ZERO); <<<<<<< public final FinalReference<Duration> selection = new FinalReference<>(Duration.ZERO); ======= public final FinalReference<Duration> selection = new FinalReference<>(ZERO); >>>>>>> public final FinalReference<Duration> selection = new FinalReference<>(ZERO); <<<<<<< public final FinalReference<Duration> alter = new FinalReference<>(Duration.ZERO); ======= public final FinalReference<Duration> alter = new FinalReference<>(ZERO); >>>>>>> public final FinalReference<Duration> alter = new FinalReference<>(ZERO); <<<<<<< public final FinalReference<Duration> combine = new FinalReference<>(Duration.ZERO); ======= public final FinalReference<Duration> combine = new FinalReference<>(ZERO); >>>>>>> public final FinalReference<Duration> combine = new FinalReference<>(ZERO); <<<<<<< public final FinalReference<Duration> evaluation = new FinalReference<>(Duration.ZERO); ======= public final FinalReference<Duration> evaluation = new FinalReference<>(ZERO); >>>>>>> public final FinalReference<Duration> evaluation = new FinalReference<>(ZERO); <<<<<<< public final FinalReference<Duration> statistics = new FinalReference<>(Duration.ZERO); ======= public final FinalReference<Duration> statistics = new FinalReference<>(ZERO); >>>>>>> public final FinalReference<Duration> statistics = new FinalReference<>(ZERO); <<<<<<< out.append(format(pattern, "Select time", selection.get().getNano()/1_000_000_000.0)); out.append(format(pattern, "Alter time", alter.get().getNano()/1_000_000_000.0)); out.append(format(pattern, "Combine time", combine.get().getNano()/1_000_000_000.0)); out.append(format(pattern, "Fitness calculation time", evaluation.get().getNano()/1_000_000_000.0)); out.append(format(pattern, "Statistics calculation time", statistics.get().getNano()/1_000_000_000.0)); out.append(format(pattern, "Overall execution time", execution.get().getNano()/1_000_000_000.0)); ======= out.append(format(pattern, "Select time", selection.get().toSeconds())); out.append(format(pattern, "Alter time", alter.get().toSeconds())); out.append(format(pattern, "Combine time", combine.get().toSeconds())); out.append(format(pattern, "Fitness calculation time", evaluation.get().toSeconds())); out.append(format(pattern, "Statistics calculation time", statistics.get().toSeconds())); out.append(format(pattern, "Overall execution time", execution.get().toSeconds())); >>>>>>> out.append(format(pattern, "Select time", selection.get().toSeconds())); out.append(format(pattern, "Alter time", alter.get().toSeconds())); out.append(format(pattern, "Combine time", combine.get().toSeconds())); out.append(format(pattern, "Fitness calculation time", evaluation.get().toSeconds())); out.append(format(pattern, "Statistics calculation time", statistics.get().toSeconds())); out.append(format(pattern, "Overall execution time", execution.get().toSeconds())); <<<<<<< /* ******************************************************************** * XML object serialization * ********************************************************************/ static final XMLFormat<Statistics.Time> XML = new XMLFormat<Statistics.Time>(Statistics.Time.class) { private static final String ALTER_TIME = "alter-time"; private static final String COMBINE_TIME = "combine-time"; private static final String EVALUATION_TIME = "evaluation-time"; private static final String EXECUTION_TIME = "execution-time"; private static final String SELECTION_TIME = "selection-time"; private static final String STATISTICS_TIME = "statistics-time"; @SuppressWarnings("unchecked") @Override public Statistics.Time newInstance( final Class<Statistics.Time> cls, final InputElement xml ) throws XMLStreamException { final Statistics.Time time = new Statistics.Time(); try { time.alter.set(Duration.parse(xml.get(ALTER_TIME))); time.combine.set(Duration.parse(xml.get(COMBINE_TIME))); time.evaluation.set(Duration.parse(xml.get(EVALUATION_TIME))); time.execution.set(Duration.parse(xml.get(EXECUTION_TIME))); time.selection.set(Duration.parse(xml.get(SELECTION_TIME))); time.statistics.set(Duration.parse(xml.get(STATISTICS_TIME))); } catch (DateTimeParseException e) { throw new XMLStreamException(e); } return time; } @Override public void write(final Statistics.Time s, final OutputElement xml) throws XMLStreamException { xml.add(s.alter.get().toString(), ALTER_TIME); xml.add(s.combine.get().toString(), COMBINE_TIME); xml.add(s.evaluation.get().toString(), EVALUATION_TIME); xml.add(s.execution.get().toString(), EXECUTION_TIME); xml.add(s.selection.get().toString(), SELECTION_TIME); xml.add(s.statistics.get().toString(), STATISTICS_TIME); } @Override public void read(final InputElement xml, final Statistics.Time p) { } }; ======= >>>>>>> <<<<<<< * @version 1.0 &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em>
<<<<<<< import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.Collection; import java.util.EnumMap; import java.util.List; import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.UUID; import java.util.concurrent.LinkedTransferQueue; import org.bukkit.Achievement; import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.EntityEffect; import org.bukkit.GameMode; import org.bukkit.Instrument; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Note; import org.bukkit.Particle; import org.bukkit.Server; import org.bukkit.Sound; import org.bukkit.SoundCategory; import org.bukkit.Statistic; import org.bukkit.WeatherType; import org.bukkit.World; ======= import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.UnimplementedOperationException; import be.seeseemelk.mockbukkit.command.MessageTarget; import be.seeseemelk.mockbukkit.inventory.PlayerInventoryMock; import com.google.common.base.Charsets; import org.bukkit.*; >>>>>>> import static org.junit.Assert.*; import be.seeseemelk.mockbukkit.MockBukkit; import be.seeseemelk.mockbukkit.UnimplementedOperationException; import be.seeseemelk.mockbukkit.command.MessageTarget; import be.seeseemelk.mockbukkit.inventory.PlayerInventoryMock; import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.Collection; import java.util.EnumMap; import java.util.List; import java.util.Map; import java.util.Queue; import java.util.Set; import java.util.UUID; import java.util.concurrent.LinkedTransferQueue; import org.bukkit.Achievement; import org.bukkit.Bukkit; import org.bukkit.Effect; import org.bukkit.EntityEffect; import org.bukkit.GameMode; import org.bukkit.Instrument; import org.bukkit.Location; import org.bukkit.Material; import org.bukkit.Note; import org.bukkit.Particle; import org.bukkit.Server; import org.bukkit.Sound; import org.bukkit.SoundCategory; import org.bukkit.Statistic; import org.bukkit.WeatherType; import org.bukkit.World; <<<<<<< import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.entity.Villager; import org.bukkit.event.entity.EntityDamageByEntityEvent; ======= import org.bukkit.entity.*; >>>>>>> import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import org.bukkit.entity.Player; import org.bukkit.entity.Projectile; import org.bukkit.entity.Villager; import org.bukkit.event.entity.EntityDamageByEntityEvent; <<<<<<< private double maxHealth = MAX_HEALTH; private double health = 20.0; ======= private boolean whitelisted = true; private boolean operator = false; public PlayerMock(String name) { this(name, UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8))); this.online = false; } >>>>>>> private double maxHealth = MAX_HEALTH; private double health = 20.0; private boolean whitelisted = true; private boolean operator = false; public PlayerMock(String name) { this(name, UUID.nameUUIDFromBytes(("OfflinePlayer:" + name).getBytes(Charsets.UTF_8))); this.online = false; }
<<<<<<< import org.jenetics.util.Accumulator.MinMax; ======= >>>>>>> import org.jenetics.util.Accumulator.MinMax; <<<<<<< * @version <em>$Date: 2013-03-26 $</em> ======= * @version <em>$Date: 2013-09-01 $</em> >>>>>>> * @version <em>$Date: 2013-09-08 $</em>
<<<<<<< * @version 2.0 &mdash; <em>$Date: 2014-04-02 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-12-22 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-12-28 $</em> <<<<<<< * Parameter class for the {@code LCG64ShiftRandom} generator, for the * parameters <i>a</i> and <i>b</i> of the LC recursion * <i>r<sub>i+1</sub> = a · r<sub>i</sub> + b</i> mod <i>2<sup>64</sup></i>. * * @author <a href="mailto:[email protected]">Franz Wilhelmstötter</a> * @since 1.1 * @version 2.0 &mdash; <em>$Date: 2014-04-02 $</em> */ public static final class Param implements Serializable { private static final long serialVersionUID = 1L; /** * The default PRNG parameters: a = 0xFBD19FBBC5C07FF5L; b = 1 */ public static final Param DEFAULT = new Param(0xFBD19FBBC5C07FF5L, 1L); /** * LEcuyer 1 parameters: a = 0x27BB2EE687B0B0FDL; b = 1 */ public static final Param LECUYER1 = new Param(0x27BB2EE687B0B0FDL, 1L); /** * LEcuyer 2 parameters: a = 0x2C6FE96EE78B6955L; b = 1 */ public static final Param LECUYER2 = new Param(0x2C6FE96EE78B6955L, 1L); /** * LEcuyer 3 parameters: a = 0x369DEA0F31A53F85L; b = 1 */ public static final Param LECUYER3 = new Param(0x369DEA0F31A53F85L, 1L); /** * The parameter <i>a</i> of the LC recursion. */ public final long a; /** * The parameter <i>b</i> of the LC recursion. */ public final long b; /** * Create a new parameter object. * * @param a the parameter <i>a</i> of the LC recursion. * @param b the parameter <i>b</i> of the LC recursion. */ public Param(final long a, final long b) { this.a = a; this.b = b; } @Override public int hashCode() { return 31*(int)(a^(a >>> 32)) + 31*(int)(b^(b >>> 32)); } @Override public boolean equals(final Object obj) { if (obj == this) { return true; } if (!(obj instanceof Param)) { return false; } final Param param = (Param)obj; return a == param.a && b == param.b; } @Override public String toString() { return format("%s[a=%d, b=%d]", getClass().getName(), a, b); } } /** ======= >>>>>>> <<<<<<< * @version 2.0 &mdash; <em>$Date: 2014-04-02 $</em> ======= * @version 3.0 &mdash; <em>$Date: 2014-12-22 $</em> >>>>>>> * @version 3.0 &mdash; <em>$Date: 2014-12-28 $</em> <<<<<<< * @version 2.0 &mdash; <em>$Date: 2014-04-02 $</em> ======= * @version 3.0 &mdash; <em>$Date: 2014-12-22 $</em> >>>>>>> * @version 3.0 &mdash; <em>$Date: 2014-12-28 $</em>
<<<<<<< * @version @__version__@ &mdash; <em>$Date: 2014-03-07 $</em> * ======= * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em> >>>>>>> * @version @__version__@ &mdash; <em>$Date: 2014-03-31 $</em> *
<<<<<<< import java.util.function.Function; import org.jscience.mathematics.number.Float64; ======= import static org.jenetics.util.math.random.nextDouble; import java.util.Random; >>>>>>> import java.util.function.Function; import java.util.Random; <<<<<<< ======= import org.jenetics.util.Function; import org.jenetics.util.RandomRegistry; >>>>>>> import org.jenetics.util.Function; import org.jenetics.util.RandomRegistry;
<<<<<<< * @version 2.0 &mdash; <em>$Date: 2013-12-18 $</em> ======= * @version 1.6 &mdash; <em>$Date: 2014-03-07 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-03-07 $</em>
<<<<<<< * @version <em>$Date: 2014-06-02 $</em> ======= * @version <em>$Date: 2014-08-12 $</em> >>>>>>> * @version <em>$Date: 2014-08-12 $</em> <<<<<<< ======= final Factory<TruncationSelector<DoubleGene, Double>> _factory = new Factory<TruncationSelector<DoubleGene,Double>>() { @Override public TruncationSelector<DoubleGene, Double> newInstance() { return new TruncationSelector<>(); } }; >>>>>>>
<<<<<<< import java.util.Collection; import java.util.function.Function; import javolution.lang.Immutable; ======= >>>>>>> <<<<<<< * @version @__version__@ &mdash; <em>$Date: 2014-03-07 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-03-12 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-03-31 $</em>
<<<<<<< * @version 1.6 &mdash; <em>$Date: 2014-03-07 $</em> ======= >>>>>>>
<<<<<<< final File saveFile = new File(saveDir, encode(name + JSON_EXTENSION)); ======= final File saveFile = new File(saveDir, FilenameEncoder.encode(name + ".json")); >>>>>>> final File saveFile = new File(saveDir, FilenameEncoder.encode(name + JSON_EXTENSION)); <<<<<<< final JsonNode root = mapper.readTree(new File(saveDir, encode(queryName) + JSON_EXTENSION)); ======= final JsonNode root = mapper.readTree(new File(saveDir, FilenameEncoder.encode(queryName) + ".json")); >>>>>>> final JsonNode root = mapper.readTree(new File(saveDir, FilenameEncoder.encode(queryName) + JSON_EXTENSION));
<<<<<<< if (sum != 0 && Math.abs(sum - 1.0) > 1.0e-10) { System.out.printf("(Normalizing ranks after %d power iterations with error) ", numIterations, sum - 1.0); for (int i = 0; i < numNodes; ++i) { nodeFlow[i] /= sum; ======= if (sum != 0) { if (Math.abs(sum - 1.0) > 1.0e-10) { System.out.printf("(Normalizing ranks after %d power iterations with error %e) ", numIterations, sum - 1.0); for (int i = 0; i < numNodes; ++i) { nodeFlow[i] /= sum; } >>>>>>> if (sum != 0 && Math.abs(sum - 1.0) > 1.0e-10) { System.out.printf("(Normalizing ranks after %d power iterations with error %e) ", numIterations, sum - 1.0); for (int i = 0; i < numNodes; ++i) { nodeFlow[i] /= sum;
<<<<<<< final File f = new File(delimIoDir, TemplateListDialog.encode(templName + JSON_EXTENSION)); ======= final File f = new File(delimIoDir, FilenameEncoder.encode(templName + ".json")); >>>>>>> final File f = new File(delimIoDir, FilenameEncoder.encode(templName + JSON_EXTENSION)); <<<<<<< final File template = new File(delimIoDir, TemplateListDialog.encode(templName) + JSON_EXTENSION); ======= final File template = new File(delimIoDir, FilenameEncoder.encode(templName) + ".json"); >>>>>>> final File template = new File(delimIoDir, FilenameEncoder.encode(templName) + JSON_EXTENSION); <<<<<<< final JsonNode root = mapper.readTree(new File(delimIoDir, TemplateListDialog.encode(templName) + JSON_EXTENSION)); ======= final JsonNode root = mapper.readTree(new File(delimIoDir, FilenameEncoder.encode(templName) + ".json")); >>>>>>> final JsonNode root = mapper.readTree(new File(delimIoDir, FilenameEncoder.encode(templName) + JSON_EXTENSION));
<<<<<<< import org.jenetics.util.MSeq; ======= import org.jenetics.util.MSeq; import org.jenetics.util.Seq; >>>>>>> import org.jenetics.util.MSeq; import org.jenetics.util.Seq; <<<<<<< * @version 2.0 &mdash; <em>$Date: 2014-08-01 $</em> ======= * @version 2.0 &mdash; <em>$Date: 2014-10-28 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2014-10-30 $</em> <<<<<<< throws Exception { final ISeq alleles = ISeq.of(model.alleles) .map(jaxb.Unmarshaller(model.alleles.get(0))); ======= throws Exception { final ISeq alleles = ISeq.of(model.alleles) .map(jaxb.Unmarshaller(model.alleles.get(0))); >>>>>>> throws Exception { final ISeq alleles = ISeq.of(model.alleles) .map(jaxb.Unmarshaller(model.alleles.get(0))); <<<<<<< private static final Function<EnumGene<?>, Integer> AlleleIndex = g -> g.getAlleleIndex(); ======= >>>>>>>
<<<<<<< * @version 2.0 &mdash; <em>$Date: 2013-05-25 $</em> ======= * @version 1.3 &mdash; <em>$Date: 2013-06-12 $</em> >>>>>>> * @version 2.0 &mdash; <em>$Date: 2013-07-12 $</em> <<<<<<< ======= * Create a new array with length one. The array will be initialized with * the given value. * * @param first the only element of the array. * * @deprecated Use {@link #valueOf(Object...)} instead. */ @Deprecated public Array(final T first) { this(1); _array.data[0] = first; } /** * Create a new array with length two. The array will be initialized with * the given values. * * @param first first array element. * @param second second array element. * * @deprecated Use {@link #valueOf(Object...)} instead. */ @Deprecated public Array( final T first, final T second ) { this(2); _array.data[0] = first; _array.data[1] = second; } /** * Create a new array with length three. The array will be initialized with * the given values. * * @param first first array element. * @param second second array element. * @param third third array element. * * @deprecated Use {@link #valueOf(Object...)} instead. */ @Deprecated public Array( final T first, final T second, final T third ) { this(3); _array.data[0] = first; _array.data[1] = second; _array.data[2] = third; } /** * Create a new array with length four. The array will be initialized with * the given values. * * @param first first array element. * @param second second array element. * @param third third array element. * @param fourth fourth array element. * * @deprecated Use {@link #valueOf(Object...)} instead. */ @Deprecated public Array( final T first, final T second, final T third, final T fourth ) { this(4); _array.data[0] = first; _array.data[1] = second; _array.data[2] = third; _array.data[3] = fourth; } /** * Create a new array with length five. The array will be initialized with * the given values. * * @param first first array element. * @param second second array element. * @param third third array element. * @param fourth fourth array element. * @param fifth fifth array element. * * @deprecated Use {@link #valueOf(Object...)} instead. */ @Deprecated public Array( final T first, final T second, final T third, final T fourth, final T fifth ) { this(5); _array.data[0] = first; _array.data[1] = second; _array.data[2] = third; _array.data[3] = fourth; _array.data[4] = fifth; } /** * Create a new array from the given values. * * @param first first array element. * @param second second array element. * @param third third array element. * @param fourth fourth array element. * @param fifth fifth array element. * @param rest the rest of the array element. * @throws NullPointerException if the {@code rest} array is {@code null}. * * @deprecated Use {@link #valueOf(Object...)} instead. */ @Deprecated @SafeVarargs public Array( final T first, final T second, final T third, final T fourth, final T fifth, final T... rest ) { this(5 + rest.length); _array.data[0] = first; _array.data[1] = second; _array.data[2] = third; _array.data[3] = fourth; _array.data[4] = fifth; arraycopy(rest, 0, _array.data, 5, rest.length); } /** * Create a new array from the given values. * * @param values the array values. * @throws NullPointerException if the {@code values} array is {@code null}. * * @deprecated Use {@link #valueOf(Object...)} instead. */ @Deprecated public Array(final T[] values) { this(values.length); arraycopy(values, 0, _array.data, 0, values.length); } /** * Create a new Array from the values of the given Collection. The order of * the elements are determined by the iterator of the Collection. * * @param values the array values. * @throws NullPointerException if the {@code values} array is {@code null}. * * @deprecated Use {@link #valueOf(Collection)} instead. */ @Deprecated public Array(final Collection<? extends T> values) { this(values.size()); int index = 0; for (Iterator<? extends T> it = values.iterator(); it.hasNext(); ++index) { _array.data[index] = it.next(); } } /** >>>>>>>
<<<<<<< * Returns the range of this {@code IntRange} as a {@code LongRange} after * a widening primitive conversion. * * @since !__version__! * * @return this {@code IntRange} as {@code LongRange} */ public LongRange longRange() { return LongRange.of(_min, _max); } /** * Returns the range of this {@code IntRange} as a {@code DoubleRange} after * a widening primitive conversion. * * @since !__version__! * * @return this {@code IntRange} as {@code DoubleRange} */ public DoubleRange doubleRange() { return DoubleRange.of(_min, _max); } /** ======= * Returns a sequential ordered {@code IntStream} from {@link #getMin()} * (inclusive) to {@link #getMax()} (exclusive) by an incremental step of * {@code 1}. * <p> * An equivalent sequence of increasing values can be produced sequentially * using a {@code for} loop as follows: * <pre>{@code * for (int i = range.getMin(); i < range.getMax(); ++i) { * ... * } * }</pre> * * @return a sequential {@link IntStream} for the range of {@code int} * elements */ public IntStream stream() { return IntStream.range(_min, _max); } /** >>>>>>> * Returns a sequential ordered {@code IntStream} from {@link #getMin()} * (inclusive) to {@link #getMax()} (exclusive) by an incremental step of * {@code 1}. * <p> * An equivalent sequence of increasing values can be produced sequentially * using a {@code for} loop as follows: * <pre>{@code * for (int i = range.getMin(); i < range.getMax(); ++i) { * ... * } * }</pre> * * @return a sequential {@link IntStream} for the range of {@code int} * elements */ public IntStream stream() { return IntStream.range(_min, _max); } /** * Returns the range of this {@code IntRange} as a {@code LongRange} after * a widening primitive conversion. * * @since !__version__! * * @return this {@code IntRange} as {@code LongRange} */ public LongRange longRange() { return LongRange.of(_min, _max); } /** * Returns the range of this {@code IntRange} as a {@code DoubleRange} after * a widening primitive conversion. * * @since !__version__! * * @return this {@code IntRange} as {@code DoubleRange} */ public DoubleRange doubleRange() { return DoubleRange.of(_min, _max); } /**
<<<<<<< teleportBackWhenFreedFromJail = _isTeleportBackWhenFreedFromJail(); ======= isCompassTowardsHomePerm = _isCompassTowardsHomePerm(); isAllowWorldInBroadcastworld = _isAllowWorldInBroadcastworld(); >>>>>>> teleportBackWhenFreedFromJail = _isTeleportBackWhenFreedFromJail(); isCompassTowardsHomePerm = _isCompassTowardsHomePerm(); isAllowWorldInBroadcastworld = _isAllowWorldInBroadcastworld(); <<<<<<< private boolean teleportBackWhenFreedFromJail; private boolean _isTeleportBackWhenFreedFromJail() { return config.getBoolean("teleport-back-when-freed-from-jail", true); } @Override public boolean isTeleportBackWhenFreedFromJail() { return teleportBackWhenFreedFromJail; } ======= private boolean isCompassTowardsHomePerm; private boolean _isCompassTowardsHomePerm() { return config.getBoolean("compass-towards-home-perm", false); } @Override public boolean isCompassTowardsHomePerm() { return isCompassTowardsHomePerm; } private boolean isAllowWorldInBroadcastworld; private boolean _isAllowWorldInBroadcastworld() { return config.getBoolean("allow-world-in-broadcastworld", false); } @Override public boolean isAllowWorldInBroadcastworld() { return isAllowWorldInBroadcastworld; } >>>>>>> private boolean teleportBackWhenFreedFromJail; private boolean _isTeleportBackWhenFreedFromJail() { return config.getBoolean("teleport-back-when-freed-from-jail", true); } @Override public boolean isTeleportBackWhenFreedFromJail() { return teleportBackWhenFreedFromJail; } private boolean isCompassTowardsHomePerm; private boolean _isCompassTowardsHomePerm() { return config.getBoolean("compass-towards-home-perm", false); } @Override public boolean isCompassTowardsHomePerm() { return isCompassTowardsHomePerm; } private boolean isAllowWorldInBroadcastworld; private boolean _isAllowWorldInBroadcastworld() { return config.getBoolean("allow-world-in-broadcastworld", false); } @Override public boolean isAllowWorldInBroadcastworld() { return isAllowWorldInBroadcastworld; }
<<<<<<< import java.util.Locale.Category; ======= import java.util.Map.Entry; >>>>>>> import java.util.Locale.Category; import java.util.Map.Entry; <<<<<<< currencyFormat = _getCurrencyFormat(); ======= commandCooldowns = _getCommandCooldowns(); >>>>>>> commandCooldowns = _getCommandCooldowns(); currencyFormat = _getCurrencyFormat(); <<<<<<< private NumberFormat currencyFormat; private NumberFormat _getCurrencyFormat() { String currencyFormatString = config.getString("currency-format", "#,##0.00"); String symbolLocaleString = config.getString("currency-symbol-format-locale"); DecimalFormatSymbols decimalFormatSymbols; if (symbolLocaleString != null) { decimalFormatSymbols = DecimalFormatSymbols.getInstance(Locale.forLanguageTag(symbolLocaleString)); } else { // Fallback to the JVM's default locale decimalFormatSymbols = DecimalFormatSymbols.getInstance(); } DecimalFormat currencyFormat = new DecimalFormat(currencyFormatString, decimalFormatSymbols); currencyFormat.setRoundingMode(RoundingMode.FLOOR); // Updates NumberUtil#PRETTY_FORMAT field so that all of Essentials // can follow a single format. try { Field field = NumberUtil.class.getDeclaredField("PRETTY_FORMAT"); field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); field.set(null, currencyFormat); modifiersField.setAccessible(false); field.setAccessible(false); } catch (NoSuchFieldException | IllegalAccessException e) { ess.getLogger().severe("Failed to apply custom currency format: " + e.getMessage()); if (isDebug()) { e.printStackTrace(); } } return currencyFormat; } @Override public NumberFormat getCurrencyFormat() { return this.currencyFormat; } ======= @Override public boolean isTeleportToCenterLocation() { return config.getBoolean("teleport-to-center", true); } private Map<Pattern, Long> commandCooldowns; private Map<Pattern, Long> _getCommandCooldowns() { if (!config.isConfigurationSection("command-cooldowns")) { return null; } ConfigurationSection section = config.getConfigurationSection("command-cooldowns"); Map<Pattern, Long> result = new LinkedHashMap<>(); for (String cmdEntry : section.getKeys(false)) { Pattern pattern = null; /* ================================ * >> Regex * ================================ */ if (cmdEntry.startsWith("^")) { try { pattern = Pattern.compile(cmdEntry.substring(1)); } catch (PatternSyntaxException e) { ess.getLogger().warning("Command cooldown error: " + e.getMessage()); } } else { // Escape above Regex if (cmdEntry.startsWith("\\^")) { cmdEntry = cmdEntry.substring(1); } String cmd = cmdEntry .replaceAll("\\*", ".*"); // Wildcards are accepted as asterisk * as known universally. pattern = Pattern.compile(cmd + "( .*)?"); // This matches arguments, if present, to "ignore" them from the feature. } /* ================================ * >> Process cooldown value * ================================ */ Object value = section.get(cmdEntry); if (!(value instanceof Number) && value instanceof String) { try { value = Double.parseDouble(value.toString()); } catch (NumberFormatException ignored) { } } if (!(value instanceof Number)) { ess.getLogger().warning("Command cooldown error: '" + value + "' is not a valid cooldown"); continue; } double cooldown = ((Number) value).doubleValue(); if (cooldown < 1) { ess.getLogger().warning("Command cooldown with very short " + cooldown + " cooldown."); } result.put(pattern, (long) cooldown * 1000); // convert to milliseconds } return result; } @Override public boolean isCommandCooldownsEnabled() { return commandCooldowns != null; } @Override public long getCommandCooldownMs(String label) { Entry<Pattern, Long> result = getCommandCooldownEntry(label); return result != null ? result.getValue() : -1; // return cooldown in milliseconds } @Override public Entry<Pattern, Long> getCommandCooldownEntry(String label) { if (isCommandCooldownsEnabled()) { for (Entry<Pattern, Long> entry : this.commandCooldowns.entrySet()) { // Check if label matches current pattern (command-cooldown in config) if (entry.getKey().matcher(label).matches()) { return entry; } } } return null; } @Override public boolean isCommandCooldownPersistent(String label) { // TODO: enable per command cooldown specification for persistence. return config.getBoolean("command-cooldown-persistence", true); } >>>>>>> @Override public boolean isTeleportToCenterLocation() { return config.getBoolean("teleport-to-center", true); } private Map<Pattern, Long> commandCooldowns; private Map<Pattern, Long> _getCommandCooldowns() { if (!config.isConfigurationSection("command-cooldowns")) { return null; } ConfigurationSection section = config.getConfigurationSection("command-cooldowns"); Map<Pattern, Long> result = new LinkedHashMap<>(); for (String cmdEntry : section.getKeys(false)) { Pattern pattern = null; /* ================================ * >> Regex * ================================ */ if (cmdEntry.startsWith("^")) { try { pattern = Pattern.compile(cmdEntry.substring(1)); } catch (PatternSyntaxException e) { ess.getLogger().warning("Command cooldown error: " + e.getMessage()); } } else { // Escape above Regex if (cmdEntry.startsWith("\\^")) { cmdEntry = cmdEntry.substring(1); } String cmd = cmdEntry .replaceAll("\\*", ".*"); // Wildcards are accepted as asterisk * as known universally. pattern = Pattern.compile(cmd + "( .*)?"); // This matches arguments, if present, to "ignore" them from the feature. } /* ================================ * >> Process cooldown value * ================================ */ Object value = section.get(cmdEntry); if (!(value instanceof Number) && value instanceof String) { try { value = Double.parseDouble(value.toString()); } catch (NumberFormatException ignored) { } } if (!(value instanceof Number)) { ess.getLogger().warning("Command cooldown error: '" + value + "' is not a valid cooldown"); continue; } double cooldown = ((Number) value).doubleValue(); if (cooldown < 1) { ess.getLogger().warning("Command cooldown with very short " + cooldown + " cooldown."); } result.put(pattern, (long) cooldown * 1000); // convert to milliseconds } return result; } @Override public boolean isCommandCooldownsEnabled() { return commandCooldowns != null; } @Override public long getCommandCooldownMs(String label) { Entry<Pattern, Long> result = getCommandCooldownEntry(label); return result != null ? result.getValue() : -1; // return cooldown in milliseconds } @Override public Entry<Pattern, Long> getCommandCooldownEntry(String label) { if (isCommandCooldownsEnabled()) { for (Entry<Pattern, Long> entry : this.commandCooldowns.entrySet()) { // Check if label matches current pattern (command-cooldown in config) if (entry.getKey().matcher(label).matches()) { return entry; } } } return null; } @Override public boolean isCommandCooldownPersistent(String label) { // TODO: enable per command cooldown specification for persistence. return config.getBoolean("command-cooldown-persistence", true); } private NumberFormat currencyFormat; private NumberFormat _getCurrencyFormat() { String currencyFormatString = config.getString("currency-format", "#,##0.00"); String symbolLocaleString = config.getString("currency-symbol-format-locale"); DecimalFormatSymbols decimalFormatSymbols; if (symbolLocaleString != null) { decimalFormatSymbols = DecimalFormatSymbols.getInstance(Locale.forLanguageTag(symbolLocaleString)); } else { // Fallback to the JVM's default locale decimalFormatSymbols = DecimalFormatSymbols.getInstance(); } DecimalFormat currencyFormat = new DecimalFormat(currencyFormatString, decimalFormatSymbols); currencyFormat.setRoundingMode(RoundingMode.FLOOR); // Updates NumberUtil#PRETTY_FORMAT field so that all of Essentials // can follow a single format. try { Field field = NumberUtil.class.getDeclaredField("PRETTY_FORMAT"); field.setAccessible(true); Field modifiersField = Field.class.getDeclaredField("modifiers"); modifiersField.setAccessible(true); modifiersField.setInt(field, field.getModifiers() & ~Modifier.FINAL); field.set(null, currencyFormat); modifiersField.setAccessible(false); field.setAccessible(false); } catch (NoSuchFieldException | IllegalAccessException e) { ess.getLogger().severe("Failed to apply custom currency format: " + e.getMessage()); if (isDebug()) { e.printStackTrace(); } } return currencyFormat; } @Override public NumberFormat getCurrencyFormat() { return this.currencyFormat; }
<<<<<<< || event.getReason() == TargetReason.PIG_ZOMBIE_TARGET) && prot.getSettingBool(ProtectConfig.prevent_entitytarget) ======= || event.getReason() == TargetReason.PIG_ZOMBIE_TARGET || event.getReason() == TargetReason.RANDOM_TARGET || event.getReason() == TargetReason.TARGET_ATTACKED_OWNER || event.getReason() == TargetReason.OWNER_ATTACKED_TARGET) && EssentialsProtect.guardSettings.get("protect.prevent.entitytarget") >>>>>>> || event.getReason() == TargetReason.PIG_ZOMBIE_TARGET || event.getReason() == TargetReason.RANDOM_TARGET || event.getReason() == TargetReason.TARGET_ATTACKED_OWNER || event.getReason() == TargetReason.OWNER_ATTACKED_TARGET) && prot.getSettingBool(ProtectConfig.prevent_entitytarget)
<<<<<<< NumberFormat getCurrencyFormat(); ======= boolean isTeleportToCenterLocation(); boolean isCommandCooldownsEnabled(); long getCommandCooldownMs(String label); Entry<Pattern, Long> getCommandCooldownEntry(String label); boolean isCommandCooldownPersistent(String label); >>>>>>> boolean isTeleportToCenterLocation(); boolean isCommandCooldownsEnabled(); long getCommandCooldownMs(String label); Entry<Pattern, Long> getCommandCooldownEntry(String label); boolean isCommandCooldownPersistent(String label); NumberFormat getCurrencyFormat();
<<<<<<< import com.amaze.filemanager.utils.CloudUtil; import com.amaze.filemanager.utils.CryptUtil; import com.amaze.filemanager.utils.Futils; import com.amaze.filemanager.utils.OTGUtil; ======= import com.amaze.filemanager.utils.cloud.CloudUtil; import com.amaze.filemanager.utils.files.CryptUtil; import com.amaze.filemanager.utils.files.Futils; >>>>>>> import com.amaze.filemanager.utils.OTGUtil; import com.amaze.filemanager.utils.cloud.CloudUtil; import com.amaze.filemanager.utils.files.CryptUtil; import com.amaze.filemanager.utils.files.Futils;
<<<<<<< * From the command line, you can configure git to use AWS code commit with a credential * helper. However, jgit does not support credential helper commands, but it does provider * a CredentialsProvider abstract class we can extend. ======= * From the command line, you can configure git to use AWS code commit with a * credential helper. However, jgit does not support credential helper commands, * but it does provider a CredentialsProvider abstract class we can extend. * </p> * Connecting to an AWS CodeCommit (codecommit) repository requires an AWS access key * and secret key. These are used to calculate a signature for the git request. The * AWS access key is used as the codecommit username, and the calculated signature * is used as the password. The process for calculating this signature is documented * very well at https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html. >>>>>>> * From the command line, you can configure git to use AWS code commit with a credential * helper. However, jgit does not support credential helper commands, but it does provider * a CredentialsProvider abstract class we can extend. Connecting to an AWS CodeCommit * (codecommit) repository requires an AWS access key and secret key. These are used to * calculate a signature for the git request. The AWS access key is used as the codecommit * username, and the calculated signature is used as the password. The process for * calculating this signature is documented very well at * https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html. <<<<<<< ======= /** * Calculate the AWS CodeCommit password for the provided URI and AWS secret key. * This uses the algorithm published by AWS at * https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html * @param uri the codecommit repository uri * @param awsSecretKey the aws secret key * @return the password to use in the git request */ protected static String calculateCodeCommitPassword(URIish uri, String awsSecretKey) { String[] split = uri.getHost().split("\\."); if (split.length < 4) { throw new CredentialException("Cannot detect AWS region from URI", null); } String region = split[1]; >>>>>>>
<<<<<<< import org.eclipse.jgit.api.errors.TransportException; ======= import org.eclipse.jgit.api.errors.InvalidRemoteException; import org.eclipse.jgit.api.errors.NotMergedException; import org.eclipse.jgit.lib.ObjectId; >>>>>>> import org.eclipse.jgit.api.errors.TransportException; import org.eclipse.jgit.api.errors.InvalidRemoteException; import org.eclipse.jgit.api.errors.NotMergedException; import org.eclipse.jgit.lib.ObjectId;
<<<<<<< import static org.mockito.Matchers.isNull; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; ======= import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; >>>>>>> import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; <<<<<<< import com.jcraft.jsch.HostKey; import com.jcraft.jsch.HostKeyRepository; import com.jcraft.jsch.JSch; import com.jcraft.jsch.Session; import com.jcraft.jsch.UserInfo; ======= import com.jcraft.jsch.HostKey; import com.jcraft.jsch.HostKeyRepository; import com.jcraft.jsch.JSch; import com.jcraft.jsch.Session; import com.jcraft.jsch.UserInfo; import static org.mockito.Matchers.any; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; >>>>>>> import com.jcraft.jsch.HostKey; import com.jcraft.jsch.HostKeyRepository; import com.jcraft.jsch.JSch; import com.jcraft.jsch.Session; import com.jcraft.jsch.UserInfo; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when;
<<<<<<< import java.io.File; import java.io.IOException; ======= import java.io.*; import java.util.ArrayList; >>>>>>> import java.io.File; import java.io.IOException; import java.util.ArrayList; <<<<<<< @Option(name = {"-o", "--old"}, description = "Provides the path to the old version of the jar.") ======= @Option(name = { "-o", "--old" }, description = "Provides the path to the old version(s) of the jar(s). Use ; to separate jar files.") >>>>>>> @Option(name = { "-o", "--old" }, description = "Provides the path to the old version(s) of the jar(s). Use ; to separate jar files.") <<<<<<< @Option(name = {"-n", "--new"}, description = "Provides the path to the new version of the jar.") ======= @Option(name = { "-n", "--new" }, description = "Provides the path to the new version(s) of the jar(s). Use ; to separate jar files.") >>>>>>> @Option(name = { "-n", "--new" }, description = "Provides the path to the new version(s) of the jar(s). Use ; to separate jar files.") <<<<<<< private void verifyExisting(File newArchive) { if (!newArchive.exists()) { throw JApiCmpException.of(JApiCmpException.Reason.CliError, "File '%s' does not exist.", newArchive.getAbsolutePath()); } } private void verifyJarArchive(File file) { JarFile jarFile = null; try { jarFile = new JarFile(file); } catch (IOException e) { throw JApiCmpException.of(JApiCmpException.Reason.CliError, "File '%s' could not be opened as a jar file: %s", file.getAbsolutePath(), e.getMessage()); } finally { if (jarFile != null) { try { jarFile.close(); } catch (IOException ignored) { } } } } ======= >>>>>>>
<<<<<<< import japicmp.util.Optional; import japicmp.model.*; ======= import com.google.common.base.Optional; import japicmp.model.JApiAnnotation; import japicmp.model.JApiAnnotationElement; import japicmp.model.JApiChangeStatus; import japicmp.model.JApiClass; import japicmp.model.JApiField; import japicmp.model.JApiMethod; >>>>>>> import japicmp.model.*;
<<<<<<< sb.append(signs).append(" ").append(jApiClass.getChangeStatus()).append(" ").append(jApiClass.getType()).append(javaObjectSerializationStatus(jApiClass)).append(": ") .append(accessModifierAsString(jApiClass)).append(abstractModifierAsString(jApiClass)).append(staticModifierAsString(jApiClass)) .append(finalModifierAsString(jApiClass)).append(jApiClass.getFullyQualifiedName()).append("\n"); ======= sb.append(signs + " " + jApiClass.getChangeStatus() + " " + processClassType(jApiClass) + ": " + accessModifierAsString(jApiClass) + abstractModifierAsString(jApiClass) + staticModifierAsString(jApiClass) + finalModifierAsString(jApiClass) + jApiClass.getFullyQualifiedName() + "\n"); >>>>>>> sb.append(signs + " " + jApiClass.getChangeStatus() + " " + processClassType(jApiClass) + ": " + accessModifierAsString(jApiClass) + abstractModifierAsString(jApiClass) + staticModifierAsString(jApiClass) + finalModifierAsString(jApiClass) + jApiClass.getFullyQualifiedName() + "\n"); <<<<<<< private String javaObjectSerializationStatus(JApiClass jApiClass) { String returnValue; JApiJavaObjectSerializationCompatibility.JApiJavaObjectSerializationChangeStatus status = jApiClass.getJavaObjectSerializationCompatible(); switch (status) { case SERIALIZABLE_COMPATIBLE: returnValue = " (serialization compatible)"; break; case SERIALIZABLE_INCOMPATIBLE: returnValue = " (serialization incompatible)"; break; case SERIALIZABLE_INCOMPATIBLE_BUT_SUID_EQUAL: returnValue = " (serialization incompatible but serialVersionUID equal)"; break; default: returnValue = ""; } return returnValue; } ======= private String processClassType(JApiClass jApiClass) { JApiClassType classType = jApiClass.getClassType(); switch (classType.getChangeStatus()) { case NEW: return classType.getNewType(); case REMOVED: return classType.getOldType(); case MODIFIED: return classType.getNewType() + " (<- " + classType.getOldType() + ") "; case UNCHANGED: return classType.getOldType(); } return "n.a."; } >>>>>>> private String processClassType(JApiClass jApiClass) { JApiClassType classType = jApiClass.getClassType(); switch (classType.getChangeStatus()) { case NEW: return classType.getNewType(); case REMOVED: return classType.getOldType(); case MODIFIED: return classType.getNewType() + " (<- " + classType.getOldType() + ") "; case UNCHANGED: return classType.getOldType(); } return "n.a."; } private String javaObjectSerializationStatus(JApiClass jApiClass) { String returnValue; JApiJavaObjectSerializationCompatibility.JApiJavaObjectSerializationChangeStatus status = jApiClass.getJavaObjectSerializationCompatible(); switch (status) { case SERIALIZABLE_COMPATIBLE: returnValue = " (serialization compatible)"; break; case SERIALIZABLE_INCOMPATIBLE: returnValue = " (serialization incompatible)"; break; case SERIALIZABLE_INCOMPATIBLE_BUT_SUID_EQUAL: returnValue = " (serialization incompatible but serialVersionUID equal)"; break; default: returnValue = ""; } return returnValue; }
<<<<<<< // Manage public members. HlaAttributeUpdater newObject = (HlaAttributeUpdater) super.clone(workspace); ======= HlaAttributeUpdater newObject = (HlaAttributeUpdater) super.clone(workspace); newObject._hlaManager = _hlaManager; newObject._useCertiMessageBuffer = _useCertiMessageBuffer; >>>>>>> // Manage public members. HlaAttributeUpdater newObject = (HlaAttributeUpdater) super.clone(workspace); newObject._hlaManager = _hlaManager; newObject._useCertiMessageBuffer = _useCertiMessageBuffer; <<<<<<< // FIXMEjc: add in HlaManager the name of this new actor: // updateHlaAttribute(HlaPublisher hp, Token in) _hlaManager.updateHlaAttribute(this, in); // FIXME: check if the log is correct ======= // FIXME: _hlaManager.updateHlaAttribute(this, in); >>>>>>> // FIXMEjc: add in HlaManager the name of this new actor: // updateHlaAttribute(HlaPublisher hp, Token in) _hlaManager.updateHlaAttribute(this, in); // FIXME: check if the log is correct
<<<<<<< import com.oneops.cms.md.service.CmsMdProcessor; ======= import org.apache.commons.lang3.StringUtils; >>>>>>> import com.oneops.cms.md.service.CmsMdProcessor; import org.apache.commons.lang3.StringUtils;
<<<<<<< try { LayoutElementParcelable layoutElement = new LayoutElementParcelable(name, aMFile.getPath(), "", "", Formatter.formatFileSize(getContext(), aMFile.length()), aMFile.length(), false, aMFile.lastModified() + "", false, getBoolean(PREFERENCE_SHOW_THUMB), OpenMode.SMB); searchHelper.add(layoutElement.generateBaseFile()); a.add(layoutElement); } catch (Exception e) { e.printStackTrace(); } ======= LayoutElementParcelable layoutElement = new LayoutElementParcelable(name, aMFile.getPath(), "", "", Formatter.formatFileSize(getContext(), aMFile.length()), aMFile.length(), false, aMFile.lastModified() + "", false, getBoolean(PREFERENCE_SHOW_THUMB)); layoutElement.setMode(OpenMode.SMB); searchHelper.add(layoutElement.generateBaseFile()); smbFileList.add(layoutElement); >>>>>>> LayoutElementParcelable layoutElement = new LayoutElementParcelable(name, aMFile.getPath(), "", "", Formatter.formatFileSize(getContext(), aMFile.length()), aMFile.length(), false, aMFile.lastModified() + "", false, getBoolean(PREFERENCE_SHOW_THUMB), OpenMode.SMB); layoutElement.setMode(OpenMode.SMB); searchHelper.add(layoutElement.generateBaseFile()); smbFileList.add(layoutElement);
<<<<<<< bomGenerationProcessor.processManifestPlatform(context, context.loadPlatformContext(platform), cloudRel, 1, false); ======= bomRfcProcessor.processManifestPlatform(context, context.loadPlatformContext(platform), cloudRel, 1, false); >>>>>>> bomGenerationProcessor.processManifestPlatform(context,
<<<<<<< public static final String BASE_PROVIDES = "base.Provides"; public static final String BASE_PLACED_IN = "base.PlacedIn"; ======= public static final String BASE_PROVIDES = "base.Provides" ; public static final String BASE_CONSUMES = "base.Consumes"; //manifest >>>>>>> public static final String BASE_PROVIDES = "base.Provides"; public static final String BASE_PLACED_IN = "base.PlacedIn"; public static final String BASE_PROVIDES = "base.Provides" ; public static final String BASE_CONSUMES = "base.Consumes"; //manifest <<<<<<< public static final String ZONE_CLASS = "cloud.Zone"; public static final String CLOUD_CLASS = "account.Cloud"; ======= >>>>>>> public static final String ZONE_CLASS = "cloud.Zone"; public static final String CLOUD_CLASS = "account.Cloud";
<<<<<<< ======= import io.fabric.sdk.android.Fabric; import java.text.DecimalFormat; >>>>>>> import io.fabric.sdk.android.Fabric; import java.text.DecimalFormat; <<<<<<< if (tempViewport.left == 0.0 || holdViewport.left == 0.0 || holdViewport.right >= (new Date().getTime())) { previewChart.setCurrentViewport(bgGraphBuilder.advanceViewport(chart, previewChart)); ======= if (tempViewport.left == 0.0 || holdViewport.left == 0.0 || holdViewport.right >= (new Date().getTime())) { previewChart.setCurrentViewport(bgGraphBuilder.advanceViewport(chart, previewChart), false); >>>>>>> if (tempViewport.left == 0.0 || holdViewport.left == 0.0 || holdViewport.right >= (new Date().getTime())) { previewChart.setCurrentViewport(bgGraphBuilder.advanceViewport(chart, previewChart));
<<<<<<< ======= import android.content.pm.PackageManager; import android.hardware.fingerprint.FingerprintManager; >>>>>>> import android.content.pm.PackageManager; import android.hardware.fingerprint.FingerprintManager; <<<<<<< import com.amaze.filemanager.ui.views.CheckBx; import com.amaze.filemanager.utils.MainActivityHelper; ======= import com.amaze.filemanager.activities.BaseActivity; import com.amaze.filemanager.ui.views.CheckBox; import com.amaze.filemanager.utils.Futils; >>>>>>> import com.amaze.filemanager.ui.views.CheckBox; import com.amaze.filemanager.utils.MainActivityHelper; <<<<<<< if(gplus.isChecked()){ boolean b= MainActivityHelper.checkAccountsPermission(getActivity()); if(!b) MainActivityHelper.requestAccountsPermission(getActivity()); ======= if (gplus.isChecked()) { boolean b = checkGplusPermission(); if (!b) requestGplusPermission(); >>>>>>> if(gplus.isChecked()){ boolean b= MainActivityHelper.checkAccountsPermission(getActivity()); if(!b) MainActivityHelper.requestAccountsPermission(getActivity());
<<<<<<< public void setBooks(ArrayList<String[]> books) { ======= public static synchronized void setBooks(ArrayList<String[]> books) { >>>>>>> public void synchronized setBooks(ArrayList<String[]> books) { <<<<<<< public void setStorages(ArrayList<String> storages) { this.storages = storages; ======= public static synchronized void setStorages(List<String> storages) { DataUtils.storages = storages; >>>>>>> public void synchronized setStorages(ArrayList<String> storages) { this.storages = storages;
<<<<<<< setupCache(); testMode = props.getBoolean("test.mode", false); if (testMode) { logger.info("Running in testMode."); } ======= this.globalProps = globalProps; >>>>>>> setupCache(); testMode = props.getBoolean("test.mode", false); if (testMode) { logger.info("Running in testMode."); } this.globalProps = globalProps;
<<<<<<< ======= public void updateDrawer(String path) { new AsyncTask<String, Void, Integer>() { @Override protected Integer doInBackground(String... strings) { String path = strings[0]; int k = 0, i = 0; String entryItemPathOld = ""; for (Item item : DataUtils.getList()) { if (!item.isSection()) { String entryItemPath = ((EntryItem) item).getPath(); if (path.contains(((EntryItem) item).getPath())) { if (entryItemPath.length() > entryItemPathOld.length()) { // we don't need to match with the quick search drawer items // whether current entry item path is bigger than the older one found, // for eg. when we have /storage and /storage/Movies as entry items // we would choose to highlight /storage/Movies in drawer adapter k = i; entryItemPathOld = entryItemPath; } } } i++; } return k; } @Override public void onPostExecute(Integer integers) { if (adapter != null) adapter.toggleChecked(integers); } }.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, path); } >>>>>>> <<<<<<< items.add(new SectionItem()); ArrayList<String[]> Servers = dataUtils.getServers(); if (Servers != null && Servers.size() > 0) { for (String[] file : Servers) { items.add(new EntryItem(file[0], file[1], ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_settings_remote_white_48dp))); ======= DataUtils.setStorages(storageDirectories); sectionItems.add(new SectionItem()); try { for (String[] file : grid.readTableSecondary(DataUtils.SMB)) servers.add(file); DataUtils.setServers(servers); if (servers.size() > 0) { Collections.sort(servers, new BookSorter()); for (String[] file : servers) sectionItems.add(new EntryItem(file[0], file[1], ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_settings_remote_white_48dp))); sectionItems.add(new SectionItem()); >>>>>>> DataUtils.setStorages(storageDirectories); sectionItems.add(new SectionItem()); try { for (String[] file : grid.readTableSecondary(DataUtils.SMB)) servers.add(file); DataUtils.setServers(servers); if (servers.size() > 0) { Collections.sort(servers, new BookSorter()); for (String[] file : servers) sectionItems.add(new EntryItem(file[0], file[1], ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_settings_remote_white_48dp))); sectionItems.add(new SectionItem()); <<<<<<< loadBooksAndMarkers(items); dataUtils.setList(items); return items; ======= for (String[] file : grid.readTableSecondary(DataUtils.BOOKS)) { books.add(file); } DataUtils.setBooks(books); if (books.size() > 0) { Collections.sort(books, new BookSorter()); for (String[] file : books) sectionItems.add(new EntryItem(file[0], file[1], ContextCompat.getDrawable(MainActivity.this, R.drawable .folder_fab))); sectionItems.add(new SectionItem()); } sectionItems.add(new EntryItem(getResources().getString(R.string.quick), "5", ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_star_white_18dp))); sectionItems.add(new EntryItem(getResources().getString(R.string.recent), "6", ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_history_white_48dp))); sectionItems.add(new EntryItem(getResources().getString(R.string.images), "0", ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_doc_image))); sectionItems.add(new EntryItem(getResources().getString(R.string.videos), "1", ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_doc_video_am))); sectionItems.add(new EntryItem(getResources().getString(R.string.audio), "2", ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_doc_audio_am))); sectionItems.add(new EntryItem(getResources().getString(R.string.documents), "3", ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_doc_doc_am))); sectionItems.add(new EntryItem(getResources().getString(R.string.apks), "4", ContextCompat.getDrawable(MainActivity.this, R.drawable.ic_doc_apk_grid))); DataUtils.setList(sectionItems); return sectionItems; >>>>>>> if(!sharedPref.contains(FoldersPref.KEY)) { for (String[] file : grid.readTableSecondary(DataUtils.BOOKS)) { books.add(file); } } else { ArrayList<FoldersPref.Shortcut> booksPref = FoldersPref.castStringListToTrioList(TinyDB.getList(sharedPref, String.class, FoldersPref.KEY, new ArrayList<String>())); for (FoldersPref.Shortcut t : booksPref) { if(t.enabled) { books.add(new String[] {t.name, t.directory}); } } } dataUtils.setBooks(books); if (sharedPref.getBoolean(PREFERENCE_SHOW_SIDEBAR_FOLDERS, true)) { if (books.size() > 0) { if (!sharedPref.contains(FoldersPref.KEY)) { Collections.sort(books, new BookSorter()); } for (String[] file : books) { sectionItems.add(new EntryItem(file[0], file[1], ContextCompat.getDrawable(this, R.drawable.folder_fab))); } sectionItems.add(new SectionItem()); } } Boolean[] quickAccessPref = TinyDB.getBooleanArray(sharedPref, QuickAccessPref.KEY, QuickAccessPref.DEFAULT); if (sharedPref.getBoolean(PREFERENCE_SHOW_SIDEBAR_QUICKACCESSES, true)) { if (quickAccessPref[0]) sectionItems.add(new EntryItem(getResources().getString(R.string.quick), "5", ContextCompat.getDrawable(this, R.drawable.ic_star_white_18dp))); if (quickAccessPref[1]) sectionItems.add(new EntryItem(getResources().getString(R.string.recent), "6", ContextCompat.getDrawable(this, R.drawable.ic_history_white_48dp))); if (quickAccessPref[2]) sectionItems.add(new EntryItem(getResources().getString(R.string.images), "0", ContextCompat.getDrawable(this, R.drawable.ic_doc_image))); if (quickAccessPref[3]) sectionItems.add(new EntryItem(getResources().getString(R.string.videos), "1", ContextCompat.getDrawable(this, R.drawable.ic_doc_video_am))); if (quickAccessPref[4]) sectionItems.add(new EntryItem(getResources().getString(R.string.audio), "2", ContextCompat.getDrawable(this, R.drawable.ic_doc_audio_am))); if (quickAccessPref[5]) sectionItems.add(new EntryItem(getResources().getString(R.string.documents), "3", ContextCompat.getDrawable(this, R.drawable.ic_doc_doc_am))); if (quickAccessPref[6]) sectionItems.add(new EntryItem(getResources().getString(R.string.apks), "4", ContextCompat.getDrawable(this, R.drawable.ic_doc_apk_grid))); } else { sectionItems.remove(items.size() - 1); //Deletes last divider } dataUtils.setList(sectionItems); return items;
<<<<<<< import com.amaze.filemanager.utils.AppConfig; import com.amaze.filemanager.utils.CryptUtil; ======= >>>>>>> <<<<<<< import static com.amaze.filemanager.utils.Futils.toHFileArray; ======= import static com.amaze.filemanager.utils.files.Futils.getFreeSpace; import static com.amaze.filemanager.utils.files.Futils.getTotalSpace; import static com.amaze.filemanager.utils.files.Futils.toHFileArray; >>>>>>> import static com.amaze.filemanager.utils.files.Futils.toHFileArray;
<<<<<<< private String executionPath; private HashMap<String, FlowProps> flowProps = new HashMap<String, FlowProps>(); private HashMap<String, ExecutableNode> executableNodes = new HashMap<String, ExecutableNode>(); private ArrayList<String> startNodes; private ArrayList<String> endNodes; ======= >>>>>>> <<<<<<< ======= private String executionPath; >>>>>>> private String executionPath; <<<<<<< public ExecutableFlow(Flow flow) { this.projectId = flow.getProjectId(); this.scheduleId = -1; this.flowId = flow.getId(); this.version = flow.getVersion(); this.setFlow(flow); } public ExecutableFlow(int executionId, Flow flow) { this.projectId = flow.getProjectId(); ======= public ExecutableFlow(Project project, Flow flow) { this.projectId = project.getId(); this.version = project.getVersion(); >>>>>>> public ExecutableFlow(Project project, Flow flow) { this.projectId = project.getId(); this.version = project.getVersion(); <<<<<<< this.flowId = flow.getId(); this.version = flow.getVersion(); this.executionId = executionId; this.setFlow(flow); ======= this.setFlow(project, flow); >>>>>>> this.setFlow(project, flow); <<<<<<< private void setFlow(Flow flow) { ======= protected void setFlow(Project project, Flow flow) { super.setFlow(project, flow); >>>>>>> protected void setFlow(Project project, Flow flow) { super.setFlow(project, flow); <<<<<<< for (Node node: flow.getNodes()) { String id = node.getId(); ExecutableNode exNode = new ExecutableNode(node, this); executableNodes.put(id, exNode); } for (Edge edge: flow.getEdges()) { ExecutableNode sourceNode = executableNodes.get(edge.getSourceId()); ExecutableNode targetNode = executableNodes.get(edge.getTargetId()); sourceNode.addOutNode(edge.getTargetId()); targetNode.addInNode(edge.getSourceId()); } ======= >>>>>>> <<<<<<< executionOptions.setMailCreator(flow.getMailCreator()); flowProps.putAll(flow.getAllFlowProps()); } public List<String> getStartNodes() { if (startNodes == null) { startNodes = new ArrayList<String>(); for (ExecutableNode node: executableNodes.values()) { if (node.getInNodes().isEmpty()) { startNodes.add(node.getJobId()); } } } return startNodes; } public List<String> getEndNodes() { if (endNodes == null) { endNodes = new ArrayList<String>(); for (ExecutableNode node: executableNodes.values()) { if (node.getOutNodes().isEmpty()) { endNodes.add(node.getJobId()); } } } return endNodes; } public boolean setNodeStatus(String nodeId, Status status) { ExecutableNode exNode = executableNodes.get(nodeId); if (exNode == null) { return false; } exNode.setStatus(status); return true; } public void setProxyNodes(int externalExecutionId, String nodeId) { ExecutableNode exNode = executableNodes.get(nodeId); if (exNode == null) { return; } exNode.setExternalExecutionId(externalExecutionId); ======= >>>>>>> <<<<<<< for (ExecutableNode node: executableNodes.values()) { node.setExecutionId(executionId); } } public String getFlowId() { return flowId; } public void setFlowId(String flowId) { this.flowId = flowId; ======= >>>>>>> <<<<<<< public void setSubmitTime(long time) { this.submitTime = time; } public Status getStatus() { return flowStatus; } public void setStatus(Status flowStatus) { this.flowStatus = flowStatus; ======= public void setSubmitTime(long submitTime) { this.submitTime = submitTime; >>>>>>> public void setSubmitTime(long submitTime) { this.submitTime = submitTime; <<<<<<< public Object toUpdateObject(long lastUpdateTime) { Map<String, Object> updateData = new HashMap<String, Object>(); updateData.put("execId", this.executionId); updateData.put("status", this.flowStatus.getNumVal()); updateData.put("startTime", this.startTime); updateData.put("endTime", this.endTime); updateData.put("updateTime", this.updateTime); List<Map<String, Object>> updatedNodes = new ArrayList<Map<String, Object>>(); for (ExecutableNode node: executableNodes.values()) { if (node.getUpdateTime() > lastUpdateTime) { Map<String, Object> updatedNodeMap = new HashMap<String, Object>(); updatedNodeMap.put("jobId", node.getJobId()); updatedNodeMap.put("status", node.getStatus().getNumVal()); updatedNodeMap.put("startTime", node.getStartTime()); updatedNodeMap.put("endTime", node.getEndTime()); updatedNodeMap.put("updateTime", node.getUpdateTime()); updatedNodeMap.put("attempt", node.getAttempt()); if (node.getAttempt() > 0) { ArrayList<Map<String, Object>> pastAttempts = new ArrayList<Map<String, Object>>(); for (Attempt attempt: node.getPastAttemptList()) { pastAttempts.add(attempt.toObject()); } updatedNodeMap.put("pastAttempts", pastAttempts); } updatedNodes.add(updatedNodeMap); } } updateData.put("nodes", updatedNodes); return updateData; } @SuppressWarnings("unchecked") public void applyUpdateObject(Map<String, Object> updateData) { List<Map<String, Object>> updatedNodes = (List<Map<String, Object>>)updateData.get("nodes"); for (Map<String, Object> node: updatedNodes) { String jobId = (String)node.get("jobId"); Status status = Status.fromInteger((Integer)node.get("status")); long startTime = JSONUtils.getLongFromObject(node.get("startTime")); long endTime = JSONUtils.getLongFromObject(node.get("endTime")); long updateTime = JSONUtils.getLongFromObject(node.get("updateTime")); ExecutableNode exNode = executableNodes.get(jobId); exNode.setEndTime(endTime); exNode.setStartTime(startTime); exNode.setUpdateTime(updateTime); exNode.setStatus(status); int attempt = 0; if (node.containsKey("attempt")) { attempt = (Integer)node.get("attempt"); if (attempt > 0) { exNode.updatePastAttempts((List<Object>)node.get("pastAttempts")); } } exNode.setAttempt(attempt); } this.flowStatus = Status.fromInteger((Integer)updateData.get("status")); this.startTime = JSONUtils.getLongFromObject(updateData.get("startTime")); this.endTime = JSONUtils.getLongFromObject(updateData.get("endTime")); this.updateTime = JSONUtils.getLongFromObject(updateData.get("updateTime")); ======= flowObj.put(SUBMITTIME_PARAM, submitTime); return flowObj; >>>>>>> flowObj.put(SUBMITTIME_PARAM, submitTime); return flowObj; <<<<<<< HashMap<String, Object> flowObj = (HashMap<String, Object>)obj; exFlow.executionId = (Integer)flowObj.get("executionId"); exFlow.executionPath = (String)flowObj.get("executionPath"); exFlow.flowId = (String)flowObj.get("flowId"); exFlow.projectId = (Integer)flowObj.get("projectId"); if (flowObj.containsKey("scheduleId")) { exFlow.scheduleId = (Integer)flowObj.get("scheduleId"); } exFlow.submitTime = JSONUtils.getLongFromObject(flowObj.get("submitTime")); exFlow.startTime = JSONUtils.getLongFromObject(flowObj.get("startTime")); exFlow.endTime = JSONUtils.getLongFromObject(flowObj.get("endTime")); exFlow.flowStatus = Status.valueOf((String)flowObj.get("status")); exFlow.submitUser = (String)flowObj.get("submitUser"); exFlow.version = (Integer)flowObj.get("version"); if (flowObj.containsKey("executionOptions")) { exFlow.executionOptions = ExecutionOptions.createFromObject(flowObj.get("executionOptions")); } else { // for backawards compatibility should remove in a few versions. exFlow.executionOptions = ExecutionOptions.createFromObject(flowObj); } // Copy nodes List<Object> nodes = (List<Object>)flowObj.get("nodes"); for (Object nodeObj: nodes) { ExecutableNode node = ExecutableNode.createNodeFromObject(nodeObj, exFlow); exFlow.executableNodes.put(node.getJobId(), node); } List<Object> properties = (List<Object>)flowObj.get("properties"); for (Object propNode: properties) { HashMap<String, Object> fprop = (HashMap<String, Object>)propNode; String source = (String)fprop.get("source"); String inheritedSource = (String)fprop.get("inherited"); FlowProps flowProps = new FlowProps(inheritedSource, source); exFlow.flowProps.put(source, flowProps); } if (flowObj.containsKey("proxyUsers")) { ArrayList<String> proxyUserList = (ArrayList<String>)flowObj.get("proxyUsers"); exFlow.addAllProxyUsers(proxyUserList); } ======= HashMap<String, Object> flowObj = (HashMap<String,Object>)obj; exFlow.fillExecutableFromMapObject(flowObj); >>>>>>> HashMap<String, Object> flowObj = (HashMap<String,Object>)obj; exFlow.fillExecutableFromMapObject(flowObj);
<<<<<<< private long _totalAttachmentSizeSoFar; ======= private boolean _usesAuth = true; >>>>>>> private long _totalAttachmentSizeSoFar; private boolean _usesAuth = true; <<<<<<< try { t.connect(_mailHost, _mailUser, _mailPassword); } catch (MessagingException ste) { if (ste.getCause() instanceof SocketTimeoutException) { try { // retry on SocketTimeoutException t.connect(_mailHost, _mailUser, _mailPassword); logger.info("Email retry on SocketTimeoutException succeeded"); } catch (MessagingException me) { logger.error("Email retry on SocketTimeoutException failed", me); throw me; } } else { logger.error("Encountered issue while connecting to email server", ste); throw ste; } } ======= if (_usesAuth) { t.connect(_mailHost, _mailUser, _mailPassword); } else { t.connect(); } >>>>>>> try { connectToSMTPServer(t); } catch (MessagingException ste) { if (ste.getCause() instanceof SocketTimeoutException) { try { // retry on SocketTimeoutException connectToSMTPServer(t); logger.info("Email retry on SocketTimeoutException succeeded"); } catch (MessagingException me) { logger.error("Email retry on SocketTimeoutException failed", me); throw me; } } else { logger.error("Encountered issue while connecting to email server", ste); throw ste; } }
<<<<<<< public static int MAX_FPS = 40; public static final int MIN_FPS_CONFIG = 1; public static final int MAX_FPS_CONFIG = 200; ======= public static int MAX_FPS = 50; >>>>>>> public static int MAX_FPS = 50; public static final int MIN_FPS_CONFIG = 1; public static final int MAX_FPS_CONFIG = 200; <<<<<<< screen = new Screen(new SpriteSheet(ImageIO.read(Game.class.getResourceAsStream("/icons.png")))); lightScreen = new Screen(new SpriteSheet(ImageIO.read(Game.class.getResourceAsStream("/icons.png")))); ======= screen = new Screen(new SpriteSheet(ImageIO.read(Game.class.getResourceAsStream ("/resources/icons.png")))); lightScreen = new Screen(new SpriteSheet(ImageIO.read(Game.class.getResourceAsStream ("/resources/icons.png")))); >>>>>>> screen = new Screen(new SpriteSheet(ImageIO.read(Game.class.getResourceAsStream ("/resources/icons.png")))); lightScreen = new Screen(new SpriteSheet(ImageIO.read(Game.class.getResourceAsStream ("/resources/icons.png")))); <<<<<<< Game.main = game; // sets the main game instance reference. ======= Game.main = game; >>>>>>> Game.main = game; // sets the main game instance reference.
<<<<<<< public Display menu; // the current menu you are on. ======= public Menu menu, newMenu; // the current menu you are on. >>>>>>> public Display menu, newMenu; // the current menu you are on. <<<<<<< Time(int ticks) { ======= Time(int ticks) { >>>>>>> Time(int ticks) { <<<<<<< public void setMenu(Display display) { Display parent = this.menu; this.menu = display; ======= public void setMenu(Menu menu) { this.newMenu = menu; >>>>>>> public void setMenu(Display display) { Display parent = this.menu; this.newMenu = display; <<<<<<< List<File> files = new ArrayList<File>(); if(top == null) { System.err.println("GAME: cannot search files of null folder."); return files; } ======= List<File> files = new ArrayList<>(); >>>>>>> List<File> files = new ArrayList<File>(); if(top == null) { System.err.println("GAME: cannot search files of null folder."); return files; } <<<<<<< if(top == null) return; if(top.isDirectory()) for(File subfile: top.listFiles()) deleteAllFiles(subfile); ======= if(top.isDirectory()) { File[] subfiles = top.listFiles(); if(subfiles != null) for (File subfile : subfiles) deleteAllFiles(subfile); } //noinspection ResultOfMethodCallIgnored >>>>>>> if(top == null) return; if(top.isDirectory()) { File[] subfiles = top.listFiles(); if(subfiles != null) for (File subfile : subfiles) deleteAllFiles(subfile); } //noinspection ResultOfMethodCallIgnored
<<<<<<< ======= import java.lang.ref.WeakReference; >>>>>>> import java.lang.ref.WeakReference; <<<<<<< public static MaterialDialog showBasicDialog(BasicActivity m, String[] texts) { int accentColor = m.getColorPreference().getColor(ColorUsage.ACCENT); MaterialDialog.Builder a = new MaterialDialog.Builder(m) ======= public static MaterialDialog showBasicDialog(Context c, String fabskin, AppTheme appTheme, String[] texts) { MaterialDialog.Builder a = new MaterialDialog.Builder(c) >>>>>>> public static MaterialDialog showBasicDialog(BasicActivity m, String[] texts) { int accentColor = m.getColorPreference().getColor(ColorUsage.ACCENT); MaterialDialog.Builder a = new MaterialDialog.Builder(m) <<<<<<< a.widgetColor(accentColor); ======= a.widgetColor(Color.parseColor(BaseActivity.accentSkin)); >>>>>>> a.widgetColor(accentColor); <<<<<<< a.positiveColor(accentColor); a.neutralText(texts[4]); if (texts[5] != (null)) { ======= a.positiveColor(Color.parseColor(BaseActivity.accentSkin)); if(texts[4] != null) { a.neutralText(texts[4]); } if (texts[5] != null) { >>>>>>> if(texts[4] != null) { a.neutralText(texts[4]); } if (texts[5] != null) { <<<<<<< return a.build(); ======= return a.build(); >>>>>>> return a.build();
<<<<<<< import android.animation.ArgbEvaluator; import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.DecelerateInterpolator; import android.widget.ImageView; ======= import java.util.ArrayList; import java.util.List; >>>>>>> import java.util.ArrayList; import java.util.List; import com.amaze.filemanager.R; import com.amaze.filemanager.activities.MainActivity; import com.amaze.filemanager.database.TabHandler; import com.amaze.filemanager.database.models.explorer.Tab; import com.amaze.filemanager.fragments.preference_fragments.PreferencesConstants; import com.amaze.filemanager.ui.ColorCircleDrawable; import com.amaze.filemanager.ui.colors.UserColorPreferences; import com.amaze.filemanager.ui.views.DisablableViewPager; import com.amaze.filemanager.ui.views.Indicator; import com.amaze.filemanager.utils.MainActivityHelper; import com.amaze.filemanager.utils.OpenMode; import com.amaze.filemanager.utils.PreferenceUtils; import android.animation.ArgbEvaluator; import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.DecelerateInterpolator; import android.widget.ImageView; <<<<<<< import java.util.ArrayList; import java.util.List; /** * Created by Arpit on 15-12-2014. */ public class TabFragment extends Fragment implements ViewPager.OnPageChangeListener { public List<Fragment> fragments = new ArrayList<>(); public ScreenSlidePagerAdapter mSectionsPagerAdapter; public DisablableViewPager mViewPager; // current visible tab, either 0 or 1 //public int currenttab; private MainActivity mainActivity; private boolean savepaths; private FragmentManager fragmentManager; private static final String KEY_POSITION = "pos"; private SharedPreferences sharedPrefs; private String path; // ink indicators for viewpager only for Lollipop+ private Indicator indicator; // views for circlular drawables below android lollipop private ImageView circleDrawable1, circleDrawable2; // color drawable for action bar background private ColorDrawable colorDrawable = new ColorDrawable(); // colors relative to current visible tab private @ColorInt int startColor, endColor; ======= import android.animation.ArgbEvaluator; import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.util.Log; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.DecelerateInterpolator; import android.widget.ImageView; >>>>>>> import android.animation.ArgbEvaluator; import android.content.SharedPreferences; import android.graphics.Color; import android.graphics.drawable.ColorDrawable; import android.os.Build; import android.os.Bundle; import android.preference.PreferenceManager; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.view.animation.DecelerateInterpolator; import android.widget.ImageView; <<<<<<< tabHandler = TabHandler.getInstance(); fragmentManager = getActivity().getSupportFragmentManager(); ======= // current visible tab, either 0 or 1 // public int currenttab; private MainActivity mainActivity; private boolean savepaths; private FragmentManager fragmentManager; >>>>>>> // current visible tab, either 0 or 1 // public int currenttab; private MainActivity mainActivity; private boolean savepaths; private FragmentManager fragmentManager; <<<<<<< if (getArguments() != null) { path = getArguments().getString("path"); } mainActivity = ((MainActivity) getActivity()); mainActivity.supportInvalidateOptionsMenu(); mViewPager.addOnPageChangeListener(this); mSectionsPagerAdapter = new ScreenSlidePagerAdapter(getActivity().getSupportFragmentManager()); if (savedInstanceState == null) { int lastOpenTab = sharedPrefs.getInt(PreferencesConstants.PREFERENCE_CURRENT_TAB, PreferenceUtils.DEFAULT_CURRENT_TAB); MainActivity.currentTab = lastOpenTab; Tab tab1 = tabHandler.findTab(1); Tab tab2 = tabHandler.findTab(2); Tab[] tabs = tabHandler.getAllTabs(); if (tabs == null || tabs.length < 1 || tab1 == null || tab2 == null) {// creating tabs in db for the first time, probably the first launch of app, or something got corrupted if (mainActivity.getDrawer().getFirstPath() != null) { addNewTab(1, mainActivity.getDrawer().getFirstPath()); } else { if (mainActivity.getDrawer().getSecondPath() != null) { addNewTab(1, mainActivity.getDrawer().getSecondPath()); } else { sharedPrefs.edit().putBoolean(PreferencesConstants.PREFERENCE_ROOTMODE, true).apply(); addNewTab(1, "/"); } } if (mainActivity.getDrawer().getSecondPath() != null) { addNewTab(2, mainActivity.getDrawer().getSecondPath()); } else { addNewTab(2, mainActivity.getDrawer().getFirstPath()); } } else { if (path != null && path.length() != 0) { if (lastOpenTab == 0) { addTab(tab1, path); addTab(tab2, ""); } if (lastOpenTab == 1) { addTab(tab1, ""); addTab(tab2, path); } } else { addTab(tab1, ""); addTab(tab2, ""); } } mViewPager.setAdapter(mSectionsPagerAdapter); try { mViewPager.setCurrentItem(lastOpenTab, true); if (circleDrawable1 != null && circleDrawable2 != null) { updateIndicator(mViewPager.getCurrentItem()); } } catch (Exception e) { e.printStackTrace(); } ======= // views for circlular drawables below android lollipop private ImageView circleDrawable1, circleDrawable2; >>>>>>> // views for circlular drawables below android lollipop private ImageView circleDrawable1, circleDrawable2; <<<<<<< Log.d(getClass().getSimpleName(), "Page Selected: " + MainActivity.currentTab, new Exception()); Fragment fragment = fragments.get(p1); if (fragment != null && fragment instanceof MainFragment) { MainFragment ma = (MainFragment) fragment; if (ma.getCurrentPath() != null) { mainActivity.getDrawer().selectCorrectDrawerItemForPath(ma.getCurrentPath()); mainActivity.getAppbar().getBottomBar().updatePath(ma.getCurrentPath(), ma.results, MainActivityHelper.SEARCH_TEXT, ma.openMode, ma.folder_count, ma.file_count, ma); } } ======= fragments.add(0, fragmentManager.getFragment(savedInstanceState, "tab" + 0)); fragments.add(1, fragmentManager.getFragment(savedInstanceState, "tab" + 1)); } catch (Exception e) { e.printStackTrace(); } >>>>>>> fragments.add(0, fragmentManager.getFragment(savedInstanceState, "tab" + 0)); fragments.add(1, fragmentManager.getFragment(savedInstanceState, "tab" + 1)); } catch (Exception e) { e.printStackTrace(); }
<<<<<<< isValid = validateConnection(connection, validateAction); LOGGER.logTransaction(DAL, transactionName, String.format(IS_VALID_FORMAT, isValid), startTime); if (!isValid) { LOGGER.warn(IS_VALID_RETURN_INFO); } ======= LOGGER.logTransaction(DalLogTypes.DAL_DATASOURCE, transactionName, String.format(IS_VALID_FORMAT, isValid), startTime); >>>>>>> isValid = validateConnection(connection, validateAction); LOGGER.logTransaction(DalLogTypes.DAL_DATASOURCE, transactionName, String.format(IS_VALID_FORMAT, isValid), startTime); if (!isValid) { LOGGER.warn(IS_VALID_RETURN_INFO); } <<<<<<< StringBuilder sb = new StringBuilder(); if (!isValid) { sb.append(IS_VALID_RETURN_INFO); sb.append(" "); // space } sb.append(String.format(VALIDATE_ERROR_FORMAT, e.getMessage())); LOGGER.warn(sb.toString()); LOGGER.logTransaction(DAL, transactionName, sb.toString(), e, startTime); ======= LOGGER.warn(String.format(VALIDATE_ERROR_FORMAT, e.getMessage())); LOGGER.logTransaction(DalLogTypes.DAL_DATASOURCE, transactionName, String.format(IS_VALID_FORMAT, isValid), e, startTime); >>>>>>> StringBuilder sb = new StringBuilder(); if (!isValid) { sb.append(IS_VALID_RETURN_INFO); sb.append(" "); // space } sb.append(String.format(VALIDATE_ERROR_FORMAT, e.getMessage())); LOGGER.warn(sb.toString()); LOGGER.logTransaction(DalLogTypes.DAL_DATASOURCE, transactionName, sb.toString(), e, startTime);
<<<<<<< ======= // We cast from string to integer ((String)testcasecountryproperty field `length` -> (Integer)testcaseexecutiondata field `length`) // if we can't, testCaseExecutionData field `length` will be equal to 0 int tccpLength = 0; try { tccpLength = Integer.parseInt(tccp.getLength()); } catch (NumberFormatException e) { LOG.info(e.toString()); } >>>>>>>
<<<<<<< + "conditionOper, conditionVal1Init, conditionVal2Init, conditionVal1, conditionVal2, manualExecution, UserAgent, queueId, system, robotdecli) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; ======= + "conditionOper, conditionVal1Init, conditionVal2Init, conditionVal1, conditionVal2, manualExecution, UserAgent, queueId, testCaseVersion) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; >>>>>>> + "conditionOper, conditionVal1Init, conditionVal2Init, conditionVal1, conditionVal2, manualExecution, UserAgent, queueId, testCaseVersion, system, robotdecli) " + "VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)"; <<<<<<< preStat.setString(i++, tCExecution.getSystem()); preStat.setString(i++, tCExecution.getRobotDecli()); ======= preStat.setInt(i++, tCExecution.getTestCaseVersion()); >>>>>>> preStat.setInt(i++, tCExecution.getTestCaseVersion()); preStat.setString(i++, tCExecution.getSystem()); preStat.setString(i++, tCExecution.getRobotDecli()); <<<<<<< + ", ConditionOper = ?, ConditionVal1Init = ?, ConditionVal2Init = ?, ConditionVal1 = ?, ConditionVal2 = ?, ManualExecution = ?, UserAgent = ?, queueId = ? , system = ? , robotdecli = ? WHERE id = ?"; ======= + ", ConditionOper = ?, ConditionVal1Init = ?, ConditionVal2Init = ?, ConditionVal1 = ?, ConditionVal2 = ?, ManualExecution = ?, UserAgent = ?, queueId = ?, testCaseVersion = ? WHERE id = ?"; >>>>>>> + ", ConditionOper = ?, ConditionVal1Init = ?, ConditionVal2Init = ?, ConditionVal1 = ?, ConditionVal2 = ?, ManualExecution = ?, UserAgent = ?, queueId = ?, testCaseVersion = ?, system = ? , robotdecli = ? WHERE id = ?"; <<<<<<< preStat.setString(i++, tCExecution.getSystem()); preStat.setString(i++, tCExecution.getRobotDecli()); ======= preStat.setInt(i++, tCExecution.getTestCaseVersion()); >>>>>>> preStat.setInt(i++, tCExecution.getTestCaseVersion()); preStat.setString(i++, tCExecution.getSystem()); preStat.setString(i++, tCExecution.getRobotDecli()); <<<<<<< conditionOper, conditionVal1Init, conditionVal2Init, conditionVal1, conditionVal2, manualExecution, userAgent, system, robotDecli); ======= conditionOper, conditionVal1Init, conditionVal2Init, conditionVal1, conditionVal2, manualExecution, userAgent, testCaseVersion ); >>>>>>> conditionOper, conditionVal1Init, conditionVal2Init, conditionVal1, conditionVal2, manualExecution, userAgent, testCaseVersion, system, robotDecli);
<<<<<<< ======= import java.util.Map; import org.cerberus.dto.TestCaseWithExecution; >>>>>>> import java.util.Map;
<<<<<<< CONDITIONEVAL_FAILED_IFELEMENTVISIBLE_MISSINGPARAMETER(1220, "FA", "Missing mandatory parameter for '%COND%'.", false, false, false, MessageGeneralEnum.EXECUTION_FA_CONDITION), CONDITIONEVAL_FAILED_IFELEMENTNOTVISIBLE_MISSINGPARAMETER(1220, "FA", "Missing mandatory parameter for '%COND%'.", false, false, false, MessageGeneralEnum.EXECUTION_FA_CONDITION), CONDITIONEVAL_FAILED_NOOBJECTINMEMORY(1220, "FA", "Cannot perform the control because no successfull Service/Page/Screen was accessed previously.", false, false, false, MessageGeneralEnum.EXECUTION_FA_CONDITION), ======= CONDITIONEVAL_FAILED_NOOBJECTINMEMORY(1220, "FA", "Cannot perform the control because no successful Service/Page/Screen was accessed previously.", false, false, false, MessageGeneralEnum.EXECUTION_FA_CONDITION), >>>>>>> CONDITIONEVAL_FAILED_IFELEMENTVISIBLE_MISSINGPARAMETER(1220, "FA", "Missing mandatory parameter for '%COND%'.", false, false, false, MessageGeneralEnum.EXECUTION_FA_CONDITION), CONDITIONEVAL_FAILED_IFELEMENTNOTVISIBLE_MISSINGPARAMETER(1220, "FA", "Missing mandatory parameter for '%COND%'.", false, false, false, MessageGeneralEnum.EXECUTION_FA_CONDITION), CONDITIONEVAL_FAILED_NOOBJECTINMEMORY(1220, "FA", "Cannot perform the control because no successful Service/Page/Screen was accessed previously.", false, false, false, MessageGeneralEnum.EXECUTION_FA_CONDITION),
<<<<<<< public static final String DRIVE = "drive", SMB = "smb", BOOKS = "books", HISTORY = "Table1", HIDDEN = "Table2", LIST = "list", GRID = "grid"; private ArrayList<String> hiddenfiles = new ArrayList<>(), gridfiles = new ArrayList<>(), listfiles = new ArrayList<>(), history = new ArrayList<>(), storages = new ArrayList<>(); private ArrayList<Item> list = new ArrayList<>(); private ArrayList<String[]> servers = new ArrayList<>(), books = new ArrayList<>(), accounts = new ArrayList<>(); ======= public static ArrayList<Item> list = new ArrayList<>(); public static ArrayList<String[]> servers = new ArrayList<>(), books = new ArrayList<>(); private static ArrayList<CloudStorage> accounts = new ArrayList<>(4); >>>>>>> public static final String DRIVE = "drive", SMB = "smb", BOOKS = "books", HISTORY = "Table1", HIDDEN = "Table2", LIST = "list", GRID = "grid"; private ArrayList<String> hiddenfiles = new ArrayList<>(), gridfiles = new ArrayList<>(), listfiles = new ArrayList<>(), history = new ArrayList<>(), storages = new ArrayList<>(); private ArrayList<Item> list = new ArrayList<>(); private ArrayList<String[]> servers = new ArrayList<>(), books = new ArrayList<>(); private ArrayList<CloudStorage> accounts = new ArrayList<>(4); <<<<<<< public int containsBooks(String[] a) { ======= public static int containsBooks(String[] a) { >>>>>>> public int containsBooks(String[] a) { <<<<<<< public int containsAccounts(String[] a) { ======= /*public static int containsAccounts(CloudEntry cloudEntry) { >>>>>>> /*public int containsAccounts(CloudEntry cloudEntry) { <<<<<<< public void removeAcc(int i) { if (accounts.size() > i) accounts.remove(i); ======= public static synchronized void removeAccount(OpenMode serviceType) { for (CloudStorage storage : accounts) { switch (serviceType) { case BOX: if (storage instanceof Box) accounts.remove(storage); break; case DROPBOX: if (storage instanceof Dropbox) accounts.remove(storage); break; case GDRIVE: if (storage instanceof GoogleDrive) accounts.remove(storage); break; case ONEDRIVE: if (storage instanceof OneDrive) accounts.remove(storage); break; default: return; } } >>>>>>> public synchronized void removeAccount(OpenMode serviceType) { for (CloudStorage storage : accounts) { switch (serviceType) { case BOX: if (storage instanceof Box) accounts.remove(storage); break; case DROPBOX: if (storage instanceof Dropbox) accounts.remove(storage); break; case GDRIVE: if (storage instanceof GoogleDrive) accounts.remove(storage); break; case ONEDRIVE: if (storage instanceof OneDrive) accounts.remove(storage); break; default: return; } } <<<<<<< public void addAcc(String[] i) { accounts.add(i); ======= public static synchronized void addAccount(CloudStorage storage) { accounts.add(storage); >>>>>>> public synchronized void addAccount(CloudStorage storage) { accounts.add(storage); <<<<<<< public void setAccounts(ArrayList<String[]> accounts) { ======= public static synchronized void setAccounts(ArrayList<CloudStorage> accounts) { >>>>>>> public synchronized void setAccounts(ArrayList<CloudStorage> accounts) { <<<<<<< public ArrayList<String[]> getServers() { ======= public static synchronized ArrayList<String[]> getServers() { >>>>>>> public synchronized ArrayList<String[]> getServers() { <<<<<<< public List<String> getStorages() { ======= public static synchronized List<String> getStorages() { >>>>>>> public synchronized List<String> getStorages() { <<<<<<< public void setList(ArrayList<Item> list) { this.list = list; ======= public static synchronized void setList(ArrayList<Item> list) { DataUtils.list = list; >>>>>>> public synchronized void setList(ArrayList<Item> list) { this.list = list;
<<<<<<< tcParameters.put("countries", countries); StringBuilder query = new StringBuilder("SELECT tec.*, app.system FROM testcase tec "); if(withLabelOrBattery) { query.append("LEFT OUTER JOIN application app ON app.application = tec.application ") .append("INNER JOIN testcasecountry tcc ON tcc.Test = tec.Test and tcc.TestCase = tec.TestCase ") .append("LEFT JOIN testbatterycontent tbc ON tbc.Test = tec.Test and tbc.TestCase = tec.TestCase ") .append("LEFT JOIN campaigncontent cpc ON cpc.testbattery = tbc.testbattery ") .append("LEFT JOIN testcaselabel tel ON tec.test = tel.test AND tec.testcase = tel.testcase ") .append("LEFT JOIN campaignlabel cpl ON cpl.labelId = tel.labelId ") .append("WHERE ((cpc.campaign = ?) OR (cpl.campaign = ?) )"); }else { query.append("LEFT OUTER JOIN application app ON app.application = tec.application ") ======= StringBuilder query = null; if (withLabelOrBattery) { query = new StringBuilder("SELECT tec.*, app.system ") .append("FROM testcase tec ") .append("LEFT OUTER JOIN application app ON app.application = tec.application ") .append("INNER JOIN testcasecountry tcc ON tcc.Test = tec.Test and tcc.TestCase = tec.TestCase ") .append("LEFT JOIN testbatterycontent tbc ON tbc.Test = tec.Test and tbc.TestCase = tec.TestCase ") .append("LEFT JOIN campaigncontent cpc ON cpc.testbattery = tbc.testbattery ") .append("LEFT JOIN testcaselabel tel ON tec.test = tel.test AND tec.testcase = tel.testcase ") .append("LEFT JOIN campaignlabel cpl ON cpl.labelId = tel.labelId ") .append("WHERE ((cpc.campaign = ?) OR (cpl.campaign = ?) )"); } else { query = new StringBuilder("SELECT tec.*, app.system ") .append("FROM testcase tec ") .append("LEFT OUTER JOIN application app ON app.application = tec.application ") >>>>>>> tcParameters.put("countries", countries); StringBuilder query = new StringBuilder("SELECT tec.*, app.system FROM testcase tec "); if(withLabelOrBattery) { query.append("LEFT OUTER JOIN application app ON app.application = tec.application ") .append("INNER JOIN testcasecountry tcc ON tcc.Test = tec.Test and tcc.TestCase = tec.TestCase ") .append("LEFT JOIN testbatterycontent tbc ON tbc.Test = tec.Test and tbc.TestCase = tec.TestCase ") .append("LEFT JOIN campaigncontent cpc ON cpc.testbattery = tbc.testbattery ") .append("LEFT JOIN testcaselabel tel ON tec.test = tel.test AND tec.testcase = tel.testcase ") .append("LEFT JOIN campaignlabel cpl ON cpl.labelId = tel.labelId ") .append("WHERE ((cpc.campaign = ?) OR (cpl.campaign = ?) )"); }else { query.append("LEFT OUTER JOIN application app ON app.application = tec.application ") <<<<<<< if(valeur != null && valeur.length > 0) { if(!cle.equals("system") && !cle.equals("countries")) { query.append(" AND tec."+cle+" in (?"); }else if(cle.equals("system")) { query.append(" AND app.system in (?"); }else { query.append(" AND tcc.Country in (?"); } if(valeur.length > 1) { for (int i = 0; i < valeur.length - 1; i++) { query.append(",?"); ======= if (valeur != null && cle != "system") { query.append(" AND tec." + cle + " in ("); for (int i = 0; i < valeur.length; i++) { query.append("?"); if (i < valeur.length - 1) { query.append(", "); } else { query.append(")"); } } } else if (valeur != null) { query.append(" AND app.system = ?"); for (int i = 0; i < valeur.length; i++) { query.append("?"); if (i < valeur.length - 1) { query.append(", "); } else { query.append(")"); } >>>>>>> if(valeur != null && valeur.length > 0) { if(!cle.equals("system") && !cle.equals("countries")) { query.append(" AND tec."+cle+" in (?"); }else if(cle.equals("system")) { query.append(" AND app.system in (?"); }else { query.append(" AND tcc.Country in (?"); } if(valeur.length > 1) { for (int i = 0; i < valeur.length - 1; i++) { query.append(",?"); <<<<<<< if(valeur != null && valeur.length > 0) { for (String c : valeur) { ======= if (valeur != null) { for (String c : valeur) { >>>>>>> if(valeur != null && valeur.length > 0) { for (String c : valeur) { <<<<<<< ======= for (String c : countries) { preStat.setString(i++, c); } >>>>>>>
<<<<<<< public static final String KEY_INTENT_PROCESS_VIEWER = "openprocesses"; public static final String TAG_INTENT_FILTER_FAILED_OPS = "failedOps"; public static final String TAG_INTENT_FILTER_GENERAL = "general_communications"; // the current visible tab, either 0 or 1 public static int currentTab; public static boolean isSearchViewEnabled = false; public static Shell.Interactive shellInteractive; public static Handler handler; ======= >>>>>>> public static final String KEY_INTENT_PROCESS_VIEWER = "openprocesses"; public static final String TAG_INTENT_FILTER_FAILED_OPS = "failedOps"; public static final String TAG_INTENT_FILTER_GENERAL = "general_communications"; // the current visible tab, either 0 or 1 public static int currentTab; public static boolean isSearchViewEnabled = false; public static Shell.Interactive shellInteractive; public static Handler handler; <<<<<<< unbindService(mEncryptServiceConnection); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { ======= if (SDK_INT >= Build.VERSION_CODES.KITKAT) { >>>>>>> unbindService(mEncryptServiceConnection); if (SDK_INT >= Build.VERSION_CODES.KITKAT) { <<<<<<< if (i.getStringArrayListExtra(TAG_INTENT_FILTER_FAILED_OPS) != null) { ArrayList<BaseFile> failedOps = i.getParcelableArrayListExtra(TAG_INTENT_FILTER_FAILED_OPS); if (failedOps != null) { ======= if (i.getStringArrayListExtra("failedOps") != null) { ArrayList<BaseFile> failedOps = i.getParcelableArrayListExtra("failedOps"); if (failedOps != null) >>>>>>> if (i.getStringArrayListExtra(TAG_INTENT_FILTER_FAILED_OPS) != null) { ArrayList<BaseFile> failedOps = i.getParcelableArrayListExtra(TAG_INTENT_FILTER_FAILED_OPS); if (failedOps != null) {
<<<<<<< } else if (storeItemTypeindex == 2) { //accessories ======= } else if (storeItemTypeindex == TYPE_ACCESSORIES) { //accessories dataSource.setCurrentAccessoriesValue(index); presenter.calculateAccessoryValue(index); >>>>>>> } else if (storeItemTypeindex == 2) { //accessories <<<<<<< case PowerUpUtils.TYPE_HAIR: ======= case TYPE_HAIR: dataSource.setPurchasedHair(index); >>>>>>> case TYPE_HAIR:
<<<<<<< ======= } else { // TODO: ractoc! fix this! :) nifty.publishEvent(getId(), new TreeItemSelectedEvent(this, item)); >>>>>>> <<<<<<< selectedItem.setActiveItem(true); ======= System.out.println("setting selected item " + selectedItem.getTreeItem().getDisplayCaption()); getListBox("#listbox").selectItem(selectedItem); >>>>>>> selectedItem.setActiveItem(true);
<<<<<<< private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; ======= private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ssZ"; private static final int MILLISECONDS_PER_SECOND = 1000; >>>>>>> private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ss'Z'"; private static final int MILLISECONDS_PER_SECOND = 1000;
<<<<<<< import java.util.LinkedHashMap; import java.util.Map; ======= >>>>>>> <<<<<<< public class MapEntry implements Map.Entry { private KeyMapEntry key; private Integer value; ======= public class MapEntry extends ImmutableEntry<ImmutableEntry<Integer, Integer>, Integer> { >>>>>>> public class MapEntry extends ImmutableEntry<ImmutableEntry<Integer, Integer>, Integer> {
<<<<<<< ======= import org.apache.commons.io.IOUtils; >>>>>>> import org.apache.commons.io.IOUtils; <<<<<<< import com.github.restdriver.serverdriver.http.AnyRequestModifier; import com.github.restdriver.serverdriver.http.Header; import com.github.restdriver.serverdriver.http.NoOpRequestProxy; import com.github.restdriver.serverdriver.http.RequestBody; import com.github.restdriver.serverdriver.http.RequestConnectionTimeout; import com.github.restdriver.serverdriver.http.RequestProxy; import com.github.restdriver.serverdriver.http.RequestSocketTimeout; import com.github.restdriver.serverdriver.http.RequestTimeout; import com.github.restdriver.serverdriver.http.ServerDriverHttpUriRequest; import com.github.restdriver.serverdriver.http.Url; ======= import com.github.restdriver.serverdriver.http.AnyRequestModifier; import com.github.restdriver.serverdriver.http.BodyableRequestModifier; import com.github.restdriver.serverdriver.http.ByteArrayRequestBody; import com.github.restdriver.serverdriver.http.Header; import com.github.restdriver.serverdriver.http.NoOpRequestProxy; import com.github.restdriver.serverdriver.http.RequestBody; import com.github.restdriver.serverdriver.http.RequestConnectionTimeout; import com.github.restdriver.serverdriver.http.RequestProxy; import com.github.restdriver.serverdriver.http.RequestSocketTimeout; import com.github.restdriver.serverdriver.http.RequestTimeout; import com.github.restdriver.serverdriver.http.ServerDriverHttpUriRequest; import com.github.restdriver.serverdriver.http.Url; >>>>>>> import com.github.restdriver.serverdriver.http.AnyRequestModifier; import com.github.restdriver.serverdriver.http.ByteArrayRequestBody; import com.github.restdriver.serverdriver.http.Header; import com.github.restdriver.serverdriver.http.NoOpRequestProxy; import com.github.restdriver.serverdriver.http.RequestBody; import com.github.restdriver.serverdriver.http.RequestConnectionTimeout; import com.github.restdriver.serverdriver.http.RequestProxy; import com.github.restdriver.serverdriver.http.RequestSocketTimeout; import com.github.restdriver.serverdriver.http.RequestTimeout; import com.github.restdriver.serverdriver.http.ServerDriverHttpUriRequest; import com.github.restdriver.serverdriver.http.Url;
<<<<<<< ======= >>>>>>>
<<<<<<< import static android.os.Build.VERSION_CODES.JELLY_BEAN; ======= import static com.amaze.filemanager.filesystem.ssh.SshConnectionPool.SSH_URI_PREFIX; >>>>>>> import static android.os.Build.VERSION_CODES.JELLY_BEAN; import static com.amaze.filemanager.filesystem.ssh.SshConnectionPool.SSH_URI_PREFIX;
<<<<<<< project = ((ProjectManagerImpl) projectManager).convertAndLoadProject(baseDir.getPath()); ======= for (ProjectOpenProcessor processor : ProjectOpenProcessor.EXTENSION_POINT_NAME.getExtensions()) { processor.refreshProjectFiles(projectDir); } project = ((ProjectManagerImpl) projectManager).convertAndLoadProject(baseDir.getPath(), cancelled); >>>>>>> for (ProjectOpenProcessor processor : ProjectOpenProcessor.EXTENSION_POINT_NAME.getExtensions()) { processor.refreshProjectFiles(projectDir); } project = ((ProjectManagerImpl) projectManager).convertAndLoadProject(baseDir.getPath());
<<<<<<< /** * Show changes made in the specified revision. * * @param project the project * @param revision the revision number * @param file the file affected by the revision * @param local pass true to let the diff be editable, i.e. making the revision "at the right" be a local (current) revision. * pass false to let both sides of the diff be non-editable. * @param revertable pass true to let "Revert" action be active. */ public static void showSubmittedFiles(final Project project, final String revision, final VirtualFile file, final boolean local, final boolean revertable) { new Task.Backgroundable(project, GitBundle.message("changes.retrieving", revision)) { public void run(@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); try { VirtualFile vcsRoot = getGitRoot(file); final CommittedChangeList changeList = GitChangeUtils.getRevisionChanges(project, vcsRoot, revision, true, local, revertable); if (changeList != null) { UIUtil.invokeLaterIfNeeded(new Runnable() { public void run() { AbstractVcsHelper.getInstance(project).showChangesListBrowser(changeList, GitBundle.message("paths.affected.title", revision)); } }); } } catch (final VcsException e) { UIUtil.invokeLaterIfNeeded(new Runnable() { public void run() { GitUIUtil.showOperationError(project, e, "git show"); } }); } } }.queue(); } ======= /** * Returns the tracking information (remote and the name of the remote branch), or null if we are not on a branch. */ @Nullable public static GitBranchTrackInfo getTrackInfoForCurrentBranch(@NotNull GitRepository repository) { GitBranch currentBranch = repository.getCurrentBranch(); if (currentBranch == null) { return null; } return GitBranchUtil.getTrackInfoForBranch(repository, currentBranch); } >>>>>>> /** * Show changes made in the specified revision. * * @param project the project * @param revision the revision number * @param file the file affected by the revision * @param local pass true to let the diff be editable, i.e. making the revision "at the right" be a local (current) revision. * pass false to let both sides of the diff be non-editable. * @param revertable pass true to let "Revert" action be active. */ public static void showSubmittedFiles(final Project project, final String revision, final VirtualFile file, final boolean local, final boolean revertable) { new Task.Backgroundable(project, GitBundle.message("changes.retrieving", revision)) { public void run(@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); try { VirtualFile vcsRoot = getGitRoot(file); final CommittedChangeList changeList = GitChangeUtils.getRevisionChanges(project, vcsRoot, revision, true, local, revertable); if (changeList != null) { UIUtil.invokeLaterIfNeeded(new Runnable() { public void run() { AbstractVcsHelper.getInstance(project).showChangesListBrowser(changeList, GitBundle.message("paths.affected.title", revision)); } }); } } catch (final VcsException e) { UIUtil.invokeLaterIfNeeded(new Runnable() { public void run() { GitUIUtil.showOperationError(project, e, "git show"); } }); } } }.queue(); } /** * Returns the tracking information (remote and the name of the remote branch), or null if we are not on a branch. */ @Nullable public static GitBranchTrackInfo getTrackInfoForCurrentBranch(@NotNull GitRepository repository) { GitBranch currentBranch = repository.getCurrentBranch(); if (currentBranch == null) { return null; } return GitBranchUtil.getTrackInfoForBranch(repository, currentBranch); }
<<<<<<< public void _testLoadingModules() throws IOException, JDOMException { CoreApplicationEnvironment appEnv = new CoreApplicationEnvironment(getTestRootDisposable()); ProjectModelEnvironment.registerApplicationEnvironment(appEnv); CoreProjectEnvironment prjEnv = new CoreProjectEnvironment(getTestRootDisposable(), appEnv); ProjectModelEnvironment.registerProjectEnvironment(prjEnv); ======= public void _testLoadingModules() throws IOException, JDOMException, InvalidDataException { CoreEnvironment env = new CoreEnvironment(getTestRootDisposable()); ProjectModelEnvironment.register(env); >>>>>>> public void _testLoadingModules() throws IOException, JDOMException, InvalidDataException { CoreApplicationEnvironment appEnv = new CoreApplicationEnvironment(getTestRootDisposable()); ProjectModelEnvironment.registerApplicationEnvironment(appEnv); CoreProjectEnvironment prjEnv = new CoreProjectEnvironment(getTestRootDisposable(), appEnv); ProjectModelEnvironment.registerProjectEnvironment(prjEnv);
<<<<<<< import com.intellij.openapi.vcs.FilePathImpl; import com.intellij.openapi.vcs.FileStatus; ======= >>>>>>> import com.intellij.openapi.vcs.FileStatus; <<<<<<< h.addRelativePaths(filePath); parser.parseStatusBeforeName(true); ======= parser.setNameInOutput(true); >>>>>>> parser.parseStatusBeforeName(true); <<<<<<< final GitLogRecord record = parser.parseOneRecord(output); final List<Change> changes = record.coolChangesParser(project, root); final Change change = changes.get(0); if (change.isMoved() || change.isRenamed()) { final List<FilePath> paths = record.getFilePaths(root); ======= final List<GitLogRecord> records = parser.parse(output); // we have information about all changed files of the commit. Extracting information about the file we need. GitLogRecord fileRecord = null; for (GitLogRecord record : records) { final List<String> paths = record.getPaths(); if (!paths.isEmpty()) { String path = paths.get(paths.size()-1); // if the file is renamed, it has 2 paths - we are looking for the new name. if (path.equals(GitUtil.relativePath(root, filePath))) { fileRecord = record; break; } } } if (fileRecord != null && fileRecord.getNameStatus() == 'R') { final List<FilePath> paths = fileRecord.getFilePaths(root); >>>>>>> final List<GitLogRecord> records = parser.parse(output); // we have information about all changed files of the commit. Extracting information about the file we need. GitLogRecord fileRecord = null; for (GitLogRecord record : records) { final List<String> paths = record.getPaths(); if (!paths.isEmpty()) { String path = paths.get(paths.size()-1); // if the file is renamed, it has 2 paths - we are looking for the new name. if (path.equals(GitUtil.relativePath(root, filePath))) { fileRecord = record; break; } } } if (fileRecord != null) { final List<Change> changes = fileRecord.coolChangesParser(project, root); final Change change = changes.get(0); if (change.isMoved() || change.isRenamed()) { final List<FilePath> paths = fileRecord.getFilePaths(root); <<<<<<< // adjust path using change manager path = getLastCommitName(project, path); GitSimpleHandler h = new GitSimpleHandler(project, root, GitCommand.LOG); GitLogParser parser = new GitLogParser(HASH, COMMIT_TIME, AUTHOR_NAME, AUTHOR_EMAIL, COMMITTER_NAME, COMMITTER_EMAIL, SUBJECT, BODY); h.setNoSSH(true); h.setStdoutSuppressed(true); h.addParameters("-M", "--follow", "--name-only", parser.getPretty(), "--encoding=UTF-8"); parser.parseStatusBeforeName(false); if (parameters != null && parameters.length > 0) { h.addParameters(parameters); } h.endOptions(); h.addRelativePaths(path); String output = h.run(); final List<GitLogRecord> result = parser.parse(output); ======= >>>>>>>
<<<<<<< import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.util.InheritanceUtil; ======= >>>>>>> import com.intellij.psi.search.GlobalSearchScope; import com.intellij.psi.util.InheritanceUtil; <<<<<<< import com.intellij.util.containers.MultiMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList; import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrNamedArgument; ======= import gnu.trove.THashMap; import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement; >>>>>>> import com.intellij.util.containers.MultiMap; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElement; import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrArgumentList; import org.jetbrains.plugins.groovy.lang.psi.api.statements.arguments.GrNamedArgument; <<<<<<< import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; ======= import java.util.ArrayList; import java.util.List; import java.util.Map; >>>>>>> import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; <<<<<<< public static class ArgInfo { public static final ArgInfo[] EMPTY_ARRAY = new ArgInfo[0]; public List<PsiElement> args; public final boolean isMultiArg; public ArgInfo(List<PsiElement> args, boolean multiArg) { this.args = args; isMultiArg = multiArg; } } /** * Returns array of lists which contain psiElements mapped to parameters * * @param signature * @param list * @return null if signature can not be applied to this argumentList */ @Nullable public static ArgInfo[] mapParametersToArguments(@NotNull GrClosureSignature signature, @NotNull GrArgumentList list, PsiManager manager, GlobalSearchScope scope) { ArgInfo[] map = map(signature, list, manager, scope); if (map != null) return map; if (signature.isVarargs()) { return new ApplicabilityMapperForVararg(manager, scope, list, signature).map(); } return null; } @Nullable private static ArgInfo[] map(@NotNull GrClosureSignature signature, @NotNull GrArgumentList list, PsiManager manager, GlobalSearchScope scope) { final GrExpression[] args = list.getExpressionArguments(); final GrNamedArgument[] namedArgs = list.getNamedArguments(); boolean hasNamedArgs = namedArgs.length > 0; GrClosureParameter[] params = signature.getParameters(); ArgInfo[] map = new ArgInfo[params.length]; int paramLength = params.length; if (hasNamedArgs) { if (paramLength == 0) return null; PsiType type = params[0].getType(); if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_MAP)) { paramLength--; map[0] = new ArgInfo(Arrays.<PsiElement>asList(namedArgs), true); } else { return null; } } if (args.length > paramLength && !signature.isVarargs()) return null; int optional = getOptionalParamCount(signature, hasNamedArgs); int notOptional = paramLength - optional; if (signature.isVarargs()) notOptional--; if (notOptional > args.length) return null; int curParam = 0; optional = args.length - notOptional; if (hasNamedArgs) curParam++; for (int curArg = 0; curArg < args.length; curArg++, curParam++) { while (optional == 0 && curParam < params.length && params[curParam].isOptional()) { map[curParam] = new ArgInfo(Collections.<PsiElement>emptyList(), false); curParam++; } if (curParam == params.length) return null; if (params[curParam].isOptional()) optional--; if (TypesUtil.isAssignableByMethodCallConversion(params[curParam].getType(), args[curArg].getType(), manager, scope)) { map[curParam] = new ArgInfo(Collections.<PsiElement>singletonList(args[curArg]), false); } else { return null; } } for (; curParam < params.length; curParam++) map[curParam] = new ArgInfo(Collections.<PsiElement>emptyList(), false); return map; } private static class ApplicabilityMapperForVararg { private PsiManager manager; private GlobalSearchScope scope; private GrExpression[] args; private PsiType[] types; private GrNamedArgument[] namedArgs; private int paramLength; private GrClosureParameter[] params; private PsiType vararg; public ApplicabilityMapperForVararg(PsiManager manager, GlobalSearchScope scope, GrArgumentList list, GrClosureSignature signature) { this.manager = manager; this.scope = scope; args = list.getExpressionArguments(); namedArgs = list.getNamedArguments(); params = signature.getParameters(); paramLength = params.length - 1; vararg = ((PsiArrayType)params[paramLength].getType()).getComponentType(); types = new PsiType[args.length]; for (int i = 0; i < args.length; i++) { types[i] = args[i].getType(); } } @Nullable public ArgInfo[] map() { boolean hasNamedArgs = namedArgs.length > 0; ArgInfo[] map = new ArgInfo[params.length]; if (hasNamedArgs) { if (params.length == 0) return null; PsiType type = params[0].getType(); if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_MAP)) { map[0] = new ArgInfo(Arrays.<PsiElement>asList(namedArgs), true); } else { return null; } } int start = hasNamedArgs ? 1 : 0; int notOptionals = 0; for (int i = start; i < paramLength; i++) { if (!params[i].isOptional()) notOptionals++; } return mapInternal(start, 0, false, notOptionals, map); } @Nullable private ArgInfo[] mapInternal(int curParam, int curArg, boolean skipOptionals, int notOptional, ArgInfo[] map) { if (notOptional > args.length - curArg) return null; if (notOptional == args.length - curArg) skipOptionals = true; while (curArg < args.length) { if (skipOptionals) { while (curParam < paramLength && params[curParam].isOptional()) curParam++; } if (curParam == paramLength) break; if (params[curParam].isOptional()) { if (TypesUtil.isAssignable(params[curParam].getType(), types[curArg], manager, scope)) { ArgInfo[] copy = mapInternal(curParam + 1, curArg + 1, false, notOptional, copyMap(map)); if (copy != null) return copy; } skipOptionals = true; } else { if (!TypesUtil.isAssignableByMethodCallConversion(params[curParam].getType(), types[curArg], manager, scope)) return null; map[curParam] = new ArgInfo(Collections.<PsiElement>singletonList(args[curArg]), false); notOptional--; curArg++; curParam++; } } map[paramLength] = new ArgInfo(new ArrayList<PsiElement>(args.length - curArg), true); for (; curArg < args.length; curArg++) { if (!TypesUtil.isAssignableByMethodCallConversion(vararg, types[curArg], manager, scope)) return null; map[paramLength].args.add(args[curArg]); } return map; } private static ArgInfo[] copyMap(ArgInfo[] map) { ArgInfo[] copy = new ArgInfo[map.length]; System.arraycopy(map, 0, copy, 0, map.length); return copy; } } ======= >>>>>>> public static class ArgInfo { public static final ArgInfo[] EMPTY_ARRAY = new ArgInfo[0]; public List<PsiElement> args; public final boolean isMultiArg; public ArgInfo(List<PsiElement> args, boolean multiArg) { this.args = args; isMultiArg = multiArg; } } /** * Returns array of lists which contain psiElements mapped to parameters * * @param signature * @param list * @return null if signature can not be applied to this argumentList */ @Nullable public static ArgInfo[] mapParametersToArguments(@NotNull GrClosureSignature signature, @NotNull GrArgumentList list, PsiManager manager, GlobalSearchScope scope) { ArgInfo[] map = map(signature, list, manager, scope); if (map != null) return map; if (signature.isVarargs()) { return new ApplicabilityMapperForVararg(manager, scope, list, signature).map(); } return null; } @Nullable private static ArgInfo[] map(@NotNull GrClosureSignature signature, @NotNull GrArgumentList list, PsiManager manager, GlobalSearchScope scope) { final GrExpression[] args = list.getExpressionArguments(); final GrNamedArgument[] namedArgs = list.getNamedArguments(); boolean hasNamedArgs = namedArgs.length > 0; GrClosureParameter[] params = signature.getParameters(); ArgInfo[] map = new ArgInfo[params.length]; int paramLength = params.length; if (hasNamedArgs) { if (paramLength == 0) return null; PsiType type = params[0].getType(); if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_MAP)) { paramLength--; map[0] = new ArgInfo(Arrays.<PsiElement>asList(namedArgs), true); } else { return null; } } if (args.length > paramLength && !signature.isVarargs()) return null; int optional = getOptionalParamCount(signature, hasNamedArgs); int notOptional = paramLength - optional; if (signature.isVarargs()) notOptional--; if (notOptional > args.length) return null; int curParam = 0; optional = args.length - notOptional; if (hasNamedArgs) curParam++; for (int curArg = 0; curArg < args.length; curArg++, curParam++) { while (optional == 0 && curParam < params.length && params[curParam].isOptional()) { map[curParam] = new ArgInfo(Collections.<PsiElement>emptyList(), false); curParam++; } if (curParam == params.length) return null; if (params[curParam].isOptional()) optional--; if (TypesUtil.isAssignableByMethodCallConversion(params[curParam].getType(), args[curArg].getType(), manager, scope)) { map[curParam] = new ArgInfo(Collections.<PsiElement>singletonList(args[curArg]), false); } else { return null; } } for (; curParam < params.length; curParam++) map[curParam] = new ArgInfo(Collections.<PsiElement>emptyList(), false); return map; } private static class ApplicabilityMapperForVararg { private PsiManager manager; private GlobalSearchScope scope; private GrExpression[] args; private PsiType[] types; private GrNamedArgument[] namedArgs; private int paramLength; private GrClosureParameter[] params; private PsiType vararg; public ApplicabilityMapperForVararg(PsiManager manager, GlobalSearchScope scope, GrArgumentList list, GrClosureSignature signature) { this.manager = manager; this.scope = scope; args = list.getExpressionArguments(); namedArgs = list.getNamedArguments(); params = signature.getParameters(); paramLength = params.length - 1; vararg = ((PsiArrayType)params[paramLength].getType()).getComponentType(); types = new PsiType[args.length]; for (int i = 0; i < args.length; i++) { types[i] = args[i].getType(); } } @Nullable public ArgInfo[] map() { boolean hasNamedArgs = namedArgs.length > 0; ArgInfo[] map = new ArgInfo[params.length]; if (hasNamedArgs) { if (params.length == 0) return null; PsiType type = params[0].getType(); if (InheritanceUtil.isInheritor(type, CommonClassNames.JAVA_UTIL_MAP)) { map[0] = new ArgInfo(Arrays.<PsiElement>asList(namedArgs), true); } else { return null; } } int start = hasNamedArgs ? 1 : 0; int notOptionals = 0; for (int i = start; i < paramLength; i++) { if (!params[i].isOptional()) notOptionals++; } return mapInternal(start, 0, false, notOptionals, map); } @Nullable private ArgInfo[] mapInternal(int curParam, int curArg, boolean skipOptionals, int notOptional, ArgInfo[] map) { if (notOptional > args.length - curArg) return null; if (notOptional == args.length - curArg) skipOptionals = true; while (curArg < args.length) { if (skipOptionals) { while (curParam < paramLength && params[curParam].isOptional()) curParam++; } if (curParam == paramLength) break; if (params[curParam].isOptional()) { if (TypesUtil.isAssignable(params[curParam].getType(), types[curArg], manager, scope)) { ArgInfo[] copy = mapInternal(curParam + 1, curArg + 1, false, notOptional, copyMap(map)); if (copy != null) return copy; } skipOptionals = true; } else { if (!TypesUtil.isAssignableByMethodCallConversion(params[curParam].getType(), types[curArg], manager, scope)) return null; map[curParam] = new ArgInfo(Collections.<PsiElement>singletonList(args[curArg]), false); notOptional--; curArg++; curParam++; } } map[paramLength] = new ArgInfo(new ArrayList<PsiElement>(args.length - curArg), true); for (; curArg < args.length; curArg++) { if (!TypesUtil.isAssignableByMethodCallConversion(vararg, types[curArg], manager, scope)) return null; map[paramLength].args.add(args[curArg]); } return map; } private static ArgInfo[] copyMap(ArgInfo[] map) { ArgInfo[] copy = new ArgInfo[map.length]; System.arraycopy(map, 0, copy, 0, map.length); return copy; } }
<<<<<<< ======= //String itemsstring = res.getString(R.string.items);// TODO: 23/5/2017 use or delete >>>>>>> //String itemsstring = res.getString(R.string.items);// TODO: 23/5/2017 use or delete
<<<<<<< import javax.annotation.Nonnull; import javax.annotation.Nullable; ======= import hudson.util.ListBoxModel; import jenkins.model.Jenkins; >>>>>>> import javax.annotation.Nonnull; import javax.annotation.Nullable; import hudson.util.ListBoxModel; import jenkins.model.Jenkins; <<<<<<< @DataBoundConstructor public ListSubversionTagsParameterDefinition(String name, String tagsDir, String tagsFilter, String defaultValue, String maxTags, boolean reverseByDate, boolean reverseByName) { ======= /** * We use a UUID to uniquely identify each use of this parameter: We need this * to find the project using this parameter in the getTags() method (which is * called before the build takes place). */ private final UUID uuid; /** @deprecated */ @Deprecated public ListSubversionTagsParameterDefinition(String name, String tagsDir, String tagsFilter, String defaultValue, String maxTags, boolean reverseByDate, boolean reverseByName, String uuid) { this(name, tagsDir, tagsFilter, defaultValue, maxTags, reverseByDate, reverseByName, uuid, null); } @DataBoundConstructor public ListSubversionTagsParameterDefinition(String name, String tagsDir, String tagsFilter, String defaultValue, String maxTags, boolean reverseByDate, boolean reverseByName, String uuid, String credentialsId) { >>>>>>> /** @deprecated */ @Deprecated public ListSubversionTagsParameterDefinition(String name, String tagsDir, String tagsFilter, String defaultValue, String maxTags, boolean reverseByDate, boolean reverseByName, String uuid) { this(name, tagsDir, tagsFilter, defaultValue, maxTags, reverseByDate, reverseByName, uuid, null); } @DataBoundConstructor public ListSubversionTagsParameterDefinition(String name, String tagsDir, String tagsFilter, String defaultValue, String maxTags, boolean reverseByDate, boolean reverseByName, String uuid, String credentialsId) { <<<<<<< ======= if(uuid == null || uuid.length() == 0) { this.uuid = UUID.randomUUID(); } else { this.uuid = UUID.fromString(uuid); } this.credentialsId = credentialsId; >>>>>>> this.credentialsId = credentialsId;
<<<<<<< import com.amaze.filemanager.fragments.Main; import com.amaze.filemanager.fragments.preference_fragments.Preffrag; ======= import com.amaze.filemanager.fragments.MainFragment; >>>>>>> import com.amaze.filemanager.fragments.preference_fragments.Preffrag; import com.amaze.filemanager.fragments.MainFragment;