conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
public class Window extends XulElement {
=======
public class Window extends XulElement
implements org.zkoss.zul.api.Window, Framable, IdSpace {
>>>>>>>
public class Window extends XulElement
implements Framable, IdSpace { |
<<<<<<<
private transient Map<String, Interpreter> _ips;
=======
private transient Map _ips;
private transient NS _ns;
/** The mapper representing all mappers being added to this page. */
private final FunctionMapper _mapper = new PageFuncMapper();
/** A list of {@link FunctionMapper}. */
private transient List _mappers;
>>>>>>>
private transient Map<String, Interpreter> _ips;
/** The mapper representing all mappers being added to this page. */
private final FunctionMapper _mapper = new PageFuncMapper();
/** A list of {@link FunctionMapper}. */
private transient List<FunctionMapper> _mappers;
<<<<<<<
=======
willPassivate(_mappers);
//backward compatible (we store variables in attributes)
for (Iterator it = CollectionsX.comodifiableIterator(_attrs.getAttributes().values());
it.hasNext();) {
final Object val = it.next();
if (val instanceof NamespaceActivationListener) //backward compatible
((NamespaceActivationListener)val).willPassivate(_ns);
}
>>>>>>>
willPassivate(_mappers);
<<<<<<<
=======
didActivate(_mappers);
//backward compatible (we store variables in attributes)
for (Iterator it = CollectionsX.comodifiableIterator(_attrs.getAttributes().values());
it.hasNext();) {
final Object val = it.next();
if (val instanceof NamespaceActivationListener) //backward compatible
((NamespaceActivationListener)val).didActivate(_ns);
}
>>>>>>>
didActivate(_mappers);
<<<<<<<
_resolvers = Serializables.smartRead(s, _resolvers); //might be null
=======
_resolvers = (List)Serializables.smartRead(s, _resolvers); //might be null
_mappers = (List)Serializables.smartRead(s, _mappers); //might be null
>>>>>>>
_resolvers = Serializables.smartRead(s, _resolvers); //might be null
_mappers = Serializables.smartRead(s, _mappers); //might be null
<<<<<<<
=======
/** @deprecated */
private class NS implements Namespace {
//Namespace//
public Component getOwner() {
return null;
}
public Page getOwnerPage() {
return PageImpl.this;
}
public Set getVariableNames() {
return _attrs.getAttributes().keySet();
}
public boolean containsVariable(String name, boolean local) {
return hasAttributeOrFellow(name, !local)
|| getXelVariable(null, null, name, true) != null;
}
public Object getVariable(String name, boolean local) {
final Object o = getAttributeOrFellow(name, !local);
return o != null ? o: getXelVariable(null, null, name, true);
}
public void setVariable(String name, Object value, boolean local) {
setAttribute(name, value);
}
public void unsetVariable(String name, boolean local) {
removeAttribute(name);
}
/** @deprecated */
public Namespace getParent() {
return null;
}
/** @deprecated */
public void setParent(Namespace parent) {
throw new UnsupportedOperationException();
}
/** @deprecated */
public boolean addChangeListener(NamespaceChangeListener listener) {
return false;
}
/** @deprecated */
public boolean removeChangeListener(NamespaceChangeListener listener) {
return false;
}
}
private class PageFuncMapper implements FunctionMapper, java.io.Serializable {
public Function resolveFunction(String prefix, String name)
throws XelException {
if (_mappers != null) {
for (Iterator it = CollectionsX.comodifiableIterator(_mappers);
it.hasNext();) {
final Function f =
((FunctionMapper)it.next()).resolveFunction(prefix, name);
if (f != null)
return f;
}
}
return null;
}
public Collection getClassNames() {
Collection coll = null;
if (_mappers != null) {
for (Iterator it = CollectionsX.comodifiableIterator(_mappers);
it.hasNext();) {
coll = combine(coll,
((FunctionMapper)it.next()).getClassNames());
}
}
return coll != null ? coll: Collections.EMPTY_LIST;
}
public Class resolveClass(String name) throws XelException {
if (_mappers != null) {
for (Iterator it = CollectionsX.comodifiableIterator(_mappers);
it.hasNext();) {
final Class c =
((FunctionMapper)it.next()).resolveClass(name);
if (c != null)
return c;
}
}
return null;
}
}
private static Collection combine(Collection first, Collection second) {
return DualCollection.combine(
first != null && !first.isEmpty() ? first: null,
second != null && !second.isEmpty() ? second: null);
}
>>>>>>>
private class PageFuncMapper
implements FunctionMapper, FunctionMapperExt, java.io.Serializable {
public Function resolveFunction(String prefix, String name)
throws XelException {
if (_mappers != null) {
for (Iterator<FunctionMapper> it = CollectionsX.comodifiableIterator(_mappers);
it.hasNext();) {
final Function f = it.next().resolveFunction(prefix, name);
if (f != null)
return f;
}
}
return null;
}
public Collection<String> getClassNames() {
Collection<String> coll = null;
if (_mappers != null) {
for (Iterator it = CollectionsX.comodifiableIterator(_mappers);
it.hasNext();) {
final FunctionMapper mapper = (FunctionMapper)it.next();
if (mapper instanceof FunctionMapperExt)
coll = combine(coll,
((FunctionMapperExt)mapper).getClassNames());
}
}
if (coll != null)
return coll;
return Collections.emptyList();
}
public Class resolveClass(String name) throws XelException {
if (_mappers != null) {
for (Iterator it = CollectionsX.comodifiableIterator(_mappers);
it.hasNext();) {
final FunctionMapper mapper = (FunctionMapper)it.next();
if (mapper instanceof FunctionMapperExt) {
final Class c =
((FunctionMapperExt)mapper).resolveClass(name);
if (c != null)
return c;
}
}
}
return null;
}
}
private static <E> Collection<E> combine(Collection<E> first, Collection<E> second) {
return DualCollection.combine(
first != null && !first.isEmpty() ? first: null,
second != null && !second.isEmpty() ? second: null);
} |
<<<<<<<
import com.mycelium.wapi.wallet.*;
=======
import com.mycelium.wapi.content.btc.BitcoinUriParser;
import com.mycelium.wapi.wallet.AddressUtils;
import com.mycelium.wapi.wallet.AesKeyCipher;
import com.mycelium.wapi.wallet.BitcoinBasedGenericTransaction;
import com.mycelium.wapi.wallet.BroadcastResult;
import com.mycelium.wapi.wallet.BroadcastResultType;
import com.mycelium.wapi.wallet.FeeEstimationsGeneric;
import com.mycelium.wapi.wallet.GenericAddress;
import com.mycelium.wapi.wallet.GenericTransaction;
import com.mycelium.wapi.wallet.KeyCipher;
import com.mycelium.wapi.wallet.WalletAccount;
import com.mycelium.wapi.wallet.WalletManager;
import com.mycelium.wapi.wallet.btc.AbstractBtcAccount;
>>>>>>>
import com.mycelium.wapi.wallet.AddressUtils;
import com.mycelium.wapi.wallet.AesKeyCipher;
import com.mycelium.wapi.wallet.BitcoinBasedGenericTransaction;
import com.mycelium.wapi.wallet.BroadcastResult;
import com.mycelium.wapi.wallet.BroadcastResultType;
import com.mycelium.wapi.wallet.FeeEstimationsGeneric;
import com.mycelium.wapi.wallet.GenericAddress;
import com.mycelium.wapi.wallet.GenericTransaction;
import com.mycelium.wapi.wallet.KeyCipher;
import com.mycelium.wapi.wallet.WalletAccount;
import com.mycelium.wapi.wallet.WalletManager;
import com.mycelium.wapi.wallet.btc.AbstractBtcAccount; |
<<<<<<<
=======
} catch (AbstractMethodError ex) { //backward compatible
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
}
try {
_factory.stop(this);
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
}
try {
_provider.stop(this);
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
}
try {
_engine.stop(this);
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
>>>>>>>
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
}
try {
_factory.stop(this);
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
}
try {
_provider.stop(this);
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
}
try {
_engine.stop(this);
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
<<<<<<<
=======
} catch (AbstractMethodError ex) { //backward compatible
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up
>>>>>>>
} catch (Throwable ex) {
ex.printStackTrace(); //not using log since it might be cleaned up |
<<<<<<<
import org.zkoss.html.HTMLs;
=======
>>>>>>>
<<<<<<<
=======
/** @deprecated As of release 5.0.8, no longer used.
*/
protected void renderIdSpace(ContentRenderer renderer) throws IOException {
}
>>>>>>> |
<<<<<<<
public Map<String, Object> evalProperties(Map<String, Object> propmap, Page owner, Component parent) {
return propmap != null ? propmap: new HashMap<String, Object>(2);
=======
public void applyAttributes(Component comp) {
}
public Map evalProperties(Map propmap, Page owner, Component parent) {
return propmap != null ? propmap: new HashMap(3);
>>>>>>>
public void applyAttributes(Component comp) {
}
public Map<String, Object> evalProperties(Map<String, Object> propmap, Page owner, Component parent) {
return propmap != null ? propmap: new HashMap<String, Object>(2); |
<<<<<<<
=======
/** Returns if the given ID is generated automatically.
* Note: use this method instead of {@link #isAutoId(String)} if possible,
* since this method considered RawId and IdGenerator.
* @since 5.0.3
*/
public static boolean isAutoId(Component comp, String id) {
if (id == null || id.length() == 0)
return true;
if (!(comp instanceof RawId)) //including comp is null
return false;
Desktop dt = comp.getDesktop();
if (dt == null) {
Execution exec = Executions.getCurrent();
if (exec != null)
dt = exec.getDesktop();
}
if (dt != null) {
IdGenerator idgen = ((WebAppCtrl)dt.getWebApp()).getIdGenerator();
if (idgen != null) {
try {
return idgen.isAutoUuid(comp, id);
} catch (AbstractMethodError ex) { //ignore (backward compatible)
}
}
}
return isAutoId(id);
}
/** @deprecated As of release 5.0.2, replaced with {@link #isAutoId}.
* If you want to varify UUID, use {@link #checkUuid}.
*/
public static final boolean isUuid(String id) {
return isAutoId(id);
}
>>>>>>>
/** Returns if the given ID is generated automatically.
* Note: use this method instead of {@link #isAutoId(String)} if possible,
* since this method considered RawId and IdGenerator.
* @since 5.0.3
*/
public static boolean isAutoId(Component comp, String id) {
if (id == null || id.length() == 0)
return true;
if (!(comp instanceof RawId)) //including comp is null
return false;
Desktop dt = comp.getDesktop();
if (dt == null) {
Execution exec = Executions.getCurrent();
if (exec != null)
dt = exec.getDesktop();
}
if (dt != null) {
IdGenerator idgen = ((WebAppCtrl)dt.getWebApp()).getIdGenerator();
if (idgen != null) {
try {
return idgen.isAutoUuid(comp, id);
} catch (AbstractMethodError ex) { //ignore (backward compatible)
}
}
}
return isAutoId(id);
} |
<<<<<<<
import android.widget.Toast;
import com.google.common.base.Preconditions;
=======
import com.google.common.base.Optional;
>>>>>>>
import com.google.common.base.Optional;
import android.widget.Toast;
import com.google.common.base.Preconditions; |
<<<<<<<
private String _quality = "hight";
=======
private String _bgcolor;
>>>>>>>
private String _quality = "hight";
private String _version = "6,0,0,0";
private String _bgcolor;
<<<<<<<
=======
/**
* Gets the background color of Flash movie.
* <p>Default: null (the system default)
* @return the background color of Flash movie,[ hexadecimal RGB value]
*/
public String getBgcolor() {
return _bgcolor;
}
/**
* Sets the background color of Flash movie.
* @param bgcolor [ hexadecimal RGB value]
*/
public void setBgcolor(String bgcolor) {
if(!Objects.equals(_bgcolor, bgcolor)){
_bgcolor = bgcolor;
smartUpdate("bgcolor",bgcolor);
}
}
>>>>>>>
/**
* Gets the background color of Flash movie.
* <p>Default: null (the system default)
* @return the background color of Flash movie,[ hexadecimal RGB value]
*/
public String getBgcolor() {
return _bgcolor;
}
/**
* Sets the background color of Flash movie.
* @param bgcolor [ hexadecimal RGB value]
*/
public void setBgcolor(String bgcolor) {
if(!Objects.equals(_bgcolor, bgcolor)){
_bgcolor = bgcolor;
smartUpdate("bgcolor",bgcolor);
}
}
<<<<<<<
public void setAutoPlay(boolean play){
if(_autoPlay != play){
_autoPlay = play;
smartUpdate("autoPlay",play);
=======
public void setAutoplay(boolean autoplay){
if(_autoplay != autoplay){
_autoplay = autoplay;
smartUpdate("play", autoplay);
>>>>>>>
public void setAutoplay(boolean autoplay){
if(_autoplay != autoplay){
_autoplay = autoplay;
smartUpdate("autoplay", autoplay); |
<<<<<<<
import android.preference.PreferenceManager;
=======
import android.support.annotation.NonNull;
>>>>>>>
import android.preference.PreferenceManager;
import android.support.annotation.NonNull;
<<<<<<<
=======
BTCSettings currencySettings = (BTCSettings) _walletManager.getCurrencySettings(Currency.BTC);
currencySettings.setChangeAddressMode(changeAddressMode);
_walletManager.setCurrencySettings(Currency.BTC, currencySettings);
getEditor().putString(Constants.CHANGE_ADDRESS_MODE, changeAddressMode.toString()).apply();
>>>>>>> |
<<<<<<<
public static final Initiators doInit(PageDefinition pagedef, Page page) {
final List<Initiator> inits = pagedef.doInit(page);
if (inits.isEmpty()) return new Initiators();
return new RealInits(inits);
=======
public static final Initiators doInit(PageDefinition pagedef, Page page,
Initiator[] sysinits) {
if (sysinits == null) {
sysinits = new Initiator[0];
} else {
try {
for (int j = 0; j < sysinits.length; ++j)
sysinits[j].doInit(page, Collections.EMPTY_MAP);
} catch (Throwable ex) {
throw UiException.Aide.wrap(ex);
}
}
final List inits = pagedef.doInit(page);
if (sysinits.length == 0 && inits.isEmpty())
return new Initiators();
return new RealInits(sysinits, inits);
>>>>>>>
@SuppressWarnings("unchecked")
public static final Initiators doInit(PageDefinition pagedef, Page page,
Initiator[] sysinits) {
if (sysinits == null) {
sysinits = new Initiator[0];
} else {
try {
for (int j = 0; j < sysinits.length; ++j)
sysinits[j].doInit(page, Collections.EMPTY_MAP);
} catch (Throwable ex) {
throw UiException.Aide.wrap(ex);
}
}
final List<Initiator> inits = pagedef.doInit(page);
if (sysinits.length == 0 && inits.isEmpty())
return new Initiators();
return new RealInits(sysinits, inits);
<<<<<<<
private final List<Initiator> _inits;
=======
private final Initiator[] _sysinits;
private final List _inits;
>>>>>>>
private final Initiator[] _sysinits;
private final List<Initiator> _inits;
<<<<<<<
/*package*/ RealInits(List<Initiator> inits) {
=======
/*package*/ RealInits(Initiator[] sysinits, List inits) {
_sysinits = sysinits;
>>>>>>>
/*package*/ RealInits(Initiator[] sysinits, List<Initiator> inits) {
_sysinits = sysinits;
<<<<<<<
for (Initiator init: _inits) {
=======
for (int j = 0; j < _sysinits.length; ++j) {
final Initiator init = _sysinits[j];
if (init instanceof InitiatorExt) {
if (comps == null) comps = new Component[0];
((InitiatorExt)init).doAfterCompose(page, comps);
} else {
init.doAfterCompose(page);
}
}
for (Iterator it = _inits.iterator(); it.hasNext();) {
final Object init = it.next();
>>>>>>>
for (int j = 0; j < _sysinits.length; ++j) {
final Initiator init = _sysinits[j];
if (init instanceof InitiatorExt) {
if (comps == null) comps = new Component[0];
((InitiatorExt)init).doAfterCompose(page, comps);
} else {
init.doAfterCompose(page);
}
}
for (Initiator init: _inits) {
<<<<<<<
for (Initiator init: _inits) {
=======
for (int j = 0; j < _sysinits.length; ++j) {
final Initiator init = _sysinits[j];
try {
if (init.doCatch(t))
return true;
} catch (Throwable ex) {
Initiators.log.error(ex);
}
}
for (Iterator it = _inits.iterator(); it.hasNext();) {
final Initiator init = (Initiator)it.next();
>>>>>>>
for (int j = 0; j < _sysinits.length; ++j) {
final Initiator init = _sysinits[j];
try {
if (init.doCatch(t))
return true;
} catch (Throwable ex) {
Initiators.log.error(ex);
}
}
for (Initiator init: _inits) {
<<<<<<<
for (Initiator init: _inits) {
=======
for (int j = 0; j < _sysinits.length; ++j) {
final Initiator init = _sysinits[j];
try {
init.doFinally();
} catch (Throwable ex) {
Initiators.log.error(ex);
if (t == null) t = ex;
}
}
for (Iterator it = _inits.iterator(); it.hasNext();) {
final Initiator init = (Initiator)it.next();
>>>>>>>
for (int j = 0; j < _sysinits.length; ++j) {
final Initiator init = _sysinits[j];
try {
init.doFinally();
} catch (Throwable ex) {
Initiators.log.error(ex);
if (t == null) t = ex;
}
}
for (Initiator init: _inits) { |
<<<<<<<
public void storeColuAssetIds(String assetIds) {
storeKeyCategoryValueEntry(COLU.of("assetIds"), assetIds);
}
public String getColuAssetIds() {
return getKeyCategoryValueEntry(COLU.of("assetIds"), "");
}
public void storeColuKey(String assetId, String base58PrivateKey) {
storeKeyCategoryValueEntry(COLU.of("key" + assetId), base58PrivateKey);
}
public Optional<String> getColuKey(String assetId) {
Optional<String> key = getKeyCategoryValueEntry(COLU.of("key" + assetId));
return key;
}
public void deleteColuKey(String assetId) {
deleteByKeyCategory(COLU.of("key" + assetId));
}
public void storeColuUUID(String assetId, UUID uuid) {
storeKeyCategoryValueEntry(COLU.of(assetId), uuid.toString());
}
public void deleteColuUUID(String assetId) {
deleteByKeyCategory(COLU.of(assetId));
}
public Optional<UUID> getColuUUID(String assetId) {
Optional<String> uuid = getKeyCategoryValueEntry(COLU.of(assetId));
if (!uuid.isPresent()) {
return Optional.absent();
}
return Optional.of(UUID.fromString(uuid.get()));
}
public String getCashilaLastUsedCountryCode() {
return getKeyCategoryValueEntry(CASHILA_COUNTRY_CODE, "");
}
public void setCashilaLastUsedCountryCode(String countryCode) {
storeKeyCategoryValueEntry(CASHILA_COUNTRY_CODE, countryCode);
}
public boolean getCashilaIsEnabled() {
return getKeyCategoryValueEntry(CASHILA_IS_ENABLED, "1").equals("1");
}
public void setCashilaIsEnabled(boolean enable) {
storeKeyCategoryValueEntry(CASHILA_IS_ENABLED, enable ? "1" : "0");
}
=======
>>>>>>>
public void storeColuAssetIds(String assetIds) {
storeKeyCategoryValueEntry(COLU.of("assetIds"), assetIds);
}
public String getColuAssetIds() {
return getKeyCategoryValueEntry(COLU.of("assetIds"), "");
}
public void storeColuKey(String assetId, String base58PrivateKey) {
storeKeyCategoryValueEntry(COLU.of("key" + assetId), base58PrivateKey);
}
public Optional<String> getColuKey(String assetId) {
Optional<String> key = getKeyCategoryValueEntry(COLU.of("key" + assetId));
return key;
}
public void deleteColuKey(String assetId) {
deleteByKeyCategory(COLU.of("key" + assetId));
}
public void storeColuUUID(String assetId, UUID uuid) {
storeKeyCategoryValueEntry(COLU.of(assetId), uuid.toString());
}
public void deleteColuUUID(String assetId) {
deleteByKeyCategory(COLU.of(assetId));
}
public Optional<UUID> getColuUUID(String assetId) {
Optional<String> uuid = getKeyCategoryValueEntry(COLU.of(assetId));
if (!uuid.isPresent()) {
return Optional.absent();
}
return Optional.of(UUID.fromString(uuid.get()));
} |
<<<<<<<
import org.zkoss.zk.ui.IdSpace;
import org.zkoss.zk.ui.event.*;
=======
import org.zkoss.zk.ui.ext.render.MultiBranch;
import org.zkoss.zk.ui.ext.client.Maximizable;
import org.zkoss.zk.ui.ext.client.Minimizable;
import org.zkoss.zk.ui.ext.client.Openable;
import org.zkoss.zk.ui.ext.render.Floating;
import org.zkoss.zk.ui.event.Events;
import org.zkoss.zk.ui.event.MinimizeEvent;
>>>>>>>
import org.zkoss.zk.ui.event.*; |
<<<<<<<
import com.mycelium.wallet.activity.send.PopActivity;
import com.mycelium.wallet.bitid.BitIDAuthenticationActivity;
import com.mycelium.wallet.bitid.BitIDSignRequest;
import com.mycelium.wallet.BitcoinUri;
import com.mycelium.wallet.Constants;
import com.mycelium.wallet.MbwManager;
import com.mycelium.wallet.R;
import com.mycelium.wallet.Utils;
=======
import com.mycelium.wallet.*;
>>>>>>>
import com.mycelium.wallet.*;
<<<<<<<
import com.mycelium.wallet.pop.PopRequest;
=======
import com.mycelium.wallet.bitid.BitIDAuthenticationActivity;
import com.mycelium.wallet.bitid.BitIDSignRequest;
>>>>>>>
import com.mycelium.wallet.pop.PopRequest;
import com.mycelium.wallet.bitid.BitIDAuthenticationActivity;
import com.mycelium.wallet.bitid.BitIDSignRequest;
<<<<<<<
final Uri intentUri = intent.getData();
final String scheme = intentUri != null ? intentUri.getScheme() : null;
if (intentUri != null && (Intent.ACTION_VIEW.equals(action) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action))) {
if ("bitcoin".equals(scheme)) {
handleBitcoinUri(intentUri);
} else if ("bitid".equals(scheme)) {
handleBitIdUri(intentUri);
} else if ("btcpop".equals(scheme)) {
handlePopUri(intentUri);
=======
if ("application/bitcoin-paymentrequest".equals(intent.getType())){
// called via paymentrequest-file
final Uri paymentRequest = intent.getData();
handlePaymentRequest(paymentRequest);
return true;
} else {
final Uri intentUri = intent.getData();
final String scheme = intentUri != null ? intentUri.getScheme() : null;
if (intentUri != null && (Intent.ACTION_VIEW.equals(action) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action))) {
if ("bitcoin".equals(scheme)) {
handleBitcoinUri(intentUri);
} else if ("bitid".equals(scheme)) {
handleBitIdUri(intentUri);
}
return true;
>>>>>>>
if ("application/bitcoin-paymentrequest".equals(intent.getType())){
// called via paymentrequest-file
final Uri paymentRequest = intent.getData();
handlePaymentRequest(paymentRequest);
return true;
} else {
final Uri intentUri = intent.getData();
final String scheme = intentUri != null ? intentUri.getScheme() : null;
if (intentUri != null && (Intent.ACTION_VIEW.equals(action) || NfcAdapter.ACTION_NDEF_DISCOVERED.equals(action))) {
if ("bitcoin".equals(scheme)) {
handleBitcoinUri(intentUri);
} else if ("bitid".equals(scheme)) {
handleBitIdUri(intentUri);
} else if ("btcpop".equals(scheme)) {
handlePopUri(intentUri);
}
return true; |
<<<<<<<
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.InfiniteLinearLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
=======
>>>>>>>
import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.InfiniteLinearLayoutManager;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView; |
<<<<<<<
public RetrieveExpression(ExModifier existenceModifier, QualifiedIdentifier topic, IdentifierExpression modality, IdentifierExpression valuesetPathIdentifier, QualifiedIdentifier valueset, IdentifierExpression duringPathIdentifier, Expression duringExpression) {
super();
this.existenceModifier = existenceModifier;
this.topic = topic;
this.modality = modality;
this.valuesetPathIdentifier = valuesetPathIdentifier;
this.valueset = valueset;
=======
public RetrieveExpression(SourceDataCriteria dataCriteria, IdentifierExpression duringPathIdentifier, Expression duringExpression) {
this.dataCriteria = dataCriteria;
>>>>>>>
public RetrieveExpression(SourceDataCriteria dataCriteria, IdentifierExpression duringPathIdentifier, Expression duringExpression) {
super(); |
<<<<<<<
public static CqlTranslator createTranslatorFromText(String cqlText, CqlTranslator.Options... options) {
ModelManager modelManager = new ModelManager();
LibraryManager libraryManager = new LibraryManager(modelManager);
libraryManager.getLibrarySourceLoader().registerProvider(new FhirLibrarySourceProvider());
CqlTranslator translator = CqlTranslator.fromText(cqlText, modelManager, libraryManager, getUcumService(), options);
return translator;
}
=======
public static CqlTranslator createTranslatorFromStream(String testFileName, CqlTranslator.Options... options) throws IOException {
return createTranslatorFromStream(null, testFileName, options);
}
public static CqlTranslator createTranslatorFromStream(NamespaceInfo namespaceInfo, String testFileName, CqlTranslator.Options... options) throws IOException {
InputStream inputStream = Cql2ElmVisitorTest.class.getResourceAsStream(testFileName);
ModelManager modelManager = new ModelManager();
LibraryManager libraryManager = new LibraryManager(modelManager);
libraryManager.getLibrarySourceLoader().registerProvider(new TestLibrarySourceProvider());
libraryManager.getLibrarySourceLoader().registerProvider(new FhirLibrarySourceProvider());
CqlTranslator translator = CqlTranslator.fromStream(namespaceInfo, inputStream, modelManager, libraryManager, getUcumService(), options);
return translator;
}
>>>>>>>
public static CqlTranslator createTranslatorFromText(String cqlText, CqlTranslator.Options... options) {
ModelManager modelManager = new ModelManager();
LibraryManager libraryManager = new LibraryManager(modelManager);
libraryManager.getLibrarySourceLoader().registerProvider(new FhirLibrarySourceProvider());
CqlTranslator translator = CqlTranslator.fromText(cqlText, modelManager, libraryManager, getUcumService(), options);
return translator;
}
public static CqlTranslator createTranslatorFromStream(String testFileName, CqlTranslator.Options... options) throws IOException {
return createTranslatorFromStream(null, testFileName, options);
}
public static CqlTranslator createTranslatorFromStream(NamespaceInfo namespaceInfo, String testFileName, CqlTranslator.Options... options) throws IOException {
InputStream inputStream = Cql2ElmVisitorTest.class.getResourceAsStream(testFileName);
ModelManager modelManager = new ModelManager();
LibraryManager libraryManager = new LibraryManager(modelManager);
libraryManager.getLibrarySourceLoader().registerProvider(new TestLibrarySourceProvider());
libraryManager.getLibrarySourceLoader().registerProvider(new FhirLibrarySourceProvider());
CqlTranslator translator = CqlTranslator.fromStream(namespaceInfo, inputStream, modelManager, libraryManager, getUcumService(), options);
return translator;
} |
<<<<<<<
public DefaultJwtSigningAndValidationService(JWKSetKeyStore keyStore) throws NoSuchAlgorithmException, InvalidKeySpecException {
// convert all keys in the keystore to a map based on key id
for (JWK key : keyStore.getKeys()) {
if (!Strings.isNullOrEmpty(key.getKeyID())) {
this.keys.put(key.getKeyID(), key);
} else {
throw new IllegalArgumentException("Tried to load a key from a keystore without a 'kid' field: " + key);
}
}
buildSignersAndVerifiers();
}
=======
public DefaultJwtSigningAndValidationService(JWKSetKeyStore keyStore) throws NoSuchAlgorithmException, InvalidKeySpecException {
// convert all keys in the keystore to a map based on key id
for (JWK key : keyStore.getKeys()) {
if (!Strings.isNullOrEmpty(key.getKeyID())) {
this.keys.put(key.getKeyID(), key);
} else {
throw new IllegalArgumentException("Tried to load a key from a keystore without a 'kid' field: " + key);
}
}
buildSignersAndVerifiers();
}
@PostConstruct
public void afterPropertiesSet() throws NoSuchAlgorithmException, InvalidKeySpecException{
if (keys == null) {
throw new IllegalArgumentException("Signing and validation service must have at least one key configured.");
}
buildSignersAndVerifiers();
logger.info("DefaultJwtSigningAndValidationService is ready: " + this.toString());
}
>>>>>>>
public DefaultJwtSigningAndValidationService(JWKSetKeyStore keyStore) throws NoSuchAlgorithmException, InvalidKeySpecException {
// convert all keys in the keystore to a map based on key id
for (JWK key : keyStore.getKeys()) {
if (!Strings.isNullOrEmpty(key.getKeyID())) {
this.keys.put(key.getKeyID(), key);
} else {
throw new IllegalArgumentException("Tried to load a key from a keystore without a 'kid' field: " + key);
}
}
buildSignersAndVerifiers();
}
@PostConstruct
public void afterPropertiesSet() throws NoSuchAlgorithmException, InvalidKeySpecException{
if (keys == null) {
throw new IllegalArgumentException("Signing and validation service must have at least one key configured.");
}
buildSignersAndVerifiers();
logger.info("DefaultJwtSigningAndValidationService is ready: " + this.toString());
}
<<<<<<<
public JWSAlgorithm getDefaultSigningAlgorithm() {
return defaultAlgorithm;
}
public void setDefaultSigningAlgorithmName(String algName) {
defaultAlgorithm = JWSAlgorithm.parse(algName);
}
public String getDefaultSigningAlgorithmName() {
if (defaultAlgorithm != null) {
return defaultAlgorithm.getName();
} else {
return null;
}
}
/*
* (non-Javadoc)
*
* @see
* org.springframework.beans.factory.InitializingBean#afterPropertiesSet()
*/
@Override
public void afterPropertiesSet() throws NoSuchAlgorithmException, InvalidKeySpecException{
=======
public JWSAlgorithm getDefaultSigningAlgorithm() {
return defaultAlgorithm;
}
>>>>>>>
public JWSAlgorithm getDefaultSigningAlgorithm() {
return defaultAlgorithm;
}
<<<<<<<
buildSignersAndVerifiers();
logger.info("DefaultJwtSigningAndValidationService is ready: " + this.toString());
=======
>>>>>>>
<<<<<<<
jwt.sign(signer);
} catch (JOSEException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
=======
jwt.sign(signer);
} catch (JOSEException e) {
logger.error("Failed to sign JWT, error was: ", e);
}
>>>>>>>
jwt.sign(signer);
} catch (JOSEException e) {
logger.error("Failed to sign JWT, error was: ", e);
}
<<<<<<<
// TODO Auto-generated catch block
e.printStackTrace();
}
=======
logger.error("Failed to validate signature, error was: ", e);
}
>>>>>>>
logger.error("Failed to validate signature, error was: ", e);
}
<<<<<<<
=======
/* (non-Javadoc)
* @see org.mitre.jwt.signer.service.JwtSigningAndValidationService#getAllSigningAlgsSupported()
*/
@Override
public Collection<JWSAlgorithm> getAllSigningAlgsSupported() {
Set<JWSAlgorithm> algs = new HashSet<JWSAlgorithm>();
for (JWSSigner signer : signers.values()) {
algs.addAll(signer.supportedAlgorithms());
}
for (JWSVerifier verifier : verifiers.values()) {
algs.addAll(verifier.supportedAlgorithms());
}
return algs;
}
>>>>>>>
/* (non-Javadoc)
* @see org.mitre.jwt.signer.service.JwtSigningAndValidationService#getAllSigningAlgsSupported()
*/
@Override
public Collection<JWSAlgorithm> getAllSigningAlgsSupported() {
Set<JWSAlgorithm> algs = new HashSet<JWSAlgorithm>();
for (JWSSigner signer : signers.values()) {
algs.addAll(signer.supportedAlgorithms());
}
for (JWSVerifier verifier : verifiers.values()) {
algs.addAll(verifier.supportedAlgorithms());
}
return algs;
} |
<<<<<<<
@Autowired
private ConfigurationPropertiesBean configBean;
private List<? extends JwtSigner> signers = new ArrayList<JwtSigner>();
=======
// map of identifier to signer
private Map<String, ? extends JwtSigner> signers = new HashMap<String, JwtSigner>();
>>>>>>>
@Autowired
private ConfigurationPropertiesBean configBean;
// map of identifier to signer
private Map<String, ? extends JwtSigner> signers = new HashMap<String, JwtSigner>(); |
<<<<<<<
public DefaultOAuth2ClientDetailsEntityService() {
}
public DefaultOAuth2ClientDetailsEntityService(OAuth2ClientRepository clientRepository,
OAuth2TokenRepository tokenRepository) {
this.clientRepository = clientRepository;
this.tokenRepository = tokenRepository;
}
=======
>>>>>>> |
<<<<<<<
=======
>>>>>>>
<<<<<<<
* @see org.springframework.security.oauth2.provider.token.AbstractTokenGranter#getOAuth2Authentication(org.springframework.security.oauth2.provider.AuthorizationRequest)
*/
@Override
protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) throws AuthenticationException, InvalidTokenException {
// read and load up the existing token
String incomingTokenValue = tokenRequest.getRequestParameters().get("token");
OAuth2AccessTokenEntity incomingToken = tokenServices.readAccessToken(incomingTokenValue);
// check for scoping in the request, can't up-scope with a chained request
Set<String> approvedScopes = incomingToken.getScope();
Set<String> requestedScopes = tokenRequest.getScope();
if (requestedScopes == null) {
requestedScopes = new HashSet<String>();
}
// do a check on the requested scopes -- if they exactly match the client scopes, they were probably shadowed by the token granter
if (client.getScope().equals(requestedScopes)) {
requestedScopes = new HashSet<String>();
}
// if our scopes are a valid subset of what's allowed, we can continue
if (approvedScopes.containsAll(requestedScopes)) {
if (requestedScopes.isEmpty()) {
// if there are no scopes, inherit the original scopes from the token
tokenRequest.setScope(approvedScopes);
} else {
// if scopes were asked for, give only the subset of scopes requested
// this allows safe downscoping
tokenRequest.setScope(Sets.intersection(requestedScopes, approvedScopes));
}
// NOTE: don't revoke the existing access token
// create a new access token
OAuth2Authentication authentication = new OAuth2Authentication(getRequestFactory().createOAuth2Request(client, tokenRequest), incomingToken.getAuthenticationHolder().getAuthentication().getUserAuthentication());
return authentication;
} else {
throw new InvalidScopeException("Invalid scope requested in chained request", approvedScopes);
}
}
=======
* @see org.springframework.security.oauth2.provider.token.AbstractTokenGranter#getOAuth2Authentication(org.springframework.security.oauth2.provider.AuthorizationRequest)
*/
@Override
protected OAuth2Authentication getOAuth2Authentication(AuthorizationRequest authorizationRequest) throws AuthenticationException, InvalidTokenException {
// read and load up the existing token
String incomingTokenValue = authorizationRequest.getAuthorizationParameters().get("token");
OAuth2AccessTokenEntity incomingToken = tokenServices.readAccessToken(incomingTokenValue);
// check for scoping in the request, can't up-scope with a chained request
Set<String> approvedScopes = incomingToken.getScope();
Set<String> requestedScopes = authorizationRequest.getScope();
if (requestedScopes == null) {
requestedScopes = new HashSet<String>();
}
// do a check on the requested scopes -- if they exactly match the client scopes, they were probably shadowed by the token granter
// FIXME: bug in SECOAUTH functionality
ClientDetailsEntity client = incomingToken.getClient();
if (client.getScope().equals(requestedScopes)) {
requestedScopes = new HashSet<String>();
}
// if our scopes are a valid subset of what's allowed, we can continue
if (approvedScopes.containsAll(requestedScopes)) {
// build an appropriate auth request to hand to the token services layer
DefaultAuthorizationRequest outgoingAuthRequest = new DefaultAuthorizationRequest(authorizationRequest);
outgoingAuthRequest.setApproved(true);
if (requestedScopes.isEmpty()) {
// if there are no scopes, inherit the original scopes from the token
outgoingAuthRequest.setScope(approvedScopes);
} else {
// if scopes were asked for, give only the subset of scopes requested
// this allows safe downscoping
outgoingAuthRequest.setScope(Sets.intersection(requestedScopes, approvedScopes));
}
// NOTE: don't revoke the existing access token
// create a new access token
OAuth2Authentication authentication = new OAuth2Authentication(outgoingAuthRequest, incomingToken.getAuthenticationHolder().getAuthentication().getUserAuthentication());
return authentication;
} else {
throw new InvalidScopeException("Invalid scope requested in chained request", approvedScopes);
}
}
>>>>>>>
* @see org.springframework.security.oauth2.provider.token.AbstractTokenGranter#getOAuth2Authentication(org.springframework.security.oauth2.provider.AuthorizationRequest)
*/
@Override
protected OAuth2Authentication getOAuth2Authentication(ClientDetails client, TokenRequest tokenRequest) throws AuthenticationException, InvalidTokenException {
// read and load up the existing token
String incomingTokenValue = tokenRequest.getRequestParameters().get("token");
OAuth2AccessTokenEntity incomingToken = tokenServices.readAccessToken(incomingTokenValue);
// check for scoping in the request, can't up-scope with a chained request
Set<String> approvedScopes = incomingToken.getScope();
Set<String> requestedScopes = tokenRequest.getScope();
if (requestedScopes == null) {
requestedScopes = new HashSet<String>();
}
// do a check on the requested scopes -- if they exactly match the client scopes, they were probably shadowed by the token granter
if (client.getScope().equals(requestedScopes)) {
requestedScopes = new HashSet<String>();
}
// if our scopes are a valid subset of what's allowed, we can continue
if (approvedScopes.containsAll(requestedScopes)) {
if (requestedScopes.isEmpty()) {
// if there are no scopes, inherit the original scopes from the token
tokenRequest.setScope(approvedScopes);
} else {
// if scopes were asked for, give only the subset of scopes requested
// this allows safe downscoping
tokenRequest.setScope(Sets.intersection(requestedScopes, approvedScopes));
}
// NOTE: don't revoke the existing access token
// create a new access token
OAuth2Authentication authentication = new OAuth2Authentication(getRequestFactory().createOAuth2Request(client, tokenRequest), incomingToken.getAuthenticationHolder().getAuthentication().getUserAuthentication());
return authentication;
} else {
throw new InvalidScopeException("Invalid scope requested in chained request", approvedScopes);
}
} |
<<<<<<<
long fundingAmountToSend = _mbwManager.getColuManager().getColuTransactionFee(feePerKbValue);
if (fundingAmountToSend < TransactionUtils.MINIMUM_OUTPUT_VALUE)
fundingAmountToSend = TransactionUtils.MINIMUM_OUTPUT_VALUE;
=======
long fundingAmountShouldHave = _mbwManager.getColuManager().getColuTransactionFee(getFeePerKb().getLongValue()) + getAmountForColuTxOutputs();
if (fundingAmountShouldHave < TransactionUtils.MINIMUM_OUTPUT_VALUE)
fundingAmountShouldHave = TransactionUtils.MINIMUM_OUTPUT_VALUE;
>>>>>>>
long fundingAmountShouldHave = _mbwManager.getColuManager().getColuTransactionFee(feePerKbValue) + getAmountForColuTxOutputs();
if (fundingAmountShouldHave < TransactionUtils.MINIMUM_OUTPUT_VALUE)
fundingAmountShouldHave = TransactionUtils.MINIMUM_OUTPUT_VALUE;
<<<<<<<
=======
final long feePerKb = getFeePerKb().getLongValue();
>>>>>>>
<<<<<<<
long txFee = _mbwManager.getColuManager().getColuTransactionFee(feePerKbValue);
long fundingAmountToSend = txFee;
=======
long txFee = _mbwManager.getColuManager().getColuTransactionFee(feePerKb);
long fundingAmountToSend = txFee + getAmountForColuTxOutputs();
>>>>>>>
long txFee = _mbwManager.getColuManager().getColuTransactionFee(feePerKbValue);
long fundingAmountToSend = txFee + getAmountForColuTxOutputs(); |
<<<<<<<
=======
/**
* Check if the user has already stored a positive approval decision for this site; or if the
* site is whitelisted, approve it automatically.
*
* Otherwise, return false so that the user will see the approval page and can make their own decision.
*
* @param authorizationRequest the incoming authorization request
* @param userAuthentication the Principal representing the currently-logged-in user
*
* @return true if the site is approved, false otherwise
*/
>>>>>>>
/**
* Check if the user has already stored a positive approval decision for this site; or if the
* site is whitelisted, approve it automatically.
*
* Otherwise, return false so that the user will see the approval page and can make their own decision.
*
* @param authorizationRequest the incoming authorization request
* @param userAuthentication the Principal representing the currently-logged-in user
*
* @return true if the site is approved, false otherwise
*/
<<<<<<<
=======
/**
* Check whether the requested scope set is a proper subset of the allowed scopes.
*
* @param requestedScopes
* @param allowedScopes
* @return
*/
private boolean scopesMatch(Set<String> requestedScopes, Set<String> allowedScopes) {
for (String scope : requestedScopes) {
if (!allowedScopes.contains(scope)) {
return false; //throw new InvalidScopeException("Invalid scope: " + scope, allowedScopes);
}
}
return true;
}
>>>>>>>
<<<<<<<
public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
=======
public AuthorizationRequest updateBeforeApproval(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
>>>>>>>
public AuthorizationRequest checkForPreApproval(AuthorizationRequest authorizationRequest, Authentication userAuthentication) {
<<<<<<<
//getName may not be filled in? TODO: investigate
=======
>>>>>>>
<<<<<<<
Map<String,String> approvalParams = authorizationRequest.getApprovalParameters();
=======
Map<String,String> approvalParams = ar.getApprovalParameters();
>>>>>>>
Map<String,String> approvalParams = authorizationRequest.getApprovalParameters();
<<<<<<<
// TODO: for the moment this allows both upscoping and downscoping.
authorizationRequest.setScope(allowedScopes);
=======
ar.setScope(allowedScopes);
>>>>>>>
authorizationRequest.setScope(allowedScopes);
<<<<<<<
}
/**
* Check whether the requested scope set is a proper subset of the allowed scopes.
*
* @param requestedScopes
* @param allowedScopes
* @return
*/
private boolean scopesMatch(Set<String> requestedScopes, Set<String> allowedScopes) {
for (String scope : requestedScopes) {
if (!allowedScopes.contains(scope)) {
return false; //throw new InvalidScopeException("Invalid scope: " + scope, allowedScopes);
}
}
return true;
}
=======
}
>>>>>>>
}
/**
* Check whether the requested scope set is a proper subset of the allowed scopes.
*
* @param requestedScopes
* @param allowedScopes
* @return
*/
private boolean scopesMatch(Set<String> requestedScopes, Set<String> allowedScopes) {
for (String scope : requestedScopes) {
if (!allowedScopes.contains(scope)) {
return false; //throw new InvalidScopeException("Invalid scope: " + scope, allowedScopes);
}
}
return true;
} |
<<<<<<<
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
import org.mitre.oauth2.repository.OAuth2TokenRepository;
=======
>>>>>>>
import org.mitre.oauth2.model.OAuth2AccessTokenEntity;
import org.mitre.oauth2.repository.OAuth2TokenRepository;
<<<<<<<
@Autowired
private OAuth2TokenRepository tokenRepository;
/**
* Default constructor
*/
public DefaultApprovedSiteService() {
}
/**
* Constructor for use in test harnesses.
*
* @param repository
*/
public DefaultApprovedSiteService(ApprovedSiteRepository approvedSiteRepository) {
this.approvedSiteRepository = approvedSiteRepository;
}
=======
>>>>>>>
@Autowired
private OAuth2TokenRepository tokenRepository;
<<<<<<<
}
=======
}
@Override
public void clearExpiredSites() {
logger.info("Clearing expired approved sites");
Collection<ApprovedSite> expiredSites = approvedSiteRepository.getExpired();
if (expiredSites != null) {
for (ApprovedSite expired : expiredSites) {
approvedSiteRepository.remove(expired);
}
}
}
>>>>>>>
}
@Override
public void clearExpiredSites() {
logger.info("Clearing expired approved sites");
Collection<ApprovedSite> expiredSites = approvedSiteRepository.getExpired();
if (expiredSites != null) {
for (ApprovedSite expired : expiredSites) {
approvedSiteRepository.remove(expired);
}
}
} |
<<<<<<<
oldTypes = new ArrayList<String>(4);
oldTypes.add((String) elem.get("@type"));
=======
oldTypes = new ArrayList<String>();
oldTypes.add((String) elem.get(JsonLdConsts.TYPE));
>>>>>>>
oldTypes = new ArrayList<String>(4);
oldTypes.add((String) elem.get(JsonLdConsts.TYPE));
<<<<<<<
final Map<String, Object> result = newMap("@list", new ArrayList<Object>(4));
=======
final Map<String, Object> result = newMap(JsonLdConsts.LIST, new ArrayList<Object>());
>>>>>>>
final Map<String, Object> result = newMap(JsonLdConsts.LIST, new ArrayList<Object>(4));
<<<<<<<
final Map<String, Map<String, NodeMapNode>> graphMap = new LinkedHashMap<String, Map<String, NodeMapNode>>(4);
graphMap.put("@default", defaultGraph);
=======
final Map<String, Map<String, NodeMapNode>> graphMap = new LinkedHashMap<String, Map<String, NodeMapNode>>();
graphMap.put(JsonLdConsts.DEFAULT, defaultGraph);
>>>>>>>
final Map<String, Map<String, NodeMapNode>> graphMap = new LinkedHashMap<String, Map<String, NodeMapNode>>(4);
graphMap.put(JsonLdConsts.DEFAULT, defaultGraph);
<<<<<<<
node.put("@graph", new ArrayList<Object>(4));
=======
node.put(JsonLdConsts.GRAPH, new ArrayList<Object>());
>>>>>>>
node.put(JsonLdConsts.GRAPH, new ArrayList<Object>(4)); |
<<<<<<<
import io.fundrequest.platform.faq.FAQService;
import io.fundrequest.platform.profile.profile.ProfileService;
import io.fundrequest.platform.profile.profile.dto.UserProfile;
import org.apache.commons.lang3.StringUtils;
=======
>>>>>>>
import io.fundrequest.platform.profile.profile.ProfileService;
import io.fundrequest.platform.profile.profile.dto.UserProfile;
import org.apache.commons.lang3.StringUtils;
<<<<<<<
private final FAQService faqService;
private final RefundService refundService;
private final ProfileService profileService;
=======
>>>>>>>
private final RefundService refundService;
private final ProfileService profileService;
<<<<<<<
public FundController(final RequestService requestService,
final FAQService faqService,
final RefundService refundService,
final ProfileService profileService) {
=======
public FundController(final RequestService requestService) {
>>>>>>>
public FundController(final RequestService requestService,
final RefundService refundService,
final ProfileService profileService) {
<<<<<<<
this.faqService = faqService;
this.refundService = refundService;
this.profileService = profileService;
=======
>>>>>>>
this.refundService = refundService;
this.profileService = profileService; |
<<<<<<<
import io.fundrequest.platform.faq.FAQService;
import io.fundrequest.platform.faq.model.FaqItemDto;
import io.fundrequest.platform.profile.profile.ProfileService;
import io.fundrequest.platform.profile.profile.dto.UserProfile;
=======
import org.junit.Before;
>>>>>>>
import io.fundrequest.platform.profile.profile.ProfileService;
import io.fundrequest.platform.profile.profile.dto.UserProfile;
<<<<<<<
import org.mockito.internal.matchers.Same;
=======
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
>>>>>>>
<<<<<<<
private FAQService faqService;
private RefundService refundService;
private ProfileService profileService;
=======
private FundController controller;
>>>>>>>
private RefundService refundService;
private ProfileService profileService;
<<<<<<<
faqService = mock(FAQService.class);
refundService = mock(RefundService.class);
profileService = mock(ProfileService.class);
return new FundController(requestService, faqService, refundService, profileService);
=======
controller = new FundController(requestService);
mockMvc = MockMvcBuilders.standaloneSetup(controller).build();
>>>>>>>
refundService = mock(RefundService.class);
profileService = mock(ProfileService.class);
return new FundController(requestService, refundService, profileService);
<<<<<<<
mockMvc.perform(get("/requests/{request-id}/fund", 1L).principal(principal))
.andExpect(status().isOk())
.andExpect(model().attribute("url", "https://github.com/kazuki43zoo/api-stub/issues/42"))
.andExpect(model().attribute("faqs", new Same(faqs)))
.andExpect(view().name("pages/fund/github"));
=======
this.mockMvc.perform(get("/requests/{request-id}/fund", 1L).principal(principal))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("url", "https://github.com/kazuki43zoo/api-stub/issues/42"))
.andExpect(MockMvcResultMatchers.view().name("pages/fund/github"));
>>>>>>>
mockMvc.perform(get("/requests/{request-id}/fund", 1L).principal(principal))
.andExpect(status().isOk())
.andExpect(model().attribute("url", "https://github.com/kazuki43zoo/api-stub/issues/42"))
.andExpect(view().name("pages/fund/github"));
<<<<<<<
final List<FaqItemDto> faqs = new ArrayList<>();
when(faqService.getFAQsForPage("fundGithub")).thenReturn(faqs);
mockMvc.perform(get("/fund/{type}", "github").principal(principal))
.andExpect(status().isOk())
.andExpect(model().attribute("faqs", new Same(faqs)))
.andExpect(view().name("pages/fund/github"));
}
@Test
public void requestRefund() throws Exception {
final long requestId = 38L;
final String funderAddress = "0x24356789";
when(profileService.getUserProfile(principal)).thenReturn(UserProfile.builder().etherAddress(funderAddress).etherAddressVerified(true).build());
mockMvc.perform(post("/requests/{request-id}/refunds", requestId).principal(principal).param("funder_address", funderAddress))
.andExpect(status().is3xxRedirection())
.andExpect(redirectAlert("success", "Your refund has been requested and is waiting for approval."))
.andExpect(redirectedUrl("/requests/38#funded-by"));
verify(refundService).requestRefund(RequestRefundCommand.builder().requestId(requestId).funderAddress(funderAddress).build());
}
@Test
public void requestRefund_notFunder() throws Exception {
final long requestId = 38L;
final String funderAddress = "0x24356789";
when(profileService.getUserProfile(principal)).thenReturn(UserProfile.builder().etherAddress("0x75636463").etherAddressVerified(true).build());
mockMvc.perform(post("/requests/{request-id}/refunds", requestId).principal(principal).param("funder_address", funderAddress))
.andExpect(status().is3xxRedirection())
.andExpect(redirectAlert("danger", "Your request for a refund is not allowed because the address used to fund does not match the address on your profile."))
.andExpect(redirectedUrl("/requests/38#funded-by"));
verifyZeroInteractions(refundService);
}
@Test
public void requestRefund_notAddressNotVerified() throws Exception {
final long requestId = 38L;
final String funderAddress = "0x24356789";
when(profileService.getUserProfile(principal)).thenReturn(UserProfile.builder().etherAddress(funderAddress).etherAddressVerified(false).build());
mockMvc.perform(post("/requests/{request-id}/refunds", requestId).principal(principal).param("funder_address", funderAddress))
.andExpect(status().is3xxRedirection())
.andExpect(redirectAlert("danger",
"You need to validate your ETH address before you can request refunds. You can do this on your <a href='/profile'>profile</a> page."))
.andExpect(redirectedUrl("/requests/38#funded-by"));
verifyZeroInteractions(refundService);
=======
this.mockMvc.perform(get("/fund/{type}", "github").principal(principal))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.view().name("pages/fund/github"));
>>>>>>>
mockMvc.perform(get("/fund/{type}", "github").principal(principal))
.andExpect(status().isOk())
.andExpect(view().name("pages/fund/github"));
}
@Test
public void requestRefund() throws Exception {
final long requestId = 38L;
final String funderAddress = "0x24356789";
when(profileService.getUserProfile(principal)).thenReturn(UserProfile.builder().etherAddress(funderAddress).etherAddressVerified(true).build());
mockMvc.perform(post("/requests/{request-id}/refunds", requestId).principal(principal).param("funder_address", funderAddress))
.andExpect(status().is3xxRedirection())
.andExpect(redirectAlert("success", "Your refund has been requested and is waiting for approval."))
.andExpect(redirectedUrl("/requests/38#funded-by"));
verify(refundService).requestRefund(RequestRefundCommand.builder().requestId(requestId).funderAddress(funderAddress).build());
}
@Test
public void requestRefund_notFunder() throws Exception {
final long requestId = 38L;
final String funderAddress = "0x24356789";
when(profileService.getUserProfile(principal)).thenReturn(UserProfile.builder().etherAddress("0x75636463").etherAddressVerified(true).build());
mockMvc.perform(post("/requests/{request-id}/refunds", requestId).principal(principal).param("funder_address", funderAddress))
.andExpect(status().is3xxRedirection())
.andExpect(redirectAlert("danger", "Your request for a refund is not allowed because the address used to fund does not match the address on your profile."))
.andExpect(redirectedUrl("/requests/38#funded-by"));
verifyZeroInteractions(refundService);
}
@Test
public void requestRefund_notAddressNotVerified() throws Exception {
final long requestId = 38L;
final String funderAddress = "0x24356789";
when(profileService.getUserProfile(principal)).thenReturn(UserProfile.builder().etherAddress(funderAddress).etherAddressVerified(false).build());
mockMvc.perform(post("/requests/{request-id}/refunds", requestId).principal(principal).param("funder_address", funderAddress))
.andExpect(status().is3xxRedirection())
.andExpect(redirectAlert("danger",
"You need to validate your ETH address before you can request refunds. You can do this on your <a href='/profile'>profile</a> page."))
.andExpect(redirectedUrl("/requests/38#funded-by"));
verifyZeroInteractions(refundService); |
<<<<<<<
private static final String FAQ_REQUESTS_PAGE = "requests";
private static final String FAQ_REQUEST_DETAIL_PAGE = "requestDetail";
private final SecurityContextService securityContextService;
=======
>>>>>>>
private final SecurityContextService securityContextService;
<<<<<<<
.withObject("requests", getAsJson(requests))
.withObject("statistics", statisticsService.getStatistics())
.withObject("projects", getAsJson(requestService.findAllProjects()))
.withObject("technologies", getAsJson(requestService.findAllTechnologies()))
.withObject("isAuthenticated", getAsJson(securityContextService.isUserFullyAuthenticated()))
.withObject("faqs", faqService.getFAQsForPage(FAQ_REQUESTS_PAGE))
.withView("pages/requests/index")
.build();
=======
.withObject("requests", getAsJson(requests))
.withObject("statistics", statisticsService.getStatistics())
.withObject("projects", getAsJson(requestService.findAllProjects()))
.withObject("technologies", getAsJson(requestService.findAllTechnologies()))
.withView("pages/requests/index")
.build();
>>>>>>>
.withObject("requests", getAsJson(requests))
.withObject("statistics", statisticsService.getStatistics())
.withObject("projects", getAsJson(requestService.findAllProjects()))
.withObject("technologies", getAsJson(requestService.findAllTechnologies()))
.withObject("isAuthenticated", getAsJson(securityContextService.isUserFullyAuthenticated()))
.withView("pages/requests/index")
.build();
<<<<<<<
.withObject("isAuthenticated", getAsJson(securityContextService.isUserFullyAuthenticated()))
.withObject("faqs", faqs)
=======
>>>>>>>
.withObject("isAuthenticated", getAsJson(securityContextService.isUserFullyAuthenticated())) |
<<<<<<<
mbwManager = MbwManager.getInstance(getApplication());
=======
_mbwManager = MbwManager.getInstance(getApplication());
feeItemsBuilder = new FeeItemsBuilder(_mbwManager.getExchangeRateManager(), _mbwManager.getFiatCurrency());
>>>>>>>
mbwManager = MbwManager.getInstance(getApplication());
feeItemsBuilder = new FeeItemsBuilder(_mbwManager.getExchangeRateManager(), mbwManager.getFiatCurrency());
<<<<<<<
feeItemsBuilder = new FeeItemsBuilder(mbwManager.getExchangeRateManager(), mbwManager.getFiatCurrency());
=======
>>>>>>>
<<<<<<<
UUID receivingAccount = mbwManager.getWalletManager(false).getAccountByAddress(receivingAddress);
if(receivingAccount != null) {
MbwManager.getEventBus().post( new AccountChanged(receivingAccount));
}
=======
UUID receivingAccount = _mbwManager.getWalletManager(false).getAccountByAddress(_receivingAddress);
if(receivingAccount != null) {
MbwManager.getEventBus().post( new AccountChanged(receivingAccount));
}
>>>>>>>
UUID receivingAccount = mbwManager.getWalletManager(false).getAccountByAddress(receivingAddress);
if(receivingAccount != null) {
MbwManager.getEventBus().post( new AccountChanged(receivingAccount));
} |
<<<<<<<
pendingFundService,
statisticsService,
profileService,
fundService,
refundService,
claimService,
fiatService,
faqService,
objectMapper,
mappers);
=======
pendingFundService,
statisticsService,
profileService,
fundService,
claimService,
fiatService,
objectMapper,
mappers);
>>>>>>>
pendingFundService,
statisticsService,
profileService,
fundService,
refundService,
claimService,
fiatService,
objectMapper,
mappers);
<<<<<<<
final List<FaqItemDto> faqs = new ArrayList<>();
=======
>>>>>>>
<<<<<<<
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("request", requestDetailsView))
.andExpect(MockMvcResultMatchers.model().attribute("requestJson", "requestDetailsView"))
.andExpect(MockMvcResultMatchers.model().attribute("fundedBy", fundersDto))
.andExpect(MockMvcResultMatchers.model().attribute("pendingRefundAddresses", expectedPendingRefundAddresses))
.andExpect(MockMvcResultMatchers.model().attribute("claims", claims))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", sameInstance(commentDtos)))
.andExpect(MockMvcResultMatchers.model().attribute("faqs", sameInstance(faqs)))
.andExpect(MockMvcResultMatchers.view().name("pages/requests/detail"));
=======
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("request", requestDetailsView))
.andExpect(MockMvcResultMatchers.model().attribute("requestJson", "requestDetailsView"))
.andExpect(MockMvcResultMatchers.model().attribute("fundedBy", fundersDto))
.andExpect(MockMvcResultMatchers.model().attribute("claims", claims))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", new Same(commentDtos)))
.andExpect(MockMvcResultMatchers.view().name("pages/requests/detail"));
>>>>>>>
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("request", requestDetailsView))
.andExpect(MockMvcResultMatchers.model().attribute("requestJson", "requestDetailsView"))
.andExpect(MockMvcResultMatchers.model().attribute("fundedBy", fundersDto))
.andExpect(MockMvcResultMatchers.model().attribute("pendingRefundAddresses", expectedPendingRefundAddresses))
.andExpect(MockMvcResultMatchers.model().attribute("claims", claims))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", sameInstance(commentDtos)))
.andExpect(MockMvcResultMatchers.view().name("pages/requests/detail"));
<<<<<<<
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("request", requestDetailsView))
.andExpect(MockMvcResultMatchers.model().attribute("requestJson", "requestDetailsView"))
.andExpect(MockMvcResultMatchers.model().attribute("fundedBy", fundersDto))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", sameInstance(commentDtos)))
.andExpect(MockMvcResultMatchers.model().attribute("faqs", sameInstance(faqs)))
.andExpect(MockMvcResultMatchers.view().name("pages/requests/detail"));
=======
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("request", requestDetailsView))
.andExpect(MockMvcResultMatchers.model().attribute("requestJson", "requestDetailsView"))
.andExpect(MockMvcResultMatchers.model().attribute("fundedBy", fundersDto))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", new Same(commentDtos)))
.andExpect(MockMvcResultMatchers.view().name("pages/requests/detail"));
>>>>>>>
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("request", requestDetailsView))
.andExpect(MockMvcResultMatchers.model().attribute("requestJson", "requestDetailsView"))
.andExpect(MockMvcResultMatchers.model().attribute("fundedBy", fundersDto))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", sameInstance(commentDtos)))
.andExpect(MockMvcResultMatchers.view().name("pages/requests/detail"));
<<<<<<<
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("requests", "requestViews"))
.andExpect(MockMvcResultMatchers.model().attribute("pendingFunds", "pendingFunds"))
.andExpect(MockMvcResultMatchers.model().attribute("faqs", sameInstance(faqs)))
.andExpect(MockMvcResultMatchers.view().name("pages/user/requests"));
=======
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("requests", "requestViews"))
.andExpect(MockMvcResultMatchers.model().attribute("pendingFunds", "pendingFunds"))
.andExpect(MockMvcResultMatchers.view().name("pages/user/requests"));
>>>>>>>
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.model().attribute("requests", "requestViews"))
.andExpect(MockMvcResultMatchers.model().attribute("pendingFunds", "pendingFunds"))
.andExpect(MockMvcResultMatchers.view().name("pages/user/requests")); |
<<<<<<<
import io.fundrequest.core.request.fund.dto.RefundRequestDto;
import io.fundrequest.core.request.fund.dto.TotalFundDto;
=======
>>>>>>>
import io.fundrequest.core.request.fund.dto.RefundRequestDto;
<<<<<<<
final List<RefundRequestDto> pendingRefundRequests = Lists.newArrayList(RefundRequestDto.builder().funderAddress("0xGDjhg4354").build(),
RefundRequestDto.builder().funderAddress("0xFEFSkjhkhj5436").build());
final List<String> expectedPendingRefundAddresses = Lists.newArrayList("0xgdjhg4354", "0xfefskjhkhj5436");
=======
final ClaimsByTransactionAggregate claims = mock(ClaimsByTransactionAggregate.class);
>>>>>>>
final List<RefundRequestDto> pendingRefundRequests = Lists.newArrayList(RefundRequestDto.builder().funderAddress("0xGDjhg4354").build(),
RefundRequestDto.builder().funderAddress("0xFEFSkjhkhj5436").build());
final List<String> expectedPendingRefundAddresses = Lists.newArrayList("0xgdjhg4354", "0xfefskjhkhj5436");
final ClaimsByTransactionAggregate claims = mock(ClaimsByTransactionAggregate.class);
<<<<<<<
when(refundService.findAllRefundRequestsFor(requestId, PENDING)).thenReturn(pendingRefundRequests);
=======
when(claimService.getAggregatedClaimsForRequest(requestId)).thenReturn(claims);
>>>>>>>
when(refundService.findAllRefundRequestsFor(requestId, PENDING)).thenReturn(pendingRefundRequests);
when(claimService.getAggregatedClaimsForRequest(requestId)).thenReturn(claims);
<<<<<<<
.andExpect(MockMvcResultMatchers.model().attribute("pendingRefundAddresses", expectedPendingRefundAddresses))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", sameInstance(commentDtos)))
.andExpect(MockMvcResultMatchers.model().attribute("faqs", sameInstance(faqs)))
=======
.andExpect(MockMvcResultMatchers.model().attribute("claims", claims))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", new Same(commentDtos)))
.andExpect(MockMvcResultMatchers.model().attribute("faqs", new Same(faqs)))
>>>>>>>
.andExpect(MockMvcResultMatchers.model().attribute("pendingRefundAddresses", expectedPendingRefundAddresses))
.andExpect(MockMvcResultMatchers.model().attribute("claims", claims))
.andExpect(MockMvcResultMatchers.model().attribute("githubComments", sameInstance(commentDtos)))
.andExpect(MockMvcResultMatchers.model().attribute("faqs", sameInstance(faqs))) |
<<<<<<<
private TotalFundDto fndFunds;
private TotalFundDto otherFunds;
private String funderAddress;
=======
private TokenValueDto fndFunds;
private TokenValueDto otherFunds;
>>>>>>>
private TokenValueDto fndFunds;
private TokenValueDto otherFunds;
private String funderAddress; |
<<<<<<<
import static org.mockito.Mockito.*;
=======
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
>>>>>>>
import static org.junit.Assert.fail;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.*; |
<<<<<<<
import static io.fundrequest.core.web3j.EthUtil.fromWei;
import static java.util.stream.Collectors.groupingBy;
import static java.util.stream.Collectors.reducing;
import static java.util.stream.Collectors.toList;
=======
>>>>>>>
<<<<<<<
final TotalFundDto fndFunds = totalFunds(list, FunderDto::getFndFunds);
final TotalFundDto otherFunds = totalFunds(list, FunderDto::getOtherFunds);
=======
TokenValueDto fndFunds = totalFunds(list, FunderDto::getFndFunds);
TokenValueDto otherFunds = totalFunds(list, FunderDto::getOtherFunds);
>>>>>>>
final TokenValueDto fndFunds = totalFunds(list, FunderDto::getFndFunds);
final TokenValueDto otherFunds = totalFunds(list, FunderDto::getOtherFunds);
<<<<<<<
private void enrichFundsWithZeroValues(final List<FunderDto> list) {
TotalFundDto fndNonEmpty = null;
TotalFundDto otherNonEmpty = null;
=======
private void enrichFundsWithZeroValues(List<FunderDto> list) {
TokenValueDto fndNonEmpty = null;
TokenValueDto otherNonEmpty = null;
>>>>>>>
private void enrichFundsWithZeroValues(final List<FunderDto> list) {
TokenValueDto fndNonEmpty = null;
TokenValueDto otherNonEmpty = null;
<<<<<<<
private FunderDto mapToFunderDto(final UserProfile loggedInUserProfile, final Fund fund) {
final TotalFundDto totalFundDto = createTotalFund(fund.getToken(), fund.getAmountInWei());
final String funderNameOrAddress = StringUtils.isNotBlank(fund.getFunderUserId())
? profileService.getUserProfile(fund.getFunderUserId()).getName()
: fund.getFunderAddress();
final boolean isFundedByLoggedInUser = isFundedByLoggedInUser(loggedInUserProfile, fund);
return totalFundDto == null ? null : FunderDto.builder()
.funder(funderNameOrAddress)
.funderAddress(fund.getFunderAddress())
.fndFunds(getFndFunds(totalFundDto))
.otherFunds(getOtherFunds(totalFundDto))
.isLoggedInUser(isFundedByLoggedInUser)
.build();
}
private boolean isFundedByLoggedInUser(final UserProfile loggedInUserProfile, final Fund fund) {
return loggedInUserProfile != null
&& (loggedInUserProfile.getId().equals(fund.getFunderUserId()) || fund.getFunderAddress().equalsIgnoreCase(loggedInUserProfile.getEtherAddress()));
=======
private FunderDto mapToFunderDto(UserProfile userProfile, Fund fund) {
final TokenValueDto tokenValueDto = tokenValueDtoMapper.map(fund.getTokenValue());
final String funder = StringUtils.isNotBlank(fund.getFunderUserId()) ? profileService.getUserProfile(fund.getFunderUserId()).getName() : fund.getFunder();
return tokenValueDto == null
? null
: FunderDto.builder()
.funder(funder)
.fndFunds(getFndFunds(tokenValueDto))
.otherFunds(getOtherFunds(tokenValueDto))
.isLoggedInUser(userProfile != null && (userProfile.getId().equals(fund.getFunderUserId()) || fund.getFunder().equalsIgnoreCase(userProfile.getEtherAddress())))
.build();
>>>>>>>
private FunderDto mapToFunderDto(UserProfile loggedInUserProfile, Fund fund) {
final TokenValueDto tokenValueDto = tokenValueDtoMapper.map(fund.getTokenValue());
final String funderNameOrAddress = StringUtils.isNotBlank(fund.getFunderUserId())
? profileService.getUserProfile(fund.getFunderUserId()).getName()
: fund.getFunderAddress();
final boolean isFundedByLoggedInUser = isFundedByLoggedInUser(loggedInUserProfile, fund);
return tokenValueDto == null ? null : FunderDto.builder()
.funder(funderNameOrAddress)
.funderAddress(fund.getFunderAddress())
.fndFunds(getFndFunds(tokenValueDto))
.otherFunds(getOtherFunds(tokenValueDto))
.isLoggedInUser(isFundedByLoggedInUser)
.build();
}
private boolean isFundedByLoggedInUser(final UserProfile loggedInUserProfile, final Fund fund) {
return loggedInUserProfile != null
&& (loggedInUserProfile.getId().equals(fund.getFunderUserId()) || fund.getFunderAddress().equalsIgnoreCase(loggedInUserProfile.getEtherAddress())); |
<<<<<<<
import io.fundrequest.common.infrastructure.exception.ResourceNotFoundException;
import io.fundrequest.common.infrastructure.mapping.Mappers;
=======
import io.fundrequest.common.infrastructure.mapping.Mappers;
>>>>>>>
import io.fundrequest.common.infrastructure.exception.ResourceNotFoundException;
import io.fundrequest.common.infrastructure.mapping.Mappers;
<<<<<<<
=======
import io.fundrequest.core.infrastructure.exception.ResourceNotFoundException;
import io.fundrequest.core.request.domain.IssueInformation;
>>>>>>>
import io.fundrequest.core.request.domain.IssueInformation;
<<<<<<<
final PendingFundRepository pendingFundRepository,
final RequestRepository requestRepository,
=======
final RefundRepository refundRepository,
final PendingFundRepository pendingFundRepository,
final RequestRepository requestRepository,
>>>>>>>
final RefundRepository refundRepository,
final PendingFundRepository pendingFundRepository,
final RequestRepository requestRepository, |
<<<<<<<
import net.tridentsdk.server.data.MetadataType;
import net.tridentsdk.server.data.ProtocolMetadata;
import net.tridentsdk.server.entity.TridentEntityBuilder;
=======
import net.tridentsdk.server.entity.EntityBuilder;
>>>>>>>
import net.tridentsdk.server.data.MetadataType;
import net.tridentsdk.server.data.ProtocolMetadata;
import net.tridentsdk.server.entity.TridentEntityBuilder;
import net.tridentsdk.server.entity.EntityBuilder; |
<<<<<<<
private RollbarResponse readResponse(HttpURLConnection connection) throws ConnectionFailedException {
=======
private static final Pattern messagePattern = Pattern.compile("\"message\"\\s*:\\s*\"([^\"]*)\"");
private static final Pattern uuidPattern = Pattern.compile("\"uuid\"\\s*:\\s*\"([^\"]*)\"");
private static RollbarResponse readResponse(HttpURLConnection connection) throws ConnectionFailedException {
>>>>>>>
private static RollbarResponse readResponse(HttpURLConnection connection) throws ConnectionFailedException { |
<<<<<<<
private void process(ThrowableWrapper error, Map<String, Object> custom, String description,
=======
public void close(boolean wait) throws Exception {
this.config.sender().close(wait);
}
private void process(Throwable error, Map<String, Object> custom, String description,
>>>>>>>
public void close(boolean wait) throws Exception {
this.config.sender().close(wait);
}
private void process(ThrowableWrapper error, Map<String, Object> custom, String description, |
<<<<<<<
if (actionId == EditorInfo.IME_ACTION_GO) {
submit();
=======
if (actionId == EditorInfo.IME_NULL) {
submit(null);
>>>>>>>
if (actionId == EditorInfo.IME_ACTION_GO) {
submit(null); |
<<<<<<<
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jFormattedTextField1 = new javax.swing.JFormattedTextField();
jCheckBox1 = new javax.swing.JCheckBox();
=======
jPanel2 = new javax.swing.JPanel();
autoCompleteCheckBox = new javax.swing.JCheckBox();
autoCompleteTextLabel = new javax.swing.JLabel();
autoCompleteDelayTextField = new javax.swing.JFormattedTextField();
autocompleteMSLabel = new javax.swing.JLabel();
>>>>>>>
jPanel2 = new javax.swing.JPanel();
autoCompleteCheckBox = new javax.swing.JCheckBox();
autoCompleteTextLabel = new javax.swing.JLabel();
autoCompleteDelayTextField = new javax.swing.JFormattedTextField();
autocompleteMSLabel = new javax.swing.JLabel();
<<<<<<<
org.openide.awt.Mnemonics.setLocalizedText(jCheckBox1, org.openide.util.NbBundle.getMessage(LaTeXSettingsPanel.class, "LaTeXSettingsPanel.jCheckBox1.text")); // NOI18N
=======
org.openide.awt.Mnemonics.setLocalizedText(autoCompleteTextLabel, org.openide.util.NbBundle.getMessage(LaTeXSettingsPanel.class, "LaTeXSettingsPanel.autoCompleteTextLabel.text")); // NOI18N
autoCompleteDelayTextField.setText(org.openide.util.NbBundle.getMessage(LaTeXSettingsPanel.class, "LaTeXSettingsPanel.autoCompleteDelayTextField.text_1")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(autocompleteMSLabel, org.openide.util.NbBundle.getMessage(LaTeXSettingsPanel.class, "LaTeXSettingsPanel.autocompleteMSLabel.text")); // NOI18N
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(autoCompleteCheckBox)
.addGap(18, 18, 18)
.addComponent(autoCompleteTextLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(autoCompleteDelayTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(autocompleteMSLabel)
.addContainerGap(404, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(autoCompleteCheckBox)
.addComponent(autoCompleteTextLabel)
.addComponent(autoCompleteDelayTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(autocompleteMSLabel))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
>>>>>>>
org.openide.awt.Mnemonics.setLocalizedText(autoCompleteTextLabel, org.openide.util.NbBundle.getMessage(LaTeXSettingsPanel.class, "LaTeXSettingsPanel.autoCompleteTextLabel.text")); // NOI18N
autoCompleteDelayTextField.setText(org.openide.util.NbBundle.getMessage(LaTeXSettingsPanel.class, "LaTeXSettingsPanel.autoCompleteDelayTextField.text_1")); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(autocompleteMSLabel, org.openide.util.NbBundle.getMessage(LaTeXSettingsPanel.class, "LaTeXSettingsPanel.autocompleteMSLabel.text")); // NOI18N
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(autoCompleteCheckBox)
.addGap(18, 18, 18)
.addComponent(autoCompleteTextLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(autoCompleteDelayTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(autocompleteMSLabel)
.addContainerGap(404, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(autoCompleteCheckBox)
.addComponent(autoCompleteTextLabel)
.addComponent(autoCompleteDelayTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(autocompleteMSLabel))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
<<<<<<<
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(jLabel1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel2))
.addComponent(jCheckBox1))
.addGap(0, 0, Short.MAX_VALUE)))
=======
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addContainerGap())
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
>>>>>>>
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
<<<<<<<
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jCheckBox1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jLabel2)
.addComponent(jFormattedTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(26, Short.MAX_VALUE))
=======
.addGap(18, 18, 18)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(59, Short.MAX_VALUE))
>>>>>>>
.addGap(18, 18, 18)
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(59, Short.MAX_VALUE))
<<<<<<<
ApplicationSettings.INSTANCE.setSettingValue(ApplicationSettings.Setting.AUTOCOMPLETE_ENABLED, String.valueOf(jCheckBox1.isSelected()));
int autoCompleteDelay = Integer.parseInt(jFormattedTextField1.getText());
ApplicationSettings.INSTANCE.setAutoCompleteDelay(autoCompleteDelay);
=======
final boolean autoCompleteStatus = autoCompleteCheckBox.isSelected();
if(autoCompleteStatus){
final int autoCompleteDelay = Integer.parseInt(autoCompleteDelayTextField.getText());
ApplicationSettings.INSTANCE.setAutoCompleteDelay(autoCompleteDelay);
ApplicationSettings.INSTANCE.setAutoCompleteStatus(true);
}else{
ApplicationSettings.INSTANCE.setAutoCompleteStatus(false);
}
>>>>>>>
ApplicationSettings.INSTANCE.setSettingValue(ApplicationSettings.Setting.AUTOCOMPLETE_ENABLED, String.valueOf(autoCompleteCheckBox.isSelected()));
ApplicationSettings.INSTANCE.setAutoCompleteDelay( Integer.parseInt(autoCompleteDelayTextField.getText()) );
<<<<<<<
private javax.swing.JCheckBox jCheckBox1;
private javax.swing.JFormattedTextField jFormattedTextField1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
=======
>>>>>>> |
<<<<<<<
/*
* Copyright (c) 2016 Sebastian Brudzinski
*
* See the file LICENSE for copying permission.
*/
package latexstudio.editor.remote;
import com.dropbox.core.DbxClient;
import com.dropbox.core.DbxException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import latexstudio.editor.ApplicationLogger;
import latexstudio.editor.DropboxRevisionsTopComponent;
import latexstudio.editor.TopComponentFactory;
import latexstudio.editor.settings.ApplicationSettings;
import latexstudio.editor.settings.SettingsService;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;
@ActionID(
category = "Remote",
id = "latexstudio.editor.remote.DisconnectDropbox"
)
@ActionRegistration(
displayName = "#CTL_DisconnectDropbox"
)
@ActionReference(path = "Menu/Remote", position = 3508)
@Messages("CTL_DisconnectDropbox=Disconnect from Dropbox")
public final class DisconnectDropbox implements ActionListener {
private final DropboxRevisionsTopComponent drtc = new TopComponentFactory<DropboxRevisionsTopComponent>()
.getTopComponent(DropboxRevisionsTopComponent.class.getSimpleName());
private static final ApplicationLogger LOGGER = new ApplicationLogger("Cloud Support");
@Override
public void actionPerformed(ActionEvent e) {
int currentCloudStatus = CloudStatus.getInstance().getStatus();
CloudStatus.getInstance().setStatus(CloudStatus.STATUS_CONNECTING);
DbxClient client = DbxUtil.getDbxClient();
if (client == null) {
LOGGER.log("Dropbox account already disconnected.");
CloudStatus.getInstance().setStatus(CloudStatus.STATUS_DISCONNECTED);
return;
}
String userToken = client.getAccessToken();
if (userToken != null && !userToken.isEmpty()) {
try {
client.disableAccessToken();
drtc.updateRevisionsList(null);
drtc.close();
ApplicationSettings appSettings = SettingsService.loadApplicationSettings();
appSettings.setDropboxToken("");
SettingsService.saveApplicationSettings(appSettings);
LOGGER.log("Successfully disconnected from Dropbox account.");
CloudStatus.getInstance().setStatus(CloudStatus.STATUS_DISCONNECTED);
} catch (DbxException ex) {
DbxUtil.showDbxAccessDeniedPrompt();
CloudStatus.getInstance().setStatus(currentCloudStatus);
}
} else {
LOGGER.log("Dropbox account already disconnected.");
CloudStatus.getInstance().setStatus(CloudStatus.STATUS_DISCONNECTED);
}
}
}
=======
/*
* Copyright (c) 2016 Sebastian Brudzinski
*
* See the file LICENSE for copying permission.
*/
package latexstudio.editor.remote;
import com.dropbox.core.DbxClient;
import com.dropbox.core.DbxException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import latexstudio.editor.ApplicationLogger;
import latexstudio.editor.DropboxRevisionsTopComponent;
import latexstudio.editor.TopComponentFactory;
import latexstudio.editor.settings.ApplicationSettings;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;
@ActionID(
category = "Remote",
id = "latexstudio.editor.remote.DisconnectDropbox"
)
@ActionRegistration(
displayName = "#CTL_DisconnectDropbox"
)
@ActionReference(path = "Menu/Remote", position = 3508)
@Messages("CTL_DisconnectDropbox=Disconnect from Dropbox")
public final class DisconnectDropbox implements ActionListener {
private final DropboxRevisionsTopComponent drtc = new TopComponentFactory<DropboxRevisionsTopComponent>()
.getTopComponent(DropboxRevisionsTopComponent.class.getSimpleName());
private static final ApplicationLogger LOGGER = new ApplicationLogger("Dropbox");
@Override
public void actionPerformed(ActionEvent e) {
DbxClient client = DbxUtil.getDbxClient();
if (client == null) {
LOGGER.log("Dropbox account already disconnected.");
return;
}
String userToken = client.getAccessToken();
if (userToken != null && !userToken.isEmpty()) {
try {
client.disableAccessToken();
drtc.updateRevisionsList(null);
drtc.close();
ApplicationSettings.INSTANCE.setDropboxToken("");
ApplicationSettings.INSTANCE.save();
LOGGER.log("Successfully disconnected from Dropbox account.");
} catch (DbxException ex) {
DbxUtil.showDbxAccessDeniedPrompt();
}
} else {
LOGGER.log("Dropbox account already disconnected.");
}
}
}
>>>>>>>
/*
* Copyright (c) 2016 Sebastian Brudzinski
*
* See the file LICENSE for copying permission.
*/
package latexstudio.editor.remote;
import com.dropbox.core.DbxClient;
import com.dropbox.core.DbxException;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import latexstudio.editor.ApplicationLogger;
import latexstudio.editor.DropboxRevisionsTopComponent;
import latexstudio.editor.TopComponentFactory;
import latexstudio.editor.settings.ApplicationSettings;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
import org.openide.awt.ActionRegistration;
import org.openide.util.NbBundle.Messages;
@ActionID(
category = "Remote",
id = "latexstudio.editor.remote.DisconnectDropbox"
)
@ActionRegistration(
displayName = "#CTL_DisconnectDropbox"
)
@ActionReference(path = "Menu/Remote", position = 3508)
@Messages("CTL_DisconnectDropbox=Disconnect from Dropbox")
public final class DisconnectDropbox implements ActionListener {
private final DropboxRevisionsTopComponent drtc = new TopComponentFactory<DropboxRevisionsTopComponent>()
.getTopComponent(DropboxRevisionsTopComponent.class.getSimpleName());
private static final ApplicationLogger LOGGER = new ApplicationLogger("Cloud Support");
@Override
public void actionPerformed(ActionEvent e) {
int currentCloudStatus = CloudStatus.getInstance().getStatus();
CloudStatus.getInstance().setStatus(CloudStatus.STATUS_CONNECTING);
DbxClient client = DbxUtil.getDbxClient();
if (client == null) {
LOGGER.log("Dropbox account already disconnected.");
CloudStatus.getInstance().setStatus(CloudStatus.STATUS_DISCONNECTED);
return;
}
String userToken = client.getAccessToken();
if (userToken != null && !userToken.isEmpty()) {
try {
client.disableAccessToken();
drtc.updateRevisionsList(null);
drtc.close();
ApplicationSettings.INSTANCE.setDropboxToken("");
ApplicationSettings.INSTANCE.save();
LOGGER.log("Successfully disconnected from Dropbox account.");
CloudStatus.getInstance().setStatus(CloudStatus.STATUS_DISCONNECTED);
} catch (DbxException ex) {
DbxUtil.showDbxAccessDeniedPrompt();
CloudStatus.getInstance().setStatus(currentCloudStatus);
}
} else {
LOGGER.log("Dropbox account already disconnected.");
CloudStatus.getInstance().setStatus(CloudStatus.STATUS_DISCONNECTED);
}
}
} |
<<<<<<<
private final RevisionDisplayTopComponent revtc = new TopComponentFactory<RevisionDisplayTopComponent>()
.getTopComponent(RevisionDisplayTopComponent.class.getSimpleName());
private static final ApplicationLogger LOGGER = new ApplicationLogger("Dropbox");
=======
>>>>>>>
private final RevisionDisplayTopComponent revtc = new TopComponentFactory<RevisionDisplayTopComponent>()
.getTopComponent(RevisionDisplayTopComponent.class.getSimpleName()); |
<<<<<<<
public static final String MARKETPAY_ENDPOINT_TEST = "https://cal-test.adyen.com/cal/services";
public static final String MARKETPAY_ENDPOINT_LIVE = "https://cal-live.adyen.com/cal/services";
public static final String API_VERSION = "v25";
public static final String MARKETPAY_API_VERSION = "v3";
=======
public static final String API_VERSION = "v30";
public static final String RECURRING_API_VERSION = "v25";
>>>>>>>
public static final String MARKETPAY_ENDPOINT_TEST = "https://cal-test.adyen.com/cal/services";
public static final String MARKETPAY_ENDPOINT_LIVE = "https://cal-live.adyen.com/cal/services";
public static final String API_VERSION = "v30";
public static final String RECURRING_API_VERSION = "v25";
public static final String MARKETPAY_API_VERSION = "v3";
<<<<<<<
public String getApiVersion() {
return API_VERSION;
}
public String getMarketPayApiVersion() {
return MARKETPAY_API_VERSION;
}
public String getLibraryVersion() {
return LIB_VERSION;
}
=======
>>>>>>> |
<<<<<<<
import com.fasterxml.jackson.annotation.JsonValue;
=======
import com.adyen.util.MaskUtil;
>>>>>>>
import com.fasterxml.jackson.annotation.JsonValue;
import com.adyen.util.MaskUtil; |
<<<<<<<
import com.fasterxml.jackson.annotation.JsonValue;
=======
import com.adyen.util.MaskUtil;
>>>>>>>
import com.fasterxml.jackson.annotation.JsonValue;
import com.adyen.util.MaskUtil; |
<<<<<<<
import com.lib.dto.LuceneSearchVo;
import com.lib.dto.PageVo;
=======
import com.lib.dto.JsonResult;
import com.lib.entity.DocInfo;
>>>>>>>
import com.lib.dto.LuceneSearchVo;
import com.lib.dto.PageVo;
import com.lib.dto.JsonResult;
import com.lib.entity.DocInfo; |
<<<<<<<
NewsDatabase.INSTANCE.initialize(this);
NewsSyncUtils.startNewsUpdateRepeating(this);
=======
PackageRemovedReceiver.register(getApplicationContext());
>>>>>>>
PackageRemovedReceiver.register(getApplicationContext());
NewsDatabase.INSTANCE.initialize(this);
NewsSyncUtils.startNewsUpdateRepeating(this); |
<<<<<<<
@Override
public FileInfo getFileInfoByFileId(Long fileId) {
// TODO Auto-generated method stub
return fileinfoDao.getFileInfoByFileId(fileId);
}
=======
@Override
public List<FileInfo> searchFileInfoByNameOrId(String searchInfo, Long userId) {
return fileinfoDao.searchFileInfoByNameOrId("%"+searchInfo+"%", userId);
}
>>>>>>>
@Override
public FileInfo getFileInfoByFileId(Long fileId) {
// TODO Auto-generated method stub
return fileinfoDao.getFileInfoByFileId(fileId);
}
@Override
public List<FileInfo> searchFileInfoByNameOrId(String searchInfo, Long userId) {
return fileinfoDao.searchFileInfoByNameOrId("%"+searchInfo+"%", userId);
} |
<<<<<<<
@RequestMapping(value="/recommend", method = {RequestMethod.POST,RequestMethod.GET})
=======
@RequestMapping("/recommend")
>>>>>>>
@RequestMapping(value="/recommend", method = {RequestMethod.POST,RequestMethod.GET})
<<<<<<<
System.out.println(list);
// Collections.reverse(list);//倒序排列
jr = new JsonResult< List<FileInfo>>(true, list);
=======
Collections.reverse(list);//倒序排列
System.out.println(list);
// jr = new JsonResult< List<FileInfo>>(true, list);
>>>>>>>
System.out.println(list);
jr = new JsonResult< List<FileInfo>>(true, list); |
<<<<<<<
import com.pspdfkit.annotations.Annotation;
import com.pspdfkit.react.events.PdfViewDataReturnedEvent;
=======
import com.pspdfkit.react.events.PdfViewAnnotationChangedEvent;
import com.pspdfkit.react.events.PdfViewAnnotationTappedEvent;
import com.pspdfkit.react.events.PdfViewDocumentSavedEvent;
>>>>>>>
import com.pspdfkit.react.events.PdfViewAnnotationChangedEvent;
import com.pspdfkit.react.events.PdfViewAnnotationTappedEvent;
import com.pspdfkit.react.events.PdfViewDocumentSavedEvent;
import com.pspdfkit.annotations.Annotation;
import com.pspdfkit.react.events.PdfViewDataReturnedEvent;
<<<<<<<
public static final int COMMAND_GET_ANNOTATIONS = 4;
public static final int COMMAND_ADD_ANNOTATION = 5;
public static final int COMMAND_GET_ALL_UNSAVED_ANNOTATIONS = 6;
public static final int COMMAND_ADD_ANNOTATIONS = 7;
=======
public static final int COMMAND_SAVE_CURRENT_DOCUMENT = 3;
>>>>>>>
public static final int COMMAND_SAVE_CURRENT_DOCUMENT = 3;
public static final int COMMAND_GET_ANNOTATIONS = 4;
public static final int COMMAND_ADD_ANNOTATION = 5;
public static final int COMMAND_GET_ALL_UNSAVED_ANNOTATIONS = 6;
public static final int COMMAND_ADD_ANNOTATIONS = 7;
<<<<<<<
COMMAND_EXIT_CURRENTLY_ACTIVE_MODE,
"getAnnotations",
COMMAND_GET_ANNOTATIONS,
"addAnnotation",
COMMAND_ADD_ANNOTATION,
"getAllUnsavedAnnotations",
COMMAND_GET_ALL_UNSAVED_ANNOTATIONS,
"addAnnotations",
COMMAND_ADD_ANNOTATIONS);
=======
COMMAND_EXIT_CURRENTLY_ACTIVE_MODE,
"saveCurrentDocument",
COMMAND_SAVE_CURRENT_DOCUMENT);
>>>>>>>
COMMAND_EXIT_CURRENTLY_ACTIVE_MODE,
"saveCurrentDocument",
COMMAND_SAVE_CURRENT_DOCUMENT,
"getAnnotations",
COMMAND_GET_ANNOTATIONS,
"addAnnotation",
COMMAND_ADD_ANNOTATION,
"getAllUnsavedAnnotations",
COMMAND_GET_ALL_UNSAVED_ANNOTATIONS,
"addAnnotations",
COMMAND_ADD_ANNOTATIONS);
<<<<<<<
return MapBuilder.of(PdfViewStateChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onStateChanged"),
PdfViewDataReturnedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onDataReturned"));
=======
return MapBuilder.of(PdfViewStateChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onStateChanged"),
PdfViewDocumentSavedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onDocumentSaved"),
PdfViewAnnotationTappedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onAnnotationTapped"),
PdfViewAnnotationChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onAnnotationsChanged"));
>>>>>>>
return MapBuilder.of(PdfViewStateChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onStateChanged"),
PdfViewDocumentSavedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onDocumentSaved"),
PdfViewAnnotationTappedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onAnnotationTapped"),
PdfViewAnnotationChangedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onAnnotationsChanged"),
PdfViewDataReturnedEvent.EVENT_NAME, MapBuilder.of("registrationName", "onDataReturned"));
<<<<<<<
case COMMAND_GET_ANNOTATIONS:
if (args != null) {
final int requestId = args.getInt(0);
Disposable annotationDisposable = root.getAnnotations(args.getInt(1), args.getString(2))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<List<Annotation>>() {
@Override
public void accept(List<Annotation> annotations) {
root.getEventDispatcher().dispatchEvent(new PdfViewDataReturnedEvent(root.getId(), requestId, annotations));
}
});
}
break;
case COMMAND_ADD_ANNOTATION:
if (args != null) {
root.addAnnotation(args.getMap(0));
}
break;
case COMMAND_GET_ALL_UNSAVED_ANNOTATIONS:
if (args != null) {
final int requestId = args.getInt(0);
Disposable annotationDisposable = root.getAllUnsavedAnnotations()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<JSONObject>() {
@Override
public void accept(JSONObject jsonObject) {
root.getEventDispatcher().dispatchEvent(new PdfViewDataReturnedEvent(root.getId(), requestId, jsonObject));
}
});
}
break;
case COMMAND_ADD_ANNOTATIONS:
if (args != null) {
root.addAnnotations(args.getMap(0));
}
break;
=======
case COMMAND_SAVE_CURRENT_DOCUMENT:
root.saveCurrentDocument();
break;
>>>>>>>
case COMMAND_SAVE_CURRENT_DOCUMENT:
root.saveCurrentDocument();
break;
case COMMAND_GET_ANNOTATIONS:
if (args != null) {
final int requestId = args.getInt(0);
Disposable annotationDisposable = root.getAnnotations(args.getInt(1), args.getString(2))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<List<Annotation>>() {
@Override
public void accept(List<Annotation> annotations) {
root.getEventDispatcher().dispatchEvent(new PdfViewDataReturnedEvent(root.getId(), requestId, annotations));
}
});
}
break;
case COMMAND_ADD_ANNOTATION:
if (args != null) {
root.addAnnotation(args.getMap(0));
}
break;
case COMMAND_GET_ALL_UNSAVED_ANNOTATIONS:
if (args != null) {
final int requestId = args.getInt(0);
Disposable annotationDisposable = root.getAllUnsavedAnnotations()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new Consumer<JSONObject>() {
@Override
public void accept(JSONObject jsonObject) {
root.getEventDispatcher().dispatchEvent(new PdfViewDataReturnedEvent(root.getId(), requestId, jsonObject));
}
});
}
break;
case COMMAND_ADD_ANNOTATIONS:
if (args != null) {
root.addAnnotations(args.getMap(0));
}
break; |
<<<<<<<
final ZeebeState otherZeebeState = new ZeebeState(1, newDb, newDb.createContext());
=======
final int secondPartitionId = Protocol.DEPLOYMENT_PARTITION + 1;
final ZeebeState otherZeebeState = new ZeebeState(secondPartitionId, newDb);
>>>>>>>
final int secondPartitionId = Protocol.DEPLOYMENT_PARTITION + 1;
final ZeebeState otherZeebeState =
new ZeebeState(secondPartitionId, newDb, newDb.createContext()); |
<<<<<<<
public static EmbeddedBrokerRule brokerRule = new EmbeddedBrokerRule();
public static ClientApiRule apiRule = new ClientApiRule(brokerRule::getClientAddress);
=======
public EmbeddedBrokerRule brokerRule = new EmbeddedBrokerRule();
public ClientApiRule apiRule = new ClientApiRule(brokerRule::getAtomix);
>>>>>>>
public static EmbeddedBrokerRule brokerRule = new EmbeddedBrokerRule();
public static ClientApiRule apiRule = new ClientApiRule(brokerRule::getAtomix); |
<<<<<<<
public static EmbeddedBrokerRule brokerRule = new EmbeddedBrokerRule();
public static ClientApiRule apiRule = new ClientApiRule(brokerRule::getClientAddress);
=======
public EmbeddedBrokerRule brokerRule = new EmbeddedBrokerRule();
public ClientApiRule apiRule = new ClientApiRule(brokerRule::getAtomix);
>>>>>>>
public static EmbeddedBrokerRule brokerRule = new EmbeddedBrokerRule();
public static ClientApiRule apiRule = new ClientApiRule(brokerRule::getAtomix); |
<<<<<<<
import static io.zeebe.logstreams.impl.LogBlockIndexWriter.LOG;
=======
import static io.zeebe.logstreams.impl.service.LogStreamServiceNames.distributedLogPartitionServiceName;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import io.zeebe.distributedlog.DistributedLogstreamService;
import io.zeebe.distributedlog.impl.DefaultDistributedLogstreamService;
import io.zeebe.distributedlog.impl.DistributedLogstreamPartition;
import io.zeebe.distributedlog.impl.DistributedLogstreamServiceConfig;
>>>>>>>
import static io.zeebe.logstreams.impl.LogBlockIndexWriter.LOG;
import static io.zeebe.logstreams.impl.service.LogStreamServiceNames.distributedLogPartitionServiceName;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyLong;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.mock;
import io.zeebe.distributedlog.DistributedLogstreamService;
import io.zeebe.distributedlog.impl.DefaultDistributedLogstreamService;
import io.zeebe.distributedlog.impl.DistributedLogstreamPartition;
import io.zeebe.distributedlog.impl.DistributedLogstreamServiceConfig;
<<<<<<<
=======
snapshotStorage = null;
closeDistributedLog();
distributedLogImpl = null;
>>>>>>>
closeDistributedLog();
distributedLogImpl = null;
<<<<<<<
=======
snapshotStorage = builder.getSnapshotStorage();
openDistributedLog();
>>>>>>>
openDistributedLog(); |
<<<<<<<
import com.mycelium.wapi.wallet.btc.bip44.HDAccountExternalSignature;
=======
import com.mycelium.wapi.wallet.btc.bip44.Bip44AccountExternalSignature;
import com.mycelium.wapi.wallet.coins.BitcoinTest;
import com.mycelium.wapi.wallet.coins.Value;
>>>>>>>
import com.mycelium.wapi.wallet.btc.bip44.HDAccountExternalSignature;
import com.mycelium.wapi.wallet.btc.bip44.Bip44AccountExternalSignature;
import com.mycelium.wapi.wallet.coins.BitcoinTest;
import com.mycelium.wapi.wallet.coins.Value; |
<<<<<<<
import static io.zeebe.broker.system.SystemServiceNames.METRICS_HTTP_SERVER;
import static io.zeebe.broker.transport.TransportServiceNames.MANAGEMENT_API_SERVER_NAME;
import static io.zeebe.broker.transport.TransportServiceNames.bufferingServerTransport;
=======
>>>>>>>
import static io.zeebe.broker.system.SystemServiceNames.METRICS_HTTP_SERVER; |
<<<<<<<
import io.zeebe.protocol.impl.record.value.workflowinstance.WorkflowInstanceCreationRecord;
=======
import io.zeebe.protocol.impl.record.value.workflowinstance.WorkflowInstanceRecord;
import io.zeebe.protocol.intent.DeploymentIntent;
>>>>>>>
import io.zeebe.protocol.impl.record.value.workflowinstance.WorkflowInstanceCreationRecord;
import io.zeebe.protocol.intent.DeploymentIntent;
<<<<<<<
import io.zeebe.protocol.intent.WorkflowInstanceCreationIntent;
import io.zeebe.test.broker.protocol.brokerapi.ControlMessageRequest;
=======
import io.zeebe.protocol.intent.WorkflowInstanceIntent;
>>>>>>>
import io.zeebe.protocol.intent.WorkflowInstanceCreationIntent;
import io.zeebe.protocol.intent.WorkflowInstanceIntent;
<<<<<<<
=======
private static final DirectBuffer EMPTY_PAYLOAD =
new UnsafeBuffer(new MsgPackConverter().convertToMsgPack("{}"));
private final int clientMaxRequests = 128;
>>>>>>>
<<<<<<<
@Test
public void shouldRefreshTopologyWhenLeaderIsNotKnown() {
// given
// initial topology has been fetched
waitUntil(() -> broker.getReceivedControlMessageRequests().size() == 1);
broker.jobs().registerCompleteCommand();
// extend topology
broker.addPartition(2);
final long key = (2L << Protocol.KEY_BITS) + 123;
final BrokerCompleteJobRequest request =
new BrokerCompleteJobRequest(key, DocumentValue.EMPTY_DOCUMENT);
// when
final BrokerResponse<JobRecord> response = client.sendRequest(request).join();
// then the client has refreshed its topology
assertThat(response.isResponse()).isTrue();
assertTopologyRefreshRequests(2);
=======
@After
public void tearDown() {
client.close();
>>>>>>>
@After
public void tearDown() {
client.close();
<<<<<<<
public void shouldThrottleTopologyRefreshRequestsWhenPartitionCannotBeDetermined() {
// when
final long start = System.currentTimeMillis();
assertThatThrownBy(() -> client.sendRequest(new BrokerCreateWorkflowInstanceRequest()).join());
final long requestDuration = System.currentTimeMillis() - start;
// then
final long actualTopologyRequests =
broker.getReceivedControlMessageRequests().stream()
.filter(r -> r.messageType() == ControlMessageType.REQUEST_TOPOLOGY)
.count();
// +4 (one for the extra request when client is started)
final long expectedMaximumTopologyRequests =
(requestDuration / BrokerTopologyManagerImpl.MIN_REFRESH_INTERVAL_MILLIS.toMillis()) + 4;
assertThat(actualTopologyRequests).isLessThanOrEqualTo(expectedMaximumTopologyRequests);
}
@Test
public void shouldThrottleTopologyRefreshRequestsWhenPartitionLeaderCannotBeDetermined() {
// given
final int nonExistingPartition = 999;
final long key = ((long) nonExistingPartition << Protocol.KEY_BITS) + 123;
// when
final long start = System.currentTimeMillis();
assertThatThrownBy(
() ->
client
.sendRequest(new BrokerCompleteJobRequest(key, DocumentValue.EMPTY_DOCUMENT))
.join());
final long requestDuration = System.currentTimeMillis() - start;
// then
final long actualTopologyRequests =
broker.getReceivedControlMessageRequests().stream()
.filter(r -> r.messageType() == ControlMessageType.REQUEST_TOPOLOGY)
.count();
// +4 (one for the extra request when client is started)
final long expectedMaximumTopologyRequests =
(requestDuration / BrokerTopologyManagerImpl.MIN_REFRESH_INTERVAL_MILLIS.toMillis()) + 4;
assertThat(actualTopologyRequests).isLessThanOrEqualTo(expectedMaximumTopologyRequests);
}
// TODO: revise the tests below
@Test
=======
>>>>>>>
<<<<<<<
client.sendRequest(new BrokerCompleteJobRequest(79, DocumentValue.EMPTY_DOCUMENT)).join();
=======
client
.sendRequest(
new BrokerCompleteJobRequest(
Protocol.encodePartitionId(Protocol.DEPLOYMENT_PARTITION, 79), EMPTY_PAYLOAD))
.join();
>>>>>>>
client
.sendRequest(
new BrokerCompleteJobRequest(
Protocol.encodePartitionId(Protocol.DEPLOYMENT_PARTITION, 79),
DocumentValue.EMPTY_DOCUMENT))
.join();
<<<<<<<
@Test
public void shouldFailRequestIfTopologyCannotBeRefreshed() {
// given
broker.onTopologyRequest().doNotRespond();
broker.onExecuteCommandRequest(ValueType.JOB, JobIntent.COMPLETE).doNotRespond();
// then
exception.expect(ExecutionException.class);
exception.expectMessage("Request timed out after PT5S");
// when
client.sendRequest(new BrokerCompleteJobRequest(0, DocumentValue.EMPTY_DOCUMENT)).join();
}
@Test
public void shouldRetryTopologyRequestAfterTimeout() {
// given
final int topologyTimeoutSeconds = 1;
broker.onTopologyRequest().doNotRespond();
broker.jobs().registerCompleteCommand();
// wait for a hanging topology request
waitUntil(
() ->
broker.getReceivedControlMessageRequests().stream()
.filter(r -> r.messageType() == ControlMessageType.REQUEST_TOPOLOGY)
.count()
== 1);
broker.stubTopologyRequest(); // make topology available
clock.addTime(Duration.ofSeconds(topologyTimeoutSeconds + 1)); // let request time out
// when making a new request
// then the topology has been refreshed and the request succeeded
client.sendRequest(new BrokerCompleteJobRequest(0, DocumentValue.EMPTY_DOCUMENT)).join();
}
=======
>>>>>>>
<<<<<<<
private void assertTopologyRefreshRequests(final int count) {
final List<ControlMessageRequest> receivedControlMessageRequests =
broker.getReceivedControlMessageRequests();
assertThat(receivedControlMessageRequests).hasSize(count);
receivedControlMessageRequests.forEach(
request -> {
assertThat(request.messageType()).isEqualTo(REQUEST_TOPOLOGY);
assertThat(request.getData()).isNull();
});
}
private void assertAtLeastTopologyRefreshRequests(final int count) {
final List<ControlMessageRequest> receivedControlMessageRequests =
broker.getReceivedControlMessageRequests();
assertThat(receivedControlMessageRequests.size()).isGreaterThanOrEqualTo(count);
receivedControlMessageRequests.forEach(
request -> {
assertThat(request.messageType()).isEqualTo(REQUEST_TOPOLOGY);
assertThat(request.getData()).isNull();
});
}
public void registerCreateWfCommand() {
final ExecuteCommandResponseBuilder builder =
broker
.onExecuteCommandRequest(
ValueType.WORKFLOW_INSTANCE_CREATION, WorkflowInstanceCreationIntent.CREATE)
.respondWith()
.event()
.intent(WorkflowInstanceCreationIntent.CREATED)
.key(ExecuteCommandRequest::key)
.value()
.allOf(ExecuteCommandRequest::getCommand)
.done();
builder.register();
}
=======
>>>>>>> |
<<<<<<<
public static final int METRICS_PORT = MetricsCfg.DEFAULT_PORT;
=======
public static final int ATOMIX_PORT = SocketBindingAtomixCfg.DEFAULT_PORT;
>>>>>>>
public static final int METRICS_PORT = MetricsCfg.DEFAULT_PORT;
public static final int ATOMIX_PORT = SocketBindingAtomixCfg.DEFAULT_PORT;
<<<<<<<
assertPorts(
"default", CLIENT_PORT, MANAGEMENT_PORT, REPLICATION_PORT, SUBSCRIPTION_PORT, METRICS_PORT);
=======
assertPorts(
"default", CLIENT_PORT, MANAGEMENT_PORT, REPLICATION_PORT, SUBSCRIPTION_PORT, ATOMIX_PORT);
>>>>>>>
assertPorts(
"default",
CLIENT_PORT,
MANAGEMENT_PORT,
REPLICATION_PORT,
SUBSCRIPTION_PORT,
ATOMIX_PORT,
METRICS_PORT);
<<<<<<<
SUBSCRIPTION_PORT + offset,
METRICS_PORT + offset);
=======
SUBSCRIPTION_PORT + offset,
ATOMIX_PORT + offset);
>>>>>>>
SUBSCRIPTION_PORT + offset,
ATOMIX_PORT + offset,
METRICS_PORT + offset);
<<<<<<<
SUBSCRIPTION_PORT + offset,
METRICS_PORT + offset);
=======
SUBSCRIPTION_PORT + offset,
ATOMIX_PORT + offset);
>>>>>>>
SUBSCRIPTION_PORT + offset,
ATOMIX_PORT + offset,
METRICS_PORT + offset);
<<<<<<<
assertPorts(
"default", CLIENT_PORT, MANAGEMENT_PORT, REPLICATION_PORT, SUBSCRIPTION_PORT, METRICS_PORT);
=======
assertPorts(
"default", CLIENT_PORT, MANAGEMENT_PORT, REPLICATION_PORT, SUBSCRIPTION_PORT, ATOMIX_PORT);
>>>>>>>
assertPorts(
"default",
CLIENT_PORT,
MANAGEMENT_PORT,
REPLICATION_PORT,
SUBSCRIPTION_PORT,
ATOMIX_PORT,
METRICS_PORT);
<<<<<<<
SUBSCRIPTION_PORT + offset,
METRICS_PORT + offset);
=======
SUBSCRIPTION_PORT + offset,
ATOMIX_PORT + offset);
>>>>>>>
SUBSCRIPTION_PORT + offset,
ATOMIX_PORT + offset,
METRICS_PORT + offset);
<<<<<<<
final int subscription,
final int metrics) {
final BrokerCfg brokerCfg = readConfig(configFileName);
final NetworkCfg network = brokerCfg.getNetwork();
=======
final int subscription,
final int atomix) {
final NetworkCfg network = readConfig(configFileName).getNetwork();
>>>>>>>
final int subscription,
final int atomix,
final int metrics) {
final BrokerCfg brokerCfg = readConfig(configFileName);
final NetworkCfg network = brokerCfg.getNetwork();
<<<<<<<
assertThat(brokerCfg.getMetrics().getPort()).isEqualTo(metrics);
=======
assertThat(network.getAtomix().getPort()).isEqualTo(atomix);
>>>>>>>
assertThat(network.getAtomix().getPort()).isEqualTo(atomix);
assertThat(brokerCfg.getMetrics().getPort()).isEqualTo(metrics); |
<<<<<<<
import io.zeebe.broker.exporter.record.value.RaftRecordValueImpl;
import io.zeebe.broker.exporter.record.value.VariableDocumentRecordValueImpl;
=======
>>>>>>>
import io.zeebe.broker.exporter.record.value.VariableDocumentRecordValueImpl;
<<<<<<<
import io.zeebe.exporter.api.record.Record;
import io.zeebe.exporter.api.record.RecordValue;
import io.zeebe.exporter.api.record.value.DeploymentRecordValue;
import io.zeebe.exporter.api.record.value.IncidentRecordValue;
import io.zeebe.exporter.api.record.value.JobRecordValue;
import io.zeebe.exporter.api.record.value.MessageRecordValue;
import io.zeebe.exporter.api.record.value.MessageSubscriptionRecordValue;
import io.zeebe.exporter.api.record.value.RaftRecordValue;
import io.zeebe.exporter.api.record.value.VariableDocumentRecordValue;
import io.zeebe.exporter.api.record.value.VariableRecordValue;
import io.zeebe.exporter.api.record.value.WorkflowInstanceCreationRecordValue;
import io.zeebe.exporter.api.record.value.WorkflowInstanceRecordValue;
import io.zeebe.exporter.api.record.value.WorkflowInstanceSubscriptionRecordValue;
=======
import io.zeebe.exporter.record.Record;
import io.zeebe.exporter.record.RecordValue;
import io.zeebe.exporter.record.value.DeploymentRecordValue;
import io.zeebe.exporter.record.value.IncidentRecordValue;
import io.zeebe.exporter.record.value.JobRecordValue;
import io.zeebe.exporter.record.value.MessageRecordValue;
import io.zeebe.exporter.record.value.MessageSubscriptionRecordValue;
import io.zeebe.exporter.record.value.VariableRecordValue;
import io.zeebe.exporter.record.value.WorkflowInstanceRecordValue;
import io.zeebe.exporter.record.value.WorkflowInstanceSubscriptionRecordValue;
>>>>>>>
import io.zeebe.exporter.api.record.Record;
import io.zeebe.exporter.api.record.RecordValue;
import io.zeebe.exporter.api.record.value.DeploymentRecordValue;
import io.zeebe.exporter.api.record.value.IncidentRecordValue;
import io.zeebe.exporter.api.record.value.JobRecordValue;
import io.zeebe.exporter.api.record.value.MessageRecordValue;
import io.zeebe.exporter.api.record.value.MessageSubscriptionRecordValue;
import io.zeebe.exporter.api.record.value.VariableDocumentRecordValue;
import io.zeebe.exporter.api.record.value.VariableRecordValue;
import io.zeebe.exporter.api.record.value.WorkflowInstanceCreationRecordValue;
import io.zeebe.exporter.api.record.value.WorkflowInstanceRecordValue;
import io.zeebe.exporter.api.record.value.WorkflowInstanceSubscriptionRecordValue;
<<<<<<<
import io.zeebe.protocol.intent.RaftIntent;
import io.zeebe.protocol.intent.VariableDocumentIntent;
=======
>>>>>>>
import io.zeebe.protocol.intent.VariableDocumentIntent; |
<<<<<<<
import org.agrona.DirectBuffer;
=======
import org.junit.Ignore;
>>>>>>>
import org.agrona.DirectBuffer;
import org.junit.Ignore;
<<<<<<<
=======
public void shouldDeleteOnClose() {
final File logDir = tempFolder.getRoot();
final LogStream logStream =
buildLogStream(b -> b.logRootPath(logDir.getAbsolutePath()).deleteOnClose(true));
// when
logStream.close();
// then
final File[] files = logDir.listFiles();
assertThat(files).isNotNull();
assertThat(files.length).isEqualTo(0);
}
@Test
public void shouldNotDeleteOnCloseByDefault() {
final File logDir = tempFolder.getRoot();
final LogStream logStream = buildLogStream(b -> b.logRootPath(logDir.getAbsolutePath()));
// when
logStream.close();
// then
final File[] files = logDir.listFiles();
assertThat(files).isNotNull();
assertThat(files.length).isGreaterThan(0);
}
@Test
@Ignore // events are appended only after committed. So cannot truncate.
>>>>>>> |
<<<<<<<
Preloader(List<GenericTransaction> toAdd, WalletAccount account, int offset, int limit, AtomicBoolean success) {
=======
Preloader(List<TransactionSummary> toAdd, WalletAccount account, MbwManager _mbwManager
, int offset, int limit, AtomicBoolean success) {
>>>>>>>
Preloader(List<GenericTransaction> toAdd, WalletAccount account, MbwManager _mbwManager
, int offset, int limit, AtomicBoolean success) {
<<<<<<<
List<GenericTransaction> preloadedData = account.getTransactions(offset, limit);
synchronized (toAdd) {
toAdd.addAll(preloadedData);
success.set(toAdd.size() == limit);
=======
List<TransactionSummary> preloadedData = account.getTransactionHistory(offset, limit);
if(account.equals(_mbwManager.getSelectedAccount())) {
synchronized (toAdd) {
toAdd.addAll(preloadedData);
success.set(toAdd.size() == limit);
}
>>>>>>>
List<GenericTransaction> preloadedData = account.getTransactions(offset, limit);
if(account.equals(_mbwManager.getSelectedAccount())) {
synchronized (toAdd) {
toAdd.addAll(preloadedData);
success.set(toAdd.size() == limit);
} |
<<<<<<<
import com.intellij.openapi.module.Module;
import com.intellij.openapi.module.ModuleManager;
import com.intellij.openapi.progress.ProgressIndicator;
import com.intellij.openapi.progress.Task;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.DumbAwareRunnable;
=======
import com.intellij.openapi.progress.*;
>>>>>>>
import com.intellij.openapi.progress.*;
import com.intellij.openapi.project.DumbAware;
import com.intellij.openapi.project.DumbAwareRunnable;
<<<<<<<
import com.intellij.openapi.roots.CompilerModuleExtension;
import com.intellij.openapi.roots.ModifiableRootModel;
import com.intellij.openapi.roots.ModuleRootManager;
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.openapi.vfs.VirtualFileManager;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowAnchor;
import com.intellij.openapi.wm.ToolWindowId;
import com.intellij.openapi.wm.ToolWindowManager;
import net.orfjackal.sbt.plugin.settings.SbtApplicationSettingsComponent;
import net.orfjackal.sbt.plugin.settings.SbtProjectSettingsComponent;
import net.orfjackal.sbt.runner.OutputReader;
import net.orfjackal.sbt.runner.SbtRunner;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import java.util.Scanner;
public class SbtRunnerComponent extends AbstractProjectComponent implements DumbAware {
=======
import com.intellij.openapi.vfs.*;
import net.orfjackal.sbt.plugin.settings.*;
import net.orfjackal.sbt.runner.*;
import java.io.*;
import java.util.*;
public class SbtRunnerComponent extends AbstractProjectComponent {
>>>>>>>
import com.intellij.openapi.startup.StartupManager;
import com.intellij.openapi.vfs.*;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowAnchor;
import com.intellij.openapi.wm.ToolWindowManager;
import net.orfjackal.sbt.plugin.settings.*;
import net.orfjackal.sbt.runner.*;
import java.io.File;
import java.io.IOException;
import java.util.Properties;
import java.util.Scanner;
public class SbtRunnerComponent extends AbstractProjectComponent implements DumbAware { |
<<<<<<<
@Override
public void onSignedOut() {
// TODO: Implement
}
@Override
public void onSignInFailed() {
// TODO: Implement
}
@Override
public void onMessageReceived(String from, Bundle message) {
// TODO: Implement
}
=======
@Override
public void onMessageReceived(String from, Bundle message) {
logAndToast("Message received", message);
}
private void logAndToast(String message) {
logAndToast(message, "");
}
private void logAndToast(String message, Object value) {
String text = message + "//" + value;
Log.d(TAG, text);
Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();
}
>>>>>>>
@Override
public void onSignedOut() {
// TODO: Implement
}
@Override
public void onSignInFailed() {
// TODO: Implement
}
@Override
public void onMessageReceived(String from, Bundle message) {
logAndToast("Message received", message);
}
private void logAndToast(String message) {
logAndToast(message, "");
}
private void logAndToast(String message, Object value) {
String text = message + "//" + value;
Log.d(TAG, text);
Toast.makeText(getApplicationContext(), text, Toast.LENGTH_LONG).show();
} |
<<<<<<<
import ucar.unidata.data.*;
import ucar.unidata.geoloc.*;
import ucar.unidata.geoloc.projection.*;
=======
import ucar.unidata.data.BadDataException;
import ucar.unidata.data.DataCategory;
import ucar.unidata.data.DataChoice;
import ucar.unidata.data.DataSelection;
import ucar.unidata.data.DataSourceDescriptor;
import ucar.unidata.data.DerivedDataChoice;
import ucar.unidata.data.DirectDataChoice;
import ucar.unidata.data.GeoLocationInfo;
import ucar.unidata.data.GeoSelection;
import ucar.unidata.geoloc.LatLonPointImpl;
import ucar.unidata.geoloc.LatLonRect;
import ucar.unidata.geoloc.ProjectionImpl;
>>>>>>>
import ucar.unidata.data.*;
import ucar.unidata.geoloc.LatLonPointImpl;
import ucar.unidata.geoloc.LatLonRect;
import ucar.unidata.geoloc.ProjectionImpl;
<<<<<<<
long starttime = System.currentTimeMillis();
FieldImpl fieldImpl = null;
=======
long starttime = System.currentTimeMillis();
FieldImpl fieldImpl = null;
//GridDataset myDataset = getDataset();
//if (myDataset == null) {
// return null;
//}
//GeoGrid geoGrid = findGridForDataChoice(myDataset, dataChoice);
//String paramName = dataChoice.getStringId();
>>>>>>>
long starttime = System.currentTimeMillis();
FieldImpl fieldImpl = null;
//GridDataset myDataset = getDataset();
//if (myDataset == null) {
// return null;
//}
//GeoGrid geoGrid = findGridForDataChoice(myDataset, dataChoice);
//String paramName = dataChoice.getStringId();
<<<<<<<
GeoGridAdapter adapter = makeGeoGridAdapter(dataChoice,
givenDataSelection, requestProperties,
fromLevelIndex, toLevelIndex, false);
=======
GeoGridAdapter adapter = null;
try {
adapter = makeGeoGridAdapter(dataChoice, givenDataSelection,
requestProperties, fromLevelIndex,
toLevelIndex, false);
} catch (HugeSizeException hse) {
return null;
}
>>>>>>>
GeoGridAdapter adapter = null;
try {
adapter = makeGeoGridAdapter(dataChoice, givenDataSelection,
requestProperties, fromLevelIndex,
toLevelIndex, false);
} catch (HugeSizeException hse) {
return null;
} |
<<<<<<<
private final WatcherRemoveCuratorFramework client;
private final CreateModable<ACLBackgroundPathAndBytesable<String>> createMethod;
=======
private final CuratorFramework client;
>>>>>>>
private final WatcherRemoveCuratorFramework client; |
<<<<<<<
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
=======
import org.apache.zookeeper.data.ACL;
>>>>>>>
import org.apache.zookeeper.data.ACL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory; |
<<<<<<<
ChildData oldChildData = childData.getAndSet(null);
ConcurrentMap<String, TreeNode> childMap = children.getAndSet(null);
=======
ChildData oldChildData = childDataUpdater.getAndSet(this, null);
client.clearWatcherReferences(this);
ConcurrentMap<String, TreeNode> childMap = childrenUpdater.getAndSet(this,null);
>>>>>>>
ChildData oldChildData = childDataUpdater.getAndSet(this, null);
ConcurrentMap<String, TreeNode> childMap = childrenUpdater.getAndSet(this,null); |
<<<<<<<
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.utils.PathUtils;
=======
import org.apache.curator.utils.ThreadUtils;
>>>>>>>
import org.apache.curator.utils.CloseableUtils;
import org.apache.curator.utils.PathUtils;
import org.apache.curator.utils.ThreadUtils; |
<<<<<<<
private final ErrorPolicy errorPolicy;
=======
private final AtomicLong currentInstanceIndex = new AtomicLong(-1);
private final InternalConnectionHandler internalConnectionHandler;
>>>>>>>
private final ErrorPolicy errorPolicy;
private final AtomicLong currentInstanceIndex = new AtomicLong(-1);
private final InternalConnectionHandler internalConnectionHandler;
<<<<<<<
errorPolicy = parent.errorPolicy;
=======
internalConnectionHandler = parent.internalConnectionHandler;
>>>>>>>
errorPolicy = parent.errorPolicy;
internalConnectionHandler = parent.internalConnectionHandler; |
<<<<<<<
=======
import com.google.common.collect.Queues;
>>>>>>>
import com.google.common.collect.Queues;
<<<<<<<
import org.apache.curator.framework.api.CuratorWatcher;
import org.apache.curator.framework.imps.TestCleanState;
=======
import org.apache.curator.framework.api.CuratorWatcher;
>>>>>>>
import org.apache.curator.framework.api.CuratorWatcher;
import org.apache.curator.framework.imps.TestCleanState;
<<<<<<<
import org.apache.curator.utils.CloseableUtils;
=======
import org.apache.curator.utils.CloseableUtils;
import org.apache.zookeeper.KeeperException;
>>>>>>>
import org.apache.curator.utils.CloseableUtils;
import org.apache.zookeeper.KeeperException;
<<<<<<<
=======
@Test
public void testChildReaperCleansUpLockNodes() throws Exception
{
Timing timing = new Timing();
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
client.start();
ChildReaper childReaper = null;
try
{
InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(client, "/test/lock", 1);
semaphore.returnLease(semaphore.acquire(timing.forWaiting().seconds(), TimeUnit.SECONDS));
Assert.assertTrue(client.getChildren().forPath("/test").size() > 0);
childReaper = new ChildReaper(
client,
"/test",
Reaper.Mode.REAP_UNTIL_GONE,
ChildReaper.newExecutorService(),
1,
"/test-leader",
InterProcessSemaphoreV2.LOCK_SCHEMA
);
childReaper.start();
timing.forWaiting().sleepABit();
List<String> children = client.getChildren().forPath("/test");
Assert.assertEquals(children.size(), 0, "All children of /test should have been reaped");
}
finally
{
CloseableUtils.closeQuietly(childReaper);
CloseableUtils.closeQuietly(client);
}
}
>>>>>>>
@Test
public void testChildReaperCleansUpLockNodes() throws Exception
{
Timing timing = new Timing();
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
client.start();
ChildReaper childReaper = null;
try
{
InterProcessSemaphoreV2 semaphore = new InterProcessSemaphoreV2(client, "/test/lock", 1);
semaphore.returnLease(semaphore.acquire(timing.forWaiting().seconds(), TimeUnit.SECONDS));
Assert.assertTrue(client.getChildren().forPath("/test").size() > 0);
childReaper = new ChildReaper(
client,
"/test",
Reaper.Mode.REAP_UNTIL_GONE,
ChildReaper.newExecutorService(),
1,
"/test-leader",
InterProcessSemaphoreV2.LOCK_SCHEMA
);
childReaper.start();
timing.forWaiting().sleepABit();
List<String> children = client.getChildren().forPath("/test");
Assert.assertEquals(children.size(), 0, "All children of /test should have been reaped");
}
finally
{
CloseableUtils.closeQuietly(childReaper);
CloseableUtils.closeQuietly(client);
}
} |
<<<<<<<
import com.mycelium.wapi.wallet.btc.coins.BitcoinTest;
=======
import com.mycelium.wapi.wallet.btc.bip44.HDConfig;
import com.mycelium.wapi.wallet.coins.BitcoinMain;
import com.mycelium.wapi.wallet.coins.BitcoinTest;
>>>>>>>
import com.mycelium.wapi.wallet.btc.bip44.HDConfig;
import com.mycelium.wapi.wallet.btc.coins.BitcoinTest; |
<<<<<<<
private List<AuthInfo> buildAuths(CuratorFrameworkFactory.Builder builder)
{
ImmutableList.Builder<AuthInfo> builder1 = ImmutableList.builder();
if ( builder.getAuthInfos() != null )
{
builder1.addAll(builder.getAuthInfos());
}
return builder1.build();
}
=======
@Override
public WatcherRemoveCuratorFramework newWatcherRemoveCuratorFramework()
{
return new WatcherRemovalFacade(this);
}
>>>>>>>
private List<AuthInfo> buildAuths(CuratorFrameworkFactory.Builder builder)
{
ImmutableList.Builder<AuthInfo> builder1 = ImmutableList.builder();
if ( builder.getAuthInfos() != null )
{
builder1.addAll(builder.getAuthInfos());
}
return builder1.build();
}
@Override
public WatcherRemoveCuratorFramework newWatcherRemoveCuratorFramework()
{
return new WatcherRemovalFacade(this);
} |
<<<<<<<
public void testQuickClose() throws Exception
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), 1, new RetryNTimes(0, 0));
try
{
client.start();
client.close();
}
finally
{
CloseableUtils.closeQuietly(client);
}
}
@Test
=======
public void testCreateContainersForBadConnect() throws Exception
{
final int serverPort = server.getPort();
server.close();
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), 1000, 1000, new RetryForever(100));
try
{
new Thread()
{
@Override
public void run()
{
try
{
Thread.sleep(3000);
server = new TestingServer(serverPort, true);
}
catch ( Exception e )
{
e.printStackTrace();
}
}
}.start();
client.start();
client.createContainers("/this/does/not/exist");
Assert.assertNotNull(client.checkExists().forPath("/this/does/not/exist"));
}
finally
{
CloseableUtils.closeQuietly(client);
}
}
@Test
>>>>>>>
public void testCreateContainersForBadConnect() throws Exception
{
final int serverPort = server.getPort();
server.close();
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), 1000, 1000, new RetryForever(100));
try
{
new Thread()
{
@Override
public void run()
{
try
{
Thread.sleep(3000);
server = new TestingServer(serverPort, true);
}
catch ( Exception e )
{
e.printStackTrace();
}
}
}.start();
client.start();
client.createContainers("/this/does/not/exist");
Assert.assertNotNull(client.checkExists().forPath("/this/does/not/exist"));
}
finally
{
CloseableUtils.closeQuietly(client);
}
}
@Test
public void testQuickClose() throws Exception
{
CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), 1, new RetryNTimes(0, 0));
try
{
client.start();
client.close();
}
finally
{
CloseableUtils.closeQuietly(client);
}
}
@Test |
<<<<<<<
stat.set(null);
data.set(null);
=======
Stat oldStat = stat.getAndSet(null);
byte[] oldData = data.getAndSet(null);
client.clearWatcherReferences(this);
>>>>>>>
Stat oldStat = stat.getAndSet(null);
byte[] oldData = data.getAndSet(null);
client.watches().remove(this).ofType(WatcherType.Any).inBackground().forPath(path);
<<<<<<<
this.client = client.newWatcherRemoveCuratorFramework();
=======
this.client = Preconditions.checkNotNull(client, "client cannot be null");
>>>>>>>
Preconditions.checkNotNull(client, "client cannot be null");
this.client = client.newWatcherRemoveCuratorFramework(); |
<<<<<<<
=======
public static final String BUILD = Gpr.compileTimeStamp(Bds.class);
public static final String REVISION = "c";
public static final String SOFTWARE_NAME = Bds.class.getSimpleName();
public static final String VERSION_MAJOR = "2.1";
public static final String VERSION_SHORT = VERSION_MAJOR + REVISION;
public static final String VERSION = SOFTWARE_NAME + " " + VERSION_SHORT + " (build " + BUILD + "), by " + Pcingola.BY;
>>>>>>>
public static final String BUILD = Gpr.compileTimeStamp(Bds.class);
public static final String REVISION = "c";
public static final String SOFTWARE_NAME = Bds.class.getSimpleName();
public static final String VERSION_MAJOR = "2.1";
public static final String VERSION_SHORT = VERSION_MAJOR + REVISION;
public static final String VERSION = SOFTWARE_NAME + " " + VERSION_SHORT + " (build " + BUILD + "), by " + Pcingola.BY; |
<<<<<<<
import org.jpmml.sparkml.MatrixUtil;
import org.jpmml.sparkml.ScaledFeatureUtil;
=======
>>>>>>>
import org.jpmml.sparkml.MatrixUtil;
<<<<<<<
if(categoricalLabel.size() == 2){
List<Feature> features = new ArrayList<>(schema.getFeatures());
List<Double> coefficients = new ArrayList<>(VectorUtil.toList(model.coefficients()));
ScaledFeatureUtil.simplify(features, coefficients);
=======
RegressionTableUtil.simplify(this, null, features, coefficients);
>>>>>>>
if(categoricalLabel.size() == 2){
List<Feature> features = new ArrayList<>(schema.getFeatures());
List<Double> coefficients = new ArrayList<>(VectorUtil.toList(model.coefficients())); |
<<<<<<<
=======
if(expression instanceof StringTrim){
return PMMLUtil.createApply(PMMLFunctions.TRIMBLANKS, translateInternal(child));
} else
>>>>>>> |
<<<<<<<
import org.dmg.pmml.regression.RegressionTable;
import org.jpmml.converter.CategoricalLabel;
import org.jpmml.converter.Feature;
import org.jpmml.converter.ModelUtil;
=======
import org.jpmml.converter.Feature;
>>>>>>>
import org.dmg.pmml.regression.RegressionTable;
import org.jpmml.converter.CategoricalLabel;
import org.jpmml.converter.Feature;
import org.jpmml.converter.ModelUtil;
<<<<<<<
import org.jpmml.sparkml.MatrixUtil;
=======
import org.jpmml.sparkml.ScaledFeatureUtil;
>>>>>>>
import org.jpmml.sparkml.MatrixUtil;
import org.jpmml.sparkml.ScaledFeatureUtil;
<<<<<<<
CategoricalLabel categoricalLabel = (CategoricalLabel)schema.getLabel();
if(categoricalLabel.size() == 2){
RegressionModel regressionModel = RegressionModelUtil.createBinaryLogisticClassification(schema.getFeatures(), VectorUtil.toList(model.coefficients()), model.intercept(), RegressionModel.NormalizationMethod.LOGIT, true, schema)
.setOutput(null);
return regressionModel;
} else
if(categoricalLabel.size() > 2){
Matrix coefficientMatrix = model.coefficientMatrix();
Vector interceptVector = model.interceptVector();
List<? extends Feature> features = schema.getFeatures();
List<RegressionTable> regressionTables = new ArrayList<>();
for(int i = 0; i < categoricalLabel.size(); i++){
RegressionTable regressionTable = RegressionModelUtil.createRegressionTable(features, MatrixUtil.getRow(coefficientMatrix, i), interceptVector.apply(i))
.setTargetCategory(categoricalLabel.getValue(i));
regressionTables.add(regressionTable);
}
RegressionModel regressionModel = new RegressionModel(MiningFunction.CLASSIFICATION, ModelUtil.createMiningSchema(categoricalLabel), regressionTables)
.setNormalizationMethod(RegressionModel.NormalizationMethod.SOFTMAX);
return regressionModel;
} else
=======
List<Feature> features = new ArrayList<>(schema.getFeatures());
List<Double> coefficients = new ArrayList<>(VectorUtil.toList(model.coefficients()));
ScaledFeatureUtil.simplify(features, coefficients);
RegressionModel regressionModel = RegressionModelUtil.createBinaryLogisticClassification(features, coefficients, model.intercept(), RegressionModel.NormalizationMethod.LOGIT, true, schema)
.setOutput(null);
>>>>>>>
CategoricalLabel categoricalLabel = (CategoricalLabel)schema.getLabel();
if(categoricalLabel.size() == 2){
List<Feature> features = new ArrayList<>(schema.getFeatures());
List<Double> coefficients = new ArrayList<>(VectorUtil.toList(model.coefficients()));
ScaledFeatureUtil.simplify(features, coefficients);
RegressionModel regressionModel = RegressionModelUtil.createBinaryLogisticClassification(features, coefficients, model.intercept(), RegressionModel.NormalizationMethod.LOGIT, true, schema)
.setOutput(null);
return regressionModel;
} else
if(categoricalLabel.size() > 2){
Matrix coefficientMatrix = model.coefficientMatrix();
Vector interceptVector = model.interceptVector();
List<RegressionTable> regressionTables = new ArrayList<>();
for(int i = 0; i < categoricalLabel.size(); i++){
List<Feature> features = new ArrayList<>(schema.getFeatures());
List<Double> coefficients = new ArrayList<>(MatrixUtil.getRow(coefficientMatrix, i));
ScaledFeatureUtil.simplify(features, coefficients);
RegressionTable regressionTable = RegressionModelUtil.createRegressionTable(features, coefficients, interceptVector.apply(i))
.setTargetCategory(categoricalLabel.getValue(i));
regressionTables.add(regressionTable);
}
RegressionModel regressionModel = new RegressionModel(MiningFunction.CLASSIFICATION, ModelUtil.createMiningSchema(categoricalLabel), regressionTables)
.setNormalizationMethod(RegressionModel.NormalizationMethod.SOFTMAX);
return regressionModel;
} else |
<<<<<<<
=======
import java.io.IOException;
import java.net.MalformedURLException;
>>>>>>>
import java.io.IOException;
import java.net.MalformedURLException; |
<<<<<<<
public static final String PackageName = "Crypto";
public static final String CodeGenerationCallFolder = Constants.innerFileSeparator + Constants.PackageName;
public static final String CodeGenerationCallFile = CodeGenerationCallFolder + Constants.innerFileSeparator + Constants.AdditionalOutputFile;
=======
public static final String PackageName = "de" + Constants.innerFileSeparator + "cognicrypt" + Constants.innerFileSeparator + "crypto";
public static final String CodeGenerationCallFile = Constants.innerFileSeparator + Constants.PackageName + Constants.innerFileSeparator + Constants.AdditionalOutputFile;
>>>>>>>
public static final String PackageName = "de" + Constants.innerFileSeparator + "cognicrypt" + Constants.innerFileSeparator + "crypto";
public static final String CodeGenerationCallFolder = Constants.innerFileSeparator + Constants.PackageName;
public static final String CodeGenerationCallFile = CodeGenerationCallFolder + Constants.innerFileSeparator + Constants.AdditionalOutputFile; |
<<<<<<<
final CryptSLRule rule = new CryptSLRule(curClass, objects, this.forbiddenMethods, this.smg, constraints,
actPreds);
=======
final CryptSLRule rule = new CryptSLRule(this.curClass, objects, this.forbiddenMethods, this.smg,
constraints, actPreds);
>>>>>>>
final CryptSLRule rule = new CryptSLRule(this.curClass, objects, this.forbiddenMethods, this.smg, constraints, actPreds);
<<<<<<<
ObjectImpl object = (ObjectImpl) ((LiteralExpression) lit.getLit().getName()).getValue();
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
String type = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
String variable = object.getName();
=======
final ObjectImpl object = (ObjectImpl) ((LiteralExpression) lit.getLit().getName()).getValue();
final String type = ((ObjectDecl) object.eContainer()).getObjectType().getQualifiedName();
final String variable = object.getName();
>>>>>>>
final ObjectImpl object = (ObjectImpl) ((LiteralExpression) lit.getLit().getName()).getValue();
final ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
final String type = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
final String variable = object.getName();
<<<<<<<
SuperType object = name.getValue();
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
=======
final SuperType object = name.getValue();
>>>>>>>
final SuperType object = name.getValue();
final ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
<<<<<<<
SuperType object = name.getValue();
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
=======
final SuperType object = name.getValue();
>>>>>>>
final SuperType object = name.getValue();
final ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
<<<<<<<
Object object = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons()).getObj()
.get(0);
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
String type = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
=======
final Object object = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons())
.getObj().get(0);
final String type = ((ObjectDecl) object.eContainer()).getObjectType().getQualifiedName();
>>>>>>>
final Object object = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons()).getObj()
.get(0);
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
final String type = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
<<<<<<<
Object objectL = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons()).getObj()
.get(0);
objectDecl = (ObjectDecl) objectL.eContainer();
String typeL = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
=======
final Object objectL = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons())
.getObj().get(0);
final String typeL = ((ObjectDecl) objectL.eContainer()).getObjectType().getQualifiedName();
>>>>>>>
final Object objectL = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons()).getObj().get(0);
objectDecl = (ObjectDecl) objectL.eContainer();
final String typeL = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : ""); |
<<<<<<<
import crypto.rules.CryptSLRule;
=======
>>>>>>>
import crypto.rules.CryptSLRule; |
<<<<<<<
import org.junit.Ignore;
import org.junit.After;
import org.junit.Before;
=======
>>>>>>>
import org.junit.Ignore;
import org.junit.After;
import org.junit.Before;
<<<<<<<
this.configEnc = TestUtils.createXSLConfigurationForCodeGeneration(developerProject, encTask);
boolean encCheck = generatorEnc.generateCodeTemplates(configEnc, encTask.getAdditionalResources());
=======
this.configEnc = TestUtils.createConfigurationForCodeGeneration(this.developerProject, this.encTask);
final boolean encCheck = this.generatorEnc.generateCodeTemplates(this.configEnc,
this.encTask.getAdditionalResources());
>>>>>>>
this.configEnc = TestUtils.createXSLConfigurationForCodeGeneration(this.developerProject, this.encTask);
final boolean encCheck = this.generatorEnc.generateCodeTemplates(this.configEnc,
this.encTask.getAdditionalResources());
<<<<<<<
ICompilationUnit testClassUnit = TestUtils.getICompilationUnit(developerProject, "testPackage", "Test.java");
TestUtils.openJavaFileInWorkspace(developerProject, "testPackage", testClassUnit);
this.configEnc = TestUtils.createXSLConfigurationForCodeGeneration(developerProject, encTask);
generatorEnc.generateCodeTemplates(configEnc, encTask.getAdditionalResources());
assertEquals(1, TestUtils.countMethods(testClassUnit));
=======
final ICompilationUnit testClassUnit = TestUtils.getICompilationUnit(this.developerProject, "testPackage",
"Test.java");
TestUtils.openJavaFileInWorkspace(this.developerProject, "testPackage", testClassUnit);
this.configEnc = TestUtils.createConfigurationForCodeGeneration(this.developerProject, this.encTask);
this.generatorEnc.generateCodeTemplates(this.configEnc, this.encTask.getAdditionalResources());
assertEquals(1, countMethods(testClassUnit));
>>>>>>>
final ICompilationUnit testClassUnit = TestUtils.getICompilationUnit(this.developerProject, "testPackage",
"Test.java");
TestUtils.openJavaFileInWorkspace(this.developerProject, "testPackage", testClassUnit);
this.configEnc = TestUtils.createXSLConfigurationForCodeGeneration(this.developerProject, this.encTask);
this.generatorEnc.generateCodeTemplates(this.configEnc, this.encTask.getAdditionalResources());
assertEquals(1, countMethods(testClassUnit));
<<<<<<<
this.configEnc = TestUtils.createXSLConfigurationForCodeGeneration(developerProject, encTask);
generatorEnc.generateCodeTemplates(configEnc, encTask.getAdditionalResources());
this.configSecPassword = TestUtils.createXSLConfigurationForCodeGeneration(developerProject, secPasswordTask);
generatorSecPassword.generateCodeTemplates(configSecPassword, secPasswordTask.getAdditionalResources());
ICompilationUnit outputUnit = TestUtils.getICompilationUnit(developerProject, Constants.PackageName,"Output.java");
assertEquals(2, TestUtils.countMethods(outputUnit));
=======
this.configEnc = TestUtils.createConfigurationForCodeGeneration(this.developerProject, this.encTask);
this.generatorEnc.generateCodeTemplates(this.configEnc, this.encTask.getAdditionalResources());
this.configSecPassword = TestUtils.createConfigurationForCodeGeneration(this.developerProject,
this.secPasswordTask);
this.generatorSecPassword.generateCodeTemplates(this.configSecPassword,
this.secPasswordTask.getAdditionalResources());
final ICompilationUnit outputUnit = TestUtils.getICompilationUnit(this.developerProject, Constants.PackageName,
"Output.java");
assertEquals(2, countMethods(outputUnit));
>>>>>>>
this.configEnc = TestUtils.createXSLConfigurationForCodeGeneration(this.developerProject, this.encTask);
this.generatorEnc.generateCodeTemplates(this.configEnc, this.encTask.getAdditionalResources());
this.configSecPassword = TestUtils.createXSLConfigurationForCodeGeneration(this.developerProject,
this.secPasswordTask);
this.generatorSecPassword.generateCodeTemplates(this.configSecPassword,
this.secPasswordTask.getAdditionalResources());
final ICompilationUnit outputUnit = TestUtils.getICompilationUnit(this.developerProject, Constants.PackageName,
"Output.java");
assertEquals(2, countMethods(outputUnit)); |
<<<<<<<
import de.cognicrypt.core.Constants.CodeGenerators;
import de.cognicrypt.utils.Utils;
=======
import de.cognicrypt.utils.DeveloperProject;
>>>>>>>
import de.cognicrypt.core.Constants.CodeGenerators;
import de.cognicrypt.utils.Utils;
import de.cognicrypt.utils.DeveloperProject; |
<<<<<<<
final CryptSLRule rule = new CryptSLRule(curClass, objects, this.forbiddenMethods, this.smg, constraints,
actPreds);
=======
final CryptSLRule rule = new CryptSLRule(this.curClass, objects, this.forbiddenMethods, this.smg,
constraints, actPreds);
>>>>>>>
final CryptSLRule rule = new CryptSLRule(this.curClass, objects, this.forbiddenMethods, this.smg, constraints, actPreds);
<<<<<<<
ObjectImpl object = (ObjectImpl) ((LiteralExpression) lit.getLit().getName()).getValue();
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
String type = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
String variable = object.getName();
=======
final ObjectImpl object = (ObjectImpl) ((LiteralExpression) lit.getLit().getName()).getValue();
final String type = ((ObjectDecl) object.eContainer()).getObjectType().getQualifiedName();
final String variable = object.getName();
>>>>>>>
final ObjectImpl object = (ObjectImpl) ((LiteralExpression) lit.getLit().getName()).getValue();
final ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
final String type = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
final String variable = object.getName();
<<<<<<<
SuperType object = name.getValue();
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
=======
final SuperType object = name.getValue();
>>>>>>>
final SuperType object = name.getValue();
final ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
<<<<<<<
SuperType object = name.getValue();
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
=======
final SuperType object = name.getValue();
>>>>>>>
final SuperType object = name.getValue();
final ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
<<<<<<<
Object object = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons()).getObj()
.get(0);
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
String type = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
=======
final Object object = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons())
.getObj().get(0);
final String type = ((ObjectDecl) object.eContainer()).getObjectType().getQualifiedName();
>>>>>>>
final Object object = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons()).getObj()
.get(0);
ObjectDecl objectDecl = (ObjectDecl) object.eContainer();
final String type = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
<<<<<<<
Object objectL = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons()).getObj()
.get(0);
objectDecl = (ObjectDecl) objectL.eContainer();
String typeL = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : "");
=======
final Object objectL = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons())
.getObj().get(0);
final String typeL = ((ObjectDecl) objectL.eContainer()).getObjectType().getQualifiedName();
>>>>>>>
final Object objectL = (de.darmstadt.tu.crossing.cryptSL.Object) ((PreDefinedPredicates) lit.getCons()).getObj().get(0);
objectDecl = (ObjectDecl) objectL.eContainer();
final String typeL = objectDecl.getObjectType().getQualifiedName()
+ ((objectDecl.getArray() != null) ? objectDecl.getArray() : ""); |
<<<<<<<
public static final String PackageName = "Crypto";
public static final String CodeGenerationCallFolder = Constants.innerFileSeparator + Constants.PackageName;
public static final String CodeGenerationCallFile = CodeGenerationCallFolder + Constants.innerFileSeparator + Constants.AdditionalOutputFile;
=======
public static final String PackageName = "de" + Constants.innerFileSeparator + "cognicrypt" + Constants.innerFileSeparator + "crypto";
public static final String CodeGenerationCallFile = Constants.innerFileSeparator + Constants.PackageName + Constants.innerFileSeparator + Constants.AdditionalOutputFile;
>>>>>>>
public static final String PackageName = "de" + Constants.innerFileSeparator + "cognicrypt" + Constants.innerFileSeparator + "crypto";
public static final String CodeGenerationCallFolder = Constants.innerFileSeparator + Constants.PackageName;
public static final String CodeGenerationCallFile = CodeGenerationCallFolder + Constants.innerFileSeparator + Constants.AdditionalOutputFile; |
<<<<<<<
case IBankTypes.MARGINALEN:
return new Marginalen(context);
=======
case IBankTypes.CHALMREST:
return new Chalmrest(context);
>>>>>>>
case IBankTypes.CHALMREST:
return new Chalmrest(context);
case IBankTypes.MARGINALEN:
return new Marginalen(context);
<<<<<<<
banks.add(new Marginalen(context));
=======
banks.add(new Chalmrest(context));
>>>>>>>
banks.add(new Chalmrest(context));
banks.add(new Marginalen(context)); |
<<<<<<<
//dynamicDAG.getParentSetTime0(B).addParent(H1);
//dynamicDAG.getParentSetTime0(C).addParent(H1);
//dynamicDAG.getParentSetTime0(D).addParent(H1);
//dynamicDAG.getParentSetTime0(B).addParent(H2);
//dynamicDAG.getParentSetTime0(C).addParent(H2);
//dynamicDAG.getParentSetTime0(D).addParent(H2);
//dynamicDAG.getParentSetTimeT(H1).addParent(ATempClone);
//dynamicDAG.getParentSetTimeT(H2).addParent(ATempClone);
DynamicDAG dynamicDAG = new DynamicDAG(dynamicVariables);
=======
>>>>>>>
DynamicDAG dynamicDAG = new DynamicDAG(dynamicVariables); |
<<<<<<<
import COM.hugin.HAPI.ExceptionHugin;
import com.google.common.base.Stopwatch;
=======
>>>>>>>
import COM.hugin.HAPI.ExceptionHugin;
import com.google.common.base.Stopwatch; |
<<<<<<<
default boolean isInverseGamma(){
return(this.getDistributionType().compareTo(DistType.INV_GAMMA)==0);
}
default boolean isIndicator(){
return(this.getDistributionType().compareTo(DistType.INDICATOR)==0);
}
=======
//default boolean isIndicator(){
// return(this.getDistributionType().compareTo(DistType.INDICATOR)==0);
//}
>>>>>>>
default boolean isInverseGamma(){
return(this.getDistributionType().compareTo(DistType.INV_GAMMA)==0);
}
//default boolean isIndicator(){
// return(this.getDistributionType().compareTo(DistType.INDICATOR)==0);
//} |
<<<<<<<
parallelVB.setPlateuStructure(new PlateuStructure());
=======
// Convergence parameters
>>>>>>>
//
parallelVB.setPlateuStructure(new PlateuStructure());
// Convergence parameters
<<<<<<<
Normal normal = parallelVB.getParameterPosteriorTimeT(globalHiddenVar);
=======
//Compute expected value for H this month
normal = parallelVB.getParameterPosteriorTimeT(globalHiddenVar);
>>>>>>>
Normal normal = parallelVB.getParameterPosteriorTimeT(globalHiddenVar);
//Compute expected value for H this month
normal = parallelVB.getParameterPosteriorTimeT(globalHiddenVar); |
<<<<<<<
import COM.hugin.HAPI.ExceptionHugin;
import com.google.common.base.Stopwatch;
=======
>>>>>>>
import COM.hugin.HAPI.ExceptionHugin;
import com.google.common.base.Stopwatch; |
<<<<<<<
for (DataInstance dynamicdatainstance : sampler.getSampleIterator(3, 2)){
System.out.println("\nSequence ID" + dynamicdatainstance.getSequenceID());
System.out.println("\nTime ID" + dynamicdatainstance.getTimeID());
=======
for (DynamicDataInstance dynamicdatainstance : sampler.getSampleIterator(2, 10)){
>>>>>>>
for (DynamicDataInstance dynamicdatainstance : sampler.getSampleIterator(3, 2)){
System.out.println("\nSequence ID" + dynamicdatainstance.getSequenceID());
System.out.println("\nTime ID" + dynamicdatainstance.getTimeID()); |
<<<<<<<
// Set the dynamic DAG to learn from (resulting DAG is nVariables*nSamples*nMonths)
=======
>>>>>>>
// Set the dynamic DAG to learn from (resulting DAG is nVariables*nSamples*nMonths)
<<<<<<<
// Show the new dynamic DAG structure
=======
>>>>>>>
// Show the new dynamic DAG structure |
<<<<<<<
=======
import eu.amidst.core.inference.ImportanceSampling;
>>>>>>>
import eu.amidst.core.inference.ImportanceSampling; |
<<<<<<<
public enum DistType {MULTINOMIAL, GAUSSIAN, MULTINOMIAL_LOGISTIC, INDICATOR, INV_GAMMA;
=======
public enum DistType {MULTINOMIAL, NORMAL, MULTINOMIAL_LOGISTIC, INDICATOR;
>>>>>>>
public enum DistType {MULTINOMIAL, NORMAL, MULTINOMIAL_LOGISTIC, INDICATOR, INV_GAMMA; |
<<<<<<<
domainObject.computeDBNPredictions(1);
LabelledDCNode node = (LabelledDCNode) domainObject.getNodeByName("T1." + var.getName());
posteriorDistribution = var.newUnivariateDistribution();
=======
LabelledDCNode node = (LabelledDCNode) domainObject.getNodeByName(targetVariableName + var.getName());
posteriorDistribution = DistributionBuilder.newUnivariateDistribution(var);
>>>>>>>
LabelledDCNode node = (LabelledDCNode) domainObject.getNodeByName(targetVariableName + var.getName());
posteriorDistribution = var.newUnivariateDistribution();
<<<<<<<
UnivariateDistribution posteriorDistribution = var.newUnivariateDistribution();
=======
UnivariateDistribution posteriorDistribution = null;
>>>>>>>
UnivariateDistribution posteriorDistribution = null; |
<<<<<<<
//distC.getNormal(0).setSd(0.2);
=======
distC.getNormal(0).setVariance(0.04);
>>>>>>>
distC.getNormal(0).setVariance(0.04);
<<<<<<<
//distC.getNormal(1).setSd(1);
=======
distC.getNormal(1).setVariance(1);
>>>>>>>
distC.getNormal(1).setVariance(1);
<<<<<<<
//distC.getNormal(2).setSd(0.05);
=======
distC.getNormal(2).setVariance(0.0025);
>>>>>>>
distC.getNormal(2).setVariance(0.0025);
<<<<<<<
//distC.getNormal(3).setSd(0.04);
=======
distC.getNormal(3).setVariance(0.0016);
distC.getNormal(3).setVariance(0.0016);
>>>>>>>
distC.getNormal(3).setVariance(0.0016); |
<<<<<<<
import COM.hugin.HAPI.ExceptionHugin;
import com.google.common.base.Stopwatch;
=======
>>>>>>>
import COM.hugin.HAPI.ExceptionHugin;
import com.google.common.base.Stopwatch; |
<<<<<<<
//distC.getNormal(0).setSd(0.2);
=======
distC.getNormal(0).setVariance(0.04);
>>>>>>>
distC.getNormal(0).setVariance(0.04);
<<<<<<<
//distC.getNormal(1).setSd(1);
=======
distC.getNormal(1).setVariance(1);
>>>>>>>
distC.getNormal(1).setVariance(1);
<<<<<<<
//distC.getNormal(2).setSd(0.05);
=======
distC.getNormal(2).setVariance(0.0025);
>>>>>>>
distC.getNormal(2).setVariance(0.0025);
<<<<<<<
//distC.getNormal(3).setSd(0.04);
=======
distC.getNormal(3).setVariance(0.0016);
distC.getNormal(3).setVariance(0.0016);
>>>>>>>
distC.getNormal(3).setVariance(0.0016); |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.