auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public FeatureDefinitionData[] getFeatureDefinitionData() { FeatureDefinitionData[] featureDefitionArray = null; List<ArtifactReadable> featureDefinitionArts = orcsApi.getQueryFactory().fromBranch(branch).andIsOfType( CoreArtifactTypes.FeatureDefinition).getResults().getList(); for (ArtifactReadable art : featureDefinitionArts) { String json = art.getSoleAttributeAsString(CoreAttributeTypes.GeneralStringData); ObjectMapper mapper = new ObjectMapper(); try { featureDefitionArray = mapper.readValue(json, FeatureDefinitionData[].class); } catch (Exception ex1) { System.out.println(ex1); } } return featureDefitionArray; }

Target:
public FeatureDefinitionData[] getFeatureDefinitionData() { FeatureDefinitionData[] featureDefitionArray = null; List<ArtifactReadable> featureDefinitionArts = orcsApi.getQueryFactory().fromBranch(branch).andIsOfType( CoreArtifactTypes.FeatureDefinition).getResults().getList(); for (ArtifactReadable art : featureDefinitionArts) { String json = art.getSoleAttributeAsString(CoreAttributeTypes.GeneralStringData); ObjectMapper mapper = new ObjectMapper(); try { featureDefitionArray = mapper.readValue(json, FeatureDefinitionData[].class); } catch (Exception e) { throw new OseeCoreException(e, String.format("Invalid JSON in general string data attribute on artifactId [%s]", art.getId())); } } return featureDefitionArray; }
Source:
public ZonedDateTime getZonedDateTime() { return ZonedDateTime.of(zonedDateTime.toLocalDateTime(), zonedDateTime.getZone()); }

Target:
public ZonedDateTime getZonedDateTime() { return zonedDateTime; }
Source:
public void readEurekaConfig() { String xml = HAZELCAST_START_TAG + " <network>\n" + " <join>\n" + " <multicast enabled=\"false\"/>\n" + " <tcp-ip enabled=\"false\"/>\n" + " <eureka enabled=\"true\">\n" + " <use-public-ip>true</use-public-ip>\n" + " <namespace>hazelcast</namespace>\n" + " <shouldUseDns>false</shouldUseDns>\n" + " <serviceUrl.default>http://localhost:8082/eureka</serviceUrl.default>\n" + " </eureka>\n" + " </join>\n" + " </network>" + HAZELCAST_END_TAG; Config config = buildConfig(xml); EurekaConfig eurekaConfig = config.getNetworkConfig().getJoin().getEurekaConfig(); assertTrue(eurekaConfig.isEnabled()); assertTrue(eurekaConfig.isUsePublicIp()); assertEquals("hazelcast", eurekaConfig.getProperty("namespace")); assertEquals("false", eurekaConfig.getProperty("shouldUseDns")); }

Target:
public void readEurekaConfig() { String xml = HAZELCAST_START_TAG + " <network>\n" + " <join>\n" + " <multicast enabled=\"false\"/>\n" + " <tcp-ip enabled=\"false\"/>\n" + " <eureka enabled=\"true\">\n" + " <use-public-ip>true</use-public-ip>\n" + " <namespace>hazelcast</namespace>\n" + " <shouldUseDns>false</shouldUseDns>\n" + " <serviceUrl.default>http://localhost:8082/eureka</serviceUrl.default>\n" + " </eureka>\n" + " </join>\n" + " </network>" + HAZELCAST_END_TAG; Config config = buildConfig(xml); EurekaConfig eurekaConfig = config.getNetworkConfig().getJoin().getEurekaConfig(); assertTrue(eurekaConfig.isEnabled()); assertTrue(eurekaConfig.isUsePublicIp()); assertEquals("hazelcast", eurekaConfig.getProperty("namespace")); assertEquals("false", eurekaConfig.getProperty("shouldUseDns")); assertEquals("http://localhost:8082/eureka", eurekaConfig.getProperty("serviceUrl.default")); }
Source:
public void whenReadEventsForBlockedConsumerThen403() throws Exception { readEvents() .then() .statusCode(HttpStatus.OK.value()); SettingsControllerAT.blacklist(EVENT_TYPE_NAME, BlacklistService.Type.CONSUMER_ET); Thread.sleep(100); readEvents() .then() .statusCode(403) .body("detail", Matchers.equalTo("Application or event type is blocked")); SettingsControllerAT.whitelist(EVENT_TYPE_NAME, BlacklistService.Type.CONSUMER_ET); readEvents() .then() .statusCode(HttpStatus.OK.value()); }

Target:
public void whenReadEventsForBlockedConsumerThen403() throws Exception { readEvents() .then() .statusCode(HttpStatus.OK.value()); SettingsControllerAT.blacklist(EVENT_TYPE_NAME, BlacklistService.Type.CONSUMER_ET); TestUtils.waitFor(() -> readEvents() .then() .statusCode(403) .body("detail", Matchers.equalTo("Application or event type is blocked")), 1000, 200); SettingsControllerAT.whitelist(EVENT_TYPE_NAME, BlacklistService.Type.CONSUMER_ET); readEvents() .then() .statusCode(HttpStatus.OK.value()); }
Source:
public List<ResourceJournalEntry> findByNameStartsWith(String name) { Query findByName = query(where("name").regex(name)); return mongoTemplate.find(findByName, ResourceJournalEntry.class, collectionName); }

Target:
public List<ResourceJournalEntry> findByNameStartsWith(String name) { Query findByName = query(where("name").regex("^" + name)); return mongoTemplate.find(findByName, ResourceJournalEntry.class, collectionName); }
Source:
public void run() { readMemoryInfoFile(); }

Target:
public void run() { try { readMemoryInfoFile(); } catch (Throwable t) { logger.error("error calling readMemoryInfoFile", t); } }
Source:
public Statement apply(Statement base, Description description) { final Flaky annotation = description.getAnnotation(Flaky.class); if (annotation != null) { if ( ! isReviewDatePassed(annotation)) { return new RetryingStatement(base, description); } } return new Statement() { @Override public void evaluate() throws Throwable { base.evaluate(); } }; }

Target:
public Statement apply(Statement base, Description description) { final Flaky annotation = description.getAnnotation(Flaky.class); if (annotation == null) { return base; } if (annotation.githubIssueUrl().trim().length() == 0) { throw new IllegalArgumentException("A GitHub issue URL must be set for usages of the @Flaky annotation"); } final int maxTries = annotation.maxTries(); if (maxTries < 1) { throw new IllegalArgumentException("@Flaky annotation maxTries must be at least one"); } final LocalDate reviewDate; try { reviewDate = LocalDate.parse(annotation.reviewDate()); } catch (DateTimeParseException e) { throw new IllegalArgumentException("@Flaky reviewDate could not be parsed. Please provide a date in yyyy-mm-dd format"); } if ( LocalDate.now().isBefore(reviewDate) ) { return new RetryingStatement(base, description, maxTries); } else { return base; } }
Source:
public List<OSThread> getThreadDetails() { return null; }

Target:
public List<OSThread> getThreadDetails() { return Collections.emptyList(); }
Source:
public static String generateResponse(String realm, String authnType) throws Exception { GenerateResponse.intializeSAML(); Response response = GenerateResponse.generateResponse(false); String encoded_response = OpenSAMLUtils.compressAndEncodeString(OpenSAMLUtils.SAMLObjectToString(response), false); return String.format("%s realm=\"%s\" saml-authn-request=\"%s\"", authnType, realm, encoded_response); }

Target:
public static String generateResponse(String realm, String authnType) throws Exception { GenerateResponse.initializeSAML(); Response response = GenerateResponse.generateResponse(false); String encoded_response = OpenSAMLUtils.compressAndEncodeString(OpenSAMLUtils.SAMLObjectToString(response), false); return String.format("%s realm=\"%s\" saml-authn-request=\"%s\"", authnType, realm, encoded_response); }
Source:
public static boolean isIdentifier(String str) { boolean isIdentifier = !str.isEmpty() && Character.isJavaIdentifierStart(str.charAt(0)); for (int i = 1; isIdentifier && i < str.length(); i++) { isIdentifier = Character.isJavaIdentifierPart(str.charAt(i)); } return isIdentifier; }

Target:
public static boolean isIdentifier(String str) { boolean isIdentifier = !str.isEmpty(); for (int i = 0; isIdentifier && i < str.length(); i++) { if (i == 0) { isIdentifier = Character.isJavaIdentifierStart(str.charAt(0)); } else { isIdentifier = Character.isJavaIdentifierPart(str.charAt(i)); } } return isIdentifier; }
Source:
public String toString() { String checksString = Optional.ofNullable(checks).stream() .flatMap(Collection::stream) .map(CheckEntry::toString) .collect(Collectors.joining(",")); String pluginStatString = Optional.ofNullable(pluginStat).stream() .flatMap(Collection::stream) .map(PluginStatusEntry::toString) .collect(Collectors.joining(",")); return "CheckResult{" + "status='" + status + "\'," + "host='" + host + "\'," + "checks={" + checksString + "}," + "plugin_stat={" + pluginStatString + "}" + '}'; }

Target:
public String toString() { return "CheckResult{" + "status='" + status + "\'," + "host='" + host + "\'," + "checks={" + StringUtils.join(checks, ",") + "}," + "plugin_stat={" + StringUtils.join(pluginStat, ",") + "}" + '}'; }
Source:
private void prepareReplication() { try { if (m_consumerDRGateway != null) { if (m_config.m_startAction != StartAction.CREATE) { Pair<Byte, List<MeshMemberInfo>> expectedClusterMembers = m_producerDRGateway.getInitialConversations(); m_consumerDRGateway.setInitialConversationMembership(expectedClusterMembers.getFirst(), expectedClusterMembers.getSecond()); } m_consumerDRGateway.initialize(m_config.m_startAction != StartAction.CREATE && m_config.m_startAction != StartAction.JOIN); } if (m_producerDRGateway != null) { m_producerDRGateway.startListening(m_catalogContext.cluster.getDrproducerenabled(), VoltDB.getReplicationPort(m_catalogContext.cluster.getDrproducerport()), VoltDB.getDefaultReplicationInterface()); } } catch (Exception ex) { CoreUtils.printPortsInUse(hostLog); VoltDB.crashLocalVoltDB("Failed to initialize DR", false, ex); } }

Target:
private void prepareReplication() { try { if (m_consumerDRGateway != null) { if (m_config.m_startAction != StartAction.CREATE) { Pair<Byte, List<MeshMemberInfo>> expectedClusterMembers = m_producerDRGateway.getInitialConversations(); m_consumerDRGateway.setInitialConversationMembership(expectedClusterMembers.getFirst(), expectedClusterMembers.getSecond()); } m_consumerDRGateway.initialize(m_config.m_startAction, willDoActualRecover()); } if (m_producerDRGateway != null) { m_producerDRGateway.startListening(m_catalogContext.cluster.getDrproducerenabled(), VoltDB.getReplicationPort(m_catalogContext.cluster.getDrproducerport()), VoltDB.getDefaultReplicationInterface()); } } catch (Exception ex) { CoreUtils.printPortsInUse(hostLog); VoltDB.crashLocalVoltDB("Failed to initialize DR", false, ex); } }
Source:
private void runningSpawnParticle(final net.minecraft.world.World world, final IParticleData particleTypes, final double xCoord, final double yCoord, final double zCoord, final double xOffset, final double yOffset, final double zOffset) { if (!this.vanish$isVanished) { this.world.addParticle(particleTypes, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset); } }

Target:
private void impl$runningSpawnParticle(final net.minecraft.world.World world, final IParticleData particleTypes, final double xCoord, final double yCoord, final double zCoord, final double xOffset, final double yOffset, final double zOffset) { if (!this.vanish$isVanished) { this.world.addParticle(particleTypes, xCoord, yCoord, zCoord, xOffset, yOffset, zOffset); } }
Source:
private List<Long> insertBucket(final Set<SequenceSegment> bucket, final Set<Sequence> visibleSequences) { List<Long> list = new ArrayList<>(4); list.add((long) 0); list.add((long) 0); list.add((long) 0); list.add((long) 0); Map<Mutation, Integer> mutations = new HashMap<>(); mutations.put(Mutation.INSERTION, 1); mutations.put(Mutation.DELETION, 2); mutations.put(Mutation.POLYMORPHISM, 3); for (SequenceSegment segment : bucket) { Set<Sequence> sources = new HashSet<>(segment.getSources()); if (visibleSequences != null) { sources.retainAll(visibleSequences); } long size = segment.getContent().getLength() * sources.size(); if (mutations.containsKey(segment.getMutation())) { int index = mutations.get(segment.getMutation()); list.set(index, list.get(index) + size); } list.set(0, list.get(0) + size); } return list; }

Target:
private List<Long> insertBucket(final Set<SequenceSegment> bucket, final Set<Sequence> visibleSequences) { List<Long> list = new ArrayList<>(NUMBER_OF_VALUES); for (int index = 0; index < NUMBER_OF_VALUES; index++) { list.add((long) 0); } Map<Mutation, Integer> mutations = new HashMap<>(3); mutations.put(Mutation.INSERTION, INSERTION_MAP); mutations.put(Mutation.DELETION, DELETION_MAP); mutations.put(Mutation.POLYMORPHISM, POLYMORPHISM_MAP); for (SequenceSegment segment : bucket) { Set<Sequence> sources = new HashSet<>(segment.getSources()); if (visibleSequences != null) { sources.retainAll(visibleSequences); } long size = segment.getContent().getLength() * sources.size(); if (mutations.containsKey(segment.getMutation())) { int index = mutations.get(segment.getMutation()); list.set(index, list.get(index) + size); } list.set(0, list.get(0) + size); } return list; }
Source:
private HttpMessage sendRequest(HttpMessage msg, String param, String value) throws IOException { msg = msg.cloneRequest(); setParameter(msg, param, value); sendAndReceive(msg); return msg; }

Target:
private HttpMessage sendRequest(HttpMessage msg, String param, String value) throws IOException { msg = getNewMsg(); setParameter(msg, param, value); sendAndReceive(msg); requestsSent++; return msg; }
Source:
boolean maybeResumeSuspendedTask(final TaskId taskId, final Set<TopicPartition> partitions) { if (suspended.containsKey(taskId)) { final StreamTask task = suspended.get(taskId); log.trace("Found suspended {}", taskTypeName, taskId); suspended.remove(taskId); if (task.partitions().equals(partitions)) { task.resume(); try { transitionToRunning(task); } catch (final TaskMigratedException e) { log.info("Failed to resume since it got migrated to another thread already. " + "Will trigger a new rebalance and close all tasks as zombies together.", taskTypeName, task.id()); throw e; } log.trace("Resuming suspended {}", taskTypeName, task.id()); return true; } else { log.warn("Couldn't resume task assigned partitions {}, task partitions {}", taskId, partitions, task.partitions()); task.closeSuspended(true, null); } } return false; }

Target:
boolean maybeResumeSuspendedTask(final TaskId taskId, final Set<TopicPartition> partitions) { if (suspended.containsKey(taskId)) { final StreamTask task = suspended.get(taskId); log.trace("Found suspended stream task {}", taskId); suspended.remove(taskId); if (task.partitions().equals(partitions)) { task.resume(); try { transitionToRunning(task); } catch (final TaskMigratedException e) { log.info("Failed to resume stream task since it got migrated to another thread already. " + "Will trigger a new rebalance and close all tasks as zombies together.", task.id()); throw e; } log.trace("Resuming the suspended stream task {}", task.id()); return true; } else { log.warn("Couldn't resume stream task assigned partitions {}, task partitions {}", taskId, partitions, task.partitions()); task.closeSuspended(true, null); } } return false; }
Source:
private ExpressionTree getPackageName(CompilationUnitTree cut) { return cut.packageDeclaration() != null ? cut.packageDeclaration().packageName() : null; }

Target:
private static ExpressionTree getPackageName(CompilationUnitTree cut) { return cut.packageDeclaration() != null ? cut.packageDeclaration().packageName() : null; }
Source:
private Map <String, String> getQuota(Folder folder) { Map <String, String> map = new HashMap <String, String>(); try { if (folder.exists() && folder.getMessageCount() > 0) { Quota[] quotas = ((IMAPFolder)folder).getQuota(); for (Quota quota : quotas) { for (Quota.Resource resource : quota.resources) { String unit = " Mo"; int coef = 1000; if ((resource.limit/1000)>9999){ unit = " Go"; coef = 1000000; } String spaceUsed = new BigDecimal(String.valueOf(((double)(resource.usage*100)/(double)(resource.limit)))).setScale(2, BigDecimal.ROUND_DOWN).toString().concat("%"); map.put("userQuota", new BigDecimal(String.valueOf(((double)(resource.limit))/coef)).setScale(2, BigDecimal.ROUND_DOWN).toString().concat(unit)); map.put("spaceUsed", spaceUsed); } } } return map; } catch (MessagingException e) { log.error("Failed to connect or get quota for mail user "); map.put("userQuota", null); return map; } }

Target:
private EmailQuota getQuota(Folder folder) { if(!(folder instanceof IMAPFolder)) { return null; } try { if (folder.exists() && folder.getMessageCount() > 0) { Quota[] quotas = ((IMAPFolder)folder).getQuota(); for (Quota quota : quotas) { for (Quota.Resource resource : quota.resources) { if(resource.name.equals("STORAGE")) { return new EmailQuota(resource.limit,resource.usage); } } } } } catch (MessagingException e) { log.error("Failed to connect or get quota for mail user "); } return null; }
Source:
FetchV0Request recvWants(PacketLineIn pckIn) throws PackProtocolException, IOException { FetchV0Request.Builder reqBuilder = new FetchV0Request.Builder(); boolean isFirst = true; boolean filterReceived = false; for (;;) { String line; try { line = pckIn.readString(); } catch (EOFException eof) { if (isFirst) { break; } throw eof; } if (line == PacketLineIn.END) { break; } if (line.startsWith("deepen ")) { int depth = Integer.parseInt(line.substring(7)); if (depth <= 0) { throw new PackProtocolException( MessageFormat.format(JGitText.get().invalidDepth, Integer.valueOf(depth))); } reqBuilder.setDepth(depth); continue; } if (line.startsWith("shallow ")) { reqBuilder.addClientShallowCommit( ObjectId.fromString(line.substring(8))); continue; } if (transferConfig.isAllowFilter() && line.startsWith(OPTION_FILTER + " ")) { String arg = line.substring(OPTION_FILTER.length() + 1); if (filterReceived) { throw new PackProtocolException( JGitText.get().tooManyFilters); } filterReceived = true; reqBuilder.setFilterSpec(ProtocolV2Parser.parseFilterLine(arg)); continue; } if (!line.startsWith("want ") || line.length() < 45) { throw new PackProtocolException(MessageFormat .format(JGitText.get().expectedGot, "want", line)); } if (isFirst) { if (line.length() > 45) { FirstWant firstLine = FirstWant.fromLine(line); reqBuilder.addClientCapabilities(firstLine.getCapabilities()); reqBuilder.setAgent(firstLine.getAgent()); line = firstLine.getLine(); } } reqBuilder.addWantId(ObjectId.fromString(line.substring(5))); isFirst = false; } return reqBuilder.build(); }

Target:
FetchV0Request recvWants(PacketLineIn pckIn) throws PackProtocolException, IOException { FetchV0Request.Builder reqBuilder = new FetchV0Request.Builder(); boolean isFirst = true; boolean filterReceived = false; for (;;) { String line; try { line = pckIn.readString(); } catch (EOFException eof) { if (isFirst) { break; } throw eof; } if (line == PacketLineIn.END) { break; } if (line.startsWith("deepen ")) { int depth = Integer.parseInt(line.substring(7)); if (depth <= 0) { throw new PackProtocolException( MessageFormat.format(JGitText.get().invalidDepth, Integer.valueOf(depth))); } reqBuilder.setDepth(depth); continue; } if (line.startsWith("shallow ")) { reqBuilder.addClientShallowCommit( ObjectId.fromString(line.substring(8))); continue; } if (transferConfig.isAllowFilter() && line.startsWith(OPTION_FILTER + " ")) { String arg = line.substring(OPTION_FILTER.length() + 1); if (filterReceived) { throw new PackProtocolException( JGitText.get().tooManyFilters); } filterReceived = true; reqBuilder.setFilterSpec(FilterSpec.parseFilterLine(arg)); continue; } if (!line.startsWith("want ") || line.length() < 45) { throw new PackProtocolException(MessageFormat .format(JGitText.get().expectedGot, "want", line)); } if (isFirst) { if (line.length() > 45) { FirstWant firstLine = FirstWant.fromLine(line); reqBuilder.addClientCapabilities(firstLine.getCapabilities()); reqBuilder.setAgent(firstLine.getAgent()); line = firstLine.getLine(); } } reqBuilder.addWantId(ObjectId.fromString(line.substring(5))); isFirst = false; } return reqBuilder.build(); }
Source:
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); if (clazz == null) { return; } final ClassAnnotationInformation<RunAs, String> runAs = clazz.getAnnotationInformation(RunAs.class); final ClassAnnotationInformation<RunAsPrincipal, String> runAsPrincipal = clazz .getAnnotationInformation(RunAsPrincipal.class); if (runAs == null) { if(runAsPrincipal != null) { EjbLogger.DEPLOYMENT_LOGGER.warnf("@RunAs annotation is required when using @RunAsPrincipal on %s", componentClass.getName()); } return; } if (!runAs.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setRunAs(runAs.getClassLevelAnnotations().get(0)); } String principal = DEFAULT_RUN_AS_PRINCIPAL; if (runAsPrincipal != null) { if (!runAsPrincipal.getClassLevelAnnotations().isEmpty()) { principal = runAsPrincipal.getClassLevelAnnotations().get(0); } } componentConfiguration.setRunAsPrincipal(principal); }

Target:
protected void handleAnnotations(final DeploymentUnit deploymentUnit, final EEApplicationClasses applicationClasses, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription componentConfiguration) throws DeploymentUnitProcessingException { final EEModuleClassDescription clazz = applicationClasses.getClassByName(componentClass.getName()); if (clazz == null) { return; } final ClassAnnotationInformation<RunAs, String> runAs = clazz.getAnnotationInformation(RunAs.class); final ClassAnnotationInformation<RunAsPrincipal, String> runAsPrincipal = clazz .getAnnotationInformation(RunAsPrincipal.class); if (runAs == null) { if(runAsPrincipal != null) { EjbLogger.DEPLOYMENT_LOGGER.missingRunAsAnnotation(componentClass.getName()); } return; } if (!runAs.getClassLevelAnnotations().isEmpty()) { componentConfiguration.setRunAs(runAs.getClassLevelAnnotations().get(0)); } String principal = DEFAULT_RUN_AS_PRINCIPAL; if (runAsPrincipal != null) { if (!runAsPrincipal.getClassLevelAnnotations().isEmpty()) { principal = runAsPrincipal.getClassLevelAnnotations().get(0); } } componentConfiguration.setRunAsPrincipal(principal); }
Source:
public void initialize() { Configuration config = getThing().getConfiguration(); String ipAddress = (String) config.get(SonyAudioBindingConstants.HOST_PARAMETER); String path = (String) config.get(SonyAudioBindingConstants.SCALAR_PATH_PARAMETER); Object port_o = config.get(SonyAudioBindingConstants.SCALAR_PORT_PARAMETER); int port; if (port_o instanceof BigDecimal) { port = ((BigDecimal) port_o).intValue(); } else { port = (int) port_o; } Object refresh_o = config.get(SonyAudioBindingConstants.REFRESHINTERVAL); int refresh = 0; if (refresh_o instanceof BigDecimal) { refresh = ((BigDecimal) refresh_o).intValue(); } else if (refresh_o instanceof Integer) { refresh = (int) refresh_o; } try { connection = new SonyAudioConnection(ipAddress, port, path, this); connection.connect(scheduler); Runnable connectionChecker = new Runnable() { @Override public void run() { try { if (!connection.checkConnection()) { updateStatus(ThingStatus.OFFLINE); } } catch (Exception ex) { logger.warn("Exception in check connection to @{}. Cause: {}", connection.getConnectionName(), ex.getMessage()); } } }; connectionCheckerFuture = scheduler.scheduleWithFixedDelay(connectionChecker, 1, 10, TimeUnit.SECONDS); startAutomaticRefresh(refresh); } catch (Exception e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); } }

Target:
public void initialize() { Configuration config = getThing().getConfiguration(); String ipAddress = (String) config.get(SonyAudioBindingConstants.HOST_PARAMETER); String path = (String) config.get(SonyAudioBindingConstants.SCALAR_PATH_PARAMETER); Object port_o = config.get(SonyAudioBindingConstants.SCALAR_PORT_PARAMETER); int port = 10000; if (port_o instanceof BigDecimal) { port = ((BigDecimal) port_o).intValue(); } else if (port_o instanceof Integer) { port = (int) port_o; } Object refresh_o = config.get(SonyAudioBindingConstants.REFRESHINTERVAL); int refresh = 0; if (refresh_o instanceof BigDecimal) { refresh = ((BigDecimal) refresh_o).intValue(); } else if (refresh_o instanceof Integer) { refresh = (int) refresh_o; } try { connection = new SonyAudioConnection(ipAddress, port, path, this, scheduler, webSocketClient); Runnable connectionChecker = () -> { try { if (!connection.checkConnection()) { if (getThing().getStatusInfo().getStatus() != ThingStatus.OFFLINE) { logger.info("Lost connection"); updateStatus(ThingStatus.OFFLINE); } } } catch (Exception ex) { logger.warn("Exception in check connection to @{}. Cause: {}", connection.getConnectionName(), ex.getMessage(), ex); } }; connectionCheckerFuture = scheduler.scheduleWithFixedDelay(connectionChecker, 1, 10, TimeUnit.SECONDS); startAutomaticRefresh(refresh); } catch (URISyntaxException e) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.CONFIGURATION_ERROR, e.getMessage()); } }
Source:
public static void closeWelcomePage() { if (welcomePageClosed) return; try { bot.viewByTitle("Welcome").close(); welcomePageClosed = true; } catch (WidgetNotFoundException e) { welcomePageClosed = true; } }

Target:
public static void closeWelcomePage() { if (welcomePageClosed) return; try { bot.viewByTitle("Welcome").close(); } catch (WidgetNotFoundException e) { } finally { welcomePageClosed = true; } }
Source:
public Response addMetadataStoreRealm(@PathParam("realm") String realm) { try { if (!_metadataStoreDirectory.addMetadataStoreRealm(_namespace, realm)) { return serverError(); } } catch (IllegalArgumentException ex) { return notFound(ex.getMessage()); } catch (IllegalStateException ex) { return serverError(); } return created(); }

Target:
public Response addMetadataStoreRealm(@PathParam("realm") String realm) { try { if (!_metadataStoreDirectory.addMetadataStoreRealm(_namespace, realm)) { return serverError(); } } catch (IllegalArgumentException ex) { return notFound(ex.getMessage()); } return created(); }
Source:
static CommentDetailFragment newInstance(SiteModel site, CommentModel commentModel) { CommentDetailFragment fragment = new CommentDetailFragment(); Bundle args = new Bundle(); args.putInt(KEY_MODE, FROM_BLOG_COMMENT); args.putLong(KEY_SITE_ID, site.getSiteId()); args.putLong(KEY_COMMENT_ID, commentModel.getRemoteCommentId()); fragment.setArguments(args); return fragment; }

Target:
static CommentDetailFragment newInstance(SiteModel site, CommentModel commentModel) { CommentDetailFragment fragment = new CommentDetailFragment(); Bundle args = new Bundle(); args.putInt(KEY_MODE, FROM_BLOG_COMMENT); args.putInt(KEY_SITE_LOCAL_ID, site.getId()); args.putLong(KEY_COMMENT_ID, commentModel.getRemoteCommentId()); fragment.setArguments(args); return fragment; }
Source:
public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } final HeapObject other = (HeapObject) obj; if ( node == null ) { return other.node == null; } else return node.equals(other.node); }

Target:
public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( obj == null ) { return false; } if ( getClass() != obj.getClass() ) { return false; } final HeapObject other = (HeapObject) obj; if ( node == null ) { return other.node == null; } return node.equals(other.node); }
Source:
public void sendConfirmationEmailForSubmission(String courseId, String feedbackSessionName, String userId, String unregisteredStudentEmail, String unregisteredStudentRegKey) throws EntityDoesNotExistException { Assumption.assertNotNull(ERROR_NULL_PARAMETER, courseId); Assumption.assertNotNull(ERROR_NULL_PARAMETER, feedbackSessionName); feedbackSessionsLogic.sendConfirmationEmailForSubmission(courseId, feedbackSessionName, userId, unregisteredStudentEmail, unregisteredStudentRegKey); }

Target:
public void sendConfirmationEmailForSubmission(String courseId, String feedbackSessionName, String userId, String unregisteredStudentEmail, String unregisteredStudentRegKey) throws EntityDoesNotExistException { Assumption.assertNotNull(ERROR_NULL_PARAMETER, courseId); Assumption.assertNotNull(ERROR_NULL_PARAMETER, feedbackSessionName); Assumption.assertFalse(ERROR_NULL_PARAMETER, userId == null && (unregisteredStudentEmail == null || unregisteredStudentRegKey == null)); feedbackSessionsLogic.sendConfirmationEmailForSubmission(courseId, feedbackSessionName, userId, unregisteredStudentEmail, unregisteredStudentRegKey); }
Source:
private void backup() { List<BackupOperation> batch = ImmutableList.copyOf(operations); operations.clear(); BackupRequest request = BackupRequest.request( context.descriptor(), context.nodeId(), context.currentTerm(), context.currentIndex(), batch); log.trace("Sending to {}", request, nodeId); context.protocol().backup(nodeId, request).join(); lastSent = System.currentTimeMillis(); }

Target:
private void backup() { List<BackupOperation> batch = ImmutableList.copyOf(operations); operations.clear(); BackupRequest request = BackupRequest.request( context.descriptor(), context.memberId(), context.currentTerm(), context.currentIndex(), batch); log.trace("Sending to {}", request, memberId); context.protocol().backup(memberId, request); lastSent = System.currentTimeMillis(); }
Source:
public void shutdown() throws InterruptedException { stopPeriodRebalance(); stopOnDemandTimer(); logger.info("Shutting down pipeline", Pipeline.Type.DEFAULT.name()); shutdownPipeline(_eventThread, _eventQueue); logger.info("Shutting down pipeline", Pipeline.Type.TASK.name()); shutdownPipeline(_taskEventThread, _taskEventQueue); _asyncTasksThreadPool.shutdownNow(); try { _asyncTasksThreadPool.awaitTermination(EVENT_THREAD_JOIN_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { logger.warn("Timeout when terminating async tasks. Some async tasks are still executing."); } shutdownAsyncFIFOWorkers(); enableClusterStatusMonitor(false); _rebalancerRef.closeRebalancer(); }

Target:
public void shutdown() throws InterruptedException { stopPeriodRebalance(); shutdownOnDemandTimer(); logger.info("Shutting down pipeline", Pipeline.Type.DEFAULT.name()); shutdownPipeline(_eventThread, _eventQueue); logger.info("Shutting down pipeline", Pipeline.Type.TASK.name()); shutdownPipeline(_taskEventThread, _taskEventQueue); _asyncTasksThreadPool.shutdownNow(); try { _asyncTasksThreadPool.awaitTermination(EVENT_THREAD_JOIN_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { logger.warn("Timeout when terminating async tasks. Some async tasks are still executing."); } shutdownAsyncFIFOWorkers(); enableClusterStatusMonitor(false); _rebalancerRef.closeRebalancer(); }
Source:
public boolean allInnerJoins() { return m_joinType == JoinType.INNER && (m_leftNode == null ? true : m_leftNode.allInnerJoins()) && (m_rightNode == null ? true : m_rightNode.allInnerJoins()); }

Target:
public boolean allInnerJoins() { return m_joinType == JoinType.INNER && (m_leftNode == null || m_leftNode.allInnerJoins()) && (m_rightNode == null || m_rightNode.allInnerJoins()); }
Source:
protected boolean canCreateSymLinks() { if (!isWindowsVistaOrHigher()) return true; if (canCreateSymLinkOnWindows == null) { IPath tempDir = getTempDir(); String linkName = FileSystemHelper.getRandomLocation(tempDir).lastSegment(); try { createSymLink(tempDir.toFile(), linkName, "testTarget", false); new File(tempDir.toFile(), linkName).delete(); canCreateSymLinkOnWindows = Boolean.TRUE; } catch (AssertionFailedError e) { canCreateSymLinkOnWindows = Boolean.FALSE; } } return canCreateSymLinkOnWindows.booleanValue(); }

Target:
protected boolean canCreateSymLinks() { if (canCreateSymLink == null) { if (isWindowsVistaOrHigher()) { IPath tempDir = getTempDir(); String linkName = FileSystemHelper.getRandomLocation(tempDir).lastSegment(); try { createSymLink(tempDir.toFile(), linkName, "testTarget", false); new File(tempDir.toFile(), linkName).delete(); canCreateSymLink = Boolean.TRUE; } catch (AssertionFailedError e) { canCreateSymLink = Boolean.FALSE; } } else { canCreateSymLink = Boolean.TRUE; } } return canCreateSymLink.booleanValue(); }
Source:
private void waitForTransportState(String state) { if (stateMap.get("TransportState") != null) { long start = System.currentTimeMillis(); while (!stateMap.get("TransportState").equals(state)) { try { Thread.sleep(50); if (System.currentTimeMillis() - start > (this.notificationTimeout.longValue() * 1000)) { break; } } catch (InterruptedException e) { logger.error("InterruptedException during playing a notification sound"); } } } }

Target:
private void waitForTransportState(String state) { if (stateMap.get("TransportState") != null) { long start = System.currentTimeMillis(); while (!stateMap.get("TransportState").equals(state)) { try { Thread.sleep(50); if (System.currentTimeMillis() - start > this.notificationTimeout.longValue() * 1000) { break; } } catch (InterruptedException e) { logger.error("InterruptedException during playing a notification sound"); } } } }
Source:
public static InternalFileContent createWorkspaceFileContent(IFile file) { String path= file.getLocationURI().getPath(); path= normalizePath(path, file); InputStream input; try { long fileReadTime = System.currentTimeMillis(); IFileStore store = EFS.getStore(file.getLocationURI()); IFileInfo fileInfo = store.fetchInfo(); input= file.getContents(true); if ((input instanceof FileInputStream)) { try { return createFileContent(path, file.getCharset(), input, fileInfo.getLastModified(), fileInfo.getLength(), fileReadTime); } finally { try { input.close(); } catch (IOException e) { } } } } catch (CoreException e) { switch (e.getStatus().getCode()) { case IResourceStatus.NOT_FOUND_LOCAL: case IResourceStatus.NO_LOCATION_LOCAL: case IResourceStatus.FAILED_READ_LOCAL: case IResourceStatus.RESOURCE_NOT_LOCAL: case IResourceStatus.RESOURCE_NOT_FOUND: break; default: CCorePlugin.log(e); break; } } return null; }

Target:
public static InternalFileContent createWorkspaceFileContent(IFile file) { String path= file.getLocationURI().getPath(); path= normalizePath(path, file); InputStream input; try { long fileReadTime = System.currentTimeMillis(); IFileStore store = EFS.getStore(file.getLocationURI()); IFileInfo fileInfo = store.fetchInfo(); input= file.getContents(true); if (input instanceof FileInputStream) { try { return createFileContent(path, file.getCharset(), input, fileInfo.getLastModified(), fileInfo.getLength(), fileReadTime); } finally { try { input.close(); } catch (IOException e) { } } } } catch (CoreException e) { switch (e.getStatus().getCode()) { case IResourceStatus.NOT_FOUND_LOCAL: case IResourceStatus.NO_LOCATION_LOCAL: case IResourceStatus.FAILED_READ_LOCAL: case IResourceStatus.RESOURCE_NOT_LOCAL: case IResourceStatus.RESOURCE_NOT_FOUND: break; default: CCorePlugin.log(e); break; } } return null; }
Source:
private boolean hasPlainToString(Class<?> cls, Object obj) { try { if (cls.getMethod("toString") == plainToString) { return true; } String plainToStringValue = cls.getName() + "@" + Integer.toHexString(obj.hashCode()); return plainToStringValue.equals(obj.toString()); } catch (Exception e) { return false; } }

Target:
private boolean hasPlainToString(Class<?> cls, Object obj) { try { if (cls.getMethod("toString") == plainToString) { return true; } String plainToStringValue = cls.getName() + "@" + Integer.toHexString(System.identityHashCode(obj)); return plainToStringValue.equals(obj.toString()); } catch (Exception e) { return false; } }
Source:
String getDetails() throws ReportException; String getParameters() throws ReportException; ResultsPage getAllResults() throws ReportException; ResultsPage getResults() throws ReportException; void setConfiguration(Resource config); void setPage(int page); default Map<String, String> getParamPatternMap(SlingHttpServletRequest request) { Map<String, String> parameters = new HashMap<>(); Enumeration<String> paramNames = request.getParameterNames(); while (paramNames.hasMoreElements()) { String key = paramNames.nextElement(); parameters.put(key, StringEscapeUtils.escapeSql(request.getParameter(key))); } LoggerFactory.getLogger(this.getClass()).trace("Loading parameters from request: {}", parameters); return parameters; }

Target:
String getDetails() throws ReportException; String getParameters() throws ReportException; ResultsPage getAllResults() throws ReportException; ResultsPage getResults() throws ReportException; void setConfiguration(Resource config); void setPage(int page); default Map<String, String> getParamPatternMap(SlingHttpServletRequest request) { Map<String, String> parameters = new HashMap<>(); Enumeration<String> paramNames = request.getParameterNames(); while (paramNames.hasMoreElements()) { String key = paramNames.nextElement(); parameters.put(key, StringEscapeUtils.escapeSql(request.getParameter(key))); } LoggerFactory.getLogger(this.getClass()).debug("Loading parameters from request: {}", parameters); return parameters; }
Source:
public Object get(String handle, StorageRecordType recordType) { try { storageLock.lock(); if (_storage == null) { throw new RuntimeException(EXCEPTION_STORAGE); } String value = _storage.get(recordType.getKey(handle)); if (value == null) { return null; } if (recordType.equals(ACCESS_TOKEN_RESPONSE)) { AccessTokenResponse accessTokenResponse = gson.fromJson(value, AccessTokenResponse.class); return accessTokenResponse; } else if (recordType.equals(SERVICE_CONFIGURATION)) { PersistedParams params = gson.fromJson(value, PersistedParams.class); return params; } else if (recordType.equals(LAST_USED)) { Date lastUsedDate = gson.fromJson(value, Date.class); return lastUsedDate; } return null; } finally { storageLock.unlock(); } }

Target:
public @Nullable Object get(String handle, StorageRecordType recordType) { storageLock.lock(); try { if (storage == null) { throw new IllegalStateException(EXCEPTION_STORAGE); } String value = storage.get(recordType.getKey(handle)); if (value == null) { return null; } if (recordType.equals(ACCESS_TOKEN_RESPONSE)) { try { AccessTokenResponse accessTokenResponse = gson.fromJson(value, AccessTokenResponse.class); return accessTokenResponse; } catch (Exception e) { logger.error( "Unable to deserialize json, discarding AccessTokenResponse. " + "Please check json against standard or with oauth provider. json:\n{}", value, e); return null; } } else if (recordType.equals(SERVICE_CONFIGURATION)) { try { PersistedParams params = gson.fromJson(value, PersistedParams.class); return params; } catch (Exception e) { logger.error("Unable to deserialize json, discarding PersistedParams. json:\n{}", value, e); return null; } } else if (recordType.equals(LAST_USED)) { try { LocalDateTime lastUsedDate = gson.fromJson(value, LocalDateTime.class); return lastUsedDate; } catch (Exception e) { logger.info("Unable to deserialize json, reset LAST_USED to now. json:\n{}", value); return LocalDateTime.now(); } } return null; } finally { storageLock.unlock(); } }
Source:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); VDSGroup vdsGroup = getVdsGroup(); jobProperties.put(VdcObjectType.VdsGroups.name().toLowerCase(), vdsGroup == null ? null : vdsGroup.getname()); } return jobProperties; }

Target:
public Map<String, String> getJobMessageProperties() { if (jobProperties == null) { jobProperties = new HashMap<String, String>(); VDSGroup vdsGroup = getVdsGroup(); jobProperties.put(GlusterConstants.CLUSTER, vdsGroup == null ? null : vdsGroup.getname()); } return jobProperties; }
Source:
private void findByName() throws IOException { RepositoryUtil repoUtil = getRepositoryUtil(); RepositoryCache repoCache = getRepositoryCache(); for (String dirs : repoUtil.getConfiguredRepositories()) { match = repoCache.lookupRepository(new File(dirs)); if (!ResourcePropertyTester.hasGerritConfiguration(match)) { break; } RemoteConfig remote = findRemoteByName(); if (remote != null) { return; } } match = null; }

Target:
private void findByName() throws IOException { RepositoryUtil repoUtil = getRepositoryUtil(); RepositoryCache repoCache = getRepositoryCache(); for (String dirs : repoUtil.getConfiguredRepositories()) { match = repoCache.lookupRepository(new File(dirs)); if (!ResourcePropertyTester.hasGerritConfiguration(match)) { continue; } RemoteConfig remote = findRemoteByName(); if (remote != null) { return; } } match = null; }
Source:
protected List<String> getTags(DocumentModel docModel) { return (List<String>) docModel.getPropertyValue(TAG_LIST); }

Target:
protected List<String> getTags(DocumentModel docModel) { try { return (List<String>) docModel.getPropertyValue(TAG_LIST); } catch (PropertyNotFoundException e) { return Collections.emptyList(); } }
Source:
private void initializeItems() { List<IStorageModel> items = AsyncDataProvider.getIsoStorageModels(); items.addAll(AsyncDataProvider.getInstance().getExportStorageModels()); items.addAll(AsyncDataProvider.getFileDataStorageModels()); items.addAll(AsyncDataProvider.getImportBlockDataStorageModels()); getModel().setItems(items); }

Target:
private void initializeItems() { List<IStorageModel> items = AsyncDataProvider.getIsoStorageModels(); items.addAll(AsyncDataProvider.getExportStorageModels()); items.addAll(AsyncDataProvider.getFileDataStorageModels()); items.addAll(AsyncDataProvider.getImportBlockDataStorageModels()); getModel().setItems(items); }
Source:
private boolean handleWebSocketHandshake(CarbonMessage carbonMessage, Session session) throws WebSocketEndpointAnnotationException { EndpointsRegistryImpl endpointsRegistry = EndpointsRegistryImpl.getInstance(); PatternPathRouter.RoutableDestination<Object> routableEndpoint = endpointsRegistry.getRoutableEndpoint(carbonMessage); try { if (routableEndpoint == null) { throw new NullPointerException("Cannot find the URI for the endpoint"); } Method method = new EndpointDispatcher().getOnOpenMethod(routableEndpoint.getDestination()); List<Object> parameterList = new LinkedList<>(); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); Arrays.stream(method.getParameters()).forEach( parameter -> { if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } else { parameterList.add(null); throw new IllegalArgumentException("String parameters without" + " @PathParam annotation"); } } else { parameterList.add(null); } } ); executeMethod(method, routableEndpoint.getDestination(), parameterList, session); return true; } catch (Throwable throwable) { handleError(carbonMessage, throwable, routableEndpoint, session); return false; } }

Target:
private boolean handleWebSocketHandshake(CarbonMessage carbonMessage, Session session) { EndpointsRegistryImpl endpointsRegistry = EndpointsRegistryImpl.getInstance(); String requestUri = (String) carbonMessage.getProperty(Constants.TO); PatternPathRouter.RoutableDestination<Object> routableEndpoint = endpointsRegistry.getRoutableEndpoint(requestUri); Optional<Method> methodOptional = new EndpointDispatcher().getOnOpenMethod(routableEndpoint.getDestination()); Map<String, String> paramValues = routableEndpoint.getGroupNameValues(); try { List<Object> parameterList = new LinkedList<>(); methodOptional.ifPresent( method -> { Arrays.stream(method.getParameters()).forEach( parameter -> { if (parameter.getType() == Session.class) { parameterList.add(session); } else if (parameter.getType() == String.class) { PathParam pathParam = parameter.getAnnotation(PathParam.class); if (pathParam != null) { parameterList.add(paramValues.get(pathParam.value())); } else { throw new IllegalArgumentException("String parameters without" + " @PathParam annotation"); } } else { parameterList.add(null); } } ); executeMethod(method, routableEndpoint.getDestination(), parameterList, session); } ); return true; } catch (Throwable throwable) { handleError(throwable, routableEndpoint, session); return false; } }
Source:
catch (Exception e) { LOG.fatal("Can't access to getPathToAliases() on " + MapredWork.class.getName(), e); throw new RuntimeException("Incompatible Hive API found. Expected: 0.11.0+", e); }

Target:
catch (Exception e) { mapWorkClazz = MapredWork.class; LOG.info("No Hive 0.12.0 compatible API was found, couldn't load " + mapWorkClassName); LOG.debug(e); }
Source:
public View getView(int position, View convertView, ViewGroup parent) { View element = convertView; if(element == null){ LayoutInflater inflater = (LayoutInflater) this.mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); element = inflater.inflate(R.layout.song_item, null); } View userColor = (View) element.findViewById(R.id.user_color); TextView title = (TextView)element.findViewById(R.id.title); TextView artist = (TextView) element.findViewById(R.id.artist); TextView album = (TextView) element.findViewById(R.id.album); ImageButton addButton = (ImageButton) element.findViewById(R.id.add_to_playlist); addButton.setTag(position); userColor.setBackgroundColor(0xFFFFFFFF); title.setText(metadataList.get(position).getTitle()); artist.setText(metadataList.get(position).getArtist()); album.setText(metadataList.get(position).getAlbum()); artist.setMaxWidth(parent.getWidth()/2); return element; }

Target:
public View getView(int position, View convertView, ViewGroup parent) { View element = convertView; if(element == null){ LayoutInflater inflater = (LayoutInflater) this.mContext .getSystemService(Context.LAYOUT_INFLATER_SERVICE); element = inflater.inflate(R.layout.song_item, null); } View userColor = (View) element.findViewById(R.id.user_color); TextView title = (TextView)element.findViewById(R.id.title); TextView artist = (TextView) element.findViewById(R.id.artist); TextView album = (TextView) element.findViewById(R.id.album); String macAddress = metadataList.get(position).getMacAddress(); userColor.setBackgroundColor(users.getUserByMACAddress(macAddress).getColor()); ImageButton addButton = (ImageButton) element.findViewById(R.id.add_to_playlist); addButton.setTag(position); title.setText(metadataList.get(position).getTitle()); artist.setText(metadataList.get(position).getArtist()); album.setText(metadataList.get(position).getAlbum()); artist.setMaxWidth(parent.getWidth()/2); return element; }
Source:
public void testSuccessInThePresenceOfVariousErrors() throws Exception { doPut(); String dcWherePutHappened = routerConfig.routerDatacenterName; Properties props = getNonBlockingRouterProperties(); props.setProperty("router.datacenter.name", "DC1"); routerConfig = new RouterConfig(new VerifiableProperties(props)); testVariousErrors(dcWherePutHappened); props = getNonBlockingRouterProperties(); props.setProperty("router.datacenter.name", "DC2"); routerConfig = new RouterConfig(new VerifiableProperties(props)); testVariousErrors(dcWherePutHappened); props = getNonBlockingRouterProperties(); props.setProperty("router.datacenter.name", "DC3"); routerConfig = new RouterConfig(new VerifiableProperties(props)); testVariousErrors(dcWherePutHappened); }

Target:
public void testSuccessInThePresenceOfVariousErrors() throws Exception { doPut(); String dcWherePutHappened = routerConfig.routerDatacenterName; Properties props = getDefaultNonBlockingRouterProperties(); props.setProperty("router.datacenter.name", "DC1"); routerConfig = new RouterConfig(new VerifiableProperties(props)); testVariousErrors(dcWherePutHappened); props = getDefaultNonBlockingRouterProperties(); props.setProperty("router.datacenter.name", "DC2"); routerConfig = new RouterConfig(new VerifiableProperties(props)); testVariousErrors(dcWherePutHappened); props = getDefaultNonBlockingRouterProperties(); props.setProperty("router.datacenter.name", "DC3"); routerConfig = new RouterConfig(new VerifiableProperties(props)); testVariousErrors(dcWherePutHappened); }