2014-08-28 3 views
0

pmd 검사를 실행할 때 내 코드가 스레드 그룹 회피 오류로 표시되고 그 이유를 알 수 없습니다. 아무도 나에게 이것을 설명 할 수 있습니까? 여기 Timestamp에서 java.lang.ThreadGroup을 사용하지 마십시오

Timestamp currentTimestamp = new java.sql.Timestamp(Calendar.getInstance().getTime().getTime()); 

그리고

는 PMD 로그입니다 :

<violation beginline="40" endline="40" begincolumn="36" endcolumn="53" rule="AvoidThreadGroup" ruleset="Basic Rules" package="com" class="Route" externalInfoUrl="http://pmd.sourceforge.net/rules/basic.html#AvoidThreadGroup" priority="3"> 
Avoid using java.lang.ThreadGroup; it is not thread safe 

답변

1

신경 끄시 고, 나는 PMD 검사를 통과하기를 얻었다. 왜 그런지는 모르겠지만 그 라인을 이것으로 대체하면 효과가있었습니다.

Timestamp currentTimestamp = new Timestamp(Calendar.getInstance().getTime().getTime()); 
관련 문제