Class AgentSharedInstanceHooks
Why these three
SimpleDateFormat, Matcher and MessageDigest share a shape:
each keeps mutable parsing or digest state inside the instance, each is documented as unsafe for
concurrent use, and each is routinely cached in a static field because constructing one is
expensive. That combination is one of the oldest concurrency bugs in Java, and until now this
library could only see it if the test author called a record method by hand, which means
seeing it only when they already suspected it.
The mechanism is the one AgentCollectionHooks documents: substituting the invocation
with a static hook whose first parameter is the receiver hands the instance over without spilling
arguments, so the operand stack shape is unchanged and no member is added.
Why the shared-instance family and not every stateful JDK type
Each entry costs a rewritten instruction in every woven method that calls it, so the table is
not a place to be generous. These three earn it by being both common and unambiguous: unlike
Random, none of them has a thread-safe subclass that a call site could be holding, so a
substituted call cannot be recording an instance that was safe all along. ThreadLocalRandom
is exactly that hazard, which is why Random is absent here.
Sharing is decided by the detector, not by this class. A hook fires on every call, and the detector reports only when it has seen more than one thread touch the same instance, so a confined formatter used a thousand times costs a map lookup and produces nothing.
- Since:
- 1.10.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidWeavesCalendar.add(int, int)(#820).static Appendableappend(Appendable receiver, char value) WeavesAppendable.append(char), recording only when the receiver is aStringBuilder.static Appendableappend(Appendable receiver, CharSequence value) WeavesAppendable.append(CharSequence), recording only when the receiver is aStringBuilder.static Appendableappend(Appendable receiver, CharSequence value, int start, int end) WeavesAppendable.append(CharSequence, int, int), recording only when the receiver is aStringBuilder.static StringBuilderappend(StringBuilder receiver, boolean value) WeavesStringBuilder.append(boolean).static StringBuilderappend(StringBuilder receiver, char value) WeavesStringBuilder.append(char).static StringBuilderappend(StringBuilder receiver, double value) WeavesStringBuilder.append(double).static StringBuilderappend(StringBuilder receiver, int value) WeavesStringBuilder.append(int).static StringBuilderappend(StringBuilder receiver, long value) WeavesStringBuilder.append(long).static StringBuilderappend(StringBuilder receiver, CharSequence value) WeavesStringBuilder.append(CharSequence).static StringBuilderappend(StringBuilder receiver, Object value) WeavesStringBuilder.append(Object).static StringBuilderappend(StringBuilder receiver, String value) WeavesStringBuilder.append(String).static intbreakCurrent(BreakIterator receiver) WeavesBreakIterator.current(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static intbreakFirst(BreakIterator receiver) WeavesBreakIterator.first(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static intbreakFollowing(BreakIterator receiver, int offset) WeavesBreakIterator.following(int): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static CharacterIteratorbreakGetText(BreakIterator receiver) WeavesBreakIterator.getText(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static booleanbreakIsBoundary(BreakIterator receiver, int offset) WeavesBreakIterator.isBoundary(int): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static intbreakLast(BreakIterator receiver) WeavesBreakIterator.last(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static intbreakNext(BreakIterator receiver) WeavesBreakIterator.next(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static intbreakNext(BreakIterator receiver, int n) WeavesBreakIterator.next(int): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static intbreakPreceding(BreakIterator receiver, int offset) WeavesBreakIterator.preceding(int): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static intbreakPrevious(BreakIterator receiver) WeavesBreakIterator.previous(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static voidbreakSetText(BreakIterator receiver, String text) WeavesBreakIterator.setText(String): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static voidbreakSetText(BreakIterator receiver, CharacterIterator text) WeavesBreakIterator.setText(CharacterIterator): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static ByteBufferclear(ByteBuffer receiver) static voidWeavesCalendar.clear()(#820): every field is left unset, so the nextgetrecomputes them, as after aset.static voidWeavesCalendar.clear(int)(#820), recorded asclear(Calendar)is.static ByteBuffercompact(ByteBuffer receiver) static CharBufferdecode(CharsetDecoder receiver, ByteBuffer in) static CoderResultdecode(CharsetDecoder receiver, ByteBuffer in, CharBuffer out, boolean endOfInput) static intstatic intstatic intstatic intdeflate(Deflater receiver, ByteBuffer output) static intdeflate(Deflater receiver, ByteBuffer output, int flush) static byte[]digest(MessageDigest receiver) WeavesMessageDigest.digest().static byte[]digest(MessageDigest receiver, byte[] input) WeavesMessageDigest.digest(byte[]).static intdigest(MessageDigest receiver, byte[] output, int offset, int length) WeavesMessageDigest.digest(byte[], int, int).static byte[]WeavesCipher.doFinal().static byte[]WeavesCipher.doFinal(byte[]).static intWeavesCipher.doFinal(byte[], int).static byte[]WeavesCipher.doFinal(byte[], int, int).static intWeavesCipher.doFinal(byte[], int, int, byte[]).static intWeavesCipher.doFinal(byte[], int, int, byte[], int).static intdoFinal(Cipher receiver, ByteBuffer a0, ByteBuffer a1) WeavesCipher.doFinal(ByteBuffer, ByteBuffer).static byte[]WeavesMac.doFinal().static byte[]WeavesMac.doFinal(byte[]).static voidWeavesMac.doFinal(byte[], int).static ByteBufferencode(CharsetEncoder receiver, CharBuffer in) static CoderResultencode(CharsetEncoder receiver, CharBuffer in, ByteBuffer out, boolean endOfInput) static voidstatic voidstatic booleanWeavesMatcher.find().static booleanWeavesMatcher.find(int), which resets the matcher before searching.static voidstatic ByteBufferflip(ByteBuffer receiver) static CoderResultflush(CharsetDecoder receiver, CharBuffer out) static CoderResultflush(CharsetEncoder receiver, ByteBuffer out) static Stringformat(DateFormat receiver, Date date) WeavesDateFormat.format(Date), recording only when the receiver is aSimpleDateFormat.static StringWeavesFormat.format(Object), the call everyjava.textformat inherits.static Stringformat(NumberFormat receiver, double value) WeavesNumberFormat.format(double), which coversDecimalFormat.static Stringformat(NumberFormat receiver, long value) WeavesNumberFormat.format(long).static Stringformat(SimpleDateFormat receiver, Date date) WeavesSimpleDateFormat.format(Date).static FormatterWeavesjava.util.Formatter.format(String, Object...).static FormatterWeavesFormatter.format(Locale, String, Object...).static byteget(ByteBuffer receiver) static ByteBufferget(ByteBuffer receiver, byte[] dst) static ByteBufferget(ByteBuffer receiver, byte[] dst, int offset, int length) static intWeavesCalendar.get(int).static intgetInt(ByteBuffer receiver) static longgetLong(ByteBuffer receiver) static longstatic StringWeavesMatcher.group().static StringWeavesMatcher.group(int).static StringWeavesMatcher.group(String), the named-group form of the overload above.static intstatic intstatic intinflate(Inflater receiver, ByteBuffer output) static voidinit(Cipher receiver, int opmode, Certificate certificate) WeavesCipher.init(int, Certificate).static voidinit(Cipher receiver, int opmode, Certificate certificate, SecureRandom random) WeavesCipher.init(int, Certificate, SecureRandom).static voidWeavesCipher.init(int, Key).static voidinit(Cipher receiver, int opmode, Key key, AlgorithmParameters params) WeavesCipher.init(int, Key, AlgorithmParameters).static voidinit(Cipher receiver, int opmode, Key key, AlgorithmParameters params, SecureRandom random) WeavesCipher.init(int, Key, AlgorithmParameters, SecureRandom).static voidinit(Cipher receiver, int opmode, Key key, SecureRandom random) WeavesCipher.init(int, Key, SecureRandom).static voidinit(Cipher receiver, int opmode, Key key, AlgorithmParameterSpec params) WeavesCipher.init(int, Key, AlgorithmParameterSpec).static voidinit(Cipher receiver, int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) WeavesCipher.init(int, Key, AlgorithmParameterSpec, SecureRandom).static voidWeavesMac.init(Key).static voidinit(Mac receiver, Key key, AlgorithmParameterSpec params) WeavesMac.init(Key, AlgorithmParameterSpec).static voidinitSign(Signature receiver, PrivateKey privateKey) WeavesSignature.initSign(PrivateKey).static voidinitSign(Signature receiver, PrivateKey privateKey, SecureRandom random) WeavesSignature.initSign(PrivateKey, SecureRandom).static voidinitVerify(Signature receiver, Certificate certificate) WeavesSignature.initVerify(Certificate).static voidinitVerify(Signature receiver, PublicKey publicKey) WeavesSignature.initVerify(PublicKey).static StringJoinerjoinerAdd(StringJoiner receiver, CharSequence element) WeavesStringJoiner.add(CharSequence): an append to the joiner's unsynchronised array, recorded on theSTRING_BUILDERdetector as a builder's is (#1309).static intjoinerLength(StringJoiner receiver) WeavesStringJoiner.length(), a read (#1309).static StringJoinerjoinerMerge(StringJoiner receiver, StringJoiner other) WeavesStringJoiner.merge(StringJoiner): a write of the receiver and a read of the joiner merged in (#1309).static StringJoinerjoinerSetEmptyValue(StringJoiner receiver, CharSequence emptyValue) WeavesStringJoiner.setEmptyValue(CharSequence), a write (#1309).static StringjoinerToString(StringJoiner receiver) WeavesStringJoiner.toString(), a read (#1309).static booleanWeavesMatcher.matches().static booleannextBoolean(SplittableRandom receiver) static voidnextBytes(SplittableRandom receiver, byte[] bytes) static doublenextDouble(SplittableRandom receiver) static doublenextDouble(SplittableRandom receiver, double bound) static doublenextDouble(SplittableRandom receiver, double origin, double bound) static intnextInt(SplittableRandom receiver) static intnextInt(SplittableRandom receiver, int bound) static intnextInt(SplittableRandom receiver, int origin, int bound) static longnextLong(SplittableRandom receiver) static longnextLong(SplittableRandom receiver, long bound) static longnextLong(SplittableRandom receiver, long origin, long bound) static Dateparse(DateFormat receiver, String source) WeavesDateFormat.parse(String), recording only when the receiver is aSimpleDateFormat.static Dateparse(DateFormat receiver, String source, ParsePosition position) WeavesDateFormat.parse(String, ParsePosition), recording only when the receiver is aSimpleDateFormat.static Object[]parse(MessageFormat receiver, String source) WeavesMessageFormat.parse(String).static Numberparse(NumberFormat receiver, String source) WeavesNumberFormat.parse(String).static Numberparse(NumberFormat receiver, String source, ParsePosition position) WeavesNumberFormat.parse(String, ParsePosition).static Dateparse(SimpleDateFormat receiver, String source) WeavesSimpleDateFormat.parse(String).static Dateparse(SimpleDateFormat receiver, String source, ParsePosition position) WeavesSimpleDateFormat.parse(String, ParsePosition).static ObjectparseObject(Format receiver, String source) WeavesFormat.parseObject(String); records whatformat(Format, Object)does.static voidpersistenceHandleClosed(Object handle) Called before a wovenclose()on a persistence handle: the thread lets it go, which is the per-transaction hand-off the detector excuses when no two threads held it at once (#992).static voidpersistenceHandleUsed(Object handle) Called before each call on a JPAEntityManageror HibernateSessionthe agent weaves, with the handle: the call's thread uses it (#992).static ByteBufferput(ByteBuffer receiver, byte b) static ByteBufferput(ByteBuffer receiver, byte[] src) static ByteBufferput(ByteBuffer receiver, byte[] src, int offset, int length) static ByteBufferput(ByteBuffer receiver, ByteBuffer src) static ByteBufferputInt(ByteBuffer receiver, int value) static ByteBufferputLong(ByteBuffer receiver, long value) static CharsetDecoderreset(CharsetDecoder receiver) static CharsetEncoderreset(CharsetEncoder receiver) static voidstatic voidstatic voidstatic voidWeavesMac.reset().static ByteBufferrewind(ByteBuffer receiver) static voidWeavesCalendar.roll(int, boolean)(#820), recorded asroll(Calendar, int, int)is.static voidWeavesCalendar.roll(int, int)(#820): recorded as an add that leaves the fields to recompute, except on a plainGregorianCalendar, where a roll by 0 changes nothing and a roll ofHOURorHOUR_OF_DAYkeeps every field computed, as asetTimedoes.static voidWeavesCalendar.set(int, int).static voidWeavesCalendar.set(int, int, int).static voidWeavesCalendar.set(int, int, int, int, int).static voidWeavesCalendar.set(int, int, int, int, int, int).static voidstatic voidstatic voidsetInput(Deflater receiver, ByteBuffer input) static voidstatic voidstatic voidsetInput(Inflater receiver, ByteBuffer input) static voidWeavesCalendar.setTime(Date)(#820): a write that computes every field at once, so the nextgetonly reads.static voidsetTimeInMillis(Calendar receiver, long millis) WeavesCalendar.setTimeInMillis(long)(#820), recorded assetTime(java.util.Calendar, java.util.Date)is.static voidsetTimeZone(Calendar receiver, TimeZone zone) WeavesCalendar.setTimeZone(TimeZone)(#820): the fields are left to recompute in the new zone, so the nextgetwrites them, as after aset.static byte[]WeavesSignature.sign().static intWeavesSignature.sign(byte[], int, int).static SplittableRandomsplit(SplittableRandom receiver) static SplittableRandomsplit(SplittableRandom receiver, RandomGenerator.SplittableGenerator source) static inttokenizerCountTokens(StringTokenizer receiver) WeavesStringTokenizer.countTokens(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static booleantokenizerHasMoreElements(StringTokenizer receiver) WeavesStringTokenizer.hasMoreElements(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static booleantokenizerHasMoreTokens(StringTokenizer receiver) WeavesStringTokenizer.hasMoreTokens(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static ObjecttokenizerNextElement(StringTokenizer receiver) WeavesStringTokenizer.nextElement(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static StringtokenizerNextToken(StringTokenizer receiver) WeavesStringTokenizer.nextToken(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static StringtokenizerNextToken(StringTokenizer receiver, String delimiters) WeavesStringTokenizer.nextToken(String): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).static KeyWeavesCipher.unwrap(byte[], String, int).static voidupdate(MessageDigest receiver, byte input) WeavesMessageDigest.update(byte).static voidupdate(MessageDigest receiver, byte[] input) WeavesMessageDigest.update(byte[]).static voidupdate(MessageDigest receiver, byte[] input, int offset, int length) WeavesMessageDigest.update(byte[], int, int), the ranged form.static voidupdate(MessageDigest receiver, ByteBuffer input) WeavesMessageDigest.update(ByteBuffer).static voidWeavesSignature.update(byte).static voidWeavesSignature.update(byte[]).static voidWeavesSignature.update(byte[], int, int).static voidupdate(Signature receiver, ByteBuffer a0) WeavesSignature.update(ByteBuffer).static voidstatic voidstatic voidstatic voidupdate(Checksum receiver, ByteBuffer buffer) static byte[]WeavesCipher.update(byte[]).static byte[]WeavesCipher.update(byte[], int, int).static intWeavesCipher.update(byte[], int, int, byte[]).static intWeavesCipher.update(byte[], int, int, byte[], int).static intupdate(Cipher receiver, ByteBuffer a0, ByteBuffer a1) WeavesCipher.update(ByteBuffer, ByteBuffer).static voidWeavesMac.update(byte).static voidWeavesMac.update(byte[]).static voidWeavesMac.update(byte[], int, int).static voidupdate(Mac receiver, ByteBuffer a0) WeavesMac.update(ByteBuffer).static voidWeavesCipher.updateAAD(byte[]).static voidWeavesCipher.updateAAD(byte[], int, int).static voidupdateAAD(Cipher receiver, ByteBuffer a0) WeavesCipher.updateAAD(ByteBuffer).static booleanWeavesSignature.verify(byte[]).static booleanWeavesSignature.verify(byte[], int, int).static byte[]WeavesCipher.wrap(Key).
-
Method Details
-
format
WeavesSimpleDateFormat.format(Date).- Parameters:
receiver- the formatterdate- the date to format- Returns:
- the formatted text
-
parse
WeavesSimpleDateFormat.parse(String).- Parameters:
receiver- the formattersource- the text to parse- Returns:
- the parsed date
- Throws:
ParseException- if the text cannot be parsed
-
parse
WeavesSimpleDateFormat.parse(String, ParsePosition).The incremental parse, used when walking a string containing several dates. It advances the position object and drives the same internal calendar the other overload does, and it was not woven (#434).
- Parameters:
receiver- the formattersource- the text to parseposition- where to start, updated to where parsing stopped- Returns:
- the parsed date, or
nullif the text did not match
-
format
WeavesDateFormat.format(Date), recording only when the receiver is aSimpleDateFormat.Library code rarely holds the concrete type. Jackson builds
SimpleDateFormatinstances and keeps them inDateFormatfields, and the weaver matches a call only when its owner is the entry's type or a subtype, so none of those calls was substituted (#542).DateFormathas subclasses of every kind, including stateless ones, so the static type is not evidence and the runtime type is checked before recording.- Parameters:
receiver- the formatdate- the date to format- Returns:
- the formatted text
- Since:
- 1.12.1
-
parse
WeavesDateFormat.parse(String), recording only when the receiver is aSimpleDateFormat.- Parameters:
receiver- the formatsource- the text to parse- Returns:
- the parsed date
- Throws:
ParseException- if the text cannot be parsed- Since:
- 1.12.1
-
parse
WeavesDateFormat.parse(String, ParsePosition), recording only when the receiver is aSimpleDateFormat.Jackson's
StdDateFormatparses RFC 1123 text through exactly this call, on aSimpleDateFormatit holds as aDateFormat.- Parameters:
receiver- the formatsource- the text to parseposition- where to start, updated to where parsing stopped- Returns:
- the parsed date, or
nullif the text did not match - Since:
- 1.12.1
-
find
WeavesMatcher.find().- Parameters:
receiver- the matcher- Returns:
- whether a match was found
-
matches
WeavesMatcher.matches().- Parameters:
receiver- the matcher- Returns:
- whether the whole region matched
-
group
WeavesMatcher.group().- Parameters:
receiver- the matcher- Returns:
- the matched subsequence
-
group
WeavesMatcher.group(int).find()thengroup(1)is the standard idiom, and the group-taking overload was the one not woven - so the most common way of reading a shared matcher's result was unobserved while the zero-argument form was seen (#434).- Parameters:
receiver- the matchergroup- the group index- Returns:
- the matched subsequence
-
group
WeavesMatcher.group(String), the named-group form of the overload above.- Parameters:
receiver- the matchername- the group name- Returns:
- the matched subsequence
-
find
WeavesMatcher.find(int), which resets the matcher before searching.- Parameters:
receiver- the matcherstart- the index to start from- Returns:
- whether a match was found
-
update
WeavesMessageDigest.update(byte[]).- Parameters:
receiver- the digestinput- the bytes to add
-
digest
WeavesMessageDigest.digest().- Parameters:
receiver- the digest- Returns:
- the computed hash
-
digest
WeavesMessageDigest.digest(byte[]).- Parameters:
receiver- the digestinput- the final bytes to add before computing- Returns:
- the computed hash
-
update
WeavesMessageDigest.update(byte).- Parameters:
receiver- the digestinput- the byte to accumulate
-
update
WeavesMessageDigest.update(byte[], int, int), the ranged form.- Parameters:
receiver- the digestinput- the buffer to accumulate fromoffset- where to startlength- how many bytes
-
update
WeavesMessageDigest.update(ByteBuffer).- Parameters:
receiver- the digestinput- the buffer to accumulate from
-
digest
public static int digest(MessageDigest receiver, byte[] output, int offset, int length) throws DigestException WeavesMessageDigest.digest(byte[], int, int).- Parameters:
receiver- the digestoutput- where to write the digestoffset- where to start writinglength- how much room there is- Returns:
- the number of bytes written
- Throws:
DigestException- if the output buffer is too small
-
get
WeavesCalendar.get(int).- Parameters:
receiver- the calendarfield- the field to read- Returns:
- the field's value
-
set
WeavesCalendar.set(int, int).- Parameters:
receiver- the calendarfield- the field to writevalue- the value to write
-
set
WeavesCalendar.set(int, int, int).The three date-setting overloads below are how calendars are actually populated -
set(field, value)one field at a time is the rarer shape - and none of them was woven (#434).- Parameters:
receiver- the calendaryear- the calendar year, as Calendar.YEAR takes itmonth- the zero-based month, as Calendar.MONTH takes itdate- the day of month
-
set
WeavesCalendar.set(int, int, int, int, int).- Parameters:
receiver- the calendaryear- the calendar year, as Calendar.YEAR takes itmonth- the zero-based month, as Calendar.MONTH takes itdate- the day of monthhour- the hour of dayminute- the minutes past the hour
-
set
public static void set(Calendar receiver, int year, int month, int date, int hour, int minute, int second) WeavesCalendar.set(int, int, int, int, int, int).- Parameters:
receiver- the calendaryear- the calendar year, as Calendar.YEAR takes itmonth- the zero-based month, as Calendar.MONTH takes itdate- the day of monthhour- the hour of dayminute- the minutes past the hoursecond- the seconds past the minute
-
add
WeavesCalendar.add(int, int)(#820).Recorded with the field, so an add to a field below
MONTH, which the JDK carries out as asetTimeInMillis, leaves the nextgeta read.- Parameters:
receiver- the calendarfield- the field to add toamount- the amount to add
-
roll
WeavesCalendar.roll(int, int)(#820): recorded as an add that leaves the fields to recompute, except on a plainGregorianCalendar, where a roll by 0 changes nothing and a roll ofHOURorHOUR_OF_DAYkeeps every field computed, as asetTimedoes.- Parameters:
receiver- the calendarfield- the field to rollamount- the signed amount to roll by
-
roll
WeavesCalendar.roll(int, boolean)(#820), recorded asroll(Calendar, int, int)is.- Parameters:
receiver- the calendarfield- the field to rollup- whether to roll up rather than down
-
clear
WeavesCalendar.clear()(#820): every field is left unset, so the nextgetrecomputes them, as after aset.- Parameters:
receiver- the calendar
-
clear
WeavesCalendar.clear(int)(#820), recorded asclear(Calendar)is.- Parameters:
receiver- the calendarfield- the field to clear
-
setTime
WeavesCalendar.setTime(Date)(#820): a write that computes every field at once, so the nextgetonly reads.- Parameters:
receiver- the calendardate- the time to set
-
setTimeInMillis
WeavesCalendar.setTimeInMillis(long)(#820), recorded assetTime(java.util.Calendar, java.util.Date)is.- Parameters:
receiver- the calendarmillis- the time to set, in milliseconds since the epoch
-
setTimeZone
WeavesCalendar.setTimeZone(TimeZone)(#820): the fields are left to recompute in the new zone, so the nextgetwrites them, as after aset.- Parameters:
receiver- the calendarzone- the time zone to set
-
append
WeavesStringBuilder.append(String).- Parameters:
receiver- the buildervalue- the text to append- Returns:
- the builder, so the call chain is unchanged
-
append
WeavesStringBuilder.append(int).- Parameters:
receiver- the buildervalue- the number to append- Returns:
- the builder, so the call chain is unchanged
-
append
WeavesStringBuilder.append(char).The five overloads below carry no new argument about correctness. They exist because the weaver matches an exact descriptor, so a shared builder appended to with a
charwas invisible while the same builder appended to with aStringwas not - andappend(char)readscount, writes the array and writescountback exactly as the others do. The gap was found by a corpus row that had to fire and did not (#434).- Parameters:
receiver- the buildervalue- the character to append- Returns:
- the builder, so the call chain is unchanged
-
append
WeavesStringBuilder.append(long).- Parameters:
receiver- the buildervalue- the number to append- Returns:
- the builder, so the call chain is unchanged
-
append
WeavesStringBuilder.append(double).- Parameters:
receiver- the buildervalue- the number to append- Returns:
- the builder, so the call chain is unchanged
-
append
WeavesStringBuilder.append(boolean).- Parameters:
receiver- the buildervalue- the flag to append- Returns:
- the builder, so the call chain is unchanged
-
append
WeavesStringBuilder.append(Object).- Parameters:
receiver- the buildervalue- the value to append- Returns:
- the builder, so the call chain is unchanged
-
append
WeavesStringBuilder.append(CharSequence).- Parameters:
receiver- the buildervalue- the sequence to append- Returns:
- the builder, so the call chain is unchanged
-
joinerAdd
WeavesStringJoiner.add(CharSequence): an append to the joiner's unsynchronised array, recorded on theSTRING_BUILDERdetector as a builder's is (#1309).- Parameters:
receiver- the joinerelement- the element to add- Returns:
- the joiner, so the call chain is unchanged
- Since:
- 1.14.4
-
joinerMerge
WeavesStringJoiner.merge(StringJoiner): a write of the receiver and a read of the joiner merged in (#1309).- Parameters:
receiver- the joiner merged intoother- the joiner whose contents are added- Returns:
- the receiver, so the call chain is unchanged
- Since:
- 1.14.4
-
joinerSetEmptyValue
WeavesStringJoiner.setEmptyValue(CharSequence), a write (#1309).- Parameters:
receiver- the joineremptyValue- what an empty joiner reads as- Returns:
- the joiner, so the call chain is unchanged
- Since:
- 1.14.4
-
joinerToString
WeavesStringJoiner.toString(), a read (#1309).- Parameters:
receiver- the joiner- Returns:
- the joined text
- Since:
- 1.14.4
-
joinerLength
WeavesStringJoiner.length(), a read (#1309).- Parameters:
receiver- the joiner- Returns:
- the length of the joined text
- Since:
- 1.14.4
-
tokenizerHasMoreTokens
WeavesStringTokenizer.hasMoreTokens(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the tokenizer- Returns:
- what the original call returns
- Since:
- 1.14.4
-
tokenizerNextToken
WeavesStringTokenizer.nextToken(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the tokenizer- Returns:
- what the original call returns
- Since:
- 1.14.4
-
tokenizerNextToken
WeavesStringTokenizer.nextToken(String): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the tokenizerdelimiters- as the original call takes it- Returns:
- what the original call returns
- Since:
- 1.14.4
-
tokenizerHasMoreElements
WeavesStringTokenizer.hasMoreElements(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the tokenizer- Returns:
- what the original call returns
- Since:
- 1.14.4
-
tokenizerNextElement
WeavesStringTokenizer.nextElement(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the tokenizer- Returns:
- what the original call returns
- Since:
- 1.14.4
-
tokenizerCountTokens
WeavesStringTokenizer.countTokens(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the tokenizer- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakSetText
WeavesBreakIterator.setText(String): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iteratortext- as the original call takes it- Since:
- 1.14.4
-
breakSetText
WeavesBreakIterator.setText(CharacterIterator): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iteratortext- as the original call takes it- Since:
- 1.14.4
-
breakFirst
WeavesBreakIterator.first(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iterator- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakLast
WeavesBreakIterator.last(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iterator- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakNext
WeavesBreakIterator.next(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iterator- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakNext
WeavesBreakIterator.next(int): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iteratorn- as the original call takes it- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakPrevious
WeavesBreakIterator.previous(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iterator- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakFollowing
WeavesBreakIterator.following(int): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iteratoroffset- as the original call takes it- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakPreceding
WeavesBreakIterator.preceding(int): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iteratoroffset- as the original call takes it- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakCurrent
WeavesBreakIterator.current(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iterator- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakIsBoundary
WeavesBreakIterator.isBoundary(int): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iteratoroffset- as the original call takes it- Returns:
- what the original call returns
- Since:
- 1.14.4
-
breakGetText
WeavesBreakIterator.getText(): a step of the instance's cursor, recorded on theSHARED_ITERATORdetector before it runs (#1322).- Parameters:
receiver- the break iterator- Returns:
- what the original call returns
- Since:
- 1.14.4
-
append
WeavesAppendable.append(CharSequence), recording only when the receiver is aStringBuilder.Library code appends through
Appendable: Guava'sJoiner.appendTotakes aStringBuilderand writes to it through that interface, so a builder shared across threads and handed to Guava was never observed (#542).Appendableis alsoStringBuffer,Writerand a dozen safe things, which is why the static type alone is not evidence and the runtime type is checked before recording.- Parameters:
receiver- the appendablevalue- the sequence to append- Returns:
- the receiver, so the call chain is unchanged
- Throws:
IOException- if the receiver's append throws- Since:
- 1.12.1
-
append
WeavesAppendable.append(char), recording only when the receiver is aStringBuilder.- Parameters:
receiver- the appendablevalue- the character to append- Returns:
- the receiver, so the call chain is unchanged
- Throws:
IOException- if the receiver's append throws- Since:
- 1.12.1
-
append
public static Appendable append(Appendable receiver, CharSequence value, int start, int end) throws IOException WeavesAppendable.append(CharSequence, int, int), recording only when the receiver is aStringBuilder.- Parameters:
receiver- the appendablevalue- the sequence to append fromstart- the first index to appendend- the index after the last one to append- Returns:
- the receiver, so the call chain is unchanged
- Throws:
IOException- if the receiver's append throws- Since:
- 1.12.1
-
format
WeavesNumberFormat.format(long).Formatting an integral value is at least as common as formatting a
double, and only thedoubleoverload was woven (#434).- Parameters:
receiver- the formatvalue- the number to format- Returns:
- the formatted text
-
format
WeavesNumberFormat.format(double), which coversDecimalFormat.- Parameters:
receiver- the formatvalue- the number to format- Returns:
- the formatted text
-
parse
WeavesNumberFormat.parse(String).Parsing drives the same digit list and position state formatting does, and a caller that hands a shared format to a parsing utility (Spring's
NumberUtils.parseNumbertakes one) was invisible while onlyformatwas woven (#542). Every JDKNumberFormatis unsafe to share, so no runtime check is needed here.- Parameters:
receiver- the formatsource- the text to parse- Returns:
- the parsed number
- Throws:
ParseException- if the text cannot be parsed- Since:
- 1.12.1
-
parse
WeavesNumberFormat.parse(String, ParsePosition).- Parameters:
receiver- the formatsource- the text to parseposition- where to start, updated to where parsing stopped- Returns:
- the parsed number, or
nullif the text did not match - Since:
- 1.12.1
-
format
WeavesFormat.format(Object), the call everyjava.textformat inherits.It is how a
BigDecimalor a boxed number reaches aDecimalFormatand how aMessageFormatis used at all, and it was invisible while the typed overloads were woven (#1319).Formatis also the immutable view of aDateTimeFormatterand any format an application wrote, so only aNumberFormat, aSimpleDateFormator aMessageFormatreceiver is recorded.- Parameters:
receiver- the formatvalue- the object to format- Returns:
- the formatted text
- Since:
- 1.14.3
-
parseObject
WeavesFormat.parseObject(String); records whatformat(Format, Object)does.- Parameters:
receiver- the formatsource- the text to parse- Returns:
- the parsed object
- Throws:
ParseException- if the text cannot be parsed- Since:
- 1.14.3
-
parse
WeavesMessageFormat.parse(String).- Parameters:
receiver- the formatsource- the text to parse- Returns:
- the parsed arguments
- Throws:
ParseException- if the text cannot be parsed- Since:
- 1.14.3
-
format
Weavesjava.util.Formatter.format(String, Object...).- Parameters:
receiver- the formatterformat- the format stringargs- the format arguments- Returns:
- the formatter, so the call chain is unchanged
-
format
WeavesFormatter.format(Locale, String, Object...).The locale-taking overload is the one an internationalised codebase actually calls, and it was invisible while its two-argument sibling was woven. Same receiver, same interleaved output, different descriptor (#434).
- Parameters:
receiver- the formatterlocale- the locale to format withformat- the format stringargs- the format arguments- Returns:
- the formatter, so the call chain is unchanged
-
persistenceHandleUsed
Called before each call on a JPAEntityManageror HibernateSessionthe agent weaves, with the handle: the call's thread uses it (#992). The detector checks the handle's type by interface name, since the library cannot depend on JPA.- Parameters:
handle- the call's receiver- Since:
- 1.13.2
-
persistenceHandleClosed
Called before a wovenclose()on a persistence handle: the thread lets it go, which is the per-transaction hand-off the detector excuses when no two threads held it at once (#992).- Parameters:
handle- the handle being closed- Since:
- 1.13.2
-
get
-
get
-
get
-
put
-
put
-
put
-
put
-
getInt
-
putInt
-
getLong
-
putLong
-
flip
-
clear
-
rewind
-
compact
-
encode
public static ByteBuffer encode(CharsetEncoder receiver, CharBuffer in) throws CharacterCodingException - Throws:
CharacterCodingException
-
encode
public static CoderResult encode(CharsetEncoder receiver, CharBuffer in, ByteBuffer out, boolean endOfInput) -
flush
-
reset
-
decode
public static CharBuffer decode(CharsetDecoder receiver, ByteBuffer in) throws CharacterCodingException - Throws:
CharacterCodingException
-
decode
public static CoderResult decode(CharsetDecoder receiver, ByteBuffer in, CharBuffer out, boolean endOfInput) -
flush
-
reset
-
update
-
update
-
update
-
update
-
getValue
-
reset
-
setInput
-
setInput
-
setInput
-
deflate
-
deflate
-
deflate
-
deflate
-
deflate
-
finish
-
reset
-
end
-
setInput
-
setInput
-
setInput
-
inflate
- Throws:
DataFormatException
-
inflate
public static int inflate(Inflater receiver, byte[] output, int off, int len) throws DataFormatException - Throws:
DataFormatException
-
inflate
- Throws:
DataFormatException
-
reset
-
end
-
nextInt
-
nextInt
-
nextInt
-
nextLong
-
nextLong
-
nextLong
-
nextDouble
-
nextDouble
-
nextDouble
-
nextBoolean
-
nextBytes
-
split
-
split
public static SplittableRandom split(SplittableRandom receiver, RandomGenerator.SplittableGenerator source) -
update
WeavesMac.update(byte).- Parameters:
receiver- the maca0- the call'sbyteargument, passed through
-
update
WeavesMac.update(byte[]).- Parameters:
receiver- the maca0- the call'sbyte[]argument, passed through
-
update
WeavesMac.update(byte[], int, int).- Parameters:
receiver- the maca0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed through
-
update
WeavesMac.update(ByteBuffer).- Parameters:
receiver- the maca0- the call'sByteBufferargument, passed through
-
doFinal
WeavesMac.doFinal().- Parameters:
receiver- the mac- Returns:
- what the mac returned
-
doFinal
WeavesMac.doFinal(byte[]).- Parameters:
receiver- the maca0- the call'sbyte[]argument, passed through- Returns:
- what the mac returned
-
doFinal
WeavesMac.doFinal(byte[], int).- Parameters:
receiver- the maca0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed through- Throws:
ShortBufferException- as the mac throws it
-
update
WeavesSignature.update(byte).- Parameters:
receiver- the signaturea0- the call'sbyteargument, passed through- Throws:
SignatureException- as the signature throws it
-
update
WeavesSignature.update(byte[]).- Parameters:
receiver- the signaturea0- the call'sbyte[]argument, passed through- Throws:
SignatureException- as the signature throws it
-
update
WeavesSignature.update(byte[], int, int).- Parameters:
receiver- the signaturea0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed through- Throws:
SignatureException- as the signature throws it
-
update
WeavesSignature.update(ByteBuffer).- Parameters:
receiver- the signaturea0- the call'sByteBufferargument, passed through- Throws:
SignatureException- as the signature throws it
-
sign
WeavesSignature.sign().- Parameters:
receiver- the signature- Returns:
- what the signature returned
- Throws:
SignatureException- as the signature throws it
-
sign
WeavesSignature.sign(byte[], int, int).- Parameters:
receiver- the signaturea0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed through- Returns:
- what the signature returned
- Throws:
SignatureException- as the signature throws it
-
verify
WeavesSignature.verify(byte[]).- Parameters:
receiver- the signaturea0- the call'sbyte[]argument, passed through- Returns:
- what the signature returned
- Throws:
SignatureException- as the signature throws it
-
verify
public static boolean verify(Signature receiver, byte[] a0, int a1, int a2) throws SignatureException WeavesSignature.verify(byte[], int, int).- Parameters:
receiver- the signaturea0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed through- Returns:
- what the signature returned
- Throws:
SignatureException- as the signature throws it
-
update
WeavesCipher.update(byte[]).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed through- Returns:
- what the cipher returned
-
update
WeavesCipher.update(byte[], int, int).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed through- Returns:
- what the cipher returned
-
update
public static int update(Cipher receiver, byte[] a0, int a1, int a2, byte[] a3) throws ShortBufferException WeavesCipher.update(byte[], int, int, byte[]).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed througha3- the call'sbyte[]argument, passed through- Returns:
- what the cipher returned
- Throws:
ShortBufferException- as the cipher throws it
-
update
public static int update(Cipher receiver, byte[] a0, int a1, int a2, byte[] a3, int a4) throws ShortBufferException WeavesCipher.update(byte[], int, int, byte[], int).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed througha3- the call'sbyte[]argument, passed througha4- the call'sintargument, passed through- Returns:
- what the cipher returned
- Throws:
ShortBufferException- as the cipher throws it
-
update
WeavesCipher.update(ByteBuffer, ByteBuffer).- Parameters:
receiver- the ciphera0- the call'sByteBufferargument, passed througha1- the call'sByteBufferargument, passed through- Returns:
- what the cipher returned
- Throws:
ShortBufferException- as the cipher throws it
-
doFinal
WeavesCipher.doFinal().- Parameters:
receiver- the cipher- Returns:
- what the cipher returned
- Throws:
IllegalBlockSizeException- as the cipher throws itBadPaddingException- as the cipher throws it
-
doFinal
public static int doFinal(Cipher receiver, byte[] a0, int a1) throws IllegalBlockSizeException, ShortBufferException, BadPaddingException WeavesCipher.doFinal(byte[], int).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed through- Returns:
- what the cipher returned
- Throws:
IllegalBlockSizeException- as the cipher throws itShortBufferException- as the cipher throws itBadPaddingException- as the cipher throws it
-
doFinal
public static byte[] doFinal(Cipher receiver, byte[] a0) throws IllegalBlockSizeException, BadPaddingException WeavesCipher.doFinal(byte[]).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed through- Returns:
- what the cipher returned
- Throws:
IllegalBlockSizeException- as the cipher throws itBadPaddingException- as the cipher throws it
-
doFinal
public static byte[] doFinal(Cipher receiver, byte[] a0, int a1, int a2) throws IllegalBlockSizeException, BadPaddingException WeavesCipher.doFinal(byte[], int, int).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed through- Returns:
- what the cipher returned
- Throws:
IllegalBlockSizeException- as the cipher throws itBadPaddingException- as the cipher throws it
-
doFinal
public static int doFinal(Cipher receiver, byte[] a0, int a1, int a2, byte[] a3) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException WeavesCipher.doFinal(byte[], int, int, byte[]).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed througha3- the call'sbyte[]argument, passed through- Returns:
- what the cipher returned
- Throws:
ShortBufferException- as the cipher throws itIllegalBlockSizeException- as the cipher throws itBadPaddingException- as the cipher throws it
-
doFinal
public static int doFinal(Cipher receiver, byte[] a0, int a1, int a2, byte[] a3, int a4) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException WeavesCipher.doFinal(byte[], int, int, byte[], int).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed througha3- the call'sbyte[]argument, passed througha4- the call'sintargument, passed through- Returns:
- what the cipher returned
- Throws:
ShortBufferException- as the cipher throws itIllegalBlockSizeException- as the cipher throws itBadPaddingException- as the cipher throws it
-
doFinal
public static int doFinal(Cipher receiver, ByteBuffer a0, ByteBuffer a1) throws ShortBufferException, IllegalBlockSizeException, BadPaddingException WeavesCipher.doFinal(ByteBuffer, ByteBuffer).- Parameters:
receiver- the ciphera0- the call'sByteBufferargument, passed througha1- the call'sByteBufferargument, passed through- Returns:
- what the cipher returned
- Throws:
ShortBufferException- as the cipher throws itIllegalBlockSizeException- as the cipher throws itBadPaddingException- as the cipher throws it
-
updateAAD
WeavesCipher.updateAAD(byte[]).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed through
-
updateAAD
WeavesCipher.updateAAD(byte[], int, int).- Parameters:
receiver- the ciphera0- the call'sbyte[]argument, passed througha1- the call'sintargument, passed througha2- the call'sintargument, passed through
-
updateAAD
WeavesCipher.updateAAD(ByteBuffer).- Parameters:
receiver- the ciphera0- the call'sByteBufferargument, passed through
-
init
WeavesMac.init(Key).- Parameters:
receiver- the mackey- the call'sKeyargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
init
public static void init(Mac receiver, Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException WeavesMac.init(Key, AlgorithmParameterSpec).- Parameters:
receiver- the mackey- the call'sKeyargument, passed throughparams- the call'sAlgorithmParameterSpecargument, passed through- Throws:
InvalidKeyException- as the original call doesInvalidAlgorithmParameterException- as the original call does- Since:
- 1.14.4
-
reset
WeavesMac.reset().- Parameters:
receiver- the mac- Since:
- 1.14.4
-
initSign
WeavesSignature.initSign(PrivateKey).- Parameters:
receiver- the signatureprivateKey- the call'sPrivateKeyargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
initSign
public static void initSign(Signature receiver, PrivateKey privateKey, SecureRandom random) throws InvalidKeyException WeavesSignature.initSign(PrivateKey, SecureRandom).- Parameters:
receiver- the signatureprivateKey- the call'sPrivateKeyargument, passed throughrandom- the call'sSecureRandomargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
initVerify
WeavesSignature.initVerify(PublicKey).- Parameters:
receiver- the signaturepublicKey- the call'sPublicKeyargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
initVerify
public static void initVerify(Signature receiver, Certificate certificate) throws InvalidKeyException WeavesSignature.initVerify(Certificate).- Parameters:
receiver- the signaturecertificate- the call'sCertificateargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
init
WeavesCipher.init(int, Key).- Parameters:
receiver- the cipheropmode- the call'sintargument, passed throughkey- the call'sKeyargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
init
public static void init(Cipher receiver, int opmode, Key key, SecureRandom random) throws InvalidKeyException WeavesCipher.init(int, Key, SecureRandom).- Parameters:
receiver- the cipheropmode- the call'sintargument, passed throughkey- the call'sKeyargument, passed throughrandom- the call'sSecureRandomargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
init
public static void init(Cipher receiver, int opmode, Key key, AlgorithmParameterSpec params) throws InvalidKeyException, InvalidAlgorithmParameterException WeavesCipher.init(int, Key, AlgorithmParameterSpec).- Parameters:
receiver- the cipheropmode- the call'sintargument, passed throughkey- the call'sKeyargument, passed throughparams- the call'sAlgorithmParameterSpecargument, passed through- Throws:
InvalidKeyException- as the original call doesInvalidAlgorithmParameterException- as the original call does- Since:
- 1.14.4
-
init
public static void init(Cipher receiver, int opmode, Key key, AlgorithmParameterSpec params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException WeavesCipher.init(int, Key, AlgorithmParameterSpec, SecureRandom).- Parameters:
receiver- the cipheropmode- the call'sintargument, passed throughkey- the call'sKeyargument, passed throughparams- the call'sAlgorithmParameterSpecargument, passed throughrandom- the call'sSecureRandomargument, passed through- Throws:
InvalidKeyException- as the original call doesInvalidAlgorithmParameterException- as the original call does- Since:
- 1.14.4
-
init
public static void init(Cipher receiver, int opmode, Key key, AlgorithmParameters params) throws InvalidKeyException, InvalidAlgorithmParameterException WeavesCipher.init(int, Key, AlgorithmParameters).- Parameters:
receiver- the cipheropmode- the call'sintargument, passed throughkey- the call'sKeyargument, passed throughparams- the call'sAlgorithmParametersargument, passed through- Throws:
InvalidKeyException- as the original call doesInvalidAlgorithmParameterException- as the original call does- Since:
- 1.14.4
-
init
public static void init(Cipher receiver, int opmode, Key key, AlgorithmParameters params, SecureRandom random) throws InvalidKeyException, InvalidAlgorithmParameterException WeavesCipher.init(int, Key, AlgorithmParameters, SecureRandom).- Parameters:
receiver- the cipheropmode- the call'sintargument, passed throughkey- the call'sKeyargument, passed throughparams- the call'sAlgorithmParametersargument, passed throughrandom- the call'sSecureRandomargument, passed through- Throws:
InvalidKeyException- as the original call doesInvalidAlgorithmParameterException- as the original call does- Since:
- 1.14.4
-
init
public static void init(Cipher receiver, int opmode, Certificate certificate) throws InvalidKeyException WeavesCipher.init(int, Certificate).- Parameters:
receiver- the cipheropmode- the call'sintargument, passed throughcertificate- the call'sCertificateargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
init
public static void init(Cipher receiver, int opmode, Certificate certificate, SecureRandom random) throws InvalidKeyException WeavesCipher.init(int, Certificate, SecureRandom).- Parameters:
receiver- the cipheropmode- the call'sintargument, passed throughcertificate- the call'sCertificateargument, passed throughrandom- the call'sSecureRandomargument, passed through- Throws:
InvalidKeyException- as the original call does- Since:
- 1.14.4
-
wrap
public static byte[] wrap(Cipher receiver, Key key) throws IllegalBlockSizeException, InvalidKeyException WeavesCipher.wrap(Key).- Parameters:
receiver- the cipherkey- the call'sKeyargument, passed through- Returns:
- what the original call returns
- Throws:
IllegalBlockSizeException- as the original call doesInvalidKeyException- as the original call does- Since:
- 1.14.4
-
unwrap
public static Key unwrap(Cipher receiver, byte[] wrappedKey, String wrappedKeyAlgorithm, int wrappedKeyType) throws InvalidKeyException, NoSuchAlgorithmException WeavesCipher.unwrap(byte[], String, int).- Parameters:
receiver- the cipherwrappedKey- the call'sbyte[]argument, passed throughwrappedKeyAlgorithm- the call'sStringargument, passed throughwrappedKeyType- the call'sintargument, passed through- Returns:
- what the original call returns
- Throws:
InvalidKeyException- as the original call doesNoSuchAlgorithmException- as the original call does- Since:
- 1.14.4
-