Skip to content

Commit

Permalink
tagging release 3.294
Browse files Browse the repository at this point in the history
  • Loading branch information
dxcity committed Oct 1, 2020
1 parent a28b0d1 commit fc3704f
Show file tree
Hide file tree
Showing 51 changed files with 359 additions and 166 deletions.
8 changes: 8 additions & 0 deletions ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@

QDS 3.294:

* [QD-1262] Handle MARS time synchronization tracker multicast initialization error on MacOS
* [QD-1257] Add connector option to ignore received subscription removal requests
- added 'subscriptionKeepAlive' parameter accepting '0' (default behavior) and 'inf' (ignores unsubscription) values
* [QD-1261] Unsynchronized usage of WeakHashMap in SerialClassContext

QDS 3.293:

* [QD-1246] LongHashMap key_set,values,entry_set,mod_count fields should not be volatile
Expand Down
2 changes: 1 addition & 1 deletion auth/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-bin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-codegen-verify/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxfeed-codegen/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxfeed-ipf-filter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxfeed-news/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxfeed-ondemand/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxfeed-plotter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxfeed-promise/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
4 changes: 2 additions & 2 deletions dxfeed-samples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>dxfeed-samples</artifactId>
<version>3.293</version>
<version>3.294</version>
<packaging>jar</packaging>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-tools/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-viewer-installer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-viewer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxfeed-webservice-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxfeed-webservice/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion dxlib-benchmark/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxlib-qd-sandbox/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion dxlib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<parent>
<artifactId>QD</artifactId>
<groupId>com.devexperts.qd</groupId>
<version>3.293</version>
<version>3.294</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
48 changes: 22 additions & 26 deletions dxlib/src/main/java/com/devexperts/io/SerialClassContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.WeakHashMap;

Expand All @@ -48,7 +50,8 @@ public class SerialClassContext {
*/
public static final String DEFAULT_BLACK_LIST_NAME = "/META-INF/SerialClassBlacklist.txt";

private static final WeakHashMap<ClassLoader, SerialClassContext> defaultSerialContextMap = new WeakHashMap<>();
private static final Map<ClassLoader, SerialClassContext> defaultSerialContextMap =
Collections.synchronizedMap(new WeakHashMap<>());

private static final String ARRAY_PREFIX = "[";

Expand Down Expand Up @@ -79,45 +82,38 @@ public static SerialClassContext createSerialClassContext(ClassLoader loader, Co
* @return serial class context.
*/
public static SerialClassContext getDefaultSerialContext(ClassLoader loader) {
if (loader == null)
loader = ClassUtil.resolveContextClassLoader(null);
SerialClassContext defaultContext = defaultSerialContextMap.get(loader);
if (defaultContext == null) {
StringPrefixSet whitelist = readPrefixSet(loader, DEFAULT_WHITE_LIST_NAME, StringPrefixSet.ANYTHING_SET);
StringPrefixSet blacklist = readPrefixSet(loader, DEFAULT_BLACK_LIST_NAME, StringPrefixSet.NOTHING_SET);
defaultContext = new SerialClassContext(loader, whitelist, blacklist);
defaultSerialContextMap.put(loader, defaultContext);
}
return defaultContext;
return defaultSerialContextMap.computeIfAbsent(
ClassUtil.resolveContextClassLoader(loader),
SerialClassContext::readSerialClassContext);
}

private static SerialClassContext readSerialClassContext(ClassLoader cl) {
StringPrefixSet whitelist = readPrefixSet(cl, DEFAULT_WHITE_LIST_NAME, StringPrefixSet.ANYTHING_SET);
StringPrefixSet blacklist = readPrefixSet(cl, DEFAULT_BLACK_LIST_NAME, StringPrefixSet.NOTHING_SET);
return new SerialClassContext(cl, whitelist, blacklist);
}

private static StringPrefixSet readPrefixSet(ClassLoader cl, String prefixSetName, StringPrefixSet def) {
if (prefixSetName == null)
return def;
List<URL> urls = new ArrayList<>();
if (cl == null)
cl = Thread.currentThread().getContextClassLoader();
List<URL> urls;
try {
urls.addAll(Collections.list(cl.getResources(prefixSetName)));
urls = Collections.list(cl.getResources(prefixSetName));
} catch (IOException e) {
return def;
}
if (urls.isEmpty())
return def;
StringPrefixSet set = null;
List<String> names = new ArrayList<>();
for (URL url : urls) {
try (BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream(), StandardCharsets.UTF_8))) {
for (String name; (name = r.readLine()) != null;) {
if (set == null)
set = StringPrefixSet.valueOf(name);
else
set = set.add(StringPrefixSet.valueOf(name));
for (String line; (line = r.readLine()) != null;) {
// support multiple names on a single line for compatibility
names.addAll(Arrays.asList(line.split(StringPrefixSet.DEFAULT_NAMES_SEPARATOR)));
}
} catch (IOException e) {
log.error("Cannot read " + LogUtil.hideCredentials(url), e);
}
}
return set == null ? def : set;
return names.isEmpty() ? def : StringPrefixSet.valueOf(names);
}

private final StringPrefixSet whitelist;
Expand Down Expand Up @@ -157,7 +153,7 @@ public ClassLoader getClassLoader() {
* @return {@code true}, if class name contained in whitelist and not contained in blacklist.
* @throws NullPointerException if className is null.
*/
public synchronized boolean accept(String className) {
public boolean accept(String className) {
Objects.requireNonNull(className, "className");
if (className.startsWith(ARRAY_PREFIX))
return true;
Expand All @@ -176,7 +172,7 @@ public synchronized boolean accept(String className) {
* @throws ClassNotFoundException if the class not contained in whitelist or contained in blacklist.
* @throws NullPointerException if className is null.
*/
public synchronized void check(String className) throws ClassNotFoundException {
public void check(String className) throws ClassNotFoundException {
Objects.requireNonNull(className, "className");
if (className.startsWith(ARRAY_PREFIX))
return;
Expand Down
Loading

0 comments on commit fc3704f

Please sign in to comment.