开发者

How to avoid this warning:warning: com.sun.org.apache.regexp.internal.RE is Sun proprietary API and may be removed in a future release

开发者 https://www.devze.com 2023-04-12 04:37 出处:网络
private static RE_TaskTypeRE= new RE(\"~:~([0-9]*)~\"); and this requires import com.sun.org.apache.regexp.internal.RE;

private static RE _TaskTypeRE = new RE("~:~([0-9]*)~");

and this requires import com.sun.org.apache.regexp.internal.RE;

So on compiling I am getting the following warning.

 warning: com.sun.org.apache.regexp.internal.RE is Sun proprietary API and may be removed in a future release
    [javac] import com.sun.org.apache.regexp.internal.RE;

One solution is to not use that class.

Another solution is开发者_运维技巧 to ignore the warning. If i want to avoid this class what is the better alternative. Thanks


If you need regular expressions, use the Pattern class.

private static Pattern p = Pattern.compile("~:~([0-9]*)~");

Take a look at the JavaDoc I linked to though. It may work differently.

0

精彩评论

暂无评论...
验证码 换一张
取 消