private Method methodFor(CommandLineOption option) { return AssertionUtil.notNull(this.optionToMethod.get(option), option.toString()); }
AssertionUtil.enableAssertionsFor(subjectClass);
@Override public void transform(String path, File in, File out, Mode mode) throws IOException { switch (mode) { case CHECK: throw FileTransformer.NOT_IDENTICAL; case CHECK_AND_TRANSFORM: throw AssertionUtil.<Error>fail("Must not invoke 'remove()' in mode CHECK_AND_TRANSFORM"); case TRANSFORM: if (in.equals(out)) { if (!in.delete()) throw new IOException("Could not delete '" + in + "'"); } return; default: throw AssertionUtil.<Error>fail("Unexpected mode '" + mode + "'"); } } };
class SecretKeys { static { AssertionUtil.enableAssertionsForThisClass(); }
class NoTemplate { static { AssertionUtil.enableAssertionsForThisClass(); }
private void execute2() throws Exception { File archiveFile = this.archiveFile; if (archiveFile == null) throw new BuildException("Attribute 'archiveFile=\"...\"' missing"); OutputStream os = new FileOutputStream( AssertionUtil.notNull(this.archiveFile, "Attribute 'archiveFile=\"...\"' missing") ); Closeable c = os; try { c = this.pack.setOutputStream(os); this.execute3(); c.close(); } finally { try { c.close(); } catch (Exception e) {} } }
@Override public void transform(String path, File in, File out, Mode mode) throws IOException { switch (mode) { case CHECK: throw FileTransformer.NOT_IDENTICAL; case CHECK_AND_TRANSFORM: throw AssertionUtil.<Error>fail("Must not invoke 'remove()' in mode CHECK_AND_TRANSFORM"); case TRANSFORM: if (in.equals(out)) { if (!in.delete()) throw new IOException("Could not delete '" + in + "'"); } return; default: throw AssertionUtil.<Error>fail("Unexpected mode '" + mode + "'"); } } };
AssertionUtil.enableAssertionsFor(subjectClass);
@Override public synchronized void write(@Nullable byte[] b, int off, int len) throws IOException { while (len > this.delegateByteCount) { this.delegate.write(b, off, (int) this.delegateByteCount); this.delegate.close(); off += this.delegateByteCount; len -= this.delegateByteCount; this.delegate = AssertionUtil.notNull( delegates.produce(), "'delegates' produced <null>" ); this.delegateByteCount = AssertionUtil.notNull( byteCountLimits.produce(), "'byteCountLimits' produced <null>" ); } this.delegate.write(b, off, len); this.delegateByteCount -= len; }
@Override public void transform(String path, File in, File out, Mode mode) throws IOException { switch (mode) { case CHECK: return; case CHECK_AND_TRANSFORM: case TRANSFORM: if (!in.equals(out)) IoUtil.copy(in, out); return; default: throw AssertionUtil.<Error>fail("Unexpected mode '" + mode + "'"); } } };
private NodeWithPath scanStream(ProducerWhichThrows<? extends InputStream, IOException> opener) throws IOException { ContentsProcessor<NodeWithPath> dcp = this.contentsProcessor(); InputStream stream1 = AssertionUtil.notNull(opener.produce()); final NodeWithPath node1; try { node1 = dcp.process("", stream1, -1L, -1L, opener); stream1.close(); } finally { try { stream1.close(); } catch (Exception e) {} } assert node1 != null; return node1; }
throw AssertionUtil.<Error>fail("Unexpected mode '" + mode + "'");
throw AssertionUtil.<Error>fail("Unexpected mode '" + mode + "'");
@Override @Nullable public Void process( String name, final InputStream is, long size, long crc32, ProducerWhichThrows<? extends InputStream, ? extends IOException> opener ) throws IOException { if (!Pack.this.pathPredicate.evaluate(name)) return null; AssertionUtil.notNull(Pack.this.archiveFormat).writeEntry( AssertionUtil.notNull(Pack.this.archiveOutputStream), name, IoUtil.copyFrom(is) ); return null; } };
throw AssertionUtil.<Error>fail("Unexpected mode '" + mode + "'");
@Override @Nullable public InputStream produce() throws IOException { ArchiveInputStream ais = AssertionUtil.notNull(archiveOpener.produce()); for (ArchiveEntry ae2 = ais.getNextEntry(); ae2 != null; ae2 = ais.getNextEntry()) { String name2 = ArchiveFormatFactory.normalizeEntryName(ae2.getName()); if (name2.equals(entryName)) return ais; } ais.close(); throw new IOException(entryPath); } };
throw AssertionUtil.<Error>fail("Unexpected mode '" + mode + "'");
@Override @Nullable public InputStream produce() throws IOException { ArchiveInputStream ais = AssertionUtil.notNull(archiveOpener.produce()); for (ArchiveEntry ae2 = ais.getNextEntry(); ae2 != null; ae2 = ais.getNextEntry()) { String name2 = ArchiveFormatFactory.normalizeEntryName(ae2.getName()); if (name2.equals(entryName)) return ais; } ais.close(); throw new IOException(entryPath); } };