1c737c696f5a568db61cc11bc361dce1dc938a682Werner Dietlpackage annotations.tests.executable; 210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali 3a74f2668d253bb9375805db0f23a01e30ddfba8fwdietl/*>>> 443367280222c6f50f8085ae8d12a985c257b3ea0Michael Ernstimport org.checkerframework.checker.nullness.qual.NonNull; 5a74f2668d253bb9375805db0f23a01e30ddfba8fwdietl*/ 610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali 710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Aliimport java.io.*; 810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali 910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Aliimport annotations.el.*; 1010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Aliimport annotations.io.*; 1110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali 1210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Alipublic class RegurgitateDemo { 133aff85d01d84fa9d8551ca791036a733ae4a4f39Michael Ernst public static void main(/*@NonNull*/ String /*@NonNull*/ [] args) { 1410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali // String sampleIndexFile = "package pkg: annotation @A: int value class 1510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali // foo: @pkg.A(value=dinglewompus)"; 1610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali /*@NonNull*/ AScene scene = new AScene(); 1710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali try { 180508808bf63f01cf8c1808d2049d96154520fdacDan Brown LineNumberReader in = new LineNumberReader(new FileReader("test2-2.jaif")); 1910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali IndexFileParser.parse(in, scene); 2010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali 2110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali System.out.println("regurgitating:"); 220508808bf63f01cf8c1808d2049d96154520fdacDan Brown IndexFileWriter.write(scene, new FileWriter("test2-3.jaif")); 2310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali } catch (ParseException p) { 2410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali p.printStackTrace(System.err); 2510353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali } catch (DefException p) { 2610353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali p.printStackTrace(System.err); 2710353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali } catch (IOException e) { 2810353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali // won't happen for a StringReader 2910353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali assert false; 3010353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali } 3110353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali // set a breakpoint here to inspect the scene 3210353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali System.out.println("finished"); 3310353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali } 3410353ed766fc48a0af6bd33d934439e695c03e3Mahmood Ali} 35