auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void cleanupLeaverTransactions(List<Address> members) { try { if (remoteTransactions == null) return; if (trace) log.tracef("Checking for transactions originated on leavers. Current cache members are %s, remote transactions: %d", members, remoteTransactions.size()); HashSet<Address> membersSet = new HashSet<>(members); List<GlobalTransaction> toKill = new ArrayList<>(); for (Map.Entry<GlobalTransaction, RemoteTransaction> e : remoteTransactions.entrySet()) { GlobalTransaction gt = e.getKey(); if (trace) log.tracef("Checking transaction %s", gt); if (!membersSet.contains(gt.getAddress())) { toKill.add(gt); } } if (toKill.isEmpty()) { if (trace) log.tracef("No remote transactions pertain to originator(s) who have left the cluster."); } else { log.debugf("The originating node left the cluster for %d remote transactions", toKill.size()); for (GlobalTransaction gtx : toKill) { if (partitionHandlingManager.canRollbackTransactionAfterOriginatorLeave(gtx)) { log.debugf("Rolling back transaction %s because originator %s left the cluster", gtx, gtx.getAddress()); killTransaction(gtx); } else { log.debugf("Keeping transaction %s after the originator %s left the cluster.", gtx, gtx.getAddress()); } } if (trace) log.tracef("Completed cleaning transactions originating on leavers. Remote transactions remaining: %d", remoteTransactions.size()); } } catch (Throwable t) { log.unableToRollbackGlobalTx(null, t); } }

Target:
public void cleanupLeaverTransactions(List<Address> members) { if (remoteTransactions == null) return; try { if (trace) log.tracef("Checking for transactions originated on leavers. Current cache members are %s, remote transactions: %d", members, remoteTransactions.size()); HashSet<Address> membersSet = new HashSet<>(members); List<GlobalTransaction> toKill = new ArrayList<>(); for (Map.Entry<GlobalTransaction, RemoteTransaction> e : remoteTransactions.entrySet()) { GlobalTransaction gt = e.getKey(); if (trace) log.tracef("Checking transaction %s", gt); if (!membersSet.contains(gt.getAddress())) { toKill.add(gt); } } if (toKill.isEmpty()) { if (trace) log.tracef("No remote transactions pertain to originator(s) who have left the cluster."); } else { log.debugf("The originating node left the cluster for %d remote transactions", toKill.size()); for (GlobalTransaction gtx : toKill) { if (partitionHandlingManager.canRollbackTransactionAfterOriginatorLeave(gtx)) { log.debugf("Rolling back transaction %s because originator %s left the cluster", gtx, gtx.getAddress()); killTransaction(gtx); } else { log.debugf("Keeping transaction %s after the originator %s left the cluster.", gtx, gtx.getAddress()); } } if (trace) log.tracef("Completed cleaning transactions originating on leavers. Remote transactions remaining: %d", remoteTransactions.size()); } } catch (Throwable t) { log.unableToRollbackGlobalTx(null, t); } }
Source:
private boolean isFileEncrypted(AbstractFile file) throws ReadContentInputStreamException, IOException, TskCoreException { boolean possiblyEncrypted = false; if (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.LOCAL_DIR) && (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK) || slackFilesAllowed)) { if (!file.getKnown().equals(TskData.FileKnown.KNOWN)) { long contentSize = file.getSize(); if (contentSize >= minimumFileSize) { if (!fileSizeMultipleEnforced || (contentSize % FILE_SIZE_MODULUS) == 0) { String mimeType = fileTypeDetector.getMIMEType(file); if (mimeType.equals("application/octet-stream")) { possiblyEncrypted = true; } } } } } if (possiblyEncrypted) { try { calculatedEntropy = calculateEntropy(file); if (calculatedEntropy >= minimumEntropy) { return true; } } catch (ReadContentInputStreamException ex) { throw new ReadContentInputStreamException("Unable to calculate the entropy.", ex); } catch (IOException ex) { throw new IOException("Unable to calculate the entropy.", ex); } } return false; }

Target:
private boolean isFileEncrypted(AbstractFile file) throws ReadContentInputStreamException, IOException, TskCoreException { boolean possiblyEncrypted = false; if (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNALLOC_BLOCKS) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.UNUSED_BLOCKS) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.VIRTUAL_DIR) && !file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.LOCAL_DIR) && (!file.getType().equals(TskData.TSK_DB_FILES_TYPE_ENUM.SLACK) || slackFilesAllowed)) { if (!file.getKnown().equals(TskData.FileKnown.KNOWN)) { long contentSize = file.getSize(); if (contentSize >= minimumFileSize) { if (!fileSizeMultipleEnforced || (contentSize % FILE_SIZE_MODULUS) == 0) { String mimeType = fileTypeDetector.getMIMEType(file); if (mimeType.equals("application/octet-stream")) { possiblyEncrypted = true; } } } } } if (possiblyEncrypted) { calculatedEntropy = calculateEntropy(file); if (calculatedEntropy >= minimumEntropy) { return true; } } return false; }
Source:
protected String composeRequestUrl(Args args) throws ClientServicesException { StringBuilder b = new StringBuilder(256); String url = ""; if(!(UrlUtil.isAbsoluteUrl(args.getServiceUrl()))){ url = getUrlPath(args); if (url.charAt(url.length() - 1) == '/') { url = url.substring(0, url.length() - 1); } b.append(url); addUrlParts(b, args); }else{ b.append(args.getServiceUrl()); } addUrlParameters(b, args); return b.toString(); }

Target:
protected String composeRequestUrl(Args args) throws ClientServicesException { StringBuilder b = new StringBuilder(256); if(!(UrlUtil.isAbsoluteUrl(args.getServiceUrl()))){ String url = getUrlPath(args); if (url.charAt(url.length() - 1) == '/') { url = url.substring(0, url.length() - 1); } b.append(url); addUrlParts(b, args); }else{ b.append(args.getServiceUrl()); } addUrlParameters(b, args); return b.toString(); }
Source:
public String[] getKeys() { List<String> names = new ArrayList<>(); for (Ban.Profile ban: Sponge.getServiceManager().provideUnchecked(BanService.class).getProfileBans()) { names.add(ban.getProfile().getName().get()); } return names.toArray(new String[names.size()]); }

Target:
public String[] getKeys() { List<String> names = new ArrayList<>(); for (Ban.Profile ban: Sponge.getServiceManager().provideUnchecked(BanService.class).getProfileBans()) { if (ban.getProfile().getName().isPresent()) { names.add(ban.getProfile().getName().get()); } } return names.toArray(new String[names.size()]); }
Source:
public boolean supports(PortalEvent event) { boolean postEvent = false; for (Class<?> cls : supportedEventTypes) { postEvent |= cls.isAssignableFrom(event.getClass()); } if (postEvent && filterFNames != null) { PortletExecutionEvent execEvent = (PortletExecutionEvent)event; boolean foundFName = false; for (String fname : filterFNames) { if (fname != null && fname.equalsIgnoreCase(execEvent.getFname())) { foundFName = true; } } postEvent = fnameFilterType == FNameFilterType.Whitelist ? foundFName : !foundFName; } return postEvent; }

Target:
public boolean supports(PortalEvent event) { boolean postEvent = false; for (Class<?> cls : supportedEventTypes) { if (cls.isAssignableFrom(event.getClass())) { postEvent = true; break; } } if (postEvent && filterFNames != null) { PortletExecutionEvent execEvent = (PortletExecutionEvent)event; boolean foundFName = false; for (String fname : filterFNames) { if (fname != null && fname.equalsIgnoreCase(execEvent.getFname())) { foundFName = true; break; } } postEvent = fnameFilterType == FNameFilterType.Whitelist ? foundFName : !foundFName; } return postEvent; }
Source:
void addToCache(String blobKey, short lifeVersion, BlobState blobState) { if (isVcr) { if (blobState == BlobState.TTL_UPDATED) { if (recentBlobCache.containsKey(blobKey)) { lifeVersion = (lifeVersion > recentBlobCache.get(blobKey).getLifeVersion()) ? lifeVersion : recentBlobCache.get(blobKey).getLifeVersion(); } } recentBlobCache.put(blobKey, new BlobLifeState(blobState, lifeVersion, recentBlobCache.get(blobKey))); } }

Target:
void addToCache(String blobKey, short lifeVersion, BlobState blobState) { if (isVcr) { if (blobState == BlobState.TTL_UPDATED) { if (recentBlobCache.containsKey(blobKey)) { lifeVersion = (short) Math.max(lifeVersion, recentBlobCache.get(blobKey).getLifeVersion()); } } recentBlobCache.put(blobKey, new BlobLifeState(blobState, lifeVersion, recentBlobCache.get(blobKey))); } }
Source:
private CacheParams(String cacheKey, Optional<Integer> timeToLive) { this.cacheKey = Preconditions.checkNotNull(cacheKey); this.timeToLive = timeToLive; }

Target:
private CacheParams(String cacheKey, Optional<Integer> timeToLive) { this.cacheKey = Preconditions.checkNotNull(cacheKey); this.timeToLive = Preconditions.checkNotNull(timeToLive); }
Source:
public void evaluate_shouldReturnAvalidCCCNumber() throws Exception{ MohUniquePatientNumberRule mohUniquePatientNumberRule = new MohUniquePatientNumberRule(); PatientService patientService = Context.getPatientService(); Patient patient1 = patientService.getPatient(6); AdministrationService ams = Context.getAdministrationService(); PatientIdentifierType cccnotype = new PatientIdentifierType(); cccnotype.setName("CCC Number"); cccnotype.setDescription("A unique number generated by clinics"); patientService.savePatientIdentifierType(cccnotype); GlobalProperty globalProperty = new GlobalProperty(); globalProperty.setProperty("mflgenerator.mfl"); globalProperty.setDescription("A unique patient Number generated by Clinics"); globalProperty.setPropertyValue("CCC Number"); ams.saveGlobalProperty(globalProperty); PatientIdentifierType pit = MohCacheUtils.getPatientIdentifierType(ams.getGlobalProperty("mflgenerator.mfl")); Location location = Context.getLocationService().getLocation(1); PatientIdentifier pi = new PatientIdentifier("11740-00001", pit, location); patient1.addIdentifier(pi); patientService.savePatient(patient1); Context.flushSession(); Result result1 = mohUniquePatientNumberRule.evaluate(null, patient1.getId(), null); Result expectedResult1 = new Result("11740-00001"); Assert.assertEquals("The two identifiers are not equal",expectedResult1.toString(),result1.toString()); }

Target:
public void evaluate_shouldReturnAvalidCCCNumber() throws Exception{ MohUniquePatientNumberRule mohUniquePatientNumberRule = new MohUniquePatientNumberRule(); PatientService patientService = Context.getPatientService(); Patient patient1 = patientService.getPatient(8); AdministrationService ams = Context.getAdministrationService(); PatientIdentifierType cccnotype = new PatientIdentifierType(); cccnotype.setName("CCC Number"); cccnotype.setDescription("A unique number generated by clinics"); patientService.savePatientIdentifierType(cccnotype); GlobalProperty globalProperty = new GlobalProperty(); globalProperty.setProperty("cccgenerator.CCC"); globalProperty.setDescription("A unique patient Number generated by Clinics"); globalProperty.setPropertyValue("CCC Number"); ams.saveGlobalProperty(globalProperty); Context.flushSession(); String savedProperty = ams.getGlobalProperty("cccgenerator.CCC"); PatientIdentifierType pit = MohCacheUtils.getPatientIdentifierType(Context.getAdministrationService().getGlobalProperty("cccgenerator.CCC")); Location location = Context.getLocationService().getLocation(1); PatientIdentifier pi = new PatientIdentifier("11740-00001", pit, location); patient1.addIdentifier(pi); patientService.savePatient(patient1); Context.flushSession(); Result result1 = mohUniquePatientNumberRule.evaluate(null, patient1.getId(), null); Result expectedResult1 = new Result("11740-00001"); Assert.assertEquals("The two identifiers are not equal",expectedResult1,result1); }
Source:
public ActiveDirectoryUnixAuthenticationProvider(ActiveDirectorySecurityRealm realm) { if (realm.domain==null) throw new IllegalArgumentException("Active Directory domain name is required but it is not set"); this.domainNames = realm.domain.split(","); this.site = realm.site; this.bindName = realm.bindName; this.server = realm.server; this.bindPassword = Secret.toString(realm.bindPassword); this.groupLookupStrategy = realm.getGroupLookupStrategy(); this.descriptor = realm.getDescriptor(); this.cache = realm.cache; if (cache == null) { this.cache = new CacheConfiguration(0, 0); } if (cache.getUserCache() == null || cache.getGroupCache() == null) { this.cache = new CacheConfiguration(cache.getSize(), cache.getTtl()); } this.userCache = cache.getUserCache(); this.groupCache = cache.getGroupCache(); this.ldapConnectTimeout = realm.ldapConnectTimeout; this.ldapReadTimeout = realm.ldapReadTimeout; if (ldapConnectTimeout == null || ldapConnectTimeout.isEmpty()) { System.setProperty("com.sun.jndi.ldap.connect.timeout", Long.toString(DEFAULT_LDAP_CONNECTION_TIMEOUT)); } else { System.setProperty("com.sun.jndi.ldap.connect.timeout", ldapConnectTimeout); } if (ldapReadTimeout == null || ldapReadTimeout.isEmpty()) { System.setProperty("com.sun.jndi.ldap.read.timeout", Long.toString(DEFAULT_LDAP_READ_TIMEOUT)); } else { System.setProperty("com.sun.jndi.ldap.read.timeout", ldapReadTimeout); } }

Target:
public ActiveDirectoryUnixAuthenticationProvider(ActiveDirectorySecurityRealm realm) { if (realm.domain==null) throw new IllegalArgumentException("Active Directory domain name is required but it is not set"); this.domainNames = realm.domain.split(","); this.site = realm.site; this.bindName = realm.bindName; this.server = realm.server; this.bindPassword = Secret.toString(realm.bindPassword); this.groupLookupStrategy = realm.getGroupLookupStrategy(); this.descriptor = realm.getDescriptor(); this.cache = realm.cache; if (cache == null) { this.cache = new CacheConfiguration(0, 0); } if (cache.getUserCache() == null || cache.getGroupCache() == null) { this.cache = new CacheConfiguration(cache.getSize(), cache.getTtl()); } this.userCache = cache.getUserCache(); this.groupCache = cache.getGroupCache(); Map<String, String> extraEnvVarsMap = ActiveDirectorySecurityRealm.EnvironmentProperty.toMap(realm.environmentProperties); props.put(LDAP_READ_TIMEOUT, System.getProperty(LDAP_READ_TIMEOUT, DEFAULT_LDAP_READ_TIMEOUT)); props.putAll(extraEnvVarsMap); }
Source:
public static String toSlug(String input, boolean urlEncodeNonNormalizableCharacter) { if(input == null || input.isEmpty()) return ""; String nonLatinPattern = urlEncodeNonNormalizableCharacter ? "[^\\P{M}]" : "[^\\w-]"; Pattern NONLATIN = Pattern.compile(nonLatinPattern); Pattern WHITESPACE = Pattern.compile("[\\s]"); String nowhitespace = WHITESPACE.matcher(input).replaceAll("-"); String normalized = Normalizer.normalize(nowhitespace, Form.NFD); String slug = NONLATIN.matcher(normalized).replaceAll(""); if (urlEncodeNonNormalizableCharacter) { try { slug = URLEncoder.encode(slug, "UTF-8"); } catch (UnsupportedEncodingException e) { } } return slug.toLowerCase(Locale.ENGLISH); }

Target:
public static String toSlug(String input, boolean urlEncodeNonNormalizableCharacter) { if(input == null || input.isEmpty()) return ""; String nonLatinPattern = urlEncodeNonNormalizableCharacter ? "[^\\P{M}]" : "[^\\w-]"; Pattern NONLATIN = Pattern.compile(nonLatinPattern); Pattern WHITESPACE = Pattern.compile("[\\s]"); String nowhitespace = WHITESPACE.matcher(input).replaceAll("-"); String normalized = Normalizer.normalize(nowhitespace, Form.NFD); String slug = NONLATIN.matcher(normalized).replaceAll(""); if (urlEncodeNonNormalizableCharacter) { try { slug = URLEncoder.encode(slug, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } } return slug.toLowerCase(Locale.ENGLISH); }
Source:
public Collection<CallStackSeries> getCallStackSeries() { Collection<CallStackSeries> callstacks = fCallStacks; if (callstacks == null) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Objects.requireNonNull(Collections.emptyList()); } callstacks = Collections.singleton(new CallStackSeries(ss, PATTERNS, 0, "", getHostId(), new CallStackSeries.AttributeValueThreadResolver(1))); fCallStacks = callstacks; } return callstacks; }

Target:
public Collection<CallStackSeries> getCallStackSeries() { Collection<CallStackSeries> callstacks = fCallStacks; if (callstacks == null) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return Collections.emptyList(); } callstacks = Collections.singleton(new CallStackSeries(ss, PATTERNS, 0, "", getHostId(), new CallStackSeries.AttributeValueThreadResolver(1))); fCallStacks = callstacks; } return callstacks; }
Source:
public ScaleGestureDetector(Context context, SimpleOnScaleGestureListener simpleOnScaleGestureListener) { try { Class.forName("android.view.ScaleGestureDetector"); Class<?> classRealScaleGestureDetector = Class.forName("com.jjoe64.graphview.compatible.RealScaleGestureDetector"); method_getScaleFactor = classRealScaleGestureDetector.getMethod("getScaleFactor"); method_isInProgress = classRealScaleGestureDetector.getMethod("isInProgress"); method_onTouchEvent = classRealScaleGestureDetector.getMethod("onTouchEvent", MotionEvent.class); Constructor<?> constructor = classRealScaleGestureDetector.getConstructor(Context.class, getClass(), SimpleOnScaleGestureListener.class); realScaleGestureDetector = constructor.newInstance(context, this, simpleOnScaleGestureListener); } catch (Exception e) { e.printStackTrace(); } }

Target:
public ScaleGestureDetector(Context context, SimpleOnScaleGestureListener simpleOnScaleGestureListener) { try { Class.forName("android.view.ScaleGestureDetector"); Class<?> classRealScaleGestureDetector = Class.forName("com.jjoe64.graphview.compatible.RealScaleGestureDetector"); method_getScaleFactor = classRealScaleGestureDetector.getMethod("getScaleFactor"); method_isInProgress = classRealScaleGestureDetector.getMethod("isInProgress"); method_onTouchEvent = classRealScaleGestureDetector.getMethod("onTouchEvent", MotionEvent.class); Constructor<?> constructor = classRealScaleGestureDetector.getConstructor(Context.class, getClass(), SimpleOnScaleGestureListener.class); realScaleGestureDetector = constructor.newInstance(context, this, simpleOnScaleGestureListener); } catch (Exception e) { Log.w("com.jjoe64.graphview", "*** WARNING *** No scaling available for graphs. Exception:"); e.printStackTrace(); } }
Source:
private void testRcTextCharDecoding(boolean rcFileOptimizedWriterEnabled, boolean rcFileOptimizedReaderEnabled) throws Exception { String catalog = getSession().getCatalog().get(); Session session = Session.builder(getSession()) .setCatalogSessionProperty(catalog, RCFILE_OPTIMIZED_WRITER_ENABLED, "" + rcFileOptimizedWriterEnabled) .setCatalogSessionProperty(catalog, RCFILE_OPTIMIZED_READER_ENABLED, "" + rcFileOptimizedReaderEnabled) .build(); assertUpdate(session, "CREATE TABLE test_table_with_char WITH (format = 'RCTEXT') AS SELECT CAST('khaki' AS CHAR(7)) char_column", 1); assertQuery(session, "SELECT * FROM test_table_with_char WHERE char_column = 'khaki '", "VALUES (CAST('khaki' AS CHAR(7)))"); assertUpdate(session, "DROP TABLE test_table_with_char"); }

Target:
private void testRcTextCharDecoding(boolean rcFileOptimizedWriterEnabled, boolean rcFileOptimizedReaderEnabled) throws Exception { String catalog = getSession().getCatalog().get(); Session session = Session.builder(getSession()) .setCatalogSessionProperty(catalog, RCFILE_OPTIMIZED_WRITER_ENABLED, Boolean.toString(rcFileOptimizedWriterEnabled)) .setCatalogSessionProperty(catalog, RCFILE_OPTIMIZED_READER_ENABLED, Boolean.toString(rcFileOptimizedReaderEnabled)) .build(); assertUpdate(session, "CREATE TABLE test_table_with_char WITH (format = 'RCTEXT') AS SELECT CAST('khaki' AS CHAR(7)) char_column", 1); try { assertQuery(session, "SELECT * FROM test_table_with_char WHERE char_column = 'khaki '", "VALUES (CAST('khaki' AS CHAR(7)))"); } finally { assertUpdate(session, "DROP TABLE test_table_with_char"); } }
Source:
private void logExceptionBeforeFailOver(Exception ex, MessageHandler handler, Message<?> message) { if (this.logger.isInfoEnabled()) { this.logger.info("An exception was thrown by '" + handler + "' while handling '" + message + "': " + ex.getMessage() + ". Failing over to the next subscriber."); } else if (this.logger.isDebugEnabled()) { this.logger.debug("An exception was thrown by '" + handler + "' while handling '" + message + "'. Failing over to the next subscriber.", ex); } }

Target:
private void logExceptionBeforeFailOver(Exception ex, MessageHandler handler, Message<?> message) { if (this.logger.isDebugEnabled()) { this.logger.debug("An exception was thrown by '" + handler + "' while handling '" + message + "'. Failing over to the next subscriber.", ex); } else if (this.logger.isInfoEnabled()) { this.logger.info("An exception was thrown by '" + handler + "' while handling '" + message + "': " + ex.getMessage() + ". Failing over to the next subscriber."); } }
Source:
private static void testTriggerDatabaseBackup() throws MambuApiException { DatabaseService databaseService = MambuAPIFactory.getDatabaseService(); DatabaseBackupRequest databaseRequestObject = new DatabaseBackupRequest(); databaseRequestObject.setCallback("<LINK_0>"); DatabaseBackupResponse response = databaseService.createDatabaseBackup(databaseRequestObject); System.out.println(response); }

Target:
private static void testTriggerDatabaseBackup() throws MambuApiException { System.out.println(methodName = "\nIn testTriggerDatabaseBackup"); DatabaseService databaseService = MambuAPIFactory.getDatabaseService(); DatabaseBackupRequest databaseRequestObject = new DatabaseBackupRequest(); databaseRequestObject.setCallback("<LINK_0>"); DatabaseBackupResponse response = databaseService.createDatabaseBackup(databaseRequestObject); System.out.println("Database request Response:\n" + response); }
Source:
public HitPolicy getHitPolicy() { return hitPolicy == null ? HitPolicy.NONE : hitPolicy; }

Target:
public HitPolicy getHitPolicy() { return hitPolicy == null ? HitPolicy.getDefault(): hitPolicy; }
Source:
public void updatePhysics(GlowBlock block) { Byte initalData = block.getState().getRawData(); if (isStationary(block.getType())) { block.setType(getOpposite(block.getType()), block.getData(), false); } if (Byte.compare(block.getState().getRawData(), STRENGTH_SOURCE) != 0) { BlockFace[] faces = {UP, NORTH, EAST, SOUTH, WEST}; boolean connected = false; int count = 0; for (BlockFace face : faces) { if (block.getRelative(face).getType() == block.getType()) { if (count < 2 && face != UP && Byte.compare(block.getRelative(face).getState().getRawData(), STRENGTH_SOURCE) == 0) { count++; } if (!connected && face == UP || Byte.compare(block.getRelative(face).getState().getRawData(), block.getState().getRawData()) < 0) { connected = true; if (block.getWorld().getServer().getClassicWater()) { block.getState().setRawData(STRENGTH_SOURCE); } } if (block.getWorld().getServer().getClassicWater() && Byte.compare(block.getRelative(face).getState().getRawData(), STRENGTH_SOURCE) == 0) { block.getRelative(face).setType(Material.AIR); } } } if (!connected) { block.setType(Material.AIR); return; } if (count == 2) { block.getState().setRawData(STRENGTH_SOURCE); return; } } if (!(Byte.compare(block.getState().getRawData(), isWater(block.getType()) || block.getBiome() == Biome.HELL ? STRENGTH_MIN_WATER : STRENGTH_MIN_LAVA) == 0) || block.getRelative(DOWN).getType() == Material.AIR) { calculateFlow(block); } if (initalData != block.getState().getRawData()) { block.getWorld().requestSinglePulse(block, isWater(block.getType()) || block.getBiome() == Biome.HELL ? TICK_RATE_WATER : TICK_RATE_LAVA); } }

Target:
public void updatePhysics(GlowBlock block) { if (isStationary(block.getType())) { block.setType(getOpposite(block.getType()), block.getData(), false); } if (Byte.compare(block.getState().getRawData(), STRENGTH_SOURCE) != 0) { BlockFace[] faces = {UP, NORTH, EAST, SOUTH, WEST}; boolean connected = false; int count = 0; for (BlockFace face : faces) { if (block.getRelative(face).getType() == block.getType()) { if (count < 2 && face != UP && Byte.compare(block.getRelative(face).getState().getRawData(), STRENGTH_SOURCE) == 0) { count++; } if (!connected && face == UP || Byte.compare(block.getRelative(face).getState().getRawData(), block.getState().getRawData()) < 0) { connected = true; if (block.getWorld().getServer().getClassicWater()) { block.getState().setRawData(STRENGTH_SOURCE); } } if (block.getWorld().getServer().getClassicWater() && Byte.compare(block.getRelative(face).getState().getRawData(), STRENGTH_SOURCE) == 0) { block.getRelative(face).setType(Material.AIR); } } } if (!connected) { block.setType(Material.AIR); return; } if (count == 2) { block.getState().setRawData(STRENGTH_SOURCE); return; } } if (!(Byte.compare(block.getState().getRawData(), isWater(block.getType()) || block.getBiome() == Biome.HELL ? STRENGTH_MIN_WATER : STRENGTH_MIN_LAVA) == 0) || block.getRelative(DOWN).getType() == Material.AIR) { calculateFlow(block); } }
Source:
private void checkTimeoutDecreaseProcFailed(boolean sync, Client client, String procName, Object...params) throws IOException, ProcCallException, InterruptedException { checkDeploymentPropertyValue(client, "querytimeout", Integer.toString(TIMEOUT_NORMAL)); try { client.callProcedure(procName, params); } catch (Exception ex) { fail(procName + " is supposed to succeed, but failed with message " + ex.getMessage()); } checkDeploymentPropertyValue(client, "querytimeout", Integer.toString(TIMEOUT_NORMAL)); if (sync) { try { client.callProcedureWithTimeout(TIMEOUT_SHORT, procName, params); fail(procName + PROMPTMSG); } catch (Exception ex) { assertTrue(ex.toString() + " did not contain " + ERRORMSG, ex.getMessage().contains(ERRORMSG)); } } else { client.callProcedureWithTimeout(m_callback, TIMEOUT_SHORT, procName, params); client.drain(); checkCallbackTimeoutError(ERRORMSG);; } checkDeploymentPropertyValue(client, "querytimeout", Integer.toString(TIMEOUT_NORMAL)); try { client.callProcedure(procName, params); } catch (Exception ex) { fail(procName + " is supposed to succeed, but failed with message " + ex.getMessage() + "\n"); ex.printStackTrace(); } checkDeploymentPropertyValue(client, "querytimeout", Integer.toString(TIMEOUT_NORMAL)); }

Target:
private void checkTimeoutDecreaseProcFailed(boolean sync, Client client, String procName, Object...params) throws IOException, ProcCallException, InterruptedException { checkDeploymentPropertyValue(client, "querytimeout", Integer.toString(TIMEOUT_NORMAL)); try { client.callProcedure(procName, params); } catch (Exception ex) { fail(procName + " is supposed to succeed, but failed with message " + ex.getMessage()); } checkDeploymentPropertyValue(client, "querytimeout", Integer.toString(TIMEOUT_NORMAL)); if (sync) { try { client.callProcedureWithTimeout(TIMEOUT_SHORT, procName, params); fail(procName + PROMPTMSG); } catch (Exception ex) { assertTrue(ex.toString() + " did not contain " + ERRORMSG, ex.getMessage().contains(ERRORMSG)); } } else { client.callProcedureWithTimeout(m_callback, TIMEOUT_SHORT, procName, params); client.drain(); checkCallbackTimeoutError(ERRORMSG);; } checkDeploymentPropertyValue(client, "querytimeout", Integer.toString(TIMEOUT_NORMAL)); try { client.callProcedure(procName, params); } catch (Exception ex) { fail(procName + " is supposed to succeed, but failed with message " + ex.getMessage() + "\n"); } checkDeploymentPropertyValue(client, "querytimeout", Integer.toString(TIMEOUT_NORMAL)); }
Source:
public void setAsyncExecutor(Executor executor) { if (executor == null && logger.isWarnEnabled()) { logger.warn("A null executor disables the async gateway; methods returning Future<?> will run on the calling thread"); } this.asyncExecutor = (executor instanceof AsyncTaskExecutor || executor == null) ? (AsyncTaskExecutor) executor : new TaskExecutorAdapter(executor); }

Target:
public void setAsyncExecutor(Executor executor) { if (executor == null && logger.isInfoEnabled()) { logger.info("A null executor disables the async gateway; methods returning Future<?> will run on the calling thread"); } this.asyncExecutor = (executor instanceof AsyncTaskExecutor || executor == null) ? (AsyncTaskExecutor) executor : new TaskExecutorAdapter(executor); }
Source:
protected Map<String, String>[] BuildStructFromConnectionListObject() { final StoragePool storage_pool = DbFacade.getInstance().getStoragePoolDao().getForVds(getParameters().getVdsId()); final Map<String, String>[] result = new HashMap[getParameters().getConnectionList().size()]; int i = 0; for (StorageServerConnections connection : getParameters().getConnectionList()) { result[i] = CreateStructFromConnection(connection, storage_pool); i++; } return result; }

Target:
protected Map<String, String>[] BuildStructFromConnectionListObject() { final StoragePool storagePool = DbFacade.getInstance().getStoragePoolDao().getForVds(getParameters().getVdsId()); final Map<String, String>[] result = new HashMap[getParameters().getConnectionList().size()]; int i = 0; for (StorageServerConnections connection : getParameters().getConnectionList()) { result[i] = CreateStructFromConnection(connection, storagePool); i++; } return result; }
Source:
public String formatRate(int energy) { return String.format("%.0f %s/t", energy * factor, energyName); }

Target:
public String formatRate(int energy) { String amountString = formatEnergyNum(energy); return String.format("%s %s/t", amountString, energyName); }
Source:
public boolean isStackChecked(String workspaceName) { String attrValue = redrawUiElementsTimeout .until( visibilityOfElementLocated( By.xpath(format(Locators.STACK_ITEM_CHECKBOX_XPATH_PATTERN, workspaceName)))) .getAttribute("aria-checked"); return Boolean.parseBoolean(attrValue); }

Target:
public boolean isStackChecked(String workspaceName) { String attrValue = seleniumWebDriverHelper.waitVisibilityAndGetAttribute( By.xpath(format(Locators.STACK_ITEM_CHECKBOX_XPATH_PATTERN, workspaceName)), "aria-checked"); return Boolean.parseBoolean(attrValue); }
Source:
public void wrongValueTypeThrowsException() throws IllegalAccessException, InstantiationException { final Store kvStore = factory.newStore( new StoreConfigurationImpl<K, V>(factory.getKeyType(), factory.getValueType(), ClassLoader.getSystemClassLoader())); K key = factory.getKeyType().newInstance(); try { if (this.factory.getKeyType() == String.class) { kvStore.remove(key, 1.0f); } else { kvStore.remove(key, "value"); } throw new AssertionError("Expected ClassCastException because the value is of the wrong type"); } catch (ClassCastException e) { } catch (CacheAccessException e) { System.err.println("Warning, an exception is thrown due to the SPI test"); e.printStackTrace(); } }

Target:
public void wrongValueTypeThrowsException() throws IllegalAccessException, InstantiationException { final Store kvStore = factory.newStore( new StoreConfigurationImpl<K, V>(factory.getKeyType(), factory.getValueType(), ClassLoader.getSystemClassLoader())); K key = factory.getKeyType().newInstance(); try { if (this.factory.getValueType() == String.class) { kvStore.remove(key, 1.0f); } else { kvStore.remove(key, "value"); } throw new AssertionError("Expected ClassCastException because the value is of the wrong type"); } catch (ClassCastException e) { } catch (CacheAccessException e) { System.err.println("Warning, an exception is thrown due to the SPI test"); e.printStackTrace(); } }
Source:
protected ProjectAssetsQuery createProjectQuery(String filter, String filterType, int startIndex, int amount) { List<String> suffixes = Collections.EMPTY_LIST; Category category = getCategory(filterType); if (category != null) { suffixes = this.getSuffixes(category); } return new ProjectAssetsQuery(libraryPlaces.getProjectInfo().getProject(), filter, startIndex, amount, suffixes); }

Target:
protected ProjectAssetsQuery createProjectQuery(String filter, String filterType, int startIndex, int amount) { Category category = categoriesManagerCache.getCategory(filterType); List<String> suffixes = this.getSuffixes(category); return new ProjectAssetsQuery(libraryPlaces.getActiveWorkspaceContext(), filter, startIndex, amount, suffixes); }
Source:
public void onPersonSelected(Person person) { FragmentManager fragmentManager = getFragmentManager(); PersonDetailFragment personDetailFragment = (PersonDetailFragment) fragmentManager.findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); long personID = person.getPersonID(); int localTableBlogID = person.getLocalTableBlogId(); if (personDetailFragment == null) { personDetailFragment = PersonDetailFragment.newInstance(personID, localTableBlogID); } else { personDetailFragment.setPersonDetails(personID, localTableBlogID); } if (!personDetailFragment.isAdded()) { FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.setCustomAnimations(R.animator.fragment_slide_in_from_right, R.animator.fragment_slide_out_to_left, R.animator.fragment_slide_in_from_left, R.animator.fragment_slide_out_to_right); fragmentTransaction.replace(R.id.fragment_container, personDetailFragment, KEY_PERSON_DETAIL_FRAGMENT); fragmentTransaction.addToBackStack(null); fragmentTransaction.commit(); } }

Target:
public void onPersonSelected(Person person) { FragmentManager fragmentManager = getFragmentManager(); PersonDetailFragment personDetailFragment = (PersonDetailFragment) fragmentManager .findFragmentByTag(KEY_PERSON_DETAIL_FRAGMENT); long personID = person.getPersonID(); int localTableBlogID = person.getLocalTableBlogId(); if (personDetailFragment == null) { personDetailFragment = PersonDetailFragment.newInstance(personID, localTableBlogID); } else { personDetailFragment.setPersonDetails(personID, localTableBlogID); } if (!personDetailFragment.isAdded()) { FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction(); fragmentTransaction.add(R.id.fragment_container, personDetailFragment, KEY_PERSON_DETAIL_FRAGMENT); fragmentTransaction.addToBackStack(null); fragmentTransaction.commit(); } }
Source:
public void testIterateWhilePresent() { assertEquals( asList(), Seq.iterateWhilePresent(null, i -> Optional.empty()).toList() ); assertEquals( asList(2), Seq.iterateWhilePresent(2, i -> Optional.empty()).toList() ); assertEquals( asList(2, 4, 16, 256, 65536), Seq.iterateWhilePresent(2, i -> i <= 256 ? Optional.of(i * i) : Optional.empty()).toList() ); }

Target:
public void testIterateWhilePresent() { assertThrows(NullPointerException.class, () -> Seq.iterateWhilePresent(null, i -> Optional.empty()).toList()); assertEquals( asList(2), Seq.iterateWhilePresent(2, i -> Optional.empty()).toList() ); assertEquals( asList(2, 4, 16, 256, 65536), Seq.iterateWhilePresent(2, i -> i <= 256 ? Optional.of(i * i) : Optional.empty()).toList() ); }
Source:
public void testDoWhileWhitespaceAround() throws Exception { final String[] expected = { "9:16: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), }; verify(checkConfig, getPath("InputWhitespaceAroundDoWhileWhitespaceAround.java"), expected); }

Target:
public void testDoWhileWhitespaceAround() throws Exception { final String[] expected = { "9:16: " + getCheckMessage(MSG_WS_NOT_FOLLOWED, "while"), }; verify(checkConfig, getPath("InputWhitespaceAroundDoWhile.java"), expected); }
Source:
public void clear() throws Exception { trigger.clear(window); }

Target:
void clear() throws Exception { trigger.clear(window); }
Source:
private Refreshable<Long> getIncrementingLongRefreshableThrowingOnSpecificValue(long badValue) { AtomicLong atomicLong = new AtomicLong(); PollingRefreshable<Long> pollingRefreshable = PollingRefreshable.createWithSpecificPoller( () -> { long newValue = atomicLong.incrementAndGet(); if (newValue == badValue) { throw new RuntimeException(badValue + " is illegal"); } return newValue; }, scheduler); return pollingRefreshable.getRefreshable(); }

Target:
private Refreshable<Long> getIncrementingLongRefreshableThrowingOnSpecificValue(long badValue) { AtomicLong atomicLong = new AtomicLong(); PollingRefreshable<Long> pollingRefreshable = PollingRefreshable.createWithSpecificPoller( () -> { long newValue = atomicLong.incrementAndGet(); if (newValue == badValue) { throw new RuntimeException(badValue + " is illegal"); } return newValue; }, REFRESH_INTERVAL, scheduler); return pollingRefreshable.getRefreshable(); }
Source:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append("TmfConstantTransform [ offset="); builder.append(new TmfNanoTimestamp(fOffset)); builder.append(" ]"); return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append("TmfConstantTransform [ offset = "); builder.append(fOffset); builder.append(" ]"); return builder.toString(); }
Source:
public void testVHTLocal() throws Exception { TestParams vhtConfig = new TestParams.Builder() .setInputInstances(200_000) .setSamplingSize(20_000) .setEvaluationInstances(200_000) .setClassifiedInstances(200_000) .setClassificationsCorrect(75f) .setKappaStat(0f) .setKappaTempStat(0f) .setCLIStringTemplate(TestParams.Templates.PREQEVAL_VHT_RANDOMTREE) .setResultFilePollTimeout(10) .setPrePollWait(10) .setTaskClassName(LocalDoTask.class.getName()) .build(); TestUtils.test(vhtConfig); }

Target:
public void testVHTLocal() throws Exception { TestParams vhtConfig = new TestParams.Builder() .inputInstances(200_000) .samplingSize(20_000) .evaluationInstances(200_000) .classifiedInstances(200_000) .classificationsCorrect(75f) .kappaStat(0f) .kappaTempStat(0f) .cliStringTemplate(TestParams.Templates.PREQEVAL_VHT_RANDOMTREE) .resultFilePollTimeout(10) .prePollWait(10) .taskClassName(LocalDoTask.class.getName()) .build(); TestUtils.test(vhtConfig); }
Source:
private void compareValues(String expandedContent, String expandedValue) throws Exception { Diff diff = new Diff(expandedContent, expandedValue); diff.overrideDifferenceListener(new DifferenceListener() { public int differenceFound(Difference diff) { if (allowWildcards && (diff.getId() == DifferenceEngine.TEXT_VALUE.getId() || diff.getId() == DifferenceEngine.ATTR_VALUE .getId())) { try { Tools.assertSimilar(diff.getControlNodeDetail().getValue(), diff.getTestNodeDetail().getValue(), '*'); } catch (ComparisonFailure e) { return Diff.RETURN_ACCEPT_DIFFERENCE; } return Diff.RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL; } return Diff.RETURN_ACCEPT_DIFFERENCE; } public void skippedComparison(Node arg0, Node arg1) { } }); if (!diff.identical()) { throw new Exception(diff.toString()); } }

Target:
private void compareValues(String expandedContent, String expandedValue) throws Exception { Diff diff = new Diff(expandedContent, expandedValue); diff.overrideDifferenceListener(new DifferenceListener() { public int differenceFound(Difference diff) { if (allowWildcards && (diff.getId() == DifferenceEngine.TEXT_VALUE.getId() || diff.getId() == DifferenceEngine.ATTR_VALUE .getId())) { try { Tools.assertSimilar(diff.getControlNodeDetail().getValue(), diff.getTestNodeDetail().getValue(), '*'); return Diff.RETURN_IGNORE_DIFFERENCE_NODES_IDENTICAL; } catch (ComparisonFailure e) { return Diff.RETURN_ACCEPT_DIFFERENCE; } } return Diff.RETURN_ACCEPT_DIFFERENCE; } public void skippedComparison(Node arg0, Node arg1) { } }); if (!diff.identical()) { throw new Exception(diff.toString()); } }
Source:
public void writeFormattedMessageLine(String format, Object... args) { super.writeFormattedMessageLine(format, args); if (LOG.isDebugEnabled()) { LOG.debug("writeFormattedMessageLine, the format: " + format); int i = 0; for (Object arg : args) { LOG.debug("writeFormattedMessageLine, the " + i + " arg is " + arg.toString()); i++; } } }

Target:
public void writeFormattedMessageLine(String format, Object... args) { super.writeFormattedMessageLine(format, args); debugWriteFormattedMessageLine(format, args); }
Source:
protected void render0(FunctionRenderContext context) { Object[] jsonPathElements = new Object[context.getArgumentsSize() - 2]; for (int i = 2; i < context.getArgumentsSize(); i++) { try { jsonPathElements[i - 2] = Integer.parseInt(JpqlFunctionUtil.unquoteSingleQuotes(context.getArgument(i))); } catch (NumberFormatException e) { jsonPathElements[i - 2] = JpqlFunctionUtil.unquoteSingleQuotes(context.getArgument(i)); } } context.addChunk("(select "); context.addChunk("json_merge_patch("); context.addArgument(0); context.addChunk(", concat('"); for (int i = 0; i < jsonPathElements.length; i++) { startJsonPathElement(context, jsonPathElements, i); } context.addChunk("', "); context.addChunk("temp.val"); context.addChunk(", '"); for (int i = jsonPathElements.length - 1; i >= 0; i--) { endJsonPathElement(context, jsonPathElements, i); } context.addChunk("'))"); context.addChunk(" from (values row("); context.addArgument(1); context.addChunk(")) temp(val))"); }

Target:
protected void render0(FunctionRenderContext context) { List<Object> jsonPathElements = AbstractJsonGetFunction.retrieveJsonPathElements(context, 2); context.addChunk("(select "); context.addChunk("case when lower(temp.val) = 'null' then json_set("); context.addArgument(0); context.addChunk(",'"); context.addChunk(AbstractJsonGetFunction.toJsonPath(jsonPathElements, jsonPathElements.size(), true)); context.addChunk("', null) else "); context.addChunk("json_merge_patch("); context.addArgument(0); context.addChunk(", concat('"); for (int i = 0; i < jsonPathElements.size(); i++) { startJsonPathElement(context, jsonPathElements, i); } context.addChunk("', "); context.addChunk("temp.val"); context.addChunk(", '"); for (int i = jsonPathElements.size() - 1; i >= 0; i--) { endJsonPathElement(context, jsonPathElements, i); } context.addChunk("')) end"); context.addChunk(" from (values row("); context.addArgument(1); context.addChunk(")) temp(val))"); }
Source:
private static ByteBuffer encodeElement(Element element) { if (element instanceof SequencedElement) { ByteBuffer buffer = ByteBuffer.allocate(SEQ_NUM_OFFSET + ELEMENT_PAYLOAD_OFFSET + element.getPayload().remaining()); buffer.putLong(((SequencedElement)element).getSequenceNumber()); buffer.putInt(element.getPayload().remaining()); buffer.put(element.getPayload()); buffer.flip(); return buffer; } ByteBuffer buffer = ByteBuffer.allocate(ELEMENT_PAYLOAD_OFFSET + element.getPayload().remaining()); buffer.putInt(element.getPayload().remaining()); buffer.put(element.getPayload()); buffer.flip(); return buffer; }

Target:
private static ByteBuffer encodeElement(Element element) { ByteBuffer buffer = null; if (element instanceof SequencedElement) { buffer = ByteBuffer.allocate(SEQ_NUM_OFFSET + ELEMENT_PAYLOAD_OFFSET + element.getPayload().remaining()); buffer.putLong(((SequencedElement)element).getSequenceNumber()); } else { buffer = ByteBuffer.allocate(ELEMENT_PAYLOAD_OFFSET + element.getPayload().remaining()); } buffer.putInt(element.getPayload().remaining()); buffer.put(element.getPayload()); buffer.flip(); return buffer; }
Source:
public void invalidateAll() throws InterruptedException, ExecutionException, TimeoutException, NetworkException { final int numPulls = 1000; final CountDownLatch countDownLatch = new CountDownLatch(1); final ExecutorService pool = Executors.newSingleThreadExecutor(); pool.submit(() -> { for (int pull = 0; pull < numPulls; ++pull) { parameterWorker.pull(0); parameterWorker.invalidateAll(); } countDownLatch.countDown(); }); pool.shutdown(); final boolean allThreadsFinished = countDownLatch.await(10, TimeUnit.SECONDS); parameterWorker.close(ParameterWorkerTestUtil.CLOSE_TIMEOUT); assertTrue(ParameterWorkerTestUtil.MSG_THREADS_SHOULD_FINISH, allThreadsFinished); verify(mockSender, times(numPulls)).sendPullMsg(anyString(), anyObject()); }

Target:
public void invalidateAll() throws InterruptedException, ExecutionException, TimeoutException, NetworkException { final int numPulls = 1000; final CountDownLatch countDownLatch = new CountDownLatch(1); final ExecutorService pool = Executors.newSingleThreadExecutor(); final SSPParameterWorker sspParameterWorker = (SSPParameterWorker) parameterWorker; pool.submit(() -> { for (int pull = 0; pull < numPulls; ++pull) { sspParameterWorker.pull(0); sspParameterWorker.invalidateAll(); } countDownLatch.countDown(); }); pool.shutdown(); final boolean allThreadsFinished = countDownLatch.await(10, TimeUnit.SECONDS); sspParameterWorker.close(ParameterWorkerTestUtil.CLOSE_TIMEOUT); assertTrue(ParameterWorkerTestUtil.MSG_THREADS_SHOULD_FINISH, allThreadsFinished); verify(mockSender, times(numPulls)).sendPullMsg(anyString(), anyObject()); }
Source:
public void waitUntilInstanceReady(final HttpClient client, final String host) { final StatusResponseHandler handler = StatusResponseHandler.getInstance(); RetryUtil.retryUntilTrue( () -> { try { StatusResponseHolder response = client.go( new Request(HttpMethod.GET, new URL(StringUtils.format("%s/status/health", host))), handler ).get(); LOG.info("%s %s", response.getStatus(), response.getContent()); return response.getStatus().equals(HttpResponseStatus.OK); } catch (Throwable e) { LOG.error(e, ""); return false; } }, "Waiting for instance to be ready: [" + host + "]" ); }

Target:
public void waitUntilInstanceReady(final HttpClient client, final String host) { RetryUtil.retryUntilTrue( () -> { try { StatusResponseHolder response = client.go( new Request(HttpMethod.GET, new URL(StringUtils.format("%s/status/health", host))), StatusResponseHandler.getInstance() ).get(); LOG.info("%s %s", response.getStatus(), response.getContent()); return response.getStatus().equals(HttpResponseStatus.OK); } catch (Throwable e) { LOG.error(e, ""); return false; } }, "Waiting for instance to be ready: [" + host + "]" ); }
Source:
public ViewBundle() { this(ImmutableList.copyOf(ServiceFinder.find(ViewRenderer.class))); }

Target:
public ViewBundle() { this(ServiceFinder.find(ViewRenderer.class)); }
Source:
public static List<Matrix> computeCovariances(Dataset<EmptyContext, GmmPartitionData> dataset, Vector clusterProbs, Vector[] means) { List<CovarianceMatricesAggregator> aggregators = dataset.compute( data -> map(data, means), CovarianceMatricesAggregator::reduce ); List<Matrix> res = new ArrayList<>(); for (int i = 0; i < aggregators.size(); i++) res.add(aggregators.get(i).covariance(clusterProbs.get(i))); return res; }

Target:
static List<Matrix> computeCovariances(Dataset<EmptyContext, GmmPartitionData> dataset, Vector clusterProbs, Vector[] means) { List<CovarianceMatricesAggregator> aggregators = dataset.compute( data -> map(data, means), CovarianceMatricesAggregator::reduce ); if (aggregators == null) return Collections.emptyList(); List<Matrix> res = new ArrayList<>(); for (int i = 0; i < aggregators.size(); i++) res.add(aggregators.get(i).covariance(clusterProbs.get(i))); return res; }
Source:
public StepUpdate(@Nullable Key<?> changedKey) { super(new Object[]{DynamicWizardStep.this, changedKey}); myChangedKey = changedKey; }

Target:
public StepUpdate(@Nullable Key<?> changedKey) { super(DynamicWizardStep.this); myChangedKey = changedKey; }
Source:
private void addRoleWidget(StringBuilder sb, IAtsWorkItem workItem, IAtsWidgetDefinition widget) { sb.append("Roles: "); Collection<String> roles = atsServer.getAttributeResolver().getAttributesToStringList(workItem, AtsAttributeTypes.Role); if (!roles.isEmpty()) { sb.append("<table border=\"1\" align=\"center\" width=\"90%\"><tr><th>Role</th><th>User</th><th>Completed</th><th>Hours Spent</th></tr>"); for (String xml : roles) { sb.append("<tr>"); for (String key : roleKeys) { sb.append("<td>"); String data = AXml.getTagData(xml, key); if (key.equals("userId")) { data = atsServer.getUserService().getUserById(data).getName(); } sb.append(data); sb.append("</td>"); } sb.append("</tr>"); } sb.append("</table>"); } }

Target:
private void addRoleWidget(StringBuilder sb, IAtsWorkItem workItem, IAtsWidgetDefinition widget) { sb.append("Roles: "); Collection<String> roles = atsServer.getAttributeResolver().getAttributesToStringList(workItem, AtsAttributeTypes.Role); if (!roles.isEmpty()) { sb.append(ROLE_TABLE_HEADER); for (String xml : roles) { sb.append("<tr>"); for (String key : roleKeys) { sb.append("<td>"); String data = AXml.getTagData(xml, key); if (key.equals("userId")) { data = atsServer.getUserService().getUserById(data).getName(); } sb.append(data); sb.append("</td>"); } sb.append("</tr>"); } sb.append("</table>"); } }