auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean matches(final URI uri, final String abstractType, final String abstractTypeAuthority, final String purpose) { String host = uri.getHost(); if (host.startsWith("[") && host.endsWith("]")) { try { host = InetAddress.getByName(host).getCanonicalHostName(); } catch (UnknownHostException e) { log.warnf(e, "Invalid IPv6 address: %s", host); } } return host != null && host.startsWith(hostSpec) && super.matches(uri, abstractType, abstractTypeAuthority, purpose); }

Target:
public boolean matches(final URI uri, final String abstractType, final String abstractTypeAuthority, final String purpose) { String host = uri.getHost(); if (host == null) { return false; } byte[] hostBytes; if (host.startsWith("[") && host.endsWith("]")) { hostBytes = Inet.parseInet6AddressToBytes(host); } else { hostBytes = Inet.parseInet4AddressToBytes(host); } if (hostBytes != null && this.hostSpecBytes != null) { return Arrays.equals(hostBytes, this.hostSpecBytes) && super.matches(uri, abstractType, abstractTypeAuthority, purpose); } else { return host.toLowerCase(Locale.ROOT).equals(hostSpec) && super.matches(uri, abstractType, abstractTypeAuthority, purpose); } }
Source:
public boolean sleep() { attempt++; long currentTimeMillis = Clock.currentTimeMillis(); if (currentTimeMillis > clusterConnectDeadline) { logger.warning(String.format("Unable to get live cluster connection, cluster connect timeout %d seconds is " + "reached. Attempt %d.", clusterConnectTimeoutSeconds, attempt)); return false; } long actualSleepTime = (long) (currentBackoffMillis - (currentBackoffMillis * jitter) + (currentBackoffMillis * jitter * random.nextDouble())); actualSleepTime = Math.min(actualSleepTime, clusterConnectDeadline - currentTimeMillis); logger.warning(String.format("Unable to get live cluster connection, retry in %d ms, attempt %d " + ", cluster connect timeout seconds %d " + ", retry timeout millis %d cap", actualSleepTime, attempt, clusterConnectTimeoutSeconds, maxBackoffMillis)); try { Thread.sleep(actualSleepTime); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } currentBackoffMillis = (int) Math.min(currentBackoffMillis * multiplier, maxBackoffMillis); return true; }

Target:
public boolean sleep() { attempt++; long currentTimeMillis = Clock.currentTimeMillis(); long timePassed = currentTimeMillis - clusterConnectAttemptBegin; if (timePassed > clusterConnectTimeoutMillis) { logger.warning(String.format("Unable to get live cluster connection, cluster connect timeout (%d millis) is " + "reached. Attempt %d.", clusterConnectTimeoutMillis, attempt)); return false; } long actualSleepTime = (long) (currentBackoffMillis - (currentBackoffMillis * jitter) + (currentBackoffMillis * jitter * random.nextDouble())); actualSleepTime = Math.min(actualSleepTime, clusterConnectTimeoutMillis - timePassed); logger.warning(String.format("Unable to get live cluster connection, retry in %d ms, attempt: %d " + ", cluster connect timeout: %d seconds " + ", max backoff millis: %d", actualSleepTime, attempt, clusterConnectTimeoutMillis, maxBackoffMillis)); try { Thread.sleep(actualSleepTime); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return false; } currentBackoffMillis = (int) Math.min(currentBackoffMillis * multiplier, maxBackoffMillis); return true; }
Source:
private Object fetchObjects(Environment context) { if(context.data.isPresent()) { throw new BadRequestException("FETCH must not include data"); } if (context.isRoot() || context.outputType instanceof GraphQLList) { GraphQLObjectType graphQLType = (GraphQLObjectType) ((GraphQLList) context.outputType).getWrappedType(); String entityType = graphQLType.getName(); Class recordType = context.requestScope.getDictionary().getEntityClass(entityType); if (recordType == null) { throw new UnknownEntityException(entityType); } return fetchObject(context.requestScope, recordType, context.ids, context.sort, context.offset, context.first, context.filters); } else { return fetchObject(context.requestScope, context.parentResource, context.field, context.outputType, context.ids, context.sort, context.offset, context.first, context.filters); } }

Target:
private Object fetchObjects(Environment context) { if(context.data.isPresent()) { throw new BadRequestException("FETCH must not include data"); } if (context.isRoot()) { return fetchObject(context); } else { EntityDictionary dictionary = context.requestScope.getDictionary(); Class parentClass = context.parentResource.getResourceClass(); String fieldName = context.field.getName(); if(dictionary.isAttribute(parentClass, fieldName)) { return fetchAttribute(context.parentResource, context.field); } else if(dictionary.isRelation(parentClass, fieldName)){ return fetchRelationship(context); } else { throw new BadRequestException("Unrecognized object type: " + context.outputType.getClass().getName()); } } }
Source:
public void should_fail_if_actual_is_null() { assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> maps.assertContainsOnlyKeys(someInfo(), null, Arrays.asList("name"))) .withMessage(actualIsNull()); }

Target:
public void should_fail_if_actual_is_null() { assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> maps.assertContainsOnlyKeys(someInfo(), null, list("name"))) .withMessage(actualIsNull()); }
Source:
private String getForwardToEmail() { return env.getProperty("emailBuilder.config.forwardAddress"); }

Target:
private String getForwardToEmail() { return env.getProperty("emailBuilder_config_forwardAddress"); }
Source:
public void start() { try { String hostName = System.getProperty("fake.host"); if (hostName == null) { hostName = "localhost"; } log.debug("Opening a Stomp server " + hostName + ":" + jsonPort); Reactor reactor; if (!encrypted) { reactor = ReactorFactory.getReactor(null, ReactorType.STOMP); } else { Runtime.getRuntime().exec("<dir>/generate-certs.sh 1 2 3"); reactor = ReactorFactory.getReactor(new VdsmProvider(AppConfig.getInstance().getCertspath(), log), ReactorType.STOMP); } final Future<ReactorListener> futureListener = reactor.createListener(hostName, jsonPort, new ReactorListener.EventListener() { @Override public void onAcccept(final ReactorClient client) { client.addEventListener(new MessageListener() { @Override public void onMessageReceived(byte[] message) { MessageHandler handler = new MessageHandler(client, message); service.submit(handler); } }); } }); listener = futureListener.get(TIMEOUT, TimeUnit.MILLISECONDS); } catch (Exception e) { log.error("Failure to start json server socket", e); } }

Target:
public void start() { try { String hostName = System.getProperty("fake.host"); if (hostName == null) { hostName = "localhost"; } log.debug("Opening a Stomp server " + hostName + ":" + jsonPort); Reactor reactor; if (!encrypted) { reactor = ReactorFactory.getReactor(null, ReactorType.STOMP); } else { reactor = ReactorFactory.getReactor(new VdsmProvider(AppConfig.getInstance().getCertspath(), log), ReactorType.STOMP); } final Future<ReactorListener> futureListener = reactor.createListener(hostName, jsonPort, new ReactorListener.EventListener() { @Override public void onAcccept(final ReactorClient client) { client.addEventListener(new MessageListener() { @Override public void onMessageReceived(byte[] message) { MessageHandler handler = new MessageHandler(client, message); service.submit(handler); } }); } }); listener = futureListener.get(TIMEOUT, TimeUnit.MILLISECONDS); } catch (Exception e) { log.error("Failure to start json server socket", e); } }
Source:
public void testRemoteSnapshotRequestedNodeLeft() throws Exception { IgniteEx ig0 = startGridWithCache(defaultCacheCfg, CACHE_KEYS_RANGE); IgniteEx ig1 = startGrid(1); ig0.cluster().setBaselineTopology(ig0.cluster().forServers().nodes()); awaitPartitionMapExchange(); CountDownLatch hold = new CountDownLatch(1); ((GridCacheDatabaseSharedManager)ig1.context() .cache() .context() .database()) .waitForCheckpoint("Snapshot before request", f -> { try { U.await(hold); } catch (IgniteCheckedException e) { throw new IgniteException(e); } }); UUID rmtNodeId = ig1.localNode().id(); ig0.context() .cache() .context() .snapshotMgr() .createRemoteSnapshot(rmtNodeId, owningParts(ig0, new HashSet<>(Collections.singletonList(CU.cacheId(DEFAULT_CACHE_NAME))), rmtNodeId), (part, grp) -> {}); IgniteInternalFuture<?>[] futs = new IgniteInternalFuture[1]; GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { IgniteInternalFuture<Boolean> snpFut = ig1.context() .cache() .context() .snapshotMgr() .lastScheduledRemoteSnapshotTask(ig0.localNode().id()); if (snpFut == null) return false; else futs[0] = snpFut; return true; } }, 5_000L); stopGrid(0); hold.countDown(); futs[0].get(); }

Target:
public void testRemoteSnapshotRequestedNodeLeft() throws Exception { IgniteEx ig0 = startGridWithCache(dfltCacheCfg, CACHE_KEYS_RANGE); IgniteEx ig1 = startGrid(1); ig0.cluster().setBaselineTopology(ig0.cluster().forServers().nodes()); awaitPartitionMapExchange(); CountDownLatch hold = new CountDownLatch(1); ((GridCacheDatabaseSharedManager)ig1.context().cache().context().database()) .addCheckpointListener(new DbCheckpointListener() { @Override public void beforeCheckpointBegin(Context ctx) throws IgniteCheckedException { U.await(hold); } @Override public void onMarkCheckpointBegin(Context ctx) { } @Override public void onCheckpointBegin(Context ctx) { } }); UUID rmtNodeId = ig1.localNode().id(); Map<Integer, Set<Integer>> parts = new HashMap<>(); parts.put(CU.cacheId(DEFAULT_CACHE_NAME), null); snp(ig0).createRemoteSnapshot(rmtNodeId, parts, (part, grp) -> {}); IgniteInternalFuture<?>[] futs = new IgniteInternalFuture[1]; assertTrue(GridTestUtils.waitForCondition(new GridAbsPredicate() { @Override public boolean apply() { IgniteInternalFuture<Boolean> snpFut = snp(ig1) .lastScheduledRemoteSnapshotTask(ig0.localNode().id()); if (snpFut == null) return false; else futs[0] = snpFut; return true; } }, 5_000L)); stopGrid(0); hold.countDown(); futs[0].get(); }
Source:
public void attachNodeFailingBecauseOfNodeGoingDownInPreparePhase() throws Exception { waitForNPassives(1, 2); int activeId = findActive(1).getAsInt(); int passiveId1 = findPassives(1)[0]; int passiveId2 = findPassives(1)[1]; startNode(1, 4); waitForDiagnostic(1, 4); assertThat(getUpcomingCluster("localhost", getNodePort(1, 4)).getNodeCount(), is(equalTo(1))); String propertySettingString = "stripe.1.node." + activeId + ".tc-properties.failoverAddition=killAddition-prepare"; invokeConfigTool("set", "-s", "localhost:" + getNodePort(1, 1), "-c", propertySettingString); assertThat( () -> invokeConfigTool("attach", "-f", "-d", "localhost:" + getNodePort(1, activeId), "-s", "localhost:" + getNodePort(1, 4)), exceptionMatcher("Two-Phase commit failed")); assertThat(getUpcomingCluster("localhost", getNodePort(1, passiveId1)).getNodeCount(), is(equalTo(3))); assertThat(getUpcomingCluster("localhost", getNodePort(1, passiveId2)).getNodeCount(), is(equalTo(3))); assertThat(getUpcomingCluster("localhost", getNodePort(1, 4)).getNodeCount(), is(equalTo(1))); withTopologyService(1, passiveId1, topologyService -> assertTrue(topologyService.isActivated())); withTopologyService(1, passiveId2, topologyService -> assertTrue(topologyService.isActivated())); withTopologyService(1, 4, topologyService -> assertFalse(topologyService.isActivated())); startNode(1, activeId, "-r", getNode(1, activeId).getConfigRepo()); waitForPassive(1, activeId); withTopologyService(1, activeId, topologyService -> assertTrue(topologyService.isActivated())); }

Target:
public void attachNodeFailingBecauseOfNodeGoingDownInPreparePhase() throws Exception { int activeId = findActive(1).getAsInt(); int passiveId1 = findPassives(1)[0]; int passiveId2 = findPassives(1)[1]; startNode(1, 4); waitForDiagnostic(1, 4); assertThat(getUpcomingCluster("localhost", getNodePort(1, 4)).getNodeCount(), is(equalTo(1))); String propertySettingString = "stripe.1.node." + activeId + ".tc-properties.failoverAddition=killAddition-prepare"; invokeConfigTool("set", "-s", "localhost:" + getNodePort(1, 1), "-c", propertySettingString); assertThat( () -> invokeConfigTool("attach", "-f", "-d", "localhost:" + getNodePort(1, activeId), "-s", "localhost:" + getNodePort(1, 4)), exceptionMatcher("Two-Phase commit failed")); assertThat(getUpcomingCluster("localhost", getNodePort(1, passiveId1)).getNodeCount(), is(equalTo(3))); assertThat(getUpcomingCluster("localhost", getNodePort(1, passiveId2)).getNodeCount(), is(equalTo(3))); assertThat(getUpcomingCluster("localhost", getNodePort(1, 4)).getNodeCount(), is(equalTo(1))); withTopologyService(1, passiveId1, topologyService -> assertTrue(topologyService.isActivated())); withTopologyService(1, passiveId2, topologyService -> assertTrue(topologyService.isActivated())); withTopologyService(1, 4, topologyService -> assertFalse(topologyService.isActivated())); startNode(1, activeId, "-r", getNode(1, activeId).getConfigRepo()); waitForPassive(1, activeId); withTopologyService(1, activeId, topologyService -> assertTrue(topologyService.isActivated())); }
Source:
static LocalDate parseDate(String str) { try { if (str.length() == 10 && str.charAt(4) == '-' && str.charAt(7) == '-') { return LocalDate.parse(str, YYYY_MM_DD_DASH); } if (str.length() == 10 && str.charAt(4) == '/' && str.charAt(7) == '/') { return LocalDate.parse(str, YYYY_MM_DD_SLASH); } if (str.length() >= 6 && str.charAt(2) == '/' && str.charAt(5) == '/') { if (str.length() == 8) { return LocalDate.parse(str, DD_MM_YY_SLASH); } else { return LocalDate.parse(str, DD_MM_YYYY_SLASH); } } if (str.length() >= 10 && str.charAt(str.length() - 5) == '-') { return LocalDate.parse(str, D_MMM_YYYY_DASH); } if (str.length() == 8 && Character.isDigit(str.charAt(2))) { return LocalDate.parse(str, YYYYMMDD); } return LocalDate.parse(str, D_MMM_YYYY_NODASH); } catch (DateTimeParseException ex) { throw new IllegalArgumentException( "Unknown date format, must be formatted as " + "yyyy-MM-dd, yyyyMMdd, dd/MM/yyyy, yyyy/MM/dd, 'd-MMM-yyyy' or 'dMMMyyyy' but was: " + str, ex); } }

Target:
static LocalDate parseDate(String str) { try { if (str.length() == 10 && str.charAt(4) == '-' && str.charAt(7) == '-') { return LocalDate.parse(str, YYYY_MM_DD_DASH); } if (str.length() == 10 && str.charAt(4) == '/' && str.charAt(7) == '/') { return LocalDate.parse(str, YYYY_MM_DD_SLASH); } if (str.length() >= 8 && str.charAt(2) == '/' && str.charAt(5) == '/') { if (str.length() == 8) { return LocalDate.parse(str, DD_MM_YY_SLASH); } else { return LocalDate.parse(str, DD_MM_YYYY_SLASH); } } if (str.length() >= 10 && str.charAt(str.length() - 5) == '-') { return LocalDate.parse(str, D_MMM_YYYY_DASH); } if (str.length() == 8 && Character.isDigit(str.charAt(2))) { return LocalDate.parse(str, YYYYMMDD); } return LocalDate.parse(str, D_MMM_YYYY_NODASH); } catch (DateTimeParseException ex) { throw new IllegalArgumentException( "Unknown date format, must be formatted as " + "yyyy-MM-dd, yyyyMMdd, dd/MM/yyyy, yyyy/MM/dd, 'd-MMM-yyyy' or 'dMMMyyyy' but was: " + str, ex); } }
Source:
private void displayCurrentInfo() { DecimalFormat df = new DecimalFormat("#"); df.setMaximumFractionDigits(0); boolean isDexbridge = CollectionServiceStarter.isDexbridgeWixel(getApplicationContext()); boolean displayBattery = prefs.getBoolean("display_bridge_battery",false); int bridgeBattery = prefs.getInt("bridge_battery", 0); if (isDexbridge && displayBattery) { if (bridgeBattery == 0) { dexbridgeBattery.setText("xBridge Battery: Unknown, Waiting for packet"); dexbridgeBattery.setTextColor(Color.WHITE); } else { dexbridgeBattery.setText("xBridge Battery: " + bridgeBattery + "%"); } if (bridgeBattery < 50 && bridgeBattery >25) dexbridgeBattery.setTextColor(Color.YELLOW); if (bridgeBattery <= 25) dexbridgeBattery.setTextColor(Color.RED); else dexbridgeBattery.setTextColor(Color.GREEN); dexbridgeBattery.setVisibility(View.VISIBLE); } else { dexbridgeBattery.setText(""); dexbridgeBattery.setVisibility(View.INVISIBLE); } if ((currentBgValueText.getPaintFlags() & Paint.STRIKE_THRU_TEXT_FLAG) > 0) { currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG)); dexbridgeBattery.setPaintFlags(dexbridgeBattery.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG)); } BgReading lastBgReading = BgReading.lastNoSenssor(); boolean predictive = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean("predictive_bg", false); if (isBTShare) { predictive = false; } if (lastBgReading != null) { displayCurrentInfoFromReading(lastBgReading, predictive); } }

Target:
private void displayCurrentInfo() { DecimalFormat df = new DecimalFormat("#"); df.setMaximumFractionDigits(0); boolean isDexbridge = CollectionServiceStarter.isDexbridgeWixel(getApplicationContext()); boolean displayBattery = prefs.getBoolean("display_bridge_battery",false); int bridgeBattery = prefs.getInt("bridge_battery", 0); if (isDexbridge && displayBattery) { if (bridgeBattery == 0) { dexbridgeBattery.setText("xBridge Battery: Unknown, Waiting for packet"); dexbridgeBattery.setTextColor(Color.WHITE); } else { dexbridgeBattery.setText("xBridge Battery: " + bridgeBattery + "%"); } dexbridgeBattery.setTextColor(Color.GREEN); if (bridgeBattery < 50 && bridgeBattery >30) dexbridgeBattery.setTextColor(Color.YELLOW); if (bridgeBattery <= 30) dexbridgeBattery.setTextColor(Color.RED); dexbridgeBattery.setVisibility(View.VISIBLE); } else { dexbridgeBattery.setText(""); dexbridgeBattery.setVisibility(View.INVISIBLE); } if ((currentBgValueText.getPaintFlags() & Paint.STRIKE_THRU_TEXT_FLAG) > 0) { currentBgValueText.setPaintFlags(currentBgValueText.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG)); dexbridgeBattery.setPaintFlags(dexbridgeBattery.getPaintFlags() & (~Paint.STRIKE_THRU_TEXT_FLAG)); } BgReading lastBgReading = BgReading.lastNoSenssor(); boolean predictive = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getBoolean("predictive_bg", false); if (isBTShare) { predictive = false; } if (lastBgReading != null) { displayCurrentInfoFromReading(lastBgReading, predictive); } }
Source:
public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); try { List<String> uniqueUnits = getUniqueUnits(connection); for (String unit : uniqueUnits) { migrateUnitsToCodedValue(connection, unit); } } catch (SQLException e) { throw new CustomChangeException(e); } }

Target:
public void execute(Database database) throws CustomChangeException { JdbcConnection connection = (JdbcConnection) database.getConnection(); try { List<String> uniqueUnits = getUniqueUnits(connection); migrateUnitsToCodedValue(connection, uniqueUnits); } catch (SQLException e) { throw new CustomChangeException(e); } catch (DatabaseException e) { throw new CustomChangeException(e); } }
Source:
public static <T extends WeightedElement> T randomMemberWeighted( SimpleList<T> list, Map<T, Double> weights, double totalWeight) { incrementCallsToRandom("randomMemberWeighted(SimpleList)"); double chosenPoint = Randomness.random.nextDouble() * totalWeight; if (GenInputsAbstract.selection_log != null) { try { GenInputsAbstract.selection_log.write(String.format("chosenPoint = %s%n", chosenPoint)); } catch (IOException e) { throw new Error("Problem writing to selection-log", e); } } double currentPoint = 0; for (int i = 0; i < list.size(); i++) { currentPoint += getWeight(list.get(i), weights); if (currentPoint >= chosenPoint) { logSelection(i, "randomMemberWeighted", list); return list.get(i); } } throw new BugInRandoopException("Unable to select random member"); }

Target:
public static <T extends WeightedElement> T randomMemberWeighted( SimpleList<T> list, Map<T, Double> weights, double totalWeight) { incrementCallsToRandom("randomMemberWeighted(SimpleList)"); double chosenPoint = Randomness.random.nextDouble() * totalWeight; if (GenInputsAbstract.selection_log != null) { try { GenInputsAbstract.selection_log.write(String.format("chosenPoint = %s%n", chosenPoint)); } catch (IOException e) { throw new Error("Problem writing to selection-log", e); } } double currentPoint = 0; for (int i = 0; i < list.size(); i++) { currentPoint += getWeight(list.get(i), weights); if (currentPoint > chosenPoint) { logSelection(i, "randomMemberWeighted", list); return list.get(i); } } throw new BugInRandoopException("Unable to select random member"); }
Source:
public CreateTaskVariablePayload handleCreateTaskVariablePayload(CreateTaskVariablePayload createTaskVariablePayload) { String name = createTaskVariablePayload.getName(); if (!variableNameValidator.validate(name)) { throw new IllegalStateException("Variable has not a valid name: " + (name != null ? name : "null" )); } Object value = createTaskVariablePayload.getValue(); if (value instanceof String) { handleAsDate((String)value).ifPresent(createTaskVariablePayload::setValue); } return createTaskVariablePayload; }

Target:
public CreateTaskVariablePayload handleCreateTaskVariablePayload(CreateTaskVariablePayload createTaskVariablePayload) { checkNotValidCharactersInVariableName(createTaskVariablePayload.getName(), "Variable has not a valid name: "); Object value = createTaskVariablePayload.getValue(); if (value instanceof String) { handleAsDate((String)value).ifPresent(createTaskVariablePayload::setValue); } return createTaskVariablePayload; }
Source:
public InetSocketAddress next(long spinDelay) { if (!connectedSinceNext) { InetSocketAddress curAddr = serverAddresses.get(currentIndex); String curHostString = getHostString(curAddr); if (!curHostString.equals(curAddr.getAddress().getHostAddress())) { LOG.info("Resolving again hostname: {}", getHostString(curAddr)); try { int thePort = curAddr.getPort(); InetAddress resolvedAddresses[] = InetAddress.getAllByName(curHostString); nextAdded = 0; nextRemoved = 0; if (resolvedAddresses.length == 1) { serverAddresses.set(currentIndex, new InetSocketAddress(resolvedAddresses[0], thePort)); nextAdded = nextRemoved = 1; LOG.debug("Newly resolved address: {}", resolvedAddresses[0]); } else { int i = 0; while (i < serverAddresses.size()) { if (getHostString(serverAddresses.get(i)).equals(curHostString) && serverAddresses.get(i).getPort() == curAddr.getPort()) { LOG.debug("Removing address: {}", serverAddresses.get(i)); serverAddresses.remove(i); nextRemoved++; } else { i++; } } for (InetAddress resolvedAddress : resolvedAddresses) { InetSocketAddress newAddr = new InetSocketAddress(resolvedAddress, thePort); if (!serverAddresses.contains(newAddr)) { LOG.debug("Adding address: {}", newAddr); serverAddresses.add(newAddr); nextAdded++; } } } } catch (UnknownHostException e) { LOG.warn("Cannot re-resolve server: {}", curAddr, e); } } } connectedSinceNext = false; currentIndex = ++currentIndex % serverAddresses.size(); if (currentIndex == lastIndex && spinDelay > 0) { try { Thread.sleep(spinDelay); } catch (InterruptedException e) { LOG.warn("Unexpected exception", e); } } else if (lastIndex == -1) { lastIndex = 0; } return serverAddresses.get(currentIndex); }

Target:
public InetSocketAddress next(long spinDelay) { currentIndex = ++currentIndex % serverAddresses.size(); if (currentIndex == lastIndex && spinDelay > 0) { try { Thread.sleep(spinDelay); } catch (InterruptedException e) { LOG.warn("Unexpected exception", e); } } else if (lastIndex == -1) { lastIndex = 0; } InetSocketAddress curAddr = serverAddresses.get(currentIndex); try { String curHostString = getHostString(curAddr); List<InetAddress> resolvedAddresses = new ArrayList<InetAddress>(Arrays.asList(this.resolver.getAllByName(curHostString))); if (resolvedAddresses.isEmpty()) { return curAddr; } Collections.shuffle(resolvedAddresses); return new InetSocketAddress(resolvedAddresses.get(0), curAddr.getPort()); } catch (UnknownHostException e) { return curAddr; } }
Source:
public void testGetSuggestedDiskAliasNullDisk() { assertEquals("null disk does not give the default name", prefix + "_Disk1", ImagesHandler.getSuggestedDiskAlias(null, prefix, 1)); }

Target:
public void testGetSuggestedDiskAliasNullDisk() { assertEquals("null disk does not give the default name", prefix + ImagesHandler.DISK + ImagesHandler.DefaultDriveName, ImagesHandler.getSuggestedDiskAlias(null, prefix, 1)); }
Source:
public List<PortalNodeSummary> getNodesFromRootForSite(EntityView view, Map<String, Object> params){ String siteId = (String)params.get("siteid"); if(StringUtils.isBlank(siteId)){ throw new IllegalArgumentException("site ID must be set in order to get the site node locations"); } List<PortalNodeSummary> portalNodeSummaries = new ArrayList<>(); if (portalHierarchyService.siteExists(siteId)) { List<PortalNode> portalNodes = portalHierarchyService.getNodesWithSite(siteId); PortalNode portalNodePrimary = portalHierarchyService.getDefaultNode(siteId); if (portalNodes.isEmpty()) { return portalNodeSummaries; } for (PortalNode pn : portalNodes) { if (pn.canView()) { PortalNodeSummary pne = new PortalNodeSummary(pn); if ((pn.getId()).equals(portalNodePrimary.getId())) { pne.setPrimary(true); } portalNodeSummaries.add(pne); } } if (portalNodeSummaries.size() == 0) { throw new IllegalArgumentException("You do not have permission to view any pages that include this site"); } } else { throw new IllegalArgumentException("No site found for the given site ID"); } return portalNodeSummaries; }

Target:
public List<PortalNodeSummary> getNodesFromRootForSite(EntityView view, Map<String, Object> params){ String siteId = (String)params.get("siteid"); if(StringUtils.isBlank(siteId)){ throw new IllegalArgumentException("site ID must be set in order to get the site node locations"); } List<PortalNodeSummary> portalNodeSummaries = new ArrayList<>(); if (siteService.siteExists(siteId)) { List<PortalNode> portalNodes = portalHierarchyService.getNodesWithSite(siteId); PortalNode portalNodePrimary = portalHierarchyService.getDefaultNode(siteId); if (portalNodes.isEmpty()) { return portalNodeSummaries; } for (PortalNode pn : portalNodes) { PortalNodeSummary pne = new PortalNodeSummary(pn); if (pn.equals(portalNodePrimary)) { pne.setPrimary(true); } portalNodeSummaries.add(pne); } } else { throw new IllegalArgumentException("The site ID is not valid"); } return portalNodeSummaries; }
Source:
protected void checkAllowQueriesOnUiThread() { if (getSharedRealm().capabilities.isMainThread()) { if (!getConfiguration().isAllowQueriesOnUiThread()) { throw new RealmException("There exists an opt-out for running queries on the UI thread. By default Realm allows queries from the UI thread. You can alternatively opt in by using 'RealmConfiguration.allowQueriesOnUiThread'."); } } }

Target:
protected void checkAllowQueriesOnUiThread() { if (getSharedRealm().capabilities.isMainThread()) { if (!getConfiguration().isAllowQueriesOnUiThread()) { throw new RealmException("Queries on the UI thread have been disabled. They can be enabled by setting 'RealmConfiguration.Builder.allowQueriesOnUiThread(true)'."); } } }
Source:
public void shutdown() { shuttingDown.set(true); logger.info("Compactor received shutdown request, waiting up to seconds for in-flight operations to finish", shutDownTimeoutSecs); try { doneLatch.get().await(shutDownTimeoutSecs, TimeUnit.SECONDS); logger.info("Compactor shut down successfully."); } catch (InterruptedException ex) { logger.warn("Timed out waiting for operations to finish. If cloud provider uses separate stores for " + "data and metadata, some inconsistencies may be present."); } }

Target:
public void shutdown() { shuttingDown.set(true); logger.info("Compactor received shutdown request, waiting up to seconds for in-flight operations to finish", shutDownTimeoutSecs); boolean success = false; try { success = doneLatch.get().await(shutDownTimeoutSecs, TimeUnit.SECONDS); } catch (InterruptedException ex) { } if (success) { logger.info("Compactor shut down successfully."); } else { logger.warn("Timed out or interrupted waiting for operations to finish. If cloud provider uses separate stores" + " for data and metadata, some inconsistencies may be present."); vcrMetrics.compactionShutdownTimeoutCount.inc(); } }
Source:
public void setup() throws Exception { String propFileName = "test.properties"; Properties props = new Properties(); try (InputStream input = this.getClass().getClassLoader().getResourceAsStream(propFileName)) { if (input == null) { throw new IllegalStateException("Could not find resource: " + propFileName); } props.load(input); } catch (IOException ex) { throw new IllegalStateException("Could not load properties from resource: " + propFileName); } VerifiableProperties verProps = new VerifiableProperties(props); azureDest = (AzureCloudDestination) new AzureCloudDestinationFactory(verProps, new MetricRegistry()).getCloudDestination(); cosmosCollectionLink = verProps.getString(AzureCloudConfig.COSMOS_COLLECTION_LINK); }

Target:
public void setup() throws Exception { String propFileName = "azure-test.properties"; Properties props = new Properties(); try (InputStream input = this.getClass().getClassLoader().getResourceAsStream(propFileName)) { if (input == null) { throw new IllegalStateException("Could not find resource: " + propFileName); } props.load(input); } catch (IOException ex) { throw new IllegalStateException("Could not load properties from resource: " + propFileName); } VerifiableProperties verProps = new VerifiableProperties(props); azureDest = (AzureCloudDestination) new AzureCloudDestinationFactory(verProps, new MetricRegistry()).getCloudDestination(); cosmosCollectionLink = verProps.getString(AzureCloudConfig.COSMOS_COLLECTION_LINK); }
Source:
public void deleteAttachment(Long attachmentId) throws IOException { Attachment attachment = attachments.load(attachmentId); if (attachment == null) { result.notFound(); return; } User current = loggedUser.getCurrent(); detachFromQuestion(attachment); detachFromAnswer(attachment); if (!attachment.canDelete(current) && !current.isModerator()) { result.use(http()).sendError(403); return; } attachments.delete(attachment); fileStorage.delete(attachment); result.nothing(); }

Target:
public void deleteAttachment(Long attachmentId) throws IOException { Attachment attachment = attachments.load(attachmentId); User current = loggedUser.getCurrent(); if (!attachment.canDelete(current) && !current.isModerator()) { validator.add(messageFactory.build("error", "unauthorized.title")); result.use(http()).sendError(403); return; } attachments.delete(attachment); result.nothing(); }
Source:
public void stop(ComponentContext context) throws InterruptedException { getLog().debug("Stoping component"); }

Target:
public void stop(ComponentContext context) throws InterruptedException { getLog().debug("Stopping component " + getName()); }
Source:
public BluetoothServerSocket listenUsingL2capCoc(int transport) throws IOException { if (transport != BluetoothDevice.TRANSPORT_LE) { throw new IllegalArgumentException("Unsupported transport: " + transport); } BluetoothServerSocket socket = new BluetoothServerSocket(BluetoothSocket.TYPE_L2CAP_LE, true, true, SOCKET_CHANNEL_AUTO_STATIC_NO_SDP, false, false); int errno = socket.mSocket.bindListen(); if (errno != 0) { throw new IOException("Error: " + errno); } int assignedPsm = socket.mSocket.getPort(); if (assignedPsm == 0) { throw new IOException("Error: Unable to assign PSM value"); } if (DBG) { Log.d(TAG, "listenUsingL2capCoc: set assigned PSM to " + assignedPsm); } socket.setChannel(assignedPsm); return socket; }

Target:
public BluetoothServerSocket listenUsingL2capCoc(int transport) throws IOException { Log.e(TAG, "listenUsingL2capCoc: PLEASE USE THE OFFICIAL API, listenUsingL2cap"); return listenUsingL2cap(transport); }
Source:
public void execute() { Resource umlResource = UmlUtils.getUmlModel(modelSet).getResource(); model = (org.eclipse.uml2.uml.Model) umlResource.getContents().get(0); URI qudvURI = URI.createURI(SysMLResource.LIBRARY_PATH).appendFragment("SysML.package_packagedElement_Libraries"); libraries = modelSet.getEObject(qudvURI, true); this.getCommandStack(modelSet).execute(new RecordingCommand(modelSet.getTransactionalEditingDomain()) { @Override protected void doExecute() { PackageImport importPrimitivePack = model.createPackageImport((org.eclipse.uml2.uml.Package) libraries); if (!model.getPackageImports().contains(importPrimitivePack)) { model.getPackageImports().add(importPrimitivePack); } try { model.eResource().save(Collections.EMPTY_MAP); } catch (IOException e) { Activator.getLogHelper().error(e); } } }); }

Target:
public void execute() { Resource umlResource = UmlUtils.getUmlModel(modelSet).getResource(); root = (org.eclipse.uml2.uml.Package) umlResource.getContents().get(0); URI qudvURI = URI.createURI(SysMLResource.LIBRARY_PATH).appendFragment(SysMLResource.LIBRARY_ROOT_ID); libraries = (org.eclipse.uml2.uml.Package) modelSet.getEObject(qudvURI, true); this.getCommandStack(modelSet).execute(new RecordingCommand(modelSet.getTransactionalEditingDomain()) { @Override protected void doExecute() { PackageImport importPrimitivePack = root.createPackageImport( libraries); if (!root.getPackageImports().contains(importPrimitivePack)) { root.getPackageImports().add(importPrimitivePack); } try { root.eResource().save(Collections.EMPTY_MAP); } catch (IOException e) { Activator.getLogHelper().error(e); } } }); }
Source:
public String footerFull(Model model) { String footerExtraData = Context.getMessageSourceService().getMessage("legacyui.footer.extradata", null, null, Locale.getDefault()); if (footerExtraData.equals("legacyui.footer.extradata")) { footerExtraData = null; } model.addAttribute("footerExtraData", footerExtraData); return "module/legacyui/template/footerFull"; }

Target:
public String footerFull(Model model) { String footerExtraData = Context.getRuntimeProperties().getProperty("legacyui.footer.extradata", ""); model.addAttribute("extraData", footerExtraData); return "module/legacyui/template/footerFull"; }
Source:
public boolean createExpiredObject(ExpiredObject obj) { try { int objectExpirationInMinutes = 0; if(obj.getType() == ExpiredObjectType.STATE){ objectExpirationInMinutes = configuration.getStateExpirationInMinutes(); } else if(obj.getType() == ExpiredObjectType.NONCE){ objectExpirationInMinutes = configuration.getNonceExpirationInMinutes(); } put(objectExpirationInMinutes * 60, obj.getKey(), obj.getType().getValue()); return true; } catch (Exception e) { LOG.error("Failed to create ExpiredObject: " + obj.getKey(), e); return false; } }

Target:
public boolean createExpiredObject(ExpiredObject obj) { try { int objectExpirationInMinutes = 0; if (obj.getType() == ExpiredObjectType.STATE) { objectExpirationInMinutes = configuration.getStateExpirationInMinutes(); } else if (obj.getType() == ExpiredObjectType.NONCE) { objectExpirationInMinutes = configuration.getNonceExpirationInMinutes(); } put(objectExpirationInMinutes * 60, obj.getKey(), obj.getValue()); return true; } catch (Exception e) { LOG.error("Failed to create ExpiredObject: " + obj.getKey(), e); return false; } }
Source:
public void write(byte b[], int off, int len) throws IOException { count += len; if (count > maxOutputSize) { throw new IOException("Attempt to write " + count + " bytes was made. A maximum of " + maxOutputSize + " is allowed for an encryption stream."); } obuffer = cipher.update(b, off, len); if (obuffer != null) { output.write(obuffer); obuffer = null; } }

Target:
public void write(byte b[], int off, int len) throws IOException { count += len; if (count > maxOutputSize) { throw new IOException("Attempt to write " + count + " bytes was made. A maximum of " + maxOutputSize + " is allowed for an encryption stream."); } super.write(b, off, len); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_inset_map); mainMapMapView = (MapView) findViewById(R.id.main_mapView); mainMapMapView.onCreate(savedInstanceState); mainMapMapView.getMapAsync(new OnMapReadyCallback() { @Override public void onMapReady(MapboxMap mapboxMap) { InsetMapActivity.this.mainLargeMapboxMap = mapboxMap; mainLargeMapboxMap.addOnCameraMoveListener(new MapboxMap.OnCameraMoveListener() { @Override public void onCameraMove() { onMapMovedFragmentInterfaceListener.onMapMoved(mainLargeMapboxMap.getCameraPosition()); } }); } }); CustomSupportMapFragment customSupportMapFragment; if (savedInstanceState == null) { final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); MapboxMapOptions options = new MapboxMapOptions(); options.styleUrl("mapbox://styles/mapbox/cj5l80zrp29942rmtg0zctjto"); options.attributionEnabled(false); options.logoEnabled(false); options.compassEnabled(false); options.scrollGesturesEnabled(false); options.tiltGesturesEnabled(false); options.rotateGesturesEnabled(false); options.camera(new CameraPosition.Builder() .target(new LatLng(11.302318, 106.025839)) .zoom(2) .build()); customSupportMapFragment = CustomSupportMapFragment.newInstance(options); transaction.add(R.id.mini_map_fragment_container, customSupportMapFragment, "com.mapbox.fragmentMap"); transaction.commit(); } else { customSupportMapFragment = (CustomSupportMapFragment) getSupportFragmentManager().findFragmentByTag("com.mapbox.fragmentMap"); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); Mapbox.getInstance(this, getString(R.string.access_token)); setContentView(R.layout.activity_inset_map); mainMapMapView = findViewById(R.id.main_mapView); mainMapMapView.onCreate(savedInstanceState); mainMapMapView.getMapAsync(this); CustomSupportMapFragment customSupportMapFragment; if (savedInstanceState == null) { final FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); MapboxMapOptions options = new MapboxMapOptions(); options.styleUrl("mapbox://styles/mapbox/cj5l80zrp29942rmtg0zctjto"); options.attributionEnabled(false); options.logoEnabled(false); options.compassEnabled(false); options.scrollGesturesEnabled(false); options.tiltGesturesEnabled(false); options.rotateGesturesEnabled(false); options.camera(new CameraPosition.Builder() .target(new LatLng(11.302318, 106.025839)) .zoom(2) .build()); customSupportMapFragment = CustomSupportMapFragment.newInstance(options); transaction.add(R.id.mini_map_fragment_container, customSupportMapFragment, "com.mapbox.fragmentMap"); transaction.commit(); } else { customSupportMapFragment = (CustomSupportMapFragment) getSupportFragmentManager().findFragmentByTag("com.mapbox.fragmentMap"); } }
Source:
public void testGetCurrentThread() { HANDLE h = Kernel32.INSTANCE.GetCurrentThread(); assertNotNull("No current thread handle", h); assertFalse("Null current thread handle", h.getPointer().equals(Pointer.NULL)); }

Target:
public void testGetCurrentThread() { HANDLE h = Kernel32.INSTANCE.GetCurrentThread(); assertNotNull("No current thread handle", h); assertNotNull("Null current thread handle", h.getPointer()); }
Source:
public void cannotModifyReadOnlyConfiguration() throws Exception { HtmlPage configure = webClient.login(SYSTEM_READER_AND_MANAGER) .goTo("configure"); HtmlForm form = configure.getFormByName("config"); j.submit(form); Config config = GlobalConfiguration.all().get(Config.class); assert config != null; assertNull("shouldn't be allowed to change the number of executors", config.getNumber()); }

Target:
public void cannotModifyReadOnlyConfiguration() throws Exception { HtmlPage configure = webClient.login(SYSTEM_READER_AND_MANAGER) .goTo("configure"); HtmlForm form = configure.getFormByName("config"); j.submit(form); Config config = GlobalConfiguration.all().get(Config.class); assert config != null; assertNull("shouldn't be allowed to change a GlobalConfiguration that needs Overall/Administer", config.getNumber()); }
Source:
public List<SelectableData> getRating() { return asList( new SelectableData("5 Stars", "5", cms.getOrEmpty("ratingFiveStarText"), "", false), new SelectableData("4 Stars", "4", cms.getOrEmpty("ratingFourStarText"), "", false), new SelectableData("3 Stars", "3", cms.getOrEmpty("ratingThreeStarText"), "", false), new SelectableData("2 Stars", "2", cms.getOrEmpty("ratingTwoStarText"), "", false), new SelectableData("1 Stars", "1", cms.getOrEmpty("ratingOneStarText"), "", false)); }

Target:
public List<SelectableData> getRating() { return rating; }
Source:
protected Mono<BulkResponse> checkForBulkOperationFailure(BulkResponse bulkResponse) { if (bulkResponse.hasFailures()) { Map<String, String> failedDocuments = new HashMap<>(); for (BulkItemResponse item : bulkResponse.getItems()) { if (item.isFailed()) failedDocuments.put(item.getId(), item.getFailureMessage()); } ElasticsearchException exception = new ElasticsearchException( "Bulk operation has failures. Use ElasticsearchException.getFailedDocuments() for detailed messages [" + failedDocuments + ']', failedDocuments); return Mono.error(exception); } else { return Mono.just(bulkResponse); } }

Target:
protected Mono<BulkResponse> checkForBulkOperationFailure(BulkResponse bulkResponse) { if (bulkResponse.hasFailures()) { Map<String, String> failedDocuments = new HashMap<>(); for (BulkItemResponse item : bulkResponse.getItems()) { if (item.isFailed()) { failedDocuments.put(item.getId(), item.getFailureMessage()); } } ElasticsearchException exception = new ElasticsearchException( "Bulk operation has failures. Use ElasticsearchException.getFailedDocuments() for detailed messages [" + failedDocuments + ']', failedDocuments); return Mono.error(exception); } else { return Mono.just(bulkResponse); } }
Source:
private static void addBootProtocol(Map<String, Object> cfg, VdsNetworkInterface iface) { NetworkBootProtocol bootproto = NetworkBootProtocol.None; if (cfg != null) { String bootProtocol = (String) cfg.get("BOOTPROTO"); if (bootProtocol != null) { if (bootProtocol.toLowerCase().equals("dhcp")) { bootproto = NetworkBootProtocol.Dhcp; } else if (bootProtocol.toLowerCase().equals("static")) { bootproto = NetworkBootProtocol.StaticIp; } else if (bootProtocol.toLowerCase().equals("none")) { if (StringUtils.isNotEmpty((String) cfg.get("IPADDR"))) { bootproto = NetworkBootProtocol.StaticIp; } } } else if (StringUtils.isNotEmpty((String) cfg.get("IPADDR"))) { bootproto = NetworkBootProtocol.StaticIp; } if (bootproto == NetworkBootProtocol.StaticIp) { String gateway = (String) cfg.get(VdsProperties.gateway); if (StringUtils.isNotEmpty(gateway)) { setGatewayIfManagementNetwork(iface, gateway.toString()); } } } iface.setBootProtocol(bootproto); }

Target:
private static void addBootProtocol(Map<String, Object> cfg, VdsNetworkInterface iface) { NetworkBootProtocol bootproto = NetworkBootProtocol.None; if (cfg != null) { String bootProtocol = (String) cfg.get("BOOTPROTO"); if (bootProtocol != null) { if (bootProtocol.toLowerCase().equals("dhcp")) { bootproto = NetworkBootProtocol.Dhcp; } else if (bootProtocol.toLowerCase().equals("none") || bootProtocol.toLowerCase().equals("static")) { if (StringUtils.isNotEmpty((String) cfg.get("IPADDR"))) { bootproto = NetworkBootProtocol.StaticIp; } } } else if (StringUtils.isNotEmpty((String) cfg.get("IPADDR"))) { bootproto = NetworkBootProtocol.StaticIp; } if (bootproto == NetworkBootProtocol.StaticIp) { String gateway = (String) cfg.get(VdsProperties.gateway); if (StringUtils.isNotEmpty(gateway)) { setGatewayIfManagementNetwork(iface, gateway.toString()); } } } iface.setBootProtocol(bootproto); }
Source:
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { this.collector = collector; if (this.config == null) { config.configure(conf); } zkState = new ZkState(conf, config); coordinator = new PartitionCoordinator(conf, config, context, zkState); lastUpdateMs = System.currentTimeMillis(); }

Target:
public void open(Map conf, TopologyContext context, SpoutOutputCollector collector) { this.collector = collector; if (this.config == null) { config = new KafkaSpoutConfig(); config.configure(conf); } zkState = new ZkState(conf, config); coordinator = new PartitionCoordinator(conf, config, context, zkState); lastUpdateMs = System.currentTimeMillis(); }
Source:
public abstract void runMergeStrategy() throws MergeException; public void verifyMergeability(Change change) { try { openRepository(); final Ref destBranchRef = db.getRef(destBranch.get()); submitted = new ArrayList<Change>(); submitted.add(change); if ((destBranchRef == null && change.getLastSha1MergeTested() == null) || change.getLastSha1MergeTested() == null || (destBranchRef != null && !destBranchRef.getObjectId().getName() .equals(change.getLastSha1MergeTested().get()))) { schema = mArguments.schemaFactory.open(); preMerge(); if (destBranchRef != null) { change.setLastSha1MergeTested(new RevId(destBranchRef .getObjectId().getName())); } else { change.setLastSha1MergeTested(new RevId("")); } change.setMergeable(isMergeable(change)); schema.changes().update(Collections.singleton(change)); } } catch (MergeException e) { log.error("Test merge attempt for change: " + change.getId() + " failed", e); } catch (OrmException e) { log.error("Test merge attempt for change: " + change.getId() + " failed: Not able to query the database", e); } catch (IOException e) { log.error("Test merge attempt for change: " + change.getId() + " failed", e); } finally { if (schema != null) { schema.close(); } schema = null; } }

Target:
protected abstract void runMergeStrategy() throws MergeException; public final void verifyMergeability(Change change) { try { openRepository(); final Ref destBranchRef = db.getRef(destBranch.get()); submitted = new ArrayList<Change>(); submitted.add(change); if ((destBranchRef == null && change.getLastSha1MergeTested() == null) || change.getLastSha1MergeTested() == null || (destBranchRef != null && !destBranchRef.getObjectId().getName() .equals(change.getLastSha1MergeTested().get()))) { schema = mArguments.schemaFactory.open(); preMerge(); if (destBranchRef != null) { change.setLastSha1MergeTested(new RevId(destBranchRef .getObjectId().getName())); } else { change.setLastSha1MergeTested(new RevId("")); } change.setMergeable(isMergeable(change)); schema.changes().update(Collections.singleton(change)); } } catch (MergeException e) { log.error("Test merge attempt for change: " + change.getId() + " failed", e); } catch (OrmException e) { log.error("Test merge attempt for change: " + change.getId() + " failed: Not able to query the database", e); } catch (IOException e) { log.error("Test merge attempt for change: " + change.getId() + " failed", e); } finally { if (schema != null) { schema.close(); } schema = null; } }
Source:
protected String enumValueToSchemaString(Enum<?> value) { String enumValue = value.name(); String enumName; String[] aliases = null; if(value instanceof HasName) { enumName = ((HasName)value).getName(); } else { enumName = String.valueOf(value); } if(value instanceof HasAliases) { aliases = ((HasAliases)value).getAliases(); } return Serializator.enumValueToSchemaString(enumValue, enumName, aliases); }

Target:
protected String enumValueToSchemaString(Enum<?> value) { final String enumValue = value.name(); String enumName; String[] aliases = null; if(value instanceof HasName) { enumName = ((HasName)value).getName(); } else { enumName = String.valueOf(value); } if(value instanceof HasAliases) { aliases = ((HasAliases)value).getAliases(); } return Serializator.enumValueToSchemaString(enumValue, enumName, aliases); }
Source:
public boolean getBroadcastEnabled(SystemStream systemStream) { return java.lang.Boolean.parseBoolean(getSamzaProperty(systemStream, BROADCAST)); }

Target:
public boolean getBroadcastEnabled(SystemStream systemStream) { return Boolean.parseBoolean(getSamzaProperty(systemStream, BROADCAST)); }