- 1
void setEnabled(boolean disable)
Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
+82
void setEnabled(boolean disable)
+66
Link link = new Link( element );
if( !Browser.getBrowser().isElementPresent( link.getLocator() ) )
{
return false;
}
else
{
return true;
}
зачэм так?
+79
long sourceBaseId = Long.parseLong(_depId+"00000000000000");
+144
07.07.2010 14:49:14 com.mchange.v2.c3p0.C3P0Registry banner
INFO: Initializing c3p0-0.9.1.2 [built 21-May-2007 15:04:56; debug? true; trace:
10]
07.07.2010 14:49:15 com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource getPoo
lManager
INFO: Initializing c3p0 pool... com.mchange.v2.c3p0.ComboPooledDataSource [ acqu
ireIncrement -> 5, acquireRetryAttempts -> 0, acquireRetryDelay -> 500, autoComm
itOnClose -> true, automaticTestTable -> connection_test_table, breakAfterAcquir
eFailure -> false, checkoutTimeout -> 0, connectionCustomizerClassName -> null,
connectionTesterClassName -> com.mchange.v2.c3p0.impl.DefaultConnectionTester, d
ataSourceName -> mo0lz2891bvagwh7rwflk|11e1e67, debugUnreturnedConnectionStackTr
aces -> false, description -> null, driverClass -> com.mysql.jdbc.Driver, factor
yClassLocation -> null, forceIgnoreUnresolvedTransactions -> false, identityToke
n -> mo0lz2891bvagwh7rwflk|11e1e67, idleConnectionTestPeriod -> 3600, initialPoo
lSize -> 10, jdbcUrl -> jdbc:mysql://localhost/mysql, maxAdministrativeTaskTime
-> 0, maxConnectionAge -> 0, maxIdleTime -> 0, maxIdleTimeExcessConnections -> 0
, maxPoolSize -> 10, maxStatements -> 0, maxStatementsPerConnection -> 100, minP
oolSize -> 10, numHelperThreads -> 3, numThreadsAwaitingCheckoutDefaultUser -> 0
, preferredTestQuery -> null, properties -> {user=******, password=******}, prop
ertyCycle -> 0, testConnectionOnCheckin -> false, testConnectionOnCheckout -> fa
lse, unreturnedConnectionTimeout -> 0, usesTraditionalReflectiveProxies -> false
]
07.07.2010 14:49:15 com.l2scoria.loginserver.LoginController <init>
INFO: Loading LoginContoller...
07.07.2010 14:49:21 com.l2scoria.loginserver.LoginController <init>
INFO: Cached 10 KeyPairs for RSA communication
Exception in thread "main" java.lang.NullPointerException
at com.l2scoria.util.random.MTRandom.next(MTRandom.java:355)
at java.util.Random.nextDouble(Random.java:438)
at com.l2scoria.util.random.Rnd.nextInt(Rnd.java:55)
at com.l2scoria.loginserver.LoginController.generateBlowFishKeys(LoginCo
ntroller.java:176)
at com.l2scoria.loginserver.LoginController.<init>(LoginController.java:
138)
at com.l2scoria.loginserver.LoginController.load(LoginController.java:10
3)
at com.l2scoria.loginserver.L2LoginServer.<init>(L2LoginServer.java:117)
at com.l2scoria.loginserver.L2LoginServer.main(L2LoginServer.java:61)
LoginServer terminated abnormaly
Send you bug to : http://la2.100nt.ru
LoginServer terminated
Send you bug to : http://la2.100nt.ru
Restart(r) or Quit(q)^CTerminate batch job (Y/N)?
+87
/**
* The Time class is a faster replacement for the java.util.Calendar and
* java.util.GregorianCalendar classes. An instance of the Time class represents
* a moment in time, specified with second precision. It is modelled after
* struct tm, and in fact, uses struct tm to implement most of the
* functionality.
*/
public class Time {
...
/**
* Year. TBD. Is this years since 1900 like in struct tm?
*/
public int year;
...
}
Android 1.5. TBD в публичном API официального SDK - это пять. Ну мы ещё подумаем, как нам нравится, а вы пока просто посмотрите в дебаге! Гы.
+81
if (f.mColor != null) {
int c = -1;
if (f.mColor.equalsIgnoreCase("aqua")) {
c = 0x00FFFF;
} else if (f.mColor.equalsIgnoreCase("black")) {
c = 0x000000;
} else if (f.mColor.equalsIgnoreCase("blue")) {
c = 0x0000FF;
} else if (f.mColor.equalsIgnoreCase("fuchsia")) {
c = 0xFF00FF;
} else if (f.mColor.equalsIgnoreCase("green")) {
c = 0x008000;
} else if (f.mColor.equalsIgnoreCase("grey")) {
c = 0x808080;
} else if (f.mColor.equalsIgnoreCase("lime")) {
c = 0x00FF00;
} else if (f.mColor.equalsIgnoreCase("maroon")) {
c = 0x800000;
} else if (f.mColor.equalsIgnoreCase("navy")) {
c = 0x000080;
} else if (f.mColor.equalsIgnoreCase("olive")) {
c = 0x808000;
} else if (f.mColor.equalsIgnoreCase("purple")) {
c = 0x800080;
} else if (f.mColor.equalsIgnoreCase("red")) {
c = 0xFF0000;
} else if (f.mColor.equalsIgnoreCase("silver")) {
c = 0xC0C0C0;
} else if (f.mColor.equalsIgnoreCase("teal")) {
c = 0x008080;
} else if (f.mColor.equalsIgnoreCase("white")) {
c = 0xFFFFFF;
} else if (f.mColor.equalsIgnoreCase("yellow")) {
c = 0xFFFF00;
} else {
try {
c = XmlUtils.convertValueToInt(f.mColor, -1);
} catch (NumberFormatException nfe) {
// Can't understand the color, so just drop it.
}
}
Исходники Android 1.5, Html.java:636 .
Неудивительно, что Html.fromHtml() тормозит так, что юзать для списков вообще нельзя, даже один раз.
+74
public static int indexOf(String str, String... array) {
return ArrayUtils.indexOf(array, str);
}
+83
String error= "TYPE {" + ex.getType() + "} TEXT {" + ex.getText() + "} STACK {" + stringWriter.toString() + "} LOG {" + _localLog + "}";
if(error.length()>3000)
{
error= "TYPE {" + ex.getType() + "} TEXT {" + ex.getText() + "} STACK {" +stringWriter.toString() + "} LOG {" + "}";
}
if(error.length()>3000)
{
error= "TYPE {" + ex.getType() + "} TEXT {" + ex.getText() + "} STACK {" +stringWriter.toString().substring(0,Math.min(700, stringWriter.toString().length())) + "} LOG {" +_localLog.substring(0,Math.min(700, _localLog.length()))+ "}";
}
if(error.length()>3000)
{
error= "TYPE {" + ex.getType() + "} TEXT {" + ex.getText() + "} STACK {" + "} LOG {" + "}";
}
if(error.length()>3000)
{
error= error.substring(0,3000);
}
+96
public static Entity read(final URI path) {
if(!(path.items!= null && (0 < path.items.size()))){
assert (false);
}
//дальше сам метод
+77
Writer writer = new BufferedWriter(new FileWriter(new File("launch.vbs")));
writer.write("Set objIExplorer = CreateObject(\"internetexplorer.application\")\r\n");
writer.write("objIExplorer.visible = True\r\n");
writer.write("objIExplorer.navigate \"http://www.google.com\"\r\n");
writer.flush();
writer.close();
Runtime.getRuntime().exec("cscript.exe launch.vbs");
Запуск IE под виндой, когда путь к нему неизвестен.