@@ -364,7 +364,6 @@ public int lowpc() {
364364 *
365365 * @return the highest code section offset for compiled method code belonging to this class
366366 */
367- @ SuppressWarnings ("unused" )
368367 public int hipc () {
369368 assert hasCompiledEntries ();
370369 return compiledEntries .get (compiledEntries .size () - 1 ).getPrimary ().getHi ();
@@ -379,9 +378,8 @@ public void includeFile(FileEntry file) {
379378 if (files == null ) {
380379 files = new ArrayList <>();
381380 }
382- assert !files .contains (file );
383- // cannot add files after index has been created
384- assert fileIndex == null ;
381+ assert !files .contains (file ) : "caller should ensure file is only included once" ;
382+ assert fileIndex == null : "cannot include files after index has been created" ;
385383 files .add (file );
386384 }
387385
@@ -394,9 +392,8 @@ public void includeDir(DirEntry dirEntry) {
394392 if (dirs == null ) {
395393 dirs = new ArrayList <>();
396394 }
397- assert !dirs .contains (dirEntry );
398- // cannot add dirs after index has been created
399- assert dirIndex == null ;
395+ assert !dirs .contains (dirEntry ) : "caller should ensure dir is only included once" ;
396+ assert dirIndex == null : "cannot include dirs after index has been created" ;
400397 dirs .add (dirEntry );
401398 }
402399
@@ -406,11 +403,9 @@ public void includeDir(DirEntry dirEntry) {
406403 */
407404 public void buildFileAndDirIndexes () {
408405 // this is a one-off operation
409- assert fileIndex == null ;
410- assert dirIndex == null ;
406+ assert fileIndex == null && dirIndex == null : "file and indexes can only be generated once" ;
411407 if (files == null ) {
412- // should not have any dirs if we have no files
413- assert dirs == null ;
408+ assert dirs == null : "should not have included any dirs if we have no files" ;
414409 return ;
415410 }
416411 int idx = 1 ;
0 commit comments