diff --git a/ReleaseNotes.txt b/ReleaseNotes.txt index 929b4a27c..595d04b83 100644 --- a/ReleaseNotes.txt +++ b/ReleaseNotes.txt @@ -1,3 +1,10 @@ +QDS 3.293: + +* [QD-1246] LongHashMap key_set,values,entry_set,mod_count fields should not be volatile +* [QD-1252] dxFeed API: Add accessor to flags constants for OrderAction in Order +* [QD-1254] QDS: Improve schema generation code +* [QD-1255] dxFeed API: Make "ExecutedSize" field in Order enabled for Full Order Book + QDS 3.292: * [QD-1251] New order source for cboe C2 options diff --git a/auth/pom.xml b/auth/pom.xml index 4161c5638..278b670e9 100644 --- a/auth/pom.xml +++ b/auth/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxfeed-api/pom.xml b/dxfeed-api/pom.xml index 053e1ea4b..31e45dfa0 100644 --- a/dxfeed-api/pom.xml +++ b/dxfeed-api/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxfeed-bin/pom.xml b/dxfeed-bin/pom.xml index f30cadff3..a61883914 100644 --- a/dxfeed-bin/pom.xml +++ b/dxfeed-bin/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxfeed-codegen-verify/pom.xml b/dxfeed-codegen-verify/pom.xml index f80d92335..91f2633bc 100644 --- a/dxfeed-codegen-verify/pom.xml +++ b/dxfeed-codegen-verify/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxfeed-codegen/pom.xml b/dxfeed-codegen/pom.xml index 779492fa1..79bab7925 100644 --- a/dxfeed-codegen/pom.xml +++ b/dxfeed-codegen/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/DelegateGen.java b/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/DelegateGen.java index d87650413..37c664032 100644 --- a/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/DelegateGen.java +++ b/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/DelegateGen.java @@ -200,6 +200,8 @@ DelegateGen phantom(String phantomProperty) { RecordField field = lastFieldMapping().field; field.conditionalProperty = phantomProperty; field.isPhantom = true; + field.required = false; + field.enabled = false; } return this; } @@ -211,6 +213,7 @@ DelegateGen onlyIf(String conditionalProperty) { field.conditionalProperty = conditionalProperty; field.isPhantom = false; field.required = false; + field.enabled = false; return this; } @@ -249,6 +252,7 @@ DelegateGen onlySuffixes(String suffixesProperty, String suffixesDefault) { fm.field.onlySuffixesProperty = suffixesProperty; fm.field.onlySuffixesDefault = suffixesDefault; fm.field.required = false; + fm.field.enabled = false; return this; } @@ -259,6 +263,7 @@ DelegateGen exceptSuffixes(String suffixes) { throw new AssertionError("Record should have suffixes"); fm.field.exceptSuffixes = suffixes; fm.field.required = false; + fm.field.enabled = false; return this; } diff --git a/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/FactoryImplGen.java b/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/FactoryImplGen.java index f79064f3d..37461bf6a 100644 --- a/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/FactoryImplGen.java +++ b/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/FactoryImplGen.java @@ -119,45 +119,12 @@ private void generateBuildSchemeCode(ClassGen cg) { private void generateFieldCode(ClassGen cg, Map fields, String recordNameReference, boolean isRegional) { - String conditionalProperty = null; - boolean isPhantom = false; for (Map.Entry fieldEntry : fields.entrySet()) { String fieldName = fieldEntry.getKey(); RecordField f = fieldEntry.getValue(); if (isRegional && f.isCompositeOnly) continue; - if (conditionalProperty != null && - (!conditionalProperty.equals(f.conditionalProperty) || isPhantom != f.isPhantom)) - { - cg.unindent(); - cg.code("}"); - conditionalProperty = null; - } - if (f.conditionalProperty != null && !f.conditionalProperty.equals(conditionalProperty)) { - cg.addImport(new ClassName(SystemProperties.class)); - cg.code("if (SystemProperties.getBooleanProperty(\"" + f.conditionalProperty + "\", false)) {"); - cg.indent(); - conditionalProperty = f.conditionalProperty; - isPhantom = f.isPhantom; - } - if (f.onlySuffixesDefault != null || f.exceptSuffixes != null) { - cg.code("if (" + - (f.onlySuffixesDefault != null ? - ("suffix.matches(" + - (f.onlySuffixesProperty != null ? - "SystemProperties.getProperty(\"" + f.onlySuffixesProperty + "\", \"" + - f.onlySuffixesDefault + "\")" : - "\"" + f.onlySuffixesDefault + "\"" - ) + - ")" - ) : - "" - ) + - (f.onlySuffixesDefault != null && f.exceptSuffixes != null ? " && " : "") + - (f.exceptSuffixes != null ? "!suffix.matches(\"" + f.exceptSuffixes + "\")" : "") + - ")"); - cg.indent(); - } + cg.addImport(new ClassName(SerialFieldType.class)); for (FieldType.Field field : f.fieldType.fields) { String typeExpr = "SerialFieldType." + field.serialType; @@ -179,17 +146,43 @@ private void generateFieldCode(ClassGen cg, Map fields, Str } else { cg.code("builder.addOptionalField(" + recordNameReference + ", \"" + field.getFullName(fieldName) + "\", " + typeExpr + - ", \"" + f.eventName + "\", \"" + f.propertyName + "\", " + f.enabled + + ", \"" + f.eventName + "\", \"" + f.propertyName + "\", " + generateEnabledCondition(cg, f) + (f.time == SchemeFieldTime.COMMON_FIELD ? "" : ", SchemeFieldTime." + f.time) + ");"); } } - if (f.onlySuffixesDefault != null || f.exceptSuffixes != null) - cg.unindent(); } - if (conditionalProperty != null) { - cg.unindent(); - cg.code("}"); + } + + private String generateEnabledCondition(ClassGen cg, RecordField f) { + if (f.enabled) { + // Field is unconditionally enabled + return "true"; + } + + String enabledCondition = ""; + if (f.conditionalProperty != null) { + // Field is enabled if system property is set + cg.addImport(new ClassName(SystemProperties.class)); + enabledCondition += "SystemProperties.getBooleanProperty(\"" + f.conditionalProperty + "\", false)"; + } + if (f.onlySuffixesDefault != null) { + if (!enabledCondition.isEmpty()) { + enabledCondition += " && "; + } + // Field is enabled if suffix matches pattern + enabledCondition += "suffix.matches(" + (f.onlySuffixesProperty != null ? + "SystemProperties.getProperty(\"" + f.onlySuffixesProperty + "\", \"" + f.onlySuffixesDefault + "\")" : + "\"" + f.onlySuffixesDefault + "\"") + ")"; + + } + if (f.exceptSuffixes != null) { + if (!enabledCondition.isEmpty()) { + enabledCondition += " && "; + } + // Field is enabled if not suffix matches pattern + enabledCondition += "!suffix.matches(\"" + f.exceptSuffixes + "\")"; } + return (enabledCondition.isEmpty()) ? "false" : enabledCondition; } private void generateCreateDelegatesCode(ClassGen cg, boolean streamOnly) { diff --git a/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/ImplCodeGen.java b/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/ImplCodeGen.java index 0d72f2663..efe42ebd0 100644 --- a/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/ImplCodeGen.java +++ b/dxfeed-codegen/src/main/java/com/dxfeed/api/codegen/ImplCodeGen.java @@ -242,7 +242,7 @@ public void runForDxfeedImpl() throws IOException { map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). map("Price", "Price", FieldType.PRICE). map("Size", "Size", FieldType.SIZE). - map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault(). + map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.Order.suffixes.count", ""). map("Flags", "Flags", FieldType.FLAGS). map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). @@ -284,7 +284,7 @@ public void runForDxfeedImpl() throws IOException { map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). map("Price", "Price", FieldType.PRICE). map("Size", "Size", FieldType.SIZE). - map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault(). + map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.AnalyticOrder.suffixes.count", ""). map("Flags", "Flags", FieldType.FLAGS). map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). @@ -326,7 +326,7 @@ public void runForDxfeedImpl() throws IOException { map("AuxOrderId", "AuxOrderId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). map("Price", "Price", FieldType.PRICE). map("Size", "Size", FieldType.SIZE). - map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).optional().disabledByDefault(). + map("ExecutedSize", "ExecutedSize", FieldType.DECIMAL_AS_DOUBLE).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). map("Count", "Count", FieldType.INT_DECIMAL).onlySuffixes("com.dxfeed.event.order.impl.SpreadOrder.suffixes.count", ""). map("Flags", "Flags", FieldType.FLAGS). map("TradeId", "TradeId", FieldType.LONG).onlyIf(DXSCHEME_FOB).onlySuffixes(FOB_SUFFIX_PROPERTY, FOB_SUFFIX_DEFAULT). diff --git a/dxfeed-impl/pom.xml b/dxfeed-impl/pom.xml index 6ecb2f9aa..142bb6537 100644 --- a/dxfeed-impl/pom.xml +++ b/dxfeed-impl/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxfeed-impl/src/main/java/com/dxfeed/event/candle/CandleFactoryImpl.java b/dxfeed-impl/src/main/java/com/dxfeed/event/candle/CandleFactoryImpl.java index 87a9de34c..e0eada613 100644 --- a/dxfeed-impl/src/main/java/com/dxfeed/event/candle/CandleFactoryImpl.java +++ b/dxfeed-impl/src/main/java/com/dxfeed/event/candle/CandleFactoryImpl.java @@ -55,10 +55,8 @@ public void buildScheme(SchemeBuilder builder) { builder.addRequiredField(recordName, "Close", select(SerialFieldType.DECIMAL, "dxscheme.price")); builder.addOptionalField(recordName, "Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "Volume", true); builder.addOptionalField(recordName, "VWAP", select(SerialFieldType.DECIMAL, "dxscheme.price"), "Candle", "VWAP", true); - if (!suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*")) - builder.addOptionalField(recordName, "Bid.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "BidVolume", true); - if (!suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*")) - builder.addOptionalField(recordName, "Ask.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "AskVolume", true); + builder.addOptionalField(recordName, "Bid.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "BidVolume", !suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*")); + builder.addOptionalField(recordName, "Ask.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "AskVolume", !suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*")); builder.addOptionalField(recordName, "ImpVolatility", select(SerialFieldType.DECIMAL), "Candle", "ImpVolatility", true); builder.addOptionalField(recordName, "OpenInterest", select(SerialFieldType.DECIMAL, "dxscheme.oi"), "Candle", "OpenInterest", true); } @@ -74,10 +72,8 @@ public void buildScheme(SchemeBuilder builder) { builder.addRequiredField(recordName, "Close", select(SerialFieldType.DECIMAL, "dxscheme.price")); builder.addOptionalField(recordName, "Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "Volume", true); builder.addOptionalField(recordName, "VWAP", select(SerialFieldType.DECIMAL, "dxscheme.price"), "Candle", "VWAP", true); - if (!suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*")) - builder.addOptionalField(recordName, "Bid.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "BidVolume", true); - if (!suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*")) - builder.addOptionalField(recordName, "Ask.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "AskVolume", true); + builder.addOptionalField(recordName, "Bid.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "BidVolume", !suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*")); + builder.addOptionalField(recordName, "Ask.Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Candle", "AskVolume", !suffix.matches(".*[{,]price=(bid|ask|mark|s)[,}].*")); builder.addOptionalField(recordName, "ImpVolatility", select(SerialFieldType.DECIMAL), "Candle", "ImpVolatility", true); builder.addOptionalField(recordName, "OpenInterest", select(SerialFieldType.DECIMAL, "dxscheme.oi"), "Candle", "OpenInterest", true); } diff --git a/dxfeed-impl/src/main/java/com/dxfeed/event/market/MarketAccessorImpl.java b/dxfeed-impl/src/main/java/com/dxfeed/event/market/MarketAccessorImpl.java index 0e42e0a34..ab693c97e 100644 --- a/dxfeed-impl/src/main/java/com/dxfeed/event/market/MarketAccessorImpl.java +++ b/dxfeed-impl/src/main/java/com/dxfeed/event/market/MarketAccessorImpl.java @@ -39,6 +39,18 @@ public static void setOrderFlags(OrderBase order, int flags) { order.setFlags(flags); } + public static int orderAction(OrderAction action) { + return action.getCode() << OrderBase.ACTION_SHIFT; + } + + public static OrderAction getOrderAction(int flags) { + return OrderAction.valueOf(Util.getBits(flags, OrderBase.ACTION_MASK, OrderBase.ACTION_SHIFT)); + } + + public static int setOrderAction(int flags, OrderAction action) { + return Util.setBits(flags, OrderBase.ACTION_MASK, OrderBase.ACTION_SHIFT, action.getCode()); + } + public static int orderExchange(char exchangeCode) { Util.checkChar(exchangeCode, OrderBase.EXCHANGE_MASK, "exchangeCode"); return exchangeCode << OrderBase.EXCHANGE_SHIFT; diff --git a/dxfeed-impl/src/main/java/com/dxfeed/event/market/MarketFactoryImpl.java b/dxfeed-impl/src/main/java/com/dxfeed/event/market/MarketFactoryImpl.java index 61a5f6f43..b9c7ad212 100644 --- a/dxfeed-impl/src/main/java/com/dxfeed/event/market/MarketFactoryImpl.java +++ b/dxfeed-impl/src/main/java/com/dxfeed/event/market/MarketFactoryImpl.java @@ -90,10 +90,8 @@ public void buildScheme(SchemeBuilder builder) { builder.addOptionalField("Trade", "Volume", select(SerialFieldType.DECIMAL, "dxscheme.volume", "dxscheme.size"), "Trade", "DayVolume", true); builder.addOptionalField("Trade", "DayTurnover", select(SerialFieldType.DECIMAL, "dxscheme.turnover", "dxscheme.price"), "Trade", "DayTurnover", true); builder.addOptionalField("Trade", "Last.Flags", SerialFieldType.COMPACT_INT, "Trade", "Flags", true); - if (SystemProperties.getBooleanProperty("reuters.phantom", false)) { - builder.addRequiredField("Trade", "Date", SerialFieldType.COMPACT_INT); - builder.addRequiredField("Trade", "Operation", SerialFieldType.COMPACT_INT); - } + builder.addOptionalField("Trade", "Date", SerialFieldType.COMPACT_INT, "Trade", "Date", SystemProperties.getBooleanProperty("reuters.phantom", false)); + builder.addOptionalField("Trade", "Operation", SerialFieldType.COMPACT_INT, "Trade", "Operation", SystemProperties.getBooleanProperty("reuters.phantom", false)); for (char exchange : SystemProperties.getProperty("com.dxfeed.event.market.impl.Trade.exchanges", "ABCDEFGHIJKLMNOPQRSTUVWXYZ").toCharArray()) { String recordName = "Trade&" + exchange; builder.addOptionalField(recordName, "Last.Time", SerialFieldType.TIME_SECONDS, "Trade", "Time", true); @@ -203,30 +201,18 @@ public void buildScheme(SchemeBuilder builder) { builder.addRequiredField(recordName, "Time", SerialFieldType.TIME_SECONDS); builder.addRequiredField(recordName, "Sequence", SerialFieldType.SEQUENCE); builder.addOptionalField(recordName, "TimeNanoPart", SerialFieldType.COMPACT_INT, "Order", "TimeNanoPart", false); - if (SystemProperties.getBooleanProperty("dxscheme.fob", false)) { - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "ActionTime", SerialFieldType.TIME_MILLIS, "Order", "ActionTime", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "OrderId", SerialFieldType.LONG, "Order", "OrderId", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "AuxOrderId", SerialFieldType.LONG, "Order", "AuxOrderId", true); - } + builder.addOptionalField(recordName, "ActionTime", SerialFieldType.TIME_MILLIS, "Order", "ActionTime", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "OrderId", SerialFieldType.LONG, "Order", "OrderId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "AuxOrderId", SerialFieldType.LONG, "Order", "AuxOrderId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); builder.addRequiredField(recordName, "Price", select(SerialFieldType.DECIMAL, "dxscheme.price")); builder.addRequiredField(recordName, "Size", select(SerialFieldType.COMPACT_INT, "dxscheme.size")); - builder.addOptionalField(recordName, "ExecutedSize", select(SerialFieldType.DECIMAL), "Order", "ExecutedSize", false); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.Order.suffixes.count", ""))) - builder.addOptionalField(recordName, "Count", select(SerialFieldType.COMPACT_INT), "Order", "Count", true); + builder.addOptionalField(recordName, "ExecutedSize", select(SerialFieldType.DECIMAL), "Order", "ExecutedSize", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "Count", select(SerialFieldType.COMPACT_INT), "Order", "Count", suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.Order.suffixes.count", ""))); builder.addRequiredField(recordName, "Flags", SerialFieldType.COMPACT_INT); - if (SystemProperties.getBooleanProperty("dxscheme.fob", false)) { - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradeId", SerialFieldType.LONG, "Order", "TradeId", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradePrice", select(SerialFieldType.DECIMAL), "Order", "TradePrice", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradeSize", select(SerialFieldType.DECIMAL), "Order", "TradeSize", true); - } - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.Order.suffixes.mmid", "|#NTV|#BATE|#CHIX|#CEUX|#BXTR"))) - builder.addOptionalField(recordName, "MMID", SerialFieldType.SHORT_STRING, "Order", "MarketMaker", true); + builder.addOptionalField(recordName, "TradeId", SerialFieldType.LONG, "Order", "TradeId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "TradePrice", select(SerialFieldType.DECIMAL), "Order", "TradePrice", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "TradeSize", select(SerialFieldType.DECIMAL), "Order", "TradeSize", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "MMID", SerialFieldType.SHORT_STRING, "Order", "MarketMaker", suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.Order.suffixes.mmid", "|#NTV|#BATE|#CHIX|#CEUX|#BXTR"))); builder.addOptionalField(recordName, "IcebergPeakSize", select(SerialFieldType.DECIMAL), "Order", "IcebergPeakSize", false); builder.addOptionalField(recordName, "IcebergHiddenSize", select(SerialFieldType.DECIMAL), "Order", "IcebergHiddenSize", false); builder.addOptionalField(recordName, "IcebergExecutedSize", select(SerialFieldType.DECIMAL), "Order", "IcebergExecutedSize", false); @@ -240,30 +226,18 @@ public void buildScheme(SchemeBuilder builder) { builder.addRequiredField(recordName, "Time", SerialFieldType.TIME_SECONDS); builder.addRequiredField(recordName, "Sequence", SerialFieldType.SEQUENCE); builder.addOptionalField(recordName, "TimeNanoPart", SerialFieldType.COMPACT_INT, "AnalyticOrder", "TimeNanoPart", false); - if (SystemProperties.getBooleanProperty("dxscheme.fob", false)) { - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "ActionTime", SerialFieldType.TIME_MILLIS, "AnalyticOrder", "ActionTime", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "OrderId", SerialFieldType.LONG, "AnalyticOrder", "OrderId", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "AuxOrderId", SerialFieldType.LONG, "AnalyticOrder", "AuxOrderId", true); - } + builder.addOptionalField(recordName, "ActionTime", SerialFieldType.TIME_MILLIS, "AnalyticOrder", "ActionTime", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "OrderId", SerialFieldType.LONG, "AnalyticOrder", "OrderId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "AuxOrderId", SerialFieldType.LONG, "AnalyticOrder", "AuxOrderId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); builder.addRequiredField(recordName, "Price", select(SerialFieldType.DECIMAL, "dxscheme.price")); builder.addRequiredField(recordName, "Size", select(SerialFieldType.COMPACT_INT, "dxscheme.size")); - builder.addOptionalField(recordName, "ExecutedSize", select(SerialFieldType.DECIMAL), "AnalyticOrder", "ExecutedSize", false); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.AnalyticOrder.suffixes.count", ""))) - builder.addOptionalField(recordName, "Count", select(SerialFieldType.COMPACT_INT), "AnalyticOrder", "Count", true); + builder.addOptionalField(recordName, "ExecutedSize", select(SerialFieldType.DECIMAL), "AnalyticOrder", "ExecutedSize", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "Count", select(SerialFieldType.COMPACT_INT), "AnalyticOrder", "Count", suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.AnalyticOrder.suffixes.count", ""))); builder.addRequiredField(recordName, "Flags", SerialFieldType.COMPACT_INT); - if (SystemProperties.getBooleanProperty("dxscheme.fob", false)) { - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradeId", SerialFieldType.LONG, "AnalyticOrder", "TradeId", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradePrice", select(SerialFieldType.DECIMAL), "AnalyticOrder", "TradePrice", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradeSize", select(SerialFieldType.DECIMAL), "AnalyticOrder", "TradeSize", true); - } - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.AnalyticOrder.suffixes.mmid", "|#NTV|#BATE|#CHIX|#CEUX|#BXTR"))) - builder.addOptionalField(recordName, "MMID", SerialFieldType.SHORT_STRING, "AnalyticOrder", "MarketMaker", true); + builder.addOptionalField(recordName, "TradeId", SerialFieldType.LONG, "AnalyticOrder", "TradeId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "TradePrice", select(SerialFieldType.DECIMAL), "AnalyticOrder", "TradePrice", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "TradeSize", select(SerialFieldType.DECIMAL), "AnalyticOrder", "TradeSize", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "MMID", SerialFieldType.SHORT_STRING, "AnalyticOrder", "MarketMaker", suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.AnalyticOrder.suffixes.mmid", "|#NTV|#BATE|#CHIX|#CEUX|#BXTR"))); builder.addOptionalField(recordName, "IcebergPeakSize", select(SerialFieldType.DECIMAL), "AnalyticOrder", "IcebergPeakSize", false); builder.addOptionalField(recordName, "IcebergHiddenSize", select(SerialFieldType.DECIMAL), "AnalyticOrder", "IcebergHiddenSize", false); builder.addOptionalField(recordName, "IcebergExecutedSize", select(SerialFieldType.DECIMAL), "AnalyticOrder", "IcebergExecutedSize", false); @@ -277,28 +251,17 @@ public void buildScheme(SchemeBuilder builder) { builder.addRequiredField(recordName, "Time", SerialFieldType.TIME_SECONDS); builder.addRequiredField(recordName, "Sequence", SerialFieldType.SEQUENCE); builder.addOptionalField(recordName, "TimeNanoPart", SerialFieldType.COMPACT_INT, "SpreadOrder", "TimeNanoPart", false); - if (SystemProperties.getBooleanProperty("dxscheme.fob", false)) { - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "ActionTime", SerialFieldType.TIME_MILLIS, "SpreadOrder", "ActionTime", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "OrderId", SerialFieldType.LONG, "SpreadOrder", "OrderId", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "AuxOrderId", SerialFieldType.LONG, "SpreadOrder", "AuxOrderId", true); - } + builder.addOptionalField(recordName, "ActionTime", SerialFieldType.TIME_MILLIS, "SpreadOrder", "ActionTime", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "OrderId", SerialFieldType.LONG, "SpreadOrder", "OrderId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "AuxOrderId", SerialFieldType.LONG, "SpreadOrder", "AuxOrderId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); builder.addRequiredField(recordName, "Price", select(SerialFieldType.DECIMAL, "dxscheme.price")); builder.addRequiredField(recordName, "Size", select(SerialFieldType.COMPACT_INT, "dxscheme.size")); - builder.addOptionalField(recordName, "ExecutedSize", select(SerialFieldType.DECIMAL), "SpreadOrder", "ExecutedSize", false); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.SpreadOrder.suffixes.count", ""))) - builder.addOptionalField(recordName, "Count", select(SerialFieldType.COMPACT_INT), "SpreadOrder", "Count", true); + builder.addOptionalField(recordName, "ExecutedSize", select(SerialFieldType.DECIMAL), "SpreadOrder", "ExecutedSize", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "Count", select(SerialFieldType.COMPACT_INT), "SpreadOrder", "Count", suffix.matches(SystemProperties.getProperty("com.dxfeed.event.order.impl.SpreadOrder.suffixes.count", ""))); builder.addRequiredField(recordName, "Flags", SerialFieldType.COMPACT_INT); - if (SystemProperties.getBooleanProperty("dxscheme.fob", false)) { - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradeId", SerialFieldType.LONG, "SpreadOrder", "TradeId", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradePrice", select(SerialFieldType.DECIMAL), "SpreadOrder", "TradePrice", true); - if (suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))) - builder.addOptionalField(recordName, "TradeSize", select(SerialFieldType.DECIMAL), "SpreadOrder", "TradeSize", true); - } + builder.addOptionalField(recordName, "TradeId", SerialFieldType.LONG, "SpreadOrder", "TradeId", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "TradePrice", select(SerialFieldType.DECIMAL), "SpreadOrder", "TradePrice", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); + builder.addOptionalField(recordName, "TradeSize", select(SerialFieldType.DECIMAL), "SpreadOrder", "TradeSize", SystemProperties.getBooleanProperty("dxscheme.fob", false) && suffix.matches(SystemProperties.getProperty("com.dxfeed.event.market.impl.Order.fob.suffixes", "|#NTV"))); builder.addRequiredField(recordName, "SpreadSymbol", SerialFieldType.UTF_CHAR_ARRAY); } diff --git a/dxfeed-ipf-filter/pom.xml b/dxfeed-ipf-filter/pom.xml index dda7836af..7516c319d 100644 --- a/dxfeed-ipf-filter/pom.xml +++ b/dxfeed-ipf-filter/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxfeed-news/pom.xml b/dxfeed-news/pom.xml index 13bc359ae..08b3227ec 100644 --- a/dxfeed-news/pom.xml +++ b/dxfeed-news/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxfeed-ondemand/pom.xml b/dxfeed-ondemand/pom.xml index 8ac930f76..2a0419359 100644 --- a/dxfeed-ondemand/pom.xml +++ b/dxfeed-ondemand/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxfeed-plotter/pom.xml b/dxfeed-plotter/pom.xml index 0f8a8ba64..141d379a8 100644 --- a/dxfeed-plotter/pom.xml +++ b/dxfeed-plotter/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxfeed-promise/pom.xml b/dxfeed-promise/pom.xml index 60714a8b2..0cb9be294 100644 --- a/dxfeed-promise/pom.xml +++ b/dxfeed-promise/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxfeed-samples/pom.xml b/dxfeed-samples/pom.xml index 2fd3d7e46..fe3198cf3 100644 --- a/dxfeed-samples/pom.xml +++ b/dxfeed-samples/pom.xml @@ -14,13 +14,13 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 dxfeed-samples - 3.292 + 3.293 jar diff --git a/dxfeed-tools/pom.xml b/dxfeed-tools/pom.xml index 3ff01f36d..a6d7e7afa 100644 --- a/dxfeed-tools/pom.xml +++ b/dxfeed-tools/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxfeed-viewer-installer/pom.xml b/dxfeed-viewer-installer/pom.xml index f376830c2..a882cf888 100644 --- a/dxfeed-viewer-installer/pom.xml +++ b/dxfeed-viewer-installer/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxfeed-viewer/pom.xml b/dxfeed-viewer/pom.xml index 9faaa8a3d..8b3004833 100644 --- a/dxfeed-viewer/pom.xml +++ b/dxfeed-viewer/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxfeed-webservice-impl/pom.xml b/dxfeed-webservice-impl/pom.xml index 20b5ae3a3..7073c934f 100644 --- a/dxfeed-webservice-impl/pom.xml +++ b/dxfeed-webservice-impl/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxfeed-webservice/pom.xml b/dxfeed-webservice/pom.xml index bfc03f21f..2832d9f9e 100644 --- a/dxfeed-webservice/pom.xml +++ b/dxfeed-webservice/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/dxlib-benchmark/pom.xml b/dxlib-benchmark/pom.xml index bd9b37706..855ca0ede 100644 --- a/dxlib-benchmark/pom.xml +++ b/dxlib-benchmark/pom.xml @@ -2,7 +2,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxlib-qd-sandbox/pom.xml b/dxlib-qd-sandbox/pom.xml index a8b11d723..0b01b1eba 100644 --- a/dxlib-qd-sandbox/pom.xml +++ b/dxlib-qd-sandbox/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxlib/pom.xml b/dxlib/pom.xml index 56dba8177..4e14a1a98 100644 --- a/dxlib/pom.xml +++ b/dxlib/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/dxlib/src/main/java/com/devexperts/util/LongHashMap.java b/dxlib/src/main/java/com/devexperts/util/LongHashMap.java index a06d2890b..2333f7013 100644 --- a/dxlib/src/main/java/com/devexperts/util/LongHashMap.java +++ b/dxlib/src/main/java/com/devexperts/util/LongHashMap.java @@ -96,16 +96,16 @@ public final class LongHashMap extends AbstractLongMap implements Cloneabl /** * The threshold for the number of elements in the hashtable. The hashtable - * grows when count > threshold is true before the attempt + * grows when {@code count > threshold} is true before the attempt * to add an element. The value of the threshold is always equal to * (table.length << 1) / 3 if {@link #table} is not - * null or 0 otherwise. + * {@code null} or 0 otherwise. */ private transient int threshold; /** * First key in the hashtable. This variable is always defined when - * count > 0. This place is reserved for 0 value, because + * {@code count > 0}. This place is reserved for 0 value, because * it cannot be stored in {@link #table}, but if the table does not * contain 0, then an arbitrary key is placed here. */ @@ -121,15 +121,15 @@ public final class LongHashMap extends AbstractLongMap implements Cloneabl * in this array, i.e. everything except for the {@link #first_key}. * Zeroes denote unused entries in the table. The length of this array * is always a power of 2 and is at least {@link #INITIAL_LENGTH}. - * It is null until it is not allocated. + * It is {@code null} until it is not allocated. */ private transient long[] table; /** * The values for the corresponding entries from {@link #table}. * The memory for this object is allocated only when any non-null mapping - * is added to hashtable. When table_val == null all - * mappings are treated as being mapped to null. + * is added to hashtable. When {@code table_val == null} all + * mappings are treated as being mapped to {@code null}. */ private transient V[] table_val; @@ -143,7 +143,7 @@ public final class LongHashMap extends AbstractLongMap implements Cloneabl * to make iterators on the hash fail-fast. * @see ConcurrentModificationException */ - private transient volatile int mod_count; + private transient int mod_count; // Constructors @@ -215,7 +215,7 @@ public void putAll(Map t) { if (lhm_table[i] != 0) put(lhm_table[i], null); } else { - // everething maps to some values + // everything maps to some values for (int i = lhm_table.length; --i >= 0;) if (lhm_table[i] != 0) put(lhm_table[i], lhm_table_val[i]); @@ -493,7 +493,7 @@ private void removeFirstKey() { } /** - * Removes the mapping for the table[index] from + * Removes the mapping for the {@code table[index]} from * this map assuming that it is present. */ private void removeByIndex(int index) { @@ -530,8 +530,8 @@ private void removeByIndex(int index) { // Stores different views of this map private transient volatile LongSet key_set; - private transient volatile Collection values; - private transient volatile Set> entry_set; + private transient Collection values; + private transient Set> entry_set; // Implements LongSet#longKeySet() @@ -550,9 +550,12 @@ private void removeByIndex(int index) { */ @Override public LongSet longKeySet() { - if (key_set == null) - key_set = new LongHashSet(this); - return key_set; + LongSet ks = this.key_set; + if (ks == null) { + ks = new LongHashSet(this); + this.key_set = ks; + } + return ks; } /** @@ -568,8 +571,9 @@ public LongSet longKeySet() { */ @Override public Collection values() { - if (values == null) { - values = new AbstractCollection() { + Collection vals = this.values; + if (vals == null) { + vals = new AbstractCollection() { @Override public int size() { return count; @@ -590,8 +594,9 @@ public Iterator iterator() { return new ValuesIterator(); } }; + this.values = vals; } - return values; + return vals; } // Implements Set#entrySet() @@ -611,8 +616,9 @@ public Iterator iterator() { */ @Override public Set> entrySet() { - if (entry_set == null) { - entry_set = new AbstractSet>() { + Set> es = this.entry_set; + if (es == null) { + es = new AbstractSet>() { @Override public int size() { return count; @@ -663,17 +669,18 @@ public Iterator> iterator() { return new EntrySetIterator(); } }; + this.entry_set = es; } - return entry_set; + return es; } // Internal rehashing methods /** * Rehashes internal structure of this map so that - * table.length = (1 << new_power). It is + * {@code table.length = (1 << new_power)}. It is * an error to call this method with - * new_power < INITIAL_POWER. + * {@code new_power < INITIAL_POWER}. */ private void rehash(int new_power) { int new_length = 1 << new_power; @@ -685,7 +692,7 @@ private void rehash(int new_power) { /** * Performs actual unconditional rehashing assuming that {@link #shift} - * if already assigned to a correct value and new_length + * if already assigned to a correct value and {@code new_length} * if a correct power of 2. */ @SuppressWarnings("unchecked") @@ -697,7 +704,7 @@ private void rehashHelper(int new_length) { table_val = null; } else { // actual rehash -- because count > 1 we know that table != null long[] t = new long[new_length]; // new table - V[] tv = null; // new table_val -- we will alocate it if needed + V[] tv = null; // new table_val -- we will allocate it if needed for (int i = table.length; --i >= 0; ) { // scan entire old hashtable long k = table[i]; if (k != 0) { // Non-empty value -- place it into new table 't' @@ -747,14 +754,14 @@ private static int getPower(int capacity) { /** * Makes sure that no rehashes or memory reallocations will be - * needed until size() <= capacity. - * @throws IllegalArgumentException when capacity > MAX_CAPACITY. + * needed until {@code size() <= capacity}. + * @throws IllegalArgumentException when {@code capacity > MAX_CAPACITY}. */ public void ensureCapacity(int capacity) { if (capacity > MAX_CAPACITY) throw new IllegalArgumentException("Invalid capacity"); if (capacity <= threshold) - return; // Nothing todo -- already have enough capacity + return; // Nothing to do -- already have enough capacity rehash(getPower(capacity)); } @@ -779,7 +786,7 @@ public void compact() { * but is faster, because it does not produce excessive garbage. * When capacity is less or equal than 1, this method is equivalent * to {@link #compact()}. - * @throws IllegalArgumentException when capacity > MAX_CAPACITY. + * @throws IllegalArgumentException when {@code capacity > MAX_CAPACITY}. */ public void compact(int capacity) { if (capacity <= 1 || capacity <= count) { // Simply compact such cases @@ -814,7 +821,7 @@ public void clearAndCompact() { * to the sequence of {@link #clear()} and {@link #compact(int)} calls, * but is faster. When capacity is less or equal than 1, this method is * equivalent to {@link #clearAndCompact()}. - * @throws IllegalArgumentException when capacity > MAX_CAPACITY. + * @throws IllegalArgumentException when {@code capacity > MAX_CAPACITY}. */ public void clearAndCompact(int capacity) { if (capacity <= 1) { // they don't ask for big capacity @@ -929,8 +936,8 @@ private abstract class AbstractIterator implements Iterator { /** * This index points to the element in hashtable on which * we shall stop iteration. It points to an - * empty slot in the {@link #table}, i.e. table[last_index] == 0 - * and is defined when index >= 0. + * empty slot in the {@link #table}, i.e. {@code table[last_index] == 0} + * and is defined when {@code index >= 0}. */ private int last_index; @@ -948,7 +955,7 @@ private abstract class AbstractIterator implements Iterator { * The last returned value by the {@link #nextIndex()} method. * The value of -1 indicates that the value was not returned yet * (or the value returned was already removed). The value of -2 - * indicates that fisrt_key was returned. Any non-negative value + * indicates that first_key was returned. Any non-negative value * indicates that the corresponding entry from the table was * returned. */ @@ -962,7 +969,7 @@ private abstract class AbstractIterator implements Iterator { protected AbstractIterator() {} - // Implemenets Iterator#hasNext() + // Implements Iterator#hasNext() @Override public boolean hasNext() { if (index == -1) // Yes, we have a lots of elements ahead, if the set is not empty @@ -1025,7 +1032,7 @@ public void remove() { last_returned = -1; } - // Abstract method Iterator#next() to be overriden + // Abstract method Iterator#next() to be overridden @Override @SuppressWarnings({"IteratorNextCanNotThrowNoSuchElementException"}) public abstract T next(); @@ -1085,7 +1092,7 @@ public Map.Entry next() { /** * Abstract entry implementation that is consistent with the - * java.util.HashMap.Entry. + * {@code java.util.HashMap.Entry}. */ private abstract class AbstractEntry implements LongMap.Entry { protected final int expected_mod_count = mod_count; @@ -1110,6 +1117,7 @@ public Long getKey() { @Override public abstract V setValue(V value); + @Override public boolean equals(Object o) { if (!(o instanceof Map.Entry)) return false; @@ -1130,19 +1138,21 @@ public boolean equals(Object o) { return (value == null ? e.getValue() == null : value.equals(e.getValue())); } + @Override public int hashCode() { Object value = getValue(); int hash = (int) (key ^ (key >> 32)); // !!! This is hashcode of java.lang.Long return hash ^ ((value == null) ? 0 : value.hashCode()); } + @Override public String toString() { return key + "=" + getValue(); } } /** - * Entry implementaion for {@link LongHashMap#first_key} mapping. + * Entry implementation for {@link LongHashMap#first_key} mapping. */ private final class FirstKeyEntry extends AbstractEntry { FirstKeyEntry() { @@ -1167,7 +1177,7 @@ public V setValue(V value) { } /** - * Entry implementaion for {@link LongHashMap#table} mappings. + * Entry implementation for {@link LongHashMap#table} mappings. */ private final class IndexEntry extends AbstractEntry { private final int index; diff --git a/license/pom.xml b/license/pom.xml index 42b2981b0..e9b45b1de 100644 --- a/license/pom.xml +++ b/license/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/mars-sample/pom.xml b/mars-sample/pom.xml index 82449e3ff..91b9c6c27 100644 --- a/mars-sample/pom.xml +++ b/mars-sample/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/mars/pom.xml b/mars/pom.xml index a5b1ff921..c7fee6f1b 100644 --- a/mars/pom.xml +++ b/mars/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/pom.xml b/pom.xml index 02d24ecec..ea150d39f 100644 --- a/pom.xml +++ b/pom.xml @@ -16,7 +16,7 @@ com.devexperts.qd QD pom - 3.292 + 3.293 2002 diff --git a/proto-sample/pom.xml b/proto-sample/pom.xml index a7dffb469..f55d51251 100644 --- a/proto-sample/pom.xml +++ b/proto-sample/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/proto-ssl/pom.xml b/proto-ssl/pom.xml index f4fcacf82..8961a2e5d 100644 --- a/proto-ssl/pom.xml +++ b/proto-ssl/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/proto/pom.xml b/proto/pom.xml index 12491fbc8..49e708a5b 100644 --- a/proto/pom.xml +++ b/proto/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-core/pom.xml b/qd-core/pom.xml index d1ebe08c1..dfc743de4 100644 --- a/qd-core/pom.xml +++ b/qd-core/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-dataextractor/pom.xml b/qd-dataextractor/pom.xml index 8f61ee1b4..a4708e62e 100644 --- a/qd-dataextractor/pom.xml +++ b/qd-dataextractor/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/qd-logger/pom.xml b/qd-logger/pom.xml index 42e8129a0..5a2c9d826 100644 --- a/qd-logger/pom.xml +++ b/qd-logger/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-nio/pom.xml b/qd-nio/pom.xml index 287564b78..c285bfff5 100644 --- a/qd-nio/pom.xml +++ b/qd-nio/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-rmi/pom.xml b/qd-rmi/pom.xml index c94a7478b..8a09fdd30 100644 --- a/qd-rmi/pom.xml +++ b/qd-rmi/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-sample/pom.xml b/qd-sample/pom.xml index c81147f9a..4e4c59df3 100644 --- a/qd-sample/pom.xml +++ b/qd-sample/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-samplecert/pom.xml b/qd-samplecert/pom.xml index 720fd9b92..132f134e8 100644 --- a/qd-samplecert/pom.xml +++ b/qd-samplecert/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-servlet/pom.xml b/qd-servlet/pom.xml index 7a3d46405..0db5dda18 100644 --- a/qd-servlet/pom.xml +++ b/qd-servlet/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-stripe/pom.xml b/qd-stripe/pom.xml index f0e128887..94253e7cf 100644 --- a/qd-stripe/pom.xml +++ b/qd-stripe/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qd-tools/pom.xml b/qd-tools/pom.xml index af0c68b2e..8993b7a0f 100644 --- a/qd-tools/pom.xml +++ b/qd-tools/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qds-file/pom.xml b/qds-file/pom.xml index 20377eeeb..fbeacbb70 100644 --- a/qds-file/pom.xml +++ b/qds-file/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qds-monitoring/pom.xml b/qds-monitoring/pom.xml index 5f98516b5..ce50015cb 100644 --- a/qds-monitoring/pom.xml +++ b/qds-monitoring/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qds-tools/pom.xml b/qds-tools/pom.xml index 7c0f7555b..391328745 100644 --- a/qds-tools/pom.xml +++ b/qds-tools/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/qds/pom.xml b/qds/pom.xml index 584c6643f..bebb55d7f 100644 --- a/qds/pom.xml +++ b/qds/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0 diff --git a/rt-api-builder/pom.xml b/rt-api-builder/pom.xml index 3b2890c87..ca8f84278 100644 --- a/rt-api-builder/pom.xml +++ b/rt-api-builder/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 4.0.0 diff --git a/teamcity-version/pom.xml b/teamcity-version/pom.xml index fb8ef1f72..cbddda2ba 100644 --- a/teamcity-version/pom.xml +++ b/teamcity-version/pom.xml @@ -14,7 +14,7 @@ QD com.devexperts.qd - 3.292 + 3.293 ../pom.xml 4.0.0