Hi,
I was playing with the history (this is a full time job for
me these
days ))
) and when trying to search with " kak vurvi*******
" the
following exception appeared:
[java] Exception in thread "Thread-22"
java.util.regex.PatternSyntaxException: Dangling meta
character '*' near
index 17
[java] ^(?i).*kak vurvi********.*$
[java] ^
[java] at
java.util.regex.Pattern.error(Pattern.java:1650)
[java] at
java.util.regex.Pattern.sequence(Pattern.java:1787)
[java] at
java.util.regex.Pattern.expr(Pattern.java:1687)
[java] at
java.util.regex.Pattern.compile(Pattern.java:1397)
[java] at
java.util.regex.Pattern.<init>(Pattern.java:1124)
[java] at
java.util.regex.Pattern.compile(Pattern.java:817)
[java] at
java.util.regex.Pattern.matches(Pattern.java:919)
[java] at java.lang.String.matches(String.java:1921)
[java] at
net.java.sip.communicator.impl.history.HistoryReaderImpl.mat
chKeyword(HistoryReaderImpl.java:467)
[java] at
net.java.sip.communicator.impl.history.HistoryReaderImpl.fil
terByKeyword(HistoryReaderImpl.java:420)
[java] at
net.java.sip.communicator.impl.history.HistoryReaderImpl.fin
d(HistoryReaderImpl.java:337)
[java] at
net.java.sip.communicator.impl.history.HistoryReaderImpl.fin
dByKeywords(HistoryReaderImpl.java:264)
[java] at
net.java.sip.communicator.impl.history.HistoryReaderImpl.fin
dByKeyword(HistoryReaderImpl.java:246)
[java] at
net.java.sip.communicator.impl.msghistory.MessageHistoryServ
iceImpl.findByKeyword(MessageHistoryServiceImpl.java:702)
[java] at
net.java.sip.communicator.impl.msghistory.MessageHistoryServ
iceImpl.findByKeyword(MessageHistoryServiceImpl.java:226)
[java] at
net.java.sip.communicator.impl.gui.main.message.history.Hist
oryWindow$KeywordDatesLoader.run(HistoryWindow.java:560)
I think it could be because the special characters are not
escaped when
making the regular expression. I have made myself a method
that do that,
but it's in the gui package. If really this is the problem
causing that
exception and if this could be a common task we could think
about making
a general method in the util package. Or maybe it's already
there?
Regards,
Yana
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe sip-communicator.dev.java.net
For additional commands, e-mail: dev-help sip-communicator.dev.java.net
|