List of usage examples for java.lang Thread dumpStack
public static void dumpStack()
From source file:l2p.gameserver.model.pledge.Clan.java
public void updateClanInDB() { if (getLeaderId() == 0) { _log.warn("updateClanInDB with empty LeaderId"); Thread.dumpStack(); return;/*from w w w. ja v a 2s . c o m*/ } if (getClanId() == 0) { _log.warn("updateClanInDB with empty ClanId"); Thread.dumpStack(); return; } Connection con = null; PreparedStatement statement = null; try { con = DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement( "UPDATE clan_data SET ally_id=?,reputation_score=?,expelled_member=?,leaved_ally=?,dissolved_ally=?,clan_level=?,warehouse=?,airship=?,academy_graduates=? WHERE clan_id=?"); statement.setInt(1, getAllyId()); statement.setInt(2, getReputationScore()); statement.setLong(3, getExpelledMemberTime() / 1000); statement.setLong(4, getLeavedAllyTime() / 1000); statement.setLong(5, getDissolvedAllyTime() / 1000); statement.setInt(6, _level); statement.setInt(7, getWhBonus()); statement.setInt(8, isHaveAirshipLicense() ? getAirshipFuel() : -1); statement.setInt(9, getAcademyGraduatesCount()); statement.setInt(10, getClanId()); statement.execute(); } catch (Exception e) { _log.warn("error while updating clan '" + getClanId() + "' data in db"); _log.error("", e); } finally { DbUtils.closeQuietly(con, statement); } }
From source file:com.comcast.oscar.cli.CommandRun.java
/** * Decompiles the input file/*w w w .ja va 2 s .c om*/ */ public void decompile() { if (comInput != null && comInput.hasInput()) { if (comInput.isBinary()) { ConfigurationFileExport cfe = new ConfigurationFileExport(comInput.getInput(), comSpecification.getConfigurationFileType()); cfe.setDotTextOIDOutputFormat(comDecompile.checkDotted()); ConfigurationFile cf = null; try { cf = new ConfigurationFile(comSpecification.getConfigurationFileType(), cfe.getTlvBuilder()); } catch (TlvException e) { Thread.dumpStack(); e.printStackTrace(); } tlvInsertion(cf); cf.commit(); ConfigurationFileExport cfeSnmp64Insert = new ConfigurationFileExport(cf); System.out.println( cfeSnmp64Insert.toPrettyPrint(comDecompile.checkVerbose(), comDecompile.checkSuppressed())); } else { System.err.println("Input file " + Constants.ERR_NOT_BIN); } } else { System.err.println(Input.ERROR); } }
From source file:l2next.gameserver.model.pledge.Clan.java
public void updateClanInDB() { if (getLeaderId() == 0) { _log.warn("updateClanInDB with empty LeaderId"); Thread.dumpStack(); return;// w w w . j ava 2s. c o m } if (getClanId() == 0) { _log.warn("updateClanInDB with empty ClanId"); Thread.dumpStack(); return; } Connection con = null; PreparedStatement statement = null; try { con = DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement( "UPDATE clan_data SET ally_id=?,reputation_score=?,expelled_member=?,leaved_ally=?,dissolved_ally=?,clan_level=?,warehouse=?,airship=? WHERE clan_id=?"); statement.setInt(1, getAllyId()); statement.setInt(2, getReputationScore()); statement.setLong(3, getExpelledMemberTime() / 1000); statement.setLong(4, getLeavedAllyTime() / 1000); statement.setLong(5, getDissolvedAllyTime() / 1000); statement.setInt(6, _level); statement.setInt(7, getWhBonus()); statement.setInt(8, isHaveAirshipLicense() ? getAirshipFuel() : -1); statement.setInt(9, getClanId()); statement.execute(); } catch (Exception e) { _log.warn("error while updating clan '" + getClanId() + "' data in db"); _log.error("", e); } finally { DbUtils.closeQuietly(con, statement); } }
From source file:l2r.gameserver.model.pledge.Clan.java
public void updateClanInDB() { if (getLeaderId() == 0) { _log.warn("updateClanInDB with empty LeaderId"); Thread.dumpStack(); return;//from w w w. ja v a 2 s.c om } if (getClanId() == 0) { _log.warn("updateClanInDB with empty ClanId"); Thread.dumpStack(); return; } // Because this method is called when managing clan alliances, I'm putting the update here. CharacterNameColorization.updateColor(getOnlineMembers(0).toArray(new Player[0])); Connection con = null; PreparedStatement statement = null; try { con = DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement( "UPDATE clan_data SET ally_id=?,reputation_score=?,expelled_member=?,leaved_ally=?,dissolved_ally=?,clan_level=?,warehouse=?,airship=?,dissolved_clan=?,disband_penalty=? WHERE clan_id=?"); statement.setInt(1, getAllyId()); statement.setInt(2, getReputationScore()); statement.setLong(3, getExpelledMemberTime() / 1000); statement.setLong(4, getLeavedAllyTime() / 1000); statement.setLong(5, getDissolvedAllyTime() / 1000); statement.setInt(6, _level); statement.setInt(7, getWhBonus()); statement.setInt(8, isHaveAirshipLicense() ? getAirshipFuel() : -1); statement.setLong(9, getDissolvedClanTime() / 1000L); statement.setLong(10, getDisbandPenaltyTime() / 1000L); statement.setInt(11, getClanId()); statement.execute(); } catch (Exception e) { _log.warn("error while updating clan '" + getClanId() + "' data in db"); _log.error("", e); } finally { DbUtils.closeQuietly(con, statement); } }
From source file:l2s.gameserver.model.pledge.Clan.java
private void updateClanScoreInDB() { if (getClanId() == 0) { _log.warn("updateClanScoreInDB with empty ClanId"); Thread.dumpStack(); return;//from w w w .j a v a 2 s . c o m } Connection con = null; PreparedStatement statement = null; try { con = DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement("UPDATE clan_data SET reputation_score=? WHERE clan_id=?"); statement.setInt(1, getReputationScore()); statement.setInt(2, getClanId()); statement.execute(); } catch (Exception e) { _log.warn("error while updating clan reputation score '" + getClanId() + "' data in db"); _log.error("", e); } finally { DbUtils.closeQuietly(con, statement); } }
From source file:l2s.gameserver.model.pledge.Clan.java
public void updateClanInDB() { if (getLeaderId() == 0) { _log.warn("updateClanInDB with empty LeaderId"); Thread.dumpStack(); return;// w w w . j a v a 2 s. c o m } if (getClanId() == 0) { _log.warn("updateClanInDB with empty ClanId"); Thread.dumpStack(); return; } Connection con = null; PreparedStatement statement = null; try { con = DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement( "UPDATE clan_data SET ally_id=?,reputation_score=?,expelled_member=?,leaved_ally=?,dissolved_ally=?,clan_level=?,warehouse=?,airship=?,academy_graduates=?,castle_defend_count=?,disband_end=?,disband_penalty=? WHERE clan_id=?"); statement.setInt(1, getAllyId()); statement.setInt(2, getReputationScore()); statement.setLong(3, getExpelledMemberTime() / 1000); statement.setLong(4, getLeavedAllyTime() / 1000); statement.setLong(5, getDissolvedAllyTime() / 1000); statement.setInt(6, _level); statement.setInt(7, getWhBonus()); statement.setInt(8, isHaveAirshipLicense() ? getAirshipFuel() : -1); statement.setInt(9, getAcademyGraduatesCount()); statement.setInt(10, getCastleDefendCount()); statement.setInt(11, (int) (getDisbandEndTime() / 1000L)); statement.setInt(12, (int) (getDisbandPenaltyTime() / 1000L)); statement.setInt(13, getClanId()); statement.execute(); } catch (Exception e) { _log.warn("error while updating clan '" + getClanId() + "' data in db"); _log.error("", e); } finally { DbUtils.closeQuietly(con, statement); } }
From source file:net.sf.freecol.FreeCol.java
/** * Exit printing fatal error message.//from w w w.j av a 2 s . co m * * @param err The error message to print. */ public static void fatal(String err) { if (err == null || err.isEmpty()) { err = "Bogus null fatal error message"; Thread.dumpStack(); } System.err.println(err); System.exit(1); }
From source file:lineage2.gameserver.model.pledge.Clan.java
/** * Method updateClanInDB.//from w ww.j a va 2 s . com */ public void updateClanInDB() { if (getLeaderId() == 0) { _log.warn("updateClanInDB with empty LeaderId"); Thread.dumpStack(); return; } if (getClanId() == 0) { _log.warn("updateClanInDB with empty ClanId"); Thread.dumpStack(); return; } Connection con = null; PreparedStatement statement = null; try { con = DatabaseFactory.getInstance().getConnection(); statement = con.prepareStatement( "UPDATE clan_data SET ally_id=?,reputation_score=?,expelled_member=?,leaved_ally=?,dissolved_ally=?,clan_level=?,warehouse=?,airship=? WHERE clan_id=?"); statement.setInt(1, getAllyId()); statement.setInt(2, getReputationScore()); statement.setLong(3, getExpelledMemberTime() / 1000); statement.setLong(4, getLeavedAllyTime() / 1000); statement.setLong(5, getDissolvedAllyTime() / 1000); statement.setInt(6, _level); statement.setInt(7, getWhBonus()); statement.setInt(8, isHaveAirshipLicense() ? getAirshipFuel() : -1); statement.setInt(9, getClanId()); statement.execute(); } catch (Exception e) { _log.warn("error while updating clan '" + getClanId() + "' data in db"); _log.error("", e); } finally { DbUtils.closeQuietly(con, statement); } }
From source file:com.norbl.cbp.ppe.Ec2Wrangler.java
private void throwMissingParamsEx(String name) throws MissingParamsException { System.err.println("Param " + name + " is " + params.getMissingParamMessage() + "\nParams:\n" + params.toString() + "\n"); Thread.dumpStack(); throw new MissingParamsException("Param " + name + " is " + params.getMissingParamMessage()); }
From source file:eu.stratosphere.pact.runtime.task.RegularPactTask.java
protected S initStub(Class<? super S> stubSuperClass) throws Exception { try {//from w ww.jav a 2s . c o m S stub = config.<S>getStubWrapper(this.userCodeClassLoader).getUserCodeObject(stubSuperClass, this.userCodeClassLoader); // check if the class is a subclass, if the check is required if (stubSuperClass != null && !stubSuperClass.isAssignableFrom(stub.getClass())) { Thread.dumpStack(); throw new RuntimeException("The class '" + stub.getClass().getName() + "' is not a subclass of '" + stubSuperClass.getName() + "' as is required."); } stub.setRuntimeContext(this.runtimeUdfContext); return stub; } catch (ClassCastException ccex) { throw new Exception("The stub class is not a proper subclass of " + stubSuperClass.getName(), ccex); } }