conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
public TransitMode getTransitMode() {
return pattern.mode;
=======
public TraverseMode getTransitMode() {
return pattern.getMode();
>>>>>>>
public TransitMode getTransitMode() {
return pattern.getMode(); |
<<<<<<<
weight = slopeSpeedEffectiveLength / options.speed;
} else if (options.getModes().contains(TraverseMode.BICYCLE)) {
switch (options.optimize) {
=======
weight = slopeSpeedEffectiveLength / speed;
} else if (s0.getNonTransitMode(options).equals(TraverseMode.BICYCLE)) {
switch (options.optimizeFor) {
>>>>>>>
weight = slopeSpeedEffectiveLength / speed;
} else if (s0.getNonTransitMode(options).equals(TraverseMode.BICYCLE)) {
switch (options.optimize) { |
<<<<<<<
options.optimize = OptimizeType.TRIANGLE;
options.speed = 6.0;
=======
options.optimizeFor = OptimizeType.TRIANGLE;
options.setBikeSpeed(6.0);
>>>>>>>
options.optimize = OptimizeType.TRIANGLE;
options.setBikeSpeed(6.0); |
<<<<<<<
=======
import com.google.gerrit.server.restapi.change.CommentJson.CommentFormatter;
import com.google.gwtorm.server.OrmException;
>>>>>>>
import com.google.gerrit.server.restapi.change.CommentJson.CommentFormatter;
<<<<<<<
private final ChangeData.Factory changeDataFactory;
private final Provider<CommentJson> commentJson;
private final CommentsUtil commentsUtil;
=======
protected final Provider<ReviewDb> db;
protected final ChangeData.Factory changeDataFactory;
protected final Provider<CommentJson> commentJson;
protected final CommentsUtil commentsUtil;
>>>>>>>
protected final ChangeData.Factory changeDataFactory;
protected final Provider<CommentJson> commentJson;
protected final CommentsUtil commentsUtil; |
<<<<<<<
=======
protected TableTripPattern pattern;
>>>>>>>
<<<<<<<
public PatternEdge(TransitVertex fromv, TransitVertex tov) {
=======
public PatternEdge(TransitVertex fromv, TransitVertex tov, TableTripPattern pattern) {
>>>>>>>
public PatternEdge(TransitVertex fromv, TransitVertex tov) { |
<<<<<<<
import org.apache.bsf.BSFException;
=======
import org.opentripplanner.analyst.request.IsoChroneSPTRendererAccSampling;
import org.opentripplanner.analyst.request.Renderer;
import org.opentripplanner.analyst.request.SPTCache;
import org.opentripplanner.analyst.request.SampleGridRenderer;
import org.opentripplanner.analyst.request.TileCache;
import org.opentripplanner.api.resource.PlanGenerator;
>>>>>>>
import org.apache.bsf.BSFException;
import org.opentripplanner.analyst.request.IsoChroneSPTRendererAccSampling;
import org.opentripplanner.analyst.request.Renderer;
import org.opentripplanner.analyst.request.SPTCache;
import org.opentripplanner.analyst.request.SampleGridRenderer;
import org.opentripplanner.analyst.request.TileCache;
import org.opentripplanner.api.resource.PlanGenerator;
<<<<<<<
import org.opentripplanner.scripting.impl.BSFOTPScript;
import org.opentripplanner.scripting.impl.OTPScript;
=======
import org.opentripplanner.updater.GraphUpdaterConfigurator;
>>>>>>>
import org.opentripplanner.updater.GraphUpdaterConfigurator;
import org.opentripplanner.scripting.impl.BSFOTPScript;
import org.opentripplanner.scripting.impl.OTPScript; |
<<<<<<<
public class ResultFeature implements Serializable{
=======
import org.opentripplanner.analyst.pointset.PropertyMetadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;
public class ResultFeature {
>>>>>>>
import org.opentripplanner.analyst.pointset.PropertyMetadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;
public class ResultFeature implements Serializable{ |
<<<<<<<
=======
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.TimeZone;
>>>>>>>
<<<<<<<
=======
import org.opentripplanner.model.FeedScopedId;
import org.opentripplanner.model.Route;
import org.opentripplanner.model.Trip;
import org.opentripplanner.model.calendar.CalendarServiceData;
>>>>>>>
<<<<<<<
import org.opentripplanner.model.FeedScopedId;
import org.opentripplanner.model.Route;
import org.opentripplanner.model.Trip;
import org.opentripplanner.model.calendar.CalendarServiceData;
import org.opentripplanner.routing.algorithm.AStar;
=======
import org.opentripplanner.routing.algorithm.astar.AStar;
>>>>>>>
import org.opentripplanner.model.FeedScopedId;
import org.opentripplanner.model.Route;
import org.opentripplanner.model.Trip;
import org.opentripplanner.model.calendar.CalendarServiceData;
import org.opentripplanner.routing.algorithm.astar.AStar;
<<<<<<<
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.TimeZone;
=======
import static org.opentripplanner.calendar.impl.CalendarServiceDataFactoryImpl.createCalendarServiceData;
>>>>>>>
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.HashMap;
import java.util.List;
import java.util.TimeZone; |
<<<<<<<
import java.io.*;
import java.lang.reflect.Field;
=======
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
>>>>>>>
import java.io.*;
import java.lang.reflect.Field;
<<<<<<<
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.MissingNode;
=======
import org.apache.bsf.BSFException;
>>>>>>>
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.MissingNode;
import org.apache.bsf.BSFException;
<<<<<<<
=======
import org.opentripplanner.scripting.impl.BSFOTPScript;
import org.opentripplanner.scripting.impl.OTPScript;
import org.opentripplanner.updater.PropertiesPreferences;
>>>>>>>
import org.opentripplanner.scripting.impl.BSFOTPScript;
import org.opentripplanner.scripting.impl.OTPScript; |
<<<<<<<
public static long getPathSize(Configuration conf, Path path) throws IOException {
return getPathSize(FileSystem.get(conf), path);
}
public static long getPathSize(FileSystem fs, Path path) throws IOException {
if (!fs.exists(path)) {
return -1L;
}
FileStatus[] stati = null;
try {
stati = fs.listStatus(path);
} catch (FileNotFoundException e) {
return 0L;
}
if (stati.length == 0) {
return 0L;
}
long size = 0;
for (FileStatus status : stati) {
size += status.getLen();
}
return size;
}
=======
private static final Log LOG = LogFactory.getLog(SourceTargetHelper.class);
public static long getPathSize(Configuration conf, Path path) throws IOException {
return getPathSize(FileSystem.get(conf), path);
}
public static long getPathSize(FileSystem fs, Path path) throws IOException {
FileStatus[] stati = null;
try {
stati = fs.listStatus(path);
if (stati == null) {
throw new FileNotFoundException(path + " doesn't exist");
}
} catch (FileNotFoundException e) {
LOG.warn("Returning 0 for getPathSize on non-existant path '" + path + "'");
return 0L;
}
if (stati.length == 0) {
return 0L;
}
long size = 0;
for (FileStatus status : stati) {
size += status.getLen();
}
return size;
}
>>>>>>>
private static final Log LOG = LogFactory.getLog(SourceTargetHelper.class);
public static long getPathSize(Configuration conf, Path path) throws IOException {
return getPathSize(FileSystem.get(conf), path);
}
public static long getPathSize(FileSystem fs, Path path) throws IOException {
if (!fs.exists(path)) {
return -1L;
}
FileStatus[] stati = null;
try {
stati = fs.listStatus(path);
if (stati == null) {
throw new FileNotFoundException(path + " doesn't exist");
}
} catch (FileNotFoundException e) {
LOG.warn("Returning 0 for getPathSize on non-existant path '" + path + "'");
return 0L;
}
if (stati.length == 0) {
return 0L;
}
long size = 0;
for (FileStatus status : stati) {
size += status.getLen();
}
return size;
} |
<<<<<<<
final List claimsSupported = new ArrayList((List) m.get("claims_supported"));
claimsSupported.remove("zone_info");
claimsSupported.add("zoneinfo");
m.put("claims_supported", claimsSupported);
=======
>>>>>>>
final List claimsSupported = new ArrayList((List) m.get("claims_supported"));
claimsSupported.remove("zone_info");
claimsSupported.add("zoneinfo");
m.put("claims_supported", claimsSupported); |
<<<<<<<
this.waitUntilInitialized();
try {
dispatchGroup.enter();
syncConfig.addSynchronizedDocument(namespace, documentId);
triggerListeningToNamespace(namespace);
} finally {
dispatchGroup.exit();
}
=======
for (final BsonValue documentId : documentIds) {
syncConfig.addSynchronizedDocument(namespace, documentId);
}
triggerListeningToNamespace(namespace);
>>>>>>>
this.waitUntilInitialized();
try {
dispatchGroup.enter();
for (final BsonValue documentId : documentIds) {
syncConfig.addSynchronizedDocument(namespace, documentId);
}
triggerListeningToNamespace(namespace);
} finally {
dispatchGroup.exit();
}
<<<<<<<
dispatchGroup.enter();
final Lock lock =
this.syncConfig.getNamespaceConfig(namespace).getLock().writeLock();
lock.lock();
try {
syncConfig.removeSynchronizedDocument(namespace, documentId);
getLocalCollection(namespace).deleteOne(getDocumentIdFilter(documentId));
} finally {
lock.unlock();
}
triggerListeningToNamespace(namespace);
=======
for (final BsonValue documentId : documentIds) {
syncConfig.removeSynchronizedDocument(namespace, documentId);
}
getLocalCollection(namespace).deleteMany(
new Document("_id", new Document("$in", documentIds)));
>>>>>>>
dispatchGroup.enter();
for (final BsonValue documentId : documentIds) {
syncConfig.removeSynchronizedDocument(namespace, documentId);
}
getLocalCollection(namespace).deleteMany(
new Document("_id", new Document("$in", documentIds)));
<<<<<<<
// this block is to trigger coalescence for a delete after insert
if (config.getLastUncommittedChangeEvent() != null
&& config.getLastUncommittedChangeEvent().getOperationType()
== ChangeEvent.OperationType.INSERT) {
desyncDocumentFromRemote(config.getNamespace(), config.getDocumentId());
undoCollection.deleteOne(getDocumentIdFilter(config.getDocumentId()));
return result;
}
config.setSomePendingWrites(logicalT, event);
=======
// this block is to trigger coalescence for a delete after insert
if (config.getLastUncommittedChangeEvent() != null
&& config.getLastUncommittedChangeEvent().getOperationType()
== ChangeEvent.OperationType.INSERT) {
desyncDocumentsFromRemote(config.getNamespace(), config.getDocumentId());
>>>>>>>
// this block is to trigger coalescence for a delete after insert
if (config.getLastUncommittedChangeEvent() != null
&& config.getLastUncommittedChangeEvent().getOperationType()
== ChangeEvent.OperationType.INSERT) {
desyncDocumentsFromRemote(config.getNamespace(), config.getDocumentId()); |
<<<<<<<
if(_session.jsch.getLogger().isEnabled(Logger.DEBUG)) {
_session.jsch.getLogger().log(Logger.DEBUG, "waiting max. "+t+" ms for channel reply ...");
}
=======
this.notifyme=1;
>>>>>>>
if(_session.jsch.getLogger().isEnabled(Logger.DEBUG)) {
_session.jsch.getLogger().log(Logger.DEBUG, "waiting max. "+t+" ms for channel reply ...");
}
this.notifyme=1;
<<<<<<<
this.notifyme=0;
if(_session.jsch.getLogger().isEnabled(Logger.DEBUG)) {
_session.jsch.getLogger().log(Logger.DEBUG, "... finished waiting for channel reply");
}
=======
>>>>>>>
if(_session.jsch.getLogger().isEnabled(Logger.DEBUG)) {
_session.jsch.getLogger().log(Logger.DEBUG, "... finished waiting for channel reply");
} |
<<<<<<<
/**
* a pool of all sessions currently active for this JSch instance.
* Updated by the sessions on connect and disconnect, nowhere used.
*/
java.util.Vector pool=new java.util.Vector();
java.util.Vector identities=new java.util.Vector();
=======
private java.util.Vector sessionPool = new java.util.Vector();
private IdentityRepository identityRepository =
new LocalIdentityRepository(this);
public synchronized void setIdentityRepository(IdentityRepository identityRepository){
this.identityRepository = identityRepository;
}
synchronized IdentityRepository getIdentityRepository(){
return this.identityRepository;
}
>>>>>>>
/**
* a pool of all sessions currently active for this JSch instance.
* Updated by the sessions on connect and disconnect, nowhere used.
*/
private java.util.Vector sessionPool = new java.util.Vector();
private IdentityRepository identityRepository =
new LocalIdentityRepository(this);
public synchronized void setIdentityRepository(IdentityRepository identityRepository){
this.identityRepository = identityRepository;
}
synchronized IdentityRepository getIdentityRepository(){
return this.identityRepository;
}
<<<<<<<
/**
* Removes an identity by name.
* (The name is the result of the {@link Identity#getName getName}
* method of the Identity object.)
*
* This identity will not be used for future connections anymore.
* (We also {@link Identity#clear clear} the identity, causing it
* to forget its passphrase.)
* @param name the name of the identity to remove.
*/
=======
/**
* @deprecated use JSch#removeIdentity(Identity identity)
*/
>>>>>>>
/**
* Removes an identity by name.
* (The name is the result of the {@link Identity#getName getName}
* method of the Identity object.)
*
* This identity will not be used for future connections anymore.
* (We also {@link Identity#clear clear} the identity, causing it
* to forget its passphrase.)
* @param name the name of the identity to remove.
* @deprecated use JSch#removeIdentity(Identity identity)
*/ |
<<<<<<<
/**
* checks whether this file is a directory.
* @return true if the permissions are included in the
* structure and the directory bit is set.
*/
=======
private boolean isType(int mask) {
return (flags&SSH_FILEXFER_ATTR_PERMISSIONS)!=0 &&
(permissions&S_IFMT)==mask;
}
public boolean isReg(){
return isType(S_IFREG);
}
>>>>>>>
private boolean isType(int mask) {
return (flags&SSH_FILEXFER_ATTR_PERMISSIONS)!=0 &&
(permissions&S_IFMT)==mask;
}
public boolean isReg(){
return isType(S_IFREG);
}
/**
* checks whether this file is a directory.
* @return true if the permissions are included in the
* structure and the directory bit is set.
*/
<<<<<<<
return ((flags&SSH_FILEXFER_ATTR_PERMISSIONS)!=0 &&
((permissions&S_IFDIR)==S_IFDIR));
}
/**
* checks whether this file is a symbolic link.
* @return true if the permissions are included in the
* structure and the link bits are set.
*/
public boolean isLink(){
return ((flags&SSH_FILEXFER_ATTR_PERMISSIONS)!=0 &&
((permissions&S_IFLNK)==S_IFLNK));
}
/**
* returns the flags indicating which attributes
* are present.
*/
=======
return isType(S_IFDIR);
}
public boolean isChr(){
return isType(S_IFCHR);
}
public boolean isBlk(){
return isType(S_IFBLK);
}
public boolean isFifo(){
return isType(S_IFIFO);
}
public boolean isLink(){
return isType(S_IFLNK);
}
public boolean isSock(){
return isType(S_IFSOCK);
}
>>>>>>>
return isType(S_IFDIR);
}
public boolean isChr(){
return isType(S_IFCHR);
}
public boolean isBlk(){
return isType(S_IFBLK);
}
public boolean isFifo(){
return isType(S_IFIFO);
}
/**
* checks whether this file is a symbolic link.
* @return true if the permissions are included in the
* structure and the link bits are set.
*/
public boolean isLink(){
return isType(S_IFLNK);
}
public boolean isSock(){
return isType(S_IFSOCK);
}
/**
* returns the flags indicating which attributes
* are present.
*/ |
<<<<<<<
/**
* Usually not to be used by applications.
* A DSA signing or signature checking algorithm.
* <p>
* This interface is a slimmed down and specialized (on DSA) version
* of {@link java.security.Signature}.
* </p>
* <p>
* It will be used by the library to check the server's signature
* during key exchange, and to prove our own possession of the
* private key for public-key authentication in the default {@link Identity}
* implementation.
* </p>
* <p>
* The library will choose the implementation class by the configuration
* option {@code signature.dsa}, and instantiate it using the no-argument
* constructor. For signature checking, the usage would look like this:
* </p>
*<pre>
* sig = class.newInstance();
* sig.init();
* sig.setPubKey(y, p, q, g);
* sig.update(H); // maybe more than once
* boolean ok = sig.verify(sig_of_H);
*</pre>
*<p>For signing, the usage would look like this:</p>
*<pre>
* sig = class.newInstance();
* sig.init();
* sig.setPrvKey(x, p, q, g);
* sig.update(H); // maybe more than once
* byte[] sig_of_H = sig.sign();
*</pre>
* <p>
* The library contains a default implementation based on
* {@link java.security.Signature}.
* </p>
* @see SignatureRSA
*/
public interface SignatureDSA{
void init() throws Exception;
/**
* Sets the public key and prepares this signature object
* for signature verifying.
* @param y the public key {@code y = g^x mod p}.
* @param p the <em>big prime</em>
* @param q the <em>small prime</em>
* @param g the generator
* @see KeyPairGenDSA
*/
=======
public interface SignatureDSA extends Signature {
>>>>>>>
/**
* Usually not to be used by applications.
* A DSA signing or signature checking algorithm.
* <p>
* This interface is a slimmed down and specialized (on DSA) version
* of {@link java.security.Signature}.
* </p>
* <p>
* It will be used by the library to check the server's signature
* during key exchange, and to prove our own possession of the
* private key for public-key authentication in the default {@link Identity}
* implementation.
* </p>
* <p>
* The library will choose the implementation class by the configuration
* option {@code signature.dsa}, and instantiate it using the no-argument
* constructor. For signature checking, the usage would look like this:
* </p>
*<pre>
* sig = class.newInstance();
* sig.init();
* sig.setPubKey(y, p, q, g);
* sig.update(H); // maybe more than once
* boolean ok = sig.verify(sig_of_H);
*</pre>
*<p>For signing, the usage would look like this:</p>
*<pre>
* sig = class.newInstance();
* sig.init();
* sig.setPrvKey(x, p, q, g);
* sig.update(H); // maybe more than once
* byte[] sig_of_H = sig.sign();
*</pre>
* <p>
* The library contains a default implementation based on
* {@link java.security.Signature}.
* </p>
* @see SignatureRSA
*/
public interface SignatureDSA extends Signature {
/**
* Sets the public key and prepares this signature object
* for signature verifying.
* @param y the public key {@code y = g^x mod p}.
* @param p the <em>big prime</em>
* @param q the <em>small prime</em>
* @param g the generator
* @see KeyPairGenDSA
*/
<<<<<<<
/**
* adds some more data to be signed/verified.
* @param H the array containing the data to be verified.
*/
void update(byte[] H) throws Exception;
/**
* Verifies that the given signature is a correct signature.
* @param sig an array containing the signature for the data
* given by {@link #update}.
* @return true if the signature is correct,
* false if the signature is not correct.
*/
boolean verify(byte[] sig) throws Exception;
/**
* Signs the data given so far to the {@link #update} method.
* @return a signature for the data.
*/
byte[] sign() throws Exception;
=======
>>>>>>> |
<<<<<<<
/**
* creates a new session object from a JSch.
*/
Session(JSch jsch) throws JSchException{
=======
Session(JSch jsch, String username, String host, int port) throws JSchException{
>>>>>>>
/**
* creates a new session object from a JSch.
*/
Session(JSch jsch, String username, String host, int port) throws JSchException{
<<<<<<<
/**
* Creates a local-side port forwarding, listening only on the loopback address
* (i.e. only useable from the same computer).
* @see #setPortForwardingL(String, int, String, int)
*/
=======
/**
* Registers the local port forwarding for loop-back interface.
* If <code>lport</code> is <code>0</code>, the tcp port will be allocated.
* @param lport local port for local port forwarding
* @param host host address for local port forwarding
* @param rport remote port number for local port forwarding
* @return an allocated local TCP port number
* @see #setPortForwardingL(String bind_address, int lport, String host, int rport, ServerSocketFactory ssf, int connectTimeout)
*/
>>>>>>>
/**
* Registers the local port forwarding for loop-back interface.
* If <code>lport</code> is <code>0</code>, the tcp port will be allocated.
* @param lport local port for local port forwarding
* @param host host address for local port forwarding
* @param rport remote port number for local port forwarding
* @return an allocated local TCP port number
* @see #setPortForwardingL(String bind_address, int lport, String host, int rport, ServerSocketFactory ssf, int connectTimeout)
*/
<<<<<<<
/**
* removes a local-side port forwarding (listening on the loopback device).
* @param lport the local port we are listening on.
*/
=======
/**
* Cancels the local port forwarding assigned
* at local TCP port <code>lport</code> on loopback interface.
*
* @param lport local TCP port
*/
>>>>>>>
/**
* Cancels the local port forwarding assigned
* at local TCP port <code>lport</code> on loopback interface.
*
* @param lport local TCP port
*/
<<<<<<<
/**
* Creates a remote side port forwarding to a host at the local side.
* @see #setPortForwardingR(String, int, String, int, SocketFactory)
*/
=======
/**
* Registers the remote port forwarding for the loopback interface
* of the remote.
*
* @param rport remote port
* @param host host address
* @param lport local port
* @see #setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
*/
>>>>>>>
/**
* Registers the remote port forwarding for the loopback interface
* of the remote.
*
* @param rport remote port
* @param host host address
* @param lport local port
* @see #setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
*/
<<<<<<<
/**
* Creates a remote side port forwarding to a host at the local side.
* @see #setPortForwardingR(String, int, String, int, SocketFactory)
*/
=======
/**
* Registers the remote port forwarding.
* If <code>bind_address</code> is an empty string or <code>"*"</code>,
* the port should be available from all interfaces.
* If <code>bind_address</code> is <code>"localhost"</code> or is not given,
* the listening port will be bound for local use only.
* Note that if <code>GatewayPorts</code> is <code>"no"</code> on the
* remote, <code>"localhost"</code> is always used as a bind_address.
*
* @param bind_address bind address
* @param rport remote port
* @param host host address
* @param lport local port
* @see #setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
*/
>>>>>>>
/**
* Registers the remote port forwarding.
* If <code>bind_address</code> is an empty string or <code>"*"</code>,
* the port should be available from all interfaces.
* If <code>bind_address</code> is <code>"localhost"</code> or is not given,
* the listening port will be bound for local use only.
* Note that if <code>GatewayPorts</code> is <code>"no"</code> on the
* remote, <code>"localhost"</code> is always used as a bind_address.
*
* @param bind_address bind address
* @param rport remote port
* @param host host address
* @param lport local port
* @see #setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
*/
<<<<<<<
/**
* Creates a remote side port forwarding to a host at the local side.
* @see #setPortForwardingR(String, int, String, int, SocketFactory)
*/
=======
/**
* Registers the remote port forwarding for the loopback interface
* of the remote.
*
* @param rport remote port
* @param host host address
* @param lport local port
* @param sf socket factory
* @see #setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
*/
>>>>>>>
/**
* Registers the remote port forwarding for the loopback interface
* of the remote.
*
* @param rport remote port
* @param host host address
* @param lport local port
* @param sf socket factory
* @see #setPortForwardingR(String bind_address, int rport, String host, int lport, SocketFactory sf)
*/
<<<<<<<
/**
* Creates a remote side port forwarding to a host at the local side.
* @param bind_address the network interface to bind on on the remote side.
* If null, bind to (remote) localhost, if {@code ""} or {@code "*"},
* bind to all interfaces.
* @param rport the port to listen on on the remote side.
* @param host the host on the local side to forward connections to.
* @param lport the port at host to forward connections to.
* @param sf a SocketFactory used to create the local-side connections.
*/
=======
// TODO: This method should return the integer value as the assigned port.
/**
* Registers the remote port forwarding.
* If <code>bind_address</code> is an empty string or <code>"*"</code>,
* the port should be available from all interfaces.
* If <code>bind_address</code> is <code>"localhost"</code> or is not given,
* the listening port will be bound for local use only.
* Note that if <code>GatewayPorts</code> is <code>"no"</code> on the
* remote, <code>"localhost"</code> is always used as a bind_address.
* If <code>rport</code> is <code>0</code>, the TCP port will be allocated on the remote.
*
* @param bind_address bind address
* @param rport remote port
* @param host host address
* @param lport local port
* @param sf socket factory
*/
>>>>>>>
// TODO: This method should return the integer value as the assigned port.
/**
* Registers the remote port forwarding.
* If <code>bind_address</code> is an empty string or <code>"*"</code>,
* the port should be available from all interfaces.
* If <code>bind_address</code> is <code>"localhost"</code> or is not given,
* the listening port will be bound for local use only.
* Note that if <code>GatewayPorts</code> is <code>"no"</code> on the
* remote, <code>"localhost"</code> is always used as a bind_address.
* If <code>rport</code> is <code>0</code>, the TCP port will be allocated on the remote.
*
* @param bind_address bind address
* @param rport remote port
* @param host host address
* @param lport local port
* @param sf socket factory
*/
<<<<<<<
/**
* Adds a remote-side port forwarding to a local side daemon,
* bound to the remote loopback device, with null as arguments
* for the deamon.
* @see #setPortForwardingR(String, int, String, Object[])
*/
=======
/**
* Registers the remote port forwarding for the loopback interface
* of the remote.
* The TCP connection to <code>rport</code> on the remote will be
* forwarded to an instance of the class <code>daemon</code>.
* The class specified by <code>daemon</code> must implement
* <code>ForwardedTCPIPDaemon</code>.
*
* @param rport remote port
* @param daemon class name, which implements "ForwardedTCPIPDaemon"
* @see #setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
*/
>>>>>>>
/**
* Registers the remote port forwarding for the loopback interface
* of the remote.
* The TCP connection to <code>rport</code> on the remote will be
* forwarded to an instance of the class <code>daemon</code>.
* The class specified by <code>daemon</code> must implement
* <code>ForwardedTCPIPDaemon</code>.
*
* @param rport remote port
* @param daemon class name, which implements "ForwardedTCPIPDaemon"
* @see #setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
*/
<<<<<<<
/**
* Adds a remote-side port forwarding to a local side daemon,
* bound to the remote loopback device.
* @see #setPortForwardingR(String, int, String, Object[])
*/
=======
/**
* Registers the remote port forwarding for the loopback interface
* of the remote.
* The TCP connection to <code>rport</code> on the remote will be
* forwarded to an instance of the class <code>daemon</code> with
* the argument <code>arg</code>.
* The class specified by <code>daemon</code> must implement <code>ForwardedTCPIPDaemon</code>.
*
* @param rport remote port
* @param daemon class name, which implements "ForwardedTCPIPDaemon"
* @param arg arguments for "daemon"
* @see #setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
*/
>>>>>>>
/**
* Registers the remote port forwarding for the loopback interface
* of the remote.
* The TCP connection to <code>rport</code> on the remote will be
* forwarded to an instance of the class <code>daemon</code> with
* the argument <code>arg</code>.
* The class specified by <code>daemon</code> must implement <code>ForwardedTCPIPDaemon</code>.
*
* @param rport remote port
* @param daemon class name, which implements "ForwardedTCPIPDaemon"
* @param arg arguments for "daemon"
* @see #setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
*/
<<<<<<<
/**
* Adds a remote-side port forwarding to a local side daemon.
*
* The deamon class has to implement {@link ForwardedTCPIPDaemon}.
*<p>
* When someone connects to the remote socket, we create an instance using
* the no-argument constructor, then call
* {@link ForwardedTCPIPDaemon#setChannel setChannel} (with
* the streams connected to the remote socket) and
* {@link ForwardedTCPIPDaemon#setArg setArg(arg)}. Then we create a new
* Thread running it.
*</p>
* @param bind_address the network interface to bind on on the remote side.
* If null, bind to (remote) localhost, if {@code ""} or {@code "*"},
* bind to all interfaces.
* @param rport the port to listen on on the remote side.
* @param daemon the class name of the deamon class.
* @param arg additional arguments passed to the daemon.
*/
=======
/**
* Registers the remote port forwarding.
* If <code>bind_address</code> is an empty string
* or <code>"*"</code>, the port should be available from all interfaces.
* If <code>bind_address</code> is <code>"localhost"</code> or is not given,
* the listening port will be bound for local use only.
* Note that if <code>GatewayPorts</code> is <code>"no"</code> on the
* remote, <code>"localhost"</code> is always used as a bind_address.
* The TCP connection to <code>rport</code> on the remote will be
* forwarded to an instance of the class <code>daemon</code> with the
* argument <code>arg</code>.
* The class specified by <code>daemon</code> must implement <code>ForwardedTCPIPDaemon</code>.
*
* @param bind_address bind address
* @param rport remote port
* @param daemon class name, which implements "ForwardedTCPIPDaemon"
* @param arg arguments for "daemon"
* @see #setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
*/
>>>>>>>
/**
* Registers the remote port forwarding.
* If <code>bind_address</code> is an empty string
* or <code>"*"</code>, the port should be available from all interfaces.
* If <code>bind_address</code> is <code>"localhost"</code> or is not given,
* the listening port will be bound for local use only.
* Note that if <code>GatewayPorts</code> is <code>"no"</code> on the
* remote, <code>"localhost"</code> is always used as a bind_address.
* The TCP connection to <code>rport</code> on the remote will be
* forwarded to an instance of the class <code>daemon</code> with the
* argument <code>arg</code>.
* The class specified by <code>daemon</code> must implement <code>ForwardedTCPIPDaemon</code>.
*
* @param bind_address bind address
* @param rport remote port
* @param daemon class name, which implements "ForwardedTCPIPDaemon"
* @param arg arguments for "daemon"
* @see #setPortForwardingR(String bind_address, int rport, String daemon, Object[] arg)
*/
<<<<<<<
/**
* removes a remote port forwarding.
* @param rport the remote listening port.
*/
=======
/**
* Cancels the remote port forwarding assigned at remote TCP port <code>rport</code>.
*
* @param rport remote TCP port
*/
>>>>>>>
/**
* Cancels the remote port forwarding assigned at remote TCP port <code>rport</code>.
*
* @param rport remote TCP port
*/
<<<<<<<
* @param interval the timeout interval in milliseconds before sending
* a server alive message, if no message is received from the server.
=======
*
* @param interval the specified interval, in milliseconds.
>>>>>>>
*
* @param interval the timeout interval in milliseconds before sending
* a server alive message, if no message is received from the server.
<<<<<<<
* @see #setServerAliveCountMax(int)
=======
*
* @see #setServerAliveCountMax(int)
>>>>>>>
*
* @see #setServerAliveCountMax(int) |
<<<<<<<
/**
* Writes an encoded form of the private
* key to an OutputStream.
*/
// TODO: describe the format.
=======
/**
* Writes the plain private key to the given output stream.
* @param out output stream
* @see #writePrivateKey(java.io.OutputStream out, byte[] passphrase)
*/
>>>>>>>
/**
* Writes the plain private key to the given output stream.
* @param out output stream
* @see #writePrivateKey(java.io.OutputStream out, byte[] passphrase)
*/
<<<<<<<
/**
* Writes the public key to some file, in encoded form.
* @param name the file to write the key to.
* @param comment a comment which will be written to the stream
* after the key.
*/
=======
/**
* Writes the public key with the specified comment to the file.
* @param name file name
* @param comment comment
* @see #writePublicKey(java.io.OutputStream out, String comment)
*/
>>>>>>>
/**
* Writes the public key with the specified comment to the file.
* @param name file name
* @param comment comment
* @see #writePublicKey(java.io.OutputStream out, String comment)
*/
<<<<<<<
/**
* Writes the public key to some OutputStream, in the form
* defined by RFC 4716.
* @param out the stream to write the key to.
* @param comment a comment accompanying the the key.
* @see <a href="http://tools.ietf.org/html/rfc4716">RFC 4716,
* The Secure Shell (SSH) Public Key File Format</a>
*/
=======
/**
* Writes the public key with the specified comment to the output stream in
* the format defined in http://www.ietf.org/rfc/rfc4716.txt
* @param out output stream
* @param comment comment
*/
>>>>>>>
/**
* Writes the public key with the specified comment to the output stream in
* the format defined in <a href="http://tools.ietf.org/html/rfc4716">RFC 4716,
* The Secure Shell (SSH) Public Key File Format</a>.
* @param out output stream
* @param comment comment
*/
<<<<<<<
/**
* Writes the public key to some file, in the form
* defined by RFC 4716.
* @param name the file to write the key to.
* @param comment a comment accompanying the the key.
* @see <a href="http://tools.ietf.org/html/rfc4716">RFC 4716,
* The Secure Shell (SSH) Public Key File Format</a>
*/
=======
/**
* Writes the public key with the specified comment to the output stream in
* the format defined in http://www.ietf.org/rfc/rfc4716.txt
* @param name file name
* @param comment comment
* @see #writeSECSHPublicKey(java.io.OutputStream out, String comment)
*/
>>>>>>>
/**
* Writes the public key with the specified comment to the output stream in
* the format defined in <a href="http://tools.ietf.org/html/rfc4716">RFC 4716,
* The Secure Shell (SSH) Public Key File Format</a>
* @param name file name
* @param comment comment
* @see #writeSECSHPublicKey(java.io.OutputStream out, String comment)
*/
<<<<<<<
/**
* Writes an encoded form of the private
* key to a file.
*/
=======
/**
* Writes the plain private key to the file.
* @param name file name
* @see #writePrivateKey(String name, byte[] passphrase)
*/
>>>>>>>
/**
* Writes the plain private key to the file.
* @param name file name
* @see #writePrivateKey(String name, byte[] passphrase)
*/
<<<<<<<
/**
* Creates and returns a fingerprint of the public key,
* i.e. the hexadecimal representation of the MD5 hash of
* the public key.
*/
=======
/**
* Returns the finger-print of the public key.
* @return finger print
*/
>>>>>>>
/**
* Creates and returns a fingerprint of the public key,
* i.e. the hexadecimal representation of the MD5 hash of
* the public key.
*/
<<<<<<<
/**
* Sets a passphrase for the private key. This will be
* used for encrypting the private key before writing
* it out.
*/
=======
/**
* @deprecated use #writePrivateKey(java.io.OutputStream out, byte[] passphrase)
*/
>>>>>>>
/**
* Sets a passphrase for the private key. This will be
* used for encrypting the private key before writing
* it out.
* @deprecated use #writePrivateKey(java.io.OutputStream out, byte[] passphrase)
*/
<<<<<<<
/**
* Sets a passphrase for the private key. This will be
* used for encrypting the private key before writing
* it out.
*/
=======
/**
* @deprecated use #writePrivateKey(String name, byte[] passphrase)
*/
>>>>>>>
/**
* Sets a passphrase for the private key. This will be
* used for encrypting the private key before writing
* it out.
* @deprecated use #writePrivateKey(String name, byte[] passphrase)
*/ |
<<<<<<<
/**
* Uploads a file.
* @param src the local source file name, absolute or relative to the
* <a href="#current-directory">current local directory</a>.
* @param dst the remote destination file name, absolute or relative to the
* <a href="#current-directory">current remote directory</a>.
* @param monitor an object receiving notifications about the progress
* of the operation. Can be {@code null}, then there will be no progress
* notification.
* @param mode the transfer mode, one of {@link #RESUME}, {@link #APPEND},
* {@link #OVERWRITE}.
* @throws SftpException if some problem occurred.
*/
=======
/**
* Sends data from <code>src</code> file to <code>dst</code> file.
* The <code>mode</code> should be <code>OVERWRITE</code>,
* <code>RESUME</code> or <code>APPEND</code>.
*
* @param src source file
* @param dst destination file
* @param monitor progress monitor
* @param mode how data should be added to dst
*/
>>>>>>>
/**
* Uploads a file.
* @param src the local source file name, absolute or relative to the
* <a href="#current-directory">current local directory</a>.
* @param dst the remote destination file name, absolute or relative to the
* <a href="#current-directory">current remote directory</a>.
* @param monitor an object receiving notifications about the progress
* of the operation. Can be {@code null}, then there will be no progress
* notification.
* @param mode the transfer mode, one of {@link #RESUME}, {@link #APPEND},
* {@link #OVERWRITE}.
* @throws SftpException if some problem occurred.
*/
<<<<<<<
/**
* Uploads a file from an input stream.
* @param src the source file, in form of an input stream.
* @param dst the remote destination file name, relative to the
* <a href="#current-directory">current remote directory</a>.
* @param monitor an object receiving notifications about the progress
* of the operation. Can be {@code null}, then there will be no progress
* notification.
* @param mode the transfer mode, one of {@link #RESUME}, {@link #APPEND},
* {@link #OVERWRITE}.
* @throws SftpException if some problem occurred.
*/
=======
/**
* Sends data from the input stream <code>src</code> to <code>dst</code> file.
* The <code>mode</code> should be <code>OVERWRITE</code>,
* <code>RESUME</code> or <code>APPEND</code>.
*
* @param src input stream
* @param dst destination file
* @param monitor progress monitor
* @param mode how data should be added to dst
*/
>>>>>>>
/**
* Uploads a file from an input stream.
* @param src the source file, in form of an input stream.
* @param dst the remote destination file name, relative to the
* <a href="#current-directory">current remote directory</a>.
* @param monitor an object receiving notifications about the progress
* of the operation. Can be {@code null}, then there will be no progress
* notification.
* @param mode the transfer mode, one of {@link #RESUME}, {@link #APPEND},
* {@link #OVERWRITE}.
* @throws SftpException if some problem occurred.
*/
<<<<<<<
/**
* Starts an upload by OutputStream.
*<p>
* The returned output stream should be used by the application to
* write data, which will then be uploaded to the remote file.
* Closing the stream will finish the upload.
*</p>
* @param dst the remote destination file name, relative to the
* <a href="#current-directory">current remote directory</a>.
* @param monitor an object receiving notifications about the progress
* of the operation. Can be {@code null}, then there will be no progress
* notification.
* @param mode the transfer mode, one of {@link #RESUME}, {@link #APPEND},
* {@link #OVERWRITE}.
* @param offset the position in the remote file where we want
* to start writing. In the {@link #RESUME} and {@link #APPEND} modes,
* this is added to the current size of the file (i.e. then a value > 0
* creates a sparse section in the file).
* (I hope I did understand this right - there is no example using this
* method with offset.)
* @return an OutputStream to which the application should write the file
* contents.
* @throws SftpException if some problem occurred.
*/
=======
/**
* Sends data from the output stream to <code>dst</code> file.
* The <code>mode</code> should be <code>OVERWRITE</code>,
* <code>RESUME</code> or <code>APPEND</code>.
*
* @param dst destination file
* @param monitor progress monitor
* @param mode how data should be added to dst
* @param offset data will be added at offset
* @return output stream, which accepts data to be transferred.
*/
>>>>>>>
/**
* Starts an upload by OutputStream.
*<p>
* The returned output stream should be used by the application to
* write data, which will then be uploaded to the remote file.
* Closing the stream will finish the upload.
*</p>
* @param dst the remote destination file name, relative to the
* <a href="#current-directory">current remote directory</a>.
* @param monitor an object receiving notifications about the progress
* of the operation. Can be {@code null}, then there will be no progress
* notification.
* @param mode the transfer mode, one of {@link #RESUME}, {@link #APPEND},
* {@link #OVERWRITE}.
* @param offset the position in the remote file where we want
* to start writing. In the {@link #RESUME} and {@link #APPEND} modes,
* this is added to the current size of the file (i.e. then a value > 0
* creates a sparse section in the file).
* (I hope I did understand this right - there is no example using this
* method with offset.)
* @return an OutputStream to which the application should write the file
* contents.
* @throws SftpException if some problem occurred.
*/
<<<<<<<
/**
* Creates a new symbolic link.
*
*<p>
* <strong>Note:</strong> The protocol draft declares the two parameters
* in the reverse order (i.e. first linkpath, then targetpath), but because
* of an erronous implementation in (both sides of) OpenSSH, the
* de facto protocol is now what is implemented here (first targetpath,
* then linkpath).
* If you are speaking to a SFTP server which implements the protocol
* as specified, you might have to swap the arguments.
*</p>
*
* @param oldpath the path of the link target, relative to the
* <a href="#current-directory">current remote directory</a>
* @param newpath the path of the link to be created, relative to the
* <a href="#current-directory">current remote directory</a>
* @see <a href="http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-6.10">Internet draft, 6.10. Dealing with Symbolic links</a>
* @see <a href="http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL?rev=HEAD">OpenSSH protocol deviations.</a>
*/
=======
>>>>>>>
/**
* Creates a new symbolic link.
*
*<p>
* <strong>Note:</strong> The protocol draft declares the two parameters
* in the reverse order (i.e. first linkpath, then targetpath), but because
* of an erronous implementation in (both sides of) OpenSSH, the
* de facto protocol is now what is implemented here (first targetpath,
* then linkpath).
* If you are speaking to a SFTP server which implements the protocol
* as specified, you might have to swap the arguments.
*</p>
*
* @param oldpath the path of the link target, relative to the
* <a href="#current-directory">current remote directory</a>
* @param newpath the path of the link to be created, relative to the
* <a href="#current-directory">current remote directory</a>
* @see <a href="http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-6.10">Internet draft, 6.10. Dealing with Symbolic links</a>
* @see <a href="http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/ssh/PROTOCOL?rev=HEAD">OpenSSH protocol deviations.</a>
*/
<<<<<<<
/**
* Renames a file or directory.
* @param oldpath the old name of the file, relative to the
* <a href="#current-directory">current remote directory</a>.
* @param newpath the new name of the file, relative to the
* <a href="#current-directory">current remote directory</a>.
* @see <a href="http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-6.5">Internet draft, 6.5 Removing and Renaming Files</a>
*/
=======
public void hardlink(String oldpath, String newpath) throws SftpException{
if(!extension_hardlink){
throw new SftpException(SSH_FX_OP_UNSUPPORTED,
"[email protected] is not supported");
}
try{
((MyPipedInputStream)io_in).updateReadSide();
oldpath=remoteAbsolutePath(oldpath);
newpath=remoteAbsolutePath(newpath);
oldpath=isUnique(oldpath);
if(isPattern(newpath)){
throw new SftpException(SSH_FX_FAILURE, newpath);
}
newpath=Util.unquote(newpath);
sendHARDLINK(Util.str2byte(oldpath, fEncoding),
Util.str2byte(newpath, fEncoding));
Header header=new Header();
header=header(buf, header);
int length=header.length;
int type=header.type;
fill(buf, length);
if(type!=SSH_FXP_STATUS){
throw new SftpException(SSH_FX_FAILURE, "");
}
int i=buf.getInt();
if(i==SSH_FX_OK) return;
throwStatusError(buf, i);
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
>>>>>>>
public void hardlink(String oldpath, String newpath) throws SftpException{
if(!extension_hardlink){
throw new SftpException(SSH_FX_OP_UNSUPPORTED,
"[email protected] is not supported");
}
try{
((MyPipedInputStream)io_in).updateReadSide();
oldpath=remoteAbsolutePath(oldpath);
newpath=remoteAbsolutePath(newpath);
oldpath=isUnique(oldpath);
if(isPattern(newpath)){
throw new SftpException(SSH_FX_FAILURE, newpath);
}
newpath=Util.unquote(newpath);
sendHARDLINK(Util.str2byte(oldpath, fEncoding),
Util.str2byte(newpath, fEncoding));
Header header=new Header();
header=header(buf, header);
int length=header.length;
int type=header.type;
fill(buf, length);
if(type!=SSH_FXP_STATUS){
throw new SftpException(SSH_FX_FAILURE, "");
}
int i=buf.getInt();
if(i==SSH_FX_OK) return;
throwStatusError(buf, i);
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
}
/**
* Renames a file or directory.
* @param oldpath the old name of the file, relative to the
* <a href="#current-directory">current remote directory</a>.
* @param newpath the new name of the file, relative to the
* <a href="#current-directory">current remote directory</a>.
* @see <a href="http://tools.ietf.org/html/draft-ietf-secsh-filexfer-02#section-6.5">Internet draft, 6.5 Removing and Renaming Files</a>
*/
<<<<<<<
/**
* Retrieves the file attributes of a file or directory.
*
* This method does not follow symbolic links (i.e. returns
* the attributes of the link and not the target).
* @param path the path of the file or directory, relative
* to the <a href="#current-directory">current remote directory</a>.
* @return an SftpAttrs object containing the file's attributes.
* @see #stat(String)
*/
=======
public SftpStatVFS statVFS(String path) throws SftpException{
try{
((MyPipedInputStream)io_in).updateReadSide();
path=remoteAbsolutePath(path);
path=isUnique(path);
return _statVFS(path);
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
//return null;
}
private SftpStatVFS _statVFS(byte[] path) throws SftpException{
if(!extension_statvfs){
throw new SftpException(SSH_FX_OP_UNSUPPORTED,
"[email protected] is not supported");
}
try{
sendSTATVFS(path);
Header header=new Header();
header=header(buf, header);
int length=header.length;
int type=header.type;
fill(buf, length);
if(type != (SSH_FXP_EXTENDED_REPLY&0xff)){
if(type==SSH_FXP_STATUS){
int i=buf.getInt();
throwStatusError(buf, i);
}
throw new SftpException(SSH_FX_FAILURE, "");
}
else {
SftpStatVFS stat = SftpStatVFS.getStatVFS(buf);
return stat;
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
//return null;
}
private SftpStatVFS _statVFS(String path) throws SftpException{
return _statVFS(Util.str2byte(path, fEncoding));
}
>>>>>>>
public SftpStatVFS statVFS(String path) throws SftpException{
try{
((MyPipedInputStream)io_in).updateReadSide();
path=remoteAbsolutePath(path);
path=isUnique(path);
return _statVFS(path);
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
//return null;
}
private SftpStatVFS _statVFS(byte[] path) throws SftpException{
if(!extension_statvfs){
throw new SftpException(SSH_FX_OP_UNSUPPORTED,
"[email protected] is not supported");
}
try{
sendSTATVFS(path);
Header header=new Header();
header=header(buf, header);
int length=header.length;
int type=header.type;
fill(buf, length);
if(type != (SSH_FXP_EXTENDED_REPLY&0xff)){
if(type==SSH_FXP_STATUS){
int i=buf.getInt();
throwStatusError(buf, i);
}
throw new SftpException(SSH_FX_FAILURE, "");
}
else {
SftpStatVFS stat = SftpStatVFS.getStatVFS(buf);
return stat;
}
}
catch(Exception e){
if(e instanceof SftpException) throw (SftpException)e;
if(e instanceof Throwable)
throw new SftpException(SSH_FX_FAILURE, "", (Throwable)e);
throw new SftpException(SSH_FX_FAILURE, "");
}
//return null;
}
private SftpStatVFS _statVFS(String path) throws SftpException{
return _statVFS(Util.str2byte(path, fEncoding));
}
/**
* Retrieves the file attributes of a file or directory.
*
* This method does not follow symbolic links (i.e. returns
* the attributes of the link and not the target).
* @param path the path of the file or directory, relative
* to the <a href="#current-directory">current remote directory</a>.
* @return an SftpAttrs object containing the file's attributes.
* @see #stat(String)
*/ |
<<<<<<<
* @see <a href="http://tools.ietf.org/html/rfc4254#section-6.4">RFC4254 6.4 Environment Variable Passing</a>
=======
>>>>>>>
<<<<<<<
* @see <a href="http://tools.ietf.org/html/rfc4254#section-6.4">RFC4254 6.4 Environment Variable Passing</a>
=======
>>>>>>>
<<<<<<<
* @see <a href="http://tools.ietf.org/html/rfc4254#section-6.7">RFC4254 6.7. Window Dimension Change Message</a>
=======
>>>>>>> |
<<<<<<<
int remoteSize = buf.getInt();
if(jsch.getLogger().isEnabled(Logger.INFO)) {
jsch.getLogger().log(Logger.INFO, "SSH_MSG_CHANNEL_DATA received, channel: "+i + ", bytes: " + remoteSize);
}
channel.addRemoteWindowSize(remoteSize);
=======
channel.addRemoteWindowSize(buf.getUInt());
>>>>>>>
long remoteSize = buf.getUInt();
if(jsch.getLogger().isEnabled(Logger.INFO)) {
jsch.getLogger().log(Logger.INFO, "SSH_MSG_CHANNEL_DATA received, channel: "+i + ", bytes: " + remoteSize);
}
channel.addRemoteWindowSize(remoteSize);
<<<<<<<
if(jsch.getLogger().isEnabled(Logger.INFO)) {
jsch.getLogger().log(Logger.INFO, "SSH_MSG_CHANNEL_OPEN_CONFIRMATION received, channel: "+i);
}
if(channel==null){
//break;
}
=======
>>>>>>>
if(jsch.getLogger().isEnabled(Logger.INFO)) {
jsch.getLogger().log(Logger.INFO, "SSH_MSG_CHANNEL_OPEN_CONFIRMATION received, channel: "+i);
}
<<<<<<<
if(channel==null){
//break;
}
int reason_code=buf.getInt();
if(jsch.getLogger().isEnabled(Logger.INFO)) {
// additional textual information
String descr =Util.byte2str(buf.getString());
//foo=buf.getString(); // language tag
jsch.getLogger().log(Logger.INFO, "SSH_MSG_CHANNEL_OPEN_FAILURE received, reason: " + reason_code+", channel: "+i+", description: " + descr);
}
channel.setExitStatus(reason_code);
channel.close=true;
channel.eof_remote=true;
channel.setRecipient(0);
=======
if(channel!=null){
int reason_code=buf.getInt();
//foo=buf.getString(); // additional textual information
//foo=buf.getString(); // language tag
channel.setExitStatus(reason_code);
channel.close=true;
channel.eof_remote=true;
channel.setRecipient(0);
}
>>>>>>>
if(channel!=null){
int reason_code=buf.getInt();
if(jsch.getLogger().isEnabled(Logger.INFO)) {
// additional textual information
String descr =Util.byte2str(buf.getString());
//foo=buf.getString(); // language tag
jsch.getLogger().log(Logger.INFO, "SSH_MSG_CHANNEL_OPEN_FAILURE received, reason: " + reason_code+", channel: "+i+", description: " + descr);
}
//foo=buf.getString(); // additional textual information
//foo=buf.getString(); // language tag
channel.setExitStatus(reason_code);
channel.close=true;
channel.eof_remote=true;
channel.setRecipient(0);
} |
<<<<<<<
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
=======
import android.view.View;
import android.view.ViewGroup;
import android.widget.Toast;
>>>>>>>
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
<<<<<<<
import butterknife.OnClick;
=======
import cn.bingoogolapple.androidcommon.adapter.BGAOnRVItemClickListener;
>>>>>>>
import butterknife.OnClick;
import cn.bingoogolapple.androidcommon.adapter.BGAOnRVItemClickListener; |
<<<<<<<
if (mirw.isMergedInto(mirw.parseCommit(accepted), mirw.parseCommit(commit))) {
log.debug(
"Dependency {} merged into branch head {}.", commit.getName(), accepted.getName());
return true;
}
}
// check if the commit associated change is merged in the same branch
List<ChangeData> changes = internalChangeQuery.byCommit(commit);
for (ChangeData change : changes) {
if (change.change().getStatus() == Status.MERGED
&& change.change().getDest().equals(dest)) {
log.debug(
"Dependency {} associated with merged change {}.", commit.getName(), change.getId());
=======
if (mirw.isMergedInto(mirw.parseCommit(commit),
mirw.parseCommit(accepted))) {
>>>>>>>
if (mirw.isMergedInto(mirw.parseCommit(commit), mirw.parseCommit(accepted))) {
log.debug(
"Dependency {} merged into branch head {}.", commit.getName(), accepted.getName());
return true;
}
}
// check if the commit associated change is merged in the same branch
List<ChangeData> changes = internalChangeQuery.byCommit(commit);
for (ChangeData change : changes) {
if (change.change().getStatus() == Status.MERGED
&& change.change().getDest().equals(dest)) {
log.debug(
"Dependency {} associated with merged change {}.", commit.getName(), change.getId()); |
<<<<<<<
public RuntimeInfo(Context context, String[] command) {
this.context = context;
mapper = new ObjectMapper();
String resultOfTop = executeCommand(command);
topCommandRows = resultOfTop.split("\n");
}
public String getCPUInfo() throws AndroidAgentException {
=======
public List<Device.Property> getCPUInfo() throws AndroidAgentException {
>>>>>>>
public RuntimeInfo(Context context, String[] command) {
this.context = context;
mapper = new ObjectMapper();
String resultOfTop = executeCommand(command);
topCommandRows = resultOfTop.split("\n");
}
public List<Device.Property> getCPUInfo() throws AndroidAgentException {
<<<<<<<
public Application getHighestCPU() {
Application appData = null;
for (String topCommandRow : topCommandRows) {
if (topCommandRow != null && !topCommandRow.isEmpty()
&& !topCommandRow.contains(" root ")) {
String[] columns = topCommandRow.replaceFirst("^\\s*", "").split(" ");
String pidColumnValue = columns[0].trim();
if (!pidColumnValue.isEmpty() && TextUtils.isDigitsOnly(pidColumnValue)) {
appData = new Application();
appData.setPackageName(columns[columns.length - 1]);
appData.setPid(Integer.parseInt(columns[0]));
for (String column : columns) {
if (column != null) {
String columnValue = column.trim();
if (columnValue.contains("%")) {
String percentage = columnValue.replace("%", "");
if (!percentage.isEmpty() && TextUtils.isDigitsOnly(percentage)) {
appData.setCpu(Integer.parseInt(percentage));
}
break;
}
}
}
}
}
}
return appData;
}
public String getRAMInfo() throws AndroidAgentException {
=======
public List<Device.Property> getRAMInfo() throws AndroidAgentException {
>>>>>>>
public Application getHighestCPU() {
Application appData = null;
for (String topCommandRow : topCommandRows) {
if (topCommandRow != null && !topCommandRow.isEmpty()
&& !topCommandRow.contains(" root ")) {
String[] columns = topCommandRow.replaceFirst("^\\s*", "").split(" ");
String pidColumnValue = columns[0].trim();
if (!pidColumnValue.isEmpty() && TextUtils.isDigitsOnly(pidColumnValue)) {
appData = new Application();
appData.setPackageName(columns[columns.length - 1]);
appData.setPid(Integer.parseInt(columns[0]));
for (String column : columns) {
if (column != null) {
String columnValue = column.trim();
if (columnValue.contains("%")) {
String percentage = columnValue.replace("%", "");
if (!percentage.isEmpty() && TextUtils.isDigitsOnly(percentage)) {
appData.setCpu(Integer.parseInt(percentage));
}
break;
}
}
}
}
}
}
return appData;
}
public List<Device.Property> getRAMInfo() throws AndroidAgentException { |
<<<<<<<
case Constants.Operation.APP_RESTRICTION:
return buildApplicationRestrictionOpearation(operation);
=======
case Constants.Operation.WORK_PROFILE:
return buildWorkProfileOperation(operation);
>>>>>>>
case Constants.Operation.APP_RESTRICTION:
return buildApplicationRestrictionOpearation(operation);
case Constants.Operation.WORK_PROFILE:
return buildWorkProfileOperation(operation); |
<<<<<<<
protected void doGet(HttpServletRequest req, HttpServletResponse rsp) throws IOException {
toGerrit(req.getRequestURI(), req, rsp);
=======
protected void doGet(final HttpServletRequest req, final HttpServletResponse rsp)
throws IOException {
toGerrit(req.getRequestURI().substring(req.getContextPath().length()), req, rsp);
>>>>>>>
protected void doGet(HttpServletRequest req, HttpServletResponse rsp) throws IOException {
toGerrit(req.getRequestURI().substring(req.getContextPath().length()), req, rsp); |
<<<<<<<
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
=======
import org.wso2.carbon.device.mgt.common.notification.mgt.*;
>>>>>>>
import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException;
import org.wso2.carbon.device.mgt.common.notification.mgt.*;
<<<<<<<
} catch (ApplicationManagementException e) {
log.error("Issue in retrieving application management service instance", e);
=======
} catch (NotificationManagementException e) {
log.error("Issue in retrieving Notification management service instance", e);
>>>>>>>
} catch (ApplicationManagementException e) {
log.error("Issue in retrieving application management service instance", e);
} catch (NotificationManagementException e) {
log.error("Issue in retrieving Notification management service instance", e);
<<<<<<<
throws OperationManagementException, PolicyComplianceException, ApplicationManagementException {
=======
throws OperationManagementException, PolicyComplianceException, DeviceManagementException,
NotificationManagementException {
>>>>>>>
throws OperationManagementException, PolicyComplianceException,
ApplicationManagementException, NotificationManagementException, DeviceManagementException { |
<<<<<<<
=======
import java.io.File;
import java.math.BigDecimal;
import java.math.RoundingMode;
import android.support.v4.content.ContextCompat;
import org.wso2.emm.agent.utils.Response;
>>>>>>> |
<<<<<<<
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.mobile.impl.MobileDeviceManagementConstants;
=======
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
>>>>>>>
import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
<<<<<<<
public static DeviceIdentifier convertToDeviceIdentifierObject(String deviceId){
DeviceIdentifier identifier = new DeviceIdentifier();
identifier.setId(deviceId);
identifier.setType(MobileDeviceManagementConstants.PlatformTypes.MOBILE_DEVICE_TYPE_ANDROID);
return identifier;
=======
public static Device convertToDeviceDTO(String deviceId){
Device device = new Device();
DeviceType type = new DeviceType();
device.setId(deviceId);
type.setName(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
device.setDeviceType(type);
return device;
>>>>>>>
public static DeviceIdentifier convertToDeviceIdentifierObject(String deviceId){
DeviceIdentifier identifier = new DeviceIdentifier();
identifier.setId(deviceId);
identifier.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID);
return identifier; |
<<<<<<<
=======
/**
* Get a list of devices based on the username.
* @param username Username of the device owner.
* @return A list of devices.
* @throws MDMAPIException
*/
@GET
@Produces({ MediaType.APPLICATION_JSON })
@Path("listall/user/{username}")
public List<org.wso2.carbon.device.mgt.common.Device> getAllDeviceOfUser( @PathParam("username") String username)
throws MDMAPIException {
DeviceManagementService dmService;
try {
dmService = MDMAPIUtils.getDeviceManagementService();
return dmService.getDeviceListOfUser(username);
} catch (DeviceManagementServiceException deviceServiceMgtEx) {
String errorMsg = "Device management service error";
log.error(errorMsg, deviceServiceMgtEx);
throw new MDMAPIException(errorMsg, deviceServiceMgtEx);
} catch (DeviceManagementException e) {
String errorMsg = "Device management error";
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
}
}
>>>>>>>
/**
* Get a list of devices based on the username.
* @param username Username of the device owner.
* @return A list of devices.
* @throws MDMAPIException
*/
@GET
@Produces({ MediaType.APPLICATION_JSON })
@Path("listall/user/{username}")
public List<org.wso2.carbon.device.mgt.common.Device> getAllDeviceOfUser( @PathParam("username") String username)
throws MDMAPIException {
DeviceManagementService dmService;
try {
dmService = MDMAPIUtils.getDeviceManagementService();
return dmService.getDeviceListOfUser(username);
} catch (DeviceManagementServiceException deviceServiceMgtEx) {
String errorMsg = "Device management service error";
log.error(errorMsg, deviceServiceMgtEx);
throw new MDMAPIException(errorMsg, deviceServiceMgtEx);
} catch (DeviceManagementException e) {
String errorMsg = "Device management error";
log.error(errorMsg, e);
throw new MDMAPIException(errorMsg, e);
}
} |
<<<<<<<
case Constants.Operation.APP_RESTRICTION:
restrictAccessToApplications(operation);
=======
case Constants.Operation.VPN:
configureVPN(operation);
break;
>>>>>>>
case Constants.Operation.VPN:
configureVPN(operation);
break;
case Constants.Operation.APP_RESTRICTION:
restrictAccessToApplications(operation); |
<<<<<<<
Response deviceCompatibility = state.evaluateCompatibility();
if (!deviceCompatibility.getCode()) {
txtSeverAddress.setText(deviceCompatibility.getDescriptionResourceID());
CommonUtils.callSystemApp(this,"sd","werwe");
=======
Response compatibility = state.evaluateCompatibility();
if (!compatibility.getCode()) {
txtSeverAddress.setText(compatibility.getDescriptionResourceID());
>>>>>>>
Response deviceCompatibility = state.evaluateCompatibility();
if (!deviceCompatibility.getCode()) {
txtSeverAddress.setText(deviceCompatibility.getDescriptionResourceID()); |
<<<<<<<
@Override
public void onProfileProvisioningComplete(Context context, Intent intent) {
Intent launch = new Intent(context, EnableProfileActivity.class);
launch.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
context.startActivity(launch);
}
/**
* Generates a {@link ComponentName} that is used throughout the app.
* @return a {@link ComponentName}
*/
public static ComponentName getComponentName(Context context) {
return new ComponentName(context.getApplicationContext(), AgentDeviceAdminReceiver.class);
}
=======
public void onLockTaskModeEntering(Context context, Intent intent, String pkg) {
Toast.makeText(context, "Device is locked", Toast.LENGTH_LONG).show();
}
public void onLockTaskModeExiting(Context context, Intent intent) {
Toast.makeText(context, "Device is unlocked", Toast.LENGTH_SHORT).show();
}
>>>>>>>
@Override
public void onProfileProvisioningComplete(Context context, Intent intent) {
Intent launch = new Intent(context, EnableProfileActivity.class);
launch.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
context.startActivity(launch);
}
/**
* Generates a {@link ComponentName} that is used throughout the app.
* @return a {@link ComponentName}
*/
public static ComponentName getComponentName(Context context) {
return new ComponentName(context.getApplicationContext(), AgentDeviceAdminReceiver.class);
}
public void onLockTaskModeEntering(Context context, Intent intent, String pkg) {
Toast.makeText(context, "Device is locked", Toast.LENGTH_LONG).show();
}
public void onLockTaskModeExiting(Context context, Intent intent) {
Toast.makeText(context, "Device is unlocked", Toast.LENGTH_SHORT).show();
} |
<<<<<<<
*
=======
>>>>>>> |
<<<<<<<
import com.github.juanmf.java2plant.render.filters.Filter;
import com.github.juanmf.java2plant.render.filters.Filters;
=======
import com.github.juanmf.java2plant.Parser;
import com.github.juanmf.java2plant.structure.Aggregation;
import com.github.juanmf.java2plant.structure.Extension;
>>>>>>>
import com.github.juanmf.java2plant.render.filters.Filter;
import com.github.juanmf.java2plant.render.filters.Filters;
import com.github.juanmf.java2plant.Parser;
import com.github.juanmf.java2plant.structure.Aggregation;
import com.github.juanmf.java2plant.structure.Extension;
<<<<<<<
private final Filter<String> classesFilter;
private final Filter<Class<? extends Relation>> relationsFilter;
=======
private final Set<Pattern> toTypesToShowAsMember;
private final Filter filter;
private static final Map<Class<? extends Relation>, MemberPrinter> memberPrinters = new HashMap<>();
static {
memberPrinters.put(Use.class, new MethodPrinter());
memberPrinters.put(Aggregation.class, new FieldPrinter());
memberPrinters.put(Extension.class, new NullPrinter());
}
>>>>>>>
private final Filter<String> classesFilter;
private final Filter<Class<? extends Relation>> relationsFilter;
private final Set<Pattern> toTypesToShowAsMember;
private static final Map<Class<? extends Relation>, MemberPrinter> memberPrinters = new HashMap<>();
static {
memberPrinters.put(Use.class, new MethodPrinter());
memberPrinters.put(Aggregation.class, new FieldPrinter());
memberPrinters.put(Extension.class, new NullPrinter());
}
<<<<<<<
this.relationsFilter = relationsFilter;
this.classesFilter = classesFilter;
=======
this.filter = filter;
toTypesToShowAsMember = new HashSet<>();
toTypesToShowAsMember.add(Pattern.compile("^java.lang.*"));
>>>>>>>
this.relationsFilter = relationsFilter;
this.classesFilter = classesFilter;
toTypesToShowAsMember = new HashSet<>();
toTypesToShowAsMember.add(Pattern.compile("^java.lang.*"));
<<<<<<<
try {
for (String c : types) {
if (!classesFilter.satisfy(c)){
continue;
}
Class<?> aClass = Class.forName(c);
sb.append(aClass.toString()).append("\n");
=======
for (String c : types) {
try {
Class<?> aClass = Class.forName(c, true, Parser.CLASS_LOADER);
addClass(sb, aClass);
} catch (ClassNotFoundException e) {
System.out.println("ClassNotFoundException: " + e.getMessage());
continue;
}
}
}
protected void addClass(StringBuilder sb, Class<?> aClass) {
if (aClass.getName().contains("$")) {
return;
}
sb.append(aClass.toString()).append(" {\n");
renderClassMembers(sb, aClass);
sb.append("\n} \n ");
}
private void renderClassMembers(StringBuilder sb, Class<?> aClass) {
Iterator<Relation> ri = relations.iterator();
Set<String> fields = new HashSet<>();
Set<String> methods = new HashSet<>();
while (ri.hasNext()) {
Relation relation = ri.next();
if (relation.getFromType().equals(aClass.getName())
&& matches(relation.getToType(), toTypesToShowAsMember)) {
System.out.println(String.format("%s has a relation to %s to be shown as member", aClass.getName(), relation.getToType()));
memberPrinters.get(relation.getClass()).addMember(relation, fields, methods);
ri.remove();
}
}
for (String field : fields) {
sb.append(field + "\n");
}
sb.append("--\n");
for (String method : methods) {
sb.append(method + "\n");
}
}
private boolean matches(String toType, Set<Pattern> toTypesToShowAsAttrs) {
for (Pattern pattern : toTypesToShowAsAttrs) {
Matcher m = pattern.matcher(toType);
if (m.matches()) {
return true;
>>>>>>>
for (String c : types) {
if (!classesFilter.satisfy(c)){
continue;
}
try {
Class<?> aClass = Class.forName(c, true, Parser.CLASS_LOADER);
addClass(sb, aClass);
} catch (ClassNotFoundException e) {
System.out.println("ClassNotFoundException: " + e.getMessage());
continue;
}
}
}
protected void addClass(StringBuilder sb, Class<?> aClass) {
if (aClass.getName().contains("$")) {
return;
}
sb.append(aClass.toString()).append(" {\n");
renderClassMembers(sb, aClass);
sb.append("\n} \n ");
}
private void renderClassMembers(StringBuilder sb, Class<?> aClass) {
Iterator<Relation> ri = relations.iterator();
Set<String> fields = new HashSet<>();
Set<String> methods = new HashSet<>();
while (ri.hasNext()) {
Relation relation = ri.next();
if (relation.getFromType().equals(aClass.getName())
&& matches(relation.getToType(), toTypesToShowAsMember)) {
System.out.println(String.format("%s has a relation to %s to be shown as member", aClass.getName(), relation.getToType()));
memberPrinters.get(relation.getClass()).addMember(relation, fields, methods);
ri.remove();
}
}
for (String field : fields) {
sb.append(field + "\n");
}
sb.append("--\n");
for (String method : methods) {
sb.append(method + "\n");
}
}
private boolean matches(String toType, Set<Pattern> toTypesToShowAsAttrs) {
for (Pattern pattern : toTypesToShowAsAttrs) {
Matcher m = pattern.matcher(toType);
if (m.matches()) {
return true; |
<<<<<<<
=======
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
return Arrays.<NativeModule>asList(
new ExtraDimensionsModule(reactContext)
);
}
>>>>>>>
<<<<<<<
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new ExtraDimensionsModule(reactContext));
return modules;
}
}
=======
}
>>>>>>>
@Override
public List<NativeModule> createNativeModules(ReactApplicationContext reactContext) {
List<NativeModule> modules = new ArrayList<>();
modules.add(new ExtraDimensionsModule(reactContext));
return modules;
}
} |
<<<<<<<
public void showSessionDetail(@NonNull Fragment fragment, @NonNull Session session, int requestCode) {
SessionDetailActivity.startForResult(fragment, session, requestCode);
}
public void showMain(@NonNull Activity activity) {
MainActivity.start(activity);
=======
public void showMain(@NonNull Activity activity, boolean shouldRefresh) {
MainActivity.start(activity, shouldRefresh);
>>>>>>>
public void showSessionDetail(@NonNull Fragment fragment, @NonNull Session session, int requestCode) {
SessionDetailActivity.startForResult(fragment, session, requestCode);
}
public void showMain(@NonNull Activity activity, boolean shouldRefresh) {
MainActivity.start(activity, shouldRefresh); |
<<<<<<<
import retrofit2.GsonConverterFactory;
import retrofit2.Response;
=======
>>>>>>>
import retrofit2.Response;
<<<<<<<
import retrofit2.RxJavaCallAdapterFactory;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
=======
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
>>>>>>>
import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded; |
<<<<<<<
import com.microsoft.codepush.react.CodePush;
import com.reactnativejitsimeet.JitsiMeetPackage;
=======
import com.centaurwarchief.smslistener.SmsListenerPackage;
>>>>>>>
import com.reactnativejitsimeet.JitsiMeetPackage;
<<<<<<<
new CodePush("_C083_CqL7CmKwASrv6Xrj1wqH7erJMhIBnRQ", MainApplication.this, BuildConfig.DEBUG),
new JitsiMeetPackage(),
=======
new SmsListenerPackage(),
>>>>>>>
new JitsiMeetPackage(), |
<<<<<<<
import com.RNRSA.RNRSAPackage;
=======
import com.brentvatne.react.ReactVideoPackage;
>>>>>>>
import com.RNRSA.RNRSAPackage;
import com.brentvatne.react.ReactVideoPackage;
<<<<<<<
new RNRSAPackage(),
=======
new ReactVideoPackage(),
>>>>>>>
new RNRSAPackage(),
new ReactVideoPackage(), |
<<<<<<<
ElasticTestUtils.configure(
elasticsearchConfig, nodeInfo.hostname, nodeInfo.port, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig));
=======
ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
>>>>>>>
ElasticTestUtils.configure(elasticsearchConfig, container, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig)); |
<<<<<<<
import java.util.HashSet;
=======
>>>>>>>
import java.util.HashSet;
<<<<<<<
import java.util.Set;
=======
>>>>>>>
import java.util.Set;
<<<<<<<
// we have removed all generated values for RECORD_TYPE_1, _2 and _3, so 'allPossibleValuesForRecordType123' has be empty now
for (Set<String> valuesForRecordType123 : allPossibleValuesForRecordType123) {
Assert.fail("Oops! We have not generated combanation for for RECORD_TYPE_1, _2 and _3 - '" + valuesForRecordType123 + "'!");
}
} catch (ModelException ex) {
Assert.fail("Oops! ModelException = " + e);
}
}
private Set<Set<String>> generateAllPossibleValues() {
Set<Set<String>> result = new HashSet<Set<String>>();
for (String val1 : setRecordType1) {
for (String val2 : setRecordType2) {
for (String val3 : setRecordType3) {
Set<String> record = new HashSet<String>();
record.add(val1);
record.add(val2);
record.add(val3);
result.add(record);
}
}
}
return result;
}
/**
=======
} catch (ModelException ex) {
Assert.fail();
}
}
/**
>>>>>>>
// we have removed all generated values for RECORD_TYPE_1, _2 and _3, so 'allPossibleValuesForRecordType123' has be empty now
for (Set<String> valuesForRecordType123 : allPossibleValuesForRecordType123) {
Assert.fail("Oops! We have not generated combanation for for RECORD_TYPE_1, _2 and _3 - '" + valuesForRecordType123 + "'!");
}
} catch (ModelException ex) {
Assert.fail("Oops! ModelException = " + e);
}
}
private Set<Set<String>> generateAllPossibleValues() {
Set<Set<String>> result = new HashSet<Set<String>>();
for (String val1 : setRecordType1) {
for (String val2 : setRecordType2) {
for (String val3 : setRecordType3) {
Set<String> record = new HashSet<String>();
record.add(val1);
record.add(val2);
record.add(val3);
result.add(record);
}
}
}
return result;
}
/** |
<<<<<<<
public static ProtoBlock noOpBlock() {
return new ProtoBlock() {
public ProtoObject applyTo(ProtoObject r, ThisContext t) {
return ProtoObject.NIL;
}
};
}
=======
public static ProtoObject p216(ProtoObject receiver, ThisContext thisContext, ProtoObject arg1, ProtoObject arg2, ProtoObject arg3, ProtoObject arg4, ProtoObject arg5, ProtoObject arg6, ProtoObject arg7) {
throw RedlineException.withMessage(arg1.javaValue().toString());
}
>>>>>>>
public static ProtoBlock noOpBlock() {
return new ProtoBlock() {
public ProtoObject applyTo(ProtoObject r, ThisContext t) {
return ProtoObject.NIL;
}
};
}
public static ProtoObject p216(ProtoObject receiver, ThisContext thisContext, ProtoObject arg1, ProtoObject arg2, ProtoObject arg3, ProtoObject arg4, ProtoObject arg5, ProtoObject arg6, ProtoObject arg7) {
throw RedlineException.withMessage(arg1.javaValue().toString());
} |
<<<<<<<
private final PatchSetInfoFactory psInfoFactory;
=======
private final PersonIdent myIdent;
>>>>>>>
private final PatchSetInfoFactory psInfoFactory;
private final PersonIdent myIdent;
<<<<<<<
final PatchSetInfoFactory psif,
PatchListCache patchListCache, SchemaFactory<ReviewDb> schema) {
=======
PatchListCache patchListCache, SchemaFactory<ReviewDb> schema,
@GerritPersonIdent PersonIdent myIdent) {
>>>>>>>
final PatchSetInfoFactory psif,
PatchListCache patchListCache, SchemaFactory<ReviewDb> schema,
@GerritPersonIdent PersonIdent myIdent) {
<<<<<<<
this.psInfoFactory = psif;
=======
this.myIdent = myIdent;
>>>>>>>
this.psInfoFactory = psif;
this.myIdent = myIdent; |
<<<<<<<
proto
.getPatchSetList()
.stream()
.map(bytes -> parseProtoFrom(PatchSetProtoConverter.INSTANCE, bytes))
=======
proto.getPatchSetList().stream()
.map(PATCH_SET_CODEC::decode)
>>>>>>>
proto.getPatchSetList().stream()
.map(bytes -> parseProtoFrom(PatchSetProtoConverter.INSTANCE, bytes))
<<<<<<<
proto
.getApprovalList()
.stream()
.map(bytes -> parseProtoFrom(PatchSetApprovalProtoConverter.INSTANCE, bytes))
=======
proto.getApprovalList().stream()
.map(APPROVAL_CODEC::decode)
>>>>>>>
proto.getApprovalList().stream()
.map(bytes -> parseProtoFrom(PatchSetApprovalProtoConverter.INSTANCE, bytes))
<<<<<<<
proto
.getChangeMessageList()
.stream()
.map(bytes -> parseProtoFrom(ChangeMessageProtoConverter.INSTANCE, bytes))
=======
proto.getChangeMessageList().stream()
.map(MESSAGE_CODEC::decode)
>>>>>>>
proto.getChangeMessageList().stream()
.map(bytes -> parseProtoFrom(ChangeMessageProtoConverter.INSTANCE, bytes)) |
<<<<<<<
import won.protocol.owner.OwnerProtocolOwnerServiceClient;
=======
import won.protocol.repository.FacetRepository;
>>>>>>>
import won.protocol.owner.OwnerProtocolOwnerServiceClient;
import won.protocol.repository.FacetRepository;
<<<<<<<
private OwnerProtocolOwnerServiceClient ownerProtocolOwnerService;
=======
>>>>>>>
private OwnerProtocolOwnerServiceClient ownerProtocolOwnerService;
<<<<<<<
public void setOwnerProtocolOwnerService(final OwnerProtocolOwnerServiceClient ownerProtocolOwnerService)
{
this.ownerProtocolOwnerService = ownerProtocolOwnerService;
}
=======
>>>>>>>
public void setOwnerProtocolOwnerService(final OwnerProtocolOwnerServiceClient ownerProtocolOwnerService)
{
this.ownerProtocolOwnerService = ownerProtocolOwnerService;
} |
<<<<<<<
import java.net.URI;
import java.time.Duration;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
=======
>>>>>>>
<<<<<<<
//acknowledge the command
Model messageModel = WonRdfUtils.MessageUtils.textMessage("Ok, I'm going to validate the data in our connection. This may take a while.");
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
//start validation behaviour
ValidateConnectionCommandEvent command = new ValidateConnectionCommandEvent(con.getNeedURI(), con.getConnectionURI());
ValidateConnectionDataBehaviour validateConnectionDataBehaviour = new ValidateConnectionDataBehaviour(ctx,command, Duration.ofSeconds(60));
validateConnectionDataBehaviour.onResult(new BaseEventBotAction(ctx) {
@Override
protected void doRun(Event event, EventListener executingListener) throws Exception {
if (event instanceof ValidateConnectionCommandSuccessEvent) {
ValidateConnectionCommandSuccessEvent successEvent = (ValidateConnectionCommandSuccessEvent) event;
Model messageModel = WonRdfUtils.MessageUtils
.textMessage(successEvent.getMessage());
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
if (!successEvent.isValid()) {
String message = successEvent.getMessage();
if (message == null || message.trim().length() == 0) {
message = "[no message available]";
}
messageModel = WonRdfUtils.MessageUtils
.textMessage("Problem report: " + message);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
}
} else if (event instanceof ValidateConnectionCommandFailureEvent){
String message = ((ValidateConnectionCommandFailureEvent)event).getMessage();
if (message == null || message.trim().length() == 0) {
message = "[no message available]";
}
Model messageModel = WonRdfUtils.MessageUtils
.textMessage("Could not validate connection data. Problem: " + message);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
}
}
});
validateConnectionDataBehaviour.activate();
} else if (PATTERN_RETRACT.matcher(message).matches()) {
URI targetUri = URI.create("https://example.com/to/be/implemented");
Model messageModel = WonRdfUtils.MessageUtils.textMessage("Ok, I am hereby retracting my last message (not yet implemented)");
messageModel = WonRdfUtils.MessageUtils.addRetracts(messageModel, targetUri);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
} else if (PATTERN_RETRACT_MINE.matcher(message).matches()) {
URI targetUri = URI.create("https://example.com/to/be/implemented");
Model messageModel = WonRdfUtils.MessageUtils.textMessage("Ok, I am hereby retracting your last message (not yet implemented)");
messageModel = WonRdfUtils.MessageUtils.addRetracts(messageModel, targetUri);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
} else if (PATTERN_PROPOSE.matcher(message).matches()) {
URI targetUri = URI.create("https://example.com/to/be/implemented");
Model messageModel = WonRdfUtils.MessageUtils.textMessage("Ok, I am hereby proposing my last message for an agreement (not yet implemented)");
messageModel = WonRdfUtils.MessageUtils.addProposes(messageModel, targetUri);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
} else if (PATTERN_PROPOSE_MINE.matcher(message).matches()) {
URI targetUri = URI.create("https://example.com/to/be/implemented");
Model messageModel = WonRdfUtils.MessageUtils.textMessage("Ok, I am hereby proposing your last message for an agreement (not yet implemented)");
messageModel = WonRdfUtils.MessageUtils.addProposes(messageModel, targetUri);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
} else if (PATTERN_ACCEPT.matcher(message).matches()) {
URI targetUri = URI.create("https://example.com/to/be/implemented");
Model messageModel = WonRdfUtils.MessageUtils.textMessage("Ok, I am hereby accepting the newest open proposal I find (not yet implemented)");
messageModel = WonRdfUtils.MessageUtils.addAccepts(messageModel, targetUri);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
} else if (PATTERN_ACCEPT_PROPOSAL_TO_CANCEL.matcher(message).matches()) {
URI targetUri = URI.create("https://example.com/to/be/implemented");
Model messageModel = WonRdfUtils.MessageUtils.textMessage("Ok, I am hereby accepting the lates proposal to cancel I find (not yet implemented)");
messageModel = WonRdfUtils.MessageUtils.addAccepts(messageModel, targetUri);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
} else if (PATTERN_PROPOSE_TO_CANCEL.matcher(message).matches()) {
URI targetUri = URI.create("https://example.com/to/be/implemented");
Model messageModel = WonRdfUtils.MessageUtils.textMessage("Ok, I am hereby proposing to cancel the latest agreement I find (not yet implemented)");
messageModel = WonRdfUtils.MessageUtils.addProposesToCancel(messageModel, targetUri);
bus.publish(new ConnectionMessageCommandEvent(con, messageModel));
=======
validate(ctx,bus,con);
} else if (PATTERN_RETRACT.matcher(message).matches()) {
retractLatestMessage(ctx, bus, con);
} else if (PATTERN_RETRACT_MINE.matcher(message).matches()) {
retractLatestMessageOfCounterpart(ctx, bus, con);
} else if (PATTERN_PROPOSE.matcher(message).matches()) {
proposeLatestMessage(ctx, bus, con);
} else if (PATTERN_PROPOSE_MINE.matcher(message).matches()) {
proposeLatestMessageOfCounterpart(ctx, bus, con);
} else if (PATTERN_ACCEPT.matcher(message).matches()) {
acceptLatestProposal(ctx, bus, con);
} else if (PATTERN_ACCEPT_PROPOSAL_TO_CANCEL.matcher(message).matches()) {
acceptLatestProposalToCancel(ctx, bus, con);
} else if (PATTERN_PROPOSE_TO_CANCEL.matcher(message).matches()) {
proposeToCancelLatestAccept(ctx, bus, con);
>>>>>>>
validate(ctx,bus,con);
} else if (PATTERN_RETRACT.matcher(message).matches()) {
retractLatestMessage(ctx, bus, con);
} else if (PATTERN_RETRACT_MINE.matcher(message).matches()) {
retractLatestMessageOfCounterpart(ctx, bus, con);
} else if (PATTERN_PROPOSE.matcher(message).matches()) {
proposeLatestMessage(ctx, bus, con);
} else if (PATTERN_PROPOSE_MINE.matcher(message).matches()) {
proposeLatestMessageOfCounterpart(ctx, bus, con);
} else if (PATTERN_ACCEPT.matcher(message).matches()) {
acceptLatestProposal(ctx, bus, con);
} else if (PATTERN_ACCEPT_PROPOSAL_TO_CANCEL.matcher(message).matches()) {
acceptLatestProposalToCancel(ctx, bus, con);
} else if (PATTERN_PROPOSE_TO_CANCEL.matcher(message).matches()) {
proposeToCancelLatestAccept(ctx, bus, con); |
<<<<<<<
import com.hp.hpl.jena.vocabulary.DCTerms;
=======
import com.hp.hpl.jena.vocabulary.RDF;
>>>>>>>
import com.hp.hpl.jena.vocabulary.DCTerms;
import com.hp.hpl.jena.vocabulary.RDF; |
<<<<<<<
ElasticTestUtils.configure(elasticsearchConfig, nodeInfo.port, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig));
=======
ElasticTestUtils.configure(
elasticsearchConfig, nodeInfo.hostname, nodeInfo.port, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig, notesMigration));
>>>>>>>
ElasticTestUtils.configure(
elasticsearchConfig, nodeInfo.hostname, nodeInfo.port, indicesPrefix);
return Guice.createInjector(new InMemoryModule(elasticsearchConfig)); |
<<<<<<<
import won.bot.framework.eventbot.bus.EventBus;
=======
import won.bot.framework.eventbot.action.impl.needlifecycle.AbstractCreateNeedAction;
>>>>>>>
import won.bot.framework.eventbot.bus.EventBus;
import won.bot.framework.eventbot.action.impl.needlifecycle.AbstractCreateNeedAction; |
<<<<<<<
=======
import won.bot.framework.events.action.impl.CreateNeedWithFacetsAction;
import won.bot.framework.events.bus.EventBus;
>>>>>>>
import won.bot.framework.events.action.impl.CreateNeedWithFacetsAction;
import won.bot.framework.events.bus.EventBus;
<<<<<<<
import won.bot.framework.events.action.BaseEventBotAction;
import won.bot.framework.events.action.impl.*;
import won.bot.framework.events.bus.EventBus;
import won.bot.framework.events.event.Event;
import won.bot.framework.events.event.impl.*;
import won.bot.framework.events.listener.BaseEventListener;
=======
import won.bot.framework.events.event.impl.ActEvent;
import won.bot.framework.events.event.impl.HintFromMatcherEvent;
import won.bot.framework.events.event.impl.NeedCreatedEvent;
import won.bot.framework.events.event.impl.NeedDeactivatedEvent;
import won.bot.framework.events.listener.*;
import won.bot.framework.events.action.impl.DeactivateAllNeedsAction;
import won.bot.framework.events.action.impl.MatchNeedsAction;
import won.bot.framework.events.action.impl.SignalWorkDoneAction;
>>>>>>>
import won.bot.framework.events.event.impl.ActEvent;
import won.bot.framework.events.event.impl.HintFromMatcherEvent;
import won.bot.framework.events.event.impl.NeedCreatedEvent;
import won.bot.framework.events.event.impl.NeedDeactivatedEvent;
import won.bot.framework.events.listener.*;
import won.bot.framework.events.action.impl.DeactivateAllNeedsAction;
import won.bot.framework.events.action.impl.MatchNeedsAction;
import won.bot.framework.events.action.impl.SignalWorkDoneAction;
import won.bot.framework.events.action.BaseEventBotAction;
import won.bot.framework.events.action.impl.*;
import won.bot.framework.events.bus.EventBus;
import won.bot.framework.events.event.Event;
import won.bot.framework.events.event.impl.*;
import won.bot.framework.events.listener.BaseEventListener; |
<<<<<<<
import won.protocol.model.Need;
=======
>>>>>>>
import won.protocol.model.Need;
<<<<<<<
import java.util.List;
import java.util.Set;
=======
>>>>>>>
import java.util.List;
import java.util.Set; |
<<<<<<<
import org.springframework.beans.factory.annotation.Autowired;
import won.protocol.need.NeedProtocolNeedClientSide;
=======
import won.node.facet.impl.FacetRegistry;
>>>>>>>
import org.springframework.beans.factory.annotation.Autowired;
import won.protocol.need.NeedProtocolNeedClientSide;
import won.node.facet.impl.FacetRegistry;
<<<<<<<
import won.protocol.util.DataAccessUtils;
import won.node.protocol.impl.MessageProducer;
=======
>>>>>>>
import won.protocol.util.DataAccessUtils;
import won.node.protocol.impl.MessageProducer;
<<<<<<<
private NeedProtocolNeedClientSide needFacingConnectionClient;
private ExecutorService executorService;
@Autowired
private ConnectionRepository connectionRepository;
@Autowired
private ChatMessageRepository chatMessageRepository;
@Autowired
private EventRepository eventRepository;
@Autowired
private RDFStorageService rdfStorageService;
@Autowired
private MessageProducer messageProducer;
=======
private FacetRegistry reg;
private DataAccessService dataService;
>>>>>>>
private FacetRegistry reg;
private DataAccessService dataService; |
<<<<<<<
=======
public static final Property HAS_ATTACHED_MEDIA = m.createProperty(BASE_URI, "hasAttachedMedia");
public static final Property HAS_HEIGHT = m.createProperty(BASE_URI, "hasHeight");
public static final Property HAS_DEPTH = m.createProperty(BASE_URI, "hasDepth");
public static final Property HAS_WIDTH = m.createProperty(BASE_URI, "hasWidth");
public static final Property HAS_WEIGHT = m.createProperty(BASE_URI, "hasWeight");
public static final Property HAS_QUANTITATIVE_PROPERTY = m.createProperty(BASE_URI, "hasQuantitativeProperty");
>>>>>>>
public static final Property HAS_ATTACHED_MEDIA = m.createProperty(BASE_URI, "hasAttachedMedia");
public static final Property HAS_HEIGHT = m.createProperty(BASE_URI, "hasHeight");
public static final Property HAS_DEPTH = m.createProperty(BASE_URI, "hasDepth");
public static final Property HAS_WIDTH = m.createProperty(BASE_URI, "hasWidth");
public static final Property HAS_WEIGHT = m.createProperty(BASE_URI, "hasWeight");
public static final Property HAS_QUANTITATIVE_PROPERTY = m.createProperty(BASE_URI, "hasQuantitativeProperty");
<<<<<<<
public static final Property COORDINATION_MESSAGE = m.createProperty(BASE_URI + "coordinationMessage");
=======
>>>>>>>
public static final Property COORDINATION_MESSAGE = m.createProperty(BASE_URI + "coordinationMessage"); |
<<<<<<<
List<MessageData> logs = mockedIngestion.getMessageDataInRequest();
=======
RequestData rd = (RequestData) ((Data) rdEnvelope.getData()).getBaseData();
List<MessageData> logs = mockedIngestion.getTelemetryDataByType("MessageData");
>>>>>>>
RequestData rd = (RequestData) ((Data) rdEnvelope.getData()).getBaseData();
List<MessageData> logs = mockedIngestion.getMessageDataInRequest(); |
<<<<<<<
public List<ProcessorConfig> processors = new ArrayList<>();
=======
public boolean openTelemetryApiSupport;
>>>>>>>
public List<ProcessorConfig> processors = new ArrayList<>();
public boolean openTelemetryApiSupport; |
<<<<<<<
assertEquals("www.bing.com:-1 | www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
=======
assertEquals("www.bing.com", rdd.getTarget());
assertTrue(rdd.getId().contains(rd.getId()));
>>>>>>>
assertEquals("www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
<<<<<<<
assertEquals("www.bing.com:-1 | www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
=======
assertEquals("www.bing.com", rdd.getTarget());
assertTrue(rdd.getId().contains(rd.getId()));
>>>>>>>
assertEquals("www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
<<<<<<<
assertEquals("www.bing.com:-1 | www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
=======
assertEquals("www.bing.com", rdd.getTarget());
assertTrue(rdd.getId().contains(rd.getId()));
>>>>>>>
assertEquals("www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
<<<<<<<
assertEquals("www.bing.com:-1 | www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
=======
assertEquals("www.bing.com", rdd.getTarget());
assertTrue(rdd.getId().contains(rd.getId()));
>>>>>>>
assertEquals("www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
<<<<<<<
assertEquals("www.bing.com:-1 | www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
=======
assertEquals("www.bing.com", rdd.getTarget());
assertTrue(rdd.getId().contains(rd.getId()));
>>>>>>>
assertEquals("www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
<<<<<<<
assertEquals("www.bing.com:-1 | www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
}
private static void assertParentChild(RequestData rd, Envelope rdEnvelope, Envelope rddEnvelope) {
String operationId = rdEnvelope.getTags().get("ai.operation.id");
assertNotNull(operationId);
assertEquals(operationId, rddEnvelope.getTags().get("ai.operation.id"));
assertEquals(rd.getId(), rddEnvelope.getTags().get("ai.operation.parentId"));
=======
assertEquals("www.bing.com", rdd.getTarget());
assertTrue(rdd.getId().contains(rd.getId()));
>>>>>>>
assertEquals("www.bing.com", rdd.getTarget());
assertParentChild(rd, rdEnvelope, rddEnvelope);
}
private static void assertParentChild(RequestData rd, Envelope rdEnvelope, Envelope rddEnvelope) {
String operationId = rdEnvelope.getTags().get("ai.operation.id");
assertNotNull(operationId);
assertEquals(operationId, rddEnvelope.getTags().get("ai.operation.id"));
assertEquals(rd.getId(), rddEnvelope.getTags().get("ai.operation.parentId")); |
<<<<<<<
public static class ProcessorConfig {
public ProcessorType type;
public String processorName;
public ProcessorIncludeExclude include;
public ProcessorIncludeExclude exclude;
public List<ProcessorAction> actions; // specific for processor type "attributes"
public NameConfig name; // specific for processor types "log" and "span"
private static void isValidRegex(String value) {
try {
Pattern.compile(value);
} catch (PatternSyntaxException exception) {
throw new ConfigurationException("User provided processor config do not have valid regex:" + value);
}
}
public boolean isValid() {
if (type == null) return false;
//if (processorName == null || processorName.length() == 0) return false;
if (include != null && !include.isValid(type)) {
return false;
}
if (exclude != null && !exclude.isValid(type)) {
return false;
}
return hasValidAttributeProcessorConfig() && hasValidLogOrSpanProcessorConfig();
}
public boolean hasValidAttributeProcessorConfig() {
if (type == ProcessorType.attribute) {
if (actions == null || actions.isEmpty()) {
return false;
}
for (ProcessorAction action : actions) {
if (!action.isValid()) return false;
}
}
return true;
}
public boolean hasValidLogOrSpanProcessorConfig() {
if (type == ProcessorType.log || type == ProcessorType.span) {
if (name == null) return false;
return name.isValid();
}
return true;
}
}
public static class NameConfig {
public List<String> fromAttributes;
public ToAttributeConfig toAttributes;
public String separator;
public boolean isValid() {
if (fromAttributes == null && toAttributes == null) return false;
if (toAttributes != null) return toAttributes.isValid();
return separator == null || separator.length() != 0;
}
}
public static class ToAttributeConfig {
public List<String> rules;
public boolean isValid() {
if(rules==null || rules.isEmpty()) return false;
for (String rule : rules) {
ProcessorConfig.isValidRegex(rule);
}
return true;
}
}
public static class ProcessorIncludeExclude {
public ProcessorMatchType matchType;
public List<String> spanNames;
public List<String> logNames;
public List<ProcessorAttribute> attributes;
public boolean isValid(ProcessorType processorType) {
if (this.matchType == null) return false;
if (this.attributes != null) {
for (ProcessorAttribute attribute : this.attributes) {
if (attribute.key == null) return false;
if (this.matchType == ProcessorMatchType.regexp && attribute.value != null) {
ProcessorConfig.isValidRegex(attribute.value);
}
}
}
if (processorType == ProcessorType.attribute) {
return hasValidAttributeProcessorIncludeExclude();
} else if (processorType == ProcessorType.log) {
return hasValidLogProcessorIncludeExclude();
} else {
return hasValidSpanProcessorIncludeExclude();
}
}
private boolean hasValidAttributeProcessorIncludeExclude() {
if (spanNames == null && attributes == null) return false;
if (spanNames != null && matchType == ProcessorMatchType.regexp) {
for (String spanName : spanNames) {
ProcessorConfig.isValidRegex(spanName);
}
}
return true;
}
private boolean hasValidLogProcessorIncludeExclude() {
if (logNames == null && attributes == null) return false;
if (logNames != null && matchType == ProcessorMatchType.regexp) {
for (String logName : logNames) {
ProcessorConfig.isValidRegex(logName);
}
}
return true;
}
private boolean hasValidSpanProcessorIncludeExclude() {
if (spanNames == null && attributes == null) return false;
if (spanNames != null && matchType == ProcessorMatchType.regexp) {
for (String spanName : spanNames) {
ProcessorConfig.isValidRegex(spanName);
}
}
return true;
}
}
public static class ProcessorAttribute {
public String key;
public String value;
}
public static class ProcessorAction {
public String key;
public ProcessorActionType action;
public String value;
public String fromAttribute;
public boolean isValid() {
if (this.key == null) return false;
if (this.action == null) return false;
if (this.action == ProcessorActionType.insert || this.action == ProcessorActionType.update) {
return this.value != null || this.fromAttribute != null;
}
return true;
}
}
=======
// transient so that Moshi will ignore when binding from json
public transient Path configPath;
// transient so that Moshi will ignore when binding from json
public transient long lastModifiedTime;
>>>>>>>
public static class ProcessorConfig {
public ProcessorType type;
public String processorName;
public ProcessorIncludeExclude include;
public ProcessorIncludeExclude exclude;
public List<ProcessorAction> actions; // specific for processor type "attributes"
public NameConfig name; // specific for processor types "log" and "span"
private static void isValidRegex(String value) {
try {
Pattern.compile(value);
} catch (PatternSyntaxException exception) {
throw new ConfigurationException("User provided processor config do not have valid regex:" + value);
}
}
public boolean isValid() {
if (type == null) return false;
//if (processorName == null || processorName.length() == 0) return false;
if (include != null && !include.isValid(type)) {
return false;
}
if (exclude != null && !exclude.isValid(type)) {
return false;
}
return hasValidAttributeProcessorConfig() && hasValidLogOrSpanProcessorConfig();
}
public boolean hasValidAttributeProcessorConfig() {
if (type == ProcessorType.attribute) {
if (actions == null || actions.isEmpty()) {
return false;
}
for (ProcessorAction action : actions) {
if (!action.isValid()) return false;
}
}
return true;
}
public boolean hasValidLogOrSpanProcessorConfig() {
if (type == ProcessorType.log || type == ProcessorType.span) {
if (name == null) return false;
return name.isValid();
}
return true;
}
}
public static class NameConfig {
public List<String> fromAttributes;
public ToAttributeConfig toAttributes;
public String separator;
public boolean isValid() {
if (fromAttributes == null && toAttributes == null) return false;
if (toAttributes != null) return toAttributes.isValid();
return separator == null || separator.length() != 0;
}
}
public static class ToAttributeConfig {
public List<String> rules;
public boolean isValid() {
if(rules==null || rules.isEmpty()) return false;
for (String rule : rules) {
ProcessorConfig.isValidRegex(rule);
}
return true;
}
}
public static class ProcessorIncludeExclude {
public ProcessorMatchType matchType;
public List<String> spanNames;
public List<String> logNames;
public List<ProcessorAttribute> attributes;
public boolean isValid(ProcessorType processorType) {
if (this.matchType == null) return false;
if (this.attributes != null) {
for (ProcessorAttribute attribute : this.attributes) {
if (attribute.key == null) return false;
if (this.matchType == ProcessorMatchType.regexp && attribute.value != null) {
ProcessorConfig.isValidRegex(attribute.value);
}
}
}
if (processorType == ProcessorType.attribute) {
return hasValidAttributeProcessorIncludeExclude();
} else if (processorType == ProcessorType.log) {
return hasValidLogProcessorIncludeExclude();
} else {
return hasValidSpanProcessorIncludeExclude();
}
}
private boolean hasValidAttributeProcessorIncludeExclude() {
if (spanNames == null && attributes == null) return false;
if (spanNames != null && matchType == ProcessorMatchType.regexp) {
for (String spanName : spanNames) {
ProcessorConfig.isValidRegex(spanName);
}
}
return true;
}
private boolean hasValidLogProcessorIncludeExclude() {
if (logNames == null && attributes == null) return false;
if (logNames != null && matchType == ProcessorMatchType.regexp) {
for (String logName : logNames) {
ProcessorConfig.isValidRegex(logName);
}
}
return true;
}
private boolean hasValidSpanProcessorIncludeExclude() {
if (spanNames == null && attributes == null) return false;
if (spanNames != null && matchType == ProcessorMatchType.regexp) {
for (String spanName : spanNames) {
ProcessorConfig.isValidRegex(spanName);
}
}
return true;
}
}
public static class ProcessorAttribute {
public String key;
public String value;
}
public static class ProcessorAction {
public String key;
public ProcessorActionType action;
public String value;
public String fromAttribute;
public boolean isValid() {
if (this.key == null) return false;
if (this.action == null) return false;
if (this.action == ProcessorActionType.insert || this.action == ProcessorActionType.update) {
return this.value != null || this.fromAttribute != null;
}
return true;
}
}
// transient so that Moshi will ignore when binding from json
public transient Path configPath;
// transient so that Moshi will ignore when binding from json
public transient long lastModifiedTime; |
<<<<<<<
=======
import io.opentelemetry.instrumentation.api.aiconnectionstring.AiConnectionString;
import io.opentelemetry.javaagent.config.ConfigOverride;
>>>>>>>
import io.opentelemetry.instrumentation.api.aiconnectionstring.AiConnectionString; |
<<<<<<<
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
=======
import com.google.common.collect.Sets;
>>>>>>>
import com.google.common.collect.Iterables;
import com.google.common.collect.Sets;
<<<<<<<
Set<Class<?>> interfaces = Sets.newLinkedHashSet();
=======
// TODO Don't want the proxy to have to implement EntityLocal, but required by how
// AbstractEntity.parent is used (e.g. parent.getAllConfig)
MutableSet.Builder<Class<?>> builder = MutableSet.<Class<?>>builder()
.add(EntityProxy.class, Entity.class, EntityLocal.class, EntityInternal.class);
>>>>>>>
Set<Class<?>> interfaces = Sets.newLinkedHashSet();
<<<<<<<
interfaces.addAll(spec.getAdditionalInterfaces());
return createEntityProxy(interfaces, entity);
}
@SuppressWarnings("unchecked")
public <T extends Entity> T createEntityProxy(Iterable<Class<?>> interfaces, T entity) {
// TODO Don't want the proxy to have to implement EntityLocal, but required by how
// AbstractEntity.parent is used (e.g. parent.getAllConfig)
Set<Class<?>> allInterfaces = MutableSet.<Class<?>>builder()
.add(EntityProxy.class, Entity.class, EntityLocal.class, EntityInternal.class)
.addAll(interfaces)
.build();
// TODO OSGi strangeness! The classloader obtained from the type should be enough.
// If an OSGi class loader, it should delegate to find things like Entity.class etc.
// However, we get errors such as:
=======
builder.addAll(spec.getAdditionalInterfaces());
Set<Class<?>> interfaces = builder.build();
// When using the entity's classloader, we get errors such as:
>>>>>>>
interfaces.addAll(spec.getAdditionalInterfaces());
return createEntityProxy(interfaces, entity);
}
@SuppressWarnings("unchecked")
public <T extends Entity> T createEntityProxy(Iterable<Class<?>> interfaces, T entity) {
// TODO Don't want the proxy to have to implement EntityLocal, but required by how
// AbstractEntity.parent is used (e.g. parent.getAllConfig)
Set<Class<?>> allInterfaces = MutableSet.<Class<?>>builder()
.add(EntityProxy.class, Entity.class, EntityLocal.class, EntityInternal.class)
.addAll(interfaces)
.build();
// TODO OSGi strangeness! The classloader obtained from the type should be enough.
// If an OSGi class loader, it should delegate to find things like Entity.class etc.
// However, we get errors such as:
<<<<<<<
// But we really should not have to do this! What are the consequences?
AggregateClassLoader aggregateClassLoader = AggregateClassLoader.newInstanceWithNoLoaders();
aggregateClassLoader.addFirst(entity.getClass().getClassLoader());
for(Class<?> iface : allInterfaces) {
aggregateClassLoader.addLast(iface.getClassLoader());
=======
//
// The reason for the error is that the proxy tries to load all classes
// referenced from the entity and its interfaces with the single passed loader
// while a normal class loading would nest the class loaders (loading interfaces'
// references with their own class loaders which in our case are different).
Collection<ClassLoader> loaders = Sets.newLinkedHashSet();
addClassLoaders(entity.getClass(), loaders);
for(Class<?> iface : interfaces) {
loaders.add(iface.getClassLoader());
}
AggregateClassLoader aggregateClassLoader = AggregateClassLoader.newInstanceWithNoLoaders();
for (ClassLoader cl : loaders) {
aggregateClassLoader.addLast(cl);
>>>>>>>
// But we really should not have to do this! What are the consequences?
//
// The reason for the error is that the proxy tries to load all classes
// referenced from the entity and its interfaces with the single passed loader
// while a normal class loading would nest the class loaders (loading interfaces'
// references with their own class loaders which in our case are different).
Collection<ClassLoader> loaders = Sets.newLinkedHashSet();
addClassLoaders(entity.getClass(), loaders);
for (Class<?> iface : allInterfaces) {
loaders.add(iface.getClassLoader());
}
AggregateClassLoader aggregateClassLoader = AggregateClassLoader.newInstanceWithNoLoaders();
for (ClassLoader cl : loaders) {
aggregateClassLoader.addLast(cl);
<<<<<<<
=======
private void addClassLoaders(Class<?> type, Collection<ClassLoader> loaders) {
ClassLoader cl = type.getClassLoader();
//java.lang.Object.getClassLoader() = null
if (cl != null) {
loaders.add(cl);
}
Class<?> superType = type.getSuperclass();
if (superType != null) {
addClassLoaders(superType, loaders);
}
for (Class<?> iface : type.getInterfaces()) {
addClassLoaders(iface, loaders);
}
}
>>>>>>>
private void addClassLoaders(Class<?> type, Collection<ClassLoader> loaders) {
ClassLoader cl = type.getClassLoader();
//java.lang.Object.getClassLoader() = null
if (cl != null) {
loaders.add(cl);
}
Class<?> superType = type.getSuperclass();
if (superType != null) {
addClassLoaders(superType, loaders);
}
for (Class<?> iface : type.getInterfaces()) {
addClassLoaders(iface, loaders);
}
} |
<<<<<<<
=======
import brooklyn.util.collections.MutableMap;
>>>>>>>
<<<<<<<
redis = app.createAndManageChild(EntitySpecs.spec(RedisStore.class));
app.start(ImmutableList.of(loc));
=======
redis = app.createAndManageChild(EntitySpec.create(RedisStore.class));
app.start(ImmutableList.of(testLocation));
>>>>>>>
redis = app.createAndManageChild(EntitySpec.create(RedisStore.class));
app.start(ImmutableList.of(loc));
<<<<<<<
redis = app.createAndManageChild(EntitySpecs.spec(RedisStore.class));
app.start(ImmutableList.of(loc));
=======
redis = app.createAndManageChild(EntitySpec.create(RedisStore.class));
app.start(ImmutableList.of(testLocation));
>>>>>>>
redis = app.createAndManageChild(EntitySpec.create(RedisStore.class));
app.start(ImmutableList.of(loc)); |
<<<<<<<
=======
import brooklyn.event.SensorEvent;
import brooklyn.event.SensorEventListener;
import brooklyn.event.basic.DependentConfiguration;
import brooklyn.event.feed.http.HttpFeed;
import brooklyn.event.feed.http.HttpPollConfig;
import brooklyn.event.feed.http.HttpValueFunctions;
import brooklyn.event.feed.http.JsonFunctions;
>>>>>>>
import brooklyn.event.basic.DependentConfiguration;
import brooklyn.event.feed.http.HttpFeed;
import brooklyn.event.feed.http.HttpPollConfig;
import brooklyn.event.feed.http.HttpValueFunctions;
import brooklyn.event.feed.http.JsonFunctions;
<<<<<<<
=======
connectEnrichers();
setAttribute(BUCKET_CREATION_IN_PROGRESS, false);
>>>>>>>
setAttribute(BUCKET_CREATION_IN_PROGRESS, false); |
<<<<<<<
import java.util.List;
import org.apache.brooklyn.api.entity.Application;
import org.apache.brooklyn.api.entity.EntitySpec;
=======
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import org.apache.brooklyn.api.entity.Entity;
>>>>>>>
import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;
import java.util.List;
import org.apache.brooklyn.api.entity.Application;
import org.apache.brooklyn.api.entity.Entity;
import org.apache.brooklyn.api.entity.EntitySpec;
<<<<<<<
import org.apache.brooklyn.core.mgmt.BrooklynTags;
import org.apache.brooklyn.core.mgmt.BrooklynTags.NamedStringTag;
import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
=======
import org.apache.brooklyn.core.entity.Entities;
>>>>>>>
import org.apache.brooklyn.core.entity.Entities;
import org.apache.brooklyn.core.mgmt.BrooklynTags;
import org.apache.brooklyn.core.mgmt.BrooklynTags.NamedStringTag;
import org.apache.brooklyn.core.mgmt.EntityManagementUtils;
<<<<<<<
import org.apache.brooklyn.test.Asserts;
import org.apache.brooklyn.test.TestUtils;
=======
import org.apache.brooklyn.entity.group.DynamicCluster;
import org.apache.brooklyn.entity.stock.BasicApplication;
>>>>>>>
import org.apache.brooklyn.entity.group.DynamicCluster;
import org.apache.brooklyn.entity.stock.BasicApplication;
import org.apache.brooklyn.test.Asserts;
<<<<<<<
@Test
public void testSpecFromItem() throws Exception {
makeItem();
EntitySpec<? extends Application> spec = EntityManagementUtils.createEntitySpecForApplication(mgmt(),
"services: [ { type: t1 } ]\n" +
"location: localhost");
List<NamedStringTag> yamls = BrooklynTags.findAll(BrooklynTags.YAML_SPEC_KIND, spec.getTags());
Assert.assertEquals(yamls.size(), 1, "Expected 1 yaml tag; instead had: "+yamls);
String yaml = Iterables.getOnlyElement(yamls).getContents();
Asserts.assertStringContains(yaml, "services:", "t1", "localhost");
}
=======
@Test
public void testServiceTypeEntityOfTypeCatalogTemplateNotWrapped() throws Exception {
addCatalogItems(
"brooklyn.catalog:",
" id: t1",
" item_type: template",
" name: myT1",
" item:",
" services:",
" - type: " + TestEntity.class.getName());
addCatalogItems(
"brooklyn.catalog:",
" id: t2",
" item_type: template",
" name: myT2",
" item:",
" services:",
" - type: t1",
" - type: t1");
Entity app = createAndStartApplication(
"services:",
"- type: t2");
waitForApplicationTasks(app);
Entities.dumpInfo(app);
Entity t1a = Iterables.get(app.getChildren(), 0);
Entity t1b = Iterables.get(app.getChildren(), 1);
assertEquals(app.getChildren().size(), 2);
assertEquals(t1a.getChildren().size(), 0);
assertEquals(t1b.getChildren().size(), 0);
assertTrue(app instanceof BasicApplication);
assertTrue(t1a instanceof TestEntity);
assertTrue(t1b instanceof TestEntity);
}
@Test
public void testChildEntityOfTypeCatalogTemplateNotWrapped() throws Exception {
addCatalogItems(
"brooklyn.catalog:",
" id: t1",
" item_type: template",
" name: myT1",
" item:",
" services:",
" - type: " + TestEntity.class.getName());
addCatalogItems(
"brooklyn.catalog:",
" id: t2",
" item_type: template",
" name: myT2",
" item:",
" services:",
" - type: " + TestEntity.class.getName(),
" brooklyn.children:",
" - type: t1");
Entity app = createAndStartApplication(
"services:",
"- type: t2");
waitForApplicationTasks(app);
Entities.dumpInfo(app);
Entity t2 = Iterables.getOnlyElement(app.getChildren());
Entity t1 = Iterables.getOnlyElement(t2.getChildren());
assertEquals(t1.getChildren().size(), 0);
assertTrue(app instanceof BasicApplication);
assertTrue(t1 instanceof TestEntity);
assertTrue(t2 instanceof TestEntity);
}
@Test
public void testMemberSpecEntityOfTypeCatalogTemplateNotWrapped() throws Exception {
addCatalogItems(
"brooklyn.catalog:",
" id: t1",
" item_type: template",
" name: myT1",
" item:",
" services:",
" - type: " + TestEntity.class.getName());
addCatalogItems(
"brooklyn.catalog:",
" id: t2",
" item_type: template",
" name: myT2",
" item:",
" services:",
" - type: " + DynamicCluster.class.getName(),
" brooklyn.config:",
" memberSpec:",
" $brooklyn:entitySpec:",
" type: t1",
" cluster.initial.size: 1");
Entity app = createAndStartApplication(
"location: localhost",
"services:",
"- type: t2");
waitForApplicationTasks(app);
Entities.dumpInfo(app);
DynamicCluster t2 = (DynamicCluster) Iterables.getOnlyElement(app.getChildren());
Entity t1 = Iterables.getOnlyElement(t2.getMembers());
assertEquals(t1.getChildren().size(), 0);
assertTrue(app instanceof BasicApplication);
assertTrue(t2 instanceof DynamicCluster);
assertTrue(t1 instanceof TestEntity);
}
>>>>>>>
public void testServiceTypeEntityOfTypeCatalogTemplateNotWrapped() throws Exception {
addCatalogItems(
"brooklyn.catalog:",
" id: t1",
" item_type: template",
" name: myT1",
" item:",
" services:",
" - type: " + TestEntity.class.getName());
addCatalogItems(
"brooklyn.catalog:",
" id: t2",
" item_type: template",
" name: myT2",
" item:",
" services:",
" - type: t1",
" - type: t1");
Entity app = createAndStartApplication(
"services:",
"- type: t2");
waitForApplicationTasks(app);
Entities.dumpInfo(app);
Entity t1a = Iterables.get(app.getChildren(), 0);
Entity t1b = Iterables.get(app.getChildren(), 1);
assertEquals(app.getChildren().size(), 2);
assertEquals(t1a.getChildren().size(), 0);
assertEquals(t1b.getChildren().size(), 0);
assertTrue(app instanceof BasicApplication);
assertTrue(t1a instanceof TestEntity);
assertTrue(t1b instanceof TestEntity);
}
@Test
public void testChildEntityOfTypeCatalogTemplateNotWrapped() throws Exception {
addCatalogItems(
"brooklyn.catalog:",
" id: t1",
" item_type: template",
" name: myT1",
" item:",
" services:",
" - type: " + TestEntity.class.getName());
addCatalogItems(
"brooklyn.catalog:",
" id: t2",
" item_type: template",
" name: myT2",
" item:",
" services:",
" - type: " + TestEntity.class.getName(),
" brooklyn.children:",
" - type: t1");
Entity app = createAndStartApplication(
"services:",
"- type: t2");
waitForApplicationTasks(app);
Entities.dumpInfo(app);
Entity t2 = Iterables.getOnlyElement(app.getChildren());
Entity t1 = Iterables.getOnlyElement(t2.getChildren());
assertEquals(t1.getChildren().size(), 0);
assertTrue(app instanceof BasicApplication);
assertTrue(t1 instanceof TestEntity);
assertTrue(t2 instanceof TestEntity);
}
@Test
public void testMemberSpecEntityOfTypeCatalogTemplateNotWrapped() throws Exception {
addCatalogItems(
"brooklyn.catalog:",
" id: t1",
" item_type: template",
" name: myT1",
" item:",
" services:",
" - type: " + TestEntity.class.getName());
addCatalogItems(
"brooklyn.catalog:",
" id: t2",
" item_type: template",
" name: myT2",
" item:",
" services:",
" - type: " + DynamicCluster.class.getName(),
" brooklyn.config:",
" memberSpec:",
" $brooklyn:entitySpec:",
" type: t1",
" cluster.initial.size: 1");
Entity app = createAndStartApplication(
"location: localhost",
"services:",
"- type: t2");
waitForApplicationTasks(app);
Entities.dumpInfo(app);
DynamicCluster t2 = (DynamicCluster) Iterables.getOnlyElement(app.getChildren());
Entity t1 = Iterables.getOnlyElement(t2.getMembers());
assertEquals(t1.getChildren().size(), 0);
assertTrue(app instanceof BasicApplication);
assertTrue(t2 instanceof DynamicCluster);
assertTrue(t1 instanceof TestEntity);
}
@Test
public void testPlanYamlTagOnSpecFromItem() throws Exception {
makeItem();
EntitySpec<? extends Application> spec = EntityManagementUtils.createEntitySpecForApplication(mgmt(),
"services: [ { type: t1 } ]\n" +
"location: localhost");
List<NamedStringTag> yamls = BrooklynTags.findAll(BrooklynTags.YAML_SPEC_KIND, spec.getTags());
Assert.assertEquals(yamls.size(), 1, "Expected 1 yaml tag; instead had: "+yamls);
String yaml = Iterables.getOnlyElement(yamls).getContents();
Asserts.assertStringContains(yaml, "services:", "t1", "localhost");
} |
<<<<<<<
import com.google.common.collect.ImmutableList;
=======
>>>>>>>
import com.google.common.collect.ImmutableList;
<<<<<<<
=======
private static final Logger LOG = LoggerFactory.getLogger(RedisStoreSshDriver.class);
private String expandedInstallDir;
>>>>>>>
private static final Logger LOG = LoggerFactory.getLogger(RedisStoreSshDriver.class); |
<<<<<<<
import brooklyn.mementos.CatalogItemMemento;
=======
import brooklyn.mementos.BrooklynMementoRawData;
>>>>>>>
import brooklyn.mementos.BrooklynMementoRawData;
import brooklyn.mementos.CatalogItemMemento;
<<<<<<<
Stopwatch stopwatch = Stopwatch.createStarted();
LOG.debug("Scanning persisted state: {} entities, {} locations, {} policies, {} enrichers, {} catalog items from {}", new Object[]{
entitySubPathList.size(), locationSubPathList.size(), policySubPathList.size(), enricherSubPathList.size(), catalogSubPathList.size(),
=======
LOG.debug("Scanning persisted state: {} entities, {} locations, {} policies, {} enrichers, from {}", new Object[]{
entitySubPathList.size(), locationSubPathList.size(), policySubPathList.size(), enricherSubPathList.size(),
>>>>>>>
LOG.debug("Scanning persisted state: {} entities, {} locations, {} policies, {} enrichers, {} catalog items from {}", new Object[]{
entitySubPathList.size(), locationSubPathList.size(), policySubPathList.size(), enricherSubPathList.size(), catalogSubPathList.size(),
<<<<<<<
BrooklynMementoManifest result = builder.build();
if (LOG.isDebugEnabled()) {
LOG.debug("Loaded memento manifest; took {}; {} entities, {} locations, {} policies, {} enrichers, {} catalog items, from {}",
new Object[]{
Time.makeTimeStringRounded(stopwatch.elapsed(TimeUnit.MILLISECONDS)), result.getEntityIdToType().size(),
result.getLocationIdToType().size(), result.getPolicyIdToType().size(), result.getEnricherIdToType().size(),
result.getCatalogIdToType().size(),
objectStore.getSummaryName() });
}
if (result.getEntityIdToType().size() != entitySubPathList.size()) {
LOG.error("Lost an entity?!");
}
return result;
=======
>>>>>>>
<<<<<<<
Exceptions.propagateIfFatal(e);
List<Exception> exceptions = Lists.newArrayList();
for (ListenableFuture<?> future : futures) {
if (future.isDone()) {
try {
future.get();
} catch (InterruptedException e2) {
throw Exceptions.propagate(e2);
} catch (ExecutionException e2) {
LOG.warn("Problem loading memento", e2);
exceptions.add(e2);
}
future.cancel(true);
}
}
if (exceptions.isEmpty()) {
throw Exceptions.propagate(e);
} else {
// Normally there should be at least one failure; otherwise all.get() would not have failed.
throw new CompoundRuntimeException("Problem loading mementos", exceptions);
}
=======
throw Exceptions.propagate(e);
>>>>>>>
// TODO is the logging here as good as it was prior to https://github.com/apache/incubator-brooklyn/pull/177/files ?
throw Exceptions.propagate(e); |
<<<<<<<
public void testAttributeWhenReadyAbortsWhenOnFireByDefault() {
log.info("starting test "+JavaClassNames.niceClassAndMethod());
=======
public void testAttributeWhenReadyWithAbortFailsWhenAbortConditionAlreadyHoldsWaitingNow() throws Exception {
entity2.setAttribute(TestEntity.SEQUENCE, 1);
final Task<String> t = submit(new Callable<String>() {
public String call() {
return DependentConfiguration.builder()
.attributeWhenReady(entity, TestEntity.NAME)
.abortIf(entity2, TestEntity.SEQUENCE, Predicates.equalTo(1))
.runNow();
}});
try {
assertDoneEventually(t);
fail();
} catch (Exception e) {
if (!e.toString().contains("Aborted waiting for ready")) throw e;
}
}
@Test
public void testAttributeWhenReadyAbortsWhenOnfireByDefault() throws Exception {
>>>>>>>
public void testAttributeWhenReadyWithAbortFailsWhenAbortConditionAlreadyHoldsWaitingNow() throws Exception {
entity2.setAttribute(TestEntity.SEQUENCE, 1);
final Task<String> t = submit(new Callable<String>() {
public String call() {
return DependentConfiguration.builder()
.attributeWhenReady(entity, TestEntity.NAME)
.abortIf(entity2, TestEntity.SEQUENCE, Predicates.equalTo(1))
.runNow();
}});
try {
assertDoneEventually(t);
fail();
} catch (Exception e) {
if (!e.toString().contains("Aborted waiting for ready")) throw e;
}
}
@Test
public void testAttributeWhenReadyAbortsWhenOnFireByDefault() {
log.info("starting test "+JavaClassNames.niceClassAndMethod()); |
<<<<<<<
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.checkState;
<<<<<<<
import java.io.IOException;
import java.io.InputStream;
import java.util.UUID;
=======
import com.google.common.base.Strings;
>>>>>>>
import java.io.IOException;
import java.io.InputStream;
import java.util.UUID;
<<<<<<<
/**
* Key for cache of album mappings. TODO: Add a method parameter for a {@code key} for fine
* grained objects.
*/
private String createCacheKey() {
// TODO: store objects containing individual mappings instead of single object containing all
// mappings
return "tempPhotosData";
}
/**
* Get the proper album upload information for the photo. Takes into account size limits of the
* albums and completed uploads.
*/
private SmugMugPhotoTempData getAlbumTempData(
UUID jobId, IdempotentImportExecutor idempotentExecutor, String baseAlbumId)
throws Exception {
SmugMugPhotoTempData baseAlbumTempData =
jobStore.findData(jobId, baseAlbumId, SmugMugPhotoTempData.class);
SmugMugPhotoTempData albumTempData = baseAlbumTempData;
int depth = 0;
while (albumTempData.getPhotoCount() >= transmogrificationConfig.getAlbumMaxSize()) {
if (albumTempData.getOverflowAlbumId() == null) {
PhotoAlbum newAlbum =
createOverflowAlbum(
baseAlbumTempData.getAlbumId(),
baseAlbumTempData.getAlbumName(),
baseAlbumTempData.getAlbumDescription(),
depth + 1);
String newUri =
idempotentExecutor.executeOrThrowException(
newAlbum.getId(),
newAlbum.getName(),
() -> importSingleAlbum(jobId, newAlbum, smugMugInterface));
albumTempData.setOverflowAlbumId(newAlbum.getId());
jobStore.update(jobId, albumTempData.getAlbumId(), albumTempData);
albumTempData =
jobStore.findData(
jobId, albumTempData.getOverflowAlbumId(), SmugMugPhotoTempData.class);
} else {
albumTempData =
jobStore.findData(
jobId, albumTempData.getOverflowAlbumId(), SmugMugPhotoTempData.class);
}
depth += 1;
}
return albumTempData;
}
/**
* Create an overflow album id -> {baseAlbumId}-overflow-{copyNumber} name -> {baseAlbumName}
* ({copyNumber}) description -> {baseAlbumDescription}
*/
private static PhotoAlbum createOverflowAlbum(
String baseAlbumId, String baseAlbumName, String baseAlbumDescription, int copyNumber)
throws Exception {
checkState(copyNumber > 0, "copyNumber should be > 0");
return new PhotoAlbum(
String.format("%s-overflow-%d", baseAlbumId, copyNumber),
String.format("%s (%d)", baseAlbumName, copyNumber),
baseAlbumDescription);
}
=======
>>>>>>>
/**
* Key for cache of album mappings. TODO: Add a method parameter for a {@code key} for fine
* grained objects.
*/
private String createCacheKey() {
// TODO: store objects containing individual mappings instead of single object containing all
// mappings
return "tempPhotosData";
}
/**
* Get the proper album upload information for the photo. Takes into account size limits of the
* albums and completed uploads.
*/
private SmugMugPhotoTempData getAlbumTempData(
UUID jobId, IdempotentImportExecutor idempotentExecutor, String baseAlbumId)
throws Exception {
SmugMugPhotoTempData baseAlbumTempData =
jobStore.findData(jobId, baseAlbumId, SmugMugPhotoTempData.class);
SmugMugPhotoTempData albumTempData = baseAlbumTempData;
int depth = 0;
while (albumTempData.getPhotoCount() >= transmogrificationConfig.getAlbumMaxSize()) {
if (albumTempData.getOverflowAlbumId() == null) {
PhotoAlbum newAlbum =
createOverflowAlbum(
baseAlbumTempData.getAlbumId(),
baseAlbumTempData.getAlbumName(),
baseAlbumTempData.getAlbumDescription(),
depth + 1);
String newUri =
idempotentExecutor.executeOrThrowException(
newAlbum.getId(),
newAlbum.getName(),
() -> importSingleAlbum(jobId, newAlbum, smugMugInterface));
albumTempData.setOverflowAlbumId(newAlbum.getId());
jobStore.update(jobId, albumTempData.getAlbumId(), albumTempData);
albumTempData =
jobStore.findData(
jobId, albumTempData.getOverflowAlbumId(), SmugMugPhotoTempData.class);
} else {
albumTempData =
jobStore.findData(
jobId, albumTempData.getOverflowAlbumId(), SmugMugPhotoTempData.class);
}
depth += 1;
}
return albumTempData;
}
/**
* Create an overflow album id -> {baseAlbumId}-overflow-{copyNumber} name -> {baseAlbumName}
* ({copyNumber}) description -> {baseAlbumDescription}
*/
private static PhotoAlbum createOverflowAlbum(
String baseAlbumId, String baseAlbumName, String baseAlbumDescription, int copyNumber)
throws Exception {
checkState(copyNumber > 0, "copyNumber should be > 0");
return new PhotoAlbum(
String.format("%s-overflow-%d", baseAlbumId, copyNumber),
String.format("%s (%d)", baseAlbumName, copyNumber),
baseAlbumDescription);
} |
<<<<<<<
AuthData exportAuthData,
AuthData importAuthData,
UUID jobId)
throws IOException, CopyException;
=======
AuthData exportAuthData,
AuthData importAuthData,
UUID jobId, Optional<ExportInformation> exportInfo)
throws IOException;
>>>>>>>
AuthData exportAuthData,
AuthData importAuthData,
UUID jobId, Optional<ExportInformation> exportInfo)
throws IOException, CopyException; |
<<<<<<<
import com.linbit.extproc.ExtCmd;
=======
>>>>>>>
import com.linbit.extproc.ExtCmd;
<<<<<<<
public LvmThinDriverTest()
{
super(new StorageTestUtils.DriverFactory()
{
@Override
public StorageDriver createDriver(ExtCmd ec) throws StorageException
{
return new LvmThinDriver(ec);
}
});
}
public LvmThinDriverTest(DriverFactory driverFactory)
{
super(driverFactory);
}
@Override
@Before
public void setUp() throws Exception
{
ec = new TestExtCmd();
driver = new LvmThinDriver(ec);
}
@Override
=======
@Override
@Before
public void setUp() throws Exception
{
ec = new TestExtCmd();
driver = new LvmThinDriver(ec);
}
@Override
>>>>>>>
public LvmThinDriverTest()
{
super(new StorageTestUtils.DriverFactory()
{
@Override
public StorageDriver createDriver(ExtCmd ec) throws StorageException
{
return new LvmThinDriver(ec);
}
});
}
public LvmThinDriverTest(DriverFactory driverFactory)
{
super(driverFactory);
}
@Override
@Before
public void setUp() throws Exception
{
ec = new TestExtCmd();
driver = new LvmThinDriver(ec);
}
@Override |
<<<<<<<
import com.linbit.drbdmanage.security.ObjectProtection;
import java.util.Iterator;
=======
import com.linbit.drbdmanage.stateflags.Flags;
import com.linbit.drbdmanage.stateflags.StateFlags;
>>>>>>>
import com.linbit.drbdmanage.security.ObjectProtection;
import java.util.Iterator;
import com.linbit.drbdmanage.stateflags.Flags;
import com.linbit.drbdmanage.stateflags.StateFlags;
<<<<<<<
public Props getProps(AccessContext accCtx)
throws AccessDeniedException;
=======
public StateFlags<RscFlags> getStateFlags();
public enum RscFlags implements Flags
{
CLEAN(1L),
REMOVE(2L);
public static final RscFlags[] ALL_FLAGS =
{
CLEAN,
REMOVE
};
public final long flagValue;
private RscFlags(long value)
{
flagValue = value;
}
@Override
public long getFlagValue()
{
// TODO: Implement
throw new UnsupportedOperationException("Not supported yet.");
}
}
>>>>>>>
public Props getProps(AccessContext accCtx)
throws AccessDeniedException;
public StateFlags<RscFlags> getStateFlags();
public enum RscFlags implements Flags
{
CLEAN(1L),
REMOVE(2L);
public static final RscFlags[] ALL_FLAGS =
{
CLEAN,
REMOVE
};
public final long flagValue;
private RscFlags(long value)
{
flagValue = value;
}
@Override
public long getFlagValue()
{
// TODO: Implement
throw new UnsupportedOperationException("Not supported yet.");
}
} |
<<<<<<<
@Override
public Iterator<StorPool> iterateStorPools(AccessContext accCtx)
throws AccessDeniedException
{
objProt.requireAccess(accCtx, AccessType.VIEW);
return storPoolMap.values().iterator();
}
=======
@Override
public StateFlags<NodeFlags> getFlags()
{
return flags;
}
private static final class NodeFlagsImpl extends StateFlagsBits<NodeFlags>
{
NodeFlagsImpl(ObjectProtection objProtRef)
{
super(objProtRef, StateFlagsBits.getMask(NodeFlags.ALL_FLAGS));
}
}
>>>>>>>
@Override
public Iterator<StorPool> iterateStorPools(AccessContext accCtx)
throws AccessDeniedException
{
objProt.requireAccess(accCtx, AccessType.VIEW);
return storPoolMap.values().iterator();
}
@Override
public StateFlags<NodeFlags> getFlags()
{
return flags;
}
private static final class NodeFlagsImpl extends StateFlagsBits<NodeFlags>
{
NodeFlagsImpl(ObjectProtection objProtRef)
{
super(objProtRef, StateFlagsBits.getMask(NodeFlags.ALL_FLAGS));
}
} |
<<<<<<<
// Properties container for this volume definition
private Props vlmDfnProps;
=======
// State flags
private StateFlags<VlmDfnFlags> flags;
>>>>>>>
// Properties container for this volume definition
private Props vlmDfnProps;
// State flags
private StateFlags<VlmDfnFlags> flags;
<<<<<<<
vlmDfnProps = SerialPropsContainer.createRootContainer(srlGen);
=======
flags = new VlmDfnFlagsImpl(resDfnRef.getObjProt());
>>>>>>>
vlmDfnProps = SerialPropsContainer.createRootContainer(srlGen);
flags = new VlmDfnFlagsImpl(resDfnRef.getObjProt()); |
<<<<<<<
import com.linbit.ExhaustedPoolException;
=======
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.regex.Pattern;
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.name.Names;
import com.linbit.linstor.LinStorModule;
import com.linbit.linstor.dbdrivers.DatabaseDriver;
import com.linbit.linstor.netcom.NetComContainer;
import com.linbit.linstor.security.DbAccessor;
import com.linbit.linstor.security.SecurityModule;
import org.slf4j.event.Level;
>>>>>>>
import com.google.inject.Injector;
import com.google.inject.Key;
import com.google.inject.name.Names;
<<<<<<<
import com.linbit.linstor.TcpPortNumber;
import com.linbit.linstor.VolumeDefinition;
import com.linbit.linstor.api.ApiConsts;
=======
>>>>>>>
<<<<<<<
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import static com.linbit.linstor.dbdrivers.derby.DerbyConstants.TBL_SEC_CONFIGURATION;
=======
>>>>>>>
import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.security.KeyManagementException;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.security.cert.CertificateException;
import java.sql.SQLException;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
import java.util.regex.Pattern;
<<<<<<<
/**
* Initializes the number allocation caches
*
* Caller must have write-locked the reconfigurationLock
*/
private void initNumberPools(AccessContext initCtx)
{
try
{
reloadMinorNrRange();
reloadTcpPortRange();
for (ResourceDefinition curRscDfn : rscDfnMap.values())
{
TcpPortNumber portNr = curRscDfn.getPort(initCtx);
tcpPortNrPool.allocate(portNr.value);
Iterator<VolumeDefinition> vlmIter = curRscDfn.iterateVolumeDfn(initCtx);
while (vlmIter.hasNext())
{
VolumeDefinition curVlmDfn = vlmIter.next();
MinorNumber minorNr = curVlmDfn.getMinorNr(initCtx);
minorNrPool.allocate(minorNr.value);
}
}
}
catch (AccessDeniedException accExc)
{
throw new ImplementationError(
"An " + accExc.getClass().getSimpleName() + " exception was generated " +
"during number allocation cache initialization",
accExc
);
}
}
public void reloadTcpPortRange()
{
String strRange;
Matcher matcher;
boolean useDefaults;
try
{
strRange = ctrlConf.getProp(ApiConsts.KEY_TCP_PORT_RANGE);
useDefaults = true;
if (strRange != null)
{
matcher = RANGE_PATTERN.matcher(strRange);
if (matcher.find())
{
try
{
tcpPortRangeMin = Integer.parseInt(matcher.group("min"));
tcpPortRangeMax = Integer.parseInt(matcher.group("max"));
TcpPortNumber.tcpPortNrCheck(tcpPortRangeMin);
TcpPortNumber.tcpPortNrCheck(tcpPortRangeMax);
useDefaults = false;
}
catch (ValueOutOfRangeException | NumberFormatException ignored)
{
}
}
}
if (useDefaults)
{
tcpPortRangeMin = DEFAULT_TCP_PORT_MIN;
tcpPortRangeMax = DEFAULT_TCP_PORT_MAX;
}
}
catch (InvalidKeyException invldKeyExc)
{
throw new ImplementationError(
"Controller configuration key was invalid: " + invldKeyExc.invalidKey,
invldKeyExc
);
}
}
public void reloadMinorNrRange()
{
String strRange;
try
{
strRange = ctrlConf.getProp(ApiConsts.KEY_MINOR_NR_RANGE);
Matcher matcher;
boolean useDefaults = true;
if (strRange != null)
{
matcher = RANGE_PATTERN.matcher(strRange);
if (matcher.find())
{
try
{
minorNrRangeMin = Integer.parseInt(matcher.group("min"));
minorNrRangeMax = Integer.parseInt(matcher.group("max"));
MinorNumber.minorNrCheck(minorNrRangeMin);
MinorNumber.minorNrCheck(minorNrRangeMax);
useDefaults = false;
}
catch (ValueOutOfRangeException | NumberFormatException ignored)
{
}
}
}
if (useDefaults)
{
minorNrRangeMin = DEFAULT_MINOR_NR_MIN;
minorNrRangeMax = DEFAULT_MINOR_NR_MAX;
}
}
catch (InvalidKeyException invldKeyExc)
{
throw new ImplementationError(
"Controller configuration key was invalid: " + invldKeyExc.invalidKey,
invldKeyExc
);
}
}
private void initializeWorkerThreadPool(final AccessContext initCtx)
{
try
{
int cpuCount = getCpuCount();
int thrCount = MathUtils.bounds(MIN_WORKER_COUNT, cpuCount, MAX_CPU_COUNT);
int qSize = thrCount * getWorkerQueueFactor();
qSize = qSize > MIN_WORKER_QUEUE_SIZE ? qSize : MIN_WORKER_QUEUE_SIZE;
setWorkerThreadCount(initCtx, thrCount);
setWorkerQueueSize(initCtx, qSize);
workerThrPool = WorkerPool.initialize(
thrCount, qSize, true, "MainWorkerPool", getErrorReporter(),
dbConnPool
);
// Initialize the message processor
msgProc = new CommonMessageProcessor(this, workerThrPool);
}
catch (AccessDeniedException accessDeniedException)
{
throw new ImplementationError(
"Failed to initialize the worker thread pool",
accessDeniedException
);
}
}
private Props loadPropsContainer()
throws SQLException
{
Props propsContainer;
TransactionMgr transMgr = null;
try
{
transMgr = new TransactionMgr(dbConnPool);
propsContainer = PropsContainer.getInstance(DB_CONTROLLER_PROPSCON_INSTANCE_NAME, transMgr);
transMgr.commit();
}
finally
{
if (transMgr != null)
{
dbConnPool.returnConnection(transMgr);
}
}
return propsContainer;
}
=======
>>>>>>> |
<<<<<<<
import java.util.Iterator;
=======
import com.linbit.drbdmanage.stateflags.Flags;
import com.linbit.drbdmanage.stateflags.StateFlags;
>>>>>>>
import java.util.Iterator;
import com.linbit.drbdmanage.stateflags.Flags;
import com.linbit.drbdmanage.stateflags.StateFlags;
<<<<<<<
public Iterator<StorPool> iterateStorPools(AccessContext accCtx)
throws AccessDeniedException;
public Props getProps(AccessContext accCtx)
throws AccessDeniedException;
=======
public StateFlags<NodeFlags> getFlags();
public enum NodeFlags implements Flags
{
REMOVE(1L);
public static final NodeFlags[] ALL_FLAGS =
{
REMOVE
};
public final long flagValue;
private NodeFlags(long value)
{
flagValue = value;
}
@Override
public long getFlagValue()
{
return flagValue;
}
}
>>>>>>>
public Iterator<StorPool> iterateStorPools(AccessContext accCtx)
throws AccessDeniedException;
public Props getProps(AccessContext accCtx)
throws AccessDeniedException;
public StateFlags<NodeFlags> getFlags();
public enum NodeFlags implements Flags
{
REMOVE(1L);
public static final NodeFlags[] ALL_FLAGS =
{
REMOVE
};
public final long flagValue;
private NodeFlags(long value)
{
flagValue = value;
}
@Override
public long getFlagValue()
{
return flagValue;
}
} |
<<<<<<<
import static com.exonum.binding.common.hash.Hashing.DEFAULT_HASH_SIZE_BYTES;
=======
import static com.exonum.binding.common.crypto.CryptoFunctions.Ed25519.PUBLIC_KEY_BYTES;
>>>>>>>
import static com.exonum.binding.common.crypto.CryptoFunctions.Ed25519.PUBLIC_KEY_BYTES;
import static com.exonum.binding.common.hash.Hashing.DEFAULT_HASH_SIZE_BYTES;
<<<<<<<
import com.exonum.binding.common.hash.HashCode;
=======
import com.exonum.binding.common.crypto.PublicKey;
>>>>>>>
import com.exonum.binding.common.crypto.PublicKey;
import com.exonum.binding.common.hash.HashCode; |
<<<<<<<
static {
LibraryLoader.load();
}
=======
private static final ViewFactory VIEW_FACTORY = ViewProxyFactory.getInstance();
>>>>>>>
static {
LibraryLoader.load();
}
private static final ViewFactory VIEW_FACTORY = ViewProxyFactory.getInstance(); |
<<<<<<<
=======
import com.exonum.binding.common.messages.Service.ServiceConfiguration;
import com.exonum.binding.common.messages.Service.ServiceConfiguration.Format;
import com.exonum.binding.core.storage.database.Fork;
>>>>>>>
import com.exonum.binding.common.messages.Service.ServiceConfiguration;
import com.exonum.binding.common.messages.Service.ServiceConfiguration.Format; |
<<<<<<<
import fj.data.Array;
import fj.data.Either;
import fj.data.LazyString;
import fj.data.List;
import fj.data.Natural;
import fj.data.NonEmptyList;
import fj.data.Option;
import fj.data.Seq;
import fj.data.Set;
import fj.data.Stream;
import fj.data.Tree;
import fj.data.TreeMap;
import fj.data.Validation;
import fj.data.Writer;
=======
import static fj.Function.curry;
import fj.data.*;
import fj.data.hamt.BitSet;
>>>>>>>
import fj.data.Array;
import fj.data.Either;
import fj.data.LazyString;
import fj.data.List;
import fj.data.Natural;
import fj.data.NonEmptyList;
import fj.data.Option;
import fj.data.Seq;
import fj.data.Set;
import fj.data.Stream;
import fj.data.Tree;
import fj.data.TreeMap;
import fj.data.Validation;
import fj.data.Writer;
import fj.data.hamt.BitSet; |
<<<<<<<
=======
import org.spongepowered.api.text.placeholder.PlaceholderParser;
import org.spongepowered.api.statistic.BlockStatistic;
import org.spongepowered.api.statistic.EntityStatistic;
import org.spongepowered.api.statistic.ItemStatistic;
>>>>>>>
import org.spongepowered.api.text.placeholder.PlaceholderParser;
<<<<<<<
public static final Class<PortalType> PORTAL_TYPE = PortalType.class;
=======
public static final Class<PlaceholderParser> PLACEHOLDER_PARSER = PlaceholderParser.class;
public static final Class<PlantType> PLANT_TYPE = PlantType.class;
public static final Class<PopulatorObject> POPULATOR_OBJECT = PopulatorObject.class;
public static final Class<PopulatorType> POPULATOR_TYPE = PopulatorType.class;
public static final Class<PortalAgentType> PORTAL_AGENT_TYPE = PortalAgentType.class;
>>>>>>>
public static final Class<PortalType> PORTAL_TYPE = PortalType.class;
public static final Class<PlaceholderParser> PLACEHOLDER_PARSER = PlaceholderParser.class; |
<<<<<<<
=======
* Removes all empty texts from the beginning and end of this
* builder.
*
* @return This builder
*/
public Builder trim() {
Iterator<Text> front = this.children.iterator();
while (front.hasNext()) {
if (front.next().isEmpty()) {
front.remove();
} else {
break;
}
}
ListIterator<Text> back = this.children.listIterator(this.children.size());
while (back.hasPrevious()) {
if (back.previous().isEmpty()) {
back.remove();
} else {
break;
}
}
return this;
}
/**
* Appends a variable {@link LiteralText} to this builder. The appended
* variables will be formatted by {@link #build(Object...)} and should
* contain a Java format string.
*
* @param var Variable to append
* @return This text builder
*/
public Builder var(LiteralText var) {
append(var);
this.vars.add(var);
return this;
}
/**
* Formats existing variables within this builder and builds an
* immutable instance of the current state of this text builder.
*
* @return An immutable {@link Text} with the current properties of this
* builder
*/
public Text build(Object... params) {
for (int i = 0; i < this.vars.size(); i++) {
if (i >= params.length) {
break;
}
LiteralText var = this.vars.get(i);
ListIterator<Text> iter = this.children.listIterator();
while (iter.hasNext()) {
Text child = iter.next();
if (child == var) {
iter.set(new LiteralText(
var.format,
var.children,
var.clickAction.orElse(null),
var.hoverAction.orElse(null),
var.shiftClickAction.orElse(null),
String.format(var.getContent(), params[i])));
break;
}
}
}
return build();
}
/**
>>>>>>>
* Removes all empty texts from the beginning and end of this
* builder.
*
* @return This builder
*/
public Builder trim() {
Iterator<Text> front = this.children.iterator();
while (front.hasNext()) {
if (front.next().isEmpty()) {
front.remove();
} else {
break;
}
}
ListIterator<Text> back = this.children.listIterator(this.children.size());
while (back.hasPrevious()) {
if (back.previous().isEmpty()) {
back.remove();
} else {
break;
}
}
return this;
}
/** |
<<<<<<<
* <p>Note that an {@link Optional#empty()} channel is different from a
* {@link MessageChannel#toNone()} channel.</p>
=======
* <p>Note that setting this to {@code null}, or no channel, is different
* from a {@link MessageChannel#TO_NONE} channel.</p>
>>>>>>>
* <p>Note that setting this to {@code null}, or no channel, is different
* from a {@link MessageChannel#toNone()} channel.</p> |
<<<<<<<
import org.spongepowered.api.component.attribute.Flammable;
import org.spongepowered.api.component.attribute.Movable;
import org.spongepowered.api.component.attribute.Positionable;
import org.spongepowered.api.component.attribute.Rotatable;
import org.spongepowered.api.math.Vector3d;
import org.spongepowered.api.world.World;
import java.util.UUID;
=======
import com.google.common.base.Optional;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.math.EulerDirection;
import org.spongepowered.api.math.Vector3d;
import org.spongepowered.api.math.Vector3f;
>>>>>>>
import com.google.common.base.Optional;
import org.spongepowered.api.item.inventory.ItemStack;
import org.spongepowered.api.math.EulerDirection;
<<<<<<<
UUID getUniqueID();
/**
* Gets the world that this entity is in
*
* @return World containing this entity
*/
World getWorld();
/**
* Teleports this entity to a target position.
*
* <p>If world parameter is null, it will teleport an entity to a position
* in the same world.</p>
*
* @param position The Vector3d to teleport this entity to
* @param world The world to teleport this entity to. Can be null
* @see #teleport(double, double, double, World)
*/
void teleport(Vector3d position, @Nullable World world);
/**
* Teleports this entity to a coordinate specified by x, y, z.
*
* <p>If world parameter is null, it will teleport an entity to the
* coordinates in the same world</p>
*
* @param x The x coordinate
* @param y The y coordinate
* @param z The z coordinate
* @param world The world these coordinates reside in. Can be null
* @see #teleport(Vector3d, World)
*/
void teleport(double x, double y, double z, @Nullable World world);
=======
void setPosition(Vector3d position);
>>>>>>>
void setPosition(Vector3d position); |
<<<<<<<
import org.spongepowered.api.entity.living.animal.Rabbit;
import org.spongepowered.api.entity.living.animal.Sheep;
import org.spongepowered.api.entity.living.monster.boss.dragon.EnderDragon;
=======
import org.spongepowered.api.entity.living.animal.Rabbit;
import org.spongepowered.api.entity.living.animal.Sheep;
import org.spongepowered.api.entity.living.complex.EnderDragon;
>>>>>>>
import org.spongepowered.api.entity.living.animal.Rabbit;
import org.spongepowered.api.entity.living.animal.Sheep;
import org.spongepowered.api.entity.living.animal.Rabbit;
import org.spongepowered.api.entity.living.animal.Sheep;
import org.spongepowered.api.entity.living.monster.boss.dragon.EnderDragon; |
<<<<<<<
import org.checkerframework.checker.nullness.qual.Nullable;
=======
import org.spongepowered.api.data.Key;
>>>>>>>
import org.checkerframework.checker.nullness.qual.Nullable;
import org.spongepowered.api.data.Key; |
<<<<<<<
import org.spongepowered.api.entity.Player;
import org.spongepowered.api.event.entity.EntityEvent;
=======
import org.spongepowered.api.entity.player.Player;
import org.spongepowered.api.event.GameEvent;
>>>>>>>
import org.spongepowered.api.entity.player.Player;
import org.spongepowered.api.event.entity.EntityEvent; |
<<<<<<<
/**
* Gets the {@link Value} for whether this vindicator is considered a
* "johnny" vindicator. "Johnny" vindicators will deal more damage and
* often times carry an {@link ItemTypes#IRON_AXE} of sorts.
*
* @deprecated In favor of {@link Keys#IS_JOHNNY} to match with the rest of
* API and in-case other mobs ever support "johnny" mode in
* any implementation. Will be removed in API 8
*/
@Deprecated
public static final Key<Value<Boolean>> JOHNNY_VINDICATOR = KeyFactory.fake("JOHNNY_VINDICATOR");;
=======
public static final Key<Value<Boolean>> JOHNNY_VINDICATOR = DummyObjectProvider.createExtendedFor(Key.class,"JOHNNY_VINDICATOR");
>>>>>>>
/**
* Gets the {@link Value} for whether this vindicator is considered a
* "johnny" vindicator. "Johnny" vindicators will deal more damage and
* often times carry an {@link ItemTypes#IRON_AXE} of sorts.
*
* @deprecated In favor of {@link Keys#IS_JOHNNY} to match with the rest of
* API and in-case other mobs ever support "johnny" mode in
* any implementation. Will be removed in API 8
*/
@Deprecated
public static final Key<Value<Boolean>> JOHNNY_VINDICATOR = DummyObjectProvider.createExtendedFor(Key.class,"JOHNNY_VINDICATOR"); |
<<<<<<<
import org.spongepowered.api.data.DataContainer;
import org.spongepowered.api.data.DataSerializable;
import org.spongepowered.api.data.Queries;
import org.spongepowered.math.GenericMath;
=======
import org.spongepowered.api.data.persistence.DataContainer;
import org.spongepowered.api.data.persistence.DataSerializable;
import org.spongepowered.api.data.persistence.Queries;
>>>>>>>
import org.spongepowered.api.data.persistence.DataContainer;
import org.spongepowered.api.data.persistence.DataSerializable;
import org.spongepowered.api.data.persistence.Queries;
import org.spongepowered.math.GenericMath; |
<<<<<<<
=======
import org.spongepowered.api.world.World;
import com.google.common.base.Optional;
>>>>>>>
import org.spongepowered.api.world.World;
import com.google.common.base.Optional;
<<<<<<<
/**
* Mount the entity provided.
*
* @param entity The entity to mount
*/
void mount(Entity entity);
/**
* Dismount from the currently mounted entity.
*/
void dismount();
/**
* Eject any entity mounted on this entity.
*/
void eject();
/**
* Gets the entity that is riding this entity.
*
* @return The riding entity, if it exists
*/
Optional<Entity> getRider();
/**
* Gets the entity that this entity is riding.
*
* @return The entity being ridden, if it exists
*/
Optional<Entity> getRiding();
=======
/**
* Gets world of this entity.
* @return World, if possible
*/
Optional<World> getWorld();
>>>>>>>
/**
* Mount the entity provided.
*
* @param entity The entity to mount
*/
void mount(Entity entity);
/**
* Dismount from the currently mounted entity.
*/
void dismount();
/**
* Eject any entity mounted on this entity.
*/
void eject();
/**
* Gets the entity that is riding this entity.
*
* @return The riding entity, if it exists
*/
Optional<Entity> getRider();
/**
* Gets the entity that this entity is riding.
*
* @return The entity being ridden, if it exists
*/
Optional<Entity> getRiding();
* Gets world of this entity.
* @return World, if possible
*/
Optional<World> getWorld(); |
<<<<<<<
=======
import org.spongepowered.api.data.Keys;
import org.spongepowered.api.entity.Entity;
>>>>>>>
import org.spongepowered.api.data.Keys; |
<<<<<<<
Waypoint wp = cache.getWaypoints().get(1);
=======
cgWaypoint wp = cache.getWaypoints().get(0);
>>>>>>>
Waypoint wp = cache.getWaypoints().get(0); |
<<<<<<<
/**
* Detect waypoint types in the personal note text. It works by rule of thumb only.
*/
private static WaypointType parseWaypointType(final String input) {
final String lowerInput = StringUtils.substring(input, 0, 20).toLowerCase(Locale.getDefault());
for (WaypointType wpType : WaypointType.values()) {
if (lowerInput.contains(wpType.getL10n().toLowerCase(Locale.getDefault()))) {
return wpType;
}
if (lowerInput.contains(wpType.id)) {
return wpType;
}
if (lowerInput.contains(wpType.name().toLowerCase(Locale.US))) {
return wpType;
}
}
return WaypointType.WAYPOINT;
}
=======
private boolean hasIdenticalWaypoint(final Geopoint point) {
for (final Waypoint waypoint: waypoints) {
if (waypoint.getCoords() == point) {
return true;
}
}
return false;
}
>>>>>>>
/**
* Detect waypoint types in the personal note text. It works by rule of thumb only.
*/
private static WaypointType parseWaypointType(final String input) {
final String lowerInput = StringUtils.substring(input, 0, 20).toLowerCase(Locale.getDefault());
for (WaypointType wpType : WaypointType.values()) {
if (lowerInput.contains(wpType.getL10n().toLowerCase(Locale.getDefault()))) {
return wpType;
}
if (lowerInput.contains(wpType.id)) {
return wpType;
}
if (lowerInput.contains(wpType.name().toLowerCase(Locale.US))) {
return wpType;
}
}
return WaypointType.WAYPOINT;
}
private boolean hasIdenticalWaypoint(final Geopoint point) {
for (final Waypoint waypoint: waypoints) {
if (waypoint.getCoords() == point) {
return true;
}
}
return false;
} |
<<<<<<<
if (paramsMatcher1.find() == true && paramsMatcher1.groupCount() > 0) {
OAtoken = paramsMatcher1.group(1);
=======
if (paramsMatcher1.find() && paramsMatcher1.groupCount() > 0) {
OAtoken = paramsMatcher1.group(1).toString();
>>>>>>>
if (paramsMatcher1.find() && paramsMatcher1.groupCount() > 0) {
OAtoken = paramsMatcher1.group(1);
<<<<<<<
if (paramsMatcher2.find() == true && paramsMatcher2.groupCount() > 0) {
OAtokenSecret = paramsMatcher2.group(1);
=======
if (paramsMatcher2.find() && paramsMatcher2.groupCount() > 0) {
OAtokenSecret = paramsMatcher2.group(1).toString();
>>>>>>>
if (paramsMatcher2.find() && paramsMatcher2.groupCount() > 0) {
OAtokenSecret = paramsMatcher2.group(1);
<<<<<<<
if (paramsMatcher1.find() == true && paramsMatcher1.groupCount() > 0) {
OAtoken = paramsMatcher1.group(1);
=======
if (paramsMatcher1.find() && paramsMatcher1.groupCount() > 0) {
OAtoken = paramsMatcher1.group(1).toString();
>>>>>>>
if (paramsMatcher1.find() && paramsMatcher1.groupCount() > 0) {
OAtoken = paramsMatcher1.group(1);
<<<<<<<
if (paramsMatcher2.find() == true && paramsMatcher2.groupCount() > 0) {
OAtokenSecret = paramsMatcher2.group(1);
=======
if (paramsMatcher2.find() && paramsMatcher2.groupCount() > 0) {
OAtokenSecret = paramsMatcher2.group(1).toString();
>>>>>>>
if (paramsMatcher2.find() && paramsMatcher2.groupCount() > 0) {
OAtokenSecret = paramsMatcher2.group(1); |
<<<<<<<
private static final Pattern PATTERN_GK_CODE_EXTENDED = Pattern.compile("(GK[0-9A-F]{4,})|([0-9A-Z]{6})");
private static final String URL = "http://geokrety.org";
=======
private static final String HOST = "geokrety.org";
public static final String URL = "https://" + HOST;
>>>>>>>
private static final Pattern PATTERN_GK_CODE_EXTENDED = Pattern.compile("(GK[0-9A-F]{4,})|([0-9A-Z]{6})");
private static final String HOST = "geokrety.org";
public static final String URL = "https://" + HOST; |
<<<<<<<
import org.n52.sos.ds.hibernate.entities.series.Series;
=======
import org.n52.sos.ogc.om.NamedValue;
import org.n52.sos.ogc.om.OmObservation;
>>>>>>>
import org.n52.sos.ds.hibernate.entities.series.Series;
import org.n52.sos.ogc.om.NamedValue;
import org.n52.sos.ogc.om.OmObservation; |
<<<<<<<
private static String getMatch(String match) {
// creating a new String via String constructor is necessary here!!
return new String(match.trim());
// Java copies the whole page String, when matching with regular expressions
// later this would block the garbage collector, as we only need tiny parts of the page
// see http://developer.android.com/reference/java/lang/String.html#backing_array
// And BTW: You cannot even see that effect in the debugger, but must use a separate memory profiler!
}
public Date parseGcCustomDate(final String input)
=======
public Date parseGcCustomDate(String input)
>>>>>>>
public Date parseGcCustomDate(final String input)
<<<<<<<
final HttpClient client = getHttpClient();
for (int i = 0; i <= NB_DOWNLOAD_RETRIES; i++) {
try {
return client.execute(request);
} catch (IOException e) {
if (i == NB_DOWNLOAD_RETRIES) {
Log.e(cgSettings.tag, "cgeoBase.request", e);
} else {
Log.e(cgSettings.tag, "cgeoBase.request: failed to download data (" + e.getMessage() + "), retrying");
=======
try {
if (httpCode == 302 && httpLocation != null) {
final URI newLocation = uri.resolve(httpLocation);
response = request(newLocation,
"GET", new HashMap<String, String>(), requestId, false, false, false);
} else {
if (StringUtils.isNotEmpty(buffer)) {
BaseUtils.replaceWhitespace(buffer);
String data = buffer.toString();
buffer = null;
if (data != null) {
response.setData(data);
} else {
response.setData("");
}
response.setStatusCode(httpCode);
response.setStatusMessage(httpMessage);
response.setUrl(u.toString());
>>>>>>>
final HttpClient client = getHttpClient();
for (int i = 0; i <= NB_DOWNLOAD_RETRIES; i++) {
try {
return client.execute(request);
} catch (IOException e) {
if (i == NB_DOWNLOAD_RETRIES) {
Log.e(cgSettings.tag, "cgeoBase.request", e);
} else {
Log.e(cgSettings.tag, "cgeoBase.request: failed to download data (" + e.getMessage() + "), retrying");
<<<<<<<
/**
* Replace the characters \n, \r and \t with a space. The input are complete HTML pages.
* This method must be fast, but may not lead to the shortest replacement String.
*
* @param buffer
* The data
*/
public static String replaceWhitespace(final String data) {
// YOU ARE ONLY ALLOWED TO CHANGE THIS CODE IF YOU CAN PROVE IT BECAME FASTER ON A DEVICE
// see WhitespaceTest in the test project
final int length = data.length();
final char[] chars = new char[length];
data.getChars(0, length, chars, 0);
int resultSize = 0;
boolean lastWasWhitespace = true;
for (char c : chars) {
if (c == ' ' || c == '\n' || c == '\r' || c == '\t') {
if (!lastWasWhitespace) {
chars[resultSize++] = ' ';
}
lastWasWhitespace = true;
} else {
chars[resultSize++] = c;
lastWasWhitespace = false;
}
}
return String.valueOf(chars, 0, resultSize);
}
=======
>>>>>>>
/**
* Replace the characters \n, \r and \t with a space. The input are complete HTML pages.
* This method must be fast, but may not lead to the shortest replacement String.
*
* @param buffer
* The data
*/
public static String replaceWhitespace(final String data) {
// You are only allowed to change this code if you can prove it became faster on a device.
// see WhitespaceTest in the test project
final int length = data.length();
final char[] chars = new char[length];
data.getChars(0, length, chars, 0);
int resultSize = 0;
boolean lastWasWhitespace = true;
for (char c : chars) {
if (c == ' ' || c == '\n' || c == '\r' || c == '\t') {
if (!lastWasWhitespace) {
chars[resultSize++] = ' ';
}
lastWasWhitespace = true;
} else {
chars[resultSize++] = c;
lastWasWhitespace = false;
}
}
return String.valueOf(chars, 0, resultSize);
}
<<<<<<<
return null;
=======
String page = null;
if (httpCode == 302 && httpLocation != null) {
final URI newLocation = uri.resolve(httpLocation);
page = requestJSONgc(newLocation, params);
} else {
BaseUtils.replaceWhitespace(buffer);
page = buffer.toString();
}
if (page != null) {
return page;
} else {
return "";
}
}
private static InputStream getInputstreamFromConnection(HttpURLConnection connection) throws IOException {
final String encoding = connection.getContentEncoding();
InputStream ins;
if (encoding != null && encoding.equalsIgnoreCase("gzip")) {
ins = new GZIPInputStream(connection.getInputStream());
} else if (encoding != null && encoding.equalsIgnoreCase("deflate")) {
ins = new InflaterInputStream(connection.getInputStream(), new Inflater(true));
} else {
ins = connection.getInputStream();
}
return ins;
}
public static String requestJSON(String host, String path, String params) {
return requestJSON("http://", host, path, "GET", params);
}
public static String requestJSON(String scheme, String host, String path, String method, String params) {
int httpCode = -1;
//String httpLocation = null;
if (method == null) {
method = "GET";
} else {
method = method.toUpperCase();
}
boolean methodPost = false;
if (method.equalsIgnoreCase("POST")) {
methodPost = true;
}
URLConnection uc = null;
HttpURLConnection connection = null;
Integer timeout = 30000;
final StringBuffer buffer = new StringBuffer();
for (int i = 0; i < 3; i++) {
if (i > 0) {
Log.w(cgSettings.tag, "Failed to download data, retrying. Attempt #" + (i + 1));
}
buffer.delete(0, buffer.length());
timeout = 30000 + (i * 15000);
try {
try {
URL u = null;
if (methodPost) {
u = new URL(scheme + host + path);
} else {
u = new URL(scheme + host + path + "?" + params);
}
if (u.getProtocol().toLowerCase().equals("https")) {
trustAllHosts();
HttpsURLConnection https = (HttpsURLConnection) u.openConnection();
https.setHostnameVerifier(doNotVerify);
uc = https;
} else {
uc = (HttpURLConnection) u.openConnection();
}
uc.setRequestProperty("Host", host);
uc.setRequestProperty("Accept", "application/json, text/javascript, */*; q=0.01");
if (methodPost) {
uc.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
uc.setRequestProperty("Content-Length", Integer.toString(params.length()));
uc.setRequestProperty("X-HTTP-Method-Override", "GET");
} else {
uc.setRequestProperty("Content-Type", "application/json; charset=UTF-8");
}
uc.setRequestProperty("X-Requested-With", "XMLHttpRequest");
connection = (HttpURLConnection) uc;
connection.setReadTimeout(timeout);
connection.setRequestMethod(method);
HttpURLConnection.setFollowRedirects(false); // TODO: Fix these (FilCab)
connection.setDoInput(true);
if (methodPost) {
connection.setDoOutput(true);
final OutputStream out = connection.getOutputStream();
final OutputStreamWriter wr = new OutputStreamWriter(out);
wr.write(params);
wr.flush();
wr.close();
} else {
connection.setDoOutput(false);
}
InputStream ins = getInputstreamFromConnection(connection);
final InputStreamReader inr = new InputStreamReader(ins);
final BufferedReader br = new BufferedReader(inr, 1024);
readIntoBuffer(br, buffer);
httpCode = connection.getResponseCode();
final String paramsLog = params.replaceAll(passMatch, "password=***");
Log.i(cgSettings.tag + " | JSON", "[POST " + (int) (params.length() / 1024) + "k | " + httpCode + " | " + (int) (buffer.length() / 1024) + "k] Downloaded " + "http://" + host + path + "?" + paramsLog);
connection.disconnect();
br.close();
ins.close();
inr.close();
} catch (IOException e) {
httpCode = connection.getResponseCode();
Log.e(cgSettings.tag, "cgeoBase.requestJSON.IOException: " + httpCode + ": " + connection.getResponseMessage() + " ~ " + e.toString());
}
} catch (Exception e) {
Log.e(cgSettings.tag, "cgeoBase.requestJSON: " + e.toString());
}
if (StringUtils.isNotBlank(buffer)) {
break;
}
if (httpCode == 403) {
// we're not allowed to download content, so let's move
break;
}
}
String page = null;
//This is reported as beeing deadCode (httpLocation is always null)
//2011-08-09 - 302 is redirect so something should probably be done
/*
* if (httpCode == 302 && httpLocation != null) {
* final Uri newLocation = Uri.parse(httpLocation);
* if (newLocation.isRelative()) {
* page = requestJSONgc(host, path, params);
* } else {
* page = requestJSONgc(newLocation.getHost(), newLocation.getPath(), params);
* }
* } else {
*/
BaseUtils.replaceWhitespace(buffer);
page = buffer.toString();
//}
if (page != null) {
return page;
} else {
return "";
}
>>>>>>>
return null; |
<<<<<<<
int logType, int year, int month, int day, String log, List<cgTrackableLog> trackables) {
if (ArrayUtils.isEmpty(viewstates)) {
=======
int logType, int year, int month, int day, String log, ArrayList<cgTrackableLog> trackables) {
if (isEmpty(viewstates)) {
>>>>>>>
int logType, int year, int month, int day, String log, List<cgTrackableLog> trackables) {
if (isEmpty(viewstates)) { |
<<<<<<<
=======
import com.google.gerrit.common.data.GroupReference;
import com.google.gerrit.common.data.PermissionRule;
import com.google.gerrit.extensions.api.changes.CherryPickInput;
import com.google.gerrit.extensions.api.changes.ReviewInput;
import com.google.gerrit.extensions.api.changes.SubmitInput;
import com.google.gerrit.extensions.api.groups.GroupApi;
import com.google.gerrit.extensions.api.projects.BranchInfo;
import com.google.gerrit.extensions.api.projects.BranchInput;
import com.google.gerrit.extensions.client.InheritableBoolean;
>>>>>>>
import com.google.gerrit.extensions.api.changes.CherryPickInput;
import com.google.gerrit.extensions.api.changes.ReviewInput;
import com.google.gerrit.extensions.api.changes.SubmitInput;
import com.google.gerrit.extensions.api.projects.BranchInfo;
import com.google.gerrit.extensions.api.projects.BranchInput;
import com.google.gerrit.extensions.client.InheritableBoolean;
<<<<<<<
import com.google.gerrit.extensions.common.ServerInfo;
=======
import com.google.gerrit.extensions.common.ChangeInfo;
import com.google.gerrit.extensions.common.ChangeInput;
import com.google.gerrit.extensions.restapi.AuthException;
>>>>>>>
import com.google.gerrit.extensions.common.ChangeInfo;
import com.google.gerrit.extensions.common.ChangeInput;
import com.google.gerrit.extensions.common.ServerInfo;
import com.google.gerrit.extensions.restapi.AuthException;
<<<<<<<
private void assertAgreement(AgreementInfo info, ContributorAgreement ca) {
assertThat(info.name).isEqualTo(ca.getName());
assertThat(info.description).isEqualTo(ca.getDescription());
assertThat(info.url).isEqualTo(ca.getAgreementUrl());
if (ca.getAutoVerify() != null) {
assertThat(info.autoVerifyGroup.name)
.isEqualTo(ca.getAutoVerify().getName());
} else {
assertThat(info.autoVerifyGroup).isNull();
}
}
=======
@Test
public void revertChangeWithoutCLA() throws Exception {
assume().that(isContributorAgreementsEnabled()).isTrue();
// Create a change succeeds when agreement is not required
setUseContributorAgreements(InheritableBoolean.FALSE);
ChangeInfo change = gApi.changes().create(newChangeInput()).get();
// Approve and submit it
setApiUser(admin);
gApi.changes().id(change.changeId).current().review(ReviewInput.approve());
gApi.changes().id(change.changeId).current().submit(new SubmitInput());
// Revert is not allowed when CLA is required but not signed
setApiUser(user);
setUseContributorAgreements(InheritableBoolean.TRUE);
exception.expect(AuthException.class);
exception.expectMessage("A Contributor Agreement must be completed");
gApi.changes().id(change.changeId).revert();
}
@Test
public void cherrypickChangeWithoutCLA() throws Exception {
assume().that(isContributorAgreementsEnabled()).isTrue();
// Create a new branch
setApiUser(admin);
BranchInfo dest = gApi.projects().name(project.get())
.branch("cherry-pick-to").create(new BranchInput()).get();
// Create a change succeeds when agreement is not required
setUseContributorAgreements(InheritableBoolean.FALSE);
ChangeInfo change = gApi.changes().create(newChangeInput()).get();
// Approve and submit it
gApi.changes().id(change.changeId).current().review(ReviewInput.approve());
gApi.changes().id(change.changeId).current().submit(new SubmitInput());
// Cherry-pick is not allowed when CLA is required but not signed
setApiUser(user);
setUseContributorAgreements(InheritableBoolean.TRUE);
CherryPickInput in = new CherryPickInput();
in.destination = dest.ref;
in.message = change.subject;
exception.expect(AuthException.class);
exception.expectMessage("A Contributor Agreement must be completed");
gApi.changes().id(change.changeId).current().cherryPick(in);
}
@Test
public void createChangeWithoutCLA() throws Exception {
assume().that(isContributorAgreementsEnabled()).isTrue();
// Create a change succeeds when agreement is not required
setUseContributorAgreements(InheritableBoolean.FALSE);
gApi.changes().create(newChangeInput());
// Create a change is not allowed when CLA is required but not signed
setUseContributorAgreements(InheritableBoolean.TRUE);
exception.expect(AuthException.class);
exception.expectMessage("A Contributor Agreement must be completed");
gApi.changes().create(newChangeInput());
}
private ChangeInput newChangeInput() {
ChangeInput in = new ChangeInput();
in.branch = "master";
in.subject = "test";
in.project = project.get();
return in;
}
>>>>>>>
@Test
public void revertChangeWithoutCLA() throws Exception {
assume().that(isContributorAgreementsEnabled()).isTrue();
// Create a change succeeds when agreement is not required
setUseContributorAgreements(InheritableBoolean.FALSE);
ChangeInfo change = gApi.changes().create(newChangeInput()).get();
// Approve and submit it
setApiUser(admin);
gApi.changes().id(change.changeId).current().review(ReviewInput.approve());
gApi.changes().id(change.changeId).current().submit(new SubmitInput());
// Revert is not allowed when CLA is required but not signed
setApiUser(user);
setUseContributorAgreements(InheritableBoolean.TRUE);
exception.expect(AuthException.class);
exception.expectMessage("A Contributor Agreement must be completed");
gApi.changes().id(change.changeId).revert();
}
@Test
public void cherrypickChangeWithoutCLA() throws Exception {
assume().that(isContributorAgreementsEnabled()).isTrue();
// Create a new branch
setApiUser(admin);
BranchInfo dest = gApi.projects().name(project.get())
.branch("cherry-pick-to").create(new BranchInput()).get();
// Create a change succeeds when agreement is not required
setUseContributorAgreements(InheritableBoolean.FALSE);
ChangeInfo change = gApi.changes().create(newChangeInput()).get();
// Approve and submit it
gApi.changes().id(change.changeId).current().review(ReviewInput.approve());
gApi.changes().id(change.changeId).current().submit(new SubmitInput());
// Cherry-pick is not allowed when CLA is required but not signed
setApiUser(user);
setUseContributorAgreements(InheritableBoolean.TRUE);
CherryPickInput in = new CherryPickInput();
in.destination = dest.ref;
in.message = change.subject;
exception.expect(AuthException.class);
exception.expectMessage("A Contributor Agreement must be completed");
gApi.changes().id(change.changeId).current().cherryPick(in);
}
@Test
public void createChangeWithoutCLA() throws Exception {
assume().that(isContributorAgreementsEnabled()).isTrue();
// Create a change succeeds when agreement is not required
setUseContributorAgreements(InheritableBoolean.FALSE);
gApi.changes().create(newChangeInput());
// Create a change is not allowed when CLA is required but not signed
setUseContributorAgreements(InheritableBoolean.TRUE);
exception.expect(AuthException.class);
exception.expectMessage("A Contributor Agreement must be completed");
gApi.changes().create(newChangeInput());
}
private void assertAgreement(AgreementInfo info, ContributorAgreement ca) {
assertThat(info.name).isEqualTo(ca.getName());
assertThat(info.description).isEqualTo(ca.getDescription());
assertThat(info.url).isEqualTo(ca.getAgreementUrl());
if (ca.getAutoVerify() != null) {
assertThat(info.autoVerifyGroup.name)
.isEqualTo(ca.getAutoVerify().getName());
} else {
assertThat(info.autoVerifyGroup).isNull();
}
}
private ChangeInput newChangeInput() {
ChangeInput in = new ChangeInput();
in.branch = "master";
in.subject = "test";
in.project = project.get();
return in;
} |
<<<<<<<
CacheDetailActivity.this.notifyDataSetChanged(); // reload cache details
=======
progress.dismiss();
if (msg.what == -1) {
showToast(res.getString(R.string.err_favorite_failed));
} else {
updateFavPointBox();
}
>>>>>>>
progress.dismiss();
if (msg.what == -1) {
showToast(res.getString(R.string.err_favorite_failed));
} else {
CacheDetailActivity.this.notifyDataSetChanged(); // reload cache details
} |
<<<<<<<
RETRACT(25, "25", "rectract listing", R.string.log_retractlisting),
UNKNOWN(0, "unknown", "", R.string.err_unknown, R.drawable.mark_red); // LogType not init. yet
=======
RETRACT(25, "25", "retract listing", R.string.log_retractlisting),
UNKNOWN(0, "unknown", "", R.string.err_unknown); // LogType not init. yet
>>>>>>>
RETRACT(25, "25", "retract listing", R.string.log_retractlisting),
UNKNOWN(0, "unknown", "", R.string.err_unknown, R.drawable.mark_red); // LogType not init. yet |
<<<<<<<
public void end(String body) {
if (StringUtils.isBlank(cache.location)) {
cache.location = validate(body.trim());
=======
public void end(String country) {
if (cache.location == null || cache.location.length() == 0) {
cache.location = validate(country);
>>>>>>>
public void end(String country) {
if (StringUtils.isBlank(cache.location)) {
cache.location = validate(country);
<<<<<<<
public void end(String body) {
if (StringUtils.isBlank(cache.location)) {
cache.location = validate(body.trim());
=======
public void end(String state) {
if (cache.location == null || cache.location.length() == 0) {
cache.location = validate(state);
>>>>>>>
public void end(String state) {
if (StringUtils.isBlank(cache.location)) {
cache.location = validate(state); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.