private void check(ServiceType type, TraceMetadataProvider provider) {
            Pair<ServiceType> pair = new Pair<>(type, provider);
            Pair<ServiceType> prev = serviceTypeNameMap.put(type.getName(), pair);
    
            if (prev != null) {
                // TODO change exception type
                throw new RuntimeException("ServiceType name of " + serviceTypePairToString(pair) + " is duplicated with " + serviceTypePairToString(prev));
            }
    
            prev = serviceTypeCodeMap.put(type.getCode(), pair);
    
            if (prev != null) {
                // TODO change exception type
                throw new RuntimeException("ServiceType code of " + serviceTypePairToString(pair) + " is duplicated with " + serviceTypePairToString(prev));
            }

            if(type.isAlias()){
                if(!type.isRpcClient()){
                    throw new RuntimeException("ServiceType code of " + serviceTypePairToString(pair) + " should be between range of RPC");
                }
                if(type.isRecordStatistics()){
                    throw new RuntimeException("ServiceType code of " + serviceTypePairToString(pair) + " can't have ALIAS and RECORD_STATISTICS at the same time");
                }
            }
        }
@author Jongho Moon
@author HyunGil Jeong
commons-profiler/src/main/java/com/navercorp/pinpoint/common/profiler/trace/TraceMetadataLoader.java