GetFeatureInfo with same layer twice but different styles returns the features according to the first style only (and duplicated)

Description

Steps to reproduce on demo data.

Workspace, Datastore and nyc Layer setup according to http://docs.geoserver.org/latest/en/user/gettingstarted/shapefile-quickstart/index.html

Create two styles as below.
Associate the styles to layer: nyc_roads.

Queries from browser:
1: return two road sections from roads other than Broadway
http://192.168.96.33:8080/geoserver/nyc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=nyc%3Anyc_roads&STYLES=nyc_BROADWAY&LAYERS=nyc%3Anyc_roads&INFO_FORMAT=text%2Fhtml&FEATURE_COUNT=50&X=50&Y=50&SRS=EPSG%3A2908&WIDTH=101&HEIGHT=101&BBOX=986942.4708652133%2C213077.2430648932%2C988870.345253427%2C215005.11745310682

2: return two road sections from Broadway
http://192.168.96.33:8080/geoserver/nyc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=nyc%3Anyc_roads&STYLES=nyc_BROADWAY&LAYERS=nyc%3Anyc_roads&INFO_FORMAT=text%2Fhtml&FEATURE_COUNT=50&X=50&Y=50&SRS=EPSG%3A2908&WIDTH=101&HEIGHT=101&BBOX=986942.4708652133%2C213077.2430648932%2C988870.345253427%2C215005.11745310682

3: SHOULD return all 4 sections, but only returns Broadway sections twice
http://192.168.96.33:8080/geoserver/nyc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=nyc%3Anyc_roads,nyc%3Anyc_roads&STYLES=nyc_BROADWAY,nyc_not_BROADWAY&LAYERS=nyc%3Anyc_roads,nyc%3Anyc_roads&INFO_FORMAT=text%2Fhtml&FEATURE_COUNT=50&X=50&Y=50&SRS=EPSG%3A2908&WIDTH=101&HEIGHT=101&BBOX=986942.4708652133%2C213077.2430648932%2C988870.345253427%2C215005.11745310682

4: SHOULD return all 4 sections, but only return not Broadway sections twice
http://192.168.96.33:8080/geoserver/nyc/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetFeatureInfo&FORMAT=image%2Fpng&TRANSPARENT=true&QUERY_LAYERS=nyc%3Anyc_roads,nyc%3Anyc_roads&STYLES=nyc_not_BROADWAY,nyc_BROADWAY&LAYERS=nyc%3Anyc_roads,nyc%3Anyc_roads&INFO_FORMAT=text%2Fhtml&FEATURE_COUNT=50&X=50&Y=50&SRS=EPSG%3A2908&WIDTH=101&HEIGHT=101&BBOX=986942.4708652133%2C213077.2430648932%2C988870.345253427%2C215005.11745310682

nyc_BROADWAY with SLD content:

nyc_not_BROADWAY with SLD content:

Environment

None

Status

Assignee

Unassigned

Reporter

László Németh

Triage

Fix versions

None

Affects versions

Priority

Medium
Configure