equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
2018 char* SharedRuntime::generate_class_cast_message( |
2018 char* SharedRuntime::generate_class_cast_message( |
2019 Klass* caster_klass, Klass* target_klass, Symbol* target_klass_name) { |
2019 Klass* caster_klass, Klass* target_klass, Symbol* target_klass_name) { |
2020 const char* caster_name = caster_klass->external_name(); |
2020 const char* caster_name = caster_klass->external_name(); |
2021 |
2021 |
2022 assert(target_klass != NULL || target_klass_name != NULL, "one must be provided"); |
2022 assert(target_klass != NULL || target_klass_name != NULL, "one must be provided"); |
2023 const char* target_name = target_klass == NULL ? target_klass_name->as_C_string() : |
2023 const char* target_name = target_klass == NULL ? target_klass_name->as_klass_external_name() : |
2024 target_klass->external_name(); |
2024 target_klass->external_name(); |
2025 |
2025 |
2026 size_t msglen = strlen(caster_name) + strlen("class ") + strlen(" cannot be cast to class ") + strlen(target_name) + 1; |
2026 size_t msglen = strlen(caster_name) + strlen("class ") + strlen(" cannot be cast to class ") + strlen(target_name) + 1; |
2027 |
2027 |
2028 const char* caster_klass_description = ""; |
2028 const char* caster_klass_description = ""; |