Skip to content
Commits on Source (6)
......@@ -34,7 +34,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
</parent>
<properties>
......
......@@ -47,6 +47,7 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentMap;
/**
* This is the default helper class which is used to define builtin operations for rules.
......@@ -315,6 +316,12 @@ public class Helper
return false;
}
//check for presence in Map before hitting the synchronization;
PrintStream unlockedStream = traceMap.get(identifier);
if (unlockedStream != null) {
return false;
}
synchronized(traceMap) {
PrintStream stream = traceMap.get(identifier);
if (stream != null) {
......@@ -351,11 +358,7 @@ public class Helper
FileOutputStream fos;
try {
if (file.exists()) {
fos = new FileOutputStream(file, true);
} else {
fos = new FileOutputStream(file, true);
}
fos = new FileOutputStream(file, true);
} catch (FileNotFoundException e) {
// oops, just return false
return false;
......@@ -387,10 +390,9 @@ public class Helper
synchronized(traceMap) {
// need to do the close while synchronized so we ensure an open cannot
// proceed until we have flushed all changes to disk
PrintStream ps = traceMap.get(identifier);
PrintStream ps = traceMap.remove(identifier);
if (ps != null) {
ps.close();
traceMap.remove(identifier);
return true;
}
}
......@@ -410,9 +412,9 @@ public class Helper
*/
private static boolean dotrace(Object identifier, String message)
{
synchronized(traceMap) {
PrintStream ps = traceMap.get(identifier);
if (ps == null) {
PrintStream ps = traceMap.get(identifier);
if (ps == null) {
synchronized(traceMap) {
if (doTraceOpen(identifier, null)) {
ps = traceMap.get(identifier);
} else {
......@@ -441,9 +443,9 @@ public class Helper
*/
private static boolean dotraceln(Object identifier, String message)
{
synchronized(traceMap) {
PrintStream ps = traceMap.get(identifier);
if (ps == null) {
PrintStream ps = traceMap.get(identifier);
if (ps == null) {
synchronized(traceMap) {
if (doTraceOpen(identifier, null)) {
ps = traceMap.get(identifier);
} else {
......@@ -467,10 +469,9 @@ public class Helper
*/
private static void doTraceException(Object id, Throwable th)
{
PrintStream ps;
synchronized (traceMap) {
ps = traceMap.get(id);
if (ps == null) {
PrintStream ps = traceMap.get(id);
if (ps == null) {
synchronized (traceMap) {
if (id.equals("err")) {
ps = System.err;
} else {
......@@ -3896,8 +3897,11 @@ public class Helper
/**
* a hash map used to identify trace streams from their
* identifying objects
* Mutating the map requires synchronization on the traceMap;
* not required for read operations (or use of the stored PrintStream instances)
* as that is inherently racy.
*/
private static HashMap<Object, PrintStream> traceMap = new HashMap<Object, PrintStream>();
private final static ConcurrentMap<Object, PrintStream> traceMap = new ConcurrentHashMap<Object, PrintStream>();
/**
* a set used to identify settings for boolean flags associated
......
......@@ -7,7 +7,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
</parent>
<description>
......
......@@ -32,7 +32,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<build>
......
......@@ -32,7 +32,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<build>
......
......@@ -33,7 +33,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<dependencies>
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-jboss-modules</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......
......@@ -19,7 +19,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-jboss-modules</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<relativePath>../pom.xml</relativePath>
</parent>
......
......@@ -18,7 +18,7 @@
<plugin>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-rulecheck-maven-plugin</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<executions>
<execution>
<id>rulecheck-test</id>
......
......@@ -32,7 +32,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
<relativePath>../../pom.xml</relativePath>
</parent>
......
byteman (4.0.8-1) unstable; urgency=medium
* New upstream version 4.0.8
* Adding ${maven:CompileDepends} to the Depends of the binary package.
* Adding Rules-Requires-Root: no.
-- Andrius Merkys <merkys@debian.org> Wed, 16 Oct 2019 04:29:52 -0400
byteman (4.0.7-2) unstable; urgency=medium
* Team upload.
......
......@@ -20,6 +20,7 @@ Build-Depends:
maven-debian-helper,
testng,
Standards-Version: 4.4.0
Rules-Requires-Root: no
Homepage: http://byteman.jboss.org
Vcs-Browser: https://salsa.debian.org/java-team/byteman
Vcs-Git: https://salsa.debian.org/java-team/byteman.git
......@@ -27,6 +28,7 @@ Vcs-Git: https://salsa.debian.org/java-team/byteman.git
Package: libbyteman-java
Architecture: all
Depends:
${maven:CompileDepends},
${maven:Depends},
${misc:Depends},
Suggests:
......
......@@ -6,7 +6,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-docs</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
</parent>
<artifactId>byteman-asciidoc</artifactId>
......
......@@ -6,7 +6,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
</parent>
<artifactId>byteman-docs</artifactId>
......
......@@ -28,7 +28,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
</parent>
<description>
The Byteman download includes the byteman agent, submit and install jars. the contributed
......
......@@ -33,7 +33,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
</parent>
<profiles>
......
......@@ -41,7 +41,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
</parent>
<properties>
<!-- don't install or deploy this jar, instead use it to
......
......@@ -36,7 +36,7 @@
<parent>
<groupId>org.jboss.byteman</groupId>
<artifactId>byteman-root</artifactId>
<version>4.0.7</version>
<version>4.0.8</version>
</parent>
<build>
<plugins>
......
......@@ -33,7 +33,7 @@
into Java application and JVM runtime methods. Its primary purpose is to support execution tracing and fault
injection testing.
</description>
<version>4.0.7</version>
<version>4.0.8</version>
<name>byteman-root</name>
<url>http://www.jboss.org/byteman</url>
......@@ -106,7 +106,7 @@
<!-- for testing: command line args to enable debugger and verbose trace -->
<debug.args>-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 -Dorg.jboss.byteman.verbose</debug.args>
<!-- asm release version to use -->
<asm.version>7.1</asm.version>
<asm.version>7.2-beta</asm.version>
</properties>
<dependencyManagement>
......