conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
public void openIndex(KnowledgeBase aKb)
{
try {
log.info("Index has been opened for KB " + aKb.getName());
}
catch (Exception e) {
log.error("Unable to open index", e);
}
}
//
// public SailRepository setupLuceneSail()
// {
// // create a sesame memory sail
// MemoryStore memoryStore = new MemoryStore();
//
// // create a lucenesail to wrap the memorystore
// LuceneSail lucenesail = new LuceneSail();
//
// // set this parameter to store the lucene index on disk
// //d
// lucenesail.setParameter(LuceneSail.LUCENE_DIR_KEY, "${repository.path}/luceneIndex");
//
// // wrap memorystore in a lucenesail
// lucenesail.setBaseSail(memoryStore);
//
// // create a Repository to access the sails
// SailRepository repository = new SailRepository(lucenesail);
// repository.initialize();
// return repository;
// }
@Override
public void indexLocalKb(KnowledgeBase aKb) throws IOException
{
Analyzer analyzer = new StandardAnalyzer();
File f = new File("${repository.path}/luceneIndex");
Directory directory = FSDirectory.open(f.toPath());
IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(analyzer));
try (RepositoryConnection conn = getConnection(aKb)) {
RepositoryResult<Statement> stmts = RdfUtils
.getStatementsSparql(conn, null, RDFS.LABEL, null, Integer.MAX_VALUE, false, null);
while (stmts.hasNext()) {
Statement stmt = stmts.next();
String id = stmt.getSubject().stringValue();
String label = stmt.getObject().stringValue();
try {
indexEntity(id, label, indexWriter);
}
catch (IOException e) {
log.error("Could not index entity with id [{}] and label [{}]", id, label);
}
}
}
indexWriter.close();
}
private void indexEntity(String aId, String aLabel, IndexWriter aIndexWriter)
throws IOException
{
String FIELD_ID = "id";
String FIELD_CONTENT = "label";
Document doc = new Document();
doc.add(new StringField(FIELD_ID, aId, Field.Store.YES));
doc.add(new StringField(FIELD_CONTENT, aLabel, Field.Store.YES));
aIndexWriter.addDocument(doc);
aIndexWriter.commit();
log.info("Entity indexed with id [{}] and label [{}]", aId, aLabel);
}
=======
/**
* Read identifier IRI and return {@link Optional} of {@link KBObject}
*
* @return {@link Optional} of {@link KBObject} of type {@link KBConcept} or {@link KBInstance}
*/
public Optional<KBObject> readKBIdentifier(Project aProject, String aIdentifier)
{
for (KnowledgeBase kb : getKnowledgeBases(aProject)) {
try (RepositoryConnection conn = getConnection(kb)) {
ValueFactory vf = conn.getValueFactory();
RepositoryResult<Statement> stmts = RdfUtils.getStatements(conn,
vf.createIRI(aIdentifier), kb.getTypeIri(), kb.getClassIri(), true);
if (stmts.hasNext()) {
KBConcept kbConcept = KBConcept.read(conn, vf.createIRI(aIdentifier), kb);
if (kbConcept != null) {
return Optional.of(kbConcept);
}
}
else if (!stmts.hasNext()) {
Optional<KBInstance> kbInstance = readInstance(kb, aIdentifier);
if (kbInstance.isPresent()) {
return kbInstance.flatMap((p) -> Optional.of(p));
}
}
}
catch (QueryEvaluationException e) {
log.error("Reading KB Entries failed.", e);
return Optional.empty();
}
}
return Optional.empty();
}
>>>>>>>
/**
* Read identifier IRI and return {@link Optional} of {@link KBObject}
*
* @return {@link Optional} of {@link KBObject} of type {@link KBConcept} or {@link KBInstance}
*/
public Optional<KBObject> readKBIdentifier(Project aProject, String aIdentifier)
{
for (KnowledgeBase kb : getKnowledgeBases(aProject)) {
try (RepositoryConnection conn = getConnection(kb)) {
ValueFactory vf = conn.getValueFactory();
RepositoryResult<Statement> stmts = RdfUtils.getStatements(conn,
vf.createIRI(aIdentifier), kb.getTypeIri(), kb.getClassIri(), true);
if (stmts.hasNext()) {
KBConcept kbConcept = KBConcept.read(conn, vf.createIRI(aIdentifier), kb);
if (kbConcept != null) {
return Optional.of(kbConcept);
}
}
else if (!stmts.hasNext()) {
Optional<KBInstance> kbInstance = readInstance(kb, aIdentifier);
if (kbInstance.isPresent()) {
return kbInstance.flatMap((p) -> Optional.of(p));
}
}
}
catch (QueryEvaluationException e) {
log.error("Reading KB Entries failed.", e);
return Optional.empty();
}
}
return Optional.empty();
}
public void openIndex(KnowledgeBase aKb)
{
try {
log.info("Index has been opened for KB " + aKb.getName());
}
catch (Exception e) {
log.error("Unable to open index", e);
}
}
//
// public SailRepository setupLuceneSail()
// {
// // create a sesame memory sail
// MemoryStore memoryStore = new MemoryStore();
//
// // create a lucenesail to wrap the memorystore
// LuceneSail lucenesail = new LuceneSail();
//
// // set this parameter to store the lucene index on disk
// //d
// lucenesail.setParameter(LuceneSail.LUCENE_DIR_KEY, "${repository.path}/luceneIndex");
//
// // wrap memorystore in a lucenesail
// lucenesail.setBaseSail(memoryStore);
//
// // create a Repository to access the sails
// SailRepository repository = new SailRepository(lucenesail);
// repository.initialize();
// return repository;
// }
@Override
public void indexLocalKb(KnowledgeBase aKb) throws IOException
{
Analyzer analyzer = new StandardAnalyzer();
File f = new File("${repository.path}/luceneIndex");
Directory directory = FSDirectory.open(f.toPath());
IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(analyzer));
try (RepositoryConnection conn = getConnection(aKb)) {
RepositoryResult<Statement> stmts = RdfUtils
.getStatementsSparql(conn, null, RDFS.LABEL, null, Integer.MAX_VALUE, false, null);
while (stmts.hasNext()) {
Statement stmt = stmts.next();
String id = stmt.getSubject().stringValue();
String label = stmt.getObject().stringValue();
try {
indexEntity(id, label, indexWriter);
}
catch (IOException e) {
log.error("Could not index entity with id [{}] and label [{}]", id, label);
}
}
}
indexWriter.close();
}
private void indexEntity(String aId, String aLabel, IndexWriter aIndexWriter)
throws IOException
{
String FIELD_ID = "id";
String FIELD_CONTENT = "label";
Document doc = new Document();
doc.add(new StringField(FIELD_ID, aId, Field.Store.YES));
doc.add(new StringField(FIELD_CONTENT, aLabel, Field.Store.YES));
aIndexWriter.addDocument(doc);
aIndexWriter.commit();
log.info("Entity indexed with id [{}] and label [{}]", aId, aLabel);
} |
<<<<<<<
public static final Variable VAR_OBJECT = var(VAR_OBJECT_NAME);
=======
public static final Variable VAR_RANGE = var(VAR_RANGE_NAME);
public static final Variable VAR_DOMAIN = var(VAR_DOMAIN_NAME);
>>>>>>>
public static final Variable VAR_OBJECT = var(VAR_OBJECT_NAME);
public static final Variable VAR_RANGE = var(VAR_RANGE_NAME);
public static final Variable VAR_DOMAIN = var(VAR_DOMAIN_NAME);
<<<<<<<
SparqlBuilder.from(Rdf.iri(kb.getDefaultDatasetIri()))));
=======
SparqlBuilder.from(iri(kb.getDefaultDatasetIri()))));
>>>>>>>
SparqlBuilder.from(iri(kb.getDefaultDatasetIri()))));
<<<<<<<
TupleQueryResult result = tupleQuery.evaluate();
List<KBHandle> handles = new ArrayList<>();
while (result.hasNext()) {
BindingSet bindings = result.next();
if (bindings.size() == 0) {
continue;
=======
try (TupleQueryResult result = tupleQuery.evaluate()) {
List<KBHandle> handles = new ArrayList<>();
while (result.hasNext()) {
BindingSet bindings = result.next();
if (bindings.size() == 0) {
continue;
}
LOG.trace("[{}] Bindings: {}", toHexString(hashCode()), bindings);
String id = bindings.getBinding(VAR_SUBJECT_NAME).getValue().stringValue();
if (!id.contains(":") || (!aAll && hasImplicitNamespace(kb, id))) {
continue;
}
KBHandle handle = new KBHandle(id);
handle.setKB(kb);
extractLabel(handle, bindings);
extractDescription(handle, bindings);
extractRange(handle, bindings);
extractDomain(handle, bindings);
handles.add(handle);
>>>>>>>
try (TupleQueryResult result = tupleQuery.evaluate()) {
List<KBHandle> handles = new ArrayList<>();
while (result.hasNext()) {
BindingSet bindings = result.next();
if (bindings.size() == 0) {
continue;
}
LOG.trace("[{}] Bindings: {}", toHexString(hashCode()), bindings);
String id = bindings.getBinding(VAR_SUBJECT_NAME).getValue().stringValue();
if (!id.contains(":") || (!aAll && hasImplicitNamespace(kb, id))) {
continue;
}
KBHandle handle = new KBHandle(id);
handle.setKB(kb);
extractLabel(handle, bindings);
extractDescription(handle, bindings);
extractRange(handle, bindings);
extractDomain(handle, bindings);
handles.add(handle); |
<<<<<<<
=======
import com.fasterxml.jackson.annotation.ObjectIdResolver;
>>>>>>>
import com.fasterxml.jackson.annotation.ObjectIdResolver; |
<<<<<<<
// remove existing annotations of this type, after all it is an
// automation, no care
clearAnnotations(aCas, type);
=======
// remove existing annotations of this type, after all it is an automation, no care
clearAnnotations(aJcas, aFeature);
>>>>>>>
// remove existing annotations of this type, after all it is an automation, no care
clearAnnotations(aCas, aFeature);
<<<<<<<
newAnnotation = aCas.createAnnotation(type, begin, end);
=======
AnnotationFS newAnnotation = aJcas.getCas().createAnnotation(type, begin, end);
>>>>>>>
AnnotationFS newAnnotation = aCas.createAnnotation(type, begin, end);
<<<<<<<
newAnnotation = aCas.createAnnotation(type, begin, end);
=======
AnnotationFS newAnnotation = aJcas.getCas().createAnnotation(type, begin,
end);
>>>>>>>
AnnotationFS newAnnotation = aCas.createAnnotation(type, begin, end);
<<<<<<<
attachType = CasUtil.getType(aCas, attachTypeName);
attachFeature = attachType.getFeatureByBaseName(attachTypeName);
=======
Type attachType = CasUtil.getType(aJcas.getCas(), attachTypeName);
attachFeature = attachType
.getFeatureByBaseName(aFeature.getLayer().getAttachFeature().getName());
>>>>>>>
Type attachType = CasUtil.getType(aCas, attachTypeName);
attachFeature = attachType.getFeatureByBaseName(attachTypeName);
<<<<<<<
LOG.info(annotations.size() + " Predictions found to be written to the CAS");
CAS cas = null;
=======
LOG.info("[{}] predictions found to be written to the CAS", annotations.size());
JCas jCas = null;
>>>>>>>
LOG.info("[{}] predictions found to be written to the CAS", annotations.size());
CAS cas = null;
<<<<<<<
cas = aRepository.readAnnotationCas(annoDocument);
automate(cas, layerFeature, annotations);
}
catch (DataRetrievalFailureException e) {
automate(cas, layerFeature, annotations);
LOG.info("Predictions found are written to the CAS");
aCorrectionDocumentService.writeCorrectionCas(cas, document);
=======
jCas = aRepository.readAnnotationCas(annoDocument);
automate(jCas, layerFeature, annotations);
// We need to clear the timestamp since we read from the annotation CAS and write
// to the correction CAS - this makes the comparison between the time stamp
// stored in the CAS and the on-disk timestamp of the correction CAS invalid
CasMetadataUtils.clearCasMetadata(jCas);
aCorrectionDocumentService.writeCorrectionCas(jCas, document);
>>>>>>>
cas = aRepository.readAnnotationCas(annoDocument);
automate(cas, layerFeature, annotations);
// We need to clear the timestamp since we read from the annotation CAS and write
// to the correction CAS - this makes the comparison between the time stamp
// stored in the CAS and the on-disk timestamp of the correction CAS invalid
CasMetadataUtils.clearCasMetadata(cas);
aCorrectionDocumentService.writeCorrectionCas(cas, document);
<<<<<<<
annotationsToRemove.addAll(select(aCas, aType));
=======
Type type = CasUtil.getType(cas, aFeature.getLayer().getName());
annotationsToRemove.addAll(select(cas, type));
>>>>>>>
Type type = CasUtil.getType(aCas, aFeature.getLayer().getName());
annotationsToRemove.addAll(select(aCas, type));
<<<<<<<
aCas.removeFsFromIndexes(annotation);
=======
if (attachFeature != null) {
// Unattach the annotation to be removed
for (AnnotationFS attach : selectCovered(attachType, annotation)) {
FeatureStructure existing = attach.getFeatureValue(attachFeature);
if (annotation.equals(existing)) {
attach.setFeatureValue(attachFeature, null);
}
}
}
cas.removeFsFromIndexes(annotation);
>>>>>>>
if (attachFeature != null) {
// Unattach the annotation to be removed
for (AnnotationFS attach : selectCovered(attachType, annotation)) {
FeatureStructure existing = attach.getFeatureValue(attachFeature);
if (annotation.equals(existing)) {
attach.setFeatureValue(attachFeature, null);
}
}
}
aCas.removeFsFromIndexes(annotation); |
<<<<<<<
import de.tudarmstadt.ukp.clarin.webanno.support.dialog.ConfirmationDialog;
=======
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
>>>>>>>
import de.tudarmstadt.ukp.clarin.webanno.model.SourceDocument;
import de.tudarmstadt.ukp.clarin.webanno.support.dialog.ConfirmationDialog;
<<<<<<<
private @SpringBean CasStorageService casStorageService;
=======
private @SpringBean FeatureSupportRegistry fsRegistry;
>>>>>>>
private @SpringBean FeatureSupportRegistry fsRegistry;
private @SpringBean CasStorageService casStorageService; |
<<<<<<<
* Call {@link KnowledgeBaseService#initStatement(KnowledgeBase, KBStatement)} after
* constructing this in order to allow upserting.
*
* @param aInstance
* {@link KBHandle} for the statement instance
* @param aProperty
* {@link KBHandle} for the statement property
* @param aValue
* Defines value for the statement
=======
* @param aInstance
* {@link KBHandle} for the statement instance
* @param aProperty
* {@link KBHandle} for the statement property
* @param aValue
* Defines value for the statement
>>>>>>>
* @param aInstance
* {@link KBHandle} for the statement instance
* @param aProperty
* {@link KBHandle} for the statement property
* @param aValue
* Defines value for the statement
<<<<<<<
public KBStatement(KBHandle aInstance, KBProperty aProperty, Value aValue)
=======
public KBStatement(String aId, KBHandle aInstance, KBHandle aProperty, Object aValue)
>>>>>>>
public KBStatement(String aId, KBHandle aInstance, KBProperty aProperty, Object aValue) |
<<<<<<<
public IRI getFtsIri()
{
return ftsIri;
}
public void setFtsIri(IRI ftsIri)
{
this.ftsIri = ftsIri;
}
=======
public IRI getLabelIri()
{
return labelIri;
}
public void setLabelIri(IRI aLabelIri)
{
labelIri = aLabelIri;
}
public IRI getPropertyTypeIri()
{
return propertyTypeIri;
}
public void setPropertyTypeIri(IRI aPropertyTypeIri)
{
propertyTypeIri = aPropertyTypeIri;
}
>>>>>>>
public IRI getLabelIri()
{
return labelIri;
}
public void setLabelIri(IRI aLabelIri)
{
labelIri = aLabelIri;
}
public IRI getPropertyTypeIri()
{
return propertyTypeIri;
}
public void setPropertyTypeIri(IRI aPropertyTypeIri)
{
propertyTypeIri = aPropertyTypeIri;
}
public IRI getFtsIri()
{
return ftsIri;
}
public void setFtsIri(IRI ftsIri)
{
this.ftsIri = ftsIri;
} |
<<<<<<<
import org.springframework.security.authentication.AuthenticationProvider;
=======
import org.springframework.security.authentication.DefaultAuthenticationEventPublisher;
>>>>>>>
import org.springframework.security.authentication.AuthenticationProvider;
import org.springframework.security.authentication.DefaultAuthenticationEventPublisher;
<<<<<<<
auth.authenticationProvider(authenticationProvider);
=======
auth.authenticationProvider(authenticationProvider());
auth.authenticationEventPublisher(new DefaultAuthenticationEventPublisher());
>>>>>>>
auth.authenticationProvider(authenticationProvider);
auth.authenticationEventPublisher(new DefaultAuthenticationEventPublisher()); |
<<<<<<<
.hasFieldOrPropertyWithValue("identifier", property.getIdentifier())
.hasFieldOrProperty("name")
.matches(h -> h.getIdentifier().startsWith(IriConstants.INCEPTION_NAMESPACE));
=======
.hasFieldOrPropertyWithValue("identifier", handle.getIdentifier())
.hasFieldOrProperty("name");
>>>>>>>
.hasFieldOrPropertyWithValue("identifier", property.getIdentifier())
.hasFieldOrProperty("name");
<<<<<<<
KBStatement mockStatement = buildStatement(kb, concept.toKBHandle(), property, "Test statement");
assertTrue(sut.statementsMatchSPO(kb, mockStatement));
=======
KBStatement mockStatement = buildStatement(kb, conceptHandle, propertyHandle,
"Test statement");
assertTrue(sut.exists(kb, mockStatement));
>>>>>>>
KBStatement mockStatement = buildStatement(kb, concept.toKBHandle(), property,
"Test statement");
assertTrue(sut.exists(kb, mockStatement));
<<<<<<<
KBStatement mockStatement = buildStatement(kb, concept.toKBHandle(), property, "Test statement");
assertFalse(sut.statementsMatchSPO(kb, mockStatement));
=======
KBStatement mockStatement = buildStatement(kb, conceptHandle, propertyHandle,
"Test statement");
assertFalse(sut.exists(kb, mockStatement));
>>>>>>>
KBStatement mockStatement = buildStatement(kb, concept.toKBHandle(), property,
"Test statement");
assertFalse(sut.exists(kb, mockStatement));
<<<<<<<
KBStatement stmt = testFixtures.buildStatement(conceptHandle, aProperty, value);
sut.initStatement(knowledgeBase, stmt);
=======
KBStatement stmt = testFixtures.buildStatement(conceptHandle, propertyHandle, value);
>>>>>>>
KBStatement stmt = testFixtures.buildStatement(conceptHandle, aProperty, value); |
<<<<<<<
import com.fasterxml.jackson.core.io.NumberInput;
=======
>>>>>>> |
<<<<<<<
private TokenObject token;
private int id;
private String label;
private String uiLabel;
private String feature;
private String source;
private double confidence;
private long recommenderId;
private boolean visible = false;
=======
private final TokenObject token;
private final int id;
private final String label;
private final String uiLabel;
private final String feature;
private final String source;
private final double confidence;
private final long recommenderId;
>>>>>>>
private final TokenObject token;
private final int id;
private final String label;
private final String uiLabel;
private final String feature;
private final String source;
private final double confidence;
private final long recommenderId;
private boolean visible = false; |
<<<<<<<
private ConfirmationDialog confirmationDialog;
=======
>>>>>>>
private ConfirmationDialog confirmationDialog;
<<<<<<<
// Open accepted recommendation in the annotation detail editor panel
VID vid = new VID(id);
annotatorState.getSelection().selectSpan(vid, jCas, begin, end);
AnnotationActionHandler aActionHandler = this.getActionHandler();
aActionHandler.actionSelect(aTarget, jCas);
// Save CAS
aActionHandler.actionCreateOrUpdate(aTarget, jCas);
=======
>>>>>>> |
<<<<<<<
TupleQuery query = QueryUtil.generateCandidateQuery(conn, processedMention,
properties.getCandidateQueryLimit());
=======
TupleQuery query = QueryUtil
.generateCandidateQuery(conn, mentionArray, properties.getCandidateQueryLimit(),
aKB.getDescriptionIri());
>>>>>>>
TupleQuery query = QueryUtil.generateCandidateQuery(conn, processedMention,
properties.getCandidateQueryLimit(), aKB.getDescriptionIri()); |
<<<<<<<
Object id = _valueDeserializer.deserialize(p, ctxt);
=======
Object id = _valueDeserializer.deserialize(jp, ctxt);
/* 02-Apr-2015, tatu: Actually, as per [databind#742], let it be;
* missing or null id is needed for some cases, such as cases where id
* will be generated externally, at a later point, and is not available
* quite yet. Typical use case is with DB inserts.
*/
if (id == null) {
return null;
}
>>>>>>>
Object id = _valueDeserializer.deserialize(p, ctxt);
/* 02-Apr-2015, tatu: Actually, as per [databind#742], let it be;
* missing or null id is needed for some cases, such as cases where id
* will be generated externally, at a later point, and is not available
* quite yet. Typical use case is with DB inserts.
*/
if (id == null) {
return null;
} |
<<<<<<<
=======
import org.eclipse.rdf4j.model.vocabulary.OWL;
import org.eclipse.rdf4j.model.vocabulary.RDF;
import org.eclipse.rdf4j.model.vocabulary.RDFS;
import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.eclipse.rdf4j.query.QueryEvaluationException;
>>>>>>>
import org.eclipse.rdf4j.query.QueryEvaluationException; |
<<<<<<<
void actionDelete(AjaxRequestTarget aTarget, DocumentMetadataAnnotationDetailPanel detailPanel)
{
if (selectedDetailPanel == detailPanel) {
selectedAnnotation = null;
selectedDetailPanel = null;
}
remove(detailPanel);
aTarget.add(this);
findParent(AnnotationPageBase.class).actionRefreshDocument(aTarget);
}
=======
>>>>>>> |
<<<<<<<
if (!isUserViewingOthersWork(state, userRepository.getCurrentUser())
&& SourceDocumentState.NEW.equals(state.getDocument().getState())) {
documentService.transitionSourceDocumentState(state.getDocument(),
NEW_TO_ANNOTATION_IN_PROGRESS);
=======
if (!isUserViewingOthersWork()) {
if (SourceDocumentState.NEW.equals(state.getDocument().getState())) {
documentService.transitionSourceDocumentState(state.getDocument(),
NEW_TO_ANNOTATION_IN_PROGRESS);
}
if (AnnotationDocumentState.NEW.equals(annotationDocument.getState())) {
documentService.transitionAnnotationDocumentState(annotationDocument,
AnnotationDocumentStateTransition.NEW_TO_ANNOTATION_IN_PROGRESS);
}
>>>>>>>
if (!isUserViewingOthersWork(state, userRepository.getCurrentUser())
&& SourceDocumentState.NEW.equals(state.getDocument().getState())) {
if (SourceDocumentState.NEW.equals(state.getDocument().getState())) {
documentService.transitionSourceDocumentState(state.getDocument(),
NEW_TO_ANNOTATION_IN_PROGRESS);
}
if (AnnotationDocumentState.NEW.equals(annotationDocument.getState())) {
documentService.transitionAnnotationDocumentState(annotationDocument,
AnnotationDocumentStateTransition.NEW_TO_ANNOTATION_IN_PROGRESS);
} |
<<<<<<<
* or field. Type of definition is either instance (of type {@link JsonSerializer})
* or Class (of {@code Class<JsonSerializer} implementation subtype);
* if value of different type is returned, a runtime exception may be thrown by caller.
=======
* or field. Type of definition is either instance (of type
* {@link JsonSerializer}) or Class (of type
* {@code Class<JsonSerializer>}; if value of different
* type is returned, a runtime exception may be thrown by caller.
>>>>>>>
* or field. Type of definition is either instance (of type {@link JsonSerializer})
* or Class (of {@code Class<JsonSerializer>} implementation subtype);
* if value of different type is returned, a runtime exception may be thrown by caller.
<<<<<<<
* Method for getting a serializer definition for keys of associated {@code java.util.Map} property.
* Type of definition is either instance (of type {@link JsonSerializer})
* or Class (of type {@code Class<JsonSerializer>});
* if value of different type is returned, a runtime exception may be thrown by caller.
=======
* Method for getting a serializer definition for keys of associated <code>Map</code> property.
* Type of definition is either instance (of type
* {@link JsonSerializer}) or Class (of type
* {@code Class<JsonSerializer>}); if value of different
* type is returned, a runtime exception may be thrown by caller.
>>>>>>>
* Method for getting a serializer definition for keys of associated {@code java.util.Map} property.
* Type of definition is either instance (of type {@link JsonSerializer})
* or Class (of type {@code Class<JsonSerializer>});
* if value of different type is returned, a runtime exception may be thrown by caller.
<<<<<<<
* associated <code>Collection</code>, <code>array</code> or {@code Map} property.
* Type of definition is either instance (of type {@link JsonSerializer})
* or Class (of type {@code Class<JsonSerializer>});
* if value of different
=======
* associated <code>Collection</code>, <code>array</code> or <code>Map</code> property.
* Type of definition is either instance (of type
* {@link JsonSerializer}) or Class (of type
* {@code Class<JsonSerializer>}); if value of different
>>>>>>>
* associated <code>Collection</code>, <code>array</code> or {@code Map} property.
* Type of definition is either instance (of type {@link JsonSerializer})
* or Class (of type {@code Class<JsonSerializer>});
* if value of different
<<<<<<<
* Type of definition is either instance (of type {@link JsonDeserializer})
* or Class (of type {@code Class<JsonDeserializer>});
=======
* Type of definition is either instance (of type
* {@link JsonDeserializer}) or Class (of type
* {@code Class<JsonDeserializer>}): if value of different
>>>>>>>
* Type of definition is either instance (of type {@link JsonDeserializer})
* or Class (of type {@code Class&<JsonDeserializer>});
<<<<<<<
* Type of definition is either instance (of type {@link JsonDeserializer})
* or Class (of type {@code Class<JsonDeserializer>});
* if value of different
=======
* Type of definition is either instance (of type
* {@link JsonDeserializer}) or Class (of type
* {@code Class<JsonDeserializer>}): if value of different
>>>>>>>
* Type of definition is either instance (of type {@link JsonDeserializer})
* or Class (of type {@code Class<JsonDeserializer>});
* if value of different
<<<<<<<
* Type of definition is either instance (of type {@link JsonDeserializer})
* or Class (of type {@code Class<JsonDeserializer>});
* if value of different
=======
* Type of definition is either instance (of type
* {@link JsonDeserializer}) or Class (of type
* {@code Class<JsonDeserializer>}): if value of different
>>>>>>>
* Type of definition is either instance (of type {@link JsonDeserializer})
* or Class (of type {@code Class<JsonDeserializer>});
* if value of different |
<<<<<<<
=======
/**
* @since 2.8
*/
>>>>>>>
<<<<<<<
String name = p.currentName();
=======
final String name = p.getCurrentName();
>>>>>>>
final String name = p.currentName(); |
<<<<<<<
void addQualifier(KnowledgeBase kb, KBQualifier newQualifier);
void deleteQualifier(KnowledgeBase kb, KBQualifier oldQualifier);
void upsertQualifier(KnowledgeBase kb, KBQualifier aQualifier);
List<KBQualifier> listQualifiers(KnowledgeBase kb, KBStatement aStatement);
=======
RepositoryConnection getConnection(KnowledgeBase kb);
interface ReadAction<T>
{
T accept(RepositoryConnection aConnection);
}
<T> T read(KnowledgeBase kb, ReadAction<T> aAction);
List<KBHandle> list(KnowledgeBase kb, IRI aType, boolean aIncludeInferred, boolean
aAll);
>>>>>>>
RepositoryConnection getConnection(KnowledgeBase kb);
interface ReadAction<T>
{
T accept(RepositoryConnection aConnection);
}
<T> T read(KnowledgeBase kb, ReadAction<T> aAction);
List<KBHandle> list(KnowledgeBase kb, IRI aType, boolean aIncludeInferred, boolean
aAll);
void addQualifier(KnowledgeBase kb, KBQualifier newQualifier);
void deleteQualifier(KnowledgeBase kb, KBQualifier oldQualifier);
void upsertQualifier(KnowledgeBase kb, KBQualifier aQualifier);
List<KBQualifier> listQualifiers(KnowledgeBase kb, KBStatement aStatement); |
<<<<<<<
=======
private LoadingCache<AnnotationLayer, Boolean> hasLinkFeatureCache;
>>>>>>>
private LoadingCache<AnnotationLayer, Boolean> hasLinkFeatureCache; |
<<<<<<<
import org.springframework.test.context.ContextConfiguration;
=======
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.security.core.session.SessionRegistry;
>>>>>>>
import org.springframework.security.core.session.SessionRegistry;
import org.springframework.test.context.ContextConfiguration; |
<<<<<<<
=======
/**
* List the properties for a specific accepted domain identifier and also
* include properties which do not have any domain specified.
*
* @param kb
* The knowledge base
* @param aDomain
* a domain identifier.
* @param aIncludeInferred
* indicates whether inferred statements should be included in the result.
* @param aAll
* indicates whether to include base properties or not
* @return All properties for a specific accepted domain identifier
*/
>>>>>>>
/**
* List the properties for a specific accepted domain identifier and also
* include properties which do not have any domain specified.
*
* @param kb
* The knowledge base
* @param aDomain
* a domain identifier.
* @param aIncludeInferred
* indicates whether inferred statements should be included in the result.
* @param aAll
* indicates whether to include base properties or not
* @return All properties for a specific accepted domain identifier
*/
<<<<<<<
=======
/**
* List the properties
*
* @param kb
* The knowledge base
* @param aType
* a {@link IRI} for type of property
* @param aIncludeInferred
* indicates whether inferred statements should be included in the result.
* @param aAll
* indicates whether to include base properties or not
* @return All properties
*/
>>>>>>>
/**
* List the properties
*
* @param kb
* The knowledge base
* @param aType
* a {@link IRI} for type of property
* @param aIncludeInferred
* indicates whether inferred statements should be included in the result.
* @param aAll
* indicates whether to include base properties or not
* @return All properties
*/
<<<<<<<
/**
* Read an identifier value from a particular kb to return {@link KBObject}
* @param akb
* @param aIdentifier
* @return {@link Optional} of {@link KBObject} of type {@link KBConcept} or {@link KBInstance}
*/
Optional<KBObject> readKBIdentifier(KnowledgeBase akb, String aIdentifier);
List<KBHandle> getParentConceptsForConcept(KnowledgeBase aKB, String aIdentifier,
boolean aAll)
=======
/**
* Retrieves the parent concept for an identifier
*
* @param aKB The knowledge base
* @param aIdentifier a concept identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @return List of parent concept for an identifier
*/
List<KBHandle> getParentConcept(KnowledgeBase aKB, String aIdentifier, boolean aAll)
>>>>>>>
/**
* Read an identifier value from a particular kb to return {@link KBObject}
* @param akb
* @param aIdentifier
* @return {@link Optional} of {@link KBObject} of type {@link KBConcept} or {@link KBInstance}
*/
Optional<KBObject> readKBIdentifier(KnowledgeBase akb, String aIdentifier);
* Retrieves the parent concept for a concept identifier
*
* @param aKB The knowledge base
* @param aIdentifier a concept identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @return List of parent concept for an identifier
*/
List<KBHandle> getParentConceptsForConcept(KnowledgeBase aKB, String aIdentifier,
boolean aAll)
<<<<<<<
=======
/**
* Read an identifier value from a particular kb to return {@link KBObject}
* @param kb
* @param aIdentifier
* @return {@link Optional} of {@link KBObject} of type {@link KBConcept} or {@link KBInstance}
*/
Optional<KBObject> readKBIdentifier(KnowledgeBase kb, String aIdentifier);
>>>>>>> |
<<<<<<<
public static String aLimit = "1000";
=======
public static int aLimit = 1000;
>>>>>>>
public static int aLimit = 1000;
<<<<<<<
, "LIMIT 10000");
//Query to get property specific domain elements
public static String PROPERTYLIST_DOMAIN_DEPENDENT = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?s rdfs:domain/(owl:unionOf/rdf:rest*/rdf:first)* ?aDomain "
, " OPTIONAL {"
, " ?s ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT 10000");
//Query to get property specific range elements
public static String PROPERTY_SPECIFIC_RANGE = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?aProperty rdfs:range/(owl:unionOf/rdf:rest*/rdf:first)* ?s "
, " OPTIONAL {"
, " ?aProperty ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT 10000");
// Query to retrieve super class concept for a concept
public static String PARENT_CONCEPT = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE { "
, " {?oChild ?pSUBCLASS ?s . }"
, " UNION { ?s ?pTYPE ?oCLASS ."
, " ?oChild owl:intersectionOf ?list . "
, " FILTER EXISTS {?list rdf:rest*/rdf:first ?s. } }"
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} ");
// Query to retrieve concept for an instance
public static String CONCEPT_FOR_INSTANCE = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?pInstance ?pTYPE ?s ."
, " OPTIONAL {"
, " ?pInstance ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT 10000");
=======
, "LIMIT " + aLimit);
>>>>>>>
, "LIMIT " + aLimit);
//Query to get property specific domain elements
public static String PROPERTYLIST_DOMAIN_DEPENDENT = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?s rdfs:domain/(owl:unionOf/rdf:rest*/rdf:first)* ?aDomain "
, " OPTIONAL {"
, " ?s ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT " + aLimit);
//Query to get property specific range elements
public static String PROPERTY_SPECIFIC_RANGE = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?aProperty rdfs:range/(owl:unionOf/rdf:rest*/rdf:first)* ?s "
, " OPTIONAL {"
, " ?aProperty ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT " + aLimit);
// Query to retrieve super class concept for a concept
public static String PARENT_CONCEPT = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE { "
, " {?oChild ?pSUBCLASS ?s . }"
, " UNION { ?s ?pTYPE ?oCLASS ."
, " ?oChild owl:intersectionOf ?list . "
, " FILTER EXISTS {?list rdf:rest*/rdf:first ?s. } }"
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} ");
// Query to retrieve concept for an instance
public static String CONCEPT_FOR_INSTANCE = String.join("\n"
, SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE {"
, " ?pInstance ?pTYPE ?s ."
, " OPTIONAL {"
, " ?pInstance ?pLABEL ?l ."
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\"))"
, " }"
, "}"
, "LIMIT " + aLimit); |
<<<<<<<
import de.agilecoders.wicket.core.markup.html.bootstrap.form.BootstrapRadioChoice;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxButton;
import de.tudarmstadt.ukp.inception.workload.dynamic.model.WorkloadAndWorkflowService;
=======
import java.util.ArrayList;
import java.util.List;
>>>>>>>
import static de.tudarmstadt.ukp.inception.workload.dynamic.api.WorkloadConst.DEFAULT_MONITORING;
import static de.tudarmstadt.ukp.inception.workload.dynamic.api.WorkloadConst.DEFAULT_WORKFLOW;
import static de.tudarmstadt.ukp.inception.workload.dynamic.api.WorkloadConst.DYNAMIC_WORKFLOW;
import static de.tudarmstadt.ukp.inception.workload.dynamic.api.WorkloadConst.WORKLOAD_MONITORING;
import java.util.ArrayList;
import java.util.List;
<<<<<<<
import java.util.ArrayList;
import java.util.List;
import static de.tudarmstadt.ukp.inception.workload.dynamic.api.WorkloadConst.*;
=======
import de.agilecoders.wicket.core.markup.html.bootstrap.form.BootstrapRadioChoice;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxButton;
import de.tudarmstadt.ukp.inception.workload.dynamic.manager.WorkflowProperties;
import de.tudarmstadt.ukp.inception.workload.dynamic.manager.WorkloadProperties;
>>>>>>>
import de.agilecoders.wicket.core.markup.html.bootstrap.form.BootstrapRadioChoice;
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaAjaxButton;
import de.tudarmstadt.ukp.inception.workload.dynamic.model.WorkloadAndWorkflowService;
<<<<<<<
private final List<String> workflow;
private final BootstrapRadioChoice<String> workflowChoices;
private final List<String> monitoring;
private final BootstrapRadioChoice<String> monitoringChoices;
private final Project project;
=======
private final List<String> workflow;
private final BootstrapRadioChoice<String> workflowChoices;
private final List<String> monitoring;
private final BootstrapRadioChoice<String> monitoringChoices;
>>>>>>>
private final List<String> workflow;
private final BootstrapRadioChoice<String> workflowChoices;
private final List<String> monitoring;
private final BootstrapRadioChoice<String> monitoringChoices;
private final Project project;
<<<<<<<
monitoring = new ArrayList<>();
monitoring.add(DEFAULT_MONITORING);
monitoring.add(WORKLOAD_MONITORING);
=======
monitoring = new ArrayList<>();
monitoring.add("Default monitoring page");
monitoring.add("Workload monitoring page");
monitoringChoices = new BootstrapRadioChoice<>("monitoringRadios",
new Model<>(getString("defaultMonitoring")), monitoring);
monitoringChoices.setInline(true);
monitoringChoices.setOutputMarkupId(true);
//Set default value for the group
monitoringChoices.setModel(new Model<>(workloadProperties.getProperty()));
>>>>>>>
monitoring = new ArrayList<>();
monitoring.add(DEFAULT_MONITORING);
monitoring.add(WORKLOAD_MONITORING);
<<<<<<<
add(form);
}
@Override
protected void onInitialize()
{
super.onInitialize();
IModel<String> resourceModel = new StringResourceModel(
getString(getId()), this, Model.of(getId()));
}
@Deprecated
private void actionConfirm(AjaxRequestTarget aTarget, Form<?> aForm)
{
aTarget.addChildren(getPage(), IFeedback.class);
if (monitoringChoices.getDefaultModelObjectAsString().equals(monitoring.get(0))) {
workloadAndWorkflowService.setWorkloadManager(DEFAULT_MONITORING, project);
} else {
workloadAndWorkflowService.setWorkloadManager(WORKLOAD_MONITORING, project);
}
if (workflowChoices.getDefaultModelObjectAsString().equals(workflow.get(0))) {
workloadAndWorkflowService.setWorkflowManager(DEFAULT_WORKFLOW, project);
} else {
workloadAndWorkflowService.setWorkflowManager(DYNAMIC_WORKFLOW, project);
}
success("Workflow and workload settings changed");
=======
add(form);
}
@Override
protected void onInitialize()
{
super.onInitialize();
IModel<String> resourceModel = new StringResourceModel(
getString(getId()), this, Model.of(getId()));
}
@Deprecated
private void actionConfirm(AjaxRequestTarget aTarget, Form<?> aForm)
{
aTarget.addChildren(getPage(), IFeedback.class);
if (monitoringChoices.getDefaultModelObjectAsString().equals(monitoring.get(0))) {
workloadProperties.setActive(false);
} else {
workloadProperties.setActive(true);
}
if (workflowChoices.getDefaultModelObjectAsString().equals(workflow.get(0))) {
workflowProperties.setActive(false);
} else {
workflowProperties.setActive(true);
}
success("Workflow and workload settings changed");
>>>>>>>
add(form);
}
@Override
protected void onInitialize()
{
super.onInitialize();
IModel<String> resourceModel = new StringResourceModel(
getString(getId()), this, Model.of(getId()));
}
@Deprecated
private void actionConfirm(AjaxRequestTarget aTarget, Form<?> aForm) {
aTarget.addChildren(getPage(), IFeedback.class);
if (monitoringChoices.getDefaultModelObjectAsString().equals(monitoring.get(0))) {
workloadAndWorkflowService.setWorkloadManager(DEFAULT_MONITORING, project);
} else {
workloadAndWorkflowService.setWorkloadManager(WORKLOAD_MONITORING, project);
}
if (workflowChoices.getDefaultModelObjectAsString().equals(workflow.get(0))) {
workloadAndWorkflowService.setWorkflowManager(DEFAULT_WORKFLOW, project);
} else {
workloadAndWorkflowService.setWorkflowManager(DYNAMIC_WORKFLOW, project);
success("Workflow and workload settings changed");
} |
<<<<<<<
DateFormat df = _force(_dateFormat, tz);
return new BaseSettings(_annotationIntrospector, _propertyNamingStrategy, _accessorNaming,
_defaultTyper, _typeValidator, df, _handlerInstantiator, _locale,
tz, _defaultBase64, _nodeFactory);
=======
// 18-Oct-2020, tatu: Should allow use of `null` to revert back to "Default",
// commented out handling used before 2.12
// if (tz == null) {
// throw new IllegalArgumentException();
// }
DateFormat df = _force(_dateFormat, (tz == null) ? DEFAULT_TIMEZONE : tz);
return new BaseSettings(_classIntrospector, _annotationIntrospector,
_propertyNamingStrategy, _typeFactory,
_typeResolverBuilder, df, _handlerInstantiator, _locale,
tz, _defaultBase64, _typeValidator, _accessorNaming);
>>>>>>>
DateFormat df = _force(_dateFormat, (tz == null) ? DEFAULT_TIMEZONE : tz);
return new BaseSettings(_annotationIntrospector, _propertyNamingStrategy, _accessorNaming,
_defaultTyper, _typeValidator, df, _handlerInstantiator, _locale,
tz, _defaultBase64, _nodeFactory); |
<<<<<<<
import org.eclipse.rdf4j.model.vocabulary.RDFS;
=======
import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
>>>>>>>
import org.eclipse.rdf4j.model.vocabulary.XMLSchema;
import org.eclipse.rdf4j.model.vocabulary.RDFS;
<<<<<<<
List<KBHandle> resultList = new ArrayList<>();
resultList = read(kb, (conn) -> {
String QUERY = String.join("\n"
, SPARQLQueryStore.SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE { "
, " { ?s ?pTYPE ?oCLASS . } "
, " UNION { ?someSubClass ?pSUBCLASS ?s . } ."
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} "
, "LIMIT 10000" );
=======
List<KBHandle> resultList;
resultList = read(aKB, (conn) -> {
String QUERY = SPARQLQueryStore.queryForAllConceptList(aKB);
>>>>>>>
List<KBHandle> resultList;
resultList = read(aKB, (conn) -> {
String QUERY = SPARQLQueryStore.queryForAllConceptList(aKB);
<<<<<<<
resultList = read(kb, (conn) -> {
String QUERY = String.join("\n"
, SPARQLQueryStore.SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE { "
, " { ?s ?pTYPE ?oCLASS . } "
, " UNION { ?someSubClass ?pSUBCLASS ?s . } ."
, " FILTER NOT EXISTS { "
, " ?s ?pSUBCLASS ?otherSub . "
, " FILTER (?s != ?otherSub) }"
, " FILTER NOT EXISTS { "
, " ?s owl:intersectionOf ?list . }"
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} "
, "LIMIT " + SPARQLQueryStore.aLimit);
=======
resultList = read(aKB, (conn) -> {
String QUERY = SPARQLQueryStore.listRootConcepts(aKB);
>>>>>>>
resultList = read(aKB, (conn) -> {
String QUERY = SPARQLQueryStore.listRootConcepts(aKB);
<<<<<<<
=======
>>>>>>>
<<<<<<<
String QUERY = String.join("\n"
, SPARQLQueryStore.SPARQL_PREFIX
, "SELECT DISTINCT ?s ?l WHERE { "
, " {?s ?pSUBCLASS ?oPARENT . }"
, " UNION { ?s ?pTYPE ?oCLASS ."
, " ?s owl:intersectionOf ?list . "
, " FILTER EXISTS { ?list rdf:rest*/rdf:first ?oPARENT} }"
, " OPTIONAL { "
, " ?s ?pLABEL ?l . "
, " FILTER(LANG(?l) = \"\" || LANGMATCHES(LANG(?l), \"en\")) "
, " } "
, "} "
, "LIMIT " + aLimit);
=======
String QUERY = SPARQLQueryStore.listChildConcepts(aKB);
>>>>>>>
String QUERY = SPARQLQueryStore.listChildConcepts(aKB);
<<<<<<<
=======
>>>>>>>
<<<<<<<
=======
>>>>>>>
<<<<<<<
public void openIndex(KnowledgeBase aKb)
{
try {
log.info("Index has been opened for KB " + aKb.getName());
}
catch (Exception e) {
log.error("Unable to open index", e);
}
}
//
// public SailRepository setupLuceneSail()
// {
// // create a sesame memory sail
// MemoryStore memoryStore = new MemoryStore();
//
// // create a lucenesail to wrap the memorystore
// LuceneSail lucenesail = new LuceneSail();
//
// // set this parameter to store the lucene index on disk
// //d
// lucenesail.setParameter(LuceneSail.LUCENE_DIR_KEY, "${repository.path}/luceneIndex");
//
// // wrap memorystore in a lucenesail
// lucenesail.setBaseSail(memoryStore);
//
// // create a Repository to access the sails
// SailRepository repository = new SailRepository(lucenesail);
// repository.initialize();
// return repository;
// }
@Override
public void indexLocalKb(KnowledgeBase aKb) throws IOException
{
Analyzer analyzer = new StandardAnalyzer();
File f = new File("${repository.path}/luceneIndex");
Directory directory = FSDirectory.open(f.toPath());
IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(analyzer));
try (RepositoryConnection conn = getConnection(aKb)) {
RepositoryResult<Statement> stmts = RdfUtils
.getStatementsSparql(conn, null, RDFS.LABEL, null, Integer.MAX_VALUE, false, null);
while (stmts.hasNext()) {
Statement stmt = stmts.next();
String id = stmt.getSubject().stringValue();
String label = stmt.getObject().stringValue();
try {
indexEntity(id, label, indexWriter);
}
catch (IOException e) {
log.error("Could not index entity with id [{}] and label [{}]", id, label);
}
}
}
indexWriter.close();
}
private void indexEntity(String aId, String aLabel, IndexWriter aIndexWriter)
throws IOException
{
String FIELD_ID = "id";
String FIELD_CONTENT = "label";
Document doc = new Document();
doc.add(new StringField(FIELD_ID, aId, Field.Store.YES));
doc.add(new StringField(FIELD_CONTENT, aLabel, Field.Store.YES));
aIndexWriter.addDocument(doc);
aIndexWriter.commit();
log.info("Entity indexed with id [{}] and label [{}]", aId, aLabel);
}
=======
>>>>>>>
public void openIndex(KnowledgeBase aKb)
{
try {
log.info("Index has been opened for KB " + aKb.getName());
}
catch (Exception e) {
log.error("Unable to open index", e);
}
}
//
// public SailRepository setupLuceneSail()
// {
// // create a sesame memory sail
// MemoryStore memoryStore = new MemoryStore();
//
// // create a lucenesail to wrap the memorystore
// LuceneSail lucenesail = new LuceneSail();
//
// // set this parameter to store the lucene index on disk
// //d
// lucenesail.setParameter(LuceneSail.LUCENE_DIR_KEY, "${repository.path}/luceneIndex");
//
// // wrap memorystore in a lucenesail
// lucenesail.setBaseSail(memoryStore);
//
// // create a Repository to access the sails
// SailRepository repository = new SailRepository(lucenesail);
// repository.initialize();
// return repository;
// }
@Override
public void indexLocalKb(KnowledgeBase aKb) throws IOException
{
Analyzer analyzer = new StandardAnalyzer();
File f = new File("${repository.path}/luceneIndex");
Directory directory = FSDirectory.open(f.toPath());
IndexWriter indexWriter = new IndexWriter(directory, new IndexWriterConfig(analyzer));
try (RepositoryConnection conn = getConnection(aKb)) {
RepositoryResult<Statement> stmts = RdfUtils
.getStatementsSparql(conn, null, RDFS.LABEL, null, Integer.MAX_VALUE, false, null);
while (stmts.hasNext()) {
Statement stmt = stmts.next();
String id = stmt.getSubject().stringValue();
String label = stmt.getObject().stringValue();
try {
indexEntity(id, label, indexWriter);
}
catch (IOException e) {
log.error("Could not index entity with id [{}] and label [{}]", id, label);
}
}
}
indexWriter.close();
}
private void indexEntity(String aId, String aLabel, IndexWriter aIndexWriter)
throws IOException
{
String FIELD_ID = "id";
String FIELD_CONTENT = "label";
Document doc = new Document();
doc.add(new StringField(FIELD_ID, aId, Field.Store.YES));
doc.add(new StringField(FIELD_CONTENT, aLabel, Field.Store.YES));
aIndexWriter.addDocument(doc);
aIndexWriter.commit();
log.info("Entity indexed with id [{}] and label [{}]", aId, aLabel);
} |
<<<<<<<
vdoc, cas.getDocumentText(), annotationService, aPdfExtractFile);
=======
vdoc, jCas.getDocumentText(), annotationService, pdfExtractFile);
>>>>>>>
vdoc, cas.getDocumentText(), annotationService, pdfExtractFile);
<<<<<<<
/**
* Renders the PdfAnnoModel.
* This includes the anno file and the color map.
*/
public void renderPdfAnnoModel(AjaxRequestTarget aTarget, String aPdftxt)
{
renderPdfAnnoModel(aTarget, new PdfExtractFile(aPdftxt));
}
public void createSpanAnnotation(AjaxRequestTarget aTarget, IRequestParameters aParams,
CAS aCas, PdfExtractFile aPdfExtractFile)
=======
public void createSpanAnnotation(
AjaxRequestTarget aTarget, IRequestParameters aParams, JCas aJCas)
>>>>>>>
public void createSpanAnnotation(
AjaxRequestTarget aTarget, IRequestParameters aParams, CAS aCas)
<<<<<<<
Offset docOffset = PdfAnnoRenderer
.convertToDocumentOffset(aCas.getDocumentText(), aPdfExtractFile, offset);
if (docOffset != null) {
=======
Offset docOffset =
PdfAnnoRenderer.convertToDocumentOffset(offset, documentModel, pdfExtractFile);
if (docOffset.getBegin() > -1 && docOffset.getEnd() > -1) {
>>>>>>>
Offset docOffset =
PdfAnnoRenderer.convertToDocumentOffset(offset, documentModel, pdfExtractFile);
if (docOffset.getBegin() > -1 && docOffset.getEnd() > -1) {
<<<<<<<
.selectSpan(aCas, docOffset.getBegin(), docOffset.getEnd());
getActionHandler().actionCreateOrUpdate(aTarget, aCas);
renderPdfAnnoModel(aTarget, aPdfExtractFile.getPdftxt());
=======
.selectSpan(aJCas, docOffset.getBegin(), docOffset.getEnd());
getActionHandler().actionCreateOrUpdate(aTarget, aJCas);
>>>>>>>
.selectSpan(aCas, docOffset.getBegin(), docOffset.getEnd());
getActionHandler().actionCreateOrUpdate(aTarget, aCas);
<<<<<<<
private void selectSpanAnnotation(AjaxRequestTarget aTarget, IRequestParameters aParams,
CAS aCas, PdfExtractFile aPdfExtractFile)
=======
private void selectSpanAnnotation(
AjaxRequestTarget aTarget, IRequestParameters aParams, JCas aJCas)
>>>>>>>
private void selectSpanAnnotation(
AjaxRequestTarget aTarget, IRequestParameters aParams, CAS aCas)
<<<<<<<
Offset docOffset = PdfAnnoRenderer
.convertToDocumentOffset(aCas.getDocumentText(), aPdfExtractFile, offset);
if (docOffset != null) {
=======
Offset docOffset =
PdfAnnoRenderer.convertToDocumentOffset(offset, documentModel, pdfExtractFile);
if (docOffset.getBegin() > -1 && docOffset.getEnd() > -1) {
>>>>>>>
Offset docOffset =
PdfAnnoRenderer.convertToDocumentOffset(offset, documentModel, pdfExtractFile);
if (docOffset.getBegin() > -1 && docOffset.getEnd() > -1) {
<<<<<<<
private void createRelationAnnotation(AjaxRequestTarget aTarget, IRequestParameters aParams,
CAS aCas, PdfExtractFile aPdfExtractFile)
=======
private void createRelationAnnotation(
AjaxRequestTarget aTarget, IRequestParameters aParams, JCas aJCas)
>>>>>>>
private void createRelationAnnotation(AjaxRequestTarget aTarget, IRequestParameters aParams,
CAS aCas)
<<<<<<<
private void selectRelationAnnotation(AjaxRequestTarget aTarget, IRequestParameters aParams,
CAS aCas)
throws IOException
=======
private void selectRelationAnnotation(
AjaxRequestTarget aTarget, IRequestParameters aParams, JCas aJCas)
>>>>>>>
private void selectRelationAnnotation(
AjaxRequestTarget aTarget, IRequestParameters aParams, CAS aCas)
<<<<<<<
private void deleteRecommendation(AjaxRequestTarget aTarget, IRequestParameters aParams,
CAS aCas, PdfExtractFile aPdfExtractFile)
=======
private void deleteRecommendation(
AjaxRequestTarget aTarget, IRequestParameters aParams, JCas aJCas)
>>>>>>>
private void deleteRecommendation(
AjaxRequestTarget aTarget, IRequestParameters aParams, CAS aCas)
<<<<<<<
Offset docOffset = PdfAnnoRenderer
.convertToDocumentOffset(aCas.getDocumentText(), aPdfExtractFile, offset);
if (docOffset != null) {
=======
Offset docOffset =
PdfAnnoRenderer.convertToDocumentOffset(offset, documentModel, pdfExtractFile);
if (docOffset.getBegin() > -1 && docOffset.getEnd() > -1) {
>>>>>>>
Offset docOffset =
PdfAnnoRenderer.convertToDocumentOffset(offset, documentModel, pdfExtractFile);
if (docOffset.getBegin() > -1 && docOffset.getEnd() > -1) { |
<<<<<<<
=======
return handles;
}
private AnnotationFeature getLinkedAnnotationFeature() {
String linkedType = this.getModelObject().feature.getType();
AnnotationLayer linkedLayer = annotationService
.getLayer(linkedType, this.stateModel.getObject().getProject());
AnnotationFeature linkedAnnotationFeature = annotationService
.getFeature(FactLinkingConstants.LINKED_LAYER_FEATURE, linkedLayer);
return linkedAnnotationFeature;
}
private ConceptFeatureTraits readFeatureTraits(AnnotationFeature aAnnotationFeature) {
FeatureSupport<ConceptFeatureTraits> fs = featureSupportRegistry
.getFeatureSupport(aAnnotationFeature);
ConceptFeatureTraits traits = fs.readTraits(aAnnotationFeature);
return traits;
}
private boolean featureUsesDisabledKB(ConceptFeatureTraits aTraits)
{
Optional<KnowledgeBase> kb = Optional.empty();
String repositoryId = aTraits.getRepositoryId();
if (repositoryId != null) {
kb = kbService.getKnowledgeBaseById(getModelObject().feature.getProject(),
aTraits.getRepositoryId());
}
return kb.isPresent() && !kb.get().isEnabled() || repositoryId != null && !kb.isPresent();
}
private List<KBHandle> getInstances(ConceptFeatureTraits traits, Project project,
AnnotationActionHandler aHandler, String aTypedString)
{
List<KBHandle> handles = new ArrayList<>();
if (traits.getRepositoryId() != null) {
// If a specific KB is selected, get its instances
Optional<KnowledgeBase> kb = kbService
.getKnowledgeBaseById(project, traits.getRepositoryId());
if (kb.isPresent()) {
//TODO: (#122) see ConceptFeatureEditor
if (kb.get().isSupportConceptLinking()) {
handles.addAll(
listLinkingInstances(kb.get(), () -> getEditorCas(aHandler), aTypedString));
}
else if (traits.getScope() != null) {
handles = kbService
.listInstancesForChildConcepts(kb.get(), traits.getScope(), false, 50)
.stream().filter(inst -> inst.getUiLabel().contains(aTypedString))
.collect(Collectors.toList());
}
else {
for (KBHandle concept : kbService.listConcepts(kb.get(), false)) {
handles.addAll(
kbService.listInstances(kb.get(), concept.getIdentifier(), false));
}
}
}
}
else {
// If no specific KB is selected, collect instances from all KBs
for (KnowledgeBase kb : kbService.getEnabledKnowledgeBases(project)) {
//TODO: (#122) see ConceptFeatureEditor
if (kb.isSupportConceptLinking()) {
handles.addAll(
listLinkingInstances(kb, () -> getEditorCas(aHandler), aTypedString));
}
else if (traits.getScope() != null) {
handles.addAll(
kbService.listInstancesForChildConcepts(kb, traits.getScope(), false, 50)
.stream().filter(inst -> inst.getUiLabel().contains(aTypedString))
.collect(Collectors.toList()));
}
else {
for (KBHandle concept : kbService.listConcepts(kb, false)) {
handles.addAll(kbService.listInstances(kb, concept.getIdentifier(), false));
}
}
}
}
return handles;
}
private List<KBHandle> getConcepts(ConceptFeatureTraits traits, Project project,
AnnotationActionHandler aHandler, String aTypedString)
{
List<KBHandle> handles = new ArrayList<>();
if (traits.getRepositoryId() != null) {
// If a specific KB is selected, get its instances
Optional<KnowledgeBase> kb = kbService
.getKnowledgeBaseById(project, traits.getRepositoryId());
if (kb.isPresent()) {
//TODO: (#122) see ConceptFeatureEditor
if (kb.get().isSupportConceptLinking()) {
handles.addAll(
listLinkingInstances(kb.get(), () -> getEditorCas(aHandler), aTypedString));
}
else if (traits.getScope() != null) {
handles = kbService.listChildConcepts(kb.get(), traits.getScope(), false)
.stream().filter(conc -> conc.getUiLabel().contains(aTypedString))
.collect(Collectors.toList());
}
else {
handles.addAll(kbService.listConcepts(kb.get(), false));
}
}
}
else {
// If no specific KB is selected, collect instances from all KBs
for (KnowledgeBase kb : kbService.getEnabledKnowledgeBases(project)) {
//TODO: (#122) see ConceptFeatureEditor
if (kb.isSupportConceptLinking()) {
handles.addAll(
listLinkingInstances(kb, () -> getEditorCas(aHandler), aTypedString));
}
else if (traits.getScope() != null) {
handles = kbService.listChildConcepts(kb, traits.getScope(), false).stream()
.filter(conc -> conc.getUiLabel().contains(aTypedString))
.collect(Collectors.toList());
}
else {
handles.addAll(kbService.listConcepts(kb, false));
}
>>>>>>> |
<<<<<<<
protected VDocument render(CAS aCas, int windowBeginOffset, int windowEndOffset)
=======
protected VDocument render(JCas aJCas, int aWindowBeginOffset, int aWindowEndOffset)
>>>>>>>
protected VDocument render(CAS aCas, int aWindowBeginOffset, int aWindowEndOffset)
<<<<<<<
preRenderer.render(vdoc, windowBeginOffset, windowEndOffset,
aCas, getLayersToRender());
=======
preRenderer.render(vdoc, aWindowBeginOffset, aWindowEndOffset,
aJCas, getLayersToRender());
>>>>>>>
preRenderer.render(vdoc, aWindowBeginOffset, aWindowEndOffset,
aCas, getLayersToRender());
<<<<<<<
extensionRegistry.fireRender(aCas, getModelObject(), vdoc);
=======
extensionRegistry.fireRender(aJCas, getModelObject(), vdoc,
aWindowBeginOffset, aWindowEndOffset);
>>>>>>>
extensionRegistry.fireRender(aCas, getModelObject(), vdoc,
aWindowBeginOffset, aWindowEndOffset); |
<<<<<<<
kb_wine.setMaxResults(maxResults);
kbList.add(new TestConfiguration("data/wine-ontology.rdf", kb_wine, "http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#ChateauMargaux"));
=======
kb_wine.setDefaultLanguage("en");
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#Grape");
kbList.add(new TestConfiguration("data/wine-ontology.rdf", kb_wine,
"http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#ChateauMargaux",
rootConcepts));
>>>>>>>
kb_wine.setDefaultLanguage("en");
kb_wine.setMaxResults(maxResults);
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#Grape");
kbList.add(new TestConfiguration("data/wine-ontology.rdf", kb_wine,
"http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#ChateauMargaux",
rootConcepts));
<<<<<<<
kb_hucit.setMaxResults(maxResults);
kbList.add(new TestConfiguration("http://nlp.dainst.org:8888/sparql", kb_hucit,
=======
kb_hucit.setDefaultLanguage("en");
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.w3.org/2000/01/rdf-schema#Class");
kbList.add(new TestConfiguration("http://nlp.dainst.org:8888/sparql", kb_hucit,
>>>>>>>
kb_hucit.setDefaultLanguage("en");
kb_hucit.setMaxResults(maxResults);
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.w3.org/2000/01/rdf-schema#Class");
kbList.add(new TestConfiguration("http://nlp.dainst.org:8888/sparql", kb_hucit,
<<<<<<<
kb_wikidata_direct.setMaxResults(maxResults);
=======
kb_wikidata_direct.applyRootConcepts(profile);
kb_wikidata_direct.setDefaultLanguage("en");
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.wikidata.org/entity/Q35120");
>>>>>>>
kb_wikidata_direct.applyRootConcepts(profile);
kb_wikidata_direct.setDefaultLanguage("en");
kb_wikidata_direct.setMaxResults(maxResults);
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.wikidata.org/entity/Q35120");
<<<<<<<
// {
// KnowledgeBaseProfile profile = PROFILES.get("virtuoso");
// KnowledgeBase kb_wikidata_direct = new KnowledgeBase();
// kb_wikidata_direct.setName("UKP_Wikidata (Virtuoso)");
// kb_wikidata_direct.setType(RepositoryType.REMOTE);
// kb_wikidata_direct.setReification(Reification.NONE);
// kb_wikidata_direct.applyMapping(profile.getMapping());
// kbList.add(new TestConfiguration(profile.getAccess().getAccessUrl(), kb_wikidata_direct,
// "http://www.wikidata.org/entity/Q19576436"));
// }
=======
// {
// KnowledgeBaseProfile profile = PROFILES.get("virtuoso");
// KnowledgeBase kb_wikidata_direct = new KnowledgeBase();
// kb_wikidata_direct.setName("UKP_Wikidata (Virtuoso)");
// kb_wikidata_direct.setType(RepositoryType.REMOTE);
// kb_wikidata_direct.setReification(Reification.NONE);
// kb_wikidata_direct.applyMapping(profile.getMapping());
// kb_wikidata_direct.setDefaultLanguage("en");
// rootConcepts = new HashSet<String>();
// rootConcepts.add("http://www.wikidata.org/entity/Q2419");
// kbList.add(new TestConfiguration(profile.getAccess().getAccessUrl(), kb_wikidata_direct,
// "http://www.wikidata.org/entity/Q19576436", rootConcepts));
// }
>>>>>>>
// {
// KnowledgeBaseProfile profile = PROFILES.get("virtuoso");
// KnowledgeBase kb_wikidata_direct = new KnowledgeBase();
// kb_wikidata_direct.setName("UKP_Wikidata (Virtuoso)");
// kb_wikidata_direct.setType(RepositoryType.REMOTE);
// kb_wikidata_direct.setReification(Reification.NONE);
// kb_wikidata_direct.applyMapping(profile.getMapping());
// kb_wikidata_direct.setDefaultLanguage("en");
// rootConcepts = new HashSet<String>();
// rootConcepts.add("http://www.wikidata.org/entity/Q2419");
// kbList.add(new TestConfiguration(profile.getAccess().getAccessUrl(), kb_wikidata_direct,
// "http://www.wikidata.org/entity/Q19576436", rootConcepts));
// }
<<<<<<<
kb_dbpedia.setMaxResults(maxResults);
=======
kb_dbpedia.applyRootConcepts(profile);
kb_dbpedia.setDefaultLanguage("en");
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.w3.org/2002/07/owl#Thing");
>>>>>>>
kb_dbpedia.applyRootConcepts(profile);
kb_dbpedia.setDefaultLanguage("en");
kb_dbpedia.setMaxResults(maxResults);
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.w3.org/2002/07/owl#Thing");
<<<<<<<
kb_yago.setMaxResults(maxResults);
=======
kb_yago.applyRootConcepts(profile);
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.w3.org/2002/07/owl#Thing");
>>>>>>>
kb_yago.applyRootConcepts(profile);
rootConcepts = new HashSet<String>();
rootConcepts.add("http://www.w3.org/2002/07/owl#Thing");
kb_yago.setMaxResults(maxResults);
<<<<<<<
kb_zbw_stw_economics.setMaxResults(maxResults);
kbList.add(new TestConfiguration(profile.getAccess().getAccessUrl(), kb_zbw_stw_economics,
"http://zbw.eu/stw/thsys/71020"));
=======
kb_zbw_stw_economics.applyRootConcepts(profile);
kb_zbw_stw_economics.setDefaultLanguage("en");
rootConcepts = new HashSet<String>();
rootConcepts.add("http://zbw.eu/stw/thsys/a");
kbList.add(new TestConfiguration(profile.getAccess().getAccessUrl(),
kb_zbw_stw_economics, "http://zbw.eu/stw/thsys/71020", rootConcepts));
>>>>>>>
kb_zbw_stw_economics.applyRootConcepts(profile);
kb_zbw_stw_economics.setDefaultLanguage("en");
kb_zbw_stw_economics.setMaxResults(maxResults);
rootConcepts = new HashSet<String>();
rootConcepts.add("http://zbw.eu/stw/thsys/a");
kbList.add(new TestConfiguration(profile.getAccess().getAccessUrl(),
kb_zbw_stw_economics, "http://zbw.eu/stw/thsys/71020", rootConcepts)); |
<<<<<<<
private Map<ImmutablePair<Project, String>, Set<CandidateEntity>> candidateCache;
private Map<ImmutablePair<Project, String>, SemanticSignature> semanticSignatureCache;
=======
private static final String WIKIDATA_PREFIX = "http://www.wikidata.org/entity/";
private static final String POS_VERB_PREFIX = "V";
private static final String POS_NOUN_PREFIX = "N";
private static final String POS_ADJECTIVE_PREFIX = "J";
// A cache for candidates retrieved by fulltext-search
private LoadingCache<CandidateCacheKey, Set<CandidateEntity>> candidateFullTextCache;
private LoadingCache<SemanticSignatureCacheKey, SemanticSignature> semanticSignatureCache;
>>>>>>>
// A cache for candidates retrieved by fulltext-search
private LoadingCache<CandidateCacheKey, Set<CandidateEntity>> candidateFullTextCache;
private LoadingCache<SemanticSignatureCacheKey, SemanticSignature> semanticSignatureCache;
<<<<<<<
return distinctByIri(candidatesFullText, aKB);
=======
return candidatesFullText;
>>>>>>>
return distinctByIri(candidatesFullText, aKey.getKnowledgeBase());
<<<<<<<
(label != null) ? label.stringValue() : "",
(description != null) ? description.stringValue() : "",
language.orElse(""));
=======
: (label != null) ? label.stringValue() : "",
(description != null) ? description.stringValue() : "");
>>>>>>>
(label != null) ? label.stringValue() : "",
(description != null) ? description.stringValue() : "",
language.orElse(""));
<<<<<<<
if (entityFrequencyMap != null) {
aCandidatesFullText.forEach(l -> {
String key = l.getIRI();
// For Virtuoso KBs
if (aKB.getFtsIri().toString().equals("bif:contains")) {
key = key.replace("http://www.wikidata.org/entity/", "");
if (entityFrequencyMap.get(key) != null) {
l.setFrequency(entityFrequencyMap.get(key));
}
}
});
}
=======
aCandidatesFullText.forEach(l -> {
String wikidataId = l.getIRI().replace(WIKIDATA_PREFIX, "");
if (entityFrequencyMap != null && entityFrequencyMap.get(wikidataId) != null) {
l.setFrequency(entityFrequencyMap.get(wikidataId));
}
});
>>>>>>>
if (entityFrequencyMap != null) {
aCandidatesFullText.forEach(l -> {
String key = l.getIRI();
// For Virtuoso KBs
if (aKB.getFtsIri().toString().equals("bif:contains")) {
key = key.replace("http://www.wikidata.org/entity/", "");
if (entityFrequencyMap.get(key) != null) {
l.setFrequency(entityFrequencyMap.get(key));
}
}
});
}
<<<<<<<
ImmutablePair<Project, String> pair = new ImmutablePair<>(aKB.getProject(), aIri);
if (semanticSignatureCache.containsKey(pair)) {
return semanticSignatureCache.get(pair);
}
=======
return semanticSignatureCache.get(new SemanticSignatureCacheKey(aKB, aWikidataId));
}
>>>>>>>
return semanticSignatureCache.get(new SemanticSignatureCacheKey(aKB, aIri));
}
<<<<<<<
try (RepositoryConnection conn = kbService.getConnection(aKB)) {
TupleQuery query = QueryUtil.generateSemanticSignatureQuery(conn, aIri,
properties.getSignatureQueryLimit(), aKB);
=======
try (RepositoryConnection conn = kbService.getConnection(aKey.getKnowledgeBase())) {
TupleQuery query = QueryUtil.generateSemanticSignatureQuery(conn, aKey.getQuery(),
properties.getSignatureQueryLimit(), aKey.getKnowledgeBase());
>>>>>>>
try (RepositoryConnection conn = kbService.getConnection(aKey.getKnowledgeBase())) {
TupleQuery query = QueryUtil.generateSemanticSignatureQuery(conn, aKey.getQuery(),
properties.getSignatureQueryLimit(), aKey.getKnowledgeBase()); |
<<<<<<<
protected TypeNameIdResolver(JavaType baseType,
Map<String, String> typeToId, Map<String, JavaType> idToType)
=======
protected TypeNameIdResolver(MapperConfig<?> config, JavaType baseType,
ConcurrentHashMap<String, String> typeToId,
HashMap<String, JavaType> idToType)
>>>>>>>
protected TypeNameIdResolver(JavaType baseType,
ConcurrentHashMap<String, String> typeToId,
HashMap<String, JavaType> idToType)
<<<<<<<
// 12-Oct-2019, tatu: This looked weird; was done in 2.x to force application
// of `TypeModifier`. But that just... does not seem right, at least not in
// the sense that raw class would be changed (intent for modifier is to change
// `JavaType` being resolved, not underlying class. Hence commented out in
// 3.x. There should be better way to support whatever the use case is.
// 29-Nov-2019, tatu: Looking at 2.x, test in `TestTypeModifierNameResolution` suggested
// that use of `TypeModifier` was used for demoting some types (from impl class to
// interface. For what that's worth. Still not supported for 3.x until proven necessary
// cls = _typeFactory.constructType(cls).getRawClass();
final String key = cls.getName();
String name;
synchronized (_typeToId) {
name = _typeToId.get(key);
}
=======
// NOTE: although we may need to let `TypeModifier` change actual type to use
// for id, we can use original type as key for more efficient lookup:
final String key = clazz.getName();
String name = _typeToId.get(key);
>>>>>>>
// 12-Oct-2019, tatu: This looked weird; was done in 2.x to force application
// of `TypeModifier`. But that just... does not seem right, at least not in
// the sense that raw class would be changed (intent for modifier is to change
// `JavaType` being resolved, not underlying class. Hence commented out in
// 3.x. There should be better way to support whatever the use case is.
// 29-Nov-2019, tatu: Looking at 2.x, test in `TestTypeModifierNameResolution` suggested
// that use of `TypeModifier` was used for demoting some types (from impl class to
// interface. For what that's worth. Still not supported for 3.x until proven necessary
// cls = _typeFactory.constructType(cls).getRawClass();
final String key = cls.getName();
String name = _typeToId.get(key); |
<<<<<<<
=======
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.fileUpload;
>>>>>>>
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; |
<<<<<<<
import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationDocument;
import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature;
=======
>>>>>>>
import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationDocument;
import de.tudarmstadt.ukp.clarin.webanno.model.AnnotationFeature;
<<<<<<<
import de.tudarmstadt.ukp.inception.recommendation.api.ClassificationTool;
import de.tudarmstadt.ukp.inception.recommendation.api.Classifier;
import de.tudarmstadt.ukp.inception.recommendation.api.LearningRecordService;
=======
import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
>>>>>>>
import de.tudarmstadt.ukp.dkpro.core.api.metadata.type.DocumentMetaData;
import de.tudarmstadt.ukp.dkpro.core.api.segmentation.type.Token;
import de.tudarmstadt.ukp.inception.recommendation.api.LearningRecordService;
<<<<<<<
import de.tudarmstadt.ukp.inception.recommendation.api.model.LearningRecord;
import de.tudarmstadt.ukp.inception.recommendation.api.model.LearningRecordUserAction;
=======
import de.tudarmstadt.ukp.inception.recommendation.api.model.Offset;
>>>>>>>
import de.tudarmstadt.ukp.inception.recommendation.api.model.LearningRecord;
import de.tudarmstadt.ukp.inception.recommendation.api.model.LearningRecordUserAction;
import de.tudarmstadt.ukp.inception.recommendation.api.model.Offset; |
<<<<<<<
private @SpringBean FeatureSupportRegistry featureSupportRegistry;
=======
private @SpringBean FeatureSupportRegistry fsRegistry;
private @SpringBean CasStorageService casStorageService;
>>>>>>>
private @SpringBean FeatureSupportRegistry fsRegistry;
private @SpringBean CasStorageService casStorageService;
private @SpringBean FeatureSupportRegistry featureSupportRegistry;
<<<<<<<
private FeatureState featureState;
=======
private ConfirmationDialog confirmationDialog;
>>>>>>>
private FeatureState featureState;
private ConfirmationDialog confirmationDialog;
<<<<<<<
record.setAnnotation(annotationValue);
=======
record.setAnnotation(currentRecommendation.getLabel());
>>>>>>>
record.setAnnotation(annotationValue);
<<<<<<<
.getFeature(currentRecommendation.getFeature(), selectedLayer.getObject());
recommendationService
.setFeatureValue(feature, selectedFeaturevalue, adapter, annotatorState, jCas, id);
=======
.getFeature(acceptedRecommendation.getFeature(), selectedLayer.getObject());
String predictedValue = acceptedRecommendation.getLabel();
recommendationService.setFeatureValue(feature, predictedValue, adapter, annotatorState,
jCas, id);
>>>>>>>
.getFeature(currentRecommendation.getFeature(), selectedLayer.getObject());
recommendationService
.setFeatureValue(feature, selectedFeaturevalue, adapter, annotatorState, jCas, id);
<<<<<<<
// Event AjaxAfterAnnotationUpdateEvent will be published. Method
// afterAnnotationUpdateEvent will call moveToNextRecommendation(aTarget);
=======
moveToNextRecommendation(aTarget);
>>>>>>>
// Event AjaxAfterAnnotationUpdateEvent will be published. Method
// afterAnnotationUpdateEvent will call moveToNextRecommendation(aTarget);
moveToNextRecommendation(aTarget); |
<<<<<<<
neLayer.setOverlapMode(ANY_OVERLAP);
sut.add(document, username, jcas, 0, 1);
=======
sut.add(document, username, jcas.getCas(), 0, 1);
>>>>>>>
neLayer.setOverlapMode(ANY_OVERLAP);
sut.add(document, username, jcas.getCas(), 0, 1);
<<<<<<<
.isThrownBy(() -> sut.add(document, username, jcas, 0, 1))
.withMessageContaining("stacking is not allowed");
// Adding another annotation at the same place DOES work
neLayer.setOverlapMode(STACKING_ONLY);
assertThatCode(() -> sut.add(document, username, jcas, 0, 1)).doesNotThrowAnyException();
neLayer.setOverlapMode(ANY_OVERLAP);
assertThatCode(() -> sut.add(document, username, jcas, 0, 1)).doesNotThrowAnyException();
=======
.isThrownBy(() -> sut.add(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("stacking is not enabled");
>>>>>>>
.isThrownBy(() -> sut.add(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("stacking is not allowed");
// Adding another annotation at the same place DOES work
neLayer.setOverlapMode(STACKING_ONLY);
assertThatCode(() -> sut.add(document, username, jcas.getCas(), 0, 1))
.doesNotThrowAnyException();
neLayer.setOverlapMode(ANY_OVERLAP);
assertThatCode(() -> sut.add(document, username, jcas.getCas(), 0, 1))
.doesNotThrowAnyException();
<<<<<<<
neLayer.setOverlapMode(ANY_OVERLAP);
sut.add(document, username, jcas, 0, 4);
=======
sut.add(document, username, jcas.getCas(), 0, 4);
>>>>>>>
neLayer.setOverlapMode(ANY_OVERLAP);
sut.add(document, username, jcas.getCas(), 0, 4);
<<<<<<<
.isThrownBy(() -> sut.add(document, username, jcas, 0, 1))
.withMessageContaining("stacking is not allowed");
// Adding another annotation at the same place DOES work
neLayer.setOverlapMode(STACKING_ONLY);
assertThatCode(() -> sut.add(document, username, jcas, 0, 1)).doesNotThrowAnyException();
neLayer.setOverlapMode(ANY_OVERLAP);
assertThatCode(() -> sut.add(document, username, jcas, 0, 1)).doesNotThrowAnyException();
=======
.isThrownBy(() -> sut.add(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("stacking is not enabled");
>>>>>>>
.isThrownBy(() -> sut.add(document, username, jcas.getCas(), 0, 1))
.withMessageContaining("stacking is not allowed");
// Adding another annotation at the same place DOES work
neLayer.setOverlapMode(STACKING_ONLY);
assertThatCode(() -> sut.add(document, username, jcas.getCas(), 0, 1))
.doesNotThrowAnyException();
neLayer.setOverlapMode(ANY_OVERLAP);
assertThatCode(() -> sut.add(document, username, jcas.getCas(), 0, 1))
.doesNotThrowAnyException(); |
<<<<<<<
String featureValue = "";
// Test if the internal feature name is a primitive feature
if (WebAnnoCasUtil.isPrimitiveFeature(annotation, feature.getName())) {
// Get the feature value using the internal name.
// Cast to Object so that the proper valueOf signature is used by
// the compiler, otherwise it will think that a String argument is
// char[].
featureValue = String.valueOf((Object) WebAnnoCasUtil
.getFeature(annotation, feature.getName()));
// Add the UI annotation.feature name to the index as an annotation.
// Replace spaces with underscore in the UI name.
MtasToken mtasAnnotationFeature = new MtasTokenString(mtasId++,
getIndexedName(annotationUiName) + "."
+ getIndexedName(feature.getUiName())
+ MtasToken.DELIMITER + featureValue, beginToken);
mtasAnnotationFeature.setOffset(annotation.getBegin(),
annotation.getEnd());
mtasAnnotationFeature.addPositionRange(beginToken, endToken);
tokenCollection.add(mtasAnnotationFeature);
// Returns KB IRI label after checking if the
// feature type is associated with KB and feature value is not null
String labelStr = null;
if (feature.getType().contains(IndexingConstants.KB)
&& (featureValue != null)) {
labelStr = getUILabel(featureValue);
}
if (labelStr != null) {
String[] kbValues = labelStr.split(MtasToken.DELIMITER);
if (IndexingConstants.KBCONCEPT.equals(kbValues[0])) {
kbValues[0] = IndexingConstants.INDEXKBCONCEPT;
}
else if (IndexingConstants.KBINSTANCE.equals(kbValues[0])) {
kbValues[0] = IndexingConstants.INDEXKBINSTANCE;
}
// Index IRI feature value with their labels along with
// annotation.feature name
String indexedStr = getIndexedName(annotationUiName) + "."
+ getIndexedName(feature.getUiName()) + "."
+ kbValues[0] + MtasToken.DELIMITER + kbValues[1];
// Indexing UI annotation with type i.e Concept/Instance
log.debug("Indexed String with type for : {}", indexedStr);
MtasToken mtasAnnotationTypeFeatureLabel = new MtasTokenString(
mtasId++, indexedStr, beginToken);
mtasAnnotationTypeFeatureLabel.setOffset(annotation.getBegin(),
annotation.getEnd());
mtasAnnotationTypeFeatureLabel.addPositionRange(beginToken,
endToken);
tokenCollection.add(mtasAnnotationTypeFeatureLabel);
indexedStr = getIndexedName(annotationUiName) + "."
+ getIndexedName(feature.getUiName())
+ MtasToken.DELIMITER + kbValues[1];
// Indexing UI annotation without type i.e Concept/Instance
log.debug("Indexed String without type for : {}", indexedStr);
MtasToken mtasAnnotationFeatureLabel = new MtasTokenString(
mtasId++, indexedStr, beginToken);
mtasAnnotationFeatureLabel.setOffset(annotation.getBegin(),
annotation.getEnd());
mtasAnnotationFeatureLabel.addPositionRange(beginToken,
endToken);
tokenCollection.add(mtasAnnotationFeatureLabel);
// Indexing UI annotation without type and layer for generic
// search
indexedStr = IndexingConstants.KBENTITY + MtasToken.DELIMITER
+ kbValues[1];
log.debug("Indexed String without type and label for : {}",
indexedStr);
MtasToken mtasAnnotationKBEntity = new MtasTokenString(
mtasId++, indexedStr, beginToken);
mtasAnnotationKBEntity.setOffset(annotation.getBegin(),
annotation.getEnd());
mtasAnnotationKBEntity.addPositionRange(beginToken,
endToken);
tokenCollection.add(mtasAnnotationKBEntity);
}
=======
// Test if the internal feature is a primitive feature
if (!WebAnnoCasUtil.isPrimitiveFeature(annotation, feature.getName())) {
continue;
}
mtasId = indexFeatureValue(tokenCollection, feature, annotation,
beginToken, endToken, mtasId, annotationUiName);
if (feature.getType().startsWith("kb:")) {
mtasId = indexConcept(tokenCollection, feature, annotation,
beginToken, endToken, mtasId, annotationUiName);
>>>>>>>
// Test if the internal feature is a primitive feature
if (!WebAnnoCasUtil.isPrimitiveFeature(annotation, feature.getName())) {
continue;
<<<<<<<
/**
* Takes in {@code IRI} for identifier as {@code String} and returns the label String
* Eg:- InputParameter String is {@code http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#RoseDAnjou},
* it returns {@code KBConcept} + {@link MtasToken#DELIMITER} + RoseDAnjou
* @param aIRI the identifier value as IRI
* @return String
*/
public String getUILabel(String aIRI) {
StringBuilder labelStr = new StringBuilder();
Optional<KBObject> kbObject = KBUtility.readKBIdentifier(kbService,project, aIRI);
if (kbObject.isPresent()) {
labelStr.append(kbObject.get().getClass().getSimpleName())
.append(MtasToken.DELIMITER).append(kbObject.get().getUiLabel());
}
return labelStr.toString();
}
=======
>>>>>>> |
<<<<<<<
=======
private final LoadingCache<TagSet, List<ImmutableTag>> immutableTagsCache;
>>>>>>>
private final LoadingCache<TagSet, List<ImmutableTag>> immutableTagsCache;
<<<<<<<
=======
try (MDC.MDCCloseable closable = MDC.putCloseable(Logging.KEY_PROJECT_ID,
String.valueOf(aProject.getId()))) {
log.info("Created {} tags and updated {} tags in tagset [{}]({}) in project [{}]({})",
createdCount, updatedCount, tagSet.getName(), tagSet.getId(),
aProject.getName(), aProject.getId());
}
>>>>>>>
try (MDC.MDCCloseable closable = MDC.putCloseable(Logging.KEY_PROJECT_ID,
String.valueOf(aProject.getId()))) {
log.info("Created {} tags and updated {} tags in tagset [{}]({}) in project [{}]({})",
createdCount, updatedCount, tagSet.getName(), tagSet.getId(),
aProject.getName(), aProject.getId());
}
<<<<<<<
=======
flushImmutableTagCache(aTag.getTagSet());
>>>>>>>
flushImmutableTagCache(aTag.getTagSet());
<<<<<<<
=======
flushImmutableTagCache(aTagSet);
>>>>>>>
flushImmutableTagCache(aTagSet); |
<<<<<<<
=======
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
>>>>>>> |
<<<<<<<
update(kb, (conn) -> {
String identifier = generateIdentifier(conn, kb);
=======
return update(kb, (conn) -> {
String identifier = getReificationStrategy(kb).generateConceptIdentifier(conn, kb);
>>>>>>>
update(kb, (conn) -> {
String identifier = getReificationStrategy(kb).generateConceptIdentifier(conn, kb);
<<<<<<<
update(kb, (conn) -> {
String identifier = generateIdentifier(conn, kb);
=======
return update(kb, (conn) -> {
String identifier = getReificationStrategy(kb).generatePropertyIdentifier(conn, kb);
>>>>>>>
update(kb, (conn) -> {
String identifier = getReificationStrategy(kb).generatePropertyIdentifier(conn, kb);
<<<<<<<
update(kb, (conn) -> {
String identifier = generateIdentifier(conn, kb);
=======
return update(kb, (conn) -> {
String identifier = getReificationStrategy(kb).generateInstanceIdentifier(conn, kb);
>>>>>>>
update(kb, (conn) -> {
String identifier = getReificationStrategy(kb).generateInstanceIdentifier(conn, kb); |
<<<<<<<
userRepository = aUserRepository;
=======
>>>>>>>
<<<<<<<
this(aRepositoryProperties, aUserRepository, aCasStorageService, aImportExportService,
aProjectService, aApplicationEventPublisher);
=======
this(aRepositoryProperties, aCasStorageService, aImportExportService, aProjectService,
aApplicationEventPublisher);
>>>>>>>
this(aRepositoryProperties, aCasStorageService, aImportExportService, aProjectService,
aApplicationEventPublisher);
<<<<<<<
=======
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
>>>>>>>
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
<<<<<<<
=======
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
>>>>>>>
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
<<<<<<<
@Transactional
public boolean existsCas(SourceDocument aDocument, String aUser) throws IOException
=======
public boolean existsCas(SourceDocument aDocument, String aUser)
throws IOException
>>>>>>>
public boolean existsCas(SourceDocument aDocument, String aUser) throws IOException
<<<<<<<
@Transactional
public boolean existsAnnotationCas(AnnotationDocument aAnnotationDocument) throws IOException
=======
public boolean existsAnnotationCas(AnnotationDocument aAnnotationDocument)
throws IOException
>>>>>>>
public boolean existsAnnotationCas(AnnotationDocument aAnnotationDocument) throws IOException
<<<<<<<
=======
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
>>>>>>>
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
<<<<<<<
=======
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
>>>>>>>
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
<<<<<<<
log.debug("Loading initial CAS for source document " + "[{}]({}) in project [{}]({})",
=======
log.debug("Loading initial CAS for source document [{}]({}) in project [{}]({})",
>>>>>>>
log.debug("Loading initial CAS for source document [{}]({}) in project [{}]({})",
<<<<<<<
return casStorageService.readOrCreateCas(aDocument, INITIAL_CAS_PSEUDO_USER, aUpgradeMode,
() -> {
// Normally, the initial CAS should be created on document import, but after
// adding this feature, the existing projects do not yet have initial CASes, so
// we create them here lazily
try {
return importExportService.importCasFromFile(
getSourceDocumentFile(aDocument), aDocument.getProject(),
aDocument.getFormat(), aFullProjectTypeSystem);
}
catch (UIMAException e) {
throw new IOException("Unable to create CAS: " + e.getMessage(), e);
}
}, aAccessMode);
}
=======
return casStorageService.readOrCreateCas(aDocument, INITIAL_CAS_PSEUDO_USER,
aUpgradeMode, () -> {
// Normally, the initial CAS should be created on document import, but after
// adding this feature, the existing projects do not yet have initial CASes, so
// we create them here lazily
try {
return importExportService.importCasFromFile(
getSourceDocumentFile(aDocument), aDocument.getProject(),
aDocument.getFormat(), aFullProjectTypeSystem);
}
catch (UIMAException e) {
throw new IOException("Unable to create CAS: " + e.getMessage(), e);
}
}, aAccessMode);
}
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
>>>>>>>
return casStorageService.readOrCreateCas(aDocument, INITIAL_CAS_PSEUDO_USER, aUpgradeMode,
() -> {
// Normally, the initial CAS should be created on document import, but after
// adding this feature, the existing projects do not yet have initial CASes, so
// we create them here lazily
try {
return importExportService.importCasFromFile(
getSourceDocumentFile(aDocument), aDocument.getProject(),
aDocument.getFormat(), aFullProjectTypeSystem);
}
catch (UIMAException e) {
throw new IOException("Unable to create CAS: " + e.getMessage(), e);
}
}, aAccessMode);
}
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
<<<<<<<
=======
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
>>>>>>>
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
<<<<<<<
=======
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
>>>>>>>
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
<<<<<<<
@Transactional
public CAS readAnnotationCas(AnnotationDocument aAnnotationDocument) throws IOException
=======
public CAS readAnnotationCas(AnnotationDocument aAnnotationDocument)
throws IOException
>>>>>>>
public CAS readAnnotationCas(AnnotationDocument aAnnotationDocument) throws IOException
<<<<<<<
=======
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
>>>>>>>
// NO TRANSACTION REQUIRED - This does not do any should not do a database access, so we do not
// need to be in a transaction here. Avoiding the transaction speeds up the call.
<<<<<<<
String query = String.join("\n", "SELECT COUNT(*) FROM AnnotationDocument",
"WHERE document = :document", " AND user = :user", " AND state = :state");
return entityManager.createQuery(query, Long.class).setParameter("document", aDocument)
.setParameter("user", aUser.getUsername())
.setParameter("state", AnnotationDocumentState.FINISHED).getSingleResult() > 0;
// try {
// AnnotationDocument annotationDocument = entityManager
// .createQuery(
// "FROM AnnotationDocument WHERE document = :document AND "
// + "user =:user", AnnotationDocument.class)
// .setParameter("document", aDocument)
// .setParameter("user", aUser.getUsername())
// .getSingleResult();
// if (annotationDocument.getState().equals(AnnotationDocumentState.FINISHED)) {
// return true;
// }
// else {
// return false;
// }
// }
// // User even didn't start annotating
// catch (NoResultException e) {
// return false;
// }
=======
return isAnnotationFinished(aDocument, aUser.getUsername());
}
@Override
@Transactional
public boolean isAnnotationFinished(SourceDocument aDocument, String aUsername)
{
String query = String.join("\n",
"SELECT COUNT(*) FROM AnnotationDocument",
"WHERE document = :document",
" AND user = :user",
" AND state = :state");
return entityManager.createQuery(query, Long.class)
.setParameter("document", aDocument)
.setParameter("user", aUsername)
.setParameter("state", AnnotationDocumentState.FINISHED)
.getSingleResult() > 0;
>>>>>>>
return isAnnotationFinished(aDocument, aUser.getUsername());
}
@Override
@Transactional
public boolean isAnnotationFinished(SourceDocument aDocument, String aUsername)
{
String query = String.join("\n", "SELECT COUNT(*) FROM AnnotationDocument",
"WHERE document = :document", " AND user = :user", " AND state = :state");
return entityManager.createQuery(query, Long.class) //
.setParameter("document", aDocument) //
.setParameter("user", aUsername) //
.setParameter("state", AnnotationDocumentState.FINISHED).getSingleResult() > 0; |
<<<<<<<
/**
* List the instances for the child concepts
*
* @param aKB The knowledge base
* @param aParentIdentifier a Parent identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @param aLimit Limit for SPARQL queries
* @return All instances of the child concepts
*/
List<KBHandle> listInstancesForChildConcepts(KnowledgeBase aKB, String aParentIdentifier,
boolean aAll, int aLimit) throws QueryEvaluationException;
=======
List<KBHandle> listChildConceptsInstances(KnowledgeBase aKB, String aParentIdentifier,
boolean aAll, int aLimit) throws QueryEvaluationException;
>>>>>>>
/**
* List the instances for the child concepts
*
* @param aKB The knowledge base
* @param aParentIdentifier a Parent identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @param aLimit Limit for SPARQL queries
* @return All instances of the child concepts
*/
List<KBHandle> listInstancesForChildConcepts(KnowledgeBase aKB, String aParentIdentifier,
boolean aAll, int aLimit) throws QueryEvaluationException;
<<<<<<<
=======
>>>>>>>
<<<<<<<
/**
* Retrieves the parent concept for an identifier
*
* @param aKB The knowledge base
* @param aIdentifier a concept identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @return List of parent concept for an identifier
*/
List<KBHandle> getParentConcept(KnowledgeBase aKB, String aIdentifier, boolean aAll)
throws QueryEvaluationException;
/**
* Retrieves the distinct parent concepts till the root element for an identifier regardless of
* it being an instance or concept
*
* @param aKB The knowledge base
* @param aIdentifier a concept/instance identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @return List of parent concept for an identifier
*/
Set<KBHandle> getParentConceptList(KnowledgeBase aKB, String aIdentifier, boolean aAll)
throws QueryEvaluationException;
/**
* Retrieves the concepts for an instance identifier
*
* @param aKB The knowledge base
* @param aIdentifier an instance identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @return List of concepts for an instance identifier
*/
List<KBHandle> getConceptForInstance(KnowledgeBase aKB, String aIdentifier, boolean aAll)
throws QueryEvaluationException;
=======
List<KBHandle> getParentConceptsForConcept(KnowledgeBase aKB, String aIdentifier,
boolean aAll)
throws QueryEvaluationException;
Set<KBHandle> getParentConceptList(KnowledgeBase aKB, String aIdentifier, boolean aAll)
throws QueryEvaluationException;
List<KBHandle> getConceptForInstance(KnowledgeBase aKB, String aIdentifier,
boolean aAll)
throws QueryEvaluationException;
boolean hasImplicitNamespace(String s);
/**
>>>>>>>
/**
* Retrieves the parent concept for an identifier
*
* @param aKB The knowledge base
* @param aIdentifier a concept identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @return List of parent concept for an identifier
*/
List<KBHandle> getParentConcept(KnowledgeBase aKB, String aIdentifier, boolean aAll)
throws QueryEvaluationException;
/**
* Retrieves the distinct parent concepts till the root element for an identifier regardless of
* it being an instance or concept
*
* @param aKB The knowledge base
* @param aIdentifier a concept/instance identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @return List of parent concept for an identifier
*/
Set<KBHandle> getParentConceptList(KnowledgeBase aKB, String aIdentifier, boolean aAll)
throws QueryEvaluationException;
/**
* Retrieves the concepts for an instance identifier
*
* @param aKB The knowledge base
* @param aIdentifier an instance identifier.
* @param aAll True if entities with implicit namespaces (e.g. defined by RDF)
* @return List of concepts for an instance identifier
*/
List<KBHandle> getConceptForInstance(KnowledgeBase aKB, String aIdentifier, boolean aAll)
throws QueryEvaluationException;
boolean hasImplicitNamespace(String s);
/** |
<<<<<<<
=======
Map<AnnotationFS, Integer> sentenceIndexes = null;
>>>>>>>
Map<AnnotationFS, Integer> sentenceIndexes = null;
<<<<<<<
List<AnnotationFS> sentences = new ArrayList<>(select(aCas, getType(aCas, Sentence.class)));
=======
>>>>>>>
<<<<<<<
if (!vcomment.getVid().isSynthetic()
&& ((fs = selectAnnotationByAddr(aCas, vcomment.getVid().getId())) != null
&& fs.getType().getName().equals(Sentence.class.getName()))) {
int index = sentences.indexOf(fs) + 1;
=======
if (
!vcomment.getVid().isSynthetic() &&
((fs = selectAnnotationByAddr(aCas, vcomment.getVid().getId())) != null &&
fs.getType().getName().equals(Sentence.class.getName()))
) {
// Lazily fetching the sentences because we only need them for the comments
if (sentenceIndexes == null) {
sentenceIndexes = new HashMap<>();
int i = 1;
for (AnnotationFS s : select(aCas, getType(aCas, Sentence.class))) {
sentenceIndexes.put(s, i);
i++;
}
}
int index = sentenceIndexes.get(fs);
>>>>>>>
if (!vcomment.getVid().isSynthetic()
&& ((fs = selectAnnotationByAddr(aCas, vcomment.getVid().getId())) != null
&& fs.getType().getName().equals(Sentence.class.getName()))) {
// Lazily fetching the sentences because we only need them for the comments
if (sentenceIndexes == null) {
sentenceIndexes = new HashMap<>();
int i = 1;
for (AnnotationFS s : select(aCas, getType(aCas, Sentence.class))) {
sentenceIndexes.put(s, i);
i++;
}
}
int index = sentenceIndexes.get(fs); |
<<<<<<<
import static de.tudarmstadt.ukp.clarin.webanno.api.casstorage.CasAccessMode.EXCLUSIVE_WRITE_ACCESS;
import static de.tudarmstadt.ukp.clarin.webanno.api.dao.CasMetadataUtils.addOrUpdateCasMetadata;
=======
>>>>>>>
import static de.tudarmstadt.ukp.clarin.webanno.api.casstorage.CasAccessMode.EXCLUSIVE_WRITE_ACCESS; |
<<<<<<<
import static java.util.stream.Collectors.toList;
=======
import static de.tudarmstadt.ukp.clarin.webanno.support.wicket.WicketUtil.serverTiming;
>>>>>>>
import static de.tudarmstadt.ukp.clarin.webanno.support.wicket.WicketUtil.serverTiming;
import static java.util.stream.Collectors.toList;
<<<<<<<
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.preferences.AnnotationEditorProperties;
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.PreRenderer;
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.Renderer;
=======
>>>>>>>
import de.tudarmstadt.ukp.clarin.webanno.api.annotation.rendering.Renderer;
<<<<<<<
if (layerParam.isEmpty() || databaseParam.isEmpty()) {
=======
if (layerParam.isEmpty() || keyParam.isEmpty() || databaseParam.isEmpty()) {
>>>>>>>
if (layerParam.isEmpty() || databaseParam.isEmpty()) {
<<<<<<<
=======
AnnotationFeature feature = annotationService.getFeature(database, layer);
>>>>>>> |
<<<<<<<
private final JsonDeserializer<Object> _delegateDeserializer() {
=======
/**
* @since 2.9
*/
protected final JsonDeserializer<Object> _delegateDeserializer() {
>>>>>>>
protected final JsonDeserializer<Object> _delegateDeserializer() { |
<<<<<<<
import de.tudarmstadt.ukp.inception.recommendation.scheduling.tasks.PredictionTask;
=======
import de.tudarmstadt.ukp.inception.recommendation.api.model.Preferences;
>>>>>>>
import de.tudarmstadt.ukp.inception.recommendation.api.model.Preferences;
import de.tudarmstadt.ukp.inception.recommendation.scheduling.tasks.PredictionTask;
<<<<<<<
AnnotationDocument annoDoc = aDocumentService
.getAnnotationDocument(aState.getDocument(), aState.getUser());
recommendations = PredictionTask
.setVisibility(learningRecordService, aAnnotationService, aJcas,
aState.getUser().getUsername(), annoDoc, layer, recommendations, windowBegin,
windowEnd);
for (List<AnnotationObject> token: recommendations) {
=======
List<VSpan> vspansWithoutRecommendations = new ArrayList<>(vdoc.spans(layer.getId()));
List<LearningRecord> recordedAnnotations = learningRecordService
.getAllRecordsByDocumentAndUserAndLayer(aState.getDocument(),
aState.getUser().getUsername(), layer);
Preferences pref = recommendationService.getPreferences(aState.getUser(),
layer.getProject());
for (List<AnnotationObject> sentenceRecommendations: recommendations) {
>>>>>>>
AnnotationDocument annoDoc = aDocumentService
.getAnnotationDocument(aState.getDocument(), aState.getUser());
recommendations = PredictionTask
.setVisibility(learningRecordService, aAnnotationService, aJcas,
aState.getUser().getUsername(), annoDoc, layer, recommendations, windowBegin,
windowEnd);
Preferences pref = recommendationService.getPreferences(aState.getUser(),
layer.getProject());
for (List<AnnotationObject> token : recommendations) {
<<<<<<<
=======
/**
* Check if there is already an existing annotation overlapping the prediction
*/
private boolean isOverlappingForFeature(Collection<VSpan> vspans, Offset recOffset,
int windowBegin, String feature)
{
for (VSpan v : vspans) {
for (VRange o : v.getOffsets()) {
if ((o.getBegin() <= recOffset.getBeginCharacter() - windowBegin)
&& (o.getEnd() >= recOffset.getEndCharacter() - windowBegin)
|| (o.getBegin() >= recOffset.getBeginCharacter() - windowBegin)
&& (o.getEnd() <= recOffset.getEndCharacter() - windowBegin)
|| (o.getBegin() >= recOffset.getBeginCharacter() - windowBegin)
&& (o.getEnd() >= recOffset.getEndCharacter() - windowBegin)
&& (o.getBegin() < recOffset.getEndCharacter() - windowBegin)
|| (o.getBegin() <= recOffset.getBeginCharacter() - windowBegin)
&& (o.getEnd() <= recOffset.getEndCharacter() - windowBegin)
&& (o.getEnd() > recOffset.getBeginCharacter() - windowBegin)) {
if (v.getFeatures().get(feature) == null || v.getFeatures().get(feature)
.isEmpty()) {
continue;
}
return true;
}
}
}
return false;
}
private boolean isRejected(List<LearningRecord> recordedRecommendations, AnnotationObject ao)
{
for (LearningRecord record : recordedRecommendations) {
if (record.getOffsetCharacterBegin() == ao.getOffset().getBeginCharacter()
&& record.getOffsetCharacterEnd() == ao.getOffset().getEndCharacter()
&& record.getAnnotation().equals(ao.getLabel())
&& record.getUserAction().equals(LearningRecordUserAction.REJECTED)) {
return true;
}
}
return false;
}
>>>>>>> |
<<<<<<<
for (AnnotationObject existedRecommendation : cleanRecommendationList) {
if (existedRecommendation.getSource().equals(source) && existedRecommendation.getLabel()
.equals(annotation) && existedRecommendation.getDocumentName()
.equals(documentName)) {
=======
for (AnnotationObject existingRecommendation : cleanRecommendationList) {
if (
existingRecommendation.getSource().equals(source) &&
existingRecommendation.getLabel().equals(annotation) &&
existingRecommendation.getDocumentName().equals(documentName)
) {
>>>>>>>
for (AnnotationObject existingRecommendation : cleanRecommendationList) {
if (
existingRecommendation.getSource().equals(source) &&
existingRecommendation.getLabel().equals(annotation) &&
existingRecommendation.getDocumentName().equals(documentName)
) {
<<<<<<<
// get a list of differences, sorted ascendingly
List<RecommendationDifference> recommendationDifferences =
createDifferencesSortedAscendingly(
listOfRecommendationsPerTokenPerClassifier);
long rankingDifferenceTimer = System.currentTimeMillis();
LOG.debug("Ranking difference costs {}ms.", (rankingDifferenceTimer - splitingListTimer));
=======
// get a list of differences, sorted ascending
List<RecommendationDifference> recommendationDifferences = createDifferencesSortedAscending(
listOfRecommendationsPerTokenPerClassifier);
>>>>>>>
// get a list of differences, sorted ascending
List<RecommendationDifference> recommendationDifferences = createDifferencesSortedAscending(
listOfRecommendationsPerTokenPerClassifier);
long rankingDifferenceTimer = System.currentTimeMillis();
LOG.trace("Ranking difference costs {}ms.", (rankingDifferenceTimer - splitingListTimer));
<<<<<<<
private static List<RecommendationDifference> createDifferencesSortedAscendingly(
List<List<AnnotationObject>> listOfRecommendationsPerTokenPerClassifier)
=======
private static boolean fromMoreThanOneClassifier(
List<AnnotationObject> recommendationListPerToken)
{
int numberOfStringMatchingClassifer = 0;
int numberOfOpenNLPClassifier = 0;
for (AnnotationObject recommendation : recommendationListPerToken) {
if (recommendation.getSource().contains("StringMatching")) {
numberOfStringMatchingClassifer++;
}
if (recommendation.getSource().contains("OpenNlp")) {
numberOfOpenNLPClassifier++;
}
}
return numberOfOpenNLPClassifier >= 1 && numberOfStringMatchingClassifer >= 1;
}
private static void splitRecommendationsWithRegardToClassifier(
List<List<AnnotationObject>> listOfRecommendationsPerTokenPerClassifier,
List<AnnotationObject> recommendationsPerToken)
{
List<AnnotationObject> stringMatchingClassifierAnnotationObject = new ArrayList<>();
for (AnnotationObject recommendation : recommendationsPerToken) {
if (recommendation.getSource().contains("StringMatching")) {
stringMatchingClassifierAnnotationObject.add(recommendation);
}
}
recommendationsPerToken.removeIf(recommendation -> recommendation.getSource()
.contains("StringMatching"));
listOfRecommendationsPerTokenPerClassifier.add(recommendationsPerToken);
listOfRecommendationsPerTokenPerClassifier.add(stringMatchingClassifierAnnotationObject);
}
private static List<RecommendationDifference> createDifferencesSortedAscending(
List<List<AnnotationObject>> listOfRecommendationsPerTokenPerClassifier)
>>>>>>>
private static List<RecommendationDifference> createDifferencesSortedAscending(
List<List<AnnotationObject>> listOfRecommendationsPerTokenPerClassifier) |
<<<<<<<
import java.util.Collections;
import java.util.Comparator;
=======
>>>>>>>
import java.util.Collections;
<<<<<<<
import java.util.Optional;
import java.util.stream.Collectors;
=======
>>>>>>>
import java.util.Optional;
<<<<<<<
import de.tudarmstadt.ukp.clarin.webanno.model.Project;
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaBehavior;
import de.tudarmstadt.ukp.inception.conceptlinking.service.ConceptLinkingServiceImpl;
=======
import de.tudarmstadt.ukp.inception.conceptlinking.service.ConceptLinkingService;
>>>>>>>
import de.tudarmstadt.ukp.clarin.webanno.support.lambda.LambdaBehavior;
import de.tudarmstadt.ukp.inception.conceptlinking.service.ConceptLinkingService;
<<<<<<<
import de.tudarmstadt.ukp.inception.kb.graph.KBObject;
import de.tudarmstadt.ukp.inception.kb.model.KnowledgeBase;
import de.tudarmstadt.ukp.inception.ui.kb.DisabledKBWarning;
=======
>>>>>>>
import de.tudarmstadt.ukp.inception.kb.model.KnowledgeBase;
import de.tudarmstadt.ukp.inception.ui.kb.DisabledKBWarning;
<<<<<<<
protected List<KBHandle> getChoices(String input) {
return listInstances(aState, aHandler, input != null ? input.toLowerCase() : null);
=======
protected List<KBHandle> getChoices(String aInput)
{
return getCandidates(aState, aHandler, aInput);
>>>>>>>
protected List<KBHandle> getChoices(String aInput)
{
return getCandidates(aState, aHandler, aInput);
<<<<<<<
private List<KBHandle> listInstances(AnnotatorState aState, AnnotationActionHandler aHandler,
String aTypedString) {
AnnotationFeature feat = getModelObject().feature;
Project project = feat.getProject();
ConceptFeatureTraits traits = readFeatureTraits(feat);
// Check if kb is actually enabled
if (featureUsesDisabledKB(traits)) {
return Collections.emptyList();
}
=======
FeatureSupport<ConceptFeatureTraits> fs = featureSupportRegistry
.getFeatureSupport(feat);
ConceptFeatureTraits traits = fs.readTraits(feat);
>>>>>>>
ConceptFeatureTraits traits = readFeatureTraits(feat);
// Check if kb is actually enabled
if (featureUsesDisabledKB(traits)) {
return Collections.emptyList();
}
<<<<<<<
// if concept linking does not return any results or is disabled
if (handles.size() == 0) {
handles = kbService.getEntitiesInScope(traits.getRepositoryId(), traits.getScope(),
traits.getAllowedValueType(), project);
// Sort and filter results
handles = handles.stream()
.filter(handle -> handle.getUiLabel().toLowerCase().startsWith(aTypedString))
.sorted(Comparator.comparing(KBObject::getUiLabel)).collect(Collectors.toList());
}
return KBHandle.distinctByIri(handles);
}
private ConceptFeatureTraits readFeatureTraits(AnnotationFeature aAnnotationFeature) {
FeatureSupport<ConceptFeatureTraits> fs = featureSupportRegistry
.getFeatureSupport(aAnnotationFeature);
ConceptFeatureTraits traits = fs.readTraits(aAnnotationFeature);
return traits;
}
private boolean featureUsesDisabledKB(ConceptFeatureTraits aTraits)
{
Optional<KnowledgeBase> kb = Optional.empty();
String repositoryId = aTraits.getRepositoryId();
if (repositoryId != null) {
kb = kbService.getKnowledgeBaseById(getModelObject().feature.getProject(),
aTraits.getRepositoryId());
}
return kb.isPresent() && !kb.get().isEnabled() || repositoryId != null && !kb.isPresent();
}
private DisabledKBWarning createDisabledKbWarningLabel()
{
AnnotationFeature feature = getModelObject().feature;
ConceptFeatureTraits traits = readFeatureTraits(feature);
Optional<KnowledgeBase> kb = Optional.empty();
if (traits.getRepositoryId() != null) {
kb = kbService.getKnowledgeBaseById(feature.getProject(), traits.getRepositoryId());
}
String kbName = kb.isPresent() ? kb.get().getName() : "unknown ID";
DisabledKBWarning warning = new DisabledKBWarning("disabledKBWarning",
new StringResourceModel("value.null.disabledKbWarning", this).setParameters(kbName));
warning.add(LambdaBehavior
.onConfigure(label -> label.setVisible(featureUsesDisabledKB(traits))));
return warning;
}
@Override
protected void onInitialize() {
super.onInitialize();
=======
return choices;
>>>>>>>
return choices;
}
private ConceptFeatureTraits readFeatureTraits(AnnotationFeature aAnnotationFeature) {
FeatureSupport<ConceptFeatureTraits> fs = featureSupportRegistry
.getFeatureSupport(aAnnotationFeature);
ConceptFeatureTraits traits = fs.readTraits(aAnnotationFeature);
return traits;
}
private boolean featureUsesDisabledKB(ConceptFeatureTraits aTraits)
{
Optional<KnowledgeBase> kb = Optional.empty();
String repositoryId = aTraits.getRepositoryId();
if (repositoryId != null) {
kb = kbService.getKnowledgeBaseById(getModelObject().feature.getProject(),
aTraits.getRepositoryId());
}
return kb.isPresent() && !kb.get().isEnabled() || repositoryId != null && !kb.isPresent();
}
private DisabledKBWarning createDisabledKbWarningLabel()
{
AnnotationFeature feature = getModelObject().feature;
ConceptFeatureTraits traits = readFeatureTraits(feature);
Optional<KnowledgeBase> kb = Optional.empty();
if (traits.getRepositoryId() != null) {
kb = kbService.getKnowledgeBaseById(feature.getProject(), traits.getRepositoryId());
}
String kbName = kb.isPresent() ? kb.get().getName() : "unknown ID";
DisabledKBWarning warning = new DisabledKBWarning("disabledKBWarning",
new StringResourceModel("value.null.disabledKbWarning", this).setParameters(kbName));
warning.add(LambdaBehavior
.onConfigure(label -> label.setVisible(featureUsesDisabledKB(traits))));
return warning; |
<<<<<<<
public void onDestroy() {
super.onDestroy();
if (null != mBackgroundTimer) {
mBackgroundTimer.cancel();
}
}
@Override
=======
public void onPause() {
super.onPause();
}
@Override
>>>>>>>
<<<<<<<
ShowFanart = get(UserPreferences.class).get(UserPreferences.Companion.getBackdropEnabled());
if (mImageType != mDisplayPrefs.getCustomPrefs().get("ImageType") || mPosterSizeSetting != mDisplayPrefs.getCustomPrefs().get("PosterSize")) {
mImageType = mDisplayPrefs.getCustomPrefs().get("ImageType");
mPosterSizeSetting = mDisplayPrefs.getCustomPrefs().get("PosterSize");
// Set defaults
if (mImageType == null) mImageType = ImageType.DEFAULT;
if (mPosterSizeSetting == null) mPosterSizeSetting = PosterSize.AUTO;
mCardHeight = getCardHeight(mPosterSizeSetting);
setGridSizes();
createGrid();
loadGrid(mRowDef);
}
=======
>>>>>>>
if (mImageType != mDisplayPrefs.getCustomPrefs().get("ImageType") || mPosterSizeSetting != mDisplayPrefs.getCustomPrefs().get("PosterSize")) {
mImageType = mDisplayPrefs.getCustomPrefs().get("ImageType");
mPosterSizeSetting = mDisplayPrefs.getCustomPrefs().get("PosterSize");
// Set defaults
if (mImageType == null) mImageType = ImageType.DEFAULT;
if (mPosterSizeSetting == null) mPosterSizeSetting = PosterSize.AUTO;
mCardHeight = getCardHeight(mPosterSizeSetting);
setGridSizes();
createGrid();
loadGrid(mRowDef);
} |
<<<<<<<
import androidx.leanback.media.PlayerAdapter;
import com.devbrackets.android.exomedia.EMVideoView;
=======
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory;
>>>>>>>
import androidx.leanback.media.PlayerAdapter;
import com.google.android.exoplayer2.ExoPlaybackException;
import com.google.android.exoplayer2.ExoPlayerFactory;
import com.google.android.exoplayer2.Player;
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.ui.PlayerView;
import com.google.android.exoplayer2.upstream.DataSource;
import com.google.android.exoplayer2.upstream.DefaultDataSourceFactory; |
<<<<<<<
}
@Test
public void testDriverDeleteTable() throws SQLException, IOException {
Statement stat = connection.createStatement();
stat.execute("DROP TABLE IF EXISTS AREA, MYCSV");
stat.execute("create table area(the_geom GEOMETRY, idarea int primary key)");
stat.execute("insert into area values('POLYGON ((-10 109, 90 109, 90 9, -10 9, -10 109))', 1)");
stat.execute("insert into area values('POLYGON ((90 109, 190 109, 190 9, 90 9, 90 109))', 2)");
stat.execute("CREATE TABLE MYCSV(the_geom GEOMETRY, idarea int primary key)");
// Export in target with special chars
File csvFile = new File("target/area éxport.csv");
DriverFunction exp = new CSVDriverFunction();
exp.exportTable(connection, "AREA", csvFile,new EmptyProgressVisitor());
exp.importFile(connection, "MYCSV", csvFile, new EmptyProgressVisitor(), true);
ResultSet rs = stat.executeQuery("select SUM(idarea::int) from mycsv");
try {
assertTrue(rs.next());
assertEquals(3,rs.getDouble(1),1e-2);
} finally {
rs.close();
}
}
=======
}
@Test
public void testDriverQueryOptions() throws SQLException, IOException {
Statement stat = connection.createStatement();
stat.execute("DROP TABLE IF EXISTS AREA");
stat.execute("create table area(the_geom GEOMETRY, idarea int primary key)");
stat.execute("insert into area values('POLYGON ((-10 109, 90 109, 90 9, -10 9, -10 109))', 1)");
stat.execute("insert into area values('POLYGON ((90 109, 190 109, 190 9, 90 9, 90 109))', 2)");
// Export in target with special chars
File csvFile = new File("target/csv_options.csv");
CSVDriverFunction exp = new CSVDriverFunction();
exp.exportTable(connection, "(SELECT * FROM AREA)", csvFile,new EmptyProgressVisitor(), "fieldSeparator=| fieldDelimiter=,");
stat.execute("DROP TABLE IF EXISTS mycsv");
exp.importFile(connection, "MYCSV", csvFile, new EmptyProgressVisitor(), "fieldSeparator=| fieldDelimiter=,");
try (ResultSet rs = stat.executeQuery("select SUM(idarea::int) from mycsv")) {
assertTrue(rs.next());
assertEquals(3,rs.getDouble(1),1e-2);
}
}
>>>>>>>
}
@Test
public void testDriverDeleteTable() throws SQLException, IOException {
Statement stat = connection.createStatement();
stat.execute("DROP TABLE IF EXISTS AREA, MYCSV");
stat.execute("create table area(the_geom GEOMETRY, idarea int primary key)");
stat.execute("insert into area values('POLYGON ((-10 109, 90 109, 90 9, -10 9, -10 109))', 1)");
stat.execute("insert into area values('POLYGON ((90 109, 190 109, 190 9, 90 9, 90 109))', 2)");
stat.execute("CREATE TABLE MYCSV(the_geom GEOMETRY, idarea int primary key)");
// Export in target with special chars
File csvFile = new File("target/area éxport.csv");
DriverFunction exp = new CSVDriverFunction();
exp.exportTable(connection, "AREA", csvFile,new EmptyProgressVisitor());
exp.importFile(connection, "MYCSV", csvFile, new EmptyProgressVisitor(), true);
ResultSet rs = stat.executeQuery("select SUM(idarea::int) from mycsv");
try {
assertTrue(rs.next());
assertEquals(3,rs.getDouble(1),1e-2);
} finally {
rs.close();
}
}
@Test
public void testDriverQueryOptions() throws SQLException, IOException {
Statement stat = connection.createStatement();
stat.execute("DROP TABLE IF EXISTS AREA");
stat.execute("create table area(the_geom GEOMETRY, idarea int primary key)");
stat.execute("insert into area values('POLYGON ((-10 109, 90 109, 90 9, -10 9, -10 109))', 1)");
stat.execute("insert into area values('POLYGON ((90 109, 190 109, 190 9, 90 9, 90 109))', 2)");
// Export in target with special chars
File csvFile = new File("target/csv_options.csv");
CSVDriverFunction exp = new CSVDriverFunction();
exp.exportTable(connection, "(SELECT * FROM AREA)", csvFile,new EmptyProgressVisitor(), "fieldSeparator=| fieldDelimiter=,");
stat.execute("DROP TABLE IF EXISTS mycsv");
exp.importFile(connection, "MYCSV", csvFile, new EmptyProgressVisitor(), "fieldSeparator=| fieldDelimiter=,");
try (ResultSet rs = stat.executeQuery("select SUM(idarea::int) from mycsv")) {
assertTrue(rs.next());
assertEquals(3,rs.getDouble(1),1e-2);
}
} |
<<<<<<<
return new Function[]{
new ST_3DLength(),
new ST_ClosestPoint(),
new ST_ClosestCoordinate(),
new ST_CompactnessRatio(),
new ST_Covers(),
new ST_DWithin(),
new ST_Extent(),
new ST_Explode(),
new ST_FurthestCoordinate(),
new ST_Holes(),
new ST_IsRectangle(),
new ST_IsValid(),
new ST_LocateAlong(),
new ST_MakeEllipse(),
new ST_MakeLine(),
new ST_MakePoint(),
new ST_Rotate(),
new ST_Scale(),
new ST_ToMultiPoint(),
new ST_ToMultiLine(),
new ST_ToMultiSegments(),
new ST_XMin(),
new ST_XMax(),
new ST_YMin(),
new ST_YMax(),
new ST_ZMin(),
new ST_ZMax(),
new DriverManager(),
new SHPRead(),
new SHPWrite(),
new DBFRead(),
new DBFWrite(),
new GPXRead(),
new ST_Delaunay(),
new ST_ConstrainedDelaunay(),
new ST_MakeGrid(),
new ST_MakeGridPoints(),
new ST_TriangleAspect(),
new ST_TriangleSlope(),
new ST_TriangleDirection(),
new ST_TriangleContouring(),
new ST_BoundingCircle(),
new ST_Densify(),
new ST_Expand(),
new ST_OctogonalEnvelope(),
new ST_MinimumRectangle(),
new ST_RemoveRepeatedPoints(),
new ST_Extrude(),
new ST_RemoveHoles(),
new ST_MakeEnvelope(),
new ST_Interpolate3DLine(),
new ST_Reverse(),
new ST_Reverse3DLine(),
new ST_Snap(),
new ST_Split(),
new ST_AddPoint(),
new ST_RemovePoint(),
new ST_PrecisionReducer(),
new ST_Simplify(),
new ST_SimplifyPreserveTopology(),
new ST_Translate(),
new ST_UpdateZ(),
new ST_AddZ(),
new ST_MultiplyZ(),
new ST_ZUpdateExtremities(),
new ST_Normalize(),
new ST_Polygonize(),
// h2network functions
new ST_Graph(),
new ST_AsGeoJSON(),
new GeoJsonRead(),
new GeoJsonWrite()
};
=======
return new Function[] {
new DBFRead(),
new DBFWrite(),
new DriverManager(),
new GPXRead(),
new GeoJsonRead(),
new GeoJsonWrite(),
new SHPRead(),
new SHPWrite(),
new ST_3DLength(),
new ST_AddPoint(),
new ST_AddZ(),
new ST_AsGeoJSON(),
new ST_BoundingCircle(),
new ST_ClosestCoordinate(),
new ST_ClosestPoint(),
new ST_CompactnessRatio(),
new ST_ConstrainedDelaunay(),
new ST_Covers(),
new ST_DWithin(),
new ST_Delaunay(),
new ST_Densify(),
new ST_Expand(),
new ST_Explode(),
new ST_Extent(),
new ST_Extrude(),
new ST_FurthestCoordinate(),
new ST_Holes(),
new ST_Interpolate3DLine(),
new ST_IsRectangle(),
new ST_IsValid(),
new ST_LocateAlong(),
new ST_MakeEllipse(),
new ST_MakeEnvelope(),
new ST_MakeGrid(),
new ST_MakeGridPoints(),
new ST_MakeLine(),
new ST_MakePoint(),
new ST_MinimumRectangle(),
new ST_MultiplyZ(),
new ST_Normalize(),
new ST_OctogonalEnvelope(),
new ST_Polygonize(),
new ST_PrecisionReducer(),
new ST_RemoveHoles(),
new ST_RemovePoint(),
new ST_RemoveRepeatedPoints(),
new ST_Reverse(),
new ST_Reverse3DLine(),
new ST_Rotate(),
new ST_Scale(),
new ST_Simplify(),
new ST_SimplifyPreserveTopology(),
new ST_Snap(),
new ST_Split(),
new ST_ToMultiLine(),
new ST_ToMultiPoint(),
new ST_ToMultiSegments(),
new ST_Translate(),
new ST_TriangleAspect(),
new ST_TriangleDirection(),
new ST_TriangleSlope(),
new ST_UpdateZ(),
new ST_XMax(),
new ST_XMin(),
new ST_YMax(),
new ST_YMin(),
new ST_ZMax(),
new ST_ZMin(),
new ST_ZUpdateExtremities(),
// h2network functions
new ST_Graph(),
new ST_ShortestPathLength()};
>>>>>>>
return new Function[] {
new DBFRead(),
new DBFWrite(),
new DriverManager(),
new GPXRead(),
new GeoJsonRead(),
new GeoJsonWrite(),
new SHPRead(),
new SHPWrite(),
new ST_3DLength(),
new ST_AddPoint(),
new ST_AddZ(),
new ST_AsGeoJSON(),
new ST_BoundingCircle(),
new ST_ClosestCoordinate(),
new ST_ClosestPoint(),
new ST_CompactnessRatio(),
new ST_ConstrainedDelaunay(),
new ST_Covers(),
new ST_DWithin(),
new ST_Delaunay(),
new ST_Densify(),
new ST_Expand(),
new ST_Explode(),
new ST_Extent(),
new ST_Extrude(),
new ST_FurthestCoordinate(),
new ST_Holes(),
new ST_Interpolate3DLine(),
new ST_IsRectangle(),
new ST_IsValid(),
new ST_LocateAlong(),
new ST_MakeEllipse(),
new ST_MakeEnvelope(),
new ST_MakeGrid(),
new ST_MakeGridPoints(),
new ST_MakeLine(),
new ST_MakePoint(),
new ST_MinimumRectangle(),
new ST_MultiplyZ(),
new ST_Normalize(),
new ST_OctogonalEnvelope(),
new ST_Polygonize(),
new ST_PrecisionReducer(),
new ST_RemoveHoles(),
new ST_RemovePoint(),
new ST_RemoveRepeatedPoints(),
new ST_Reverse(),
new ST_Reverse3DLine(),
new ST_Rotate(),
new ST_Scale(),
new ST_Simplify(),
new ST_SimplifyPreserveTopology(),
new ST_Snap(),
new ST_Split(),
new ST_ToMultiLine(),
new ST_ToMultiPoint(),
new ST_ToMultiSegments(),
new ST_Translate(),
new ST_TriangleAspect(),
new ST_TriangleDirection(),
new ST_TriangleSlope(),
new ST_TriangleContouring(),
new ST_UpdateZ(),
new ST_XMax(),
new ST_XMin(),
new ST_YMax(),
new ST_YMin(),
new ST_ZMax(),
new ST_ZMin(),
new ST_ZUpdateExtremities(),
// h2network functions
new ST_Graph(),
new ST_ShortestPathLength()}; |
<<<<<<<
final DBTypes dbType = DBUtils.getDBType(connection);
=======
final boolean isH2 = JDBCUtilities.isH2DataBase(connection);
ArrayList<String> tableNames = new ArrayList<>();
>>>>>>>
final DBTypes dbType = DBUtils.getDBType(connection);
ArrayList<String> tableNames = new ArrayList<>();
<<<<<<<
setWptPreparedStmt(GPXTablesFactory.createWayPointsTable(connection, wptTableName));
=======
setWptPreparedStmt(GPXTablesFactory.createWayPointsTable(connection, wptTableName, isH2));
tableNames.add(wptTableName);
>>>>>>>
setWptPreparedStmt(GPXTablesFactory.createWayPointsTable(connection, wptTableName));
tableNames.add(wptTableName);
<<<<<<<
setRtePreparedStmt(GPXTablesFactory.createRouteTable(connection, routeTableName));
setRteptPreparedStmt(GPXTablesFactory.createRoutePointsTable(connection, routePointsTableName));
=======
setRtePreparedStmt(GPXTablesFactory.createRouteTable(connection, routeTableName, isH2));
setRteptPreparedStmt(GPXTablesFactory.createRoutePointsTable(connection, routePointsTableName, isH2));
tableNames.add(routeTableName);
tableNames.add(routePointsTableName);
>>>>>>>
setRtePreparedStmt(GPXTablesFactory.createRouteTable(connection, routeTableName));
setRteptPreparedStmt(GPXTablesFactory.createRoutePointsTable(connection, routePointsTableName));
tableNames.add(routeTableName);
tableNames.add(routePointsTableName);
<<<<<<<
setTrkPreparedStmt(GPXTablesFactory.createTrackTable(connection, trackTableName));
setTrkSegmentsPreparedStmt(GPXTablesFactory.createTrackSegmentsTable(connection, trackSegmentsTableName));
setTrkPointsPreparedStmt(GPXTablesFactory.createTrackPointsTable(connection, trackPointsTableName));
=======
setTrkPreparedStmt(GPXTablesFactory.createTrackTable(connection, trackTableName, isH2));
setTrkSegmentsPreparedStmt(GPXTablesFactory.createTrackSegmentsTable(connection, trackSegmentsTableName, isH2));
setTrkPointsPreparedStmt(GPXTablesFactory.createTrackPointsTable(connection, trackPointsTableName, isH2));
tableNames.add(trackTableName);
tableNames.add(trackSegmentsTableName);
tableNames.add(trackPointsTableName);
>>>>>>>
setTrkPreparedStmt(GPXTablesFactory.createTrackTable(connection, trackTableName));
setTrkSegmentsPreparedStmt(GPXTablesFactory.createTrackSegmentsTable(connection, trackSegmentsTableName));
setTrkPointsPreparedStmt(GPXTablesFactory.createTrackPointsTable(connection, trackPointsTableName));
tableNames.add(trackTableName);
tableNames.add(trackSegmentsTableName);
tableNames.add(trackPointsTableName); |
<<<<<<<
"COLUMN_NAME f_geometry_column,1 storage_type,GeometryTypeFromConstraint(CHECK_CONSTRAINT || REMARKS) geometry_type,2 coord_dimension,ColumnSRID(TABLE_NAME,COLUMN_NAME) srid" +
" from INFORMATION_SCHEMA.COLUMNS WHERE CHECK_CONSTRAINT LIKE '%SC_GEOMETRY%' OR REMARKS LIKE '%SC_GEOMETRY%'");
=======
"COLUMN_NAME f_geometry_column,1 storage_type,GeometryTypeFromConstraint(CHECK_CONSTRAINT) geometry_type,2 coord_dimension,ColumnSRID(TABLE_NAME,COLUMN_NAME) srid" +
" from INFORMATION_SCHEMA.COLUMNS WHERE CHECK_CONSTRAINT LIKE '%SC_GEOMETRY%'");
ResultSet rs = connection.getMetaData().getTables("","PUBLIC","SPATIAL_REF_SYS",null);
if(!rs.next()) {
URL resource = CreateSpatialExtension.class.getResource("spatial_ref_sys.sql");
st.execute(String.format("RUNSCRIPT FROM '%s'",resource));
}
>>>>>>>
"COLUMN_NAME f_geometry_column,1 storage_type,GeometryTypeFromConstraint(CHECK_CONSTRAINT || REMARKS) geometry_type,2 coord_dimension,ColumnSRID(TABLE_NAME,COLUMN_NAME) srid" +
" from INFORMATION_SCHEMA.COLUMNS WHERE CHECK_CONSTRAINT LIKE '%SC_GEOMETRY%' OR REMARKS LIKE '%SC_GEOMETRY%'");
ResultSet rs = connection.getMetaData().getTables("","PUBLIC","SPATIAL_REF_SYS",null);
if(!rs.next()) {
URL resource = CreateSpatialExtension.class.getResource("spatial_ref_sys.sql");
st.execute(String.format("RUNSCRIPT FROM '%s'",resource));
} |
<<<<<<<
String outputTable = TableLocation.parse(tableReference, isH2).toString(isH2);
int recordCount = JDBCUtilities.getRowCount(connection, outputTable);
=======
final DBTypes dbType = DBUtils.getDBType(connection);
String tableName = TableLocation.parse(tableReference, isH2).toString(dbType);
int recordCount = JDBCUtilities.getRowCount(connection, tableName);
>>>>>>>
String outputTable = TableLocation.parse(tableReference, isH2).toString(isH2);
int recordCount = JDBCUtilities.getRowCount(connection, outputTable);
<<<<<<<
stmt.execute("DROP TABLE IF EXISTS " + outputTable);
=======
stmt.execute("DROP TABLE IF EXISTS " + requestedTable.toString(dbType));
>>>>>>>
stmt.execute("DROP TABLE IF EXISTS " + outputTable);
<<<<<<<
=======
String parsedTable = requestedTable.toString(dbType);
>>>>>>> |
<<<<<<<
return new AnnotatedCreatorCollector(intr, tc, checkClassAnnotations)
.collect(typeFactory, type, primaryMixIn);
=======
return new AnnotatedCreatorCollector(intr, typeFactory, tc, collectAnnotations)
.collect(type, primaryMixIn);
>>>>>>>
return new AnnotatedCreatorCollector(intr, tc, collectAnnotations)
.collect(typeFactory, type, primaryMixIn); |
<<<<<<<
import org.h2gis.h2spatialext.function.spatial.mesh.ST_ConstrainedDelaunay;
import org.h2gis.h2spatialext.function.spatial.mesh.ST_Delaunay;
=======
import org.h2gis.h2spatialext.function.spatial.create.ST_MakeGrid;
import org.h2gis.h2spatialext.function.spatial.create.ST_MakeGridPoints;
>>>>>>>
import org.h2gis.h2spatialext.function.spatial.mesh.ST_ConstrainedDelaunay;
import org.h2gis.h2spatialext.function.spatial.mesh.ST_Delaunay;
import org.h2gis.h2spatialext.function.spatial.create.ST_MakeGrid;
import org.h2gis.h2spatialext.function.spatial.create.ST_MakeGridPoints;
<<<<<<<
new GPXRead(),
new ST_Delaunay(),
new ST_ConstrainedDelaunay()};
=======
new GPXRead(),
new ST_MakeGrid(),
new ST_MakeGridPoints()};
>>>>>>>
new GPXRead(),
new ST_Delaunay(),
new ST_ConstrainedDelaunay(),
new ST_MakeGrid(),
new ST_MakeGridPoints()}; |
<<<<<<<
public void importFile(Connection connection, String tableReference, File fileName, String options, boolean deleteTables, ProgressVisitor progress) throws SQLException, IOException {
if (connection == null) {
throw new SQLException("The connection cannot be null.\n");
}
if (tableReference == null || tableReference.isEmpty()) {
throw new SQLException("The table name cannot be null or empty");
}
if (fileName == null) {
throw new SQLException("The file name cannot be null.\n");
}
if(progress==null){
progress= new EmptyProgressVisitor();
}
final DBTypes dbType = DBUtils.getDBType(connection);
=======
public String[] importFile(Connection connection, String tableReference, File fileName, String options, boolean deleteTables, ProgressVisitor progress) throws SQLException, IOException {
progress = DriverManager.check(connection,tableReference,fileName, progress);
final boolean isH2 = JDBCUtilities.isH2DataBase(connection);
>>>>>>>
public String[] importFile(Connection connection, String tableReference, File fileName, String options, boolean deleteTables, ProgressVisitor progress) throws SQLException, IOException {
progress = DriverManager.check(connection,tableReference,fileName, progress);
final DBTypes dbType = DBUtils.getDBType(connection);
<<<<<<<
TableLocation requestedTable = TableLocation.parse(tableReference, dbType);
String table = requestedTable.getTable();
=======
>>>>>>>
<<<<<<<
parse = TableLocation.parse(tableReference, dbType);
=======
>>>>>>> |
<<<<<<<
public static double computeSlope(Geometry geometry) throws IllegalArgumentException {
return TriMarkers.getSlopeInPercent(TriMarkers.getNormalVector(TINFeatureFactory.createTriangle(geometry)), TINFeatureFactory.EPSILON);
=======
public static Double computeSlope(Geometry geometry) throws DelaunayError {
if(geometry == null){
return null;
}
DTriangle triangle = TINFeatureFactory.createDTriangle(geometry);
return triangle.getSlopeInPercent();
>>>>>>>
public static Double computeSlope(Geometry geometry) throws IllegalArgumentException {
if(geometry == null){
return null;
}
return TriMarkers.getSlopeInPercent(TriMarkers.getNormalVector(TINFeatureFactory.createTriangle(geometry)), TINFeatureFactory.EPSILON); |
<<<<<<<
new ST_IsValidReason(),
new ST_IsValidDetail(),
=======
new ST_MakePolygon(),
>>>>>>>
new ST_MakePolygon(),
new ST_IsValidReason(),
new ST_IsValidDetail(), |
<<<<<<<
@Override
public String toString()
{
StringBuilder sb = new StringBuilder(32 + (size() << 4));
sb.append("{");
int count = 0;
for (Map.Entry<String, JsonNode> en : _children.entrySet()) {
if (count > 0) {
sb.append(",");
}
++count;
// 09-Dec-2017, tatu: Use apostrophes on purpose to prevent use as JSON producer:
sb.append('\'')
// CharTypes.appendQuoted(sb, content);
.append(en.getKey())
.append('\'')
.append(':')
.append(en.getValue().toString());
}
sb.append("}");
return sb.toString();
}
=======
>>>>>>> |
<<<<<<<
@Test
public void testReadGeoJSON1() throws Exception {
Statement stat = connection.createStatement();
ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('{\"type\":\"Point\",\"coordinates\":[10,1]}')");
res.next();
assertTrue(res.getString(1).equals("POINT (10 1)"));
stat.close();
}
@Test
public void testReadGeoJSON2() throws Exception {
Statement stat = connection.createStatement();
ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('{\"type\":\"LineString\",\"coordinates\":[[1,1],[10,10]]}')");
res.next();
assertTrue(res.getString(1).equals("LINESTRING (1 1, 10 10)"));
stat.close();
}
@Test
public void testReadGeoJSON3() throws Exception {
Statement stat = connection.createStatement();
ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('{ \"type\": \"MultiPoint\", \"coordinates\": [ [100, 0], [101, 1] ]}')");
res.next();
assertTrue(res.getString(1).equals("MULTIPOINT ((100 0), (101 1))"));
stat.close();
}
=======
@Test
public void testWriteReadGeojsonMixedGeometries() throws Exception {
Statement stat = connection.createStatement();
stat.execute("DROP TABLE IF EXISTS TABLE_MIXED");
stat.execute("create table TABLE_MIXED(the_geom GEOMETRY)");
stat.execute("insert into TABLE_MIXED values( 'MULTIPOINT ((140 260), (246 284))')");
stat.execute("insert into TABLE_MIXED values( 'LINESTRING (150 290, 180 170, 266 275)')");
stat.execute("CALL GeoJsonWrite('target/mixedgeom.geojson', 'TABLE_MIXED');");
stat.execute("CALL GeoJsonRead('target/mixedgeom.geojson', 'TABLE_MIXED_READ');");
ResultSet res = stat.executeQuery("SELECT * FROM TABLE_MIXED_READ;");
res.next();
assertTrue(((Geometry) res.getObject(1)).equals(WKTREADER.read("MULTIPOINT ((140 260), (246 284))")));
res.next();
assertTrue(((Geometry) res.getObject(1)).equals(WKTREADER.read("LINESTRING (150 290, 180 170, 266 275)")));
res.close();
stat.execute("DROP TABLE IF EXISTS TABLE_MIXED_READ");
stat.close();
}
>>>>>>>
@Test
public void testWriteReadGeojsonMixedGeometries() throws Exception {
Statement stat = connection.createStatement();
stat.execute("DROP TABLE IF EXISTS TABLE_MIXED");
stat.execute("create table TABLE_MIXED(the_geom GEOMETRY)");
stat.execute("insert into TABLE_MIXED values( 'MULTIPOINT ((140 260), (246 284))')");
stat.execute("insert into TABLE_MIXED values( 'LINESTRING (150 290, 180 170, 266 275)')");
stat.execute("CALL GeoJsonWrite('target/mixedgeom.geojson', 'TABLE_MIXED');");
stat.execute("CALL GeoJsonRead('target/mixedgeom.geojson', 'TABLE_MIXED_READ');");
ResultSet res = stat.executeQuery("SELECT * FROM TABLE_MIXED_READ;");
res.next();
assertTrue(((Geometry) res.getObject(1)).equals(WKTREADER.read("MULTIPOINT ((140 260), (246 284))")));
res.next();
assertTrue(((Geometry) res.getObject(1)).equals(WKTREADER.read("LINESTRING (150 290, 180 170, 266 275)")));
res.close();
stat.execute("DROP TABLE IF EXISTS TABLE_MIXED_READ");
stat.close();
}
public void testReadGeoJSON1() throws Exception {
Statement stat = connection.createStatement();
ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('{\"type\":\"Point\",\"coordinates\":[10,1]}')");
res.next();
assertTrue(res.getString(1).equals("POINT (10 1)"));
stat.close();
}
@Test
public void testReadGeoJSON2() throws Exception {
Statement stat = connection.createStatement();
ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('{\"type\":\"LineString\",\"coordinates\":[[1,1],[10,10]]}')");
res.next();
assertTrue(res.getString(1).equals("LINESTRING (1 1, 10 10)"));
stat.close();
}
@Test
public void testReadGeoJSON3() throws Exception {
Statement stat = connection.createStatement();
ResultSet res = stat.executeQuery("SELECT ST_GeomFromGeoJSON('{ \"type\": \"MultiPoint\", \"coordinates\": [ [100, 0], [101, 1] ]}')");
res.next();
assertTrue(res.getString(1).equals("MULTIPOINT ((100 0), (101 1))"));
stat.close();
} |
<<<<<<<
if (removableRoot == null || primaryRoot == null) {
removableRoot = FileUtil.getStoragePath(_context, true);
primaryRoot = FileUtil.getStoragePath(_context, false);
}
if (path.contains(removableRoot))
path = path.substring(removableRoot.lastIndexOf('/') + 1);
if (path.contains(primaryRoot))
path = path.substring(primaryRoot.lastIndexOf('/') + 1);
=======
String removableRoot = FileUtil.getStoragePath(_context, true);
String primaryRoot = FileUtil.getStoragePath(_context, false);
if (path.contains(removableRoot))
path = path.substring(displayRoot ? removableRoot.lastIndexOf('/') + 1 : removableRoot.length());
if (path.contains(primaryRoot))
path = path.substring(displayRoot ? primaryRoot.lastIndexOf('/') + 1 : primaryRoot.length());
>>>>>>>
if (removableRoot == null || primaryRoot == null) {
removableRoot = FileUtil.getStoragePath(_context, true);
primaryRoot = FileUtil.getStoragePath(_context, false);
}
if (path.contains(removableRoot)) {
path = path.substring(removableRoot.lastIndexOf('/') + 1);
}
if (path.contains(primaryRoot)) {
path = path.substring(primaryRoot.lastIndexOf('/') + 1);
} |
<<<<<<<
=======
/**
* @since 2.12
*/
protected final TypeSerializer _valueTypeSerializer;
protected final JsonSerializer<Object> _valueSerializer;
protected final BeanProperty _property;
>>>>>>>
<<<<<<<
=======
_valueType = accessor.getType();
_valueTypeSerializer = vts;
_valueSerializer = (JsonSerializer<Object>) ser;
_property = null;
>>>>>>>
<<<<<<<
protected JsonValueSerializer(JsonValueSerializer src, BeanProperty property,
JsonSerializer<?> ser, boolean forceTypeInfo)
=======
/**
* @deprecated Since 2.12
*/
@Deprecated
public JsonValueSerializer(AnnotatedMember accessor, JsonSerializer<?> ser) {
this(accessor, null, ser);
}
// @since 2.12
@SuppressWarnings("unchecked")
public JsonValueSerializer(JsonValueSerializer src, BeanProperty property,
TypeSerializer vts, JsonSerializer<?> ser, boolean forceTypeInfo)
>>>>>>>
protected JsonValueSerializer(JsonValueSerializer src, BeanProperty property,
TypeSerializer vts, JsonSerializer<?> ser, boolean forceTypeInfo)
<<<<<<<
_accessor = src._accessor;
_staticTyping = src._staticTyping;
=======
_valueTypeSerializer = vts;
_valueSerializer = (JsonSerializer<Object>) ser;
_property = property;
>>>>>>>
_accessor = src._accessor;
_staticTyping = src._staticTyping;
<<<<<<<
if ((_property == property) && (_valueSerializer == ser)
&& (forceTypeInfo == _forceTypeInformation)) {
=======
if ((_property == property)
&& (_valueTypeSerializer == vts) && (_valueSerializer == ser)
&& (forceTypeInfo == _forceTypeInformation)) {
>>>>>>>
if ((_property == property)
&& (_valueTypeSerializer == vts) && (_valueSerializer == ser)
&& (forceTypeInfo == _forceTypeInformation)) {
<<<<<<<
=======
/*
/**********************************************************
/* Overrides
/**********************************************************
*/
@Override // since 2.12
public boolean isEmpty(SerializerProvider ctxt, Object bean)
{
// 31-Oct-2020, tatu: Should perhaps catch access issue here... ?
Object referenced = _accessor.getValue(bean);
if (referenced == null) {
return true;
}
JsonSerializer<Object> ser = _valueSerializer;
if (ser == null) {
try {
ser = _findDynamicSerializer(ctxt, referenced.getClass());
} catch (JsonMappingException e) {
throw new RuntimeJsonMappingException(e);
}
}
return ser.isEmpty(ctxt, referenced);
}
>>>>>>>
/*
/**********************************************************
/* Overrides
/**********************************************************
*/
@Override // since 2.12
public boolean isEmpty(SerializerProvider ctxt, Object bean) throws IOException
{
// 31-Oct-2020, tatu: Should perhaps catch access issue here... ?
Object referenced = _accessor.getValue(bean);
if (referenced == null) {
return true;
}
JsonSerializer<Object> ser = _valueSerializer;
if (ser == null) {
ser = _findAndAddDynamic(ctxt, referenced.getClass());
}
return ser.isEmpty(ctxt, referenced);
}
<<<<<<<
ser = provider.handlePrimaryContextualization(ser, property);
return withResolved(property, ser, _forceTypeInformation);
=======
ser = ctxt.handlePrimaryContextualization(ser, property);
return withResolved(property, typeSer, ser, _forceTypeInformation);
>>>>>>>
ser = ctxt.handlePrimaryContextualization(ser, property);
return withResolved(property, vts, ser, _forceTypeInformation);
<<<<<<<
ctxt.defaultSerializeNullValue(gen);
return;
}
JsonSerializer<Object> ser = _valueSerializer;
if (ser == null) {
Class<?> cc = value.getClass();
if (_valueType.hasGenericTypes()) {
ser = _findAndAddDynamic(ctxt,
ctxt.constructSpecializedType(_valueType, cc));
} else {
ser = _findAndAddDynamic(ctxt, cc);
}
}
if (_valueTypeSerializer != null) {
ser.serializeWithType(value, gen, ctxt, _valueTypeSerializer);
} else {
ser.serialize(value, gen, ctxt);
=======
ctxt.defaultSerializeNull(gen);
} else {
JsonSerializer<Object> ser = _valueSerializer;
if (ser == null) {
ser = _findDynamicSerializer(ctxt, value.getClass());
}
if (_valueTypeSerializer != null) {
ser.serializeWithType(value, gen, ctxt, _valueTypeSerializer);
} else {
ser.serialize(value, gen, ctxt);
}
>>>>>>>
ctxt.defaultSerializeNullValue(gen);
return;
}
JsonSerializer<Object> ser = _valueSerializer;
if (ser == null) {
Class<?> cc = value.getClass();
if (_valueType.hasGenericTypes()) {
ser = _findAndAddDynamic(ctxt,
ctxt.constructSpecializedType(_valueType, cc));
} else {
ser = _findAndAddDynamic(ctxt, cc);
}
}
if (_valueTypeSerializer != null) {
ser.serializeWithType(value, gen, ctxt, _valueTypeSerializer);
} else {
ser.serialize(value, gen, ctxt);
<<<<<<<
if (ser == null) {
Class<?> cc = value.getClass();
if (_valueType.hasGenericTypes()) {
ser = _findAndAddDynamic(ctxt, ctxt.constructSpecializedType(_valueType, cc));
} else {
ser = _findAndAddDynamic(ctxt, cc);
=======
if (ser == null) { // no serializer yet? Need to fetch
ser = _findDynamicSerializer(ctxt, value.getClass());
} else {
// 09-Dec-2010, tatu: To work around natural type's refusal to add type info, we do
// this (note: type is for the wrapper type, not enclosed value!)
if (_forceTypeInformation) {
// Confusing? Type id is for POJO and NOT for value returned by JsonValue accessor...
WritableTypeId typeIdDef = typeSer0.writeTypePrefix(gen,
typeSer0.typeId(bean, JsonToken.VALUE_STRING));
ser.serialize(value, gen, ctxt);
typeSer0.writeTypeSuffix(gen, typeIdDef);
return;
>>>>>>>
if (ser == null) {
Class<?> cc = value.getClass();
if (_valueType.hasGenericTypes()) {
ser = _findAndAddDynamic(ctxt, ctxt.constructSpecializedType(_valueType, cc));
} else {
ser = _findAndAddDynamic(ctxt, cc);
<<<<<<<
=======
// @since 2.12
protected JsonSerializer<Object> _findDynamicSerializer(SerializerProvider ctxt,
Class<?> valueClass) throws JsonMappingException
{
JsonSerializer<Object> serializer = _dynamicSerializers.serializerFor(valueClass);
if (serializer == null) {
if (_valueType.hasGenericTypes()) {
final JavaType fullType = ctxt.constructSpecializedType(_valueType, valueClass);
serializer = ctxt.findPrimaryPropertySerializer(fullType, _property);
PropertySerializerMap.SerializerAndMapResult result = _dynamicSerializers.addSerializer(fullType, serializer);
_dynamicSerializers = result.map;
} else {
serializer = ctxt.findPrimaryPropertySerializer(valueClass, _property);
PropertySerializerMap.SerializerAndMapResult result = _dynamicSerializers.addSerializer(valueClass, serializer);
_dynamicSerializers = result.map;
}
}
return serializer;
/*
if (_valueType.hasGenericTypes()) {
JavaType fullType = ctxt.constructSpecializedType(_valueType, valueClass);
// 31-Oct-2020, tatu: Should not get typed/root serializer, but for now has to do:
serializer = ctxt.findTypedValueSerializer(fullType, false, _property);
PropertySerializerMap.SerializerAndMapResult result = _dynamicSerializers.addSerializer(fullType, serializer);
// did we get a new map of serializers? If so, start using it
_dynamicSerializers = result.map;
return serializer;
} else {
// 31-Oct-2020, tatu: Should not get typed/root serializer, but for now has to do:
serializer = ctxt.findTypedValueSerializer(valueClass, false, _property);
PropertySerializerMap.SerializerAndMapResult result = _dynamicSerializers.addSerializer(valueClass, serializer);
// did we get a new map of serializers? If so, start using it
_dynamicSerializers = result.map;
return serializer;
}
*/
}
>>>>>>> |
<<<<<<<
import com.fasterxml.jackson.annotation.JsonAutoDetect;
=======
import com.fasterxml.jackson.annotation.JsonFormat;
>>>>>>>
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonFormat;
<<<<<<<
VisibilityChecker.defaultInstance(),
null
=======
VisibilityChecker.Std.defaultInstance(),
null, null
>>>>>>>
VisibilityChecker.defaultInstance(),
null, null
<<<<<<<
JsonInclude.Value defIncl,
JsonSetter.Value defSetter,
VisibilityChecker defVisibility,
Boolean defMergeable) {
=======
JsonInclude.Value defIncl, JsonSetter.Value defSetter,
VisibilityChecker<?> defVisibility, Boolean defMergeable, Boolean defLeniency)
{
>>>>>>>
JsonInclude.Value defIncl, JsonSetter.Value defSetter,
VisibilityChecker defVisibility,
Boolean defMergeable, Boolean defLeniency) {
<<<<<<<
@Override
public ConfigOverrides snapshot()
=======
/**
* @deprecated Since 2.10
*/
@Deprecated // since 2.10
protected ConfigOverrides(Map<Class<?>, MutableConfigOverride> overrides,
JsonInclude.Value defIncl, JsonSetter.Value defSetter,
VisibilityChecker<?> defVisibility, Boolean defMergeable) {
this(overrides, defIncl, defSetter, defVisibility, defMergeable, null);
}
public ConfigOverrides copy()
>>>>>>>
@Override
public ConfigOverrides snapshot()
<<<<<<<
_defaultInclusion, _defaultNullHandling, _visibilityChecker, _defaultMergeable);
=======
_defaultInclusion, _defaultSetterInfo, _visibilityChecker,
_defaultMergeable, _defaultLeniency);
>>>>>>>
_defaultInclusion, _defaultNullHandling, _visibilityChecker,
_defaultMergeable, _defaultLeniency);
<<<<<<<
public VisibilityChecker getDefaultVisibility() {
=======
/**
* @since 2.10
*/
public Boolean getDefaultLeniency() {
return _defaultLeniency;
}
/**
* @since 2.9
*/
public VisibilityChecker<?> getDefaultVisibility() {
>>>>>>>
public Boolean getDefaultLeniency() {
return _defaultLeniency;
}
public VisibilityChecker getDefaultVisibility() { |
<<<<<<<
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
=======
import javax.swing.border.EmptyBorder;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
>>>>>>>
import javax.swing.border.EmptyBorder;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
<<<<<<<
//needed to initialize vertical divider to 0.5 weight
verticalSplitPane.setPreferredSize(new Dimension(500, 600));
//horizontal divider won't drag to the right without a minimum size
verticalSplitPane.setMinimumSize(new Dimension(1, 1));
JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
horizontalSplitPane.setResizeWeight(0.5);
horizontalSplitPane.add(leftPanel);
horizontalSplitPane.add(verticalSplitPane);
=======
JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,treeView,verticalSplitPane);
horizontalSplitPane.setDividerLocation(250);
horizontalSplitPane.setResizeWeight(0.0);
>>>>>>>
//needed to initialize vertical divider to 0.5 weight
verticalSplitPane.setPreferredSize(new Dimension(500, 600));
//horizontal divider won't drag to the right without a minimum size
verticalSplitPane.setMinimumSize(new Dimension(1, 1));
JSplitPane horizontalSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
horizontalSplitPane.add(leftPanel);
horizontalSplitPane.add(verticalSplitPane);
horizontalSplitPane.setDividerLocation(250);
horizontalSplitPane.setResizeWeight(0.0);
<<<<<<<
displayInGUI.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
if (e.getStateChange() == ItemEvent.SELECTED) {
process.launcher.setPrintOut(new PrintStream(new TextOutputStream(outputTextArea)));
} else {
process.launcher.setPrintOut(System.out);
}
}
});
=======
// redirect console output to the GUI
process.launcher.setPrintOut(new PrintStream(new TextOutputStream(outputTextArea)));
process.launcher.setPrintErr(new PrintStream(new TextOutputStream(outputTextArea)));
>>>>>>>
// redirect console output to the GUI
process.launcher.setPrintOut(new PrintStream(new TextOutputStream(outputTextArea)));
process.launcher.setPrintErr(new PrintStream(new TextOutputStream(outputTextArea))); |
<<<<<<<
List<String> getAllJobs(CuratorRepository.CuratorFrameworkOp curatorFrameworkOp) throws SaturnJobConsoleException;
List<String> getAllUnSystemJobs(CuratorRepository.CuratorFrameworkOp curatorFrameworkOp) throws SaturnJobConsoleException;
=======
Long calculateJobNextTime(String jobName);
Long getNextFireTimeAfterSpecifiedTimeExcludePausePeriod(long nextFireTimeAfterThis, String jobName, CuratorRepository.CuratorFrameworkOp curatorFrameworkOp);
>>>>>>>
Long calculateJobNextTime(String jobName);
Long getNextFireTimeAfterSpecifiedTimeExcludePausePeriod(long nextFireTimeAfterThis, String jobName, CuratorRepository.CuratorFrameworkOp curatorFrameworkOp);
List<String> getAllJobs(CuratorRepository.CuratorFrameworkOp curatorFrameworkOp) throws SaturnJobConsoleException;
List<String> getAllUnSystemJobs(CuratorRepository.CuratorFrameworkOp curatorFrameworkOp) throws SaturnJobConsoleException; |
<<<<<<<
import java.util.*;
=======
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
>>>>>>>
import java.util.*;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Collection;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Locale;
<<<<<<<
=======
import com.vip.saturn.job.console.utils.CommonUtils;
import com.vip.saturn.job.console.utils.CronExpression;
>>>>>>>
import com.vip.saturn.job.console.utils.CommonUtils;
import com.vip.saturn.job.console.utils.CronExpression; |
<<<<<<<
import cc.shinichi.bigimageviewpager.glide.GlideV4Engine;
=======
>>>>>>>
<<<<<<<
import com.zhihu.matisse.Matisse;
import com.zhihu.matisse.MimeType;
import com.zhihu.matisse.internal.entity.CaptureStrategy;
=======
>>>>>>> |
<<<<<<<
public static boolean isIsPaymentsEnable() {
return isPaymentsEnable;
}
public static void requestUserState(Context ctx, VKPaymentsCallback callback) {
VKPaymentsCallback.requestUserState(ctx, callback);
}
public void withPayments() {
isPaymentsEnable = true;
VKPaymentsReceiver.onReceiveStatic(applicationContext);
}
=======
public static void customInitialize(Context ctx, int appId, String apiVer) {
if (appId == 0) {
appId = getIntFromPref(ctx, VK_SDK_APP_ID_PREF_KEY);
}
if (TextUtils.isEmpty(apiVer)) {
apiVer = getStringFromPref(ctx, VK_SDK_APP_VERSION_PREF_KEY, VKSdkVersion.DEFAULT_API_VERSION);
}
if (appId == 0) {
throw new RuntimeException("your_app_id is 0");
}
sIsCustomInitialize = true;
initialize(ctx, appId, apiVer);
if (sCurrentAppId != 0) {
storeIntToPref(ctx, VK_SDK_APP_ID_PREF_KEY, sCurrentAppId);
}
if (sCurrentApiVersion != null) {
storeStringToPref(ctx, VK_SDK_APP_VERSION_PREF_KEY, sCurrentApiVersion);
}
}
public static boolean isCustomInitialize() {
return sIsCustomInitialize;
}
>>>>>>>
public static boolean isIsPaymentsEnable() {
return isPaymentsEnable;
}
public static void requestUserState(Context ctx, VKPaymentsCallback callback) {
VKPaymentsCallback.requestUserState(ctx, callback);
}
public void withPayments() {
isPaymentsEnable = true;
VKPaymentsReceiver.onReceiveStatic(applicationContext);
}
public static VKSdk customInitialize(Context ctx, int appId, String apiVer) {
if (appId == 0) {
appId = getIntFromPref(ctx, VK_SDK_APP_ID_PREF_KEY);
}
if (TextUtils.isEmpty(apiVer)) {
apiVer = getStringFromPref(ctx, VK_SDK_APP_VERSION_PREF_KEY, VKSdkVersion.DEFAULT_API_VERSION);
}
if (appId == 0) {
throw new RuntimeException("your_app_id is 0");
}
sIsCustomInitialize = true;
VKSdk vkSdk = initialize(ctx, appId, apiVer);
if (sCurrentAppId != 0) {
storeIntToPref(ctx, VK_SDK_APP_ID_PREF_KEY, sCurrentAppId);
}
if (sCurrentApiVersion != null) {
storeStringToPref(ctx, VK_SDK_APP_VERSION_PREF_KEY, sCurrentApiVersion);
}
return vkSdk;
}
public static boolean isCustomInitialize() {
return sIsCustomInitialize;
}
<<<<<<<
public synchronized static VKSdk initialize(Context applicationContext) {
=======
public static void initialize(Context ctx) {
>>>>>>>
public static VKSdk initialize(Context ctx) {
<<<<<<<
vkSdk = new VKSdk(applicationContext);
if (!(applicationContext instanceof Application)) {
if (applicationContext == null) {
=======
if (!(ctx instanceof Application)) {
if (ctx == null) {
>>>>>>>
if (!(ctx instanceof Application)) {
if (ctx == null) { |
<<<<<<<
=======
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.view.WindowManager;
//import android.view.View;
>>>>>>>
import android.view.View;
import android.view.ViewGroup.LayoutParams; |
<<<<<<<
import android.webkit.WebBackForwardList;
import android.webkit.WebHistoryItem;
=======
import android.webkit.WebChromeClient;
>>>>>>>
import android.webkit.WebBackForwardList;
import android.webkit.WebHistoryItem;
import android.webkit.WebChromeClient;
<<<<<<<
NativeToJsMessageQueue jsMessageQueue;
ExposedJsApi exposedJsApi;
=======
/** custom view created by the browser (a video player for example) */
private View mCustomView;
private WebChromeClient.CustomViewCallback mCustomViewCallback;
static final FrameLayout.LayoutParams COVER_SCREEN_GRAVITY_CENTER =
new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
Gravity.CENTER);
>>>>>>>
NativeToJsMessageQueue jsMessageQueue;
ExposedJsApi exposedJsApi;
/** custom view created by the browser (a video player for example) */
private View mCustomView;
private WebChromeClient.CustomViewCallback mCustomViewCallback;
static final FrameLayout.LayoutParams COVER_SCREEN_GRAVITY_CENTER =
new FrameLayout.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.MATCH_PARENT,
Gravity.CENTER);
<<<<<<<
// Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
// while we do this
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
Level16Apis.enableUniversalAccess(settings);
=======
//Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
//while we do this
// TODO .setAllowUniversalAccessFromFileURLs(true); is abstract and cannot be called
//if(android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
// settings.setAllowUniversalAccessFromFileURLs(true);
>>>>>>>
// Jellybean rightfully tried to lock this down. Too bad they didn't give us a whitelist
// while we do this
if (android.os.Build.VERSION.SDK_INT > android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1)
Level16Apis.enableUniversalAccess(settings);
<<<<<<<
// If back key is bound, then send event to JavaScript
if (this.bound) {
this.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');");
return true;
} else {
// If not bound
// Go to previous page in webview if it is possible to go back
if (this.backHistory()) {
return true;
}
// If not, then invoke default behavior
else {
//this.activityState = ACTIVITY_EXITING;
return false;
}
}
=======
// A custom view is currently displayed (e.g. playing a video)
if(mCustomView != null) {
this.hideCustomView();
} else {
// The webview is currently displayed
// If back key is bound, then send event to JavaScript
if (this.bound) {
this.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');");
return true;
} else {
// If not bound
// Go to previous page in webview if it is possible to go back
if (this.backHistory()) {
return true;
}
// If not, then invoke default behaviour
else {
//this.activityState = ACTIVITY_EXITING;
return false;
}
}
}
>>>>>>>
// A custom view is currently displayed (e.g. playing a video)
if(mCustomView != null) {
this.hideCustomView();
} else {
// The webview is currently displayed
// If back key is bound, then send event to JavaScript
if (this.bound) {
this.loadUrl("javascript:cordova.fireDocumentEvent('backbutton');");
return true;
} else {
// If not bound
// Go to previous page in webview if it is possible to go back
if (this.backHistory()) {
return true;
}
// If not, then invoke default behaviour
else {
//this.activityState = ACTIVITY_EXITING;
return false;
}
}
}
<<<<<<<
// Wrapping these functions in their own class prevents warnings in adb like:
// VFY: unable to resolve virtual method 285: Landroid/webkit/WebSettings;.setAllowUniversalAccessFromFileURLs
@TargetApi(16)
private static class Level16Apis {
static void enableUniversalAccess(WebSettings settings) {
settings.setAllowUniversalAccessFromFileURLs(true);
}
}
public void printBackForwardList() {
WebBackForwardList currentList = this.copyBackForwardList();
int currentSize = currentList.getSize();
for(int i = 0; i < currentSize; ++i)
{
WebHistoryItem item = currentList.getItemAtIndex(i);
String url = item.getUrl();
LOG.d(TAG, "The URL at index: " + Integer.toString(i) + "is " + url );
}
}
//Can Go Back is BROKEN!
public boolean startOfHistory()
{
WebBackForwardList currentList = this.copyBackForwardList();
WebHistoryItem item = currentList.getItemAtIndex(0);
String url = item.getUrl();
String currentUrl = this.getUrl();
LOG.d(TAG, "The current URL is: " + currentUrl);
LOG.d(TAG, "The URL at item 0 is:" + url);
return currentUrl.equals(url);
}
=======
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
// This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
Log.d(TAG, "showing Custom View");
// if a view already exists then immediately terminate the new one
if (mCustomView != null) {
callback.onCustomViewHidden();
return;
}
// Store the view and its callback for later (to kill it properly)
mCustomView = view;
mCustomViewCallback = callback;
// Add the custom view to its container.
ViewGroup parent = (ViewGroup) this.getParent();
parent.addView(view, COVER_SCREEN_GRAVITY_CENTER);
// Hide the content view.
this.setVisibility(View.GONE);
// Finally show the custom view container.
parent.setVisibility(View.VISIBLE);
parent.bringToFront();
}
public void hideCustomView() {
// This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
Log.d(TAG, "Hidding Custom View");
if (mCustomView == null) return;
// Hide the custom view.
mCustomView.setVisibility(View.GONE);
// Remove the custom view from its container.
ViewGroup parent = (ViewGroup) this.getParent();
parent.removeView(mCustomView);
mCustomView = null;
mCustomViewCallback.onCustomViewHidden();
// Show the content view.
this.setVisibility(View.VISIBLE);
}
>>>>>>>
// Wrapping these functions in their own class prevents warnings in adb like:
// VFY: unable to resolve virtual method 285: Landroid/webkit/WebSettings;.setAllowUniversalAccessFromFileURLs
@TargetApi(16)
private static class Level16Apis {
static void enableUniversalAccess(WebSettings settings) {
settings.setAllowUniversalAccessFromFileURLs(true);
}
}
public void printBackForwardList() {
WebBackForwardList currentList = this.copyBackForwardList();
int currentSize = currentList.getSize();
for(int i = 0; i < currentSize; ++i)
{
WebHistoryItem item = currentList.getItemAtIndex(i);
String url = item.getUrl();
LOG.d(TAG, "The URL at index: " + Integer.toString(i) + "is " + url );
}
}
//Can Go Back is BROKEN!
public boolean startOfHistory()
{
WebBackForwardList currentList = this.copyBackForwardList();
WebHistoryItem item = currentList.getItemAtIndex(0);
String url = item.getUrl();
String currentUrl = this.getUrl();
LOG.d(TAG, "The current URL is: " + currentUrl);
LOG.d(TAG, "The URL at item 0 is:" + url);
return currentUrl.equals(url);
}
public void showCustomView(View view, WebChromeClient.CustomViewCallback callback) {
// This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
Log.d(TAG, "showing Custom View");
// if a view already exists then immediately terminate the new one
if (mCustomView != null) {
callback.onCustomViewHidden();
return;
}
// Store the view and its callback for later (to kill it properly)
mCustomView = view;
mCustomViewCallback = callback;
// Add the custom view to its container.
ViewGroup parent = (ViewGroup) this.getParent();
parent.addView(view, COVER_SCREEN_GRAVITY_CENTER);
// Hide the content view.
this.setVisibility(View.GONE);
// Finally show the custom view container.
parent.setVisibility(View.VISIBLE);
parent.bringToFront();
}
public void hideCustomView() {
// This code is adapted from the original Android Browser code, licensed under the Apache License, Version 2.0
Log.d(TAG, "Hidding Custom View");
if (mCustomView == null) return;
// Hide the custom view.
mCustomView.setVisibility(View.GONE);
// Remove the custom view from its container.
ViewGroup parent = (ViewGroup) this.getParent();
parent.removeView(mCustomView);
mCustomView = null;
mCustomViewCallback.onCustomViewHidden();
// Show the content view.
this.setVisibility(View.VISIBLE);
}
/**
* if the video overlay is showing then we need to know
* as it effects back button handling
*
* @return
*/
public boolean isCustomViewShowing() {
return mCustomView != null;
} |
<<<<<<<
import java.util.Hashtable;
import org.apache.cordova.api.CordovaInterface;
=======
import java.io.IOException;
import java.io.InputStream;
>>>>>>>
import java.util.Hashtable;
import org.apache.cordova.api.CordovaInterface;
import java.io.IOException;
import java.io.InputStream;
<<<<<<<
*
* @param cordova
* @param view
=======
*
* @param ctx
>>>>>>>
*
* @param cordova
* @param view
<<<<<<<
* Constructor.
*
* @param view
*/
public void setWebView(CordovaWebView view) {
this.appView = view;
}
/**
* Give the host application a chance to take over the control when a new url
* is about to be loaded in the current WebView.
*
=======
* Give the host application a chance to take over the control when a new url
* is about to be loaded in the current WebView.
*
>>>>>>>
* Constructor.
*
* @param view
*/
public void setWebView(CordovaWebView view) {
this.appView = view;
}
/**
* Give the host application a chance to take over the control when a new url
* is about to be loaded in the current WebView.
*
<<<<<<<
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
// Get the authentication token
AuthenticationToken token = this.getAuthenticationToken(host, realm);
if (token != null) {
=======
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host,
String realm) {
// get the authentication token
AuthenticationToken token = ctx.getAuthenticationToken(host,realm);
if(token != null) {
>>>>>>>
public void onReceivedHttpAuthRequest(WebView view, HttpAuthHandler handler, String host, String realm) {
// Get the authentication token
AuthenticationToken token = this.getAuthenticationToken(host, realm);
if (token != null) {
<<<<<<<
/**
* Notify the host application that a page has started loading.
* This method is called once for each main frame load so a page with iframes or framesets will call onPageStarted
* one time for the main frame. This also means that onPageStarted will not be called when the contents of an
* embedded frame changes, i.e. clicking a link whose target is an iframe.
*
* @param view The webview initiating the callback.
* @param url The url of the page.
*/
=======
>>>>>>>
/**
* Notify the host application that a page has started loading.
* This method is called once for each main frame load so a page with iframes or framesets will call onPageStarted
* one time for the main frame. This also means that onPageStarted will not be called when the contents of an
* embedded frame changes, i.e. clicking a link whose target is an iframe.
*
* @param view The webview initiating the callback.
* @param url The url of the page.
*/
<<<<<<<
if (!this.appView.useBrowserHistory) {
view.clearHistory();
this.doClearHistory = true;
}
// Create callback server and plugin manager
if (this.appView.callbackServer == null) {
this.appView.callbackServer = new CallbackServer();
this.appView.callbackServer.init(url);
}
else {
this.appView.callbackServer.reinit(url);
}
// Broadcast message that page has loaded
this.appView.postMessage("onPageStarted", url);
=======
view.clearHistory();
this.doClearHistory = true;
>>>>>>>
if (!this.appView.useBrowserHistory) {
view.clearHistory();
this.doClearHistory = true;
}
// Create callback server and plugin manager
if (this.appView.callbackServer == null) {
this.appView.callbackServer = new CallbackServer();
this.appView.callbackServer.init(url);
}
else {
this.appView.callbackServer.reinit(url);
}
// Broadcast message that page has loaded
this.appView.postMessage("onPageStarted", url);
<<<<<<<
* This method is called only for main frame. When onPageFinished() is called, the rendering picture may not be updated yet.
*
=======
*
>>>>>>>
* This method is called only for main frame. When onPageFinished() is called, the rendering picture may not be updated yet.
*
*
<<<<<<<
/**
* Notify the host application that an SSL error occurred while loading a resource.
* The host application must call either handler.cancel() or handler.proceed().
* Note that the decision may be retained for use in response to future SSL errors.
* The default behavior is to cancel the load.
*
* @param view The WebView that is initiating the callback.
* @param handler An SslErrorHandler object that will handle the user's response.
* @param error The SSL error object.
*/
@Override
=======
>>>>>>>
/**
* Notify the host application that an SSL error occurred while loading a resource.
* The host application must call either handler.cancel() or handler.proceed().
* Note that the decision may be retained for use in response to future SSL errors.
* The default behavior is to cancel the load.
*
* @param view The WebView that is initiating the callback.
* @param handler An SslErrorHandler object that will handle the user's response.
* @param error The SSL error object.
*/
@Override
<<<<<<<
final String packageName = this.cordova.getActivity().getPackageName();
final PackageManager pm = this.cordova.getActivity().getPackageManager();
=======
final String packageName = this.ctx.getPackageName();
final PackageManager pm = this.ctx.getPackageManager();
>>>>>>>
final String packageName = this.cordova.getActivity().getPackageName();
final PackageManager pm = this.cordova.getActivity().getPackageManager();
<<<<<<<
/**
* Removes the authentication token.
*
* @param host
* @param realm
*
* @return the authentication token or null if did not exist
*/
public AuthenticationToken removeAuthenticationToken(String host, String realm) {
return this.authenticationTokens.remove(host.concat(realm));
}
/**
* Gets the authentication token.
*
* In order it tries:
* 1- host + realm
* 2- host
* 3- realm
* 4- no host, no realm
*
* @param host
* @param realm
*
* @return the authentication token
*/
public AuthenticationToken getAuthenticationToken(String host, String realm) {
AuthenticationToken token = null;
token = this.authenticationTokens.get(host.concat(realm));
if (token == null) {
// try with just the host
token = this.authenticationTokens.get(host);
// Try the realm
if (token == null) {
token = this.authenticationTokens.get(realm);
}
// if no host found, just query for default
if (token == null) {
token = this.authenticationTokens.get("");
}
}
return token;
}
/**
* Clear all authentication tokens.
*/
public void clearAuthenticationTokens() {
this.authenticationTokens.clear();
}
=======
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
if(url.contains("?")){
return generateWebResourceResponse(url);
} else {
return super.shouldInterceptRequest(view, url);
}
}
private WebResourceResponse generateWebResourceResponse(String url) {
final String ANDROID_ASSET = "file:///android_asset/";
if (url.startsWith(ANDROID_ASSET)) {
String niceUrl = url;
niceUrl = url.replaceFirst(ANDROID_ASSET, "");
if(niceUrl.contains("?")){
niceUrl = niceUrl.split("\\?")[0];
}
String mimetype = null;
if(niceUrl.endsWith(".html")){
mimetype = "text/html";
}
try {
AssetManager assets = ctx.getAssets();
Uri uri = Uri.parse(niceUrl);
InputStream stream = assets.open(uri.getPath(), AssetManager.ACCESS_STREAMING);
WebResourceResponse response = new WebResourceResponse(mimetype, "UTF-8", stream);
return response;
} catch (IOException e) {
Log.e("generateWebResourceResponse", e.getMessage(), e);
}
}
return null;
}
>>>>>>>
/**
* Removes the authentication token.
*
* @param host
* @param realm
*
* @return the authentication token or null if did not exist
*/
public AuthenticationToken removeAuthenticationToken(String host, String realm) {
return this.authenticationTokens.remove(host.concat(realm));
}
/**
* Gets the authentication token.
*
* In order it tries:
* 1- host + realm
* 2- host
* 3- realm
* 4- no host, no realm
*
* @param host
* @param realm
*
* @return the authentication token
*/
public AuthenticationToken getAuthenticationToken(String host, String realm) {
AuthenticationToken token = null;
token = this.authenticationTokens.get(host.concat(realm));
if (token == null) {
// try with just the host
token = this.authenticationTokens.get(host);
// Try the realm
if (token == null) {
token = this.authenticationTokens.get(realm);
}
// if no host found, just query for default
if (token == null) {
token = this.authenticationTokens.get("");
}
}
return token;
}
/**
* Clear all authentication tokens.
*/
public void clearAuthenticationTokens() {
this.authenticationTokens.clear();
}
@Override
public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
if(url.contains("?")){
return generateWebResourceResponse(url);
} else {
return super.shouldInterceptRequest(view, url);
}
}
private WebResourceResponse generateWebResourceResponse(String url) {
final String ANDROID_ASSET = "file:///android_asset/";
if (url.startsWith(ANDROID_ASSET)) {
String niceUrl = url;
niceUrl = url.replaceFirst(ANDROID_ASSET, "");
if(niceUrl.contains("?")){
niceUrl = niceUrl.split("\\?")[0];
}
String mimetype = null;
if(niceUrl.endsWith(".html")){
mimetype = "text/html";
}
try {
AssetManager assets = cordova.getActivity().getAssets();
Uri uri = Uri.parse(niceUrl);
InputStream stream = assets.open(uri.getPath(), AssetManager.ACCESS_STREAMING);
WebResourceResponse response = new WebResourceResponse(mimetype, "UTF-8", stream);
return response;
} catch (IOException e) {
LOG.e("generateWebResourceResponse", e.getMessage(), e);
}
}
return null;
} |
<<<<<<<
import com.datasalt.pangool.io.HadoopInputFormat;
import com.datasalt.pangool.io.HadoopOutputFormat;
import com.datasalt.pangool.io.Utf8;
=======
>>>>>>>
import com.datasalt.pangool.io.HadoopInputFormat;
import com.datasalt.pangool.io.HadoopOutputFormat; |
<<<<<<<
=======
public List<String> getCustomPartitionFields(){
return customPartitionFields;
}
>>>>>>>
public List<String> getCustomPartitionFields(){
return customPartitionFields;
}
<<<<<<<
void addSource(Schema schema) throws CoGrouperException {
if(sourceNames.contains(schema.getName())) {
=======
private void addSource(Schema schema) throws CoGrouperException {
if (sourceNames.contains(schema.getName())){
>>>>>>>
private void addSource(Schema schema) throws CoGrouperException {
if (sourceNames.contains(schema.getName())){
<<<<<<<
=======
void setSourceSchemas(Collection<Schema> schemas) throws CoGrouperException {
for (Schema s : schemas){
addSource(s);
}
}
>>>>>>>
void setSourceSchemas(Collection<Schema> schemas) throws CoGrouperException {
for (Schema s : schemas){
addSource(s);
}
}
<<<<<<<
void setSecondarySortBy(String sourceName, Criteria criteria) throws CoGrouperException {
if(this.secondaryCriterias.isEmpty()) {
=======
void setCustomPartitionFields(List<String> customPartitionFields ){
this.customPartitionFields = customPartitionFields;
}
void setSecondarySortBy(String sourceName,Criteria criteria) throws CoGrouperException {
if (this.secondaryCriterias.isEmpty()){
>>>>>>>
void setCustomPartitionFields(List<String> customPartitionFields ){
this.customPartitionFields = customPartitionFields;
}
void setSecondarySortBy(String sourceName,Criteria criteria) throws CoGrouperException {
if (this.secondaryCriterias.isEmpty()){
<<<<<<<
gen.writeStartObject();
gen.writeArrayFieldStart("sourceSchemas");
for(Schema schema : sourceSchemas) {
schema.toJson(gen);
}
gen.writeEndArray();
gen.writeArrayFieldStart("groupByFields");
for(String field : groupByFields) {
gen.writeString(field);
}
gen.writeEndArray();
if(rollupFrom != null) {
gen.writeFieldName("rollupFrom");
gen.writeString(rollupFrom);
}
gen.writeFieldName("commonSortBy");
commonCriteria.toJson(gen);
gen.writeStringField("sourcesOrder", sourcesOrder.toString());
// TODO this code should write a map with sourceName
if(secondaryCriterias == null || secondaryCriterias.isEmpty()) {
initSecondaryCriteriasWithNull();
}
gen.writeArrayFieldStart("secondarySortBys");
for(Criteria c : secondaryCriterias) {
if(c == null) {
gen.writeNull();
} else {
c.toJson(gen);
}
}
gen.writeEndArray();
gen.writeEndObject();
}
=======
gen.writeStartObject();
gen.writeArrayFieldStart("sourceSchemas");
for (Schema schema : sourceSchemas){
schema.toJson(gen);
}
gen.writeEndArray();
gen.writeArrayFieldStart("groupByFields");
for(String field : groupByFields){
gen.writeString(field);
}
gen.writeEndArray();
if (this.customPartitionFields != null && !this.customPartitionFields.isEmpty()){
gen.writeArrayFieldStart("customPartitionFields");
for(String field : customPartitionFields){
gen.writeString(field);
}
gen.writeEndArray();
}
if (rollupFrom != null){
gen.writeFieldName("rollupFrom");
gen.writeString(rollupFrom);
}
gen.writeFieldName("commonSortBy");
commonCriteria.toJson(gen);
gen.writeStringField("sourcesOrder",sourcesOrder.toString());
//TODO this code should write a map with sourceName
if (secondaryCriterias == null || secondaryCriterias.isEmpty()){
initSecondaryCriteriasWithNull();
}
gen.writeArrayFieldStart("secondarySortBys");
for (Criteria c : secondaryCriterias){
if (c == null){
gen.writeNull();
} else {
c.toJson(gen);
}
}
gen.writeEndArray();
gen.writeEndObject();
}
>>>>>>>
gen.writeStartObject();
gen.writeArrayFieldStart("sourceSchemas");
for(Schema schema : sourceSchemas) {
schema.toJson(gen);
}
gen.writeEndArray();
gen.writeArrayFieldStart("groupByFields");
for(String field : groupByFields) {
gen.writeString(field);
}
gen.writeEndArray();
if(rollupFrom != null) {
gen.writeFieldName("rollupFrom");
gen.writeString(rollupFrom);
}
gen.writeFieldName("commonSortBy");
commonCriteria.toJson(gen);
gen.writeStringField("sourcesOrder", sourcesOrder.toString());
// TODO this code should write a map with sourceName
if(secondaryCriterias == null || secondaryCriterias.isEmpty()) {
initSecondaryCriteriasWithNull();
}
gen.writeArrayFieldStart("secondarySortBys");
for(Criteria c : secondaryCriterias) {
if(c == null) {
gen.writeNull();
} else {
c.toJson(gen);
}
}
gen.writeEndArray();
gen.writeEndObject();
}
<<<<<<<
public String toString() {
// TODO not use toJson as toString()... it is not complete.
// Custom comparators does not appears here.
return toJson(true);
}
protected String toJson(boolean pretty) {
try {
StringWriter writer = new StringWriter();
JsonGenerator gen = FACTORY.createJsonGenerator(writer);
if(pretty)
gen.useDefaultPrettyPrinter();
toJson(gen);
gen.flush();
return writer.toString();
} catch(IOException e) {
throw new RuntimeException(e);
}
}
/**
* Parse a schema from the provided string. If named, the schema is added to
* the names known to this parser.
*/
public static CoGrouperConfig parse(String s) throws IOException {
return parse(FACTORY.createJsonParser(new StringReader(s)));
}
private static CoGrouperConfig parse(JsonParser parser) throws IOException {
try {
return parse(MAPPER.readTree(parser));
} catch(JsonParseException e) {
throw new IOException(e);
}
}
public boolean equals(Object a) {
if(!(a instanceof CoGrouperConfig)) {
return false;
}
CoGrouperConfig that = (CoGrouperConfig) a;
return(this.getSourcesOrder() == that.getSourcesOrder()
&& this.getCommonCriteria().equals(that.getCommonCriteria())
&& this.getGroupByFields().equals(that.getGroupByFields())
&& this.getSourceSchemas().equals(that.getSourceSchemas()) && this.getSecondarySortBys().equals(
that.getSecondarySortBys()));
}
=======
public String toString(){
return toString(true);
}
public String toString(boolean pretty) {
try {
StringWriter writer = new StringWriter();
JsonGenerator gen = FACTORY.createJsonGenerator(writer);
if (pretty) gen.useDefaultPrettyPrinter();
toJson(gen);
gen.flush();
return writer.toString();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
/** Parse a schema from the provided string.
* If named, the schema is added to the names known to this parser. */
public static CoGrouperConfig parse(String s) throws IOException {
return parse(FACTORY.createJsonParser(new StringReader(s)));
}
private static CoGrouperConfig parse(JsonParser parser) throws IOException {
try {
return parse(MAPPER.readTree(parser));
} catch (JsonParseException e) {
throw new IOException(e);
}
}
public boolean equals(Object a){
if (!(a instanceof CoGrouperConfig)){
return false;
}
CoGrouperConfig that = (CoGrouperConfig)a;
return (this.getSourcesOrder() == that.getSourcesOrder() &&
this.getCommonCriteria().equals(that.getCommonCriteria()) &&
this.getGroupByFields().equals(that.getGroupByFields()) &&
this.getSourceSchemas().equals(that.getSourceSchemas()) &&
this.getSecondarySortBys().equals(that.getSecondarySortBys()) &&
((this.getCustomPartitionFields() == null && that.getCustomPartitionFields() == null) ||
this.getCustomPartitionFields().equals(that.getCustomPartitionFields())));
}
>>>>>>>
public String toString() {
// TODO not use toJson as toString()... it is not complete.
// Custom comparators does not appears here.
return toJson(true);
}
protected String toJson(boolean pretty) {
try {
StringWriter writer = new StringWriter();
JsonGenerator gen = FACTORY.createJsonGenerator(writer);
if(pretty)
gen.useDefaultPrettyPrinter();
toJson(gen);
gen.flush();
return writer.toString();
} catch(IOException e) {
throw new RuntimeException(e);
}
}
/**
* Parse a schema from the provided string. If named, the schema is added to
* the names known to this parser.
*/
public static CoGrouperConfig parse(String s) throws IOException {
return parse(FACTORY.createJsonParser(new StringReader(s)));
}
private static CoGrouperConfig parse(JsonParser parser) throws IOException {
try {
return parse(MAPPER.readTree(parser));
} catch(JsonParseException e) {
throw new IOException(e);
}
}
public boolean equals(Object a) {
if(!(a instanceof CoGrouperConfig)) {
return false;
}
CoGrouperConfig that = (CoGrouperConfig) a;
return(this.getSourcesOrder() == that.getSourcesOrder()
&& this.getCommonCriteria().equals(that.getCommonCriteria())
&& this.getGroupByFields().equals(that.getGroupByFields())
&& this.getSourceSchemas().equals(that.getSourceSchemas()) && this.getSecondarySortBys().equals(
that.getSecondarySortBys()));
} |
<<<<<<<
=======
/**
* @since 2.8
*/
>>>>>>>
<<<<<<<
JsonIgnoreProperties.Value ignorals = intr.findPropertyIgnoralByName(config, accessor);
if (ignorals != null) {
Set<String> ignored = ignorals.findIgnoredForDeserialization();
if (!ignored.isEmpty()) {
Set<String> prev = contextual._ignorableProps;
if ((prev != null) && !prev.isEmpty()) {
ignored = new HashSet<String>(ignored);
ignored.addAll(prev);
}
contextual = contextual.withIgnorableProperties(ignored);
}
// 30-Mar-2020, tatu: As per [databind#2627], need to also allow
// per-property override to "ignore all unknown".
// NOTE: there is no way to override with `false` because annotation
// defaults to `false` (i.e. can not know if `false` is explicit value)
if (ignorals.getIgnoreUnknown() && !_ignoreAllUnknown) {
contextual = contextual.withIgnoreAllUnknown(true);
}
}
JsonIncludeProperties.Value inclusions = intr.findPropertyInclusionByName(config, accessor);
if (inclusions != null) {
Set<String> included = inclusions.getIncluded();
Set<String> prev = contextual._includableProps;
if (prev != null && included != null) {
Set<String> newIncluded = new HashSet<>();
// Make the intersection with the previously included properties.
for(String prop : prev) {
if (included.contains(prop)) {
newIncluded.add(prop);
}
}
contextual = contextual.withIncludableProperties(newIncluded);
}
}
=======
contextual = _handleByNameInclusion(ctxt, intr, contextual, accessor);
>>>>>>>
contextual = _handleByNameInclusion(ctxt, intr, contextual, accessor);
<<<<<<<
// @since 3.0
protected abstract void initFieldMatcher(DeserializationContext ctxt);
=======
// @since 2.12
protected BeanDeserializerBase _handleByNameInclusion(DeserializationContext ctxt,
AnnotationIntrospector intr,
BeanDeserializerBase contextual,
AnnotatedMember accessor) throws JsonMappingException
{
final DeserializationConfig config = ctxt.getConfig();
JsonIgnoreProperties.Value ignorals = intr.findPropertyIgnoralByName(config, accessor);
// 30-Mar-2020, tatu: As per [databind#2627], need to also allow
// per-property override to "ignore all unknown".
// NOTE: there is no way to override with `false` because annotation
// defaults to `false` (i.e. can not know if `false` is explicit value)
if (ignorals.getIgnoreUnknown() && !_ignoreAllUnknown) {
contextual = contextual.withIgnoreAllUnknown(true);
}
final Set<String> namesToIgnore = ignorals.findIgnoredForDeserialization();
final Set<String> prevNamesToIgnore = contextual._ignorableProps;
final Set<String> newNamesToIgnore;
if (namesToIgnore.isEmpty()) {
newNamesToIgnore = prevNamesToIgnore;
} else if ((prevNamesToIgnore == null) || prevNamesToIgnore.isEmpty()) {
newNamesToIgnore = namesToIgnore;
} else {
newNamesToIgnore = new HashSet<String>(prevNamesToIgnore);
newNamesToIgnore.addAll(namesToIgnore);
}
final Set<String> prevNamesToInclude = contextual._includableProps;
final Set<String> newNamesToInclude = IgnorePropertiesUtil.combineNamesToInclude(prevNamesToInclude,
intr.findPropertyInclusionByName(config, accessor).getIncluded());
if ((newNamesToIgnore != prevNamesToIgnore)
|| (newNamesToInclude != prevNamesToInclude)) {
contextual = contextual.withByNameInclusion(newNamesToIgnore, newNamesToInclude);
}
return contextual;
}
>>>>>>>
protected BeanDeserializerBase _handleByNameInclusion(DeserializationContext ctxt,
AnnotationIntrospector intr,
BeanDeserializerBase contextual,
AnnotatedMember accessor) throws JsonMappingException
{
final DeserializationConfig config = ctxt.getConfig();
JsonIgnoreProperties.Value ignorals = intr.findPropertyIgnoralByName(config, accessor);
// 30-Mar-2020, tatu: As per [databind#2627], need to also allow
// per-property override to "ignore all unknown".
// NOTE: there is no way to override with `false` because annotation
// defaults to `false` (i.e. can not know if `false` is explicit value)
if (ignorals.getIgnoreUnknown() && !_ignoreAllUnknown) {
contextual = contextual.withIgnoreAllUnknown(true);
}
final Set<String> namesToIgnore = ignorals.findIgnoredForDeserialization();
final Set<String> prevNamesToIgnore = contextual._ignorableProps;
final Set<String> newNamesToIgnore;
if (namesToIgnore.isEmpty()) {
newNamesToIgnore = prevNamesToIgnore;
} else if ((prevNamesToIgnore == null) || prevNamesToIgnore.isEmpty()) {
newNamesToIgnore = namesToIgnore;
} else {
newNamesToIgnore = new HashSet<String>(prevNamesToIgnore);
newNamesToIgnore.addAll(namesToIgnore);
}
final Set<String> prevNamesToInclude = contextual._includableProps;
final Set<String> newNamesToInclude = IgnorePropertiesUtil.combineNamesToInclude(prevNamesToInclude,
intr.findPropertyInclusionByName(config, accessor).getIncluded());
if ((newNamesToIgnore != prevNamesToIgnore)
|| (newNamesToInclude != prevNamesToInclude)) {
contextual = contextual.withByNameInclusion(newNamesToIgnore, newNamesToInclude);
}
return contextual;
} |
<<<<<<<
import com.datasalt.pangool.io.HadoopInputFormat;
import com.datasalt.pangool.io.HadoopOutputFormat;
=======
import com.datasalt.pangool.cogroup.sorting.SortBy;
>>>>>>>
import com.datasalt.pangool.cogroup.sorting.SortBy;
import com.datasalt.pangool.io.HadoopInputFormat;
import com.datasalt.pangool.io.HadoopOutputFormat; |
<<<<<<<
=======
import com.datasalt.pangolin.grouper.io.tuple.ITuple.InvalidFieldException;
>>>>>>>
import com.datasalt.pangolin.grouper.io.tuple.ITuple.InvalidFieldException; |
<<<<<<<
JavaStreamingContext ssc = new JavaStreamingContext(master, "FlumeEventCount", batchInterval,
System.getenv("SPARK_HOME"), System.getenv("SPARK_EXAMPLES_JAR"));
FlumeFunctions flumeFunc = new FlumeFunctions(ssc);
JavaDStream<SparkFlumeEvent> flumeStream = flumeFunc.flumeStream("localhost", port);
=======
JavaStreamingContext sc = new JavaStreamingContext(master, "FlumeEventCount", batchInterval,
System.getenv("SPARK_HOME"),
JavaStreamingContext.jarOfClass(JavaFlumeEventCount.class));
JavaDStream<SparkFlumeEvent> flumeStream = sc.flumeStream("localhost", port);
>>>>>>>
JavaStreamingContext ssc = new JavaStreamingContext(master, "FlumeEventCount", batchInterval,
System.getenv("SPARK_HOME"),
JavaStreamingContext.jarOfClass(JavaFlumeEventCount.class));
FlumeFunctions flumeFunc = new FlumeFunctions(ssc);
JavaDStream<SparkFlumeEvent> flumeStream = flumeFunc.flumeStream("localhost", port); |
<<<<<<<
import scala.reflect.ClassTag;
import scala.reflect.ClassTag$;
=======
import scala.reflect.ClassManifest;
import scala.reflect.ClassManifest$;
>>>>>>>
import scala.reflect.ClassTag;
import scala.reflect.ClassTag$;
<<<<<<<
public abstract Iterable<Tuple2<K, V>> call(T t) throws Exception;
public ClassTag<K> keyType() {
return (ClassTag<K>) ClassTag$.MODULE$.apply(Object.class);
=======
public ClassManifest<K> keyType() {
return (ClassManifest<K>) ClassManifest$.MODULE$.fromClass(Object.class);
>>>>>>>
public ClassTag<K> keyType() {
return (ClassTag<K>) ClassTag$.MODULE$.apply(Object.class); |
<<<<<<<
import com.webank.api.consumer.MeshMQPushConsumer;
import com.webank.eventmesh.common.config.CommonConfiguration;
import com.webank.runtime.constants.ProxyConstants;
=======
import com.webank.api.consumer.MeshMQPushConsumer;
import com.webank.eventmesh.common.config.CommonConfiguration;
>>>>>>>
import com.webank.api.consumer.MeshMQPushConsumer;
import com.webank.eventmesh.common.config.CommonConfiguration;
<<<<<<<
protected MeshMQPushConsumer meshMQConsumer;
=======
protected MeshMQPushConsumer meshMQPushConsumer;
>>>>>>>
protected MeshMQPushConsumer meshMQPushConsumer;
<<<<<<<
meshMQConsumer.subscribe(topic);
=======
meshMQPushConsumer.subscribe(topic);
>>>>>>>
meshMQPushConsumer.subscribe(topic);
<<<<<<<
meshMQConsumer.unsubscribe(topic);
=======
meshMQPushConsumer.unsubscribe(topic);
>>>>>>>
meshMQPushConsumer.unsubscribe(topic);
<<<<<<<
if (isBroadcast){
consumerGroup = ProxyConstants.CONSUMER_GROUP_NAME_PREFIX + ProxyConstants.BROADCAST_PREFIX + consumerGroup;
}else {
consumerGroup = ProxyConstants.CONSUMER_GROUP_NAME_PREFIX + consumerGroup;
}
meshMQConsumer.init(isBroadcast, commonConfiguration, consumerGroup);
=======
meshMQPushConsumer.init(isBroadcast, commonConfiguration, consumerGroup);
>>>>>>>
if (isBroadcast){
consumerGroup = ProxyConstants.CONSUMER_GROUP_NAME_PREFIX + ProxyConstants.BROADCAST_PREFIX + consumerGroup;
}else {
consumerGroup = ProxyConstants.CONSUMER_GROUP_NAME_PREFIX + consumerGroup;
}
meshMQPushConsumer.init(isBroadcast, commonConfiguration, consumerGroup);
<<<<<<<
private MeshMQPushConsumer getMeshMQConsumer() {
ServiceLoader<MeshMQPushConsumer> meshMQConsumerServiceLoader = ServiceLoader.load(MeshMQPushConsumer.class);
if (meshMQConsumerServiceLoader.iterator().hasNext()){
return meshMQConsumerServiceLoader.iterator().next();
=======
private MeshMQPushConsumer getMeshMQPushConsumer() {
ServiceLoader<MeshMQPushConsumer> meshMQPushConsumerServiceLoader = ServiceLoader.load(MeshMQPushConsumer.class);
if (meshMQPushConsumerServiceLoader.iterator().hasNext()){
return meshMQPushConsumerServiceLoader.iterator().next();
>>>>>>>
private MeshMQPushConsumer getMeshMQPushConsumer() {
ServiceLoader<MeshMQPushConsumer> meshMQPushConsumerServiceLoader = ServiceLoader.load(MeshMQPushConsumer.class);
if (meshMQPushConsumerServiceLoader.iterator().hasNext()){
return meshMQPushConsumerServiceLoader.iterator().next(); |
<<<<<<<
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
=======
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
>>>>>>>
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.TimeUnit;
<<<<<<<
private Set<ClientSessionFactoryInternal> factories = new HashSet<ClientSessionFactoryInternal>();
=======
private final Set<ClientSessionFactory> factories = new HashSet<ClientSessionFactory>();
>>>>>>>
private final Set<ClientSessionFactoryInternal> factories = new HashSet<ClientSessionFactoryInternal>();
<<<<<<<
private final Topology topology;
=======
private final Topology topology = new Topology();
>>>>>>>
private final Topology topology;
<<<<<<<
=======
>>>>>>>
<<<<<<<
if (System.currentTimeMillis() > timeout && !receivedTopology && !closed && !closing)
=======
if (!receivedTopology)
>>>>>>>
if (System.currentTimeMillis() > timeout && !receivedTopology && !closed && !closing)
<<<<<<<
public synchronized void factoryClosed(final ClientSessionFactory factory)
{
factories.remove(factory);
if (!clusterConnection && factories.isEmpty())
{
// Go back to using the broadcast or static list
receivedTopology = false;
topologyArray = null;
}
}
=======
>>>>>>>
public synchronized void factoryClosed(final ClientSessionFactory factory)
{
factories.remove(factory);
if (!clusterConnection && factories.isEmpty())
{
// Go back to using the broadcast or static list
receivedTopology = false;
topologyArray = null;
}
}
<<<<<<<
int retryNumber = 0;
while (csf == null && !ServerLocatorImpl.this.closed && !ServerLocatorImpl.this.closing)
=======
List<Future<ClientSessionFactory>> futuresList = new ArrayList<Future<ClientSessionFactory>>();
for (Connector conn : connectors)
{
futuresList.add(threadPool.submit(conn));
}
for (int i = 0, futuresSize = futuresList.size(); i < futuresSize; i++)
>>>>>>>
int retryNumber = 0;
while (csf == null && !ServerLocatorImpl.this.closed && !ServerLocatorImpl.this.closing)
<<<<<<<
{
csf.getConnection().addFailureListener(new FailureListener()
{
// Case the node where the cluster connection was connected is gone, we need to restart the
// connection
public void connectionFailed(HornetQException exception, boolean failedOver)
{
if (clusterConnection && exception.getCode() == HornetQException.DISCONNECTED)
{
try
{
ServerLocatorImpl.this.start(startExecutor);
}
catch (Exception e)
{
// There isn't much to be done if this happens here
log.warn(e.getMessage());
}
}
}
});
if (log.isDebugEnabled())
{
log.debug("Returning " + csf +
" after " +
retryNumber +
" retries on StaticConnector " +
ServerLocatorImpl.this);
}
return csf;
}
=======
{
break;
}
>>>>>>>
{
csf.getConnection().addFailureListener(new FailureListener()
{
// Case the node where the cluster connection was connected is gone, we need to restart the
// connection
public void connectionFailed(HornetQException exception, boolean failedOver)
{
if (clusterConnection && exception.getCode() == HornetQException.DISCONNECTED)
{
try
{
ServerLocatorImpl.this.start(startExecutor);
}
catch (Exception e)
{
// There isn't much to be done if this happens here
log.warn(e.getMessage());
}
}
}
});
if (log.isDebugEnabled())
{
log.debug("Returning " + csf +
" after " +
retryNumber +
" retries on StaticConnector " +
ServerLocatorImpl.this);
}
return csf;
} |
<<<<<<<
return createInVMFailoverServer(true,
configuration,
PagingFailoverTest.PAGE_SIZE,
PagingFailoverTest.PAGE_MAX,
new HashMap<String, AddressSettings>(),
nodeManager,
2);
=======
return createInVMFailoverServer(true, configuration, PAGE_SIZE, PAGE_MAX, new HashMap<String, AddressSettings>(),
nodeManager);
>>>>>>>
return createInVMFailoverServer(true, configuration, PAGE_SIZE, PAGE_MAX, new HashMap<String, AddressSettings>(),
nodeManager,
2); |
<<<<<<<
locator.setConfirmationWindowSize(10 * 1024 * 1024);
sf = (ClientSessionFactoryInternal)createSessionFactoryAndWaitForTopology(locator, 2);
try
{
=======
sf = createSessionFactoryAndWaitForTopology(locator, 2);
>>>>>>>
locator.setConfirmationWindowSize(10 * 1024 * 1024);
sf = createSessionFactoryAndWaitForTopology(locator, 2);
try
{
<<<<<<<
Thread t = new Thread(runnable);
t.setName("MainTEST");
=======
Thread t = new Thread(runnable);
>>>>>>>
Thread t = new Thread(runnable);
t.setName("MainTEST");
<<<<<<<
Assert.assertEquals(0, sf.numConnections());
}
=======
Assert.assertEquals(0, sf.numSessions());
locator.close();
Assert.assertEquals(0, sf.numConnections());
>>>>>>>
Assert.assertEquals(0, sf.numConnections());
}
<<<<<<<
logAndSystemOut("#test Finished sending, starting consumption now");
=======
>>>>>>>
logAndSystemOut("#test Finished sending, starting consumption now");
<<<<<<<
try
=======
if (blocked)
>>>>>>>
try |
<<<<<<<
import org.hornetq.api.core.HornetQException;
=======
>>>>>>>
import org.hornetq.api.core.HornetQException;
<<<<<<<
import org.hornetq.api.core.client.ClientConsumer;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientProducer;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.ServerLocator;
import org.hornetq.api.core.client.SessionFailureListener;
=======
import org.hornetq.api.core.client.ClientConsumer;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientProducer;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ClientSessionFactory;
>>>>>>>
import org.hornetq.api.core.client.ClientConsumer;
import org.hornetq.api.core.client.ClientMessage;
import org.hornetq.api.core.client.ClientProducer;
import org.hornetq.api.core.client.ClientSession;
import org.hornetq.api.core.client.ClientSessionFactory;
import org.hornetq.api.core.client.ServerLocator;
<<<<<<<
=======
import org.hornetq.tests.util.CountDownSessionFailureListener;
import org.hornetq.tests.util.TransportConfigurationUtils;
>>>>>>>
import org.hornetq.tests.util.CountDownSessionFailureListener;
import org.hornetq.tests.util.TransportConfigurationUtils;
<<<<<<<
assertTrue(latch.await(5, TimeUnit.SECONDS));
=======
backupServer.start();
assertTrue(listener.getLatch().await(5, TimeUnit.SECONDS));
>>>>>>>
assertTrue(latch.await(5, TimeUnit.SECONDS));
<<<<<<<
assertTrue(latch2.await(5, TimeUnit.SECONDS));
=======
assertTrue(listener.getLatch().await(5, TimeUnit.SECONDS));
>>>>>>>
assertTrue(listener.getLatch().await(5, TimeUnit.SECONDS));
<<<<<<<
class MyListener implements SessionFailureListener
{
private final CountDownLatch latch;
public MyListener(CountDownLatch latch)
{
this.latch = latch;
}
public void connectionFailed(final HornetQException me, boolean failedOver)
{
System.out.println("Failed, me");
latch.countDown();
}
public void beforeReconnect(HornetQException exception)
{
System.out.println("MyListener.beforeReconnect");
}
}
=======
>>>>>>> |
<<<<<<<
public static final byte REPLICATION_SYNC = 103;
=======
public static final byte REPLICATION_SYNC_FILE = 103;
// HA
>>>>>>>
public static final byte REPLICATION_SYNC_FILE = 103;
<<<<<<<
public static final byte SESS_UNIQUE_ADD_METADATA = 106;
// HA
=======
>>>>>>>
public static final byte SESS_UNIQUE_ADD_METADATA = 106;
// HA
<<<<<<<
=======
public static final byte BACKUP_REGISTRATION = 113;
public static final byte REPLICATION_START_STOP_SYNC = 120;
>>>>>>>
public static final byte BACKUP_REGISTRATION = 115;
public static final byte REPLICATION_START_STOP_SYNC = 120; |
<<<<<<<
private static final boolean trace = ReplicationEndpointImpl.log.isTraceEnabled();
private final IOCriticalErrorListener criticalErrorListener;
=======
private static final boolean trace = log.isTraceEnabled();
>>>>>>>
private static final boolean trace = log.isTraceEnabled();
private final IOCriticalErrorListener criticalErrorListener;
private static void trace(final String msg)
{
ReplicationEndpointImpl.log.trace(msg);
}
<<<<<<<
// Constructors --------------------------------------------------
public ReplicationEndpointImpl(final HornetQServer server, IOCriticalErrorListener criticalErrorListener)
=======
// Constructors --------------------------------------------------
public ReplicationEndpointImpl(final HornetQServerImpl server)
>>>>>>>
// Constructors --------------------------------------------------
public ReplicationEndpointImpl(final HornetQServerImpl server, IOCriticalErrorListener criticalErrorListener)
<<<<<<<
storage = new JournalStorageManager(config, server.getExecutorFactory(), criticalErrorListener);
=======
storage = server.getStorageManager();
>>>>>>>
storage = server.getStorageManager(); |
<<<<<<<
private Map<SimpleString, Pair<UUID, AtomicLong>> targetAddressInfos = new HashMap<SimpleString, Pair<UUID, AtomicLong>>();
private long creationTime = System.currentTimeMillis();
=======
private final Map<SimpleString, Pair<UUID, AtomicLong>> targetAddressInfos = new HashMap<SimpleString, Pair<UUID, AtomicLong>>();
private final long creationTime = System.currentTimeMillis();
>>>>>>>
private final Map<SimpleString, Pair<UUID, AtomicLong>> targetAddressInfos = new HashMap<SimpleString, Pair<UUID, AtomicLong>>();
private final long creationTime = System.currentTimeMillis();
<<<<<<<
=======
@Override
>>>>>>> |
<<<<<<<
isSavedInstanceNull = savedInstanceState == null;
=======
lifecycleController = getArguments().getBoolean("lifecycleController");
>>>>>>>
lifecycleController = getArguments().getBoolean("lifecycleController");
isSavedInstanceNull = savedInstanceState == null; |
<<<<<<<
import com.aptoide.amethyst.utils.Logger;
=======
import com.aptoide.amethyst.utils.LifeCycleMonitor;
>>>>>>>
import com.aptoide.amethyst.utils.Logger;
import com.aptoide.amethyst.utils.LifeCycleMonitor;
<<<<<<<
Logger.d("debug", "onCreate: " + getClass().getSimpleName());
AptoideUtils.AppNavigationUtils.onCreate(getIntent(), this);
=======
LifeCycleMonitor.sendLiveCycleEvent(this, OttoEvents.ActivityLifeCycleEvent.LifeCycle.CREATE);
>>>>>>>
Logger.d("debug", "onCreate: " + getClass().getSimpleName());
AptoideUtils.AppNavigationUtils.onCreate(getIntent(), this);
LifeCycleMonitor.sendLiveCycleEvent(this, OttoEvents.ActivityLifeCycleEvent.LifeCycle.CREATE);
<<<<<<<
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int i = item.getItemId();
if (i == android.R.id.home || i == R.id.home) {
AptoideUtils.AppNavigationUtils.startParentActivity(this ,this);
return true;
}
return super.onOptionsItemSelected(item);
}
=======
>>>>>>>
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int i = item.getItemId();
if (i == android.R.id.home || i == R.id.home) {
AptoideUtils.AppNavigationUtils.startParentActivity(this ,this);
return true;
}
return super.onOptionsItemSelected(item);
} |
<<<<<<<
=======
if (filter != null) {
filter.depositSchemaProperty(prop, propertiesNode, provider);
continue;
}
depositSchemaProperty(prop, propertiesNode, provider);
>>>>>>>
<<<<<<<
=======
/**
* Attempt to add the output of the given {@link BeanPropertyWriter} in the given {@link ObjectNode}.
* Otherwise, add the default schema {@link JsonNode} in place of the writer's output
*
* @param writer Bean property serializer to use to create schema value
* @param propertiesNode Node which the given property would exist within
* @param provider Provider that can be used for accessing dynamic aspects of serialization
* processing
*
* {@link BeanPropertyFilter#depositSchemaProperty(BeanPropertyWriter, ObjectNode, SerializerProvider)}
*/
public static void depositSchemaProperty(BeanPropertyWriter writer, ObjectNode propertiesNode, SerializerProvider provider)
{
JavaType propType = writer.getSerializationType();
// 03-Dec-2010, tatu: SchemaAware REALLY should use JavaType, but alas it doesn't...
Type hint = (propType == null) ? writer.getGenericPropertyType() : propType.getRawClass();
JsonNode schemaNode;
// Maybe it already has annotated/statically configured serializer?
JsonSerializer<Object> ser = writer.getSerializer();
try {
if (ser == null) { // nope
Class<?> serType = writer.getRawSerializationType();
if (serType == null) {
serType = writer.getPropertyType();
}
ser = provider.findValueSerializer(serType, writer);
}
boolean isOptional = !BeanSerializerBase.isPropertyRequired(writer, provider);
if (ser instanceof SchemaAware) {
schemaNode = ((SchemaAware) ser).getSchema(provider, hint, isOptional) ;
} else {
schemaNode = JsonSchema.getDefaultSchemaNode();
}
} catch (JsonMappingException e) {
schemaNode = JsonSchema.getDefaultSchemaNode();
// TODO: handle in better way (why not throw?)
}
propertiesNode.put(writer.getName(), schemaNode);
}
>>>>>>> |
<<<<<<<
if ((referenceBinding = this.environment.askForType(this, name, mod)) != null) {
=======
//This call (to askForType) should be the last option to call, because the call is very expensive regarding performance
// (a search for secondary types may get triggered which requires to parse all classes of a package).
if ((referenceBinding = this.environment.askForType(this, name)) != null) {
>>>>>>>
//This call (to askForType) should be the last option to call, because the call is very expensive regarding performance
// (a search for secondary types may get triggered which requires to parse all classes of a package).
if ((referenceBinding = this.environment.askForType(this, name, mod)) != null) {
<<<<<<<
if (packageBinding == null) { // have not looked for it before
if ((packageBinding = findPackage(name, mod)) != null) {
return packageBinding;
}
if (referenceBinding != null && referenceBinding != LookupEnvironment.TheNotFoundType) {
return referenceBinding; // found cached missing type - check if package conflict
}
addNotFoundPackage(name);
}
=======
>>>>>>>
if (packageBinding == null) { // have not looked for it before
if ((packageBinding = findPackage(name, mod)) != null) {
return packageBinding;
}
if (referenceBinding != null && referenceBinding != LookupEnvironment.TheNotFoundType) {
return referenceBinding; // found cached missing type - check if package conflict
}
addNotFoundPackage(name);
} |
<<<<<<<
public static final char[] TAG_SYSTEM_PROPERTY = "systemProperty".toCharArray(); //$NON-NLS-1$
=======
public static final char[] TAG_USES = "uses".toCharArray(); //$NON-NLS-1$
public static final char[] TAG_PROVIDES = "provides".toCharArray(); //$NON-NLS-1$
>>>>>>>
public static final char[] TAG_SYSTEM_PROPERTY = "systemProperty".toCharArray(); //$NON-NLS-1$
public static final char[] TAG_USES = "uses".toCharArray(); //$NON-NLS-1$
public static final char[] TAG_PROVIDES = "provides".toCharArray(); //$NON-NLS-1$
<<<<<<<
public static final int TAG_SYSTEM_PROPERTY_LENGTH = TAG_SYSTEM_PROPERTY.length;
=======
public static final int TAG_USES_LENGTH = TAG_USES.length;
public static final int TAG_PROVIDES_LENGTH = TAG_PROVIDES.length;
>>>>>>>
public static final int TAG_SYSTEM_PROPERTY_LENGTH = TAG_SYSTEM_PROPERTY.length;
public static final int TAG_USES_LENGTH = TAG_USES.length;
public static final int TAG_PROVIDES_LENGTH = TAG_PROVIDES.length;
<<<<<<<
public static final int TAG_SYSTEM_PROPERTY_VALUE=21;
=======
public static final int TAG_USES_VALUE=21;
public static final int TAG_PROVIDES_VALUE=22;
>>>>>>>
public static final int TAG_SYSTEM_PROPERTY_VALUE=21;
public static final int TAG_USES_VALUE=21;
public static final int TAG_PROVIDES_VALUE=22; |
<<<<<<<
protected boolean parsingJava12Plus;
=======
protected boolean parsingJava11Plus;
>>>>>>>
protected boolean parsingJava12Plus;
protected boolean parsingJava11Plus;
<<<<<<<
this.parsingJava12Plus = this.options.sourceLevel >= ClassFileConstants.JDK12;
=======
this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11;
>>>>>>>
this.parsingJava12Plus = this.options.sourceLevel >= ClassFileConstants.JDK12;
this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11; |
<<<<<<<
throws DatabindException
{
InvalidDefinitionException e = InvalidDefinitionException.from(getGenerator(), msg, type);
e.initCause(cause);
throw e;
=======
throws JsonMappingException {
throw InvalidDefinitionException.from(getGenerator(), msg, type)
.withCause(cause);
>>>>>>>
throws DatabindException
{
throw InvalidDefinitionException.from(getGenerator(), msg, type)
.withCause(cause);
<<<<<<<
throws DatabindException
{
InvalidDefinitionException e = InvalidDefinitionException.from(getGenerator(), msg, constructType(raw));
e.initCause(cause);
throw e;
=======
throws JsonMappingException {
throw InvalidDefinitionException.from(getGenerator(), msg, constructType(raw))
.withCause(cause);
>>>>>>>
throws DatabindException
{
throw InvalidDefinitionException.from(getGenerator(), msg, constructType(raw))
.withCause(cause); |
<<<<<<<
if (isJRE9) return;
String jreDirectory = Util.getJREDirectory();
String jfxJar = Util.toNativePath(jreDirectory + "/lib/ext/jfxrt.jar");
=======
>>>>>>>
if (isJRE9) return; |
<<<<<<<
* Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
=======
* Copyright (c) 2000, 2017 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
>>>>>>>
* Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0 |
<<<<<<<
import java.net.URI;
import java.nio.file.DirectoryStream;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
import java.nio.file.FileVisitor;
import java.nio.file.Files;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.HashMap;
=======
import java.util.ArrayList;
>>>>>>>
import java.net.URI;
import java.nio.file.DirectoryStream;
import java.nio.file.FileSystems;
import java.nio.file.FileVisitResult;
import java.nio.file.FileVisitor;
import java.nio.file.Files;
import java.nio.file.attribute.BasicFileAttributes;
import java.util.ArrayList;
import java.util.HashMap; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.