My favorites | Sign in
Project Home Downloads Wiki Issues Source
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 545: Patch text incorrectly detected as HZ-GB-2312
2 people starred this issue and may be notified of changes. Back to list
Status:  Released
Owner:  ----
Closed:  Mar 2012


Sign in to add a comment
 
Reported by dancys...@gmail.com, Apr 26, 2010
Version: 2.1.2.2-20-g21f8fb4

We have a patch that, for whatever reason, is detected as charset HZ-GB-
2312 by the UniversalDetector.  I examined the text of the patch and it has 
no non-ascii characters.  

Since HZ-GB-2312 isn't supported by Java, when users try to look at the 
change, they end up w/ an error page and the server logs the error included 
below.  

As a workaround, I modified Text.java:
  // Added by dancy                                                                                                             
    if (encoding == "HZ-GB-2312") {
        encoding = "ISO-8859-1";
    }

This got us back on track for the time being.


[2010-04-18 10:58:58,804] ERROR 
com.google.gerrit.server.cache.SelfPopulatingCache : Cannot lookup 
com.google.gerrit.server.patch.PatchListKey@6c6f9120 in "diff"
net.sf.ehcache.CacheException: Could not fetch object for cache entry with 
key "com.google.gerrit.server.patch.PatchListKey@6c6f9120".
	at 
net.sf.ehcache.constructs.blocking.SelfPopulatingCache.get(SelfPopulatingCa
che.java:88)
	at 
com.google.gerrit.server.cache.SelfPopulatingCache.get(SelfPopulatingCache.
java:107)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.get(PatchListCacheImpl.ja
va:115)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.get(PatchListCacheImpl.ja
va:127)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.get(PatchListCacheImpl.ja
va:119)
	at 
com.google.gerrit.httpd.rpc.changedetail.PatchSetDetailFactory.call(PatchSe
tDetailFactory.java:83)
	at 
com.google.gerrit.httpd.rpc.changedetail.ChangeDetailFactory.loadCurrentPat
chSet(ChangeDetailFactory.java:188)
	at 
com.google.gerrit.httpd.rpc.changedetail.ChangeDetailFactory.call(ChangeDet
ailFactory.java:108)
	at 
com.google.gerrit.httpd.rpc.changedetail.ChangeDetailFactory.call(ChangeDet
ailFactory.java:53)
	at com.google.gerrit.httpd.rpc.Handler.to(Handler.java:65)
	at 
com.google.gerrit.httpd.rpc.changedetail.ChangeDetailServiceImpl.changeDeta
il(ChangeDetailServiceImpl.java:42)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
9)
	at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
l.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at 
com.google.gwtjsonrpc.server.MethodHandle.invoke(MethodHandle.java:91)
	at 
com.google.gwtjsonrpc.server.JsonServlet.doService(JsonServlet.java:382)
	at 
com.google.gwtjsonrpc.server.JsonServlet.service(JsonServlet.java:268)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at 
com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.jav
a:216)
	at 
com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:
141)
	at 
com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipe
line.java:93)
	at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocat
ion.java:63)
	at 
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:1
34)
	at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocat
ion.java:59)
	at 
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:1
34)
	at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocat
ion.java:59)
	at 
com.google.gwtexpui.server.CacheControlFilter.doFilter(CacheControlFilter.j
ava:76)
	at 
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:1
29)
	at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocat
ion.java:59)
	at 
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:1
34)
	at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocat
ion.java:59)
	at 
com.google.gerrit.httpd.RequestCleanupFilter.doFilter(RequestCleanupFilter.
java:54)
	at 
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:1
29)
	at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocat
ion.java:59)
	at 
com.google.inject.servlet.FilterDefinition.doFilter(FilterDefinition.java:1
34)
	at 
com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocat
ion.java:59)
	at 
com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipel
ine.java:122)
	at 
com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
	at 
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandle
r.java:1187)
	at 
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:425)
	at 
org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.jav
a:931)
	at 
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:362)
	at 
org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java
:867)
	at 
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:11
7)
	at 
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:
113)
	at org.eclipse.jetty.server.Server.handle(Server.java:334)
	at 
org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:5
59)
	at 
org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnecti
on.java:1007)
	at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:747)
	at 
org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:209)
	at 
org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:406)
	at 
org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.ja
va:462)
	at 
org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:
436)
	at java.lang.Thread.run(Thread.java:619)
Caused by: java.nio.charset.UnsupportedCharsetException: HZ-GB-2312
	at java.nio.charset.Charset.forName(Charset.java:505)
	at com.google.gerrit.server.patch.Text.charset(Text.java:42)
	at com.google.gerrit.server.patch.Text.decode(Text.java:74)
	at com.google.gerrit.server.patch.Text.getLines(Text.java:69)
	at com.google.gerrit.server.patch.Text.getLine(Text.java:56)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.isBlankLineGap(PatchListC
acheImpl.java:465)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.combineLineEdits(PatchLis
tCacheImpl.java:445)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.newEntry(PatchListCacheIm
pl.java:248)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.readPatchList(PatchListCa
cheImpl.java:203)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.compute(PatchListCacheImp
l.java:134)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl.access$000(PatchListCache
Impl.java:64)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl$2.createEntry(PatchListCa
cheImpl.java:102)
	at 
com.google.gerrit.server.patch.PatchListCacheImpl$2.createEntry(PatchListCa
cheImpl.java:99)
	at 
com.google.gerrit.server.cache.SelfPopulatingCache$1.createEntry(SelfPopula
tingCache.java:60)
	at 
net.sf.ehcache.constructs.blocking.SelfPopulatingCache.get(SelfPopulatingCa
che.java:72)
	... 54 more




Apr 27, 2010
#1 sop@google.com
Fixed by I4b52836a69cdec2907ff8ff92d178faec3eb6fe7
Status: Fixed
Labels: FixedIn-2.1.2.4
Mar 27, 2012
#2 sop@google.com
(No comment was entered for this change.)
Status: Released
Sign in to add a comment

Powered by Google Project Hosting