/*******************************************************************************
 * Copyright (c) 2015-2016 Oak Ridge National Laboratory.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package org.csstudio.display.builder.runtime.pv.vtype_pv;

import org.csstudio.display.builder.runtime.pv.RuntimePV;
import org.csstudio.display.builder.runtime.pv.RuntimePVFactory;
import org.csstudio.vtype.pv.PV;
import org.csstudio.vtype.pv.PVPool;

/** {@link RuntimePVFactory} for {@link PV}
 *
 *  @author Kay Kasemir
 */
public class VTypePVFactory implements RuntimePVFactory
{
    @Override
    public RuntimePV getPV(final String name) throws Exception
    {
        return new VTypePV(PVPool.getPV(name));
    }

    @Override
    public void releasePV(final RuntimePV pv)
    {
        PVPool.releasePV(((VTypePV)pv).getPV());
    }
}

@@ -846,16 +846,466 @@
 ctory%0A%7B%0A
+    /** @param name PV Name that might contain legacy information%0A     *  @return Patched PV name%0A     */%0A    private String patch(String name)%0A    %7B%0A        // Remove PVManager's longString modifier.%0A        // Not using regular expression because text%0A        // had to be exactly like this at end of PV name.%0A        if (name.endsWith(%22 %7B%5C%22longString%5C%22:true%7D%22))%0A            name = name.substring(0,  name.length()-20);%0A        return name;%0A    %7D%0A%0A
     @Ove
@@ -1302,32 +1302,32 @@
 %0A%0A    @Override%0A
-
     public Runti
@@ -1423,14 +1423,21 @@
 tPV(
+patch(
 name))
+)
 ;%0A  

Patch 'longString' modifier for legacy PVM names