conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
import hunternif.mc.atlas.ext.watcher.*;
import hunternif.mc.atlas.ext.watcher.impl.StructureWatcherFortress;
import hunternif.mc.atlas.ext.watcher.impl.StructureWatcherGeneric;
import hunternif.mc.atlas.ext.watcher.impl.StructureWatcherVillage;
import hunternif.mc.atlas.item.ItemAtlas;
import hunternif.mc.atlas.item.ItemEmptyAtlas;
import hunternif.mc.atlas.item.RecipeAtlasCloning;
import hunternif.mc.atlas.item.RecipeAtlasCombining;
>>>>>>>
import hunternif.mc.atlas.ext.watcher.*;
import hunternif.mc.atlas.ext.watcher.impl.StructureWatcherFortress;
import hunternif.mc.atlas.ext.watcher.impl.StructureWatcherGeneric;
import hunternif.mc.atlas.ext.watcher.impl.StructureWatcherVillage;
import hunternif.mc.atlas.item.ItemAtlas;
import hunternif.mc.atlas.item.ItemEmptyAtlas;
import hunternif.mc.atlas.item.RecipeAtlasCloning;
import hunternif.mc.atlas.item.RecipeAtlasCombining;
<<<<<<<
=======
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.DimensionType;
>>>>>>>
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.world.DimensionType;
<<<<<<<
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
=======
import net.minecraftforge.fml.common.event.*;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.oredict.RecipeSorter;
>>>>>>>
import net.minecraftforge.fml.common.event.FMLInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
<<<<<<<
=======
@EventHandler
public void onMissingMapping(FMLMissingMappingsEvent event) {
Log.info("Repairing missing mappings");
for (FMLMissingMappingsEvent.MissingMapping mapping : event.get()) {
String resourcePath = mapping.resourceLocation.getResourcePath();
if (mapping.type == GameRegistry.Type.ITEM) {
if ("antiqueatlas".equalsIgnoreCase(resourcePath)) {
mapping.remap(itemAtlas);
} else if ("emptyantiqueatlas".equalsIgnoreCase(resourcePath)) {
mapping.remap(itemEmptyAtlas);
}
}
}
}
@EventHandler
public void onServerStop(FMLServerStoppedEvent event) {
Log.info("Clearing visited locations");
StructureWatcher.INSTANCE.handleShutdown();
}
>>>>>>> |
<<<<<<<
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.registry.RegistryKey;
=======
>>>>>>>
import net.minecraft.util.registry.RegistryKey;
<<<<<<<
.getMarkersAtChunk(world.getDimensionRegistryKey(), chunkX / MarkersData.CHUNK_STEP,
chunkZ / MarkersData.CHUNK_STEP);
=======
.getMarkersAtChunk(world.getDimensionRegistryKey(), chunkX / MarkersData.CHUNK_STEP, chunkZ / MarkersData.CHUNK_STEP);
>>>>>>>
.getMarkersAtChunk(world.getDimensionRegistryKey(), chunkX / MarkersData.CHUNK_STEP, chunkZ / MarkersData.CHUNK_STEP); |
<<<<<<<
private final List<IButtonListener> listeners = new ArrayList<IButtonListener>();
=======
private static final ResourceLocation DEFAULT_CLICK_SOUND = new ResourceLocation("gui.button.press");
private final List<IButtonListener> listeners = new ArrayList<>();
>>>>>>>
private final List<IButtonListener> listeners = new ArrayList<>(); |
<<<<<<<
private boolean _annotationsPopUpEnabled = true;
=======
private boolean _pitchEnabled = true;
>>>>>>>
private boolean _pitchEnabled = true;
<<<<<<<
public void setAnnotationsPopUpEnabled(boolean value) {
_annotationsPopUpEnabled = value;
}
=======
public void setPitchEnabled(boolean value) {
if (_pitchEnabled == value) { return; }
_pitchEnabled = value;
if (_map != null) {
_map.getUiSettings().setTiltGesturesEnabled(value);
}
}
>>>>>>>
public void setPitchEnabled(boolean value) {
if (_pitchEnabled == value) { return; }
_pitchEnabled = value;
if (_map != null) {
_map.getUiSettings().setTiltGesturesEnabled(value);
}
}
public void setAnnotationsPopUpEnabled(boolean value) {
_annotationsPopUpEnabled = value;
} |
<<<<<<<
import java.io.FileNotFoundException;
import java.nio.file.Files;
=======
>>>>>>>
import java.io.FileNotFoundException; |
<<<<<<<
import org.xdi.config.oxtrust.AppConfiguration;
import org.xdi.model.SimpleCustomProperty;
import org.xdi.model.SimpleExtendedCustomProperty;
import org.xdi.model.SimpleProperty;
import org.xdi.model.custom.script.CustomScriptType;
import org.xdi.model.custom.script.model.CustomScript;
import org.xdi.model.ldap.GluuLdapConfiguration;
import org.xdi.model.passport.PassportConfiguration;
import org.xdi.service.custom.script.AbstractCustomScriptService;
import org.xdi.service.security.Secure;
import org.xdi.util.OxConstants;
import org.xdi.util.StringHelper;
import org.xdi.util.properties.FileConfiguration;
import org.xdi.util.security.PropertiesDecrypter;
import org.xdi.util.security.StringEncrypter.EncryptionException;
=======
>>>>>>> |
<<<<<<<
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
=======
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull;
import java.io.*;
>>>>>>>
import javax.annotation.Nonnull;
import java.io.Closeable;
import javax.annotation.CheckForNull;
import javax.annotation.Nonnull; |
<<<<<<<
import org.gluu.search.filter.Filter;
=======
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.*;
>>>>>>>
import org.gluu.search.filter.Filter;
import javax.ejb.Stateless;
import javax.inject.Inject;
import javax.inject.Named;
import java.util.*; |
<<<<<<<
=======
import java.util.ArrayList;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.hp.hpl.jena.sparql.core.DatasetGraph;
>>>>>>> |
<<<<<<<
import com.opencsv.CSVReader;
import java.io.BufferedWriter;
=======
>>>>>>>
import java.io.BufferedWriter;
<<<<<<<
import java.io.FileOutputStream;
import java.io.FileReader;
=======
>>>>>>>
import java.io.FileOutputStream;
<<<<<<<
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.Reader;
import java.util.ArrayList;
=======
>>>>>>>
import java.io.OutputStreamWriter;
<<<<<<<
try {
String formatName = FilenameUtils.getExtension(ontologyIRI.toString());
OWLDocumentFormat format = getFormat(formatName);
return saveOntology(ontology, format, ontologyIRI, true);
} catch (IllegalArgumentException e) {
throw new IOException(e);
}
=======
String formatName = FilenameUtils.getExtension(ontologyIRI.toString());
OWLDocumentFormat format = getFormat(formatName);
return saveOntology(ontology, format, ontologyIRI);
>>>>>>>
try {
String formatName = FilenameUtils.getExtension(ontologyIRI.toString());
OWLDocumentFormat format = getFormat(formatName);
return saveOntology(ontology, format, ontologyIRI, true);
} catch (IllegalArgumentException e) {
throw new IOException(e);
}
<<<<<<<
final OWLOntology ontology, OWLDocumentFormat format, IRI ontologyIRI, boolean checkOBO)
throws IOException {
logger.debug("Saving ontology {} as {} with to IRI {}", ontology, format, ontologyIRI);
=======
final OWLOntology ontology, OWLDocumentFormat format, IRI ontologyIRI) throws IOException {
logger.debug(
"Saving ontology {} as {} to IRI {}", ontology.getOntologyID(), format, ontologyIRI);
>>>>>>>
final OWLOntology ontology, OWLDocumentFormat format, IRI ontologyIRI, boolean checkOBO)
throws IOException {
logger.debug("Saving ontology {} as {} with to IRI {}", ontology, format, ontologyIRI); |
<<<<<<<
public List<DatasetEntity> getSeries(GetObservationByIdRequest request, Session session) throws OwsExceptionReport {
return getSeriesCriteria(request, session).list();
=======
public List<Series> getSeries(GetObservationByIdRequest request, Session session) throws OwsExceptionReport {
return getSeriesCriteria(request.getObservationIdentifier(), session).list();
}
@SuppressWarnings("unchecked")
@Override
public List<Series> getSeries(Collection<String> identifiers, Session session) throws OwsExceptionReport {
return getSeriesCriteria(identifiers, session).list();
>>>>>>>
public List<DatasetEntity> getSeries(GetObservationByIdRequest request, Session session) throws OwsExceptionReport {
return getSeriesCriteria(request.getObservationIdentifier(), session).list();
}
@SuppressWarnings("unchecked")
@Override
public List<DatasetEntity> getSeries(Collection<String> identifiers, Session session) throws OwsExceptionReport {
return getSeriesCriteria(identifiers, session).list(); |
<<<<<<<
/** Tests converting row and column numbers to A1 notation. */
@Test
public void testA1Notation() {
String a1 = IOHelper.cellToA1(1, 1);
assertEquals("A1", a1);
a1 = IOHelper.cellToA1(100, 200);
assertEquals("GR100", a1);
a1 = IOHelper.cellToA1(39, 8459);
assertEquals("LMI39", a1);
}
=======
/**
* Test adding prefixes using the addPrefixes method
*
* @throws IOException on problem creating IOHelper or adding prefixes
*/
@Test
public void testAddPrefixes() throws IOException {
// IOHelper without default prefixes
IOHelper ioh = new IOHelper(false);
// Single prefix to add from a context
String inputContext = "{\n \"@context\" : {\n \"foo\" : \"http://foo.bar\"\n }\n}";
Context context = IOHelper.parseContext(inputContext);
ioh.addPrefixes(context);
// Get the context back from IOHelper
String outputContext = ioh.getContextString();
assertEquals(inputContext, outputContext);
}
>>>>>>>
/** Tests converting row and column numbers to A1 notation. */
@Test
public void testA1Notation() {
String a1 = IOHelper.cellToA1(1, 1);
assertEquals("A1", a1);
a1 = IOHelper.cellToA1(100, 200);
assertEquals("GR100", a1);
a1 = IOHelper.cellToA1(39, 8459);
assertEquals("LMI39", a1);
}
/**
* Test adding prefixes using the addPrefixes method
*
* @throws IOException on problem creating IOHelper or adding prefixes
*/
@Test
public void testAddPrefixes() throws IOException {
// IOHelper without default prefixes
IOHelper ioh = new IOHelper(false);
// Single prefix to add from a context
String inputContext = "{\n \"@context\" : {\n \"foo\" : \"http://foo.bar\"\n }\n}";
Context context = IOHelper.parseContext(inputContext);
ioh.addPrefixes(context);
// Get the context back from IOHelper
String outputContext = ioh.getContextString();
assertEquals(inputContext, outputContext);
} |
<<<<<<<
if (superClass.isAnonymous() && !excludeAnonymous || !superClass.isAnonymous()) {
// Anonymous axioms may have been removed so we don't want to add them back
axioms.add(dataFactory.getOWLSubClassOfAxiom(subClass, superClass));
}
=======
axioms.add(df.getOWLSubClassOfAxiom(subClass, superClass));
>>>>>>>
if (superClass.isAnonymous() && !excludeAnonymous || !superClass.isAnonymous()) {
// Anonymous axioms may have been removed so we don't want to add them back
axioms.add(df.getOWLSubClassOfAxiom(subClass, superClass));
}
<<<<<<<
* Given a list of base namespaces and a set of subject IRIs, determine if at least one of the
* subjects is in the set of base namespaces.
*
* @param baseNamespaces list of base namespaces as strings
* @param subjects set of IRIs to check
* @return true if at least one IRI is in one of the base namespaces
*/
private static boolean isBase(List<String> baseNamespaces, Set<IRI> subjects) {
for (String base : baseNamespaces) {
for (IRI subject : subjects) {
if (subject.toString().startsWith(base)) {
return true;
}
}
}
return false;
}
/**
=======
* Given an ontology and a class expression, return the set of superclasses while removing any
* circular subclass definitions. Warn on any circular subclasses.
*
* @param ontology OWLOntology to get super properties
* @param property OWLObjectProperty to get super properties of
* @return Set of OWLObjectPropertyExpressions that are super properties of property
*/
private static Set<OWLObjectPropertyExpression> getSuperObjectProperties(
OWLOntology ontology, OWLObjectProperty property) {
Set<OWLObjectPropertyExpression> superProperties = new HashSet<>();
// We might get stuck if a class is both subclass and equivalent
// So compare the eqs to the superclasses and don't add a super if it's also an eq
Collection<OWLObjectPropertyExpression> eqs =
EntitySearcher.getEquivalentProperties(property, ontology);
for (OWLObjectPropertyExpression expr : EntitySearcher.getSuperProperties(property, ontology)) {
if (expr.isAnonymous()) {
superProperties.add(expr);
continue;
}
if (eqs.contains(expr)) {
logger.warn(
String.format(
"Class '%s' has equivalent property and super property '%s'",
property.getIRI(), expr));
continue;
}
if (expr.asOWLObjectProperty().getIRI().toString().equals(property.getIRI().toString())) {
logger.warn("Circular subproperty definition: " + property.getIRI());
continue;
}
superProperties.add(expr);
}
return superProperties;
}
/**
>>>>>>>
* Given an ontology and a class expression, return the set of superclasses while removing any
* circular subclass definitions. Warn on any circular subclasses.
*
* @param ontology OWLOntology to get super properties
* @param property OWLObjectProperty to get super properties of
* @return Set of OWLObjectPropertyExpressions that are super properties of property
*/
private static Set<OWLObjectPropertyExpression> getSuperObjectProperties(
OWLOntology ontology, OWLObjectProperty property) {
Set<OWLObjectPropertyExpression> superProperties = new HashSet<>();
// We might get stuck if a class is both subclass and equivalent
// So compare the eqs to the superclasses and don't add a super if it's also an eq
Collection<OWLObjectPropertyExpression> eqs =
EntitySearcher.getEquivalentProperties(property, ontology);
for (OWLObjectPropertyExpression expr : EntitySearcher.getSuperProperties(property, ontology)) {
if (expr.isAnonymous()) {
superProperties.add(expr);
continue;
}
if (eqs.contains(expr)) {
logger.warn(
String.format(
"Class '%s' has equivalent property and super property '%s'",
property.getIRI(), expr));
continue;
}
if (expr.asOWLObjectProperty().getIRI().toString().equals(property.getIRI().toString())) {
logger.warn("Circular subproperty definition: " + property.getIRI());
continue;
}
superProperties.add(expr);
}
return superProperties;
}
/**
* Given a list of base namespaces and a set of subject IRIs, determine if at least one of the
* subjects is in the set of base namespaces.
*
* @param baseNamespaces list of base namespaces as strings
* @param subjects set of IRIs to check
* @return true if at least one IRI is in one of the base namespaces
*/
private static boolean isBase(List<String> baseNamespaces, Set<IRI> subjects) {
for (String base : baseNamespaces) {
for (IRI subject : subjects) {
if (subject.toString().startsWith(base)) {
return true;
}
}
}
return false;
}
/** |
<<<<<<<
/**
* Given an input string, return a list of the string split on whitespace, while ignoring any
* whitespace in single string quotes.
*
* @param selects String of select options to split
* @return List of split strings
*/
protected static List<String> splitSelects(String selects) {
List<String> split = new ArrayList<>();
Matcher m = Pattern.compile("([^\\s]+=.*'[^']+'[^\\s']*|[^\\s']+)").matcher(selects);
while (m.find()) {
String s = m.group(1).trim();
split.add(s);
}
return split;
}
=======
/**
* Given a wildcard pattern as string, return an array of files matching that pattern.
*
* @param pattern wildcard pattern to match
* @return array of files
*/
private static File[] getFilesByPattern(String pattern) {
if (!pattern.contains("*") && !pattern.contains("?")) {
throw new IllegalArgumentException(wildcardError);
}
FileFilter fileFilter = new WildcardFileFilter(pattern);
File[] files = new File(".").listFiles(fileFilter);
if (files.length < 1) {
// Warn user, but continue (empty input checked later)
logger.error("No files match pattern: {}", pattern);
}
return files;
}
/**
* Given an IOHelper and a command line, check input options and return a list of loaded input
* ontologies.
*
* @param ioHelper the IOHelper to load the ontology with
* @param line the command line to use
* @return the list of input ontologies
* @throws IOException if the ontology cannot be loaded
*/
private static List<OWLOntology> getInputOntologies(IOHelper ioHelper, CommandLine line)
throws IOException {
List<OWLOntology> inputOntologies = new ArrayList<>();
// Check for input files
List<String> inputOntologyPaths = getOptionalValues(line, "input");
for (String inputOntologyPath : inputOntologyPaths) {
inputOntologies.add(ioHelper.loadOntology(inputOntologyPath));
}
// Check for input IRIs
List<String> inputOntologyIRIs = getOptionalValues(line, "input-iri");
for (String inputOntologyIRI : inputOntologyIRIs) {
inputOntologies.add(ioHelper.loadOntology(IRI.create(inputOntologyIRI)));
}
// Check for input patterns (wildcard)
String pattern = getOptionalValue(line, "inputs");
if (pattern != null) {
for (File inputOntologyFile : getFilesByPattern(pattern)) {
inputOntologies.add(ioHelper.loadOntology(inputOntologyFile));
}
}
return inputOntologies;
}
/**
* Given an IOHelper, a command line, and the path to a catalog file, check input options and
* return a list of loaded input ontologies with the catalog file.
*
* @param ioHelper the IOHelper to load the ontology with
* @param line the command line to use
* @param catalogPath the catalog file to use
* @return the list of input ontologies
* @throws IOException if the ontology cannot be loaded
*/
private static List<OWLOntology> getInputOntologies(
IOHelper ioHelper, CommandLine line, String catalogPath) throws IOException {
List<OWLOntology> inputOntologies = new ArrayList<>();
// Check for input files
List<String> inputOntologyPaths = getOptionalValues(line, "input");
for (String inputOntologyPath : inputOntologyPaths) {
inputOntologies.add(ioHelper.loadOntology(inputOntologyPath, catalogPath));
}
// Check for input IRIs
List<String> inputOntologyIRIs = getOptionalValues(line, "input-iri");
for (String inputOntologyIRI : inputOntologyIRIs) {
inputOntologies.add(ioHelper.loadOntology(IRI.create(inputOntologyIRI), catalogPath));
}
// Check for input patterns (wildcard)
String pattern = getOptionalValue(line, "inputs");
if (pattern != null) {
File catalogFile = new File(catalogPath);
for (File inputOntologyFile : getFilesByPattern(pattern)) {
inputOntologies.add(ioHelper.loadOntology(inputOntologyFile, catalogFile));
}
}
return inputOntologies;
}
>>>>>>>
/**
* Given an input string, return a list of the string split on whitespace, while ignoring any
* whitespace in single string quotes.
*
* @param selects String of select options to split
* @return List of split strings
*/
protected static List<String> splitSelects(String selects) {
List<String> split = new ArrayList<>();
Matcher m = Pattern.compile("([^\\s]+=.*'[^']+'[^\\s']*|[^\\s']+)").matcher(selects);
while (m.find()) {
String s = m.group(1).trim();
split.add(s);
}
return split;
}
/**
* Given a wildcard pattern as string, return an array of files matching that pattern.
*
* @param pattern wildcard pattern to match
* @return array of files
*/
private static File[] getFilesByPattern(String pattern) {
if (!pattern.contains("*") && !pattern.contains("?")) {
throw new IllegalArgumentException(wildcardError);
}
FileFilter fileFilter = new WildcardFileFilter(pattern);
File[] files = new File(".").listFiles(fileFilter);
if (files.length < 1) {
// Warn user, but continue (empty input checked later)
logger.error("No files match pattern: {}", pattern);
}
return files;
}
/**
* Given an IOHelper and a command line, check input options and return a list of loaded input
* ontologies.
*
* @param ioHelper the IOHelper to load the ontology with
* @param line the command line to use
* @return the list of input ontologies
* @throws IOException if the ontology cannot be loaded
*/
private static List<OWLOntology> getInputOntologies(IOHelper ioHelper, CommandLine line)
throws IOException {
List<OWLOntology> inputOntologies = new ArrayList<>();
// Check for input files
List<String> inputOntologyPaths = getOptionalValues(line, "input");
for (String inputOntologyPath : inputOntologyPaths) {
inputOntologies.add(ioHelper.loadOntology(inputOntologyPath));
}
// Check for input IRIs
List<String> inputOntologyIRIs = getOptionalValues(line, "input-iri");
for (String inputOntologyIRI : inputOntologyIRIs) {
inputOntologies.add(ioHelper.loadOntology(IRI.create(inputOntologyIRI)));
}
// Check for input patterns (wildcard)
String pattern = getOptionalValue(line, "inputs");
if (pattern != null) {
for (File inputOntologyFile : getFilesByPattern(pattern)) {
inputOntologies.add(ioHelper.loadOntology(inputOntologyFile));
}
}
return inputOntologies;
}
/**
* Given an IOHelper, a command line, and the path to a catalog file, check input options and
* return a list of loaded input ontologies with the catalog file.
*
* @param ioHelper the IOHelper to load the ontology with
* @param line the command line to use
* @param catalogPath the catalog file to use
* @return the list of input ontologies
* @throws IOException if the ontology cannot be loaded
*/
private static List<OWLOntology> getInputOntologies(
IOHelper ioHelper, CommandLine line, String catalogPath) throws IOException {
List<OWLOntology> inputOntologies = new ArrayList<>();
// Check for input files
List<String> inputOntologyPaths = getOptionalValues(line, "input");
for (String inputOntologyPath : inputOntologyPaths) {
inputOntologies.add(ioHelper.loadOntology(inputOntologyPath, catalogPath));
}
// Check for input IRIs
List<String> inputOntologyIRIs = getOptionalValues(line, "input-iri");
for (String inputOntologyIRI : inputOntologyIRIs) {
inputOntologies.add(ioHelper.loadOntology(IRI.create(inputOntologyIRI), catalogPath));
}
// Check for input patterns (wildcard)
String pattern = getOptionalValue(line, "inputs");
if (pattern != null) {
File catalogFile = new File(catalogPath);
for (File inputOntologyFile : getFilesByPattern(pattern)) {
inputOntologies.add(ioHelper.loadOntology(inputOntologyFile, catalogFile));
}
}
return inputOntologies;
} |
<<<<<<<
=======
import java.io.*;
import java.util.Map;
import java.util.Optional;
>>>>>>>
<<<<<<<
=======
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>> |
<<<<<<<
boolean terminatable = false;
=======
boolean underscorable = false;
>>>>>>>
boolean terminatable = false;
boolean underscorable = false;
<<<<<<<
for (int i = index.get(); i < s.length(); i = index.incrementAndGet()) {
char c = s.charAt(i);
=======
for (int i = 0; i < chars.length; i++) {
char c = chars[i];
boolean notLastChar = chars.length > i + 1;
>>>>>>>
for (int i = index.get(); i < s.length(); i = index.incrementAndGet()) {
char c = s.charAt(i);
boolean notLastChar = s.length() > i + 1;
<<<<<<<
} else if ((c == '+' || c == '-') && signable && s.length() > i + 1) {
=======
} else if ((c == '+' || c == '-') && signable && notLastChar) {
>>>>>>>
} else if ((c == '+' || c == '-') && signable && notLastChar) {
<<<<<<<
} else if (c == '.' && dottable && s.length() > i + 1) {
=======
underscorable = false;
} else if (c == '.' && dottable && notLastChar) {
>>>>>>>
} else if (c == '.' && dottable && notLastChar) {
<<<<<<<
} else if ((c == 'E' || c == 'e') && exponentable && s.length() > i + 1) {
=======
underscorable = false;
} else if ((c == 'E' || c == 'e') && exponentable && notLastChar) {
>>>>>>>
} else if ((c == 'E' || c == 'e') && exponentable && notLastChar) {
<<<<<<<
=======
underscorable = false;
} else if (c == '_' && underscorable && notLastChar && Character.isDigit(chars[i + 1])) {
underscorable = false;
} else if (Character.isWhitespace(c)) {
whitespace = true;
} else if (whitespace && c == '#') {
break;
>>>>>>>
underscorable = false;
} else if (c == '_' && underscorable && notLastChar && Character.isDigit(s.charAt(i + 1))) {
underscorable = false; |
<<<<<<<
disabledFeatures.add(Feature.DROP_CONFIRMATION);
disabledFeatures.add(Feature.MINION_STOP_WARNING);
disabledFeatures.add(Feature.HIDE_HEALTH_BAR);
disabledFeatures.add(Feature.MINION_FULL_WARNING);
disabledFeatures.add(Feature.USE_VANILLA_TEXTURE_DEFENCE);
disabledFeatures.add(Feature.IGNORE_ITEM_FRAME_CLICKS);
disabledFeatures.add(Feature.SHOW_BACKPACK_HOLDING_SHIFT);
disabledFeatures.add(Feature.HEALTH_BAR);
disabledFeatures.add(Feature.DEFENCE_PERCENTAGE);
disabledFeatures.add(Feature.ITEM_PICKUP_LOG);
=======
Feature[] toDisable = {Feature.DROP_CONFIRMATION, Feature.MINION_STOP_WARNING, Feature.HIDE_HEALTH_BAR,
Feature.USE_VANILLA_TEXTURE_DEFENCE, Feature.IGNORE_ITEM_FRAME_CLICKS, Feature.SHOW_BACKPACK_HOLDING_SHIFT,
Feature.HEALTH_BAR, Feature.DEFENCE_PERCENTAGE, Feature.HIDE_PLAYERS_IN_LOBBY};
disabledFeatures.addAll(Arrays.asList(toDisable));
>>>>>>>
Feature[] toDisable = {Feature.DROP_CONFIRMATION, Feature.MINION_STOP_WARNING, Feature.HIDE_HEALTH_BAR,
Feature.USE_VANILLA_TEXTURE_DEFENCE, Feature.IGNORE_ITEM_FRAME_CLICKS, Feature.SHOW_BACKPACK_HOLDING_SHIFT,
Feature.HEALTH_BAR, Feature.DEFENCE_PERCENTAGE, Feature.HIDE_PLAYERS_IN_LOBBY};
disabledFeatures.addAll(Arrays.asList(toDisable));
disabledFeatures.add(Feature.ITEM_PICKUP_LOG); |
<<<<<<<
super(String.class, context, id);
=======
super(context, id);
this.counter = new AtomicInteger(DEFAULT);
>>>>>>>
super(String.class, context, id);
this.counter = new AtomicInteger(DEFAULT); |
<<<<<<<
SETTING_DISABLE_MINION_LOCATION_WARNING(MessageObject.SETTING, "disableMinionLocationWarning"),
=======
SETTING_CHANGE_BAR_COLOR_WITH_POTIONS(MessageObject.SETTING, "changeBarColorForPotions"),
SETTING_CRAFTING_PATTERNS(MessageObject.SETTING, "craftingPatterns"),
SETTING_FISHING_SOUND_INDICATOR(MessageObject.SETTING, "soundIndicatorForFishing"),
SETTING_AVOID_BLINKING_NIGHT_VISION(MessageObject.SETTING, "avoidBlinkingNightVision"),
>>>>>>>
SETTING_CHANGE_BAR_COLOR_WITH_POTIONS(MessageObject.SETTING, "changeBarColorForPotions"),
SETTING_CRAFTING_PATTERNS(MessageObject.SETTING, "craftingPatterns"),
SETTING_FISHING_SOUND_INDICATOR(MessageObject.SETTING, "soundIndicatorForFishing"),
SETTING_AVOID_BLINKING_NIGHT_VISION(MessageObject.SETTING, "avoidBlinkingNightVision"),
SETTING_DISABLE_MINION_LOCATION_WARNING(MessageObject.SETTING, "disableMinionLocationWarning"), |
<<<<<<<
import codes.biscuit.skyblockaddons.gui.ButtonLocation;
import codes.biscuit.skyblockaddons.gui.ButtonSlider;
import codes.biscuit.skyblockaddons.gui.LocationEditGui;
import codes.biscuit.skyblockaddons.gui.SkyblockAddonsGui;
import codes.biscuit.skyblockaddons.utils.*;
=======
import codes.biscuit.skyblockaddons.utils.Attribute;
import codes.biscuit.skyblockaddons.utils.EnumUtils;
import codes.biscuit.skyblockaddons.utils.Feature;
>>>>>>>
import codes.biscuit.skyblockaddons.utils.Attribute;
import codes.biscuit.skyblockaddons.utils.EnumUtils;
import codes.biscuit.skyblockaddons.utils.Feature;
<<<<<<<
import java.math.BigDecimal;
import java.util.*;
=======
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.util.Timer;
import java.util.TimerTask;
>>>>>>>
import java.awt.*;
import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.UnsupportedFlavorException;
import java.io.IOException;
import java.util.Timer;
import java.util.TimerTask;
import java.math.BigDecimal;
import java.util.*;
<<<<<<<
public final static ItemStack BONE_ITEM = new ItemStack(Item.getItemById(352));
private final static ResourceLocation BARS = new ResourceLocation("skyblockaddons", "bars.png");
private final static ResourceLocation DEFENCE_VANILLA = new ResourceLocation("skyblockaddons", "defence.png");
/**
* Delay for item pickup logging to happen after changing a world in ms
* to prevent the whole inventory being shown as just picked up
*/
private final static int ITEM_PICKUP_LOG_DELAY = 1000;
=======
>>>>>>>
<<<<<<<
if (manaBarType == Feature.BarType.BAR
|| manaBarType == Feature.BarType.BAR_TEXT) {
drawBar(Feature.MANA_BAR, scaleMultiplier, mc, sr, Feature.MANA_BAR_COLOR);
}
if (healthBarType == Feature.BarType.BAR
|| healthBarType == Feature.BarType.BAR_TEXT) {
drawBar(Feature.HEALTH_BAR, scaleMultiplier, mc, sr, Feature.HEALTH_BAR_COLOR);
}
if (iconType == Feature.IconType.ICON || iconType == Feature.IconType.ICON_DEFENCE || iconType == Feature.IconType.ICON_PERCENTAGE
|| iconType == Feature.IconType.ICON_DEFENCE_PERCENTAGE) {
drawIcon(scale, mc, sr, null);
}
if (iconType == Feature.IconType.DEFENCE || iconType == Feature.IconType.ICON_DEFENCE || iconType == Feature.IconType.DEFENCE_PERCENTAGE
|| iconType == Feature.IconType.ICON_DEFENCE_PERCENTAGE) {
drawText(Feature.DEFENCE_TEXT, scaleMultiplier, mc, sr, Feature.DEFENCE_TEXT_COLOR);
}
if (iconType == Feature.IconType.PERCENTAGE || iconType == Feature.IconType.ICON_PERCENTAGE || iconType == Feature.IconType.DEFENCE_PERCENTAGE
|| iconType == Feature.IconType.ICON_DEFENCE_PERCENTAGE) {
drawText(Feature.DEFENCE_PERCENTAGE, scaleMultiplier, mc, sr, Feature.DEFENCE_PERCENTAGE_COLOR);
}
if (manaBarType == Feature.BarType.TEXT
|| manaBarType == Feature.BarType.BAR_TEXT) {
drawText(Feature.MANA_TEXT, scaleMultiplier, mc, sr, Feature.MANA_TEXT_COLOR);
}
if (healthBarType == Feature.BarType.TEXT
|| healthBarType == Feature.BarType.BAR_TEXT) {
drawText(Feature.HEALTH_TEXT, scaleMultiplier, mc, sr, Feature.HEALTH_TEXT_COLOR);
}
if(!main.getConfigValues().getDisabledFeatures().contains(Feature.ITEM_PICKUP_LOG)) {
drawPickupLog(scaleMultiplier, mc, sr);
}
}
GlStateManager.popMatrix();
}
private void drawBar(Feature feature, float scaleMultiplier, Minecraft mc, ScaledResolution sr, Feature colorFeature) {
drawBar(feature, scaleMultiplier, mc, sr, colorFeature, null);
}
public void drawBar(Feature feature, float scaleMultiplier, Minecraft mc, ScaledResolution sr, Feature colorFeature, ButtonLocation buttonLocation) {
mc.getTextureManager().bindTexture(PlayerListener.BARS);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
short barWidth = 92;
float fill;
if (feature == Feature.MANA_BAR) {
fill = (float) mana / maxMana;
=======
main.getRenderListener().setPredictMana(true);
main.getRenderListener().setPredictHealth(true);
>>>>>>>
main.getRenderListener().setPredictMana(true);
main.getRenderListener().setPredictHealth(true);
<<<<<<<
List<String> logItemsToRemove = new LinkedList<>();
itemPickupLog.forEach((displayName, itemDiff) -> {
if(itemDiff.getLifetime() > ItemDiff.LIFESPAN) {
logItemsToRemove.add(displayName);
}
});
logItemsToRemove.forEach(name -> itemPickupLog.remove(name));
} else if (manaTick > 20) {
main.getUtils().checkGameAndLocation();
Minecraft mc = Minecraft.getMinecraft();
if (!sentUpdate && mc != null && mc.thePlayer != null && mc.theWorld != null) {
main.getUtils().checkUpdates();
sentUpdate = true;
}
manaTick = 1;
=======
>>>>>>> |
<<<<<<<
MINION_DISABLE_LOCATION_WARNING(46, Message.SETTING_DISABLE_MINION_LOCATION_WARNING),
=======
CHANGE_BAR_COLOR_FOR_POTIONS(46, Message.SETTING_CHANGE_BAR_COLOR_WITH_POTIONS),
CRAFTING_PATTERNS(47, Message.SETTING_CRAFTING_PATTERNS),
FISHING_SOUND_INDICATOR(48, Message.SETTING_FISHING_SOUND_INDICATOR),
AVOID_BLINKING_NIGHT_VISION(49, Message.SETTING_AVOID_BLINKING_NIGHT_VISION),
>>>>>>>
CHANGE_BAR_COLOR_FOR_POTIONS(46, Message.SETTING_CHANGE_BAR_COLOR_WITH_POTIONS),
CRAFTING_PATTERNS(47, Message.SETTING_CRAFTING_PATTERNS),
FISHING_SOUND_INDICATOR(48, Message.SETTING_FISHING_SOUND_INDICATOR),
AVOID_BLINKING_NIGHT_VISION(49, Message.SETTING_AVOID_BLINKING_NIGHT_VISION),
MINION_DISABLE_LOCATION_WARNING(46, Message.SETTING_DISABLE_MINION_LOCATION_WARNING), |
<<<<<<<
SETTING_AVOID_BREAKING_LOG_BEFORE_JUNGLE_AXE_COOLDOWN_ENDS(MessageObject.SETTING, "avoidBreakingLogBeforeJungleAxeCooldownEnds"),
=======
SETTING_CHANGE_BAR_COLOR_WITH_POTIONS(MessageObject.SETTING, "changeBarColorForPotions"),
SETTING_CRAFTING_PATTERNS(MessageObject.SETTING, "craftingPatterns"),
SETTING_FISHING_SOUND_INDICATOR(MessageObject.SETTING, "soundIndicatorForFishing"),
SETTING_AVOID_BLINKING_NIGHT_VISION(MessageObject.SETTING, "avoidBlinkingNightVision"),
SETTING_DISABLE_MINION_LOCATION_WARNING(MessageObject.SETTING, "disableMinionLocationWarning"),
>>>>>>>
SETTING_CHANGE_BAR_COLOR_WITH_POTIONS(MessageObject.SETTING, "changeBarColorForPotions"),
SETTING_CRAFTING_PATTERNS(MessageObject.SETTING, "craftingPatterns"),
SETTING_FISHING_SOUND_INDICATOR(MessageObject.SETTING, "soundIndicatorForFishing"),
SETTING_AVOID_BLINKING_NIGHT_VISION(MessageObject.SETTING, "avoidBlinkingNightVision"),
SETTING_DISABLE_MINION_LOCATION_WARNING(MessageObject.SETTING, "disableMinionLocationWarning"),
SETTING_AVOID_BREAKING_LOG_BEFORE_JUNGLE_AXE_COOLDOWN_ENDS(MessageObject.SETTING, "avoidBreakingLogBeforeJungleAxeCooldownEnds"), |
<<<<<<<
Feature.MAKE_ENDERCHESTS_GREEN_IN_END, Feature.SUMMONING_EYE_ALERT, Feature.DONT_RESET_CURSOR_INVENTORY,
Feature.ORGANIZE_ENCHANTMENTS, Feature.REPLACE_ROMAN_NUMERALS_WITH_NUMBERS, Feature.DROP_CONFIRMATION};
=======
Feature.MAKE_ENDERCHESTS_GREEN_IN_END, Feature.SUMMONING_EYE_ALERT, Feature.FISHING_SOUND_INDICATOR, Feature.DONT_RESET_CURSOR_INVENTORY,
Feature.REPLACE_ROMAN_NUMERALS_WITH_NUMBERS, Feature.DROP_CONFIRMATION, Feature.AVOID_BREAKING_BOTTOM_SUGAR_CANE,
Feature.JUNGLE_AXE_COOLDOWN};
>>>>>>>
Feature.MAKE_ENDERCHESTS_GREEN_IN_END, Feature.SUMMONING_EYE_ALERT, Feature.FISHING_SOUND_INDICATOR, Feature.DONT_RESET_CURSOR_INVENTORY,
Feature.REPLACE_ROMAN_NUMERALS_WITH_NUMBERS, Feature.DROP_CONFIRMATION, Feature.AVOID_BREAKING_BOTTOM_SUGAR_CANE,
Feature.ORGANIZE_ENCHANTMENTS, Feature.JUNGLE_AXE_COOLDOWN}; |
<<<<<<<
private boolean shouldTriggerFishingIndicator() {
Minecraft mc = Minecraft.getMinecraft();
if (mc.thePlayer != null && mc.thePlayer.fishEntity != null && mc.thePlayer.getHeldItem() != null
&& mc.thePlayer.getHeldItem().getItem().equals(Items.fishing_rod)
&& main.getConfigValues().isEnabled(Feature.FISHING_SOUND_INDICATOR)) {
// Highly consistent detection by checking when the hook has been in the water for a while and
// suddenly moves downward. The client may rarely bug out with the idle bobbing and trigger a false positive.
EntityFishHook bobber = mc.thePlayer.fishEntity;
long currentTime = System.currentTimeMillis();
if (bobber.isInWater() && !oldBobberIsInWater) lastBobberEnteredWater = currentTime;
oldBobberIsInWater = bobber.isInWater();
if (bobber.isInWater() && Math.abs(bobber.motionX) < 0.01 && Math.abs(bobber.motionZ) < 0.01
&& currentTime - lastFishingAlert > 1000 && currentTime - lastBobberEnteredWater > 1500) {
double movement = bobber.posY - oldBobberPosY; // The Entity#motionY field is inaccurate for this purpose
oldBobberPosY = bobber.posY;
if (movement < -0.04d){
lastFishingAlert = currentTime;
return true;
}
return movement < -0.03d;
}
}
return false;
}
=======
public void setLastSecondHealth(int lastSecondHealth) {
this.lastSecondHealth = lastSecondHealth;
}
>>>>>>>
private boolean shouldTriggerFishingIndicator() {
Minecraft mc = Minecraft.getMinecraft();
if (mc.thePlayer != null && mc.thePlayer.fishEntity != null && mc.thePlayer.getHeldItem() != null
&& mc.thePlayer.getHeldItem().getItem().equals(Items.fishing_rod)
&& main.getConfigValues().isEnabled(Feature.FISHING_SOUND_INDICATOR)) {
// Highly consistent detection by checking when the hook has been in the water for a while and
// suddenly moves downward. The client may rarely bug out with the idle bobbing and trigger a false positive.
EntityFishHook bobber = mc.thePlayer.fishEntity;
long currentTime = System.currentTimeMillis();
if (bobber.isInWater() && !oldBobberIsInWater) lastBobberEnteredWater = currentTime;
oldBobberIsInWater = bobber.isInWater();
if (bobber.isInWater() && Math.abs(bobber.motionX) < 0.01 && Math.abs(bobber.motionZ) < 0.01
&& currentTime - lastFishingAlert > 1000 && currentTime - lastBobberEnteredWater > 1500) {
double movement = bobber.posY - oldBobberPosY; // The Entity#motionY field is inaccurate for this purpose
oldBobberPosY = bobber.posY;
if (movement < -0.04d){
lastFishingAlert = currentTime;
return true;
}
return movement < -0.03d;
}
}
return false;
}
public void setLastSecondHealth(int lastSecondHealth) {
this.lastSecondHealth = lastSecondHealth;
} |
<<<<<<<
GlStateManager.enableRescaleNormal();
RenderHelper.enableGUIStandardItemLighting();
mc.getRenderItem().renderItemIntoGUI(buttonLocation == null ? skill.getItem() : EnumUtils.SkillType.FARMING.getItem(),
=======
mc.getRenderItem().renderItemIntoGUI(buttonLocation == null ? skill.getItem() : EnumUtils.SkillType.FARMING.getItem(), //TODO set Z level behind chat
>>>>>>>
GlStateManager.enableRescaleNormal();
RenderHelper.enableGUIStandardItemLighting();
mc.getRenderItem().renderItemIntoGUI(buttonLocation == null ? skill.getItem() : EnumUtils.SkillType.FARMING.getItem(), //TODO set Z level behind chat |
<<<<<<<
public void initCalculator()
{
initCalculator(context);
}
=======
@Override
public SuntimesCalculatorFactory initFactory(Context context)
{
return new SuntimesCalculatorFactory(context, calculatorMode)
{
public SuntimesCalculator fallbackCalculator()
{
return new com.forrestguice.suntimeswidget.calculator.time4a.Time4A4JSuntimesCalculator();
}
public SuntimesCalculatorDescriptor fallbackCalculatorDescriptor()
{
return com.forrestguice.suntimeswidget.calculator.time4a.Time4A4JSuntimesCalculator.getDescriptor();
}
};
}
>>>>>>>
public void initCalculator()
{
initCalculator(context);
}
@Override
public SuntimesCalculatorFactory initFactory(Context context)
{
return new SuntimesCalculatorFactory(context, calculatorMode)
{
public SuntimesCalculator fallbackCalculator()
{
return new com.forrestguice.suntimeswidget.calculator.time4a.Time4A4JSuntimesCalculator();
}
public SuntimesCalculatorDescriptor fallbackCalculatorDescriptor()
{
return com.forrestguice.suntimeswidget.calculator.time4a.Time4A4JSuntimesCalculator.getDescriptor();
}
};
} |
<<<<<<<
if (key.endsWith(WidgetSettings.PREF_KEY_GENERAL_TRACKINGMODE))
{
// the pref activity saves to: com.forrestguice.suntimeswidget_preferences.xml,
// ...but this is a widget setting (belongs in com.forrestguice.suntimeswidget.xml)
WidgetSettings.saveTrackingModePref(this, 0, WidgetSettings.TrackingMode.valueOf(sharedPreferences.getString(key, "missing")));
return;
}
=======
if (key.endsWith(WidgetSettings.PREF_KEY_GENERAL_SHOWSECONDS))
{
// the pref activity saves to: com.forrestguice.suntimeswidget_preferences.xml,
// ...but this is a widget setting (belongs in com.forrestguice.suntimeswidget.xml)
WidgetSettings.saveShowSecondsPref(this, 0, sharedPreferences.getBoolean(key, WidgetSettings.PREF_DEF_GENERAL_SHOWSECONDS));
return;
}
>>>>>>>
if (key.endsWith(WidgetSettings.PREF_KEY_GENERAL_TRACKINGMODE))
{
// the pref activity saves to: com.forrestguice.suntimeswidget_preferences.xml,
// ...but this is a widget setting (belongs in com.forrestguice.suntimeswidget.xml)
WidgetSettings.saveTrackingModePref(this, 0, WidgetSettings.TrackingMode.valueOf(sharedPreferences.getString(key, "missing")));
return;
}
if (key.endsWith(WidgetSettings.PREF_KEY_GENERAL_SHOWSECONDS))
{
// the pref activity saves to: com.forrestguice.suntimeswidget_preferences.xml,
// ...but this is a widget setting (belongs in com.forrestguice.suntimeswidget.xml)
WidgetSettings.saveShowSecondsPref(this, 0, sharedPreferences.getBoolean(key, WidgetSettings.PREF_DEF_GENERAL_SHOWSECONDS));
return;
} |
<<<<<<<
Calendar eventTime = (event.isRising() ? moonData.moonriseCalendarToday() : moonData.moonsetCalendarToday());
if (eventTime != null)
{
eventTime.set(Calendar.SECOND, 0);
alarmTime.setTimeInMillis(eventTime.getTimeInMillis() + offset);
}
=======
Calendar eventTime = moonEventCalendar(event, moonData, true);
eventTime.set(Calendar.SECOND, 0);
alarmTime.setTimeInMillis(eventTime.getTimeInMillis() + offset);
>>>>>>>
Calendar eventTime = moonEventCalendar(event, moonData, true);
if (eventTime != null)
{
eventTime.set(Calendar.SECOND, 0);
alarmTime.setTimeInMillis(eventTime.getTimeInMillis() + offset);
}
<<<<<<<
eventTime = (event.isRising() ? moonData.moonriseCalendarToday() : moonData.moonsetCalendarToday());
if (eventTime != null)
{
eventTime.set(Calendar.SECOND, 0);
alarmTime.setTimeInMillis(eventTime.getTimeInMillis() + offset);
}
c++;
=======
eventTime = moonEventCalendar(event, moonData, true);
eventTime.set(Calendar.SECOND, 0);
alarmTime.setTimeInMillis(eventTime.getTimeInMillis() + offset);
>>>>>>>
eventTime = moonEventCalendar(event, moonData, true);
if (eventTime != null)
{
eventTime.set(Calendar.SECOND, 0);
alarmTime.setTimeInMillis(eventTime.getTimeInMillis() + offset);
}
c++; |
<<<<<<<
=======
public static void saveObserverHeightPref(Context context, int appWidgetId, float meters)
{
SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_WIDGET, 0).edit();
String prefs_prefix = PREF_PREFIX_KEY + appWidgetId + PREF_PREFIX_KEY_GENERAL;
prefs.putFloat(prefs_prefix + PREF_KEY_GENERAL_OBSERVERHEIGHT, meters);
prefs.apply();
}
public static float loadObserverHeightPref(Context context, int appWidgetId)
{
SharedPreferences prefs = context.getSharedPreferences(PREFS_WIDGET, 0);
String prefs_prefix = PREF_PREFIX_KEY + appWidgetId + PREF_PREFIX_KEY_GENERAL;
return prefs.getFloat(prefs_prefix + PREF_KEY_GENERAL_OBSERVERHEIGHT, PREF_DEF_GENERAL_OBSERVERHEIGHT);
}
public static void deleteObserverHeightPref(Context context, int appWidgetId)
{
SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_WIDGET, 0).edit();
String prefs_prefix = PREF_PREFIX_KEY + appWidgetId + PREF_PREFIX_KEY_GENERAL;
prefs.remove(prefs_prefix + PREF_KEY_GENERAL_OBSERVERHEIGHT);
prefs.apply();
}
>>>>>>>
public static void saveObserverHeightPref(Context context, int appWidgetId, float meters)
{
SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_WIDGET, 0).edit();
String prefs_prefix = PREF_PREFIX_KEY + appWidgetId + PREF_PREFIX_KEY_GENERAL;
prefs.putFloat(prefs_prefix + PREF_KEY_GENERAL_OBSERVERHEIGHT, meters);
prefs.apply();
}
public static float loadObserverHeightPref(Context context, int appWidgetId)
{
SharedPreferences prefs = context.getSharedPreferences(PREFS_WIDGET, 0);
String prefs_prefix = PREF_PREFIX_KEY + appWidgetId + PREF_PREFIX_KEY_GENERAL;
return prefs.getFloat(prefs_prefix + PREF_KEY_GENERAL_OBSERVERHEIGHT, PREF_DEF_GENERAL_OBSERVERHEIGHT);
}
public static void deleteObserverHeightPref(Context context, int appWidgetId)
{
SharedPreferences.Editor prefs = context.getSharedPreferences(PREFS_WIDGET, 0).edit();
String prefs_prefix = PREF_PREFIX_KEY + appWidgetId + PREF_PREFIX_KEY_GENERAL;
prefs.remove(prefs_prefix + PREF_KEY_GENERAL_OBSERVERHEIGHT);
prefs.apply();
} |
<<<<<<<
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
=======
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
>>>>>>>
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Collections;
import java.util.Comparator; |
<<<<<<<
WidgetSettings.saveTimezonePref(context, appWidgetId, customTimezone.getID());
// save: solar timemode
WidgetSettings.SolarTimeMode[] solarTimeModes = WidgetSettings.SolarTimeMode.values();
WidgetSettings.SolarTimeMode solarTimeMode = solarTimeModes[spinner_solartime.getSelectedItemPosition()];
WidgetSettings.saveSolarTimeModePref(context, appWidgetId, solarTimeMode);
=======
if (customTimezone != null)
{
WidgetSettings.saveTimezonePref(context, appWidgetId, customTimezone.getID());
} else {
Log.e("saveTimezoneSettings", "Failed to save timezone; none selected (was null). The timezone selector may not have been fully loaded..");
}
>>>>>>>
if (customTimezone != null)
{
WidgetSettings.saveTimezonePref(context, appWidgetId, customTimezone.getID());
} else {
Log.e("saveTimezoneSettings", "Failed to save timezone; none selected (was null). The timezone selector may not have been fully loaded..");
}
// save: solar timemode
WidgetSettings.SolarTimeMode[] solarTimeModes = WidgetSettings.SolarTimeMode.values();
WidgetSettings.SolarTimeMode solarTimeMode = solarTimeModes[spinner_solartime.getSelectedItemPosition()];
WidgetSettings.saveSolarTimeModePref(context, appWidgetId, solarTimeMode); |
<<<<<<<
int[] ids2 = widgetManager.getAppWidgetIds(new ComponentName(context, SuntimesWidget2.class));
for (int id : ids2)
{
AppWidgetProviderInfo info = widgetManager.getAppWidgetInfo(id);
SuntimesEquinoxSolsticeData data = new SuntimesEquinoxSolsticeData(context, id);
String widgetTitle = utils.displayStringForTitlePattern(titlePattern, data);
String title = context.getString(R.string.configLabel_widgetList_itemTitle, widgetTitle);
String type = context.getString(R.string.app_name_widget2);
String source = data.calculatorMode().getDisplayString();
String summary = context.getString(R.string.configLabel_widgetList_itemSummaryPattern, type, source);
try {
items.add(new WidgetListItem(id, info.icon, title, summary, Class.forName(info.configure.getClassName()) ));
} catch (ClassNotFoundException e) {
Log.e("WidgetListActivity", "configuration class for widget " + id + " missing.");
}
}
=======
int[] ids3 = widgetManager.getAppWidgetIds(new ComponentName(context, SuntimesWidget0_2x1.class));
for (int id : ids3)
{
AppWidgetProviderInfo info = widgetManager.getAppWidgetInfo(id);
SuntimesRiseSetData data = new SuntimesRiseSetData(context, id);
String widgetTitle = utils.displayStringForTitlePattern(titlePattern, data);
String title = context.getString(R.string.configLabel_widgetList_itemTitle, widgetTitle);
String type = context.getString(R.string.app_name_widget0);
String source = ((data.calculatorMode() == null) ? "def" : data.calculatorMode().name());
String summary = context.getString(R.string.configLabel_widgetList_itemSummaryPattern, type, source);
try {
items.add(new WidgetListItem(id, info.icon, title, summary, Class.forName(info.configure.getClassName()) ));
} catch (ClassNotFoundException e) {
Log.e("WidgetListActivity", "configuration class for widget " + id + " missing.");
}
}
>>>>>>>
int[] ids2 = widgetManager.getAppWidgetIds(new ComponentName(context, SuntimesWidget2.class));
for (int id : ids2)
{
AppWidgetProviderInfo info = widgetManager.getAppWidgetInfo(id);
SuntimesEquinoxSolsticeData data = new SuntimesEquinoxSolsticeData(context, id);
String widgetTitle = utils.displayStringForTitlePattern(titlePattern, data);
String title = context.getString(R.string.configLabel_widgetList_itemTitle, widgetTitle);
String type = context.getString(R.string.app_name_widget2);
String source = data.calculatorMode().getDisplayString();
String summary = context.getString(R.string.configLabel_widgetList_itemSummaryPattern, type, source);
try {
items.add(new WidgetListItem(id, info.icon, title, summary, Class.forName(info.configure.getClassName()) ));
} catch (ClassNotFoundException e) {
Log.e("WidgetListActivity", "configuration class for widget " + id + " missing.");
}
}
int[] ids3 = widgetManager.getAppWidgetIds(new ComponentName(context, SuntimesWidget0_2x1.class));
for (int id : ids3)
{
AppWidgetProviderInfo info = widgetManager.getAppWidgetInfo(id);
SuntimesRiseSetData data = new SuntimesRiseSetData(context, id);
String widgetTitle = utils.displayStringForTitlePattern(titlePattern, data);
String title = context.getString(R.string.configLabel_widgetList_itemTitle, widgetTitle);
String type = context.getString(R.string.app_name_widget0);
String source = ((data.calculatorMode() == null) ? "def" : data.calculatorMode().name());
String summary = context.getString(R.string.configLabel_widgetList_itemSummaryPattern, type, source);
try {
items.add(new WidgetListItem(id, info.icon, title, summary, Class.forName(info.configure.getClassName()) ));
} catch (ClassNotFoundException e) {
Log.e("WidgetListActivity", "configuration class for widget " + id + " missing.");
}
} |
<<<<<<<
import android.widget.ScrollView;
=======
import android.widget.ProgressBar;
>>>>>>>
import android.widget.ScrollView;
import android.widget.ProgressBar; |
<<<<<<<
layout_solartime = (LinearLayout)findViewById(R.id.appwidget_solartime_layout);
label_solartime = (TextView)findViewById(R.id.appwidget_solartime_label);
spinner_solartime = (Spinner)findViewById(R.id.appwidget_solartime);
if (spinner_solartime != null)
{
ArrayAdapter<WidgetSettings.SolarTimeMode> spinner_solartimeAdapter;
spinner_solartimeAdapter = new ArrayAdapter<WidgetSettings.SolarTimeMode>(this, R.layout.layout_listitem_oneline, WidgetSettings.SolarTimeMode.values());
spinner_solartimeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner_solartime.setAdapter(spinner_solartimeAdapter);
}
=======
spinner_timezone_actionMode = new WidgetTimezones.TimeZoneSpinnerSortActionCompat(context, spinner_timezone)
{
@Override
public void onSortTimeZones(WidgetTimezones.TimeZoneItemAdapter result, WidgetTimezones.TimeZoneSort sortMode)
{
super.onSortTimeZones(result, sortMode);
spinner_timezone_adapter = result;
WidgetTimezones.selectTimeZone(spinner_timezone, spinner_timezone_adapter, customTimezoneID);
}
@Override
public void onSaveSortMode( WidgetTimezones.TimeZoneSort sortMode )
{
super.onSaveSortMode(sortMode);
AppSettings.setTimeZoneSortPref(SuntimesConfigActivity.this, sortMode);
}
@Override
public void onDestroyActionMode(ActionMode mode)
{
super.onDestroyActionMode(mode);
actionMode = null;
}
};
>>>>>>>
layout_solartime = (LinearLayout)findViewById(R.id.appwidget_solartime_layout);
label_solartime = (TextView)findViewById(R.id.appwidget_solartime_label);
spinner_solartime = (Spinner)findViewById(R.id.appwidget_solartime);
if (spinner_solartime != null)
{
ArrayAdapter<WidgetSettings.SolarTimeMode> spinner_solartimeAdapter;
spinner_solartimeAdapter = new ArrayAdapter<WidgetSettings.SolarTimeMode>(this, R.layout.layout_listitem_oneline, WidgetSettings.SolarTimeMode.values());
spinner_solartimeAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinner_solartime.setAdapter(spinner_solartimeAdapter);
}
spinner_timezone_actionMode = new WidgetTimezones.TimeZoneSpinnerSortActionCompat(context, spinner_timezone)
{
@Override
public void onSortTimeZones(WidgetTimezones.TimeZoneItemAdapter result, WidgetTimezones.TimeZoneSort sortMode)
{
super.onSortTimeZones(result, sortMode);
spinner_timezone_adapter = result;
WidgetTimezones.selectTimeZone(spinner_timezone, spinner_timezone_adapter, customTimezoneID);
}
@Override
public void onSaveSortMode( WidgetTimezones.TimeZoneSort sortMode )
{
super.onSaveSortMode(sortMode);
AppSettings.setTimeZoneSortPref(SuntimesConfigActivity.this, sortMode);
}
@Override
public void onDestroyActionMode(ActionMode mode)
{
super.onDestroyActionMode(mode);
actionMode = null;
}
};
<<<<<<<
spinner_timezone.setSelection(WidgetTimezones.ordinal(timezoneID), true);
=======
if (spinner_timezone_adapter != null)
{
spinner_timezone.setSelection(spinner_timezone_adapter.ordinal(timezoneID), true);
}
>>>>>>>
if (spinner_timezone_adapter != null)
{
spinner_timezone.setSelection(spinner_timezone_adapter.ordinal(timezoneID), true);
}
<<<<<<<
int timezonePos = WidgetTimezones.ordinal(customTimezoneID);
int numTimeZones = WidgetTimezones.values().length;
if (timezonePos >= 0 && timezonePos < numTimeZones)
{
spinner_timezone.setSelection(timezonePos);
} else {
spinner_timezone.setSelection(0);
Log.w("loadTimezoneSettings", "unable to find timezone " + customTimezoneID + " in the list! Setting selection to 0." );
}
WidgetSettings.SolarTimeMode solartimeMode = WidgetSettings.loadSolarTimeModePref(context, appWidgetId);
spinner_solartime.setSelection(solartimeMode.ordinal());
setCustomTimezoneEnabled(timezoneMode == WidgetSettings.TimezoneMode.CUSTOM_TIMEZONE);
setUseSolarTime(timezoneMode == WidgetSettings.TimezoneMode.SOLAR_TIME);
=======
WidgetTimezones.selectTimeZone(spinner_timezone, spinner_timezone_adapter, customTimezoneID);
>>>>>>>
WidgetTimezones.selectTimeZone(spinner_timezone, spinner_timezone_adapter, customTimezoneID); |
<<<<<<<
=======
import com.forrestguice.suntimeswidget.calendar.SuntimesCalendarSettings;
import com.forrestguice.suntimeswidget.calendar.SuntimesCalendarTask;
>>>>>>>
<<<<<<<
=======
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
{
if (grantResults.length > 0 && permissions.length > 0)
{
switch (requestCode)
{
case REQUEST_CALENDARPREFSFRAGMENT_ENABLED:
case REQUEST_CALENDARPREFSFRAGMENT_DISABLED:
if (grantResults[0] == PackageManager.PERMISSION_GRANTED)
{
boolean enabled = requestCode == (REQUEST_CALENDARPREFSFRAGMENT_ENABLED);
runCalendarTask(SuntimesSettingsActivity.this, enabled);
SharedPreferences.Editor pref = PreferenceManager.getDefaultSharedPreferences(context).edit();
pref.putBoolean(SuntimesCalendarSettings.PREF_KEY_CALENDARS_ENABLED, enabled);
pref.apply();
if (tmp_calendarPref != null)
{
tmp_calendarPref.setChecked(enabled);
tmp_calendarPref = null;
}
}
break;
}
}
}
@Override
>>>>>>>
<<<<<<<
=======
String key_observerHeight = WidgetSettings.PREF_PREFIX_KEY + "0" + WidgetSettings.PREF_PREFIX_KEY_GENERAL + WidgetSettings.PREF_KEY_GENERAL_OBSERVERHEIGHT;
LengthPreference observerHeightPref = (LengthPreference) fragment.findPreference(key_observerHeight);
if (observerHeightPref != null)
{
initPref_observerHeight(fragment.getActivity(), observerHeightPref);
loadPref_observerHeight(fragment.getActivity(), observerHeightPref);
}
}
>>>>>>>
String key_observerHeight = WidgetSettings.PREF_PREFIX_KEY + "0" + WidgetSettings.PREF_PREFIX_KEY_GENERAL + WidgetSettings.PREF_KEY_GENERAL_OBSERVERHEIGHT;
LengthPreference observerHeightPref = (LengthPreference) fragment.findPreference(key_observerHeight);
if (observerHeightPref != null)
{
initPref_observerHeight(fragment.getActivity(), observerHeightPref);
loadPref_observerHeight(fragment.getActivity(), observerHeightPref);
}
}
<<<<<<<
} catch (Exception e) {
Log.e("CalendarPrefs", "Unable to launch SuntimesCalendarActivity! " + e);
}
}
AppSettings.initLocale(getActivity());
addPreferencesFromResource(R.xml.preference_calendar);
Preference calendarReadme = findPreference("appwidget_0_calendars_readme");
if (calendarReadme != null)
=======
private void initPref_calendars()
{
CheckBoxPreference calendarsEnabledPref = (CheckBoxPreference) findPreference(SuntimesCalendarSettings.PREF_KEY_CALENDARS_ENABLED);
initPref_calendars(this, calendarsEnabledPref);
}
@TargetApi(Build.VERSION_CODES.HONEYCOMB)
private static void initPref_calendars(PreferenceFragment fragment)
{
CheckBoxPreference calendarsEnabledPref = (CheckBoxPreference) fragment.findPreference(SuntimesCalendarSettings.PREF_KEY_CALENDARS_ENABLED);
initPref_calendars(fragment.getActivity(), calendarsEnabledPref);
}
private static void initPref_calendars(final Activity activity, final CheckBoxPreference enabledPref )
{
final Preference.OnPreferenceChangeListener onPreferenceChanged0 = new Preference.OnPreferenceChangeListener()
{
@Override
public boolean onPreferenceChange(Preference preference, Object newValue)
>>>>>>>
} catch (Exception e) {
Log.e("CalendarPrefs", "Unable to launch SuntimesCalendarActivity! " + e);
}
}
AppSettings.initLocale(getActivity());
addPreferencesFromResource(R.xml.preference_calendar);
Preference calendarReadme = findPreference("appwidget_0_calendars_readme");
if (calendarReadme != null) |
<<<<<<<
public static final String KEY_UI_CARDPOSITION = "cardPosition";
=======
public static final String KEY_UI_RESETNOTE = "resetNote";
>>>>>>>
public static final String KEY_UI_CARDPOSITION = "cardPosition";
public static final String KEY_UI_RESETNOTE = "resetNote";
<<<<<<<
outState.putInt(KEY_UI_CARDPOSITION, ((card_layout.findFirstVisibleItemPosition() + card_layout.findLastVisibleItemPosition()) / 2));
=======
outState.putBoolean(KEY_UI_CARDISTOMORROW, (card_flipper.getDisplayedChild() != 0));
outState.putBoolean(KEY_UI_RESETNOTE, onStart_resetNoteIndex);
>>>>>>>
outState.putInt(KEY_UI_CARDPOSITION, ((card_layout.findFirstVisibleItemPosition() + card_layout.findLastVisibleItemPosition()) / 2));
outState.putBoolean(KEY_UI_RESETNOTE, onStart_resetNoteIndex); |
<<<<<<<
public static final int[] FEATURES = new int[] { FEATURE_RISESET, FEATURE_SOLSTICE, FEATURE_ALTITUDE, FEATURE_MOON };
=======
public static final int[] FEATURES = new int[] { FEATURE_RISESET, FEATURE_SOLSTICE, FEATURE_GOLDBLUE, FEATURE_ALTITUDE };
>>>>>>>
public static final int[] FEATURES = new int[] { FEATURE_RISESET, FEATURE_SOLSTICE, FEATURE_GOLDBLUE, FEATURE_ALTITUDE, FEATURE_MOON }; |
<<<<<<<
import java.sql.SQLException;
import java.util.Optional;
=======
import java.util.List;
>>>>>>>
import java.util.Optional;
<<<<<<<
String apiKey = Optional.ofNullable(requestContext.getUriInfo().getQueryParameters().get("k"))
.flatMap(l -> l.stream().findFirst()).orElse(requestContext.getHeaderString("k"));
=======
List<String> keys = requestContext.getUriInfo().getQueryParameters().get("k");
if (keys == null || keys.isEmpty()) {
throw new WebApplicationException("Please provide an API key", Status.UNAUTHORIZED);
}
>>>>>>>
String apiKey = Optional.ofNullable(requestContext.getUriInfo().getQueryParameters().get("k"))
.flatMap(l -> l.stream().findFirst()).orElse(requestContext.getHeaderString("k"));
<<<<<<<
if (apiKey == null || !backend.verifyGeneralKey(apiKey)) {
throw new WebApplicationException("Please provide an API key", 401);
}
} catch (SQLException e) {
throw new InternalServerErrorException(e);
=======
authentication.findKey(keys.get(0));
} catch (NotFoundException e) {
throw new WebApplicationException("Unknown API key", Status.UNAUTHORIZED);
>>>>>>>
if (apiKey == null) {
throw new NotFoundException();
}
authentication.findKey(apiKey);
} catch (NotFoundException e) {
throw new WebApplicationException("Unknown API key", Status.UNAUTHORIZED); |
<<<<<<<
import com.forrestguice.suntimeswidget.themes.SuntimesTheme;
=======
import com.forrestguice.suntimeswidget.settings.AppSettings;
import com.forrestguice.suntimeswidget.settings.WidgetSettings;
>>>>>>>
import com.forrestguice.suntimeswidget.themes.SuntimesTheme;
import com.forrestguice.suntimeswidget.settings.AppSettings;
import com.forrestguice.suntimeswidget.settings.WidgetSettings;
<<<<<<<
private TextView sunAzimuth, sunAzimuthRising, sunAzimuthSetting, sunAzimuthAtNoon, sunAzimuthLabel;
private TextView sunElevation, sunElevationAtNoon, sunElevationLabel;
private ImageView riseIcon, setIcon;
=======
private TextView sunAzimuth, sunAzimuthRising, sunAzimuthSetting, sunAzimuthAtNoon;
private TextView sunElevation, sunElevationAtNoon;
private TextView sunShadowObj, sunShadowLength, sunShadowLengthAtNoon;
>>>>>>>
private TextView sunAzimuth, sunAzimuthRising, sunAzimuthSetting, sunAzimuthAtNoon, sunAzimuthLabel;
private TextView sunElevation, sunElevationAtNoon, sunElevationLabel;
private ImageView riseIcon, setIcon;
private TextView sunShadowObj, sunShadowLength, sunShadowLengthAtNoon; |
<<<<<<<
int FEATURE_MOON = 30; // feature: moonrise, moonset, phase, illumination
=======
int FEATURE_GOLDBLUE = 30; // feature: gold, blue hour times
>>>>>>>
int FEATURE_MOON = 30; // feature: moonrise, moonset, phase, illumination
int FEATURE_GOLDBLUE = 30; // feature: gold, blue hour times |
<<<<<<<
ThemeDescriptor themeDescriptor = WidgetThemes.valueOf(theme.themeName());
if (themeDescriptor != null)
{
spinner_theme.setSelection(themeDescriptor.ordinal(WidgetThemes.values()));
} else {
Log.e("loadAppearanceSettings", "theme is not installed! " + theme.themeName());
}
=======
ThemeDescriptor themeDescriptor;
try
{
themeDescriptor = WidgetThemes.valueOf(theme.themeName());
} catch (InvalidParameterException e) {
Log.e("loadAppearanceSettings", "Failed to load theme " + theme.themeName());
themeDescriptor = DarkTheme.THEMEDEF_DESCRIPTOR;
}
spinner_theme.setSelection(themeDescriptor.ordinal(WidgetThemes.values()));
>>>>>>>
ThemeDescriptor themeDescriptor;
try
{
themeDescriptor = WidgetThemes.valueOf(theme.themeName());
} catch (InvalidParameterException e) {
Log.e("loadAppearanceSettings", "Failed to load theme " + theme.themeName());
themeDescriptor = DarkTheme.THEMEDEF_DESCRIPTOR;
}
if (themeDescriptor != null)
{
spinner_theme.setSelection(themeDescriptor.ordinal(WidgetThemes.values()));
} else {
Log.e("loadAppearanceSettings", "theme is not installed! " + theme.themeName());
} |
<<<<<<<
* @return an AlarmManager interval; e.g. AlarmManager.INTERVAL_DAY
*/
protected long getUpdateInterval()
{
return AlarmManager.INTERVAL_DAY;
}
/**
* @param context
=======
* @param context the context
>>>>>>>
* @return an AlarmManager interval; e.g. AlarmManager.INTERVAL_DAY
*/
protected long getUpdateInterval()
{
return AlarmManager.INTERVAL_DAY;
}
/**
* @param context
* @param context the context |
<<<<<<<
public static final String PREF_KEY_UI_SHOWGOLDHOUR = "app_ui_showgoldhour";
public static final boolean PREF_DEF_UI_SHOWGOLDHOUR = true;
public static final String PREF_KEY_UI_SHOWBLUEHOUR = "app_ui_showbluehour";
public static final boolean PREF_DEF_UI_SHOWBLUEHOUR = false;
=======
public static final String PREF_KEY_ACCESSIBILITY_VERBOSE = "app_accessibility_verbose";
public static final boolean PREF_DEF_ACCESSIBILITY_VERBOSE = false;
>>>>>>>
public static final String PREF_KEY_UI_SHOWGOLDHOUR = "app_ui_showgoldhour";
public static final boolean PREF_DEF_UI_SHOWGOLDHOUR = true;
public static final String PREF_KEY_UI_SHOWBLUEHOUR = "app_ui_showbluehour";
public static final boolean PREF_DEF_UI_SHOWBLUEHOUR = false;
public static final String PREF_KEY_ACCESSIBILITY_VERBOSE = "app_accessibility_verbose";
public static final boolean PREF_DEF_ACCESSIBILITY_VERBOSE = false;
<<<<<<<
public static boolean loadBlueHourPref( Context context )
{
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
return pref.getBoolean(PREF_KEY_UI_SHOWBLUEHOUR, PREF_DEF_UI_SHOWBLUEHOUR);
}
public static boolean loadGoldHourPref( Context context )
{
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
return pref.getBoolean(PREF_KEY_UI_SHOWGOLDHOUR, PREF_DEF_UI_SHOWGOLDHOUR);
}
=======
public static boolean loadVerboseAccessibilityPref( Context context )
{
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
return pref.getBoolean(PREF_KEY_ACCESSIBILITY_VERBOSE, PREF_DEF_ACCESSIBILITY_VERBOSE);
}
>>>>>>>
public static boolean loadBlueHourPref( Context context )
{
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
return pref.getBoolean(PREF_KEY_UI_SHOWBLUEHOUR, PREF_DEF_UI_SHOWBLUEHOUR);
}
public static boolean loadGoldHourPref( Context context )
{
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
return pref.getBoolean(PREF_KEY_UI_SHOWGOLDHOUR, PREF_DEF_UI_SHOWGOLDHOUR);
}
public static boolean loadVerboseAccessibilityPref( Context context )
{
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
return pref.getBoolean(PREF_KEY_ACCESSIBILITY_VERBOSE, PREF_DEF_ACCESSIBILITY_VERBOSE);
} |
<<<<<<<
=======
import java.util.Map;
import java.util.Map.Entry;
import java.util.regex.Pattern;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<<<<<<<
public static DDTracer create(TracerConfig config) {
=======
@SuppressWarnings("unchecked")
public static DDTracer create(TracerConfig config){
>>>>>>>
public static DDTracer create(TracerConfig config) {
<<<<<<<
Sampler sampler;
if (config.getSampler() != null) {
if (RATE_SAMPLER_TYPE.equals(config.getSampler().getType())) {
sampler = new RateSampler(config.getSampler().getRate());
} else if (ALL_SAMPLER_TYPE.equals(config.getSampler().getType())) {
sampler = new AllSampler();
} else {
sampler = DDTracer.UNASSIGNED_SAMPLER;
=======
Sampler sampler = DDTracer.UNASSIGNED_SAMPLER;
if (config.getSampler() != null && config.getSampler().get("type") != null) {
String type = (String) config.getSampler().get("type");
if (type.equals(AllSampler.class.getSimpleName())) {
sampler = new AllSampler();
} else if (type.equals(RateSampler.class.getSimpleName())) {
sampler = new RateSampler((Double) config.getSampler().get("rate"));
}
//Add sampled tags
Map<String,String> skipTagsPatterns = (Map<String, String>) config.getSampler().get("skipTagsPatterns");
if(skipTagsPatterns!=null && sampler instanceof ASampler){
ASampler aSampler = (ASampler) sampler;
for(Entry<String,String> entry:skipTagsPatterns.entrySet()){
aSampler.addSkipTagPattern(entry.getKey(), Pattern.compile(entry.getValue()));
}
>>>>>>>
Sampler sampler;
if (config.getSampler() != null) {
if (RATE_SAMPLER_TYPE.equals(config.getSampler().getType())) {
sampler = new RateSampler(config.getSampler().getRate());
} else if (ALL_SAMPLER_TYPE.equals(config.getSampler().getType())) {
sampler = new AllSampler();
} else {
sampler = DDTracer.UNASSIGNED_SAMPLER;
Sampler sampler = DDTracer.UNASSIGNED_SAMPLER;
if (config.getSampler() != null && config.getSampler().get("type") != null) {
String type = (String) config.getSampler().get("type");
if (type.equals(AllSampler.class.getSimpleName())) {
sampler = new AllSampler();
} else if (type.equals(RateSampler.class.getSimpleName())) {
sampler = new RateSampler((Double) config.getSampler().get("rate"));
}
//Add sampled tags
Map<String,String> skipTagsPatterns = (Map<String, String>) config.getSampler().get("skipTagsPatterns");
if(skipTagsPatterns!=null && sampler instanceof ASampler){
ASampler aSampler = (ASampler) sampler;
for(Entry<String,String> entry:skipTagsPatterns.entrySet()){
aSampler.addSkipTagPattern(entry.getKey(), Pattern.compile(entry.getValue()));
}
<<<<<<<
return new DDTracer(defaultServiceName, writer, sampler);
=======
return new DDTracer(defaultServiceName, writer, sampler);
>>>>>>>
return new DDTracer(defaultServiceName, writer, sampler); |
<<<<<<<
private final Map<String, List<ArtifactSupport>> rules;
=======
private static InstrumentationChecker INSTANCE;
private final Map<String, List<Map<String, String>>> rules;
>>>>>>>
private static InstrumentationChecker INSTANCE;
private final Map<String, List<ArtifactSupport>> rules;
<<<<<<<
private static InstrumentationChecker INSTANCE;
private final ClassLoader classLoader;
=======
>>>>>>>
private final ClassLoader classLoader;
<<<<<<<
private List<String> doGetUnsupportedRules() {
final List<String> unsupportedRules = new ArrayList<>();
for (final String rule : rules.keySet()) {
// Check rules
boolean supported = false;
for (final ArtifactSupport check : rules.get(rule)) {
log.debug("Checking rule {}", check);
boolean matched = true;
for (final String identifyingClass : check.identifyingPresentClasses) {
final boolean classPresent = isClassPresent(identifyingClass);
if (!classPresent) {
log.debug(
"Instrumentation {} not applied due to missing class {}.", rule, identifyingClass);
}
matched &= classPresent;
}
for (final String identifyingClass : check.identifyingMissingClasses) {
final boolean classMissing = !isClassPresent(identifyingClass);
if (!classMissing) {
log.debug(
"Instrumentation {} not applied due to present class {}.", rule, identifyingClass);
}
matched &= classMissing;
}
final boolean useVersionMatching =
frameworks.containsKey(check.artifact)
&& check.identifyingMissingClasses.isEmpty()
&& check.identifyingPresentClasses.isEmpty();
if (useVersionMatching) {
// If no classes to scan, fall back on version regex.
matched = Pattern.matches(check.supportedVersion, frameworks.get(check.artifact));
if (!matched) {
log.debug(
"Library conflict: supported_version={}, actual_version={}",
check.supportedVersion,
frameworks.get(check.artifact));
}
}
supported |= matched;
if (supported) {
break;
}
}
if (!supported) {
log.info("Instrumentation rule={} is not supported", rule);
unsupportedRules.add(rule);
}
}
return unsupportedRules;
}
private boolean isClassPresent(final String identifyingPresentClass) {
try {
return identifyingPresentClass != null
&& Class.forName(identifyingPresentClass, false, classLoader) != null;
} catch (final ClassNotFoundException e) {
return false;
}
}
=======
>>>>>>>
<<<<<<<
@Data
@JsonIgnoreProperties("check")
static class ArtifactSupport {
private String artifact;
@JsonProperty("supported_version")
private String supportedVersion;
@JsonProperty("identifying_present_classes")
private List<String> identifyingPresentClasses = Collections.emptyList();
@JsonProperty("identifying_missing_classes")
private List<String> identifyingMissingClasses = Collections.emptyList();
}
=======
private List<String> doGetUnsupportedRules() {
final List<String> unsupportedRules = new ArrayList<>();
for (final String rule : rules.keySet()) {
// Check rules
boolean supported = false;
for (final Map<String, String> check : rules.get(rule)) {
if (frameworks.containsKey(check.get("artifact"))) {
final boolean matched =
Pattern.matches(
check.get("supported_version"), frameworks.get(check.get("artifact")));
if (!matched) {
log.debug(
"Library conflict: supported_version={}, actual_version={}",
check.get("supported_version"),
frameworks.get(check.get("artifact")));
supported = false;
break;
}
supported = true;
log.trace("Instrumentation rule={} is supported", rule);
}
}
if (!supported) {
log.info("Instrumentation rule={} is not supported", rule);
unsupportedRules.add(rule);
}
}
return unsupportedRules;
}
>>>>>>>
private List<String> doGetUnsupportedRules() {
final List<String> unsupportedRules = new ArrayList<>();
for (final String rule : rules.keySet()) {
// Check rules
boolean supported = false;
for (final ArtifactSupport check : rules.get(rule)) {
log.debug("Checking rule {}", check);
boolean matched = true;
for (final String identifyingClass : check.identifyingPresentClasses) {
final boolean classPresent = isClassPresent(identifyingClass);
if (!classPresent) {
log.debug(
"Instrumentation {} not applied due to missing class {}.", rule, identifyingClass);
}
matched &= classPresent;
}
for (final String identifyingClass : check.identifyingMissingClasses) {
final boolean classMissing = !isClassPresent(identifyingClass);
if (!classMissing) {
log.debug(
"Instrumentation {} not applied due to present class {}.", rule, identifyingClass);
}
matched &= classMissing;
}
final boolean useVersionMatching =
frameworks.containsKey(check.artifact)
&& check.identifyingMissingClasses.isEmpty()
&& check.identifyingPresentClasses.isEmpty();
if (useVersionMatching) {
// If no classes to scan, fall back on version regex.
matched = Pattern.matches(check.supportedVersion, frameworks.get(check.artifact));
if (!matched) {
log.debug(
"Library conflict: supported_version={}, actual_version={}",
check.supportedVersion,
frameworks.get(check.artifact));
}
}
supported |= matched;
if (supported) {
break;
}
}
if (!supported) {
log.info("Instrumentation rule={} is not supported", rule);
unsupportedRules.add(rule);
}
}
return unsupportedRules;
}
private boolean isClassPresent(final String identifyingPresentClass) {
try {
return identifyingPresentClass != null
&& Class.forName(identifyingPresentClass, false, classLoader) != null;
} catch (final ClassNotFoundException e) {
return false;
}
}
@Data
@JsonIgnoreProperties("check")
static class ArtifactSupport {
private String artifact;
@JsonProperty("supported_version")
private String supportedVersion;
@JsonProperty("identifying_present_classes")
private List<String> identifyingPresentClasses = Collections.emptyList();
@JsonProperty("identifying_missing_classes")
private List<String> identifyingMissingClasses = Collections.emptyList();
} |
<<<<<<<
import com.datadoghq.trace.Codec;
=======
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.datadoghq.trace.Codec;
<<<<<<<
import io.opentracing.propagation.TextMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.*;
=======
>>>>>>> |
<<<<<<<
null,
this.parent == null ? this.spanType : p.getSpanType(),
true,
=======
this.spanType,
>>>>>>>
this.parent == null ? this.spanType : p.getSpanType(), |
<<<<<<<
private final String traceId;
=======
private final long traceId;
private final Map<String, String> serviceNameMappings;
>>>>>>>
private final String traceId;
private final Map<String, String> serviceNameMappings;
<<<<<<<
PendingTrace(final DDTracer tracer, final String traceId) {
=======
PendingTrace(
final DDTracer tracer, final long traceId, final Map<String, String> serviceNameMappings) {
>>>>>>>
PendingTrace(
final DDTracer tracer, final String traceId, final Map<String, String> serviceNameMappings) { |
<<<<<<<
import static datadog.trace.api.ConfigDefaults.DEFAULT_ASYNC_PROPAGATING;
=======
import static datadog.trace.util.AgentThreadFactory.AGENT_THREAD_GROUP;
>>>>>>>
import static datadog.trace.api.ConfigDefaults.DEFAULT_ASYNC_PROPAGATING;
import static datadog.trace.util.AgentThreadFactory.AGENT_THREAD_GROUP; |
<<<<<<<
@Getter private final boolean appCustomLogManager;
// If `true` the hostname will be detected and added to the root span's metadata
@Getter private final boolean reportHostName;
=======
>>>>>>>
// If `true` the hostname will be detected and added to the root span's metadata
@Getter private final boolean reportHostName;
<<<<<<<
appCustomLogManager =
getBooleanSettingFromEnvironment(APP_CUSTOM_LOG_MANAGER, DEFAULT_APP_CUSTOM_LOG_MANAGER);
reportHostName =
getBooleanSettingFromEnvironment(TRACE_REPORT_HOSTNAME, DEFAULT_TRACE_REPORT_HOSTNAME);
=======
>>>>>>>
reportHostName =
getBooleanSettingFromEnvironment(TRACE_REPORT_HOSTNAME, DEFAULT_TRACE_REPORT_HOSTNAME);
<<<<<<<
appCustomLogManager =
getBooleanSettingFromEnvironment(APP_CUSTOM_LOG_MANAGER, DEFAULT_APP_CUSTOM_LOG_MANAGER);
reportHostName =
getPropertyBooleanValue(properties, TRACE_REPORT_HOSTNAME, parent.reportHostName);
=======
>>>>>>>
reportHostName =
getPropertyBooleanValue(properties, TRACE_REPORT_HOSTNAME, parent.reportHostName); |
<<<<<<<
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
=======
import com.datadoghq.trace.Utils.TracerLogger;
>>>>>>>
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import com.datadoghq.trace.Utils.TracerLogger;
<<<<<<<
=======
import java.util.*;
>>>>>>> |
<<<<<<<
public final static Object MISSING = new Object();
public final static Object NO_BINDING = new Object();
// TODO move me to Utils
private static String toString(String[] values) {
String toReturn = "";
if (values != null) {
for (String value : values) {
toReturn = "," + value;
}
}
if (toReturn.equals("")) {
return toReturn;
}
return toReturn.substring(1);
}
static Object bindInternal(String name, Class clazz, Type type, Annotation[] annotations, Map<String, String[]> params, String prefix, String[] profiles) {
=======
@SuppressWarnings("unchecked")
static Object bindInternal(String name, Class clazz, Type type, Map<String, String[]> params, String prefix) {
>>>>>>>
public final static Object MISSING = new Object();
public final static Object NO_BINDING = new Object();
// TODO move me to Utils
private static String toString(String[] values) {
String toReturn = "";
if (values != null) {
for (String value : values) {
toReturn = "," + value;
}
}
if (toReturn.equals("")) {
return toReturn;
}
return toReturn.substring(1);
}
@SuppressWarnings("unchecked")
static Object bindInternal(String name, Class clazz, Type type, Annotation[] annotations, Map<String, String[]> params, String prefix, String[] profiles) { |
<<<<<<<
import android.os.Handler;
=======
import android.content.pm.PackageManager;
>>>>>>>
import android.content.pm.PackageManager;
import android.os.Handler;
<<<<<<<
if (options == null) {
throw new IllegalArgumentException("GalgoOptions must not be null");
}
=======
checkPermission(context);
>>>>>>>
checkPermission(context); |
<<<<<<<
=======
import org.hibernate.type.Type;
import play.Invoker.InvocationContext;
>>>>>>>
<<<<<<<
=======
import org.apache.commons.lang.*;
import play.db.Configuration;
>>>>>>> |
<<<<<<<
import java.io.FileOutputStream;
=======
import java.io.FileNotFoundException;
>>>>>>>
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
<<<<<<<
import java.io.OutputStream;
=======
import java.nio.channels.Channel;
import java.nio.channels.Channels;
import java.nio.channels.FileChannel;
>>>>>>>
import java.io.OutputStream;
import java.nio.channels.Channel;
import java.nio.channels.FileChannel; |
<<<<<<<
import java.io.OutputStream;
=======
import java.nio.channels.Channel;
import java.nio.channels.Channels;
>>>>>>>
import java.io.OutputStream;
import java.nio.channels.Channel;
import java.nio.channels.Channels; |
<<<<<<<
import play.data.binding.annotations.As;
=======
import play.exceptions.UnexpectedException;
>>>>>>>
import play.data.binding.annotations.As;
import play.exceptions.UnexpectedException;
<<<<<<<
=======
>>>>>>>
<<<<<<<
// Let see if we have a As annotation and a separator. If so, we need to split the values
// Look up for the As annotation
if (annotations != null) {
for (Annotation annotation : annotations) {
if (value != null && value.length > 0 && annotation.annotationType().equals(As.class)) {
final String separator = ((As) annotation).separator();
value = value[0].split(separator);
}
}
}
// Arrays types
=======
// Arrays types
>>>>>>>
// Let see if we have a As annotation and a separator. If so, we need to split the values
// Look up for the As annotation
if (annotations != null) {
for (Annotation annotation : annotations) {
if (value != null && value.length > 0 && annotation.annotationType().equals(As.class)) {
final String separator = ((As) annotation).separator();
value = value[0].split(separator);
}
}
}
// Arrays types
<<<<<<<
public static Object bind(String name, Class clazz, Type type, Annotation[] annotations, Map<String, String[]> params) {
=======
public static Object bind(String name, Class clazz, Type type, Map<String, String[]> params) {
return bind(name, clazz, type, params, null, null, 0);
}
public static Object bind(String name, Class clazz, Type type, Map<String, String[]> params, Object o, Method method, int parameterIndex) {
>>>>>>>
public static Object bind(String name, Class clazz, Type type, Annotation[] annotations, Map<String, String[]> params) {
return bind(name, clazz, type, annotations, params, null, null, 0);
}
public static Object bind(String name, Class clazz, Type type, Annotation[] annotations, Map<String, String[]> params, Object o, Method method, int parameterIndex) {
<<<<<<<
return directBind(null, value, clazz);
}
public static Object directBind(Annotation[] annotations, String value, Class clazz) throws Exception {
=======
>>>>>>>
return directBind(null, value, clazz);
}
public static Object directBind(Annotation[] annotations, String value, Class clazz) throws Exception {
<<<<<<<
if (annotations != null) {
for (Annotation annotation : annotations) {
if (annotation.getClass().equals(As.class)) {
Class<? extends SupportedType> toInstanciate = ((As)annotation).implementation();
if (!(toInstanciate.equals(As.DEFAULT.class))) {
// Instanciate the binder
SupportedType myInstance = toInstanciate.newInstance();
return myInstance.bind(annotations, value);
}
}
}
}
if (supportedTypes.containsKey(clazz)) {
if (value == null || value.trim().length() == 0) {
return null;
}
return supportedTypes.get(clazz).bind(annotations, value);
=======
boolean nullOrEmpty = value == null || value.trim().length() == 0;
if (supportedTypes.containsKey(clazz)) {
return nullOrEmpty ? null : supportedTypes.get(clazz).bind(value);
>>>>>>>
if (annotations != null) {
for (Annotation annotation : annotations) {
if (annotation.getClass().equals(As.class)) {
Class<? extends SupportedType> toInstanciate = ((As)annotation).implementation();
if (!(toInstanciate.equals(As.DEFAULT.class))) {
// Instanciate the binder
SupportedType myInstance = toInstanciate.newInstance();
return myInstance.bind(annotations, value);
}
}
}
}
boolean nullOrEmpty = value == null || value.trim().length() == 0;
if (supportedTypes.containsKey(clazz)) {
return nullOrEmpty ? null : supportedTypes.get(clazz).bind(annotations, value);
<<<<<<<
if (clazz.getName().equals("byte") || clazz.equals(Byte.class)) {
if (value == null || value.trim().length() == 0) {
return clazz.isPrimitive() ? 0 : null;
}
if (value.contains(".")) {
value = value.substring(0, value.indexOf("."));
}
return Byte.parseByte(value);
}
=======
// BigDecimal binding
>>>>>>>
// BigDecimal binding |
<<<<<<<
import play.libs.MimeTypes;
=======
import play.mvc.results.NoResult;
>>>>>>>
import play.libs.MimeTypes;
import play.mvc.results.NoResult;
<<<<<<<
import play.mvc.results.Ok;
import play.mvc.results.RenderBinary;
import play.mvc.results.RenderText;
import play.utils.Utils;
=======
>>>>>>>
import play.mvc.results.Ok;
import play.mvc.results.RenderBinary;
import play.mvc.results.RenderText;
import play.utils.Utils;
<<<<<<<
=======
throw new NoResult();
>>>>>>>
throw new NoResult(); |
<<<<<<<
import org.nuxeo.ecm.core.query.sql.model.DateLiteral;
=======
import org.nuxeo.ecm.core.query.sql.SQLQueryParser;
>>>>>>>
import org.nuxeo.ecm.core.query.sql.SQLQueryParser;
import org.nuxeo.ecm.core.query.sql.model.DateLiteral; |
<<<<<<<
@In(create = true)
protected transient CoreSession documentManager;
=======
@In(create = true, required = false)
protected CoreSession documentManager;
>>>>>>>
@In(create = true, required = false)
protected transient CoreSession documentManager; |
<<<<<<<
=======
import org.springframework.security.web.DefaultSecurityFilterChain;
import org.springframework.security.web.access.channel.ChannelProcessingFilter;
>>>>>>> |
<<<<<<<
protected ProgressMonitor monitor = DefaultProgressMonitor.INSTANCE;
=======
>>>>>>>
<<<<<<<
throw new ClientException("Failed to get children for " +
parent.toString(), e);
}
}
public List<DocumentRef> getChildrenRefs(DocumentRef parentRef,
String perm) throws ClientException {
if (perm != null) {
// XXX TODO
throw new ClientException("perm != null not implemented");
}
try {
Document parent = resolveReference(parentRef);
checkPermission(parent, READ_CHILDREN);
List<String> ids = parent.getChildrenIds();
List<DocumentRef> refs = new ArrayList<DocumentRef>(ids.size());
for (String id : ids) {
refs.add(new IdRef(id));
}
return refs;
} catch (DocumentException e) {
throw new ClientException(e);
=======
throw new ClientException("Failed to get children for " +
parent.toString(), e);
>>>>>>>
throw new ClientException("Failed to get children for " +
parent.toString(), e);
}
}
public List<DocumentRef> getChildrenRefs(DocumentRef parentRef,
String perm) throws ClientException {
if (perm != null) {
// XXX TODO
throw new ClientException("perm != null not implemented");
}
try {
Document parent = resolveReference(parentRef);
checkPermission(parent, READ_CHILDREN);
List<String> ids = parent.getChildrenIds();
List<DocumentRef> refs = new ArrayList<DocumentRef>(ids.size());
for (String id : ids) {
refs.add(new IdRef(id));
}
return refs;
} catch (DocumentException e) {
throw new ClientException(e);
<<<<<<<
try {
checkPermission(doc, WRITE_LIFE_CYCLE);
String formerStateName = doc.getCurrentLifeCycleState();
operationResult = doc.followTransition(transition);
if (operationResult) {
// Construct a map holding meta information about the event.
Map<String, Object> options = new HashMap<String, Object>();
options.put(LifeCycleEventTypes.OPTION_NAME_FROM,
formerStateName);
options.put(LifeCycleEventTypes.OPTION_NAME_TO,
doc.getCurrentLifeCycleState());
options.put(LifeCycleEventTypes.OPTION_NAME_TRANSITION,
transition);
options.put(CoreEventConstants.DOCUMENT, doc);
DocumentModel docModel = readModel(doc, null);
notifyEvent(LifeCycleEventTypes.LIFECYCLE_TRANSITION_EVENT,
docModel, options,
DocumentEventCategories.EVENT_LIFE_CYCLE_CATEGORY,
null, true);
}
} catch (LifeCycleException e) {
ClientException ce = new ClientException(
"Unable to follow transition <" + transition +
"> for document : " + docRef, e);
ce.fillInStackTrace();
throw ce;
}
=======
checkPermission(doc, WRITE_LIFE_CYCLE);
String formerStateName = doc.getCurrentLifeCycleState();
operationResult = doc.followTransition(transition);
if (operationResult) {
// Construct a map holding meta information about the event.
Map<String, Object> options = new HashMap<String, Object>();
options.put(LifeCycleEventTypes.OPTION_NAME_FROM,
formerStateName);
options.put(LifeCycleEventTypes.OPTION_NAME_TO,
doc.getCurrentLifeCycleState());
options.put(LifeCycleEventTypes.OPTION_NAME_TRANSITION,
transition);
options.put(CoreEventConstants.DOCUMENT, doc);
DocumentModel docModel = readModel(doc, null);
notifyEvent(LifeCycleEventTypes.LIFECYCLE_TRANSITION_EVENT,
docModel, options,
DocumentEventCategories.EVENT_LIFE_CYCLE_CATEGORY,
null, true);
}
} catch (LifeCycleException e) {
ClientException ce = new ClientException(
"Unable to follow transition <" + transition +
"> for document : " + docRef, e);
ce.fillInStackTrace();
throw ce;
>>>>>>>
checkPermission(doc, WRITE_LIFE_CYCLE);
String formerStateName = doc.getCurrentLifeCycleState();
operationResult = doc.followTransition(transition);
if (operationResult) {
// Construct a map holding meta information about the event.
Map<String, Object> options = new HashMap<String, Object>();
options.put(LifeCycleEventTypes.OPTION_NAME_FROM,
formerStateName);
options.put(LifeCycleEventTypes.OPTION_NAME_TO,
doc.getCurrentLifeCycleState());
options.put(LifeCycleEventTypes.OPTION_NAME_TRANSITION,
transition);
options.put(CoreEventConstants.DOCUMENT, doc);
DocumentModel docModel = readModel(doc, null);
notifyEvent(LifeCycleEventTypes.LIFECYCLE_TRANSITION_EVENT,
docModel, options,
DocumentEventCategories.EVENT_LIFE_CYCLE_CATEGORY,
null, true);
}
} catch (LifeCycleException e) {
ClientException ce = new ClientException(
"Unable to follow transition <" + transition +
"> for document : " + docRef, e);
ce.fillInStackTrace();
throw ce;
<<<<<<<
try {
checkPermission(doc, READ_LIFE_CYCLE);
allowedStateTransitions = doc.getAllowedStateTransitions();
} catch (LifeCycleException e) {
ClientException ce = new ClientException(
"Unable to get allowed state transitions for document : " +
docRef, e);
ce.fillInStackTrace();
throw ce;
}
=======
checkPermission(doc, READ_LIFE_CYCLE);
allowedStateTransitions = doc.getAllowedStateTransitions();
} catch (LifeCycleException e) {
ClientException ce = new ClientException(
"Unable to get allowed state transitions for document : " +
docRef, e);
ce.fillInStackTrace();
throw ce;
>>>>>>>
checkPermission(doc, READ_LIFE_CYCLE);
allowedStateTransitions = doc.getAllowedStateTransitions();
} catch (LifeCycleException e) {
ClientException ce = new ClientException(
"Unable to get allowed state transitions for document : " +
docRef, e);
ce.fillInStackTrace();
throw ce;
<<<<<<<
return op.run(this, monitor, (Object[]) null);
=======
Document doc = resolveReference(ref);
if (doc == null) {
throw new ClientException("No Such Document: " + ref);
}
boolean readPermChecked = false;
if ((refreshFlags & DocumentModel.REFRESH_PREFETCH) != 0) {
if (!readPermChecked) {
checkPermission(doc, READ);
readPermChecked = true;
}
PrefetchInfo info = doc.getType().getPrefetchInfo();
if (info != null) {
Schema[] pschemas = info.getSchemas();
if (pschemas != null) {
// TODO: this should be returned as document parts of
// the document
}
Field[] fields = info.getFields();
if (fields != null) {
Map<String, Serializable> prefetch = new HashMap<String, Serializable>();
// TODO : should use documentpartreader
for (Field field : fields) {
Object value = doc.getPropertyValue(field.getName().getPrefixedName());
prefetch.put(field.getDeclaringType().getName() +
'.' + field.getName().getLocalName(),
value == null ? Null.VALUE
: (Serializable) value);
}
result[0] = prefetch;
}
}
}
if ((refreshFlags & DocumentModel.REFRESH_LOCK) != 0) {
if (!readPermChecked) {
checkPermission(doc, READ);
readPermChecked = true;
}
result[1] = doc.getLock();
}
if ((refreshFlags & DocumentModel.REFRESH_LIFE_CYCLE) != 0) {
checkPermission(doc, READ_LIFE_CYCLE);
result[2] = doc.getCurrentLifeCycleState();
result[3] = doc.getLifeCyclePolicy();
}
if ((refreshFlags & DocumentModel.REFRESH_ACP) != 0) {
checkPermission(doc, READ_SECURITY);
result[4] = getSession().getSecurityManager().getMergedACP(doc);
}
if ((refreshFlags & (DocumentModel.REFRESH_CONTENT)) != 0) {
if (!readPermChecked) {
checkPermission(doc, READ);
readPermChecked = true;
}
if (schemas == null) {
schemas = doc.getType().getSchemaNames();
}
DocumentType type = doc.getType();
DocumentPart[] parts = new DocumentPart[schemas.length];
for (int i = 0; i < schemas.length; i++) {
DocumentPart part = new DocumentPartImpl(
type.getSchema(schemas[i]));
doc.readDocumentPart(part);
parts[i] = part;
}
result[5] = parts;
}
>>>>>>>
Document doc = resolveReference(ref);
if (doc == null) {
throw new ClientException("No Such Document: " + ref);
}
boolean readPermChecked = false;
if ((refreshFlags & DocumentModel.REFRESH_PREFETCH) != 0) {
if (!readPermChecked) {
checkPermission(doc, READ);
readPermChecked = true;
}
PrefetchInfo info = doc.getType().getPrefetchInfo();
if (info != null) {
Schema[] pschemas = info.getSchemas();
if (pschemas != null) {
// TODO: this should be returned as document parts of
// the document
}
Field[] fields = info.getFields();
if (fields != null) {
Map<String, Serializable> prefetch = new HashMap<String, Serializable>();
// TODO : should use documentpartreader
for (Field field : fields) {
Object value = doc.getPropertyValue(field.getName().getPrefixedName());
prefetch.put(field.getDeclaringType().getName() +
'.' + field.getName().getLocalName(),
value == null ? Null.VALUE
: (Serializable) value);
}
result[0] = prefetch;
}
}
}
if ((refreshFlags & DocumentModel.REFRESH_LOCK) != 0) {
if (!readPermChecked) {
checkPermission(doc, READ);
readPermChecked = true;
}
result[1] = doc.getLock();
}
if ((refreshFlags & DocumentModel.REFRESH_LIFE_CYCLE) != 0) {
checkPermission(doc, READ_LIFE_CYCLE);
result[2] = doc.getCurrentLifeCycleState();
result[3] = doc.getLifeCyclePolicy();
}
if ((refreshFlags & DocumentModel.REFRESH_ACP) != 0) {
checkPermission(doc, READ_SECURITY);
result[4] = getSession().getSecurityManager().getMergedACP(doc);
}
if ((refreshFlags & (DocumentModel.REFRESH_CONTENT)) != 0) {
if (!readPermChecked) {
checkPermission(doc, READ);
readPermChecked = true;
}
if (schemas == null) {
schemas = doc.getType().getSchemaNames();
}
DocumentType type = doc.getType();
DocumentPart[] parts = new DocumentPart[schemas.length];
for (int i = 0; i < schemas.length; i++) {
DocumentPart part = new DocumentPartImpl(
type.getSchema(schemas[i]));
doc.readDocumentPart(part);
parts[i] = part;
}
result[5] = parts;
} |
<<<<<<<
public Collection<ComponentName> getActivatingRegistrations() {
Collection<ComponentName> activating = new ArrayList<ComponentName>();
for (RegistrationInfo ri : registry.values()) {
if (ri.getState() == RegistrationInfo.ACTIVATING) {
activating.add(ri.getName());
}
}
return activating;
}
=======
public <T> T getService(Class<T> serviceClass) {
ComponentInstance comp = getComponentProvidingService(serviceClass);
return comp != null ? comp.getAdapter(serviceClass) : null;
}
>>>>>>>
public <T> T getService(Class<T> serviceClass) {
ComponentInstance comp = getComponentProvidingService(serviceClass);
return comp != null ? comp.getAdapter(serviceClass) : null;
}
public Collection<ComponentName> getActivatingRegistrations() {
Collection<ComponentName> activating = new ArrayList<ComponentName>();
for (RegistrationInfo ri : registry.values()) {
if (ri.getState() == RegistrationInfo.ACTIVATING) {
activating.add(ri.getName());
}
}
return activating;
} |
<<<<<<<
+ MAX_POOL_SIZE);
indexingTpExec = IndexingThreadPoolExecutor.newInstance(MIN_POOL_SIZE,
MAX_POOL_SIZE, THREAD_KEEP_ALIVE, TimeUnit.MILLISECONDS);
=======
+ maxPoolSize);
tpExec = new ThreadPoolExecutor(MIN_POOL_SIZE, maxPoolSize,
THREAD_KEEP_ALIVE, TimeUnit.MILLISECONDS,
new LinkedBlockingQueue<Runnable>(DEFAULT_QUEUE_SIZE),
new IndexingThreadFactory());
>>>>>>>
+ maxPoolSize);
indexingTpExec = IndexingThreadPoolExecutor.newInstance(MIN_POOL_SIZE,
maxPoolSize, THREAD_KEEP_ALIVE, TimeUnit.MILLISECONDS);
<<<<<<<
protected static void executeIndexingTask(Task task) {
synchronized (indexingTpExec) {
indexingTpExec.execute(task);
=======
protected static void execute(AbstractIndexingTask r)
throws IndexingException {
if (searchService != null) {
r.setSearchService(searchService);
>>>>>>>
protected static void executeIndexingTask(Task task) {
synchronized (indexingTpExec) {
indexingTpExec.execute(task); |
<<<<<<<
protected MimetypeRegistry getMimetypeService() {
if (mimetypeService == null) {
try {
mimetypeService = Framework.getService(MimetypeRegistry.class);
} catch (Exception e) {
log.error("Unable to get mimetype service : " + e.getMessage());
}
}
return mimetypeService;
}
//@Create
=======
// @Create
>>>>>>>
//@Create
<<<<<<<
private void setDocumentIconPath(DocumentModel docModel) {
// Set the document icon according to the uploaded file if document
// schema holds given values.
// FIXME: Surely not the better way to do this here
// XXX AT: jsf components should take care of this, or event
// listeners should make the necessary updates + this would need to
// be done again after each edition
Type currentType = getChangeableDocumentType();
Object file = docModel.getProperty("file", "content");
if (file != null && file instanceof Blob) {
Blob blob = (Blob) file;
MimetypeEntry mimeEntry = getMimetypeService().getMimetypeEntryByMimeType(
blob.getMimeType());
String iconPath = "";
if (mimeEntry != null) {
if (mimeEntry.getIconPath() != null) {
// FIXME: above Context should find it
iconPath = "/icons/" + mimeEntry.getIconPath();
} else {
iconPath = currentType.getIcon();
}
} else {
iconPath = currentType.getIcon();
}
docModel.setProperty("common", "icon", iconPath);
} else {
docModel.setProperty("common", "icon", currentType.getIcon());
}
}
=======
>>>>>>> |
<<<<<<<
import com.stormpath.sdk.application.ApplicationAccountStoreMappingList;
import com.stormpath.sdk.application.ApplicationAccountStoreMappingCriteria;
=======
import com.stormpath.sdk.application.ApplicationStatus;
import com.stormpath.sdk.authc.*;
>>>>>>>
import com.stormpath.sdk.application.ApplicationStatus;
<<<<<<<
import com.stormpath.sdk.oauth.OauthRequestAuthenticator;
import com.stormpath.sdk.organization.Organization;
import com.stormpath.sdk.organization.OrganizationCriteria;
import com.stormpath.sdk.organization.OrganizationList;
=======
import com.stormpath.sdk.oauth.*;
>>>>>>>
import com.stormpath.sdk.oauth.OauthRequestAuthenticator;
import com.stormpath.sdk.organization.Organization;
import com.stormpath.sdk.organization.OrganizationCriteria;
import com.stormpath.sdk.organization.OrganizationList;
<<<<<<<
static final ResourceReference<ApplicationAccountStoreMapping> DEFAULT_ACCOUNT_STORE_MAPPING =
new ResourceReference<ApplicationAccountStoreMapping>("defaultAccountStoreMapping", ApplicationAccountStoreMapping.class);
static final ResourceReference<ApplicationAccountStoreMapping> DEFAULT_GROUP_STORE_MAPPING =
new ResourceReference<ApplicationAccountStoreMapping>("defaultGroupStoreMapping", ApplicationAccountStoreMapping.class);
=======
static final ResourceReference<AccountStoreMapping> DEFAULT_ACCOUNT_STORE_MAPPING =
new ResourceReference<AccountStoreMapping>("defaultAccountStoreMapping", AccountStoreMapping.class);
static final ResourceReference<AccountStoreMapping> DEFAULT_GROUP_STORE_MAPPING =
new ResourceReference<AccountStoreMapping>("defaultGroupStoreMapping", AccountStoreMapping.class);
static final ResourceReference<OauthPolicy> OAUTH_POLICY =
new ResourceReference<OauthPolicy>("oAuthPolicy", OauthPolicy.class);
>>>>>>>
static final ResourceReference<ApplicationAccountStoreMapping> DEFAULT_ACCOUNT_STORE_MAPPING =
new ResourceReference<ApplicationAccountStoreMapping>("defaultAccountStoreMapping", ApplicationAccountStoreMapping.class);
static final ResourceReference<ApplicationAccountStoreMapping> DEFAULT_GROUP_STORE_MAPPING =
new ResourceReference<ApplicationAccountStoreMapping>("defaultGroupStoreMapping", ApplicationAccountStoreMapping.class);
static final ResourceReference<OauthPolicy> OAUTH_POLICY =
new ResourceReference<OauthPolicy>("oAuthPolicy", OauthPolicy.class); |
<<<<<<<
MYSQL, //
POSTGRESQL;
};
=======
POSTGRESQL
}
>>>>>>>
MYSQL, //
POSTGRESQL
} |
<<<<<<<
=======
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLStreamHandler;
import java.net.URLStreamHandlerFactory;
import java.util.Collections;
>>>>>>>
import java.util.Collections;
<<<<<<<
=======
@SuppressWarnings( { "ResultOfObjectAllocationIgnored" })
>>>>>>> |
<<<<<<<
* TODO remove this once we work on org.nuxeo.core, v 1.4
*
=======
*
>>>>>>>
*
<<<<<<<
* time
* </p>
*
=======
* time.
*
>>>>>>>
* time.
* </p>
* |
<<<<<<<
whereBuilder = new WhereBuilder(database, model, pathResolver,
dialect, hierTable, hierId, dataHierTable, dataHierId,
docKind == DocKind.PROXY, aliasColumns);
=======
whereBuilder = new WhereBuilder(database, session, dialect,
hierTable, hierId, dataHierTable, dataHierId,
docKind == DocKind.PROXY, true);
>>>>>>>
whereBuilder = new WhereBuilder(database, model, pathResolver,
dialect, hierTable, hierId, dataHierTable, dataHierId,
docKind == DocKind.PROXY, true); |
<<<<<<<
* @author <a href="mailto:[email protected]">Thierry Delprat</a>
=======
>>>>>>>
* @author <a href="mailto:[email protected]">Thierry Delprat</a>
<<<<<<<
private String url;
=======
>>>>>>>
private String url;
<<<<<<<
public DocumentBlob(String name, String encoding, String mimeType, String downloadUrl) throws IOException {
this.name=name;
this.encoding=encoding;
this.mimeType=mimeType;
this.url=downloadUrl;
}
=======
>>>>>>>
public DocumentBlob(String name, String encoding, String mimeType, String downloadUrl) throws IOException {
this.name=name;
this.encoding=encoding;
this.mimeType=mimeType;
this.url=downloadUrl;
}
<<<<<<<
public String getDownloadUrl()
{
return url;
}
=======
>>>>>>>
public String getDownloadUrl()
{
return url;
} |
<<<<<<<
import java.util.Set;
import java.util.TreeSet;
=======
import java.util.concurrent.atomic.AtomicInteger;
>>>>>>>
import java.util.Set;
import java.util.TreeSet;
import java.util.concurrent.atomic.AtomicInteger;
<<<<<<<
public boolean skipDeleted = true; // do not include trashed documents by
// default
protected boolean hasLifeCycleWhereClause = false;
protected boolean hasMixinTypeWhereClause = false;
public FulltextMatchInfo fulltextMatchInfo;
=======
protected FulltextMatchInfo fulltextMatchInfo;
/** Qualifier to type. */
protected Map<String, String> qualifierToType = new HashMap<String, String>();
/** Qualifier to canonical qualifier (correlation name). */
protected Map<String, String> canonicalQualifier = new HashMap<String, String>();
>>>>>>>
protected FulltextMatchInfo fulltextMatchInfo;
protected boolean hasLifeCycleWhereClause = false;
protected boolean hasMixinTypeWhereClause = false;
/** Qualifier to type. */
protected Map<String, String> qualifierToType = new HashMap<String, String>();
/** Qualifier to canonical qualifier (correlation name). */
protected Map<String, String> canonicalQualifier = new HashMap<String, String>(); |
<<<<<<<
DocumentModel doc1 = session.createDocument(session.createDocumentModel(
"/folder1", "doc1", "File"));
Thread.sleep(1000);
DocumentModel doc2 = session.createDocument(session.createDocumentModel(
"/folder2", "doc2", "File"));
=======
DocumentModel doc1 = session.createDocumentModel("/folder1", "doc1",
"File");
doc1.setPropertyValue("file:content", new StringBlob(
"The content of file 1."));
doc1 = session.createDocument(doc1);
DocumentModel doc2 = session.createDocumentModel("/folder2", "doc2",
"File");
doc2.setPropertyValue("file:content", new StringBlob(
"The content of file 2."));
doc2 = session.createDocument(doc2);
>>>>>>>
DocumentModel doc1 = session.createDocumentModel("/folder1", "doc1",
"File");
doc1.setPropertyValue("file:content", new StringBlob(
"The content of file 1."));
doc1 = session.createDocument(doc1);
Thread.sleep(1000);
DocumentModel doc2 = session.createDocumentModel("/folder2", "doc2",
"File");
doc2.setPropertyValue("file:content", new StringBlob(
"The content of file 2."));
doc2 = session.createDocument(doc2); |
<<<<<<<
registries = new HashMap<String, Registrable>();
Manager.initializeProtocols();
=======
>>>>>>>
Manager.initializeProtocols();
<<<<<<<
registries = null;
Manager.resetProtocols();
=======
for (Registrable registry : registries.values()) {
registry.clear();
}
registries.clear();
context = null;
>>>>>>>
for (Registrable registry : registries.values()) {
registry.clear();
}
registries.clear();
context = null;
Manager.resetProtocols(); |
<<<<<<<
DocumentModel doc1 = session.createDocument(session.createDocumentModel(
"/folder1", "doc1", "File"));
Thread.sleep(1000);
DocumentModel doc2 = session.createDocument(session.createDocumentModel(
"/folder2", "doc2", "File"));
=======
DocumentModel doc1 = session.createDocumentModel("/folder1", "doc1",
"File");
doc1.setPropertyValue("file:content", new StringBlob(
"The content of file 1."));
doc1 = session.createDocument(doc1);
DocumentModel doc2 = session.createDocumentModel("/folder2", "doc2",
"File");
doc2.setPropertyValue("file:content", new StringBlob(
"The content of file 2."));
doc2 = session.createDocument(doc2);
>>>>>>>
DocumentModel doc1 = session.createDocumentModel("/folder1", "doc1",
"File");
doc1.setPropertyValue("file:content", new StringBlob(
"The content of file 1."));
doc1 = session.createDocument(doc1);
Thread.sleep(1000);
DocumentModel doc2 = session.createDocumentModel("/folder2", "doc2",
"File");
doc2.setPropertyValue("file:content", new StringBlob(
"The content of file 2."));
doc2 = session.createDocument(doc2); |
<<<<<<<
deployContrib("org.nuxeo.theme.core", "OSGI-INF/nxthemes-core-service.xml");
deployContrib("org.nuxeo.theme.core", "OSGI-INF/nxthemes-core-contrib.xml");
deployContrib("fragment-config.xml");
=======
deployContrib("org.nuxeo.theme.core.tests", "nxthemes-core-service.xml");
deployContrib("org.nuxeo.theme.core.tests", "nxthemes-core-contrib.xml");
deployContrib("org.nuxeo.theme.core.tests", "fragment-config.xml");
>>>>>>>
deployContrib("org.nuxeo.theme.core", "OSGI-INF/nxthemes-core-service.xml");
deployContrib("org.nuxeo.theme.core", "OSGI-INF/nxthemes-core-contrib.xml");
deployContrib("org.nuxeo.theme.core.tests", "fragment-config.xml"); |
<<<<<<<
import java.io.IOException;
import java.io.InputStream;
import java.io.Serializable;
=======
>>>>>>>
import java.io.Serializable; |
<<<<<<<
@In(create = true)
private transient CoreSession documentManager;
=======
@In(create = true, required = false)
transient CoreSession documentManager;
>>>>>>>
@In(create = true, required = false)
private transient CoreSession documentManager; |
<<<<<<<
@FindBy(xpath = "//div[@class=\"userActions\"]")
public WebElement userActions;
=======
@FindBy(name = "userServicesForm")
public WebElement userServicesForm;
>>>>>>>
@FindBy(name = "userServicesForm")
public WebElement userServicesForm;
@FindBy(xpath = "//div[@class=\"userActions\"]")
public WebElement userActions;
<<<<<<<
/**
* Check if the user is connected by looking for the text: You are logged as
* Username
*
* @param username
*/
public void checkUserConnected(String username) {
String expectedConnectedMessage = "You are logged as " + username;
assertTrue(userActions.getText().contains(expectedConnectedMessage));
}
=======
/**
* Get the top bar navigation sub page.
*
* @return
*/
public HeaderLinksSubPage getHeaderLinks() {
assertNotNull(userServicesForm);
return asPage(HeaderLinksSubPage.class);
}
>>>>>>>
/**
* Check if the user is connected by looking for the text: You are logged as
* Username
*
* @param username
*/
public void checkUserConnected(String username) {
String expectedConnectedMessage = "You are logged as " + username;
assertTrue(userActions.getText().contains(expectedConnectedMessage));
} |
<<<<<<<
=======
* Sets the user directory name.
*
* @param userDirectoryName the user directory name.
* @throws ClientException
*/
void setUserDirectoryName(String userDirectoryName) throws ClientException;
/**
>>>>>>>
<<<<<<<
=======
* Sets the user email field.
*
* @param userEmailField the email field.
* @throws ClientException
*/
void setUserEmailField(String userEmailField) throws ClientException;
/**
>>>>>>>
<<<<<<<
* Gets the user search fields, the fields to use when a fulltext search is
=======
* Sets the user search fields, the fields to use when a user search is
* done. All fields use substring match by default.
*
* @param userSearchFields the search fields.
* @throws ClientException
*/
void setUserSearchFields(Set<String> userSearchFields) throws ClientException;
/**
* Sets the user search fields, the fields to use when a user search is
* done. The map values allow for selection between substring and exact match.
*
* @param userSearchFields map with field names as keys and values in exact / substring
*/
void setUserSearchFields(Map<String, MatchType> userSearchFields) throws ClientException;
/**
* Gets the user search fields, the fields to use when a user search is
>>>>>>>
* Gets the user search fields, the fields to use when a principal search is
<<<<<<<
=======
* Sets the group directory name.
*
* @param groupDirectoryName the user directory name.
* @throws ClientException
*/
void setGroupDirectoryName(String groupDirectoryName) throws ClientException;
/**
>>>>>>>
<<<<<<<
=======
* Sets the group members field.
*
* @param groupMembersField the members field.
* @throws ClientException
*/
void setGroupMembersField(String groupMembersField) throws ClientException;
/**
>>>>>>>
<<<<<<<
=======
* Sets the group sub-groups field.
*
* @param groupSubGroupsField the sub-groups field.
* @throws ClientException
*/
void setGroupSubGroupsField(String groupSubGroupsField) throws ClientException;
/**
>>>>>>>
<<<<<<<
=======
* Sets the group parentGroups field.
*
* @param groupParentGroupsField the parentGroups field.
* @throws ClientException
*/
void setGroupParentGroupsField(String groupParentGroupsField) throws ClientException;
/**
>>>>>>>
<<<<<<<
=======
* Sets the anonymous user properties.
*
* @param anonymousUser the anonymous user properties.
* @throws ClientException
*/
void setAnonymousUser(Map<String, String> anonymousUser) throws ClientException;
/**
>>>>>>>
<<<<<<<
* @return the anonymous user id, or the default one if none is defined.
* @throws ClientException
=======
* @return the anonymous user id, or null if none is defined.
* @throws ClientException
>>>>>>>
* @return the anonymous user id, or the default one if none is defined.
* @throws ClientException
<<<<<<<
void setConfiguration(UserManagerDescriptor descriptor)
throws ClientException;
=======
String ANONYMOUS_USER_ID_KEY = "__id__";
>>>>>>>
void setConfiguration(UserManagerDescriptor descriptor)
throws ClientException; |
<<<<<<<
/**
* Used to find the first parent accessible by a user, ie. the first parent
* where the user has the READ permission.
*/
protected static class AccessibleParentFinder extends UnrestrictedSessionRunner {
protected CoreSession userSession;
public DocumentModel doc = null;
public DocumentModel parent = null;
public AccessibleParentFinder(CoreSession session, DocumentModel doc) {
super(session);
this.userSession = session;
this.doc = doc;
}
@Override
public void run() throws ClientException {
parent = getFirstParentAccessibleByUser(doc);
}
protected DocumentModel getFirstParentAccessibleByUser(DocumentModel doc) throws ClientException {
DocumentModel parent = session.getDocument(doc.getParentRef());
if (parent == null) {
return null;
}
if (userSession.hasPermission(parent.getRef(), SecurityConstants.READ)) {
return parent;
} else {
return getFirstParentAccessibleByUser(parent);
}
}
}
protected static final String DUBLINCORE_DESCRIPTION = "dc:description";
protected static final String DUBLINCORE_COVERAGE = "dc:coverage";
protected static final String DUBLINCORE_EXPIRED = "dc:expired";
=======
protected static final List<String> DUBLINCORE_PROPERTIES = Arrays.asList(
"dc:description", "dc:coverage", "dc:subjects", "dc:expired");
>>>>>>>
/**
* Used to find the first parent accessible by a user, ie. the first parent
* where the user has the READ permission.
*/
protected static class AccessibleParentFinder extends UnrestrictedSessionRunner {
protected CoreSession userSession;
public DocumentModel doc = null;
public DocumentModel parent = null;
public AccessibleParentFinder(CoreSession session, DocumentModel doc) {
super(session);
this.userSession = session;
this.doc = doc;
}
@Override
public void run() throws ClientException {
parent = getFirstParentAccessibleByUser(doc);
}
protected DocumentModel getFirstParentAccessibleByUser(DocumentModel doc) throws ClientException {
DocumentModel parent = session.getDocument(doc.getParentRef());
if (parent == null) {
return null;
}
if (userSession.hasPermission(parent.getRef(), SecurityConstants.READ)) {
return parent;
} else {
return getFirstParentAccessibleByUser(parent);
}
}
}
protected static final List<String> DUBLINCORE_PROPERTIES = Arrays.asList(
"dc:description", "dc:coverage", "dc:subjects", "dc:expired"); |
<<<<<<<
deployContrib("org.nuxeo.theme.core", "OSGI-INF/nxthemes-core-service.xml");
deployContrib("org.nuxeo.theme.core", "OSGI-INF/nxthemes-core-contrib.xml");
deployContrib("engine-config.xml");
=======
deployContrib("org.nuxeo.theme.core.tests", "nxthemes-core-service.xml");
deployContrib("org.nuxeo.theme.core.tests", "nxthemes-core-contrib.xml");
deployContrib("org.nuxeo.theme.core.tests", "engine-config.xml");
>>>>>>>
deployContrib("org.nuxeo.theme.core", "OSGI-INF/nxthemes-core-service.xml");
deployContrib("org.nuxeo.theme.core", "OSGI-INF/nxthemes-core-contrib.xml");
deployContrib("org.nuxeo.theme.core.tests", "engine-config.xml"); |
<<<<<<<
// note that this list is duplicated in DashboardSpaceProvider.java because
// of linkage issues
private static final String[] COLS = new String[] { "firstCol",
"secondCol", "thirdCol", "fourCol" };
private static final String SPACER_CLASS = "x-panel-dd-spacer";
private final Container container;
private final Map<String, PortalColumn> columns = new HashMap<String, PortalColumn>();
private DropTargetConfig ddConfig;
private final Panel panel;
private final Map<String, GadgetPortlet> portlets = new HashMap<String, GadgetPortlet>();
private final List<GadgetPortlet> collapsedCache = new ArrayList<GadgetPortlet>();
private int loading;
private int loadingTimes = 0;
public ContainerPortal(Container container, Panel parent) {
super();
this.container = container;
this.panel = parent;
buildPortal();
}
public ContainerPortal(Container container, Panel parent,
DropTargetConfig ddConfig) {
this(container, parent);
this.ddConfig = ddConfig;
}
@Override
protected void afterRender() {
new DropZone(this, ddConfig);
loading = 0;
}
public void loader(final int timeout) {
Timer t = new Timer() {
@Override
public void run() {
if (loading == portlets.size() || loadingTimes >= 5) {
loadingTimes = 0;
JsLibrary.loadingHide();
} else {
loadingTimes++;
loader(timeout);
}
}
};
t.schedule(timeout);
}
public Container getContainer() {
return container;
}
public GadgetPortlet getGadgetPortlet(String ref) {
if (portlets.containsKey(ref))
return portlets.get(ref);
return null;
}
public GadgetPortlet getGadgetPortletById(String id) {
return getGadgetPortlet(getRef(id));
}
private String getRef(String id) {
return id.substring(GadgetPortlet.GADGET_CONTAINER.length(),
id.length());
}
public void buildPortal() {
this.addClass("containerPortal");
this.setBorder(false);
buildLayout();
panel.add(this);
List<GadgetBean> gadgets = container.getGadgets();
List<GadgetBean> lostGadgets = new ArrayList<GadgetBean>();
for (GadgetBean bean : gadgets)
addGadget(bean, lostGadgets);
for (GadgetBean bean : lostGadgets)
addGadget(bean, null);
}
private void addGadget(GadgetBean bean, List<GadgetBean> lostGadgets) {
GadgetPosition pos = bean.getGadgetPosition();
PortalColumn col = null;
if (pos.getPlaceID() != null)
col = columns.get(pos.getPlaceID());
if (col == null) {
bean.getGadgetPosition().setPlaceId(COLS[0]);
lostGadgets.add(bean);
=======
private static final String PORTAL_CLASS = "containerPortal";
private static final String[] COLS = new String[] { "firstCol", "secondCol",
"thirdCol", "fourCol" };
private static final String MAXIMIZED_COL_ID = "maximizedCol";
private static final String SPACER_CLASS = "x-panel-dd-spacer";
private PortalColumn maximizedCol;
private Container container;
private Map<String, PortalColumn> columns = new HashMap<String, PortalColumn>();
private DropTargetConfig ddConfig;
private Panel panel;
private Map<String, GadgetPortlet> portlets = new HashMap<String, GadgetPortlet>();
private List<GadgetPortlet> collapsedCache = new ArrayList<GadgetPortlet>();
private int loading;
private int loadingTimes = 0;
public ContainerPortal(Container container, Panel parent) {
super();
this.container = container;
this.panel = parent;
buildPortal();
}
public ContainerPortal(Container container, Panel parent,
DropTargetConfig ddConfig) {
this(container, parent);
this.ddConfig = ddConfig;
}
@Override
protected void afterRender() {
new DropZone(this, ddConfig);
loading = 0;
}
public void loader(final int timeout) {
Timer t = new Timer() {
@Override
public void run() {
if (loading == portlets.size() || loadingTimes >= 5) {
loadingTimes = 0;
JsLibrary.loadingHide();
>>>>>>>
private static final String PORTAL_CLASS = "containerPortal";
// note that this list is duplicated in DashboardSpaceProvider.java because
// of linkage issues
private static final String[] COLS = new String[] { "firstCol", "secondCol",
"thirdCol", "fourCol" };
private static final String MAXIMIZED_COL_ID = "maximizedCol";
private static final String SPACER_CLASS = "x-panel-dd-spacer";
private PortalColumn maximizedCol;
private final Container container;
private final Map<String, PortalColumn> columns = new HashMap<String, PortalColumn>();
private DropTargetConfig ddConfig;
private final Panel panel;
private final Map<String, GadgetPortlet> portlets = new HashMap<String, GadgetPortlet>();
private final List<GadgetPortlet> collapsedCache = new ArrayList<GadgetPortlet>();
private int loading;
private int loadingTimes = 0;
public ContainerPortal(Container container, Panel parent) {
super();
this.container = container;
this.panel = parent;
buildPortal();
}
public ContainerPortal(Container container, Panel parent,
DropTargetConfig ddConfig) {
this(container, parent);
this.ddConfig = ddConfig;
}
@Override
protected void afterRender() {
new DropZone(this, ddConfig);
loading = 0;
}
public void loader(final int timeout) {
Timer t = new Timer() {
@Override
public void run() {
if (loading == portlets.size() || loadingTimes >= 5) {
loadingTimes = 0;
JsLibrary.loadingHide();
} else {
loadingTimes++;
loader(timeout);
}
}
};
t.schedule(timeout);
}
public Container getContainer() {
return container;
}
public void buildPortal() {
this.addClass("containerPortal");
this.setBorder(false);
buildLayout();
panel.add(this);
List<GadgetBean> gadgets = container.getGadgets();
List<GadgetBean> lostGadgets = new ArrayList<GadgetBean>();
for (GadgetBean bean : gadgets)
addGadget(bean, lostGadgets);
for (GadgetBean bean : lostGadgets)
addGadget(bean, null);
}
private void addGadget(GadgetBean bean, List<GadgetBean> lostGadgets) {
GadgetPosition pos = bean.getGadgetPosition();
PortalColumn col = null;
if (pos.getPlaceID() != null)
col = columns.get(pos.getPlaceID());
if (col == null) {
bean.getGadgetPosition().setPlaceId(COLS[0]);
lostGadgets.add(bean);
<<<<<<<
=======
}
};
t.schedule(timeout);
}
public Container getContainer() {
return container;
}
public GadgetPortlet getGadgetPortlet(String id) {
if (portlets.containsKey(id))
return portlets.get(id);
return null;
}
public GadgetPortlet getGadgetPortletByRef(String ref) {
String portletId = GadgetPortlet.getIdWithRefAndView(ref, null);
return getGadgetPortlet(portletId);
}
public void buildPortal() {
this.addClass(PORTAL_CLASS);
this.setBorder(false);
buildLayout();
panel.add(this);
List<GadgetBean> gadgets = container.getGadgets();
List<GadgetBean> lostGadgets = new ArrayList<GadgetBean>();
for (GadgetBean bean : gadgets)
addGadget(bean, lostGadgets);
for (GadgetBean bean : lostGadgets)
addGadget(bean, null);
}
private void addGadget(GadgetBean bean, List<GadgetBean> lostGadgets) {
GadgetPosition pos = bean.getGadgetPosition();
PortalColumn col = null;
if (pos.getPlaceID() != null)
col = columns.get(pos.getPlaceID());
if (col == null) {
bean.getGadgetPosition()
.setPlaceId(COLS[0]);
lostGadgets.add(bean);
} else {
GadgetPortlet gp = new GadgetPortlet(bean);
col.add(gp);
portlets.put(gp.getId(), gp);
col.doLayout();
>>>>>>>
<<<<<<<
=======
}
public PortalColumn getMaximizedCol() {
return maximizedCol;
}
>>>>>>>
public static void showErrorMessage(final String title, final String message) {
MessageBox.show(new MessageBoxConfig() {
{
setTitle(title);
setMsg(message);
setClosable(true);
setModal(true);
}
});
}
public GadgetPosition getDropPosition() {
for (PortalColumn col : columns.values()) {
NodeList<Node> childs = col.getElement().getChildNodes();
for (int i = 0; i < childs.getLength(); i++) {
Element elem = Element.as(childs.getItem(i));
if (SPACER_CLASS.equals(elem.getClassName())) {
return new GadgetPosition(col.getElement().getId(), i);
}
}
}
return null;
}
public PortalColumn getPortalColumn(String id) {
if (columns.containsKey(id))
return columns.get(id);
return null;
}
public GadgetPortlet getGadgetPortlet(String id) {
if (portlets.containsKey(id))
return portlets.get(id);
return null;
}
public GadgetPortlet getGadgetPortletByRef(String ref) {
String portletId = GadgetPortlet.getIdWithRefAndView(ref, null);
return getGadgetPortlet(portletId);
}
public Collection<PortalColumn> getPortalColumns() {
return columns.values();
}
public void toggleGadgetsCollapse() {
for (GadgetPortlet p : portlets.values()) {
if (!p.isCollapsed()) {
p.toggleCollapse();
collapsedCache.add(p);
}
}
}
public void clearGadgetsCollapse() {
for (GadgetPortlet p : collapsedCache) {
p.toggleCollapse();
collapsedCache.remove(p);
}
}
private void buildLayout() {
switch (container.getStructure()) {
case 1:
createLayout1Col();
break;
case 2:
createLayout2Col();
break;
case 3:
createLayout3Cols();
break;
case 4:
createLayout4Col();
break;
default:
createLayout3Cols();
break;
}
createMaximizedCol();
}
private void createMaximizedCol() {
maximizedCol = createCol(MAXIMIZED_COL_ID, 1.00);
maximizedCol.hide();
}
private void createLayout1Col() {
createCol(COLS[0], 1.00);
}
private void createLayout2Col() {
createCol(COLS[0], .5);
createCol(COLS[1], .5);
}
private void createLayout3Cols() {
createCol(COLS[0], .33);
createCol(COLS[1], .33);
createCol(COLS[2], .33);
}
private void createLayout4Col() {
createCol(COLS[0], .25);
createCol(COLS[1], .25);
createCol(COLS[2], .25);
createCol(COLS[3], .25);
}
private PortalColumn createCol(String id, double columnWidth) {
PortalColumn col = new PortalColumn();
col.setPaddings(5, 5, 5, 0);
col.setId(id);
col.addClass(container.getLayout());
this.add(col, new ColumnLayoutData(columnWidth));
columns.put(id, col);
return col;
}
public BoxComponent getPanel() {
return panel;
}
public void removeGadgetPortlet(String id) {
GadgetBean gadget = portlets.get(id)
.getGadgetBean();
portlets.remove(id);
GadgetPosition pos = gadget.getGadgetPosition();
PortalColumn col = columns.get(pos.getPlaceID());
if (col == null)
col = columns.get(COLS[0]);
col.remove(id, true);
col.doLayout();
loader(1);
}
public void incrementLoading() {
if (loading < portlets.size())
loading++;
}
private void addGadget(GadgetPortlet portlet) {
removeGadgetPortlet(portlet.getId());
addGadget(portlet.getGadgetBean());
}
public void addGadget(GadgetBean bean) {
bean.setPosition(new GadgetPosition(COLS[0], 0));
addGadget(bean, null);
this.doLayout();
columns.get(COLS[0])
.doLayout();
}
public static String getDefaultColId() {
return COLS[0];
}
public static Integer getDefaultPos() {
return 0;
}
public void updateColumnClassName(String oldCls, String cls,
int oldStructure, int structure) {
container.setLayout(cls);
container.setStructure(structure);
for (PortalColumn col : columns.values()) {
col.removeClass(oldCls);
col.addClass(cls);
col.doLayout();
}
removeOldColumns(oldStructure, structure);
addNewColumns(oldStructure, structure);
JsLibrary.updateColumnStyle();
this.doLayout();
JsLibrary.updateFrameHeight();
}
private void addNewColumns(int oldStructure, int structure) {
for (int i = oldStructure; i < structure; i++) {
createCol(COLS[i], .25);
}
this.doLayout();
}
private void removeOldColumns(int oldStructure, int structure) {
for (int i = oldStructure; i > structure; i--) {
String colToDelete = COLS[i - 1];
for (GadgetPortlet portlet : portlets.values()) {
GadgetBean b = portlet.getGadgetBean();
if (b.getGadgetPosition()
.getPlaceID()
.equals(colToDelete)) {
addGadget(portlet);
}
}
this.columns.remove(colToDelete);
this.remove(colToDelete, true);
}
}
public PortalColumn getMaximizedCol() {
return maximizedCol;
} |
<<<<<<<
import org.nuxeo.functionaltests.waitfor.ElementNotFoundException;
import org.nuxeo.functionaltests.waitfor.FindElementUntil;
=======
import org.nuxeo.functionaltests.pages.UsersGroupsBasePage;
>>>>>>>
import org.nuxeo.functionaltests.waitfor.ElementNotFoundException;
import org.nuxeo.functionaltests.waitfor.FindElementUntil;
import org.nuxeo.functionaltests.pages.UsersGroupsBasePage; |
<<<<<<<
=======
import org.nuxeo.ecm.core.query.QueryFilter;
>>>>>>>
import org.nuxeo.ecm.core.query.QueryFilter;
<<<<<<<
String tableName = table.getPhysicalName();
if (!tableNames.contains(tableName) &&
!tableNames.contains(tableName.toUpperCase())) {
/*
* Create missing table.
*/
String sql = table.getCreateSql();
logDebug(sql);
st.execute(sql);
for (String s : table.getPostCreateSqls()) {
logDebug(s);
st.execute(s);
}
}
/*
* Get existing columns.
*/
rs = metadata.getColumns(null, null, tableName, "%");
Map<String, Integer> columnTypes = new HashMap<String, Integer>();
while (rs.next()) {
String columnName = rs.getString("COLUMN_NAME").toUpperCase();
int sqlType = rs.getInt("DATA_TYPE");
columnTypes.put(columnName, Integer.valueOf(sqlType));
}
/*
* Update types and create missing columns.
*/
for (Column column : table.getColumns()) {
Integer type = columnTypes.remove(column.getPhysicalName().toUpperCase());
if (type == null) {
log.warn("Adding missing column in database: " +
column.getFullQuotedName());
String sql = table.getAddColumnSql(column);
logDebug(sql);
st.execute(sql);
} else {
int sqlType = type.intValue();
int t = column.getSqlType();
if (t != sqlType) {
// type in database is different...
if (!(t == Types.BIT && sqlType == Types.SMALLINT) // Derby
&&
!(t == Types.CLOB && sqlType == Types.VARCHAR) // PostgreSQL
) {
log.error(String.format(
"SQL type mismatch for %s: expected %s, database has %s",
column.getFullQuotedName(),
Integer.valueOf(t), type));
}
column.setSqlType(sqlType);
}
}
=======
String physicalName = table.getName();
if (tableNames.contains(physicalName) ||
tableNames.contains(physicalName.toUpperCase())) {
// table already present
continue;
>>>>>>>
String tableName = table.getName();
if (!tableNames.contains(tableName) &&
!tableNames.contains(tableName.toUpperCase())) {
/*
* Create missing table.
*/
String sql = table.getCreateSql();
logDebug(sql);
st.execute(sql);
for (String s : table.getPostCreateSqls()) {
logDebug(s);
st.execute(s);
}
}
/*
* Get existing columns.
*/
rs = metadata.getColumns(null, null, tableName, "%");
Map<String, Integer> columnTypes = new HashMap<String, Integer>();
while (rs.next()) {
String columnName = rs.getString("COLUMN_NAME").toUpperCase();
int sqlType = rs.getInt("DATA_TYPE");
columnTypes.put(columnName, Integer.valueOf(sqlType));
}
/*
* Update types and create missing columns.
*/
for (Column column : table.getColumns()) {
Integer type = columnTypes.remove(column.getPhysicalName().toUpperCase());
if (type == null) {
log.warn("Adding missing column in database: " +
column.getFullQuotedName());
String sql = table.getAddColumnSql(column);
logDebug(sql);
st.execute(sql);
} else {
int sqlType = type.intValue();
int t = column.getSqlType();
if (t != sqlType) {
// type in database is different...
if (!(t == Types.BIT && sqlType == Types.SMALLINT) // Derby
&&
!(t == Types.CLOB && sqlType == Types.VARCHAR) // PostgreSQL
) {
log.error(String.format(
"SQL type mismatch for %s: expected %s, database has %s",
column.getFullQuotedName(),
Integer.valueOf(t), type));
}
column.setSqlType(sqlType);
}
} |
<<<<<<<
import org.apache.shindig.auth.AuthInfo;
=======
>>>>>>>
<<<<<<<
import org.apache.shindig.common.uri.Uri;
import org.apache.shindig.common.util.Utf8UrlCoder;
import org.apache.shindig.gadgets.AuthType;
import org.apache.shindig.gadgets.FeedProcessor;
=======
import org.apache.shindig.common.JsonSerializer;
>>>>>>>
import org.apache.shindig.common.JsonSerializer;
<<<<<<<
import org.apache.shindig.gadgets.oauth.OAuthArguments;
import org.apache.shindig.gadgets.rewrite.ContentRewriterRegistry;
=======
import org.apache.shindig.gadgets.http.RequestPipeline;
import org.apache.shindig.gadgets.rewrite.RequestRewriterRegistry;
import org.apache.shindig.gadgets.servlet.MakeRequestHandler;
>>>>>>>
import org.apache.shindig.gadgets.http.RequestPipeline;
import org.apache.shindig.gadgets.rewrite.RequestRewriterRegistry;
import org.apache.shindig.gadgets.servlet.MakeRequestHandler; |
<<<<<<<
import java.util.List;
=======
import org.nuxeo.functionaltests.Required;
>>>>>>>
import org.nuxeo.functionaltests.Required;
import java.util.List; |
<<<<<<<
import com.stormpath.spring.oauth.OAuth2AuthenticationProcessingFilter;
=======
import com.stormpath.spring.filter.SpringSecurityResolvedAccountFilter;
>>>>>>>
import com.stormpath.spring.oauth.OAuth2AuthenticationProcessingFilter;
import com.stormpath.spring.filter.SpringSecurityResolvedAccountFilter;
<<<<<<<
@Bean
public OAuth2AuthenticationProcessingFilter oAuth2AuthenticationProcessingFilter() throws ServletException {
FilterBuilder builder = new DefaultFilterBuilder().setFilterClass(
OAuth2AuthenticationProcessingFilter.class) //suppress config logic since Spring is used for config here
.setServletContext(servletContext).setName("oauth2AuthenticationProcessingFilter");
OAuth2AuthenticationProcessingFilter filter = (OAuth2AuthenticationProcessingFilter) builder.build();
filter.setEnabled(csrfTokenEnabled);
return filter;
}
@Override
public void setServletContext(ServletContext servletContext) {
this.servletContext = servletContext;
}
=======
@Bean
@Override
public SpringSecurityResolvedAccountFilter springSecurityResolvedAccountFilter() {
return super.springSecurityResolvedAccountFilter();
}
>>>>>>>
@Bean
@Override
public OAuth2AuthenticationProcessingFilter oAuth2AuthenticationProcessingFilter() throws ServletException {
FilterBuilder builder = new DefaultFilterBuilder().setFilterClass(
OAuth2AuthenticationProcessingFilter.class) //suppress config logic since Spring is used for config here
.setServletContext(servletContext).setName("oauth2AuthenticationProcessingFilter");
OAuth2AuthenticationProcessingFilter filter = (OAuth2AuthenticationProcessingFilter) builder.build();
filter.setEnabled(accessTokenEnabled);
return filter;
}
@Bean
@Override
public SpringSecurityResolvedAccountFilter springSecurityResolvedAccountFilter() throws ServletException {
FilterBuilder builder = new DefaultFilterBuilder().setFilterClass(
SpringSecurityResolvedAccountFilter.class) //suppress config logic since Spring is used for config here
.setServletContext(servletContext).setName("springSecurityResolvedAccountFilter");
return (SpringSecurityResolvedAccountFilter) builder.build();
}
@Override
public void setServletContext(ServletContext servletContext) {
this.servletContext = servletContext;
} |
<<<<<<<
@In(create = true)
protected transient CoreSession documentManager;
=======
@In(create = true, required = false)
protected CoreSession documentManager;
>>>>>>>
@In(create = true, required = false)
protected transient CoreSession documentManager; |
<<<<<<<
=======
import java.util.List;
import java.util.Locale;
>>>>>>>
import java.util.Locale;
<<<<<<<
GadgetBean gadgetBean = GadgetFactory.getGadgetBean(createGadget,
getLocale(gwtParams), getServerBase(gwtParams));
gadgetBean.setTitle("");
=======
GadgetBean gadgetBean = GadgetFactory.getGadgetBean(createGadget,
getPermissions(space), getLocale(gwtParams),
getServerBase(gwtParams));
if (!gwtParams.containsKey(RESET_GADGET_TITLE)
|| "true".equalsIgnoreCase(gwtParams.get(RESET_GADGET_TITLE))) {
gadgetBean.setTitle("");
} else {
internationalizeGadgetTitle(gadgetBean,
gwtParams.get(USER_LANGUAGE));
}
>>>>>>>
GadgetBean gadgetBean = GadgetFactory.getGadgetBean(createGadget,
getLocale(gwtParams), getServerBase(gwtParams));
if (!gwtParams.containsKey(RESET_GADGET_TITLE)
|| "true".equalsIgnoreCase(gwtParams.get(RESET_GADGET_TITLE))) {
gadgetBean.setTitle("");
} else {
internationalizeGadgetTitle(gadgetBean,
gwtParams.get(USER_LANGUAGE));
}
<<<<<<<
gadgets.add(GadgetFactory.getGadgetBean(g, locale,
serverBase));
=======
GadgetBean gadgetBean = GadgetFactory.getGadgetBean(g,
perms, locale, serverBase);
internationalizeGadgetTitle(gadgetBean, userLanguage);
gadgets.add(gadgetBean);
>>>>>>>
GadgetBean gadgetBean = GadgetFactory.getGadgetBean(g, locale,
serverBase);
internationalizeGadgetTitle(gadgetBean, userLanguage);
gadgets.add(gadgetBean);
<<<<<<<
=======
protected void internationalizeGadgetTitle(GadgetBean gadgetBean,
String userLanguage) {
Locale locale = userLanguage != null ? new Locale(userLanguage)
: Locale.getDefault();
String labelKey = "label.gadget." + gadgetBean.getName();
String i18nTitle = I18NUtils.getMessageString("messages", labelKey,
null, locale);
if (!i18nTitle.equals(labelKey)) {
// we found a match
gadgetBean.setTitle(i18nTitle);
}
}
static List<String> getPermissions(Space space) throws Exception {
return space.isReadOnly() ? new ArrayList<String>()
: space.getPermissions();
}
>>>>>>>
protected void internationalizeGadgetTitle(GadgetBean gadgetBean,
String userLanguage) {
Locale locale = userLanguage != null ? new Locale(userLanguage)
: Locale.getDefault();
String labelKey = "label.gadget." + gadgetBean.getName();
String i18nTitle = I18NUtils.getMessageString("messages", labelKey,
null, locale);
if (!i18nTitle.equals(labelKey)) {
// we found a match
gadgetBean.setTitle(i18nTitle);
}
} |
<<<<<<<
import com.stormpath.sdk.api.ApiAuthenticationResult;
import com.stormpath.sdk.api.ApiKey;
import com.stormpath.sdk.api.ApiKeyList;
import com.stormpath.sdk.api.ApiKeyOptions;
import com.stormpath.sdk.application.*;
=======
import com.stormpath.sdk.api.*;
import com.stormpath.sdk.application.*;
>>>>>>>
import com.stormpath.sdk.api.ApiAuthenticationResult;
import com.stormpath.sdk.api.ApiKey;
import com.stormpath.sdk.api.ApiKeyList;
import com.stormpath.sdk.api.ApiKeyOptions;
import com.stormpath.sdk.api.*;
import com.stormpath.sdk.application.*; |
<<<<<<<
=======
import java.io.IOException;
import java.io.Serializable;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.List;
import java.util.Map;
import javax.mail.MessagingException;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
import org.apache.commons.lang.StringUtils;
>>>>>>>
import java.util.HashMap;
import java.util.Hashtable;
import java.util.Map;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Response;
<<<<<<<
import org.nuxeo.ecm.automation.jaxrs.io.documents.PaginableDocumentModelListImpl;
=======
import org.nuxeo.ecm.automation.OperationException;
>>>>>>>
import org.nuxeo.ecm.automation.jaxrs.io.documents.PaginableDocumentModelListImpl;
<<<<<<<
import org.nuxeo.ecm.core.api.IdRef;
=======
>>>>>>>
import org.nuxeo.ecm.core.api.IdRef;
<<<<<<<
import org.nuxeo.ecm.platform.ec.notification.NotificationConstants;
=======
import org.nuxeo.ecm.core.api.model.PropertyNotFoundException;
>>>>>>>
import org.nuxeo.ecm.platform.ec.notification.NotificationConstants;
<<<<<<<
import org.nuxeo.ecm.platform.ec.notification.service.NotificationServiceHelper;
import org.nuxeo.ecm.platform.notification.api.Notification;
=======
import org.nuxeo.ecm.platform.query.api.PageProvider;
import org.nuxeo.ecm.platform.query.api.PageProviderService;
import org.nuxeo.ecm.platform.query.nxql.CoreQueryDocumentPageProvider;
>>>>>>>
import org.nuxeo.ecm.platform.ec.notification.service.NotificationServiceHelper;
import org.nuxeo.ecm.platform.notification.api.Notification;
<<<<<<<
private static final String DEFAULT_PAGE_INDEX = "0";
private static final Long PAGE_SIZE = 20L;
private static final String SHARE_DOC_TYPE = "EasyShareFolder";
private static AutomationService automationService;
protected final Log log = LogFactory.getLog(EasyShare.class);
@GET
public Object doGet() {
return getView("index");
}
public EasyShareUnrestrictedRunner buildUnrestrictedRunner(final String docId, final Long pageIndex) {
return new EasyShareUnrestrictedRunner() {
@Override
public Object run(CoreSession session, IdRef docRef) throws ClientException {
if (session.exists(docRef)) {
DocumentModel docShare = session.getDocument(docRef);
if (!SHARE_DOC_TYPE.equals(docShare.getType())) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
if (!checkIfShareIsValid(docShare)) {
return getView("expired").arg("docShare", docShare);
}
DocumentModel document = session.getDocument(new IdRef(docId));
String query = buildQuery(document);
if (query == null) {
return getView("denied");
}
try {
OperationContext opCtx = new OperationContext(session);
OperationChain chain = new OperationChain("getEasyShareContent");
chain.add("Document.Query")
.set("query", query)
.set("currentPageIndex", pageIndex)
.set("pageSize", PAGE_SIZE);
PaginableDocumentModelListImpl paginable = (PaginableDocumentModelListImpl) getAutomationService().run(opCtx, chain);
OperationContext ctx = new OperationContext(session);
ctx.setInput(docShare);
// Audit Log
Map<String, Object> params = new HashMap();
params.put("event", "Access");
params.put("category", "Document");
params.put("comment", "IP: " + request.getRemoteAddr());
getAutomationService().run(ctx, "Audit.Log", params);
return getView("folderList")
.arg("isFolder", document.isFolder() && !SHARE_DOC_TYPE.equals(document.getType())) //Backward compatibility to non-collection
.arg("currentPageIndex", paginable.getCurrentPageIndex())
.arg("numberOfPages", paginable.getNumberOfPages())
.arg("docShare", docShare)
.arg("docList", paginable)
.arg("previousPageAvailable", paginable.isPreviousPageAvailable())
.arg("nextPageAvailable", paginable.isNextPageAvailable())
.arg("currentPageStatus", paginable.getProvider().getCurrentPageStatus());
=======
private static final Log log = LogFactory.getLog(EasyShare.class);
>>>>>>>
private static final String DEFAULT_PAGE_INDEX = "0";
private static final Long PAGE_SIZE = 20L;
private static final String SHARE_DOC_TYPE = "EasyShareFolder";
private static AutomationService automationService;
protected final Log log = LogFactory.getLog(EasyShare.class);
@GET
public Object doGet() {
return getView("index");
}
public EasyShareUnrestrictedRunner buildUnrestrictedRunner(final String docId, final Long pageIndex) {
return new EasyShareUnrestrictedRunner() {
@Override
public Object run(CoreSession session, IdRef docRef) throws ClientException {
if (session.exists(docRef)) {
DocumentModel docShare = session.getDocument(docRef);
if (!SHARE_DOC_TYPE.equals(docShare.getType())) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
if (!checkIfShareIsValid(docShare)) {
return getView("expired").arg("docShare", docShare);
}
DocumentModel document = session.getDocument(new IdRef(docId));
String query = buildQuery(document);
if (query == null) {
return getView("denied");
}
try {
OperationContext opCtx = new OperationContext(session);
OperationChain chain = new OperationChain("getEasyShareContent");
chain.add("Document.Query")
.set("query", query)
.set("currentPageIndex", pageIndex)
.set("pageSize", PAGE_SIZE);
PaginableDocumentModelListImpl paginable = (PaginableDocumentModelListImpl) getAutomationService().run(opCtx, chain);
OperationContext ctx = new OperationContext(session);
ctx.setInput(docShare);
// Audit Log
Map<String, Object> params = new HashMap<>();
params.put("event", "Access");
params.put("category", "Document");
params.put("comment", "IP: " + request.getRemoteAddr());
getAutomationService().run(ctx, "Audit.Log", params);
return getView("folderList")
.arg("isFolder", document.isFolder() && !SHARE_DOC_TYPE.equals(document.getType())) //Backward compatibility to non-collection
.arg("currentPageIndex", paginable.getCurrentPageIndex())
.arg("numberOfPages", paginable.getNumberOfPages())
.arg("docShare", docShare)
.arg("docList", paginable)
.arg("previousPageAvailable", paginable.isPreviousPageAvailable())
.arg("nextPageAvailable", paginable.isNextPageAvailable())
.arg("currentPageStatus", paginable.getProvider().getCurrentPageStatus());
<<<<<<<
private static AutomationService getAutomationService() {
if (automationService == null) {
automationService = Framework.getService(AutomationService.class);
=======
public String getFileName(DocumentModel doc) {
Blob blob = doc.getAdapter(BlobHolder.class).getBlob();
return blob.getFilename();
>>>>>>>
private static AutomationService getAutomationService() {
if (automationService == null) {
automationService = Framework.getService(AutomationService.class);
<<<<<<<
// Audit.Log automation parameter setting
Map<String, Object> params = new HashMap<>();
params.put("event", "Download");
params.put("category", "Document");
params.put("comment", "IP: " + request.getRemoteAddr());
AutomationService service = Framework.getLocalService(AutomationService.class);
service.run(ctx, "Audit.Log", params);
if (doc.isProxy()) {
DocumentModel liveDoc = session.getSourceDocument(docRef);
ctx.setInput(liveDoc);
service.run(ctx, "Audit.Log", params);
=======
@GET
@Path("{folderId}/{fileId}/{fileName}")
public Response getFileStream(@PathParam("fileId") String fileId) {
return (Response) new EasyShareUnrestrictedRunner() {
@Override
public Object run(CoreSession session, IdRef docRef) {
if (session.exists(docRef)) {
try {
DocumentModel doc = session.getDocument(docRef);
Blob blob = doc.getAdapter(BlobHolder.class).getBlob();
DocumentModel docFolder = session.getDocument(doc.getParentRef());
// Audit Log
OperationContext ctx = new OperationContext(session);
ctx.setInput(doc);
Calendar today = Calendar.getInstance();
if (today.after(docFolder.getPropertyValue("dc:expired"))) {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
// Audit.Log operation parameter setting
Map<String, Object> params = new HashMap<String, Object>();
params.put("event", "Download");
params.put("category", "Document");
params.put("comment", "IP: " + request.getRemoteAddr());
AutomationService service = Framework.getLocalService(AutomationService.class);
service.run(ctx, "Audit.Log", params);
if (doc.isProxy()) {
DocumentModel liveDoc = session.getSourceDocument(docRef);
ctx.setInput(liveDoc);
service.run(ctx, "Audit.Log", params);
}
// Email notification
String email = (String) docFolder.getPropertyValue("eshare:contactEmail");
if (!StringUtils.isBlank(email)) {
String fileName = blob.getFilename();
String shareName = docFolder.getName();
try {
log.debug("Easyshare: starting email");
EmailHelper emailer = new EmailHelper();
Map<String, Object> mailProps = new Hashtable<String, Object>();
mailProps.put("mail.from", "[email protected]");
mailProps.put("mail.to", email);
mailProps.put("subject", "EasyShare Download Notification");
mailProps.put("body", "File " + fileName + " from " + shareName + " downloaded by "
+ request.getRemoteAddr());
mailProps.put("template", "easyShareEmail");
emailer.sendmail(mailProps);
log.debug("Easyshare: completed email");
} catch (MessagingException ex) {
log.error("Cannot send easyShare notification email", ex);
}
}
return Response.ok(blob.getStream(), blob.getMimeType()).build();
} catch (OperationException | PropertyNotFoundException | IOException ex) {
log.error("error ", ex);
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
} else {
return Response.serverError().status(Response.Status.NOT_FOUND).build();
}
>>>>>>>
// Audit.Log automation parameter setting
Map<String, Object> params = new HashMap<>();
params.put("event", "Download");
params.put("category", "Document");
params.put("comment", "IP: " + request.getRemoteAddr());
AutomationService service = Framework.getLocalService(AutomationService.class);
service.run(ctx, "Audit.Log", params);
if (doc.isProxy()) {
DocumentModel liveDoc = session.getSourceDocument(docRef);
ctx.setInput(liveDoc);
service.run(ctx, "Audit.Log", params); |
<<<<<<<
=======
import static org.jboss.seam.annotations.Install.FRAMEWORK;
import static org.jboss.seam.ScopeType.SESSION;
>>>>>>>
import static org.jboss.seam.ScopeType.SESSION;
import static org.jboss.seam.annotations.Install.FRAMEWORK; |
<<<<<<<
=======
*
>>>>>>>
*
<<<<<<<
=======
*
* @throws Exception
>>>>>>>
<<<<<<<
log.error("Error when cleaning CoreSession bound to indexing thread", t);
} finally {
coreSession = null;
=======
log.error(
"Error when cleaning CoreSession bound to indexing thread",
t);
} finally {
coreSession = null;
>>>>>>>
log.error("Error when cleaning CoreSession bound to indexing thread", t);
} finally {
coreSession = null;
<<<<<<<
=======
*
* @throws Exception
>>>>>>> |
<<<<<<<
=======
import java.util.Random;
>>>>>>>
<<<<<<<
private static final int NOTIFICATION_ID = 1;
=======
>>>>>>>
private static final int NOTIFICATION_ID = 1;
<<<<<<<
* Displays a Mixpanel push notification on the device.
*
* @param context The application context you are tracking
* @param messageIntent Intent that bundles the data used to build a notification. If the intent
* is not valid, the notification will not be shown.
* See {@link #showPushNotification(Context, Intent)}
*/
public static void showPushNotification(Context context, Intent messageIntent) {
final MPConfig config = MPConfig.getInstance(context);
String resourcePackage = config.getResourcePackageName();
if (null == resourcePackage) {
resourcePackage = context.getPackageName();
}
final ResourceIds drawableIds = new ResourceReader.Drawables(resourcePackage, context);
final Context applicationContext = context.getApplicationContext();
MixpanelPushNotification mixpanelPushNotification = createMixpanelPushNotification(applicationContext, drawableIds);
Notification notification = mixpanelPushNotification.createNotification(messageIntent);
MPLog.d(LOGTAG, "MP FCM notification received: " + mixpanelPushNotification.data.message);
if (null != notification) {
final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
if (null != mixpanelPushNotification.data.tag) {
notificationManager.notify(mixpanelPushNotification.data.tag, NOTIFICATION_ID, notification);
} else {
notificationManager.notify(mixpanelPushNotification.notificationId, notification);
}
}
}
/**
* Create an instance of MixpanelPushNotification used to construct a Notification using data from the intent.
* Developers can subclass MixpanelPushNotification to customize how push notifications are built and
* override this method to use their subclass.
*
* @param context
* @param drawableIds
* @return
*/
protected static MixpanelPushNotification createMixpanelPushNotification(Context context, ResourceIds drawableIds) {
return new MixpanelPushNotification(context, drawableIds);
}
/**
* Only use this method if you have implemented your own custom FirebaseMessagingService. This
* is useful when you use multiple push providers.
=======
>>>>>>>
<<<<<<<
=======
/**
* Only use this method if you have implemented your own custom FirebaseMessagingService. This
* is useful when you use multiple push providers.
* Displays a Mixpanel push notification on the device.
*
* @param context The application context you are tracking
* @param messageIntent Intent that bundles the data used to build a notification. If the intent
* is not valid, the notification will not be shown.
* See {@link #showPushNotification(Context, Intent)}
*/
public static void showPushNotification(Context context, Intent messageIntent) {
MixpanelPushNotification mixpanelPushNotification = new MixpanelPushNotification(context.getApplicationContext());
showPushNotification(context, messageIntent, mixpanelPushNotification);
}
/**
* Only use this method if you have implemented your own custom FirebaseMessagingService. This is
* useful if you need to override {@link MixpanelPushNotification} to further customize your
* Mixpanel push notification.
* Displays a Mixpanel push notification on the device.
*
* @param context The application context you are tracking
* @param messageIntent Intent that bundles the data used to build a notification. If the intent
* is not valid, the notification will not be shown.
* See {@link #showPushNotification(Context, Intent)}
* @param mixpanelPushNotification A customized MixpanelPushNotification object.
*/
public static void showPushNotification(Context context, Intent messageIntent, MixpanelPushNotification mixpanelPushNotification) {
Notification notification = mixpanelPushNotification.createNotification(messageIntent);
MixpanelNotificationData data = mixpanelPushNotification.getData();
String message = data == null ? "null" : data.getMessage();
MPLog.d(LOGTAG, "MP FCM notification received: " + message);
if (null != notification) {
final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
final int id = new Random().nextInt(Integer.MAX_VALUE);
if (mixpanelPushNotification.getData().getTag() != null) {
// Use 0 as id so that we can reference notification solely by tag
notificationManager.notify(mixpanelPushNotification.getData().getTag(), 0, notification);
} else {
notificationManager.notify(id, notification);
}
}
}
>>>>>>>
/**
* Only use this method if you have implemented your own custom FirebaseMessagingService. This
* is useful when you use multiple push providers.
* Displays a Mixpanel push notification on the device.
*
* @param context The application context you are tracking
* @param messageIntent Intent that bundles the data used to build a notification. If the intent
* is not valid, the notification will not be shown.
* See {@link #showPushNotification(Context, Intent)}
*/
public static void showPushNotification(Context context, Intent messageIntent) {
MixpanelPushNotification mixpanelPushNotification = new MixpanelPushNotification(context.getApplicationContext());
showPushNotification(context, messageIntent, mixpanelPushNotification);
}
/**
* Only use this method if you have implemented your own custom FirebaseMessagingService. This is
* useful if you need to override {@link MixpanelPushNotification} to further customize your
* Mixpanel push notification.
* Displays a Mixpanel push notification on the device.
*
* @param context The application context you are tracking
* @param messageIntent Intent that bundles the data used to build a notification. If the intent
* is not valid, the notification will not be shown.
* See {@link #showPushNotification(Context, Intent)}
* @param mixpanelPushNotification A customized MixpanelPushNotification object.
*/
public static void showPushNotification(Context context, Intent messageIntent, MixpanelPushNotification mixpanelPushNotification) {
Notification notification = mixpanelPushNotification.createNotification(messageIntent);
MixpanelNotificationData data = mixpanelPushNotification.getData();
String message = data == null ? "null" : data.getMessage();
MPLog.d(LOGTAG, "MP FCM notification received: " + message);
if (null != notification) {
final NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
if (null != data.getTag()) {
notificationManager.notify(data.getTag(), NOTIFICATION_ID, notification);
} else {
notificationManager.notify(mixpanelPushNotification.notificationId, notification);
}
}
} |
<<<<<<<
setContentIntent(intent);
if (notificationData.largeIcon != NotificationData.NOT_SET) {
builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), notificationData.largeIcon));
}
=======
setContentIntent(intent).
setDefaults(MPConfig.getInstance(context).getNotificationDefaults());
>>>>>>>
setContentIntent(intent).
setDefaults(MPConfig.getInstance(context).getNotificationDefaults());
if (notificationData.largeIcon != NotificationData.NOT_SET) {
builder.setLargeIcon(BitmapFactory.decodeResource(context.getResources(), notificationData.largeIcon));
} |
<<<<<<<
import com.mixpanel.android.abtesting.EditProtocol;
=======
import com.mixpanel.android.abtesting.EditorConnection;
>>>>>>>
import com.mixpanel.android.abtesting.EditProtocol;
import com.mixpanel.android.abtesting.EditorConnection;
<<<<<<<
final OutputStream out = mEditorConnection.getOutputStream();
final OutputStreamWriter writer = new OutputStreamWriter(out);
final List<RootViewInfo> rootViews = new ArrayList<RootViewInfo>();
synchronized (mLiveActivities) {
for (Activity a : mLiveActivities) {
final String activityName = a.getClass().getCanonicalName();
// We know (since we're synched w/ the UI thread on activity changes)
// that the activities in mLiveActivities are valid here.
final View rootView = a.getWindow().getDecorView().getRootView();
final RootViewInfo info = new RootViewInfo(activityName, rootView);
rootViews.add(info);
}
}
=======
final OutputStreamWriter writer = new OutputStreamWriter(mEditorConnection.getBufferedOutputStream());
>>>>>>>
final OutputStream out = mEditorConnection.getBufferedOutputStream();
final OutputStreamWriter writer = new OutputStreamWriter(out);
final List<RootViewInfo> rootViews = new ArrayList<RootViewInfo>();
synchronized (mLiveActivities) {
for (Activity a : mLiveActivities) {
final String activityName = a.getClass().getCanonicalName();
// We know (since we're synched w/ the UI thread on activity changes)
// that the activities in mLiveActivities are valid here.
final View rootView = a.getWindow().getDecorView().getRootView();
final RootViewInfo info = new RootViewInfo(activityName, rootView);
rootViews.add(info);
}
}
<<<<<<<
synchronized (mChanges) {
mChanges.clear();
=======
mChanges = new HashMap<String, ArrayList<JSONObject>>();
synchronized (mChanges) {
>>>>>>>
synchronized (mChanges) {
mChanges.clear();
<<<<<<<
private class EditorConnection {
public EditorConnection(URI uri) {
mClient = new EditorClient(uri);
mInUse = null;
}
public boolean isAlive() {
return mClient.isAlive();
}
public boolean connectBlocking() throws InterruptedException {
return mClient.connectBlocking();
}
public OutputStream getOutputStream() {
if (null != mInUse) {
throw new RuntimeException("Only one websocket output stream should be in use at a time");
}
mInUse = new BufferedOutputStream(new WebSocketOutputStream(), MAX_BUFFER_SIZE);
return mInUse;
}
public void releaseOutputStream(OutputStream out) {
if (out != mInUse) {
throw new RuntimeException("Only one output stream should be in use at a time");
}
mInUse = null;
}
/* WILL SEND GARBAGE if multiple responses end up interleaved.
* Only one response should be in progress at a time.
*/
private class WebSocketOutputStream extends OutputStream {
@Override
public void write(int b) {
// This should never be called.
byte[] oneByte = new byte[1];
oneByte[0] = (byte) b;
write(oneByte, 0, 1);
}
@Override
public void write(byte[] b) {
write(b, 0, b.length);
}
@Override
public void write(byte[] b, int off, int len) {
final ByteBuffer message = ByteBuffer.wrap(b, off, len);
mClient.sendFragmentedFrame(Framedata.Opcode.TEXT, message, false);
}
@Override
public void close() {
mClient.sendFragmentedFrame(Framedata.Opcode.TEXT, EMPTY_BYTE_BUFFER, true);
}
}
private BufferedOutputStream mInUse;
private final EditorClient mClient;
}
/**
* EditorClient should handle all communication to and from the socket. It should be fairly naive and
* only know how to delegate messages to the ABHandler class.
*/
private class EditorClient extends WebSocketClient {
public EditorClient(URI uri) {
super(uri);
mAlive = true;
}
@Override
public void onOpen(ServerHandshake handshakedata) {
Log.i(LOGTAG, "Connected");
}
@Override
public void onMessage(String message) {
Log.d(LOGTAG, "message: " + message);
try {
final JSONObject messageJson = new JSONObject(message);
String type = messageJson.getString("type");
if (type.equals("snapshot_request")) {
Message msg = mMessageThreadHandler.obtainMessage(MESSAGE_SEND_STATE_FOR_EDITING);
msg.obj = messageJson;
mMessageThreadHandler.sendMessage(msg);
} else if (type.equals("change_request")) {
Message msg = mMessageThreadHandler.obtainMessage(MESSAGE_HANDLE_CHANGES_RECEIVED);
msg.obj = messageJson;
mMessageThreadHandler.sendMessage(msg);
}
} catch (JSONException e) {
Log.e(LOGTAG, "Bad JSON received:" + message, e);
}
}
@Override
public void onClose(int code, String reason, boolean remote) {
synchronized (this) {
mAlive = false;
}
Log.i(LOGTAG, "WebSocket closed. Code: " + code + ", reason: " + reason);
}
@Override
public void onError(Exception ex) {
if (ex != null && ex.getMessage() != null) {
Log.e(LOGTAG, "Websocket Error: " + ex.getMessage());
} else {
Log.e(LOGTAG, "a Websocket error occurred");
}
}
public boolean isAlive() {
synchronized (this) {
return mAlive;
}
}
private boolean mAlive;
}
private EditorConnection mEditorConnection;
} // ABHandler
=======
}
>>>>>>>
}
<<<<<<<
private final Map<String, ArrayList<JSONObject>> mChanges;
=======
private Map<String, ArrayList<JSONObject>> mChanges;
private EditorConnection mEditorConnection;
>>>>>>>
private final Map<String, ArrayList<JSONObject>> mChanges;
private EditorConnection mEditorConnection; |
<<<<<<<
import android.widget.ImageView;
=======
import android.widget.RelativeLayout;
>>>>>>>
import android.widget.ImageView;
import android.widget.RelativeLayout; |
<<<<<<<
final FadingImageView inAppImageView = (FadingImageView) findViewById(R.id.com_mixpanel_android_notification_image);
=======
final ImageView notifGradient = (ImageView) findViewById(R.id.com_mixpanel_android_notification_gradient);
final ImageView notifImage = (ImageView) findViewById(R.id.com_mixpanel_android_notification_image);
>>>>>>>
final ImageView notifGradient = (ImageView) findViewById(R.id.com_mixpanel_android_notification_gradient);
final FadingImageView inAppImageView = (FadingImageView) findViewById(R.id.com_mixpanel_android_notification_image); |
<<<<<<<
=======
import static com.google.common.base.Preconditions.*;
import com.github.dockerjava.api.async.ResultCallback;
>>>>>>>
import static com.google.common.base.Preconditions.checkNotNull;
<<<<<<<
public EventsCmdImpl(EventsCmd.Exec exec) {
=======
private Filters filters;
private ResultCallback<Event> resultCallback;
public EventsCmdImpl(EventsCmd.Exec exec, ResultCallback<Event> resultCallback) {
>>>>>>>
private Filters filters;
public EventsCmdImpl(EventsCmd.Exec exec) {
<<<<<<<
=======
public EventsCmd withResultCallback(ResultCallback<Event> resultCallback) {
this.resultCallback = resultCallback;
return this;
}
@Override
public EventsCmd withFilters(Filters filters) {
checkNotNull(filters, "filters have not been specified");
this.filters = filters;
return this;
}
@Override
>>>>>>>
public EventsCmd withFilters(Filters filters) {
checkNotNull(filters, "filters have not been specified");
this.filters = filters;
return this;
}
@Override
<<<<<<<
=======
public ResultCallback<Event> getResultCallback() {
return resultCallback;
}
@Override
public Filters getFilters() {
return filters;
}
@Override
>>>>>>>
public Filters getFilters() {
return filters;
}
@Override |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.