Source:
<code>public final ConveyorTile dispatch( final GetMapRequest request, StringBuilder requestMistmatchTarget) { String layerName = request.getRawKvp().get("LAYERS"); if (layerName.indexOf(',') != -1) { requestMistmatchTarget.append("more than one layer requested"); return null; } if (!tld.layerExists(layerName)) { <START> LayerInfo layerInfo = catalog.getLayerByName(layerName); <END> if (layerInfo != null) layerName = layerInfo.prefixedName(); else { requestMistmatchTarget.append("not a tile layer"); return null; } } final TileLayer tileLayer; try { tileLayer = this.tld.getTileLayer(layerName); } catch (GeoWebCacheException e) { throw new RuntimeException(e); } if (!tileLayer.isEnabled()) { requestMistmatchTarget.append("tile layer disabled"); return null; } if (getConfig().isSecurityEnabled()) { String bboxstr = request.getRawKvp().get("BBOX"); String srs = request.getRawKvp().get("SRS"); ReferencedEnvelope bbox = null; try { bbox = (ReferencedEnvelope) new BBoxKvpParser().parse(bboxstr); } catch (Exception e) { throw new RuntimeException( "Invalid bbox for layer '" + layerName + "': " + bboxstr); } if (srs != null) { try { bbox = new ReferencedEnvelope(bbox, CRS.decode(srs)); } catch (Exception e) { throw new RuntimeException( "Can't decode SRS for layer '" + layerName + "': " + srs); } } try { verifyAccessLayer(layerName, bbox); } catch (ServiceException | SecurityException e) { return null; } } ConveyorTile tileReq = prepareRequest(tileLayer, request, requestMistmatchTarget); if (null == tileReq) { return null; } ConveyorTile tileResp = null; try { tileResp = tileLayer.getTile(tileReq); } catch (Exception e) { log.log(Level.INFO, "Error dispatching tile request to GeoServer", e); } return tileResp; }</code><technical_language>This LocalWorkspaceCatalog</technical_language>

Target:
public final ConveyorTile dispatch( final GetMapRequest request, StringBuilder requestMistmatchTarget) { final String layerName = request.getRawKvp().get("LAYERS"); if (layerName.indexOf(',') != -1) { requestMistmatchTarget.append("more than one layer requested"); return null; } final String getPrefixedName = (!layerName.contains(":")) ? getPrefixedName(layerName) : layerName; if (!tld.layerExists(getPrefixedName)) { requestMistmatchTarget.append("not a tile layer"); return null; } final TileLayer tileLayer; try { tileLayer = this.tld.getTileLayer(getPrefixedName); } catch (GeoWebCacheException e) { throw new RuntimeException(e); } if (!tileLayer.isEnabled()) { requestMistmatchTarget.append("tile layer disabled"); return null; } if (getConfig().isSecurityEnabled()) { String bboxstr = request.getRawKvp().get("BBOX"); String srs = request.getRawKvp().get("SRS"); ReferencedEnvelope bbox = null; try { bbox = (ReferencedEnvelope) new BBoxKvpParser().parse(bboxstr); } catch (Exception e) { throw new RuntimeException( "Invalid bbox for layer '" + layerName + "': " + bboxstr); } if (srs != null) { try { bbox = new ReferencedEnvelope(bbox, CRS.decode(srs)); } catch (Exception e) { throw new RuntimeException( "Can't decode SRS for layer '" + layerName + "': " + srs); } } try { verifyAccessLayer(layerName, bbox); } catch (ServiceException | SecurityException e) { return null; } } ConveyorTile tileReq = prepareRequest(tileLayer, request, requestMistmatchTarget); if (null == tileReq) { return null; } ConveyorTile tileResp = null; try { tileResp = tileLayer.getTile(tileReq); } catch (Exception e) { log.log(Level.INFO, "Error dispatching tile request to GeoServer", e); } return tileResp; }