先检查unit是否为transferable，如果是，直接返回true，否则再检查application是否为transferable。
注意：请先使用{{@link #defined(String, String)}}检查合法性，然后再使用本方法取属性
335843
public static boolean isTransferable(String group, String unit) {
        try {
            return UnitRouter.SINGLETON.newestDefinition(Unit.fullName(group, unit)).getMeta().isTransferable();
        } catch (UnitUndefinedException e) {
            throw new RuntimeException("Please call UnitJudge.defined() first.", e);
        }
    }
331966
@Override
    public void setMethod(byte[] method) throws UnsupportedMethodException {
        MethodValues val = MethodValues.match(method, 0, method.length);
        if (null == val) {
            throw new UnsupportedMethodException("Illegal method " + GenericUtils.getEnglishString(method));
        }
        setMethod(val);
    }
708347
private static Expression doEqualsString(SoyExpression stringExpr, SoyExpression other) {
    // This is compatible with SharedRuntime.compareString, which interestingly makes == break
    // transitivity.  See b/21461181
    SoyRuntimeType otherRuntimeType = other.soyRuntimeType();
    if (otherRuntimeType.isKnownStringOrSanitizedContent()) {
      if (stringExpr.isNonNullable()) {
        return stringExpr.invoke(MethodRef.EQUALS, other.unboxAsString());
      } else {
        return MethodRef.OBJECTS_EQUALS.invoke(stringExpr, other.unboxAsString());
      }
    }
    if (otherRuntimeType.isKnownNumber() && other.isNonNullable()) {
      // in this case, we actually try to convert stringExpr to a number
      return MethodRef.RUNTIME_STRING_EQUALS_AS_NUMBER.invoke(stringExpr, other.coerceToDouble());
    }
    // We don't know what other is, assume the worst and call out to our boxed implementation for
    // string comparisons.
    return MethodRef.RUNTIME_COMPARE_NULLABLE_STRING.invoke(stringExpr, other.box());
  }
1341632
public void declearVar(Class<?> type,String varName,StringBuilder writesb,StringBuilder readsb,Type ...actTypes)
	{
		String varType=getVarTypeName(type, actTypes);
		//变量声明
		if(type.isPrimitive())
		{
			if(type.equals(boolean.class))
			{
				writesb.append("\t").append(varType+" "+varName+"=false;").append("\n");
			}else
			{
				writesb.append("\t").append(varType+" "+varName+"=0;").append("\n");
				readsb.append("\t").append(varType+" "+varName+"=0;").append("\n");
			}
		}else
		{
			writesb.append("\t").append(varType+" "+varName+"=null;").append("\n");
			readsb.append("\t").append(varType+" "+varName+"=null;").append("\n");
		}
	}
1181459
function ToDate(amount, unit, method) {
  this.amount = amount;
  this.method = method;
  this.unit = unit;
}
995320
@Override
    public boolean containedBy(IValue str) {
        if (str.getClass() != ValueString.class)
            return false;
        return (((ValueString) str).value.indexOf(value) != -1);
    }
1013031
private static void createIf(MethodVisitor mv, Method method, Label next, Label start,
                                 String className, Class<?> parentClass) {
        // 标记分支开始位置
        mv.visitLabel(start);
        mv.visitFrame(F_SAME, 0, null, 0, null);
        // 比较方法声明类
        stringEquals(mv, () -> mv.visitVarInsn(ALOAD, 1), convert(method.getDeclaringClass()), next,
            () -> {
                // 比较方法名
                stringEquals(mv, () -> mv.visitVarInsn(ALOAD, 2), method.getName(), next, () -> {
                    // 方法名一致再比较方法说明
                    stringEquals(mv, () -> mv.visitVarInsn(ALOAD, 3),
                        ByteCodeUtils.getMethodDesc(method), next, () -> {
                            // 方法说明也一致后执行方法
                            invokeMethod(mv, method, () -> {
                                // 调用代理对象对应的方法而不是本代理的方法
                                mv.visitVarInsn(ALOAD, 0);
                                mv.visitFieldInsn(GETFIELD, convert(className), TARGET_FIELD_NAME,
                                    getByteCodeType(parentClass));
                                // 获取参数数量，用于载入参数
                                int count = method.getParameterCount();
                                Class<?>[] types = method.getParameterTypes();

                                // 循环载入参数
                                for (int i = 0; i < count; i++) {
                                    mv.visitVarInsn(Opcodes.ALOAD, 4);
                                    // 这里注意，访问数组下标0-5和6-无穷是不一样的
                                    // 访问0-5对应的byte code：  aload | iconst_[0-5] | aaload
                                    // 访问下标大于5的byte code: aload | bipush [6-无穷] aaload
                                    if (i <= 5) {
                                        mv.visitInsn(ICONST_0 + i);
                                    } else {
                                        mv.visitIntInsn(BIPUSH, i);
                                    }
                                    mv.visitInsn(Opcodes.AALOAD);
                                    mv.visitTypeInsn(CHECKCAST, convert(types[i]));
                                }
                            });
                        });
                });
            });
    }
1050851
private static String convertGetMethodParamValue(String value, String charsetOfServlet) {
		if (isGetMethod()) {
			if (null == charsetOfServlet) {
				charsetOfServlet = CharsetUtil.ISO_8859_1;
			}

			String destCharset = CharsetUtil.UTF_8;
			if (isIE()) {
				// IE浏览器GET请求使用GBK编码
				destCharset = CharsetUtil.GBK;
			}

			value = CharsetUtil.convert(value, charsetOfServlet, destCharset);
		}
		return value;
	}
542696
@Deprecated
    @Override
    protected int write(int unit) {
        int newLength=charsLength+1;
        ensureCapacity(newLength);
        charsLength=newLength;
        chars[chars.length-charsLength]=(char)unit;
        return charsLength;
    }
810720
public boolean definesSerializableFields() {
        if (!isSerializable() || isExternalizable()) {
            return false;
        } else {
            if (serializedForm == null) {
                serializedForm = new SerializedForm(env, tsym, this);
            }
            //### Clone this?
            return serializedForm.definesSerializableFields();
        }
    }
1000523
private String getAnnotations(String id, long component)
  {
    String result = "";
    String incoming = "", outgoing = "";
    int nri = 1, nro = 1;

    if(referentOfToken.get(id) != null)
    {
      for (long l : referentOfToken.get(id).keySet())
      {
        if (referentList.get((int) l) != null && referentList.get((int) l).component == component
          && referentList.get((int) l).annotations != null && referentList.get((int) l).annotations.size() > 0)
        {
          int num = referentOfToken.get(id).get(l);
          if (num == 0 || num == 2)
          {
            for (SerializableAnnotation an : referentList.get((int) l).annotations)
            {
              if (nri == 1)
              {
                incoming = ", &lt;b&gt;incoming Annotations&lt;/b&gt;: " + an.getName() + "=" + an.getValue();
                nri--;
              }
              else
              {
                incoming += ", " + an.getName() + "=" + an.getValue();
              }
            }
          }
          if (num == 1 || num == 2)
          {
            for (SerializableAnnotation an : referentList.get((int) (long) l).annotations)
            {
              if (nro == 1)
              {
                outgoing = ", &lt;b&gt;outgoing Annotations&lt;/b&gt;: " + an.getName() + "=" + an.getValue();
                nro--; // remove l+"- "+
              }
              else
              {
                outgoing += ", " + an.getName() + "=" + an.getValue();
              }
            }
          }
        }
      }
    }
    if (nro < 1)
    {
      result += outgoing;
    }
    if (nri < 1)
    {
      result += incoming;
    }
    return result;
  }
528369
public static boolean isPrintableString(String str) {
    for (int i = 0; i < str.length(); i++) {
      if (!isPrintableChar(str.charAt(i))) {
        return false;
      }
    }
    return true;
  }
922407
static boolean isSetterMethod(final Method method) {
        return method.getName().startsWith(SETTER_METHOD_PREFIX)
                &&
                Builder.class.isAssignableFrom(method.getReturnType())
                &&
                !method.isVarArgs()
                &&
                method.getParameterTypes().length == 1;
    }
367775
private boolean hasExpandableVarArgs(IMockMethod method, List<Object> args) {
    List<Class<?>> paramTypes = method.getParameterTypes();
    return !paramTypes.isEmpty()
        && CollectionUtil.getLastElement(paramTypes).isArray()
        && CollectionUtil.getLastElement(args) != null;
  }
545340
String expandIri(String value, boolean relative, boolean vocab, Map<String, Object> context,
            Map<String, Boolean> defined) throws JsonLdError {
        // 1)
        if (value == null || JsonLdUtils.isKeyword(value)) {
            return value;
        }
        // 2)
        if (context != null && context.containsKey(value)
                && !Boolean.TRUE.equals(defined.get(value))) {
            this.createTermDefinition(context, value, defined);
        }
        // 3)
        if (vocab && this.termDefinitions.containsKey(value)) {
            final Map<String, Object> td = (Map<String, Object>) this.termDefinitions.get(value);
            if (td != null) {
                return (String) td.get(JsonLdConsts.ID);
            } else {
                return null;
            }
        }
        // 4)
        final int colIndex = value.indexOf(":");
        if (colIndex >= 0) {
            // 4.1)
            final String prefix = value.substring(0, colIndex);
            final String suffix = value.substring(colIndex + 1);
            // 4.2)
            if ("_".equals(prefix) || suffix.startsWith("//")) {
                return value;
            }
            // 4.3)
            if (context != null && context.containsKey(prefix)
                    && (!defined.containsKey(prefix) || defined.get(prefix) == false)) {
                this.createTermDefinition(context, prefix, defined);
            }
            // 4.4)
            if (this.termDefinitions.containsKey(prefix)) {
                return (String) ((Map<String, Object>) this.termDefinitions.get(prefix))
                        .get(JsonLdConsts.ID) + suffix;
            }
            // 4.5)
            return value;
        }
        // 5)
        if (vocab && this.containsKey(JsonLdConsts.VOCAB)) {
            return this.get(JsonLdConsts.VOCAB) + value;
        }
        // 6)
        else if (relative) {
            return JsonLdUrl.resolve((String) this.get(JsonLdConsts.BASE), value);
        } else if (context != null && JsonLdUtils.isRelativeIri(value)) {
            throw new JsonLdError(Error.INVALID_IRI_MAPPING, "not an absolute IRI: " + value);
        }
        // 7)
        return value;
    }
332788
@Override
	public Writable serialize(Object arg0, ObjectInspector arg1) throws SerDeException {
		if (!(arg1 instanceof StructObjectInspector)) {
			throw new SerDeException("Expect a row of Strings for serialization");
		}
		final StructObjectInspector outputOI = (StructObjectInspector) arg1;
		final List<? extends StructField> outputFields = outputOI.getAllStructFieldRefs();
		if (outputFields.size()!=ExcelSpreadSheetCellDAOSerde.columnNames.length) {
			throw new SerDeException("Expected "+ExcelSpreadSheetCellDAOSerde.columnNames.length+" fields characterizing a cell: \"formattedValue\",\"comment\",\"formula\",\"address\",\"sheetName\", but found "+outputFields.size()+" fields");
		}
		if (arg0==null) {
			return null;
		}
		// get field data
		// formattedValue
		int columnNum=0;
		final Object foFormattedValue = outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
		final ObjectInspector oiFormattedValue = outputFields.get(columnNum).getFieldObjectInspector();
		String formattedValue = String.valueOf(((PrimitiveObjectInspector) oiFormattedValue).getPrimitiveJavaObject(foFormattedValue));
		// comment
		columnNum=1;
		final Object foComment= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
		final ObjectInspector oiComment = outputFields.get(columnNum).getFieldObjectInspector();
		String comment = String.valueOf(((PrimitiveObjectInspector) oiComment).getPrimitiveJavaObject(foComment));
		// formula
		columnNum=2;
		final Object foFormula= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
		final ObjectInspector oiFormula = outputFields.get(columnNum).getFieldObjectInspector();
		String formula = String.valueOf(((PrimitiveObjectInspector) oiFormula).getPrimitiveJavaObject(foFormula));
		// address
		columnNum=3;
		final Object foAddress= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
		final ObjectInspector oiAddress = outputFields.get(columnNum).getFieldObjectInspector();
		String address = String.valueOf(((PrimitiveObjectInspector) oiAddress).getPrimitiveJavaObject(foAddress));
		// sheetName
		columnNum=4;
		final Object foSheetName= outputOI.getStructFieldData(arg0, outputFields.get(columnNum));
		final ObjectInspector oiSheetName = outputFields.get(columnNum).getFieldObjectInspector();
		String sheetName = String.valueOf(((PrimitiveObjectInspector) oiSheetName).getPrimitiveJavaObject(foSheetName));
		return new SpreadSheetCellDAO(formattedValue,comment,formula,address,sheetName);
	}
1063543
public static boolean defined(String group) {
        return LocalUnitsManager.getGroupByName(group) != null ||
                (GroupDiscovery.singleton != null && GroupDiscovery.singleton.newestDefinition(group) != null);
    }