Commit Graph

173 Commits

Author SHA1 Message Date
Srikanth Adayapalam 916b8b18e1 8129740: Incorrect class file created when passing lambda in inner class constructor
Lambda implementation method must be static when lambda is an argument to an explicit constructor call.

Reviewed-by: mcimadamore
2016-05-25 15:09:13 +05:30
David Buck ed8f2f7406 8143647: Javac compiles method reference that allows results in an IllegalAccessError
Lambda implementation method synthesized by javac should not mention inaccessible types.

Reviewed-by: mcimadamore
2016-03-29 10:48:49 +00:00
Aleksei Efimov 34b5d02bb9 8068254: Method reference uses wrong qualifying type
Generated code fails with IllegalAccessError due to compiler's mishandling of packageprivate classes in method reference expressions.

Reviewed-by: rfield, mcimadamore
2016-01-22 10:49:45 +03:00
Srikanth Adayapalam 769b662af4 8130506: javac AssertionError when invoking MethodHandle.invoke with lambda parameter
Reviewed-by: mcimadamore
2016-01-18 10:58:12 +00:00
Maurizio Cimadamore 20580438a3 8066974: Compiler doesn't infer method's generic type information in lambda body
Add logic to avoid post-inference triggers on temporarty AST types

Reviewed-by: vromero
2015-11-12 21:20:49 +00:00
Jan Lahoda 77e904af76 8067422: Lambda method names are unnecessarily unstable
Lambda method numbers are now assigned per class for non-serializable lambdas.

Reviewed-by: mcimadamore, rfield, vromero
2015-09-16 10:56:23 +02:00
Jan Lahoda a3e88b936c 8080338: Incorrect GPL header causes RE script to miss swap to commercial header for licensee source bundle
8080339: Incorrect GPL header causes RE script to miss swap to commercial header for licensee source bundle
8080340: Incorrect GPL header causes RE script to miss swap to commercial header for licensee source bundle

Fixing incorrect file headers; also reviewed by kevin.l.brown@oracle.com

Reviewed-by: vromero
2015-05-18 09:27:09 +02:00
Jan Lahoda 4af3847ddd 8054220: Debugger doesn't show variables *outside* lambda
8058227: Debugger has no access to outer variables inside Lambda

Put local variables captured by lambda into the lambda method's LocalVariableTable.

Reviewed-by: mcimadamore, rfield
2015-03-26 11:34:50 +01:00
Vicente Romero a7878a1ccc 8069545: javac shouldn't check nested stuck lambdas during overload resolution
Nested lambdas should not be considered while overload resolution is in progress

Co-authored-by: Srikanth Adayapalam <srikanth.adayapalam@oracle.com>
Reviewed-by: mcimadamore
2015-02-12 10:16:19 +05:30
Jan Lahoda f008e09b91 8057794: Compiler Error when obtaining .class property
Ensuring a non-null type and sym for illegal T.class to prevent downstream errors.

Reviewed-by: mcimadamore
2014-09-22 14:55:14 +02:00
Robert Field bff093254c 8058112: Invalid BootstrapMethod for constructor/method reference
Bridge method references with functional interface method parameters of intersection type

Reviewed-by: vromero, dlsmith
2014-11-25 13:37:34 -08:00
Vicente Romero 7bcf70da65 8063052: Inference chokes on wildcard derived from method reference
Reviewed-by: mcimadamore
2014-11-20 14:05:39 -08:00
Robert Field 8e169e839e 8048121: javac complex method references: revamp and simplify
8037404: javac NPE or VerifyError for code with constructor reference of inner class
8047341: lambda reference to inner class in base class causes LambdaConversionException
8044748: JVM cannot access constructor though ::new reference although can call it directly
8044737: Lambda: NPE while obtaining method reference through lambda expression
8038776: VerifyError when running successfully compiled java class

Reviewed-by: dlsmith, vromero
2014-11-14 21:10:58 -08:00
Vicente Romero 28cd00e567 8057800: Method reference with generic type creates NPE when compiling
Reviewed-by: mcimadamore
2014-11-03 16:03:37 -08:00
Robert Field bc1519a381 8056051: int[]::clone causes "java.lang.NoClassDefFoundError: Array"
Reviewed-by: mcimadamore, vromero
2014-10-13 20:06:55 -07:00
Vicente Romero b1f21b8751 8033483: Should ignore nested lambda bodies during overload resolution
Reviewed-by: mcimadamore, dlsmith
2014-07-09 10:49:32 -04:00
Jan Lahoda 97130dce7f 8056984: Exception in compiler: java.lang.AssertionError: isSubClass T
Must use type variable's captured bound as a method receiver, instead of the type variable itself, while checking if deferred attribution is needed.

Reviewed-by: mcimadamore, vromero
2014-09-08 10:50:59 +02:00
Jan Lahoda 2b4a423cf7 8056014: Type inference may be skipped for a complex receiver generic method in a parameter position
When checking if deferred attribution is needed for a chain of methods, stop on any method that returns any type variable, as the rest of analysis cannot use the correct type.

Reviewed-by: mcimadamore, vromero
2014-09-08 10:48:18 +02:00
Maurizio Cimadamore 7836c89054 8051958: Cannot assign a value to final variable in lambda
Remove Attr.owner and refactor code for detecting forward field references

Reviewed-by: vromero
2014-09-10 10:50:59 +01:00
Vicente Romero 0a9b5d7f5a 8051402: javac, type containment should accept that CAP <= ? extends CAP and CAP <= ? super CAP
Reviewed-by: mcimadamore, dlsmith
2014-07-21 10:45:40 -04:00
Robert Field 9c992458aa 8046060: Different results of floating point multiplication for lambda code block
Propogate strictfp into lambda body

Reviewed-by: vromero, jlahoda
2014-06-23 13:14:32 -07:00
Vicente Romero 6d55f5983b 8042759: Lambda returning implicitly-typed lambdas considered pertinent to applicability
Reviewed-by: mcimadamore
2014-06-19 23:52:33 +01:00
Vicente Romero e3df0c1ec1 8038182: javac crash with FunctionDescriptorLookupError for invalid functional interface
Co-authored-by: Maurizio Cimadamore <maurizio.cimadamore@oracle.com>
Reviewed-by: mcimadamore
2014-06-19 15:39:37 +01:00
Jan Lahoda 4126a92897 8031967: For some sources compiler compiles for ever
Avoid creating DeferredTypes for method calls with method calls as receivers if the site can be determined reliably

Co-authored-by: Maurizio Cimadamore <maurizio.cimadamore@oracle.com>
Reviewed-by: mcimadamore, vromero
2014-05-30 12:54:16 +02:00
Paul Govereau 6b0e45946c 8041704: wrong error message when mixing lambda expression and inner class
Reviewed-by: vromero
2014-05-27 21:15:06 +01:00
Dan Smith 1521e690b5 8034223: Most-specific should not have any special treatment for boxed vs. unboxed types
Rewrite most-specific logic to conform to JLS 8 15.12.2.5

Reviewed-by: vromero
2014-05-14 15:41:28 -06:00
Vicente Romero 6aa281e08d 8028503: javac, for method references a primitive type can be added as a bound
Reviewed-by: jjg, dlsmith
2014-05-13 16:11:43 +01:00
Robert Field d4d9a02e3e 8029852: Bad code generated (VerifyError) when lambda instantiates enclosing local class and has captured variables
8029725: Lambda reference to containing local class causes javac infinite recursion

Reviewed-by: vromero, jlahoda, dlsmith
2014-05-01 15:43:28 -07:00
Robert Field 00f358195e 8036942: javac generates incorrect exception table for multi-catch statements inside a lambda
Union type info lost and also union type is not processed by TreeMaker.Type -- address by using existing tree, thus by-passing such issues.

Reviewed-by: vromero, jlahoda
2014-05-01 11:35:02 -07:00
Vicente Romero 8f85051892 8029718: Should always use lambda body structure to disambiguate overload resolution
Reviewed-by: dlsmith, jjg, jlahoda
2014-04-22 17:55:22 +01:00
Robert Field 619db87b78 8037935: Javac -- final local String var referenced in binary/unary op in lambda produces code that does not verify
Remove over-zealous Attr optimization breaking lambdas

Reviewed-by: jjg, vromero
2014-04-10 14:01:53 -07:00
Robert Field 6f88c3dbc3 8038420: Lambda returning post-increment generates wrong code
Reviewed-by: vromero, jlahoda
2014-04-10 11:24:26 -07:00
Alexander Zuev 2807e8d660 8031425: Two langtools/javac tests fail by timeout on Windows
Reviewed-by: vromero, jjg
2014-04-07 11:38:59 +02:00
Matherey Nunez 39f6f46864 8027175: Existing regression tests in tl/langtools and tl/jdk need to be updated for @bug keyword
Reviewed-by: jjg, ksrini
2014-01-30 11:09:01 -08:00
Steve Sides 93876b4349 8029230: Update copyright year to match last edit in jdk8 langtools repository for 2013
Reviewed-by: ksrini
2013-12-24 09:17:37 -08:00
Vicente Romero 679f831609 8029721: javac crash for annotated parameter type of lambda in a field
Reviewed-by: rfield, jfranck
2013-12-13 14:13:03 +00:00
Robert Field a02a8fba3e 8029558: java.lang.VerifyError: Bad return type when lambda's body is in parentheses
Properly type convert the body of a lambda expression

Reviewed-by: vromero
2013-12-11 11:56:55 -08:00
Robert Field 14ae524304 8028739: javac generates incorrect descriptor for MethodHandle::invoke
Introduce special handling for signature polymorphic methods

Reviewed-by: jjg
2013-11-22 17:07:35 -08:00
Vicente Romero e6e0508e1a 8026231: Look at 'static' flag when checking method references
Reviewed-by: jjg, dlsmith
2013-11-15 11:08:12 +00:00
Jan Lahoda d3eb4e0816 8027142: Invokedynamic instructions don't get line number table entries
When emitting invokedynamic instruction, write pendingStatPos, if set, into the LineNumberTable. Invokedynamic itself does not set the pendingStatPos.

Reviewed-by: jjg, jrose, ksrini, vromero
2013-11-09 15:24:38 +01:00
Robert Field c9ceea7ac7 8022720: Method refeerences - private method should be accessible (nested classes)
Reviewed-by: jjg, ksrini
2013-10-23 10:28:10 -07:00
Robert Field 69709943c3 8023668: Desugar serializable lambda bodies using more robust naming scheme
Lambda / bridged method-reference naming overhaul

Reviewed-by: ksrini, briangoetz
2013-10-22 16:53:21 -07:00
Vicente Romero 48b6b38e52 8025290: javac implicit versus explicit lambda compilation error
Reviewed-by: jjg, dlsmith
2013-10-22 13:54:49 +01:00
Vicente Romero 43754fccbd 8026956: test tools/javac/lambda/TargetType58.java is failing after a libs change
Reviewed-by: jfranck
2013-10-21 15:55:02 +01:00
Vicente Romero 027b935c1b 8024809: javac, some lambda programs are rejected by flow analysis
Reviewed-by: jjg, dlsmith
2013-10-19 17:43:09 +01:00
Jonathan Gibbons cf30c20337 8026749: Missing LV table in lambda bodies
Reviewed-by: vromero, jlahoda
2013-10-18 15:03:34 -07:00
Jonathan Gibbons ef68cc1fc1 8026704: Build failure with --enable-debug
Reviewed-by: ksrini
2013-10-16 10:47:21 -07:00
Vicente Romero 1868655b89 8024947: javac should issue the potentially ambiguous overload warning only where the problem appears
Reviewed-by: jjg
2013-10-15 21:02:21 +01:00
Vicente Romero 53cc43916a 8025816: javac crash with method reference with a type variable as the site
Reviewed-by: jjg
2013-10-15 19:36:45 +01:00
Jonathan Gibbons 0837163643 8025998: Missing LV table in lambda bodies
Reviewed-by: vromero
2013-10-14 23:07:43 -07:00