conflict_resolution
stringlengths
27
16k
<<<<<<< import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; ======= import static com.google.common.base.Preconditions.checkNotNull; >>>>>>> import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkState; <<<<<<< Change.Id id = change.getId(); try (Repository repo = repoManager.openRepository(project())) { ======= Change.Id id = checkNotNull(change.getId()); try (Repository repo = repoManager.openRepository(change.getProject())) { >>>>>>> Change.Id id = checkNotNull(change.getId()); try (Repository repo = repoManager.openRepository(project())) {
<<<<<<< if(db.getSchemaVersion() > 2) { md5= rs.getString("md5"); //NON-NLS ======= if(db.getSchemaVersion() > 2) { md5= rs.getString("md5"); >>>>>>> if(db.getSchemaVersion() > 2) { md5= rs.getString("md5"); //NON-NLS <<<<<<< File f = new File(db, rs.getLong("obj_id"), rs.getLong("fs_obj_id"), //NON-NLS TSK_FS_ATTR_TYPE_ENUM.valueOf(rs.getShort("attr_type")), //NON-NLS rs.getShort("attr_id"), rs.getString("name"), rs.getLong("meta_addr"), //NON-NLS TSK_FS_NAME_TYPE_ENUM.valueOf(rs.getShort("dir_type")), //NON-NLS TSK_FS_META_TYPE_ENUM.valueOf(rs.getShort("meta_type")), //NON-NLS TSK_FS_NAME_FLAG_ENUM.valueOf(rs.getShort("dir_flags")), //NON-NLS rs.getShort("meta_flags"), rs.getLong("size"), //NON-NLS rs.getLong("ctime"), rs.getLong("crtime"), rs.getLong("atime"), rs.getLong("mtime"), //NON-NLS rs.getShort("mode"), rs.getInt("uid"), rs.getInt("gid"), //NON-NLS rs.getString("md5"), //NON-NLS FileKnown.valueOf(rs.getByte("known")), rs.getString("parent_path")); //NON-NLS ======= File f = new File(db, rs.getLong("obj_id"), rs.getLong("fs_obj_id"), TSK_FS_ATTR_TYPE_ENUM.valueOf(rs.getShort("attr_type")), rs.getShort("attr_id"), rs.getString("name"), rs.getLong("meta_addr"), rs.getInt("meta_seq"), TSK_FS_NAME_TYPE_ENUM.valueOf(rs.getShort("dir_type")), TSK_FS_META_TYPE_ENUM.valueOf(rs.getShort("meta_type")), TSK_FS_NAME_FLAG_ENUM.valueOf(rs.getShort("dir_flags")), rs.getShort("meta_flags"), rs.getLong("size"), rs.getLong("ctime"), rs.getLong("crtime"), rs.getLong("atime"), rs.getLong("mtime"), rs.getShort("mode"), rs.getInt("uid"), rs.getInt("gid"), rs.getString("md5"), FileKnown.valueOf(rs.getByte("known")), rs.getString("parent_path")); >>>>>>> File f = new File(db, rs.getLong("obj_id"), rs.getLong("fs_obj_id"), //NON-NLS TSK_FS_ATTR_TYPE_ENUM.valueOf(rs.getShort("attr_type")), //NON-NLS rs.getShort("attr_id"), rs.getString("name"), rs.getLong("meta_addr"), rs.getInt("meta_seq"), //NON-NLS TSK_FS_NAME_TYPE_ENUM.valueOf(rs.getShort("dir_type")), //NON-NLS TSK_FS_META_TYPE_ENUM.valueOf(rs.getShort("meta_type")), //NON-NLS TSK_FS_NAME_FLAG_ENUM.valueOf(rs.getShort("dir_flags")), //NON-NLS rs.getShort("meta_flags"), rs.getLong("size"), //NON-NLS rs.getLong("ctime"), rs.getLong("crtime"), rs.getLong("atime"), rs.getLong("mtime"), //NON-NLS rs.getShort("mode"), rs.getInt("uid"), rs.getInt("gid"), //NON-NLS rs.getString("md5"), //NON-NLS FileKnown.valueOf(rs.getByte("known")), rs.getString("parent_path")); //NON-NLS <<<<<<< Directory dir = new Directory(db, rs.getLong("obj_id"), rs.getLong("fs_obj_id"), //NON-NLS TSK_FS_ATTR_TYPE_ENUM.valueOf(rs.getShort("attr_type")), //NON-NLS rs.getShort("attr_id"), name, rs.getLong("meta_addr"), //NON-NLS TSK_FS_NAME_TYPE_ENUM.valueOf(rs.getShort("dir_type")), //NON-NLS TSK_FS_META_TYPE_ENUM.valueOf(rs.getShort("meta_type")), //NON-NLS TSK_FS_NAME_FLAG_ENUM.valueOf(rs.getShort("dir_flags")), //NON-NLS rs.getShort("meta_flags"), rs.getLong("size"), //NON-NLS rs.getLong("ctime"), rs.getLong("crtime"), rs.getLong("atime"), rs.getLong("mtime"), //NON-NLS rs.getShort("mode"), rs.getInt("uid"), rs.getInt("gid"), //NON-NLS rs.getString("md5"), //NON-NLS FileKnown.valueOf(rs.getByte("known")), rs.getString("parent_path")); //NON-NLS ======= Directory dir = new Directory(db, rs.getLong("obj_id"), rs.getLong("fs_obj_id"), TSK_FS_ATTR_TYPE_ENUM.valueOf(rs.getShort("attr_type")), rs.getShort("attr_id"), name, rs.getLong("meta_addr"), rs.getInt("meta_seq"), TSK_FS_NAME_TYPE_ENUM.valueOf(rs.getShort("dir_type")), TSK_FS_META_TYPE_ENUM.valueOf(rs.getShort("meta_type")), TSK_FS_NAME_FLAG_ENUM.valueOf(rs.getShort("dir_flags")), rs.getShort("meta_flags"), rs.getLong("size"), rs.getLong("ctime"), rs.getLong("crtime"), rs.getLong("atime"), rs.getLong("mtime"), rs.getShort("mode"), rs.getInt("uid"), rs.getInt("gid"), rs.getString("md5"), FileKnown.valueOf(rs.getByte("known")), rs.getString("parent_path")); >>>>>>> Directory dir = new Directory(db, rs.getLong("obj_id"), rs.getLong("fs_obj_id"), //NON-NLS TSK_FS_ATTR_TYPE_ENUM.valueOf(rs.getShort("attr_type")), //NON-NLS rs.getShort("attr_id"), name, rs.getLong("meta_addr"), rs.getInt("meta_seq"), //NON-NLS TSK_FS_NAME_TYPE_ENUM.valueOf(rs.getShort("dir_type")), //NON-NLS TSK_FS_META_TYPE_ENUM.valueOf(rs.getShort("meta_type")), //NON-NLS TSK_FS_NAME_FLAG_ENUM.valueOf(rs.getShort("dir_flags")), //NON-NLS rs.getShort("meta_flags"), rs.getLong("size"), //NON-NLS rs.getLong("ctime"), rs.getLong("crtime"), rs.getLong("atime"), rs.getLong("mtime"), //NON-NLS rs.getShort("mode"), rs.getInt("uid"), rs.getInt("gid"), //NON-NLS rs.getString("md5"), //NON-NLS FileKnown.valueOf(rs.getByte("known")), rs.getString("parent_path")); //NON-NLS
<<<<<<< private SleuthkitCase caseDb; ======= private final SleuthkitCase caseDb; >>>>>>> private final SleuthkitCase caseDb; <<<<<<< /** * Posts the artifact. The artifact should be complete (all attributes have * been added) before being posted. Posting the artifact includes making any * events that may be derived from it, and broadcasting a notification that * the artifact is ready for further analysis. * * @param artifact The artifact to be posted. * * @throws BlackboardException If there is a problem posting the artifact. */ public synchronized void postArtifact(BlackboardArtifact artifact) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { caseDb.getTimelineManager().addEventsFromArtifact(artifact); } catch (TskCoreException ex) { throw new BlackboardException("Failed to add events for artifact: " + artifact, ex); } caseDb.postTSKEvent(new ArtifactPostedEvent(artifact)); } /** * Posts a Collection of artifacts. The artifacts should be complete (all * attributes have been added) before being posted. Posting the artifacts * includes making any events that may be derived from them, and * broadcasting notifications that the artifacts are ready for further * analysis. * * @param artifacts The artifacts to be posted. * * @throws BlackboardException If there is a problem posting the artifacts. */ public synchronized void postArtifacts(Collection<BlackboardArtifact> artifacts) throws BlackboardException { /* * For now this just posts them one by one, but in the future it could * be smarter and use transactions, post a single bulk event, etc. */ for (BlackboardArtifact artifact : artifacts) { postArtifact(artifact); } } /** * Gets an artifact type, creating it if it does not already exist. Use this * method to define custom artifact types. * * @param typeName The type name of the artifact type. * @param displayName The display name of the artifact type. * * @return A type object representing the artifact type. * * @throws BlackboardException If there is a problem getting or adding the * artifact type. */ public synchronized BlackboardArtifact.Type getOrAddArtifactType(String typeName, String displayName) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { return caseDb.addBlackboardArtifactType(typeName, displayName); } catch (TskDataException typeExistsEx) { try { return caseDb.getArtifactType(typeName); } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add artifact type", ex); } } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add artifact type", ex); } } /** * Gets an attribute type, creating it if it does not already exist. Use * this method to define custom attribute types. * * @param typeName The type name of the attribute type. * @param valueType The value type of the attribute type. * @param displayName The display name of the attribute type. * * @return A type object representing the attribute type. * * @throws BlackboardException If there is a problem getting or adding the * attribute type. */ public synchronized BlackboardAttribute.Type getOrAddAttributeType(String typeName, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType, String displayName) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { return caseDb.addArtifactAttributeType(typeName, valueType, displayName); } catch (TskDataException typeExistsEx) { try { return caseDb.getAttributeType(typeName); } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add attribute type", ex); } } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add attribute type", ex); } } ======= /** * Posts the artifact. The artifact should be complete (all attributes have * been added) before being posted. Posting the artifact includes making any * events that may be derived from it, and broadcasting a notification that * the artifact is ready for further analysis. * * @param artifact The artifact to be posted. * * @throws BlackboardException If there is a problem posting the artifact. */ public synchronized void postArtifact(BlackboardArtifact artifact) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { caseDb.getTimelineManager().addEventsFromArtifact(artifact); } catch (TskCoreException ex) { throw new BlackboardException("Failed to add events for artifact: " + artifact, ex); } caseDb.postTSKEvent(new ArtifactPostedEvent(artifact)); } /** * Posts a Collection of artifacts. The artifacts should be complete (all * attributes have been added) before being posted. Posting the artifacts * includes making any events that may be derived from them, and * broadcasting notifications that the artifacts are ready for further * analysis. * * @param artifacts The artifacts to be posted. * * @throws BlackboardException If there is a problem posting the artifacts. */ public synchronized void postArtifacts(Collection<BlackboardArtifact> artifacts) throws BlackboardException { /* * For now this just posts them one by one, but in the future it could * be smarter and use transactions, post a single bulk event, etc. */ for (BlackboardArtifact artifact : artifacts) { postArtifact(artifact); } } /** * Gets an artifact type, creating it if it does not already exist. Use this * method to define custom artifact types. * * @param typeName The type name of the artifact type. * @param displayName The display name of the artifact type. * * @return A type object representing the artifact type. * * @throws BlackboardException If there is a problem getting or adding the * artifact type. */ public synchronized BlackboardArtifact.Type getOrAddArtifactType(String typeName, String displayName) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { return caseDb.addBlackboardArtifactType(typeName, displayName); } catch (TskDataException typeExistsEx) { try { return caseDb.getArtifactType(typeName); } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add artifact type", ex); } } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add artifact type", ex); } } /** * Gets an attribute type, creating it if it does not already exist. Use * this method to define custom attribute types. * * @param typeName The type name of the attribute type. * @param valueType The value type of the attribute type. * @param displayName The display name of the attribute type. * * @return A type object representing the attribute type. * * @throws BlackboardException If there is a problem getting or adding the * attribute type. */ public synchronized BlackboardAttribute.Type getOrAddAttributeType(String typeName, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType, String displayName) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { return caseDb.addArtifactAttributeType(typeName, valueType, displayName); } catch (TskDataException typeExistsEx) { try { return caseDb.getAttributeType(typeName); } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add attribute type", ex); } } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add attribute type", ex); } } /** * A Blackboard exception. */ public static final class BlackboardException extends Exception { private static final long serialVersionUID = 1L; /** * Constructs a blackboard exception with the specified message. * * @param message The message. */ BlackboardException(String message) { super(message); } /** * Constructs a blackboard exception with the specified message and * cause. * * @param message The message. * @param cause The cause. */ BlackboardException(String message, Throwable cause) { super(message, cause); } } /** * Event published by SleuthkitCase when an artifact is posted. A posted * artifact is complete (all attributes have been added) and ready for * further processing. */ final public static class ArtifactPostedEvent { private final BlackboardArtifact artifact; public BlackboardArtifact getArtifact() { return artifact; } ArtifactPostedEvent(BlackboardArtifact artifact) { this.artifact = artifact; } } >>>>>>> /** * Posts the artifact. The artifact should be complete (all attributes have * been added) before being posted. Posting the artifact includes making any * events that may be derived from it, and broadcasting a notification that * the artifact is ready for further analysis. * * @param artifact The artifact to be posted. * * @throws BlackboardException If there is a problem posting the artifact. */ public synchronized void postArtifact(BlackboardArtifact artifact) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { caseDb.getTimelineManager().addEventsFromArtifact(artifact); } catch (TskCoreException ex) { throw new BlackboardException("Failed to add events for artifact: " + artifact, ex); } caseDb.postTSKEvent(new ArtifactPostedEvent(artifact)); } /** * Posts a Collection of artifacts. The artifacts should be complete (all * attributes have been added) before being posted. Posting the artifacts * includes making any events that may be derived from them, and * broadcasting notifications that the artifacts are ready for further * analysis. * * @param artifacts The artifacts to be posted. * * @throws BlackboardException If there is a problem posting the artifacts. */ public synchronized void postArtifacts(Collection<BlackboardArtifact> artifacts) throws BlackboardException { /* * For now this just posts them one by one, but in the future it could * be smarter and use transactions, post a single bulk event, etc. */ for (BlackboardArtifact artifact : artifacts) { postArtifact(artifact); } } /** * Gets an artifact type, creating it if it does not already exist. Use this * method to define custom artifact types. * * @param typeName The type name of the artifact type. * @param displayName The display name of the artifact type. * * @return A type object representing the artifact type. * * @throws BlackboardException If there is a problem getting or adding the * artifact type. */ public synchronized BlackboardArtifact.Type getOrAddArtifactType(String typeName, String displayName) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { return caseDb.addBlackboardArtifactType(typeName, displayName); } catch (TskDataException typeExistsEx) { try { return caseDb.getArtifactType(typeName); } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add artifact type", ex); } } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add artifact type", ex); } } /** * Gets an attribute type, creating it if it does not already exist. Use * this method to define custom attribute types. * * @param typeName The type name of the attribute type. * @param valueType The value type of the attribute type. * @param displayName The display name of the attribute type. * * @return A type object representing the attribute type. * * @throws BlackboardException If there is a problem getting or adding the * attribute type. */ public synchronized BlackboardAttribute.Type getOrAddAttributeType(String typeName, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE valueType, String displayName) throws BlackboardException { if (null == caseDb) { throw new BlackboardException("Blackboard has been closed"); } try { return caseDb.addArtifactAttributeType(typeName, valueType, displayName); } catch (TskDataException typeExistsEx) { try { return caseDb.getAttributeType(typeName); } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add attribute type", ex); } } catch (TskCoreException ex) { throw new BlackboardException("Failed to get or add attribute type", ex); } } <<<<<<< + "types.type_name AS type_name, types.display_name AS display_name " + "FROM blackboard_artifact_types AS types " + "INNER JOIN blackboard_artifacts AS arts " + "ON arts.artifact_type_id = types.artifact_type_id " + "WHERE arts.data_source_obj_id = " + dataSourceObjId; ======= + "types.type_name AS type_name, types.display_name AS display_name " + "FROM blackboard_artifact_types AS types " + "INNER JOIN blackboard_artifacts AS arts " + "ON arts.artifact_type_id = types.artifact_type_id " + "WHERE arts.data_source_obj_id = " + dataSourceObjId; SleuthkitCase.CaseDbConnection connection = caseDb.getConnection(); >>>>>>> + "types.type_name AS type_name, types.display_name AS display_name " + "FROM blackboard_artifact_types AS types " + "INNER JOIN blackboard_artifacts AS arts " + "ON arts.artifact_type_id = types.artifact_type_id " + "WHERE arts.data_source_obj_id = " + dataSourceObjId; <<<<<<< ======= >>>>>>>
<<<<<<< bu.addOp(changeId, new NotifyOp(changeToRevert, ins)); bu.addOp(changeToRevert.getId(), new PostRevertedMessageOp(computedChangeId)); ======= bu.addOp(changeId, new NotifyOp(changeToRevert, ins, input.notify, accountsToNotify)); bu.addOp(changeToRevert.getId(), new PostRevertedMessageOp(generatedChangeId)); >>>>>>> bu.addOp(changeId, new NotifyOp(changeToRevert, ins)); bu.addOp(changeToRevert.getId(), new PostRevertedMessageOp(generatedChangeId));
<<<<<<< import org.jboss.arquillian.ajocado.waiting.conditions.ElementVisible; import org.jboss.arquillian.ajocado.waiting.conditions.ElementNotVisible; ======= import org.jboss.arquillian.ajocado.waiting.conditions.ElementNotPresent; >>>>>>> import org.jboss.arquillian.ajocado.waiting.conditions.ElementVisible; import org.jboss.arquillian.ajocado.waiting.conditions.ElementNotVisible; import org.jboss.arquillian.ajocado.waiting.conditions.ElementNotPresent; <<<<<<< public static final ElementVisible elementVisible = ElementVisible.getInstance(); public static final ElementNotVisible elementNotVisible = ElementNotVisible.getInstance(); ======= >>>>>>> public static final ElementVisible elementVisible = ElementVisible.getInstance(); public static final ElementNotVisible elementNotVisible = ElementNotVisible.getInstance();
<<<<<<< import java.lang.reflect.Modifier; ======= import org.openqa.selenium.WebDriver; >>>>>>> import java.lang.reflect.Modifier; import org.openqa.selenium.WebDriver;
<<<<<<< } public static X509CRL parseCRL(String f) throws IOException, CertificateException, CRLException { return parseCRL(new FileInputStream(f)); } public static X509CRL parseCRL(InputStream crlStream) throws IOException, CertificateException, CRLException { try{ if(certFact == null) { certFact = CertificateFactory.getInstance("X.509", "BC"); } return (X509CRL) certFact.generateCRL(crlStream); } catch (NoSuchProviderException e) { throw new IOException("NoSuchProviderException: " + e.getMessage()); } } public static String canonicalizeName(X500Name name) { try { X500Principal prin = new X500Principal(name.getEncoded()); return prin.getName(); } catch (Exception e) { throw new IllegalArgumentException("invalid name " + name); } } public static X500Name sortName(X500Name name) { // TODO return name; } /** * First canonicalized the name, and then compute the SHA-1 finger-print over the * canonicalized subject string. */ public static String sha1sum_canonicalized_name(X500Principal prin) { X500Name x500Name = X500Name.getInstance(prin.getEncoded()); return sha1sum_canonicalized_name(x500Name); } public static String sha1sum_canonicalized_name(X500Name name) { ASN1ObjectIdentifier[] _types = name.getAttributeTypes(); int n = _types.length; List<String> types = new ArrayList<String>(n); for(ASN1ObjectIdentifier type : _types) { types.add(type.getId()); } Collections.sort(types); StringBuilder sb = new StringBuilder(); for(int i = 0; i < n; i++) { String type = types.get(i); if(i > 0) { sb.append(","); } sb.append(type).append("="); RDN[] rdns = name.getRDNs(new ASN1ObjectIdentifier(type)); for(int j = 0; j < rdns.length; j++) { if(j > 0) { sb.append(";"); } RDN rdn = rdns[j]; String textValue = IETFUtils.valueToString(rdn.getFirst().getValue()).toLowerCase(); sb.append(textValue); } } String canonicalizedName = sb.toString(); byte[] encoded; try { encoded = canonicalizedName.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { encoded = canonicalizedName.getBytes(); } return sha1sum(encoded); } public static String sha1sum(byte[] data) { synchronized (sha1) { sha1.reset(); sha1.update(data, 0, data.length); byte[] hashValue = new byte[20]; sha1.doFinal(hashValue, 0); return Hex.toHexString(hashValue).toUpperCase(); } } ======= } public static String canonicalizeName(X500Name name) { try { X500Principal prin = new X500Principal(name.getEncoded()); return prin.getName(); } catch (Exception e) { return name.toString(); } } >>>>>>> } public static X509CRL parseCRL(String f) throws IOException, CertificateException, CRLException { return parseCRL(new FileInputStream(f)); } public static X509CRL parseCRL(InputStream crlStream) throws IOException, CertificateException, CRLException { try{ if(certFact == null) { certFact = CertificateFactory.getInstance("X.509", "BC"); } return (X509CRL) certFact.generateCRL(crlStream); } catch (NoSuchProviderException e) { throw new IOException("NoSuchProviderException: " + e.getMessage()); } } public static String canonicalizeName(X500Name name) { try { X500Principal prin = new X500Principal(name.getEncoded()); return prin.getName(); } catch (Exception e) { throw new IllegalArgumentException("invalid name " + name); } } /** * First canonicalized the name, and then compute the SHA-1 finger-print over the * canonicalized subject string. */ public static String sha1sum_canonicalized_name(X500Principal prin) { X500Name x500Name = X500Name.getInstance(prin.getEncoded()); return sha1sum_canonicalized_name(x500Name); } public static String sha1sum_canonicalized_name(X500Name name) { ASN1ObjectIdentifier[] _types = name.getAttributeTypes(); int n = _types.length; List<String> types = new ArrayList<String>(n); for(ASN1ObjectIdentifier type : _types) { types.add(type.getId()); } Collections.sort(types); StringBuilder sb = new StringBuilder(); for(int i = 0; i < n; i++) { String type = types.get(i); if(i > 0) { sb.append(","); } sb.append(type).append("="); RDN[] rdns = name.getRDNs(new ASN1ObjectIdentifier(type)); for(int j = 0; j < rdns.length; j++) { if(j > 0) { sb.append(";"); } RDN rdn = rdns[j]; String textValue = IETFUtils.valueToString(rdn.getFirst().getValue()).toLowerCase(); sb.append(textValue); } } String canonicalizedName = sb.toString(); byte[] encoded; try { encoded = canonicalizedName.getBytes("UTF-8"); } catch (UnsupportedEncodingException e) { encoded = canonicalizedName.getBytes(); } return sha1sum(encoded); } public static String sha1sum(byte[] data) { synchronized (sha1) { sha1.reset(); sha1.update(data, 0, data.length); byte[] hashValue = new byte[20]; sha1.doFinal(hashValue, 0); return Hex.toHexString(hashValue).toUpperCase(); } }
<<<<<<< defaultCompLang = findGLFromLabel(dcl); } Iterator entries = jarFiles.entrySet().iterator(); String z = ""; String cma = ""; boolean first = true; while (entries.hasNext()) { @SuppressWarnings("unchecked") Entry<String, String> thisEntry = (Entry<String, String>) entries .next(); if (!first) { z += cma + thisEntry.getKey() + ":" + thisEntry.getValue(); cma = ";"; } first = false; ======= defaultCompLang = findGLFromLabel(dcl); >>>>>>> defaultCompLang = findGLFromLabel(dcl); } Iterator entries = jarFiles.entrySet().iterator(); String z = ""; String cma = ""; while (entries.hasNext()) { @SuppressWarnings("unchecked") Entry<String, String> thisEntry = (Entry<String, String>) entries .next(); z += cma + thisEntry.getKey() + ":" + thisEntry.getValue(); cma = ";"; <<<<<<< //menuItem = new JMenuItem("Add Additional Run Time Jar File"); //fileMenu.add(menuItem); //menuItem.addActionListener(this); ======= menuItem = new JMenuItem("Add Additional Run-Time Jar File"); fileMenu.add(menuItem); menuItem.addActionListener(this); >>>>>>> menuItem = new JMenuItem("Add Additional Run-Time Jar File"); fileMenu.add(menuItem); menuItem.addActionListener(this); <<<<<<< if (n == -1) break; ======= if (n == -1) break; >>>>>>> if (n == -1) break; <<<<<<< if (n == -1) break; ======= if (n == -1) break; >>>>>>> if (n == -1) break; <<<<<<< Iterator entries = jarFiles.entrySet().iterator(); String z = ""; String cma = ""; boolean first = true; while (entries.hasNext()) { @SuppressWarnings("unchecked") Entry<String, String> thisEntry = (Entry<String, String>) entries.next(); if (!first) { z += cma + thisEntry.getKey() + ":" + thisEntry.getValue(); cma = ";"; } first = false; } String s = "<additionalJarFiles> " + z + "</additionalJarFiles> \n"; out.write(s); ======= Iterator entries = jarFiles.entrySet().iterator(); String z = ""; String cma = ""; while (entries.hasNext()) { @SuppressWarnings("unchecked") Entry<String, String> thisEntry = (Entry<String, String>) entries.next(); z += cma + thisEntry.getKey() + ":" + thisEntry.getValue(); cma = ";"; } String s = "<additionalJarFiles> " + z + "</additionalJarFiles> \n"; out.write(s); >>>>>>> Iterator entries = jarFiles.entrySet().iterator(); String z = ""; String cma = ""; while (entries.hasNext()) { @SuppressWarnings("unchecked") Entry<String, String> thisEntry = (Entry<String, String>) entries.next(); z += cma + thisEntry.getKey() + ":" + thisEntry.getValue(); cma = ";"; } String s = "<additionalJarFiles> " + z + "</additionalJarFiles> \n"; out.write(s);
<<<<<<< if (grouperMessageHibernate != null && !StringUtils.equals(GrouperBuiltinMessageState.PROCESSED.name(), grouperMessageHibernate.getState())) { if (!StringUtils.equals(queue, grouperMessageHibernate.getQueueName())) { throw new RuntimeException("Message to mark as processed: " + grouperMessageHibernate.getId() + ", expected queue: '" + queue + "', doesnt equal actual queue: '" + grouperMessageHibernate.getQueueName() + "'"); } if (deleteOnProcessed) { grouperMessageHibernate.delete(); } else { grouperMessageHibernate.setState(GrouperBuiltinMessageState.PROCESSED.name()); grouperMessageHibernate.setGetTimeMillis(System.currentTimeMillis()); grouperMessageHibernate.saveOrUpdate(); } } else if (grouperMessageHibernate == null) { Log.warn("Grouper message doesnt exist, cant mark as processed: " + grouperMessage.getId()); } else { Log.warn("Grouper message was already processed: " + grouperMessage.getId()); ======= if (grouperMessageHibernate != null) { grouperMessageHibernate.setState(GrouperBuiltinMessageState.PROCESSED.name()); grouperMessageHibernate.setGetTimeMillis(System.currentTimeMillis()); grouperMessageHibernate.saveOrUpdate(); } else { LOG.warn("Grouper message doesnt exist, cant mark as processed: " + grouperMessage.getId()); >>>>>>> if (grouperMessageHibernate != null && !StringUtils.equals(GrouperBuiltinMessageState.PROCESSED.name(), grouperMessageHibernate.getState())) { if (!StringUtils.equals(queue, grouperMessageHibernate.getQueueName())) { throw new RuntimeException("Message to mark as processed: " + grouperMessageHibernate.getId() + ", expected queue: '" + queue + "', doesnt equal actual queue: '" + grouperMessageHibernate.getQueueName() + "'"); } if (deleteOnProcessed) { grouperMessageHibernate.delete(); } else { grouperMessageHibernate.setState(GrouperBuiltinMessageState.PROCESSED.name()); grouperMessageHibernate.setGetTimeMillis(System.currentTimeMillis()); grouperMessageHibernate.saveOrUpdate(); } } else if (grouperMessageHibernate == null) { LOG.warn("Grouper message doesnt exist, cant mark as processed: " + grouperMessage.getId()); } else { LOG.warn("Grouper message was already processed: " + grouperMessage.getId());
<<<<<<< import edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningAttributeNames; import edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningSettings; ======= import edu.internet2.middleware.grouper.app.upgradeTasks.UpgradeTasksJob; >>>>>>> import edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningAttributeNames; import edu.internet2.middleware.grouper.app.provisioning.GrouperProvisioningSettings; import edu.internet2.middleware.grouper.app.upgradeTasks.UpgradeTasksJob;
<<<<<<< import javax.naming.directory.BasicAttribute; ======= import javax.naming.directory.SearchControls; >>>>>>> import javax.naming.directory.SearchControls; import javax.naming.directory.BasicAttribute; <<<<<<< log.debug("reading properties file " + propertiesFile); File theFile = SubjectUtils.fileFromResourceName(propertiesFile); LdapConfig ldapConfig = LdapConfig.createFromProperties(new FileInputStream(theFile)); log.debug("from properties file " + propertiesFile + " got " + ldapConfig); ======= if (log.isDebugEnabled()) { log.debug("reading properties file " + propertiesFile); } LdapConfig ldapConfig = LdapConfig.createFromProperties(new FileInputStream(propertiesFile)); if (log.isDebugEnabled()) { log.debug("from properties file " + propertiesFile + " got " + ldapConfig); } >>>>>>> if (log.isDebugEnabled()) { log.debug("reading properties file " + propertiesFile); } File theFile = SubjectUtils.fileFromResourceName(propertiesFile); LdapConfig ldapConfig = LdapConfig.createFromProperties(new FileInputStream(theFile)); if (log.isDebugEnabled()) { log.debug("from properties file " + propertiesFile + " got " + ldapConfig); } <<<<<<< for (Iterator<String> it = ps.iterator(); it.hasNext(); log.debug(".. key = " + it.next())); ======= if (log.isDebugEnabled()) { for (Iterator it = ps.iterator(); it.hasNext(); log.debug(".. key = " + it.next())); } >>>>>>> if (log.isDebugEnabled()) { for (Iterator<String> it = ps.iterator(); it.hasNext(); log.debug(".. key = " + it.next())); } <<<<<<< Comparator<Subject> cp = new LdapComparator(); TreeSet<Subject> result = new TreeSet<Subject>(cp); ======= return searchHelper(searchValue, false).getResults(); } /** * @param searchValue * @return the set */ private SearchPageResult searchHelper(String searchValue, boolean firstPageOnly) { boolean tooManyResults = false; Comparator cp = new LdapComparator(); TreeSet result = new TreeSet(cp); >>>>>>> return searchHelper(searchValue, false).getResults(); } /** * @param searchValue * @return the set */ private SearchPageResult searchHelper(String searchValue, boolean firstPageOnly) { boolean tooManyResults = false; Comparator cp = new LdapComparator(); TreeSet result = new TreeSet(cp); <<<<<<< protected Map<String, Set<String>> getAllAttributes(LdapSubject subject) { Map<String, Set<String>> attributes = new SubjectCaseInsensitiveMapImpl<String, Set<String>>(); log.debug("getAllAttributes for " + subject.getName()); ======= protected Map getAllAttributes(LdapSubject subject) { Map attributes = new SubjectCaseInsensitiveMapImpl(); if (log.isDebugEnabled()) { log.debug("getAllAttributes for " + subject.getName()); } >>>>>>> protected Map<String, Set<String>> getAllAttributes(LdapSubject subject) { Map<String, Set<String>> attributes = new SubjectCaseInsensitiveMapImpl<String, Set<String>>(); if (log.isDebugEnabled()) { log.debug("getAllAttributes for " + subject.getName()); } <<<<<<< /** * Return the underlying {@link LdapPool}. * * @return the ldap pool */ public LdapPool<Ldap> getLdapPool() { return ldapPool; } /** * Set whether or not multiple results are allowed. Primarily for tests. * * @param multipleResults */ public void setMultipleResults(boolean multipleResults) { this.multipleResults = multipleResults; } ======= /** * max Page size * @return the maxPage */ public Integer getMaxPage() { return this.maxPage; } >>>>>>> /** * Return the underlying {@link LdapPool}. * * @return the ldap pool */ public LdapPool<Ldap> getLdapPool() { return ldapPool; } /** * Set whether or not multiple results are allowed. Primarily for tests. * * @param multipleResults */ public void setMultipleResults(boolean multipleResults) { this.multipleResults = multipleResults; } /** * max Page size * @return the maxPage */ public Integer getMaxPage() { return this.maxPage; }
<<<<<<< super(cfg, sitePaths, schema, clientBuilder, CHANGES_PREFIX); ======= super(cfg, fillArgs, sitePaths, schema, clientBuilder, CHANGES); >>>>>>> super(cfg, sitePaths, schema, clientBuilder, CHANGES);
<<<<<<< } Table attributeAssignTable = GrouperDdlUtils.ddlutilsFindTable(database, AttributeAssign.TABLE_GROUPER_ATTRIBUTE_ASSIGN, true); GrouperDdlUtils.ddlutilsFindOrCreateIndex(database, attributeAssignTable.getName(), "attr_asgn_type_idx", false, AttributeAssign.COLUMN_ATTRIBUTE_ASSIGN_TYPE); Table compositeTable = GrouperDdlUtils.ddlutilsFindTable(database, Composite.TABLE_GROUPER_COMPOSITES, true); GrouperDdlUtils.ddlutilsFindOrCreateIndex(database, compositeTable.getName(), "composite_type_idx", false, "type"); } ======= } } { addGrouperPasswordTables(ddlVersionBean, database); addGrouperPasswordIndexes(ddlVersionBean, database); } >>>>>>> } Table attributeAssignTable = GrouperDdlUtils.ddlutilsFindTable(database, AttributeAssign.TABLE_GROUPER_ATTRIBUTE_ASSIGN, true); GrouperDdlUtils.ddlutilsFindOrCreateIndex(database, attributeAssignTable.getName(), "attr_asgn_type_idx", false, AttributeAssign.COLUMN_ATTRIBUTE_ASSIGN_TYPE); Table compositeTable = GrouperDdlUtils.ddlutilsFindTable(database, Composite.TABLE_GROUPER_COMPOSITES, true); GrouperDdlUtils.ddlutilsFindOrCreateIndex(database, compositeTable.getName(), "composite_type_idx", false, "type"); } { addGrouperPasswordTables(ddlVersionBean, database); addGrouperPasswordIndexes(ddlVersionBean, database); }
<<<<<<< Group findByName(String name, boolean exceptionIfNotFound, QueryOptions queryOptions) throws GrouperDAOException, GroupNotFoundException ; /** * @since 2.1.0 */ Group findByName(String name, boolean exceptionIfNotFound, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups) throws GrouperDAOException, GroupNotFoundException ; ======= Group findByName(String name, boolean exceptionIfNotFound, QueryOptions queryOptions); /** * @since 2.0.2 */ Group findByNameSecure(String name, boolean exceptionIfNotFound, QueryOptions queryOptions); >>>>>>> Group findByName(String name, boolean exceptionIfNotFound, QueryOptions queryOptions) throws GrouperDAOException, GroupNotFoundException ; /** * @since 2.0.2 */ Group findByNameSecure(String name, boolean exceptionIfNotFound, QueryOptions queryOptions); /** * @since 2.1.0 */ Group findByName(String name, boolean exceptionIfNotFound, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups) throws GrouperDAOException, GroupNotFoundException ; <<<<<<< * * @param uuid * @param exceptionIfNotFound * @param queryOptions * @param typeOfGroups to search in or null for all * @return the group or null or exception * @throws GrouperDAOException * @throws GroupNotFoundException */ Group findByUuid(String uuid, boolean exceptionIfNotFound, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups) throws GrouperDAOException, GroupNotFoundException; /** ======= * find by uuid secure * @param uuid * @param exceptionIfNotFound * @param queryOptions * @return the group or null or exception * @throws GrouperDAOException * @throws GroupNotFoundException */ Group findByUuidSecure(String uuid, boolean exceptionIfNotFound, QueryOptions queryOptions); /** >>>>>>> * find by uuid secure * @param uuid * @param exceptionIfNotFound * @param queryOptions * @return the group or null or exception * @throws GrouperDAOException * @throws GroupNotFoundException */ Group findByUuidSecure(String uuid, boolean exceptionIfNotFound, QueryOptions queryOptions); /** * * @param uuid * @param exceptionIfNotFound * @param queryOptions * @param typeOfGroups to search in or null for all * @return the group or null or exception * @throws GrouperDAOException * @throws GroupNotFoundException */ Group findByUuid(String uuid, boolean exceptionIfNotFound, QueryOptions queryOptions, Set<TypeOfGroup> typeOfGroups) throws GrouperDAOException, GroupNotFoundException; /**
<<<<<<< import com.android.launcher3.util.PackageManagerHelper; ======= import com.android.launcher3.util.PackageUserKey; >>>>>>> import com.android.launcher3.util.PackageManagerHelper; import com.android.launcher3.util.PackageUserKey;
<<<<<<< ======= import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>> import org.slf4j.Logger; import org.slf4j.LoggerFactory;
<<<<<<< ======= import java.util.Collections; import java.util.HashMap; >>>>>>> import java.util.HashMap; <<<<<<< import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.ProjectionList; ======= >>>>>>> import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.ProjectionList; <<<<<<< import org.n52.sos.ds.hibernate.entities.RelatedFeature; import org.n52.sos.ds.hibernate.entities.Unit; import org.n52.sos.ds.hibernate.entities.feature.AbstractFeatureOfInterest; import org.n52.sos.ds.hibernate.entities.feature.FeatureOfInterest; import org.n52.sos.ds.hibernate.entities.feature.Specimen; ======= >>>>>>> import org.n52.sos.ds.hibernate.entities.Unit; import org.n52.sos.ds.hibernate.entities.feature.AbstractFeatureOfInterest; import org.n52.sos.ds.hibernate.entities.feature.FeatureOfInterest; import org.n52.sos.ds.hibernate.entities.feature.Specimen; <<<<<<< import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.Point; ======= >>>>>>> import com.google.common.collect.Lists; import com.google.common.collect.Maps; import com.google.common.collect.Sets; import com.vividsolutions.jts.geom.Coordinate; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.geom.GeometryFactory; import com.vividsolutions.jts.geom.LineString; import com.vividsolutions.jts.geom.Point; <<<<<<< public AbstractFeatureOfInterest getFeatureOfInterest(final String identifier, final Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class) .add(Restrictions.eq(FeatureOfInterest.IDENTIFIER, identifier)); ======= public FeatureOfInterest get(String identifier, Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class) .add(Restrictions.eq(FeatureOfInterest.IDENTIFIER, identifier)); >>>>>>> public FeatureOfInterest get(String identifier, Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class) .add(Restrictions.eq(FeatureOfInterest.IDENTIFIER, identifier)); <<<<<<< namedQuery.setParameter(PROCEDURE, observationConstellation.getProcedure().getIdentifier()); namedQuery.setParameter(OBSERVABLE_PROPERTY, observationConstellation.getObservableProperty().getIdentifier()); namedQuery.setParameter(OFFERING, observationConstellation.getOffering().getIdentifier()); ======= namedQuery.setParameter(PROCEDURE, oc.getProcedure().getIdentifier()); namedQuery.setParameter(OBSERVABLE_PROPERTY, oc.getObservableProperty().getIdentifier()); namedQuery.setParameter(OFFERING, oc.getOffering().getIdentifier()); >>>>>>> namedQuery.setParameter(PROCEDURE, oc.getProcedure().getIdentifier()); namedQuery.setParameter(OBSERVABLE_PROPERTY, oc.getObservableProperty().getIdentifier()); namedQuery.setParameter(OFFERING, oc.getOffering().getIdentifier()); <<<<<<< public List<String> getFeatureOfInterestIdentifiersForOffering(final String offeringIdentifiers, final Session session) throws OwsExceptionReport { if (HibernateHelper.isNamedQuerySupported(SQL_QUERY_GET_FEATURE_OF_INTEREST_IDENTIFIER_FOR_OFFERING, session)) { ======= public List<String> getIdentifiersForOffering(String offering, Session session) throws OwsExceptionReport { if (HibernateHelper.isNamedQuerySupported(SQL_QUERY_GET_FEATURE_OF_INTEREST_IDENTIFIER_FOR_OFFERING, session)) { >>>>>>> public List<String> getIdentifiersForOffering(String offering, Session session) throws OwsExceptionReport { if (HibernateHelper.isNamedQuerySupported(SQL_QUERY_GET_FEATURE_OF_INTEREST_IDENTIFIER_FOR_OFFERING, session)) { <<<<<<< private DetachedCriteria getDetachedCriteriaSeriesForOffering(String offering, Session session) throws CodedException { final DetachedCriteria detachedCriteria = getDetachedCriteriaSeries(session); detachedCriteria.createCriteria(Series.OFFERING).add(Restrictions.eq(Offering.IDENTIFIER, offering)); return detachedCriteria; ======= /** * Get featureOfInterest objects for featureOfInterest identifiers * * @param identifiers * FeatureOfInterest identifiers * @param session * Hibernate session * @return FeatureOfInterest objects */ @SuppressWarnings("unchecked") public List<FeatureOfInterest> getFeatureOfInterestObject(Collection<String> identifiers, Session session) { if (identifiers == null || identifiers.isEmpty()) { return Collections.emptyList(); } Criteria criteria = session.createCriteria(FeatureOfInterest.class) .add(QueryHelper.getCriterionForFoiIds(FeatureOfInterest.IDENTIFIER, identifiers)); LOGGER.debug("QUERY getFeatureOfInterestObject(identifiers): {}", HibernateHelper.getSqlString(criteria)); return criteria.list(); >>>>>>> private DetachedCriteria getDetachedCriteriaSeriesForOffering(String offering, Session session) throws CodedException { final DetachedCriteria detachedCriteria = getDetachedCriteriaSeries(session); detachedCriteria.createCriteria(Series.OFFERING).add(Restrictions.eq(Offering.IDENTIFIER, offering)); return detachedCriteria; /** * Get featureOfInterest objects for featureOfInterest identifiers * * @param identifiers * FeatureOfInterest identifiers * @param session * Hibernate session * @return FeatureOfInterest objects */ @SuppressWarnings("unchecked") public List<FeatureOfInterest> getFeatureOfInterestObject(Collection<String> identifiers, Session session) { if (identifiers == null || identifiers.isEmpty()) { return Collections.emptyList(); } Criteria criteria = session.createCriteria(FeatureOfInterest.class) .add(QueryHelper.getCriterionForFoiIds(FeatureOfInterest.IDENTIFIER, identifiers)); LOGGER.debug("QUERY getFeatureOfInterestObject(identifiers): {}", HibernateHelper.getSqlString(criteria)); return criteria.list(); <<<<<<< public List<FeatureOfInterest> getFeatureOfInterestObjects(final Session session) { Criteria criteria = getDefaultCriteria(session); ======= public List<FeatureOfInterest> getFeatureOfInterestObjects(Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class); >>>>>>> public List<FeatureOfInterest> getFeatureOfInterestObjects(Session session) { Criteria criteria = getDefaultCriteria(session); <<<<<<< public Map<String, Collection<String>> getFeatureOfInterestIdentifiersWithParents(final Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class); ProjectionList projectionList = Projections.projectionList(); projectionList.add(Projections.property(FeatureOfInterest.IDENTIFIER)); criteria.createAlias(FeatureOfInterest.PARENTS, "pfoi", JoinType.LEFT_OUTER_JOIN); projectionList.add(Projections.property("pfoi." + FeatureOfInterest.IDENTIFIER)); criteria.setProjection(projectionList); // return as List<Object[]> even if there's only one column for // consistency ======= public Map<String,Collection<String>> getIdentifiersWithParents(Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class) .createAlias(FeatureOfInterest.PARENTS, "pfoi", JoinType.LEFT_OUTER_JOIN) .setProjection(Projections.projectionList() .add(Projections.property(FeatureOfInterest.IDENTIFIER)) .add(Projections.property("pfoi." + FeatureOfInterest.IDENTIFIER))); //return as List<Object[]> even if there's only one column for consistency >>>>>>> public Map<String,Collection<String>> getIdentifiersWithParents(Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class) .createAlias(FeatureOfInterest.PARENTS, "pfoi", JoinType.LEFT_OUTER_JOIN) .setProjection(Projections.projectionList() .add(Projections.property(FeatureOfInterest.IDENTIFIER)) .add(Projections.property("pfoi." + FeatureOfInterest.IDENTIFIER))); // return as List<Object[]> even if there's only one column for // consistency <<<<<<< Map<String, Collection<String>> foiMap = Maps.newHashMap(); for (Object[] result : results) { ======= Map<String,Collection<String>> foiMap = new HashMap<>(); results.forEach(result -> { >>>>>>> Map<String, Collection<String>> foiMap = Maps.newHashMap(); results.forEach(result -> { <<<<<<< String parentFeatureIdentifier = null; parentFeatureIdentifier = (String) result[1]; ======= String parentFeatureIdentifier = (String) result[1]; >>>>>>> String parentFeatureIdentifier = (String) result[1]; <<<<<<< public List<String> getFeatureOfInterestIdentifiers(Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class) .setProjection(Projections.distinct(Projections.property(FeatureOfInterest.IDENTIFIER))); ======= public List<String> getIdentifiers(Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class) .setProjection(Projections.distinct(Projections.property(FeatureOfInterest.IDENTIFIER))); >>>>>>> public List<String> getIdentifiers(Session session) { Criteria criteria = session.createCriteria(FeatureOfInterest.class) .setProjection(Projections.distinct(Projections.property(FeatureOfInterest.IDENTIFIER))); <<<<<<< public AbstractFeatureOfInterest getOrInsertFeatureOfInterest(final String identifier, final String url, final Session session) { AbstractFeatureOfInterest feature = getFeatureOfInterest(identifier, session); ======= public FeatureOfInterest getOrInsert(String identifier, String url, Session session) { FeatureOfInterest feature = get(identifier, session); >>>>>>> public FeatureOfInterest getOrInsert(String identifier, String url, Session session) { FeatureOfInterest feature = get(identifier, session); <<<<<<< public void insertFeatureOfInterestRelationShip(final AbstractFeatureOfInterest parentFeature, final AbstractFeatureOfInterest childFeature, final Session session) { ======= public void insertRelationship(FeatureOfInterest parentFeature, FeatureOfInterest childFeature, Session session) { >>>>>>> public void insertRelationship(AbstractFeatureOfInterest parentFeature, AbstractFeatureOfInterest childFeature, Session session) { <<<<<<< public void checkOrInsertFeatureOfInterestRelatedFeatureRelation(final AbstractFeatureOfInterest featureOfInterest, final Offering offering, final Session session) { final List<RelatedFeature> relatedFeatures = new RelatedFeatureDAO(daoFactory) .getRelatedFeatureForOffering(offering.getIdentifier(), session); if (CollectionHelper.isNotEmpty(relatedFeatures)) { for (final RelatedFeature relatedFeature : relatedFeatures) { if (!featureOfInterest.getIdentifier().equals(relatedFeature.getFeatureOfInterest().getIdentifier())) { insertFeatureOfInterestRelationShip(relatedFeature.getFeatureOfInterest(), featureOfInterest, session); } } } ======= public void checkOrInsertRelatedFeatureRelation(FeatureOfInterest featureOfInterest, Offering offering, Session session) { daoFactory.getRelatedFeatureDAO() .getRelatedFeatureForOffering(offering.getIdentifier(), session) .stream() .filter(relatedFeature -> !featureOfInterest.getIdentifier().equals(relatedFeature.getFeatureOfInterest().getIdentifier())) .forEachOrdered(relatedFeature -> insertRelationship(relatedFeature.getFeatureOfInterest(), featureOfInterest, session)); >>>>>>> public void checkOrInsertRelatedFeatureRelation(AbstractFeatureOfInterest featureOfInterest, Offering offering, Session session) { daoFactory.getRelatedFeatureDAO() .getRelatedFeatureForOffering(offering.getIdentifier(), session) .stream() .filter(relatedFeature -> !featureOfInterest.getIdentifier().equals(relatedFeature.getFeatureOfInterest().getIdentifier())) .forEachOrdered(relatedFeature -> insertRelationship(relatedFeature.getFeatureOfInterest(), featureOfInterest, session));
<<<<<<< if (!PARTNER_CUSTOMIZATION) { return null; } Pair<String, Resources> customizationApkInfo = Utilities.findSystemApk( ======= Pair<String, Resources> customizationApkInfo = PackageManagerHelper.findSystemApk( >>>>>>> if (!PARTNER_CUSTOMIZATION) { return null; } Pair<String, Resources> customizationApkInfo = PackageManagerHelper.findSystemApk(
<<<<<<< import com.google.gerrit.server.notedb.ChangeNotes; ======= import com.google.gerrit.server.git.TransferConfig; >>>>>>> import com.google.gerrit.server.git.TransferConfig; import com.google.gerrit.server.notedb.ChangeNotes; <<<<<<< CapabilityCollection.Factory limitsFactory, ======= CapabilityCollection.Factory capabilityFactory, TransferConfig transferConfig, >>>>>>> CapabilityCollection.Factory limitsFactory, TransferConfig transferConfig,
<<<<<<< ======= final View buttonView = mLauncher.getWidgetsButton(); >>>>>>> final View buttonView = mLauncher.getWidgetsButton(); <<<<<<< startAnimationToWorkspaceFromOverlay(toWorkspaceState, appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); ======= startAnimationToWorkspaceFromOverlay(toWorkspaceState, toWorkspacePage, mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); >>>>>>> startAnimationToWorkspaceFromOverlay(toWorkspaceState, mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); <<<<<<< startAnimationToWorkspaceFromOverlay(toWorkspaceState, widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); ======= startAnimationToWorkspaceFromOverlay(toWorkspaceState, toWorkspacePage, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); >>>>>>> startAnimationToWorkspaceFromOverlay(toWorkspaceState, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); <<<<<<< final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) { ======= final int toWorkspacePage, final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) { >>>>>>> final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) {
<<<<<<< mOriginalIcon.forceHideDot(false); super.closeComplete(); ======= mOriginalIcon.setForceHideDot(false); >>>>>>> mOriginalIcon.setForceHideDot(false); super.closeComplete();
<<<<<<< final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { ======= final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final boolean animated, final Runnable onCompleteRunnable) { >>>>>>> final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { <<<<<<< Animator workspaceAnim = mLauncher.startWorkspaceStateChangeAnimation(toWorkspaceState, animated, overlaySearchBarView != null /* hasOverlaySearchBar */, layerViews); ======= Animator workspaceAnim = mLauncher.startWorkspaceStateChangeAnimation(toWorkspaceState, -1, animated, layerViews); >>>>>>> Animator workspaceAnim = mLauncher.startWorkspaceStateChangeAnimation(toWorkspaceState, animated, layerViews); <<<<<<< private void startAnimationToWorkspaceFromAllApps(final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { ======= private void startAnimationToWorkspaceFromAllApps(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final boolean animated, final Runnable onCompleteRunnable) { >>>>>>> private void startAnimationToWorkspaceFromAllApps(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { <<<<<<< startAnimationToWorkspaceFromOverlay(toWorkspaceState, mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); ======= mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, toWorkspacePage, mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); >>>>>>> mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, mLauncher.getAllAppsButton(), appsView, appsView.getContentView(), appsView.getRevealView(), appsView.getSearchBarView(), animated, onCompleteRunnable, cb); <<<<<<< private void startAnimationToWorkspaceFromWidgets(final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { ======= private void startAnimationToWorkspaceFromWidgets(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final boolean animated, final Runnable onCompleteRunnable) { >>>>>>> private void startAnimationToWorkspaceFromWidgets(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final boolean animated, final Runnable onCompleteRunnable) { <<<<<<< startAnimationToWorkspaceFromOverlay(toWorkspaceState, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); } ======= mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, toWorkspacePage, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); } >>>>>>> mCurrentAnimation = startAnimationToWorkspaceFromOverlay(fromWorkspaceState, toWorkspaceState, mLauncher.getWidgetsButton(), widgetsView, widgetsView.getContentView(), widgetsView.getRevealView(), null, animated, onCompleteRunnable, cb); } <<<<<<< private void startAnimationToWorkspaceFromOverlay(final Workspace.State toWorkspaceState, final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) { ======= private AnimatorSet startAnimationToWorkspaceFromOverlay(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final int toWorkspacePage, final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) { final AnimatorSet animation = LauncherAnimUtils.createAnimatorSet(); >>>>>>> private AnimatorSet startAnimationToWorkspaceFromOverlay(final Workspace.State fromWorkspaceState, final Workspace.State toWorkspaceState, final View buttonView, final View fromView, final View contentView, final View revealView, final View overlaySearchBarView, final boolean animated, final Runnable onCompleteRunnable, final PrivateTransitionCallbacks pCb) { final AnimatorSet animation = LauncherAnimUtils.createAnimatorSet(); <<<<<<< animated, overlaySearchBarView != null /* hasOverlaySearchBar */, layerViews); ======= toWorkspacePage, animated, layerViews); >>>>>>> animated, layerViews);
<<<<<<< import android.util.Log; ======= import java.lang.ref.WeakReference; import java.net.URISyntaxException; import java.text.Collator; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; >>>>>>> import android.util.Log; import java.lang.ref.WeakReference; import java.net.URISyntaxException; import java.text.Collator; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List;
<<<<<<< ======= import com.google.gerrit.reviewdb.client.Change; import com.google.gerrit.reviewdb.client.Patch; import com.google.gerrit.reviewdb.client.RefNames; >>>>>>>
<<<<<<< ======= import android.view.animation.AccelerateDecelerateInterpolator; import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; import android.widget.FrameLayout; >>>>>>> import android.view.animation.AccelerateInterpolator; import android.view.animation.DecelerateInterpolator; <<<<<<< @Override public void hideDropTargets() { animateToState(State.SEARCH_BAR, DEFAULT_DRAG_FADE_DURATION); ======= // Get the individual components mDropTargetBar = findViewById(R.id.drag_target_bar); mInfoDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.info_target_text); mDeleteDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.delete_target_text); mUninstallDropTarget = (ButtonDropTarget) mDropTargetBar.findViewById(R.id.uninstall_target_text); mInfoDropTarget.setSearchDropTargetBar(this); mDeleteDropTarget.setSearchDropTargetBar(this); mUninstallDropTarget.setSearchDropTargetBar(this); // Create the various fade animations mDropTargetBar.setAlpha(0f); AlphaUpdateListener.updateVisibility(mDropTargetBar, mAccessibilityEnabled); >>>>>>> @Override public void hideDropTargets() { animateToState(State.SEARCH_BAR, DEFAULT_DRAG_FADE_DURATION); <<<<<<< if (mQSB != null) { // Update the search bar animation mQSBSearchBarAnimator = new LauncherViewPropertyAnimator(mQSB); mQSBSearchBarAnimator.setInterpolator(sAccelerateInterpolator); mQSBSearchBarAnimator.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationStart(Animator animation) { // Ensure that the view is visible for the animation if (mQSB != null) { mQSB.setVisibility(View.VISIBLE); } } @Override public void onAnimationEnd(Animator animation) { if (mQSB != null) { AlphaUpdateListener.updateVisibility(mQSB, mAccessibilityEnabled); } } }); } else { mQSBSearchBarAnimator = null; } ======= >>>>>>>
<<<<<<< if (info instanceof PromiseAppInfo) { PromiseAppInfo promiseAppInfo = (PromiseAppInfo) info; launcher.startActivity(promiseAppInfo.getMarketIntent()); return true; } ======= return startDetailsActivityForInfo(info, launcher, callback, null, null); } public static boolean startDetailsActivityForInfo(ItemInfo info, Launcher launcher, DropTargetResultCallback callback, Rect sourceBounds, Bundle opts) { >>>>>>> return startDetailsActivityForInfo(info, launcher, callback, null, null); } public static boolean startDetailsActivityForInfo(ItemInfo info, Launcher launcher, DropTargetResultCallback callback, Rect sourceBounds, Bundle opts) { if (info instanceof PromiseAppInfo) { PromiseAppInfo promiseAppInfo = (PromiseAppInfo) info; launcher.startActivity(promiseAppInfo.getMarketIntent()); return true; }
<<<<<<< import com.android.launcher3.config.ProviderConfig; ======= import com.android.launcher3.util.IconNormalizer; >>>>>>> import com.android.launcher3.config.ProviderConfig; import com.android.launcher3.util.IconNormalizer;
<<<<<<< import com.google.gerrit.index.QueryOptions; import com.google.gerrit.index.Schema; import com.google.gerrit.index.query.DataSource; import com.google.gerrit.index.query.Predicate; import com.google.gerrit.index.query.QueryParseException; ======= import com.google.gerrit.elasticsearch.builders.QueryBuilder; import com.google.gerrit.elasticsearch.builders.SearchSourceBuilder; >>>>>>> import com.google.gerrit.elasticsearch.builders.QueryBuilder; import com.google.gerrit.elasticsearch.builders.SearchSourceBuilder; import com.google.gerrit.index.QueryOptions; import com.google.gerrit.index.Schema; import com.google.gerrit.index.query.DataSource; import com.google.gerrit.index.query.Predicate; import com.google.gerrit.index.query.QueryParseException; <<<<<<< import io.searchbox.client.JestResult; import io.searchbox.core.Bulk; import io.searchbox.core.Bulk.Builder; import io.searchbox.core.Search; import io.searchbox.core.search.sort.Sort; import io.searchbox.core.search.sort.Sort.Sorting; ======= import com.google.inject.assistedinject.AssistedInject; >>>>>>> import com.google.inject.assistedinject.AssistedInject;
<<<<<<< ObjectAnimator oa = LauncherAnimUtils.ofViewAlphaAndScale( mFolderIconImageView, 0, 1.5f, 1.5f); if (Utilities.isLmpOrAbove()) { ======= ObjectAnimator oa = LauncherAnimUtils.ofPropertyValuesHolder(mFolderIconImageView, alpha, scaleX, scaleY); if (Utilities.ATLEAST_LOLLIPOP) { >>>>>>> ObjectAnimator oa = LauncherAnimUtils.ofViewAlphaAndScale( mFolderIconImageView, 0, 1.5f, 1.5f); if (Utilities.ATLEAST_LOLLIPOP) {
<<<<<<< ======= if (!self.get().hasSameAccountId(rsrc.getUser()) && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to generate HTTP password"); } >>>>>>> <<<<<<< ======= if (!self.get().hasSameAccountId(rsrc.getUser()) && !self.get().getCapabilities().canAdministrateServer()) { throw new AuthException("not allowed to clear HTTP password"); } >>>>>>>
<<<<<<< ======= mChipOverhang = (int) context.getResources().getDimension(R.dimen.chip_hint_overhang); mActivity.getStateManager().addStateListener(this); } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); View hintContainer = mActivity.findViewById(R.id.hints); mProactiveHintsContainer = hintContainer instanceof ProactiveHintsContainer ? (ProactiveHintsContainer) hintContainer : null; >>>>>>> mActivity.getStateManager().addStateListener(this);
<<<<<<< = (ArrayList<ApplicationInfo>) mBgAllAppsList.data.clone(); mHandler.post(new Runnable() { ======= = (ArrayList<ApplicationInfo>) mAllAppsList.data.clone(); Runnable r = new Runnable() { >>>>>>> = (ArrayList<ApplicationInfo>) mBgAllAppsList.data.clone(); Runnable r = new Runnable() {
<<<<<<< mWorkspace.getCurrentPage(), cellInfo.cellX, cellInfo.cellY, false); mFolders.put(folderInfo.id, folderInfo); ======= mWorkspace.getCurrentScreen(), cellInfo.cellX, cellInfo.cellY, false); sFolders.put(folderInfo.id, folderInfo); >>>>>>> mWorkspace.getCurrentPage(), cellInfo.cellX, cellInfo.cellY, false); sFolders.put(folderInfo.id, folderInfo);
<<<<<<< ======= import com.google.gerrit.server.IdentifiedUser; import com.google.gerrit.server.Sequences; >>>>>>> import com.google.gerrit.server.IdentifiedUser; <<<<<<< import com.google.gerrit.server.notedb.Sequences; ======= import com.google.gerrit.server.group.db.GroupsUpdate; import com.google.gerrit.server.ssh.SshKeyCache; >>>>>>> import com.google.gerrit.server.group.db.GroupsUpdate; import com.google.gerrit.server.notedb.Sequences; import com.google.gerrit.server.ssh.SshKeyCache;
<<<<<<< import com.hortonworks.iotas.common.errors.ProcessingException; import com.hortonworks.iotas.layout.design.component.RulesProcessor; ======= import com.hortonworks.iotas.topology.component.Stream; import com.hortonworks.iotas.topology.component.impl.RulesProcessor; >>>>>>> import com.hortonworks.iotas.common.errors.ProcessingException; import com.hortonworks.iotas.topology.component.Stream; import com.hortonworks.iotas.topology.component.impl.RulesProcessor;
<<<<<<< elasticsearchConfig, nodeInfo.port, indicesPrefix, ElasticVersion.V5_6); return Guice.createInjector(new InMemoryModule(elasticsearchConfig)); ======= elasticsearchConfig, nodeInfo.hostname, nodeInfo.port, indicesPrefix, ElasticVersion.V5_6); return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration)); >>>>>>> elasticsearchConfig, nodeInfo.hostname, nodeInfo.port, indicesPrefix, ElasticVersion.V5_6); return Guice.createInjector(new InMemoryModule(elasticsearchConfig));
<<<<<<< import com.hortonworks.iotas.layout.transform.AddHeaderTransform; import com.hortonworks.iotas.layout.transform.IdentityTransform; import com.hortonworks.iotas.layout.transform.ProjectionTransform; import com.hortonworks.iotas.layout.transform.Transform; ======= import org.slf4j.Logger; import org.slf4j.LoggerFactory; >>>>>>> import com.hortonworks.iotas.layout.transform.AddHeaderTransform; import com.hortonworks.iotas.layout.transform.IdentityTransform; import com.hortonworks.iotas.layout.transform.ProjectionTransform; import com.hortonworks.iotas.layout.transform.Transform; import org.slf4j.Logger; import org.slf4j.LoggerFactory; <<<<<<< public class GroovyRuleRuntimeBuilder implements RuleRuntimeBuilder { ======= public class GroovyRuleRuntimeBuilder implements RuleRuntimeBuilder<Tuple, OutputCollector> { private static final Logger LOG = LoggerFactory.getLogger(GroovyRuleRuntimeBuilder.class); >>>>>>> public class GroovyRuleRuntimeBuilder implements RuleRuntimeBuilder { private static final Logger LOG = LoggerFactory.getLogger(GroovyRuleRuntimeBuilder.class);
<<<<<<< import com.hortonworks.iotas.layout.runtime.processor.RuleProcessorRuntime; import com.hortonworks.iotas.layout.runtime.rule.RuleRuntime; ======= import com.hortonworks.iotas.layout.runtime.processor.RuleProcessorRuntimeStorm; import com.hortonworks.iotas.layout.runtime.rule.RuleRuntimeStorm; import com.hortonworks.iotas.layout.runtime.rule.RulesBoltDependenciesFactory; >>>>>>> import com.hortonworks.iotas.layout.runtime.processor.RuleProcessorRuntime; import com.hortonworks.iotas.layout.runtime.rule.RuleRuntime; import com.hortonworks.iotas.layout.runtime.rule.RulesBoltDependenciesFactory;
<<<<<<< ======= public String getCustomProcessorWatchPath () { return customProcessorWatchPath; } public void setCustomProcessorWatchPath (String customProcessorWatchPath) { this.customProcessorWatchPath = customProcessorWatchPath; } public String getCustomProcessorUploadFailPath () { return customProcessorUploadFailPath; } public void setCustomProcessorUploadFailPath (String customProcessorUploadFailPath) { this.customProcessorUploadFailPath = customProcessorUploadFailPath; } public String getCustomProcessorUploadSuccessPath () { return customProcessorUploadSuccessPath; } public void setCustomProcessorUploadSuccessPath (String customProcessorUploadSuccessPath) { this.customProcessorUploadSuccessPath = customProcessorUploadSuccessPath; } >>>>>>> public String getCustomProcessorWatchPath () { return customProcessorWatchPath; } public void setCustomProcessorWatchPath (String customProcessorWatchPath) { this.customProcessorWatchPath = customProcessorWatchPath; } public String getCustomProcessorUploadFailPath () { return customProcessorUploadFailPath; } public void setCustomProcessorUploadFailPath (String customProcessorUploadFailPath) { this.customProcessorUploadFailPath = customProcessorUploadFailPath; } public String getCustomProcessorUploadSuccessPath () { return customProcessorUploadSuccessPath; } public void setCustomProcessorUploadSuccessPath (String customProcessorUploadSuccessPath) { this.customProcessorUploadSuccessPath = customProcessorUploadSuccessPath; }
<<<<<<< import com.hortonworks.iotas.layout.design.rule.Rule; import com.hortonworks.iotas.layout.design.rule.action.Action; import com.hortonworks.iotas.layout.runtime.rule.action.ActionRuntime; import com.hortonworks.iotas.layout.runtime.rule.action.ActionRuntimeContext; import com.hortonworks.iotas.layout.runtime.transform.ActionRuntimeService; ======= import com.hortonworks.iotas.topology.component.rule.Rule; import com.hortonworks.iotas.topology.component.rule.action.Action; import com.hortonworks.iotas.layout.runtime.ActionRuntime; import com.hortonworks.iotas.layout.runtime.TransformAction; import com.hortonworks.iotas.layout.runtime.transform.AddHeaderTransform; import com.hortonworks.iotas.layout.runtime.transform.IdentityTransform; import com.hortonworks.iotas.layout.runtime.transform.MergeTransform; import com.hortonworks.iotas.layout.runtime.transform.ProjectionTransform; import com.hortonworks.iotas.layout.runtime.transform.SubstituteTransform; import com.hortonworks.iotas.layout.runtime.transform.Transform; >>>>>>> import com.hortonworks.iotas.layout.runtime.rule.action.ActionRuntime; import com.hortonworks.iotas.layout.runtime.rule.action.ActionRuntimeContext; import com.hortonworks.iotas.layout.runtime.transform.ActionRuntimeService; import com.hortonworks.iotas.topology.component.rule.Rule; import com.hortonworks.iotas.topology.component.rule.action.Action;
<<<<<<< dataFeed.setName("test data feed"); dataFeed.setEndpoint("test-endpoint"); ======= dataFeed.setDataFeedName("test data feed"); dataFeed.setType("KAFKA"); >>>>>>> dataFeed.setName("test data feed"); dataFeed.setType("KAFKA");
<<<<<<< import com.hortonworks.iotas.layout.design.component.RulesProcessor; import com.hortonworks.iotas.layout.runtime.processor.RuleProcessorRuntime; import com.hortonworks.iotas.layout.runtime.processor.RuleProcessorRuntimeDependenciesBuilder; import com.hortonworks.iotas.layout.runtime.rule.GroovyRuleRuntimeBuilder; import com.hortonworks.iotas.layout.runtime.rule.RuleRuntime; import com.hortonworks.iotas.layout.runtime.rule.RuleRuntimeBuilder; ======= import com.hortonworks.iotas.layout.design.component.RulesProcessorBuilder; import com.hortonworks.iotas.layout.runtime.rule.RuleRuntimeStorm; import com.hortonworks.iotas.layout.runtime.rule.RulesBoltDependenciesFactory; >>>>>>> import com.hortonworks.iotas.layout.design.component.RulesProcessorBuilder; import com.hortonworks.iotas.layout.runtime.processor.RuleProcessorRuntime; import com.hortonworks.iotas.layout.runtime.rule.RuleRuntime; import com.hortonworks.iotas.layout.runtime.rule.RulesBoltDependenciesFactory; <<<<<<< private RuleProcessorRuntime ruleProcessorRuntime; ======= private RulesBoltDependenciesFactory rulesBoltDependenciesFactory; >>>>>>> private RuleProcessorRuntime ruleProcessorRuntime; private RulesBoltDependenciesFactory rulesBoltDependenciesFactory; <<<<<<< return ((RuleRuntime)ruleProcessorRuntime.getRulesRuntime().get(i)).getStreams().get(0); ======= return ((RuleRuntimeStorm)rulesBoltDependenciesFactory.createRuleProcessorRuntimeStorm().getRulesRuntime().get(i)).getStreamId(); //TODO: } protected abstract RulesBoltDependenciesFactory.ScriptType getScriptType(); public static class RulesTopologyTestGroovy extends RulesTopologyTest { public static void main(String[] args) throws AlreadyAliveException, InvalidTopologyException { RulesTopologyTest rulesTopologyTest = new RulesTopologyTestGroovy(); rulesTopologyTest.submitTopology(); } protected RulesBoltDependenciesFactory.ScriptType getScriptType() { return RulesBoltDependenciesFactory.ScriptType.GROOVY; } } public static class RulesTopologyTestSql extends RulesTopologyTest { public static void main(String[] args) throws AlreadyAliveException, InvalidTopologyException { RulesTopologyTest rulesTopologyTest = new RulesTopologyTestSql(); rulesTopologyTest.submitTopology(); } protected RulesBoltDependenciesFactory.ScriptType getScriptType() { return RulesBoltDependenciesFactory.ScriptType.SQL; } >>>>>>> return ((RuleRuntime) ruleProcessorRuntime.getRulesRuntime().get(i)).getStreams().get(0); } protected RulesBoltDependenciesFactory createDependenciesBuilderFactory(RulesProcessorBuilder rulesProcessorBuilder, RulesBoltDependenciesFactory.ScriptType scriptType) { rulesBoltDependenciesFactory = new RulesBoltDependenciesFactory(rulesProcessorBuilder, scriptType); return rulesBoltDependenciesFactory; } protected IRichBolt createRulesBolt(RulesBoltDependenciesFactory dependenciesBuilder) { return new RulesBolt(dependenciesBuilder); } protected RulesProcessorBuilder createRulesProcessorBuilder() { return new RuleProcessorMockBuilder(1,2,2); } protected abstract RulesBoltDependenciesFactory.ScriptType getScriptType(); public static class RulesTopologyTestGroovy extends RulesTopologyTest { public static void main(String[] args) throws AlreadyAliveException, InvalidTopologyException { RulesTopologyTest rulesTopologyTest = new RulesTopologyTestGroovy(); rulesTopologyTest.submitTopology(); } protected RulesBoltDependenciesFactory.ScriptType getScriptType() { return RulesBoltDependenciesFactory.ScriptType.GROOVY; } } public static class RulesTopologyTestSql extends RulesTopologyTest { public static void main(String[] args) throws AlreadyAliveException, InvalidTopologyException { RulesTopologyTest rulesTopologyTest = new RulesTopologyTestSql(); rulesTopologyTest.submitTopology(); } protected RulesBoltDependenciesFactory.ScriptType getScriptType() { return RulesBoltDependenciesFactory.ScriptType.SQL; }
<<<<<<< import com.hortonworks.iotas.catalog.DataFeed; ======= import com.hortonworks.iotas.catalog.Device; import com.hortonworks.iotas.catalog.NotifierInfo; >>>>>>> import com.hortonworks.iotas.catalog.DataFeed; <<<<<<< import com.hortonworks.iotas.catalog.Cluster; import com.hortonworks.iotas.catalog.NotifierInfo; import com.hortonworks.iotas.catalog.Device; import com.hortonworks.iotas.catalog.DataStream; import com.hortonworks.iotas.catalog.Component; ======= import com.hortonworks.iotas.catalog.Topology; >>>>>>> import com.hortonworks.iotas.catalog.Cluster; import com.hortonworks.iotas.catalog.NotifierInfo; import com.hortonworks.iotas.catalog.Device; import com.hortonworks.iotas.catalog.Component; import com.hortonworks.iotas.catalog.Topology; <<<<<<< public DataStream removeDataStream(Long dataStreamId) { DataStream dataStream = new DataStream(); dataStream.setId(dataStreamId); return dao.remove(new StorableKey(DATA_STREAM_NAMESPACE, dataStream ======= public Topology removeTopology (Long topologyIdId) { Topology topology = new Topology(); topology.setId(topologyIdId); return dao.remove(new StorableKey(TOPOLOGY_NAMESPACE, topology >>>>>>> public Topology removeTopology (Long topologyIdId) { Topology topology = new Topology(); topology.setId(topologyIdId); return dao.remove(new StorableKey(TOPOLOGY_NAMESPACE, topology
<<<<<<< import org.apache.commons.lang3.StringUtils; ======= >>>>>>> import org.apache.commons.lang3.StringUtils; <<<<<<< ======= import org.apache.commons.lang3.StringUtils; import org.apache.streamline.streams.storm.common.StormNotReachableException; >>>>>>>
<<<<<<< df.setName(name); df.setEndpoint("kafka://host:port/topic"); ======= df.setDataFeedName(name); df.setType("KAFKA"); >>>>>>> df.setName(name); df.setName(name); df.setType("KAFKA");
<<<<<<< import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.support.v4.content.LocalBroadcastManager; import android.util.Log; import android.widget.Toast; ======= import com.easemob.redpacketui.RedPacketConstant; import com.easemob.redpacketui.utils.RedPacketUtil; >>>>>>> import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.support.v4.content.LocalBroadcastManager; import android.util.Log; import com.easemob.redpacketui.RedPacketConstant; import com.easemob.redpacketui.utils.RedPacketUtil; <<<<<<< ======= import android.app.Activity; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.support.v4.content.LocalBroadcastManager; import android.util.Log; import android.widget.Toast; >>>>>>> <<<<<<< ======= final String str = appContext.getString(R.string.receive_the_passthrough); final String CMD_TOAST_BROADCAST = "hyphenate.demo.cmd.toast"; IntentFilter cmdFilter = new IntentFilter(CMD_TOAST_BROADCAST); if(broadCastReceiver == null){ broadCastReceiver = new BroadcastReceiver(){ @Override public void onReceive(Context context, Intent intent) { // TODO Auto-generated method stub //过滤掉红包回执消息的透传吐司 if (action.equals(RedPacketConstant.REFRESH_GROUP_RED_PACKET_ACTION)){ return; } Toast.makeText(appContext, intent.getStringExtra("cmd_value"), Toast.LENGTH_SHORT).show(); } }; //注册广播接收者 appContext.registerReceiver(broadCastReceiver,cmdFilter); } Intent broadcastIntent = new Intent(CMD_TOAST_BROADCAST); broadcastIntent.putExtra("cmd_value", str+action); appContext.sendBroadcast(broadcastIntent, null); >>>>>>>
<<<<<<< import android.annotation.TargetApi; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.content.LocalBroadcastManager; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.KeyEvent; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; ======= import java.util.List; import com.easemob.redpacketui.RedPacketConstant; import com.easemob.redpacketui.utils.RedPacketUtil; >>>>>>> import android.annotation.TargetApi; import android.content.BroadcastReceiver; import android.content.Context; import android.content.DialogInterface; import android.content.Intent; import android.content.IntentFilter; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; import android.support.v4.app.FragmentTransaction; import android.support.v4.content.LocalBroadcastManager; import android.view.ContextMenu; import android.view.ContextMenu.ContextMenuInfo; import android.view.KeyEvent; import android.view.View; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import java.util.List; import com.easemob.redpacketui.RedPacketConstant; import com.easemob.redpacketui.utils.RedPacketUtil;
<<<<<<< collectionSizeRange = new Range<>(Constants.MIN_COLLECTION_SIZE, Constants.MAX_COLLECTION_SIZE); } public void setCollectionSizeRange(final int minCollectionSize, final int maxCollectionSize) { this.collectionSizeRange = new Range<>(minCollectionSize, maxCollectionSize); ======= stringLengthRange = new Range<>(Constants.MIN_STRING_LENGTH, Constants.MAX_STRING_LENGTH); >>>>>>> collectionSizeRange = new Range<>(Constants.MIN_COLLECTION_SIZE, Constants.MAX_COLLECTION_SIZE); stringLengthRange = new Range<>(Constants.MIN_STRING_LENGTH, Constants.MAX_STRING_LENGTH); } public void setCollectionSizeRange(final int minCollectionSize, final int maxCollectionSize) { this.collectionSizeRange = new Range<>(minCollectionSize, maxCollectionSize);
<<<<<<< import org.jmrtd.lds.CardSecurityFile; import org.jmrtd.lds.ChipAuthenticationPublicKeyInfo; import org.jmrtd.lds.SODFile; ======= import org.jmrtd.lds.CardAccessFile; import org.jmrtd.lds.PACEInfo; >>>>>>> import org.jmrtd.lds.ChipAuthenticationPublicKeyInfo; import org.jmrtd.lds.SODFile; import org.jmrtd.lds.CardAccessFile;
<<<<<<< * Receive message in asynchronous way. This call doesn't block user's thread, and user's message resolve logic * should implement in the {@link MessageListener}. * * @param messageListener {@link MessageListener#onReceived(Message, MessageListener.Context)} will be called when * new delivered message is coming. * @return */ void receiveAsync(MessageListener messageListener); /** ======= * Receives the next batch messages from the bind queues of this consumer in pull model. * <p> * This call blocks indefinitely until the messages is arrives, the timeout expires, or until this {@code PullConsumer} * is shut down. * * @param timeout receive messages will blocked at most <code>timeout</code> milliseconds. * @return the next batch messages received from the bind queues, or null if the consumer is concurrently shut down. * @throws OMSSecurityException when have no authority to receive messages from this queue. * @throws OMSTimeOutException when the given timeout elapses before the send operation completes. * @throws OMSRuntimeException when the {@code Producer} fails to send the message due to some internal error. */ List<Message> batchReceive(long timeout); /** >>>>>>> * Receive message in asynchronous way. This call doesn't block user's thread, and user's message resolve logic * should implement in the {@link MessageListener}. * <p> * * @param timeout receive messages will blocked at most <code>timeout</code> milliseconds. * @return the next batch messages received from the bind queues, or null if the consumer is concurrently shut down. * @throws OMSSecurityException when have no authority to receive messages from this queue. * @throws OMSTimeOutException when the given timeout elapses before the send operation completes. * @throws OMSRuntimeException when the {@code Producer} fails to send the message due to some internal error. */ List<Message> batchReceive(long timeout); /**
<<<<<<< ======= if (result instanceof Unknown && response.getResponseCode() != 204) { Logger.log(Logger.LEVEL.DEBUG, response.toString()); Logger.log(context.getString(R.string.error, context.getString(R.string.auth_error_provider) )); Logger.log(context.getString(R.string.auth_provider_assume)); return new MosMetroV2(context, response); } >>>>>>> <<<<<<< this.gen_204 = new Gen204(context, running); setClient(new OkHttp(context)); ======= this.client = new OkHttp(context) .customDnsEnabled(true) .setRunningListener(running) .setDelaysEnabled(settings.getBoolean("pref_delay_always", false)); >>>>>>> this.gen_204 = new Gen204(context, running); setClient(new OkHttp(context)); <<<<<<< public boolean isConnected(boolean false_negatives) { return isConnected(gen_204.check(false_negatives)); ======= public static ParsedResponse generate_204(Context context, Listener<Boolean> running) { Randomizer random = new Randomizer(context); Client client = new OkHttp(context) .customDnsEnabled(true) .setRunningListener(running) .trustAllCerts() .followRedirects(false); ParsedResponse response = new ParsedResponse("<b>Empty response</b>"); try { String url = "http://" + random.choose(GENERATE_204); Logger.log(Logger.LEVEL.DEBUG, "Provider | generate_204() | URL: " + url); response = client.get(url, null); } catch (IOException ex) { Logger.log(Logger.LEVEL.DEBUG, ex); return response; } if (response.getResponseCode() != 204) return response; try { response = client.get("https://" + random.choose(GENERATE_204), null); } catch (IOException ex) { Logger.log(Logger.LEVEL.DEBUG, ex); return response; } return response; >>>>>>> public boolean isConnected(boolean false_negatives) { return isConnected(gen_204.check(false_negatives));
<<<<<<< ======= public ParsedResponse post(String link, String type, String body) throws IOException { return parse(call(link, RequestBody.create(MediaType.parse(type), body))); } @Override public InputStream getInputStream(String link) throws IOException { Response response = call(link, null); ResponseBody body = response.body(); if (body == null) { throw new IOException("Empty response: " + response.code()); } return body.byteStream(); } @Override >>>>>>> public ParsedResponse post(String link, String type, String body) throws IOException { return parse(call(link, RequestBody.create(MediaType.parse(type), body))); } @Override
<<<<<<< ======= private static String absolutePathToUrl(String base_url, String path) throws ParseException { String base = removePathFromUrl(base_url); if (path.startsWith("//")) { return Uri.parse(base_url).getScheme() + ":" + path; } else if (path.startsWith("/")) { return base + path; } else if (path.startsWith("http")) { return path; } else { throw new ParseException("Malformed URL: " + path, 0); } } public List<String> parseResourceList() { LinkedList<String> links = new LinkedList<>(); if (document == null) { return links; } // <link href="..." /> for (Element element : document.getElementsByTag("link")) { if (element.hasAttr("rel")) { String rel = element.attr("rel"); if (!("icon".equals(rel) || "stylesheet".equals(rel))) continue; } if (element.hasAttr("href")) links.add(element.attr("href")); } // <script src="..." /> for (Element element : document.getElementsByTag("script")) { if (element.hasAttr("src")) links.add(element.attr("src")); } // <img src="..." /> for (Element element : document.getElementsByTag("img")) { if (element.hasAttr("src")) links.add(element.attr("src")); } // Absolute path to full URL LinkedList<String> result = new LinkedList<>(); for (String link : links) { try { String url = absolutePathToUrl(this.url, link); if (!result.contains(url)) result.add(url); } catch (ParseException ignored) {} } return result; } public void loadResources(Client client) { for (String link : parseResourceList()) { Logger.log(this, link); try { client.get(link, null); } catch (IOException ignored) {} if (!client.running.get()) { break; } } } >>>>>>> private static String absolutePathToUrl(String base_url, String path) throws ParseException { String base = removePathFromUrl(base_url); if (path.startsWith("//")) { return Uri.parse(base_url).getScheme() + ":" + path; } else if (path.startsWith("/")) { return base + path; } else if (path.startsWith("http")) { return path; } else { throw new ParseException("Malformed URL: " + path, 0); } }
<<<<<<< protected ParsedResponse last_response = new ParsedResponse(""); ======= >>>>>>>
<<<<<<< * - Debounce value changes (Source: https://stackoverflow.com/a/38296055) * - Stack Overflow protection by checking if child is the master at the same time ======= * - Interruptible delays * - Stack Overflow protection by checking if callback is the master >>>>>>> * - Debounce value changes (Source: https://stackoverflow.com/a/38296055) * - Interruptible delays * - Stack Overflow protection by checking if child is the master at the same time
<<<<<<< // Cellomics datasets cannot be reliably detected with .mdb file if (used[i].toLowerCase().endsWith(".mdb") && r instanceof CellomicsReader) { continue; } ======= // MetaXpress TIFF reader can flag .HTD files from CellWorX if (result && r instanceof CellWorxReader && readers[j] instanceof MetaxpressTiffReader) { continue; } >>>>>>> // Cellomics datasets cannot be reliably detected with .mdb file if (used[i].toLowerCase().endsWith(".mdb") && r instanceof CellomicsReader) { continue; } // MetaXpress TIFF reader can flag .HTD files from CellWorX if (result && r instanceof CellWorxReader && readers[j] instanceof MetaxpressTiffReader) { continue; }
<<<<<<< if (!replica) { ======= modules.addAll(testSshModules); if (!slave) { >>>>>>> modules.addAll(testSshModules); if (!replica) {
<<<<<<< m.pixelType = FormatTools.pixelTypeFromBytes(bpp, signed, false); m.sizeC = 1; m.sizeT = 1; m.sizeZ = 1; m.imageCount = 1; m.dimensionOrder = "XYZCT"; m.littleEndian = false; ======= core[0].pixelType = FormatTools.pixelTypeFromBytes(bpp, signed, true); core[0].sizeC = 1; core[0].sizeT = 1; core[0].sizeZ = 1; core[0].imageCount = 1; core[0].dimensionOrder = "XYZCT"; core[0].littleEndian = false; >>>>>>> m.pixelType = FormatTools.pixelTypeFromBytes(bpp, signed, true); m.sizeC = 1; m.sizeT = 1; m.sizeZ = 1; m.imageCount = 1; m.dimensionOrder = "XYZCT"; m.littleEndian = false;
<<<<<<< public List<CoreMetadata> getCoreMetadata() { //return reader.getCoreMetadata(); ======= public CoreMetadata[] getCoreMetadata() { int count = 0; int currentIndex = reader.getCoreIndex(); // Only used for determining the object type. CoreMetadata[] oldcore = reader.getCoreMetadata(); CoreMetadata[] newcore = new CoreMetadata[oldcore.length]; for (int s=0; s<newcore.length; s++) { newcore[s] = oldcore[s].clone(this, s); } >>>>>>> public List<CoreMetadata> getCoreMetadata() { int count = 0; int currentIndex = reader.getCoreIndex(); // Only used for determining the object type. List<CoreMetadata> oldcore = reader.getCoreMetadata(); List<CoreMetadata> newcore = new ArrayList<CoreMetadata>; for (int s=0; s<oldcore.size(); s++) { newcore.add(oldcore.get(s).clone(this, s)); } <<<<<<< // -- Helper methods -- /** Creates a copy of the core metadata instantiated using the provided CoreMetadata type, * matching the state of the given reader. */ protected <T extends CoreMetadata> List<CoreMetadata> copyCoreMetadata(Class<T> c, IFormatReader r) { int count = 0; int currentSeries = r.getSeries(); for (int i=0; i<r.getSeriesCount(); i++) { r.setSeries(i); count += r.getResolutionCount(); } r.setSeries(currentSeries); ArrayList<CoreMetadata> core = new ArrayList<CoreMetadata>(); for (int s=0; s<count; s++) { T meta = null; try { meta = c.newInstance(); } catch (InstantiationException e) { throw new IllegalArgumentException("Failed to create metadata:\n" + e); } catch (IllegalAccessException e) { throw new IllegalArgumentException("Failed to create metadata:\n" + e); } meta.copy(r, s); core.add(meta); } return core; } ======= >>>>>>>
<<<<<<< if (s == 0 && !hasFlattenedResolutions()) { ms.resolutionCount = seriesCount; ======= if (s == 0) { core[s].resolutionCount = core.length; >>>>>>> if (s == 0) { ms.resolutionCount = seriesCount;
<<<<<<< CoreMetadata ms = core.get(s); if (s == 0 && !hasFlattenedResolutions()) { ms.resolutionCount = ifds.size() + (files.size() == 1 ? 0 : 1); ======= if (s == 0) { core[s].resolutionCount = ifds.size() + (files.size() == 1 ? 0 : 1); >>>>>>> CoreMetadata ms = core.get(s); if (s == 0) { ms.resolutionCount = ifds.size() + (files.size() == 1 ? 0 : 1);
<<<<<<< public static final String PREF_ND2_CHUNKMAP = "bioformats.nativend2.chunkmap"; ======= public static final String PREF_LEICA_LIF_PHYSICAL_SIZE = "bioformats.leicalif.physicalsize.compatibility"; >>>>>>> public static final String PREF_ND2_CHUNKMAP = "bioformats.nativend2.chunkmap"; public static final String PREF_LEICA_LIF_PHYSICAL_SIZE = "bioformats.leicalif.physicalsize.compatibility"; <<<<<<< ((DynamicMetadataOptions) options).setBoolean( NativeND2Reader.USE_CHUNKMAP_KEY, useND2Chunkmap()); ======= ((DynamicMetadataOptions) options).setBoolean( LIFReader.OLD_PHYSICAL_SIZE_KEY, isLeicaLIFPhysicalSizeBackwardsCompatible()); >>>>>>> ((DynamicMetadataOptions) options).setBoolean( NativeND2Reader.USE_CHUNKMAP_KEY, useND2Chunkmap()); ((DynamicMetadataOptions) options).setBoolean( LIFReader.OLD_PHYSICAL_SIZE_KEY, isLeicaLIFPhysicalSizeBackwardsCompatible()); <<<<<<< public static boolean useND2Chunkmap() { return Prefs.get(PREF_ND2_CHUNKMAP, NativeND2Reader.USE_CHUNKMAP_DEFAULT); } ======= public static boolean isLeicaLIFPhysicalSizeBackwardsCompatible() { return Prefs.get(PREF_LEICA_LIF_PHYSICAL_SIZE, LIFReader.OLD_PHYSICAL_SIZE_DEFAULT); } >>>>>>> public static boolean useND2Chunkmap() { return Prefs.get(PREF_ND2_CHUNKMAP, NativeND2Reader.USE_CHUNKMAP_DEFAULT); } public static boolean isLeicaLIFPhysicalSizeBackwardsCompatible() { return Prefs.get(PREF_LEICA_LIF_PHYSICAL_SIZE, LIFReader.OLD_PHYSICAL_SIZE_DEFAULT); }
<<<<<<< import ome.units.quantity.Length; ======= import ome.units.quantity.Length; >>>>>>> import ome.units.quantity.Length; <<<<<<< PositiveFloat emission = FormatTools.getEmissionWavelength(channel.emWave); PositiveFloat excitation = FormatTools.getExcitationWavelength(channel.exWave); Length wavelength = FormatTools.getWavelength(channel.exWave); ======= Length emission = FormatTools.getEmissionWavelength(channel.emWave); Length excitation = FormatTools.getExcitationWavelength(channel.exWave); PositiveFloat wavelength = FormatTools.getWavelength(channel.exWave); >>>>>>> Length wavelength = FormatTools.getWavelength(channel.exWave); Length emission = FormatTools.getEmissionWavelength(channel.emWave); Length excitation = FormatTools.getExcitationWavelength(channel.exWave);
<<<<<<< jpeg = new String[3]; core = new CoreMetadata[3]; ======= jpeg = new TileJPEGReader[3]; >>>>>>> jpeg = new String[3]; <<<<<<< jpeg[i] = file; TileJPEGReader reader = new TileJPEGReader(); reader.setId(file); core[i] = reader.getCoreMetadata()[0]; reader.close(); core[i].thumbnail = i > 0; core[i].interleaved = core[i].sizeX > MAX_SIZE && core[i].sizeY > MAX_SIZE; ======= jpeg[i] = new TileJPEGReader(); jpeg[i].setId(file); CoreMetadata m = jpeg[i].getCoreMetadataList().get(0); m.thumbnail = i > 0; core.add(m); >>>>>>> jpeg[i] = file; TileJPEGReader reader = new TileJPEGReader(); reader.setId(file); CoreMetadata m = reader.getCoreMetadataList().get(0); reader.close(); m.interleaved = m.sizeX > MAX_SIZE && m.sizeY > MAX_SIZE; m.thumbnail = i > 0; core.add(m);
<<<<<<< populateOriginalMetadata(image, nameStack); ======= HashMap<String, Integer> indexes = new HashMap<String, Integer>(); populateOriginalMetadata(image, nameStack, indexes); addUserCommentMeta(image); indexes.clear(); >>>>>>> populateOriginalMetadata(image, nameStack); addUserCommentMeta(image);
<<<<<<< ======= bufferWidth = niceRoundUp(screenArea.getWidth() + 1); bufferHeight = niceRoundUp(screenArea.getHeight()); int count = bufferHeight * bufferWidth; fogOfWarStatus = new byte[count * 4]; geometryInvalid = new BitSet(count); geometrytirs = count * 2; geometryhandle = gl.generateGeometry(geometrytirs * 3 * VERTEX_SIZE); >>>>>>>
<<<<<<< import go.graphics.area.Area; import go.graphics.swing.AreaContainer; import go.graphics.swing.sound.SwingSoundPlayer; import java.awt.Dimension; ======= >>>>>>> <<<<<<< import jsettlers.common.CommitInfo; ======= >>>>>>> <<<<<<< ======= import jsettlers.common.menu.IMapInterfaceConnector; import jsettlers.common.menu.IStartedGame; import jsettlers.common.menu.IStartingGame; import jsettlers.common.resources.ResourceManager; >>>>>>> import jsettlers.common.menu.IMapInterfaceConnector; import jsettlers.common.menu.IStartedGame; import jsettlers.common.menu.IStartingGame; import jsettlers.common.resources.ResourceManager; <<<<<<< loadOptionalSettings(options); setupResourceManagers(options, new File(".")); ======= if (options.isOptionSet("localhost")) { CommonConstants.DEFAULT_SERVER_ADDRESS = "localhost"; } >>>>>>> if (options.isOptionSet("localhost")) { CommonConstants.DEFAULT_SERVER_ADDRESS = "localhost"; } <<<<<<< public static void setupResourceManagers(OptionableProperties options, File defaultConfigDirectory) throws FileNotFoundException, IOException { ConfigurationPropertiesFile configFile = getConfigFile(options, defaultConfigDirectory); ======= public static void setupResourceManagers(OptionableProperties options, String defaultConfigFileName) throws FileNotFoundException, IOException { ConfigurationPropertiesFile configFile = SwingManagedJSettlers.getConfigFile(options, defaultConfigFileName); >>>>>>> public static void setupResourceManagers(OptionableProperties options, File defaultConfigDirectory) throws FileNotFoundException, IOException { ConfigurationPropertiesFile configFile = getConfigFile(options, defaultConfigDirectory);
<<<<<<< import go.graphics.area.Area; import go.graphics.swing.AreaContainer; import go.graphics.swing.sound.SwingSoundPlayer; import java.awt.Dimension; ======= >>>>>>> <<<<<<< import jsettlers.common.CommitInfo; ======= >>>>>>> <<<<<<< public static void loadOptionalSettings(OptionableProperties options) { CommonConstants.CONTROL_ALL = options.isOptionSet("control-all"); CommonConstants.ACTIVATE_ALL_PLAYERS = options.isOptionSet("activate-all-players"); CommonConstants.ENABLE_CONSOLE_LOGGING = options.isOptionSet("console-output"); CommonConstants.ENABLE_AI = !options.isOptionSet("disable-ai"); CommonConstants.ALL_AI = options.isOptionSet("all-ai"); CommonConstants.DISABLE_ORIGINAL_MAPS = options.isOptionSet("disable-original-maps"); if (options.containsKey("fixed-ai-type")) { CommonConstants.FIXED_AI_TYPE = EWhatToDoAiType.valueOf(options.getProperty("fixed-ai-type")); } if (options.isOptionSet("localhost")) { CommonConstants.DEFAULT_SERVER_ADDRESS = "localhost"; } if (options.containsKey("locale")) { String localeString = options.getProperty("locale"); String[] localeParts = localeString.split("_"); if (localeParts.length == 2) { AbstractLabels.setPreferredLocale(new Locale(localeParts[0], localeParts[1])); } else { System.err.println("Please specify the locale with language and country. (For example: de_de or en_us)"); } } } /** * Creates a new SWING GUI for the game. * * @param argsList * @return * @throws IOException * @throws FileNotFoundException */ public static JSettlersScreen startGui() { Area area = new Area(); JSettlersScreen content = new JSettlersScreen(new StartScreenConnector(), new SwingSoundPlayer(), getBuild()); area.add(content.getRegion()); startJogl(area); startRedrawTimer(content); return content; } private static void generateContent(OptionableProperties options, JSettlersScreen content) throws IOException, MapLoadException { ======= private static void handleStartOptions(OptionableProperties options, JSettlersFrame settlersFrame) throws IOException, MapLoadException { >>>>>>> private static void handleStartOptions(OptionableProperties options, JSettlersFrame settlersFrame) throws IOException, MapLoadException {
<<<<<<< /******************************************************************************* * Copyright (c) 2015 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *******************************************************************************/ package jsettlers.graphics.action; import jsettlers.common.material.EPriority; /** * This {@link Action} is used to set the priority of a building. When it is fired, the priority is set for the current selection. * * @author Andreas Eberle */ public class SetBuildingPriorityAction extends Action { private final EPriority newPriority; /** * Creates a new {@link SetBuildingPriorityAction}. * * @param newPriority * The new priority. */ public SetBuildingPriorityAction(EPriority newPriority) { super(EActionType.SET_BUILDING_PRIORITY); this.newPriority = newPriority; } /** * @return Returns the new priority that shall be set to the selected building. */ public EPriority getNewPriority() { return newPriority; } } ======= /******************************************************************************* * Copyright (c) 2015 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *******************************************************************************/ package jsettlers.graphics.action; import jsettlers.common.material.EPriority; import jsettlers.common.menu.action.EActionType; /** * This {@link Action} is used to set the priority of a building. When it is fired, the priority is set for the current selection. * * @author Andreas Eberle */ public class SetBuildingPriorityAction extends Action { private final EPriority newPriority; public SetBuildingPriorityAction(EPriority newPriority) { super(EActionType.SET_BUILDING_PRIORITY); this.newPriority = newPriority; } /** * @return Returns the new priority that shall be set to the selected building. */ public EPriority getNewPriority() { return newPriority; } } >>>>>>> /******************************************************************************* * Copyright (c) 2015 * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. *******************************************************************************/ package jsettlers.graphics.action; import jsettlers.common.material.EPriority; import jsettlers.common.menu.action.EActionType; /** * This {@link Action} is used to set the priority of a building. When it is fired, the priority is set for the current selection. * * @author Andreas Eberle */ public class SetBuildingPriorityAction extends Action { private final EPriority newPriority; /** * Creates a new {@link SetBuildingPriorityAction}. * * @param newPriority * The new priority. */ public SetBuildingPriorityAction(EPriority newPriority) { super(EActionType.SET_BUILDING_PRIORITY); this.newPriority = newPriority; } /** * @return Returns the new priority that shall be set to the selected building. */ public EPriority getNewPriority() { return newPriority; } }
<<<<<<< holdBattleBetween(EPlayerType.AI_EASY, EPlayerType.AI_VERY_EASY, 70 * MINUTES); ======= holdBattleBetween(EWhatToDoAiType.ROMAN_EASY, EWhatToDoAiType.ROMAN_VERY_EASY, 60 * MINUTES); >>>>>>> holdBattleBetween(EPlayerType.AI_EASY, EPlayerType.AI_VERY_EASY, 60 * MINUTES); <<<<<<< holdBattleBetween(EPlayerType.AI_HARD, EPlayerType.AI_EASY, 60 * MINUTES); ======= holdBattleBetween(EWhatToDoAiType.ROMAN_HARD, EWhatToDoAiType.ROMAN_EASY, 70 * MINUTES); >>>>>>> holdBattleBetween(EPlayerType.AI_HARD, EPlayerType.AI_EASY, 70 * MINUTES); <<<<<<< holdBattleBetween(EPlayerType.AI_VERY_HARD, EPlayerType.AI_HARD, 70 * MINUTES); ======= holdBattleBetween(EWhatToDoAiType.ROMAN_VERY_HARD, EWhatToDoAiType.ROMAN_HARD, 80 * MINUTES); >>>>>>> holdBattleBetween(EPlayerType.AI_VERY_HARD, EPlayerType.AI_HARD, 80 * MINUTES);
<<<<<<< import jsettlers.input.tasks.SetTradingWaypointGuiTask; ======= import jsettlers.input.tasks.SetMaterialProductionGuiTask; >>>>>>> import jsettlers.input.tasks.SetMaterialProductionGuiTask; import jsettlers.input.tasks.SetTradingWaypointGuiTask; <<<<<<< break; case CHANGE_TRADING: { ChangeTradingRequestGuiTask task = (ChangeTradingRequestGuiTask) guiTask; ShortPoint2D buildingPos = task.getBuildingPos(); IBuilding building = grid.getBuildingAt(buildingPos.x, buildingPos.y); if (building instanceof TestTradingBuilding) { ((TestTradingBuilding) building).changeRequestedMaterial(task.getMaterial(), task.getAmount(), task.isRelative()); } } break; case SET_TRADING_WAYPOINT: { SetTradingWaypointGuiTask task = (SetTradingWaypointGuiTask) guiTask; ShortPoint2D buildingPos = task.getBuildingPos(); IBuilding building = grid.getBuildingAt(buildingPos.x, buildingPos.y); if (building instanceof TestTradingBuilding) { ((TestTradingBuilding) building).setWaypoint(task.getWaypointType(), task.getPosition()); } } break; ======= break; case SET_MATERIAL_PRODUCTION: { SetMaterialProductionGuiTask task = (SetMaterialProductionGuiTask) guiTask; switch (task.getProductionType()) { case INCREASE: grid.getMaterialProductionAt(task.getPosition()).increaseNumberOfFutureProducedMaterial(task.getMaterialType()); break; case DECREASE: grid.getMaterialProductionAt(task.getPosition()).decreaseNumberOfFutureProducedMaterial(task.getMaterialType()); break; case SET_RATIO: grid.getMaterialProductionAt(task.getPosition()).setRatioOfMaterial(task.getMaterialType(), task.getRatio()); break; } break; } >>>>>>> break; case CHANGE_TRADING: { ChangeTradingRequestGuiTask task = (ChangeTradingRequestGuiTask) guiTask; ShortPoint2D buildingPos = task.getBuildingPos(); IBuilding building = grid.getBuildingAt(buildingPos.x, buildingPos.y); if (building instanceof TestTradingBuilding) { ((TestTradingBuilding) building).changeRequestedMaterial(task.getMaterial(), task.getAmount(), task.isRelative()); } } break; case SET_TRADING_WAYPOINT: { SetTradingWaypointGuiTask task = (SetTradingWaypointGuiTask) guiTask; ShortPoint2D buildingPos = task.getBuildingPos(); IBuilding building = grid.getBuildingAt(buildingPos.x, buildingPos.y); if (building instanceof TestTradingBuilding) { ((TestTradingBuilding) building).setWaypoint(task.getWaypointType(), task.getPosition()); } } break; case SET_MATERIAL_PRODUCTION: { SetMaterialProductionGuiTask task = (SetMaterialProductionGuiTask) guiTask; switch (task.getProductionType()) { case INCREASE: grid.getMaterialProductionAt(task.getPosition()).increaseNumberOfFutureProducedMaterial(task.getMaterialType()); break; case DECREASE: grid.getMaterialProductionAt(task.getPosition()).decreaseNumberOfFutureProducedMaterial(task.getMaterialType()); break; case SET_RATIO: grid.getMaterialProductionAt(task.getPosition()).setRatioOfMaterial(task.getMaterialType(), task.getRatio()); break; } break; }
<<<<<<< taskScheduler) { ArmyGeneral general = determineArmyGeneral(type, civilisation, aiStatistics, player, movableGrid, taskScheduler); EconomyMinister minister = determineMinister(type, civilisation); ======= taskScheduler) { ArmyGeneral general = determineArmyGeneral(type, aiStatistics, player, movableGrid, taskScheduler); EconomyMinister minister = determineMinister(type, aiStatistics, player); >>>>>>> taskScheduler) { ArmyGeneral general = determineArmyGeneral(type, civilisation, aiStatistics, player, movableGrid, taskScheduler); EconomyMinister minister = determineMinister(type, civilisation, aiStatistics, player); <<<<<<< private EconomyMinister determineMinister(EPlayerType type, ECivilisation civilisation) { //TODO: use civilisation to determine different ministers when there is more than ROMAN if (type == EPlayerType.AI_EASY || type == EPlayerType.AI_VERY_HARD) { ======= private EconomyMinister determineMinister(EWhatToDoAiType type, AiStatistics aiStatistics, Player player) { if (type == EWhatToDoAiType.ROMAN_VERY_EASY) { return new AdaptableEconomyMinister(aiStatistics, player); } else if (type == EWhatToDoAiType.ROMAN_VERY_HARD) { >>>>>>> private EconomyMinister determineMinister(EPlayerType type, ECivilisation civilisation, AiStatistics aiStatistics, Player player) { if (type == EPlayerType.AI_VERY_EASY) { return new AdaptableEconomyMinister(aiStatistics, player); } else if (type == EPlayerType.AI_VERY_HARD) {
<<<<<<< import go.graphics.text.EFontSize; import go.graphics.text.TextDrawer; import java.util.Iterator; ======= >>>>>>> <<<<<<< private final ReplaceableTextDrawer textDrawer; ======= // private long beginTime; >>>>>>> <<<<<<< * Gets the text drawer for the draw context. Use this method instead of the opengl one, because we might override it. * * @param size * The text size * @return A text drawer. */ public TextDrawer getTextDrawer(EFontSize size) { return textDrawer.getTextDrawer(gl, size); } /** ======= >>>>>>> <<<<<<< * Sets up drawing between two tiles. This is e.g. used to draw walking settlers. * * @param startx * The start tile * @param starty * The start tile * @param destinationx * The second tile * @param destinationy * The second tile * @param progress * The progress between those two bytes. */ public void beginBetweenTileContext(int startx, int starty, int destinationx, int destinationy, float progress) { this.gl.glPushMatrix(); float theight = getHeight(startx, starty); float dheight = getHeight(destinationx, destinationy); float x = (1 - progress) * this.converter.getViewX(startx, starty, theight) + progress * this.converter.getViewX(destinationx, destinationy, dheight); float y = (1 - progress) * this.converter.getViewY(startx, starty, theight) + progress * this.converter.getViewY(destinationx, destinationy, dheight); this.gl.glTranslatef(x, y, 0); } /** * Converts a screen rectangle to an area on the map. Map heights are respected. ======= * gets a rect on the screen. >>>>>>> * Sets up drawing between two tiles. This is e.g. used to draw walking settlers. * * @param startx * The start tile * @param starty * The start tile * @param destinationx * The second tile * @param destinationy * The second tile * @param progress * The progress between those two bytes. */ public void beginBetweenTileContext(int startx, int starty, int destinationx, int destinationy, float progress) { this.gl.glPushMatrix(); float theight = getHeight(startx, starty); float dheight = getHeight(destinationx, destinationy); float x = (1 - progress) * this.converter.getViewX(startx, starty, theight) + progress * this.converter.getViewX(destinationx, destinationy, dheight); float y = (1 - progress) * this.converter.getViewY(startx, starty, theight) + progress * this.converter.getViewY(destinationx, destinationy, dheight); this.gl.glTranslatef(x, y, 0); } /** * Converts a screen rectangle to an area on the map. Map heights are respected.
<<<<<<< ======= if (list != null) { list.addListener(this); listChanged(list); } >>>>>>>
<<<<<<< ======= ShortPoint2D closeReachableLocation = findClosestReachablePosition(waypointType, position); >>>>>>> ShortPoint2D closeReachableLocation = findClosestReachablePosition(waypointType, position); <<<<<<< private boolean coastIsReachable(ShortPoint2D position) { boolean waterFound = false; boolean landFound = false; short x = position.x; short y = position.y; final byte[] xDeltaArray = EDirection.getXDeltaArray(); final byte[] yDeltaArray = EDirection.getYDeltaArray(); int distance = 5; for (int direction = 0; direction < EDirection.NUMBER_OF_DIRECTIONS; direction++) { int dx = x + xDeltaArray[direction] * distance; int dy = y + yDeltaArray[direction] * distance; if (grid.getMovableGrid().isInBounds(dx, dy)) { if (grid.getMovableGrid().isWaterSafe(dx, dy)) { waterFound = true; } else { landFound = true; } } } return waterFound && landFound; } private ShortPoint2D findClosestRechablePosition(EWaypointType waypointType, ShortPoint2D targetPosition) { ======= private ShortPoint2D findClosestReachablePosition(EWaypointType waypointType, ShortPoint2D targetPosition) { >>>>>>> private boolean coastIsReachable(ShortPoint2D position) { boolean waterFound = false; boolean landFound = false; short x = position.x; short y = position.y; final byte[] xDeltaArray = EDirection.getXDeltaArray(); final byte[] yDeltaArray = EDirection.getYDeltaArray(); int distance = 5; for (int direction = 0; direction < EDirection.NUMBER_OF_DIRECTIONS; direction++) { int dx = x + xDeltaArray[direction] * distance; int dy = y + yDeltaArray[direction] * distance; if (grid.getMovableGrid().isInBounds(dx, dy)) { if (grid.getMovableGrid().isWaterSafe(dx, dy)) { waterFound = true; } else { landFound = true; } } } return waterFound && landFound; } private ShortPoint2D findClosestRechablePosition(EWaypointType waypointType, ShortPoint2D targetPosition) { <<<<<<< return grid.getClosestReachablePosition(waypointBefore, targetPosition, false, this.isSeaTrading, (byte) 0, WAYPOINT_SEARCH_RADIUS); ======= return grid.getClosestReachablePosition(waypointBefore, targetPosition, false, null, WAYPOINT_SEARCH_RADIUS); >>>>>>> return grid.getClosestReachablePosition(waypointBefore, targetPosition, false, this.isSeaTrading, (byte) 0, WAYPOINT_SEARCH_RADIUS);
<<<<<<< messenger.removeOld(); for (Message m : messenger.getMessages()) { ======= for (IMessage m : messenger.getMessages()) { >>>>>>> messenger.removeOld(); for (IMessage m : messenger.getMessages()) { <<<<<<< public void addMessage(Message message) { boolean printMsg; ======= public void addMessage(IMessage message) { >>>>>>> public void addMessage(IMessage message) { boolean printMsg;
<<<<<<< import jsettlers.logic.map.MapLoader; import jsettlers.logic.map.save.loader.RemakeMapLoader; ======= import org.junit.Ignore; >>>>>>> import org.junit.Ignore; <<<<<<< ======= import jsettlers.logic.map.save.loader.MapLoader; import jsettlers.logic.movable.Movable; >>>>>>> import jsettlers.logic.movable.Movable; <<<<<<< RemakeMapLoader directSavegame = ReplayTool.playGameToTargetTimeAndGetSavegame(targetTimeMinutes, networkConnector, game); ======= MapLoader replayedSavegame = ReplayUtils.replayAndCreateSavegame(directSavegameReplay.getReplayFile(), targetTimeMinutes, REMAINING_REPLAY_FILENAME); >>>>>>> MapLoader replayedSavegame = ReplayUtils.replayAndCreateSavegame(directSavegameReplay.getReplayFile(), targetTimeMinutes, REMAINING_REPLAY_FILENAME); <<<<<<< FileUtils.deleteRecursively(replayFile.getParentFile()); directSavegame.getListedMap().delete(); replayedSavegame.getListedMap().delete(); ======= FileUtils.deleteRecursively(directSavegameReplay.getReplayFile().getParentFile()); savegame.getFile().delete(); savegameOfSavegame.getFile().delete(); >>>>>>> FileUtils.deleteRecursively(directSavegameReplay.getReplayFile().getParentFile()); savegame.getListedMap().delete(); savegameOfSavegame.getListedMap().delete(); <<<<<<< FileUtils.walkFileTree(new File(ResourceManager.getResourcesDirectory(), "logs"), new IFileVisitor() { private long newestModificationTime; ======= final String mapName = "mountain lake"; >>>>>>> final String mapName = "mountain lake";
<<<<<<< @Override public boolean getStockAcceptsMaterial(EMaterialType material) { // TODO Auto-generated method stub return true; } ======= @Override public MaterialProductionSettings getMaterialProductionSettings() { return materialProductionSettings; } >>>>>>> @Override public MaterialProductionSettings getMaterialProductionSettings() { return materialProductionSettings; } @Override public boolean getStockAcceptsMaterial(EMaterialType material) { // TODO Auto-generated method stub return true; }
<<<<<<< import go.graphics.swing.contextcreator.BackendSelector; import go.graphics.swing.contextcreator.GLFWContextCreator; import go.graphics.swing.sound.ISoundSettingsProvider; ======= public class SettingsManager implements ISoundSettingsProvider { private static final String CONFIGURATION_FILE = ".jsettlers"; >>>>>>> import go.graphics.swing.contextcreator.BackendSelector; import go.graphics.swing.contextcreator.GLFWContextCreator; import go.graphics.swing.sound.ISoundSettingsProvider; public class SettingsManager implements ISoundSettingsProvider { private static final String CONFIGURATION_FILE = ".jsettlers"; <<<<<<< public class SettingsManager implements ISoundSettingsProvider { private static final String FILE = ".jsettlers"; public static final String SETTING_UUID = "gid"; public static final String SETTING_USERNAME = "name"; public static final String SETTING_SERVER = "server"; public static final String SETTING_VOLUME = "volume"; public static final String SETTING_BACKEND = "backend"; public static final String FULL_SCREEN_MODE = "fullScreenMode"; public static final String SETTING_FPS_LIMIT = "fpsLimit"; ======= private static final String SETTING_UUID = "gid"; private static final String SETTING_SETTLERS_FOLDER = "settlers-folder"; private static final String SETTING_SETTLERS_VERSION_ID = "settlers-folder-version-id"; >>>>>>> public static final String SETTING_UUID = "gid"; public static final String SETTING_USERNAME = "name"; public static final String SETTING_SERVER = "server"; public static final String SETTING_VOLUME = "volume"; public static final String SETTING_BACKEND = "backend"; public static final String FULL_SCREEN_MODE = "fullScreenMode"; public static final String SETTING_FPS_LIMIT = "fpsLimit"; private static final String SETTING_SETTLERS_FOLDER = "settlers-folder"; private static final String SETTING_SETTLERS_VERSION_ID = "settlers-folder-version-id"; <<<<<<< private String getDefault(String key) { if (SETTING_USERNAME.equals(key)) { return System.getProperty("user.name"); } else if (SETTING_SERVER.equals(key)) { return CommonConstants.DEFAULT_SERVER_ADDRESS; } else if (SETTING_VOLUME.equals(key)) { return 0.7f + ""; } else if(SETTING_FPS_LIMIT.equals(key)) { return "60"; } else if(SETTING_BACKEND.equals(key)) { return BackendSelector.DEFAULT_BACKEND.cc_name; ======= private void loadArguments(String[] args) { Pattern parameterPattern = Pattern.compile("--(.*?)=(.*?)"); Pattern optionPattern = Pattern.compile("--(.*?)"); for (String arg : args) { Matcher parameterMatcher = parameterPattern.matcher(arg); if (parameterMatcher.matches()) { String parameter = parameterMatcher.group(1); String value = parameterMatcher.group(2); runtimeProperties.put(parameter, value); } else { Matcher optionMatcher = optionPattern.matcher(arg); if (optionMatcher.matches()) { String option = optionMatcher.group(1); runtimeProperties.put(option, "true"); } } >>>>>>> private String getDefault(String key) { if (SETTING_USERNAME.equals(key)) { return System.getProperty("user.name"); } else if (SETTING_SERVER.equals(key)) { return CommonConstants.DEFAULT_SERVER_ADDRESS; } else if (SETTING_VOLUME.equals(key)) { return 0.7f + ""; } else if(SETTING_FPS_LIMIT.equals(key)) { return "60"; } else if(SETTING_BACKEND.equals(key)) { return BackendSelector.DEFAULT_BACKEND.cc_name; } } private void loadArguments(String[] args) { Pattern parameterPattern = Pattern.compile("--(.*?)=(.*?)"); Pattern optionPattern = Pattern.compile("--(.*?)"); for (String arg : args) { Matcher parameterMatcher = parameterPattern.matcher(arg); if (parameterMatcher.matches()) { String parameter = parameterMatcher.group(1); String value = parameterMatcher.group(2); runtimeProperties.put(parameter, value); } else { Matcher optionMatcher = optionPattern.matcher(arg); if (optionMatcher.matches()) { String option = optionMatcher.group(1); runtimeProperties.put(option, "true"); } } <<<<<<< public int getFpsLimit() { String fpsLimitString = get(SETTING_FPS_LIMIT); try { int fps_limit = Integer.parseInt(fpsLimitString); return Math.max(Math.min(fps_limit, 240), 1); } catch (NumberFormatException e) { } return 1; } public BackendSelector.BackendItem getBackend() { return BackendSelector.getBackendByName(get(SETTING_BACKEND)); } ======= public void setVolume(float volume) { set(SETTING_VOLUME, Float.toString(volume)); } >>>>>>> public int getFpsLimit() { String fpsLimitString = get(SETTING_FPS_LIMIT); try { int fps_limit = Integer.parseInt(fpsLimitString); return Math.max(Math.min(fps_limit, 240), 1); } catch (NumberFormatException e) { } return 1; } public BackendSelector.BackendItem getBackend() { return BackendSelector.getBackendByName(get(SETTING_BACKEND)); } public void setVolume(float volume) { set(SETTING_VOLUME, Float.toString(volume)); }
<<<<<<< GRASS(0, new Color(0xff00BD16), false, false), DRY_GRASS(1, new Color(0xff82601C), false, false), DESERT(3, new Color(0xffA07038), false, false), ======= GRASS(0, new Color(0xff105910), false, false), DRY_GRASS(1, new Color(0xff105910), false, false), DESERT(18, new Color(0xff949200), false, false), >>>>>>> GRASS(0, new Color(0xff00BD16), false, false), DRY_GRASS(1, new Color(0xff82601C), false, false), DESERT(18, new Color(0xffA07038), false, false), <<<<<<< SNOW(24, new Color(0xffc7dee0), false, true), ======= SNOW(25, new Color(0xffd7fffe), false, true), >>>>>>> SNOW(25, new Color(0xffc7dee0), false, true), <<<<<<< WATER1(17, new Color(0xff107fb9), true, true), WATER2(16, new Color(0xff077cb9), true, true), WATER3(15, new Color(0xff0776b3), true, true), WATER4(14, new Color(0xff0872b0), true, true), WATER5(13, new Color(0xff0371b0), true, true), WATER6(12, new Color(0xff056dad), true, true), WATER7(11, new Color(0xff0a69aa), true, true), WATER8(10, new Color(0xff09609e), true, true), MOOR(7, new Color(0xff003F1C), false, true), MOORINNER(7, new Color(0xff003F1C), false, true), MOORBORDER(9, new Color(0xff003F1C), false, false), ======= WATER1(17, new Color(0xff000073), true, true), WATER2(16, new Color(0xff000073), true, true), WATER3(15, new Color(0xff000073), true, true), WATER4(14, new Color(0xff000073), true, true), WATER5(13, new Color(0xff000073), true, true), WATER6(12, new Color(0xff000073), true, true), WATER7(11, new Color(0xff000073), true, true), WATER8(10, new Color(0xff000073), true, true), MOOR(8, new Color(0xff0e87cc), false, true), // TODO: color MOORINNER(7, new Color(0xff0e87cc), false, true), // TODO: color MOORBORDER(9, new Color(0xff0e87cc), false, false), // TODO: color >>>>>>> WATER1(17, new Color(0xff107fb9), true, true), WATER2(16, new Color(0xff077cb9), true, true), WATER3(15, new Color(0xff0776b3), true, true), WATER4(14, new Color(0xff0872b0), true, true), WATER5(13, new Color(0xff0371b0), true, true), WATER6(12, new Color(0xff056dad), true, true), WATER7(11, new Color(0xff0a69aa), true, true), WATER8(10, new Color(0xff09609e), true, true), MOOR(8, new Color(0xff003F1C), false, true), MOORINNER(7, new Color(0xff003F1C), false, true), MOORBORDER(9, new Color(0xff003F1C), false, false),
<<<<<<< ======= @Override public void drawAt(GLDrawContext gl, DrawBuffer buffer, float viewX, float viewY, int iColor) { super.drawAt(gl, buffer, viewX, viewY, iColor); if (this.torso != null) { this.torso.drawAt(gl, buffer, viewX, viewY, iColor); } if (this.shadow != null) { this.shadow.drawAt(gl, buffer, viewX, viewY, -1); } } @Override public void drawOnlyImageAt(GLDrawContext gl, DrawBuffer buffer, float viewX, float viewY, int iColor) { super.drawAt(gl, buffer, viewX, viewY, iColor); } @Override public void drawOnlyShadowAt(GLDrawContext gl, DrawBuffer buffer, float viewX, float viewY, int iColor) { if (this.shadow != null) { this.shadow.drawAt(gl, buffer, viewX, viewY, -1); } } @Override public void drawAt(GLDrawContext gl, DrawBuffer buffer, float viewX, float viewY, Color color, float multiply) { super.drawAt(gl, buffer, viewX, viewY, dimColor(Color.WHITE, multiply)); if (this.shadow != null) { this.shadow.drawAt(gl, buffer, viewX, viewY, -1); } if (this.torso != null) { this.torso.drawAt(gl, buffer, viewX, viewY, dimColor(color, multiply)); } } >>>>>>> @Override public void drawAt(GLDrawContext gl, float viewX, float viewY, int iColor) { super.drawAt(gl, viewX, viewY, iColor); if (this.torso != null) { this.torso.drawAt(gl, viewX, viewY, iColor); } if (this.shadow != null) { this.shadow.drawAt(gl, viewX, viewY, -1); } } @Override public void drawOnlyImageAt(GLDrawContext gl, float viewX, float viewY, int iColor) { super.drawAt(gl, viewX, viewY, iColor); } @Override public void drawOnlyShadowAt(GLDrawContext gl, float viewX, float viewY, int iColor) { if (this.shadow != null) { this.shadow.drawAt(gl, viewX, viewY, -1); } }
<<<<<<< settingsManager.set(SettingsManager.SETTING_USERNAME, playerNameField.getText()); settingsManager.set(SettingsManager.SETTING_VOLUME, (volumeSlider.getValue() / 100D) + ""); settingsManager.set(SettingsManager.SETTING_FPS_LIMIT, fpsLimitSlider.getValue() + ""); settingsManager.set(SettingsManager.SETTING_BACKEND, backendSelector.getSelectedItem() + ""); ======= settingsManager.setUserName(playerNameField.getText()); settingsManager.setVolume(volumeSlider.getValue() / 100f); >>>>>>> settingsManager.setUserName(playerNameField.getText()); settingsManager.setVolume(volumeSlider.getValue() / 100f); settingsManager.set(SettingsManager.SETTING_FPS_LIMIT, fpsLimitSlider.getValue() + ""); settingsManager.set(SettingsManager.SETTING_BACKEND, backendSelector.getSelectedItem() + "");
<<<<<<< import static jsettlers.common.movable.EMovableType.DEFAULT_HEALTH; import java.util.ArrayList; import java.util.Collections; import java.util.ConcurrentModificationException; ======= >>>>>>> import static jsettlers.common.movable.EMovableType.DEFAULT_HEALTH; import java.util.ArrayList; import java.util.Collections; import java.util.ConcurrentModificationException; <<<<<<< private static final int SHIP_IMAGE_FILE = 36; private static final int FERRY_BASE_SEQUENCE = 4; private static final int CARGO_SHIP_BASE_SEQUENCE = 0; ======= private static final int SMOKE_HEIGHT = 30; >>>>>>> private static final int SHIP_IMAGE_FILE = 36; private static final int FERRY_BASE_SEQUENCE = 4; private static final int CARGO_SHIP_BASE_SEQUENCE = 0; private static final int SMOKE_HEIGHT = 30;
<<<<<<< private void occupyMilitaryBuildings() { for (ShortPoint2D militaryBuildingPosition : aiStatistics.getBuildingPositionsOfTypesForPlayer( EBuildingType.getMilitaryBuildings(), playerId)) { OccupyingBuilding militaryBuilding = (OccupyingBuilding) aiStatistics.getBuildingAt(militaryBuildingPosition); if (militaryBuilding.getStateProgress() == 1 && !militaryBuilding.isOccupied()) { ShortPoint2D door = militaryBuilding.getDoor(); Movable soldier = aiStatistics.getNearestSwordsmanOf(door, playerId); if (soldier != null && militaryBuilding.getPos().getOnGridDistTo(soldier.getPos()) > TOWER_SEARCH_RADIUS) { ======= private void occupyTowers() { for (ShortPoint2D towerPosition : aiStatistics.getBuildingPositionsOfTypeForPlayer(TOWER, playerId)) { OccupyingBuilding tower = (OccupyingBuilding) aiStatistics.getBuildingAt(towerPosition); if (tower.getStateProgress() == 1 && !tower.isOccupied()) { ShortPoint2D door = tower.getDoor(); IMovable soldier = aiStatistics.getNearestSwordsmanOf(door, playerId); if (soldier != null && tower.getPos().getOnGridDistTo(soldier.getPos()) > TOWER_SEARCH_RADIUS) { >>>>>>> private void occupyMilitaryBuildings() { for (ShortPoint2D militaryBuildingPosition : aiStatistics.getBuildingPositionsOfTypesForPlayer( EBuildingType.getMilitaryBuildings(), playerId)) { OccupyingBuilding militaryBuilding = (OccupyingBuilding) aiStatistics.getBuildingAt(militaryBuildingPosition); if (militaryBuilding.getStateProgress() == 1 && !militaryBuilding.isOccupied()) { ShortPoint2D door = militaryBuilding.getDoor(); IMovable soldier = aiStatistics.getNearestSwordsmanOf(door, playerId); if (soldier != null && militaryBuilding.getPos().getOnGridDistTo(soldier.getPos()) > TOWER_SEARCH_RADIUS) { <<<<<<< if (type.isMilitaryBuilding()) { Movable soldier = aiStatistics.getNearestSwordsmanOf(position, playerId); ======= if (type == TOWER) { IMovable soldier = aiStatistics.getNearestSwordsmanOf(position, playerId); >>>>>>> if (type.isMilitaryBuilding()) { IMovable soldier = aiStatistics.getNearestSwordsmanOf(position, playerId);
<<<<<<< ======= import jsettlers.common.buildings.EBuildingType; import jsettlers.common.images.EImageLinkType; import jsettlers.common.images.OriginalImageLink; >>>>>>> import jsettlers.common.images.EImageLinkType; import jsettlers.common.images.OriginalImageLink; <<<<<<< /** * Somewhere to fire actions to. */ private ActionFireable actionFireable; public MainPanel(ActionFireable actionFireable) { this.actionFireable = actionFireable; layoutPanel(ControlPanelLayoutProperties.getLayoutPropertiesFor(480)); } ======= public MainPanel() { btnSystem = new TabButton(quitPrompt, new OriginalImageLink(EImageLinkType.GUI, BUTTONS_FILE, 93, 0), new OriginalImageLink(EImageLinkType.GUI, BUTTONS_FILE, 96, 0), "game-quit-description"); >>>>>>> /** * Somewhere to fire actions to. */ private ActionFireable actionFireable; public MainPanel(ActionFireable actionFireable) { this.actionFireable = actionFireable; <<<<<<< ======= private void initTabbar1() { int i = 0; UIPanel tabbar1 = new UIPanel(); this.addChild(tabbar1, 0, constants.UI_TABS1_BOTTOM, 1, constants.UI_TABS1_TOP); Button[] buttons = new Button[] { button_build, button_goods, button_settlers }; for (Button button : buttons) { float left = constants.UI_TABS1_SIDEMARGIN + i * (constants.UI_TABS1_WIDTH + constants.UI_TABS1_SPACING); tabbar1.addChild(button, left, 0, left + constants.UI_TABS1_WIDTH, 1); i++; } } private void initTabbar2() { this.addChild(tabpanel, 0, constants.UI_TABS2_BOTTOM, 1, constants.UI_TABS2_TOP); } private void addSystemButton() { this.addChild( btnSystem, constants.SYSTEM_BUTTON_LEFT, constants.SYSTEM_BUTTON_BOTTOM, constants.SYSTEM_BUTTON_RIGHT, constants.SYSTEM_BUTTON_TOP ); btnSystem.setActive(true); // Show as inactive until the functionality has been implemented } private void addLowerTabBar() { UIPanel lowerTabBar = new UIPanel(); Button[] buttons = new Button[] { btnScroll, btnSwords, btnSignPost, btnPots }; int i = 0; for (Button button : buttons) { float left = constants.LOWER_TABS_LEFT + (i++ * constants.LOWER_TABS_WIDTH); lowerTabBar.addChild(button, left, 0, left + constants.LOWER_TABS_WIDTH, 1); } this.addChild(lowerTabBar, 0, constants.LOWER_TABS_BOTTOM, 1, constants.LOWER_TABS_TOP); } public void displayBuildingBuild(EBuildingType type) { activeBuilding = type; activeContent.displayBuildingBuild(type); } >>>>>>> private void initTabbar1() { int i = 0; UIPanel tabbar1 = new UIPanel(); this.addChild(tabbar1, 0, constants.UI_TABS1_BOTTOM, 1, constants.UI_TABS1_TOP); Button[] buttons = new Button[] { button_build, button_goods, button_settlers }; for (Button button : buttons) { float left = constants.UI_TABS1_SIDEMARGIN + i * (constants.UI_TABS1_WIDTH + constants.UI_TABS1_SPACING); tabbar1.addChild(button, left, 0, left + constants.UI_TABS1_WIDTH, 1); i++; } } private void initTabbar2() { this.addChild(tabpanel, 0, constants.UI_TABS2_BOTTOM, 1, constants.UI_TABS2_TOP); } private void addSystemButton() { this.addChild( btnSystem, constants.SYSTEM_BUTTON_LEFT, constants.SYSTEM_BUTTON_BOTTOM, constants.SYSTEM_BUTTON_RIGHT, constants.SYSTEM_BUTTON_TOP ); btnSystem.setActive(true); // Show as inactive until the functionality has been implemented } private void addLowerTabBar() { UIPanel lowerTabBar = new UIPanel(); Button[] buttons = new Button[] { btnScroll, btnSwords, btnSignPost, btnPots }; int i = 0; for (Button button : buttons) { float left = constants.LOWER_TABS_LEFT + (i++ * constants.LOWER_TABS_WIDTH); lowerTabBar.addChild(button, left, 0, left + constants.LOWER_TABS_WIDTH, 1); } this.addChild(lowerTabBar, 0, constants.LOWER_TABS_BOTTOM, 1, constants.LOWER_TABS_TOP); }
<<<<<<< /** * Creates a new attacked-message. * * @param otherplayer * The attacking player * @param pos * The position that player attacked on. * @return THe message. */ public static Message attacked(byte otherplayer, ShortPoint2D pos) { ======= public static IMessage attacked(byte otherplayer, ShortPoint2D pos) { >>>>>>> /** * Creates a new attacked-message. * * @param otherplayer * The attacking player * @param pos * The position that player attacked on. * @return THe message. */ public static IMessage attacked(byte otherplayer, ShortPoint2D pos) { <<<<<<< /** * Create a new message if a geologist found minerals. * * @param type * The type of minerals. * @param pos * The position * @return The message object */ public static Message foundMinerals(EMaterialType type, ShortPoint2D pos) { ======= public static IMessage foundMinerals(EMaterialType type, ShortPoint2D pos) { >>>>>>> /** * Create a new message if a geologist found minerals. * * @param type * The type of minerals. * @param pos * The position * @return The message object */ public static IMessage foundMinerals(EMaterialType type, ShortPoint2D pos) { <<<<<<< /** * Create a new message that a building cannot find any more work. * * @param building * The building * @return THe message object */ public static Message cannotFindWork(IBuilding building) { ======= public static IMessage cannotFindWork(IBuilding building) { >>>>>>> /** * Create a new message that a building cannot find any more work. * * @param building * The building * @return THe message object */ public static IMessage cannotFindWork(IBuilding building) {
<<<<<<< String indicesPrefix = testName.getSanitizedMethodName(); ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix); ======= String indicesPrefix = getSanitizedMethodName(); ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix); >>>>>>> String indicesPrefix = testName.getSanitizedMethodName(); ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix);
<<<<<<< import jsettlers.common.menu.IGameExitListener; import jsettlers.common.menu.IStartedGame; import jsettlers.common.menu.action.EActionType; import jsettlers.graphics.action.Action; ======= import jsettlers.common.action.EActionType; import jsettlers.common.action.Action; >>>>>>> import jsettlers.common.action.Action; import jsettlers.common.action.EActionType; import jsettlers.common.menu.IGameExitListener; import jsettlers.common.menu.IStartedGame;
<<<<<<< ======= import java.io.IOException; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; >>>>>>> <<<<<<< Collection<String> r = accountPatchReviewStore.get().findReviewed(resource.getPatchSet().getId(), userId); if (r.isEmpty() && 1 < resource.getPatchSet().getPatchSetId()) { for (PatchSet ps : reversePatchSets(resource)) { Collection<String> o = accountPatchReviewStore.get().findReviewed(ps.getId(), userId); if (!o.isEmpty()) { try { r = copy(Sets.newHashSet(o), ps.getId(), resource, userId); } catch (IOException | PatchListNotAvailableException e) { log.warn("Cannot copy patch review flags", e); } break; } ======= PatchSet patchSetId = resource.getPatchSet(); Optional<PatchSetWithReviewedFiles> o = accountPatchReviewStore.get() .findReviewed(patchSetId.getId(), userId); if (o.isPresent()) { PatchSetWithReviewedFiles res = o.get(); if (res.patchSetId().equals(patchSetId.getId())) { return res.files(); >>>>>>> PatchSet patchSetId = resource.getPatchSet(); Optional<PatchSetWithReviewedFiles> o = accountPatchReviewStore.get().findReviewed(patchSetId.getId(), userId); if (o.isPresent()) { PatchSetWithReviewedFiles res = o.get(); if (res.patchSetId().equals(patchSetId.getId())) { return res.files(); <<<<<<< private List<PatchSet> reversePatchSets(RevisionResource resource) throws OrmException { Collection<PatchSet> patchSets = psUtil.byChange(db.get(), resource.getNotes()); List<PatchSet> list = (patchSets instanceof List) ? (List<PatchSet>) patchSets : new ArrayList<>(patchSets); return Lists.reverse(list); ======= return Collections.emptyList(); >>>>>>> return Collections.emptyList();
<<<<<<< ======= * @param elasticsearchEntityFactory >>>>>>> * @param elasticsearchEntityFactory
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< private AttributeMetaData idAttr; private AttributeMetaData xrefAttr; private AttributeMetaData nillableXrefAttr; private AttributeMetaData mrefAttr; private AttributeMetaData nillableMrefAttr; private AttributeMetaData uniqueStringAttr; private AttributeMetaData uniqueXrefAttr; private EntityType entityType; ======= private Attribute idAttr; private Attribute xrefAttr; private Attribute nillableXrefAttr; private Attribute mrefAttr; private Attribute nillableMrefAttr; private Attribute uniqueStringAttr; private Attribute uniqueXrefAttr; private EntityMetaData entityMeta; >>>>>>> private Attribute idAttr; private Attribute xrefAttr; private Attribute nillableXrefAttr; private Attribute mrefAttr; private Attribute nillableMrefAttr; private Attribute uniqueStringAttr; private Attribute uniqueXrefAttr; private EntityType entityType; <<<<<<< xrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(attrXrefName).getMock(); when(xrefAttr.getRefEntity()).thenReturn(refEntityType); ======= xrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrXrefName).getMock(); when(xrefAttr.getRefEntity()).thenReturn(refEntityMeta); >>>>>>> xrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrXrefName).getMock(); when(xrefAttr.getRefEntity()).thenReturn(refEntityType); <<<<<<< nillableXrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(attrNillableXrefName).getMock(); when(nillableXrefAttr.getRefEntity()).thenReturn(refEntityType); ======= nillableXrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrNillableXrefName).getMock(); when(nillableXrefAttr.getRefEntity()).thenReturn(refEntityMeta); >>>>>>> nillableXrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrNillableXrefName).getMock(); when(nillableXrefAttr.getRefEntity()).thenReturn(refEntityType); <<<<<<< mrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(attrMrefName).getMock(); when(mrefAttr.getRefEntity()).thenReturn(refEntityType); ======= mrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrMrefName).getMock(); when(mrefAttr.getRefEntity()).thenReturn(refEntityMeta); >>>>>>> mrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrMrefName).getMock(); when(mrefAttr.getRefEntity()).thenReturn(refEntityType); <<<<<<< nillableMrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(attrNillableMrefName).getMock(); when(nillableMrefAttr.getRefEntity()).thenReturn(refEntityType); ======= nillableMrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrNillableMrefName).getMock(); when(nillableMrefAttr.getRefEntity()).thenReturn(refEntityMeta); >>>>>>> nillableMrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrNillableMrefName).getMock(); when(nillableMrefAttr.getRefEntity()).thenReturn(refEntityType); <<<<<<< uniqueXrefAttr = when(mock(AttributeMetaData.class).getName()).thenReturn(attrUniqueXrefName).getMock(); when(uniqueXrefAttr.getRefEntity()).thenReturn(refEntityType); ======= uniqueXrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrUniqueXrefName).getMock(); when(uniqueXrefAttr.getRefEntity()).thenReturn(refEntityMeta); >>>>>>> uniqueXrefAttr = when(mock(Attribute.class).getName()).thenReturn(attrUniqueXrefName).getMock(); when(uniqueXrefAttr.getRefEntity()).thenReturn(refEntityType);
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataFactory; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeFactory; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeFactory; <<<<<<< targetAttributeMetaData.setRefEntity(targetRefEntityType); ======= targetAttribute.setRefEntity(targetRefEntityMeta); >>>>>>> targetAttribute.setRefEntity(targetRefEntityType); <<<<<<< targetEntityType = entityTypeFactory.create("target"); targetEntityType.addAttribute(targetAttributeMetaData); ======= targetEntityMetaData = entityMetaFactory.create("target"); targetEntityMetaData.addAttribute(targetAttribute); >>>>>>> targetEntityType = entityTypeFactory.create("target"); targetEntityType.addAttribute(targetAttribute); <<<<<<< sourceAttributeMetaData.setRefEntity(sourceRefEntityType); ======= sourceAttribute.setRefEntity(sourceRefEntityMetaData); >>>>>>> sourceAttribute.setRefEntity(sourceRefEntityType); <<<<<<< sourceEntityType = entityTypeFactory.create("source"); sourceEntityType.addAttributes(Lists.newArrayList(sourceAttributeMetaData)); ======= sourceEntityMetaData = entityMetaFactory.create("source"); sourceEntityMetaData.addAttributes(Lists.newArrayList(sourceAttribute)); >>>>>>> sourceEntityType = entityTypeFactory.create("source"); sourceEntityType.addAttributes(Lists.newArrayList(sourceAttribute)); <<<<<<< .generate(targetAttributeMetaData, singletonList(sourceAttributeMetaData), targetEntityType, sourceEntityType); ======= .generate(targetAttribute, singletonList(sourceAttribute), targetEntityMetaData, sourceEntityMetaData); >>>>>>> .generate(targetAttribute, singletonList(sourceAttribute), targetEntityType, sourceEntityType); <<<<<<< targetAttributeMetaData = attrMetaFactory.create().setName("History of Hypertension").setDataType(CATEGORICAL); targetAttributeMetaData.setRefEntity(targetRefEntityType); ======= targetAttribute = attrMetaFactory.create().setName("History of Hypertension").setDataType(CATEGORICAL); targetAttribute.setRefEntity(targetRefEntityMeta); >>>>>>> targetAttribute = attrMetaFactory.create().setName("History of Hypertension").setDataType(CATEGORICAL); targetAttribute.setRefEntity(targetRefEntityType); <<<<<<< EntityType targetRefEntityType = entityTypeFactory.create(entityName); AttributeMetaData targetCodeAttributeMetaData = attrMetaFactory.create().setName("code").setDataType(INT); AttributeMetaData targetLabelAttributeMetaData = attrMetaFactory.create().setName("label"); targetRefEntityType.addAttribute(targetCodeAttributeMetaData, ROLE_ID); targetRefEntityType.addAttribute(targetLabelAttributeMetaData, ROLE_LABEL); return targetRefEntityType; ======= EntityMetaData targetRefEntityMetaData = entityMetaFactory.create(entityName); Attribute targetCodeAttribute = attrMetaFactory.create().setName("code").setDataType(INT); Attribute targetLabelAttribute = attrMetaFactory.create().setName("label"); targetRefEntityMetaData.addAttribute(targetCodeAttribute, ROLE_ID); targetRefEntityMetaData.addAttribute(targetLabelAttribute, ROLE_LABEL); return targetRefEntityMetaData; >>>>>>> EntityType targetRefEntityType = entityTypeFactory.create(entityName); Attribute targetCodeAttribute = attrMetaFactory.create().setName("code").setDataType(INT); Attribute targetLabelAttribute = attrMetaFactory.create().setName("label"); targetRefEntityType.addAttribute(targetCodeAttribute, ROLE_ID); targetRefEntityType.addAttribute(targetLabelAttribute, ROLE_LABEL); return targetRefEntityType;
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< AttributeMetaData targetAttributeMetaData = targetEntityType.getAttribute(targetAttributeName); AttributeMapping attributeMapping = new AttributeMapping(targetAttributeMetaData); ======= Attribute targetAttribute = targetEntityMetaData.getAttribute(targetAttributeName); AttributeMapping attributeMapping = new AttributeMapping(targetAttribute); >>>>>>> Attribute targetAttribute = targetEntityType.getAttribute(targetAttributeName); AttributeMapping attributeMapping = new AttributeMapping(targetAttribute);
<<<<<<< import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Objects.requireNonNull; import static org.molgenis.dataexplorer.controller.AnnotatorController.URI; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; ======= import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Objects.requireNonNull; import static org.molgenis.dataexplorer.controller.AnnotatorController.URI; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.StringJoiner; import java.util.UUID; import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest; import org.apache.commons.lang3.RandomStringUtils; >>>>>>> import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.Objects.requireNonNull; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.UUID; import java.util.stream.Collectors; import javax.servlet.http.HttpServletRequest;
<<<<<<< Modes.I.swift(), ======= Modes.I.tcl(), >>>>>>> Modes.I.swift(), Modes.I.tcl(),
<<<<<<< jobExecution.setUser(me); jobExecution.setStatus(JobExecution.Status.PENDING); jobExecution.setType("AnnotatorJob"); jobExecution.setSubmissionDate(date); jobExecution.setStartDate(date); jobExecution.setProgressInt(50); jobExecution.setProgressMax(1032); Gson gson = new GsonBuilder().registerTypeAdapter(JobExecution.class, new EntitySerializer()) ======= me.setId("AAAAA"); jobMetaData.setUser(me); jobMetaData.setStatus(JobMetaData.Status.PENDING); jobMetaData.setType("AnnotatorJob"); jobMetaData.setSubmissionDate(date); jobMetaData.setStartDate(date); jobMetaData.setProgressInt(50); jobMetaData.setProgressMax(1032); Gson gson = new GsonBuilder().registerTypeAdapter(JobMetaData.class, new EntitySerializer()) >>>>>>> me.setId("AAAAA"); jobExecution.setUser(me); jobExecution.setStatus(JobExecution.Status.PENDING); jobExecution.setType("AnnotatorJob"); jobExecution.setSubmissionDate(date); jobExecution.setStartDate(date); jobExecution.setProgressInt(50); jobExecution.setProgressMax(1032); Gson gson = new GsonBuilder().registerTypeAdapter(JobExecution.class, new EntitySerializer()) <<<<<<< assertEquals(gson.toJson(jobExecution), "{\"__entityName\":\"JobExecution\",\"identifier\":\"AAAABDASDFR\",\"user\":\"fdlk\",\"status\":\"PENDING\",\"type\":\"AnnotatorJob\",\"submissionDate\":\"2016-02-19T13:33:09+0100\",\"startDate\":\"2016-02-19T13:33:09+0100\",\"endDate\":\"2016-02-19T13:33:09+0100\",\"progressInt\":50,\"progressMax\":1032,\"progressMessage\":\"Annotating with SnpEff, Exac, CADD, Clinvar, Dann, CGD, Fitcon, GoNL, HPO, and many more.... %p\"}"); ======= assertEquals(gson.toJson(jobMetaData), "{\"__entityName\":\"JobMetaData\",\"identifier\":\"AAAABDASDFR\",\"user\":{\"__entityName\":\"MolgenisUser\",\"__idValue\":\"AAAAA\",\"__labelValue\":\"fdlk\"},\"status\":\"PENDING\",\"type\":\"AnnotatorJob\",\"submissionDate\":\"2016-02-19T13:33:09+0100\",\"startDate\":\"2016-02-19T13:33:09+0100\",\"endDate\":\"2016-02-19T13:33:09+0100\",\"progressInt\":50,\"progressMax\":1032,\"progressMessage\":\"Annotating with SnpEff, Exac, CADD, Clinvar, Dann, CGD, Fitcon, GoNL, HPO, and many more.... %p\"}"); >>>>>>> assertEquals(gson.toJson(jobExecution), "{\"__entityName\":\"JobExecution\",\"identifier\":\"AAAABDASDFR\",\"user\":\"fdlk\",\"status\":\"PENDING\",\"type\":\"AnnotatorJob\",\"submissionDate\":\"2016-02-19T13:33:09+0100\",\"startDate\":\"2016-02-19T13:33:09+0100\",\"endDate\":\"2016-02-19T13:33:09+0100\",\"progressInt\":50,\"progressMax\":1032,\"progressMessage\":\"Annotating with SnpEff, Exac, CADD, Clinvar, Dann, CGD, Fitcon, GoNL, HPO, and many more.... %p\"}");
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.EntityType; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.EntityType; <<<<<<< EntityType emd = when(mock(EntityType.class).getName()).thenReturn("Person").getMock(); AttributeMetaData nameAttr = when(mock(AttributeMetaData.class).getName()).thenReturn("name").getMock(); ======= EntityMetaData emd = when(mock(EntityMetaData.class).getName()).thenReturn("Person").getMock(); Attribute nameAttr = when(mock(Attribute.class).getName()).thenReturn("name").getMock(); >>>>>>> EntityType entityType = when(mock(EntityType.class).getName()).thenReturn("Person").getMock(); Attribute nameAttr = when(mock(Attribute.class).getName()).thenReturn("name").getMock();
<<<<<<< LOG.error("Error handling EmxImportJob", e); writer.rollbackSchemaChanges(job); ======= try { writer.rollbackSchemaChanges(job); } catch (Exception ignore) { } >>>>>>> LOG.error("Error handling EmxImportJob", e); try { writer.rollbackSchemaChanges(job); } catch (Exception ignore) { }
<<<<<<< import org.molgenis.data.meta.model.AttributeMetaData; import org.molgenis.data.meta.model.AttributeMetaDataMetaData; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeMetadata; ======= import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeMetadata; import org.molgenis.data.meta.model.EntityMetaData; import org.molgenis.data.meta.model.EntityMetaDataMetaData; >>>>>>> import org.molgenis.data.meta.model.Attribute; import org.molgenis.data.meta.model.AttributeMetadata; import org.molgenis.data.meta.model.EntityType; import org.molgenis.data.meta.model.EntityTypeMetadata; <<<<<<< AttributeMetaData toUpdateAttribute = entityTypeDynamic.getAttribute(EntityTestHarness.ATTR_EMAIL); ======= Attribute toUpdateAttribute = entityMetaDataDynamic.getAttribute(EntityTestHarness.ATTR_EMAIL); >>>>>>> Attribute toUpdateAttribute = entityTypeDynamic.getAttribute(EntityTestHarness.ATTR_EMAIL); <<<<<<< EntityType emdActual = metaDataService.getEntityType(AttributeMetaDataMetaData.ATTRIBUTE_META_DATA); q2.eq(AttributeMetaDataMetaData.IDENTIFIER, toUpdateAttributeId); ======= EntityMetaData emdActual = metaDataService.getEntityMetaData(AttributeMetadata.ATTRIBUTE_META_DATA); q2.eq(AttributeMetadata.IDENTIFIER, toUpdateAttributeId); >>>>>>> EntityType emdActual = metaDataService.getEntityType(AttributeMetadata.ATTRIBUTE_META_DATA); q2.eq(AttributeMetadata.IDENTIFIER, toUpdateAttributeId); <<<<<<< EntityType emdActual = metaDataService.getEntityType(AttributeMetaDataMetaData.ATTRIBUTE_META_DATA); q2.eq(AttributeMetaDataMetaData.IDENTIFIER, toRemoveAttribute.getIdValue()); ======= EntityMetaData emdActual = metaDataService.getEntityMetaData(AttributeMetadata.ATTRIBUTE_META_DATA); q2.eq(AttributeMetadata.IDENTIFIER, toRemoveAttribute.getIdValue()); >>>>>>> EntityType emdActual = metaDataService.getEntityType(AttributeMetadata.ATTRIBUTE_META_DATA); q2.eq(AttributeMetadata.IDENTIFIER, toRemoveAttribute.getIdValue());
<<<<<<< // Only add attributes that do not already exist. We assume existing attributes are added in a previous annotation run. // This is a potential risk if an attribute with that name already exist that was not added by the annotator. // This risk is relatively low since annotator attributes are prefixed. attributes = attributes.stream().filter(attribute -> entityType.getAttribute(attribute.getName()) == null) .collect(Collectors.toList()); ======= // Only add attributes that do not already exist. We assume existing attributes are added in a previous annotation run. // This is a potential risk if an attribute with that name already exist that was not added by the annotator. // This risk is relatively low since annotator attributes are prefixed. attributes = attributes.stream().filter(attribute -> entityType.getAttribute(attribute.getName()) == null) .collect(toList()); >>>>>>> // Only add attributes that do not already exist. We assume existing attributes are added in a previous annotation run. // This is a potential risk if an attribute with that name already exist that was not added by the annotator. // This risk is relatively low since annotator attributes are prefixed. attributes = attributes.stream().filter(attribute -> entityType.getAttribute(attribute.getName()) == null) .collect(toList()); <<<<<<< ======= /** * Adds a new compound attribute to an existing CrudRepository * * @param annotator the annotator to be runned * @param vcfAttributes utility class for vcf metadata * @param entityTypeFactory factory for molgenis entityType * @param attributeFactory factory for molgenis entityType * @param vcfUtils utility class for working with vcf data in molgenis * @param inputVcfFile the vcf file to be annotated * @param outputVCFFile the resulting, annotated vcf file * @param attributesToInclude the attributes of the annotator that should be written to the result * @param update boolean indicating if values already present for the annotator attributes should be updated(true) or overwritten (false) * @return the path of the result vcf file * @throws IOException, * @throws MolgenisInvalidFormatException */ public static String annotate(RepositoryAnnotator annotator, VcfAttributes vcfAttributes, EntityTypeFactory entityTypeFactory, AttributeFactory attributeFactory, VcfUtils vcfUtils, File inputVcfFile, File outputVCFFile, List<String> attributesToInclude, boolean update) throws IOException, MolgenisInvalidFormatException { try (BufferedWriter outputVCFWriter = new BufferedWriter( new OutputStreamWriter(new FileOutputStream(outputVCFFile), UTF_8)); VcfRepository vcfRepo = new VcfRepository(inputVcfFile, inputVcfFile.getName(), vcfAttributes, entityTypeFactory, attributeFactory)) { List<Attribute> outputMetaData = getOutputAttributeMetadatasForAnnotator(annotator, entityTypeFactory, attributeFactory, attributesToInclude, vcfRepo); VcfWriterUtils .writeVcfHeader(inputVcfFile, outputVCFWriter, getAtomicAttributesFromList(outputMetaData), attributesToInclude); Iterable<Entity> entitiesToAnnotate = addAnnotatorMetaDataToRepository(annotator, attributeFactory, vcfUtils, vcfRepo); Iterator<Entity> annotatedRecords = annotateRepo(annotator, vcfUtils, update, entitiesToAnnotate); writeAnnotationResultToVcfFile(attributesToInclude, outputVCFWriter, outputMetaData, annotatedRecords); } return outputVCFFile.getAbsolutePath(); } private static Iterator<Entity> annotateRepo(RepositoryAnnotator annotator, VcfUtils vcfUtils, boolean update, Iterable<Entity> entitiesToAnnotate) { Iterator<Entity> annotatedRecords = annotator.annotate(entitiesToAnnotate, update); if (annotator instanceof RefEntityAnnotator || annotator instanceof EffectsAnnotator) { annotatedRecords = vcfUtils.reverseXrefMrefRelation(annotatedRecords); } return annotatedRecords; } private static Iterable<Entity> addAnnotatorMetaDataToRepository(RepositoryAnnotator annotator, AttributeFactory attributeFactory, VcfUtils vcfUtils, VcfRepository vcfRepo) { addAnnotatorAttributesToInfoAttribute(annotator, vcfRepo); Iterable<Entity> entitiesToAnnotate; // Check if annotator is annotator that annotates effects (for example Gavin) if (annotator instanceof EffectsAnnotator) { entitiesToAnnotate = vcfUtils.createEntityStructureForVcf(vcfRepo.getEntityType(), EFFECT, stream(vcfRepo.spliterator(), false)); // Add metadata to repository that will be annotated, instead of repository with variants if (entitiesToAnnotate.iterator().hasNext()) { entitiesToAnnotate.iterator().next().getEntityType().addAttributes(annotator.getOutputAttributes()); } } else { AnnotatorUtils.addAnnotatorMetaDataToRepositories(vcfRepo.getEntityType(), attributeFactory, annotator); entitiesToAnnotate = vcfRepo; } return entitiesToAnnotate; } private static void writeAnnotationResultToVcfFile(List<String> attributesToInclude, BufferedWriter outputVCFWriter, List<Attribute> outputMetaData, Iterator<Entity> annotatedRecords) throws IOException { while (annotatedRecords.hasNext()) { // annotation starts here Entity annotatedRecord = annotatedRecords.next(); writeToVcf(annotatedRecord, getAtomicAttributesFromList(outputMetaData), attributesToInclude, outputVCFWriter); outputVCFWriter.newLine(); } } private static void addAnnotatorAttributesToInfoAttribute(RepositoryAnnotator annotator, VcfRepository vcfRepo) { EntityType entityType = vcfRepo.getEntityType(); Attribute infoAttribute = entityType.getAttribute(VcfAttributes.INFO); for (Attribute attribute : annotator.getOutputAttributes()) { for (Attribute atomicAttribute : attribute.getChildren()) { atomicAttribute.setParent(infoAttribute); entityType.addAttribute(atomicAttribute); } } } private static List<Attribute> getOutputAttributeMetadatasForAnnotator(RepositoryAnnotator annotator, EntityTypeFactory entityTypeFactory, AttributeFactory attributeFactory, List<String> attributesToInclude, VcfRepository vcfRepo) { if (!attributesToInclude.isEmpty()) { checkSelectedOutputAttributeNames(annotator, attributesToInclude, vcfRepo); } // If the annotator e.g. SnpEff creates an external repository, collect the output metadata into an mref // entity // This allows for the header to be written as 'EFFECT annotations: <ouput_attributes> | <ouput_attributes>' List<Attribute> outputMetaData = newArrayList(); if (annotator instanceof RefEntityAnnotator || annotator instanceof EffectsAnnotator) { EntityType effectRefEntity = entityTypeFactory.create().setName(annotator.getSimpleName() + "_EFFECTS"); for (Attribute outputAttribute : annotator.getOutputAttributes()) { effectRefEntity.addAttribute(outputAttribute); } Attribute effect = attributeFactory.create().setName(EFFECT); effect.setDataType(MREF).setRefEntity(effectRefEntity); outputMetaData.add(effect); } else { outputMetaData = annotator.getOutputAttributes(); } return outputMetaData; } private static void checkSelectedOutputAttributeNames(RepositoryAnnotator annotator, List<String> attributesToInclude, VcfRepository vcfRepo) { // Check attribute names List<String> outputAttributeNames = getAtomicAttributesFromList(annotator.getOutputAttributes()) .stream().map(Attribute::getName).collect(toList()); List<String> inputAttributeNames = getAtomicAttributesFromList(vcfRepo.getEntityType().getAtomicAttributes()).stream() .map(Attribute::getName).collect(toList()); for (Object attrName : attributesToInclude) { if (!outputAttributeNames.contains(attrName)) { throw new RuntimeException("Unknown output attribute '" + attrName + "'"); } else if (inputAttributeNames.contains(attrName)) { throw new RuntimeException("The output attribute '" + attrName + "' is present in the inputfile, but is deselected in the current run, this is not supported"); } } } >>>>>>>