// Test qualification inference of ? expressions. // Relevant PR: PR713 // Expected result: PASS public class H7 { private final Object unsharedMarker = new Object(); private static final Object unsharedMarker2 = new Object(); public static void main(String[] args) { new H7().readString(true); new H7().readString(false); } private String readString(boolean unshared) { Object unsharedMarker3 = new Object(); Object unsharedMarker4 = unsharedMarker; String xxx = readUTFBody(); Object o = unshared ? unsharedMarker : xxx; Object o2 = unshared ? unsharedMarker2 : xxx; Object o3 = unshared ? unsharedMarker3 : xxx; Object o4 = unshared ? unsharedMarker4 : xxx; println(o); println(o2); println(o3); println(o4); return xxx; } private String readUTFBody() { StringBuffer sbuf = new StringBuffer("readUTFBody"); return sbuf.toString(); } static void println(Object o) { String s = o.toString(); if (s.indexOf('@') >= 0) System.out.println(s.substring(0, s.indexOf('@'))); else System.out.println(s); } }