8151828: Jittester: array creation node handled inproperly in source code visitor for non-int numerical arrays
Reviewed-by: iignatyev
--- a/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/JavaCodeVisitor.java Fri Apr 01 08:46:47 2016 +0000
+++ b/hotspot/test/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/JavaCodeVisitor.java Fri Apr 01 16:31:08 2016 +0300
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -164,21 +164,15 @@
code.append(node.getChildren().stream()
.map(p -> p.accept(this))
.collect(Collectors.joining("][", "[", "]")));
- code.append(";\n")
- .append(PrintingUtils.align(node.getParent().getLevel()))
+ code.append(";\n");
+ if (!TypeList.isBuiltIn(arrayType)) {
+ code.append(PrintingUtils.align(node.getParent().getLevel()))
.append("java.util.Arrays.fill(")
.append(name)
- .append(", ");
- if (TypeList.find("boolean") == arrayType) {
- code.append("false");
- } else if (TypeList.isBuiltIn(arrayType)) {
- code.append("0");
- } else {
- code.append("new ")
+ .append(", new ")
.append(type)
- .append("()");
+ .append("());\n");
}
- code.append(");\n");
return code.toString();
}