打字猴:1.70045344e+09
1700453440 }
1700453441
1700453442 }
1700453443
1700453444 (3)警示性注释
1700453445
1700453446 这类注释是我们经常缺乏的,或者是经常忽视的(即使有了,也常常是与代码版本不匹配),比如可以在注释中提示此代码的缺陷,或者它在不同操作系统上的表现,或者警告后续人员不要随意修改,例如tomcat的源码org.apache.tomcat.jni.Global中有这样一段注释:
1700453447
1700453448 public class Global{
1700453449
1700453450 /**
1700453451
1700453452 *Note:it is important that the APR_STATUS_IS_EBUSY(s)
1700453453
1700453454 *macro be used to determine
1700453455
1700453456 *if the return value was APR_EBUSY, for portability reasons.
1700453457
1700453458 *@param mutex the mutex on which to attempt the lock acquiring.
1700453459
1700453460 */
1700453461
1700453462 public static native int trylock(long mutex);
1700453463
1700453464 }
1700453465
1700453466 (4)TODO注释
1700453467
1700453468 对于一些未完成的任务,则增加上TODO提示,并标明是什么事情没有做完,以方便下次看到这个TODO标记时还能记忆起要做什么事情,比如在DBCP源代码中有这样的TODO注释:
1700453469
1700453470 public class DelegatingStatement extends……implements……{
1700453471
1700453472 /*
1700453473
1700453474 *Note was protected prior to JDBC 4
1700453475
1700453476 *TODO Consider adding build fags to make this protected
1700453477
1700453478 *unless we are using JDBC 4.
1700453479
1700453480 */
1700453481
1700453482 public boolean isClosed()throws SQLException{
1700453483
1700453484 return_closed;
1700453485
1700453486 }
1700453487
1700453488 }
1700453489
[ 上一页 ]  [ :1.70045344e+09 ]  [ 下一页 ]