Mercurial > hg > graal-jvmci-8
comparison graal/com.oracle.truffle.dsl.processor/src/com/oracle/truffle/dsl/processor/generator/NodeBaseFactory.java @ 18809:d399c7ce78b3
Truffle-DSL: fixed null dereference.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 09 Jan 2015 18:14:41 +0100 |
parents | 4ce856e65728 |
children |
comparison
equal
deleted
inserted
replaced
18808:cd0ae2f782c9 | 18809:d399c7ce78b3 |
---|---|
440 } | 440 } |
441 } | 441 } |
442 | 442 |
443 private CodeExecutableElement createUserConstructor(CodeTypeElement type, ExecutableElement superConstructor) { | 443 private CodeExecutableElement createUserConstructor(CodeTypeElement type, ExecutableElement superConstructor) { |
444 CodeExecutableElement method = new CodeExecutableElement(null, type.getSimpleName().toString()); | 444 CodeExecutableElement method = new CodeExecutableElement(null, type.getSimpleName().toString()); |
445 ElementUtils.setVisibility(method.getModifiers(), ElementUtils.getVisibility(superConstructor.getModifiers())); | |
446 CodeTreeBuilder builder = method.createBuilder(); | 445 CodeTreeBuilder builder = method.createBuilder(); |
447 | 446 |
448 if (superConstructor != null) { | 447 if (superConstructor != null) { |
448 ElementUtils.setVisibility(method.getModifiers(), ElementUtils.getVisibility(superConstructor.getModifiers())); | |
449 for (VariableElement param : superConstructor.getParameters()) { | 449 for (VariableElement param : superConstructor.getParameters()) { |
450 method.getParameters().add(CodeVariableElement.clone(param)); | 450 method.getParameters().add(CodeVariableElement.clone(param)); |
451 } | 451 } |
452 } | |
453 | |
454 if (superConstructor != null) { | |
455 builder.startStatement().startSuperCall(); | 452 builder.startStatement().startSuperCall(); |
456 for (VariableElement param : superConstructor.getParameters()) { | 453 for (VariableElement param : superConstructor.getParameters()) { |
457 builder.string(param.getSimpleName().toString()); | 454 builder.string(param.getSimpleName().toString()); |
458 } | 455 } |
459 builder.end().end(); | 456 builder.end().end(); |