| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|\
| |
| | |
JASSIST-271 Allow running on Java 11 by falling back to ClassLoader.defineClass for Java > 10
|
| |
| |
| |
| | |
ClassLoader.defineClass for Java > 10
|
|\ \
| |/
|/| |
[WIP] Fix leaking file handlers
|
| | |
|
| | |
|
| | |
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
# 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
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
with try/catch)
|
| | | |
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
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.
|
|\ \ \
| | | |
| | | | |
Secure privileged
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | | |
| | | |
| | | |
| | | | |
Yes it is deprecated but seems the right thing to do
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Wont stop you from getting an instance but it makes it more trouble at least.
Also reduce the visibility of the enum method.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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...
|
| | | |
| | | |
| | | |
| | | | |
Remembered that 1.6 won't know about MethodHandles so must use reflection methods for them still.
|
| | | |
| | | |
| | | |
| | | | |
Also do it anonomously so as not to raise the alarms and upset the powers to be.
|
| | | |
| | | |
| | | |
| | | | |
Some whitespace got shunted around a bit too.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
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.
|
|/ /
| |
| |
| |
| | |
Applied fix for #152 "Wrong modifiers returned for nested classes" as suggested by @pietrobraione.
Includes unit tests for all access modifiers and static.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| | |
Changed to org.junit.Assert.
|
| |
| |
| |
| | |
Changed to org.junit.Assert.
|
| |
| |
| |
| | |
To honour the Object.equals contract.
|
| |
| |
| |
| | |
To honour the Object.equals contract.
|
| |
| |
| |
| | |
To honour the Object.equals contract.
|
| |
| |
| |
| | |
To honour the Object.equals contract.
|
| |
| |
| |
| | |
Changed to org.junit.Assert.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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 the test output folder 'runtests' to target or build directory so that mvn clean can clean that.
|