aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #168 from cmelchior/cm/bug/classpath-closeShigeru Chiba2018-05-077-75/+30
|\ | | | | [WIP] Fix leaking file handlers
| * Fix merge mistakeChristian Melchior2017-11-132-2/+0
| |
| * Merge branch 'master' into cm/bug/classpath-closeChristian Melchior2017-11-12180-2463/+3787
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | # 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
| * | Remove close method on ClassPath. Add unit tests for new behaviour.Christian Melchior2017-11-126-68/+33
| | |
* | | fixes a bug reported in issue #155 (Javassist Incorrect Code when wrapping ↵chibash2017-11-151-1/+0
| | | | | | | | | | | | with try/catch)
* | | adds Modifier#isVarArgs()chibash2017-11-151-0/+8
| | |
* | | changes getDefinedPackage back to getPackage when Java is < 9.chibash2017-11-151-1/+10
| | |
* | | Merge pull request #159 from nickl-/scoped-poolShigeru Chiba2017-11-154-71/+136
|\ \ \ | | | | | | | | Fixes to javassist.scopepool
| * | | Fixes to javassist.scopepoolnickl-2017-11-124-71/+136
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #158 from nickl-/secure-privilegedShigeru Chiba2017-11-154-188/+534
|\ \ \ | | | | | | | | Secure privileged
| * | | Define parameters for returned iterator.nickl-2017-11-121-1/+1
| | | |
| * | | Some code comments to fill in gaps.nickl-2017-11-121-0/+30
| | | |
| * | | Even now Oracle still not happy.nickl-2017-11-122-12/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Refactor definePackage as well.nickl-2017-11-122-64/+184
| | | | | | | | | | | | | | | | Yes it is deprecated but seems the right thing to do
| * | | Give helper private constructor fwiw.nickl-2017-11-121-1/+2
| | | | | | | | | | | | | | | | | | | | Wont stop you from getting an instance but it makes it more trouble at least. Also reduce the visibility of the enum method.
| * | | Add caller class checking.nickl-2017-11-122-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | MethodHandles for JDK7+.nickl-2017-11-121-5/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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...
| * | | Refactored SecActs methods and retain 1.6 source.nickl-2017-11-121-45/+73
| | | | | | | | | | | | | | | | Remembered that 1.6 won't know about MethodHandles so must use reflection methods for them still.
| * | | Add sun.misc.Unsafe privileged retrieval to SecActions.nickl-2017-11-121-0/+29
| | | | | | | | | | | | | | | | Also do it anonomously so as not to raise the alarms and upset the powers to be.
| * | | Type check and paramatized rawtypes for SecurityActions.nickl-2017-11-121-38/+41
| | | | | | | | | | | | | | | | Some whitespace got shunted around a bit too.
| * | | Add getMethodHandle to SecurityActions.nickl-2017-11-121-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | Make an effort to secure privileged use.nickl-2017-11-121-76/+82
| |/ / | | | | | | | | | | | | | | | 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.
* / / Fix #152 inner class modifiers.nickl-2017-11-121-3/+13
|/ / | | | | | | | | Applied fix for #152 "Wrong modifiers returned for nested classes" as suggested by @pietrobraione. Includes unit tests for all access modifiers and static.
* | Organize imports to disolve ambiguity.nickl-2017-10-30106-238/+720
| |
* | Source walk/Spring clean/Parameterize/Enhance et.al.nickl-2017-10-30160-2237/+2938
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Implement hashCode for Annotation.nickl-2017-10-301-0/+6
| | | | | | | | To honour the Object.equals contract.
* | Implement hashCode for Type.nickl-2017-10-301-0/+5
| | | | | | | | To honour the Object.equals contract.
* | Implement hashCode for MultiType.nickl-2017-10-301-0/+8
| | | | | | | | To honour the Object.equals contract.
* | Implement hashCode for MultiArrayType.nickl-2017-10-301-0/+6
| | | | | | | | To honour the Object.equals contract.
* | Suppress deprecation Applet.nickl-2017-10-281-2/+2
| |
* | Fix deprecation getPackage to getDefinedPackagenickl-2017-10-281-1/+1
| |
* | Added default serialVersionUID.nickl-2017-10-2851-1/+125
|/
* changes ClassPool#appendSystemPath(). The new implementation appends ↵3.22-old-style-sourcechibash2017-10-271-2/+6
| | | | ClassClassPath when the JVM is earlier than 9.
* fixes a bug of getAnnotations(). Some hidden annotations were not ignored.chibash2017-10-271-0/+4
|
* 3.22.0-GA releaserel_3_22_0_galistchibash2017-10-103-3/+3
|
* updates ConstPool to support Module and Packagechibash2017-09-122-2/+150
|
* modifies CtClass#setModifiers() to correctly support inner classes.chibash2017-06-014-76/+56
|
* delete testHotswap() because java 9 does not seem to allow a java agent to ↵chibash2017-05-311-2/+1
| | | | be attached after the JVM starts
* to support Java 9-ea+171chibash2017-05-311-1/+1
|
* modifies the version numberrel_3_22_0_cr2chibash2017-04-171-2/+2
|
* adds javassist.util.HotSwapAgentchibash2017-04-162-0/+228
|
* adds javassist.util.proxy.ProxyFactory#onlyPublicMethods. If true, ↵chibash2017-04-153-14/+57
| | | | Javassist uses java.lang.invoke.MethodHandles.Lookup to load a class.
* Merge pull request #130 from andresluuk/patch-1Shigeru Chiba2017-04-131-1/+1
|\ | | | | A fix for older JDK8 versions: https://bugs.openjdk.java.net/browse/JDK-8041920
| * Update ClassFile.javaAndres Luuk2017-04-101-1/+1
| | | | | | | | A fix for older JDK8 versions: https://bugs.openjdk.java.net/browse/JDK-8041920 This caused random failures a little time after startup. Reported now so that when we upgrade javassist for JDK9 then we would not have to fork this class.
* | modifies to use sun.misc.Unsafe#defineClass so that Javassist can run with ↵chibash2017-04-134-122/+191
|/ | | | jigsaw
* updates the test code to run on Java 9 EA+149.chibash2016-12-201-1/+1
| | | | | | | | Due to the specification change of jigsaw, ClassLoader#defineClass() cannot be invoked through reflection API. As a workaround, --add-opens java.base/java.lang=ALL-UNNAMED must be given to the JVM. The ant target "runtest9" adds this jvm argument.
* removes javassist.ModuleClassPath.chibash2016-12-165-177/+4
| | | | | | See #ClassFilesAsResources in JSR 376. We don't need to hack the module system to read a class file in java.lang. http://openjdk.java.net/projects/jigsaw/spec/issues/
* implements better annotation handling since Javassist may fail tochibash2016-10-142-4/+14
| | | | create a proxy object due to access controls by jigsaw.
* release 3.22.0-CR1rel_3_22_0_cr1chibash2016-10-052-2/+2
|
* Merge branch 'test/java9-jigsaw'chibash2016-10-0527-58/+270
|\