docs: protected void syncScriptingVars(JavaCodeWriter tagWriter, int scope) {
          TagVariableInfo[] tagVarInfos = ti.getTagVariableInfos();
          VariableInfo[] varInfos = ti.getVariableInfo(collectedTagData.getTagData());
  
          if (varInfos == null)
              varInfos = new VariableInfo[0];
              
          if ((varInfos.length == 0) && (tagVarInfos.length == 0)) {
              return;
          }
  
          if (varInfos.length > 0) {
              for (int i = 0; i < varInfos.length; i++) {
                  if (varInfos[i].getScope() == scope) {
                      tagWriter.print(varInfos[i].getVarName());
                      tagWriter.print(" = ((");
                      String className=varInfos[i].getClassName();
                      className = replaceCharacters(className); //PK40417 &gt;,&lt;,&amp;,<\\%, and %\\>
                      tagWriter.print(className);
                      tagWriter.print(") "+pageContextVar+".findAttribute(");    //PK65013
                      tagWriter.print(GeneratorUtils.quote(varInfos[i].getVarName()));
  					tagWriter.print("))");
  					// PK26741
  					if(jspOptions.isUseRepeatInt() && isRepeatTag)
  						tagWriter.println(".intValue();");
  					else
                      	tagWriter.println(";");		// PK26741
                  }
              }
          }
          else {
              for (int i = 0; i < tagVarInfos.length; i++) {
                  if (tagVarInfos[i].getScope() == scope) {
                      String name = tagVarInfos[i].getNameGiven();
                      if (name == null) {
                          name = collectedTagData.getTagData().getAttributeString(tagVarInfos[i].getNameFromAttribute());
                      }
                      else if (tagVarInfos[i].getNameFromAttribute() != null) {
                          // alias
                          continue;
                      }
                      tagWriter.print(name);
  					tagWriter.print(" = ((");
                      String className=tagVarInfos[i].getClassName();
                      className = replaceCharacters(className); //PK40417 &gt;,&lt;,&amp;,<\\%, and %\\>
                      tagWriter.print(className);
                      tagWriter.print(") "+pageContextVar+".findAttribute("); //PK65013
                      tagWriter.print(GeneratorUtils.quote(name));
  					tagWriter.print("))");
  					// PK26741
  					if(jspOptions.isUseRepeatInt() && isRepeatTag)
  						tagWriter.println(".intValue();");
  					else
                      	tagWriter.println(";");		// PK26741
                  }
              }
          }
      }