conflict_resolution
stringlengths 27
16k
|
---|
<<<<<<<
} else {
processDiagramCanvas.drawThrowingNoneEvent(graphicInfo, scaleFactor);
=======
} else if (throwEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
processDiagramCanvas.drawThrowingCompensateEvent(graphicInfo, scaleFactor);
>>>>>>>
} else if (throwEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
processDiagramCanvas.drawThrowingCompensateEvent(graphicInfo, scaleFactor);
} else {
processDiagramCanvas.drawThrowingNoneEvent(graphicInfo, scaleFactor);
<<<<<<<
} else if (boundaryEvent.getEventDefinitions().get(0) instanceof MessageEventDefinition) {
processDiagramCanvas.drawCatchingMessageEvent(flowNode.getName(), graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor);
=======
} else if (boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
processDiagramCanvas.drawCatchingCompensateEvent(graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor);
>>>>>>>
} else if (boundaryEvent.getEventDefinitions().get(0) instanceof MessageEventDefinition) {
processDiagramCanvas.drawCatchingMessageEvent(flowNode.getName(), graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor);
} else if (boundaryEvent.getEventDefinitions().get(0) instanceof CompensateEventDefinition) {
processDiagramCanvas.drawCatchingCompensateEvent(graphicInfo, boundaryEvent.isCancelActivity(), scaleFactor); |
<<<<<<<
import com.fasterxml.jackson.core.base.DecorableTSFactory.DecorableTSFBuilder;
=======
import com.fasterxml.jackson.core.TSFBuilder;
import com.fasterxml.jackson.dataformat.yaml.util.StringQuotingChecker;
>>>>>>>
import com.fasterxml.jackson.core.base.DecorableTSFactory.DecorableTSFBuilder;
import com.fasterxml.jackson.dataformat.yaml.util.StringQuotingChecker;
<<<<<<<
=======
_formatGeneratorFeatures = base._yamlGeneratorFeatures;
_quotingChecker = base._quotingChecker;
>>>>>>>
_quotingChecker = base._quotingChecker;
<<<<<<<
_formatWriteFeatures |= f.getMask();
return _this();
=======
_formatGeneratorFeatures |= f.getMask();
return this;
>>>>>>>
_formatWriteFeatures |= f.getMask();
return this;
<<<<<<<
=======
public YAMLFactoryBuilder stringQuotingChecker(StringQuotingChecker sqc) {
_quotingChecker = sqc;
return this;
}
// // // Accessors
// public int formatParserFeaturesMask() { return _formatParserFeatures; }
public int formatGeneratorFeaturesMask() { return _formatGeneratorFeatures; }
>>>>>>>
public YAMLFactoryBuilder stringQuotingChecker(StringQuotingChecker sqc) {
_quotingChecker = sqc;
return this;
}
// // // Accessors |
<<<<<<<
protected Optional<Anchor> _currentAnchor;
=======
protected String _currentAnchor;
>>>>>>>
protected Optional<Anchor> _currentAnchor;
<<<<<<<
_currentAnchor = Optional.empty();
=======
_currentAnchor = null;
_lastTagEvent = null;
>>>>>>>
_currentAnchor = Optional.empty();
_lastTagEvent = null;
<<<<<<<
if (evt.getEventId() != Event.ID.Scalar) {
_currentAnchor = Optional.empty();
=======
if (!evt.is(Event.ID.Scalar)) {
_currentAnchor = null;
_lastTagEvent = null;
>>>>>>>
if (evt.getEventId() != Event.ID.Scalar) {
_currentAnchor = Optional.empty();
_lastTagEvent = null;
<<<<<<<
final Optional<Anchor> newAnchor = scalar.getAnchor();
if (newAnchor.isPresent() || (_currToken != JsonToken.START_OBJECT)) {
=======
final String newAnchor = scalar.getAnchor();
final boolean firstEntry = (_currToken == JsonToken.START_OBJECT);
if ((newAnchor != null) || !firstEntry) {
>>>>>>>
final boolean firstEntry = (_currToken == JsonToken.START_OBJECT);
final Optional<Anchor> newAnchor = scalar.getAnchor();
if (newAnchor.isPresent() || !firstEntry) {
<<<<<<<
_currentAnchor = Optional.empty();
switch (evt.getEventId()) {
case Scalar:
// scalar values are probably the commonest:
JsonToken t = _decodeScalar((ScalarEvent) evt);
_currToken = t;
return t;
case MappingStart:
// followed by maps, then arrays
Optional<Mark> m = evt.getStartMark();
MappingStartEvent map = (MappingStartEvent) evt;
_currentAnchor = map.getAnchor();
_parsingContext = _parsingContext.createChildObjectContext(
m.map(mark -> mark.getLine()).orElse(0), m.map(mark -> mark.getColumn()).orElse(0));
return (_currToken = JsonToken.START_OBJECT);
case MappingEnd:
// actually error; can not have map-end here
_reportError("Not expecting END_OBJECT but a value");
case SequenceStart:
Optional<Mark> mrk = evt.getStartMark();
_currentAnchor = ((NodeEvent) evt).getAnchor();
_parsingContext = _parsingContext.createChildArrayContext(
mrk.map(mark -> mark.getLine()).orElse(0), mrk.map(mark -> mark.getColumn()).orElse(0));
return (_currToken = JsonToken.START_ARRAY);
case SequenceEnd:
if (!_parsingContext.inArray()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker(']', '}');
}
_parsingContext = _parsingContext.getParent();
return (_currToken = JsonToken.END_ARRAY);
// after this, less common tokens:
case DocumentEnd:
// [dataformat-yaml#72]: logical end of doc; fine. Two choices; either skip,
// or return null as marker (but do NOT close). Earlier returned `null`, but
// to allow multi-document reading should actually just skip.
// return (_currToken = null);
continue;
case DocumentStart:
// DocumentStartEvent dd = (DocumentStartEvent) evt;
// does this matter? Shouldn't, should it?
continue;
case Alias:
AliasEvent alias = (AliasEvent) evt;
_currentIsAlias = true;
_textValue = alias.getAnchor().orElseThrow(() -> new RuntimeException("Alias must be provided.")).getValue();
_cleanedTextValue = null;
// for now, nothing to do: in future, maybe try to expose as ObjectIds?
return (_currToken = JsonToken.VALUE_STRING);
case StreamEnd:
// end-of-input; force closure
close();
return (_currToken = null);
case StreamStart:
// useless, skip
continue;
=======
// Ugh. Why not expose id, to be able to Switch?
_currentAnchor = null;
_lastTagEvent = evt;
// scalar values are probably the commonest:
if (evt.is(Event.ID.Scalar)) {
JsonToken t = _decodeScalar((ScalarEvent) evt);
_currToken = t;
return t;
}
// followed by maps, then arrays
if (evt.is(Event.ID.MappingStart)) {
Mark m = evt.getStartMark();
MappingStartEvent map = (MappingStartEvent) evt;
_currentAnchor = map.getAnchor();
_parsingContext = _parsingContext.createChildObjectContext(m.getLine(), m.getColumn());
return (_currToken = JsonToken.START_OBJECT);
}
if (evt.is(Event.ID.MappingEnd)) { // actually error; can not have map-end here
_reportError("Not expecting END_OBJECT but a value");
}
if (evt.is(Event.ID.SequenceStart)) {
Mark m = evt.getStartMark();
_currentAnchor = ((NodeEvent)evt).getAnchor();
_parsingContext = _parsingContext.createChildArrayContext(m.getLine(), m.getColumn());
return (_currToken = JsonToken.START_ARRAY);
}
if (evt.is(Event.ID.SequenceEnd)) {
if (!_parsingContext.inArray()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker(']', '}');
}
_parsingContext = _parsingContext.getParent();
return (_currToken = JsonToken.END_ARRAY);
}
// after this, less common tokens:
if (evt.is(Event.ID.DocumentEnd)) {
// [dataformat-yaml#72]: logical end of doc; fine. Two choices; either skip,
// or return null as marker (but do NOT close). Earlier returned `null`, but
// to allow multi-document reading should actually just skip.
// return (_currToken = null);
continue;
}
if (evt.is(Event.ID.DocumentStart)) {
// DocumentStartEvent dd = (DocumentStartEvent) evt;
// does this matter? Shouldn't, should it?
continue;
}
if (evt.is(Event.ID.Alias)) {
AliasEvent alias = (AliasEvent) evt;
_currentIsAlias = true;
_textValue = alias.getAnchor();
_cleanedTextValue = null;
// for now, nothing to do: in future, maybe try to expose as ObjectIds?
return (_currToken = JsonToken.VALUE_STRING);
}
if (evt.is(Event.ID.StreamEnd)) { // end-of-input; force closure
close();
return (_currToken = null);
}
if (evt.is(Event.ID.StreamStart)) { // useless, skip
continue;
>>>>>>>
_currentAnchor = Optional.empty();
_lastTagEvent = evt;
switch (evt.getEventId()) {
case Scalar:
// scalar values are probably the commonest:
JsonToken t = _decodeScalar((ScalarEvent) evt);
_currToken = t;
return t;
case MappingStart:
// followed by maps, then arrays
Optional<Mark> m = evt.getStartMark();
MappingStartEvent map = (MappingStartEvent) evt;
_currentAnchor = map.getAnchor();
_parsingContext = _parsingContext.createChildObjectContext(
m.map(mark -> mark.getLine()).orElse(0), m.map(mark -> mark.getColumn()).orElse(0));
return (_currToken = JsonToken.START_OBJECT);
case MappingEnd:
// actually error; can not have map-end here
_reportError("Not expecting END_OBJECT but a value");
case SequenceStart:
Optional<Mark> mrk = evt.getStartMark();
_currentAnchor = ((NodeEvent) evt).getAnchor();
_parsingContext = _parsingContext.createChildArrayContext(
mrk.map(mark -> mark.getLine()).orElse(0), mrk.map(mark -> mark.getColumn()).orElse(0));
return (_currToken = JsonToken.START_ARRAY);
case SequenceEnd:
if (!_parsingContext.inArray()) { // sanity check is optional, but let's do it for now
_reportMismatchedEndMarker(']', '}');
}
_parsingContext = _parsingContext.getParent();
return (_currToken = JsonToken.END_ARRAY);
// after this, less common tokens:
case DocumentEnd:
// [dataformat-yaml#72]: logical end of doc; fine. Two choices; either skip,
// or return null as marker (but do NOT close). Earlier returned `null`, but
// to allow multi-document reading should actually just skip.
// return (_currToken = null);
continue;
case DocumentStart:
// DocumentStartEvent dd = (DocumentStartEvent) evt;
// does this matter? Shouldn't, should it?
continue;
case Alias:
AliasEvent alias = (AliasEvent) evt;
_currentIsAlias = true;
_textValue = alias.getAnchor().orElseThrow(() -> new RuntimeException("Alias must be provided.")).getValue();
_cleanedTextValue = null;
// for now, nothing to do: in future, maybe try to expose as ObjectIds?
return (_currToken = JsonToken.VALUE_STRING);
case StreamEnd:
// end-of-input; force closure
close();
return (_currToken = null);
case StreamStart:
// useless, skip
continue;
<<<<<<<
Optional<String> tagOpt;
if (_lastEvent instanceof CollectionStartEvent) {
tagOpt = ((CollectionStartEvent) _lastEvent).getTag();
} else if (_lastEvent instanceof ScalarEvent) {
tagOpt = ((ScalarEvent) _lastEvent).getTag();
=======
String tag;
if (_lastTagEvent instanceof CollectionStartEvent) {
tag = ((CollectionStartEvent) _lastTagEvent).getTag();
//System.err.println("getTypeId() at "+currentToken()+", last was collection ("+_lastTagEvent.getClass().getSimpleName()+") -> "+tag);
} else if (_lastTagEvent instanceof ScalarEvent) {
tag = ((ScalarEvent) _lastTagEvent).getTag();
//System.err.println("getTypeId() at "+currentToken()+", last was scalar -> "+tag+", scalar == "+_lastEvent);
>>>>>>>
Optional<String> tagOpt;
if (_lastTagEvent instanceof CollectionStartEvent) {
tagOpt = ((CollectionStartEvent) _lastTagEvent).getTag();
//System.err.println("getTypeId() at "+currentToken()+", last was collection ("+_lastTagEvent.getClass().getSimpleName()+") -> "+tag);
} else if (_lastTagEvent instanceof ScalarEvent) {
tagOpt = ((ScalarEvent) _lastTagEvent).getTag();
//System.err.println("getTypeId() at "+currentToken()+", last was scalar -> "+tag+", scalar == "+_lastEvent); |
<<<<<<<
protected DumpSettings _outputOptions;
=======
protected DumperOptions _outputOptions;
protected final org.yaml.snakeyaml.DumperOptions.Version _docVersion;
// for field names, leave out quotes
private final static DumperOptions.ScalarStyle STYLE_UNQUOTED_NAME = DumperOptions.ScalarStyle.PLAIN;
// numbers, booleans, should use implicit
private final static DumperOptions.ScalarStyle STYLE_SCALAR = DumperOptions.ScalarStyle.PLAIN;
// Strings quoted for fun
private final static DumperOptions.ScalarStyle STYLE_QUOTED = DumperOptions.ScalarStyle.DOUBLE_QUOTED;
// Strings in literal (block) style
private final static DumperOptions.ScalarStyle STYLE_LITERAL = DumperOptions.ScalarStyle.LITERAL;
// Which flow style to use for Base64? Maybe basic quoted?
// 29-Nov-2017, tatu: Actually SnakeYAML uses block style so:
private final static DumperOptions.ScalarStyle STYLE_BASE64 = STYLE_LITERAL;
private final static DumperOptions.ScalarStyle STYLE_PLAIN = DumperOptions.ScalarStyle.PLAIN;
>>>>>>>
protected DumpSettings _outputOptions;
<<<<<<<
_emitter.emit(new StreamStartEvent());
Map<String,String> noTags = Collections.emptyMap();
boolean startMarker = Feature.WRITE_DOC_START_MARKER.enabledIn(yamlFeatures);
_emitter.emit(new DocumentStartEvent(startMarker, Optional.empty(),
// for 1.10 was: ((version == null) ? null : version.getArray()),
noTags));
=======
_emit(new StreamStartEvent(null, null));
_emitStartDocument();
>>>>>>>
_emit(new StreamStartEvent());
_emitStartDocument();
<<<<<<<
_emitter.emit(new DocumentEndEvent( false));
_emitter.emit(new StreamEndEvent());
=======
// 11-Dec-2019, tatu: Should perhaps check if content is to be auto-closed...
// but need END_DOCUMENT regardless
_emitEndDocument();
_emit(new StreamEndEvent(null, null));
>>>>>>>
// 11-Dec-2019, tatu: Should perhaps check if content is to be auto-closed...
// but need END_DOCUMENT regardless
_emitEndDocument();
_emit(new StreamEndEvent());
<<<<<<<
_emitter.emit(new SequenceStartEvent(anchor, Optional.ofNullable(yamlTag),
implicit, style));
}
@Override
public final void writeStartArray(Object currValue) throws IOException {
writeStartArray();
setCurrentValue(currValue);
=======
_emit(new SequenceStartEvent(anchor, yamlTag,
implicit, null, null, style));
>>>>>>>
_emit(new SequenceStartEvent(anchor, Optional.ofNullable(yamlTag),
implicit, style));
}
@Override
public final void writeStartArray(Object currValue) throws IOException {
writeStartArray();
setCurrentValue(currValue);
<<<<<<<
_tokenWriteContext = _tokenWriteContext.getParent();
_emitter.emit(new SequenceEndEvent());
=======
_writeContext = _writeContext.getParent();
_emit(new SequenceEndEvent(null, null));
>>>>>>>
_tokenWriteContext = _tokenWriteContext.getParent();
_emit(new SequenceEndEvent());
<<<<<<<
_emitter.emit(new MappingStartEvent(anchor, Optional.ofNullable(yamlTag), implicit, style));
}
@Override
public final void writeStartObject(Object currValue) throws IOException {
writeStartObject();
setCurrentValue(currValue);
=======
_emit(new MappingStartEvent(anchor, yamlTag,
implicit, null, null, style));
>>>>>>>
_emit(new MappingStartEvent(anchor, Optional.ofNullable(yamlTag), implicit, style));
}
@Override
public final void writeStartObject(Object currValue) throws IOException {
writeStartObject();
setCurrentValue(currValue);
<<<<<<<
_tokenWriteContext = _tokenWriteContext.getParent();
_emitter.emit(new MappingEndEvent());
=======
_writeContext = _writeContext.getParent();
_emit(new MappingEndEvent(null, null));
>>>>>>>
_tokenWriteContext = _tokenWriteContext.getParent();
_emit(new MappingEndEvent());
<<<<<<<
AliasEvent evt = new AliasEvent(Optional.of(String.valueOf(id)).map(s -> new Anchor(s)));
_emitter.emit(evt);
=======
AliasEvent evt = new AliasEvent(String.valueOf(id), null, null);
_emit(evt);
>>>>>>>
AliasEvent evt = new AliasEvent(Optional.of(String.valueOf(id)).map(s -> new Anchor(s)));
_emit(evt);
<<<<<<<
String encoded = b64variant.encode(data, false, lf);
_emitter.emit(new ScalarEvent(Optional.empty(), Optional.ofNullable(TAG_BINARY), EXPLICIT_TAGS, encoded, STYLE_BASE64));
=======
String encoded = _base64encode(b64variant, data, lf);
_emit(new ScalarEvent(null, TAG_BINARY, EXPLICIT_TAGS, encoded,
null, null, STYLE_BASE64));
>>>>>>>
String encoded = b64variant.encode(data, false, lf);
_emit(new ScalarEvent(Optional.empty(), Optional.ofNullable(TAG_BINARY), EXPLICIT_TAGS, encoded, STYLE_BASE64)); |
<<<<<<<
InputTextField keyInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("shared.unlock"), 10);
if (useDevPrivilegeKeys)
keyInputTextField.setText(DevEnv.DEV_PRIVILEGE_PRIV_KEY);
InputTextField offerIdsInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.offers"));
InputTextField nodesInputTextField = addTopLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.onions")).second;
nodesInputTextField.setPromptText("E.g. zqnzx6o3nifef5df.onion:9999"); // Do not translate
InputTextField paymentAccountFilterInputTextField = addTopLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.accounts")).second;
GridPane.setHalignment(paymentAccountFilterInputTextField, HPos.RIGHT);
paymentAccountFilterInputTextField.setPromptText("E.g. PERFECT_MONEY|getAccountNr|12345"); // Do not translate
InputTextField bannedCurrenciesInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.bannedCurrencies"));
InputTextField bannedPaymentMethodsInputTextField = addTopLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.bannedPaymentMethods")).second;
bannedPaymentMethodsInputTextField.setPromptText("E.g. PERFECT_MONEY"); // Do not translate
InputTextField bannedSignerPubKeysInputTextField = addTopLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.bannedSignerPubKeys")).second;
bannedSignerPubKeysInputTextField.setPromptText("E.g. 7f66117aa084e5a2c54fe17d29dd1fee2b241257"); // Do not translate
InputTextField arbitratorsInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.arbitrators"));
InputTextField mediatorsInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.mediators"));
InputTextField refundAgentsInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.refundAgents"));
InputTextField btcFeeReceiverAddressesInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.btcFeeReceiverAddresses"));
InputTextField seedNodesInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.seedNode"));
InputTextField priceRelayNodesInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.priceRelayNode"));
InputTextField btcNodesInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.btcNode"));
CheckBox preventPublicBtcNetworkCheckBox = addLabelCheckBox(gridPane, ++rowIndex, Res.get("filterWindow.preventPublicBtcNetwork"));
CheckBox disableDaoCheckBox = addLabelCheckBox(gridPane, ++rowIndex, Res.get("filterWindow.disableDao"));
CheckBox disableAutoConfCheckBox = addLabelCheckBox(gridPane, ++rowIndex, Res.get("filterWindow.disableAutoConf"));
InputTextField disableDaoBelowVersionInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.disableDaoBelowVersion"));
InputTextField disableTradeBelowVersionInputTextField = addInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.disableTradeBelowVersion"));
final Filter filter = filterManager.getDevelopersFilter();
=======
InputTextField keyTF = addInputTextField(gridPane, ++rowIndex,
Res.get("shared.unlock"), 10);
if (useDevPrivilegeKeys) {
keyTF.setText(DevEnv.DEV_PRIVILEGE_PRIV_KEY);
}
InputTextField offerIdsTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.offers"));
InputTextField nodesTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.onions")).second;
nodesTF.setPromptText("E.g. zqnzx6o3nifef5df.onion:9999"); // Do not translate
InputTextField paymentAccountFilterTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.accounts")).second;
GridPane.setHalignment(paymentAccountFilterTF, HPos.RIGHT);
paymentAccountFilterTF.setPromptText("E.g. PERFECT_MONEY|getAccountNr|12345"); // Do not translate
InputTextField bannedCurrenciesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.bannedCurrencies"));
InputTextField bannedPaymentMethodsTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.bannedPaymentMethods")).second;
bannedPaymentMethodsTF.setPromptText("E.g. PERFECT_MONEY"); // Do not translate
InputTextField bannedAccountWitnessSignerPubKeysTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.bannedAccountWitnessSignerPubKeys")).second;
bannedAccountWitnessSignerPubKeysTF.setPromptText("E.g. 7f66117aa084e5a2c54fe17d29dd1fee2b241257"); // Do not translate
InputTextField arbitratorsTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.arbitrators"));
InputTextField mediatorsTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.mediators"));
InputTextField refundAgentsTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.refundAgents"));
InputTextField btcFeeReceiverAddressesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.btcFeeReceiverAddresses"));
InputTextField seedNodesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.seedNode"));
InputTextField priceRelayNodesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.priceRelayNode"));
InputTextField btcNodesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.btcNode"));
CheckBox preventPublicBtcNetworkCheckBox = addLabelCheckBox(gridPane, ++rowIndex,
Res.get("filterWindow.preventPublicBtcNetwork"));
CheckBox disableDaoCheckBox = addLabelCheckBox(gridPane, ++rowIndex,
Res.get("filterWindow.disableDao"));
InputTextField disableDaoBelowVersionTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.disableDaoBelowVersion"));
InputTextField disableTradeBelowVersionTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.disableTradeBelowVersion"));
InputTextField bannedPrivilegedDevPubKeysTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.bannedPrivilegedDevPubKeys")).second;
Filter filter = filterManager.getDevFilter();
>>>>>>>
InputTextField keyTF = addInputTextField(gridPane, ++rowIndex,
Res.get("shared.unlock"), 10);
if (useDevPrivilegeKeys) {
keyTF.setText(DevEnv.DEV_PRIVILEGE_PRIV_KEY);
}
InputTextField offerIdsTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.offers"));
InputTextField nodesTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.onions")).second;
nodesTF.setPromptText("E.g. zqnzx6o3nifef5df.onion:9999"); // Do not translate
InputTextField paymentAccountFilterTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.accounts")).second;
GridPane.setHalignment(paymentAccountFilterTF, HPos.RIGHT);
paymentAccountFilterTF.setPromptText("E.g. PERFECT_MONEY|getAccountNr|12345"); // Do not translate
InputTextField bannedCurrenciesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.bannedCurrencies"));
InputTextField bannedPaymentMethodsTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.bannedPaymentMethods")).second;
bannedPaymentMethodsTF.setPromptText("E.g. PERFECT_MONEY"); // Do not translate
InputTextField bannedAccountWitnessSignerPubKeysTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.bannedAccountWitnessSignerPubKeys")).second;
bannedAccountWitnessSignerPubKeysTF.setPromptText("E.g. 7f66117aa084e5a2c54fe17d29dd1fee2b241257"); // Do not translate
InputTextField arbitratorsTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.arbitrators"));
InputTextField mediatorsTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.mediators"));
InputTextField refundAgentsTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.refundAgents"));
InputTextField btcFeeReceiverAddressesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.btcFeeReceiverAddresses"));
InputTextField seedNodesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.seedNode"));
InputTextField priceRelayNodesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.priceRelayNode"));
InputTextField btcNodesTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.btcNode"));
CheckBox preventPublicBtcNetworkCheckBox = addLabelCheckBox(gridPane, ++rowIndex,
Res.get("filterWindow.preventPublicBtcNetwork"));
CheckBox disableDaoCheckBox = addLabelCheckBox(gridPane, ++rowIndex,
Res.get("filterWindow.disableDao"));
CheckBox disableAutoConfCheckBox = addLabelCheckBox(gridPane, ++rowIndex,
Res.get("filterWindow.disableAutoConf"));
InputTextField disableDaoBelowVersionTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.disableDaoBelowVersion"));
InputTextField disableTradeBelowVersionTF = addInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.disableTradeBelowVersion"));
InputTextField bannedPrivilegedDevPubKeysTF = addTopLabelInputTextField(gridPane, ++rowIndex,
Res.get("filterWindow.bannedPrivilegedDevPubKeys")).second;
Filter filter = filterManager.getDevFilter();
<<<<<<<
disableAutoConfCheckBox.setSelected(filter.isDisableAutoConf());
disableDaoBelowVersionInputTextField.setText(filter.getDisableDaoBelowVersion());
disableTradeBelowVersionInputTextField.setText(filter.getDisableTradeBelowVersion());
=======
disableDaoBelowVersionTF.setText(filter.getDisableDaoBelowVersion());
disableTradeBelowVersionTF.setText(filter.getDisableTradeBelowVersion());
>>>>>>>
disableAutoConfCheckBox.setSelected(filter.isDisableAutoConf());
disableDaoBelowVersionTF.setText(filter.getDisableDaoBelowVersion());
disableTradeBelowVersionTF.setText(filter.getDisableTradeBelowVersion());
<<<<<<<
if (filterManager.addFilterMessageIfKeyIsValid(
new Filter(
readAsList(offerIdsInputTextField),
readAsList(nodesInputTextField),
readAsPaymentAccountFiltersList(paymentAccountFilterInputTextField),
readAsList(bannedCurrenciesInputTextField),
readAsList(bannedPaymentMethodsInputTextField),
readAsList(arbitratorsInputTextField),
readAsList(seedNodesInputTextField),
readAsList(priceRelayNodesInputTextField),
preventPublicBtcNetworkCheckBox.isSelected(),
readAsList(btcNodesInputTextField),
disableDaoCheckBox.isSelected(),
disableDaoBelowVersionInputTextField.getText(),
disableTradeBelowVersionInputTextField.getText(),
readAsList(mediatorsInputTextField),
readAsList(refundAgentsInputTextField),
readAsList(bannedSignerPubKeysInputTextField),
readAsList(btcFeeReceiverAddressesInputTextField),
disableAutoConfCheckBox.isSelected()
),
keyInputTextField.getText())
)
=======
String privKeyString = keyTF.getText();
if (filterManager.canAddDevFilter(privKeyString)) {
String signerPubKeyAsHex = filterManager.getSignerPubKeyAsHex(privKeyString);
Filter newFilter = new Filter(
readAsList(offerIdsTF),
readAsList(nodesTF),
readAsPaymentAccountFiltersList(paymentAccountFilterTF),
readAsList(bannedCurrenciesTF),
readAsList(bannedPaymentMethodsTF),
readAsList(arbitratorsTF),
readAsList(seedNodesTF),
readAsList(priceRelayNodesTF),
preventPublicBtcNetworkCheckBox.isSelected(),
readAsList(btcNodesTF),
disableDaoCheckBox.isSelected(),
disableDaoBelowVersionTF.getText(),
disableTradeBelowVersionTF.getText(),
readAsList(mediatorsTF),
readAsList(refundAgentsTF),
readAsList(bannedAccountWitnessSignerPubKeysTF),
readAsList(btcFeeReceiverAddressesTF),
filterManager.getOwnerPubKey(),
signerPubKeyAsHex,
readAsList(bannedPrivilegedDevPubKeysTF)
);
filterManager.addDevFilter(newFilter, privKeyString);
removeFilterMessageButton.setDisable(filterManager.getDevFilter() == null);
>>>>>>>
String privKeyString = keyTF.getText();
if (filterManager.canAddDevFilter(privKeyString)) {
String signerPubKeyAsHex = filterManager.getSignerPubKeyAsHex(privKeyString);
Filter newFilter = new Filter(
readAsList(offerIdsTF),
readAsList(nodesTF),
readAsPaymentAccountFiltersList(paymentAccountFilterTF),
readAsList(bannedCurrenciesTF),
readAsList(bannedPaymentMethodsTF),
readAsList(arbitratorsTF),
readAsList(seedNodesTF),
readAsList(priceRelayNodesTF),
preventPublicBtcNetworkCheckBox.isSelected(),
readAsList(btcNodesTF),
disableDaoCheckBox.isSelected(),
disableDaoBelowVersionTF.getText(),
disableTradeBelowVersionTF.getText(),
readAsList(mediatorsTF),
readAsList(refundAgentsTF),
readAsList(bannedAccountWitnessSignerPubKeysTF),
readAsList(btcFeeReceiverAddressesTF),
filterManager.getOwnerPubKey(),
signerPubKeyAsHex,
readAsList(bannedPrivilegedDevPubKeysTF),
disableAutoConfCheckBox.isSelected()
);
filterManager.addDevFilter(newFilter, privKeyString);
removeFilterMessageButton.setDisable(filterManager.getDevFilter() == null); |
<<<<<<<
import io.bitsquare.locale.BSResources;
import io.bitsquare.messages.btc.Restrictions;
=======
import io.bitsquare.locale.Res;
>>>>>>>
import io.bitsquare.locale.BSResources;
import io.bitsquare.messages.btc.Restrictions;
import io.bitsquare.locale.Res; |
<<<<<<<
import io.bisq.core.user.Preferences;
import io.bisq.core.user.PreferencesImpl;
=======
import io.bisq.core.user.DontShowAgainLookup;
>>>>>>>
import io.bisq.core.user.Preferences;
import io.bisq.core.user.DontShowAgainLookup;
<<<<<<<
protected Preferences preferences;
=======
>>>>>>>
protected Preferences preferences;
<<<<<<<
return useAnimation && PreferencesImpl.useAnimations() ? duration : 1;
=======
return useAnimation && GlobalSettings.getUseAnimations() ? duration : 1;
>>>>>>>
return useAnimation && GlobalSettings.getUseAnimations() ? duration : 1; |
<<<<<<<
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("https://github.com/bisq/bisq/issues", preferences);
=======
if (message != null)
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("https://github.com/bisq/bisq/issues");
>>>>>>>
if (message != null)
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("https://github.com/bisq/bisq/issues", preferences);
<<<<<<<
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("http://forum.bisq.io", preferences);
=======
if (message != null)
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("http://forum.bisq.io");
>>>>>>>
if (message != null)
Utilities.copyToClipboard(message);
GUIUtil.openWebPage("http://forum.bisq.io", preferences); |
<<<<<<<
import io.bitsquare.messages.alert.PrivateNotification;
=======
import io.bitsquare.locale.Res;
>>>>>>>
import io.bitsquare.messages.alert.PrivateNotification;
<<<<<<<
InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Key for private notification:", 10).second;
if (DevFlags.USE_DEV_PRIVILEGE_KEYS)
keyInputTextField.setText("6ac43ea1df2a290c1c8391736aa42e4339c5cb4f110ff0257a13b63211977b7a");
Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex, "Private notification:", "Enter notification");
=======
InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex,
Res.get("shared.unlock"), 10).second;
Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex,
Res.get("sendPrivateNotificationWindow.privateNotification"),
Res.get("sendPrivateNotificationWindow.enterNotification"));
>>>>>>>
InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex,
Res.get("shared.unlock"), 10).second;
if (DevFlags.USE_DEV_PRIVILEGE_KEYS)
keyInputTextField.setText("6ac43ea1df2a290c1c8391736aa42e4339c5cb4f110ff0257a13b63211977b7a");
Tuple2<Label, TextArea> labelTextAreaTuple2 = addLabelTextArea(gridPane, ++rowIndex,
Res.get("sendPrivateNotificationWindow.privateNotification"),
Res.get("sendPrivateNotificationWindow.enterNotification")); |
<<<<<<<
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown completed. Exiting now.");
resultHandler.handleResult();
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
});
=======
if (!hasDowngraded) {
// If user tried to downgrade we do not write the persistable data to avoid data corruption
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown completed. Exiting now.");
resultHandler.handleResult();
System.exit(EXIT_SUCCESS);
});
} else {
System.exit(EXIT_SUCCESS);
}
>>>>>>>
if (!hasDowngraded) {
// If user tried to downgrade we do not write the persistable data to avoid data corruption
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown completed. Exiting now.");
resultHandler.handleResult();
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
});
} else {
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
}
<<<<<<<
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown resulted in a timeout. Exiting now.");
resultHandler.handleResult();
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
});
=======
if (!hasDowngraded) {
// If user tried to downgrade we do not write the persistable data to avoid data corruption
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown resulted in a timeout. Exiting now.");
resultHandler.handleResult();
System.exit(EXIT_SUCCESS);
});
} else {
System.exit(EXIT_SUCCESS);
}
>>>>>>>
if (!hasDowngraded) {
// If user tried to downgrade we do not write the persistable data to avoid data corruption
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown resulted in a timeout. Exiting now.");
resultHandler.handleResult();
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
});
} else {
UserThread.runAfter(() -> System.exit(EXIT_SUCCESS), 1);
}
<<<<<<<
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown resulted in an error. Exiting now.");
resultHandler.handleResult();
UserThread.runAfter(() -> System.exit(EXIT_FAILURE), 1);
});
=======
if (!hasDowngraded) {
// If user tried to downgrade we do not write the persistable data to avoid data corruption
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown resulted in an error. Exiting now.");
resultHandler.handleResult();
System.exit(EXIT_FAILURE);
});
} else {
System.exit(EXIT_FAILURE);
}
>>>>>>>
if (!hasDowngraded) {
// If user tried to downgrade we do not write the persistable data to avoid data corruption
PersistenceManager.flushAllDataToDisk(() -> {
log.info("Graceful shutdown resulted in an error. Exiting now.");
resultHandler.handleResult();
UserThread.runAfter(() -> System.exit(EXIT_FAILURE), 1);
});
} else {
UserThread.runAfter(() -> System.exit(EXIT_FAILURE), 1);
} |
<<<<<<<
return new Filter(null, null, null, null,
null, null, null, null,
false, null, false, null,
null, null, null, null,
btcFeeReceiverAddresses, false);
=======
return new Filter(Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
false,
Lists.newArrayList(),
false,
null,
null,
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
btcFeeReceiverAddresses,
null,
0,
null,
null,
null,
null);
>>>>>>>
return new Filter(Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
false,
Lists.newArrayList(),
false,
null,
null,
Lists.newArrayList(),
Lists.newArrayList(),
Lists.newArrayList(),
btcFeeReceiverAddresses,
null,
0,
null,
null,
null,
null,
false); |
<<<<<<<
case "CAGE":
if (input.matches("^[D][a-zA-Z0-9]{26,34}$")) {
//noinspection ConstantConditions
try {
Address.fromBase58(CageParams.get(), input);
return new ValidationResult(true);
} catch (AddressFormatException e) {
return new ValidationResult(false, getErrorMessage(e));
}
} else {
return regexTestFailed;
}
=======
case "CRED":
if (!input.matches("^(0x)?[0-9a-fA-F]{40}$"))
return regexTestFailed;
else
return new ValidationResult(true);
>>>>>>>
case "CAGE":
if (input.matches("^[D][a-zA-Z0-9]{26,34}$")) {
//noinspection ConstantConditions
try {
Address.fromBase58(CageParams.get(), input);
return new ValidationResult(true);
} catch (AddressFormatException e) {
return new ValidationResult(false, getErrorMessage(e));
}
} else {
return regexTestFailed;
}
case "CRED":
if (!input.matches("^(0x)?[0-9a-fA-F]{40}$"))
return regexTestFailed;
else
return new ValidationResult(true); |
<<<<<<<
if (!DevEnv.DEV_MODE && preferences.showAgain(key)) {
new Popup<>(preferences).information(Res.get("guiUtil.miningFeeInfo"))
.dontShowAgainId(key, preferences)
=======
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
new Popup<>().information(Res.get("guiUtil.miningFeeInfo"))
.dontShowAgainId(key)
>>>>>>>
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
new Popup<>(preferences).information(Res.get("guiUtil.miningFeeInfo"))
.dontShowAgainId(key)
<<<<<<<
if (preferences.showAgain(key)) {
new Popup<>(preferences).information(Res.get("guiUtil.openWebBrowser.warning", target))
=======
if (DontShowAgainLookup.showAgain(key)) {
new Popup<>().information(Res.get("guiUtil.openWebBrowser.warning", target))
>>>>>>>
if (DontShowAgainLookup.showAgain(key)) {
new Popup<>(preferences).information(Res.get("guiUtil.openWebBrowser.warning", target)) |
<<<<<<<
public void onParseTxsCompleteAfterBatchProcessing(Block block) {
boolean isProposalPhase = daoFacade.isInPhaseButNotLastBlock(DaoPhase.Phase.PROPOSAL);
proposalTypeComboBox.setDisable(!isProposalPhase);
if (!isProposalPhase)
=======
public void onNewBlockHeight(int height) {
isProposalPhase.set(daoFacade.isInPhaseButNotLastBlock(DaoPhase.Phase.PROPOSAL));
if (isProposalPhase.get()) {
proposalGroupTitle.set(Res.get("dao.proposal.create.selectProposalType"));
} else {
proposalGroupTitle.set(Res.get("dao.proposal.create.phase.inactive"));
>>>>>>>
public void onParseTxsCompleteAfterBatchProcessing(Block block) {
isProposalPhase.set(daoFacade.isInPhaseButNotLastBlock(DaoPhase.Phase.PROPOSAL));
if (isProposalPhase.get()) {
proposalGroupTitle.set(Res.get("dao.proposal.create.selectProposalType"));
} else {
proposalGroupTitle.set(Res.get("dao.proposal.create.phase.inactive"));
<<<<<<<
=======
@Override
public void onParseBlockChainComplete() {
}
>>>>>>> |
<<<<<<<
case "CREA":
try {
Address.fromBase58(CreaParams.get(), input);
return new ValidationResult(true);
} catch (AddressFormatException e) {
return new ValidationResult(false, getErrorMessage(e));
}
=======
case "XIN":
if (!input.matches("^XIN-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{5}$"))
return regexTestFailed;
else
return new ValidationResult(true);
>>>>>>>
case "CREA":
try {
Address.fromBase58(CreaParams.get(), input);
return new ValidationResult(true);
} catch (AddressFormatException e) {
return new ValidationResult(false, getErrorMessage(e));
}
case "XIN":
if (!input.matches("^XIN-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{4}-[A-Z0-9]{5}$"))
return regexTestFailed;
else
return new ValidationResult(true); |
<<<<<<<
@Test
public void testCAGE() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("CAGE");
assertTrue(validator.validate("Db97PgfdBDhXk8DmrDhrUPyydTCELn8YSb").isValid);
assertTrue(validator.validate("DYV4h7MTsQ91jqzbg94GFAAUbgdK7RZmpG").isValid);
assertTrue(validator.validate("Db5y8iKtZ24DqgYpP2G8685vTWEvk3WACC").isValid);
assertTrue(validator.validate("DjiQbPuBLJcVYUtzYMuFuzDwDYwb9mVhaK").isValid);
assertFalse(validator.validate("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq").isValid);
assertFalse(validator.validate("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266").isValid);
assertFalse(validator.validate("DNkkfdUvkCDiywYE98MTVp9nQJTgeZAiFr").isValid);
assertFalse(validator.validate("").isValid);
}
=======
@Test
public void testCRED() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("CRED");
assertTrue(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a21").isValid);
assertTrue(validator.validate("65767ec6d4d3d18a200842352485cdc37cbf3a21").isValid);
assertFalse(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a216").isValid);
assertFalse(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a2g").isValid);
assertFalse(validator.validate("65767ec6d4d3d18a200842352485cdc37cbf3a2g").isValid);
assertFalse(validator.validate("").isValid);
}
>>>>>>>
@Test
public void testCAGE() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("CAGE");
assertTrue(validator.validate("Db97PgfdBDhXk8DmrDhrUPyydTCELn8YSb").isValid);
assertTrue(validator.validate("DYV4h7MTsQ91jqzbg94GFAAUbgdK7RZmpG").isValid);
assertTrue(validator.validate("Db5y8iKtZ24DqgYpP2G8685vTWEvk3WACC").isValid);
assertTrue(validator.validate("DjiQbPuBLJcVYUtzYMuFuzDwDYwb9mVhaK").isValid);
assertFalse(validator.validate("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq").isValid);
assertFalse(validator.validate("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266").isValid);
assertFalse(validator.validate("DNkkfdUvkCDiywYE98MTVp9nQJTgeZAiFr").isValid);
assertFalse(validator.validate("").isValid);
}
@Test
public void testCRED() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("CRED");
assertTrue(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a21").isValid);
assertTrue(validator.validate("65767ec6d4d3d18a200842352485cdc37cbf3a21").isValid);
assertFalse(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a216").isValid);
assertFalse(validator.validate("0x65767ec6d4d3d18a200842352485cdc37cbf3a2g").isValid);
assertFalse(validator.validate("65767ec6d4d3d18a200842352485cdc37cbf3a2g").isValid);
assertFalse(validator.validate("").isValid);
} |
<<<<<<<
if (preferences.showAgain(key)) {
new Popup(preferences).warning(Res.get("account.seed.warn.noPw.msg"))
=======
if (DontShowAgainLookup.showAgain(key)) {
new Popup().warning(Res.get("account.seed.warn.noPw.msg"))
>>>>>>>
if (DontShowAgainLookup.showAgain(key)) {
new Popup(preferences).warning(Res.get("account.seed.warn.noPw.msg"))
<<<<<<<
new Popup(preferences).feedback(Res.get("seed.restore.success"))
.useShutDownButton();
=======
new Popup().feedback(Res.get("seed.restore.success"))
.useShutDownButton().show();
>>>>>>>
new Popup(preferences).feedback(Res.get("seed.restore.success"))
.useShutDownButton().show(); |
<<<<<<<
import bisq.desktop.util.GUIUtil;
=======
import bisq.desktop.util.DisplayUtils;
>>>>>>>
import bisq.desktop.util.DisplayUtils;
import bisq.desktop.util.GUIUtil; |
<<<<<<<
private List<String> bannedSeedNodes, bannedBtcNodes, bannedPriceRelayNodes;
=======
protected List<String> bannedPriceRelayNodes;
@Getter
protected List<String> bannedSeedNodes;
>>>>>>>
protected List<String> bannedSeedNodes, bannedBtcNodes, bannedPriceRelayNodes; |
<<<<<<<
Lists.newArrayList(),
false));
=======
Lists.newArrayList(),
null,
0,
null,
null,
null,
null));
>>>>>>>
Lists.newArrayList(),
null,
0,
null,
null,
null,
null,
false)); |
<<<<<<<
import io.bitsquare.messages.dao.blockchain.RpcOptionKeys;
import io.bitsquare.dao.blockchain.SquBlockchainManager;
import io.bitsquare.dao.blockchain.SquBlockchainRpcService;
import io.bitsquare.dao.blockchain.SquBlockchainService;
=======
import io.bitsquare.dao.blockchain.BsqBlockchainManager;
import io.bitsquare.dao.blockchain.BsqBlockchainRpcService;
import io.bitsquare.dao.blockchain.BsqBlockchainService;
import io.bitsquare.dao.blockchain.RpcOptionKeys;
>>>>>>>
import io.bitsquare.dao.blockchain.BsqBlockchainManager;
import io.bitsquare.dao.blockchain.BsqBlockchainRpcService;
import io.bitsquare.dao.blockchain.BsqBlockchainService; |
<<<<<<<
import bisq.desktop.main.shared.PriceFeedComboBoxItem;
=======
import bisq.desktop.util.DisplayUtils;
>>>>>>>
import bisq.desktop.main.shared.PriceFeedComboBoxItem;
import bisq.desktop.util.DisplayUtils; |
<<<<<<<
import io.bisq.core.dao.blockchain.parse.BsqBlockChain;
=======
import io.bisq.core.btc.wallet.WalletsSetup;
>>>>>>>
import io.bisq.core.dao.blockchain.parse.BsqBlockChain;
import io.bisq.core.btc.wallet.WalletsSetup;
<<<<<<<
private TransactionsView(BtcWalletService btcWalletService, BsqWalletService bsqWalletService,
TradeManager tradeManager, OpenOfferManager openOfferManager,
ClosedTradableManager closedTradableManager, FailedTradesManager failedTradesManager,
BSFormatter formatter, Preferences preferences, TradeDetailsWindow tradeDetailsWindow,
BsqBlockChain bsqBlockChain, DisputeManager disputeManager, Stage stage,
=======
private TransactionsView(BtcWalletService btcWalletService,
BsqWalletService bsqWalletService,
P2PService p2PService,
WalletsSetup walletsSetup,
TradeManager tradeManager,
OpenOfferManager openOfferManager,
ClosedTradableManager closedTradableManager,
FailedTradesManager failedTradesManager,
BSFormatter formatter,
Preferences preferences,
TradeDetailsWindow tradeDetailsWindow,
DisputeManager disputeManager,
Stage stage,
>>>>>>>
private TransactionsView(BtcWalletService btcWalletService,
BsqWalletService bsqWalletService,
BsqBlockChain bsqBlockChain,
P2PService p2PService,
WalletsSetup walletsSetup,
TradeManager tradeManager,
OpenOfferManager openOfferManager,
ClosedTradableManager closedTradableManager,
FailedTradesManager failedTradesManager,
BSFormatter formatter,
Preferences preferences,
TradeDetailsWindow tradeDetailsWindow,
DisputeManager disputeManager,
Stage stage, |
<<<<<<<
import io.bitsquare.messages.provider.price.PriceFeedService;
=======
>>>>>>>
import io.bitsquare.messages.provider.price.PriceFeedService;
<<<<<<<
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.messages.locale.CurrencyUtil;
import io.bitsquare.messages.locale.TradeCurrency;
import io.bitsquare.messages.trade.offer.payload.Offer;
import io.bitsquare.messages.user.Preferences;
=======
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.locale.TradeCurrency;
import io.bitsquare.trade.offer.Offer;
import io.bitsquare.user.Preferences;
>>>>>>>
import io.bitsquare.gui.main.overlays.popups.Popup;
import io.bitsquare.messages.locale.CurrencyUtil;
import io.bitsquare.messages.locale.TradeCurrency;
import io.bitsquare.messages.trade.offer.payload.Offer;
import io.bitsquare.messages.user.Preferences;
import io.bitsquare.locale.CurrencyUtil;
import io.bitsquare.locale.Res;
import io.bitsquare.locale.TradeCurrency;
import io.bitsquare.trade.offer.Offer;
import io.bitsquare.user.Preferences; |
<<<<<<<
import io.bitsquare.gui.main.dao.wallet.TokenWalletView;
import io.bitsquare.gui.main.dao.wallet.dashboard.TokenDashboardView;
import io.bitsquare.messages.user.Preferences;
=======
import io.bitsquare.gui.main.dao.wallet.BsqWalletView;
import io.bitsquare.gui.main.dao.wallet.dashboard.BsqDashboardView;
import io.bitsquare.user.Preferences;
>>>>>>>
import io.bitsquare.gui.main.dao.wallet.BsqWalletView;
import io.bitsquare.gui.main.dao.wallet.dashboard.BsqDashboardView;
import io.bitsquare.messages.user.Preferences; |
<<<<<<<
// Broadcast tx
///////////////////////////////////////////////////////////////////////////////////////////
public void broadcastTx(Transaction tx, FutureCallback<Transaction> callback) {
Futures.addCallback(walletsSetup.getPeerGroup().broadcastTransaction(tx).future(), callback);
printTx("BSQ broadcast Tx", tx);
}
///////////////////////////////////////////////////////////////////////////////////////////
=======
>>>>>>> |
<<<<<<<
import io.bitsquare.messages.arbitration.Dispute;
import io.bitsquare.messages.arbitration.DisputeCommunicationMessage;
import io.bitsquare.messages.arbitration.payload.Attachment;
import io.bitsquare.messages.trade.payload.Contract;
=======
import io.bitsquare.locale.Res;
>>>>>>>
import io.bitsquare.locale.Res;
import io.bitsquare.messages.arbitration.Dispute;
import io.bitsquare.messages.arbitration.DisputeCommunicationMessage;
import io.bitsquare.messages.arbitration.payload.Attachment;
import io.bitsquare.messages.trade.payload.Contract;
<<<<<<<
button = new Button("Select");
=======
button = new Button(Res.get("shared.select"));
button.setOnAction(e -> tableView.getSelectionModel().select(item));
>>>>>>>
button = new Button("Select");
button.setOnAction(e -> tableView.getSelectionModel().select(item));
<<<<<<<
Button button;
=======
final Button button = new Button(Res.get("shared.details"));
{
}
>>>>>>>
final Button button = new Button("Details"); |
<<<<<<<
if (exception.getMessage().equals("Store file is already locked by another process")) {
new Popup(preferences).warning(Res.get("popup.warning.startupFailed.twoInstances"))
=======
if (exception.getMessage().equals("org.bitcoinj.store.BlockStoreException: org.bitcoinj.store.BlockStoreException: Store file is already locked by another process")) {
new Popup().warning(Res.get("popup.warning.startupFailed.twoInstances"))
>>>>>>>
if (exception.getMessage().equals("org.bitcoinj.store.BlockStoreException: org.bitcoinj.store.BlockStoreException: Store file is already locked by another process")) {
new Popup(preferences).warning(Res.get("popup.warning.startupFailed.twoInstances"))
<<<<<<<
new Popup(preferences).error(Res.get("popup.error.walletException",
=======
new Popup().warning(Res.get("error.spvFileCorrupted",
>>>>>>>
new Popup(preferences).warning(Res.get("error.spvFileCorrupted",
<<<<<<<
try {
daoManager.onAllServicesInitialized();
} catch (BsqBlockchainException e) {
new Popup<>(preferences).error(e.toString()).show();
}
=======
daoManager.onAllServicesInitialized(errorMessage -> new Popup<>().error(errorMessage).show());
>>>>>>>
daoManager.onAllServicesInitialized(errorMessage -> new Popup<>(preferences).error(errorMessage).show());
<<<<<<<
if (!walletsManager.areWalletsEncrypted() && preferences.showAgain(remindPasswordAndBackupKey) && change.wasAdded()) {
new Popup<>(preferences).headLine(Res.get("popup.securityRecommendation.headline"))
=======
if (!walletsManager.areWalletsEncrypted() && preferences.showAgain(key) && change.wasAdded()) {
new Popup<>().headLine(Res.get("popup.securityRecommendation.headline"))
>>>>>>>
if (!walletsManager.areWalletsEncrypted() && preferences.showAgain(key) && change.wasAdded()) {
new Popup<>(preferences).headLine(Res.get("popup.securityRecommendation.headline"))
<<<<<<<
if (preferences.showAgain(key)) {
preferences.dontShowAgain(key, true);
new Popup(preferences).warning(Res.get("popup.warning.tradePeriod.halfReached",
=======
if (DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup().warning(Res.get("popup.warning.tradePeriod.halfReached",
>>>>>>>
if (DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup(preferences).warning(Res.get("popup.warning.tradePeriod.halfReached",
<<<<<<<
if (preferences.showAgain(key)) {
preferences.dontShowAgain(key, true);
new Popup(preferences).warning(Res.get("popup.warning.tradePeriod.ended",
=======
if (DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup().warning(Res.get("popup.warning.tradePeriod.ended",
>>>>>>>
if (DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup(preferences).warning(Res.get("popup.warning.tradePeriod.ended",
<<<<<<<
okPayAccount.setSelectedTradeCurrency(PreferencesImpl.getDefaultTradeCurrency());
=======
okPayAccount.setSelectedTradeCurrency(GlobalSettings.getDefaultTradeCurrency());
>>>>>>>
okPayAccount.setSelectedTradeCurrency(GlobalSettings.getDefaultTradeCurrency()); |
<<<<<<<
case REIMBURSEMENT_REQUEST:
requestedBsqTextField = addLabelInputTextField(gridPane, ++gridRow,
Res.get("dao.proposal.display.requestedBsq")).second;
=======
requestedBsqTextField = addInputTextField(gridPane, ++gridRow,
Res.get("dao.proposal.display.requestedBsq"));
BsqValidator bsqValidator = new BsqValidator(bsqFormatter);
bsqValidator.setMinValue(daoFacade.getMinCompensationRequestAmount());
bsqValidator.setMaxValue(daoFacade.getMaxCompensationRequestAmount());
>>>>>>>
case REIMBURSEMENT_REQUEST:
requestedBsqTextField = addInputTextField(gridPane, ++gridRow,
Res.get("dao.proposal.display.requestedBsq")); |
<<<<<<<
=======
assertFalse(responseNode.get("time").isNull());
>>>>>>>
assertFalse(responseNode.get("time").isNull()); |
<<<<<<<
import io.bisq.gui.components.SeparatedPhaseBars;
=======
import io.bisq.gui.components.AutoTooltipLabel;
import io.bisq.gui.components.AutoTooltipTableColumn;
import io.bisq.gui.components.InputTextField;
>>>>>>>
import io.bisq.gui.components.AutoTooltipLabel;
import io.bisq.gui.components.AutoTooltipTableColumn;
import io.bisq.gui.components.InputTextField;
import io.bisq.gui.components.SeparatedPhaseBars;
<<<<<<<
createColumns();
sortedList.comparatorProperty().bind(tableView.comparatorProperty());
=======
// tableView.setMinHeight(100);
tableView.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
tableView.setPlaceholder(new AutoTooltipLabel(Res.get("table.placeholder.noData")));
sortedList = new SortedList<>(compensationRequestManger.getObservableList());
>>>>>>>
createColumns();
sortedList.comparatorProperty().bind(tableView.comparatorProperty());
<<<<<<<
///////////////////////////////////////////////////////////////////////////////////////////
// Table
///////////////////////////////////////////////////////////////////////////////////////////
private void createColumns() {
TableColumn<CompensationRequestListItem, CompensationRequestListItem> dateColumn = new TableColumn<CompensationRequestListItem, CompensationRequestListItem>(Res.get("shared.dateTime")) {
=======
private void setColumns() {
TableColumn<CompensationRequest, CompensationRequest> dateColumn = new AutoTooltipTableColumn<CompensationRequest, CompensationRequest>(Res.get("shared.dateTime")) {
>>>>>>>
///////////////////////////////////////////////////////////////////////////////////////////
// Table
///////////////////////////////////////////////////////////////////////////////////////////
private void createColumns() {
TableColumn<CompensationRequestListItem, CompensationRequestListItem> dateColumn = new AutoTooltipTableColumn<CompensationRequestListItem, CompensationRequestListItem>(Res.get("shared.dateTime")) {
<<<<<<<
TableColumn<CompensationRequestListItem, CompensationRequestListItem> nameColumn = new TableColumn<>(Res.get("shared.name"));
=======
TableColumn<CompensationRequest, CompensationRequest> nameColumn = new AutoTooltipTableColumn<>(Res.get("shared.name"));
>>>>>>>
TableColumn<CompensationRequestListItem, CompensationRequestListItem> nameColumn = new AutoTooltipTableColumn<>(Res.get("shared.name"));
<<<<<<<
TableColumn<CompensationRequestListItem, CompensationRequestListItem> uidColumn = new TableColumn<>(Res.get("shared.id"));
=======
TableColumn<CompensationRequest, CompensationRequest> uidColumn = new AutoTooltipTableColumn<>(Res.get("shared.id"));
>>>>>>>
TableColumn<CompensationRequestListItem, CompensationRequestListItem> uidColumn = new AutoTooltipTableColumn<>(Res.get("shared.id")); |
<<<<<<<
import io.bitsquare.messages.user.Preferences;
=======
import io.bitsquare.user.Preferences;
import javafx.beans.value.ChangeListener;
>>>>>>>
import io.bitsquare.messages.user.Preferences;
import javafx.beans.value.ChangeListener; |
<<<<<<<
import io.bisq.core.user.PreferencesImpl;
=======
>>>>>>>
import io.bisq.core.user.PreferencesImpl;
<<<<<<<
protected Locale locale = PreferencesImpl.getDefaultLocale();
=======
>>>>>>>
<<<<<<<
return CurrencyUtil.getNameByCode(currencyCode, PreferencesImpl.getDefaultLocale()) + " (" + getCurrencyPair(currencyCode) + ")";
=======
return CurrencyUtil.getNameByCode(currencyCode) + " (" + getCurrencyPair(currencyCode) + ")";
>>>>>>>
return CurrencyUtil.getNameByCode(currencyCode) + " (" + getCurrencyPair(currencyCode) + ")"; |
<<<<<<<
import io.bitsquare.messages.btc.provider.fee.FeeService;
=======
import io.bitsquare.btc.provider.fee.FeeService;
import io.bitsquare.btc.wallet.BsqWalletService;
>>>>>>>
import io.bitsquare.messages.btc.provider.fee.FeeService;
import io.bitsquare.btc.wallet.BsqWalletService; |
<<<<<<<
import io.bitsquare.locale.BSResources;
import io.bitsquare.messages.locale.BankUtil;
=======
import io.bitsquare.locale.BankUtil;
import io.bitsquare.locale.Res;
>>>>>>>
import io.bitsquare.locale.BSResources;
import io.bitsquare.messages.locale.BankUtil;
import io.bitsquare.locale.BankUtil;
import io.bitsquare.locale.Res; |
<<<<<<<
=======
import io.bitsquare.network.BootstrapState;
import io.bitsquare.network.ClientNode;
import io.bitsquare.network.ConnectionType;
import io.bitsquare.network.Node;
>>>>>>>
import io.bitsquare.network.BootstrapState;
import io.bitsquare.network.ClientNode;
import io.bitsquare.network.ConnectionType;
import io.bitsquare.network.Node;
<<<<<<<
=======
bootstrappedPeerFactory.getBootstrapState().addListener((ov, oldValue, newValue) ->
bootstrapListener.onBootstrapStateChanged(newValue));
>>>>>>>
<<<<<<<
public PeerDHT getPeerDHT() {
return peerDHT;
}
=======
>>>>>>> |
<<<<<<<
=======
Coin buyerAmount = ParsingUtils.parseToCoin(buyerPayoutAmountInputTextField.getText(), formatter);
Coin sellerAmount = ParsingUtils.parseToCoin(sellerPayoutAmountInputTextField.getText(), formatter);
>>>>>>>
<<<<<<<
=======
closeTicketButton.disableProperty().unbind();
dispute.setDisputeResult(disputeResult);
disputeResult.setLoserPublisher(isLoserPublisherCheckBox.isSelected());
disputeResult.setCloseDate(new Date());
String text = Res.get("disputeSummaryWindow.close.msg",
DisplayUtils.formatDateTime(disputeResult.getCloseDate()),
role,
DisplayUtils.booleanToYesNo(disputeResult.tamperProofEvidenceProperty().get()),
role,
DisplayUtils.booleanToYesNo(disputeResult.idVerificationProperty().get()),
role,
DisplayUtils.booleanToYesNo(disputeResult.screenCastProperty().get()),
formatter.formatCoinWithCode(disputeResult.getBuyerPayoutAmount()),
formatter.formatCoinWithCode(disputeResult.getSellerPayoutAmount()),
disputeResult.summaryNotesProperty().get());
dispute.setIsClosed(true);
disputeManager.sendDisputeResultMessage(disputeResult, dispute, text);
if (!finalPeersDispute.isClosed())
UserThread.runAfter(() ->
new Popup<>().attention(Res.get("disputeSummaryWindow.close.closePeer")).show(),
200, TimeUnit.MILLISECONDS);
hide();
finalizeDisputeHandlerOptional.ifPresent(Runnable::run);
>>>>>>> |
<<<<<<<
import io.bisq.network.p2p.BootstrapListener;
import io.bisq.network.p2p.DecryptedMsgWithPubKey;
import io.bisq.network.p2p.SendMailboxMessageListener;
import io.bisq.network.p2p.storage.P2PService;
import io.bisq.protobuffer.crypto.KeyRing;
import io.bisq.protobuffer.message.Message;
import io.bisq.protobuffer.message.arbitration.*;
import io.bisq.protobuffer.payload.arbitration.Attachment;
import io.bisq.protobuffer.payload.arbitration.Dispute;
import io.bisq.protobuffer.payload.arbitration.DisputeResult;
import io.bisq.protobuffer.payload.crypto.PubKeyRing;
import io.bisq.protobuffer.payload.p2p.NodeAddress;
import io.bisq.protobuffer.payload.trade.Contract;
import io.bisq.protobuffer.persistence.arbitration.DisputeList;
=======
import io.bisq.network.p2p.*;
import javafx.collections.FXCollections;
>>>>>>>
import io.bisq.network.p2p.*; |
<<<<<<<
import io.bisq.core.user.Preferences;
import io.bisq.core.user.PreferencesImpl;
=======
>>>>>>>
import io.bisq.core.user.Preferences;
<<<<<<<
currencyComboBox.setItems(FXCollections.observableArrayList(CurrencyUtil.getAllMainFiatCurrencies(PreferencesImpl.getDefaultLocale(), PreferencesImpl.getDefaultTradeCurrency())));
=======
currencyComboBox.setItems(FXCollections.observableArrayList(CurrencyUtil.getMainFiatCurrencies()));
>>>>>>>
currencyComboBox.setItems(FXCollections.observableArrayList(CurrencyUtil.getMainFiatCurrencies())); |
<<<<<<<
// Added 0.7.0
@Test
public void testALC() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("ALC");
assertTrue(validator.validate("AQJTNtWcP7opxuR52Lf5vmoQTC8EHQ6GxV").isValid);
assertTrue(validator.validate("ALEK7jttmqtx2ZhXHg69Zr426qKBnzYA9E").isValid);
assertTrue(validator.validate("AP1egWUthPoYvZL57aBk4RPqUgjG1fJGn6").isValid);
assertTrue(validator.validate("AST3zfvPdZ35npxAVC8ABgVCxxDLwTmAHU").isValid);
assertFalse(validator.validate("1AQJTNtWcP7opxuR52Lf5vmoQTC8EHQ6GxV").isValid);
assertFalse(validator.validate("1ALEK7jttmqtx2ZhXHg69Zr426qKBnzYA9E").isValid);
assertFalse(validator.validate("1AP1egWUthPoYvZL57aBk4RPqUgjG1fJGn6").isValid);
assertFalse(validator.validate("").isValid);
}
@Test
public void testDIN() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("DIN");
assertTrue(validator.validate("DBmvak2TM8GpeiR3ZEVWAHWFZeiw9FG7jK").isValid);
assertTrue(validator.validate("DDWit1CcocL2j3CzfmZgz4bx2DE1h8tugv").isValid);
assertTrue(validator.validate("DF8D75bjz6i8azUHgmbV3awpn6tni5W43B").isValid);
assertTrue(validator.validate("DJquenkkiFVNpF7vVLg2xKnxCjKwnYb6Ay").isValid);
assertFalse(validator.validate("1QbFeFc3iqRYhemqq7VZNX1SN5NtKa8UQFxw").isValid);
assertFalse(validator.validate("7rrpfJKZC7t1R2FPKrsvfkcE8KBLuSyVYAjt").isValid);
assertFalse(validator.validate("QFxwQbFeFc3iqRYhek#17VZNX1SN5NtKa8U").isValid);
assertFalse(validator.validate("").isValid);
}
@Test
public void testStraya() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("NAH");
assertTrue(validator.validate("SZHa3vS9ctDJwx3BziaqgN3zQMkYpgyP7f").isValid);
assertTrue(validator.validate("SefAdKgyqdg7wd1emhFynPs44d1b2Ca2U1").isValid);
assertTrue(validator.validate("SSw6555umxHsPZgE96KoyiEVY3CDuJRBQc").isValid);
assertTrue(validator.validate("SYwJ6aXQkmt3ExuaXBSCmyiHRn8fUpxXUi").isValid);
assertFalse(validator.validate("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq").isValid);
assertFalse(validator.validate("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266").isValid);
assertFalse(validator.validate("DNkkfdUvkCDiywYE98MTVp9nQJTgeZAiFr").isValid);
assertFalse(validator.validate("").isValid);
}
@Test
public void testROI() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("ROI");
assertTrue(validator.validate("RSdzB2mFpQ6cR3HmEopbaRBjrEMWAwXBYn").isValid);
assertTrue(validator.validate("RBQN9ybF5JzsPQdsiHMpGfkA5HpwddKvmU").isValid);
assertFalse(validator.validate("1RBQN9ybF5JzsPQdsiHMpGfkA5HpwddKvmU").isValid);
assertFalse(validator.validate("RBQN9ybF5JzsPQdsiHMpGfkA5HpwddKvmU1").isValid);
assertFalse(validator.validate("RBQN9ybF5JzsPQdsiHMpGfkA5HpwddKvmU#").isValid);
assertFalse(validator.validate("").isValid);
}
=======
@Test
public void testWMCC() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("WMCC");
assertTrue(validator.validate("wc1qke2es507uz0dcfx7eyvlfuemwys8xem48vp5rw").isValid);
assertTrue(validator.validate("wc1qlwsfmqswjnnv20quv203lnksjrgsww3mjhd349").isValid);
assertTrue(validator.validate("Wmpfed6ykt9YsFxhGri5KJvKc3r7BC1rVQ").isValid);
assertTrue(validator.validate("WSSqzNJvc4X4xWW6WDyUk1oWEeLx45vyRh").isValid);
assertTrue(validator.validate("XWJk3GEuNFEn3dGFCi7vTzVuydeGQA9Fnq").isValid);
assertTrue(validator.validate("XG1Mc7XvvpR1wQvjeikZwHAjwLvCWQD35u").isValid);
assertFalse(validator.validate("wc1qke2es507uz0dcfx7eyvlfuemwys8xem48vp5rx").isValid);
assertFalse(validator.validate("Wmpfed6ykt9YsFxhGri5KJvKc3r7BC1rvq").isValid);
assertFalse(validator.validate("XWJk3GEuNFEn3dGFCi7vTzVuydeGQA9FNQ").isValid);
assertFalse(validator.validate("0123456789Abcdefghijklmnopqrstuvwxyz").isValid);
assertFalse(validator.validate("").isValid);
}
>>>>>>>
// Added 0.7.0
@Test
public void testALC() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("ALC");
assertTrue(validator.validate("AQJTNtWcP7opxuR52Lf5vmoQTC8EHQ6GxV").isValid);
assertTrue(validator.validate("ALEK7jttmqtx2ZhXHg69Zr426qKBnzYA9E").isValid);
assertTrue(validator.validate("AP1egWUthPoYvZL57aBk4RPqUgjG1fJGn6").isValid);
assertTrue(validator.validate("AST3zfvPdZ35npxAVC8ABgVCxxDLwTmAHU").isValid);
assertFalse(validator.validate("1AQJTNtWcP7opxuR52Lf5vmoQTC8EHQ6GxV").isValid);
assertFalse(validator.validate("1ALEK7jttmqtx2ZhXHg69Zr426qKBnzYA9E").isValid);
assertFalse(validator.validate("1AP1egWUthPoYvZL57aBk4RPqUgjG1fJGn6").isValid);
assertFalse(validator.validate("").isValid);
}
@Test
public void testDIN() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("DIN");
assertTrue(validator.validate("DBmvak2TM8GpeiR3ZEVWAHWFZeiw9FG7jK").isValid);
assertTrue(validator.validate("DDWit1CcocL2j3CzfmZgz4bx2DE1h8tugv").isValid);
assertTrue(validator.validate("DF8D75bjz6i8azUHgmbV3awpn6tni5W43B").isValid);
assertTrue(validator.validate("DJquenkkiFVNpF7vVLg2xKnxCjKwnYb6Ay").isValid);
assertFalse(validator.validate("1QbFeFc3iqRYhemqq7VZNX1SN5NtKa8UQFxw").isValid);
assertFalse(validator.validate("7rrpfJKZC7t1R2FPKrsvfkcE8KBLuSyVYAjt").isValid);
assertFalse(validator.validate("QFxwQbFeFc3iqRYhek#17VZNX1SN5NtKa8U").isValid);
assertFalse(validator.validate("").isValid);
}
@Test
public void testStraya() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("NAH");
assertTrue(validator.validate("SZHa3vS9ctDJwx3BziaqgN3zQMkYpgyP7f").isValid);
assertTrue(validator.validate("SefAdKgyqdg7wd1emhFynPs44d1b2Ca2U1").isValid);
assertTrue(validator.validate("SSw6555umxHsPZgE96KoyiEVY3CDuJRBQc").isValid);
assertTrue(validator.validate("SYwJ6aXQkmt3ExuaXBSCmyiHRn8fUpxXUi").isValid);
assertFalse(validator.validate("17VZNX1SN5NtKa8UQFxwQbFeFc3iqRYhemqq").isValid);
assertFalse(validator.validate("0x2a65Aca4D5fC5B5C859090a6c34d1641353982266").isValid);
assertFalse(validator.validate("DNkkfdUvkCDiywYE98MTVp9nQJTgeZAiFr").isValid);
assertFalse(validator.validate("").isValid);
}
@Test
public void testROI() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("ROI");
assertTrue(validator.validate("RSdzB2mFpQ6cR3HmEopbaRBjrEMWAwXBYn").isValid);
assertTrue(validator.validate("RBQN9ybF5JzsPQdsiHMpGfkA5HpwddKvmU").isValid);
assertFalse(validator.validate("1RBQN9ybF5JzsPQdsiHMpGfkA5HpwddKvmU").isValid);
assertFalse(validator.validate("RBQN9ybF5JzsPQdsiHMpGfkA5HpwddKvmU1").isValid);
assertFalse(validator.validate("RBQN9ybF5JzsPQdsiHMpGfkA5HpwddKvmU#").isValid);
assertFalse(validator.validate("").isValid);
}
@Test
public void testWMCC() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("WMCC");
assertTrue(validator.validate("wc1qke2es507uz0dcfx7eyvlfuemwys8xem48vp5rw").isValid);
assertTrue(validator.validate("wc1qlwsfmqswjnnv20quv203lnksjrgsww3mjhd349").isValid);
assertTrue(validator.validate("Wmpfed6ykt9YsFxhGri5KJvKc3r7BC1rVQ").isValid);
assertTrue(validator.validate("WSSqzNJvc4X4xWW6WDyUk1oWEeLx45vyRh").isValid);
assertTrue(validator.validate("XWJk3GEuNFEn3dGFCi7vTzVuydeGQA9Fnq").isValid);
assertTrue(validator.validate("XG1Mc7XvvpR1wQvjeikZwHAjwLvCWQD35u").isValid);
assertFalse(validator.validate("wc1qke2es507uz0dcfx7eyvlfuemwys8xem48vp5rx").isValid);
assertFalse(validator.validate("Wmpfed6ykt9YsFxhGri5KJvKc3r7BC1rvq").isValid);
assertFalse(validator.validate("XWJk3GEuNFEn3dGFCi7vTzVuydeGQA9FNQ").isValid);
assertFalse(validator.validate("0123456789Abcdefghijklmnopqrstuvwxyz").isValid);
assertFalse(validator.validate("").isValid);
} |
<<<<<<<
import io.bisq.core.user.Preferences;
import io.bisq.core.user.PreferencesImpl;
=======
>>>>>>>
import io.bisq.core.user.Preferences;
<<<<<<<
if (CountryUtil.containsAllSepaEuroCountries(acceptedCountryCodes, PreferencesImpl.getDefaultLocale())) {
=======
if (CountryUtil.containsAllSepaEuroCountries(acceptedCountryCodes)) {
>>>>>>>
if (CountryUtil.containsAllSepaEuroCountries(acceptedCountryCodes)) {
<<<<<<<
tooltip = new Tooltip(CountryUtil.getNamesByCodesString(acceptedCountryCodes, PreferencesImpl.getDefaultLocale()));
=======
tooltip = new Tooltip(CountryUtil.getNamesByCodesString(acceptedCountryCodes));
>>>>>>>
tooltip = new Tooltip(CountryUtil.getNamesByCodesString(acceptedCountryCodes)); |
<<<<<<<
TaskEntity task = commandContext.getTaskEntityManager().create();
=======
CommandContext commandContext = Context.getCommandContext();
TaskEntityManager taskEntityManager = commandContext.getTaskEntityManager();
TaskEntity task = taskEntityManager.create();
>>>>>>>
TaskEntityManager taskEntityManager = commandContext.getTaskEntityManager();
TaskEntity task = taskEntityManager.create();
<<<<<<<
commandContext.getTaskEntityManager().insert(task, (ExecutionEntity) execution);
=======
>>>>>>>
<<<<<<<
commandContext.getTaskEntityManager().update(task);
commandContext.getTaskEntityManager().fireTaskListenerEvent(task, TaskListener.EVENTNAME_CREATE);
=======
>>>>>>>
<<<<<<<
commandContext.getTaskEntityManager().deleteTask(task, TaskEntity.DELETE_REASON_COMPLETED, false, false);
=======
taskEntityManager.deleteTask(task, TaskEntity.DELETE_REASON_COMPLETED, false, false);
>>>>>>>
taskEntityManager.deleteTask(task, TaskEntity.DELETE_REASON_COMPLETED, false, false);
<<<<<<<
task.setAssignee(assigneeValue);
commandContext.getTaskEntityManager().update(task);
=======
taskEntityManager.changeTaskAssignee(task, assigneeValue);;
>>>>>>>
taskEntityManager.changeTaskAssignee(task, assigneeValue);;
<<<<<<<
task.setOwner(ownerValue);
commandContext.getTaskEntityManager().update(task);
=======
taskEntityManager.changeTaskOwner(task, ownerValue);
>>>>>>>
taskEntityManager.changeTaskOwner(task, ownerValue); |
<<<<<<<
@Test
public void testXCN() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("XCN");
assertTrue(validator.validate("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2D5").isValid);
assertTrue(validator.validate("CGTta3M4t3yXu8uRgkKvaWd2d8DQvDPnpL").isValid);
assertTrue(validator.validate("Cco3zGiEJMyz3wrndEr6wg5cm1oUAbBoR2").isValid);
assertTrue(validator.validate("CPzmjGCDEdQuRffmbpkrYQtSiUAm4oZJgt").isValid);
assertFalse(validator.validate("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2D4").isValid);
assertFalse(validator.validate("CGTta3M4t3yXu8uRgkKvaWd2d8DQvDPnpl").isValid);
assertFalse(validator.validate("Cco3zGiEJMyz3wrndEr6wg5cm1oUAbBoR1").isValid);
assertFalse(validator.validate("CPzmjGCDEdQuRffmbpkrYQtSiUAm4oZJgT").isValid);
assertFalse(validator.validate("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2Da").isValid);
assertFalse(validator.validate("").isValid);
assertFalse(validator.validate("asdasd").isValid);
assertFalse(validator.validate("cT49DTNo5itqYoAD6XTGyTKbe8z5nGY2Da").isValid);
assertFalse(validator.validate("No5itqYoAD6XTGyTKbe8z5nGY2Da").isValid);
}
=======
@Test
public void testTRC() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("TRC");
assertTrue(validator.validate("1Bys8pZaKo4GTWcpArMg92cBgYqij8mKXt").isValid);
assertTrue(validator.validate("12Ycuof6g5GRyWy56eQ3NvJpwAM8z9pb4g").isValid);
assertTrue(validator.validate("1DEBTTVCn1h9bQS9scVP6UjoSsjbtJBvXF").isValid);
assertTrue(validator.validate("18s142HdWDfDQXYBpuyMvsU3KHwryLxnCr").isValid);
assertFalse(validator.validate("18s142HdWDfDQXYBpyuMvsU3KHwryLxnCr").isValid);
assertFalse(validator.validate("18s142HdWDfDQXYBpuyMvsU3KHwryLxnC").isValid);
assertFalse(validator.validate("8s142HdWDfDQXYBpuyMvsU3KHwryLxnCr").isValid);
assertFalse(validator.validate("18s142HdWDfDQXYBuyMvsU3KHwryLxnCr").isValid);
assertFalse(validator.validate("").isValid);
assertFalse(validator.validate("1asdasd").isValid);
assertFalse(validator.validate("asdasd").isValid);
}
>>>>>>>
@Test
public void testXCN() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("XCN");
assertTrue(validator.validate("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2D5").isValid);
assertTrue(validator.validate("CGTta3M4t3yXu8uRgkKvaWd2d8DQvDPnpL").isValid);
assertTrue(validator.validate("Cco3zGiEJMyz3wrndEr6wg5cm1oUAbBoR2").isValid);
assertTrue(validator.validate("CPzmjGCDEdQuRffmbpkrYQtSiUAm4oZJgt").isValid);
assertFalse(validator.validate("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2D4").isValid);
assertFalse(validator.validate("CGTta3M4t3yXu8uRgkKvaWd2d8DQvDPnpl").isValid);
assertFalse(validator.validate("Cco3zGiEJMyz3wrndEr6wg5cm1oUAbBoR1").isValid);
assertFalse(validator.validate("CPzmjGCDEdQuRffmbpkrYQtSiUAm4oZJgT").isValid);
assertFalse(validator.validate("CT49DTNo5itqYoAD6XTGyTKbe8z5nGY2Da").isValid);
assertFalse(validator.validate("").isValid);
assertFalse(validator.validate("asdasd").isValid);
assertFalse(validator.validate("cT49DTNo5itqYoAD6XTGyTKbe8z5nGY2Da").isValid);
assertFalse(validator.validate("No5itqYoAD6XTGyTKbe8z5nGY2Da").isValid);
}
@Test
public void testTRC() {
AltCoinAddressValidator validator = new AltCoinAddressValidator();
validator.setCurrencyCode("TRC");
assertTrue(validator.validate("1Bys8pZaKo4GTWcpArMg92cBgYqij8mKXt").isValid);
assertTrue(validator.validate("12Ycuof6g5GRyWy56eQ3NvJpwAM8z9pb4g").isValid);
assertTrue(validator.validate("1DEBTTVCn1h9bQS9scVP6UjoSsjbtJBvXF").isValid);
assertTrue(validator.validate("18s142HdWDfDQXYBpuyMvsU3KHwryLxnCr").isValid);
assertFalse(validator.validate("18s142HdWDfDQXYBpyuMvsU3KHwryLxnCr").isValid);
assertFalse(validator.validate("18s142HdWDfDQXYBpuyMvsU3KHwryLxnC").isValid);
assertFalse(validator.validate("8s142HdWDfDQXYBpuyMvsU3KHwryLxnCr").isValid);
assertFalse(validator.validate("18s142HdWDfDQXYBuyMvsU3KHwryLxnCr").isValid);
assertFalse(validator.validate("").isValid);
assertFalse(validator.validate("1asdasd").isValid);
assertFalse(validator.validate("asdasd").isValid);
} |
<<<<<<<
return new Offer(offerId, null,
=======
Coin securityDepositAsCoin = securityDeposit.get();
checkArgument(securityDepositAsCoin.compareTo(Restrictions.MAX_SECURITY_DEPOSIT) <= 0, "securityDeposit must be not exceed " +
Restrictions.MAX_SECURITY_DEPOSIT.toFriendlyString());
checkArgument(securityDepositAsCoin.compareTo(Restrictions.MIN_SECURITY_DEPOSIT) >= 0, "securityDeposit must be not be less than " +
Restrictions.MIN_SECURITY_DEPOSIT.toFriendlyString());
return new Offer(offerId,
>>>>>>>
Coin securityDepositAsCoin = securityDeposit.get();
checkArgument(securityDepositAsCoin.compareTo(Restrictions.MAX_SECURITY_DEPOSIT) <= 0, "securityDeposit must be not exceed " +
Restrictions.MAX_SECURITY_DEPOSIT.toFriendlyString());
checkArgument(securityDepositAsCoin.compareTo(Restrictions.MIN_SECURITY_DEPOSIT) >= 0, "securityDeposit must be not be less than " +
Restrictions.MIN_SECURITY_DEPOSIT.toFriendlyString());
return new Offer(offerId,
null, |
<<<<<<<
private final BSFormatter formatter;
private final Preferences preferences;
=======
private final BSFormatter btcFormatter;
private BsqFormatter bsqFormatter;
>>>>>>>
private final BSFormatter btcFormatter;
private BsqFormatter bsqFormatter;
<<<<<<<
public TakeOfferViewModel(TakeOfferDataModel dataModel, BtcValidator btcValidator, P2PService p2PService,
Navigation navigation, BSFormatter formatter, Preferences preferences) {
=======
public TakeOfferViewModel(TakeOfferDataModel dataModel,
BtcValidator btcValidator,
P2PService p2PService,
Navigation navigation,
BSFormatter btcFormatter,
BsqFormatter bsqFormatter) {
>>>>>>>
public TakeOfferViewModel(TakeOfferDataModel dataModel,
BtcValidator btcValidator,
P2PService p2PService,
Navigation navigation,
BSFormatter btcFormatter,
BsqFormatter bsqFormatter,
Preferences preferences) {
<<<<<<<
this.formatter = formatter;
this.preferences = preferences;
=======
this.btcFormatter = btcFormatter;
this.bsqFormatter = bsqFormatter;
>>>>>>>
this.btcFormatter = btcFormatter;
this.bsqFormatter = bsqFormatter;
this.preferences = preferences;
<<<<<<<
new Popup(preferences).warning(Res.get("shared.notEnoughFunds",
formatter.formatCoinWithCode(dataModel.totalToPayAsCoin.get()),
formatter.formatCoinWithCode(dataModel.totalAvailableBalance)))
=======
new Popup().warning(Res.get("shared.notEnoughFunds",
btcFormatter.formatCoinWithCode(dataModel.totalToPayAsCoin.get()),
btcFormatter.formatCoinWithCode(dataModel.totalAvailableBalance)))
>>>>>>>
new Popup(preferences).warning(Res.get("shared.notEnoughFunds",
btcFormatter.formatCoinWithCode(dataModel.totalToPayAsCoin.get()),
btcFormatter.formatCoinWithCode(dataModel.totalAvailableBalance))) |
<<<<<<<
import io.bisq.network.p2p.storage.P2PService;
import io.bisq.protobuffer.crypto.KeyRing;
import io.bisq.protobuffer.message.trade.TradeMessage;
import io.bisq.protobuffer.payload.btc.RawTransactionInput;
import io.bisq.protobuffer.payload.crypto.PubKeyRing;
import io.bisq.protobuffer.payload.filter.PaymentAccountFilter;
import io.bisq.protobuffer.payload.p2p.NodeAddress;
import io.bisq.protobuffer.payload.payment.PaymentAccountPayload;
import lombok.Getter;
import lombok.Setter;
=======
import io.bisq.network.p2p.NodeAddress;
import io.bisq.network.p2p.P2PService;
>>>>>>>
import lombok.Getter;
import lombok.Setter;
import io.bisq.network.p2p.NodeAddress;
import io.bisq.network.p2p.P2PService;
<<<<<<<
@Setter
transient private TradeMessage tradeMessage;
@Getter
@Setter
=======
transient private TradeMsg tradeMessage;
>>>>>>>
@Setter
transient private TradeMsg tradeMessage;
@Getter
@Setter
<<<<<<<
=======
public void setTradeMessage(TradeMsg tradeMessage) {
this.tradeMessage = tradeMessage;
}
>>>>>>> |
<<<<<<<
Capabilities.app.addAll(
Capability.TRADE_STATISTICS,
Capability.TRADE_STATISTICS_2,
Capability.ACCOUNT_AGE_WITNESS,
Capability.ACK_MSG,
Capability.BUNDLE_OF_ENVELOPES
);
=======
Capabilities.app.addAll(Capability.TRADE_STATISTICS, Capability.TRADE_STATISTICS_2, Capability.ACCOUNT_AGE_WITNESS, Capability.ACK_MSG);
Capabilities.app.addAll(Capability.BUNDLE_OF_ENVELOPES, Capability.SIGNED_ACCOUNT_AGE_WITNESS);
>>>>>>>
Capabilities.app.addAll(
Capability.TRADE_STATISTICS,
Capability.TRADE_STATISTICS_2,
Capability.ACCOUNT_AGE_WITNESS,
Capability.ACK_MSG,
Capability.BUNDLE_OF_ENVELOPES
);
<<<<<<<
Capabilities.app.addAll(
Capability.PROPOSAL,
Capability.BLIND_VOTE,
Capability.BSQ_BLOCK,
Capability.DAO_STATE
);
=======
Capabilities.app.addAll(Capability.PROPOSAL, Capability.BLIND_VOTE, Capability.DAO_STATE);
>>>>>>>
Capabilities.app.addAll(
Capability.PROPOSAL,
Capability.BLIND_VOTE,
Capability.DAO_STATE
); |
<<<<<<<
import io.bitsquare.messages.filter.payload.Filter;
import io.bitsquare.messages.filter.payload.PaymentAccountFilter;
=======
import io.bitsquare.locale.Res;
>>>>>>>
import io.bitsquare.messages.filter.payload.Filter;
import io.bitsquare.messages.filter.payload.PaymentAccountFilter;
<<<<<<<
InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Private key to unlock:", 10).second;
if (DevFlags.USE_DEV_PRIVILEGE_KEYS)
keyInputTextField.setText("6ac43ea1df2a290c1c8391736aa42e4339c5cb4f110ff0257a13b63211977b7a");
InputTextField offerIdsInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Filtered offers (comma sep.):").second;
InputTextField nodesInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Filtered onion addresses (comma sep.):").second;
InputTextField paymentAccountFilterInputTextField = addLabelInputTextField(gridPane, ++rowIndex, "Filtered trading account data:\nFormat: comma sep. list of [payment method id | data field | value]").second;
=======
InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("shared.unlock"), 10).second;
InputTextField offerIdsInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.offers")).second;
InputTextField nodesInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.onions")).second;
InputTextField paymentAccountFilterInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.accounts")).second;
>>>>>>>
InputTextField keyInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("shared.unlock"), 10).second;
if (DevFlags.USE_DEV_PRIVILEGE_KEYS)
keyInputTextField.setText("6ac43ea1df2a290c1c8391736aa42e4339c5cb4f110ff0257a13b63211977b7a");
InputTextField offerIdsInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.offers")).second;
InputTextField nodesInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.onions")).second;
InputTextField paymentAccountFilterInputTextField = addLabelInputTextField(gridPane, ++rowIndex, Res.get("filterWindow.accounts")).second; |
<<<<<<<
import io.bisq.core.user.Preferences;
import io.bisq.core.user.PreferencesImpl;
=======
>>>>>>>
import io.bisq.core.user.Preferences;
<<<<<<<
TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(countryCode, PreferencesImpl.getDefaultLocale());
=======
TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(countryCode);
>>>>>>>
TradeCurrency currency = CurrencyUtil.getCurrencyByCountryCode(countryCode);
<<<<<<<
currencyComboBox.setItems(FXCollections.observableArrayList(CurrencyUtil.getAllSortedFiatCurrencies(PreferencesImpl.getDefaultLocale())));
=======
currencyComboBox.setItems(FXCollections.observableArrayList(CurrencyUtil.getAllSortedFiatCurrencies()));
>>>>>>>
currencyComboBox.setItems(FXCollections.observableArrayList(CurrencyUtil.getAllSortedFiatCurrencies()));
<<<<<<<
FiatCurrency defaultCurrency = CurrencyUtil.getCurrencyByCountryCode(countryComboBox.getSelectionModel().getSelectedItem().code, PreferencesImpl.getDefaultLocale());
=======
FiatCurrency defaultCurrency = CurrencyUtil.getCurrencyByCountryCode(countryComboBox.getSelectionModel().getSelectedItem().code);
>>>>>>>
FiatCurrency defaultCurrency = CurrencyUtil.getCurrencyByCountryCode(countryComboBox.getSelectionModel().getSelectedItem().code); |
<<<<<<<
import io.bitsquare.messages.user.Preferences;
=======
import io.bitsquare.locale.Res;
>>>>>>>
import io.bitsquare.messages.user.Preferences;
import io.bitsquare.locale.Res;
<<<<<<<
button = new Button("Revert");
=======
button = new Button(Res.get("funds.tx.revert"));
button.setOnAction(e -> revertTransaction(item.getTxId(), item.getTradable()));
>>>>>>>
button = new Button(Res.get("funds.tx.revert"));
button.setOnAction(e -> revertTransaction(item.getTxId(), item.getTradable())); |
<<<<<<<
import io.bisq.core.provider.fee.FeeService;
import io.bisq.core.user.Preferences;
=======
>>>>>>>
import io.bisq.core.user.Preferences;
<<<<<<<
private final Preferences preferences;
private TextField balanceTextField;
=======
>>>>>>>
private final Preferences preferences;
<<<<<<<
private BsqSendView(BsqWalletService bsqWalletService, BtcWalletService btcWalletService, FeeService feeService,
BsqFormatter bsqFormatter, BSFormatter btcFormatter, BalanceUtil balanceUtil,
Preferences preferences) {
=======
private BsqSendView(BsqWalletService bsqWalletService, BtcWalletService btcWalletService,
BsqFormatter bsqFormatter, BSFormatter btcFormatter,
BalanceUtil balanceUtil, BsqValidator bsqValidator, BsqAddressValidator bsqAddressValidator) {
>>>>>>>
private BsqSendView(BsqWalletService bsqWalletService, BtcWalletService btcWalletService,
BsqFormatter bsqFormatter, BSFormatter btcFormatter,
BalanceUtil balanceUtil, BsqValidator bsqValidator, BsqAddressValidator bsqAddressValidator, Preferences preferences) {
<<<<<<<
this.preferences = preferences;
=======
this.bsqValidator = bsqValidator;
this.bsqAddressValidator = bsqAddressValidator;
>>>>>>>
this.preferences = preferences;
this.bsqValidator = bsqValidator;
this.bsqAddressValidator = bsqAddressValidator;
<<<<<<<
} catch (AddressFormatException | InsufficientFundsException |
TransactionVerificationException | WalletException | InsufficientMoneyException e) {
log.error(e.toString());
e.printStackTrace();
new Popup<>(preferences).warning(e.toString());
=======
} catch (Throwable t) {
log.error(t.toString());
t.printStackTrace();
new Popup<>().warning(t.getMessage()).show();
>>>>>>>
} catch (Throwable t) {
log.error(t.toString());
t.printStackTrace();
new Popup<>(preferences).warning(t.getMessage()).show(); |
<<<<<<<
=======
import bisq.core.util.BSFormatter;
import bisq.core.util.BsqFormatter;
import bisq.core.util.CoinUtil;
>>>>>>>
import bisq.core.util.CoinUtil; |
<<<<<<<
genesisIssueAmountTextField = addLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisIssueAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
compRequestIssueAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compRequestIssueAmount")).second;
reimbursementAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementAmount")).second;
burntAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntAmount")).second;
availableAmountTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.availableAmount")).second;
=======
genesisIssueAmountTextField = FormBuilder.addTopLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisIssueAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
compRequestIssueAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compRequestIssueAmount")).second;
burntAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntAmount")).second;
availableAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.availableAmount")).second;
>>>>>>>
genesisIssueAmountTextField = FormBuilder.addTopLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisIssueAmount"), Layout.FIRST_ROW_AND_GROUP_DISTANCE).second;
compRequestIssueAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compRequestIssueAmount")).second;
reimbursementAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementAmount")).second;
burntAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntAmount")).second;
availableAmountTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.availableAmount")).second;
<<<<<<<
addTitledGroupBg(root, ++gridRow, 7, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE);
addLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisBlockHeight"),
=======
addTitledGroupBg(root, ++gridRow, 6, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE);
addTopLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisBlockHeight"),
>>>>>>>
addTitledGroupBg(root, ++gridRow, 6, Res.get("dao.wallet.dashboard.txDetails"), Layout.GROUP_DISTANCE);
addTopLabelTextField(root, gridRow, Res.get("dao.wallet.dashboard.genesisBlockHeight"),
<<<<<<<
allTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.allTx")).second;
utxoTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second;
compensationIssuanceTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compensationIssuanceTx")).second;
reimbursementIssuanceTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementIssuanceTx")).second;
burntTxTextField = addLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntTx")).second;
=======
allTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.allTx")).second;
utxoTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second;
issuanceTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.issuanceTx")).second;
burntTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntTx")).second;
>>>>>>>
allTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.allTx")).second;
utxoTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.utxo")).second;
compensationIssuanceTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.compensationIssuanceTx")).second;
reimbursementIssuanceTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.reimbursementIssuanceTx")).second;
burntTxTextField = FormBuilder.addTopLabelTextField(root, ++gridRow, Res.get("dao.wallet.dashboard.burntTx")).second; |
<<<<<<<
import io.bisq.core.user.PreferencesImpl;
=======
import io.bisq.core.user.DontShowAgainLookup;
>>>>>>>
import io.bisq.core.user.DontShowAgainLookup;
import io.bisq.core.user.PreferencesImpl;
<<<<<<<
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode(),
PreferencesImpl.getDefaultLocale()));
=======
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()));
>>>>>>>
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()));
<<<<<<<
if (!DevEnv.DEV_MODE && preferences.showAgain(key)) {
Popup popup = new Popup(preferences);
=======
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
Popup popup = new Popup();
>>>>>>>
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
Popup popup = new Popup(preferences);
<<<<<<<
if (!DevEnv.DEV_MODE && preferences.showAgain(key)) {
Popup popup = new Popup(preferences);
=======
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
Popup popup = new Popup();
>>>>>>>
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
Popup popup = new Popup(preferences);
<<<<<<<
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode(),
PreferencesImpl.getDefaultLocale())))
=======
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode())))
>>>>>>>
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode())))
<<<<<<<
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode(), PreferencesImpl.getDefaultLocale()),
=======
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()),
>>>>>>>
CurrencyUtil.getNameByCode(trade.getOffer().getCurrencyCode()),
<<<<<<<
if (!DevEnv.DEV_MODE && preferences.showAgain(key)) {
preferences.dontShowAgain(key, true);
new Popup(preferences).headLine(Res.get("popup.attention.forTradeWithId", id))
=======
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup().headLine(Res.get("popup.attention.forTradeWithId", id))
>>>>>>>
if (!DevEnv.DEV_MODE && DontShowAgainLookup.showAgain(key)) {
DontShowAgainLookup.dontShowAgain(key, true);
new Popup(preferences).headLine(Res.get("popup.attention.forTradeWithId", id)) |
<<<<<<<
final ObservableList<String> btcDenominations = FXCollections.observableArrayList(PreferencesImpl.getBtcDenominations());
=======
final ObservableList<String> btcDenominations = FXCollections.observableArrayList();
>>>>>>>
final ObservableList<String> btcDenominations = FXCollections.observableArrayList(PreferencesImpl.getBtcDenominations());
<<<<<<<
new Popup(preferences).warning(Res.get("validation.integerOnly")).show();
=======
log.error(t.toString());
t.printStackTrace();
new Popup().warning(Res.get("validation.integerOnly")).show();
>>>>>>>
log.error(t.toString());
t.printStackTrace();
new Popup(preferences).warning(Res.get("validation.integerOnly")).show();
<<<<<<<
new Popup(preferences).warning(Res.get("validation.inputError", t.getMessage())).show();
=======
log.error(t.toString());
t.printStackTrace();
new Popup().warning(Res.get("validation.inputError", t.getMessage())).show();
>>>>>>>
log.error(t.toString());
t.printStackTrace();
new Popup(preferences).warning(Res.get("validation.inputError", t.getMessage())).show(); |
<<<<<<<
newlyAdded.add("DAI");
newlyAdded.add("YTN");
=======
newlyAdded.add("DARX");
>>>>>>>
newlyAdded.add("DAI");
newlyAdded.add("YTN");
newlyAdded.add("DARX"); |
<<<<<<<
if (preferences.showAgain(key))
new Popup(preferences).warning(Res.get("popup.warning.removeOffer", model.formatter.formatCoinWithCode(openOffer.getOffer().getCreateOfferFee())))
=======
if (DontShowAgainLookup.showAgain(key))
new Popup().warning(Res.get("popup.warning.removeOffer", model.formatter.formatCoinWithCode(openOffer.getOffer().getMakerFee())))
>>>>>>>
if (DontShowAgainLookup.showAgain(key))
new Popup(preferences).warning(Res.get("popup.warning.removeOffer", model.formatter.formatCoinWithCode(openOffer.getOffer().getMakerFee())))
<<<<<<<
if (preferences.showAgain(key))
new Popup(preferences).instruction(Res.get("offerbook.withdrawFundsHint", Res.get("navigation.funds.availableForWithdrawal")))
=======
if (DontShowAgainLookup.showAgain(key))
new Popup().instruction(Res.get("offerbook.withdrawFundsHint", Res.get("navigation.funds.availableForWithdrawal")))
>>>>>>>
if (DontShowAgainLookup.showAgain(key))
new Popup(preferences).instruction(Res.get("offerbook.withdrawFundsHint", Res.get("navigation.funds.availableForWithdrawal"))) |
<<<<<<<
private InputTextField transactionFeeInputTextField, ignoreTradersListInputTextField, referralIdInputTextField,
rpcUserTextField, blockNotifyPortTextField;
=======
private InputTextField transactionFeeInputTextField, ignoreTradersListInputTextField, ignoreDustThresholdInputTextField,
/*referralIdInputTextField,*/
rpcUserTextField;
>>>>>>>
private InputTextField transactionFeeInputTextField, ignoreTradersListInputTextField, ignoreDustThresholdInputTextField,
/*referralIdInputTextField,*/
rpcUserTextField, blockNotifyPortTextField;
<<<<<<<
private ChangeListener<String> deviationListener, ignoreTradersListListener, referralIdListener, rpcUserListener,
rpcPwListener, blockNotifyPortListener;
=======
private ChangeListener<String> deviationListener, ignoreTradersListListener, ignoreDustThresholdListener,
/*referralIdListener,*/ rpcUserListener, rpcPwListener;
>>>>>>>
private ChangeListener<String> deviationListener, ignoreTradersListListener, ignoreDustThresholdListener,
/*referralIdListener,*/ rpcUserListener, rpcPwListener, blockNotifyPortListener;
<<<<<<<
public PreferencesView(PreferencesViewModel model,
Preferences preferences,
FeeService feeService,
ReferralIdService referralIdService,
AssetService assetService,
FilterManager filterManager,
DaoFacade daoFacade,
BSFormatter formatter,
@Named(DaoOptionKeys.FULL_DAO_NODE) String fullDaoNode,
@Named(DaoOptionKeys.RPC_USER) String rpcUser,
@Named(DaoOptionKeys.RPC_PASSWORD) String rpcPassword,
@Named(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT) String rpcBlockNotificationPort) {
=======
public PreferencesView(PreferencesViewModel model, Preferences preferences, FeeService feeService,
AssetService assetService, FilterManager filterManager, DaoFacade daoFacade, BSFormatter formatter) {
>>>>>>>
public PreferencesView(PreferencesViewModel model,
Preferences preferences,
FeeService feeService,
AssetService assetService,
FilterManager filterManager,
DaoFacade daoFacade,
BSFormatter formatter,
@Named(DaoOptionKeys.FULL_DAO_NODE) String fullDaoNode,
@Named(DaoOptionKeys.RPC_USER) String rpcUser,
@Named(DaoOptionKeys.RPC_PASSWORD) String rpcPassword,
@Named(DaoOptionKeys.RPC_BLOCK_NOTIFICATION_PORT) String rpcBlockNotificationPort) { |
<<<<<<<
if (!isMakeProposalScreen)
uidTextField = addLabelTextField(gridPane, ++gridRow, Res.getWithCol("shared.id")).second;
nameTextField = addInputTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.name"));
=======
nameTextField = addLabelInputTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.name")).second;
>>>>>>>
nameTextField = addInputTextField(gridPane, ++gridRow, Res.get("dao.proposal.display.name"));
<<<<<<<
// TODO validator, addressTF
bsqAddressTextField = addInputTextField(gridPane, ++gridRow,
Res.get("dao.proposal.display.bsqAddress"));
checkNotNull(bsqAddressTextField, "bsqAddressTextField must not be null");
bsqAddressTextField.setText("B" + bsqWalletService.getUnusedAddress().toBase58());
bsqAddressTextField.setValidator(new BsqAddressValidator(bsqFormatter));
inputControls.add(bsqAddressTextField);
=======
>>>>>>>
<<<<<<<
paramComboBox = FormBuilder.<Param>addComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.paramComboBox.label"));
=======
paramComboBox = FormBuilder.<Param>addLabelComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.paramComboBox.label")).second;
comboBoxValueTextFieldIndex = gridRow;
>>>>>>>
paramComboBox = FormBuilder.<Param>addComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.paramComboBox.label"));
comboBoxValueTextFieldIndex = gridRow;
<<<<<<<
paramValueTextField = addInputTextField(gridPane, ++gridRow,
Res.get("dao.proposal.display.paramValue"));
//noinspection ConstantConditions
=======
paramValueTextField = addLabelInputTextField(gridPane, ++gridRow,
Res.get("dao.proposal.display.paramValue")).second;
>>>>>>>
paramValueTextField = addInputTextField(gridPane, ++gridRow,
Res.get("dao.proposal.display.paramValue"));
<<<<<<<
bondedRoleTypeComboBox = FormBuilder.<BondedRoleType>addComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.bondedRoleComboBox.label"));
=======
bondedRoleTypeComboBox = FormBuilder.<BondedRoleType>addLabelComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.bondedRoleComboBox.label")).second;
comboBoxValueTextFieldIndex = gridRow;
>>>>>>>
bondedRoleTypeComboBox = FormBuilder.<BondedRoleType>addComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.bondedRoleComboBox.label"));
comboBoxValueTextFieldIndex = gridRow;
<<<<<<<
confiscateBondComboBox = FormBuilder.<BondedRole>addComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.confiscateBondComboBox.label"));
=======
confiscateBondComboBox = FormBuilder.<BondedRole>addLabelComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.confiscateBondComboBox.label")).second;
comboBoxValueTextFieldIndex = gridRow;
>>>>>>>
confiscateBondComboBox = FormBuilder.<BondedRole>addComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.confiscateBondComboBox.label"));
comboBoxValueTextFieldIndex = gridRow;
<<<<<<<
assetComboBox = FormBuilder.<Asset>addComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.assetComboBox.label"));
=======
assetComboBox = FormBuilder.<Asset>addLabelComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.assetComboBox.label")).second;
comboBoxValueTextFieldIndex = gridRow;
>>>>>>>
assetComboBox = FormBuilder.<Asset>addComboBox(gridPane, ++gridRow,
Res.getWithCol("dao.proposal.display.assetComboBox.label"));
comboBoxValueTextFieldIndex = gridRow; |
<<<<<<<
// Backwards compatibility
protected Activiti5CompatibilityHandlerFactory activiti5CompatibilityHandlerFactory;
protected Activiti5CompatibilityHandler activiti5CompatibilityHandler;
// buildProcessEngine
// ///////////////////////////////////////////////////////
=======
/**
* Define a max length for storing String variable types in the database.
* Mainly used for the Oracle NVARCHAR2 limit of 2000 characters
*/
protected int maxLengthStringVariableType = 4000;
// buildProcessEngine ///////////////////////////////////////////////////////
>>>>>>>
/**
* Define a max length for storing String variable types in the database.
* Mainly used for the Oracle NVARCHAR2 limit of 2000 characters
*/
protected int maxLengthStringVariableType = 4000;
// Backwards compatibility
protected Activiti5CompatibilityHandlerFactory activiti5CompatibilityHandlerFactory;
protected Activiti5CompatibilityHandler activiti5CompatibilityHandler;
// buildProcessEngine
// ///////////////////////////////////////////////////////
<<<<<<<
}
public Activiti5CompatibilityHandlerFactory getActiviti5CompatibilityHandlerFactory() {
return activiti5CompatibilityHandlerFactory;
}
public void setActiviti5CompatibilityHandlerFactory(Activiti5CompatibilityHandlerFactory activiti5CompatibilityHandlerFactory) {
this.activiti5CompatibilityHandlerFactory = activiti5CompatibilityHandlerFactory;
}
public Activiti5CompatibilityHandler getActiviti5CompatibilityHandler() {
return activiti5CompatibilityHandler;
}
public void setActiviti5CompatibilityHandler(Activiti5CompatibilityHandler activiti5CompatibilityHandler) {
this.activiti5CompatibilityHandler = activiti5CompatibilityHandler;
}
=======
}
public int getMaxLengthStringVariableType() {
return maxLengthStringVariableType;
}
public ProcessEngineConfigurationImpl setMaxLengthStringVariableType(int maxLengthStringVariableType) {
this.maxLengthStringVariableType = maxLengthStringVariableType;
return this;
}
>>>>>>>
}
public int getMaxLengthStringVariableType() {
return maxLengthStringVariableType;
}
public ProcessEngineConfigurationImpl setMaxLengthStringVariableType(int maxLengthStringVariableType) {
this.maxLengthStringVariableType = maxLengthStringVariableType;
return this;
}
public Activiti5CompatibilityHandlerFactory getActiviti5CompatibilityHandlerFactory() {
return activiti5CompatibilityHandlerFactory;
}
public void setActiviti5CompatibilityHandlerFactory(Activiti5CompatibilityHandlerFactory activiti5CompatibilityHandlerFactory) {
this.activiti5CompatibilityHandlerFactory = activiti5CompatibilityHandlerFactory;
}
public Activiti5CompatibilityHandler getActiviti5CompatibilityHandler() {
return activiti5CompatibilityHandler;
}
public void setActiviti5CompatibilityHandler(Activiti5CompatibilityHandler activiti5CompatibilityHandler) {
this.activiti5CompatibilityHandler = activiti5CompatibilityHandler;
} |
<<<<<<<
public class JMSFilter implements ClusterBroadcastFilter {
private static final String JMS_TOPIC = JMSBroadcaster.class.getName() + ".topic";
private static final String JNDI_NAMESPACE = JMSBroadcaster.class.getName() + ".JNDINamespace";
private static final String JNDI_FACTORY_NAME = JMSBroadcaster.class.getName() + ".JNDIConnectionFactoryName";
private static final String JNDI_TOPIC = JMSBroadcaster.class.getName() + ".JNDITopic";
=======
public class JMSFilter implements MessageListener,ClusterBroadcastFilter {
private static final Logger logger = LoggerFactory.getLogger(JMSFilter.class);
>>>>>>>
public class JMSFilter implements ClusterBroadcastFilter {
private static final String JMS_TOPIC = JMSBroadcaster.class.getName() + ".topic";
private static final String JNDI_NAMESPACE = JMSBroadcaster.class.getName() + ".JNDINamespace";
private static final String JNDI_FACTORY_NAME = JMSBroadcaster.class.getName() + ".JNDIConnectionFactoryName";
private static final String JNDI_TOPIC = JMSBroadcaster.class.getName() + ".JNDITopic";
private static final Logger logger = LoggerFactory.getLogger(JMSFilter.class);
private Connection connection;
private Session session;
private MessageConsumer consumer;
private MessageProducer publisher;
private String topicId = "atmosphere";
private String factoryName = "atmosphereFactory";
private String namespace = "jms/";
private String clusterName;
private Broadcaster bc = null;
<<<<<<<
=======
}
catch (JMSException ex) {
logger.warn("failed to publish message", ex);
>>>>>>>
<<<<<<<
public Broadcaster getBroadcaster() {
=======
@Override
public Broadcaster getBroadcaster(){
>>>>>>>
@Override
public Broadcaster getBroadcaster(){
<<<<<<<
public void setBroadcaster(Broadcaster bc) {
=======
@Override
public void setBroadcaster(Broadcaster bc){
>>>>>>>
@Override
public void setBroadcaster(Broadcaster bc){ |
<<<<<<<
// Wicket only.
private final static String APPLICATION_NAME = "applicationClassName";
=======
private static final Logger logger = LoggerFactory.getLogger(ReflectorServletProcessor.class);
>>>>>>>
private final static String APPLICATION_NAME = "applicationClassName";
private static final Logger logger = LoggerFactory.getLogger(ReflectorServletProcessor.class); |
<<<<<<<
RESIZER_FACTORY("resizerFactory"),
=======
ALLOW_OVERWRITE("allowOverwrite"),
>>>>>>>
RESIZER_FACTORY("resizerFactory"),
ALLOW_OVERWRITE("allowOverwrite"),
<<<<<<<
statusMap.put(Properties.RESIZER_FACTORY, Status.OPTIONAL);
=======
statusMap.put(Properties.ALLOW_OVERWRITE, Status.OPTIONAL);
>>>>>>>
statusMap.put(Properties.RESIZER_FACTORY, Status.OPTIONAL);
statusMap.put(Properties.ALLOW_OVERWRITE, Status.OPTIONAL); |
<<<<<<<
/**
* Test for the {@link ThumbnailParameterBuilder#build()} method, where
* <ol>
* <li>Where resizer is called with a specific Resizer</li>
* </ol>
* and the expected outcome is,
* <ol>
* <li>A ThumbnailParameter will contain the specified Resizer.</li>
* </ol>
*/
@Test
public void build_calledResizer_returnsGivenResizer()
{
ThumbnailParameter param = new ThumbnailParameterBuilder()
.scale(0.5)
.resizer(Resizers.BICUBIC)
.build();
assertEquals(Resizers.BICUBIC, param.getResizer());
}
/**
* Test for the {@link ThumbnailParameterBuilder#build()} method, where
* <ol>
* <li>Where resizer is called with a specific Resizer</li>
* </ol>
* and the expected outcome is,
* <ol>
* <li>A ThumbnailParameter will contain a ResizerFactory which will return
* the specified Resizer.</li>
* </ol>
*/
@Test
public void build_calledResizer_returnedResizerFactoryReturnsResizer()
{
ThumbnailParameter param = new ThumbnailParameterBuilder()
.scale(0.5)
.resizer(Resizers.BICUBIC)
.build();
assertEquals(Resizers.BICUBIC, param.getResizerFactory().getResizer());
}
/**
* Test for the {@link ThumbnailParameterBuilder#build()} method, where
* <ol>
* <li>Where resizerFactory is called with a specific ResizerFactory</li>
* </ol>
* and the expected outcome is,
* <ol>
* <li>A ThumbnailParameter will contain the specified ResizerFactory.</li>
* </ol>
*/
@Test
public void build_calledResizerFactory()
{
ResizerFactory rf = new ResizerFactory() {
public Resizer getResizer(Dimension arg0, Dimension arg1)
{
return null;
}
public Resizer getResizer()
{
return null;
}
};
ThumbnailParameter param = new ThumbnailParameterBuilder()
.scale(0.5)
.resizerFactory(rf)
.build();
assertEquals(rf, param.getResizerFactory());
}
=======
@Test
public void build_OnlyScaleTwoArg()
{
// given, when
ThumbnailParameter param =
new ThumbnailParameterBuilder().scale(0.6, 0.4).build();
// then
assertEquals(null, param.getSize());
assertTrue(Double.compare(0.6, param.getWidthScalingFactor()) == 0);
assertTrue(Double.compare(0.4, param.getHeightScalingFactor()) == 0);
assertEquals(ThumbnailParameter.ORIGINAL_FORMAT, param.getOutputFormat());
assertEquals(ThumbnailParameter.DEFAULT_FORMAT_TYPE, param.getOutputFormatType());
assertTrue(Float.isNaN(param.getOutputQuality()));
assertEquals(Resizers.PROGRESSIVE, param.getResizer());
assertEquals(ThumbnailParameter.DEFAULT_IMAGE_TYPE, param.getType());
assertEquals(Collections.emptyList(), param.getImageFilters());
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_NaN_Valid()
{
new ThumbnailParameterBuilder().scale(Double.NaN, 0.4).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_Valid_NaN()
{
new ThumbnailParameterBuilder().scale(0.6, Double.NaN).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_NaN_NaN()
{
new ThumbnailParameterBuilder().scale(Double.NaN, Double.NaN).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_PositiveInfinity_Valid()
{
new ThumbnailParameterBuilder().scale(Double.POSITIVE_INFINITY, 0.4).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_Valid_PositiveInfinity()
{
new ThumbnailParameterBuilder().scale(0.6, Double.POSITIVE_INFINITY).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_PositiveInfinity_PositiveInfinity()
{
new ThumbnailParameterBuilder().scale(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_NegativeInfinity_Valid()
{
new ThumbnailParameterBuilder().scale(Double.NEGATIVE_INFINITY, 0.4).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_Valid_NegativeInfinity()
{
new ThumbnailParameterBuilder().scale(0.6, Double.NEGATIVE_INFINITY).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_NegativeInfinity_NegativeInfinity()
{
new ThumbnailParameterBuilder().scale(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY).build();
fail();
}
>>>>>>>
@Test
public void build_OnlyScaleTwoArg()
{
// given, when
ThumbnailParameter param =
new ThumbnailParameterBuilder().scale(0.6, 0.4).build();
// then
assertEquals(null, param.getSize());
assertTrue(Double.compare(0.6, param.getWidthScalingFactor()) == 0);
assertTrue(Double.compare(0.4, param.getHeightScalingFactor()) == 0);
assertEquals(ThumbnailParameter.ORIGINAL_FORMAT, param.getOutputFormat());
assertEquals(ThumbnailParameter.DEFAULT_FORMAT_TYPE, param.getOutputFormatType());
assertTrue(Float.isNaN(param.getOutputQuality()));
assertEquals(Resizers.PROGRESSIVE, param.getResizer());
assertEquals(ThumbnailParameter.DEFAULT_IMAGE_TYPE, param.getType());
assertEquals(Collections.emptyList(), param.getImageFilters());
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_NaN_Valid()
{
new ThumbnailParameterBuilder().scale(Double.NaN, 0.4).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_Valid_NaN()
{
new ThumbnailParameterBuilder().scale(0.6, Double.NaN).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_NaN_NaN()
{
new ThumbnailParameterBuilder().scale(Double.NaN, Double.NaN).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_PositiveInfinity_Valid()
{
new ThumbnailParameterBuilder().scale(Double.POSITIVE_INFINITY, 0.4).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_Valid_PositiveInfinity()
{
new ThumbnailParameterBuilder().scale(0.6, Double.POSITIVE_INFINITY).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_PositiveInfinity_PositiveInfinity()
{
new ThumbnailParameterBuilder().scale(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_NegativeInfinity_Valid()
{
new ThumbnailParameterBuilder().scale(Double.NEGATIVE_INFINITY, 0.4).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_Valid_NegativeInfinity()
{
new ThumbnailParameterBuilder().scale(0.6, Double.NEGATIVE_INFINITY).build();
fail();
}
@Test(expected=IllegalArgumentException.class)
public void build_OnlyScaleTwoArg_NegativeInfinity_NegativeInfinity()
{
new ThumbnailParameterBuilder().scale(Double.NEGATIVE_INFINITY, Double.NEGATIVE_INFINITY).build();
fail();
}
/**
* Test for the {@link ThumbnailParameterBuilder#build()} method, where
* <ol>
* <li>Where resizer is called with a specific Resizer</li>
* </ol>
* and the expected outcome is,
* <ol>
* <li>A ThumbnailParameter will contain the specified Resizer.</li>
* </ol>
*/
@Test
public void build_calledResizer_returnsGivenResizer()
{
ThumbnailParameter param = new ThumbnailParameterBuilder()
.scale(0.5)
.resizer(Resizers.BICUBIC)
.build();
assertEquals(Resizers.BICUBIC, param.getResizer());
}
/**
* Test for the {@link ThumbnailParameterBuilder#build()} method, where
* <ol>
* <li>Where resizer is called with a specific Resizer</li>
* </ol>
* and the expected outcome is,
* <ol>
* <li>A ThumbnailParameter will contain a ResizerFactory which will return
* the specified Resizer.</li>
* </ol>
*/
@Test
public void build_calledResizer_returnedResizerFactoryReturnsResizer()
{
ThumbnailParameter param = new ThumbnailParameterBuilder()
.scale(0.5)
.resizer(Resizers.BICUBIC)
.build();
assertEquals(Resizers.BICUBIC, param.getResizerFactory().getResizer());
}
/**
* Test for the {@link ThumbnailParameterBuilder#build()} method, where
* <ol>
* <li>Where resizerFactory is called with a specific ResizerFactory</li>
* </ol>
* and the expected outcome is,
* <ol>
* <li>A ThumbnailParameter will contain the specified ResizerFactory.</li>
* </ol>
*/
@Test
public void build_calledResizerFactory()
{
ResizerFactory rf = new ResizerFactory() {
public Resizer getResizer(Dimension arg0, Dimension arg1)
{
return null;
}
public Resizer getResizer()
{
return null;
}
};
ThumbnailParameter param = new ThumbnailParameterBuilder()
.scale(0.5)
.resizerFactory(rf)
.build();
assertEquals(rf, param.getResizerFactory());
} |
<<<<<<<
private static final int CLUSTER_SIZE = 3;
@ClassRule
public static final MesosCluster CLUSTER = new MesosCluster(
MesosClusterConfig.builder()
.slaveResources(new String[]{"ports(*):[9200-9200,9300-9300]", "ports(*):[9201-9201,9301-9301]", "ports(*):[9202-9202,9302-9302]"})
.build()
);
=======
private static final org.apache.mesos.elasticsearch.systemtest.Configuration TEST_CONFIG = new org.apache.mesos.elasticsearch.systemtest.Configuration();
>>>>>>>
private static final int CLUSTER_SIZE = 3;
@ClassRule
public static final MesosCluster CLUSTER = new MesosCluster(
MesosClusterConfig.builder()
.slaveResources(new String[]{"ports(*):[9200-9200,9300-9300]", "ports(*):[9201-9201,9301-9301]", "ports(*):[9202-9202,9302-9302]"})
.build()
);
private static final org.apache.mesos.elasticsearch.systemtest.Configuration TEST_CONFIG = new org.apache.mesos.elasticsearch.systemtest.Configuration();
<<<<<<<
=======
LOGGER.debug("Injecting executor");
CLUSTER.injectImage(TEST_CONFIG.getExecutorImageName());
>>>>>>> |
<<<<<<<
=======
private Protos.ExecutorInfo.Builder newExecutorInfo(Configuration configuration) {
//this creates and assigns a unique id to an elastic search node
long lElasticSearchNodeId = configuration.getExternalVolumeDriver() != null && configuration.getExternalVolumeDriver().length() > 0 ?
clusterState.getElasticNodeId() : ExecutorEnvironmentalVariables.EXTERNAL_VOLUME_NOT_CONFIGURED;
LOGGER.debug("Elastic Search Node Id: " + lElasticSearchNodeId);
Protos.ExecutorInfo.Builder executorInfoBuilder = Protos.ExecutorInfo.newBuilder()
.setExecutorId(Protos.ExecutorID.newBuilder().setValue(UUID.randomUUID().toString()))
.setFrameworkId(frameworkState.getFrameworkID())
.setName("elasticsearch-executor-" + UUID.randomUUID().toString())
.setCommand(newCommandInfo(configuration, lElasticSearchNodeId));
if (configuration.isFrameworkUseDocker()) {
Protos.ContainerInfo.DockerInfo.Builder containerBuilder = Protos.ContainerInfo.DockerInfo.newBuilder()
.setImage(configuration.getExecutorImage())
.setForcePullImage(configuration.getExecutorForcePullImage())
.setNetwork(Protos.ContainerInfo.DockerInfo.Network.HOST);
Protos.Volume.Mode configMode = Protos.Volume.Mode.RO;
//this should generically work for all Docker Volume drivers to enable
//external storage
if (configuration.getExternalVolumeDriver() != null && configuration.getExternalVolumeDriver().length() > 0) {
LOGGER.debug("Is Docker Container and External Driver enabled");
//containerBuilder.setPrivileged(true);
configMode = Protos.Volume.Mode.RW;
//docker external volume driver
LOGGER.debug("Docker Driver: " + configuration.getExternalVolumeDriver());
//note: this makes a unique configuration volume name per elastic search node
StringBuffer sbConfig = new StringBuffer(configuration.getFrameworkName());
sbConfig.append(Long.toString(lElasticSearchNodeId));
sbConfig.append("config:");
sbConfig.append(CONTAINER_PATH_SETTINGS);
String sHostPathOrExternalVolumeForConfig = sbConfig.toString();
LOGGER.debug("Config Volume Name: " + sHostPathOrExternalVolumeForConfig);
//note: this makes a unique data volume name per elastic search node
StringBuffer sbData = new StringBuffer(configuration.getFrameworkName());
sbData.append(Long.toString(lElasticSearchNodeId));
sbData.append("data:");
sbData.append(CONTAINER_DATA_VOLUME);
String sHostPathOrExternalVolumeForData = sbData.toString();
LOGGER.debug("Data Volume Name: " + sHostPathOrExternalVolumeForData);
containerBuilder.addParameters(Protos.Parameter.newBuilder()
.setKey("volume-driver")
.setValue(configuration.getExternalVolumeDriver()));
containerBuilder.addParameters(Protos.Parameter.newBuilder()
.setKey("volume")
.setValue(sHostPathOrExternalVolumeForConfig));
containerBuilder.addParameters(Protos.Parameter.newBuilder()
.setKey("volume")
.setValue(sHostPathOrExternalVolumeForData));
executorInfoBuilder.setContainer(Protos.ContainerInfo.newBuilder()
.setType(Protos.ContainerInfo.Type.DOCKER)
.setDocker(containerBuilder)
.build())
.addResources(Resources.cpus(configuration.getExecutorCpus(), configuration.getFrameworkRole()))
.addResources(Resources.mem(configuration.getExecutorMem(), configuration.getFrameworkRole()))
;
} else {
executorInfoBuilder.setContainer(Protos.ContainerInfo.newBuilder()
.setType(Protos.ContainerInfo.Type.DOCKER)
.setDocker(containerBuilder)
.addVolumes(Protos.Volume.newBuilder().setHostPath(CONTAINER_PATH_SETTINGS).setContainerPath(CONTAINER_PATH_SETTINGS).setMode(configMode)) // Temporary fix until we get a data container.
.addVolumes(Protos.Volume.newBuilder().setHostPath(configuration.getDataDir()).setContainerPath(CONTAINER_DATA_VOLUME).setMode(Protos.Volume.Mode.RW).build())
.build())
.addResources(Resources.cpus(configuration.getExecutorCpus(), configuration.getFrameworkRole()))
.addResources(Resources.mem(configuration.getExecutorMem(), configuration.getFrameworkRole()))
;
}
}
return executorInfoBuilder;
}
private Protos.CommandInfo.Builder newCommandInfo(Configuration configuration, long lNodeId) {
ExecutorEnvironmentalVariables executorEnvironmentalVariables = new ExecutorEnvironmentalVariables(configuration, lNodeId);
List<String> args = new ArrayList<>();
addIfNotEmpty(args, ElasticsearchCLIParameter.ELASTICSEARCH_SETTINGS_LOCATION, configuration.getElasticsearchSettingsLocation());
addIfNotEmpty(args, ElasticsearchCLIParameter.ELASTICSEARCH_CLUSTER_NAME, configuration.getElasticsearchClusterName());
args.addAll(asList(ElasticsearchCLIParameter.ELASTICSEARCH_NODES, Integer.toString(configuration.getElasticsearchNodes())));
List<Protos.TaskInfo> taskList = clusterState.getTaskList();
String hostAddress = "";
if (taskList.size() > 0) {
Protos.TaskInfo taskInfo = taskList.get(0);
String taskId = taskInfo.getTaskId().getValue();
InetSocketAddress transportAddress = clusterState.getGuiTaskList().get(taskId).getTransportAddress();
hostAddress = NetworkUtils.addressToString(transportAddress, configuration.getIsUseIpAddress()).replace("http://", "");
}
addIfNotEmpty(args, HostsCLIParameter.ELASTICSEARCH_HOST, hostAddress);
Protos.CommandInfo.Builder commandInfoBuilder = Protos.CommandInfo.newBuilder()
.setEnvironment(Protos.Environment.newBuilder().addAllVariables(executorEnvironmentalVariables.getList()));
if (configuration.isFrameworkUseDocker()) {
commandInfoBuilder
.setShell(false)
.addAllArguments(args)
.setContainer(Protos.CommandInfo.ContainerInfo.newBuilder().setImage(configuration.getExecutorImage()).build());
} else {
String address = configuration.getFrameworkFileServerAddress();
if (address == null) {
throw new NullPointerException("Webserver address is null");
}
String httpPath = address + "/get/" + Configuration.ES_EXECUTOR_JAR;
LOGGER.debug("Using file server: " + httpPath);
commandInfoBuilder
.setValue(configuration.getJavaHome() + "java $JAVA_OPTS -jar ./" + Configuration.ES_EXECUTOR_JAR)
.addAllArguments(args)
.addUris(Protos.CommandInfo.URI.newBuilder().setValue(httpPath));
}
return commandInfoBuilder;
}
private void addIfNotEmpty(List<String> args, String key, String value) {
if (!value.isEmpty()) {
args.addAll(asList(key, value));
}
}
>>>>>>> |
<<<<<<<
HttpResponse<JsonNode> response = Unirest.get(tasksEndPoint).asJson();
for (int i = 0; i < response.getBody().getArray().length(); i++) {
JSONObject jsonObject = response.getBody().getArray().getJSONObject(i);
=======
final AtomicReference<HttpResponse<JsonNode>> response = new AtomicReference<>();
Awaitility.await().atMost(30, TimeUnit.SECONDS).pollInterval(1, TimeUnit.SECONDS).until(() -> { // This can take some time, somtimes.
try {
response.set(Unirest.get(tasksEndPoint).asJson());
return true;
} catch (UnirestException e) {
LOGGER.debug(e);
return false;
}
});
for (int i = 0; i < response.get().getBody().getArray().length(); i++) {
JSONObject jsonObject = response.get().getBody().getArray().getJSONObject(i);
// If the ports are exposed on the docker adaptor, then force the http_address's to point to the docker adaptor IP address.
// This is a nasty hack, much like `if (testing) doSomething();`. This means we are no longer testing a
// real-life network setup.
if (portsExposed) {
String oldAddress = (String) jsonObject.remove(HTTP_ADDRESS);
String newAddress = dockerHostAddress
+ ":" + oldAddress.split(":")[1];
jsonObject.put(HTTP_ADDRESS, newAddress);
}
>>>>>>>
final AtomicReference<HttpResponse<JsonNode>> response = new AtomicReference<>();
Awaitility.await().atMost(30, TimeUnit.SECONDS).pollInterval(1, TimeUnit.SECONDS).until(() -> { // This can take some time, somtimes.
try {
response.set(Unirest.get(tasksEndPoint).asJson());
return true;
} catch (UnirestException e) {
LOGGER.debug(e);
return false;
}
});
for (int i = 0; i < response.get().getBody().getArray().length(); i++) {
JSONObject jsonObject = response.get().getBody().getArray().getJSONObject(i);
// If the ports are exposed on the docker adaptor, then force the http_address's to point to the docker adaptor IP address.
// This is a nasty hack, much like `if (testing) doSomething();`. This means we are no longer testing a
// real-life network setup.
if (portsExposed) {
String oldAddress = (String) jsonObject.remove(HTTP_ADDRESS);
String newAddress = dockerHostAddress
+ ":" + oldAddress.split(":")[1];
jsonObject.put(HTTP_ADDRESS, newAddress);
}
HttpResponse<JsonNode> response = Unirest.get(tasksEndPoint).asJson();
for (int i = 0; i < response.getBody().getArray().length(); i++) {
JSONObject jsonObject = response.getBody().getArray().getJSONObject(i); |
<<<<<<<
assertEquals("mesos/elasticsearch-executor", taskInfo.getExecutor().getContainer().getDocker().getImage());
assertEquals(1, taskInfo.getExecutor().getContainer().getVolumesCount());
assertEquals("/data", taskInfo.getExecutor().getContainer().getVolumes(0).getContainerPath());
assertEquals("/var/lib/elasticsearch", taskInfo.getExecutor().getContainer().getVolumes(0).getHostPath());
assertEquals(Protos.Volume.Mode.RW, taskInfo.getExecutor().getContainer().getVolumes(0).getMode());
=======
assertEquals(Configuration.DEFAULT_EXECUTOR_IMAGE, taskInfo.getExecutor().getContainer().getDocker().getImage());
>>>>>>>
assertEquals(Configuration.DEFAULT_EXECUTOR_IMAGE, taskInfo.getExecutor().getContainer().getDocker().getImage());
assertEquals("mesos/elasticsearch-executor", taskInfo.getExecutor().getContainer().getDocker().getImage());
assertEquals(1, taskInfo.getExecutor().getContainer().getVolumesCount());
assertEquals("/data", taskInfo.getExecutor().getContainer().getVolumes(0).getContainerPath());
assertEquals("/var/lib/elasticsearch", taskInfo.getExecutor().getContainer().getVolumes(0).getHostPath());
assertEquals(Protos.Volume.Mode.RW, taskInfo.getExecutor().getContainer().getVolumes(0).getMode()); |
<<<<<<<
private ClusterMonitor clusterMonitor = null;
private Observable statusUpdateWatchers = new StatusUpdateObservable();
private Boolean registered = false;
private ClusterState clusterState;
OfferStrategy offerStrategy;
private SchedulerDriver schedulerDriver;
public ElasticsearchScheduler(Configuration configuration, TaskInfoFactory taskInfoFactory) {
=======
public ElasticsearchScheduler(Configuration configuration, FrameworkState frameworkState, ClusterState clusterState, TaskInfoFactory taskInfoFactory, OfferStrategy offerStrategy, SerializableState zookeeperStateDriver) {
>>>>>>>
private SchedulerDriver schedulerDriver;
public ElasticsearchScheduler(Configuration configuration, FrameworkState frameworkState, ClusterState clusterState, TaskInfoFactory taskInfoFactory, OfferStrategy offerStrategy, SerializableState zookeeperStateDriver) {
<<<<<<<
this.schedulerDriver = driver;
FrameworkState frameworkState = new FrameworkState(configuration.getState());
frameworkState.setFrameworkId(frameworkId);
configuration.setFrameworkState(frameworkState); // DCOS certification 02
=======
>>>>>>>
this.schedulerDriver = driver;
<<<<<<<
/**
* Implementation of Observable to fix the setChanged problem.
*/
private static class StatusUpdateObservable extends Observable {
@Override
public void notifyObservers(Object arg) {
this.setChanged(); // This is ridiculous.
super.notifyObservers(arg);
}
}
=======
>>>>>>> |
<<<<<<<
public void updateSlackNotification(String ProjectId, String token, String slackNotificationId, String channel, String filterBranchName, Boolean enabled, BuildState buildState, boolean buildTypeAll, boolean buildSubProjects, Set<String> buildTypesEnabled, boolean mentionChannelEnabled, boolean mentionSlackUserEnabled, SlackNotificationContentConfig content) {
=======
public void updateSlackNotification(String ProjectId, String token, String slackNotificationId, String channel, Boolean enabled, BuildState buildState, boolean buildTypeAll, boolean buildSubProjects, Set<String> buildTypesEnabled, boolean mentionChannelEnabled, boolean mentionSlackUserEnabled, boolean mentionHereEnabled, boolean mentionWhoTriggeredEnabled, SlackNotificationContentConfig content) {
>>>>>>>
public void updateSlackNotification(String ProjectId, String token, String slackNotificationId, String channel, String filterBranchName, Boolean enabled, BuildState buildState, boolean buildTypeAll, boolean buildSubProjects, Set<String> buildTypesEnabled, boolean mentionChannelEnabled, boolean mentionSlackUserEnabled, boolean mentionHereEnabled, boolean mentionWhoTriggeredEnabled, SlackNotificationContentConfig content) {
<<<<<<<
public void addNewSlackNotification(String ProjectId, String token, String channel, String teamName, String filterBranchName, Boolean enabled, BuildState buildState, boolean buildTypeAll, boolean buildTypeSubProjects, Set<String> buildTypesEnabled, boolean mentionChannelEnabled, boolean mentionSlackUserEnabled) {
this.slackNotificationsConfigs.add(new SlackNotificationConfig(token, channel, teamName, filterBranchName, enabled, buildState, buildTypeAll, buildTypeSubProjects, buildTypesEnabled, mentionChannelEnabled, mentionSlackUserEnabled));
=======
public void addNewSlackNotification(String ProjectId, String token, String channel, String teamName, Boolean enabled, BuildState buildState, boolean buildTypeAll, boolean buildTypeSubProjects, Set<String> buildTypesEnabled, boolean mentionChannelEnabled, boolean mentionSlackUserEnabled, boolean mentionHereEnabled, boolean mentionWhoTriggeredEnabled) {
this.slackNotificationsConfigs.add(new SlackNotificationConfig(token, channel, teamName, enabled, buildState, buildTypeAll, buildTypeSubProjects, buildTypesEnabled, mentionChannelEnabled, mentionSlackUserEnabled, mentionHereEnabled, mentionWhoTriggeredEnabled));
>>>>>>>
public void addNewSlackNotification(String ProjectId, String token, String channel, String teamName, String filterBranchName, Boolean enabled, BuildState buildState, boolean buildTypeAll, boolean buildTypeSubProjects, Set<String> buildTypesEnabled, boolean mentionChannelEnabled, boolean mentionSlackUserEnabled, boolean mentionHereEnabled, boolean mentionWhoTriggeredEnabled) {
this.slackNotificationsConfigs.add(new SlackNotificationConfig(token, channel, teamName, filterBranchName, enabled, buildState, buildTypeAll, buildTypeSubProjects, buildTypesEnabled, mentionChannelEnabled, mentionSlackUserEnabled, mentionHereEnabled, mentionWhoTriggeredEnabled)); |
<<<<<<<
SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true);
=======
SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true, true, true);
>>>>>>>
SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), true, true, null, true, true, true, true);
<<<<<<<
SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), false, false, enabledBuildTypes, true, true);
=======
SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", true, new BuildState().setAllEnabled(), false, false, enabledBuildTypes, true, true, true, true);
>>>>>>>
SlackNotificationConfig newBlankConfig = new SlackNotificationConfig("", "", "", "", true, new BuildState().setAllEnabled(), false, false, enabledBuildTypes, true, true, true, true); |
<<<<<<<
private static final String TOKEN = "token";
private static final String DEFAULT_CHANNEL = "defaultChannel";
private static final String ICON_URL = "iconurl";
private static final String BOT_NAME = "botname";
private static final String SHOW_BUILD_AGENT = "showBuildAgent";
private static final String SHOW_COMMITS = "showCommits";
private static final String SHOW_COMMITTERS = "showCommitters";
private static final String SHOW_FAILURE_REASON = "showFailureReason";
private static final String MAX_COMMITS_TO_DISPLAY = "maxCommitsToDisplay";
private static final String SHOW_ELAPSED_BUILD_TIME = "showElapsedBuildTime";
=======
private static final String HTTPS = "https://";
private static final String HTTP = "http://";
private static final String PROXY = "proxy";
private static final String USERNAME = "username";
private static final String PASSWORD = "password";
private static final String ENABLED = "enabled";
private static final String TEAM_NAME = "teamName";
>>>>>>>
private static final String TOKEN = "token";
private static final String DEFAULT_CHANNEL = "defaultChannel";
private static final String ICON_URL = "iconurl";
private static final String BOT_NAME = "botname";
private static final String SHOW_BUILD_AGENT = "showBuildAgent";
private static final String SHOW_COMMITS = "showCommits";
private static final String SHOW_COMMITTERS = "showCommitters";
private static final String SHOW_FAILURE_REASON = "showFailureReason";
private static final String MAX_COMMITS_TO_DISPLAY = "maxCommitsToDisplay";
private static final String SHOW_ELAPSED_BUILD_TIME = "showElapsedBuildTime";
private static final String HTTPS = "https://";
private static final String HTTP = "http://";
private static final String PROXY = "proxy";
private static final String USERNAME = "username";
private static final String PASSWORD = "password";
private static final String ENABLED = "enabled";
private static final String TEAM_NAME = "teamName";
<<<<<<<
rootElement.setAttribute("enabled", Boolean.toString(SlackNotificationMainConfig.this.enabled));
rootElement.setAttribute("teamName", emptyIfNull(SlackNotificationMainConfig.this.teamName));
rootElement.setAttribute(DEFAULT_CHANNEL, emptyIfNull(SlackNotificationMainConfig.this.defaultChannel));
rootElement.setAttribute("teamName", emptyIfNull(SlackNotificationMainConfig.this.teamName));
rootElement.setAttribute(TOKEN, emptyIfNull(SlackNotificationMainConfig.this.token));
rootElement.setAttribute(ICON_URL, emptyIfNull(SlackNotificationMainConfig.this.content.getIconUrl()));
rootElement.setAttribute(BOT_NAME, emptyIfNull(SlackNotificationMainConfig.this.content.getBotName()));
=======
rootElement.setAttribute(ENABLED, Boolean.toString(SlackNotificationMainConfig.this.enabled));
rootElement.setAttribute(TEAM_NAME, emptyIfNull(SlackNotificationMainConfig.this.teamName));
rootElement.setAttribute("defaultChannel", emptyIfNull(SlackNotificationMainConfig.this.defaultChannel));
rootElement.setAttribute(TEAM_NAME, emptyIfNull(SlackNotificationMainConfig.this.teamName));
rootElement.setAttribute("token", emptyIfNull(SlackNotificationMainConfig.this.token));
rootElement.setAttribute("iconurl", emptyIfNull(SlackNotificationMainConfig.this.content.getIconUrl()));
rootElement.setAttribute("botname", emptyIfNull(SlackNotificationMainConfig.this.content.getBotName()));
>>>>>>>
rootElement.setAttribute("enabled", Boolean.toString(SlackNotificationMainConfig.this.enabled));
rootElement.setAttribute(TEAM_NAME, emptyIfNull(SlackNotificationMainConfig.this.teamName));
rootElement.setAttribute(DEFAULT_CHANNEL, emptyIfNull(SlackNotificationMainConfig.this.defaultChannel));
rootElement.setAttribute(TEAM_NAME, emptyIfNull(SlackNotificationMainConfig.this.teamName));
rootElement.setAttribute(TOKEN, emptyIfNull(SlackNotificationMainConfig.this.token));
rootElement.setAttribute(ICON_URL, emptyIfNull(SlackNotificationMainConfig.this.content.getIconUrl()));
rootElement.setAttribute(BOT_NAME, emptyIfNull(SlackNotificationMainConfig.this.content.getBotName()));
rootElement.setAttribute(ENABLED, Boolean.toString(SlackNotificationMainConfig.this.enabled));
rootElement.setAttribute(TEAM_NAME, emptyIfNull(SlackNotificationMainConfig.this.teamName));
rootElement.setAttribute("defaultChannel", emptyIfNull(SlackNotificationMainConfig.this.defaultChannel));
rootElement.setAttribute(TEAM_NAME, emptyIfNull(SlackNotificationMainConfig.this.teamName));
rootElement.setAttribute("token", emptyIfNull(SlackNotificationMainConfig.this.token));
rootElement.setAttribute("iconurl", emptyIfNull(SlackNotificationMainConfig.this.content.getIconUrl()));
rootElement.setAttribute("botname", emptyIfNull(SlackNotificationMainConfig.this.content.getBotName())); |
<<<<<<<
private String filterBranchName;
=======
private boolean showTriggeredBy;
>>>>>>>
private String filterBranchName;
private boolean showTriggeredBy; |
<<<<<<<
import static org.junit.Assert.*;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
=======
>>>>>>>
import static org.junit.Assert.*;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
<<<<<<<
import org.junit.*;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
=======
import org.junit.*;
>>>>>>>
import org.junit.*;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
<<<<<<<
import slacknotifications.teamcity.settings.SlackNotificationConfig;
=======
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import static org.mockito.Matchers.isA;
import static org.mockito.Mockito.*;
>>>>>>>
import slacknotifications.teamcity.settings.SlackNotificationConfig; |
<<<<<<<
filterBranchName = request.getParameter("filterBranchName");
=======
showTriggeredBy = request.getParameter("showTriggeredBy");
>>>>>>>
filterBranchName = request.getParameter("filterBranchName");
showTriggeredBy = request.getParameter("showTriggeredBy");
<<<<<<<
Boolean.parseBoolean(showElapsedBuildTime), Boolean.parseBoolean(showBuildAgent),
Boolean.parseBoolean(showCommits), Boolean.parseBoolean(showCommitters), filterBranchName, Boolean.parseBoolean(showFailureReason),
=======
Boolean.parseBoolean(showElapsedBuildTime),
Boolean.parseBoolean(showBuildAgent),
Boolean.parseBoolean(showCommits),
Boolean.parseBoolean(showCommitters),
Boolean.parseBoolean(showTriggeredBy),
Boolean.parseBoolean(showFailureReason),
>>>>>>>
Boolean.parseBoolean(showElapsedBuildTime),
Boolean.parseBoolean(showBuildAgent),
Boolean.parseBoolean(showCommits),
Boolean.parseBoolean(showCommitters),
filterBranchName,
Boolean.parseBoolean(showTriggeredBy),
Boolean.parseBoolean(showFailureReason),
<<<<<<<
notification.setFilterBranchName(branchName);
=======
notification.setShowTriggeredBy(showTriggeredBy);
>>>>>>>
notification.setFilterBranchName(branchName);
notification.setShowTriggeredBy(showTriggeredBy);
<<<<<<<
this.config.setFilterBranchName(filterBranchName);
=======
this.config.getContent().setShowTriggeredBy(Boolean.parseBoolean(showTriggeredBy));
>>>>>>>
this.config.setFilterBranchName(filterBranchName);
this.config.getContent().setShowTriggeredBy(Boolean.parseBoolean(showTriggeredBy)); |
<<<<<<<
SlackNotificationConfig config = new SlackNotificationConfig("", "#general", "teamName", "<default>", true, buildState, true, true, null, true, true);
=======
SlackNotificationConfig config = new SlackNotificationConfig("", "#general", "teamName", true, buildState, true, true, null, true, true, true, true);
>>>>>>>
SlackNotificationConfig config = new SlackNotificationConfig("", "#general", "teamName", "<default>", true, buildState, true, true, null, true, true, true, true);
<<<<<<<
projSettings.addNewSlackNotification("", "project1", "my-channel", "myteam", "", true, state, true, true, new HashSet<String>(), true, true);
=======
projSettings.addNewSlackNotification("", "project1", "my-channel", "myteam", true, state, true, true, new HashSet<String>(), true, true, true, true);
>>>>>>>
projSettings.addNewSlackNotification("", "project1", "my-channel", "myteam", "", true, state, true, true, new HashSet<String>(), true, true, true, true);
<<<<<<<
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", "", true, state , true, true, new HashSet<String>(), true, true);
=======
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", true, state , true, true, new HashSet<String>(), true, true, true, true);
>>>>>>>
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", "", true, state , true, true, new HashSet<String>(), true, true, true, true);
<<<<<<<
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", null, true, state, true, true, new HashSet<String>(), true, true);
=======
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", true, state, true, true, new HashSet<String>(), true, true, true, true);
>>>>>>>
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", null, true, state, true, true, new HashSet<String>(), true, true, true, true);
<<<<<<<
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", null, true, state, true, true, new HashSet<String>(), true, true);
=======
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", true, state, true, true, new HashSet<String>(), true, true, true, true);
>>>>>>>
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", null, true, state, true, true, new HashSet<String>(), true, true, true, true);
<<<<<<<
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", null, true, state, true, true, new HashSet<String>(), true, true);
=======
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", true, state, true, true, new HashSet<String>(), true, true, true, true);
>>>>>>>
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", null, true, state, true, true, new HashSet<String>(), true, true, true, true);
<<<<<<<
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", null, true, state, true, true, new HashSet<String>(), true, true);
=======
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", true, state, true, true, new HashSet<String>(), true, true, true, true);
>>>>>>>
projSettings.addNewSlackNotification("", "1234", "my-channel", "myteam", null, true, state, true, true, new HashSet<String>(), true, true, true, true); |
<<<<<<<
slackNotification.setFilterBranchName(slackNotificationConfig.getFilterBranchName());
=======
slackNotification.setShowTriggeredBy(myMainSettings.getShowTriggeredBy());
>>>>>>>
slackNotification.setFilterBranchName(slackNotificationConfig.getFilterBranchName());
slackNotification.setShowTriggeredBy(myMainSettings.getShowTriggeredBy()); |
<<<<<<<
SlackNotification notification = controller.createMockNotification("the team", "#general", "The Bot", "tokenthingy",
SlackNotificationMainConfig.DEFAULT_ICONURL, 5, true, true, true, true, "master", true, null, null, null, null);
=======
SlackNotification notification = controller.createMockNotification(
"the team",
"#general",
"The Bot",
"tokenthingy",
SlackNotificationMainConfig.DEFAULT_ICONURL,
5,
true,
true,
true,
true,
true,
true,
null, null, null, null);
>>>>>>>
SlackNotification notification = controller.createMockNotification(
"the team",
"#general",
"The Bot",
"tokenthingy",
SlackNotificationMainConfig.DEFAULT_ICONURL,
5,
true,
true,
true,
true,
"master",
true,
true,
null, null, null, null); |
<<<<<<<
import static org.junit.Assert.assertTrue;
=======
import org.junit.contrib.java.lang.system.EnvironmentVariables;
>>>>>>>
import static org.junit.Assert.assertTrue;
import org.junit.contrib.java.lang.system.EnvironmentVariables; |
<<<<<<<
List<String> platformServers =
ResolverConfiguration.open().nameservers();
=======
List platformServers = filterNameServers(
ResolverConfiguration.open().nameservers(), false);
>>>>>>>
List<String> platformServers = filterNameServers(
ResolverConfiguration.open().nameservers(), false); |
<<<<<<<
import sun.awt.SunToolkit;
=======
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
>>>>>>>
import sun.java2d.pipe.hw.ExtendedBufferCapabilities;
import sun.awt.SunToolkit; |
<<<<<<<
ProcessRuntimeConfiguration configuration,
ApplicationEventPublisher eventPublisher,
List<ProcessRuntimeEventListener<ProcessUpdatedEvent>> processUpdatedListeners) {
=======
ProcessRuntimeConfiguration configuration
) {
>>>>>>>
ProcessRuntimeConfiguration configuration,
ApplicationEventPublisher eventPublisher) {
<<<<<<<
this.eventPublisher = eventPublisher;
this.processUpdatedListeners=processUpdatedListeners;
=======
>>>>>>>
this.eventPublisher = eventPublisher; |
<<<<<<<
public class NoAccessException extends ReflectiveOperationException {
=======
public class NoAccessException extends RuntimeException {
private static final long serialVersionUID = 292L;
>>>>>>>
public class NoAccessException extends ReflectiveOperationException {
private static final long serialVersionUID = 292L; |
<<<<<<<
import de.fhg.iais.roberta.factory.BotNrollFactory;
import de.fhg.iais.roberta.util.test.Helper;
=======
import de.fhg.iais.roberta.util.test.ardu.Helper;
>>>>>>>
import de.fhg.iais.roberta.factory.BotNrollFactory;
import de.fhg.iais.roberta.util.test.ardu.Helper;
<<<<<<<
BotNrollFactory robotFactory = new BotNrollFactory(null);
@Before
public void setUp() throws Exception {
this.h.setRobotFactory(this.robotFactory);
}
=======
>>>>>>>
BotNrollFactory robotFactory = new BotNrollFactory(null);
@Before
public void setUp() throws Exception {
this.h.setRobotFactory(this.robotFactory);
} |
<<<<<<<
import de.fhg.iais.roberta.factory.BotNrollFactory;
import de.fhg.iais.roberta.util.test.Helper;
=======
import de.fhg.iais.roberta.util.test.ardu.Helper;
>>>>>>>
import de.fhg.iais.roberta.factory.BotNrollFactory;
import de.fhg.iais.roberta.util.test.ardu.Helper;
<<<<<<<
BotNrollFactory robotFactory = new BotNrollFactory(null);
@Before
public void setUp() throws Exception {
this.h.setRobotFactory(this.robotFactory);
}
=======
>>>>>>>
BotNrollFactory robotFactory = new BotNrollFactory(null);
@Before
public void setUp() throws Exception {
this.h.setRobotFactory(this.robotFactory);
} |
<<<<<<<
log.info("hd monitor address will sync path {} ,index {}, {}", pathType, addressIndex, hdAccountAddress.getAddress());
=======
// TODO
List<Tx> transactions;
while (needGetTxs) {
BitherMytransactionsApi bitherMytransactionsApi = new BitherMytransactionsApi(
hdAccountAddress.getAddress(), page, webType);
bitherMytransactionsApi.handleHttpGet();
String txResult = bitherMytransactionsApi.getResult();
JSONObject jsonObject = new JSONObject(txResult);
// TODO: get data from bither.net else from blockchain.info
if (webType == 0) {
if (!jsonObject.isNull(BLOCK_COUNT)) {
apiBlockCount = jsonObject.getInt(BLOCK_COUNT);
}
int txCnt = jsonObject.getInt(TX_CNT);
// TODO: HDAccount
transactions = TransactionsUtil.getTransactionsFromBither(jsonObject, storeBlockHeight);
transactions = AddressManager.getInstance().compressTxsForHDAccount(transactions);
Collections.sort(transactions, new ComparatorTx());
// address.initTxs(transactions);
AddressManager.getInstance().getHDAccountMonitored().initTxs(transactions);
txSum = txSum + transactions.size();
needGetTxs = transactions.size() > 0;
page++;
}else {
// TODO: get the latest block number from blockChain.info
JSONObject jsonObjectBlockChain = getLatestBlockNumberFromBlockchain();
if (!jsonObjectBlockChain.isNull(BLOCK_CHAIN_HEIGHT)) {
apiBlockCount = jsonObjectBlockChain.getInt(BLOCK_CHAIN_HEIGHT);
}
int txCnt = jsonObject.getInt(BLOCK_CHAIN_CNT);
// TODO: get transactions from blockChain.info
transactions = TransactionsUtil.getTransactionsFromBlockChain(jsonObject, storeBlockHeight);
transactions = AddressManager.getInstance().compressTxsForHDAccount(transactions);
Collections.sort(transactions, new ComparatorTx());
// address.initTxs(transactions);
AddressManager.getInstance().getHDAccountMonitored().initTxs(transactions);
txSum = txSum + transactions.size();
needGetTxs = false;
}
}
/*
>>>>>>>
log.info("hd monitor address will sync path {} ,index {}, {}", pathType, addressIndex, hdAccountAddress.getAddress());
while (needGetTxs) {
BitherMytransactionsApi bitherMytransactionsApi = new BitherMytransactionsApi(
hdAccountAddress.getAddress(), page, webType);
bitherMytransactionsApi.handleHttpGet();
String txResult = bitherMytransactionsApi.getResult();
JSONObject jsonObject = new JSONObject(txResult);
// TODO: get data from bither.net else from blockchain.info
if (webType == 0) {
if (!jsonObject.isNull(BLOCK_COUNT)) {
apiBlockCount = jsonObject.getInt(BLOCK_COUNT);
}
int txCnt = jsonObject.getInt(TX_CNT);
// TODO: HDAccount
transactions = TransactionsUtil.getTransactionsFromBither(jsonObject, storeBlockHeight);
transactions = AddressManager.getInstance().compressTxsForHDAccount(transactions);
Collections.sort(transactions, new ComparatorTx());
// address.initTxs(transactions);
AddressManager.getInstance().getHDAccountMonitored().initTxs(transactions);
txSum = txSum + transactions.size();
needGetTxs = transactions.size() > 0;
page++;
}else {
// TODO: get the latest block number from blockChain.info
JSONObject jsonObjectBlockChain = getLatestBlockNumberFromBlockchain();
if (!jsonObjectBlockChain.isNull(BLOCK_CHAIN_HEIGHT)) {
apiBlockCount = jsonObjectBlockChain.getInt(BLOCK_CHAIN_HEIGHT);
}
int txCnt = jsonObject.getInt(BLOCK_CHAIN_CNT);
// TODO: get transactions from blockChain.info
transactions = TransactionsUtil.getTransactionsFromBlockChain(jsonObject, storeBlockHeight);
transactions = AddressManager.getInstance().compressTxsForHDAccount(transactions);
Collections.sort(transactions, new ComparatorTx());
// address.initTxs(transactions);
AddressManager.getInstance().getHDAccountMonitored().initTxs(transactions);
txSum = txSum + transactions.size();
needGetTxs = false;
}
}
/*
<<<<<<<
log.info("hd address will sync path {} ,index {}, {}", pathType, addressIndex, hdAccountAddress.getAddress());
=======
// TODO
List<Tx> transactions;
while (needGetTxs) {
BitherMytransactionsApi bitherMytransactionsApi = new BitherMytransactionsApi(
hdAccountAddress.getAddress(), page, webType);
bitherMytransactionsApi.handleHttpGet();
String txResult = bitherMytransactionsApi.getResult();
JSONObject jsonObject = new JSONObject(txResult);
// TODO: get data from bither.net else from blockchain.info
if (webType == 0) {
if (!jsonObject.isNull(BLOCK_COUNT)) {
apiBlockCount = jsonObject.getInt(BLOCK_COUNT);
}
int txCnt = jsonObject.getInt(TX_CNT);
transactions = TransactionsUtil.getTransactionsFromBither(jsonObject, storeBlockHeight);
transactions = AddressManager.getInstance().compressTxsForHDAccount(transactions);
Collections.sort(transactions, new ComparatorTx());
// address.initTxs(transactions);
AddressManager.getInstance().getHDAccountHot().initTxs(transactions);
txSum = txSum + transactions.size();
needGetTxs = transactions.size() > 0;
page++;
}else {
// TODO: get the latest block number from blockChain.info
JSONObject jsonObjectBlockChain = getLatestBlockNumberFromBlockchain();
if (!jsonObjectBlockChain.isNull(BLOCK_CHAIN_HEIGHT)) {
apiBlockCount = jsonObjectBlockChain.getInt(BLOCK_CHAIN_HEIGHT);
}
int txCnt = jsonObject.getInt(BLOCK_CHAIN_CNT);
// TODO: get transactions from blockChain.info
transactions = TransactionsUtil.getTransactionsFromBlockChain(jsonObject, storeBlockHeight);
transactions = AddressManager.getInstance().compressTxsForHDAccount(transactions);
Collections.sort(transactions, new ComparatorTx());
// address.initTxs(transactions);
AddressManager.getInstance().getHDAccountHot().initTxs(transactions);
txSum = txSum + transactions.size();
needGetTxs = false;
}
}
/*
>>>>>>>
// TODO
List<Tx> transactions;
log.info("hd address will sync path {} ,index {}, {}", pathType, addressIndex, hdAccountAddress.getAddress());
while (needGetTxs) {
BitherMytransactionsApi bitherMytransactionsApi = new BitherMytransactionsApi(
hdAccountAddress.getAddress(), page, webType);
bitherMytransactionsApi.handleHttpGet();
String txResult = bitherMytransactionsApi.getResult();
JSONObject jsonObject = new JSONObject(txResult);
// TODO: get data from bither.net else from blockchain.info
if (webType == 0) {
if (!jsonObject.isNull(BLOCK_COUNT)) {
apiBlockCount = jsonObject.getInt(BLOCK_COUNT);
}
int txCnt = jsonObject.getInt(TX_CNT);
transactions = TransactionsUtil.getTransactionsFromBither(jsonObject, storeBlockHeight);
transactions = AddressManager.getInstance().compressTxsForHDAccount(transactions);
Collections.sort(transactions, new ComparatorTx());
// address.initTxs(transactions);
AddressManager.getInstance().getHDAccountHot().initTxs(transactions);
txSum = txSum + transactions.size();
needGetTxs = transactions.size() > 0;
page++;
}else {
// TODO: get the latest block number from blockChain.info
JSONObject jsonObjectBlockChain = getLatestBlockNumberFromBlockchain();
if (!jsonObjectBlockChain.isNull(BLOCK_CHAIN_HEIGHT)) {
apiBlockCount = jsonObjectBlockChain.getInt(BLOCK_CHAIN_HEIGHT);
}
int txCnt = jsonObject.getInt(BLOCK_CHAIN_CNT);
// TODO: get transactions from blockChain.info
transactions = TransactionsUtil.getTransactionsFromBlockChain(jsonObject, storeBlockHeight);
transactions = AddressManager.getInstance().compressTxsForHDAccount(transactions);
Collections.sort(transactions, new ComparatorTx());
// address.initTxs(transactions);
AddressManager.getInstance().getHDAccountHot().initTxs(transactions);
txSum = txSum + transactions.size();
needGetTxs = false;
}
}
/* |
<<<<<<<
=======
private static final String EXTRA_USER_ACTION_TRACE = "cat.ereza.customactivityoncrash.EXTRA_USER_ACTION_TRACE";
private static final String EXTRA_IMAGE_DRAWABLE_ID = "cat.ereza.customactivityoncrash.EXTRA_IMAGE_DRAWABLE_ID";
private static final String EXTRA_EVENT_LISTENER = "cat.ereza.customactivityoncrash.EXTRA_EVENT_LISTENER";
>>>>>>>
private static final String EXTRA_USER_ACTION_TRACE = "cat.ereza.customactivityoncrash.EXTRA_USER_ACTION_TRACE";
<<<<<<<
intent.putExtra(EXTRA_CONFIG, config);
=======
intent.putExtra(EXTRA_USER_ACTION_TRACE, userLogString);
intent.putExtra(EXTRA_RESTART_ACTIVITY_CLASS, restartActivityClass);
intent.putExtra(EXTRA_SHOW_ERROR_DETAILS, showErrorDetails);
intent.putExtra(EXTRA_EVENT_LISTENER, eventListener);
intent.putExtra(EXTRA_IMAGE_DRAWABLE_ID, defaultErrorActivityDrawableId);
>>>>>>>
intent.putExtra(EXTRA_USER_ACTION_TRACE, userLogString);
intent.putExtra(EXTRA_CONFIG, config);
<<<<<<<
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
int currentlyStartedActivities = 0;
=======
if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
int currentlyStartedActivities = 0;
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
@Override
public void onActivityCreated(Activity activity, Bundle savedInstanceState) {
if (activity.getClass() != errorActivityClass) {
// Copied from ACRA:
// Ignore activityClass because we want the last
// application Activity that was started so that we can
// explicitly kill it off.
lastActivityCreated = new WeakReference<>(activity);
}
userLogs.add(dateFormat.format(new Date())+ " " + activity.getLocalClassName() + " created\n");
}
>>>>>>>
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
int currentlyStartedActivities = 0;
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US);
<<<<<<<
@Override
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
//Do nothing
}
=======
@Override
public void onActivityDestroyed(Activity activity) {
userLogs.add(dateFormat.format(new Date())+ " " + activity.getLocalClassName() + " destroyed\n");
}
});
}
>>>>>>>
@Override
public void onActivitySaveInstanceState(Activity activity, Bundle outState) {
//Do nothing
} |
<<<<<<<
import io.searchbox.cloning.CloneUtils;
=======
import io.searchbox.annotations.JestVersion;
>>>>>>>
import io.searchbox.cloning.CloneUtils;
import io.searchbox.annotations.JestVersion;
<<<<<<<
JsonObject copy = (JsonObject)CloneUtils.deepClone(source);
if (addEsMetadataIdField) {
=======
JsonObject copy = GsonUtils.deepCopy(source);
if (addEsMetadataFields) {
>>>>>>>
JsonObject copy = (JsonObject)CloneUtils.deepClone(source);
if (addEsMetadataFields) {
<<<<<<<
JsonElement copy = (JsonElement)CloneUtils.deepClone(obj);
JsonElement objId = jsonObject.get("_id");
if ((objId != null) && copy.isJsonObject() && addEsMetadataIdField) {
copy.getAsJsonObject().add(ES_METADATA_ID, objId);
=======
JsonElement copy = GsonUtils.deepCopy(obj);
if (addEsMetadataFields && copy.isJsonObject()) {
JsonElement objId = jsonObject.get("_id");
if (objId != null) {
copy.getAsJsonObject().add(ES_METADATA_ID, objId);
}
JsonElement objVersion = jsonObject.get("_version");
if (objVersion != null) {
copy.getAsJsonObject().add(ES_METADATA_VERSION, objVersion);
}
>>>>>>>
JsonElement copy = (JsonElement)CloneUtils.deepClone(obj);
if (addEsMetadataFields && copy.isJsonObject()) {
JsonElement objId = jsonObject.get("_id");
if (objId != null) {
copy.getAsJsonObject().add(ES_METADATA_ID, objId);
}
JsonElement objVersion = jsonObject.get("_version");
if (objVersion != null) {
copy.getAsJsonObject().add(ES_METADATA_VERSION, objVersion);
} |
<<<<<<<
import io.searchbox.client.config.ElasticsearchVersion;
=======
import io.searchbox.strings.StringUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
>>>>>>>
import io.searchbox.client.config.ElasticsearchVersion;
import io.searchbox.strings.StringUtils;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
<<<<<<<
protected String buildURI(ElasticsearchVersion elasticsearchVersion) {
String uriSuffix = super.buildURI(elasticsearchVersion);
=======
protected String buildURI() {
String uriSuffix = super.buildURI();
try {
if (!StringUtils.isBlank(nodes)) {
uriSuffix += URLEncoder.encode(nodes, CHARSET);
}
} catch (UnsupportedEncodingException e) {
log.error("Error occurred while adding nodes to uri", e);
}
>>>>>>>
protected String buildURI(ElasticsearchVersion elasticsearchVersion) {
String uriSuffix = super.buildURI(elasticsearchVersion);
try {
if (!StringUtils.isBlank(nodes)) {
uriSuffix += URLEncoder.encode(nodes, CHARSET);
}
} catch (UnsupportedEncodingException e) {
log.error("Error occurred while adding nodes to uri", e);
} |
<<<<<<<
=======
import org.apache.cassandra.db.commitlog.CommitLog;
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.db.marshal.BytesType;
import org.apache.cassandra.db.marshal.CounterColumnType;
>>>>>>>
import org.apache.cassandra.db.marshal.CounterColumnType; |
<<<<<<<
public static final Builder all (Class<? extends Component>... componentTypes) {
return builder.reset().all(componentTypes);
=======
public static Builder all (Class<? extends Component>... componentTypes) {
return builder.all(componentTypes);
>>>>>>>
public static final Builder all (Class<? extends Component>... componentTypes) {
return builder.all(componentTypes);
<<<<<<<
public static final Builder one (Class<? extends Component>... componentTypes) {
return builder.reset().one(componentTypes);
=======
public static Builder one (Class<? extends Component>... componentTypes) {
return builder.one(componentTypes);
>>>>>>>
public static final Builder one (Class<? extends Component>... componentTypes) {
return builder.one(componentTypes);
<<<<<<<
public static final Builder exclude (Class<? extends Component>... componentTypes) {
return builder.reset().exclude(componentTypes);
=======
public static Builder exclude (Class<? extends Component>... componentTypes) {
return builder.exclude(componentTypes);
>>>>>>>
public static final Builder exclude (Class<? extends Component>... componentTypes) {
return builder.exclude(componentTypes);
<<<<<<<
public final Builder all (Class<? extends Component>... componentTypes) {
all = ComponentType.getBitsFor(componentTypes);
=======
public Builder all (Class<? extends Component>... componentTypes) {
Bits bits = ComponentType.getBitsFor(componentTypes);
bits.or(all);
all = bits;
>>>>>>>
public final Builder all (Class<? extends Component>... componentTypes) {
Bits bits = ComponentType.getBitsFor(componentTypes);
bits.or(all);
all = bits;
<<<<<<<
public final Builder one (Class<? extends Component>... componentTypes) {
one = ComponentType.getBitsFor(componentTypes);
=======
public Builder one (Class<? extends Component>... componentTypes) {
Bits bits = ComponentType.getBitsFor(componentTypes);
bits.or(one);
one = bits;
>>>>>>>
public final Builder one (Class<? extends Component>... componentTypes) {
Bits bits = ComponentType.getBitsFor(componentTypes);
bits.or(one);
one = bits;
<<<<<<<
public final Builder exclude (Class<? extends Component>... componentTypes) {
exclude = ComponentType.getBitsFor(componentTypes);
=======
public Builder exclude (Class<? extends Component>... componentTypes) {
Bits bits = ComponentType.getBitsFor(componentTypes);
bits.or(exclude);
exclude = bits;
>>>>>>>
public final Builder exclude (Class<? extends Component>... componentTypes) {
Bits bits = ComponentType.getBitsFor(componentTypes);
bits.or(exclude);
exclude = bits; |
<<<<<<<
=======
static long obtainId() {
return nextId++;
}
/**
* @return true if the entity is scheduled to be removed
*/
public boolean isScheduledForRemoval() {
return scheduledForRemoval;
}
>>>>>>>
/**
* @return true if the entity is scheduled to be removed
*/
public boolean isScheduledForRemoval() {
return scheduledForRemoval;
} |
<<<<<<<
/**
* @return the simulator ProductVersion for the corresponding SDKVersion (i.e. "7.0.3" for "7.0")
*/
public static String getSimulatorProductVersion(String sdkVersion) {
List<String> c = new ArrayList<>();
c.add("xcodebuild");
c.add("-version");
c.add("-sdk");
Command com = new Command(c, false);
SimulatorProductVersionParser l = new SimulatorProductVersionParser(sdkVersion);
com.registerListener(l);
com.executeAndWait();
return l.getProductVersion();
}
}
class SimulatorProductVersionParser implements CommandOutputListener {
// gets ProductVersion by parsing:
// iPhoneSimulator7.0.sdk - Simulator - iOS 7.0 (iphonesimulator7.0)
// SDKVersion: 7.0
// Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
// PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
// ProductBuildVersion: 11B508
// ProductCopyright: 1983-2013 Apple Inc.
// ProductName: iPhone OS
// ProductVersion: 7.0.3
private final String sdkVersion;
private String productVersion;
private boolean inSdkVersion;
SimulatorProductVersionParser(String sdkVersion) {
this.sdkVersion = sdkVersion;
}
String getProductVersion() {
if (productVersion == null)
throw new WebDriverException("couldn't find simulator product version for " + sdkVersion);
return productVersion;
}
@Override
public void stdout(String line) {
ClassicCommands.log.fine(line);
// SDKVersion: 7.0
if (line.startsWith("SDKVersion:")) {
String version = line.substring(12).trim();
inSdkVersion = sdkVersion.equals(version);
}
if (inSdkVersion) {
// ProductVersion: 7.0.3
if (line.startsWith("ProductVersion:"))
productVersion = line.substring(16).trim();
}
}
@Override
public void stderr(String line) {
ClassicCommands.log.warning(line);
}
=======
>>>>>>>
/**
* @return the simulator ProductVersion for the corresponding SDKVersion (i.e. "7.0.3" for "7.0")
*/
public static String getSimulatorProductVersion(String sdkVersion) {
List<String> c = new ArrayList<>();
c.add("xcodebuild");
c.add("-version");
c.add("-sdk");
Command com = new Command(c, false);
SimulatorProductVersionParser l = new SimulatorProductVersionParser(sdkVersion);
com.registerListener(l);
com.executeAndWait();
return l.getProductVersion();
}
}
class SimulatorProductVersionParser implements CommandOutputListener {
// gets ProductVersion by parsing:
// iPhoneSimulator7.0.sdk - Simulator - iOS 7.0 (iphonesimulator7.0)
// SDKVersion: 7.0
// Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk
// PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
// ProductBuildVersion: 11B508
// ProductCopyright: 1983-2013 Apple Inc.
// ProductName: iPhone OS
// ProductVersion: 7.0.3
private final String sdkVersion;
private String productVersion;
private boolean inSdkVersion;
SimulatorProductVersionParser(String sdkVersion) {
this.sdkVersion = sdkVersion;
}
String getProductVersion() {
if (productVersion == null)
throw new WebDriverException("couldn't find simulator product version for " + sdkVersion);
return productVersion;
}
@Override
public void stdout(String line) {
ClassicCommands.log.fine(line);
// SDKVersion: 7.0
if (line.startsWith("SDKVersion:")) {
String version = line.substring(12).trim();
inSdkVersion = sdkVersion.equals(version);
}
if (inSdkVersion) {
// ProductVersion: 7.0.3
if (line.startsWith("ProductVersion:"))
productVersion = line.substring(16).trim();
}
}
@Override
public void stderr(String line) {
ClassicCommands.log.warning(line);
} |
<<<<<<<
ContentResult result = results.get(0);
String addressL10ned = result.getL10nFormatted();
Criteria
ios6address =
new AndCriteria(new TypeCriteria(UIAElement.class), new NameCriteria(addressL10ned),
new LabelCriteria(addressL10ned));
Criteria
ios7address =
new AndCriteria(new TypeCriteria(UIAButton.class));
Criteria c2 = ios7address;//;new OrCriteria(ios6address,ios7address);
script.append("var addressBar = root.element(-1," + c2.stringify().toString() + ");");
script.append("var addressBarSize = addressBar.rect();");
script.append("var delta = addressBarSize.origin.y +39;");
script.append("if (delta<20){delta=20;};");
script.append("var y = top+delta;");
=======
>>>>>>> |
<<<<<<<
import org.uiautomation.ios.server.utils.JSTemplate;
=======
import org.uiautomation.ios.server.services.InstrumentsAppleScreenshotService;
import org.uiautomation.ios.server.services.TakeScreenshotService;
>>>>>>>
import org.uiautomation.ios.server.services.InstrumentsAppleScreenshotService;
import org.uiautomation.ios.server.services.TakeScreenshotService;
import org.uiautomation.ios.server.utils.JSTemplate;
<<<<<<<
private static final JSTemplate template = new JSTemplate(
"var root = UIAutomation.cache.get('%:reference$s');" +
"var result = root.tree(%:attachScreenshot$b);" +
"UIAutomation.createJSONResponse('%:sessionId$s',0,result);",
"sessionId", "reference", "attachScreenshot");
=======
private static final String jsTemplate = "var root = UIAutomation.cache.get(':reference');"
+ "var result = root.tree(:attachScreenshot);"
+ "UIAutomation.createJSONResponse(':sessionId',0,result);";
private static final String SCREEN_NAME = "tmpScreenshot";
>>>>>>>
private static final JSTemplate template = new JSTemplate(
"var root = UIAutomation.cache.get('%:reference$s');" +
"var result = root.tree(%:attachScreenshot$b);" +
"UIAutomation.createJSONResponse('%:sessionId$s',0,result);",
"sessionId", "reference", "attachScreenshot");
private static final String SCREEN_NAME = "tmpScreenshot"; |
<<<<<<<
import org.uiautomation.ios.server.services.IOSDualDriver;
=======
import org.uiautomation.ios.server.instruments.communication.CommunicationChannel;
import org.uiautomation.ios.server.instruments.InstrumentsManager;
import org.uiautomation.ios.server.logging.IOSLogManager;
import org.uiautomation.ios.server.utils.IOSVersion;
>>>>>>>
import org.uiautomation.ios.server.logging.IOSLogManager;
import org.uiautomation.ios.server.services.IOSDualDriver;
<<<<<<<
=======
import java.util.ArrayList;
import java.util.Timer;
import java.util.TimerTask;
>>>>>>>
<<<<<<<
return url;
=======
}
public boolean hasCrashed() {
return sessionCrashed;
}
public void sessionHasCrashed(String log) {
sessionCrashed = true;
applicationCrashDetails = new ApplicationCrashDetails(log);
}
public ApplicationCrashDetails getCrashDetails() {
return applicationCrashDetails;
}
public void restartWebkit() {
int currentPageID = webDriver.getCurrentPageID();
webDriver.stop();
webDriver = new RemoteIOSWebDriver(this, new AlertDetector(nativeDriver));
webDriver.switchTo(String.valueOf(currentPageID));
}
public IOSServerManager getIOSServerManager() {
return driver;
>>>>>>>
return url; |
<<<<<<<
// TODO freynaud. 2 windows doesn't mean 2 pages ...
int delta = getSession().getRemoteWebDriver().getWindowHandleIndexDifference(pageId);
=======
// TODO freynaud. 2 windows doesnt mean 2 pages ...
int delta = getWebDriver().getWindowHandleIndexDifference(pageId);
>>>>>>>
// TODO freynaud. 2 windows doesn't mean 2 pages ...
int delta = getWebDriver().getWindowHandleIndexDifference(pageId); |
<<<<<<<
final SliceReferenceFieldProcessor sliceReferenceFieldProcessor,
final ChildrenFieldProcessor childrenFieldProcessor) {
=======
final SliceReferenceFieldProcessor sliceReferenceFieldProcessor,
final ListFieldProcessor listFieldProcessor) {
>>>>>>>
final SliceReferenceFieldProcessor sliceReferenceFieldProcessor,
final ListFieldProcessor listFieldProcessor, final ChildrenFieldProcessor childrenFieldProcessor) {
<<<<<<<
this.childrenFieldProcessor = childrenFieldProcessor;
=======
this.listFieldProcessor = listFieldProcessor;
>>>>>>>
this.listFieldProcessor = listFieldProcessor;
this.childrenFieldProcessor = childrenFieldProcessor;
<<<<<<<
mapper.registerFieldProcessor(childrenFieldProcessor);
=======
mapper.registerFieldProcessor(listFieldProcessor);
>>>>>>>
mapper.registerFieldProcessor(childrenFieldProcessor);
mapper.registerFieldProcessor(listFieldProcessor); |
<<<<<<<
=======
modules.add(new ContextModule());
modules.add(new SliceResourceModule(bundleContext, bundleNameFilter, basePackage));
>>>>>>>
modules.add(new ContextModule()); |
<<<<<<<
package com.cognifide.slice.api.tag;
/*-
* #%L
* Slice - Core API
* $Id:$
* $HeadURL:$
* %%
* Copyright (C) 2012 Cognifide Limited
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import javax.servlet.ServletRequest;
import javax.servlet.jsp.PageContext;
import org.apache.commons.lang.StringUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.scripting.SlingBindings;
import org.apache.sling.api.scripting.SlingScriptHelper;
import com.cognifide.slice.api.context.ContextProvider;
import com.cognifide.slice.api.injector.InjectorWithContext;
import com.cognifide.slice.api.injector.InjectorsRepository;
import com.cognifide.slice.api.provider.ModelProvider;
import com.cognifide.slice.util.InjectorNameUtil;
public final class SliceTagUtils {
private final static String SLICE_INJECTOR_NAME = "SLICE_INJECTOR_NAME";
private SliceTagUtils() {
// hidden constructor
}
public static <T> T getFromCurrentPath(final SlingHttpServletRequest request,
final InjectorsRepository injectorsRepository, final ContextProvider contextProvider,
final Class<T> type) {
return getFromCurrentPath(request, injectorsRepository, contextProvider, type, null);
}
public static <T> T getFromCurrentPath(final PageContext pageContext, final Class<T> type) {
final SlingHttpServletRequest request = SliceTagUtils.slingRequestFrom(pageContext);
final InjectorsRepository injectorsRepository = SliceTagUtils.injectorsRepositoryFrom(pageContext);
final ContextProvider contextProvider = SliceTagUtils.contextProviderFrom(pageContext);
return getFromCurrentPath(request, injectorsRepository, contextProvider, type);
}
public static <T> T getFromCurrentPath(final SlingHttpServletRequest request,
final InjectorsRepository injectorsRepository, final ContextProvider contextProvider,
final Class<T> type, final String appName) {
final String injectorName = getInjectorName(request, appName);
if (StringUtils.isBlank(injectorName)) {
throw new IllegalStateException("Guice injector name not available");
} else {
request.setAttribute(SLICE_INJECTOR_NAME, injectorName);
}
if (null == contextProvider) {
throw new IllegalStateException("ContextProvider is not available");
}
final InjectorWithContext injector = injectorsRepository.getInjector(injectorName);
if (injector == null) {
throw new IllegalStateException("Guice injector not found: " + injectorName);
}
injector.pushContextProvider(contextProvider);
try {
final ModelProvider modelProvider = injector.getInstance(ModelProvider.class);
final Resource resource = request.getResource();
return (T) modelProvider.get(type, resource);
} finally {
injector.popContextProvider();
}
}
@SuppressWarnings("deprecation")
private static String getInjectorName(final SlingHttpServletRequest request, final String appName) {
String injectorName;
if (StringUtils.isNotBlank(appName)) {
injectorName = appName;
} else {
String cachedInjectorName = (String) request.getAttribute(SLICE_INJECTOR_NAME);
if (StringUtils.isNotBlank(cachedInjectorName)) {
injectorName = cachedInjectorName;
} else {
injectorName = InjectorNameUtil.getFromRequest(request);
}
}
return injectorName;
}
public static SlingHttpServletRequest slingRequestFrom(final PageContext pageContext) {
return (SlingHttpServletRequest) pageContext.getRequest();
}
public static ContextProvider contextProviderFrom(final PageContext pageContext) {
final SlingScriptHelper slingScriptHelper = getSlingScriptHelper(pageContext);
return slingScriptHelper.getService(ContextProvider.class);
}
public static InjectorsRepository injectorsRepositoryFrom(final PageContext pageContext) {
final SlingScriptHelper slingScriptHelper = getSlingScriptHelper(pageContext);
return slingScriptHelper.getService(InjectorsRepository.class);
}
private static SlingScriptHelper getSlingScriptHelper(final PageContext pageContext) {
ServletRequest request = pageContext.getRequest();
SlingBindings bindings = (SlingBindings) request.getAttribute(SlingBindings.class.getName());
return bindings.getSling();
}
}
=======
package com.cognifide.slice.api.tag;
/*-
* #%L Slice - Core API $Id:$ $HeadURL:$ %% Copyright (C) 2012 Cognifide Limited %% Licensed under the Apache
* License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You
* may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and limitations under the License. #L%
*/
import javax.servlet.ServletRequest;
import javax.servlet.jsp.PageContext;
import org.apache.commons.lang.StringUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.scripting.SlingBindings;
import org.apache.sling.api.scripting.SlingScriptHelper;
import com.cognifide.slice.api.context.ContextProvider;
import com.cognifide.slice.api.injector.InjectorWithContext;
import com.cognifide.slice.api.injector.InjectorsRepository;
import com.cognifide.slice.api.provider.ModelProvider;
import com.cognifide.slice.util.InjectorNameUtil;
public final class SliceTagUtils {
private SliceTagUtils() {
// hidden constructor
}
public static <T> T getFromCurrentPath(final SlingHttpServletRequest request,
final InjectorsRepository injectorsRepository, final ContextProvider contextProvider,
final Class<T> type) {
return getFromCurrentPath(request, injectorsRepository, contextProvider, type, null);
}
public static <T> T getFromCurrentPath(final PageContext pageContext, final Class<T> type) {
final SlingHttpServletRequest request = SliceTagUtils.slingRequestFrom(pageContext);
final InjectorsRepository injectorsRepository = SliceTagUtils.injectorsRepositoryFrom(pageContext);
final ContextProvider contextProvider = SliceTagUtils.contextProviderFrom(pageContext);
return SliceTagUtils.getFromCurrentPath(request, injectorsRepository, contextProvider, type);
}
public static <T> T getFromCurrentPath(final PageContext pageContext, final Class<T> type,
final String appName) {
final SlingHttpServletRequest request = SliceTagUtils.slingRequestFrom(pageContext);
final InjectorsRepository injectorsRepository = SliceTagUtils.injectorsRepositoryFrom(pageContext);
final ContextProvider contextProvider = SliceTagUtils.contextProviderFrom(pageContext);
return getFromCurrentPath(request, injectorsRepository, contextProvider, type, appName);
}
public static <T> T getFromCurrentPath(final SlingHttpServletRequest request,
final InjectorsRepository injectorsRepository, final ContextProvider contextProvider,
final Class<T> type, final String appName) {
final String applicationName = (appName != null) ? appName : InjectorNameUtil.getFromRequest(request);
if (StringUtils.isBlank(applicationName)) {
throw new IllegalStateException("Guice injector name not available");
}
if (null == contextProvider) {
throw new IllegalStateException("ContextProvider is not available");
}
final InjectorWithContext injector = injectorsRepository.getInjector(applicationName);
if (injector == null) {
throw new IllegalStateException("Guice injector not found: " + applicationName);
}
injector.pushContextProvider(contextProvider);
try {
final ModelProvider modelProvider = injector.getInstance(ModelProvider.class);
final Resource resource = request.getResource();
return (T) modelProvider.get(type, resource);
} finally {
injector.popContextProvider();
}
}
public static SlingHttpServletRequest slingRequestFrom(final PageContext pageContext) {
return (SlingHttpServletRequest) pageContext.getRequest();
}
public static ContextProvider contextProviderFrom(final PageContext pageContext) {
final SlingScriptHelper slingScriptHelper = getSlingScriptHelper(pageContext);
return slingScriptHelper.getService(ContextProvider.class);
}
public static InjectorsRepository injectorsRepositoryFrom(final PageContext pageContext) {
final SlingScriptHelper slingScriptHelper = getSlingScriptHelper(pageContext);
return slingScriptHelper.getService(InjectorsRepository.class);
}
private static SlingScriptHelper getSlingScriptHelper(final PageContext pageContext) {
ServletRequest request = pageContext.getRequest();
SlingBindings bindings = (SlingBindings) request.getAttribute(SlingBindings.class.getName());
return bindings.getSling();
}
}
>>>>>>>
package com.cognifide.slice.api.tag;
/*-
*
*
*/
import javax.servlet.ServletRequest;
import javax.servlet.jsp.PageContext;
import org.apache.commons.lang.StringUtils;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.api.scripting.SlingBindings;
import org.apache.sling.api.scripting.SlingScriptHelper;
import com.cognifide.slice.api.context.ContextProvider;
import com.cognifide.slice.api.injector.InjectorWithContext;
import com.cognifide.slice.api.injector.InjectorsRepository;
import com.cognifide.slice.api.provider.ModelProvider;
import com.cognifide.slice.util.InjectorNameUtil;
public final class SliceTagUtils {
private final static String SLICE_INJECTOR_NAME = "SLICE_INJECTOR_NAME";
private SliceTagUtils() {
// hidden constructor
}
public static <T> T getFromCurrentPath(final SlingHttpServletRequest request,
final InjectorsRepository injectorsRepository, final ContextProvider contextProvider,
final Class<T> type) {
return getFromCurrentPath(request, injectorsRepository, contextProvider, type, null);
}
public static <T> T getFromCurrentPath(final PageContext pageContext, final Class<T> type) {
final SlingHttpServletRequest request = SliceTagUtils.slingRequestFrom(pageContext);
final InjectorsRepository injectorsRepository = SliceTagUtils.injectorsRepositoryFrom(pageContext);
final ContextProvider contextProvider = SliceTagUtils.contextProviderFrom(pageContext);
return getFromCurrentPath(request, injectorsRepository, contextProvider, type);
}
public static <T> T getFromCurrentPath(final PageContext pageContext, final Class<T> type,
final String appName) {
final SlingHttpServletRequest request = SliceTagUtils.slingRequestFrom(pageContext);
final InjectorsRepository injectorsRepository = SliceTagUtils.injectorsRepositoryFrom(pageContext);
final ContextProvider contextProvider = SliceTagUtils.contextProviderFrom(pageContext);
return getFromCurrentPath(request, injectorsRepository, contextProvider, type, appName);
}
public static <T> T getFromCurrentPath(final SlingHttpServletRequest request,
final InjectorsRepository injectorsRepository, final ContextProvider contextProvider,
final Class<T> type, final String appName) {
final String injectorName = getInjectorName(request, appName);
if (StringUtils.isBlank(injectorName)) {
throw new IllegalStateException("Guice injector name not available");
} else {
request.setAttribute(SLICE_INJECTOR_NAME, injectorName);
}
if (null == contextProvider) {
throw new IllegalStateException("ContextProvider is not available");
}
final InjectorWithContext injector = injectorsRepository.getInjector(injectorName);
if (injector == null) {
throw new IllegalStateException("Guice injector not found: " + injectorName);
}
injector.pushContextProvider(contextProvider);
try {
final ModelProvider modelProvider = injector.getInstance(ModelProvider.class);
final Resource resource = request.getResource();
return (T) modelProvider.get(type, resource);
} finally {
injector.popContextProvider();
}
}
@SuppressWarnings("deprecation")
private static String getInjectorName(final SlingHttpServletRequest request, final String appName) {
String injectorName;
if (StringUtils.isNotBlank(appName)) {
injectorName = appName;
} else {
String cachedInjectorName = (String) request.getAttribute(SLICE_INJECTOR_NAME);
if (StringUtils.isNotBlank(cachedInjectorName)) {
injectorName = cachedInjectorName;
} else {
injectorName = InjectorNameUtil.getFromRequest(request);
}
}
return injectorName;
}
public static SlingHttpServletRequest slingRequestFrom(final PageContext pageContext) {
return (SlingHttpServletRequest) pageContext.getRequest();
}
public static ContextProvider contextProviderFrom(final PageContext pageContext) {
final SlingScriptHelper slingScriptHelper = getSlingScriptHelper(pageContext);
return slingScriptHelper.getService(ContextProvider.class);
}
public static InjectorsRepository injectorsRepositoryFrom(final PageContext pageContext) {
final SlingScriptHelper slingScriptHelper = getSlingScriptHelper(pageContext);
return slingScriptHelper.getService(InjectorsRepository.class);
}
private static SlingScriptHelper getSlingScriptHelper(final PageContext pageContext) {
ServletRequest request = pageContext.getRequest();
SlingBindings bindings = (SlingBindings) request.getAttribute(SlingBindings.class.getName());
return bindings.getSling();
}
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.