equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
906 DTD parse(InputStream in, DTDBuilder dtd) { |
906 DTD parse(InputStream in, DTDBuilder dtd) { |
907 try { |
907 try { |
908 this.dtd = dtd; |
908 this.dtd = dtd; |
909 this.in = new DTDInputStream(in, dtd); |
909 this.in = new DTDInputStream(in, dtd); |
910 |
910 |
911 long tm = System.currentTimeMillis(); |
|
912 ch = this.in.read(); |
911 ch = this.in.read(); |
913 parseSection(); |
912 parseSection(); |
914 |
913 |
915 if (ch != -1) { |
914 if (ch != -1) { |
916 error("premature"); |
915 error("premature"); |
917 } |
916 } |
918 |
|
919 tm = System.currentTimeMillis() - tm; |
|
920 System.err.println("[Parsed DTD " + dtd + " in " + tm + "ms]"); |
|
921 } catch (IOException e) { |
917 } catch (IOException e) { |
922 error("ioexception"); |
918 error("ioexception"); |
923 } catch (Exception e) { |
919 } catch (Exception e) { |
924 error("exception", e.getClass().getName(), e.getMessage()); |
920 error("exception", e.getClass().getName(), e.getMessage()); |
925 e.printStackTrace(); |
921 e.printStackTrace(); |