auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Map<String, PartitionAssignor.Subscription> toOldGroupSubscription(GroupSubscription newSubscriptions) { Map<String, PartitionAssignor.Subscription> oldSubscriptions = new HashMap<>(); for (Map.Entry<String, Subscription> entry : newSubscriptions.groupSubscription().entrySet()) { String member = entry.getKey(); Subscription newSubscription = entry.getValue(); oldSubscriptions.put(member, new PartitionAssignor.Subscription( newSubscription.topics(), newSubscription.userData())); } return oldSubscriptions; }

Target:
private static Map<String, PartitionAssignor.Subscription> toOldGroupSubscription(GroupSubscription newSubscriptions) { Map<String, PartitionAssignor.Subscription> oldSubscriptions = new HashMap<>(); for (Map.Entry<String, Subscription> entry : newSubscriptions.groupSubscription().entrySet()) { String member = entry.getKey(); Subscription newSubscription = entry.getValue(); oldSubscriptions.put(member, new PartitionAssignor.Subscription( newSubscription.topics(), newSubscription.userData())); } return oldSubscriptions; }
Source:
protected void trashDocument(CoreSession session, DocumentModel doc) { if (doc.getParentRef() == null) { session.removeDocument(doc.getRef()); } else { if (!Boolean.parseBoolean(String.valueOf(doc.getContextData(DISABLE_TRASH_RENAMING)))) { String name = mangleName(doc); session.move(doc.getRef(), doc.getParentRef(), name); } session.followTransition(doc, LifeCycleConstants.DELETE_TRANSITION); } }

Target:
protected void trashDocument(CoreSession session, DocumentModel doc) { if (doc.getParentRef() == null) { session.removeDocument(doc.getRef()); } else { if (!Boolean.TRUE.equals(doc.getContextData(DISABLE_TRASH_RENAMING))) { String name = mangleName(doc); session.move(doc.getRef(), doc.getParentRef(), name); } session.followTransition(doc, LifeCycleConstants.DELETE_TRANSITION); } }
Source:
public static Field constructField(java.lang.reflect.Field field) { if (field == null) { return null; } return new Field() { @Override public void setAccessible(boolean flag) { field.setAccessible(flag); } @Override public boolean isSynthetic() { return field.isSynthetic(); } @Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationClass) { return field.isAnnotationPresent(annotationClass); } @Override public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { return field.getAnnotation(annotationClass); } @Override public <T extends Annotation> T[] getAnnotationsByType(Class<T> annotationClass) { return field.getAnnotationsByType(annotationClass); } @Override public Annotation[] getDeclaredAnnotations() { return field.getDeclaredAnnotations(); } @Override public Annotation[] getAnnotations() { return field.getAnnotations(); } @Override public int getModifiers() { return field.getModifiers(); } @Override public String getName() { return field.getName(); } @Override public Object get(Object obj) throws IllegalArgumentException, IllegalAccessException { return field.get(obj); } @Override public Type<?> getType() { return new ClassType(field.getType()); } @Override public Type<?> getParameterizedType(Type<?> parentType, Optional<Integer> index) { if (parentType instanceof DynamicType) { return getType(); } java.lang.reflect.Type type = field.getGenericType(); if (type instanceof ParameterizedType && index.isPresent()) { return new ClassType( TypeUtils.getRawType( ((ParameterizedType) type).getActualTypeArguments()[index.get().intValue()], ((ClassType) parentType).getCls() ) ); } return new ClassType(TypeUtils.getRawType(type, ((ClassType) parentType).getCls())); } @Override public void set(Object obj, Object value) throws IllegalArgumentException, IllegalAccessException { field.set(obj, value); } @Override public java.lang.reflect.Field getField() { return field; } }; }

Target:
public static Field constructField(java.lang.reflect.Field field) { if (field == null) { return null; } return new FieldType(field); }
Source:
public void execute() throws MojoExecutionException, MojoFailureException { this.runtimeLocation = new BuildOutputDirectory(this.project.getBuild().getDirectory()).getChild("director"); getDirectorRuntime(); FeatureInstaller installer = constructFeatureInstaller(); installer.install(); }

Target:
public void execute() throws MojoExecutionException, MojoFailureException { this.runtimeLocation = new BuildOutputDirectory(this.project.getBuild().getDirectory()).getChild("director"); setDirectorRuntime(); FeatureInstaller installer = constructFeatureInstaller(); installer.install(); }
Source:
private static void addUrlMappings(Context context, JSONObject obj) { Object test = context.getServletContext().getAttribute("org.jaggeryjs.serveFunction"); JSONArray arr = null; if (test != null) { arr = new JSONArray(); JSONObject js1 = new JSONObject(); JSONObject js2 = new JSONObject(); js1.put("url", "/*"); js1.put("path", File.pathSeparator + INDEX_JAG); arr.add(js1); } else { arr = (JSONArray) obj.get(JaggeryCoreConstants.JaggeryConfigParams.URL_MAPPINGS); } if (arr != null) { Map<String, Object> urlMappings = new HashMap<String, Object>(); for (Object mapObj : arr) { JSONObject mapping = (JSONObject) mapObj; String url = (String) mapping.get(JaggeryCoreConstants.JaggeryConfigParams.URL_MAPPINGS_URL); String path = (String) mapping.get(JaggeryCoreConstants.JaggeryConfigParams.URL_MAPPINGS_PATH); if (url != null && path != null) { path = path.startsWith("/") ? path : "/" + path; FilterMap filterMap = new FilterMap(); filterMap.setFilterName(JaggeryCoreConstants.JAGGERY_FILTER_NAME); filterMap.addURLPattern(url); context.addFilterMap(filterMap); if (url.equals("/")) { urlMappings.put("/", path); continue; } url = url.startsWith("/") ? url.substring(1) : url; List<String> parts = new ArrayList<String>(Arrays.asList(url.split("/", -1))); addMappings(urlMappings, parts, path); } else { log.error("Invalid url mapping in jaggery.conf url : " + url + ", path : " + path); } } context.getServletContext().setAttribute(CommonManager.JAGGERY_URLS_MAP, urlMappings); } }

Target:
private static void addUrlMappings(Context context, JSONObject obj) { Object test = context.getServletContext().getAttribute("org.jaggeryjs.serveFunction"); JSONArray arr = null; if (test != null) { arr = new JSONArray(); JSONObject urlJSONObj = new JSONObject(); JSONObject pathJSONObj = new JSONObject(); urlJSONObj.put("url", "/*"); pathJSONObj.put("path", File.separator + INDEX_JAG); arr.add(urlJSONObj); } else { arr = (JSONArray) obj.get(JaggeryCoreConstants.JaggeryConfigParams.URL_MAPPINGS); } if (arr != null) { Map<String, Object> urlMappings = new HashMap<String, Object>(); for (Object mapObj : arr) { JSONObject mapping = (JSONObject) mapObj; String url = (String) mapping.get(JaggeryCoreConstants.JaggeryConfigParams.URL_MAPPINGS_URL); String path = (String) mapping.get(JaggeryCoreConstants.JaggeryConfigParams.URL_MAPPINGS_PATH); if (url != null && path != null) { path = path.startsWith("/") ? path : "/" + path; FilterMap filterMap = new FilterMap(); filterMap.setFilterName(JaggeryCoreConstants.JAGGERY_FILTER_NAME); filterMap.addURLPattern(url); context.addFilterMap(filterMap); if (url.equals("/")) { urlMappings.put("/", path); continue; } url = url.startsWith("/") ? url.substring(1) : url; List<String> parts = new ArrayList<String>(Arrays.asList(url.split("/", -1))); addMappings(urlMappings, parts, path); } else { log.error("Invalid url mapping in jaggery.conf url : " + url + ", path : " + path); } } context.getServletContext().setAttribute(CommonManager.JAGGERY_URLS_MAP, urlMappings); } }
Source:
private Set<String> computeRoles(U user, T tenant, boolean isSystemTenant) { Set<String> roles = Sets.newTreeSet(); roles.add(UserInfo.PERMISSION_LOGGED_IN); roles.addAll(user.getUserAccountData().getPermissions().getPermissions().data()); roles.addAll(tenant.getTenantData().getPackageData().computeCombinedPermissions()); if (Strings.isFilled(tenant.getTenantData().getAccountNumber())) { roles.add("tenant-" + tenant.getTenantData().getAccountNumber()); } for (AdditionalRolesProvider rolesProvider : additionalRolesProviders) { rolesProvider.addAdditionalRoles(user, roles::add); } if (tenant.getMapper().select(tenant.getClass()).eq(Tenant.PARENT, tenant.getIdAsString()).exists()) { roles.add(PERMISSION_HAS_CHILDREN); } Set<String> transformedRoles = transformRoles(roles); roles.add(PERMISSION_SYSTEM_TENANT_MEMBER); if (isSystemTenant) { if (transformedRoles.contains(PERMISSION_MANAGE_SYSTEM)) { roles.add(PERMISSION_SYSTEM_TENANT); } transformedRoles = transformRoles(roles); } transformedRoles.removeAll(tenant.getTenantData().getPackageData().getRevokedPermissions().data()); return transformedRoles; }

Target:
private Set<String> computeRoles(U user, T tenant, boolean isSystemTenant) { Set<String> roles = Sets.newTreeSet(); roles.add(UserInfo.PERMISSION_LOGGED_IN); roles.addAll(user.getUserAccountData().getPermissions().getPermissions().data()); roles.addAll(tenant.getTenantData().getPackageData().computeCombinedPermissions()); if (Strings.isFilled(tenant.getTenantData().getAccountNumber())) { roles.add("tenant-" + tenant.getTenantData().getAccountNumber()); } for (AdditionalRolesProvider rolesProvider : additionalRolesProviders) { rolesProvider.addAdditionalRoles(user, roles::add); } if (tenant.getMapper().select(tenant.getClass()).eq(Tenant.PARENT, tenant.getIdAsString()).exists()) { roles.add(PERMISSION_HAS_CHILDREN); } Set<String> transformedRoles = transformRoles(roles); if (isSystemTenant) { roles.add(PERMISSION_SYSTEM_TENANT_MEMBER); if (transformedRoles.contains(PERMISSION_MANAGE_SYSTEM)) { roles.add(PERMISSION_SYSTEM_TENANT); } transformedRoles = transformRoles(roles); } transformedRoles.removeAll(tenant.getTenantData().getPackageData().getRevokedPermissions().data()); return transformedRoles; }
Source:
private Gson buildGsonWithAdaptersSerialize() { return new GsonBuilder() .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") .registerTypeAdapter(Observation.class, new Observation.ObservationSerializer()) .registerTypeAdapter(Visit.class, new Visit.VisitSerializer()) .create(); }

Target:
private Gson buildGsonWithAdaptersSerialize() { return new GsonBuilder() .setDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ") .registerTypeAdapter(VisitType.class, new VisitType.VisitTypeSerializer()) .registerTypeAdapter(Patient.class, new Patient.PatientSerializer()) .registerTypeAdapter(Location.class, new Location.LocationSerializer()) .create(); }
Source:
public int getRowCountEstimateIncrease() { if (rowCountEstimateIncrease < 1) { return pageSize * 4; } else { return rowCountEstimateIncrease; } }

Target:
public int getRowCountEstimateIncrease() { if (rowCountEstimateIncrease == -1) { return pageSize * DEFAULT_PAGE_INCREASE_COUNT; } else { assert rowCountEstimate > 0 : "0 is not an increase"; return rowCountEstimateIncrease; } }
Source:
public void setFromBundle(Bundle data) { setName(data.getString("name")); setUsername(data.getString("username")); setUser_id(Integer.parseInt(data.getString("user_id"))); setPartner_id(Integer.parseInt(data.getString("partner_id"))); setTimezone(data.getString("timezone")); setIsactive(Boolean.parseBoolean(data.getString("isactive"))); try { setAvatar(data.getString("avatar")); } catch (Exception e) { setAvatar("false"); } setDatabase(data.getString("database")); setHost(data.getString("host")); setAndroidName(data.getString("android_name")); setPassword(data.getString("password")); setCompany_id(data.getString("company_id")); setAllowSelfSignedSSL(Boolean.parseBoolean(data .getString("allow_self_signed_ssl"))); setVersion_number(Integer.parseInt(data .getString("odoo_version_number"))); setVersion_serie(data.getString("odoo_version_serie")); setInstanceDatabase(data.getString("instance_database")); setInstanceUrl(data.getString("instance_url")); setOAuthLogin(Boolean.parseBoolean(data.getString("oauth_login"))); setClientId(data.getString("client_id")); }

Target:
public void setFromBundle(Bundle data) { setName(data.getString("name")); setUsername(data.getString("username")); setUser_id(Integer.parseInt(data.getString("user_id"))); setPartner_id(Integer.parseInt(data.getString("partner_id"))); setTimezone(data.getString("timezone")); setIsactive(Boolean.parseBoolean(data.getString("isactive"))); setAvatar(data.getString("avatar")); setDatabase(data.getString("database")); setHost(data.getString("host")); setAndroidName(data.getString("android_name")); setPassword(data.getString("password")); setCompany_id(data.getString("company_id")); setAllowSelfSignedSSL(Boolean.parseBoolean(data .getString("allow_self_signed_ssl"))); setVersion_number(Integer.parseInt(data .getString("odoo_version_number"))); setVersion_serie(data.getString("odoo_version_serie")); setInstanceDatabase(data.getString("instance_database")); setInstanceUrl(data.getString("instance_url")); setOAuthLogin(Boolean.parseBoolean(data.getString("oauth_login"))); setClientId(data.getString("client_id")); }
Source:
public ResultModel toResultModel(String warningMessage) { if (StringUtils.isEmpty(keyClass)) { keyClass = "java.lang.String"; } if (StringUtils.isEmpty(valueClass)) { valueClass = "java.lang.String"; } ResultModel result = new ResultModel(); if (warningMessage != null && !warningMessage.isEmpty()) { InfoResultModel info = result.addInfo(HEADER_INFO_SECTION); info.addLine(warningMessage); } DataResultModel data = result.addData(DATA_INFO_SECTION); if (errorString != null) { data.addData("Message", errorString); data.addData(RESULT_FLAG, operationCompletedSuccessfully); return result; } data.addData(RESULT_FLAG, operationCompletedSuccessfully); if (infoString != null) { data.addData("Message", infoString); } if (isGet()) { toResultModel_isGet(data); } else if (isLocateEntry()) { toResultModel_isLocate(result, data); } else if (isPut()) { toResultModel_isPut(data); } else if (isRemove()) { toResultModel_isRemove(data); } return result; }

Target:
public ResultModel toResultModel(String warningMessage) { if (StringUtils.isEmpty(keyClass)) { keyClass = "java.lang.String"; } if (StringUtils.isEmpty(valueClass)) { valueClass = "java.lang.String"; } ResultModel result = new ResultModel(); if (warningMessage != null && !warningMessage.isEmpty()) { InfoResultModel info = result.addInfo(WARNING_INFO_SECTION); info.addLine(warningMessage); } DataResultModel data = result.addData(DATA_INFO_SECTION); if (errorString != null) { data.addData("Message", errorString); data.addData(RESULT_FLAG, operationCompletedSuccessfully); return result; } data.addData(RESULT_FLAG, operationCompletedSuccessfully); if (infoString != null) { data.addData("Message", infoString); } if (isGet()) { toResultModel_isGet(data); } else if (isLocateEntry()) { toResultModel_isLocate(result, data); } else if (isPut()) { toResultModel_isPut(data); } else if (isRemove()) { toResultModel_isRemove(data); } return result; }
Source:
public static Bridge fromBridgeConfig(BridgeConfig bridge) { if (bridge == null) return null; org.slf4j.LoggerFactory.getLogger(Converter.class).error("HELLO {}", bridge.vxLanPortIds, bridge.vxLanPortId); return new Bridge() .setName(bridge.name) .setAdminStateUp(bridge.adminStateUp) .setTunnelKey(bridge.tunnelKey) .setInboundFilter(bridge.inboundFilter) .setOutboundFilter(bridge.outboundFilter) .setVxLanPortId(bridge.vxLanPortId) .setVxLanPortIds(bridge.vxLanPortIds) .setProperties(bridge.properties); }

Target:
public static Bridge fromBridgeConfig(BridgeConfig bridge) { if (bridge == null) return null; return new Bridge() .setName(bridge.name) .setAdminStateUp(bridge.adminStateUp) .setTunnelKey(bridge.tunnelKey) .setInboundFilter(bridge.inboundFilter) .setOutboundFilter(bridge.outboundFilter) .setVxLanPortId(bridge.vxLanPortId) .setVxLanPortIds(bridge.vxLanPortIds) .setProperties(bridge.properties); }
Source:
private static SwapLeg parseLeg( CsvRow row, String leg, FloatingRateIndex index, DayCount defaultFixedLegDayCount) { PayReceive payReceive = LoaderUtils.parsePayReceive(getValue(row, leg, DIRECTION_FIELD)); PeriodicSchedule accrualSch = parseAccrualSchedule(row, leg); PaymentSchedule paymentSch = parsePaymentSchedule(row, leg, accrualSch.getFrequency()); NotionalSchedule notionalSch = parseNotionalSchedule(row, leg); Optional<String> knownAmount = findValue(row, leg, KNOWN_AMOUNT_FIELD); if (knownAmount.isPresent()) { return KnownAmountSwapLeg.builder() .payReceive(payReceive) .accrualSchedule(accrualSch) .paymentSchedule(paymentSch) .currency(notionalSch.getCurrency()) .amount(ValueSchedule.of(LoaderUtils.parseDouble(knownAmount.get()))) .build(); } return parseRateCalculationLeg( row, leg, index, defaultFixedLegDayCount, payReceive, accrualSch, paymentSch, notionalSch); }

Target:
private static SwapLeg parseLeg( CsvRow row, String leg, FloatingRateIndex index, DayCount defaultFixedLegDayCount) { PayReceive payReceive = LoaderUtils.parsePayReceive(getValue(row, leg, DIRECTION_FIELD)); PeriodicSchedule accrualSch = parseAccrualSchedule(row, leg); PaymentSchedule paymentSch = parsePaymentSchedule(row, leg, accrualSch.getFrequency()); Currency currency = Currency.of(getValueWithFallback(row, leg, CURRENCY_FIELD)); Optional<String> knownAmount = findValue(row, leg, KNOWN_AMOUNT_FIELD); if (knownAmount.isPresent()) { return KnownAmountSwapLeg.builder() .payReceive(payReceive) .accrualSchedule(accrualSch) .paymentSchedule(paymentSch) .currency(currency) .amount(ValueSchedule.of(LoaderUtils.parseDouble(knownAmount.get()))) .build(); } return parseRateCalculationLeg( row, leg, index, defaultFixedLegDayCount, payReceive, accrualSch, paymentSch); }
Source:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid() throws Exception { Bond bond = createBond(); bond.setSlaves(Arrays.asList("slaveA", "slaveB")); ValidationResult cannotBeSlaveValidationResult = new ValidationResult(EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE, ReplacementUtils.createSetVariableString(HostInterfaceValidator.VAR_NIC_NAME, bond.getName())); HostSetupNetworksValidator validator = new HostSetupNetworksValidatorBuilder() .setParams(new ParametersBuilder().addBonds(CreateOrUpdateBond.fromBond(bond))) .build(); doTestValidateModifiedBondSlaves( spy(validator), ValidationResult.VALID, cannotBeSlaveValidationResult, failsWith(cannotBeSlaveValidationResult)); }

Target:
public void testValidateModifiedBondSlavesWhenSlaveIsNotValid() throws Exception { CreateOrUpdateBond createOrUpdateBond = createNewCreateOrUpdateBond(Guid.newGuid(), "bond1", "slaveA", "slaveB"); ValidationResult cannotBeSlaveValidationResult = new ValidationResult(EngineMessage.NETWORK_INTERFACE_BOND_OR_VLAN_CANNOT_BE_SLAVE, ReplacementUtils.createSetVariableString(HostInterfaceValidator.VAR_NIC_NAME, createOrUpdateBond.getName())); HostSetupNetworksValidator validator = new HostSetupNetworksValidatorBuilder() .setParams(new ParametersBuilder().addBonds(createOrUpdateBond)) .build(); doTestValidateModifiedBondSlaves( spy(validator), ValidationResult.VALID, cannotBeSlaveValidationResult, failsWith(cannotBeSlaveValidationResult)); }
Source:
public void injectionAccountAndContainerForGetHeadDeleteBlobIdV1Test() throws Exception { populateAccountService(); String blobId = new BlobIdV1(BlobId.DEFAULT_FLAG, ClusterMapUtils.UNKNOWN_DATACENTER_ID, refAccount.getId(), refContainer.getId(), clusterMap.getWritablePartitionIds().get(0)).getID(); verifyAccountAndContainerFromBlobId(blobId, Account.UNKNOWN_ACCOUNT, Container.UNKNOWN_CONTAINER, RestServiceErrorCode.NotFound); ByteBuffer content = ByteBuffer.allocate(0); verifyResponsePathAccountAndContainerInjection(refAccount.getName() + "extra", false, Account.UNKNOWN_ACCOUNT, Container.DEFAULT_PUBLIC_CONTAINER); verifyResponsePathAccountAndContainerInjection(refAccount.getName() + "extra", true, Account.UNKNOWN_ACCOUNT, Container.DEFAULT_PRIVATE_CONTAINER); verifyResponsePathAccountAndContainerInjection(refAccount.getName(), false, refAccount, refDefaultPublicContainer); verifyResponsePathAccountAndContainerInjection(refAccount.getName(), true, refAccount, refDefaultPrivateContainer); }

Target:
public void injectionAccountAndContainerForGetHeadDeleteBlobIdV1Test() throws Exception { populateAccountService(); String blobId = new BlobIdV1(BlobId.DEFAULT_FLAG, ClusterMapUtils.UNKNOWN_DATACENTER_ID, refAccount.getId(), refContainer.getId(), clusterMap.getWritablePartitionIds().get(0)).getID(); verifyAccountAndContainerFromBlobId(blobId, Account.UNKNOWN_ACCOUNT, Container.UNKNOWN_CONTAINER, RestServiceErrorCode.NotFound); verifyResponsePathAccountAndContainerInjection(refAccount.getName() + "extra", false, Account.UNKNOWN_ACCOUNT, Container.DEFAULT_PUBLIC_CONTAINER); verifyResponsePathAccountAndContainerInjection(refAccount.getName() + "extra", true, Account.UNKNOWN_ACCOUNT, Container.DEFAULT_PRIVATE_CONTAINER); verifyResponsePathAccountAndContainerInjection(refAccount.getName(), false, refAccount, refDefaultPublicContainer); verifyResponsePathAccountAndContainerInjection(refAccount.getName(), true, refAccount, refDefaultPrivateContainer); }
Source:
@Test public void testPlanTransformWithRuleNameConflicts() throws Exception { RelOptRule rule1 = new RelOptRule( operand(LogicalProject.class, operand(LogicalFilter.class, RelOptRule.any())), "MYRULE" ) { @Override public boolean matches(RelOptRuleCall call) { return false; } @Override public void onMatch(RelOptRuleCall call) { } }; RelOptRule rule2 = new RelOptRule( operand(LogicalFilter.class, operand(LogicalProject.class, RelOptRule.any())), "MYRULE" ) { @Override public boolean matches(RelOptRuleCall call) { return false; } @Override public void onMatch(RelOptRuleCall call) { } }; RuleSet ruleSet1 = RuleSets.ofList( rule1, EnumerableRules.ENUMERABLE_FILTER_RULE, EnumerableRules.ENUMERABLE_PROJECT_RULE); RuleSet ruleSet2 = RuleSets.ofList( rule2); Planner planner = getPlanner(null, Programs.of(ruleSet1), Programs.of(ruleSet2)); SqlNode parse = planner.parse("select * from \"emps\""); SqlNode validate = planner.validate(parse); RelNode convert = planner.convert(validate); RelTraitSet traitSet = planner.getEmptyTraitSet() .replace(EnumerableConvention.INSTANCE); RelNode transform = planner.transform(0, traitSet, convert); RelNode transform2 = planner.transform(1, traitSet, transform); assertThat(toString(transform2), equalTo( "EnumerableProject(empid=[$0], deptno=[$1], name=[$2], salary=[$3], commission=[$4])\n" + " EnumerableTableScan(table=[[hr, emps]])\n")); }

Target:
@Test public void testPlanTransformWithRuleNameConflicts() throws Exception { RelOptRule rule1 = new RelOptRule( operand(LogicalProject.class, operand(LogicalFilter.class, RelOptRule.any())), "MYRULE") { @Override public boolean matches(RelOptRuleCall call) { return false; } public void onMatch(RelOptRuleCall call) { } }; RelOptRule rule2 = new RelOptRule( operand(LogicalFilter.class, operand(LogicalProject.class, RelOptRule.any())), "MYRULE") { @Override public boolean matches(RelOptRuleCall call) { return false; } public void onMatch(RelOptRuleCall call) { } }; RuleSet ruleSet1 = RuleSets.ofList( rule1, EnumerableRules.ENUMERABLE_FILTER_RULE, EnumerableRules.ENUMERABLE_PROJECT_RULE); RuleSet ruleSet2 = RuleSets.ofList( rule2); Planner planner = getPlanner(null, Programs.of(ruleSet1), Programs.of(ruleSet2)); SqlNode parse = planner.parse("select * from \"emps\""); SqlNode validate = planner.validate(parse); RelNode convert = planner.convert(validate); RelTraitSet traitSet = planner.getEmptyTraitSet() .replace(EnumerableConvention.INSTANCE); RelNode transform = planner.transform(0, traitSet, convert); RelNode transform2 = planner.transform(1, traitSet, transform); assertThat(toString(transform2), equalTo( "EnumerableProject(empid=[$0], deptno=[$1], name=[$2], salary=[$3], commission=[$4])\n" + " EnumerableTableScan(table=[[hr, emps]])\n")); }
Source:
private void parseHashtags(RevCommit commit) throws ConfigInvalidException { if (hashtags != null) { return; } List<String> hashtagsLines = commit.getFooterLines(FOOTER_HASHTAGS); if (hashtagsLines.isEmpty()) { return; } else if (hashtagsLines.size() > 1) { throw expectedOneFooter(FOOTER_HASHTAGS, hashtagsLines); } hashtags = new HashSet<String>(Arrays.asList(hashtagsLines.get(0).split(","))); }

Target:
private void parseHashtags(RevCommit commit) throws ConfigInvalidException { if (hashtags != null) { return; } List<String> hashtagsLines = commit.getFooterLines(FOOTER_HASHTAGS); if (hashtagsLines.isEmpty()) { return; } else if (hashtagsLines.size() > 1) { throw expectedOneFooter(FOOTER_HASHTAGS, hashtagsLines); } hashtags = Sets.newHashSet(Splitter.on(',').split(hashtagsLines.get(0))); }
Source:
public void processLeftData(final MistDataEvent input) { final Object prevState = applyStatefulFunction.getCurrentState(); applyStatefulFunction.update((IN)input.getValue()); final OUT output = applyStatefulFunction.produceResult(); LOG.log(Level.FINE, "{0} updates the state {1} to {2} with input {3}, and generates {4}", new Object[]{getOperatorIdentifier(), prevState, applyStatefulFunction.getCurrentState(), input, output}); input.setValue(output); outputEmitter.emitData(input); }

Target:
public void processLeftData(final MistDataEvent input) { applyStatefulFunction.update((IN)input.getValue()); final OUT output = applyStatefulFunction.produceResult(); LOG.log(Level.FINE, "{0} updates the state to {1} with input {2}, and generates {3}", new Object[]{getOperatorIdentifier(), applyStatefulFunction.getCurrentState(), input, output}); input.setValue(output); outputEmitter.emitData(input); }
Source:
public void setPorts(Service service) { List<PortSpec> ports = getServicePorts(service); Map<String, Object> launchConfigData = DataAccessor.fields(service) .withKey(ServiceDiscoveryConstants.FIELD_LAUNCH_CONFIG).withDefault(Collections.EMPTY_MAP) .as(Map.class); Account env = objectManager.loadResource(Account.class, service.getAccountId()); List<String> newPorts = new ArrayList<>(); for (PortSpec port : ports) { if (port.getPublicPort() == null) { PooledResource resource = poolManager.allocateOneResource(env, service, new PooledResourceOptions().withQualifier( ResourcePoolConstants.ENVIRONMENT_PORT)); if (resource != null) { port.setPublicPort(new Integer(resource.getName())); } newPorts.add(port.toSpec()); } } if (!newPorts.isEmpty()) { launchConfigData.put(InstanceConstants.FIELD_PORTS, newPorts); DataAccessor.fields(service).withKey(ServiceDiscoveryConstants.FIELD_LAUNCH_CONFIG).set(launchConfigData); objectManager.persist(service); } }

Target:
public void setPorts(Service service) { List<PortSpec> ports = getServicePorts(service); Map<String, Object> launchConfigData = DataAccessor.fields(service) .withKey(ServiceDiscoveryConstants.FIELD_LAUNCH_CONFIG).withDefault(Collections.EMPTY_MAP) .as(Map.class); Account env = objectManager.loadResource(Account.class, service.getAccountId()); List<String> newPorts = new ArrayList<>(); List<PortSpec> toAllocate = new ArrayList<>(); for (PortSpec port : ports) { if (port.getPublicPort() == null) { toAllocate.add(port); } } List<PooledResource> resource = poolManager.allocateResource(env, service, new PooledResourceOptions().withCount(toAllocate.size()).withQualifier( ResourcePoolConstants.ENVIRONMENT_PORT)); int i = 0; for (PortSpec port : toAllocate) { if (resource.size() <= i) { break; } port.setPublicPort(new Integer(resource.get(i).getName())); newPorts.add(port.toSpec()); i++; } if (!newPorts.isEmpty()) { launchConfigData.put(InstanceConstants.FIELD_PORTS, newPorts); DataAccessor.fields(service).withKey(ServiceDiscoveryConstants.FIELD_LAUNCH_CONFIG).set(launchConfigData); objectManager.persist(service); } }
Source:
public void addDefaultPublications() { if (!hasPublications()) { if (publishPublicationsSpecified) { log.warn("None of the specified publications matched for project '{}' - nothing to publish.", getProject().getPath()); return; } PublishingExtension publishingExtension = (PublishingExtension) getProject().getExtensions().findByName("publishing"); if (publishingExtension == null) { log.warn("None of the specified publications matched for project '{}' - nothing to publish.", getProject().getPath()); return; } Publication mavenJavaPublication = publishingExtension.getPublications().findByName(MAVEN_JAVA); if (mavenJavaPublication != null) { log.info("No publications specified for project '{}' - adding '{}' configuration.", getProject().getPath(), MAVEN_JAVA); addPublication(mavenJavaPublication); } Publication ivyJavaPublication = publishingExtension.getPublications().findByName(IVY_JAVA); if (ivyJavaPublication != null) { log.info("No publications specified for project '{}' - adding '{}' configuration.", getProject().getPath(), IVY_JAVA); addPublication(ivyJavaPublication); } checkDependsOnArtifactsToPublish(); } }

Target:
public void addDefaultPublications() { if (!hasPublications()) { if (publishPublicationsSpecified) { log.warn("None of the specified publications matched for project '{}' - nothing to publish.", getProject().getPath()); return; } PublishingExtension publishingExtension = (PublishingExtension) getProject().getExtensions().findByName("publishing"); if (publishingExtension == null) { log.warn("None of the specified publications matched for project '{}' - nothing to publish.", getProject().getPath()); return; } Publication mavenJavaPublication = publishingExtension.getPublications().findByName(MAVEN_JAVA); if (mavenJavaPublication != null) { log.info("No publications specified for project '{}' - adding '{}' publication.", getProject().getPath(), MAVEN_JAVA); addPublication(mavenJavaPublication); } Publication ivyJavaPublication = publishingExtension.getPublications().findByName(IVY_JAVA); if (ivyJavaPublication != null) { log.info("No publications specified for project '{}' - adding '{}' publication.", getProject().getPath(), IVY_JAVA); addPublication(ivyJavaPublication); } checkDependsOnArtifactsToPublish(); } }
Source:
public Iterable<Map.Entry<UK, UV>> entries() { Map<UK, UV> userMap = stateTable.get(currentNamespace); return userMap == null ? Collections.emptyList() : userMap.entrySet(); }

Target:
public Iterable<Map.Entry<UK, UV>> entries() { Map<UK, UV> userMap = stateTable.get(currentNamespace); return userMap == null ? Collections.emptySet() : userMap.entrySet(); }
Source:
public static Slice stCentroid(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Centroid", geometry, EnumSet.of(POINT, MULTI_POINT, LINE_STRING, MULTI_LINE_STRING, POLYGON, MULTI_POLYGON)); GeometryType geometryType = GeometryType.getForEsriGeometryType(geometry.geometryType()); if (geometryType == GeometryType.POINT) { return input; } int pointCount = ((MultiVertexGeometry) geometry.getEsriGeometry()).getPointCount(); if (pointCount == 0) { return serialize(createFromEsriGeometry(new Point(), geometry.getEsriSpatialReference())); } try { return serialize(geometry.centroid()); } catch (RuntimeException e) { if (e instanceof PrestoException && ((PrestoException) e).getErrorCode() == INVALID_FUNCTION_ARGUMENT.toErrorCode()) { throw e; } throw new PrestoException(INVALID_FUNCTION_ARGUMENT, format("Cannot compute centroid: %s Use ST_IsValid to confirm that input geometry is valid or compute centroid for a bounding box using ST_Envelope.", e.getMessage()), e); } }

Target:
public static Slice stCentroid(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Centroid", geometry, EnumSet.of(POINT, MULTI_POINT, LINE_STRING, MULTI_LINE_STRING, POLYGON, MULTI_POLYGON)); GeometryType geometryType = GeometryType.getForEsriGeometryType(geometry.geometryType()); if (geometryType == GeometryType.POINT) { return input; } int pointCount = ((MultiVertexGeometry) geometry.getEsriGeometry()).getPointCount(); if (pointCount == 0) { return serialize(createFromEsriGeometry(new Point(), geometry.getEsriSpatialReference())); } return serialize(geometry.centroid()); }
Source:
public void closeTree(long requestedEndTime) { synchronized (latestBranch) { this.treeEnd = requestedEndTime; for (int i = 0; i < latestBranch.size(); i++) { latestBranch.get(i).closeThisNode(treeEnd); treeIO.writeNode(latestBranch.get(i)); } try (FileChannel fc = treeIO.getFcOut();) { ByteBuffer buffer = ByteBuffer.allocate(TREE_HEADER_SIZE); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.clear(); fc.position(0); buffer.putInt(HISTORY_FILE_MAGIC_NUMBER); buffer.putInt(FILE_VERSION); buffer.putInt(config.getProviderVersion()); buffer.putInt(config.getBlockSize()); buffer.putInt(config.getMaxChildren()); buffer.putInt(nodeCount); buffer.putInt(latestBranch.get(0).getSequenceNumber()); buffer.putLong(latestBranch.get(0).getNodeStart()); buffer.flip(); int res = fc.write(buffer); assert (res <= TREE_HEADER_SIZE); } catch (IOException e) { throw new RuntimeException(); } } }

Target:
public void closeTree(long requestedEndTime) { synchronized (latestBranch) { this.treeEnd = requestedEndTime; for (int i = 0; i < latestBranch.size(); i++) { latestBranch.get(i).closeThisNode(treeEnd); treeIO.writeNode(latestBranch.get(i)); } try (FileChannel fc = treeIO.getFcOut();) { ByteBuffer buffer = ByteBuffer.allocate(TREE_HEADER_SIZE); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.clear(); fc.position(0); buffer.putInt(HISTORY_FILE_MAGIC_NUMBER); buffer.putInt(FILE_VERSION); buffer.putInt(config.getProviderVersion()); buffer.putInt(config.getBlockSize()); buffer.putInt(config.getMaxChildren()); buffer.putInt(nodeCount); buffer.putInt(latestBranch.get(0).getSequenceNumber()); buffer.putLong(latestBranch.get(0).getNodeStart()); buffer.flip(); int res = fc.write(buffer); assert (res <= TREE_HEADER_SIZE); } catch (IOException e) { throw new RuntimeException("State system write error"); } } }
Source:
public static Parameter dataProfilePeriodOfRecord() { return new ParameterBuilder() .name("dataProfile") .description("Data Profile (column set) of the download. For use with the monitoring location summary endpoint.") .modelRef(new ModelRef("string")) .parameterType("query") .required(false) .allowableValues(new AllowableListValues(Arrays.asList( Profile.PERIOD_OF_RECORD.toString()), "LIST")) .build(); }

Target:
public static Parameter dataProfilePeriodOfRecord() { return new ParameterBuilder() .name("dataProfile") .description("Data Profile (column set) of the download. For use with the monitoring location summary endpoint.") .modelRef(new ModelRef("string")) .parameterType("query") .required(false) .allowableValues(new AllowableListValues(Arrays.asList( Profile.SUMMARY_STATION.toString(), Profile.PERIOD_OF_RECORD.toString()), "LIST")) .build(); }
Source:
protected void executeCommand() { VDS vds = getVds(); VDSGroup cluster = getVdsGroup(); Version partialVdcVersion = new Version( new Version(Config.<String> GetValue(ConfigValues.VdcVersion)).toString(2)); RpmVersion vdsVersion = vds.getVersion(); Version vdsmVersion = new Version(vdsVersion.getMajor(),vdsVersion.getMinor()); if (!Config.<HashSet<Version>> GetValue(ConfigValues.SupportedVDSMVersions).contains(vdsmVersion)) { ReportNonOperationReason(NonOperationalReason.VERSION_INCOMPATIBLE_WITH_CLUSTER, Config.<HashSet<Version>> GetValue(ConfigValues.SupportedVDSMVersions).toString(), vdsmVersion.toString()); } else if (!VersionSupport.checkClusterVersionSupported(cluster.getcompatibility_version(), vds)) { ReportNonOperationReason(NonOperationalReason.CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER, cluster.getcompatibility_version().toString(), vds.getSupportedClusterLevels().toString()); } setSucceeded(true); }

Target:
protected void executeCommand() { VDS vds = getVds(); VDSGroup cluster = getVdsGroup(); Version partialVdcVersion = new Version( new Version(Config.<String> GetValue(ConfigValues.VdcVersion)).toString(2)); RpmVersion vdsVersion = vds.getVersion(); Version vdsmVersion = new Version(vdsVersion.getMajor(),vdsVersion.getMinor()); if (!Config.<HashSet<Version>> GetValue(ConfigValues.SupportedVDSMVersions).contains(vdsmVersion)) { reportNonOperationReason(NonOperationalReason.VERSION_INCOMPATIBLE_WITH_CLUSTER, Config.<HashSet<Version>> GetValue(ConfigValues.SupportedVDSMVersions).toString(), vdsmVersion.toString()); } else if (!VersionSupport.checkClusterVersionSupported(cluster.getcompatibility_version(), vds)) { reportNonOperationReason(NonOperationalReason.CLUSTER_VERSION_INCOMPATIBLE_WITH_CLUSTER, cluster.getcompatibility_version().toString(), vds.getSupportedClusterLevels().toString()); } setSucceeded(true); }
Source:
public static VmPayload map(org.ovirt.engine.api.model.VmPayload entity, VmPayload template) { VmPayload model = template != null ? template : new VmPayload(); model.setType(VmDeviceType.valueOf(entity.getType().toUpperCase())); if (entity.getFile() != null) { model.setFileName(entity.getFile().getName()); model.setContent(entity.getFile().getContent()); } return model; }

Target:
public static VmPayload map(org.ovirt.engine.api.model.VmPayload entity, VmPayload template) { VmPayload model = template != null ? template : new VmPayload(); model.setType(VmDeviceType.valueOf(entity.getType().toUpperCase())); if (entity.isSetFile()) { model.setFileName(entity.getFile().getName()); model.setContent(entity.getFile().getContent()); } return model; }
Source:
public void determineContentAccessCertState(Owner owner) throws GeneralSecurityException, IOException { if (!owner.isContentAccessModeDirty()) { return; } if (StringUtils.isEmpty(owner.getContentAccessMode())) { contentAccessCertCurator.deleteForOwner(owner); } owner.setContentAccessModeDirty(false); ownerCurator.merge(owner); }

Target:
public void determineContentAccessCertState(Owner owner) { if (!owner.isContentAccessModeDirty()) { return; } if (owner.contentAccessMode() .equals(ContentAccessCertServiceAdapter.DEFAULT_CONTENT_ACCESS_MODE)) { contentAccessCertCurator.deleteForOwner(owner); } owner.setContentAccessModeDirty(false); ownerCurator.merge(owner); }
Source:
public void updateAddresses(final RxDocumentServiceRequest request, final URI serverKey) { Objects.requireNonNull(request, "expected non-null request"); Objects.requireNonNull(serverKey, "expected non-null serverKey"); URI serviceEndpoint = this.endpointManager.resolveServiceEndpoint(request); this.addressCacheByEndpoint.computeIfPresent(serviceEndpoint, (ignored, endpointCache) -> { final GatewayAddressCache addressCache = endpointCache.addressCache; addressCache.updateAddresses(serverKey); return endpointCache; }); }

Target:
public void updateAddresses(final RxDocumentServiceRequest request, final URI serverKey) { Objects.requireNonNull(request, "expected non-null request"); Objects.requireNonNull(serverKey, "expected non-null serverKey"); if (this.tcpConnectionEndpointRediscoveryEnabled) { URI serviceEndpoint = this.endpointManager.resolveServiceEndpoint(request); this.addressCacheByEndpoint.computeIfPresent(serviceEndpoint, (ignored, endpointCache) -> { final GatewayAddressCache addressCache = endpointCache.addressCache; addressCache.updateAddresses(serverKey); return endpointCache; }); } else { logger.warn("tcpConnectionEndpointRediscovery is not enabled, should not reach here."); } }
Source:
public void RemovePotentialMember(S solution) { Iterator<Pair<S, Double>> it = this.potentialMembers.iterator(); while (it.hasNext()) { if (it.next().getLeft() == solution) { it.remove(); break; } } }

Target:
public void RemovePotentialMember(S solution) { Iterator<Pair<S, Double>> it = this.potentialMembers.iterator(); while (it.hasNext()) { if (it.next().getLeft().equals(solution)) { it.remove(); break; } } }
Source:
static void validateTextField(Schema inputSchema, String key) { if (inputSchema.getField(key) == null) { throw new IllegalArgumentException(String.format("Input field %s does not exist in the input schema %s.", key, inputSchema.toString())); } Schema schema = inputSchema.getField(key).getSchema(); Schema.Type type = schema.isNullable() ? schema.getNonNullable().getType() : schema.getType(); if (type.equals(Schema.Type.ARRAY)) { Schema componentSchema = schema.getComponentSchema(); type = componentSchema.isNullable() ? componentSchema.getNonNullable().getType() : componentSchema.getType(); } if (!(type.equals(Schema.Type.STRING) || type.equals(Schema.Type.ARRAY))) { throw new IllegalArgumentException(String.format("Field to be transformed should be of type String or " + "Nullable String or Array of type String or Nullable " + "String . But was %s for field %s.", type, key)); } }

Target:
static void validateTextField(Schema inputSchema, String key) { if (inputSchema.getField(key) == null) { throw new IllegalArgumentException(String.format("Input field %s does not exist in the input schema %s.", key, inputSchema.toString())); } Schema schema = inputSchema.getField(key).getSchema(); Schema.Type type = schema.isNullable() ? schema.getNonNullable().getType() : schema.getType(); if (type == Schema.Type.ARRAY) { Schema componentSchema = schema.getComponentSchema(); type = componentSchema.isNullable() ? componentSchema.getNonNullable().getType() : componentSchema.getType(); } if (type != Schema.Type.STRING) { throw new IllegalArgumentException(String.format("Field to be transformed should be of type String or " + "Nullable String or Array of type String or Nullable " + "String . But was %s for field %s.", type, key)); } }
Source:
public VertxPluginRegistry(Vertx vertx, VertxEngineConfig vxEngineConfig, Map<String, String> config) { super(config); this.vertx=vertx; String sslProxyHost = System.getProperty("https.proxyHost", "none"); Integer sslProxyPort = Integer.valueOf(System.getProperty("https.proxyPort", "443")); if(!"none".equalsIgnoreCase(sslProxyHost)){ sslProxy = new ProxyOptions(); sslProxy.setHost(sslProxyHost); sslProxy.setPort(sslProxyPort); sslProxy.setType(ProxyType.HTTP); } String proxyHost = System.getProperty("http.proxyHost", "none"); Integer proxyPort = Integer.valueOf(System.getProperty("http.proxyPort", "80")); if(!"none".equalsIgnoreCase(proxyHost)){ proxy = new ProxyOptions(); proxy.setHost(proxyHost); proxy.setPort(proxyPort); proxy.setType(ProxyType.HTTP); } }

Target:
public VertxPluginRegistry(Vertx vertx, VertxEngineConfig vxEngineConfig, Map<String, String> config) { super(config); this.vertx = vertx; String sslProxyHost = System.getProperty("https.proxyHost", "none"); Integer sslProxyPort = Integer.valueOf(System.getProperty("https.proxyPort", "443")); sslNoProxy = System.getProperty("https.nonProxyHosts", "none"); if (!"none".equalsIgnoreCase(sslProxyHost)) { sslProxy = new ProxyOptions(); sslProxy.setHost(sslProxyHost); sslProxy.setPort(sslProxyPort); sslProxy.setType(ProxyType.HTTP); } String proxyHost = System.getProperty("http.proxyHost", "none"); Integer proxyPort = Integer.valueOf(System.getProperty("http.proxyPort", "80")); noProxy = System.getProperty("http.nonProxyHosts", "none"); if (!"none".equalsIgnoreCase(proxyHost)) { proxy = new ProxyOptions(); proxy.setHost(proxyHost); proxy.setPort(proxyPort); proxy.setType(ProxyType.HTTP); } }
Source:
PrefixTreeNode addChild(Character c) { if (!hasChild(c)) { children.put(c, new PrefixTreeNode()); } return children.get(c); }

Target:
protected PrefixTreeNode addChild(Character c) { if (!hasChild(c)) { children.put(c, new PrefixTreeNode()); } return children.get(c); }
Source:
public void overrideConfigs(@Nonnull TableConfig tableConfig) { if (tableConfig.getIsDimTable() != null && tableConfig.getIsDimTable().equals("true")) { _tableDataManagerConfig.addProperty(TABLE_DATA_MANAGER_NAME, DIMENSION.name()); } }

Target:
public void overrideConfigs(@Nonnull TableConfig tableConfig) { _tableDataManagerConfig.addProperty(TABLE_IS_DIMENSION, tableConfig.isDimTable()); }
Source:
public Date getOrder() { GregorianCalendar gc = new GregorianCalendar(2018, 12, 10, 0, 0, 0); return gc.getTime(); }

Target:
public Date getOrder() { GregorianCalendar gc = new GregorianCalendar(2018, 11, 10, 0, 0, 0); return gc.getTime(); }
Source:
protected String kind() { for (AbstractConfigNode n : children) { if (n instanceof ConfigNodeSingleToken) { Token t = ((ConfigNodeSingleToken) n).token(); if (Tokens.isUnquotedText(t) && !t.tokenText().equals("include") && t.tokenText().matches(".*\\w.*")) { return t.tokenText(); } } } return null; }

Target:
protected ConfigIncludeKind kind() { return kind; }
Source:
public void presentAsFile(final File file, final List<CertifiedProductSearchDetails> cpList) { try (FileWriter writer = new FileWriter(file); CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.EXCEL);) { csvPrinter.printRecord(generateHeaderValues()); for (CertifiedProductSearchDetails cp : cpList) { if (cp.getSurveillance() != null && cp.getSurveillance().size() > 0) { for (Surveillance currSurveillance : cp.getSurveillance()) { List<List<String>> rowValues = generateMultiRowValue(cp, currSurveillance); for (List<String> rowValue : rowValues) { csvPrinter.printRecord(rowValue); } } } } } catch (final IOException ex) { LOGGER.error("Could not write file " + file.getName(), ex); } }

Target:
public void presentAsFile(final File file, final List<CertifiedProductSearchDetails> cpList) { try (FileWriter writer = new FileWriter(file); CSVPrinter csvPrinter = new CSVPrinter(writer, CSVFormat.EXCEL)) { csvPrinter.printRecord(generateHeaderValues()); for (CertifiedProductSearchDetails cp : cpList) { if (cp.getSurveillance() != null && cp.getSurveillance().size() > 0) { for (Surveillance currSurveillance : cp.getSurveillance()) { List<List<String>> rowValues = generateMultiRowValue(cp, currSurveillance); for (List<String> rowValue : rowValues) { csvPrinter.printRecord(rowValue); } } } } } catch (final IOException ex) { LOGGER.error("Could not write file " + file.getName(), ex); } }
Source:
public void heartbeat() { if (!mContext.getClientContext().getClusterConf().clusterDefaultsLoaded()) { return; } ConfigHash hash; try { hash = mClient.getConfigHash(); } catch (IOException e) { LOG.error("Failed to heartbeat to meta master to get configuration hash:", e); mClient.disconnect(); return; } boolean isClusterConfUpdated = !hash.getClusterConfigHash().equals( mContext.getClientContext().getClusterConfHash()); boolean isPathConfUpdated = !hash.getPathConfigHash().equals( mContext.getClientContext().getPathConfHash()); if (isClusterConfUpdated || isPathConfUpdated) { try { mContext.reinit(isClusterConfUpdated, isPathConfUpdated); mException = null; } catch (UnavailableException e) { LOG.error("Failed to reinitialize FileSystemContext:", e); } catch (IOException e) { LOG.error("Failed to close FileSystemContext, interrupting the heartbeat thread", e); mException = e; Thread.currentThread().interrupt(); } } }

Target:
public synchronized void heartbeat() { if (!mContext.getClientContext().getClusterConf().clusterDefaultsLoaded()) { return; } ConfigHash hash; try { hash = mClient.getConfigHash(); } catch (IOException e) { LOG.error("Failed to heartbeat to meta master to get configuration hash:", e); mClient.disconnect(); return; } boolean isClusterConfUpdated = !hash.getClusterConfigHash().equals( mContext.getClientContext().getClusterConfHash()); boolean isPathConfUpdated = !hash.getPathConfigHash().equals( mContext.getClientContext().getPathConfHash()); if (isClusterConfUpdated || isPathConfUpdated) { try { mContext.reinit(isClusterConfUpdated, isPathConfUpdated); mException = null; } catch (UnavailableException e) { LOG.error("Failed to reinitialize FileSystemContext:", e); } catch (IOException e) { LOG.error("Failed to close FileSystemContext, interrupting the heartbeat thread", e); mException = e; Thread.currentThread().interrupt(); } } }
Source:
public double[] getTargetVariances() { final double[] values = file.readDoubleArray(TARGET_VARIANCES_PATH); if (values.length != panelTargets.get().size()) { throw new GATKException(String.format("wrong number of elements in the target variances recovered " + "from file '%s': %d != %d", file.getFile(), values.length, panelTargets.get().size())); } return values; }

Target:
public double[] getTargetVariances() { final double[] values = file.readDoubleArray(TARGET_VARIANCES_PATH); if (values.length != panelTargets.get().size()) { throw new GATKException(String.format("Wrong number of elements in the target variances recovered " + "from file '%s': number of target variances found in file (%d) != number of panel-target names (%d)", file.getFile(), values.length, panelTargets.get().size())); } return values; }
Source:
public DSAPrivateKeyVersion build() throws BuilderException { try { return new DSAPrivateKeyVersion(this); } catch (Exception e) { throw new BuilderException("Building DSAKeyVersion failed", e); } }

Target:
public DSAPrivateKeyVersion build() throws BuilderException { return new DSAPrivateKeyVersion(this); }