Buggy code:
public class PrisonPearlMysqlStorage implements IPrisonPearlStorage { private Database db ; private PrisonPearlPlugin plugin ; private MysqlDatabaseHandler handle ; private boolean isMercuryEnabled = PrisonPearlPlugin . isMercuryEnabled ( ) ; private boolean isWorldBorderEnabled = PrisonPearlPlugin . isWorldBorderEnabled ( ) ; public PrisonPearlMysqlStorage ( Database db , MysqlDatabaseHandler handle ) { } private void createTables ( ) { } private String addPearl ; private String removePearl ; private String getPearl ; private String getAllPearls ; private String updatePearl ; private String updateLastRestart ; private String getLastRestart ; private String insertFirstRestart ; private void initializeStatements ( ) { } private final int HolderStateToInventory_SUCCESS = 0 ; private final int HolderStateToInventory_BADPARAM = 1 ; private final int HolderStateToInventory_NULLSTATE = 2 ; private final int HolderStateToInventory_BADCONTAINER = 3 ; private final int HolderStateToInventory_NULLINV = 4 ; private Map < UUID , PrisonPearl > pearls = new HashMap < UUID , PrisonPearl > ( ) ; private long lastFeed ; @ Override public void addPearl ( PrisonPearl pp ) { } @ Override public void removePearl ( PrisonPearl pp , String reason ) { } @ Override public void load ( ) { } @ Override public void save ( ) { } @ Override public Collection < PrisonPearl > getAllPearls ( ) { } @ Override public void updatePearl ( PrisonPearl pp ) { } @ Override public void updateLastFeed ( long lastFeed ) { } @ Override public long getLastFeed ( ) { } @ Override public boolean isImprisoned ( UUID uuid ) { } @ Override public boolean isImprisoned ( Player p ) { } @ Override public Integer getImprisonedCount ( UUID [ ] ids ) { } @ Override public UUID [ ] getImprisonedIds ( UUID [ ] ids ) { } @ Override public String feedPearls ( PrisonPearlManager pearlman ) { } @ Override public int HolderStateToInventory ( PrisonPearl pp , Inventory [ ] inv ) { } @ Override public boolean upgradePearl ( Inventory inv , PrisonPearl pp ) { } @ Override public boolean isPrisonPearl ( ItemStack itemStack ) { } @ Override public PrisonPearl getByImprisoned ( Player player ) { } @ CivConfig ( name = "fixMissingPearls" , def = "false" , type = CivConfigType . Bool ) private void fixAllPearlMissing ( UUID uuid ) { } @ Override public PrisonPearl getPearlbyItemStack ( ItemStack stack ) { if ( ( ( stack == null ) || ( ! ( stack . hasItemMeta ( ) ) ) ) || ( ( stack . getType ( ) ) != ( Material . ENDER_PEARL ) ) ) return null ; if ( ! ( stack . getItemMeta ( ) . hasLore ( ) ) ) return null ; List < String > lore = stack . getItemMeta ( ) . getLore ( ) ; if ( ( lore . size ( ) ) != 3 ) return null ; UUID uuid = UUID . fromString ( lore . get ( 1 ) . split ( "<seq2seq4repair_space>" ) [ 1 ] ) ; PrisonPearl pp = getByImprisoned ( uuid ) ; if ( pp == null ) return null ; int id = Integer . parseInt ( lore . get ( 2 ) . split ( "<seq2seq4repair_space>" ) [ 1 ] ) ; <START_BUG> boolean isValid = ( uuid . equals ( pp . getImprisonedId ( ) . toString ( ) ) ) && ( id == ( pp . getUniqueIdentifier ( ) ) ) ; <END_BUG> if ( ! isValid ) { stack . setItemMeta ( null ) ; pp = null ; } return pp ; } @ Override public PrisonPearl newPearl ( OfflinePlayer imprisoned , Player imprisoner ) { } @ Override public PrisonPearl newPearl ( String imprisonedName , UUID imprisonedId , Player imprisoner ) { } @ Override public PrisonPearl getByImprisoned ( UUID uuid ) { } }

Fix:
boolean isValid = ( uuid . equals ( pp . getImprisonedId ( ) ) ) && ( id == ( pp . getUniqueIdentifier ( ) ) ) ;