( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0001484048{main}( ).../index.php:0
20.0008484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.31304086464require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.31714115456include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.31714115456get_header( $name = ???, $args = ??? ).../single.php:10
60.31714115672locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.31714115768load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.31744116312require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.31754123720wp_head( ).../header.php:18
100.31754123720do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.31754123936WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.31754123936WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.31774127352wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.31774127352do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.31774127568WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.31774127568WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.31784129456twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.31794130976wp_style_add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.php:440
190.31794130976WP_Styles->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../functions.wp-styles.php:245
200.31794130976WP_Dependencies->add_data( $handle = 'twentyfifteen-ie', $key = 'conditional', $value = 'lt IE 9' ).../class-wp-styles.php:385
210.31794130976_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.31804131296wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.31804137680trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

( ! ) Deprecated: Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers. in /var/www/html/wp-includes/functions.php on line 6131
Call Stack
#TimeMemoryFunctionLocation
10.0001484048{main}( ).../index.php:0
20.0008484400require( '/var/www/html/wp-blog-header.php ).../index.php:17
30.31304086464require_once( '/var/www/html/wp-includes/template-loader.php ).../wp-blog-header.php:19
40.31714115456include( '/var/www/html/wp-content/themes/twentyfifteen/single.php ).../template-loader.php:125
50.31714115456get_header( $name = ???, $args = ??? ).../single.php:10
60.31714115672locate_template( $template_names = [0 => 'header.php'], $load = TRUE, $load_once = TRUE, $args = [] ).../general-template.php:48
70.31714115768load_template( $_template_file = '/var/www/html/wp-content/themes/twentyfifteen/header.php', $load_once = TRUE, $args = [] ).../template.php:749
80.31744116312require_once( '/var/www/html/wp-content/themes/twentyfifteen/header.php ).../template.php:814
90.31754123720wp_head( ).../header.php:18
100.31754123720do_action( $hook_name = 'wp_head' ).../general-template.php:3197
110.31754123936WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
120.31754123936WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
130.31774127352wp_enqueue_scripts( '' ).../class-wp-hook.php:341
140.31774127352do_action( $hook_name = 'wp_enqueue_scripts' ).../script-loader.php:2311
150.31774127568WP_Hook->do_action( $args = [0 => ''] ).../plugin.php:522
160.31774127568WP_Hook->apply_filters( $value = '', $args = [0 => ''] ).../class-wp-hook.php:365
170.31784129456twentyfifteen_scripts( '' ).../class-wp-hook.php:341
180.34954138784wp_style_add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.php:444
190.34954138784WP_Styles->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../functions.wp-styles.php:245
200.34964138784WP_Dependencies->add_data( $handle = 'twentyfifteen-ie7', $key = 'conditional', $value = 'lt IE 8' ).../class-wp-styles.php:385
210.34964138784_deprecated_argument( $function_name = 'WP_Dependencies->add_data()', $version = '6.9.0', $message = 'IE conditional comments are ignored by all supported browsers.' ).../class-wp-dependencies.php:317
220.34964139104wp_trigger_error( $function_name = '', $message = 'Function WP_Dependencies->add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:5925
230.34974139328trigger_error( $message = 'Function WP_Dependencies-&gt;add_data() was called with an argument that is <strong>deprecated</strong> since version 6.9.0! IE conditional comments are ignored by all supported browsers.', $error_level = 16384 ).../functions.php:6131

Type Erasure

Type Erasure


When a generic type is instantiated, the compiler translates those types by a technique called type erasure — a process where the compiler removes all information related to type parameters and type arguments within a class or method. Type erasure enables Java applications that use generics to maintain binary compatibility with Java libraries and applications that were created before generics.


For instance, Box<String> is translated to type Box, which is called the raw type — a raw type is a generic class or interface name without any type arguments. This means that you can’t find out what type of Object a generic class is using at runtime. The following operations are not possible:


public class MyClass<E> {
public static void myMethod(Object item) {
if (item instanceof E) { //Compiler error

}
E item2 = new E(); //Compiler error
E[] iArray = new E[10]; //Compiler error
E obj = (E)new Object(); //Unchecked cast warning
}
}
The operations shown in bold are meaningless at runtime because the compiler removes all information about the actual type argument (represented by the type parameter E) at compile time.

Type erasure exists so that new code may continue to interface with legacy code. Using a raw type for any other reason is considered bad programming practice and should be avoided whenever possible.


When mixing legacy code with generic code, you may encounter warning messages similar to the following:


Note: WarningDemo.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
This can happen when using an older API that operates on raw types, as shown in the following WarningDemo program:
public class WarningDemo {
public static void main(String[] args){
Box<Integer> bi;
bi = createBox();
}

/**
* Pretend that this method is part of an old library,
* written before generics. It returns
* Box instead of Box<T>.
*/
static Box createBox(){
return new Box();
}
}

Recompiling with -Xlint:unchecked reveals the following additional information:
WarningDemo.java:4: warning: [unchecked] unchecked conversion
found : Box
required: Box<java.lang.Integer>
bi = createBox();
^
1 warning

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.