conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
=======
import parquet.column.values.bitpacking.Packer;
import parquet.column.values.boundedint.BoundedIntValuesFactory;
>>>>>>> |
<<<<<<<
RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO, schema, columns);
=======
RecordReader<Group> recordReader = getRecordReader(columnIO, schema, columns);
>>>>>>>
RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO, schema, columns);
<<<<<<<
RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO2, schema2, columns);
=======
RecordReader<Group> recordReader = getRecordReader(columnIO2, schema2, columns);
>>>>>>>
RecordReaderImplementation<Group> recordReader = getRecordReader(columnIO2, schema2, columns);
<<<<<<<
private RecordReaderImplementation<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, ColumnsStore columns) {
RecordMaterializer<Group> recordConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema));
return (RecordReaderImplementation<Group>)columnIO.getRecordReader(columns, recordConsumer);
}
private void validateFSA(int[][] expectedFSA, MessageColumnIO columnIO, RecordReaderImplementation<?> recordReader) {
=======
private RecordReader<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, ColumnsStore columns) {
RecordMaterializer<Group> recordConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema));
return columnIO.getRecordReader(columns, recordConsumer);
}
private void validateFSA(int[][] expectedFSA, MessageColumnIO columnIO, RecordReader<?> recordReader) {
>>>>>>>
private RecordReaderImplementation<Group> getRecordReader(MessageColumnIO columnIO, MessageType schema, ColumnsStore columns) {
RecordMaterializer<Group> recordConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema));
return (RecordReaderImplementation<Group>)columnIO.getRecordReader(columns, recordConsumer);
}
private void validateFSA(int[][] expectedFSA, MessageColumnIO columnIO, RecordReaderImplementation<?> recordReader) {
<<<<<<<
=======
String[] expected = {
"startMessage()",
"startField(DocId, 0)",
"addLong(10)",
"endField(DocId, 0)",
"startField(Links, 1)",
"startGroup()",
"startField(Forward, 1)",
"addLong(20)",
"addLong(40)",
"addLong(60)",
"endField(Forward, 1)",
"endGroup()",
"endField(Links, 1)",
"startField(Name, 2)",
"startGroup()",
"startField(Language, 0)",
"startGroup()",
"startField(Code, 0)",
"addString(en-us)",
"endField(Code, 0)",
"startField(Country, 1)",
"addString(us)",
"endField(Country, 1)",
"endGroup()",
"startGroup()",
"startField(Code, 0)",
"addString(en)",
"endField(Code, 0)",
"endGroup()",
"endField(Language, 0)",
"startField(Url, 1)",
"addString(http://A)",
"endField(Url, 1)",
"endGroup()",
"startGroup()",
"startField(Url, 1)",
"addString(http://B)",
"endField(Url, 1)",
"endGroup()",
"startGroup()",
"startField(Language, 0)",
"startGroup()",
"startField(Code, 0)",
"addString(en-gb)",
"endField(Code, 0)",
"startField(Country, 1)",
"addString(gb)",
"endField(Country, 1)",
"endGroup()",
"endField(Language, 0)",
"endGroup()",
"endField(Name, 2)",
"endMessage()"
};
>>>>>>>
<<<<<<<
GroupRecordConsumer groupConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema));
GroupWriter groupWriter = new GroupWriter(new RecordConsumerLoggingWrapper(groupConsumer), schema);
=======
GroupRecordConsumer groupConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema));
GroupWriter groupWriter = new GroupWriter(new RecordConsumerLoggingWrapper(groupConsumer), schema);
>>>>>>>
GroupRecordConsumer groupConsumer = new GroupRecordConsumer(new SimpleGroupFactory(schema));
GroupWriter groupWriter = new GroupWriter(new RecordConsumerLoggingWrapper(groupConsumer), schema); |
<<<<<<<
Assert.assertEquals(2, readFooter.getBlocks().size());
RedelmFileReader r = new RedelmFileReader(fin, Arrays.asList(readFooter.getBlocks().get(0)), Arrays.<String[]>asList(path1), CODEC);
=======
assertEquals(2, readFooter.getBlocks().size());
RedelmFileReader r = new RedelmFileReader(fin, Arrays.asList(readFooter.getBlocks().get(0)), Arrays.<String[]>asList(path1));
>>>>>>>
assertEquals(2, readFooter.getBlocks().size());
RedelmFileReader r = new RedelmFileReader(fin, Arrays.asList(readFooter.getBlocks().get(0)), Arrays.<String[]>asList(path1), CODEC); |
<<<<<<<
import org.apache.hadoop.conf.Configuration;
=======
import redelm.Log;
import redelm.column.ColumnDescriptor;
import redelm.hadoop.RedelmMetaData.FileMetaData;
import redelm.schema.MessageType;
>>>>>>>
import redelm.Log;
import redelm.column.ColumnDescriptor;
import redelm.hadoop.RedelmMetaData.FileMetaData;
import redelm.schema.MessageType;
import org.apache.hadoop.conf.Configuration; |
<<<<<<<
=======
import java.nio.charset.Charset;
>>>>>>>
import java.nio.charset.Charset;
<<<<<<<
//TODO why is this just a println? We should unify and standardize logging.
private void log(Object value, int r, int d) {
System.out.println(path+" "+value+" r:"+r+" d:"+d);
=======
public ColumnWriter getColumnWriter() {
if (memColumnWriter == null) {
throw new IllegalStateException("now in read mode");
}
return memColumnWriter;
>>>>>>>
//TODO why is this just a println? We should unify and standardize logging.
private void log(Object value, int r, int d) {
System.out.println(path+" "+value+" r:"+r+" d:"+d);
public ColumnWriter getColumnWriter() {
if (memColumnWriter == null) {
throw new IllegalStateException("now in read mode");
}
return memColumnWriter; |
<<<<<<<
=======
private PageHeader readNextDataPageHeader() throws IOException {
PageHeader pageHeader;
do {
long pos = f.getPos();
if (DEBUG) LOG.debug(pos + ": reading page");
try {
pageHeader = readPageHeader(f);
if (pageHeader.type != PageType.DATA_PAGE) {
if (DEBUG) LOG.debug("not a data page, skipping " + pageHeader.compressed_page_size);
f.skip(pageHeader.compressed_page_size);
}
} catch (IOException e) {
throw new IOException("could not read page header at position " + pos, e);
}
} while (pageHeader.type != PageType.DATA_PAGE);
return pageHeader;
}
@Override
>>>>>>>
@Override |
<<<<<<<
.set("myfixed", genericFixed)
=======
.set("myemptymap", emptyMap)
// TODO: support fixed encoding by plumbing in FIXED_LEN_BYTE_ARRAY
//.set("myfixed", new GenericData.Fixed(Schema.createFixed("ignored", null, null, 1),
// new byte[] { (byte) 65 }))
>>>>>>>
.set("myemptymap", emptyMap)
.set("myfixed", genericFixed)
<<<<<<<
assertEquals(genericFixed, nextRecord.get("myfixed"));
=======
assertEquals(emptyMap, nextRecord.get("myemptymap"));
//assertEquals(new byte[] { (byte) 65 }, nextRecord.get("myfixed"));
>>>>>>>
assertEquals(emptyMap, nextRecord.get("myemptymap"));
assertEquals(genericFixed, nextRecord.get("myfixed")); |
<<<<<<<
if(enableDictionary) {
=======
if (enableDictionary) {
int maxDictByteSize = applyRatioInPercent(pageSizeThreshold, DICTIONARY_PAGE_MAX_SIZE_PERCENT);
>>>>>>>
if (enableDictionary) {
<<<<<<<
=======
>>>>>>> |
<<<<<<<
} else if (property.getAdditionalProperties() != null && property.getAdditionalProperties() instanceof Schema) {
Schema inner = (Schema) property.getAdditionalProperties();
=======
}else if (property.getProperties() != null && output == null ){
if (example != null) {
try {
output = Json.mapper().readValue(example.toString(), ObjectExample.class);
} catch (IOException e) {
LOGGER.error("unable to convert `" + example + "` to JsonNode");
output = new ObjectExample();
}
}
else {
ObjectExample ex = new ObjectExample();
if(property.getProperties() != null) {
Map<String,Schema> properties = property.getProperties();
for(String propertyKey : properties.keySet()) {
Schema inner = properties.get(propertyKey);
Example propExample = fromProperty(null, inner, definitions, processedModels,requestType);
ex.put(propertyKey, propExample);
}
}
output = ex;
}
}
if (property.getAdditionalProperties() != null) {
Schema inner = property.getAdditionalProperties();
>>>>>>>
}else if (property.getProperties() != null && output == null ){
if (example != null) {
try {
output = Json.mapper().readValue(example.toString(), ObjectExample.class);
} catch (IOException e) {
LOGGER.error("unable to convert `" + example + "` to JsonNode");
output = new ObjectExample();
}
}
else {
ObjectExample ex = new ObjectExample();
if(property.getProperties() != null) {
Map<String,Schema> properties = property.getProperties();
for(String propertyKey : properties.keySet()) {
Schema inner = properties.get(propertyKey);
Example propExample = fromProperty(null, inner, definitions, processedModels,requestType);
ex.put(propertyKey, propExample);
}
}
output = ex;
}
}
if (property.getAdditionalProperties() != null && property.getAdditionalProperties() instanceof Schema) {
Schema inner = (Schema) property.getAdditionalProperties(); |
<<<<<<<
public static String convert(AstNode astNode, XmlEntityResolver resolver, int options) throws StringConversionException
=======
public static String convert(
AstNode astNode,
ParserConfigInterface resolver,
int options) throws StringConversionException
>>>>>>>
public static String convert(
AstNode astNode,
XmlEntityResolver resolver,
int options) throws StringConversionException
<<<<<<<
extends
AstVisitor
=======
extends
AstVisitor
>>>>>>>
extends
AstVisitor |
<<<<<<<
"basic/wikitext/",
"basic/ast/",
new AstVisitor[] { new AstCompressor() },
=======
"basic" + SC + "wikitext" + SC,
"basic" + SC + "ast" + SC,
new Visitor[] { new AstCompressor() },
>>>>>>>
"basic" + SC + "wikitext" + SC,
"basic" + SC + "ast" + SC,
new AstVisitor[] { new AstCompressor() },
<<<<<<<
"basic/wikitext/",
"basic/wikitext/",
new AstVisitor[] { new AstCompressor() },
=======
"basic" + SC + "wikitext" + SC,
"basic" + SC + "wikitext" + SC,
new Visitor[] { new AstCompressor() },
>>>>>>>
"basic" + SC + "wikitext" + SC,
"basic" + SC + "wikitext" + SC,
new AstVisitor[] { new AstCompressor() },
<<<<<<<
"basic/wikitext/",
"basic/wikitextprinter/",
new AstVisitor[] { new AstCompressor() },
=======
"basic" + SC + "wikitext" + SC,
"basic" + SC + "wikitextprinter" + SC,
new Visitor[] { new AstCompressor() },
>>>>>>>
"basic" + SC + "wikitext" + SC,
"basic" + SC + "wikitextprinter" + SC,
new AstVisitor[] { new AstCompressor() },
<<<<<<<
"regression/wikitext/",
"regression/ast/",
new AstVisitor[] { new AstCompressor() },
=======
"regression" + SC + "wikitext" + SC,
"regression" + SC + "ast" + SC,
new Visitor[] { new AstCompressor() },
>>>>>>>
"regression" + SC + "wikitext" + SC,
"regression" + SC + "ast" + SC,
new AstVisitor[] { new AstCompressor() },
<<<<<<<
"complex/wikitext/",
"complex/ast/",
new AstVisitor[] { new AstCompressor() },
=======
"complex" + SC + "wikitext" + SC,
"complex" + SC + "ast" + SC,
new Visitor[] { new AstCompressor() },
>>>>>>>
"complex" + SC + "wikitext" + SC,
"complex" + SC + "ast" + SC,
new AstVisitor[] { new AstCompressor() },
<<<<<<<
"scopes/wikitext/",
"scopes/ast/",
new AstVisitor[] { new AstCompressor() },
=======
"scopes" + SC + "wikitext" + SC,
"scopes" + SC + "ast" + SC,
new Visitor[] { new AstCompressor() },
>>>>>>>
"scopes" + SC + "wikitext" + SC,
"scopes" + SC + "ast" + SC,
new AstVisitor[] { new AstCompressor() }, |
<<<<<<<
import org.sweble.wikitext.engine.config.WikiConfigImpl;
=======
import org.sweble.wikitext.engine.utils.CompilerTestBase;
import org.sweble.wikitext.engine.utils.SimpleWikiConfiguration;
>>>>>>>
import org.sweble.wikitext.engine.config.WikiConfigImpl;
import org.sweble.wikitext.engine.utils.CompilerTestBase; |
<<<<<<<
import org.sweble.wikitext.lazy.ParserConfig;
=======
import org.sweble.wikitext.lazy.encval.ValidatedWikitext;
>>>>>>>
import org.sweble.wikitext.lazy.ParserConfig;
import org.sweble.wikitext.lazy.encval.ValidatedWikitext;
<<<<<<<
PageId pageId,
String wikitext,
ExpansionCallback callback)
throws CompilerException
{
return expand(pageId, wikitext, false, callback);
}
/**
* Takes wikitext and expands the wikitext. The following steps are
* performed:
* <ul>
* <li>Validation</li>
* <li>Preprocessing (for viewing)</li>
* <li>Entity substitution</li>
* <li>Expansion</li>
* </ul>
*/
public CompiledPage expand(
PageId pageId,
String wikitext,
boolean forInclusion,
ExpansionCallback callback)
throws CompilerException
=======
PageId pageId,
String wikitext,
ExpansionCallback callback)
throws CompilerException
>>>>>>>
PageId pageId,
String wikitext,
ExpansionCallback callback)
throws CompilerException
{
return expand(pageId, wikitext, false, callback);
}
/**
* Takes wikitext and expands the wikitext. The following steps are
* performed:
* <ul>
* <li>Validation</li>
* <li>Preprocessing (for viewing)</li>
* <li>Entity substitution</li>
* <li>Expansion</li>
* </ul>
*/
public CompiledPage expand(
PageId pageId,
String wikitext,
boolean forInclusion,
ExpansionCallback callback)
throws CompilerException
<<<<<<<
new Page(pAst.getContent()),
pAst.getWarnings(),
log);
=======
new Page(pAst.getContent()),
pAst.getWarnings(),
log);
}
/**
* Takes an AST after preprocessing or after expansion and performs the
* following steps:
* <ul>
* <li>Parsing</li>
* <li>Entity substitution</li>
* <li>Postprocessing</li>
* </ul>
*/
public CompiledPage postprocessPpOrExpAst(
PageId pageId,
LazyPreprocessedPage pprAst)
throws CompilerException
{
if (pageId == null)
throw new NullPointerException();
PageTitle title = pageId.getTitle();
CompilerLog log = new CompilerLog();
log.setTitle(title.getFullTitle());
log.setRevision(pageId.getRevision());
LazyParsedPage pAst;
try
{
pAst = parse(title, pprAst, log);
pAst = postprocess(title, pAst, log);
}
catch (CompilerException e)
{
e.attachLog(log);
throw e;
}
catch (Throwable e)
{
throw new CompilerException("Compilation failed!", e, log);
}
return new CompiledPage(
new Page(pAst.getContent()),
pAst.getWarnings(),
log);
>>>>>>>
new Page(pAst.getContent()),
pAst.getWarnings(),
log);
}
/**
* Takes an AST after preprocessing or after expansion and performs the
* following steps:
* <ul>
* <li>Parsing</li>
* <li>Entity substitution</li>
* <li>Postprocessing</li>
* </ul>
*/
public CompiledPage postprocessPpOrExpAst(
PageId pageId,
LazyPreprocessedPage pprAst)
throws CompilerException
{
if (pageId == null)
throw new NullPointerException();
PageTitle title = pageId.getTitle();
CompilerLog log = new CompilerLog();
log.setTitle(title.getDenormalizedFullTitle());
log.setRevision(pageId.getRevision());
LazyParsedPage pAst;
try
{
pAst = parse(title, pprAst, log);
pAst = postprocess(title, pAst, log);
}
catch (CompilerException e)
{
e.attachLog(log);
throw e;
}
catch (Throwable e)
{
throw new CompilerException(title, "Compilation failed!", e, log);
}
return new CompiledPage(
new Page(pAst.getContent()),
pAst.getWarnings(),
log);
<<<<<<<
callback,
title,
ppAst,
entityMap,
arguments,
forInclusion,
rootFrame,
parentFrame,
log);
=======
callback,
title,
ppAst,
arguments,
forInclusion,
rootFrame,
parentFrame,
log);
>>>>>>>
callback,
title,
ppAst,
arguments,
forInclusion,
rootFrame,
parentFrame,
log);
<<<<<<<
callback,
title,
ppAst,
entityMap,
arguments,
forInclusion,
rootFrame,
parentFrame,
log);
=======
callback,
title,
ppAst,
arguments,
forInclusion,
rootFrame,
parentFrame,
log);
>>>>>>>
callback,
title,
ppAst,
arguments,
forInclusion,
rootFrame,
parentFrame,
log);
<<<<<<<
String validatedWikitext = validator.validate(
wikitext,
title.getDenormalizedFullTitle(),
entityMap);
=======
if (entityMap == null)
entityMap = new EntityMap();
ValidatedWikitext validatedWikitext = validator.validate(
wikitext,
title.getFullTitle(),
entityMap);
>>>>>>>
if (entityMap == null)
entityMap = new EntityMap();
ValidatedWikitext validatedWikitext = validator.validate(
wikitext,
title.getDenormalizedFullTitle(),
entityMap);
<<<<<<<
PageTitle title,
String validatedWikitext,
boolean forInclusion,
EntityMap entityMap,
ContentNode parentLog)
throws CompilerException
=======
PageTitle title,
ValidatedWikitext validatedWikitext,
boolean forInclusion,
ContentNode parentLog)
throws CompilerException
>>>>>>>
PageTitle title,
ValidatedWikitext validatedWikitext,
boolean forInclusion,
ContentNode parentLog)
throws CompilerException
<<<<<<<
(LazyPreprocessedPage) preprocessor.parseArticle(
validatedWikitext,
title.getDenormalizedFullTitle(),
forInclusion);
=======
(LazyPreprocessedPage) preprocessor.parseArticle(
validatedWikitext,
title.getFullTitle(),
forInclusion);
>>>>>>>
(LazyPreprocessedPage) preprocessor.parseArticle(
validatedWikitext,
title.getDenormalizedFullTitle(),
forInclusion);
<<<<<<<
ExpansionCallback callback,
PageTitle title,
LazyPreprocessedPage ppAst,
EntityMap entityMap,
LinkedHashMap<String, AstNode> arguments,
boolean forInclusion,
ContentNode parentLog)
throws CompilerException
=======
ExpansionCallback callback,
PageTitle title,
LazyPreprocessedPage ppAst,
LinkedHashMap<String, AstNode> arguments,
boolean forInclusion,
ContentNode parentLog)
throws CompilerException
>>>>>>>
ExpansionCallback callback,
PageTitle title,
LazyPreprocessedPage ppAst,
LinkedHashMap<String, AstNode> arguments,
boolean forInclusion,
ContentNode parentLog)
throws CompilerException
<<<<<<<
callback,
title,
ppAst,
entityMap,
arguments,
forInclusion,
null,
null,
parentLog);
=======
callback,
title,
ppAst,
arguments,
forInclusion,
null,
null,
parentLog);
>>>>>>>
callback,
title,
ppAst,
arguments,
forInclusion,
null,
null,
parentLog);
<<<<<<<
ExpansionCallback callback,
PageTitle title,
LazyPreprocessedPage ppAst,
EntityMap entityMap,
Map<String, AstNode> arguments,
boolean forInclusion,
ExpansionFrame rootFrame,
ExpansionFrame parentFrame,
ContentNode parentLog)
throws CompilerException
=======
ExpansionCallback callback,
PageTitle title,
LazyPreprocessedPage ppAst,
Map<String, AstNode> arguments,
boolean forInclusion,
ExpansionFrame rootFrame,
ExpansionFrame parentFrame,
ContentNode parentLog)
throws CompilerException
>>>>>>>
ExpansionCallback callback,
PageTitle title,
LazyPreprocessedPage ppAst,
Map<String, AstNode> arguments,
boolean forInclusion,
ExpansionFrame rootFrame,
ExpansionFrame parentFrame,
ContentNode parentLog)
throws CompilerException
<<<<<<<
this,
callback,
hooks,
title,
entityMap,
arguments,
forInclusion,
noRedirect,
rootFrame,
parentFrame,
ppAst.getWarnings(),
log,
timingEnabled,
catchAll);
=======
this,
callback,
title,
ppAst.getEntityMap(),
arguments,
forInclusion,
rootFrame,
parentFrame,
ppAst.getWarnings(),
log);
>>>>>>>
this,
callback,
hooks,
title,
ppAst.getEntityMap(),
arguments,
forInclusion,
noRedirect,
rootFrame,
parentFrame,
ppAst.getWarnings(),
log,
timingEnabled,
catchAll);
<<<<<<<
this,
callback,
hooks,
title,
entityMap,
noRedirect,
ppAst.getWarnings(),
log,
timingEnabled,
catchAll);
=======
this,
callback,
title,
ppAst.getEntityMap(),
ppAst.getWarnings(),
log);
>>>>>>>
this,
callback,
hooks,
title,
ppAst.getEntityMap(),
noRedirect,
ppAst.getWarnings(),
log,
timingEnabled,
catchAll);
<<<<<<<
PageTitle title,
LazyPreprocessedPage ppAst,
EntityMap entityMap,
ContentNode parentLog)
throws CompilerException
=======
PageTitle title,
LazyPreprocessedPage ppAst,
ContentNode parentLog)
throws CompilerException
>>>>>>>
PageTitle title,
LazyPreprocessedPage ppAst,
ContentNode parentLog)
throws CompilerException
<<<<<<<
PreprocessorToParserTransformer.transform(
ppAst,
entityMap,
compilerConfig.isTrimTransparentBeforeParsing());
=======
PreprocessorToParserTransformer.transform(ppAst, true);
>>>>>>>
PreprocessorToParserTransformer.transform(
ppAst,
compilerConfig.isTrimTransparentBeforeParsing()); |
<<<<<<<
import org.apache.hadoop.hdds.protocol.MockDatanodeDetails;
=======
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.StorageReportProto;
>>>>>>>
import org.apache.hadoop.hdds.protocol.MockDatanodeDetails;
import org.apache.hadoop.hdds.conf.OzoneConfiguration;
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.hadoop.hdds.protocol.proto.HddsProtos;
import org.apache.hadoop.hdds.protocol.proto.StorageContainerDatanodeProtocolProtos.StorageReportProto;
<<<<<<<
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
=======
>>>>>>>
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
import org.junit.rules.ExpectedException;
import java.util.Map;
<<<<<<<
import static org.apache.hadoop.hdds.scm.ScmConfigKeys
.OZONE_SCM_DEADNODE_INTERVAL;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys
.OZONE_SCM_HEARTBEAT_PROCESS_INTERVAL;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys
.OZONE_SCM_STALENODE_INTERVAL;
=======
import static org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeState.DEAD;
import static org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeState.HEALTHY;
>>>>>>>
import static org.apache.hadoop.hdds.scm.ScmConfigKeys
.OZONE_SCM_DEADNODE_INTERVAL;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys
.OZONE_SCM_HEARTBEAT_PROCESS_INTERVAL;
import static org.apache.hadoop.hdds.scm.ScmConfigKeys
.OZONE_SCM_STALENODE_INTERVAL; |
<<<<<<<
this.nodeStatus = nodeStatus;
=======
this.metadataStorageReports = Collections.emptyList();
>>>>>>>
this.nodeStatus = nodeStatus;
this.metadataStorageReports = Collections.emptyList(); |
<<<<<<<
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState;
import org.apache.hadoop.hdds.utils.HddsServerUtil;
=======
>>>>>>>
import org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState;
<<<<<<<
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
NodeStatus status = nodeStateMap.getNodeStatus(node.getUuid());
switch (status.getHealth()) {
case HEALTHY:
// Move the node to STALE if the last heartbeat time is less than
// configured stale-node interval.
updateNodeState(node, staleNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
break;
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
// Restore the node if we have received heartbeat before configured
// stale-node interval.
updateNodeState(node, healthyNodeCondition, status,
NodeLifeCycleEvent.RESTORE);
break;
case DEAD:
// Resurrect the node if we have received heartbeat before
// configured stale-node interval.
updateNodeState(node, healthyNodeCondition, status,
NodeLifeCycleEvent.RESURRECT);
break;
default:
=======
for (NodeState state : NodeState.values()) {
List<UUID> nodes = nodeStateMap.getNodes(state);
for (UUID id : nodes) {
DatanodeInfo node = nodeStateMap.getNodeInfo(id);
switch (state) {
case HEALTHY:
// Move the node to STALE if the last heartbeat time is less than
// configured stale-node interval.
updateNodeState(node, staleNodeCondition, state,
NodeLifeCycleEvent.TIMEOUT);
break;
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, state,
NodeLifeCycleEvent.TIMEOUT);
// Restore the node if we have received heartbeat before configured
// stale-node interval.
updateNodeState(node, healthyNodeCondition, state,
NodeLifeCycleEvent.RESTORE);
break;
case DEAD:
// Resurrect the node if we have received heartbeat before
// configured stale-node interval.
updateNodeState(node, healthyNodeCondition, state,
NodeLifeCycleEvent.RESURRECT);
break;
// We don't do anything for DECOMMISSIONING and DECOMMISSIONED in
// heartbeat processing.
case DECOMMISSIONING:
case DECOMMISSIONED:
default:
}
>>>>>>>
for(DatanodeInfo node : nodeStateMap.getAllDatanodeInfos()) {
NodeStatus status = nodeStateMap.getNodeStatus(node.getUuid());
switch (status.getHealth()) {
case HEALTHY:
// Move the node to STALE if the last heartbeat time is less than
// configured stale-node interval.
updateNodeState(node, staleNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
break;
case STALE:
// Move the node to DEAD if the last heartbeat time is less than
// configured dead-node interval.
updateNodeState(node, deadNodeCondition, status,
NodeLifeCycleEvent.TIMEOUT);
// Restore the node if we have received heartbeat before configured
// stale-node interval.
updateNodeState(node, healthyNodeCondition, status,
NodeLifeCycleEvent.RESTORE);
break;
case DEAD:
// Resurrect the node if we have received heartbeat before
// configured stale-node interval.
updateNodeState(node, healthyNodeCondition, status,
NodeLifeCycleEvent.RESURRECT);
break;
default: |
<<<<<<<
import org.apache.hadoop.security.UserGroupInformation;
=======
import org.apache.ratis.protocol.AlreadyClosedException;
>>>>>>>
import org.apache.hadoop.security.UserGroupInformation;
import org.apache.ratis.protocol.AlreadyClosedException;
<<<<<<<
UserGroupInformation.getCurrentUser().addToken(subKeyInfo.getToken());
XceiverClientSpi xceiverClient =
xceiverClientManager.acquireClient(containerWithPipeline.getPipeline());
BlockOutputStreamEntry.Builder builder =
new BlockOutputStreamEntry.Builder()
.setBlockID(subKeyInfo.getBlockID())
.setKey(keyArgs.getKeyName())
.setXceiverClientManager(xceiverClientManager)
.setXceiverClient(xceiverClient)
.setRequestId(requestID)
.setChunkSize(chunkSize)
.setLength(subKeyInfo.getLength())
.setStreamBufferFlushSize(streamBufferFlushSize)
.setStreamBufferMaxSize(streamBufferMaxSize)
.setWatchTimeout(watchTimeout)
.setBufferList(bufferList)
.setChecksum(checksum)
.setToken(subKeyInfo.getToken());
streamEntries.add(builder.build());
=======
streamEntries.add(new BlockOutputStreamEntry(subKeyInfo.getBlockID(),
keyArgs.getKeyName(), xceiverClientManager,
containerWithPipeline.getPipeline(), requestID, chunkSize,
subKeyInfo.getLength(), streamBufferFlushSize, streamBufferMaxSize,
watchTimeout, bufferList, checksum));
>>>>>>>
UserGroupInformation.getCurrentUser().addToken(subKeyInfo.getToken());
XceiverClientSpi xceiverClient =
xceiverClientManager.acquireClient(containerWithPipeline.getPipeline());
BlockOutputStreamEntry.Builder builder =
new BlockOutputStreamEntry.Builder()
.setBlockID(subKeyInfo.getBlockID())
.setKey(keyArgs.getKeyName())
.setXceiverClientManager(xceiverClientManager)
.setPipeline(containerWithPipeline.getPipeline())
.setRequestId(requestID)
.setChunkSize(chunkSize)
.setLength(subKeyInfo.getLength())
.setStreamBufferFlushSize(streamBufferFlushSize)
.setStreamBufferMaxSize(streamBufferMaxSize)
.setWatchTimeout(watchTimeout)
.setBufferList(bufferList)
.setChecksum(checksum)
.setToken(subKeyInfo.getToken());
streamEntries.add(builder.build());
<<<<<<<
=======
private static class BlockOutputStreamEntry extends OutputStream {
private OutputStream outputStream;
private BlockID blockID;
private final String key;
private final XceiverClientManager xceiverClientManager;
private final Pipeline pipeline;
private final Checksum checksum;
private final String requestId;
private final int chunkSize;
// total number of bytes that should be written to this stream
private final long length;
// the current position of this stream 0 <= currentPosition < length
private long currentPosition;
private final long streamBufferFlushSize;
private final long streamBufferMaxSize;
private final long watchTimeout;
private List<ByteBuffer> bufferList;
@SuppressWarnings("parameternumber")
BlockOutputStreamEntry(BlockID blockID, String key,
XceiverClientManager xceiverClientManager,
Pipeline pipeline, String requestId, int chunkSize,
long length, long streamBufferFlushSize, long streamBufferMaxSize,
long watchTimeout, List<ByteBuffer> bufferList, Checksum checksum) {
this.outputStream = null;
this.blockID = blockID;
this.key = key;
this.xceiverClientManager = xceiverClientManager;
this.pipeline = pipeline;
this.requestId = requestId;
this.chunkSize = chunkSize;
this.length = length;
this.currentPosition = 0;
this.streamBufferFlushSize = streamBufferFlushSize;
this.streamBufferMaxSize = streamBufferMaxSize;
this.watchTimeout = watchTimeout;
this.checksum = checksum;
this.bufferList = bufferList;
}
long getLength() {
return length;
}
long getRemaining() {
return length - currentPosition;
}
/**
* BlockOutputStream is initialized in this function. This makes sure that
* xceiverClient initialization is not done during preallocation and only
* done when data is written.
* @throws IOException if xceiverClient initialization fails
*/
private void checkStream() throws IOException {
if (this.outputStream == null) {
this.outputStream =
new BlockOutputStream(blockID, key, xceiverClientManager,
pipeline, requestId, chunkSize, streamBufferFlushSize,
streamBufferMaxSize, watchTimeout, bufferList, checksum);
}
}
@Override
public void write(int b) throws IOException {
checkStream();
outputStream.write(b);
this.currentPosition += 1;
}
@Override
public void write(byte[] b, int off, int len) throws IOException {
checkStream();
outputStream.write(b, off, len);
this.currentPosition += len;
}
@Override
public void flush() throws IOException {
if (this.outputStream != null) {
this.outputStream.flush();
}
}
@Override
public void close() throws IOException {
if (this.outputStream != null) {
this.outputStream.close();
// after closing the chunkOutPutStream, blockId would have been
// reconstructed with updated bcsId
if (this.outputStream instanceof BlockOutputStream) {
this.blockID = ((BlockOutputStream) outputStream).getBlockID();
}
}
}
long getTotalSuccessfulFlushedData() throws IOException {
if (this.outputStream instanceof BlockOutputStream) {
BlockOutputStream out = (BlockOutputStream) this.outputStream;
blockID = out.getBlockID();
return out.getTotalSuccessfulFlushedData();
} else if (outputStream == null) {
// For a pre allocated block for which no write has been initiated,
// the OutputStream will be null here.
// In such cases, the default blockCommitSequenceId will be 0
return 0;
}
throw new IOException("Invalid Output Stream for Key: " + key);
}
long getWrittenDataLength() throws IOException {
if (this.outputStream instanceof BlockOutputStream) {
BlockOutputStream out = (BlockOutputStream) this.outputStream;
return out.getWrittenDataLength();
} else if (outputStream == null) {
// For a pre allocated block for which no write has been initiated,
// the OutputStream will be null here.
// In such cases, the default blockCommitSequenceId will be 0
return 0;
}
throw new IOException("Invalid Output Stream for Key: " + key);
}
void cleanup(boolean invalidateClient) throws IOException {
checkStream();
if (this.outputStream instanceof BlockOutputStream) {
BlockOutputStream out = (BlockOutputStream) this.outputStream;
out.cleanup(invalidateClient);
}
}
void writeOnRetry(long len) throws IOException {
checkStream();
if (this.outputStream instanceof BlockOutputStream) {
BlockOutputStream out = (BlockOutputStream) this.outputStream;
out.writeOnRetry(len);
this.currentPosition += len;
} else {
throw new IOException("Invalid Output Stream for Key: " + key);
}
}
}
>>>>>>> |
<<<<<<<
import org.apache.hadoop.hdds.protocol.DatanodeDetails;
import org.apache.hadoop.hdds.scm.node.NodeStatus;
=======
import com.google.common.annotations.VisibleForTesting;
>>>>>>>
import org.apache.hadoop.hdds.scm.node.NodeStatus;
import com.google.common.annotations.VisibleForTesting; |
<<<<<<<
import org.apache.hadoop.hdds.scm.node.NodeStatus;
import org.apache.hadoop.hdds.scm.safemode.SCMSafeModeManager.SafeModeStatus;
=======
>>>>>>>
import org.apache.hadoop.hdds.scm.node.NodeStatus; |
<<<<<<<
ContainerReplicaCount replicaSet =
getContainerReplicaCount(container, replicas);
ContainerPlacementStatus placementStatus = getPlacementStatus(
replicas, container.getReplicationFactor().getNumber());
=======
/*
* If container is under deleting and all it's replicas are deleted, then
* make the container as CLEANED, or resend the delete replica command if
* needed.
*/
if (state == LifeCycleState.DELETING) {
handleContainerUnderDelete(container, replicas);
return;
}
/*
* We don't have to take any action if the container is healthy.
*
* According to ReplicationMonitor container is considered healthy if
* the container is either in QUASI_CLOSED or in CLOSED state and has
* exact number of replicas in the same state.
*/
if (isContainerHealthy(container, replicas)) {
/*
* If container is empty, schedule task to delete the container.
*/
if (isContainerEmpty(container, replicas)) {
deleteContainerReplicas(container, replicas);
}
return;
}
>>>>>>>
/*
* If container is under deleting and all it's replicas are deleted, then
* make the container as CLEANED, or resend the delete replica command if
* needed.
*/
if (state == LifeCycleState.DELETING) {
handleContainerUnderDelete(container, replicas);
return;
}
ContainerReplicaCount replicaSet =
getContainerReplicaCount(container, replicas);
ContainerPlacementStatus placementStatus = getPlacementStatus(
replicas, container.getReplicationFactor().getNumber());
/*
* We don't have to take any action if the container is healthy.
*
* According to ReplicationMonitor container is considered healthy if
* the container is either in QUASI_CLOSED or in CLOSED state and has
* exact number of replicas in the same state.
*/
if (isContainerEmpty(container, replicas)) {
/*
* If container is empty, schedule task to delete the container.
*/
deleteContainerReplicas(container, replicas);
return;
} |
<<<<<<<
import org.apache.hadoop.hdds.scm.node.NodeStatus;
=======
import org.apache.hadoop.hdds.scm.net.NetworkTopology;
>>>>>>>
import org.apache.hadoop.hdds.scm.node.NodeStatus;
import org.apache.hadoop.hdds.scm.net.NetworkTopology; |
<<<<<<<
import org.apache.hadoop.hdds.scm.node.NodeManager;
import org.apache.hadoop.hdds.scm.node.NodeStatus;
import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException;
import org.apache.hadoop.hdds.scm.safemode.SCMSafeModeManager;
import org.apache.hadoop.hdds.scm.safemode.SafeModeNotification;
=======
import org.apache.hadoop.hdds.scm.node.NodeManager;
import org.apache.hadoop.hdds.scm.safemode.SCMSafeModeManager.SafeModeStatus;
import org.apache.hadoop.hdds.server.events.EventHandler;
>>>>>>>
import org.apache.hadoop.hdds.scm.node.NodeManager;
import org.apache.hadoop.hdds.scm.node.NodeStatus;
import org.apache.hadoop.hdds.scm.node.states.NodeNotFoundException;
import org.apache.hadoop.hdds.scm.safemode.SCMSafeModeManager;
import org.apache.hadoop.hdds.scm.safemode.SCMSafeModeManager.SafeModeStatus;
import org.apache.hadoop.hdds.server.events.EventHandler;
<<<<<<<
* Minimum number of replica in a healthy state for maintenance.
*/
private int minHealthyForMaintenance;
/**
=======
* Used for check datanode state.
*/
private final NodeManager nodeManager;
/**
>>>>>>>
* Minimum number of replica in a healthy state for maintenance.
*/
private int minHealthyForMaintenance;
/**
<<<<<<<
this.minHealthyForMaintenance = conf.getMaintenanceReplicaMinimum();
=======
this.nodeManager = nodeManager;
>>>>>>>
this.minHealthyForMaintenance = conf.getMaintenanceReplicaMinimum();
<<<<<<<
ContainerReplicaCount replicaSet =
getContainerReplicaCount(container, replicas);
=======
/*
* We don't have to take any action if the container is healthy.
*
* According to ReplicationMonitor container is considered healthy if
* the container is either in QUASI_CLOSED or in CLOSED state and has
* exact number of replicas in the same state.
*/
if (isContainerHealthy(container, replicas)) {
return;
}
>>>>>>>
ContainerReplicaCount replicaSet =
getContainerReplicaCount(container, replicas);
<<<<<<<
private int getInflightAdd(final ContainerID id) {
return inflightReplication.getOrDefault(id, Collections.emptyList()).size();
=======
private boolean isContainerHealthy(final ContainerInfo container,
final Set<ContainerReplica> replicas) {
return !isContainerUnderReplicated(container, replicas) &&
!isContainerOverReplicated(container, replicas) &&
replicas.stream().allMatch(
r -> compareState(container.getState(), r.getState()));
>>>>>>>
private int getInflightAdd(final ContainerID id) {
return inflightReplication.getOrDefault(id, Collections.emptyList()).size();
<<<<<<<
private int getInflightDel(final ContainerID id) {
return inflightDeletion.getOrDefault(id, Collections.emptyList()).size();
=======
private boolean isContainerUnderReplicated(final ContainerInfo container,
final Set<ContainerReplica> replicas) {
boolean misReplicated = !getPlacementStatus(
replicas, container.getReplicationFactor().getNumber())
.isPolicySatisfied();
return container.getReplicationFactor().getNumber() >
getReplicaCount(container.containerID(), replicas) || misReplicated;
>>>>>>>
private int getInflightDel(final ContainerID id) {
return inflightDeletion.getOrDefault(id, Collections.emptyList()).size();
<<<<<<<
final ContainerReplicaCount replicaSet) {
LOG.debug("Handling under replicated container: {}",
=======
final Set<ContainerReplica> replicas) {
LOG.debug("Handling under-replicated container: {}",
>>>>>>>
final ContainerReplicaCount replicaSet) {
LOG.debug("Handling under-replicated container: {}",
<<<<<<<
=======
final int replicationFactor = container
.getReplicationFactor().getNumber();
// Want to check if the container is mis-replicated after considering
// inflight add and delete.
// Create a new list from source (healthy replicas minus pending delete)
List<DatanodeDetails> targetReplicas = new ArrayList<>(source);
// Then add any pending additions
targetReplicas.addAll(replicationInFlight);
final ContainerPlacementStatus placementStatus =
containerPlacement.validateContainerPlacement(
targetReplicas, replicationFactor);
int delta = replicationFactor - getReplicaCount(id, replicas);
final int misRepDelta = placementStatus.misReplicationCount();
final int replicasNeeded
= delta < misRepDelta ? misRepDelta : delta;
if (replicasNeeded <= 0) {
LOG.debug("Container {} meets replication requirement with " +
"inflight replicas", id);
return;
}
>>>>>>>
final int replicationFactor = container
.getReplicationFactor().getNumber();
// Want to check if the container is mis-replicated after considering
// inflight add and delete.
// Create a new list from source (healthy replicas minus pending delete)
List<DatanodeDetails> targetReplicas = new ArrayList<>(source);
// Then add any pending additions
targetReplicas.addAll(replicationInFlight);
final ContainerPlacementStatus placementStatus =
containerPlacement.validateContainerPlacement(
targetReplicas, replicationFactor);
final int misRepDelta = placementStatus.misReplicationCount();
final int replicasNeeded
= repDelta < misRepDelta ? misRepDelta : repDelta;
if (replicasNeeded <= 0) {
LOG.debug("Container {} meets replication requirement with " +
"inflight replicas", id);
return;
}
<<<<<<<
List<InflightAction> actionList = inflightReplication.get(id);
if (actionList != null) {
actionList.stream().map(r -> r.datanode)
.forEach(excludeList::add);
}
// At this point we have all live source nodes and we have consider
=======
excludeList.addAll(replicationInFlight);
>>>>>>>
excludeList.addAll(replicationInFlight);
<<<<<<<
.chooseDatanodes(excludeList, null, repDelta,
=======
.chooseDatanodes(excludeList, null, replicasNeeded,
>>>>>>>
.chooseDatanodes(excludeList, null, replicasNeeded,
<<<<<<<
LOG.info("Container {} is under replicated. Expected replica count" +
" is {}, but found {}. An additional {} replica are needed",
id, replicaSet.getReplicationFactor(), replicaSet, repDelta);
for (DatanodeDetails datanode : selectedDatanodes) {
sendReplicateCommand(container, datanode, source);
=======
if (delta > 0) {
LOG.info("Container {} is under replicated. Expected replica count" +
" is {}, but found {}.", id, replicationFactor,
replicationFactor - delta);
}
int newMisRepDelta = misRepDelta;
if (misRepDelta > 0) {
LOG.info("Container: {}. {}",
id, placementStatus.misReplicatedReason());
// Check if the new target nodes (original plus newly selected nodes)
// makes the placement policy valid.
targetReplicas.addAll(selectedDatanodes);
newMisRepDelta = containerPlacement.validateContainerPlacement(
targetReplicas, replicationFactor).misReplicationCount();
}
if (delta > 0 || newMisRepDelta < misRepDelta) {
// Only create new replicas if we are missing a replicas or
// the number of pending mis-replication has improved. No point in
// creating new replicas for mis-replicated containers unless it
// improves things.
for (DatanodeDetails datanode : selectedDatanodes) {
sendReplicateCommand(container, datanode, source);
}
} else {
LOG.warn("Container {} is mis-replicated, requiring {} additional " +
"replicas. After selecting new nodes, mis-replication has not " +
"improved. No additional replicas will be scheduled",
id, misRepDelta);
>>>>>>>
if (repDelta > 0) {
LOG.info("Container {} is under replicated. Expected replica count" +
" is {}, but found {}.", id, replicationFactor,
replicationFactor - repDelta);
}
int newMisRepDelta = misRepDelta;
if (misRepDelta > 0) {
LOG.info("Container: {}. {}",
id, placementStatus.misReplicatedReason());
// Check if the new target nodes (original plus newly selected nodes)
// makes the placement policy valid.
targetReplicas.addAll(selectedDatanodes);
newMisRepDelta = containerPlacement.validateContainerPlacement(
targetReplicas, replicationFactor).misReplicationCount();
}
if (repDelta > 0 || newMisRepDelta < misRepDelta) {
// Only create new replicas if we are missing a replicas or
// the number of pending mis-replication has improved. No point in
// creating new replicas for mis-replicated containers unless it
// improves things.
for (DatanodeDetails datanode : selectedDatanodes) {
sendReplicateCommand(container, datanode, source);
}
} else {
LOG.warn("Container {} is mis-replicated, requiring {} additional " +
"replicas. After selecting new nodes, mis-replication has not " +
"improved. No additional replicas will be scheduled",
id, misRepDelta);
<<<<<<<
final int excess = replicaSet.additionalReplicaNeeded() * -1;
=======
// Don't consider inflight replication while calculating excess here.
int excess = replicas.size() - replicationFactor -
inflightDeletion.getOrDefault(id, Collections.emptyList()).size();
>>>>>>>
int excess = replicaSet.additionalReplicaNeeded() * -1;
<<<<<<<
// Retain one healthy replica per origin node Id.
final List<ContainerReplica> eligibleReplicas = new ArrayList<>(replicas);
eligibleReplicas.removeAll(uniqueReplicas.values());
// Replica which are maintenance or decommissioned are not eligible to
// be removed, as they do not count toward over-replication and they also
// many not be available
eligibleReplicas.removeIf(r ->
r.getDatanodeDetails().getPersistedOpState() !=
HddsProtos.NodeOperationalState.IN_SERVICE);
=======
// Retain one healthy replica per origin node Id.
eligibleReplicas.removeAll(uniqueReplicas.values());
}
>>>>>>>
eligibleReplicas.removeAll(uniqueReplicas.values());
// Replica which are maintenance or decommissioned are not eligible to
// be removed, as they do not count toward over-replication and they
// also many not be available
eligibleReplicas.removeIf(r ->
r.getDatanodeDetails().getPersistedOpState() !=
HddsProtos.NodeOperationalState.IN_SERVICE);
} |
<<<<<<<
=======
import butter.droid.activities.SearchActivity;
import butter.droid.activities.VideoPlayerActivity;
>>>>>>>
<<<<<<<
import butter.droid.base.BaseApplicationModule;
=======
import butter.droid.fragments.VideoPlayerFragment;
import butter.droid.fragments.dialog.BeamDeviceSelectorDialogFragment;
import butter.droid.fragments.dialog.EpisodeDialogFragment;
import butter.droid.fragments.dialog.LoadingDetailDialogFragment;
import butter.droid.ui.about.AboutActivity;
import butter.droid.ui.about.AboutComponent;
import butter.droid.ui.beam.BeamPlayerActivityComponent;
import butter.droid.ui.loading.StreamLoadingComponent;
import butter.droid.ui.main.MainComponent;
import butter.droid.ui.media.detail.MediaDetailComponent;
import butter.droid.ui.preferences.PreferencesComponent;
import butter.droid.ui.search.SearchComponent;
import butter.droid.ui.terms.TermsComponent;
import butter.droid.ui.trailer.TrailerPlayerComponent;
>>>>>>>
import butter.droid.base.BaseApplicationModule;
<<<<<<<
=======
void inject(MobileButterApplication application);
void inject(AboutActivity activity);
void inject(SearchActivity activity);
void inject(VideoPlayerActivity activity);
void inject(LoadingDetailDialogFragment fragment);
void inject(EpisodeDialogFragment fragment);
void inject(VideoPlayerFragment fragment);
void inject(BeamDeviceSelectorDialogFragment fragment);
MainComponent.Builder mainComponentBuilder();
PreferencesComponent.Builder preferencesComponentBuilder();
TermsComponent.Builder termsComponentBuilder();
MediaDetailComponent.Builder mediaDetailsComponentBuilder();
AboutComponent.Builder aboutComponentBuilder();
StreamLoadingComponent.Builder streamLoadingComponentBuilder();
BeamPlayerActivityComponent.Builder beamPlayerActivityComponentBuilder();
TrailerPlayerComponent.Builder trailerComponentBuilder();
SearchComponent.Builder searchComponentBuilder();
>>>>>>> |
<<<<<<<
import javax.inject.Inject;
=======
>>>>>>>
import javax.inject.Inject;
<<<<<<<
import butter.droid.base.manager.provider.ProviderManager;
import butter.droid.base.manager.provider.ProviderManager.OnProiderChangeListener;
import butter.droid.base.manager.provider.ProviderManager.ProviderType;
=======
import butter.droid.base.providers.media.VodoProvider;
>>>>>>>
import butter.droid.base.manager.provider.ProviderManager;
import butter.droid.base.manager.provider.ProviderManager.OnProiderChangeListener;
import butter.droid.base.manager.provider.ProviderManager.ProviderType;
<<<<<<<
import butter.droid.base.utils.ProviderUtils;
=======
>>>>>>>
import butter.droid.base.utils.ProviderUtils;
<<<<<<<
import butterknife.Bind;
=======
import butterknife.BindView;
>>>>>>>
import butterknife.BindView; |
<<<<<<<
Bugsnag.onActivityResume(this);
getApp().startService();
CastingManager.getInstance(this).addListener(this);
}
@Override
protected void onPause() {
super.onPause();
Bugsnag.onActivityPause(this);
CastingManager.getInstance(this).removeListener(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
Bugsnag.onActivityDestroy(this);
=======
>>>>>>>
CastingManager.getInstance(this).addListener(this);
}
@Override
protected void onPause() {
super.onPause();
CastingManager.getInstance(this).removeListener(this); |
<<<<<<<
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;
=======
import pct.droid.base.torrent.TorrentService;
>>>>>>>
import com.crashlytics.android.Crashlytics;
import io.fabric.sdk.android.Fabric;
import pct.droid.base.torrent.TorrentService;
<<<<<<<
Fabric.with(this, new Crashlytics());
=======
TorrentService.start(this);
>>>>>>>
Fabric.with(this, new Crashlytics());
TorrentService.start(this); |
<<<<<<<
MediaDetailComponent.Builder mediaDetailsComponentBuilder();
=======
AboutComponent.Builder aboutComponentBuilder();
>>>>>>>
MediaDetailComponent.Builder mediaDetailsComponentBuilder();
AboutComponent.Builder aboutComponentBuilder(); |
<<<<<<<
BaseAndroidModule.class,
ManagerModule.class,
=======
AndroidModule.class,
>>>>>>>
BaseAndroidModule.class, |
<<<<<<<
String indicesPrefix = testName.getSanitizedMethodName();
ElasticTestUtils.configure(
elasticsearchConfig, nodeInfo.port, indicesPrefix, ElasticVersion.V5_6);
=======
String indicesPrefix = getSanitizedMethodName();
ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix, ElasticVersion.V5_6);
>>>>>>>
String indicesPrefix = testName.getSanitizedMethodName();
ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix, ElasticVersion.V5_6); |
<<<<<<<
import pct.droid.base.torrent.StreamInfo;
=======
import pct.droid.base.utils.PixelUtils;
>>>>>>>
import pct.droid.base.torrent.StreamInfo;
import pct.droid.base.utils.PixelUtils;
<<<<<<<
if (null != info && null != info.getMedia()) {
String url;
if (info.isShow()) {
url = info.getShow().image;
}else {
url = info.getMedia().image;
}
=======
if (null != info) {
Media media = info.isShow() ? info.getShow() : info.getMedia();
String url = media.image;
if(PixelUtils.isTablet(getActivity())) {
url = media.headerImage;
}
>>>>>>>
if (null != info) {
Media media = info.isShow() ? info.getShow() : info.getMedia();
String url = media.image;
if(PixelUtils.isTablet(getActivity())) {
url = media.headerImage;
} |
<<<<<<<
@Bind(R.id.toolbar) Toolbar toolbar;
@Bind(R.id.searchview) SearchView mSearchview;
=======
public static final String EXTRA_PROVIDER = "extra_provider";
@BindView(R.id.toolbar)
Toolbar toolbar;
@BindView(R.id.searchview)
SearchView mSearchview;
>>>>>>>
@BindView(R.id.toolbar) Toolbar toolbar;
@BindView(R.id.searchview) SearchView mSearchview; |
<<<<<<<
@UiHandler("addme")
void onAddMe(@SuppressWarnings("unused") ClickEvent e) {
=======
@UiHandler("addMe")
void onAddMe(ClickEvent e) {
>>>>>>>
@UiHandler("addMe")
void onAddMe(@SuppressWarnings("unused") ClickEvent e) { |
<<<<<<<
PackageManager packageManager();
=======
ContentResolver contentResolver();
AudioManager audioManager();
WindowManager windowManager();
>>>>>>>
PackageManager packageManager();
ContentResolver contentResolver();
AudioManager audioManager();
WindowManager windowManager(); |
<<<<<<<
import butter.droid.fragments.BeamPlayerFragment;
=======
import butter.droid.fragments.MediaContainerFragment;
import butter.droid.fragments.MediaGenreSelectionFragment;
>>>>>>>
<<<<<<<
=======
void inject(MediaContainerFragment fragment);
void inject(MediaGenreSelectionFragment fragment);
>>>>>>>
<<<<<<<
=======
MediaListComponent.Builder mediaListComponentBuilder();
>>>>>>>
MediaListComponent.Builder mediaListComponentBuilder(); |
<<<<<<<
import butter.droid.base.manager.internal.provider.ProviderManager.ProviderType;
=======
import butter.droid.base.manager.provider.ProviderManager.ProviderType;
import butter.droid.base.providers.media.MediaProvider.NavInfo;
>>>>>>>
import butter.droid.base.manager.internal.provider.ProviderManager.ProviderType;
import butter.droid.base.providers.media.MediaProvider.NavInfo; |
<<<<<<<
public static Boolean DEBUG_ENABLED = BuildConfig.DEBUG; // will be set to true for debug builds and false for release builds
public static final String LOG_TAG = "PopcornTimeForAndroid";
public static final String PREFS_FILE = "PCT_Prefs";
public static final String DATABASE_NAME = "PCT_DB.db";
public static final Integer DATABASE_VERSION = 1;
public static final Integer SERVER_PORT = 55723;
public static final String BUGSNAG_KEY = "8ab4dda6780329b10aca038b86d506e5";
public static final String GIT_URL = "https://git.popcorntime.io/";
public static final String POPCORN_URL = "https://popcorntime.io/";
public static final String FB_URL = "https://fb.com/PopcornTimeTv";
public static final String BLOG_URL = "https://blog.popcorntime.io";
public static final String DISCUSS_URL = "https://discuss.popcorntime.io";
public static final String TWITTER_URL = "https://twitter.com/PopcornTimeTv";
public static final String JIRA_API = GIT_URL + "jira/rest/api/2/";
public static final String JIRA_PROJECT = "10200";
public static final String CAST_ID = "9A435985";
=======
public static Boolean DEBUG_ENABLED = BuildConfig.DEBUG; // will be set to true for debug builds and false for release builds
public static final String LOG_TAG = "PopcornTimeForAndroid";
public static final String PREFS_FILE = "PCT_Prefs";
public static final String DATABASE_NAME = "PCT_DB.db";
public static final Integer DATABASE_VERSION = 1;
public static final String GIT_URL = "https://git.popcorntime.io/";
public static final String POPCORN_URL = "https://popcorntime.io/";
public static final String FB_URL = "https://fb.com/PopcornTimeTv";
public static final String BLOG_URL = "https://blog.popcorntime.io";
public static final String DISCUSS_URL = "https://discuss.popcorntime.io";
public static final String TWITTER_URL = "https://twitter.com/PopcornTimeTv";
public static final String JIRA_API = GIT_URL + "jira/rest/api/2/";
public static final String JIRA_PROJECT = "10200";
>>>>>>>
public static Boolean DEBUG_ENABLED = BuildConfig.DEBUG; // will be set to true for debug builds and false for release builds
public static final String LOG_TAG = "PopcornTimeForAndroid";
public static final String PREFS_FILE = "PCT_Prefs";
public static final String DATABASE_NAME = "PCT_DB.db";
public static final Integer DATABASE_VERSION = 1;
public static final Integer SERVER_PORT = 55723;
public static final String GIT_URL = "https://git.popcorntime.io/";
public static final String POPCORN_URL = "https://popcorntime.io/";
public static final String FB_URL = "https://fb.com/PopcornTimeTv";
public static final String BLOG_URL = "https://blog.popcorntime.io";
public static final String DISCUSS_URL = "https://discuss.popcorntime.io";
public static final String TWITTER_URL = "https://twitter.com/PopcornTimeTv";
public static final String JIRA_API = GIT_URL + "jira/rest/api/2/";
public static final String JIRA_PROJECT = "10200";
public static final String CAST_ID = "9A435985"; |
<<<<<<<
import butter.droid.base.BaseApplicationModule;
=======
import butter.droid.tv.activities.TVLaunchActivity;
import butter.droid.tv.activities.TVMainActivity;
import butter.droid.tv.activities.TVMediaDetailActivity;
import butter.droid.tv.activities.TVMediaGridActivity;
import butter.droid.tv.activities.TVPreferencesActivity;
import butter.droid.tv.activities.TVUpdateActivity;
import butter.droid.tv.activities.TVVideoPlayerActivity;
import butter.droid.tv.fragments.TVMediaGridFragment;
import butter.droid.tv.fragments.TVMovieDetailsFragment;
import butter.droid.tv.fragments.TVOverviewFragment;
import butter.droid.tv.fragments.TVPlaybackOverlayFragment;
import butter.droid.tv.fragments.TVShowDetailsFragment;
import butter.droid.tv.fragments.TVUpdateFragment;
import butter.droid.tv.fragments.TVVideoPlayerFragment;
import butter.droid.tv.service.RecommendationService;
import butter.droid.tv.service.recommendation.RecommendationContentProvider;
import butter.droid.tv.ui.about.TVAboutComponent;
import butter.droid.tv.ui.loading.TVStreamLoadingComponent;
import butter.droid.tv.ui.preferences.TVPreferencesComponent;
import butter.droid.tv.ui.search.TVSearchActivity;
import butter.droid.tv.ui.search.TVSearchComponent;
import butter.droid.tv.ui.terms.TVTermsActivity;
import butter.droid.tv.ui.terms.TVTermsComponent;
import butter.droid.tv.ui.trailer.TVTrailerPlayerComponent;
>>>>>>>
import butter.droid.base.BaseApplicationModule;
<<<<<<<
@Singleton @Component(
modules = BaseApplicationModule.class
)
=======
@Singleton @Component(modules = ApplicationModule.class)
>>>>>>>
@Singleton @Component(modules = BaseApplicationModule.class)
<<<<<<<
=======
void inject(TVButterApplication application);
void inject(TVMainActivity activity);
void inject(TVMediaDetailActivity activity);
void inject(TVMediaGridActivity activity);
void inject(TVPreferencesActivity activity);
void inject(TVSearchActivity activity);
void inject(TVUpdateActivity activity);
void inject(TVVideoPlayerActivity activity);
void inject(TVTermsActivity activity);
void inject(TVLaunchActivity activity);
void inject(RecommendationService service);
void inject(TVOverviewFragment fragment);
void inject(TVMovieDetailsFragment fragment);
void inject(TVMediaGridFragment fragment);
void inject(TVVideoPlayerFragment fragment);
void inject(TVPlaybackOverlayFragment fragment);
void inject(TVShowDetailsFragment fragment);
void inject(TVUpdateFragment fragment);
void inject(RecommendationContentProvider contentProvider);
TVPreferencesComponent.Builder preferencesComponentBuilder();
TVTermsComponent.Builder termsComponentBuilder();
TVAboutComponent.Builder aboutComponentBuilder();
TVStreamLoadingComponent.Builder streamLoadingComponentBuilder();
TVTrailerPlayerComponent.Builder tvTrailerPlayerComponentBuilder();
TVSearchComponent.Builder searchComponentBuilder();
>>>>>>> |
<<<<<<<
import androidx.annotation.Nullable;
=======
import android.support.annotation.Nullable;
import org.videolan.libvlc.LibVLC;
>>>>>>>
import androidx.annotation.Nullable;
import org.videolan.libvlc.LibVLC; |
<<<<<<<
PackageManager packageManager();
=======
ContentResolver contentResolver();
AudioManager audioManager();
WindowManager windowManager();
>>>>>>>
PackageManager packageManager();
ContentResolver contentResolver();
AudioManager audioManager();
WindowManager windowManager(); |
<<<<<<<
import com.afwsamples.testdpc.common.ProfileOrParentFragment;
=======
import com.afwsamples.testdpc.common.Util;
>>>>>>>
import com.afwsamples.testdpc.common.ProfileOrParentFragment;
import com.afwsamples.testdpc.common.Util; |
<<<<<<<
import jodd.http.HttpConnectionProvider;
import jodd.http.HttpRequest;
import jodd.http.HttpResponse;
import jodd.http.ProxyInfo;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
=======
>>>>>>>
<<<<<<<
import me.chanjar.weixin.common.util.http.apache.Utf8ResponseHandler;
import me.chanjar.weixin.common.util.http.okhttp.OkhttpProxyInfo;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
=======
>>>>>>>
<<<<<<<
import me.chanjar.weixin.mp.util.http.apache.ApacheMaterialVideoInfoRequestExecutor;
import me.chanjar.weixin.mp.util.http.jodd.JoddMaterialVideoInfoRequestExecutor;
import me.chanjar.weixin.mp.util.http.okhttp.OkhttpMaterialVideoInfoRequestExecutor;
import okhttp3.*;
import org.apache.http.HttpHost;
import org.apache.http.client.config.RequestConfig;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
=======
import me.chanjar.weixin.mp.util.http.apache.ApacheMaterialVideoInfoRequestExecutor;
import me.chanjar.weixin.mp.util.http.jodd.JoddMaterialVideoInfoRequestExecutor;
import me.chanjar.weixin.mp.util.http.okhttp.OkhttpMaterialVideoInfoRequestExecutor;
>>>>>>>
import me.chanjar.weixin.mp.util.http.apache.ApacheMaterialVideoInfoRequestExecutor;
import me.chanjar.weixin.mp.util.http.jodd.JoddMaterialVideoInfoRequestExecutor;
import me.chanjar.weixin.mp.util.http.okhttp.OkhttpMaterialVideoInfoRequestExecutor;
<<<<<<<
public abstract class MaterialVideoInfoRequestExecutor<H,P> implements RequestExecutor<WxMpMaterialVideoInfoResult, String> {
protected RequestHttp<H,P> requestHttp;
public MaterialVideoInfoRequestExecutor(RequestHttp requestHttp){
this.requestHttp =requestHttp;
}
public static RequestExecutor<WxMpMaterialVideoInfoResult, String> create(RequestHttp requestHttp){
switch (requestHttp.getRequestType()){
case apacheHttp:
return new ApacheMaterialVideoInfoRequestExecutor(requestHttp);
case joddHttp:
return new JoddMaterialVideoInfoRequestExecutor(requestHttp);
case okHttp:
return new OkhttpMaterialVideoInfoRequestExecutor(requestHttp);
default:
return null;
}
}
=======
public MaterialVideoInfoRequestExecutor(RequestHttp requestHttp) {
this.requestHttp = requestHttp;
}
public static RequestExecutor<WxMpMaterialVideoInfoResult, String> create(RequestHttp requestHttp) {
switch (requestHttp.getRequestType()) {
case apacheHttp:
return new ApacheMaterialVideoInfoRequestExecutor(requestHttp);
case joddHttp:
return new JoddMaterialVideoInfoRequestExecutor(requestHttp);
case okHttp:
return new OkhttpMaterialVideoInfoRequestExecutor(requestHttp);
default:
return null;
}
}
>>>>>>>
public MaterialVideoInfoRequestExecutor(RequestHttp requestHttp) {
this.requestHttp = requestHttp;
}
@Override
public WxMpMaterialVideoInfoResult executeJodd(HttpConnectionProvider provider, ProxyInfo proxyInfo, String uri, String materialId) throws WxErrorException, IOException {
HttpRequest request = HttpRequest.post(uri);
if (proxyInfo != null) {
provider.useProxy(proxyInfo);
}
} |
<<<<<<<
import de.slackspace.openkeepass.exception.KeePassDatabaseUnreadableException;
import de.slackspace.openkeepass.exception.KeePassDatabaseUnwriteableException;
=======
import de.slackspace.openkeepass.domain.enricher.IconEnricher;
import de.slackspace.openkeepass.exception.KeePassDatabaseUnreadable;
import de.slackspace.openkeepass.exception.KeePassDatabaseUnwriteable;
import de.slackspace.openkeepass.processor.DecryptionStrategy;
import de.slackspace.openkeepass.processor.EncryptionStrategy;
import de.slackspace.openkeepass.processor.ProtectedValueProcessor;
>>>>>>>
import de.slackspace.openkeepass.domain.enricher.IconEnricher;
import de.slackspace.openkeepass.exception.KeePassDatabaseUnreadableException;
import de.slackspace.openkeepass.exception.KeePassDatabaseUnwriteableException;
import de.slackspace.openkeepass.processor.DecryptionStrategy;
import de.slackspace.openkeepass.processor.EncryptionStrategy;
import de.slackspace.openkeepass.processor.ProtectedValueProcessor; |
<<<<<<<
import hudson.plugins.violations.types.perlcritic.PerlCriticDescriptor;
import hudson.plugins.violations.types.pmd.PMDDescriptor;
import hudson.plugins.violations.types.pylint.PyLintDescriptor;
import hudson.plugins.violations.types.resharper.ReSharperDescriptor;
import hudson.plugins.violations.types.simian.SimianDescriptor;
import hudson.plugins.violations.types.stylecop.StyleCopDescriptor;
import java.util.List;
import java.util.TreeMap;
=======
import hudson.plugins.violations.types.pyflakes.PyflakesDescriptor;
import hudson.plugins.violations.types.xmllint.XmllintDescriptor;
import hudson.plugins.violations.types.zptlint.ZptlintDescriptor;
>>>>>>>
import hudson.plugins.violations.types.perlcritic.PerlCriticDescriptor;
import hudson.plugins.violations.types.pmd.PMDDescriptor;
import hudson.plugins.violations.types.pyflakes.PyflakesDescriptor;
import hudson.plugins.violations.types.pylint.PyLintDescriptor;
import hudson.plugins.violations.types.resharper.ReSharperDescriptor;
import hudson.plugins.violations.types.simian.SimianDescriptor;
import hudson.plugins.violations.types.stylecop.StyleCopDescriptor;
import hudson.plugins.violations.types.xmllint.XmllintDescriptor;
import hudson.plugins.violations.types.zptlint.ZptlintDescriptor;
import java.util.List;
import java.util.TreeMap;
<<<<<<<
addDescriptor(PerlCriticDescriptor.DESCRIPTOR);
addDescriptor(ReSharperDescriptor.DESCRIPTOR);
=======
addDescriptor(PyflakesDescriptor.DESCRIPTOR);
addDescriptor(XmllintDescriptor.DESCRIPTOR);
addDescriptor(ZptlintDescriptor.DESCRIPTOR);
>>>>>>>
addDescriptor(PerlCriticDescriptor.DESCRIPTOR);
addDescriptor(ReSharperDescriptor.DESCRIPTOR);
addDescriptor(PyflakesDescriptor.DESCRIPTOR);
addDescriptor(XmllintDescriptor.DESCRIPTOR);
addDescriptor(ZptlintDescriptor.DESCRIPTOR); |
<<<<<<<
import hudson.model.AbstractBuild;
=======
import hudson.model.Result;
>>>>>>>
import hudson.model.Result;
import hudson.model.AbstractBuild;
<<<<<<<
import java.io.File;
import java.io.IOException;
=======
import hudson.plugins.violations.ViolationsReport.TypeReport;
import hudson.plugins.violations.hudson.ViolationsFreestyleDescriptor;
import hudson.tasks.BuildStepDescriptor;
>>>>>>>
import java.io.File;
import java.io.IOException;
<<<<<<<
return new ViolationsBuildAction(build, report);
=======
build.getActions().add(
new ViolationsBuildAction(build, report));
handleRatcheting(report, listener);
return true;
>>>>>>>
handleRatcheting(report, listener, config);
return new ViolationsBuildAction(build, report); |
<<<<<<<
super(x, y, z);
=======
this.x = x; this.y = y; this.z = z;
}
public Location(BlockPos from) {
this.x = from.getX(); this.y = from.getY(); this.z = from.getZ();
}
public double getX() {
return x;
}
public double getY() {
return y;
>>>>>>>
super(x, y, z);
<<<<<<<
public final void add(double x, double y, double z) {
=======
public void setY(double y) {
this.y = y;
}
public Location add(Location loc) {
x += loc.getX();
y += loc.getY();
z += loc.getZ();
return this;
}
public Location add(double x, double y, double z) {
>>>>>>>
public Location(Tuple3f t) {
super(t);
}
public Location(Tuple3i t) {
super(t.x, t.y, t.z);
}
// Convert from net.minecraft.util.math vectors (Don't import so the names aren't confusing)
public Location(net.minecraft.util.math.Vec3i v) {
super(v.getX(), v.getY(), v.getZ());
}
public Location(net.minecraft.util.math.Vec3d v) {
super(v.x, v.y, v.z);
}
public Location add(Point3d loc) {
x += loc.x;
y += loc.y;
z += loc.z;
return this;
}
public Location add(double x, double y, double z) {
<<<<<<<
public final void subtract(double amount) {
=======
public Location substract(double amount) {
>>>>>>>
public Location subtract(double amount) {
<<<<<<<
public final void multiply(double amount) {
=======
public Location multiply(double amount) {
>>>>>>>
public Location multiply(double amount) { |
<<<<<<<
/*
* Copyright (C) 2012-2019 52°North Initiative for Geospatial Open Source
=======
/**
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source
>>>>>>>
/*
* Copyright (C) 2012-2020 52°North Initiative for Geospatial Open Source |
<<<<<<<
"select count(*) from tag,tool_tag,tool where tool.registry = '" + Registry.QUAY_IO.getDockerPath()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithub' and tool.toolname IS NULL and tool.id=tool_tag.toolid and tag.id=tool_tag.tagid and valid = 'f'",
=======
"select count(*) from tag, tool where tool.registry = '" + Registry.QUAY_IO.toString()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithub' and tool.toolname IS NULL and tool.id=tag.parentid and valid = 'f'",
>>>>>>>
"select count(*) from tag, tool where tool.registry = '" + Registry.QUAY_IO.getDockerPath()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithub' and tool.toolname IS NULL and tool.id=tag.parentid and valid = 'f'",
<<<<<<<
"select count(*) from tag,tool_tag,tool where tool.registry = '" + Registry.QUAY_IO.getDockerPath()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithub' and tool.toolname = '' and tool.id=tool_tag.toolid and tag.id=tool_tag.tagid and valid = 'f'",
=======
"select count(*) from tag, tool where tool.registry = '" + Registry.QUAY_IO.toString()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithub' and tool.toolname = '' and tool.id=tag.parentid and valid = 'f'",
>>>>>>>
"select count(*) from tag, tool where tool.registry = '" + Registry.QUAY_IO.getDockerPath()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithub' and tool.toolname = '' and tool.id=tag.parentid and valid = 'f'",
<<<<<<<
"select count(*) from tag,tool_tag,tool where tool.registry = '" + Registry.QUAY_IO.getDockerPath()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithubwdl' and tool.toolname IS NULL and tool.id=tool_tag.toolid and tag.id=tool_tag.tagid and valid = 'f'",
=======
"select count(*) from tag, tool where tool.registry = '" + Registry.QUAY_IO.toString()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithubwdl' and tool.toolname IS NULL and tool.id=tag.parentid and valid = 'f'",
>>>>>>>
"select count(*) from tag, tool where tool.registry = '" + Registry.QUAY_IO.getDockerPath()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithubwdl' and tool.toolname IS NULL and tool.id=tag.parentid and valid = 'f'",
<<<<<<<
"select count(*) from tag,tool_tag,tool where tool.registry = '" + Registry.QUAY_IO.getDockerPath()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithubwdl' and tool.toolname IS NULL and tool.id=tool_tag.toolid and tag.id=tool_tag.tagid and valid = 'f'",
=======
"select count(*) from tag, tool where tool.registry = '" + Registry.QUAY_IO.toString()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithubwdl' and tool.toolname IS NULL and tool.id=tag.parentid and valid = 'f'",
>>>>>>>
"select count(*) from tag, tool where tool.registry = '" + Registry.QUAY_IO.getDockerPath()
+ "' and tool.namespace = 'dockstoretestuser2' and tool.name = 'quayandgithubwdl' and tool.toolname IS NULL and tool.id=tag.parentid and valid = 'f'", |
<<<<<<<
=======
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.ws.rs.DELETE;
>>>>>>>
import java.util.regex.Matcher;
import java.util.regex.Pattern;
<<<<<<<
@PUT
=======
@GET
@Path("/user/{userId}")
@Timed
@UnitOfWork
@ApiOperation(value = "List repos owned by the logged-in user", notes = "Lists all registered and unregistered containers owned by the user", response = Container.class, responseContainer = "List")
public List<Container> userContainers(@ApiParam(hidden = true) @Auth Token token,
@ApiParam(value = "User ID", required = true) @PathParam("userId") Long userId) {
User user = userDAO.findById(token.getUserId());
Helper.checkUser(user, userId);
List<Container> ownedContainers = containerDAO.findByUserId(userId);
return ownedContainers;
}
@GET
>>>>>>>
@GET
<<<<<<<
Helper.checkUser(authUser);
=======
Helper.checkUser(authUser, userId);
List<Container> currentRepos = containerDAO.findByUserId(userId);
List<Container> allRepos = new ArrayList<>(0);
List<Token> tokens = tokenDAO.findByUserId(userId);
Map<String, ArrayList> tagMap = new HashMap<>();
SimpleDateFormat formatter = new SimpleDateFormat("EEE, d MMM yyyy HH:mm:ss Z");
List<String> namespaceList = new ArrayList<>();
Token quayToken = null;
Token gitToken = null;
// Get user's quay and git tokens
for (Token token : tokens) {
if (token.getTokenSource().equals(TokenType.QUAY_IO.toString())) {
quayToken = token;
}
if (token.getTokenSource().equals(TokenType.GITHUB_COM.toString())) {
gitToken = token;
}
}
if (gitToken == null || quayToken == null) {
LOG.info("GIT or QUAY token not found!");
throw new WebApplicationException(HttpStatus.SC_CONFLICT);
}
namespaceList.add(quayToken.getUsername());
namespaceList.addAll(namespaces);
GitHubClient githubClient = new GitHubClient();
githubClient.setOAuth2Token(gitToken.getContent());
try {
UserService uService = new UserService(githubClient);
OrganizationService oService = new OrganizationService(githubClient);
RepositoryService service = new RepositoryService(githubClient);
ContentsService cService = new ContentsService(githubClient);
org.eclipse.egit.github.core.User user = uService.getUser();
// for (String namespace : namespaces) {
for (String namespace : namespaceList) {
String url = TARGET_URL + "repository?namespace=" + namespace;
Optional<String> asString = ResourceUtilities.asString(url, quayToken.getContent(), client);
if (asString.isPresent()) {
RepoList repos;
try {
repos = objectMapper.readValue(asString.get(), RepoList.class);
LOG.info("RESOURCE CALL: " + url);
List<Container> containers = repos.getRepositories();
for (Container c : containers) {
String repo = c.getNamespace() + "/" + c.getName();
String path = quayToken.getTokenSource() + "/" + repo;
// Get the list of builds from the container.
// Builds contain information such as the Git URL and tags
String urlBuilds = TARGET_URL + "repository/" + repo + "/build/";
Optional<String> asStringBuilds = ResourceUtilities.asString(urlBuilds, quayToken.getContent(), client);
String gitURL = "";
if (asStringBuilds.isPresent()) {
String json = asStringBuilds.get();
LOG.info("RESOURCE CALL: " + urlBuilds);
// parse json using Gson to get the git url of repository and the list of tags
Gson gson = new Gson();
Map<String, ArrayList> map = new HashMap<>();
map = (Map<String, ArrayList>) gson.fromJson(json, map.getClass());
ArrayList builds = map.get("builds");
if (!builds.isEmpty()) {
Map<String, Map<String, String>> map2 = new HashMap<>();
map2 = (Map<String, Map<String, String>>) builds.get(0);
gitURL = map2.get("trigger_metadata").get("git_url");
Map<String, String> map3 = (Map<String, String>) builds.get(0);
String lastBuild = (String) map3.get("started");
LOG.info("LAST BUILD: " + lastBuild);
Date date = null;
try {
date = formatter.parse(lastBuild);
c.setLastBuild(date);
} catch (ParseException ex) {
LOG.info("Build date did not match format 'EEE, d MMM yyyy HH:mm:ss Z'");
}
tagMap.put(path, (ArrayList<String>) map2.get("tags"));
}
}
c.setRegistry(quayToken.getTokenSource());
c.setGitUrl(gitURL);
List<Repository> gitRepos = new ArrayList<>(0);
gitRepos.addAll(service.getRepositories(user.getLogin()));
for (org.eclipse.egit.github.core.User org : oService.getOrganizations()) {
gitRepos.addAll(service.getRepositories(org.getLogin()));
}
for (Repository repository : gitRepos) {
LOG.info(repository.getSshUrl());
if (repository.getSshUrl().equals(c.getGitUrl())) {
try {
List<RepositoryContents> contents = null;
try {
contents = cService.getContents(repository, "Dockstore.cwl");
} catch (Exception e) {
contents = cService.getContents(repository, "dockstore.cwl");
LOG.error("Repo: " + repository.getName() + " has no Dockstore.cwl, trying dockstore.cwl");
}
if (!(contents == null || contents.isEmpty())) {
c.setHasCollab(true);
String encoded = contents.get(0).getContent().replace("\n", "");
byte[] decode = Base64.getDecoder().decode(encoded);
String content = new String(decode, StandardCharsets.UTF_8);
// parse the Dockstore.cwl file to get description and author
YamlReader reader = new YamlReader(content);
Object object = reader.read();
Map map = (Map) object;
String description = (String) map.get("description");
map = (Map) map.get("dct:creator");
String author = (String) map.get("foaf:name");
c.setDescription(description);
c.setAuthor(author);
LOG.error("Repo: " + repository.getName() + " has Dockstore.cwl");
} else {
LOG.error("Repo: " + repository.getName() + " has no Dockstore.cwl nor dockstore.cwl!!!");
}
} catch (IOException ex) {
LOG.error("Repo: " + repository.getName() + " has no Dockstore.cwl");
}
}
}
}
allRepos.addAll(containers);
} catch (IOException ex) {
LOG.info("Exception: " + ex);
}
}
}
} catch (IOException ex) {
LOG.info("Token ignored due to IOException: " + gitToken.getId() + " " + ex);
}
Date time = new Date();
for (Container newContainer : allRepos) {
boolean exists = false;
for (Container oldContainer : currentRepos) {
if (newContainer.getName().equals(oldContainer.getName())
&& newContainer.getNamespace().equals(oldContainer.getNamespace())
&& newContainer.getRegistry().equals(oldContainer.getRegistry())) {
exists = true;
oldContainer.update(newContainer);
break;
}
}
if (!exists) {
newContainer.setUserId(userId);
String path = newContainer.getRegistry() + "/" + newContainer.getNamespace() + "/" + newContainer.getName();
newContainer.setPath(path);
currentRepos.add(newContainer);
}
}
>>>>>>>
Helper.checkUser(authUser); |
<<<<<<<
private final CreateChange createChange;
=======
private final ChangeIndexer changeIndexer;
>>>>>>>
private final CreateChange createChange;
private final ChangeIndexer changeIndexer;
<<<<<<<
DynamicMap<RestView<ChangeResource>> views,
CreateChange createChange) {
=======
DynamicMap<RestView<ChangeResource>> views,
ChangeIndexer changeIndexer) {
>>>>>>>
DynamicMap<RestView<ChangeResource>> views,
CreateChange createChange,
ChangeIndexer changeIndexer) {
<<<<<<<
this.createChange = createChange;
=======
this.changeIndexer = changeIndexer;
>>>>>>>
this.createChange = createChange;
this.changeIndexer = changeIndexer; |
<<<<<<<
private static void search(java.util.List<String> args) {
=======
/**
* Display metadata describing the server including server version information
*/
private static void serverMetadata() {
try {
final Metadata metadata = ga4ghApi.toolsMetadataGet();
final Gson gson = io.cwl.avro.CWL.getTypeSafeCWLToolDocument();
out(gson.toJson(metadata));
} catch (ApiException ex) {
kill("Exception: " + ex);
}
}
private static void search(List<String> args) {
>>>>>>>
/**
* Display metadata describing the server including server version information
*/
private static void serverMetadata() {
try {
final Metadata metadata = ga4ghApi.toolsMetadataGet();
final Gson gson = io.cwl.avro.CWL.getTypeSafeCWLToolDocument();
out(gson.toJson(metadata));
} catch (ApiException ex) {
kill("Exception: " + ex);
}
}
private static void search(java.util.List<String> args) {
<<<<<<<
java.util.List<Container> containers = usersApi.userContainers(user.getId());
=======
// check user info after usage so that users can get usage without live webservice
User user = usersApi.getUser();
if (user == null) {
throw new RuntimeException("User not found");
}
List<Container> containers = usersApi.userContainers(user.getId());
>>>>>>>
// check user info after usage so that users can get usage without live webservice
User user = usersApi.getUser();
if (user == null) {
throw new RuntimeException("User not found");
}
java.util.List<Container> containers = usersApi.userContainers(user.getId());
<<<<<<<
final String descriptor = optVal(args, "--descriptor", "cwl");
final SourceFile descriptorFromServer = getDescriptorFromServer(entry, descriptor);
final File tempDescriptor = File.createTempFile("temp", ".cwl", Files.createTempDir());
Files.write(descriptorFromServer.getContent(), tempDescriptor, StandardCharsets.UTF_8);
if (descriptor.equals("cwl")) {
// need to suppress output
final ImmutablePair<String, String> output = cwl.parseCWL(tempDescriptor.getAbsolutePath(), true);
final Map<String, Object> stringObjectMap = cwl.extractRunJson(output.getLeft());
if (json) {
final Gson gson = CWL.getTypeSafeCWLToolDocument();
return gson.toJson(stringObjectMap);
} else {
// re-arrange as rows and columns
final Map<String, String> typeMap = cwl.extractCWLTypes(output.getLeft());
final java.util.List<String> headers = new ArrayList<>();
final java.util.List<String> types = new ArrayList<>();
final java.util.List<String> entries = new ArrayList<>();
for (final Entry<String, Object> objectEntry : stringObjectMap.entrySet()) {
headers.add(objectEntry.getKey());
types.add(typeMap.get(objectEntry.getKey()));
Object value = objectEntry.getValue();
if (value instanceof Map) {
Map map = (Map) value;
if (map.containsKey("class") && "File".equals(map.get("class"))) {
value = map.get("path");
}
=======
final SourceFile cwlFromServer = getCWLFromServer(entry);
final File tempCWL = File.createTempFile("temp", ".cwl", Files.createTempDir());
Files.write(cwlFromServer.getContent(), tempCWL, StandardCharsets.UTF_8);
// need to suppress output
final ImmutablePair<String, String> output = cwl.parseCWL(tempCWL.getAbsolutePath(), true);
final Map<String, Object> stringObjectMap = cwl.extractRunJson(output.getLeft());
if (json){
final Gson gson = io.cwl.avro.CWL.getTypeSafeCWLToolDocument();
return gson.toJson(stringObjectMap);
} else{
// re-arrange as rows and columns
final Map<String, String> typeMap = cwl.extractCWLTypes(output.getLeft());
final List<String> headers = new ArrayList<>();
final List<String> types = new ArrayList<>();
final List<String> entries = new ArrayList<>();
for(final Entry<String, Object> objectEntry : stringObjectMap.entrySet()){
headers.add(objectEntry.getKey());
types.add(typeMap.get(objectEntry.getKey()));
Object value = objectEntry.getValue();
if (value instanceof Map){
Map map = (Map)value;
if (map.containsKey("class") && "File".equals(map.get("class"))){
value = map.get("path");
>>>>>>>
final String descriptor = optVal(args, "--descriptor", CWL);
final SourceFile descriptorFromServer = getDescriptorFromServer(entry, descriptor);
final File tempDescriptor = File.createTempFile("temp", ".cwl", Files.createTempDir());
Files.write(descriptorFromServer.getContent(), tempDescriptor, StandardCharsets.UTF_8);
if (descriptor.equals(CWL)) {
// need to suppress output
final ImmutablePair<String, String> output = cwl.parseCWL(tempDescriptor.getAbsolutePath(), true);
final Map<String, Object> stringObjectMap = cwl.extractRunJson(output.getLeft());
if (json) {
final Gson gson = cwl.getTypeSafeCWLToolDocument();
return gson.toJson(stringObjectMap);
} else {
// re-arrange as rows and columns
final Map<String, String> typeMap = cwl.extractCWLTypes(output.getLeft());
final java.util.List<String> headers = new ArrayList<>();
final java.util.List<String> types = new ArrayList<>();
final java.util.List<String> entries = new ArrayList<>();
for (final Entry<String, Object> objectEntry : stringObjectMap.entrySet()) {
headers.add(objectEntry.getKey());
types.add(typeMap.get(objectEntry.getKey()));
Object value = objectEntry.getValue();
if (value instanceof Map) {
Map map = (Map) value;
if (map.containsKey("class") && "File".equals(map.get("class"))) {
value = map.get("path");
}
<<<<<<<
java.util.List<Container> containers = usersApi.refresh(user.getId());
=======
// check user info after usage so that users can get usage without live webservice
User user = usersApi.getUser();
if (user == null) {
throw new RuntimeException("User not found");
}
List<Container> containers = usersApi.refresh(user.getId());
>>>>>>>
// check user info after usage so that users can get usage without live webservice
User user = usersApi.getUser();
if (user == null) {
throw new RuntimeException("User not found");
}
java.util.List<Container> containers = usersApi.refresh(user.getId());
<<<<<<<
} catch (FileNotFoundException e) {
// e.printStackTrace();
=======
>>>>>>>
<<<<<<<
case "cwl":
descriptor(args, "cwl");
break;
case "wdl":
descriptor(args, "wdl");
=======
case CWL:
cwl(args);
>>>>>>>
case WDL:
descriptor(args, WDL);
case CWL:
descriptor(args, CWL); |
<<<<<<<
import io.swagger.annotations.ApiModelProperty;
=======
import io.swagger.annotations.ApiModelProperty;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
>>>>>>>
import io.swagger.annotations.ApiModelProperty;
import java.util.HashSet;
import java.util.Set;
<<<<<<<
@Column(columnDefinition="text")
@JsonProperty("dockerfile_path")
private String dockerfilePath = "/Dockerfile";
@Column(columnDefinition="text")
@JsonProperty("cwl_path")
private String cwlPath = "/Dockstore.cwl";
@Column
@ApiModelProperty("whether this row is visible to other users aside from the owner")
private boolean hidden;
// @ManyToOne(fetch = FetchType.LAZY)
// @JoinColumn(name = "containerid", nullable = false)
// private Container container;
//
// public Container getContainer() {
// return container;
// }
//
// public void setContainer(Container container) {
// this.container = container;
// }
=======
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinTable(name = "tagsourcefile", joinColumns = { @JoinColumn(name = "tagid", referencedColumnName = "id") }, inverseJoinColumns = { @JoinColumn(name = "sourcefileid", referencedColumnName = "id") })
@ApiModelProperty("Cached files for each tag. Includes Dockerfile and Dockstore.cwl.")
private Set<SourceFile> sourceFiles;
public Tag() {
this.sourceFiles = new HashSet<>(0);
}
>>>>>>>
@Column(columnDefinition="text")
@JsonProperty("dockerfile_path")
private String dockerfilePath = "/Dockerfile";
@Column(columnDefinition="text")
@JsonProperty("cwl_path")
private String cwlPath = "/Dockstore.cwl";
@OneToMany(fetch = FetchType.LAZY, orphanRemoval = true)
@JoinTable(name = "tagsourcefile", joinColumns = { @JoinColumn(name = "tagid", referencedColumnName = "id") }, inverseJoinColumns = { @JoinColumn(name = "sourcefileid", referencedColumnName = "id") })
@ApiModelProperty("Cached files for each tag. Includes Dockerfile and Dockstore.cwl.")
private Set<SourceFile> sourceFiles;
public Tag() {
this.sourceFiles = new HashSet<>(0);
}
@Column
@ApiModelProperty("whether this row is visible to other users aside from the owner")
private boolean hidden;
<<<<<<<
@JsonProperty
public String getDockerfilePath() {
return dockerfilePath;
}
public void setDockerfilePath(String dockerfilePath) {
this.dockerfilePath = dockerfilePath;
}
@JsonProperty
public String getCwlPath() {
return cwlPath;
}
public void setCwlPath(String cwlPath) {
this.cwlPath = cwlPath;
}
@JsonProperty
public boolean isHidden() {
return hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
@Override
public int compareTo(Tag o) {
return Long.compare(this.getId(),o.getId());
}
=======
public Set<SourceFile> getSourceFiles() {
return sourceFiles;
}
public void addSourceFile(SourceFile file) {
sourceFiles.add(file);
}
>>>>>>>
@JsonProperty
public String getDockerfilePath() {
return dockerfilePath;
}
public void setDockerfilePath(String dockerfilePath) {
this.dockerfilePath = dockerfilePath;
}
public Set<SourceFile> getSourceFiles() {
return sourceFiles;
}
public void addSourceFile(SourceFile file) {
sourceFiles.add(file);
}
@JsonProperty
public String getCwlPath() {
return cwlPath;
}
public void setCwlPath(String cwlPath) {
this.cwlPath = cwlPath;
}
@JsonProperty
public boolean isHidden() {
return hidden;
}
public void setHidden(boolean hidden) {
this.hidden = hidden;
}
@Override
public int compareTo(Tag o) {
return Long.compare(this.getId(),o.getId());
} |
<<<<<<<
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.ContentsService;
import org.eclipse.egit.github.core.service.RepositoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.ws.rs.WebApplicationException;
=======
>>>>>>>
<<<<<<<
import static io.dockstore.webservice.helpers.SourceCodeRepoInterface.FileResponse;
=======
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.ws.rs.WebApplicationException;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.RepositoryContents;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.ContentsService;
import org.eclipse.egit.github.core.service.OrganizationService;
import org.eclipse.egit.github.core.service.RepositoryService;
import org.eclipse.egit.github.core.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
>>>>>>>
import static io.dockstore.webservice.helpers.SourceCodeRepoInterface.FileResponse;
import javax.ws.rs.WebApplicationException;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.eclipse.egit.github.core.Repository;
import org.eclipse.egit.github.core.RepositoryContents;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.ContentsService;
import org.eclipse.egit.github.core.service.OrganizationService;
import org.eclipse.egit.github.core.service.RepositoryService;
import org.eclipse.egit.github.core.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; |
<<<<<<<
Criteria seriesCriteria = c.createCriteria(ContextualReferencedSeriesObservation.SERIES);
seriesCriteria.createCriteria(Series.PROCEDURE).add(Restrictions.eq(Procedure.IDENTIFIER, procedureIdentifier));
=======
Criteria seriesCriteria = c.createCriteria(SeriesObservationInfo.SERIES);
seriesCriteria.createCriteria(Series.PROCEDURE)
.add(Restrictions.eq(Procedure.IDENTIFIER, procedureIdentifier));
>>>>>>>
Criteria seriesCriteria = c.createCriteria(ContextualReferencedSeriesObservation.SERIES);
seriesCriteria.createCriteria(Series.PROCEDURE)
.add(Restrictions.eq(Procedure.IDENTIFIER, procedureIdentifier));
<<<<<<<
Criteria seriesCriteria = c.createCriteria(ContextualReferencedSeriesObservation.SERIES);
seriesCriteria.createCriteria(Series.OBSERVABLE_PROPERTY).add(Restrictions.eq(ObservableProperty.IDENTIFIER, observablePropertyIdentifier));
=======
Criteria seriesCriteria = c.createCriteria(SeriesObservationInfo.SERIES);
seriesCriteria.createCriteria(Series.OBSERVABLE_PROPERTY)
.add(Restrictions.eq(ObservableProperty.IDENTIFIER, observablePropertyIdentifier));
>>>>>>>
Criteria seriesCriteria = c.createCriteria(ContextualReferencedSeriesObservation.SERIES);
seriesCriteria.createCriteria(Series.OBSERVABLE_PROPERTY)
.add(Restrictions.eq(ObservableProperty.IDENTIFIER, observablePropertyIdentifier));
<<<<<<<
List<Object[]> results;
=======
List<OfferingTimeExtrema> results = null;
>>>>>>>
List<OfferingTimeExtrema> results = null;
<<<<<<<
public class OfferingTimeExtrema {
private DateTime minPhenomenonTime;
private DateTime maxPhenomenonTime;
private DateTime minResultTime;
private DateTime maxResultTime;
public DateTime getMinPhenomenonTime() {
return minPhenomenonTime;
}
public void setMinPhenomenonTime(DateTime minPhenomenonTime) {
this.minPhenomenonTime = minPhenomenonTime;
}
public DateTime getMaxPhenomenonTime() {
return maxPhenomenonTime;
}
public void setMaxPhenomenonTime(DateTime maxPhenomenonTime) {
this.maxPhenomenonTime = maxPhenomenonTime;
}
public DateTime getMinResultTime() {
return minResultTime;
}
public void setMinResultTime(DateTime minResultTime) {
this.minResultTime = minResultTime;
}
public DateTime getMaxResultTime() {
return maxResultTime;
}
public void setMaxResultTime(DateTime maxResultTime) {
this.maxResultTime = maxResultTime;
}
}
=======
/**
* Offering time extrema {@link ResultTransformer}
*
* @author <a href="mailto:[email protected]">Carsten Hollmann</a>
* @since 4.4.0
*
*/
private class OfferingeTimeTransformer implements ResultTransformer {
private static final long serialVersionUID = -373512929481519459L;
@Override
public OfferingTimeExtrema transformTuple(Object[] tuple, String[] aliases) {
OfferingTimeExtrema offeringTimeExtrema = new OfferingTimeExtrema();
if (tuple != null) {
offeringTimeExtrema.setOffering(tuple[0].toString());
offeringTimeExtrema.setMinPhenomenonTime(DateTimeHelper.makeDateTime(tuple[1]));
if (tuple.length == 6) {
DateTime maxPhenStart = DateTimeHelper.makeDateTime(tuple[2]);
DateTime maxPhenEnd = DateTimeHelper.makeDateTime(tuple[3]);
offeringTimeExtrema.setMaxPhenomenonTime(DateTimeHelper.max(maxPhenStart, maxPhenEnd));
offeringTimeExtrema.setMinResultTime(DateTimeHelper.makeDateTime(tuple[4]));
offeringTimeExtrema.setMaxResultTime(DateTimeHelper.makeDateTime(tuple[5]));
} else {
offeringTimeExtrema.setMaxPhenomenonTime(DateTimeHelper.makeDateTime(tuple[2]));
offeringTimeExtrema.setMinResultTime(DateTimeHelper.makeDateTime(tuple[3]));
offeringTimeExtrema.setMaxResultTime(DateTimeHelper.makeDateTime(tuple[4]));
}
}
return offeringTimeExtrema;
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List transformList(List collection) {
return collection;
}
}
>>>>>>>
/**
* Offering time extrema {@link ResultTransformer}
*
* @author <a href="mailto:[email protected]">Carsten Hollmann</a>
* @since 4.4.0
*
*/
private class OfferingeTimeTransformer implements ResultTransformer {
private static final long serialVersionUID = -373512929481519459L;
@Override
public OfferingTimeExtrema transformTuple(Object[] tuple, String[] aliases) {
OfferingTimeExtrema offeringTimeExtrema = new OfferingTimeExtrema();
if (tuple != null) {
offeringTimeExtrema.setOffering(tuple[0].toString());
offeringTimeExtrema.setMinPhenomenonTime(DateTimeHelper.makeDateTime(tuple[1]));
if (tuple.length == 6) {
DateTime maxPhenStart = DateTimeHelper.makeDateTime(tuple[2]);
DateTime maxPhenEnd = DateTimeHelper.makeDateTime(tuple[3]);
offeringTimeExtrema.setMaxPhenomenonTime(DateTimeHelper.max(maxPhenStart, maxPhenEnd));
offeringTimeExtrema.setMinResultTime(DateTimeHelper.makeDateTime(tuple[4]));
offeringTimeExtrema.setMaxResultTime(DateTimeHelper.makeDateTime(tuple[5]));
} else {
offeringTimeExtrema.setMaxPhenomenonTime(DateTimeHelper.makeDateTime(tuple[2]));
offeringTimeExtrema.setMinResultTime(DateTimeHelper.makeDateTime(tuple[3]));
offeringTimeExtrema.setMaxResultTime(DateTimeHelper.makeDateTime(tuple[4]));
}
}
return offeringTimeExtrema;
}
@Override
@SuppressWarnings({ "rawtypes", "unchecked" })
public List transformList(List collection) {
return collection;
}
} |
<<<<<<<
=======
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.codahale.metrics.annotation.Timed;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Charsets;
import com.google.common.base.Optional;
import com.google.common.hash.Hashing;
import com.google.common.io.BaseEncoding;
import com.google.gson.Gson;
>>>>>>>
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.codahale.metrics.annotation.Timed;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Charsets;
import com.google.common.base.Optional;
import com.google.common.hash.Hashing;
import com.google.common.io.BaseEncoding;
import com.google.gson.Gson;
<<<<<<<
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import javax.ws.rs.DELETE;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.codahale.metrics.annotation.Timed;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Charsets;
import com.google.common.base.Optional;
import com.google.common.hash.Hashing;
import com.google.common.io.BaseEncoding;
import com.google.gson.Gson;
=======
>>>>>>> |
<<<<<<<
import io.dockstore.webservice.core.ToolMode;
import io.dockstore.webservice.helpers.EntryLabelHelper;
import io.dockstore.webservice.helpers.EntryVersionHelper;
import io.dockstore.webservice.helpers.Helper;
import io.dockstore.webservice.api.RegisterRequest;
=======
import io.dockstore.webservice.Helper;
import io.dockstore.webservice.api.PublishRequest;
import io.dockstore.webservice.core.Tool;
import io.dockstore.webservice.core.ContainerMode;
>>>>>>>
import io.dockstore.webservice.core.ToolMode;
import io.dockstore.webservice.helpers.EntryLabelHelper;
import io.dockstore.webservice.api.PublishRequest;
import io.dockstore.webservice.helpers.EntryVersionHelper;
import io.dockstore.webservice.helpers.Helper;
<<<<<<<
@Path("/registered/{containerId}")
@ApiOperation(value = "Get a registered container", notes = "NO authentication", response = Tool.class)
public Tool getRegisteredContainer(@ApiParam(value = "Tool ID", required = true) @PathParam("containerId") Long containerId) {
Tool c = toolDAO.findRegisteredById(containerId);
Helper.checkEntry(c);
return entryVersionHelper.filterContainersForHiddenTags(c);
=======
@Path("/published/{containerId}")
@ApiOperation(value = "Get a published container", notes = "NO authentication", response = Tool.class)
public Tool getPublishedContainer(@ApiParam(value = "Tool ID", required = true) @PathParam("containerId") Long containerId) {
Tool c = toolDAO.findPublishedById(containerId);
Helper.checkContainer(c);
return this.filterContainersForHiddenTags(c);
>>>>>>>
@Path("/published/{containerId}")
@ApiOperation(value = "Get a published container", notes = "NO authentication", response = Tool.class)
public Tool getPublishedContainer(@ApiParam(value = "Tool ID", required = true) @PathParam("containerId") Long containerId) {
Tool c = toolDAO.findPublishedById(containerId);
Helper.checkEntry(c);
return entryVersionHelper.filterContainersForHiddenTags(c);
<<<<<<<
@Path("registered")
@ApiOperation(value = "List all registered containers.", tags = { "containers" }, notes = "NO authentication", response = Tool.class, responseContainer = "List")
public List<Tool> allRegisteredContainers() {
List<Tool> tools = toolDAO.findAllRegistered();
entryVersionHelper.filterContainersForHiddenTags(tools);
=======
@Path("published")
@ApiOperation(value = "List all published containers.", tags = { "containers" }, notes = "NO authentication", response = Tool.class, responseContainer = "List")
public List<Tool> allPublishedContainers() {
List<Tool> tools = toolDAO.findAllPublished();
filterContainersForHiddenTags(tools);
>>>>>>>
@Path("published")
@ApiOperation(value = "List all published containers.", tags = { "containers" }, notes = "NO authentication", response = Tool.class, responseContainer = "List")
public List<Tool> allPublishedContainers() {
List<Tool> tools = toolDAO.findAllPublished();
entryVersionHelper.filterContainersForHiddenTags(tools);
<<<<<<<
List<Tool> containers = toolDAO.findRegisteredByPath(path);
entryVersionHelper.filterContainersForHiddenTags(containers);
Helper.checkEntry(containers);
=======
List<Tool> containers = toolDAO.findPublishedByPath(path);
filterContainersForHiddenTags(containers);
Helper.checkContainer(containers);
>>>>>>>
List<Tool> containers = toolDAO.findPublishedByPath(path);
entryVersionHelper.filterContainersForHiddenTags(containers);
Helper.checkEntry(containers);
<<<<<<<
Tool tool = toolDAO.findRegisteredByToolPath(Joiner.on("/").join(split[0], split[1], split[2]), toolname);
Helper.checkEntry(tool);
=======
Tool tool = toolDAO.findPublishedByToolPath(Joiner.on("/").join(split[0], split[1], split[2]), toolname);
Helper.checkContainer(tool);
>>>>>>>
Tool tool = toolDAO.findPublishedByToolPath(Joiner.on("/").join(split[0], split[1], split[2]), toolname);
Helper.checkEntry(tool); |
<<<<<<<
workflow = workflowsApi.refresh(workflow.getId());
Assert.assertNotNull("Should have a license object even if it's null name", workflow.getLicenseInformation());
Assert.assertNull("Should have no license name", workflow.getLicenseInformation().getLicenseName());
=======
workflow = workflowsApi.refresh(workflow.getId(), false);
>>>>>>>
workflow = workflowsApi.refresh(workflow.getId(), false);
Assert.assertNotNull("Should have a license object even if it's null name", workflow.getLicenseInformation());
Assert.assertNull("Should have no license name", workflow.getLicenseInformation().getLicenseName()); |
<<<<<<<
=======
import java.util.Objects;
import java.util.concurrent.TimeoutException;
>>>>>>>
import java.util.Objects;
import java.util.concurrent.TimeoutException;
<<<<<<<
=======
@ClassRule
public static final DropwizardAppRule<DockstoreWebserviceConfiguration> RULE = new DropwizardAppRule<>(
DockstoreWebserviceApplication.class, ResourceHelpers.resourceFilePath("dockstoreTest.yml"));
private static final String DOCKSTORE_TEST_USER2_HELLO_DOCKSTORE_WORKFLOW = "DockstoreTestUser2/hello-dockstore-workflow";
private static final String DOCKSTORE_TEST_USER2_DOCKSTORE_WORKFLOW = "dockstore_testuser2/dockstore-workflow";
private static final String DOCKSTORE_TEST_USER2_IMPORTS_DOCKSTORE_WORKFLOW = "DockstoreTestUser2/dockstore-whalesay-imports";
private static final String DOCKSTORE_TEST_USER2_RELATIVE_IMPORTS_WORKFLOW = "DockstoreTestUser2/dockstore_workflow_cnv";
private static final String DOCKSTORE_TEST_USER2_RELATIVE_IMPORTS_TOOL = "DockstoreTestUser2/dockstore-cgpmap";
>>>>>>>
private static final String DOCKSTORE_TEST_USER2_RELATIVE_IMPORTS_TOOL = "DockstoreTestUser2/dockstore-cgpmap"; |
<<<<<<<
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.ws.rs.WebApplicationException;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.ContentsService;
import org.eclipse.egit.github.core.service.RepositoryService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
=======
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.ws.rs.WebApplicationException;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.Optional;
import com.google.gson.Gson;
import io.dockstore.webservice.core.Container;
import io.dockstore.webservice.core.SourceFile;
import io.dockstore.webservice.core.SourceFile.FileType;
import io.dockstore.webservice.core.Tag;
import io.dockstore.webservice.core.Token;
import io.dockstore.webservice.core.TokenType;
import io.dockstore.webservice.core.User;
import io.dockstore.webservice.helpers.ImageRegistryFactory;
import io.dockstore.webservice.helpers.ImageRegistryInterface;
import io.dockstore.webservice.helpers.SourceCodeRepoFactory;
import io.dockstore.webservice.helpers.SourceCodeRepoInterface;
import io.dockstore.webservice.helpers.SourceCodeRepoInterface.FileResponse;
import io.dockstore.webservice.jdbi.ContainerDAO;
import io.dockstore.webservice.jdbi.FileDAO;
import io.dockstore.webservice.jdbi.TagDAO;
import io.dockstore.webservice.jdbi.TokenDAO;
import io.dockstore.webservice.jdbi.UserDAO;
import io.dockstore.webservice.resources.ResourceUtilities;
>>>>>>>
import java.io.UnsupportedEncodingException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import javax.ws.rs.WebApplicationException;
import org.apache.http.HttpStatus;
import org.apache.http.client.HttpClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
<<<<<<<
if (ref == null) {
tag.setAutomated(false);
} else {
tag.setAutomated(true);
}
FileResponse cwlResponse = readGitRepositoryFile(c, DOCKSTORE_CWL, client, tag, githubRepositoryService,
githubContentsService, bitbucketToken);
=======
FileResponse cwlResponse = readGitRepositoryFile(c, DOCKSTORE_CWL, client, tag, bitbucketToken, githubToken);
>>>>>>>
if (ref == null) {
tag.setAutomated(false);
} else {
tag.setAutomated(true);
}
FileResponse cwlResponse = readGitRepositoryFile(c, DOCKSTORE_CWL, client, tag, bitbucketToken, githubToken); |
<<<<<<<
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
//import java.lang.reflect.Array;
import java.util.List;
import java.util.Map;
import javax.ws.rs.DELETE;
//import java.util.Map;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import org.apache.http.HttpStatus;
=======
>>>>>>>
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap;
//import java.lang.reflect.Array;
import java.util.List;
import java.util.Map;
import javax.ws.rs.DELETE;
//import java.util.Map;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.PUT;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import org.apache.http.HttpStatus;
<<<<<<<
import com.esotericsoftware.yamlbeans.YamlReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
=======
>>>>>>>
import com.esotericsoftware.yamlbeans.YamlReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
<<<<<<<
@ApiOperation(value = "List all repos known cached in database", notes = "List docker container repos currently known. "
=======
@ApiOperation(value = "List all registered docker containers known via all registered tokens", notes = "List docker container repos currently known. "
>>>>>>>
@ApiOperation(value = "List all registered docker containers cached in database", notes = "List docker container repos currently known. "
<<<<<<<
@Path("allRegistered")
@ApiOperation(value = "List all registered containers", notes = "", response = Container.class, responseContainer = "List")
public List<Container> allRegisteredContainers() {
List<Container> repositories = containerDAO.findAllRegistered();
=======
@Path("getAllRegisteredContainers")
@ApiOperation(value = "List all registered containers. This would be a minimal resource that would need to be implemented "
+ "by a GA4GH reference server", tags={"GA4GH","docker.repo"}, notes = "", response = Container.class, responseContainer = "List")
public List<Container> getAllRegisteredContainers() {
List<Container> repositories = containerDAO.findAll();
>>>>>>>
@Path("allRegistered")
@ApiOperation(value = "List all registered containers. This would be a minimal resource that would need to be implemented "
+ "by a GA4GH reference server", tags = { "GA4GH", "docker.repo" }, notes = "", response = Container.class, responseContainer = "List")
public List<Container> allRegisteredContainers() {
List<Container> repositories = containerDAO.findAllRegistered();
<<<<<<<
@Path("/search")
@ApiOperation(value = "Search for matching registered containers", notes = "Search on the name (full path name) and description.", response = Container.class, responseContainer = "List")
public List<Container> search(@QueryParam("pattern") String word) {
=======
@Path("/searchContainers")
@ApiOperation(value = "Search for matching registered containers."
+ " This would be a minimal resource that would need to be implemented by a GA4GH reference server",
notes = "Search on the name (full path name) and description.", response = Container.class,
responseContainer = "List", tags={"GA4GH","docker.repo"})
public List<Container> searchContainers(@QueryParam("pattern") String word) {
>>>>>>>
@Path("/search")
@ApiOperation(value = "Search for matching registered containers."
+ " This would be a minimal resource that would need to be implemented by a GA4GH reference server", notes = "Search on the name (full path name) and description.", response = Container.class, responseContainer = "List", tags = {
"GA4GH", "docker.repo" })
public List<Container> search(@QueryParam("pattern") String word) { |
<<<<<<<
@ApiModelProperty("This image has a Dockstore.cwl associated with it")
private boolean validTrigger;
=======
@ApiModelProperty("Implementation specific, this image has a Dockstore.cwl associated with it")
private boolean hasCollab;
>>>>>>>
@ApiModelProperty("Implementation specific, this image has a Dockstore.cwl associated with it")
private boolean validTrigger; |
<<<<<<<
update.commit();
CheckedFuture<?, IOException> indexFuture =
indexer.indexAsync(change.getId());
=======
indexer.index(db, change);
>>>>>>>
update.commit();
indexer.index(db, change); |
<<<<<<<
@Override
public int hashCode() {
return Objects.hash(id, username);
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final User other = (User) obj;
if (this.id != other.id) {
return false;
}
if (!Objects.equals(this.username, other.username)) {
return false;
}
if (this.isAdmin != other.isAdmin) {
return false;
}
if (!Objects.equals(this.groups, other.groups)) {
return false;
}
return true;
}
=======
public Set<Container> getContainers() {
return this.containers;
}
public void addContainer(Container container) {
containers.add(container);
}
public boolean removeContainer(Container container) {
return containers.remove(container);
}
>>>>>>>
public Set<Container> getContainers() {
return this.containers;
}
public void addContainer(Container container) {
containers.add(container);
}
public boolean removeContainer(Container container) {
return containers.remove(container);
}
@Override
public int hashCode() {
return Objects.hash(id, username);
}
@Override
public boolean equals(Object obj) {
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
final User other = (User) obj;
if (this.id != other.id) {
return false;
}
if (!Objects.equals(this.username, other.username)) {
return false;
}
if (this.isAdmin != other.isAdmin) {
return false;
}
if (!Objects.equals(this.groups, other.groups)) {
return false;
}
return true;
} |
<<<<<<<
// do not re-create tags with manual mode
// with other types, you can re-create the tags on refresh
container.getTags().clear();
List<Tag> tags = tagMap.get(container.getPath());
if (tags != null) {
for (Tag tag : tags) {
tag.getSourceFiles().forEach(fileDAO::create);
long tagId = tagDAO.create(tag);
tag = tagDAO.findById(tagId);
container.addTag(tag);
}
}
LOG.info("UPDATED Container: " + container.getPath());
=======
// updateTags(container, tagDAO, fileDAO, tagMap);
LOG.info("UPDATED Container: " + container.getPath());
>>>>>>>
// do not re-create tags with manual mode
// with other types, you can re-create the tags on refresh
LOG.info("UPDATED Container: " + container.getPath());
<<<<<<<
} else if (c.getMode() == ContainerMode.MANUAL_IMAGE_PATH){
for(final Tag tag : c.getTags()){
loadFilesIntoTag(client, bitbucketToken, githubToken, c, tag);
}
// we do not need to load tags from the DB into tagMap, used only for mixed and auto-detect modes
=======
} else if (c.getMode() == ContainerMode.MANUAL_IMAGE_PATH) {
// for (final Tag tag : c.getTags()) {
// loadFilesIntoTag(client, bitbucketToken, githubToken, c, tag);
// }
// TODO: this assumes paths are unique, not sure this will hold anymore
final List<Tag> currentList = tagMap.getOrDefault(c.getPath(), new ArrayList<>());
currentList.addAll(Lists.newArrayList(c.getTags()));
tagMap.put(c.getPath(), currentList);
>>>>>>> |
<<<<<<<
String shortMsg = commit.getShortMessage();
if (shortMsg.startsWith(CHANGE_ID_PREFIX)
&& CHANGE_ID
.matcher(shortMsg.substring(CHANGE_ID_PREFIX.length()).trim())
.matches()) {
String errMsg = String.format(MISSING_SUBJECT_MSG, sha1);
throw new CommitValidationException(errMsg);
}
=======
>>>>>>> |
<<<<<<<
import com.google.gerrit.extensions.registration.DynamicMap;
=======
import com.google.gerrit.extensions.common.AccountInfo;
>>>>>>>
import com.google.gerrit.extensions.common.AccountInfo;
import com.google.gerrit.extensions.registration.DynamicMap; |
<<<<<<<
@NamedQuery(name = "io.dockstore.webservice.core.Tool.findRegisteredByPath", query = "SELECT c FROM Tool c WHERE c.path = :path AND c.isRegistered = true"),
@NamedQuery(name = "io.dockstore.webservice.core.Tool.searchPattern", query = "SELECT c FROM Tool c WHERE ((c.path LIKE :pattern) OR (c.registry LIKE :pattern) OR (c.description LIKE :pattern)) AND c.isRegistered = true") })
public class Tool extends Entry<Tool, Tag> {
=======
@NamedQuery(name = "io.dockstore.webservice.core.Tool.findPublishedByPath", query = "SELECT c FROM Tool c WHERE c.path = :path AND c.isPublished = true"),
@NamedQuery(name = "io.dockstore.webservice.core.Tool.searchPattern", query = "SELECT c FROM Tool c WHERE ((c.path LIKE :pattern) OR (c.registry LIKE :pattern) OR (c.description LIKE :pattern)) AND c.isPublished = true") })
public class Tool extends Entry {
>>>>>>>
@NamedQuery(name = "io.dockstore.webservice.core.Tool.findPublishedByPath", query = "SELECT c FROM Tool c WHERE c.path = :path AND c.isPublished = true"),
@NamedQuery(name = "io.dockstore.webservice.core.Tool.searchPattern", query = "SELECT c FROM Tool c WHERE ((c.path LIKE :pattern) OR (c.registry LIKE :pattern) OR (c.description LIKE :pattern)) AND c.isPublished = true") })
public class Tool extends Entry<Tool, Tag> { |
<<<<<<<
=======
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.net.URI;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
>>>>>>>
<<<<<<<
AmazonS3 s3Client = FileProvisioning.getAmazonS3Client(config);
String trimmedPath = destPath.replace("s3://", "");
List<String> splitPathList = Lists.newArrayList(trimmedPath.split("/"));
String bucketName = splitPathList.remove(0);
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, Joiner.on("/").join(splitPathList), sourceFile);
putObjectRequest.setGeneralProgressListener(new ProgressListener() {
ProgressPrinter printer = new ProgressPrinter();
long runningTotal = 0;
@Override
public void progressChanged(ProgressEvent progressEvent) {
if (progressEvent.getEventType() == ProgressEventType.REQUEST_BYTE_TRANSFER_EVENT) {
runningTotal += progressEvent.getBytesTransferred();
}
printer.handleProgress(runningTotal, inputSize);
}
});
try {
s3Client.putObject(putObjectRequest);
} finally {
System.out.println();
}
=======
uploadToS3(destPath, sourceFile);
>>>>>>>
AmazonS3 s3Client = FileProvisioning.getAmazonS3Client(config);
String trimmedPath = destPath.replace("s3://", "");
List<String> splitPathList = Lists.newArrayList(trimmedPath.split("/"));
String bucketName = splitPathList.remove(0);
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, Joiner.on("/").join(splitPathList), sourceFile);
putObjectRequest.setGeneralProgressListener(new ProgressListener() {
ProgressPrinter printer = new ProgressPrinter();
long runningTotal = 0;
@Override
public void progressChanged(ProgressEvent progressEvent) {
if (progressEvent.getEventType() == ProgressEventType.REQUEST_BYTE_TRANSFER_EVENT) {
runningTotal += progressEvent.getBytesTransferred();
}
printer.handleProgress(runningTotal, inputSize);
}
});
try {
s3Client.putObject(putObjectRequest);
} finally {
System.out.println();
}
<<<<<<<
/**
* Copy from stream to stream while displaying progress
*
* @param inputStream source
* @param inputSize total size
* @param outputSteam destination
* @throws IOException throws an exception if unable to provision input files
*/
private static void copyFromInputStreamToOutputStream(InputStream inputStream, long inputSize, OutputStream outputSteam)
throws IOException {
CopyStreamListener listener = new CopyStreamListener() {
ProgressPrinter printer = new ProgressPrinter();
@Override
public void bytesTransferred(CopyStreamEvent event) {
/* do nothing */
}
@Override
public void bytesTransferred(long totalBytesTransferred, int bytesTransferred, long streamSize) {
printer.handleProgress(totalBytesTransferred, streamSize);
}
};
try (OutputStream outputStream = outputSteam) {
Util.copyStream(inputStream, outputStream, Util.DEFAULT_COPY_BUFFER_SIZE, inputSize, listener);
} catch (IOException e) {
throw new RuntimeException("Could not provision input files", e);
} finally {
IOUtils.closeQuietly(inputStream);
System.out.println();
}
}
=======
private void uploadToS3(String destPath, File sourceFile) {
long inputSize = sourceFile.length();
AmazonS3 s3Client = FileProvisioning.getAmazonS3Client(config);
TransferManager tx = TransferManagerBuilder.standard().withS3Client(s3Client).build();
String trimmedPath = destPath.replace("s3://", "");
List<String> splitPathList = Lists.newArrayList(trimmedPath.split("/"));
String bucketName = splitPathList.remove(0);
PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, Joiner.on("/").join(splitPathList), sourceFile);
putObjectRequest.setGeneralProgressListener(getProgressListener(inputSize));
try {
Upload upload = tx.upload(putObjectRequest);
upload.waitForUploadResult();
} catch (InterruptedException e) {
throw new RuntimeException(e);
} finally{
tx.shutdownNow(true);
System.out.println();
}
}
private ProgressListener getProgressListener(final long inputSize) {
return new ProgressListener() {
ProgressPrinter printer = new ProgressPrinter();
long runningTotal = 0;
@Override public void progressChanged(ProgressEvent progressEvent) {
if (progressEvent.getEventType() == ProgressEventType.REQUEST_BYTE_TRANSFER_EVENT){
runningTotal += progressEvent.getBytesTransferred();
}
printer.handleProgress(runningTotal, inputSize);
}
};
}
>>>>>>>
/**
* Copy from stream to stream while displaying progress
*
* @param inputStream source
* @param inputSize total size
* @param outputSteam destination
* @throws IOException throws an exception if unable to provision input files
*/
private static void copyFromInputStreamToOutputStream(InputStream inputStream, long inputSize, OutputStream outputSteam)
throws IOException {
CopyStreamListener listener = new CopyStreamListener() {
ProgressPrinter printer = new ProgressPrinter();
@Override
public void bytesTransferred(CopyStreamEvent event) {
/* do nothing */
}
@Override
public void bytesTransferred(long totalBytesTransferred, int bytesTransferred, long streamSize) {
printer.handleProgress(totalBytesTransferred, streamSize);
}
};
try (OutputStream outputStream = outputSteam) {
Util.copyStream(inputStream, outputStream, Util.DEFAULT_COPY_BUFFER_SIZE, inputSize, listener);
} catch (IOException e) {
throw new RuntimeException("Could not provision input files", e);
} finally {
IOUtils.closeQuietly(inputStream);
System.out.println();
}
}
<<<<<<<
=======
/**
* Copy from stream to stream while displaying progress
*
* @param inputStream source
* @param inputSize total size
* @param outputSteam destination
* @throws IOException throws an exception if unable to provision input files
*/
private static void copyFromInputStreamToOutputStream(InputStream inputStream, long inputSize, OutputStream outputSteam)
throws IOException {
CopyStreamListener listener = new CopyStreamListener() {
ProgressPrinter printer = new ProgressPrinter();
@Override public void bytesTransferred(CopyStreamEvent event) {
/* do nothing */
}
@Override public void bytesTransferred(long totalBytesTransferred, int bytesTransferred, long streamSize) {
printer.handleProgress(totalBytesTransferred, streamSize);
}
};
try (OutputStream outputStream = outputSteam) {
// a larger buffer improves copy performance
// we can also split this (local file copy) out into a plugin later
final int largeBuffer = 100;
Util.copyStream(inputStream, outputStream, Util.DEFAULT_COPY_BUFFER_SIZE*largeBuffer, inputSize, listener);
} catch (IOException e) {
throw new RuntimeException("Could not provision input files", e);
} finally {
IOUtils.closeQuietly(inputStream);
System.out.println();
}
}
>>>>>>> |
<<<<<<<
@Inject @ServerInitiated protected Provider<GroupsUpdate> groupsUpdateProvider;
@Inject protected GroupIndexCollection indexes;
=======
protected Injector injector;
>>>>>>>
@Inject @ServerInitiated protected Provider<GroupsUpdate> groupsUpdateProvider;
@Inject protected GroupIndexCollection indexes;
<<<<<<<
setUpDatabase();
}
@After
public void cleanUp() {
lifecycle.stop();
db.close();
}
protected void setUpDatabase() throws Exception {
=======
initAfterLifecycleStart();
>>>>>>>
initAfterLifecycleStart();
setUpDatabase();
}
@After
public void cleanUp() {
lifecycle.stop();
db.close();
}
protected void setUpDatabase() throws Exception {
<<<<<<<
=======
@After
public void cleanUp() {
lifecycle.stop();
db.close();
}
protected void initAfterLifecycleStart() throws Exception {}
>>>>>>>
protected void initAfterLifecycleStart() throws Exception {} |
<<<<<<<
public ByteBuf decode(ByteBufQueue bufs) throws MalformedDataException {
if (shouldReadHeader) {
=======
public ByteBuf decode(ByteBufQueue bufs) throws ParseException {
if (readingHeader) {
>>>>>>>
public ByteBuf decode(ByteBufQueue bufs) throws MalformedDataException {
if (readingHeader) {
<<<<<<<
/*
Using 'check' as an accumulator as it will be set last.
4 bytes in queue are asserted before call, hence warning suppression
*/
@SuppressWarnings("ConstantConditions")
private int readIntLE(ByteBufQueue bufs) throws MalformedDataException {
check = 0;
return bufs.decodeBytes((index, nextByte) -> {
check |= (nextByte & 0xFF) << 8 * index;
return index == 3 ? check : null;
});
=======
private int readInt(ByteBufQueue bufs) throws ParseException {
bufs.consumeBytes(intLEScanner);
return intLEScanner.value;
>>>>>>>
private int readInt(ByteBufQueue bufs) throws MalformedDataException {
bufs.consumeBytes(intLEScanner);
return intLEScanner.value; |
<<<<<<<
import cpw.mods.modlauncher.api.ITransformingClassLoader;
import io.izzel.arclight.api.ArclightVersion;
import org.apache.logging.log4j.LogManager;
=======
import cpw.mods.modlauncher.api.ITransformingClassLoader;
import io.izzel.arclight.common.mod.util.log.ArclightI18nLogger;
import io.izzel.arclight.i18n.ArclightConfig;
>>>>>>>
import cpw.mods.modlauncher.api.ITransformingClassLoader;
import io.izzel.arclight.api.ArclightVersion;
import cpw.mods.modlauncher.api.ITransformingClassLoader;
import io.izzel.arclight.common.mod.util.log.ArclightI18nLogger;
import io.izzel.arclight.i18n.ArclightConfig;
<<<<<<<
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.List;
=======
import java.util.Arrays;
import java.util.List;
>>>>>>>
import java.util.Arrays;
import java.util.List;
<<<<<<<
public static final Logger LOGGER = LogManager.getLogger("Arclight");
private static final List<String> FILTER_PACKAGE = Arrays.asList("com.google.common", "com.google.gson", "ninja.leaping.configurate", "io.izzel.arclight.api");
=======
public static final Logger LOGGER = ArclightI18nLogger.getLogger("Arclight");
private static final List<String> FILTER_PACKAGE = Arrays.asList("com.google.common", "com.google.gson", "ninja.leaping.configurate");
>>>>>>>
public static final Logger LOGGER = ArclightI18nLogger.getLogger("Arclight");
private static final List<String> FILTER_PACKAGE = Arrays.asList("com.google.common", "com.google.gson", "ninja.leaping.configurate", "io.izzel.arclight.api");
<<<<<<<
if (ArclightVersion.atLeast(ArclightVersion.v1_15)) {
Mixins.addConfiguration("mixins.arclight.core.1_15.json");
}
LOGGER.info("Arclight core mixin added.");
ArclightConfig.init(Paths.get("arclight.yml"));
=======
LOGGER.info("mixin-load.core");
Mixins.addConfiguration("mixins.arclight.optimization.json");
if (ArclightConfig.spec().getOptimization().isRemoveStream()) {
Mixins.addConfiguration("mixins.arclight.optimization.stream.json");
}
LOGGER.info("mixin-load.optimization");
>>>>>>>
if (ArclightVersion.atLeast(ArclightVersion.v1_15)) {
Mixins.addConfiguration("mixins.arclight.core.1_15.json");
}
LOGGER.info("mixin-load.core"); |
<<<<<<<
/**
* Given a symmetric matrix which is represented by a lower triangular matrix convert it back into
* a full symmetric matrix.
*
* @param A (Input) Lower triangular matrix (Output) symmetric matrix
*/
public static void symmLowerToFull( DMatrixRMaj A )
{
if( A.numRows != A.numCols )
throw new MatrixDimensionException("Must be a square matrix");
final int cols = A.numCols;
for (int row = 0; row < A.numRows; row++) {
for (int col = row+1; col < cols; col++) {
A.data[row*cols+col] = A.data[col*cols+row];
}
}
}
/**
* Given a symmetric matrix which is represented by a lower triangular matrix convert it back into
* a full symmetric matrix.
*
* @param A (Input) Lower triangular matrix (Output) symmetric matrix
*/
public static void symmUpperToFull( DMatrixRMaj A )
{
if( A.numRows != A.numCols )
throw new MatrixDimensionException("Must be a square matrix");
final int cols = A.numCols;
for (int row = 0; row < A.numRows; row++) {
for (int col = 0; col <= row; col++) {
A.data[row*cols+col] = A.data[col*cols+row];
}
}
}
=======
/**
* <p>Performs absolute value of a matrix:<br>
* <br>
* c = abs(a)<br>
* c<sub>ij</sub> = abs(a<sub>ij</sub>)
* </p>
*
* @param a A matrix. Not modified.
* @param c A matrix. Modified.
*/
public static void abs(DMatrixD1 a , DMatrixD1 c ) {
c.reshape(a.numRows,a.numCols);
final int length = a.getNumElements();
for ( int i = 0; i < length; i++ ) {
c.data[i] = Math.abs(a.data[i]);
}
}
/**
* <p>Performs absolute value of a matrix:<br>
* <br>
* a = abs(a)<br>
* a<sub>ij</sub> = abs(a<sub>ij</sub>)
* </p>
*
* @param a A matrix. Modified.
*/
public static void abs(DMatrixD1 a ) {
final int length = a.getNumElements();
for ( int i = 0; i < length; i++ ) {
a.data[i] = Math.abs(a.data[i]);
}
}
>>>>>>>
/**
* <p>Performs absolute value of a matrix:<br>
* <br>
* c = abs(a)<br>
* c<sub>ij</sub> = abs(a<sub>ij</sub>)
* </p>
*
* @param a A matrix. Not modified.
* @param c A matrix. Modified.
*/
public static void abs(DMatrixD1 a , DMatrixD1 c ) {
c.reshape(a.numRows,a.numCols);
final int length = a.getNumElements();
for ( int i = 0; i < length; i++ ) {
c.data[i] = Math.abs(a.data[i]);
}
}
/**
* <p>Performs absolute value of a matrix:<br>
* <br>
* a = abs(a)<br>
* a<sub>ij</sub> = abs(a<sub>ij</sub>)
* </p>
*
* @param a A matrix. Modified.
*/
public static void abs(DMatrixD1 a ) {
final int length = a.getNumElements();
for ( int i = 0; i < length; i++ ) {
a.data[i] = Math.abs(a.data[i]);
}
}
/**
* Given a symmetric matrix which is represented by a lower triangular matrix convert it back into
* a full symmetric matrix.
*
* @param A (Input) Lower triangular matrix (Output) symmetric matrix
*/
public static void symmLowerToFull( DMatrixRMaj A )
{
if( A.numRows != A.numCols )
throw new MatrixDimensionException("Must be a square matrix");
final int cols = A.numCols;
for (int row = 0; row < A.numRows; row++) {
for (int col = row+1; col < cols; col++) {
A.data[row*cols+col] = A.data[col*cols+row];
}
}
}
/**
* Given a symmetric matrix which is represented by a lower triangular matrix convert it back into
* a full symmetric matrix.
*
* @param A (Input) Lower triangular matrix (Output) symmetric matrix
*/
public static void symmUpperToFull( DMatrixRMaj A )
{
if( A.numRows != A.numCols )
throw new MatrixDimensionException("Must be a square matrix");
final int cols = A.numCols;
for (int row = 0; row < A.numRows; row++) {
for (int col = 0; col <= row; col++) {
A.data[row*cols+col] = A.data[col*cols+row];
}
}
} |
<<<<<<<
// ex: <path>system/pentaho-cdf-dd/resources/custom/components</path>
if(path.startsWith(CdeEnvironment.getPluginId())){
=======
//ex: <path>system/pentaho-cdf-dd/resources/custom/components</path>
if(path.startsWith(CdeEnvironment.getPluginId() + "/")){
>>>>>>>
// ex: <path>system/pentaho-cdf-dd/resources/custom/components</path>
if(path.startsWith(CdeEnvironment.getPluginId() + "/")){
<<<<<<<
if (CdeEnvironment.getPluginSystemReader().fileExists(path) && CdeEnvironment.getPluginSystemReader().fetchFile(path).isDirectory()) {
componentAccesses.add(CdeEnvironment.getPluginSystemReader(path));
}
} else {
//XXX this isn't supposed to happen
// ex: <path>system/cdc/cdeComponents</path>
String pluginId = path.substring(0, path.indexOf("/"));
path = path.replaceFirst(pluginId + "/", "");
if (CdeEnvironment.getOtherPluginSystemReader(pluginId).fileExists(path) && CdeEnvironment.getOtherPluginSystemReader(pluginId).fetchFile(path).isDirectory()) {
componentAccesses.add(CdeEnvironment.getOtherPluginSystemReader(pluginId, path));
}
}
} else if (path.startsWith(CdeEnvironment.getPluginRepositoryDir())) {
// ex: <path>cde/components</path>
path = path.replaceFirst(CdeEnvironment.getPluginRepositoryDir() + "/", "");
if (CdeEnvironment.getPluginSystemReader().fileExists(path) && CdeEnvironment.getPluginSystemReader().fetchFile(path).isDirectory()) {
componentAccesses.add(CdeEnvironment.getPluginRepositoryReader(path));
}
} else {
logger.warn("Components directory '" + element.getText() + "' was not found.");
}
=======
if(CdeEnvironment.getPluginSystemReader().fileExists(path) && CdeEnvironment.getPluginSystemReader().fetchFile(path).isDirectory()){
componentAccesses.add(CdeEnvironment.getPluginSystemReader(path));
}
}else{
//ex: <path>system/cdc/cdeComponents</path>
String pluginId = path.substring(0, path.indexOf("/"));
path = path.replaceFirst(pluginId + "/", "");
if(CdeEnvironment.getOtherPluginSystemReader(pluginId).fileExists(path) && CdeEnvironment.getOtherPluginSystemReader(pluginId).fetchFile(path).isDirectory()){
componentAccesses.add(CdeEnvironment.getOtherPluginSystemReader(pluginId, path));
}
}
} else if(path.startsWith(CdeEnvironment.getPluginRepositoryDir() + "/")){
//ex: <path>cde/components</path>
path = path.replaceFirst(CdeEnvironment.getPluginRepositoryDir() + "/", "");
if(CdeEnvironment.getPluginRepositoryReader().fileExists(path) && CdeEnvironment.getPluginRepositoryReader().fetchFile(path).isDirectory()){
componentAccesses.add(CdeEnvironment.getPluginRepositoryReader(path));
}
} else {
logger.warn("Components directory '" + element.getText() + "' was not found.");
}
>>>>>>>
if (CdeEnvironment.getPluginSystemReader().fileExists(path) && CdeEnvironment.getPluginSystemReader().fetchFile(path).isDirectory()) {
componentAccesses.add(CdeEnvironment.getPluginSystemReader(path));
}
} else {
//XXX this isn't supposed to happen
// ex: <path>system/cdc/cdeComponents</path>
String pluginId = path.substring(0, path.indexOf("/"));
path = path.replaceFirst(pluginId + "/", "");
if (CdeEnvironment.getOtherPluginSystemReader(pluginId).fileExists(path) && CdeEnvironment.getOtherPluginSystemReader(pluginId).fetchFile(path).isDirectory()) {
componentAccesses.add(CdeEnvironment.getOtherPluginSystemReader(pluginId, path));
}
}
} else if(path.startsWith(CdeEnvironment.getPluginRepositoryDir() + "/")){
// ex: <path>cde/components</path>
path = path.replaceFirst(CdeEnvironment.getPluginRepositoryDir() + "/", "");
if (CdeEnvironment.getPluginSystemReader().fileExists(path) && CdeEnvironment.getPluginSystemReader().fetchFile(path).isDirectory()) {
componentAccesses.add(CdeEnvironment.getPluginRepositoryReader(path));
}
} else {
logger.warn("Components directory '" + element.getText() + "' was not found.");
} |
<<<<<<<
=======
import com.google.gerrit.reviewdb.RefRight;
import com.google.gerrit.reviewdb.SystemConfig;
>>>>>>>
<<<<<<<
import java.util.Collection;
=======
import java.util.Collections;
>>>>>>>
import java.util.Collection;
import java.util.Collections;
<<<<<<<
private final Set<AccountGroup.UUID> uploadGroups;
private final Set<AccountGroup.UUID> receiveGroups;
=======
private final SystemConfig systemConfig;
private final Set<AccountGroup.Id> uploadGroups;
private final Set<AccountGroup.Id> receiveGroups;
>>>>>>>
private final Set<AccountGroup.UUID> uploadGroups;
private final Set<AccountGroup.UUID> receiveGroups;
<<<<<<<
ProjectControl(@GitUploadPackGroups Set<AccountGroup.UUID> uploadGroups,
@GitReceivePackGroups Set<AccountGroup.UUID> receiveGroups,
=======
ProjectControl(final SystemConfig systemConfig,
@GitUploadPackGroups Set<AccountGroup.Id> uploadGroups,
@GitReceivePackGroups Set<AccountGroup.Id> receiveGroups,
>>>>>>>
ProjectControl(@GitUploadPackGroups Set<AccountGroup.UUID> uploadGroups,
@GitReceivePackGroups Set<AccountGroup.UUID> receiveGroups,
<<<<<<<
private boolean canPerformOnAnyRef(String permissionName) {
final Set<AccountGroup.UUID> groups = user.getEffectiveGroups();
=======
// TODO (anatol.pomazau): Try to merge this method with similar RefRightsForPattern#canPerform
private boolean canPerformOnAnyRef(ApprovalCategory.Id actionId,
short requireValue) {
final Set<AccountGroup.Id> groups = getEffectiveUserGroups();
>>>>>>>
/**
* @return the effective groups of the current user for this project
*/
private Set<AccountGroup.UUID> getEffectiveUserGroups() {
final Set<AccountGroup.UUID> userGroups = user.getEffectiveGroups();
if (isOwner()) {
final Set<AccountGroup.UUID> userGroupsOnProject =
new HashSet<AccountGroup.UUID>(userGroups.size() + 1);
userGroupsOnProject.addAll(userGroups);
userGroupsOnProject.add(AccountGroup.PROJECT_OWNERS);
return Collections.unmodifiableSet(userGroupsOnProject);
} else {
return userGroups;
}
}
private boolean canPerformOnAnyRef(String permissionName) {
final Set<AccountGroup.UUID> groups = getEffectiveUserGroups();
<<<<<<<
private boolean canPerformOnAllRefs(String permission) {
=======
/**
* @return the effective groups of the current user for this project
*/
private Set<AccountGroup.Id> getEffectiveUserGroups() {
final Set<AccountGroup.Id> userGroups = user.getEffectiveGroups();
if (isOwner()) {
final Set<AccountGroup.Id> userGroupsOnProject =
new HashSet<AccountGroup.Id>(userGroups.size() + 1);
userGroupsOnProject.addAll(userGroups);
userGroupsOnProject.add(systemConfig.ownerGroupId);
return Collections.unmodifiableSet(userGroupsOnProject);
} else {
return userGroups;
}
}
private boolean canPerformOnAllRefs(ApprovalCategory.Id actionId,
short requireValue) {
>>>>>>>
private boolean canPerformOnAllRefs(String permission) { |
<<<<<<<
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.gerrit.index.FieldDef.exact;
import static com.google.gerrit.index.FieldDef.fullText;
import static com.google.gerrit.index.FieldDef.integer;
import static com.google.gerrit.index.FieldDef.keyword;
import static com.google.gerrit.index.FieldDef.prefix;
import static com.google.gerrit.index.FieldDef.timestamp;
=======
import static com.google.gerrit.server.index.FieldDef.exact;
import static com.google.gerrit.server.index.FieldDef.fullText;
import static com.google.gerrit.server.index.FieldDef.integer;
import static com.google.gerrit.server.index.FieldDef.prefix;
>>>>>>>
import static com.google.common.collect.ImmutableList.toImmutableList;
import static com.google.gerrit.index.FieldDef.exact;
import static com.google.gerrit.index.FieldDef.fullText;
import static com.google.gerrit.index.FieldDef.integer;
import static com.google.gerrit.index.FieldDef.prefix;
import static com.google.gerrit.index.FieldDef.timestamp;
<<<<<<<
public static final FieldDef<InternalGroup, String> UUID =
keyword("uuid").stored().build(g -> g.getGroupUUID().get());
=======
public static final FieldDef<AccountGroup, String> UUID =
exact("uuid").stored().build(g -> g.getGroupUUID().get());
>>>>>>>
public static final FieldDef<InternalGroup, String> UUID =
exact("uuid").stored().build(g -> g.getGroupUUID().get());
<<<<<<<
public static final FieldDef<InternalGroup, String> OWNER_UUID =
keyword("owner_uuid").build(g -> g.getOwnerGroupUUID().get());
=======
public static final FieldDef<AccountGroup, String> OWNER_UUID =
exact("owner_uuid").build(g -> g.getOwnerGroupUUID().get());
>>>>>>>
public static final FieldDef<InternalGroup, String> OWNER_UUID =
exact("owner_uuid").build(g -> g.getOwnerGroupUUID().get()); |
<<<<<<<
=======
//兼容性提示
String COMPATIBILITY_RECOMMEND = "compatibility_recommend";
//自定义播放背景
String PLAYER_BACKGROUND = "player_background";
>>>>>>>
//自定义播放背景
String PLAYER_BACKGROUND = "player_background"; |
<<<<<<<
import org.n52.iceland.config.annotation.Configurable;
import org.n52.iceland.config.annotation.Setting;
import org.n52.iceland.exception.ows.CompositeOwsException;
import org.n52.iceland.exception.ows.OwsExceptionReport;
import org.n52.iceland.ogc.filter.FilterConstants.TimeOperator;
import org.n52.iceland.ogc.gml.time.TimeInstant;
import org.n52.iceland.ogc.ows.OWSConstants.ExtendedIndeterminateTime;
import org.n52.iceland.ogc.sos.ConformanceClasses;
import org.n52.iceland.ogc.sos.Sos2Constants;
import org.n52.iceland.ogc.sos.SosConstants;
import org.n52.sos.service.Configurator;
import org.n52.iceland.util.CollectionHelper;
import org.n52.sos.ds.AbstractGetObservationHandler;
import org.n52.sos.exception.ows.concrete.InvalidObservedPropertyParameterException;
=======
import org.n52.sos.config.annotation.Configurable;
import org.n52.sos.config.annotation.Setting;
import org.n52.sos.ds.AbstractGetObservationDAO;
>>>>>>>
import org.n52.iceland.config.annotation.Configurable;
import org.n52.iceland.config.annotation.Setting;
import org.n52.iceland.exception.ows.CompositeOwsException;
import org.n52.iceland.exception.ows.OwsExceptionReport;
import org.n52.iceland.ogc.filter.FilterConstants.TimeOperator;
import org.n52.iceland.ogc.gml.time.TimeInstant;
import org.n52.iceland.ogc.ows.OWSConstants.ExtendedIndeterminateTime;
import org.n52.iceland.ogc.sos.ConformanceClasses;
import org.n52.iceland.ogc.sos.Sos2Constants;
import org.n52.iceland.ogc.sos.SosConstants;
import org.n52.sos.service.Configurator;
import org.n52.iceland.util.CollectionHelper;
import org.n52.sos.ds.AbstractGetObservationHandler;
<<<<<<<
=======
import org.n52.sos.ogc.gml.time.TimeInstant;
import org.n52.sos.ogc.om.OmConstants;
import org.n52.sos.ogc.ows.CompositeOwsException;
import org.n52.sos.ogc.ows.OwsExceptionReport;
import org.n52.sos.ogc.sos.ConformanceClasses;
import org.n52.sos.ogc.sos.Sos2Constants;
import org.n52.sos.ogc.sos.SosConstants;
import org.n52.sos.ogc.sos.SosConstants.SosIndeterminateTime;
>>>>>>>
<<<<<<<
new TimeInstant(ExtendedIndeterminateTime.latest), "phenomenonTime");
=======
new TimeInstant(SosIndeterminateTime.latest), OmConstants.EN_PHENOMENON_TIME);
>>>>>>>
new TimeInstant(ExtendedIndeterminateTime.latest), "phenomenonTime"); |
<<<<<<<
else if( property.equals( IX_WIDGET.MAW_WEB_VIEW_HORIZONTAL_SCROLL_BAR_ENABLED ) )
{
webView.setHorizontalScrollBarEnabled(BooleanConverter.convert(value));
}
else if ( property.equals(IX_WIDGET.MAW_WEB_VIEW_VERTICAL_SCROLL_BAR_ENABLED ))
{
webView.setVerticalScrollBarEnabled(BooleanConverter.convert(value));
}
=======
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_HTML))
{
// // Old code kept as a reference.
// // Here we specify the base url of our content provider.
// // See class comment of this class for details:
// // com.mosync.java.android.MoSyncLocalFileContentProvider.java
// Activity activity = MoSyncThread.getInstance().getActivity();
// webView.loadDataWithBaseURL(
// "content://" + activity.getPackageName() + "/",
// value,
// "text/html",
// "utf-8",
// null);
// Load the HTML data using the currently set base url.
webView.loadDataWithBaseURL(
mBaseURL,
value, // HTML data.
"text/html",
"utf-8",
null);
}
else if (property.equals("baseUrl")) //IX_WIDGET.MAW_WEB_VIEW_BASE_URL))
{
mBaseURL = value;
}
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_SOFT_HOOK))
{
Log.i("@@@ Mosync", "Setting softHookPattern to: " + value);
// Set the pattern used for url hooking.
mSoftHookPattern = value;
}
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_HARD_HOOK))
{
Log.i("@@@ Mosync", "Setting hardHookPattern to: " + value);
// Set the pattern used for url hooking.
mHardHookPattern = value;
}
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_ENABLE_ZOOM))
{
// Turn on or off zooming.
boolean enable = BooleanConverter.convert(value);
webView.getSettings().setBuiltInZoomControls(enable);
}
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_NAVIGATE))
{
if ("back".equals(value))
{
if (webView.canGoBack())
{
webView.goBack();
}
}
else if ("forward".equals(value))
{
if (webView.canGoForward())
{
webView.goForward();
}
}
}
else if (property.equals("androidAddJavaScriptInterfaceForActivity"))
{
// Make the string in value a global JavaScript variable
// that refers to the application's activity.
Activity activity = MoSyncThread.getInstance().getActivity();
webView.addJavascriptInterface(activity, value);
}
else if (property.equals("androidAddJavaScriptInterfaceForWebView"))
{
// Make the string in value a global JavaScript variable
// that refers to this WebView instance.
webView.addJavascriptInterface(webView, value);
}
>>>>>>>
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_HTML))
{
// // Old code kept as a reference.
// // Here we specify the base url of our content provider.
// // See class comment of this class for details:
// // com.mosync.java.android.MoSyncLocalFileContentProvider.java
// Activity activity = MoSyncThread.getInstance().getActivity();
// webView.loadDataWithBaseURL(
// "content://" + activity.getPackageName() + "/",
// value,
// "text/html",
// "utf-8",
// null);
// Load the HTML data using the currently set base url.
webView.loadDataWithBaseURL(
mBaseURL,
value, // HTML data.
"text/html",
"utf-8",
null);
}
else if (property.equals("baseUrl")) //IX_WIDGET.MAW_WEB_VIEW_BASE_URL))
{
mBaseURL = value;
}
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_SOFT_HOOK))
{
Log.i("@@@ Mosync", "Setting softHookPattern to: " + value);
// Set the pattern used for url hooking.
mSoftHookPattern = value;
}
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_HARD_HOOK))
{
Log.i("@@@ Mosync", "Setting hardHookPattern to: " + value);
// Set the pattern used for url hooking.
mHardHookPattern = value;
}
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_ENABLE_ZOOM))
{
// Turn on or off zooming.
boolean enable = BooleanConverter.convert(value);
webView.getSettings().setBuiltInZoomControls(enable);
}
else if (property.equals(IX_WIDGET.MAW_WEB_VIEW_NAVIGATE))
{
if ("back".equals(value))
{
if (webView.canGoBack())
{
webView.goBack();
}
}
else if ("forward".equals(value))
{
if (webView.canGoForward())
{
webView.goForward();
}
}
}
else if (property.equals("androidAddJavaScriptInterfaceForActivity"))
{
// Make the string in value a global JavaScript variable
// that refers to the application's activity.
Activity activity = MoSyncThread.getInstance().getActivity();
webView.addJavascriptInterface(activity, value);
}
else if (property.equals("androidAddJavaScriptInterfaceForWebView"))
{
// Make the string in value a global JavaScript variable
// that refers to this WebView instance.
webView.addJavascriptInterface(webView, value);
}
else if( property.equals( IX_WIDGET.MAW_WEB_VIEW_HORIZONTAL_SCROLL_BAR_ENABLED ) )
{
webView.setHorizontalScrollBarEnabled(BooleanConverter.convert(value));
}
else if ( property.equals(IX_WIDGET.MAW_WEB_VIEW_VERTICAL_SCROLL_BAR_ENABLED ))
{
webView.setVerticalScrollBarEnabled(BooleanConverter.convert(value));
} |
<<<<<<<
import com.mosync.internal.android.EventQueue;
import com.mosync.internal.generated.IX_WIDGET;
=======
import com.mosync.internal.generated.IX_WIDGET;
>>>>>>>
import com.mosync.internal.android.EventQueue;
import com.mosync.internal.generated.IX_WIDGET;
<<<<<<<
*
* Update: it can now contain List View Sections.
* Therefore, 2 more list types are needed:
* - Segmented ( custom list view with default header
* and footer layouts).
* - Alphabetical ( alphabetical indexed list view).
* Based on the list type, sections can be created accordingly.
*
=======
*
>>>>>>>
*
* Update: it can now contain List View Sections.
* Therefore, 2 more list types are needed:
* - Segmented ( custom list view with default header
* and footer layouts).
* - Alphabetical ( alphabetical indexed list view).
* Based on the list type, sections can be created accordingly.
*
<<<<<<<
/**
* The adapter for the alphabetical indexed list.
*/
AlphabeticalViewAdapter<ListItemWidget> mAlphabeticalViewAdapter;
/**
* Widget handle, used for posting item clicked events.
*/
private int mWidgetHandle;
=======
>>>>>>>
/**
* The adapter for the alphabetical indexed list.
*/
AlphabeticalViewAdapter<ListItemWidget> mAlphabeticalViewAdapter;
/**
* Widget handle, used for posting item clicked events.
*/
private int mWidgetHandle;
/**
* Widget handle of the selected item.
*/
private int mSelectedItemHandle;
/**
* Allow selection property on the list.
* If disabled, none of the adapter's items can be selected.
*/
private boolean mAllowSelection = true;
<<<<<<<
=======
super.addChildAt( child, index );
>>>>>>>
<<<<<<<
// Get all items from section and add them to the list adapter.
for (int i=0; i < section.itemsCount(); i++)
{
ListItemWidget item = section.getItem(i);
m_viewAdapter.addAt(item.getView(), listIndex + i);
}
=======
child.getView( ).setFocusable( false );
m_viewAdapter.addAt( child.getRootView( ), listIndex );
>>>>>>>
// Get all items from section and add them to the list adapter.
for (int i=0; i < section.itemsCount(); i++)
{
ListItemWidget item = section.getItem(i);
m_viewAdapter.addAt(item.getView(), listIndex + i);
}
<<<<<<<
/**
* Updates the Android layout params for the given child, according
* to the parameters specified in the child. Only the parameters that
* are supported for the layout will be taken into consideration.
*
* @param child The child for which to update the layout params.
*/
public void updateLayoutParamsForChild(Widget child)
{
// Set layout params for the child
ViewGroup.LayoutParams nativeLayoutParams = createNativeLayoutParams( child.getLayoutParams( ) );
LayoutParamsSetter.setPossibleParams( child.getLayoutParams( ), nativeLayoutParams );
View childView = child.getView();
View rootView = child.getRootView();
if( childView != rootView )
{
if ( child instanceof Layout )
{
if ( !((Layout) child).isScrollable() )
{
rootView.setLayoutParams(
new ViewGroup.LayoutParams( nativeLayoutParams.width, nativeLayoutParams.height ) );
}
}
}
else
{
childView.setLayoutParams( nativeLayoutParams );
}
}
=======
>>>>>>>
/**
* Updates the Android layout params for the given child, according
* to the parameters specified in the child. Only the parameters that
* are supported for the layout will be taken into consideration.
*
* @param child The child for which to update the layout params.
*/
public void updateLayoutParamsForChild(Widget child)
{
// Set layout params for the child
ViewGroup.LayoutParams nativeLayoutParams = createNativeLayoutParams( child.getLayoutParams( ) );
LayoutParamsSetter.setPossibleParams( child.getLayoutParams( ), nativeLayoutParams );
View childView = child.getView();
View rootView = child.getRootView();
if( childView != rootView )
{
if ( child instanceof Layout )
{
if ( !((Layout) child).isScrollable() )
{
rootView.setLayoutParams(
new ViewGroup.LayoutParams( nativeLayoutParams.width, nativeLayoutParams.height ) );
}
}
}
else
{
childView.setLayoutParams( nativeLayoutParams );
}
}
<<<<<<<
ListView listView = (ListView) getView();
if ( property.equals(IX_WIDGET.MAW_LIST_VIEW_TYPE) )
{
if ( IntConverter.convert(value) == IX_WIDGET.MAW_LIST_VIEW_TYPE_DEFAULT)
{
listView.setAdapter( m_viewAdapter );
mListType = LIST_VIEW_TYPE_DEFAULT;
}
else if( IntConverter.convert(value) == IX_WIDGET.MAW_LIST_VIEW_TYPE_SEGMENTED )
{
mListType = LIST_VIEW_TYPE_SEGMENTED;
m_viewAdapter = new SegmentedViewAdapter( );
listView.setAdapter(m_viewAdapter);
listView.setOnItemClickListener(
new SectionedListOnItemClickListener( mWidgetHandle ) );
}
else if( IntConverter.convert(value) == IX_WIDGET.MAW_LIST_VIEW_TYPE_ALPHABETICAL )
{
mListType = LIST_VIEW_TYPE_ALPHABETICAL;
mAlphabeticalViewAdapter = new AlphabeticalViewAdapter<ListItemWidget>( );
listView.setAdapter( mAlphabeticalViewAdapter );
listView.setOnItemClickListener(
new SectionedListOnItemClickListener( mWidgetHandle ) );
}
else
{
throw new InvalidPropertyValueException(property, value);
}
}
else if( property.equals(IX_WIDGET.MAW_LIST_VIEW_RELOAD_DATA) )
{
if ( mListType == LIST_VIEW_TYPE_ALPHABETICAL )
mAlphabeticalViewAdapter.notifyDataSetChanged();
else if ( mListType == LIST_VIEW_TYPE_SEGMENTED )
m_viewAdapter.notifyDataSetChanged();
}
else if( property.equals( Types.WIDGET_PROPERTY_REVERSED ) )
=======
if( property.equals( Types.WIDGET_PROPERTY_REVERSED ) )
>>>>>>>
ListView listView = (ListView) getView();
if ( property.equals(IX_WIDGET.MAW_LIST_VIEW_TYPE) )
{
if ( IntConverter.convert(value) == IX_WIDGET.MAW_LIST_VIEW_TYPE_DEFAULT)
{
listView.setAdapter( m_viewAdapter );
mListType = IX_WIDGET.MAW_LIST_VIEW_TYPE_DEFAULT;
}
else if( IntConverter.convert(value) == IX_WIDGET.MAW_LIST_VIEW_TYPE_SEGMENTED )
{
mListType = IX_WIDGET.MAW_LIST_VIEW_TYPE_SEGMENTED;
m_viewAdapter = new SegmentedViewAdapter( );
listView.setAdapter(m_viewAdapter);
listView.setOnItemClickListener(
new SectionedListOnItemClickListener( mWidgetHandle ) );
}
else if( IntConverter.convert(value) == IX_WIDGET.MAW_LIST_VIEW_TYPE_ALPHABETICAL )
{
mListType = IX_WIDGET.MAW_LIST_VIEW_TYPE_ALPHABETICAL;
mAlphabeticalViewAdapter = new AlphabeticalViewAdapter<ListItemWidget>( );
listView.setAdapter( mAlphabeticalViewAdapter );
listView.setFastScrollEnabled(true);
listView.setOnItemClickListener(
new SectionedListOnItemClickListener( mWidgetHandle ) );
}
else
{
throw new InvalidPropertyValueException(property, value);
}
}
else if( property.equals(IX_WIDGET.MAW_LIST_VIEW_RELOAD_DATA) )
{
if ( mListType == IX_WIDGET.MAW_LIST_VIEW_TYPE_ALPHABETICAL )
mAlphabeticalViewAdapter.reloadPreviewLetters();
else if ( mListType == IX_WIDGET.MAW_LIST_VIEW_TYPE_SEGMENTED )
m_viewAdapter.notifyDataSetChanged();
}
else if( property.equals( Types.WIDGET_PROPERTY_REVERSED ) )
<<<<<<<
/**
* Class responsible for sending a mosync event when an item
* in the sectioned list has been clicked.
*
* @author emma
*/
public class SectionedListOnItemClickListener implements OnItemClickListener
{
private int m_handle = -1;
public SectionedListOnItemClickListener(int handle)
{
m_handle = handle;
}
/**
* @see OnItemClickListener.onItemClick.
*/
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
int browseIndex = 0;
int sectionIndex = 0;
// Section's start position in list.
int sectionPosition = 0;
// Get the index of the section that holds this item,
// and it's start position.
for (int i=0; i < mSections.size(); i++)
{
ListViewSection section = mSections.get(i);
browseIndex += section.itemsCount();
sectionIndex = i;
if ( browseIndex > position )
{
// The index ignores the header.
EventQueue.getDefault().
postSegmentedListItemClicked(m_handle, sectionIndex, position-sectionPosition-1);
return;
}
sectionPosition += section.itemsCount();
}
EventQueue.getDefault().
postSegmentedListItemClicked(m_handle, sectionIndex, position-sectionPosition-1);
}
}
/**
* See AdapterChangedListener.itemRemoved.
*/
@Override
public void itemRemoved(ListItemWidget item)
{
if ( mListType == LIST_VIEW_TYPE_ALPHABETICAL )
{
mAlphabeticalViewAdapter.notifyDataSetChanged();
}
else
{
m_viewAdapter.remove(item.getView());
}
}
/**
* See AdapterChangedListener.itemAdded.
*/
@Override
public void itemAdded(
ListItemWidget item, ListViewSection section, int index)
{
if ( mListType == LIST_VIEW_TYPE_ALPHABETICAL )
{
mAlphabeticalViewAdapter.notifyDataSetChanged();
}
else
{
// Based on index inside the section, compute the position in list.
int itemPos = getItemPosition(mSections.indexOf(section), index);
m_viewAdapter.addAt(item.getView(), itemPos);
}
}
/**
* Helper function.
* Based on item position inside the section,
* return the position inside the list.
* @param sectionIndex The section index.
* @param index The index inside the section.
* @return The position inside the list.
*/
private int getItemPosition(int sectionIndex, int index)
{
int browseIndex = 0;
if (sectionIndex == 0)
return index;
for (int i=1; i <= sectionIndex; i++)
{
browseIndex += mSections.get(i).itemsCount();
}
return browseIndex + index;
}
=======
>>>>>>>
/**
* @see Widget.getProperty.
*/
@Override
public String getProperty(String property)
{
if( property.equals( IX_WIDGET.MAW_LIST_VIEW_ALLOW_SELECTION ) )
{
return Boolean.toString(mAllowSelection);
}
else
{
return super.getProperty( property );
}
}
/**
* Get the handle of the last item that was selected in the list.
* @return The selected item widget handle.
*/
public int getSelectedItem()
{
return mSelectedItemHandle;
}
/**
* Class responsible for sending a mosync event when an item
* in the default list view has been clicked.
*
* @author fmattias
*/
public class ListOnItemClickListener implements OnItemClickListener
{
private int m_handle = -1;
public ListOnItemClickListener(int handle)
{
m_handle = handle;
}
/**
* @see OnItemClickListener.onItemClick.
*/
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
// Store the last selected item.
mSelectedItemHandle = m_children.get(position).getHandle();
//mSelectedItem = (ListItemWidget) m_viewAdapter.getView(position, null, null);
// Assume that the view's id is always the same as the handle.
EventQueue.getDefault( ).postWidgetItemClickedEvent( m_handle, position );
}
}
/**
* Class responsible for sending a mosync event when an item
* in the sectioned list has been clicked.
*
* @author emma
*/
public class SectionedListOnItemClickListener implements OnItemClickListener
{
private int m_handle = -1;
public SectionedListOnItemClickListener(int handle)
{
m_handle = handle;
}
/**
* @see OnItemClickListener.onItemClick.
*/
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
int browseIndex = 0;
int sectionIndex = 0;
// Section's start position in list.
int sectionPosition = 0;
// Item's position in the section.
int itemPosition = 0;
// Get the index of the section that holds this item,
// and it's start position.
for (int i=0; i < mSections.size(); i++)
{
ListViewSection section = mSections.get(i);
browseIndex += section.itemsCount();
sectionIndex = i;
if ( browseIndex > position )
{
itemPosition = position-sectionPosition;
// Get the position inside the section, decrease it by 1 if the section has a header.
if ( section.hasHeader() )
{
itemPosition --;
}
// Store the selected state of the item.
mSelectedItemHandle = section.getItem(itemPosition).getHandle();
// The index ignores the header.
EventQueue.getDefault().
postSegmentedListItemClicked(m_handle, sectionIndex, itemPosition);
return;
}
sectionPosition += section.itemsCount();
}
EventQueue.getDefault().
postSegmentedListItemClicked(m_handle, sectionIndex, itemPosition);
}
}
/**
* See AdapterChangedListener.itemRemoved.
*/
@Override
public void itemRemoved(ListItemWidget item)
{
if ( mListType == IX_WIDGET.MAW_LIST_VIEW_TYPE_ALPHABETICAL )
{
mAlphabeticalViewAdapter.notifyDataSetChanged();
}
else
{
m_viewAdapter.remove(item.getView());
}
}
/**
* See AdapterChangedListener.itemAdded.
*/
@Override
public void itemAdded(
ListItemWidget item, ListViewSection section, int index)
{
if ( mListType == IX_WIDGET.MAW_LIST_VIEW_TYPE_ALPHABETICAL )
{
mAlphabeticalViewAdapter.notifyDataSetChanged();
}
else
{
// Based on index inside the section, compute the position in list.
int itemPos = getItemPosition(mSections.indexOf(section), index);
m_viewAdapter.addAt(item.getView(), itemPos);
}
}
/**
* Helper function.
* Based on item position inside the section,
* return the position inside the list.
* @param sectionIndex The section index.
* @param index The index inside the section.
* @return The position inside the list.
*/
private int getItemPosition(int sectionIndex, int index)
{
int browseIndex = 0;
if (sectionIndex == 0)
return index;
for (int i=1; i <= sectionIndex; i++)
{
browseIndex += mSections.get(i).itemsCount();
}
return browseIndex + index;
}
<<<<<<<
* used for default list view type.
*
=======
*
>>>>>>>
* used for default list view type.
* |
<<<<<<<
=======
// Options Menu is enabled for devices prior to Honeycomb.
// ActionBar is disabled by default starting with Honeycomb, and can be
// enabled using maActionBarSetEnabled(true)
// This part will be needed when adding the Action-bar but please reevaluate all
// Action-bar related code and do proper testing.
//
// if ( Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB )
// {
// // Action bar will not be supported on pre-Honeycomb devices
// requestWindowFeature(Window.FEATURE_NO_TITLE);
// NativeUI.mActionBarEnabled = false;
// }
// else
// {
// requestWindowFeature(Window.FEATURE_ACTION_BAR);
// NativeUI.mActionBarEnabled = true;
// getActionBar().hide();
// }
>>>>>>>
<<<<<<<
if ( items.get(i).hasIconFromResources() )
=======
// if (NativeUI.mActionBarEnabled)
// item.setShowAsAction(items.get(i).getShowActionFlag());
if ( items.get(i).hasPredefinedIcon() )
>>>>>>>
// if (NativeUI.mActionBarEnabled)
// item.setShowAsAction(items.get(i).getShowActionFlag());
if ( items.get(i).hasPredefinedIcon() )
<<<<<<<
// Remove all the items from the menu.
=======
// // Remove all the items from the menu.
>>>>>>>
// // Remove all the items from the menu.
<<<<<<<
=======
// When enabled, use ActionBar items.
// if (NativeUI.mActionBarEnabled)
// {
// item.setShowAsAction(items.get(i).getShowActionFlag());
// }
>>>>>>>
// When enabled, use ActionBar items.
// if (NativeUI.mActionBarEnabled)
// {
// item.setShowAsAction(items.get(i).getShowActionFlag());
// } |
<<<<<<<
addFactory( IX_WIDGET.MAW_PROGRESS_BAR, new ProgressBarFactory( ) );
addFactory( IX_WIDGET.MAW_ACTIVITY_INDICATOR, new ActivityIndicatorFactory( ) );
addFactory( IX_WIDGET.MAW_SLIDER, new SliderFactory( ) );
addFactory( IX_WIDGET.MAW_DATE_PICKER, new DatePickerFactory( ) );
addFactory( IX_WIDGET.MAW_TIME_PICKER, new TimePickerFactory( ) );
addFactory(IX_WIDGET.MAW_VIDEO_VIEW, new VideoViewFactory( ) );
addFactory(IX_WIDGET.MAW_TOGGLE_BUTTON, new ToggleButtonFactory( ) );
=======
addFactory( IX_WIDGET.MAW_CAMERA_PREVIEW, new CameraPreviewFactory( ) );
>>>>>>>
addFactory( IX_WIDGET.MAW_CAMERA_PREVIEW, new CameraPreviewFactory( ) );
addFactory( IX_WIDGET.MAW_PROGRESS_BAR, new ProgressBarFactory( ) );
addFactory( IX_WIDGET.MAW_ACTIVITY_INDICATOR, new ActivityIndicatorFactory( ) );
addFactory( IX_WIDGET.MAW_SLIDER, new SliderFactory( ) );
addFactory( IX_WIDGET.MAW_DATE_PICKER, new DatePickerFactory( ) );
addFactory( IX_WIDGET.MAW_TIME_PICKER, new TimePickerFactory( ) );
addFactory(IX_WIDGET.MAW_VIDEO_VIEW, new VideoViewFactory( ) );
addFactory(IX_WIDGET.MAW_TOGGLE_BUTTON, new ToggleButtonFactory( ) ); |
<<<<<<<
import com.mosync.internal.android.BigPhatError;
import com.mosync.internal.generated.IX_PIM;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_CONTACTS;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_EVENTS;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NONE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_UNAVAILABLE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NATIVE_TYPE_MISMATCH;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_UNSUPPORTED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_READ_ONLY;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_WRITE_ONLY;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_COMBO_UNSUPPORTED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_COUNT_MAX;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NO_LABEL;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_CUSTOM_ATTRIBUTE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_UNAVAILABLE_LIST;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_OPERATION_NOT_PERMITTED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_CANNOT_OPEN;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_ALREADY_OPEN;
=======
import com.mosync.internal.generated.IX_PIM;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_FIELD_CONTACT_ADDR;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_FIELD_CONTACT_ORG_INFO;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_CONTACTS;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_EVENTS;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NONE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_UNAVAILABLE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NATIVE_TYPE_MISMATCH;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_LIST_TYPE_INVALID;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_LIST_UNAVAILABLE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_LIST_ALREADY_OPENED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_INVALID;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_UNSUPPORTED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_EMPTY;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_COUNT_MAX;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_READ_ONLY;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_WRITE_ONLY;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_INDEX_INVALID;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_HANDLE_INVALID;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_ATTRIBUTE_COMBO_UNSUPPORTED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_ATTRIBUTE_CUSTOM;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NO_ATTRIBUTES;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_BUFFER_TOO_SMALL;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_BUFFER_INVALID;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NO_LABEL;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_OPERATION_NOT_PERMITTED;
>>>>>>>
import com.mosync.internal.android.BigPhatError;
import com.mosync.internal.generated.IX_PIM;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_CONTACTS;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_EVENTS;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NONE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_UNAVAILABLE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NATIVE_TYPE_MISMATCH;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_UNSUPPORTED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_READ_ONLY;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_WRITE_ONLY;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_COMBO_UNSUPPORTED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_FIELD_COUNT_MAX;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_NO_LABEL;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_CUSTOM_ATTRIBUTE;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_UNAVAILABLE_LIST;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_OPERATION_NOT_PERMITTED;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_CANNOT_OPEN;
import static com.mosync.internal.generated.IX_PIM.MA_PIM_ERR_ALREADY_OPEN;
<<<<<<<
StructuredPostal.COUNTRY, DUMMY, StructuredPostal.NEIGHBORHOOD,
StructuredPostal.TYPE, StructuredPostal.LABEL, StructuredPostal.IS_PRIMARY },
=======
StructuredPostal.COUNTRY, StructuredPostal.NEIGHBORHOOD,
StructuredPostal.TYPE, StructuredPostal.LABEL, StructuredPostal.IS_PRIMARY },
>>>>>>>
StructuredPostal.COUNTRY, StructuredPostal.NEIGHBORHOOD,
StructuredPostal.TYPE, StructuredPostal.LABEL, StructuredPostal.IS_PRIMARY },
<<<<<<<
/*
=======
private final static int PIM_ERROR_LIST_TYPE_NOT_SUPPORTED = -3;
/*
>>>>>>>
/*
<<<<<<<
mPIMIterator = mPIMIterators.get(list);
=======
if ((list < 0) || ((mPIMIterator = mPIMIterators.get(list)) == null))
{
return MA_PIM_ERR_HANDLE_INVALID;
}
>>>>>>>
mPIMIterator = mPIMIterators.get(list);
<<<<<<<
}
else
{
return 0; //fleu TODO
}
=======
}
else
{
return 0;
}
>>>>>>>
}
else
{
return 0;
}
<<<<<<<
PIMItem pimItem = mPIMItems.get(item);
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
>>>>>>>
PIMItem pimItem = mPIMItems.get(item);
<<<<<<<
PIMItem pimItem = mPIMItems.get(item);
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ( (n < 0) || (n >= pimItem.getFieldsCount()) )
{
return MA_PIM_ERR_INDEX_INVALID;
}
>>>>>>>
PIMItem pimItem = mPIMItems.get(item);
<<<<<<<
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ((field < MA_PIM_FIELD_CONTACT_ADDR) ||
(field > MA_PIM_FIELD_CONTACT_ORG_INFO))
{
return MA_PIM_ERR_FIELD_INVALID;
}
PIMField pimField = null;
if ( (pimField = pimItem.getField(field)) == null )
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
>>>>>>>
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
<<<<<<<
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ((field < MA_PIM_FIELD_CONTACT_ADDR) ||
(field > MA_PIM_FIELD_CONTACT_ORG_INFO))
{
return MA_PIM_ERR_FIELD_INVALID;
}
PIMField pimField = null;
if ( (pimField = pimItem.getField(field)) == null )
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
if ( (index < 0) || (index >= pimField.length()) )
{
return MA_PIM_ERR_INDEX_INVALID;
}
>>>>>>>
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
<<<<<<<
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
String buffer = readStringFromMemory(buffPointer, buffSize);
pimField.setCustomLabel(index, buffer);
pimItem.updateField(getContentResolver(), BaseColumns._ID, pimField.getId(index), "data3", buffer);
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ((field < MA_PIM_FIELD_CONTACT_ADDR) ||
(field > MA_PIM_FIELD_CONTACT_ORG_INFO))
{
return MA_PIM_ERR_FIELD_INVALID;
}
PIMField pimField = null;
if ( (pimField = pimItem.getField(field)) == null )
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
if (pimField.length() == 0)
{
return MA_PIM_ERR_FIELD_EMPTY;
}
if ( (index < 0) || (index >= pimField.length()) )
{
return MA_PIM_ERR_INDEX_INVALID;
}
if (!pimField.hasCustomLabel(index))
{
return MA_PIM_ERR_NO_LABEL;
}
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
pimField.setCustomLabel(index, new String(buffer));
>>>>>>>
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
pimField.setCustomLabel(index, new String(buffer));
<<<<<<<
=======
if ((list < 0) || ((mPIMIterator = mPIMIterators.get(list)) == null))
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ((field < MA_PIM_FIELD_CONTACT_ADDR) ||
(field > MA_PIM_FIELD_CONTACT_ORG_INFO))
{
return MA_PIM_ERR_FIELD_INVALID;
}
>>>>>>>
<<<<<<<
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
String buffer = readStringFromMemory(buffPointer, buffSize);
pimField.setData(index, buffer);
pimField.setAttribute(index, attributes);
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ((field < MA_PIM_FIELD_CONTACT_ADDR) ||
(field > MA_PIM_FIELD_CONTACT_ORG_INFO))
{
return MA_PIM_ERR_FIELD_INVALID;
}
PIMField pimField = null;
if ( (pimField = pimItem.getField(field)) == null )
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
if (pimField.isReadOnly())
{
return MA_PIM_ERR_FIELD_READ_ONLY;
}
if ( (index < 0) || (index >= pimField.length()) )
{
return MA_PIM_ERR_INDEX_INVALID;
}
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
if (pimField.setData(index, buffer) < 0)
{
return MA_PIM_ERR_BUFFER_INVALID;
}
if (pimField.setAttribute(index, attributes) < 0)
{
return MA_PIM_ERR_ATTRIBUTE_COMBO_UNSUPPORTED;
}
>>>>>>>
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
pimField.setData(index, buffer);
if (pimField.setAttribute(index, attributes) < 0)
{
return MA_PIM_ERR_COMBO_UNSUPPORTED;
}
<<<<<<<
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
String buffer = readStringFromMemory(buffPointer, buffSize);
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ((field < MA_PIM_FIELD_CONTACT_ADDR) ||
(field > MA_PIM_FIELD_CONTACT_ORG_INFO))
{
return MA_PIM_ERR_FIELD_INVALID;
}
PIMField pimField = null;
if ( (pimField = pimItem.getField(field)) == null )
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
if (pimField.isReadOnly())
{
return MA_PIM_ERR_FIELD_READ_ONLY;
}
DebugPrint("BUFFSIZE = " + buffSize);
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
if (buffer.length == 0)
{
return MA_PIM_ERR_BUFFER_INVALID;
}
>>>>>>>
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
<<<<<<<
pimField.setAttribute(index, attributes);
=======
if ( index < 0)
{
return MA_PIM_ERR_BUFFER_INVALID;
}
if (pimField.setAttribute(index, attributes) < 0)
{
return MA_PIM_ERR_ATTRIBUTE_COMBO_UNSUPPORTED;
}
>>>>>>>
if (pimField.setAttribute(index, attributes) < 0)
{
return MA_PIM_ERR_COMBO_UNSUPPORTED;
}
<<<<<<<
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ((field < MA_PIM_FIELD_CONTACT_ADDR) ||
(field > MA_PIM_FIELD_CONTACT_ORG_INFO))
{
return MA_PIM_ERR_FIELD_INVALID;
}
PIMField pimField = null;
if ( (pimField = pimItem.getField(field)) == null )
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
if ( (index < 0) || (index >= pimField.length()) )
{
return MA_PIM_ERR_INDEX_INVALID;
}
>>>>>>>
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
return pimField.getAttribute(index);
}
public int maPimItemSetLabel(int item, int field, int buffPointer, int buffSize, int index)
{
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
pimField.setCustomLabel(index, new String(buffer));
return MA_PIM_ERR_NONE;
}
public int maPimItemGetLabel(int item, int field, int buffPointer, int buffSize, int index)
{
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
char[] buffer = pimField.getCustomLabel(index).toCharArray();
if (buffer == null)
{
return MA_PIM_ERR_NO_LABEL;
}
if ( buffer.length > buffSize )
return buffer.length;
copyStringToMemory(buffPointer, buffer);
return buffer.length;
}
public int maPimFieldType(int list, int field)
{
int ret = PIMField.getDataType(field);
if (ret < 0)
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
return ret;
}
public int maPimItemGetValue(int item, int field, int buffPointer, int buffSize, int index)
{
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
char[] buffer = new char[buffSize >> 1];
int length = pimField.getData(index, buffer);
if ( length > buffSize )
return length;
if (length > 0)
copyStringToMemory(buffPointer, buffer, length);
return length;
}
public int maPimItemSetValue(int item, int field, int buffPointer, int buffSize, int index, int attributes)
{
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
pimField.setData(index, buffer);
if (pimField.setAttribute(index, attributes) < 0)
{
return MA_PIM_ERR_COMBO_UNSUPPORTED;
}
return MA_PIM_ERR_NONE;
}
public int maPimItemAddValue(int item, int field, int buffPointer, int buffSize, int attributes)
{
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
char[] buffer = readStringFromMemory(buffPointer, buffSize >> 1);
int index = pimField.addData(buffer);
if (pimField.setAttribute(index, attributes) < 0)
{
return MA_PIM_ERR_COMBO_UNSUPPORTED;
}
return index;
}
public int maPimItemRemoveValue(int item, int field, int index) {
PIMItem pimItem = mPIMItems.get(item);
PIMField pimField = pimItem.getField(field);
<<<<<<<
throw new BigPhatError("maPimItemClose not implemented");
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
pimItem.close();
return MA_PIM_ERR_NONE;
>>>>>>>
throw new BigPhatError("maPimItemClose not implemented");
<<<<<<<
throw new BigPhatError("maPimItemCreate not implemented");
/*
=======
if ((list < 0) || ((mPIMIterator = mPIMIterators.get(list)) == null))
{
return MA_PIM_ERR_HANDLE_INVALID;
}
>>>>>>> |
<<<<<<<
MoSyncSMS mMoSyncSMS;
=======
MoSyncSensor mMoSyncSensor;
MoSyncPIM mMoSyncPIM;
>>>>>>>
MoSyncSMS mMoSyncSMS;
MoSyncSensor mMoSyncSensor;
MoSyncPIM mMoSyncPIM;
<<<<<<<
// SMS is not available on all platforms and
// therefore we do a conditional loading of the
// MoSyncSMS class.
try
{
mMoSyncSMS = new MoSyncSMS(this);
}
catch (java.lang.VerifyError error)
{
mMoSyncSMS = null;
}
nativeInitRuntime();
=======
mMoSyncSensor = new MoSyncSensor(this);
mMoSyncPIM = new MoSyncPIM(this);
nativeInitRuntime();
>>>>>>>
// SMS is not available on all platforms and
// therefore we do a conditional loading of the
// MoSyncSMS class.
try
{
mMoSyncSMS = new MoSyncSMS(this);
}
catch (java.lang.VerifyError error)
{
mMoSyncSMS = null;
}
nativeInitRuntime();
mMoSyncSensor = new MoSyncSensor(this);
mMoSyncPIM = new MoSyncPIM(this);
nativeInitRuntime();
<<<<<<<
=======
public void onResume()
{
mMoSyncSensor.onResume();
}
public void onPause()
{
mMoSyncSensor.onResume();
}
>>>>>>>
public void onResume()
{
mMoSyncSensor.onResume();
}
public void onPause()
{
mMoSyncSensor.onResume();
}
<<<<<<<
=======
int maSensorStart(int sensor, int interval)
{
return mMoSyncSensor.maSensorStart(sensor, interval);
}
int maSensorStop(int sensor)
{
return mMoSyncSensor.maSensorStop(sensor);
}
/**
* PIM related methods
*/
int maPimListOpen(int listType)
{
return mMoSyncPIM.maPimListOpen(listType);
}
int maPimListNext(int list)
{
return mMoSyncPIM.maPimListNext(list);
}
int maPimListClose(int list)
{
return mMoSyncPIM.maPimListClose(list);
}
int maPimItemCount(int item)
{
return mMoSyncPIM.maPimItemCount(item);
}
int maPimItemGetField(int item, int n)
{
return mMoSyncPIM.maPimItemGetField(item, n);
}
int maPimItemFieldCount(int item, int field)
{
return mMoSyncPIM.maPimItemFieldCount(item, field);
}
int maPimItemGetAttributes(int item, int field, int index)
{
return mMoSyncPIM.maPimItemGetAttributes(item, field, index);
}
int maPimItemSetLabel(int item, int field, int buffPointer, int buffSize, int index)
{
return mMoSyncPIM.maPimItemSetLabel(item, field, buffPointer, buffSize, index);
}
int maPimItemGetLabel(int item, int field, int buffPointer, int buffSize, int index)
{
return mMoSyncPIM.maPimItemGetLabel(item, field, buffPointer, buffSize, index);
}
int maPimFieldType(int list, int field)
{
return mMoSyncPIM.maPimFieldType(list, field);
}
int maPimItemGetValue(int item, int field, int buffPointer, int buffSize, int index)
{
return mMoSyncPIM.maPimItemGetValue(item, field, buffPointer, buffSize, index);
}
int maPimItemSetValue(int item, int field, int buffPointer, int buffSize, int index, int attributes)
{
return mMoSyncPIM.maPimItemSetValue(item, field, buffPointer, buffSize, index, attributes);
}
int maPimItemAddValue(int item, int field, int buffPointer, int buffSize, int attributes)
{
return mMoSyncPIM.maPimItemAddValue(item, field, buffPointer, buffSize, attributes);
}
int maPimItemRemoveValue(int item, int field, int index)
{
return mMoSyncPIM.maPimItemRemoveValue(item, field, index);
}
int maPimItemClose(int item)
{
return mMoSyncPIM.maPimItemClose(item);
}
int maPimItemCreate(int list)
{
return mMoSyncPIM.maPimItemCreate(list);
}
int maPimItemRemove(int list, int item)
{
return mMoSyncPIM.maPimItemRemove(list, item);
}
>>>>>>>
int maSensorStart(int sensor, int interval)
{
return mMoSyncSensor.maSensorStart(sensor, interval);
}
int maSensorStop(int sensor)
{
return mMoSyncSensor.maSensorStop(sensor);
}
/**
* PIM related methods
*/
int maPimListOpen(int listType)
{
return mMoSyncPIM.maPimListOpen(listType);
}
int maPimListNext(int list)
{
return mMoSyncPIM.maPimListNext(list);
}
int maPimListClose(int list)
{
return mMoSyncPIM.maPimListClose(list);
}
int maPimItemCount(int item)
{
return mMoSyncPIM.maPimItemCount(item);
}
int maPimItemGetField(int item, int n)
{
return mMoSyncPIM.maPimItemGetField(item, n);
}
int maPimItemFieldCount(int item, int field)
{
return mMoSyncPIM.maPimItemFieldCount(item, field);
}
int maPimItemGetAttributes(int item, int field, int index)
{
return mMoSyncPIM.maPimItemGetAttributes(item, field, index);
}
int maPimItemSetLabel(int item, int field, int buffPointer, int buffSize, int index)
{
return mMoSyncPIM.maPimItemSetLabel(item, field, buffPointer, buffSize, index);
}
int maPimItemGetLabel(int item, int field, int buffPointer, int buffSize, int index)
{
return mMoSyncPIM.maPimItemGetLabel(item, field, buffPointer, buffSize, index);
}
int maPimFieldType(int list, int field)
{
return mMoSyncPIM.maPimFieldType(list, field);
}
int maPimItemGetValue(int item, int field, int buffPointer, int buffSize, int index)
{
return mMoSyncPIM.maPimItemGetValue(item, field, buffPointer, buffSize, index);
}
int maPimItemSetValue(int item, int field, int buffPointer, int buffSize, int index, int attributes)
{
return mMoSyncPIM.maPimItemSetValue(item, field, buffPointer, buffSize, index, attributes);
}
int maPimItemAddValue(int item, int field, int buffPointer, int buffSize, int attributes)
{
return mMoSyncPIM.maPimItemAddValue(item, field, buffPointer, buffSize, attributes);
}
int maPimItemRemoveValue(int item, int field, int index)
{
return mMoSyncPIM.maPimItemRemoveValue(item, field, index);
}
int maPimItemClose(int item)
{
return mMoSyncPIM.maPimItemClose(item);
}
int maPimItemCreate(int list)
{
return mMoSyncPIM.maPimItemCreate(list);
}
int maPimItemRemove(int list, int item)
{
return mMoSyncPIM.maPimItemRemove(list, item);
} |
<<<<<<<
private Iterator<PIMItem> mPIMIterator;
=======
private int mPIMIterator;
>>>>>>>
private int mPIMIterator;
<<<<<<<
mPIMIterator = mPIMContactsList.iterator();
=======
mPIMIterator = 0;
>>>>>>>
mPIMIterator = 0;
<<<<<<<
=======
if ((list < 0) || (!mPIMIterators.containsKey(list)))
{
return MA_PIM_ERR_HANDLE_INVALID;
}
if ((field < MA_PIM_FIELD_CONTACT_ADDR) ||
(field > MA_PIM_FIELD_CONTACT_ORG_INFO))
{
return MA_PIM_ERR_FIELD_INVALID;
}
>>>>>>>
<<<<<<<
char[] buffer = new char[buffSize >> 1];
=======
PIMField pimField = null;
if ( (pimField = pimItem.getField(field)) == null )
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
DebugPrint("INDEX = " + index);
DebugPrint("FIELD LENGTH = " + pimField.length());
if ( (index < 0) || (index >= pimField.length()) )
{
return MA_PIM_ERR_INDEX_INVALID;
}
if (pimField.isWriteOnly())
{
return MA_PIM_ERR_FIELD_WRITE_ONLY;
}
char[] buffer = new char[1024];
>>>>>>>
char[] buffer = new char[1024];
if ( (pimField = pimItem.getField(field)) == null )
{
return MA_PIM_ERR_FIELD_UNSUPPORTED;
}
if (pimField.isWriteOnly())
{
return MA_PIM_ERR_WRITE_ONLY;
}
<<<<<<<
throw new BigPhatError("maPimItemClose not implemented");
=======
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
pimItem.close(getContentResolver());
return MA_PIM_ERR_NONE;
>>>>>>>
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
throw new BigPhatError("Invalid PIM item handle");
}
pimItem.close(getContentResolver());
return MA_PIM_ERR_NONE;
<<<<<<<
=======
DebugPrint("maPimItemCreate");
if ((list < 0) || (!mPIMIterators.containsKey(list)))
{
return MA_PIM_ERR_HANDLE_INVALID;
}
>>>>>>>
DebugPrint("maPimItemCreate");
<<<<<<<
throw new BigPhatError("maPimItemRemove not implemented");
=======
if ((list < 0) || (!mPIMIterators.containsKey(list)))
{
return MA_PIM_ERR_HANDLE_INVALID;
}
mPIMIterator = mPIMIterators.get(list);
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
return MA_PIM_ERR_HANDLE_INVALID;
}
pimItem.delete(getContentResolver());
mPIMItems.remove(item);
if ((item == mPIMIterator) && (mPIMIterator > 0))
{
mPIMIterator--;
mPIMIterators.put(list, mPIMIterator);
}
mPIMContactsList.remove(item);
return MA_PIM_ERR_NONE;
>>>>>>>
mPIMIterator = mPIMIterators.get(list);
PIMItem pimItem = null;
if ( (item < 0) || ((pimItem = mPIMItems.get(item)) == null) )
{
throw new BigPhatError("Invalid PIM item handle");
}
pimItem.delete(getContentResolver());
mPIMItems.remove(item);
if ((item == mPIMIterator) && (mPIMIterator > 0))
{
mPIMIterator--;
mPIMIterators.put(list, mPIMIterator);
}
mPIMContactsList.remove(item);
return MA_PIM_ERR_NONE; |
<<<<<<<
import static com.mosync.internal.generated.MAAPI_consts.EVENT_TYPE_SCREEN_STATE_OFF;
import static com.mosync.internal.generated.MAAPI_consts.EVENT_TYPE_SCREEN_STATE_ON;
=======
>>>>>>>
import static com.mosync.internal.generated.MAAPI_consts.EVENT_TYPE_SCREEN_STATE_OFF;
import static com.mosync.internal.generated.MAAPI_consts.EVENT_TYPE_SCREEN_STATE_ON;
<<<<<<<
import android.content.BroadcastReceiver;
=======
import android.app.AlertDialog;
>>>>>>>
import android.content.BroadcastReceiver;
import android.app.AlertDialog;
<<<<<<<
* Turn on screen on/off events.
* @param eventsOn 1 = events on, 0 = events off
* @return 1 on success, < 0 on failure.
*/
int maScreenStateEventsOnOff(int eventsOn)
{
if (1 == eventsOn)
{
// There should be no receiver active.
if (null != mScreenActivatedReceiver)
{
return -2;
}
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_ON);
filter.addAction(Intent.ACTION_SCREEN_OFF);
mScreenActivatedReceiver = new ScreenActivatedReceiver(this);
getActivity().registerReceiver(mScreenActivatedReceiver, filter);
return 1;
}
else if (0 == eventsOn)
{
// There should be a receiver active.
if (null == mScreenActivatedReceiver)
{
return -2;
}
getActivity().unregisterReceiver(mScreenActivatedReceiver);
mScreenActivatedReceiver = null;
return 1;
}
// eventsOn was not a valid on/off flag.
return -2;
}
/**
=======
* Loads an OpenGL sub texture to the current texture handle. If the
* underlying bitmap has an alpha channel, the texture will also
* get an alpha channel.
*
* @param bitmapHandle Handle to the bitmap to load.
*
* @return 0 on success, RES_BAD_INPUT if the handle does not exist,
* and -3 if the texture could not be loaded.
*/
public int loadGlSubTexture(final int bitmapHandle)
{
// Load texture as sub texture.
return loadGlTextureHelper(bitmapHandle, true);
}
/**
* Helper method that load a bitmap as a texture or as a sub texture.
* @param bitmapHandle Texture bitmap handle.
* @param isSubTexture true if sub texture false if standard texture.
* @return A status code.
*/
private int loadGlTextureHelper(
final int bitmapHandle,
final boolean isSubTexture)
{
// Get bitmap object.
ImageCache texture = mImageResources.get(bitmapHandle);
if(texture == null)
{
// Could not find bit map object.
return RES_BAD_INPUT;
}
// Ensure that the bitmap we use has dimensions that are power of 2.
Bitmap bitmap = loadGlTextureHelperMakeBitmapPowerOf2(texture.mBitmap);
// The texture bitmap encoding.
int textureFormat = GL10.GL_RGBA;
try
{
// Load the texture into OpenGL.
if (isSubTexture)
{
GLUtils.texSubImage2D(GL10.GL_TEXTURE_2D,
0,
0,
0,
bitmap,
textureFormat,
GL10.GL_UNSIGNED_BYTE);
}
else
{
GLUtils.texImage2D(
GL10.GL_TEXTURE_2D,
0,
textureFormat,
bitmap,
0);
}
}
catch (Throwable t)
{
Log.i("MoSyncThread", "Exception in loadGlTexture: " + t.toString());
t.printStackTrace();
}
finally
{
if (bitmap != texture.mBitmap)
{
bitmap.recycle();
}
}
// Check error status.
EGL10 egl = (EGL10) EGLContext.getEGL( );
if(egl.eglGetError( ) == EGL10.EGL_SUCCESS)
{
return 0; // Success, no errors.
}
else
{
return -3; // Texture could not be loaded.
}
}
/**
* Ensures that the bitmap has width and height that is power of 2.
* @param bitmap Source bitmap.
* @return Source bitmap if it already has power of 2 dimensions,
* a new bitmap if not, that has power of 2 dimensions.
*/
private Bitmap loadGlTextureHelperMakeBitmapPowerOf2(Bitmap bitmap)
{
int width = bitmap.getWidth();
int height = bitmap.getHeight();
if (loadGlTextureHelperIsPowerOf2(width) &&
loadGlTextureHelperIsPowerOf2(height))
{
// Bitmap is already power of 2, return the
// the original bitmap.
return bitmap;
}
// Allocate new bitmap.
int newWidth = loadGlTextureHelperGetNextPowerOf2(width);
int newHeight = loadGlTextureHelperGetNextPowerOf2(height);
Bitmap newBitmap = Bitmap.createBitmap(
newWidth,
newHeight,
Bitmap.Config.ARGB_8888);
if (null == newBitmap)
{
return null;
}
// Blit original bitmap to new bitmap.
Canvas canvas = new Canvas(newBitmap);
canvas.drawBitmap(bitmap, 0.0f, 0.0f, null);
return newBitmap;
}
/**
* Tests is a number is a power of 2.
* @param n Number to test.
* @return true if number is a power of 2.
*/
private boolean loadGlTextureHelperIsPowerOf2(int n)
{
return ((0 != n) && (0 == (n & (n - 1))));
}
/**
* Return a number that is the next higher power of two after n.
* @param n Number to test.
* @return The next power of 2 number that is higher than n.
*/
private int loadGlTextureHelperGetNextPowerOf2(int n)
{
int powerOf2 = 2;
while (powerOf2 < n)
{
powerOf2 = powerOf2 << 1;
}
return powerOf2;
}
/**
>>>>>>>
* Turn on screen on/off events.
* @param eventsOn 1 = events on, 0 = events off
* @return 1 on success, < 0 on failure.
*/
int maScreenStateEventsOnOff(int eventsOn)
{
if (1 == eventsOn)
{
// There should be no receiver active.
if (null != mScreenActivatedReceiver)
{
return -2;
}
IntentFilter filter = new IntentFilter();
filter.addAction(Intent.ACTION_SCREEN_ON);
filter.addAction(Intent.ACTION_SCREEN_OFF);
mScreenActivatedReceiver = new ScreenActivatedReceiver(this);
getActivity().registerReceiver(mScreenActivatedReceiver, filter);
return 1;
}
else if (0 == eventsOn)
{
// There should be a receiver active.
if (null == mScreenActivatedReceiver)
{
return -2;
}
getActivity().unregisterReceiver(mScreenActivatedReceiver);
mScreenActivatedReceiver = null;
return 1;
}
// eventsOn was not a valid on/off flag.
return -2;
}
/**
* Loads an OpenGL sub texture to the current texture handle. If the
* underlying bitmap has an alpha channel, the texture will also
* get an alpha channel.
*
* @param bitmapHandle Handle to the bitmap to load.
*
* @return 0 on success, RES_BAD_INPUT if the handle does not exist,
* and -3 if the texture could not be loaded.
*/
public int loadGlSubTexture(final int bitmapHandle)
{
// Load texture as sub texture.
return loadGlTextureHelper(bitmapHandle, true);
}
/**
* Helper method that load a bitmap as a texture or as a sub texture.
* @param bitmapHandle Texture bitmap handle.
* @param isSubTexture true if sub texture false if standard texture.
* @return A status code.
*/
private int loadGlTextureHelper(
final int bitmapHandle,
final boolean isSubTexture)
{
// Get bitmap object.
ImageCache texture = mImageResources.get(bitmapHandle);
if(texture == null)
{
// Could not find bit map object.
return RES_BAD_INPUT;
}
// Ensure that the bitmap we use has dimensions that are power of 2.
Bitmap bitmap = loadGlTextureHelperMakeBitmapPowerOf2(texture.mBitmap);
// The texture bitmap encoding.
int textureFormat = GL10.GL_RGBA;
try
{
// Load the texture into OpenGL.
if (isSubTexture)
{
GLUtils.texSubImage2D(GL10.GL_TEXTURE_2D,
0,
0,
0,
bitmap,
textureFormat,
GL10.GL_UNSIGNED_BYTE);
}
else
{
GLUtils.texImage2D(
GL10.GL_TEXTURE_2D,
0,
textureFormat,
bitmap,
0);
}
}
catch (Throwable t)
{
Log.i("MoSyncThread", "Exception in loadGlTexture: " + t.toString());
t.printStackTrace();
}
finally
{
if (bitmap != texture.mBitmap)
{
bitmap.recycle();
}
}
// Check error status.
EGL10 egl = (EGL10) EGLContext.getEGL( );
if(egl.eglGetError( ) == EGL10.EGL_SUCCESS)
{
return 0; // Success, no errors.
}
else
{
return -3; // Texture could not be loaded.
}
}
/**
* Ensures that the bitmap has width and height that is power of 2.
* @param bitmap Source bitmap.
* @return Source bitmap if it already has power of 2 dimensions,
* a new bitmap if not, that has power of 2 dimensions.
*/
private Bitmap loadGlTextureHelperMakeBitmapPowerOf2(Bitmap bitmap)
{
int width = bitmap.getWidth();
int height = bitmap.getHeight();
if (loadGlTextureHelperIsPowerOf2(width) &&
loadGlTextureHelperIsPowerOf2(height))
{
// Bitmap is already power of 2, return the
// the original bitmap.
return bitmap;
}
// Allocate new bitmap.
int newWidth = loadGlTextureHelperGetNextPowerOf2(width);
int newHeight = loadGlTextureHelperGetNextPowerOf2(height);
Bitmap newBitmap = Bitmap.createBitmap(
newWidth,
newHeight,
Bitmap.Config.ARGB_8888);
if (null == newBitmap)
{
return null;
}
// Blit original bitmap to new bitmap.
Canvas canvas = new Canvas(newBitmap);
canvas.drawBitmap(bitmap, 0.0f, 0.0f, null);
return newBitmap;
}
/**
* Tests is a number is a power of 2.
* @param n Number to test.
* @return true if number is a power of 2.
*/
private boolean loadGlTextureHelperIsPowerOf2(int n)
{
return ((0 != n) && (0 == (n & (n - 1))));
}
/**
* Return a number that is the next higher power of two after n.
* @param n Number to test.
* @return The next power of 2 number that is higher than n.
*/
private int loadGlTextureHelperGetNextPowerOf2(int n)
{
int powerOf2 = 2;
while (powerOf2 < n)
{
powerOf2 = powerOf2 << 1;
}
return powerOf2;
}
/** |
<<<<<<<
=======
import static com.mosync.internal.generated.MAAPI_consts.MA_TOAST_DURATION_SHORT;
import static com.mosync.internal.generated.MAAPI_consts.MA_TOAST_DURATION_LONG;
>>>>>>>
import static com.mosync.internal.generated.MAAPI_consts.MA_TOAST_DURATION_SHORT;
import static com.mosync.internal.generated.MAAPI_consts.MA_TOAST_DURATION_LONG;
<<<<<<<
=======
import android.widget.Toast;
import android.provider.Settings.Secure;
import android.net.ConnectivityManager;
>>>>>>>
import android.widget.Toast;
import android.provider.Settings.Secure;
import android.net.ConnectivityManager;
<<<<<<<
import com.mosync.internal.android.extensions.MoSyncExtensionLoader;
=======
>>>>>>>
import com.mosync.internal.android.extensions.MoSyncExtensionLoader;
<<<<<<<
MoSyncExtensionLoader mMoSyncExtensionLoader;
=======
MoSyncOrientationHelper mOrientation;
>>>>>>>
MoSyncExtensionLoader mMoSyncExtensionLoader;
MoSyncOrientationHelper mOrientation;
<<<<<<<
mMoSyncExtensionLoader = MoSyncExtensionLoader.getDefault();
=======
mOrientation = new MoSyncOrientationHelper(mContext);
>>>>>>>
mMoSyncExtensionLoader = MoSyncExtensionLoader.getDefault();
mOrientation = new MoSyncOrientationHelper(mContext); |
<<<<<<<
log.warn("Cannot load group " + groupId, e);
return Optional.empty();
=======
log.warn("Cannot load group {}", groupId, e);
return missing(groupId);
>>>>>>>
log.warn("Cannot load group {}", groupId, e);
return Optional.empty();
<<<<<<<
log.warn(String.format("Cannot look up group %s by name", name.get()), e);
return Optional.empty();
=======
log.warn("Cannot lookup group {} by name", name.get(), e);
return null;
>>>>>>>
log.warn("Cannot look up group {} by name", name.get(), e);
return Optional.empty();
<<<<<<<
log.warn(String.format("Cannot look up group %s by uuid", groupUuid.get()), e);
return Optional.empty();
=======
log.warn("Cannot lookup group {} by uuid", uuid.get(), e);
return null;
>>>>>>>
log.warn("Cannot look up group {} by uuid", groupUuid.get(), e);
return Optional.empty(); |
<<<<<<<
=======
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.exceptions.WebsocketNotConnectedException;
import org.java_websocket.handshake.ServerHandshake;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSocketFactory;
import java.io.IOException;
import java.net.URI;
>>>>>>>
<<<<<<<
public class WebSocketTransmitter implements Transmitter {
private static final Logger logger = LoggerFactory.getLogger(WebSocketTransmitter.class);
private final Draft draft;
=======
public class WebSocketTransmitter implements Transmitter
{
private static final Logger logger = LogManager.getLogger(WebSocketTransmitter.class);
>>>>>>>
public class WebSocketTransmitter implements Transmitter
{
private static final Logger logger = LogManager.getLogger(WebSocketTransmitter.class);
private final Draft draft; |
<<<<<<<
final private String WSDL_CENTRAL_SYSTEM = "eu/chargetime/ocpp/OCPP_CentralSystemService_1.6.wsdl";
final private String NAMESPACE = "urn://Ocpp/Cp/2015/10";
=======
private static final Logger logger = LoggerFactory.getLogger(WebServiceListener.class);
private static final String WSDL_CENTRAL_SYSTEM = "eu/chargetime/ocpp/OCPP_CentralSystemService_1.6.wsdl";
>>>>>>>
private static final Logger logger = LoggerFactory.getLogger(WebServiceListener.class);
private static final String WSDL_CENTRAL_SYSTEM = "eu/chargetime/ocpp/OCPP_CentralSystemService_1.6.wsdl";
private static final String NAMESPACE = "urn://Ocpp/Cp/2015/10"; |
<<<<<<<
/** The mock server. */
@Deprecated // use OkHttp's MockWebServer instead (see #316)
protected ClientAndServer mockServer;
=======
>>>>>>> |
<<<<<<<
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.ibm.watson.developer_cloud.conversation.v1.model.Context;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateCounterexample;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNode;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNodeOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateEntity;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateEntityOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateExample;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateIntent;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateIntentOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateValue;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateValueOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateWorkspaceOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.DialogNodeAction;
import com.ibm.watson.developer_cloud.conversation.v1.model.InputData;
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageResponse;
import com.ibm.watson.developer_cloud.conversation.v1.model.RuntimeEntity;
import com.ibm.watson.developer_cloud.conversation.v1.model.RuntimeIntent;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateDialogNodeOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateEntityOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateIntentOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateValueOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateWorkspaceOptions;
import com.ibm.watson.developer_cloud.http.HttpHeaders;
import com.ibm.watson.developer_cloud.WatsonServiceUnitTest;
=======
>>>>>>>
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.ibm.watson.developer_cloud.conversation.v1.model.Context;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateCounterexample;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNode;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNodeOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateEntity;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateEntityOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateExample;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateIntent;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateIntentOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateValue;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateValueOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateWorkspaceOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.DialogNodeAction;
import com.ibm.watson.developer_cloud.conversation.v1.model.InputData;
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageResponse;
import com.ibm.watson.developer_cloud.conversation.v1.model.RuntimeEntity;
import com.ibm.watson.developer_cloud.conversation.v1.model.RuntimeIntent;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateDialogNodeOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateEntityOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateIntentOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateValueOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateWorkspaceOptions;
import com.ibm.watson.developer_cloud.http.HttpHeaders;
import com.ibm.watson.developer_cloud.WatsonServiceUnitTest; |
<<<<<<<
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.ibm.watson.developer_cloud.conversation.v1.model.Context;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateCounterexample;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNode;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateDialogNodeOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateEntity;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateEntityOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateExample;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateIntent;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateIntentOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateValue;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateValueOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.CreateWorkspaceOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.DialogNodeAction;
import com.ibm.watson.developer_cloud.conversation.v1.model.InputData;
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.MessageResponse;
import com.ibm.watson.developer_cloud.conversation.v1.model.RuntimeEntity;
import com.ibm.watson.developer_cloud.conversation.v1.model.RuntimeIntent;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateDialogNodeOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateEntityOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateIntentOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateValueOptions;
import com.ibm.watson.developer_cloud.conversation.v1.model.UpdateWorkspaceOptions;
import com.ibm.watson.developer_cloud.http.HttpHeaders;
import com.ibm.watson.developer_cloud.WatsonServiceUnitTest;
=======
>>>>>>> |
<<<<<<<
import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.Project;
=======
import com.google.common.flogger.FluentLogger;
>>>>>>>
import com.google.common.flogger.FluentLogger;
import com.google.gerrit.entities.BranchNameKey;
import com.google.gerrit.entities.Change;
import com.google.gerrit.entities.Project;
<<<<<<<
final Change.Key key = Change.Key.parse(tokens.get(2));
final Project.NameKey project = Project.nameKey(tokens.get(0));
final BranchNameKey branch = BranchNameKey.create(project, tokens.get(1));
for (ChangeData cd : queryProvider.get().byBranchKey(branch, key)) {
setter.addValue(cd.getId());
=======
Change.Key key = Change.Key.parse(tokens.get(2));
Project.NameKey project = new Project.NameKey(tokens.get(0));
Branch.NameKey branch = new Branch.NameKey(project, tokens.get(1));
List<ChangeData> changes = queryProvider.get().byBranchKey(branch, key);
if (!changes.isEmpty()) {
if (changes.size() > 1) {
String msg = "\"%s\": resolves to multiple changes";
logger.atSevere().log(msg, token);
throw new CmdLineException(owner, localizable(msg), token);
}
setter.addValue(changes.get(0).getId());
>>>>>>>
Change.Key key = Change.Key.parse(tokens.get(2));
Project.NameKey project = Project.nameKey(tokens.get(0));
BranchNameKey branch = BranchNameKey.create(project, tokens.get(1));
List<ChangeData> changes = queryProvider.get().byBranchKey(branch, key);
if (!changes.isEmpty()) {
if (changes.size() > 1) {
String msg = "\"%s\": resolves to multiple changes";
logger.atSevere().log(msg, token);
throw new CmdLineException(owner, localizable(msg), token);
}
setter.addValue(changes.get(0).getId()); |
<<<<<<<
import com.ibm.watson.developer_cloud.util.ResponseUtil;
import com.ibm.watson.developer_cloud.util.Validate;
import okhttp3.Call;
import okhttp3.MultipartBody;
import okhttp3.Request;
import okhttp3.RequestBody;
import java.util.List;
=======
import com.ibm.watson.developer_cloud.util.Validator;
import com.squareup.okhttp.MultipartBuilder;
import com.squareup.okhttp.Request;
import com.squareup.okhttp.RequestBody;
>>>>>>>
import com.ibm.watson.developer_cloud.util.ResponseConverterUtils;
import com.ibm.watson.developer_cloud.util.Validator;
import okhttp3.MultipartBody;
import okhttp3.Request;
import okhttp3.RequestBody;
<<<<<<<
public ServiceCall<TranslationModel> createModel(CreateModelOptions options) {
Validate.notNull(options, "options cannot be null");
Validate.notEmpty(options.getBaseModelId(), "options.baseModelId cannot be null or empty");
=======
public TranslationModel createModel(CreateModelOptions options) {
Validator.notNull(options, "options cannot be null");
Validator.notEmpty(options.getBaseModelId(), "options.baseModelId cannot be null or empty");
>>>>>>>
public ServiceCall<TranslationModel> createModel(CreateModelOptions options) {
Validator.notNull(options, "options cannot be null");
Validator.notEmpty(options.getBaseModelId(), "options.baseModelId cannot be null or empty");
<<<<<<<
return createServiceCall(createCall(requestBuilder.build3()), ResponseUtil.getLanguageListConverter());
=======
final IdentifiableLanguages languages = executeRequest(requestBuilder.build(), IdentifiableLanguages.class);
return languages.getLanguages();
>>>>>>>
ResponseConverter<List<IdentifiableLanguage>> converter =
ResponseConverterUtils.getGenericObject(TYPE_LIST_IDENTIFIABLE_LANGUAGE, "languages");
return createServiceCall(requestBuilder.build(), converter);
<<<<<<<
return createServiceCall(createCall(requestBuilder.build3()), ResponseUtil.getTranslationModelListConverter());
=======
final TranslationModels models =
executeRequest(requestBuilder.build(), TranslationModels.class);
return models.getModels();
>>>>>>>
ResponseConverter<List<TranslationModel>> converter =
ResponseConverterUtils.getGenericObject(TYPE_LIST_TRANSLATION_MODEL, "models");
return createServiceCall(requestBuilder.build(), converter);
<<<<<<<
public ServiceCall<TranslationResult> translate(final String text, final String modelId) {
Validate.isTrue(modelId != null && !modelId.isEmpty(), "modelId cannot be null or empty");
return createServiceCall(createCall(translateRequest(text, modelId, null, null)), ResponseUtil.getObjectConverter(TranslationResult.class));
=======
public TranslationResult translate(final String text, final String modelId) {
Validator.isTrue(modelId != null && !modelId.isEmpty(), "modelId cannot be null or empty");
return translateRequest(text, modelId, null, null);
>>>>>>>
public ServiceCall<TranslationResult> translate(final String text, final String modelId) {
Validator.isTrue(modelId != null && !modelId.isEmpty(), "modelId cannot be null or empty");
return translateRequest(text, modelId, null, null);
<<<<<<<
public ServiceCall<TranslationResult> translate(final String text, final String source, final String target) {
Validate.isTrue(source != null && !source.isEmpty(), "source cannot be null or empty");
Validate.isTrue(target != null && !target.isEmpty(), "target cannot be null or empty");
return createServiceCall(createCall(translateRequest(text, null, source, target)), ResponseUtil.getObjectConverter(TranslationResult.class));
=======
public TranslationResult translate(final String text, final Language source, final Language target) {
Validator.isTrue(source != null, "source cannot be null");
Validator.isTrue(target != null, "target cannot be null");
return translateRequest(text, null, source.toString(), target.toString());
>>>>>>>
public ServiceCall<TranslationResult> translate(final String text, final Language source, final Language target) {
return translateRequest(text, null, source, target);
<<<<<<<
private Request translateRequest(String text, String modelId, String source, String target) {
Validate.isTrue(text != null && !text.isEmpty(), "text cannot be null or empty");
=======
private TranslationResult translateRequest(String text, String modelId, String source,
String target) {
Validator.isTrue(text != null && !text.isEmpty(), "text cannot be null or empty");
>>>>>>>
private ServiceCall<TranslationResult> translateRequest(String text, String modelId, Language source, Language target) {
Validator.isTrue(text != null && !text.isEmpty(), "text cannot be null or empty"); |
<<<<<<<
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
=======
import jersey.repackaged.jsr166e.CompletableFuture;
import okhttp3.Credentials;
>>>>>>>
import jersey.repackaged.jsr166e.CompletableFuture;
import okhttp3.Credentials;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; |
<<<<<<<
public static UserContext ensureSignedUp(String username, String password) throws IOException {
=======
@Test
public void changePassword() throws IOException {
String username = "test" + (System.currentTimeMillis() % 10000);
String password = "password";
UserContext userContext = ensureSignedUp(username, password);
String newPassword = "newPassword";
userContext.changePassword(newPassword);
ensureSignedUp(username, newPassword);
}
public UserContext ensureSignedUp(String username, String password) throws IOException {
>>>>>>>
@Test
public void changePassword() throws IOException {
String username = "test" + (System.currentTimeMillis() % 10000);
String password = "password";
UserContext userContext = ensureSignedUp(username, password);
String newPassword = "newPassword";
userContext.changePassword(newPassword);
ensureSignedUp(username, newPassword);
}
public static UserContext ensureSignedUp(String username, String password) throws IOException { |
<<<<<<<
import peergos.shared.io.ipfs.multihash.*;
=======
import peergos.shared.ipfs.api.*;
import peergos.shared.merklebtree.*;
>>>>>>>
import peergos.shared.io.ipfs.multihash.*;
import peergos.shared.merklebtree.*;
<<<<<<<
return dhtClient.put(signer.publicSigningKey, raw)
.thenCompose(blobHash -> coreNode.getMetadataBlob(signer.publicSigningKey)
.thenCompose(currentHash -> {
=======
return dhtClient.put(signer.publicSigningKey, raw, Collections.emptyList())
.thenCompose(blobHash -> {
>>>>>>>
return dhtClient.put(signer.publicSigningKey, raw)
.thenCompose(blobHash -> { |
<<<<<<<
= constructRsaSha256Fulfillment(rsaKeyPair);
assertTrue("Invalid condition", actual.verify(actual.getCondition(), MESSAGE.getBytes()));
=======
= TestFulfillmentFactory.constructRsaSha256Fulfillment(rsaKeyPair);
assertTrue("Invalid condition", actual.verify(actual.getDerivedCondition(), MESSAGE.getBytes()));
>>>>>>>
= constructRsaSha256Fulfillment(rsaKeyPair);
assertTrue("Invalid condition", actual.verify(actual.getDerivedCondition(), MESSAGE.getBytes())); |
<<<<<<<
=======
// Construct Preimage Fulfillment/Condition #1
final PreimageSha256Fulfillment fulfillment1 = PreimageSha256Fulfillment.from(
"Roads? Where we're going, we don't need roads.".getBytes()
);
final PreimageSha256Condition condition1 = fulfillment1.getDerivedCondition();
// Construct Preimage Fulfillment/Condition #2
final PreimageSha256Fulfillment fulfillment2 = PreimageSha256Fulfillment.from(
"Great Scott!".getBytes()
);
final PreimageSha256Condition condition2 = fulfillment2.getDerivedCondition();
>>>>>>>
// Construct Preimage Fulfillment/Condition #1
final PreimageSha256Fulfillment fulfillment1 = PreimageSha256Fulfillment.from(
"Roads? Where we're going, we don't need roads.".getBytes()
);
final PreimageSha256Condition condition1 = fulfillment1.getDerivedCondition();
// Construct Preimage Fulfillment/Condition #2
final PreimageSha256Fulfillment fulfillment2 = PreimageSha256Fulfillment.from(
"Great Scott!".getBytes()
);
final PreimageSha256Condition condition2 = fulfillment2.getDerivedCondition();
<<<<<<<
// Construct a Fulfillment with both subfulfillments, and expect it to verify
// oneOfTwoCondition properly.
final ThresholdSha256Fulfillment fulfillmentWithBoth = ThresholdFactory
.constructMOfNFulfillment(
1, 2, Collections.emptyList(), Lists.newArrayList(subfulfillment1, subfulfillment2)
);
=======
// Construct a Fulfillment with both fulfillments, it should verify oneOfTwoCondition properly.
final ThresholdSha256Fulfillment fulfillmentWithBoth = ThresholdSha256Fulfillment.from(
Lists.newArrayList(condition1, condition2),
Lists.newArrayList(fulfillment1, fulfillment2)
);
>>>>>>>
// Construct a Fulfillment with both sub-fulfillments, and expect it to verify
// oneOfTwoCondition properly.
final ThresholdSha256Fulfillment fulfillmentWithBoth = ThresholdFactory
.constructMOfNFulfillment(
1, 2, Collections.emptyList(), Lists.newArrayList(subfulfillment1, subfulfillment2)
);
<<<<<<<
=======
// Construct Preimage Fulfillment/Condition #1
final PreimageSha256Fulfillment fulfillment1 = PreimageSha256Fulfillment.from(
"Roads? Where we're going, we don't need roads.".getBytes()
);
final PreimageSha256Condition condition1 = fulfillment1.getDerivedCondition();
// Construct Preimage Fulfillment/Condition #2
final PreimageSha256Fulfillment fulfillment2 = PreimageSha256Fulfillment.from(
"Great Scott!".getBytes()
);
final PreimageSha256Condition condition2 = fulfillment2.getDerivedCondition();
>>>>>>>
<<<<<<<
=======
// Construct Preimage Fulfillment/Condition #1
final PreimageSha256Fulfillment subfulfillment1 = PreimageSha256Fulfillment.from(
"Roads? Where we're going, we don't need roads.".getBytes()
);
final PreimageSha256Condition subcondition1 = subfulfillment1.getDerivedCondition();
final PreimageSha256Fulfillment subfulfillment2 = PreimageSha256Fulfillment.from(
"Roads? Where we're going, we don't need roads.".getBytes()
);
final PreimageSha256Condition subcondition2 = subfulfillment2.getDerivedCondition();
// TODO: See https://github.com/hyperledger/quilt/issues/78
// Adding two of the same conditions or fulfillments should add duplicates.
>>>>>>> |
<<<<<<<
=======
import android.graphics.drawable.BitmapDrawable;
>>>>>>>
<<<<<<<
private void resetColors() {
int songTitleTextColor = Util.resolveColor(this, R.attr.title_text_color);
int artistNameTextColor = Util.resolveColor(this, R.attr.caption_text_color);
int defaultBarColor = Util.resolveColor(this, R.attr.default_bar_color);
=======
private void setStandardColors() {
int songTitleTextColor = DialogUtils.resolveColor(this, R.attr.title_text_color);
int artistNameTextColor = DialogUtils.resolveColor(this, R.attr.caption_text_color);
int defaultBarColor = DialogUtils.resolveColor(this, R.attr.default_bar_color);
>>>>>>>
private void resetColors() {
int songTitleTextColor = DialogUtils.resolveColor(this, R.attr.title_text_color);
int artistNameTextColor = DialogUtils.resolveColor(this, R.attr.caption_text_color);
int defaultBarColor = DialogUtils.resolveColor(this, R.attr.default_bar_color); |
<<<<<<<
private static <A> A firstNonNull(A first, A second) {
if (first != null) {
return first;
} else if (second != null) {
return second;
} else {
throw new NullPointerException();
}
}
=======
/**
* A tuple with 4 named elements.
*/
private interface TreeInfo {
boolean isBoxed();
boolean isNumeric();
boolean isBoolean();
TypeMirror unboxedType();
}
>>>>>>>
/**
* A tuple with 4 named elements.
*/
private interface TreeInfo {
boolean isBoxed();
boolean isNumeric();
boolean isBoolean();
TypeMirror unboxedType();
}
private static <A> A firstNonNull(A first, A second) {
if (first != null) {
return first;
} else if (second != null) {
return second;
} else {
throw new NullPointerException();
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.