Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Programming \ Weld a problem in JDK 8u60 environment     - Linux Command Tutorial: cat command to view the contents of the file (Linux)

- Oracle archive log full cause abnormal slow database performance (Database)

- Oracle lag () and lpad () function (Database)

- LogStash log analysis display system (Linux)

- About enhanced Linux / Unix server system security program (Linux)

- Zookeeper Rights Management and Quota Management (Server)

- Ubuntu installed racing game Speed Dreams 2.1 (Linux)

- CentOS install Memcached (Server)

- Install the latest Eclipse IDE in Ubuntu (Linux)

- To compile and install Clang 3.5.0 in Linux CentOS (Linux)

- Java Concurrency: synchronized (Programming)

- Ubuntu users install the Download Manager software Xdman 5.0 (Linux)

- DRBD daily management (Server)

- PHP with FastCGI and mod_php Comments (Server)

- Android main thread message system (Handler Looper) (Linux)

- Red Hat Enterprise Linux Server 6.5 installation GCC 4.9.2 (Linux)

- Oracle DATABASE LINK (DBLINK) Create (Database)

- Ubuntu Thunderbird 24.4.0 (Linux)

- Setting CentOS firewall open port (Linux)

- Java executable file to read information from a database copy (Programming)

 
         
  Weld a problem in JDK 8u60 environment
     
  Add Date : 2018-11-21      
         
         
         
  In the recently released JDK 8u60 not all members are virtual correctly ignored resulting in Weld exposed a problem. This problem has been 2.2.16.Final, 2.3.0.CR2 and 3.0.0.Alpha14 (not yet released) are resolved. However, if you do not use lambda expression refers to an event or process parameters inside a processor or observer method, your application will not be affected in any way. Related problems Check WELD-2019.

Example

If there is a lambda expression refers to an event or an observer processor or method parameters inside the handle. The compiler will use the event argument as a parameter to create a virtual method. From 8u60 start parameter annotation it was retained as a virtual method, so the Weld wrong these virtual methods as an observer or processor approach.

symptom

Maybe you already know WELD-000409: For container life cycle events, observer method can only be extended if .... even WELD-001408: For type of dependency is not satisfied ... the use of such a lambda expression If using a lambda expression in normal observer in lambda expressions and the use of more references (for example, not just an event or process parameters, method parameters are also some virtual methods), these additional parameters in the CDI the injection point.

example

class Foo {
  void observe (@Observes @Juicy String payload) {
    Arrays.asList ( "foo") stream () filter ((s) -> s.equals (payload))..;
  }
}
Create a virtual method as lambda expressions, and the event parameters to be used as a method parameter. Annotations are protected. In this example, Weld created two events with the same parameters: @Observes @Juicy String payload observer method.

Solution

Use an additional local variable instead of the event parameter, the value of the event parameter is assigned to a local variable:

public void observe (@Observes @Juicy String payload) {
   String p = payload;
   Arrays.asList ( "foo") stream () filter ((s) -> s.equals (p))..;
     
         
         
         
  More:      
 
- AngularJS - Getting Started with Routing (Programming)
- C ++ copy constructor (Programming)
- Oracle set and remove columns unavailable (Database)
- C ++ Supplements - Smart Pointers (Programming)
- Why JavaScript basic types can invoke methods (Programming)
- Linux install Maven and SVN client (Linux)
- Linux --- file descriptors and redirection (Linux)
- Monitoring services are running properly and will email alert (Server)
- PostgreSQL-XL installation and deployment (Database)
- Ora-00439: feature not enabled: managed standby (Database)
- Each catalog Detailed Linux (Linux)
- MySQL Study of --Percona Server 5.5 Upgrade 5.6 (Database)
- Linux Getting Started tutorial: How to backup Linux systems (Linux)
- ORA-600 [kcbz_check_objd_typ] Error Handling (Database)
- MySQL use the integer type (Database)
- Linux iptables firewall settings to use (Linux)
- 64-bit Ubuntu 15.10 How to compile the latest version of the 32 Wine 1.7.53 (Linux)
- Oracle can not change the tablespace to backup mode in non-archive mode (Database)
- Oracle 11g new features of the collection of multi-column statistics (Database)
- Ubuntu 14.04 install Nmap 6.46.1 (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.