aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* updates for release 3.23.0-GArel_3_23_0_gachibash2018-06-213-7/+7
|
* fixes a minor bug in a test case.chibash2018-05-082-1/+1
|
* Merge pull request #198 from beikov/JASSIST-271Shigeru Chiba2018-05-072-6/+36
|\ | | | | JASSIST-271 Allow running on Java 11 by falling back to ClassLoader.defineClass for Java > 10
| * JASSIST-271 Allow running on Java 11 by falling back to ↵Christian Beikov2018-04-292-6/+36
| | | | | | | | ClassLoader.defineClass for Java > 10
* | Merge pull request #168 from cmelchior/cm/bug/classpath-closeShigeru Chiba2018-05-0712-77/+96
|\ \ | |/ |/| [WIP] Fix leaking file handlers
| * Add missing unit testChristian Melchior2017-11-134-2/+24
| |
| * Fix merge mistakeChristian Melchior2017-11-132-2/+0
| |
| * CleanupChristian Melchior2017-11-122-4/+0
| |
| * Merge branch 'master' into cm/bug/classpath-closeChristian Melchior2017-11-12247-2492/+3936
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | # 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-129-68/+62
| | |
| * | Update test READMEChristian Melchior2017-11-121-2/+19
| | |
* | | fixes a bug reported in issue #155 (Javassist Incorrect Code when wrapping ↵chibash2017-11-153-1/+39
| | | | | | | | | | | | with try/catch)
* | | adds Modifier#isVarArgs()chibash2017-11-151-0/+6
| | |
* | | adds Modifier#isVarArgs()chibash2017-11-152-0/+14
| | |
* | | changes getDefinedPackage back to getPackage when Java is < 9.chibash2017-11-151-1/+10
| | |
* | | Merge pull request #159 from nickl-/scoped-poolShigeru Chiba2017-11-1514-71/+650
|\ \ \ | | | | | | | | Fixes to javassist.scopepool
| * | | Fixes to javassist.scopepoolnickl-2017-11-1214-71/+650
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-155-188/+815
|\ \ \ | | | | | | | | Secure privileged
| * | | Define parameters for returned iterator.nickl-2017-11-121-1/+1
| | | |
| * | | Some functional unit tests proofs.nickl-2017-11-121-0/+281
| | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | | 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.
* | | Merge pull request #166 from nickl-/test-ctfield-make-with-thisShigeru Chiba2017-11-142-0/+15
|\ \ \ | | | | | | | | Unit Test: CtField.make referencing 'this'.
| * | | Unit Test: CtField.make referencing 'this'.nickl-2017-11-122-0/+15
| |/ / | | | | | | | | | | | | 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.
* / / Fix #152 inner class modifiers.nickl-2017-11-123-3/+72
|/ / | | | | | | | | 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
| |
* | Squash compiler warnings in tests.nickl-2017-10-3057-0/+63
| | | | | | | | | | | | | | | | 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.
* | 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.
* | Fix deperecated junit.framework.Assert.nickl-2017-10-301-1/+3
| | | | | | | | Changed to org.junit.Assert.
* | Fix deperecated junit.framework.Assert.nickl-2017-10-301-1/+1
| | | | | | | | Changed to org.junit.Assert.
* | 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.
* | Fix deperecated junit.framework.Assert.nickl-2017-10-301-1/+1
| | | | | | | | Changed to org.junit.Assert.
* | Suppress deprecation Applet.nickl-2017-10-281-2/+2
| |
* | Suppress deprecation ClassPool.makePackagenickl-2017-10-281-0/+2
| |
* | Fix deprecation getPackage to getDefinedPackagenickl-2017-10-281-1/+1
| |
* | Added default serialVersionUID.nickl-2017-10-2865-7/+192
| |
* | Upgrade junit from ver 3 to 4.nickl-2017-10-275-17/+9
| | | | | | | | | | | | | | | | | | There were minimal changes: Some tests had their own runners these were discontinued as IDEs/maven run the tests anyway. Removed the main methods for these. 2 tests were dependent on the running order so added the test sorter. All tests succeed on junit 4 with legacy support.
* | Move runtests to build directory.nickl-2017-10-272-3/+3
|/ | | | Move the test output folder 'runtests' to target or build directory so that mvn clean can clean that.