]> source.dussan.org Git - javassist.git/log
javassist.git
5 years agofor release 3.25.0-GA rel_3_25_0_ga
chibash [Mon, 15 Apr 2019 16:35:06 +0000 (01:35 +0900)]
for release 3.25.0-GA

5 years agofor release 3.25.0-GA
chibash [Mon, 15 Apr 2019 16:33:33 +0000 (01:33 +0900)]
for release 3.25.0-GA

5 years agoMerge pull request #253 from sam-ma/master
Shigeru Chiba [Mon, 15 Apr 2019 16:09:18 +0000 (01:09 +0900)]
Merge pull request #253 from sam-ma/master

Fix #252 make instrumentation works on JDK11 for the inner class which has access to the private constructor of the host class

5 years agoMerge pull request #254 from soul2zimate/backwards-compatible-fix
Shigeru Chiba [Mon, 8 Apr 2019 09:07:31 +0000 (18:07 +0900)]
Merge pull request #254 from soul2zimate/backwards-compatible-fix

Add back FactoryHelper.toClass(ClassFile cf, ClassLoader loader, Prot…

5 years agoAdd back FactoryHelper.toClass(ClassFile cf, ClassLoader loader, ProtectionDomain... 254/head
Chao Wang [Mon, 25 Mar 2019 03:34:00 +0000 (11:34 +0800)]
Add back FactoryHelper.toClass(ClassFile cf, ClassLoader loader, ProtectionDomain domain) for backward compatibility in minor release.

5 years agoFix #252 make instrumentation works on JDK11 for the inner class which has access... 253/head
Sam Ma [Wed, 20 Mar 2019 02:08:43 +0000 (13:08 +1100)]
Fix #252 make instrumentation works on JDK11 for the inner class which has access to the private constructor of the host class

5 years agoadds javadoc comments for PR #250
chibash [Sun, 17 Mar 2019 13:57:29 +0000 (22:57 +0900)]
adds javadoc comments for PR #250

5 years agoMerge pull request #250 from skybber/master
Shigeru Chiba [Sun, 17 Mar 2019 13:26:08 +0000 (22:26 +0900)]
Merge pull request #250 from skybber/master

Control ctxClassLoader usage per thread

5 years agoControl ctxClassLoader usage per thread 250/head
skybber [Sun, 17 Mar 2019 08:26:09 +0000 (09:26 +0100)]
Control ctxClassLoader usage per thread

5 years agoMerge pull request #247 from NingZhang-e/issue246
Shigeru Chiba [Tue, 12 Feb 2019 13:23:50 +0000 (22:23 +0900)]
Merge pull request #247 from NingZhang-e/issue246

Clean Java doc to fix #246

5 years agoFix Issue #246 via clean java doc. 247/head
enigzhg [Tue, 12 Feb 2019 03:55:10 +0000 (11:55 +0800)]
Fix Issue #246 via clean java doc.

5 years agoMerge pull request #3 from jboss-javassist/master
Ning Zhang [Tue, 12 Feb 2019 03:19:33 +0000 (11:19 +0800)]
Merge pull request #3 from jboss-javassist/master

Sync with base/master.

5 years agoupdates Readme.html and rebuilds javassist.jar
chibash [Sat, 2 Feb 2019 02:40:36 +0000 (11:40 +0900)]
updates Readme.html and rebuilds javassist.jar

5 years agoMerge pull request #244 from shifujun/redirectMethodCallToStatic
Shigeru Chiba [Sat, 2 Feb 2019 02:36:46 +0000 (11:36 +0900)]
Merge pull request #244 from shifujun/redirectMethodCallToStatic

add a useful CodeConverter method:redirectMethodCallToStatic

5 years agoadd a new CodeConverter method:redirectMethodCallToStatic 244/head
shifujun [Fri, 1 Feb 2019 09:26:07 +0000 (17:26 +0800)]
add a new CodeConverter method:redirectMethodCallToStatic

5 years agofixes the bug reported in Issue #241.
chibash [Sun, 27 Jan 2019 16:35:21 +0000 (01:35 +0900)]
fixes the bug reported in Issue #241.
It makes $r available in the code given to CtBehavior#insertBefore().

5 years agoadds src/test/test5/SwitchCase.java. It also adds the javadoc comments.
chibash [Sun, 27 Jan 2019 10:35:24 +0000 (19:35 +0900)]
adds src/test/test5/SwitchCase.java. It also adds the javadoc comments.

5 years agoMerge pull request #243 from michalkurka/michalk_fix-j11-race
Shigeru Chiba [Sun, 27 Jan 2019 09:46:23 +0000 (18:46 +0900)]
Merge pull request #243 from michalkurka/michalk_fix-j11-race

JAVASSIST-242: Demonstrates a race condition in DefineClassHelper + proposed fix

5 years agoProposed fixes in DefineClassHelper & DefinePackageHelper 243/head
michalkurka [Fri, 25 Jan 2019 19:30:06 +0000 (11:30 -0800)]
Proposed fixes in DefineClassHelper & DefinePackageHelper

Don't try to clean-up after making a protected-final method accessible.
No synchronization with concurrent access can cause errors.

5 years agoJAVASSIST-242: Demonstrates a race condition in DefineClassHelper
michalkurka [Fri, 25 Jan 2019 19:28:06 +0000 (11:28 -0800)]
JAVASSIST-242: Demonstrates a race condition in DefineClassHelper

5 years agochanges Readme.html
chibash [Tue, 11 Dec 2018 06:43:33 +0000 (15:43 +0900)]
changes Readme.html

5 years agoMerge pull request #231 from jboss-javassist/test/switch-case
Shigeru Chiba [Tue, 11 Dec 2018 06:37:11 +0000 (15:37 +0900)]
Merge pull request #231 from jboss-javassist/test/switch-case

Supporting switch-case statements with string constants.

5 years agoupdates Readme.html test/switch-case 231/head
chibash [Sun, 9 Dec 2018 15:32:16 +0000 (00:32 +0900)]
updates Readme.html

5 years agoenables switch-case with string constants
chibash [Sun, 9 Dec 2018 15:24:19 +0000 (00:24 +0900)]
enables switch-case with string constants

5 years agoupdates for relase 3.24.1 rel_3_24_1_ga
chibash [Sun, 9 Dec 2018 10:58:26 +0000 (19:58 +0900)]
updates for relase 3.24.1

5 years agofixes another bug (supporting jdk.*) reported in #228
chibash [Thu, 6 Dec 2018 02:01:55 +0000 (11:01 +0900)]
fixes another bug (supporting jdk.*) reported in #228

5 years agoMerge pull request #2 from jboss-javassist/master
Ning Zhang [Tue, 4 Dec 2018 16:36:51 +0000 (17:36 +0100)]
Merge pull request #2 from jboss-javassist/master

Sync with master /jboss-javassist/javassist/.

5 years agofixes a bug reported in #228
chibash [Tue, 4 Dec 2018 15:19:56 +0000 (00:19 +0900)]
fixes a bug reported in #228

5 years agomodifies build.xml to support JDK 7.
chibash [Fri, 30 Nov 2018 06:41:39 +0000 (15:41 +0900)]
modifies build.xml to support JDK 7.

5 years agoMerge pull request #230 from JCgH4164838Gh792C124B5/localJavassistBranch
Shigeru Chiba [Fri, 30 Nov 2018 06:38:37 +0000 (15:38 +0900)]
Merge pull request #230 from JCgH4164838Gh792C124B5/localJavassistBranch

Re-enable JDK7 runtime compatibility for Javassist 3.x

5 years agoRe-enable JDK7 runtime compatibility for Javassist 3.x (until source changes preclude... 230/head
JCgH4164838Gh792C124B5 [Fri, 30 Nov 2018 05:54:00 +0000 (00:54 -0500)]
Re-enable JDK7 runtime compatibility for Javassist 3.x (until source changes preclude it).
pom.xml changes:
- lower compile source/target to 1.7 (from 1.8, introduced with Javassist 3.24.0)

5 years agoMerge pull request #1 from jboss-javassist/master
Ning Zhang [Fri, 2 Nov 2018 02:11:18 +0000 (10:11 +0800)]
Merge pull request #1 from jboss-javassist/master

Sync with jboss-javassist/javassist.

5 years agofixes bugs in javadoc comments
chibash [Thu, 1 Nov 2018 16:49:10 +0000 (01:49 +0900)]
fixes bugs in javadoc comments

5 years agoadds javassist.jar for test code rel_3_24_0_ga
chibash [Thu, 1 Nov 2018 03:54:28 +0000 (12:54 +0900)]
adds javassist.jar for test code

5 years agoupdates for release 3.24.0-GA
chibash [Wed, 31 Oct 2018 16:05:31 +0000 (01:05 +0900)]
updates for release 3.24.0-GA

6 years agofixes typos in javadocs. rel_3_24_0_rc
chibash [Fri, 5 Oct 2018 09:04:11 +0000 (18:04 +0900)]
fixes typos in javadocs.

6 years agoavoids ConcurrentModificationException in 3.23.1-GA reported in Issue #224.
chibash [Fri, 5 Oct 2018 06:47:03 +0000 (15:47 +0900)]
avoids ConcurrentModificationException in 3.23.1-GA reported in Issue #224.

6 years agostops a potential leak in JarClassPath openClassfile(). Issues #222.
chibash [Sat, 15 Sep 2018 03:06:25 +0000 (12:06 +0900)]
stops a potential leak in JarClassPath openClassfile().  Issues #222.

6 years agoadds a method taking Lookup to java.util.proxy.
chibash [Sun, 9 Sep 2018 17:39:42 +0000 (02:39 +0900)]
adds a method taking Lookup to java.util.proxy.

6 years agoadds Automatic-Module-Name to manifest
chibash [Sun, 9 Sep 2018 14:07:17 +0000 (23:07 +0900)]
adds Automatic-Module-Name to manifest

6 years agomodifies javassist.util.proxy.DefinePackageHelper to be compatible to Java 11.
chibash [Sat, 8 Sep 2018 07:26:19 +0000 (16:26 +0900)]
modifies javassist.util.proxy.DefinePackageHelper to be compatible to Java 11.
It also adds a javadoc comment to CtClass#toClass() to recommend the users to use #toClass(Class) or #toClass(Lookup).

6 years agochanges CtClass#toClass() and ClassPool#toClass() etc. to support Java 11,
chibash [Sat, 8 Sep 2018 06:47:38 +0000 (15:47 +0900)]
changes CtClass#toClass() and ClassPool#toClass() etc. to support Java 11,
in other words, java.lang.invoke.MethodHandles.Lookup.

6 years agodoes refactoring for javassist.util.proxy.
chibash [Thu, 6 Sep 2018 16:04:04 +0000 (01:04 +0900)]
does refactoring for javassist.util.proxy.

6 years agochanges the version number
chibash [Tue, 4 Sep 2018 16:52:23 +0000 (01:52 +0900)]
changes the version number

6 years agoadds test cases for NestHostAttribute and NestMembersAttribute.
chibash [Sun, 2 Sep 2018 14:50:56 +0000 (23:50 +0900)]
adds test cases for NestHostAttribute and NestMembersAttribute.

6 years agomodifies NestHostAttribute and NestMembersAttribute and adds test code
chibash [Sun, 2 Sep 2018 13:56:45 +0000 (22:56 +0900)]
modifies NestHostAttribute and NestMembersAttribute and adds test code

6 years agoMerge pull request #218 from dmitri-gb/master
Shigeru Chiba [Sun, 2 Sep 2018 10:36:51 +0000 (19:36 +0900)]
Merge pull request #218 from dmitri-gb/master

Add support for Java 11 NestHost and NestMembers attributes (JEP-181)

6 years agoadds a comment for the fix to JIRA JASSIST-267
chibash [Sun, 2 Sep 2018 10:25:12 +0000 (19:25 +0900)]
adds a comment for the fix to JIRA JASSIST-267

6 years agoMerge pull request #210 from NingZhang-Ericsson/JASSIST-267
Shigeru Chiba [Fri, 31 Aug 2018 00:22:59 +0000 (09:22 +0900)]
Merge pull request #210 from NingZhang-Ericsson/JASSIST-267

fixed JASSIST-267 (new )

6 years agoAdd support for Java 11 NestHost and NestMembers attributes 218/head
Dmitri Gabbasov [Thu, 23 Aug 2018 13:16:44 +0000 (16:16 +0300)]
Add support for Java 11 NestHost and NestMembers attributes

6 years agofixes issue #209 (NPE in Exception)
chibash [Wed, 18 Jul 2018 21:57:45 +0000 (06:57 +0900)]
fixes issue #209 (NPE in Exception)

6 years agoMerge pull request #207 from andresluuk/patch-2
Shigeru Chiba [Wed, 18 Jul 2018 21:05:45 +0000 (06:05 +0900)]
Merge pull request #207 from andresluuk/patch-2

Custom URL stream handler in ByteArrayClassPath

6 years agoFix JASSIST-267 210/head
NingZhang-Ericsson [Fri, 13 Jul 2018 08:48:13 +0000 (16:48 +0800)]
Fix JASSIST-267
Clean code according to comments.

6 years agofixed JASSIST-267
NingZhang-Ericsson [Fri, 13 Jul 2018 05:06:20 +0000 (13:06 +0800)]
fixed JASSIST-267

6 years agoCustom URL stream handler in ByteArrayClassPath 207/head
Andres Luuk [Mon, 9 Jul 2018 08:05:25 +0000 (11:05 +0300)]
Custom URL stream handler in ByteArrayClassPath

Otherwise a normal streamhandler lookup is made and if javassist is used early on server startup protses this can lead to a deadlock on rare cases on WebSpheare.
For example. A new StreamHandlerFactory is registered but not jet fully initialized. Now javassist is used at the same time but form another thread and it will be the first one to invoke the new StreamHandlerFactory and now it can deadlock with the other thread:

Snipets from my deadlock:
3XMTHREADINFO      "main" J9VMThread:0x000000000175EC00, omrthread_t:0x00007F4120008100, java/lang/Thread:0x00000000624290B8, state:B, prio=5
3XMTHREADBLOCK     Blocked on: org/osgi/util/tracker/ServiceTracker$Tracked@0x00000000627F0A90 Owned by: "other-thread" (J9VMThread:0x0000000001B26300, java/lang/Thread:0x00000000629F1458)
3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)
3XMTHREADINFO3           Java callstack:
4XESTACKTRACE                at org/osgi/util/tracker/ServiceTracker.getServiceReferences(ServiceTracker.java:525)
4XESTACKTRACE                at org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.createInternalURLStreamHandler(StreamHandlerFactory.java:162)
4XESTACKTRACE                at org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.createURLStreamHandler(StreamHandlerFactory.java:118)
4XESTACKTRACE                at java/net/URL.getURLStreamHandler(URL.java:1154)
4XESTACKTRACE                at java/net/URL.<init>(URL.java:611(Compiled Code))
4XESTACKTRACE                at java/net/URL.<init>(URL.java:502(Compiled Code))
4XESTACKTRACE                at java/net/URL.<init>(URL.java:451)
4XESTACKTRACE                at javassist/ByteArrayClassPath.find(JRebel:92)
...
4XESTACKTRACE                at java/lang/ClassLoader.loadClassHelper(ClassLoader.java:924(Compiled Code))
5XESTACKTRACE                   (entered lock: org/eclipse/core/launcher/Main$StartupClassLoader@0x0000000062F3AA88, entry count: 1)

3XMTHREADINFO      "other-thread" J9VMThread:0x0000000001B26300, omrthread_t:0x00007F4120A5D060, java/lang/Thread:0x00000000629F1458, state:B, prio=5
3XMTHREADBLOCK     Blocked on: org/eclipse/core/launcher/Main$StartupClassLoader@0x0000000062F3AA88 Owned by: "main" (J9VMThread:0x000000000175EC00, java/lang/Thread:0x00000000624290B8)
3XMHEAPALLOC             Heap bytes allocated since last GC cycle=0 (0x0)
3XMTHREADINFO3           Java callstack:
4XESTACKTRACE                at org/osgi/util/tracker/AbstractTracked.size(AbstractTracked.java:356)
4XESTACKTRACE                at org/osgi/util/tracker/ServiceTracker.getServiceReferences(ServiceTracker.java:526)
5XESTACKTRACE                   (entered lock: org/osgi/util/tracker/ServiceTracker$Tracked@0x00000000627F0A90, entry count: 1)
4XESTACKTRACE                at org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.createInternalURLStreamHandler(StreamHandlerFactory.java:162)
4XESTACKTRACE                at org/eclipse/osgi/framework/internal/protocol/StreamHandlerFactory.createURLStreamHandler(StreamHandlerFactory.java:118)
4XESTACKTRACE                at java/net/URL.getURLStreamHandler(URL.java:1154)
4XESTACKTRACE                at java/net/URL.<init>(URL.java:611(Compiled Code))
4XESTACKTRACE                at java/net/URL.<init>(URL.java:502(Compiled Code))
4XESTACKTRACE                at java/net/URL.<init>(URL.java:451)
4XESTACKTRACE                at java/net/URI.toURL(URI.java:1100)
4XESTACKTRACE                at com/ibm/jsse2/av.a(av.java:92)
4XESTACKTRACE                at com/ibm/jsse2/av.engineInit(av.java:7)
4XESTACKTRACE                at javax/net/ssl/TrustManagerFactory.init(TrustManagerFactory.java:25)

6 years agoupdates for release 3.23.1 rel_3_23_1_ga
chibash [Sun, 1 Jul 2018 17:27:13 +0000 (02:27 +0900)]
updates for release 3.23.1

6 years agoMerge pull request #204 from beikov/issues/171
Shigeru Chiba [Sat, 23 Jun 2018 12:23:21 +0000 (21:23 +0900)]
Merge pull request #204 from beikov/issues/171

[#171] Allow running on JDK 8 and possibly on JDK 7 as well. Fixes #171

6 years ago[#171] Allow running on JDK 8 and possibly on JDK 7 as well. Fixes #171 204/head
Christian Beikov [Fri, 22 Jun 2018 07:03:55 +0000 (09:03 +0200)]
[#171] Allow running on JDK 8 and possibly on JDK 7 as well. Fixes #171

6 years agoupdates for release 3.23.0-GA rel_3_23_0_ga
chibash [Wed, 20 Jun 2018 16:07:19 +0000 (01:07 +0900)]
updates for release 3.23.0-GA

6 years agofixes a minor bug in a test case.
chibash [Tue, 8 May 2018 00:24:19 +0000 (09:24 +0900)]
fixes a minor bug in a test case.

6 years agoMerge pull request #198 from beikov/JASSIST-271
Shigeru Chiba [Mon, 7 May 2018 10:14:33 +0000 (19:14 +0900)]
Merge pull request #198 from beikov/JASSIST-271

JASSIST-271 Allow running on Java 11 by falling back to ClassLoader.defineClass for Java > 10

6 years agoMerge pull request #168 from cmelchior/cm/bug/classpath-close
Shigeru Chiba [Mon, 7 May 2018 10:06:13 +0000 (19:06 +0900)]
Merge pull request #168 from cmelchior/cm/bug/classpath-close

[WIP] Fix leaking file handlers

6 years agoJASSIST-271 Allow running on Java 11 by falling back to ClassLoader.defineClass for... 198/head
Christian Beikov [Sun, 29 Apr 2018 14:20:56 +0000 (16:20 +0200)]
JASSIST-271 Allow running on Java 11 by falling back to ClassLoader.defineClass for Java > 10

6 years agofixes a bug reported in issue #155 (Javassist Incorrect Code when wrapping with try...
chibash [Tue, 14 Nov 2017 22:02:05 +0000 (07:02 +0900)]
fixes a bug reported in issue #155 (Javassist Incorrect Code when wrapping with try/catch)

6 years agoadds Modifier#isVarArgs()
chibash [Tue, 14 Nov 2017 19:07:28 +0000 (04:07 +0900)]
adds Modifier#isVarArgs()

6 years agoadds Modifier#isVarArgs()
chibash [Tue, 14 Nov 2017 18:46:02 +0000 (03:46 +0900)]
adds Modifier#isVarArgs()

6 years agochanges getDefinedPackage back to getPackage when Java is < 9.
chibash [Tue, 14 Nov 2017 18:05:05 +0000 (03:05 +0900)]
changes getDefinedPackage back to getPackage when Java is < 9.

6 years agoMerge pull request #159 from nickl-/scoped-pool
Shigeru Chiba [Tue, 14 Nov 2017 15:06:52 +0000 (00:06 +0900)]
Merge pull request #159 from nickl-/scoped-pool

Fixes to javassist.scopepool

6 years agoMerge pull request #158 from nickl-/secure-privileged
Shigeru Chiba [Tue, 14 Nov 2017 15:05:37 +0000 (00:05 +0900)]
Merge pull request #158 from nickl-/secure-privileged

Secure privileged

6 years agoMerge pull request #166 from nickl-/test-ctfield-make-with-this
Shigeru Chiba [Mon, 13 Nov 2017 18:22:25 +0000 (03:22 +0900)]
Merge pull request #166 from nickl-/test-ctfield-make-with-this

Unit Test: CtField.make referencing 'this'.

6 years agoMerge pull request #167 from nickl-/innerclass-modifiers
Shigeru Chiba [Mon, 13 Nov 2017 17:50:41 +0000 (02:50 +0900)]
Merge pull request #167 from nickl-/innerclass-modifiers

Fix for #152 inner class modifiers.

6 years agoupdates build.xml to be compatible to pom.xml
chibash [Mon, 13 Nov 2017 16:57:47 +0000 (01:57 +0900)]
updates build.xml to be compatible to pom.xml

6 years agoAdd missing unit test 168/head
Christian Melchior [Mon, 13 Nov 2017 10:25:16 +0000 (11:25 +0100)]
Add missing unit test

6 years agoFix merge mistake
Christian Melchior [Mon, 13 Nov 2017 10:24:57 +0000 (11:24 +0100)]
Fix merge mistake

6 years agoFix #152 inner class modifiers. 167/head
nickl- [Sat, 11 Nov 2017 20:34:34 +0000 (22:34 +0200)]
Fix #152 inner class modifiers.

Applied fix for #152 "Wrong modifiers returned for nested classes" as suggested by @pietrobraione.
Includes unit tests for all access modifiers and static.

6 years agoUnit Test: CtField.make referencing 'this'. 166/head
nickl- [Fri, 10 Nov 2017 17:13:01 +0000 (19:13 +0200)]
Unit Test: CtField.make referencing 'this'.

As per question raised in #161 passing 'this' reference for CtField value new object instance.
Also added assert for testing referncing 'this' for newly added field.

6 years agoFixes to javassist.scopepool 159/head
nickl- [Sun, 29 Oct 2017 21:42:49 +0000 (23:42 +0200)]
Fixes to javassist.scopepool

Applied parameters and squashed all compiler warnings.
Changed loops to enhanced for where appropriate.
Fixed SoftValueHashMap:
Made it a raw type.
Overwritten implementation of the `get` method correctly unwrapped the reference but the methods
`containsValue` and `entrySet` needed to be fixed.
Implemented the remaining outstanding methods from the `java.util.Map` contract `values`, `putAll`
and `keySet`.
Dropped `AbstractMap` inheritance as we were not inheriting anything anymore.
Changed internal map to `ConcurrentHashMap' to be atomic and parallel safe.

Found original unit tests from jboss retro which are now updated to reflect the javassist
versions of the scoped pool classes. Added tests for the SoftValueHashMap including
test which overloads the heap to ensure the cache cleans itself appropriately.

6 years agoDefine parameters for returned iterator. 158/head
nickl- [Sun, 29 Oct 2017 22:53:08 +0000 (00:53 +0200)]
Define parameters for returned iterator.

6 years agoSome functional unit tests proofs.
nickl- [Fri, 27 Oct 2017 06:33:55 +0000 (08:33 +0200)]
Some functional unit tests proofs.

Proves that you cannot access restricted functionality then goes ahead and
mock test all 3 exposures JAVA_9, JAVA_7+ and OTHERS by changing the
private static final class referenced default chosen on initialise.

6 years agoSome code comments to fill in gaps.
nickl- [Fri, 27 Oct 2017 06:12:07 +0000 (08:12 +0200)]
Some code comments to fill in gaps.

6 years agoEven now Oracle still not happy.
nickl- [Fri, 27 Oct 2017 06:10:22 +0000 (08:10 +0200)]
Even now Oracle still not happy.

Runtime still throws warnings illegal actions even after all that, there's
just no logic to it. We can use Unsafe but don't touch setAccessible. O well
might as well enjoy Unsafe while we still can.

Wrapped the Unsafe and added method cache with varargs method for invoke calls.
Can still do a lot with it but it does what it needs to for now.

6 years agoRefactor definePackage as well.
nickl- [Fri, 27 Oct 2017 05:59:12 +0000 (07:59 +0200)]
Refactor definePackage as well.

Yes it is deprecated but seems the right thing to do

6 years agoGive helper private constructor fwiw.
nickl- [Fri, 27 Oct 2017 05:57:45 +0000 (07:57 +0200)]
Give helper private constructor fwiw.

Wont stop you from getting an instance but it makes it more trouble at least.
Also reduce the visibility of the enum method.

6 years agoAdd caller class checking.
nickl- [Fri, 27 Oct 2017 05:55:08 +0000 (07:55 +0200)]
Add caller class checking.

The only thing remotely inforceable is caller class checking. You cannot
bypass an exception with setAccesible. Oracle went and removed
Reflection.getCallerClass() completely in favour of StackWalker. At least
we can share the SecurityManage ClassContext, SecurityActions seems the
appropriate venue for our stack trace peek to support the older versions

6 years agoMethodHandles for JDK7+.
nickl- [Fri, 27 Oct 2017 05:36:38 +0000 (07:36 +0200)]
MethodHandles for JDK7+.

Java 7 and 8 does support method handles so we can cater for them. When doing
repeated invokes to the same method, keeping a reference to the Method handle
is much faster than reflection. Also the API is cleaner not having to Object[]
args etc. Worth the effort...

6 years agoRefactored SecActs methods and retain 1.6 source.
nickl- [Fri, 27 Oct 2017 05:19:22 +0000 (07:19 +0200)]
Refactored SecActs methods and retain 1.6 source.

Remembered that 1.6 won't know about MethodHandles so must use reflection methods for them still.

6 years agoAdd sun.misc.Unsafe privileged retrieval to SecActions.
nickl- [Fri, 27 Oct 2017 04:59:33 +0000 (06:59 +0200)]
Add sun.misc.Unsafe privileged retrieval to SecActions.

Also do it anonomously so as not to raise the alarms and upset the powers to be.

6 years agoType check and paramatized rawtypes for SecurityActions.
nickl- [Fri, 27 Oct 2017 04:50:16 +0000 (06:50 +0200)]
Type check and paramatized rawtypes for SecurityActions.

Some whitespace got shunted around a bit too.

6 years agoAdd getMethodHandle to SecurityActions.
nickl- [Fri, 27 Oct 2017 04:43:49 +0000 (06:43 +0200)]
Add getMethodHandle to SecurityActions.

The main advantage is that we can do the privileged setAccessible during creation and
then freely invoke via the authorized method handle.

As per the javadocs:
Access checks are applied in the factory methods of Lookup, when a method handle is created.
his is a key difference from the Core Reflection API, since java.lang.reflect.Method.invoke
performs access checking against every caller, on every call.

The performance boost is just a bonus.

6 years agoMake an effort to secure privileged use.
nickl- [Wed, 25 Oct 2017 18:40:04 +0000 (20:40 +0200)]
Make an effort to secure privileged use.

Oracle (or maybe it was still Sun) warns that we should prevent from exposing access we gain to
privileged functionality like the unsafe etc. Before Oracle decides to restrict us even more lets
make an effort at least.

6 years agoCleanup
Christian Melchior [Sun, 12 Nov 2017 14:39:20 +0000 (15:39 +0100)]
Cleanup

6 years agoMerge branch 'master' into cm/bug/classpath-close
Christian Melchior [Sun, 12 Nov 2017 14:37:15 +0000 (15:37 +0100)]
Merge branch 'master' into cm/bug/classpath-close

# Conflicts:
# pom.xml
# src/main/javassist/ByteArrayClassPath.java
# src/main/javassist/ClassClassPath.java
# src/main/javassist/ClassPoolTail.java
# src/main/javassist/LoaderClassPath.java
# src/main/javassist/URLClassPath.java

6 years agoRemove close method on ClassPath. Add unit tests for new behaviour.
Christian Melchior [Sun, 12 Nov 2017 14:17:19 +0000 (15:17 +0100)]
Remove close method on ClassPath. Add unit tests for new behaviour.

6 years agoUpdate test README
Christian Melchior [Sun, 12 Nov 2017 14:11:37 +0000 (15:11 +0100)]
Update test README

6 years agoIgnore IntelliJ files
Christian Melchior [Sun, 12 Nov 2017 11:34:10 +0000 (12:34 +0100)]
Ignore IntelliJ files

6 years agoMerge pull request #160 from nickl-/squash-warnings
Shigeru Chiba [Sun, 12 Nov 2017 06:45:25 +0000 (15:45 +0900)]
Merge pull request #160 from nickl-/squash-warnings

Source walk/Spring clean/Parameterize/Enhance/Squash warnings et.al.

6 years agoOrganize imports to disolve ambiguity. 160/head
nickl- [Mon, 30 Oct 2017 19:27:52 +0000 (21:27 +0200)]
Organize imports to disolve ambiguity.

6 years agoSquash compiler warnings in tests.
nickl- [Mon, 30 Oct 2017 18:43:30 +0000 (20:43 +0200)]
Squash compiler warnings in tests.

With the unit tests warnings were squashed by suppressing them with SuppressWarnings annotations, instead of
reparing the issues as was done with the source. Reasons being...
 * The tests might be relying on the types as they were defined.
 * If the tests were written to test against the correct forms they would've/should've stipulated those.
 * Even unused members might be important to tests so we attempt to change as little as possible.

6 years agoSource walk/Spring clean/Parameterize/Enhance et.al.
nickl- [Mon, 30 Oct 2017 18:37:23 +0000 (20:37 +0200)]
Source walk/Spring clean/Parameterize/Enhance et.al.

The following were applied during multiple itterations through the source.
 * Parameterize raw types.
 * Mark unused members.
 * Annotate override and deprecated methods.
 * Convert loops to enhance for loop.
 * Remove redundant else statements.
 * Widening collection type references.
 * Optimize code for improved readability.
 * Squash compiler warnings.
 * Identify smells.

6 years agoFix deperecated junit.framework.Assert.
nickl- [Mon, 30 Oct 2017 06:07:43 +0000 (08:07 +0200)]
Fix deperecated junit.framework.Assert.

Changed to org.junit.Assert.