| 476 | } |
| 477 | |
| 478 | string JavaGenerator::getArrayInitialization(ArrayType *t) |
| 479 | { |
| 480 | string result = ""; |
| 481 | |
| 482 | DataType *current = dynamic_cast<DataType *>(t); |
| 483 | while (current->isArray()) |
| 484 | { |
| 485 | ArrayType *arrayType = dynamic_cast<ArrayType *>(current); |
| 486 | result += format_string("[%d]", arrayType->getElementCount()); |
| 487 | current = arrayType->getElementType(); |
| 488 | } |
| 489 | |
| 490 | if (current->getDataType() == DataType::data_type_t::kListType) |
| 491 | { |
| 492 | result = "List" + result; // Java does not support typed arrays e.g. List<int[]>. Use untyped List[]. |
| 493 | } |
| 494 | else |
| 495 | { |
| 496 | result = getTypenameName(t->getTrueContainerDataType(), false, false) + result; |
| 497 | } |
| 498 | |
| 499 | result = "new " + result; |
| 500 | |
| 501 | return result; |
| 502 | } |
| 503 | |
| 504 | void JavaGenerator::makeConstTemplateData() |
| 505 | { |
nothing calls this directly
no test coverage detected