comparison truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/nodes/NodeUtil.java @ 21987:b2d1c8ff592a

Less classes in the source API package. Merging interfaces and their only implementation into final classes. Hiding NullSourceSection behind factory method. Using JDK's standard CharsetDecoder instead of proprietary BytesDecoder.
author Jaroslav Tulach <jaroslav.tulach@oracle.com>
date Wed, 01 Jul 2015 10:23:36 +0200
parents 5023b913e2ba
children 65e9fbb40e51
comparison
equal deleted inserted replaced
21986:67ea94a23074 21987:b2d1c8ff592a
726 return node.getClass().getSimpleName(); 726 return node.getClass().getSimpleName();
727 } 727 }
728 728
729 private static String displaySourceAttribution(Node node) { 729 private static String displaySourceAttribution(Node node) {
730 final SourceSection section = node.getSourceSection(); 730 final SourceSection section = node.getSourceSection();
731 if (section instanceof NullSourceSection) { 731 if (section != null && section.getSource() == null) {
732 return "source: " + section.getShortDescription(); 732 return "source: " + section.getShortDescription();
733 } 733 }
734 if (section != null) { 734 if (section != null) {
735 final String srcText = section.getCode(); 735 final String srcText = section.getCode();
736 final StringBuilder sb = new StringBuilder(); 736 final StringBuilder sb = new StringBuilder();