Skip to content

Commit

Permalink
tagging release 1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikita Koval committed Feb 12, 2018
1 parent bf76c80 commit d6f6871
Show file tree
Hide file tree
Showing 11 changed files with 44 additions and 10 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
JAgent
======

[ ![Download](https://api.bintray.com/packages/devexperts/Maven/jagent/images/download.svg) ](https://bintray.com/devexperts/Maven/jagent/_latestVersion)

**JAgent** framework helps you to implement java agents.
It has some extra functionality instead of standard Java's API.

Expand Down
2 changes: 1 addition & 1 deletion jagent-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>jagent</artifactId>
<groupId>com.devexperts.jagent</groupId>
<version>1.4-SNAPSHOT</version>
<version>1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion jagent-impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>jagent</artifactId>
<groupId>com.devexperts.jagent</groupId>
<version>1.4-SNAPSHOT</version>
<version>1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ private void dumpClassIfNeeded(String className, ClassLoader loader, byte[] clas
if (dumpDir == null)
return;
try {
Path classPath = Paths.get(dumpDir, className + "#loaderHashCode=" + (loader != null ? loader.hashCode() : null));
Files.createDirectories(classPath.getParent());
Path classPath = Paths.get(dumpDir, className + "#loaderHashCode="
+ (loader != null ? loader.hashCode() : null) + ".class");
if (classPath.getParent() != null)
Files.createDirectories(classPath.getParent());
Files.write(classPath, classfileBuffer);
log.debug("Dump class ", className, " loaded by ", loader, " to ", classPath);
} catch (Exception e) {
Expand Down
4 changes: 4 additions & 0 deletions jagent-impl/src/main/java/com/devexperts/jagent/JAgent.java
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,8 @@ private void redefine(ClassFileTransformer transformer)
ArrayList<Class> classes = new ArrayList<>();
HashSet<Class> done = new HashSet<>();
FastByteBuffer buf = new FastByteBuffer();
CachingClassFileTransformer ourTransformer = transformer instanceof CachingClassFileTransformer ?
(CachingClassFileTransformer) transformer : null;
for (int pass = 1; ; pass++) {
classes.addAll(Arrays.asList(inst.getAllLoadedClasses()));
List<ClassDefinition> cdl = new ArrayList<>(classes.size());
Expand All @@ -125,6 +127,8 @@ private void redefine(ClassFileTransformer transformer)
if (!done.add(clazz))
continue;
String name = clazz.getName().replace('.', '/');
if (ourTransformer != null && !ourTransformer.processClass(name, clazz.getClassLoader()))
continue;
InputStream is = clazz.getResourceAsStream("/" + name + ".class");
buf.clear();
if (is != null)
Expand Down
27 changes: 26 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>com.devexperts.jagent</groupId>
<artifactId>jagent</artifactId>
<version>1.4-SNAPSHOT</version>
<version>1.4</version>
<packaging>pom</packaging>

<name>JAgent</name>
Expand Down Expand Up @@ -169,11 +169,36 @@
</execution>
</executions>
</plugin>
<!-- Configuration for release -->
<plugin>
<groupId>com.devexperts.jgitflow</groupId>
<artifactId>jgitflow-maven-plugin</artifactId>
<version>1.0-m5.1-devexperts</version>
<configuration>
<autoVersionSubmodules>true</autoVersionSubmodules>
<flowInitContext>
<versionTagPrefix>jagent-</versionTagPrefix>
</flowInitContext>
<squash>true</squash>
<scmCommentPrefix>[release] </scmCommentPrefix>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<pluginRepositories>
<pluginRepository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>bintray-devexperts</id>
<name>bintray-plugins</name>
<url>http://dl.bintray.com/devexperts/Maven</url>
</pluginRepository>
</pluginRepositories>

<scm>
<connection>scm:git:https://stash.in.devexperts.com/scm/dxlab/jagent.git</connection>
<developerConnection>scm:git:ssh://[email protected]:7999/dxlab/jagent.git</developerConnection>
Expand Down
2 changes: 1 addition & 1 deletion sample/agent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sample</artifactId>
<groupId>com.devexperts.jagent.sample</groupId>
<version>1.4-SNAPSHOT</version>
<version>1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sample/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sample</artifactId>
<groupId>com.devexperts.jagent.sample</groupId>
<version>1.4-SNAPSHOT</version>
<version>1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>jagent</artifactId>
<groupId>com.devexperts.jagent</groupId>
<version>1.4-SNAPSHOT</version>
<version>1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sample/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sample</artifactId>
<groupId>com.devexperts.jagent.sample</groupId>
<version>1.4-SNAPSHOT</version>
<version>1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down
2 changes: 1 addition & 1 deletion sample/transformer/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<artifactId>sample</artifactId>
<groupId>com.devexperts.jagent.sample</groupId>
<version>1.4-SNAPSHOT</version>
<version>1.4</version>
</parent>
<modelVersion>4.0.0</modelVersion>

Expand Down

0 comments on commit d6f6871

Please sign in to comment.