auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected GitCompareInput getCompareInput(ComparisonDataSource baseData, ComparisonDataSource remoteData, ComparisonDataSource ancestorData) { throw new UnsupportedOperationException( "Compare editor for working tree files is should be opened directly from GitOpenInCompareAction"); }

Target:
protected GitCompareInput getCompareInput(ComparisonDataSource baseData, ComparisonDataSource remoteData, ComparisonDataSource ancestorData) { throw new UnsupportedOperationException( "Compare editor for working tree files should be opened directly from GitOpenInCompareAction"); }
Source:
private boolean updateRelevantVms() { List<VM> vms = getVmsDiskPluggedTo(); boolean updateAllVmsSucceeded = true; if (vms.isEmpty()) { updateAllVmsSucceeded = extendDiskSize(null); } else { for (VM vm : vms) { updateAllVmsSucceeded = extendDiskSize(vm); } } return updateAllVmsSucceeded; }

Target:
private boolean updateRelevantVms() { List<VM> vms = getVmsDiskPluggedTo(); if (vms.isEmpty()) { return extendDiskSize(null); } return vms.stream().allMatch(this::extendDiskSize); }
Source:
public synchronized HttpSession getOrCreateSession(HttpServletRequest httpRequest) { HttpSession session = httpRequest.getSession(true); if (session.getAttribute(SecurityConstants.SECURITY_TOKEN_KEY) == null) { session.setMaxInactiveInterval(expirationTime * 60); session.setAttribute(SecurityConstants.SECURITY_TOKEN_KEY, new SecurityTokenHolder()); SecurityLogger.audit( "Creating a new session with id for client {}.", Hashing.sha256().hashString(session.getId(), StandardCharsets.UTF_8).toString(), httpRequest.getRemoteAddr()); } return session; }

Target:
public synchronized HttpSession getOrCreateSession(HttpServletRequest httpRequest) { HttpSession session = httpRequest.getSession(true); if (session.getAttribute(SecurityConstants.SECURITY_TOKEN_KEY) == null) { session.setMaxInactiveInterval(Math.toIntExact(TimeUnit.MINUTES.toSeconds(expirationTime))); session.setAttribute(SecurityConstants.SECURITY_TOKEN_KEY, new SecurityTokenHolder()); SecurityLogger.audit( "Creating a new session with id for client {}.", Hashing.sha256().hashString(session.getId(), StandardCharsets.UTF_8).toString(), httpRequest.getRemoteAddr()); } return session; }
Source:
private void process(final DuplicateSet set) { if (nextSetsIterator.hasNext()) { throw new PicardException("nextSetsIterator is expected to be empty, but already contains data."); } final UmiGraph umiGraph = new UmiGraph(set, umiTag, inferredUmiTag, allowMissingUmis); List<DuplicateSet> duplicateSets = umiGraph.joinUmisIntoDuplicateSets(maxEditDistanceToJoin); for (DuplicateSet ds : duplicateSets) { List<SAMRecord> records = ds.getRecords(); SAMRecord representativeRead = ds.getRepresentative(); String inferredUmi = representativeRead.getStringAttribute(inferredUmiTag); for (SAMRecord rec : records) { String currentUmi = rec.getStringAttribute(umiTag); if (currentUmi != null) { if (!haveWeSeenFirstRead) { metrics.UMI_LENGTH = currentUmi.length(); haveWeSeenFirstRead = true; } metrics.OBSERVED_BASE_ERRORS += hammingDistance(currentUmi, inferredUmi); observedBaseErrors += metrics.UMI_LENGTH; observedUmis.increment(currentUmi); inferredUmis.increment(inferredUmi); } } duplicateSetsWithUmi++; } duplicateSetsWithoutUmi++; double Z = 0; for (int k = 0; k <= maxEditDistanceToJoin; k++) { if (metrics.UMI_LENGTH > 0) { Z = Z + LongMath.binomial(metrics.UMI_LENGTH, k) * Math.pow(3.0, k); } } expectedCollisions = expectedCollisions + (1 - Math.pow(1 - Z / Math.pow(4, metrics.UMI_LENGTH), duplicateSets.size() - 1)) * duplicateSets.size(); nextSetsIterator = duplicateSets.iterator(); }

Target:
private void process(final DuplicateSet set) { if (nextSetsIterator.hasNext()) { throw new PicardException("nextSetsIterator is expected to be empty, but already contains data."); } final UmiGraph umiGraph = new UmiGraph(set, umiTag, inferredUmiTag, allowMissingUmis); List<DuplicateSet> duplicateSets = umiGraph.joinUmisIntoDuplicateSets(maxEditDistanceToJoin); for (DuplicateSet ds : duplicateSets) { List<SAMRecord> records = ds.getRecords(); SAMRecord representativeRead = ds.getRepresentative(); String inferredUmi = representativeRead.getStringAttribute(inferredUmiTag); for (SAMRecord rec : records) { String currentUmi = rec.getStringAttribute(umiTag); if (currentUmi != null) { if (!haveWeSeenFirstRead) { metrics.MEAN_UMI_LENGTH = currentUmi.length(); haveWeSeenFirstRead = true; } else { if (metrics.MEAN_UMI_LENGTH != currentUmi.length()) { throw new PicardException("UMIs of differing lengths were found."); } } metrics.OBSERVED_BASE_ERRORS += hammingDistance(currentUmi, inferredUmi); observedUmiBases += currentUmi.length(); metrics.addUmiObservation(currentUmi, inferredUmi); } } } metrics.DUPLICATE_SETS_WITH_UMI += duplicateSets.size(); metrics.DUPLICATE_SETS_IGNORING_UMI++; nextSetsIterator = duplicateSets.iterator(); }
Source:
public static String keyspaceForApplication( UUID applicationId ) { if ( USE_VIRTUAL_KEYSPACES ) { return getApplicationKeyspace(); } else { return "Application_" + applicationId.toString().replace( '-', '_' ); } }

Target:
public static String keyspaceForApplication( UUID applicationId ) { return getApplicationKeyspace(); }
Source:
public void testWithParams(String host, String redirectUrl, String opHost) { ClientInterface client = Tester.newClient(host); final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrl); final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); commandParams.setOxdId(site.getOxdId()); Map<String, String> params = new HashMap<>(); params.put("max_age", "70"); params.put("is_valid", "true"); commandParams.setParams(params); final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(), commandParams); assertNotNull(resp); notEmpty(resp.getAuthorizationUrl()); }

Target:
public void testWithParams(String host, String redirectUrl, String opHost) throws IOException { ClientInterface client = Tester.newClient(host); final RegisterSiteResponse site = RegisterSiteTest.registerSite(client, opHost, redirectUrl); final GetAuthorizationUrlParams commandParams = new GetAuthorizationUrlParams(); commandParams.setOxdId(site.getOxdId()); Map<String, String> params = new HashMap<>(); params.put("max_age", "70"); params.put("is_valid", "true"); commandParams.setParams(params); final GetAuthorizationUrlResponse resp = client.getAuthorizationUrl(Tester.getAuthorization(), commandParams); notEmpty(resp.getAuthorizationUrl()); Map<String, String> parameters = CoreUtils.splitQuery(resp.getAuthorizationUrl()); Assert.assertTrue(StringUtils.isNotBlank(parameters.get("max_age"))); assertEquals(parameters.get("max_age"), "70"); Assert.assertTrue(StringUtils.isNotBlank(parameters.get("is_valid"))); assertEquals(parameters.get("is_valid"), "true"); assertNotNull(resp); }
Source:
public void invalidStoragePool() { StorageDomain sd = new StorageDomain(); Guid storagePoolId = Guid.newGuid(); sd.setStoragePoolId(storagePoolId); when(storageDomainDao.getAllForStorageDomain(any(Guid.class))).thenReturn(Collections.singletonList(sd)); when(storagePoolDao.get(storagePoolId)).thenReturn(null); assertFalse(cmd.validate()); }

Target:
public void invalidStoragePool() { StorageDomain sd = new StorageDomain(); Guid storagePoolId = Guid.newGuid(); sd.setStoragePoolId(storagePoolId); when(storageDomainDao.getAllForStorageDomain(any())).thenReturn(Collections.singletonList(sd)); assertFalse(cmd.validate()); }
Source:
protected void saveWidgetValues() { IDialogSettings settings = getDialogSettings(); settings.put(STORE_ID_FILE_EXTENSION, getFileExtension(fileName)); settings.put(STORE_ID_INTERNAL_EXTERNAL, !internalButton.getSelection()); settings.put(STORE_ID_DESCR, selectedEditor.getId()); String editorId = selectedEditor.getId(); settings.put(STORE_ID_DESCR, editorId); if (rememberEditorButton == null || rememberTypeButton == null || (!rememberEditorButton.getSelection() && !rememberTypeButton.getSelection())) { return; } EditorRegistry reg = (EditorRegistry) WorkbenchPlugin.getDefault().getEditorRegistry(); if (rememberEditorButton.getSelection()) { updateFileMappings(reg, true); reg.setDefaultEditor(fileName, selectedEditor); } if (rememberTypeButton.getSelection()) { updateFileMappings(reg, false); reg.setDefaultEditor("*." + getFileType(), selectedEditor); } List<IFileEditorMapping> newMappings = new ArrayList<>(); newMappings.addAll(Arrays.asList(reg.getFileEditorMappings())); reg.setFileEditorMappings(newMappings.toArray(new FileEditorMapping[newMappings.size()])); reg.saveAssociations(); }

Target:
protected void saveWidgetValues() { IDialogSettings settings = getDialogSettings(); settings.put(STORE_ID_FILE_EXTENSION, getFileExtension(fileName)); settings.put(STORE_ID_INTERNAL_EXTERNAL, !internalButton.getSelection()); settings.put(STORE_ID_DESCR, selectedEditor.getId()); String editorId = selectedEditor.getId(); settings.put(STORE_ID_DESCR, editorId); boolean associateEditor = false; EditorRegistry reg = (EditorRegistry) WorkbenchPlugin.getDefault().getEditorRegistry(); if (rememberEditorButton != null && rememberEditorButton.getSelection()) { updateFileMappings(reg, true); reg.setDefaultEditor(fileName, selectedEditor); associateEditor = true; } if (rememberTypeButton != null && rememberTypeButton.getSelection()) { updateFileMappings(reg, false); reg.setDefaultEditor("*." + getFileType(), selectedEditor); associateEditor = true; } if (associateEditor) { List<IFileEditorMapping> newMappings = new ArrayList<>(); newMappings.addAll(Arrays.asList(reg.getFileEditorMappings())); reg.setFileEditorMappings(newMappings.toArray(new FileEditorMapping[newMappings.size()])); reg.saveAssociations(); } }
Source:
private XYPlot createScalabilityPlot(List<XYSeries> seriesList, String xAxisLabel, NumberFormat xAxisNumberFormat, String yAxisLabel, NumberFormat yAxisNumberFormat) { NumberAxis xAxis = new NumberAxis(xAxisLabel); if (useLogarithmicProblemScale(seriesList)) { LogarithmicAxis xLogAxis = new LogarithmicAxis(xAxis.getLabel() + " (logarithmic)"); xLogAxis.setAllowNegativesFlag(true); xAxis = xLogAxis; } xAxis.setNumberFormatOverride(xAxisNumberFormat); NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setNumberFormatOverride(yAxisNumberFormat); XYPlot plot = new XYPlot(null, xAxis, yAxis, null); int seriesIndex = 0; for (XYSeries series : seriesList) { XYSeriesCollection seriesCollection = new XYSeriesCollection(); seriesCollection.addSeries(series); plot.setDataset(seriesIndex, seriesCollection); XYItemRenderer renderer = createScalabilityPlotRenderer(yAxisNumberFormat); plot.setRenderer(seriesIndex, renderer); seriesIndex++; } plot.setOrientation(PlotOrientation.VERTICAL); return plot; }

Target:
private XYPlot createScalabilityPlot(List<XYSeries> seriesList, String xAxisLabel, NumberFormat xAxisNumberFormat, String yAxisLabel, NumberFormat yAxisNumberFormat) { NumberAxis xAxis; if (useLogarithmicProblemScale(seriesList)) { LogarithmicAxis logarithmicAxis = new LogarithmicAxis(xAxisLabel + " (logarithmic)"); logarithmicAxis.setAllowNegativesFlag(true); xAxis = logarithmicAxis; } else { xAxis = new NumberAxis(xAxisLabel); } xAxis.setNumberFormatOverride(xAxisNumberFormat); NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setNumberFormatOverride(yAxisNumberFormat); XYPlot plot = new XYPlot(null, xAxis, yAxis, null); int seriesIndex = 0; for (XYSeries series : seriesList) { XYSeriesCollection seriesCollection = new XYSeriesCollection(); seriesCollection.addSeries(series); plot.setDataset(seriesIndex, seriesCollection); XYItemRenderer renderer = createScalabilityPlotRenderer(yAxisNumberFormat); plot.setRenderer(seriesIndex, renderer); seriesIndex++; } plot.setOrientation(PlotOrientation.VERTICAL); return plot; }
Source:
public void addInitialParticipant(SessionId sessionId, ProjectId projectId, ACOrgUnitId participantId, EClass roleClass) throws ESException { checkForNulls(sessionId, projectId, participantId, roleClass); final ACUser resolvedUser = getAuthorizationControl().resolveUser(sessionId); if (!resolvedUser.getId().equals(participantId)) { throw new AccessControlException(Messages.AdminEmfStoreImpl_OnlyAllowedForRequstingUser); } final boolean isServerAdmin = getAuthorizationControl().checkProjectAdminAccess( sessionId, null, PAPrivileges.ShareProject); if (isServerAdmin) { return; } if (isServerAdminRole(roleClass)) { throw new AccessControlException(Messages.AdminEmfStoreImpl_Not_Allowed_To_Assign_ServerAdminRole); } final ShareProjectAdapter adapter = ShareProjectAdapter.find(sessionId); if (adapter == null) { throw new AccessControlException(Messages.AdminEmfStoreImpl_IllegalRequestToAddInitialRole); } final boolean didRemove = adapter.removeProject(projectId); if (!didRemove) { throw new AccessControlException(Messages.AdminEmfStoreImpl_IllegalRequestToAddInitialRole); } projectId = getProjectId(projectId); final ACOrgUnit orgUnit = getOrgUnit(participantId); for (final Role role : orgUnit.getRoles()) { if (areEqual(role, roleClass)) { role.getProjects().add(ModelUtil.clone(projectId)); save(); return; } } }

Target:
public void addInitialParticipant(SessionId sessionId, ProjectId projectId, ACOrgUnitId participantId, EClass roleClass) throws ESException { checkForNulls(sessionId, projectId, participantId, roleClass); if (isServerAdminRole(roleClass)) { throw new AccessControlException(Messages.AdminEmfStoreImpl_Not_Allowed_To_Assign_ServerAdminRole); } final ACUser resolvedUser = getAuthorizationControl().resolveUser(sessionId); if (!resolvedUser.getId().equals(participantId)) { throw new AccessControlException(Messages.AdminEmfStoreImpl_OnlyAllowedForRequstingUser); } getAuthorizationControl().checkProjectAdminAccess( sessionId, null, PAPrivileges.ShareProject); checkIfSessionIsAssociatedWithProject(sessionId, projectId); projectId = getProjectId(projectId); final ACOrgUnit orgUnit = getOrgUnit(participantId); for (final Role role : orgUnit.getRoles()) { if (areEqual(role, roleClass)) { role.getProjects().add(ModelUtil.clone(projectId)); save(); return; } } }
Source:
private void updateWatchdogItems(Set<VmWatchdogType> vmWatchdogTypes) { List<String> watchDogModels = new ArrayList<String>(); for (VmWatchdogType vmWatchdogType : vmWatchdogTypes) { watchDogModels.add(EnumTranslator.getInstance().get(vmWatchdogType)); } watchDogModels.add(0, null); String oldWatchdogSelected = getWatchdogModel().getSelectedItem(); getWatchdogModel().setItems(watchDogModels); if (watchDogModels.contains(oldWatchdogSelected)) { getWatchdogModel().setSelectedItem(oldWatchdogSelected); } }

Target:
private void updateWatchdogItems(Set<VmWatchdogType> vmWatchdogTypes) { List<String> watchDogModels = new ArrayList<String>(); for (VmWatchdogType vmWatchdogType : vmWatchdogTypes) { watchDogModels.add(EnumTranslator.getInstance().get(vmWatchdogType)); } watchDogModels.add(0, null); String oldWatchdogSelected = (String) getWatchdogModel().getSelectedItem(); getWatchdogModel().setItems(watchDogModels); if (watchDogModels.contains(oldWatchdogSelected)) { getWatchdogModel().setSelectedItem(oldWatchdogSelected); } }
Source:
private void RestoreVmFromBaseSnapshot(VM vm) { if (DbFacade.getInstance().getDiskImageDAO().getAllStatelessVmImageMapsForVm(vm.getId()).size() > 0) { log.infoFormat("Deleting snapshots for stateless vm {0}", vm.getId()); Backend.getInstance().runInternalAction(VdcActionType.RestoreStatelessVm, new VmOperationParameterBase(vm.getId()), new CommandContext(getCompensationContext())); } }

Target:
private void RestoreVmFromBaseSnapshot(VM vm) { if (getDiskImageDAO().getAllStatelessVmImageMapsForVm(vm.getId()).size() > 0) { log.infoFormat("Deleting snapshots for stateless vm {0}", vm.getId()); Backend.getInstance().runInternalAction(VdcActionType.RestoreStatelessVm, new VmOperationParameterBase(vm.getId()), new CommandContext(getCompensationContext())); } }
Source:
public TransactionsLockWatchUpdate getUpdateForTransactions( Set<Long> startTimestamps, Optional<LockWatchVersion> lastKnownVersion) { Preconditions.checkArgument(!startTimestamps.isEmpty(), "Cannot get events for empty set of transactions"); TimestampMapping timestampMapping = getTimestampMappings(startTimestamps); lastKnownVersion.ifPresent(version -> assertTrue(version.version() <= timestampMapping.lastVersion().version(), "Cannot get update for transactions when the last known version is more recent than the transactions")); VersionBounds versionBounds = new VersionBounds.Builder() .startVersion(lastKnownVersion) .endVersion(timestampMapping.lastVersion()) .earliestSnapshotVersion(timestampMapping.versionRange().lowerEndpoint()) .build(); return eventLog.getEventsBetweenVersions(versionBounds) .toTransactionsLockWatchUpdate(timestampMapping, lastKnownVersion); }

Target:
public TransactionsLockWatchUpdate getUpdateForTransactions( Set<Long> startTimestamps, Optional<LockWatchVersion> lastKnownVersion) { TimestampMapping timestampMapping = getTimestampMappings(startTimestamps); VersionBounds versionBounds = new VersionBounds.Builder() .startVersion(lastKnownVersion) .endVersion(timestampMapping.lastVersion()) .earliestSnapshotVersion(timestampMapping.versionRange().lowerEndpoint()) .build(); return eventLog.getEventsBetweenVersions(versionBounds) .toTransactionsLockWatchUpdate(timestampMapping, lastKnownVersion); }
Source:
public List<TokenCacheItem> getTokensForUser(String userId) { Iterator<TokenCacheItem> results = this.getAll(); List<TokenCacheItem> tokenItems = new ArrayList<>(); while (results.hasNext()) { final TokenCacheItem tokenCacheItem = results.next(); if (tokenCacheItem.getUserInfo() != null && tokenCacheItem.getUserInfo().getUserId().equalsIgnoreCase(userId)) { tokenItems.add(tokenCacheItem); } } return tokenItems; }

Target:
public List<TokenCacheItem> getTokensForUser(String userId) { Iterator<TokenCacheItem> results = this.getAll(); final List<TokenCacheItem> tokenItems = new ArrayList<>(); while (results.hasNext()) { final TokenCacheItem tokenCacheItem = results.next(); if (tokenCacheItem.getUserInfo() != null && tokenCacheItem.getUserInfo().getUserId().equalsIgnoreCase(userId)) { tokenItems.add(tokenCacheItem); } } return tokenItems; }
Source:
public Measurement(final int id, final String node, final int qualifier, final DateTime time, final double value) { super(id, node); final DecimalFormat df = new DecimalFormat("#.#####"); df.setRoundingMode(RoundingMode.HALF_UP); this.qualifier = qualifier; this.time = time; this.value = Double.parseDouble(df.format(value)); }

Target:
public Measurement(final int id, final String node, final int qualifier, final DateTime time, final double value) { super(id, node); this.qualifier = qualifier; this.time = time; this.value = this.roundValue(value); }
Source:
private static boolean safeShouldPublish(MetricName metricName, MetricPublicationFilter filter) { try { return filter.shouldPublish(); } catch (Exception e) { log.warn("Exception thrown when attempting to determine whether a metric should be published." + " In this case we don't filter out the metric.", SafeArg.of("metricName", metricName), e); return true; } }

Target:
private static boolean safeShouldPublish(MetricName metricName, MetricPublicationFilter filter) { try { return filter.shouldPublish(); } catch (RuntimeException e) { log.warn("Exception thrown when attempting to determine whether a metric should be published." + " In this case we don't filter out the metric.", SafeArg.of("metricName", metricName), e); return true; } }
Source:
public RewriteRelation step(org.kframework.kil.Term cfg, int steps, boolean computeGraph) throws KRunExecutionException { return javaKILRun(cfg, steps, computeGraph); }

Target:
public RewriteRelation step(org.kframework.kil.Term cfg, int steps, boolean computeGraph) throws KRunExecutionException { return javaRewriteEngineRun(cfg, steps, computeGraph); }
Source:
public List<String> getNames() { if (!valid()) { return List.of(); } return List.of(AIR_ATTACK_NON_SUBS); }

Target:
public List<String> getNames() { return valid() ? List.of(AIR_ATTACK_NON_SUBS) : List.of(); }
Source:
Trigger getTrigger(UDTValue value) { int type = value.getInt("type"); switch (type) { case 0: return new SingleExecutionTrigger(value.getLong("trigger_time")); case 1: return new RepeatingTrigger( value.getLong("interval"), value.getLong("delay"), value.getLong("trigger_time"), value.getInt("repeat_count"), value.getInt("execution_count") ); default: throw new IllegalArgumentException("Trigger type [" + type + "] is not supported"); } }

Target:
static Trigger getTrigger(UDTValue value) { int type = value.getInt("type"); switch (type) { case 0: return new SingleExecutionTrigger(value.getLong("trigger_time")); case 1: return new RepeatingTrigger( value.getLong("interval"), value.getLong("delay"), value.getLong("trigger_time"), value.getInt("repeat_count"), value.getInt("execution_count") ); default: throw new IllegalArgumentException("Trigger type [" + type + "] is not supported"); } }
Source:
public Response checkMessagingConnectionForTheDm( String message, long timeout ) { if ( message == null ) { message = "ECHO " + UUID.randomUUID(); } if ( timeout > MAXIMUM_TIMEOUT ) { this.logger.warning( "Timeout " + timeout + "ms is above maximum limit " + MAXIMUM_TIMEOUT + "ms. Normalizing" ); timeout = MAXIMUM_TIMEOUT; } this.logger.fine( "Checking connection to the message queue. message=" + message + ", timeout=" + timeout + "ms" ); boolean hasReceived; try { hasReceived = this.manager.pingMessageQueue( message, timeout ); } catch ( IOException e ) { final String eMessage = "Unable to send Echo message " + message; logger.log( Level.SEVERE, eMessage, e ); return Response.status( Status.INTERNAL_SERVER_ERROR ).entity( eMessage ).build(); } catch ( InterruptedException e ) { final String eMessage = "Interrupted while waiting for Echo message " + message; logger.log( Level.WARNING, eMessage, e ); return Response.status( Status.INTERNAL_SERVER_ERROR ).entity( eMessage ).build(); } if ( hasReceived ) { final String rMessage = "Has received Echo message " + message; logger.fine( rMessage ); return Response.status( Status.OK ).entity( rMessage ).build(); } else { final String rMessage = "Did not receive Echo message " + message + " before timeout (" + timeout + "ms)"; logger.warning( rMessage ); return Response.status( 408 ).entity( rMessage ).build(); } }

Target:
public Response checkMessagingConnectionForTheDm( String message, long timeout ) { if ( message == null ) { message = "ECHO " + UUID.randomUUID(); } if ( timeout > MAXIMUM_TIMEOUT ) { this.logger.warning( "Timeout " + timeout + "ms is above maximum limit " + MAXIMUM_TIMEOUT + "ms. Normalizing" ); timeout = MAXIMUM_TIMEOUT; } this.logger.fine( "Checking connection to the message queue. message=" + message + ", timeout=" + timeout + "ms" ); Response response; String responseMessage; try { if ( this.manager.pingMessageQueue( message, timeout ) ) { responseMessage = "Has received Echo message " + message; logger.fine( responseMessage ); response = Response.status( Status.OK ).entity( responseMessage ).build(); } else { responseMessage = "Did not receive Echo message " + message + " before timeout (" + timeout + "ms)"; logger.warning( responseMessage ); response = Response.status( 408 ).entity( responseMessage ).build(); } } catch ( IOException e ) { responseMessage = "Unable to send Echo message " + message; this.logger.severe( responseMessage ); Utils.logException( this.logger, Level.FINEST, e); response = Response.status( Status.INTERNAL_SERVER_ERROR ).entity( responseMessage ).build(); } catch ( InterruptedException e ) { responseMessage = "Interrupted while waiting for Echo message " + message; this.logger.severe( responseMessage ); Utils.logException( this.logger, Level.FINEST, e); response = Response.status( Status.INTERNAL_SERVER_ERROR ).entity( responseMessage ).build(); } return response; }
Source:
private AppLovinAdSize appLovinAdSizeFromLocalExtras(final Map<String, Object> localExtras) { if ( localExtras == null || localExtras.isEmpty() ) { log( ERROR, "No serverExtras provided" ); return null; } try { final int width = (Integer) localExtras.get( AD_WIDTH_KEY ); final int height = (Integer) localExtras.get( AD_HEIGHT_KEY ); if ( width > 0 && height > 0 ) { log( DEBUG, "Valid width (" + width + ") and height (" + height + ") provided" ); final int offset = Math.abs( BANNER_STANDARD_HEIGHT - height ); if ( offset <= BANNER_HEIGHT_OFFSET_TOLERANCE ) { return AppLovinAdSize.BANNER; } else if ( height == LEADER_STANDARD_HEIGHT || height == AppLovinAdSize.LEADER.getHeight() ) { return AppLovinAdSize.LEADER; } else if ( height <= AppLovinAdSize.MREC.getHeight() ) { return AppLovinAdSize.MREC; } else { log( ERROR, "Provided dimensions does not meet the dimensions required of banner or mrec ads" ); } } else { log( ERROR, "Invalid width (" + width + ") and height (" + height + ") provided" ); } } catch ( Throwable th ) { log( ERROR, "Encountered error while parsing width and height from serverExtras", th ); } return null; }

Target:
private AppLovinAdSize appLovinAdSizeFromLocalExtras(final Map<String, Object> localExtras) { if ( localExtras == null || localExtras.isEmpty() ) { log( ERROR, "No serverExtras provided" ); return null; } try { final int width = (Integer) localExtras.get( AD_WIDTH_KEY ); final int height = (Integer) localExtras.get( AD_HEIGHT_KEY ); if ( width > 0 && height > 0 ) { log( DEBUG, "Valid width (" + width + ") and height (" + height + ") provided" ); final int bannerOffset = Math.abs( BANNER_STANDARD_HEIGHT - height ); final int leaderOffset = Math.abs( LEADER_STANDARD_HEIGHT - height ); if ( bannerOffset <= BANNER_HEIGHT_OFFSET_TOLERANCE ) { return AppLovinAdSize.BANNER; } else if ( leaderOffset <= LEADER_HEIGHT_OFFSET_TOLERANCE ) { return AppLovinAdSize.LEADER; } else if ( height <= AppLovinAdSize.MREC.getHeight() ) { return AppLovinAdSize.MREC; } else { log( ERROR, "Provided dimensions does not meet the dimensions required of banner or mrec ads" ); } } else { log( ERROR, "Invalid width (" + width + ") and height (" + height + ") provided" ); } } catch ( Throwable th ) { log( ERROR, "Encountered error while parsing width and height from serverExtras", th ); } return null; }
Source:
private JSONArray getDatacenters() throws JSONException { List<String> names = new ArrayList<String>(datacenterCount); List<JSONArray> dataNodes = new ArrayList<JSONArray>(datacenterCount); int curBasePort = basePort; int sslPort = basePort + 1000; for (int i = 0; i < datacenterCount; i++) { names.add(i, "DC" + i); dataNodes.add(i, getDataNodes(curBasePort, sslPort, getDisks())); curBasePort += dataNodeCount; } return TestUtils.getJsonArrayDatacenters(names, dataNodes); }

Target:
private JSONArray getDatacenters() throws JSONException { List<String> names = new ArrayList<String>(datacenterCount); List<JSONArray> dataNodes = new ArrayList<JSONArray>(datacenterCount); int curBasePort = basePort; int curSslBasePort = baseSslPort + 1000; for (int i = 0; i < datacenterCount; i++) { names.add(i, "DC" + i); dataNodes.add(i, getDataNodes(curBasePort, curSslBasePort, getDisks())); curBasePort += dataNodeCount; curSslBasePort += dataNodeCount; } return TestUtils.getJsonArrayDatacenters(names, dataNodes); }
Source:
@Test public void testNodeTypeCountExchange() { final RelNode rel = convertSql("select * from emp"); final RelDistribution dist = RelDistributions.hash(ImmutableList.<Integer>of()); final LogicalExchange exchange = LogicalExchange.create(rel, dist); final Map<Class<? extends RelNode>, Integer> expected = new HashMap<>(); expected.put(TableScan.class, 1); expected.put(Exchange.class, 1); expected.put(Project.class, 1); final RelMetadataQuery mq = rel.getCluster().getMetadataQuery(); final Multimap<Class<? extends RelNode>, RelNode> result = mq.getNodeTypes(exchange); assertThat(result, notNullValue()); final Map<Class<? extends RelNode>, Integer> resultCount = new HashMap<>(); for (Entry<Class<? extends RelNode>, Collection<RelNode>> e : result.asMap().entrySet()) { resultCount.put(e.getKey(), e.getValue().size()); } assertEquals(expected, resultCount); }

Target:
@Test public void testNodeTypeCountExchange() { final RelNode rel = convertSql("select * from emp"); final RelDistribution dist = RelDistributions.hash(ImmutableList.<Integer>of()); final LogicalExchange exchange = LogicalExchange.create(rel, dist); final Map<Class<? extends RelNode>, Integer> expected = new HashMap<>(); expected.put(TableScan.class, 1); expected.put(Exchange.class, 1); expected.put(Project.class, 1); final RelMetadataQuery mq = rel.getCluster().getMetadataQuery(); final Multimap<Class<? extends RelNode>, RelNode> result = mq.getNodeTypes(exchange); assertThat(result, notNullValue()); final Map<Class<? extends RelNode>, Integer> resultCount = new HashMap<>(); for (Entry<Class<? extends RelNode>, Collection<RelNode>> e : result.asMap().entrySet()) { resultCount.put(e.getKey(), e.getValue().size()); } assertThat(expected, equalTo(resultCount)); }
Source:
public String toString() { final StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("{"); sb.append("alias=").append(alias); sb.append(", get=").append(value); sb.append('}'); return sb.toString(); }

Target:
public String toString() { final StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("{"); sb.append("alias=").append(alias); sb.append(", value=").append(value); sb.append('}'); return sb.toString(); }
Source:
public void testSerializeRequest(CommandSerializer testSubject) { Map<String, ?> metadata = new HashMap<String, Object>() {{ this.put("firstKey", "firstValue"); this.put("secondKey", "secondValue"); }}; CommandMessage message = new GenericCommandMessage<>("payload", metadata); Command command = testSubject.serialize(message, "routingKey", 1); CommandMessage<?> deserialize = testSubject.deserialize(command); assertEquals(message.getIdentifier(), deserialize.getIdentifier()); assertEquals(message.getCommandName(), deserialize.getCommandName()); assertEquals(message.getMetaData(), deserialize.getMetaData()); assertEquals(message.getPayloadType(), deserialize.getPayloadType()); assertEquals(message.getPayload(), deserialize.getPayload()); }

Target:
void testSerializeRequest(CommandSerializer testSubject) { Map<String, ?> metadata = new HashMap<String, Object>() {{ this.put("firstKey", "firstValue"); this.put("secondKey", "secondValue"); }}; CommandMessage message = new GenericCommandMessage<>("payload", metadata); Command command = testSubject.serialize(message, "routingKey", 1); CommandMessage<?> deserialize = testSubject.deserialize(command); assertEquals(message.getIdentifier(), deserialize.getIdentifier()); assertEquals(message.getCommandName(), deserialize.getCommandName()); assertEquals(message.getMetaData(), deserialize.getMetaData()); assertEquals(message.getPayloadType(), deserialize.getPayloadType()); assertEquals(message.getPayload(), deserialize.getPayload()); }
Source:
public void verifyTwitterWindow(){ CommonFunctions.waitForWindow("", ""); Object[] windows = driver.getWindowHandles().toArray(); driver.switchTo().window(windows[1].toString()); waitForStringInURL("twitter.com"); driver.close(); driver.switchTo().window(windows[0].toString()); PageObjectLogging.log("verifyTwitterWindow", "Verify that the Twitter window URL is correct", true, driver); }

Target:
public void verifyTwitterWindow(){ CommonFunctions.waitForWindow("", ""); Object[] windows = driver.getWindowHandles().toArray(); driver.switchTo().window(windows[1].toString()); waitForStringInURL(URLsContent.twitterDomain); driver.close(); driver.switchTo().window(windows[0].toString()); PageObjectLogging.log("verifyTwitterWindow", "Verify that the Twitter window URL is correct", true, driver); }
Source:
private void initGlusterPeerProcess() { _glusterPeerListSucceeded = true; _glusterPeerProbeSucceeded = true; List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { List<GlusterServerInfo> glusterServers = getGlusterPeers(upServer.getId()); if (glusterServers.size() == 0) { setNonOperational(NonOperationalReason.GLUSTER_PEER_LIST_FAILED); } else if (!hostExists(glusterServers, getVds())) { try { if (!glusterPeerProbe(upServer.getId(), getVds().gethost_name())) { setNonOperational(NonOperationalReason.GLUSTER_PEER_PROBE_FAILED); } } catch (Exception e) { log.errorFormat("Could not peer probe the gluster server {0}. Error: {1}", getVds().gethost_name(), e.getMessage()); } } } } }

Target:
private void initGlusterPeerProcess() { _glusterPeerListSucceeded = true; _glusterPeerProbeSucceeded = true; List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { List<GlusterServerInfo> glusterServers = getGlusterPeers(upServer.getId()); if (glusterServers.size() == 0) { setNonOperational(NonOperationalReason.GLUSTER_PEER_LIST_FAILED); } else if (!hostExists(glusterServers, getVds())) { if (!glusterPeerProbe(upServer.getId(), getVds().gethost_name())) { setNonOperational(NonOperationalReason.GLUSTER_PEER_PROBE_FAILED); } } } } }
Source:
public void the_factory_can_load_prefixed_keys_on_saved_preferences() { BriefcasePreferences prefs = new BriefcasePreferences(InMemoryPreferences.empty()); prefs.putAll(validConfig.asMap("some_prefix")); ExportConfiguration load = load(Optional.empty(), prefs, "some_prefix"); assertThat(load, is(validConfig)); }

Target:
public void the_factory_can_load_prefixed_keys_on_saved_preferences() { BriefcasePreferences prefs = new BriefcasePreferences(InMemoryPreferences.empty()); prefs.putAll(validConfig.asMap("some_prefix")); ExportConfiguration load = loadFormConfig(prefs, "some_prefix"); assertThat(load, is(validConfig)); }
Source:
protected void addMissingValuesReplacements(KiePMMLModel model, PMMLContext context) { logger.debug("addMissingValuesReplacements {}", model, context); final PMMLRequestData requestData = context.getRequestData(); final Map<String, ParameterInfo> mappedRequestParams = requestData.getMappedRequestParams(); final Map<String, Object> missingValueReplacementMap = model.getMissingValueReplacementMap(); missingValueReplacementMap.forEach((fieldName, missingValueReplacement) -> { if (!mappedRequestParams.containsKey(fieldName)) { logger.debug("missingValueReplacement {}", fieldName, missingValueReplacement); requestData.addRequestParam(fieldName, missingValueReplacement); } }); }

Target:
protected void addMissingValuesReplacements(KiePMMLModel model, PMMLContext context) { logger.debug("addMissingValuesReplacements {}", model, context); final PMMLRequestData requestData = context.getRequestData(); final Map<String, ParameterInfo> mappedRequestParams = requestData.getMappedRequestParams(); final Map<String, Object> missingValueReplacementMap = model.getMissingValueReplacementMap(); missingValueReplacementMap.forEach((fieldName, missingValueReplacement) -> { if (!mappedRequestParams.containsKey(fieldName)) { logger.debug("missingValueReplacement {}", fieldName, missingValueReplacement); requestData.addRequestParam(fieldName, missingValueReplacement); context.addMissingValueReplaced(fieldName, missingValueReplacement); } }); }
Source:
public BaseResponseDto updateUserAddress(UserAddressRequestDto userAddressRequestDto) { BaseResponseDto baseResponseDto = new BaseResponseDto(); List<UserAddressModel> byLoginName = userAddressMapper.findByLoginName(userAddressRequestDto.getBaseParam().getUserId()); if (CollectionUtils.isNotEmpty(byLoginName)) { UserAddressModel userAddressModel = convertUserAddressModel(userAddressRequestDto); userAddressModel.setId(byLoginName.get(0).getId()); userAddressMapper.update(userAddressModel); } else { userAddressMapper.create(convertUserAddressModel(userAddressRequestDto)); } baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); return baseResponseDto; }

Target:
public BaseResponseDto updateUserAddress(UserAddressRequestDto userAddressRequestDto) { BaseResponseDto baseResponseDto = new BaseResponseDto(); List<UserAddressModel> byLoginName = userAddressMapper.findByLoginName(userAddressRequestDto.getBaseParam().getUserId()); if (CollectionUtils.isNotEmpty(byLoginName)) { UserAddressModel userAddressModel = convertUserAddressModel(userAddressRequestDto); userAddressModel.setId(byLoginName.get(0).getId()); userAddressMapper.update(userAddressModel); } else { userAddressMapper.create(convertUserAddressModel(userAddressRequestDto)); } baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); baseResponseDto.setMessage(ReturnMessage.SUCCESS.getMsg()); return baseResponseDto; }
Source:
@Override public T convert(ResponseBody value) throws IOException { BufferedSource source = value.source(); try { return adapter.decode(source); } finally { if (source != null) { try { source.close(); } catch (IOException ignored) { } } } }

Target:
@Override public T convert(ResponseBody value) throws IOException { BufferedSource source = null; try { source = value.source(); return adapter.decode(source); } finally { if (source != null) { try { source.close(); } catch (IOException ignored) { } } } }
Source:
protected ConfigAttrIpv6AddrRangeBase(int attributeType, LinkAddress ipv6LinkAddress) { super(attributeType); validateLinkAddressTypeOrThrow(ipv6LinkAddress); linkAddress = ipv6LinkAddress; }

Target:
protected ConfigAttrIpv6AddrRangeBase(int attributeType, LinkAddress ipv6LinkAddress) { super(attributeType); validateIpv6LinkAddressTypeOrThrow(ipv6LinkAddress); linkAddress = ipv6LinkAddress; }
Source:
private boolean downloadFileWrapper(String urlString, String destination, String outputFile, NotificationDetails details) { boolean previouslyCorrupted = false; int res = DOWNLOAD_SUCCESS; for (int i = 0; i < RETRY_COUNT; i++) { if (isDownloadCanceled) { break; } String url = urlString; if (fallbackByDefault || i > 0) { if (urlString.contains("android.quran.com")) { url = urlString.replace("android.quran.com", "quran.app"); } else if (urlString.contains("quranicaudio.com")) { url = urlString.replace("quranicaudio.com", "quranicaudio.org"); } try { Thread.sleep(WAIT_TIME); } catch (InterruptedException exception) { } notifier.resetNotifications(); } wifiLock.acquire(); res = startDownload(url, destination, outputFile, details); if (wifiLock.isHeld()) { wifiLock.release(); } if (res == DOWNLOAD_SUCCESS) { fallbackByDefault = (i > 0); return true; } else if (res == QuranDownloadNotifier.ERROR_DISK_SPACE || res == QuranDownloadNotifier.ERROR_PERMISSIONS) { notifier.notifyError(res, true, details); return false; } else if (res == QuranDownloadNotifier.ERROR_INVALID_DOWNLOAD) { if (!previouslyCorrupted) { i--; previouslyCorrupted = true; } if (i + 1 < RETRY_COUNT) { notifyError(res, false, details); } } } if (isDownloadCanceled) { res = QuranDownloadNotifier.ERROR_CANCELLED; } notifyError(res, true, details); return false; }

Target:
private boolean downloadFileWrapper(String urlString, String destination, String outputFile, NotificationDetails details) { boolean previouslyCorrupted = false; int res = DOWNLOAD_SUCCESS; for (int i = 0; i < RETRY_COUNT; i++) { if (isDownloadCanceled) { break; } String url = urlString; if (fallbackByDefault || i > 0) { url = urlUtil.fallbackUrl(url); try { Thread.sleep(WAIT_TIME); } catch (InterruptedException exception) { } notifier.resetNotifications(); } wifiLock.acquire(); res = startDownload(url, destination, outputFile, details); if (wifiLock.isHeld()) { wifiLock.release(); } if (res == DOWNLOAD_SUCCESS) { fallbackByDefault = (i > 0); return true; } else if (res == QuranDownloadNotifier.ERROR_DISK_SPACE || res == QuranDownloadNotifier.ERROR_PERMISSIONS) { notifier.notifyError(res, true, details); return false; } else if (res == QuranDownloadNotifier.ERROR_INVALID_DOWNLOAD) { if (!previouslyCorrupted) { i--; previouslyCorrupted = true; } if (i + 1 < RETRY_COUNT) { notifyError(res, false, details); } } } if (isDownloadCanceled) { res = QuranDownloadNotifier.ERROR_CANCELLED; } notifyError(res, true, details); return false; }
Source:
public int hashCode() { int result = name.hashCode(); result = 31 * result + fieldName.hashCode(); return result; }

Target:
public int hashCode() { return Objects.hash(fieldName, name); }
Source:
private void drain() { if (wip.getAndIncrement() == 0) { final Subscriber<? super T> c = child; final Queue<Object> q = queue; do { if (c.isUnsubscribed()) { return; } wip.lazySet(1); long r = get(); long e = 0; Object v; while (r != 0 && (v = q.poll()) != null) { try { if (v == NULL_SENTINEL) { c.onNext(null); } else { @SuppressWarnings("unchecked") T t = (T)v; c.onNext(t); } } catch (Throwable ex) { Exceptions.throwIfFatal(ex); Throwable ex1 = OnErrorThrowable.addValueAsLastCause(ex, v != NULL_SENTINEL ? v : null); c.onError(ex1); return; } if (c.isUnsubscribed()) { return; } r--; e++; } if (e != 0) { addAndGet(-e); } } while (wip.decrementAndGet() != 0); } }

Target:
private void drain() { if (wip.getAndIncrement() == 0) { final Subscriber<? super T> c = child; final Queue<Object> q = queue; do { if (c.isUnsubscribed()) { return; } wip.lazySet(1); long r = get(); long e = 0; Object v; while (r != 0 && (v = q.poll()) != null) { try { if (v == NULL_SENTINEL) { c.onNext(null); } else { @SuppressWarnings("unchecked") T t = (T)v; c.onNext(t); } } catch (Throwable ex) { Exceptions.throwIfFatal(ex); Throwable ex1 = OnErrorThrowable.addValueAsLastCause(ex, v != NULL_SENTINEL ? v : null); c.onError(ex1); return; } if (c.isUnsubscribed()) { return; } r--; e++; } if (e != 0 && get() != Long.MAX_VALUE) { addAndGet(-e); } } while (wip.decrementAndGet() != 0); } }
Source:
public static void main(String[] args) throws IOException { if (args.length == 0) { System.err.println("Usage: RealValueFileEventStream eventfile [iterations cutoff]"); System.exit(1); } int ai = 0; String eventFile = args[ai++]; Map<String,String> params=new HashMap<String, String>(); params.put(AbstractTrainer.ITERATIONS_PARAM,"100"); params.put(AbstractTrainer.CUTOFF_PARAM, "5"); if (ai < args.length) { params.put(AbstractTrainer.ITERATIONS_PARAM,args[ai++]); params.put(AbstractTrainer.CUTOFF_PARAM, args[ai++]); } PluggableParameters parameters=new PluggableParameters(params, new HashMap<>()); AbstractModel model; try (RealValueFileEventStream es = new RealValueFileEventStream(eventFile)) { DataIndexer indexer=new OnePassDataIndexer(); indexer.init(params, new HashMap<String, String>()); model = GIS.trainModel(parameters.getIntParam(AbstractTrainer.ITERATIONS_PARAM, AbstractTrainer.CUTOFF_DEFAULT), indexer); } new SuffixSensitiveGISModelWriter(model, new File(eventFile + ".bin.gz")).persist(); }

Target:
public static void main(String[] args) throws IOException { if (args.length == 0) { System.err.println("Usage: RealValueFileEventStream eventfile [iterations cutoff]"); System.exit(1); } int ai = 0; String eventFile = args[ai++]; Map<String,String> params = new HashMap<>(); params.put(AbstractTrainer.ITERATIONS_PARAM,"100"); params.put(AbstractTrainer.CUTOFF_PARAM, "5"); if (ai < args.length) { params.put(AbstractTrainer.ITERATIONS_PARAM,args[ai++]); params.put(AbstractTrainer.CUTOFF_PARAM, args[ai++]); } PluggableParameters parameters = new PluggableParameters(params, new HashMap<>()); AbstractModel model; try (RealValueFileEventStream es = new RealValueFileEventStream(eventFile)) { DataIndexer indexer = new OnePassDataIndexer(); indexer.init(params, new HashMap<String, String>()); model = GIS.trainModel(parameters.getIntParam(AbstractTrainer.ITERATIONS_PARAM, AbstractTrainer.CUTOFF_DEFAULT), indexer); } new SuffixSensitiveGISModelWriter(model, new File(eventFile + ".bin.gz")).persist(); }
Source:
public Operation<K> decode(final ByteBuffer buffer) { OperationCode opCode = OperationCode.valueOf(buffer.get()); validateOperation(opCode); try { return newOperation(keySerializer.read(buffer)); } catch (ClassNotFoundException e) { throw new SerializerException(e); } }

Target:
public Operation<K> decode(final ByteBuffer buffer) { OperationCode opCode = OperationCode.valueOf(buffer.get()); validateOperation(opCode); try { return newOperation(keySerializer.read(buffer)); } catch (ClassNotFoundException e) { throw new CodecException(e); } }
Source:
public Player addPlayer(String playerName, SpoutServerSession<?> session, int syncDistance) { SpoutPlayer player = PlayerFiles.loadPlayerData(playerName); boolean created = false; if (player == null) { getLogger().info("First login for " + playerName + ", creating new player data"); player = new SpoutPlayer(this, playerName, getDefaultWorld().getSpawnPoint()); player.getNetwork().setSyncDistance(syncDistance); created = true; } SpoutPlayer oldPlayer = players.put(playerName, player); if (reclamation != null) { reclamation.addPlayer(); } if (oldPlayer != null && oldPlayer.getNetwork().getSession() != null) { oldPlayer.kick("Login occured from another client"); } final SpoutPhysicsComponent physics = (SpoutPhysicsComponent) player.getPhysics(); created |= physics.getTransformLive().getPosition().getWorld() == null; player.connect(session, created ? ((SpoutServerWorld) getDefaultWorld()).getSpawnPoint() : physics.getTransformLive()); World world = physics.getTransformLive().getPosition().getWorld(); world.spawnEntity(player); ((SpoutServerWorld) world).addPlayer(player); session.getProtocol().initializeServerSession(session); if (player.getNetwork() == null) { throw new IllegalStateException("initializeServerSession failed to set a player's NetworkComponent. Protocol: " + session.getProtocol()); } player.getNetwork().forceSync(); return player; }

Target:
public Player addPlayer(String playerName, SpoutServerSession<?> session, int syncDistance) { SpoutPlayer player = PlayerFiles.loadPlayerData(playerName); boolean created = false; if (player == null) { getLogger().info("First login for " + playerName + ", creating new player data"); player = new SpoutPlayer(this, playerName, getDefaultWorld().getSpawnPoint()); created = true; } SpoutPlayer oldPlayer = players.put(playerName, player); if (reclamation != null) { reclamation.addPlayer(); } if (oldPlayer != null && oldPlayer.getNetwork().getSession() != null) { oldPlayer.kick("Login occured from another client"); } final SpoutPhysicsComponent physics = (SpoutPhysicsComponent) player.getPhysics(); created |= physics.getTransformLive().getPosition().getWorld() == null; player.connect(session, created ? ((SpoutServerWorld) getDefaultWorld()).getSpawnPoint() : physics.getTransformLive()); World world = physics.getTransformLive().getPosition().getWorld(); world.spawnEntity(player); ((SpoutServerWorld) world).addPlayer(player); session.getProtocol().initializeServerSession(session); if (player.getNetwork() == null) { throw new IllegalStateException("initializeServerSession failed to set a player's NetworkComponent. Protocol: " + session.getProtocol()); } player.getNetwork().setSyncDistance(syncDistance); player.getNetwork().forceSync(); return player; }
Source:
public PhoenixNonRetryableRuntimeException() { super(); }

Target:
public PhoenixNonRetryableRuntimeException() { }