auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static void waitForQueryCount(DistributedQueryRunner queryRunner, Set<QueryState> countingStates, int expectedCount) throws InterruptedException { QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); while (queryManager.getAllQueryInfo().stream().filter(q -> countingStates.contains(q.getState())).count() != expectedCount) { MILLISECONDS.sleep(500); } }

Target:
public static void waitForQueryCount(DistributedQueryRunner queryRunner, Set<QueryState> countingStates, int expectedCount) throws InterruptedException { QueryManager queryManager = queryRunner.getCoordinator().getQueryManager(); while (queryManager.getAllQueryInfo().stream() .filter(q -> countingStates.contains(q.getState())).count() != expectedCount) { MILLISECONDS.sleep(500); } }
Source:
public ElasticHashinatorCleanerJRE9() { System.out.println("JAVA version " + ManagementFactory.getRuntimeMXBean().getSpecVersion()); try { createMtd = Class.forName("java.lang.ref.Cleaner").getMethod("create"); registerMtd = Class.forName("java.lang.ref.Cleaner").getMethod("register", Object.class, Runnable.class); } catch (ClassNotFoundException | NoSuchMethodException e) { throw new RuntimeException("Reflection failure: no java.lang.ref.Cleaner found", e); } }

Target:
public ElasticHashinatorCleanerJRE9() { try { Class<?> cleanerClass = Class.forName("java.lang.ref.Cleaner"); createMtd = cleanerClass.getMethod("create"); registerMtd = cleanerClass.getMethod("register", Object.class, Runnable.class); } catch (ClassNotFoundException | NoSuchMethodException e) { throw new RuntimeException("Reflection failure: no java.lang.ref.Cleaner found", e); } }
Source:
public T nextDataRecord(String key) { try { while (results.hasNext()) { JsonNode dataNode = results.next(); T t = dataNode.has(key) ? mapper.treeToValue(dataNode.get(key), resultClass) : null; return t; } } catch (IOException e) { throw new ResultProcessingException("Error processing results", e); } return null; }

Target:
T nextDataRecord(String key) { try { if (results.hasNext()) { JsonNode dataNode = results.next(); T t = dataNode.has(key) ? mapper.treeToValue(dataNode.get(key), resultClass) : null; return t; } } catch (IOException e) { throw new ResultProcessingException("Error processing results", e); } return null; }
Source:
private void browseDirectory(final LocalFileLocation dir) { if (dir.isRootDir()) { parentDirectory = dir.fullPath; } else { String rootPath = null; String path; for (LocalFileLocation fl : rootFileLocation) { path = fl.fullPath; if ((path != null) && (dir.fullPath != null) && (dir.fullPath.contentEquals(path))) { rootPath = fl.fullPath; break; } } if (rootPath != null) { parentDirectory = rootPath; dir.setRootDir(true); } else if (dir.fullPath != null) { parentDirectory = getParentDirectory(dir.fullPath); } } currentDirectory = dir; File[] files = (new File(dir.fullPath)).listFiles(); if (files == null) { Toast.makeText( getContext(), String.format(getString(R.string.error_getting_source_info), "listFiles() failed"), Toast.LENGTH_LONG); return; } Arrays.sort(files); ArrayList<LocalFileLocation> dir_list = new ArrayList<>(); ArrayList<LocalFileLocation> file_list = new ArrayList<>(); if (dir.hasParent) { parentDirectory = getParentDirectory(dir.fullPath); LocalFileLocation fl = new LocalFileLocation("..", parentDirectory, true); fl.setRootDir(dir.isRootDir()); dir_list.add(0, fl); } for (File file : files) { LocalFileLocation fl = new LocalFileLocation(file.getName(), file.getAbsolutePath(), file.isDirectory()); if (fl.isDirectory) { dir_list.add(fl); } else { file_list.add(fl); } } ArrayList<LocalFileLocation> full_list = new ArrayList<>(); full_list.addAll(dir_list); full_list.addAll(file_list); ((MediaPictureListAdapter) getAdapter()).setFilelistItems(full_list); browseRootAlready = false; }

Target:
private void browseDirectory(final LocalFileLocation dir) { if (dir.isRootDir()) { parentDirectory = dir.fullPath; } else { String rootPath = null; String path; for (LocalFileLocation fl : rootFileLocation) { path = fl.fullPath; if ((path != null) && (dir.fullPath != null) && (dir.fullPath.contentEquals(path))) { rootPath = fl.fullPath; break; } } if (rootPath != null) { parentDirectory = rootPath; dir.setRootDir(true); } else if (dir.fullPath != null) { parentDirectory = getParentDirectory(dir.fullPath); } } currentDirectory = dir; File[] files = (new File(dir.fullPath)).listFiles(); if (files == null) { Toast.makeText( getContext(), String.format(getString(R.string.error_getting_source_info), "listFiles() failed"), Toast.LENGTH_LONG).show(); return; } Arrays.sort(files); ArrayList<LocalFileLocation> dir_list = new ArrayList<>(); ArrayList<LocalFileLocation> file_list = new ArrayList<>(); if (dir.hasParent) { parentDirectory = getParentDirectory(dir.fullPath); LocalFileLocation fl = new LocalFileLocation("..", parentDirectory, true); fl.setRootDir(dir.isRootDir()); dir_list.add(0, fl); } for (File file : files) { LocalFileLocation fl = new LocalFileLocation(file.getName(), file.getAbsolutePath(), file.isDirectory()); if (fl.isDirectory) { dir_list.add(fl); } else { file_list.add(fl); } } ArrayList<LocalFileLocation> full_list = new ArrayList<>(); full_list.addAll(dir_list); full_list.addAll(file_list); ((MediaPictureListAdapter) getAdapter()).setFilelistItems(full_list); browseRootAlready = false; }
Source:
private PlanNodeCostEstimate calculateRemoteSourceNodeCost(RemoteSourceNode node, StatsProvider stats, TypeProvider types) { PlanNodeCostEstimate costEstimate = PlanNodeCostEstimate.ZERO_COST; for (PlanFragment fragment : sourceProvider.getSourceFragments(node)) { PartitioningHandle handle = fragment.getPartitioning(); ExchangeNode.Type exchangeType; if (handle.equals(FIXED_BROADCAST_DISTRIBUTION)) { exchangeType = REPLICATE; } else if (handle.equals(SINGLE_DISTRIBUTION)) { exchangeType = GATHER; } else { exchangeType = REPARTITION; } PlanNodeCostEstimate exchangeCost = calculateExchangeCost(numberOfNodes.getAsInt(), stats.getStats(node), node.getOutputSymbols(), exchangeType, REMOTE, types); costEstimate.add(exchangeCost); } return costEstimate; }

Target:
private PlanNodeCostEstimate calculateRemoteSourceNodeCost(RemoteSourceNode node, StatsProvider stats, TypeProvider types) { PlanNodeCostEstimate costEstimate = PlanNodeCostEstimate.ZERO_COST; ExchangeNode.Type exchangeType = node.getExchangeType(); for (PlanNode source : sourceProvider.getSources(node)) { PlanNodeCostEstimate exchangeCost = calculateExchangeCost(numberOfNodes.getAsInt(), stats.getStats(source), node.getOutputSymbols(), exchangeType, REMOTE, types); costEstimate.add(exchangeCost); } return costEstimate; }
Source:
@Before public void setup() throws SQLException { generateUniqueTableNames(); createTestTable(getUrl(), String.format(dataTableDdl, dataTableFullName)); if (!Strings.isNullOrEmpty(viewDdl)) { createTestTable(getUrl(), String.format(viewDdl, viewFullName, dataTableFullName)); createTestTable(getUrl(), String.format(indexTableDdl, indexTableName, viewFullName)); } else { createTestTable(getUrl(), String.format(indexTableDdl, indexTableName, dataTableFullName)); } props = PropertiesUtil.deepCopy(TEST_PROPERTIES); conn = DriverManager.getConnection(getUrl(), props); String dataTableUpsert = String.format(UPSERT_SQL, dataTableFullName); dataTableUpsertStmt = conn.prepareStatement(dataTableUpsert); String viewUpsert = String.format(UPSERT_SQL, viewFullName); viewUpsertStmt = conn.prepareStatement(viewUpsert); conn.setAutoCommit(false); testTime = EnvironmentEdgeManager.currentTimeMillis() - 1000; }

Target:
public void setup() throws SQLException { generateUniqueTableNames(); createTestTable(getUrl(), String.format(dataTableDdl, dataTableFullName)); if (!Strings.isNullOrEmpty(viewDdl)) { createTestTable(getUrl(), String.format(viewDdl, viewFullName, dataTableFullName)); createTestTable(getUrl(), String.format(indexTableDdl, indexTableName, viewFullName)); } else { createTestTable(getUrl(), String.format(indexTableDdl, indexTableName, dataTableFullName)); } props = PropertiesUtil.deepCopy(TEST_PROPERTIES); conn = DriverManager.getConnection(getUrl(), props); String dataTableUpsert = String.format(UPSERT_SQL, dataTableFullName); dataTableUpsertStmt = conn.prepareStatement(dataTableUpsert); String viewUpsert = String.format(UPSERT_SQL, viewFullName); viewUpsertStmt = conn.prepareStatement(viewUpsert); conn.setAutoCommit(false); testTime = EnvironmentEdgeManager.currentTimeMillis() - 1000; }
Source:
public static Cursor getJpSettings(long id) { if (id < 0) return null; String sqlCommand = sqlSelectAllJpSettings() + sqlWhere(JetpackSettingsModel.ID_COLUMN_NAME, Long.toString(id)) + ";"; return WordPress.wpDB.getDatabase().rawQuery(sqlCommand, null); }

Target:
public static Cursor getJpSettings(long id) { if (id < 0) return null; String whereClause = sqlWhere(ID_COLUMN_NAME, Long.toString(id)); String sqlCommand = sqlSelectAllJpSettings() + whereClause + ";"; return WordPress.wpDB.getDatabase().rawQuery(sqlCommand, null); }
Source:
public static String buildUrlWithQueryParams(@NonNull Logger logger, @NonNull String baseUrl, @NonNull Map<String, String> queryParams) { StringBuilder finalUrl = new StringBuilder(baseUrl); for (Map.Entry<String, String> entry : queryParams.entrySet()) { String encodedParamValue = null; try { encodedParamValue = URLEncoder.encode(entry.getValue(), "UTF-8"); } catch (UnsupportedEncodingException e) { logger.error(e); } final String queryParam = entry.getKey() + "=" + encodedParamValue; if (finalUrl.toString().contains("?")) { finalUrl.append("&").append(queryParam); } else { finalUrl.append("?").append(queryParam); } } return finalUrl.toString(); }

Target:
public static String buildUrlWithQueryParams(@NonNull Logger logger, @NonNull String baseUrl, @NonNull Map<String, String> queryParams) { final Uri.Builder uriBuilder = Uri.parse(baseUrl).buildUpon(); for (Map.Entry<String, String> entry : queryParams.entrySet()) { uriBuilder.appendQueryParameter(entry.getKey(), entry.getValue()); } final String finalUrl = uriBuilder.build().toString(); logger.debug("URL: " + finalUrl); return finalUrl; }
Source:
public static SubjectEntity[] getStorageEntitiesForCoco(List<CinderDisk> cinderDisks) { List<SubjectEntity> storageSubjects = new ArrayList<>(); for (final CinderDisk cinderDisk : cinderDisks) { SubjectEntity subjectStorage = LinqUtils.firstOrNull(storageSubjects, new Predicate<SubjectEntity>() { @Override public boolean eval(SubjectEntity storageSubject) { return storageSubject.getEntityId().equals(cinderDisk.getStorageIds().get(0)); } }); if (subjectStorage == null) { SubjectEntity se = new SubjectEntity(VdcObjectType.Storage, cinderDisk.getStorageIds().get(0)); storageSubjects.add(se); } } SubjectEntity[] subjectEntities = new SubjectEntity[storageSubjects.size()]; storageSubjects.toArray(subjectEntities); return subjectEntities; }

Target:
public static SubjectEntity[] getStorageEntitiesForCoco(List<CinderDisk> cinderDisks) { Set<SubjectEntity> storageSubjects = new HashSet<>(); for (final CinderDisk cinderDisk : cinderDisks) { SubjectEntity se = new SubjectEntity(VdcObjectType.Storage, cinderDisk.getStorageIds().get(0)); storageSubjects.add(se); } SubjectEntity[] subjectEntities = new SubjectEntity[storageSubjects.size()]; storageSubjects.toArray(subjectEntities); return subjectEntities; }
Source:
private static Boolean isUserCause(Cause cause) { if (Cause.UserIdCause.class.isInstance(cause)) { return true; } return false; }

Target:
private static Boolean isUserCause(Cause cause) { if (cause instanceof UserCause || cause instanceof UserIdCause){ return true; } return false; }
Source:
private boolean containsOuter() { for (JoinRelType joinType : joinTypes) { if (joinType != JoinRelType.INNER && joinType != JoinRelType.SEMI) { return true; } } return false; }

Target:
private boolean containsOuter() { for (JoinRelType joinType : joinTypes) { if (joinType.isOuterJoin()) { return true; } } return false; }
Source:
private void reconnectEdge(String source, String target, String newTargetName) { SWTBotGefEditPart sourceEditPartBot = getEditPart(source, AbstractBorderItemEditPart.class); SWTBotGefEditPart targetEditPartBot = getEditPart(target, AbstractBorderItemEditPart.class); SWTBotGefEditPart newtargetEditPartBot = getEditPart(newTargetName, AbstractBorderItemEditPart.class); SWTBotGefConnectionEditPart connectionEditPartBot = editor.getConnectionEditPart(sourceEditPartBot, targetEditPartBot).get(0); editor.reveal(connectionEditPartBot.part()); connectionEditPartBot.select(); SWTBotUtils.waitAllUiEvents(); PointList connection1Points = ((AbstractConnectionEditPart) connectionEditPartBot.part()).getConnectionFigure().getPoints().getCopy(); Point from = connection1Points.getLastPoint(); ((AbstractConnectionEditPart) connectionEditPartBot.part()).getFigure().translateToAbsolute(from); Point to = editor.getBounds(newtargetEditPartBot).getLocation(); editor.drag(from, to); }

Target:
private void reconnectEdge(String source, String target, String newTargetName) { SWTBotGefEditPart sourceEditPartBot = getEditPart(source, AbstractBorderItemEditPart.class); SWTBotGefEditPart targetEditPartBot = getEditPart(target, AbstractBorderItemEditPart.class); SWTBotGefEditPart newtargetEditPartBot = getEditPart(newTargetName, AbstractBorderItemEditPart.class); SWTBotGefConnectionEditPart connectionEditPartBot = editor.getConnectionEditPart(sourceEditPartBot, targetEditPartBot).get(0); editor.reveal(connectionEditPartBot.part()); connectionEditPartBot.select(); bot.waitUntil(new CheckSelectedCondition(editor, connectionEditPartBot.part())); PointList connection1Points = ((AbstractConnectionEditPart) connectionEditPartBot.part()).getConnectionFigure().getPoints().getCopy(); Point from = connection1Points.getLastPoint(); ((AbstractConnectionEditPart) connectionEditPartBot.part()).getFigure().translateToAbsolute(from); Point to = editor.getBounds(newtargetEditPartBot).getLocation(); editor.drag(from, to); }
Source:
private EuclideanValues polarToEuclidean(float r, float rDeviation, float theta, float thetaDeviation) { double thetaVariance = Math.pow(thetaDeviation, 2.0); double rVariance = Math.pow(rDeviation, 2.0); double halfPi = Math.PI / 2; double thetaVarianceFactorX = -1 * (halfPi * r) * Math.pow((1 + Math.tan(halfPi * theta)), -2) * (1 / Math.pow(Math.cos(halfPi * theta), 2)); double rVarianceFactorX = 1 / (1 + Math.tan(halfPi * theta)); double varianceX = (Math.pow(thetaVarianceFactorX, 2) * thetaVariance) + (Math.pow(rVarianceFactorX, 2) * rVariance); double thetaVarianceFactorY = -1 * thetaVarianceFactorX; double rVarianceFactorY = 1 - rVarianceFactorX; double varianceY = (Math.pow(thetaVarianceFactorY, 2) * thetaVariance) + (Math.pow(rVarianceFactorY, 2) * rVariance); double meanX = r / (1 + Math.tan(theta * halfPi)); double meanY = r - (r / (1 + Math.tan(theta * halfPi))); double devX = Math.pow(varianceX, 0.5); double devY = Math.pow(varianceY, 0.5); return new EuclideanValues((float) meanX, (float) meanY, (float) devX, (float) devY); }

Target:
EuclideanValues polarToEuclidean(float r, float rDeviation, float theta, float thetaDeviation) { final double thetaVariance = Math.pow(thetaDeviation, 2.0); final double rVariance = Math.pow(rDeviation, 2.0); final double halfPi = Math.PI / 2; final double normalizedTheta = halfPi * theta; final double rOverX = (1 + Math.tan(normalizedTheta)); final double thetaVarianceFactorX = -1 * (halfPi * r) * Math.pow(rOverX * Math.cos(normalizedTheta), -2); final double rVarianceFactorX = 1 / rOverX; final double varianceX = (Math.pow(thetaVarianceFactorX, 2) * thetaVariance) + (Math.pow(rVarianceFactorX, 2) * rVariance); final double thetaVarianceFactorY = -1 * thetaVarianceFactorX; final double rVarianceFactorY = 1 - rVarianceFactorX; final double varianceY = (Math.pow(thetaVarianceFactorY, 2) * thetaVariance) + (Math.pow(rVarianceFactorY, 2) * rVariance); final double meanX = r / rOverX; final double meanY = r - meanX; final double devX = Math.pow(varianceX, 0.5); final double devY = Math.pow(varianceY, 0.5); return new EuclideanValues((float) meanX, (float) meanY, (float) devX, (float) devY); }
Source:
public static File createTempDir() throws IOException { return Files.createTempDirectory("jenkins").toFile(); }

Target:
public static File createTempDir() throws IOException { final Path tempPath; final String tempDirNamePrefix = "jenkins"; if (FileSystems.getDefault().supportedFileAttributeViews().contains("posix")) { tempPath = Files.createTempDirectory(tempDirNamePrefix, PosixFilePermissions.asFileAttribute(EnumSet.allOf(PosixFilePermission.class))); } else { tempPath = Files.createTempDirectory(tempDirNamePrefix); } return tempPath.toFile(); }
Source:
public void build(DefaultGoPublisher publisher, EnvironmentVariableContext environmentVariableContext, TaskExtension taskExtension, ArtifactExtension artifactExtension, PluginRequestProcessorRegistry pluginRequestProcessorRegistry) { downloadMetadataFile(publisher); try { pluginRequestProcessorRegistry.registerProcessorFor(CONSOLE_LOG.requestName(), new ArtifactRequestProcessor(publisher)); final String message = format("[%s] Fetching pluggable artifact using plugin %s.", GoConstants.PRODUCT_NAME, artifactStore.getPluginId()); LOGGER.info(message); publisher.taggedConsumeLine(TaggedStreamConsumer.OUT, message); artifactExtension.fetchArtifact(artifactStore.getPluginId(), artifactStore, configuration, artifactId, getMetadataFromFile(), agentWorkingDirectory()); } catch (Exception e) { publisher.taggedConsumeLine(TaggedStreamConsumer.ERR, e.getMessage()); LOGGER.error(e.getMessage(), e); throw new RuntimeException(e); } finally { pluginRequestProcessorRegistry.removeProcessorFor(CONSOLE_LOG.requestName()); } }

Target:
public void build(DefaultGoPublisher publisher, EnvironmentVariableContext environmentVariableContext, TaskExtension taskExtension, ArtifactExtension artifactExtension, PluginRequestProcessorRegistry pluginRequestProcessorRegistry) { downloadMetadataFile(publisher); try { pluginRequestProcessorRegistry.registerProcessorFor(CONSOLE_LOG.requestName(), new ArtifactRequestProcessor(publisher)); final String message = format("[%s] Fetching pluggable artifact using plugin %s.", GoConstants.PRODUCT_NAME, artifactStore.getPluginId()); LOGGER.info(message); publisher.taggedConsumeLine(TaggedStreamConsumer.OUT, message); artifactExtension.fetchArtifact(artifactStore.getPluginId(), artifactStore, configuration, getMetadataFromFile(artifactId), agentWorkingDirectory()); } catch (Exception e) { publisher.taggedConsumeLine(TaggedStreamConsumer.ERR, e.getMessage()); LOGGER.error(e.getMessage(), e); throw new RuntimeException(e); } finally { pluginRequestProcessorRegistry.removeProcessorFor(CONSOLE_LOG.requestName()); } }
Source:
public void encode(ActiveMQBuffer buffer, Message record) { super.encode(buffer, record); AMQPLargeMessage msgEncode = (AMQPLargeMessage) record; buffer.writeLong(record.getMessageID()); buffer.writeBoolean(record.isDurable()); buffer.writeLong(msgEncode.getMessageFormat()); buffer.writeNullableSimpleString(record.getAddressSimpleString()); TypedProperties properties = ((AMQPMessage) record).getExtraProperties(); if (properties == null) { buffer.writeInt(0); } else { buffer.writeInt(properties.getEncodeSize()); properties.encode(buffer.byteBuf()); } ByteBuf savedEncodeBuffer = msgEncode.getSavedEncodeBuffer(); buffer.writeBytes(savedEncodeBuffer, 0, savedEncodeBuffer.writerIndex()); msgEncode.releaseEncodedBuffer(); msgEncode.releaseEncodedBuffer(); }

Target:
public void encode(ActiveMQBuffer buffer, Message record) { super.encode(buffer, record); AMQPLargeMessage msgEncode = (AMQPLargeMessage) record; buffer.writeLong(record.getMessageID()); buffer.writeBoolean(record.isDurable()); buffer.writeLong(msgEncode.getMessageFormat()); buffer.writeNullableSimpleString(record.getAddressSimpleString()); TypedProperties properties = ((AMQPMessage) record).getExtraProperties(); if (properties == null) { buffer.writeInt(0); } else { buffer.writeInt(properties.getEncodeSize()); properties.encode(buffer.byteBuf()); } ByteBuf savedEncodeBuffer = msgEncode.getSavedEncodeBuffer(); buffer.writeBytes(savedEncodeBuffer, 0, savedEncodeBuffer.writerIndex()); msgEncode.releaseEncodedBufferAfterWrite(); }
Source:
public void singleOpenBracket() { formatter.format("Hello {{1}} {0:.3 world!", (float) 3.1415926); }

Target:
public void singleOpenBracket() { formatter.format("Hello {{1}} {0:.3f world!", 3.1415926f); }
Source:
public static Consumer<PreparedStatement> createPreparedStatementConsumer(Integer[] indexes, DataContext context) { return pstm -> { int dynamicParamIndex = 1; for (int index : indexes) { setDynamicParam(dynamicParamIndex, context.get("?" + index), pstm); dynamicParamIndex++; } }; }

Target:
public static ResultSetEnumerable.PreparedStatementEnricher createPreparedStatementConsumer( Integer[] indexes, DataContext context) { return pstm -> { int dynamicParamIndex = 1; for (int index : indexes) { setDynamicParam(dynamicParamIndex, context.get("?" + index), pstm); dynamicParamIndex++; } }; }
Source:
private void addNeutralExceptions(Faction faction, Node node) throws DOMException, ParseException { final String METHOD_NAME = "addNeutralExceptions(String,Node)"; SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date start = null; Date end = null; if (node.getAttributes().getNamedItem("end") != null) { end = df.parse(node.getAttributes().getNamedItem("end").getTextContent().trim()); } for (int n = 0; n < node.getChildNodes().getLength(); n++) { Node wn = node.getChildNodes().item(n); if (wn.getNodeName().equalsIgnoreCase("exceptions")) { Date localStart = start; Date localEnd = end; if (wn.getAttributes().getNamedItem("start") != null) { localStart = df.parse(wn.getAttributes().getNamedItem("start").getTextContent().trim()); } if (wn.getAttributes().getNamedItem("end") != null) { localEnd = df.parse(wn.getAttributes().getNamedItem("end").getTextContent().trim()); } String[] parties = wn.getTextContent().trim().split(","); for (int i = 0; i < parties.length; i++) { final Faction f = Faction.getFaction(parties[i]); if (null == f) { MekHQ.getLogger().error(getClass(), METHOD_NAME, "Invalid faction code in factionhints.xml: " + parties[i]); continue; } addNeutralExceptions("", localStart, localEnd, faction, f); } } } }

Target:
private void addNeutralExceptions(Faction faction, Node node) throws DOMException, ParseException { final String METHOD_NAME = "addNeutralExceptions(Faction,Node)"; SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd"); Date start = null; Date end = null; if (node.getAttributes().getNamedItem("end") != null) { end = df.parse(node.getAttributes().getNamedItem("end").getTextContent().trim()); } for (int n = 0; n < node.getChildNodes().getLength(); n++) { Node wn = node.getChildNodes().item(n); if (wn.getNodeName().equals("exceptions")) { Date localStart = start; Date localEnd = end; if (wn.getAttributes().getNamedItem("start") != null) { localStart = df.parse(wn.getAttributes().getNamedItem("start").getTextContent().trim()); } if (wn.getAttributes().getNamedItem("end") != null) { localEnd = df.parse(wn.getAttributes().getNamedItem("end").getTextContent().trim()); } String[] parties = wn.getTextContent().trim().split(","); for (int i = 0; i < parties.length; i++) { final Faction f = Faction.getFaction(parties[i]); if (null == f) { MekHQ.getLogger().error(getClass(), METHOD_NAME, "Invalid faction code in factionhints.xml: " + parties[i]); continue; } addNeutralExceptions("", localStart, localEnd, faction, f); } } } }
Source:
private static TableDescriptor getTableDescriptor(String schemaName, String tableName) throws Exception { EmbedConnection defaultConn=(EmbedConnection) SpliceAdmin.getDefaultConn(); Activation lastActivation=defaultConn.getLanguageConnection().getLastActivation(); LanguageConnectionContext lcc = lastActivation.getLanguageConnectionContext(); SpliceTransactionManager tc = (SpliceTransactionManager)lcc.getTransactionExecute(); DataDictionary dd = lcc.getDataDictionary(); if (schemaName == null) { schemaName = lcc.getCurrentSchemaName(); } else { schemaName = schemaName.toUpperCase(); } if (tableName != null) { tableName = tableName.toUpperCase(); } else { throw StandardException.newException(SQLState.TABLE_NAME_CANNOT_BE_NULL); } SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true); if (sd == null){ throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST, schemaName); } TableDescriptor td = dd.getTableDescriptor(tableName, sd, tc); if (td == null) { throw StandardException.newException(SQLState.TABLE_NOT_FOUND, tableName); } return td; }

Target:
private static TableDescriptor getTableDescriptor(String schemaName, String tableName) throws Exception { EmbedConnection defaultConn=(EmbedConnection) SpliceAdmin.getDefaultConn(); Activation lastActivation=defaultConn.getLanguageConnection().getLastActivation(); LanguageConnectionContext lcc = lastActivation.getLanguageConnectionContext(); SpliceTransactionManager tc = (SpliceTransactionManager)lcc.getTransactionExecute(); DataDictionary dd = lcc.getDataDictionary(); if (schemaName == null) { schemaName = lcc.getCurrentSchemaName(); } else { schemaName = schemaName.trim(); } if (tableName != null) { tableName = tableName.trim(); } else { throw StandardException.newException(SQLState.TABLE_NAME_CANNOT_BE_NULL); } SchemaDescriptor sd = dd.getSchemaDescriptor(schemaName, tc, true); if (sd == null){ throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST, schemaName); } TableDescriptor td = dd.getTableDescriptor(tableName, sd, tc); if (td == null) { throw StandardException.newException(SQLState.TABLE_NOT_FOUND, tableName); } return td; }
Source:
public void validateConfig(WorkspaceConfig config) throws ValidationException, NotFoundException, ServerException { checkNotNull(config.getName(), "Workspace name required"); check( WS_NAME.matcher(config.getName()).matches(), "Incorrect workspace name, it must be between 3 and 100 characters and may contain digits, " + "latin letters, underscores, dots, dashes and must start and end only with digits, " + "latin letters or underscores"); check(!isNullOrEmpty(config.getDefaultEnv()), "Workspace default environment name required"); checkNotNull(config.getEnvironments(), "Workspace must contain at least one environment"); check( config.getEnvironments().containsKey(config.getDefaultEnv()), "Workspace default environment configuration required"); for (Environment environment : config.getEnvironments().values()) { checkNotNull(environment, "Environment must not be null"); Recipe recipe = environment.getRecipe(); checkNotNull(recipe, "Environment recipe must not be null"); checkNotNull(recipe.getType(), "Environment recipe type must not be null"); for (Entry<String, ? extends MachineConfig> machineEntry : environment.getMachines().entrySet()) { validateMachine(machineEntry.getKey(), machineEntry.getValue()); } } for (Command command : config.getCommands()) { check( !isNullOrEmpty(command.getName()), "Workspace %s contains command with null or empty name", config.getName()); check( !isNullOrEmpty(command.getCommandLine()), "Command line required for command '%s' in workspace '%s'", command.getName(), config.getName()); } }

Target:
public void validateConfig(WorkspaceConfig config) throws ValidationException, ServerException { checkNotNull(config.getName(), "Workspace name required"); check( WS_NAME.matcher(config.getName()).matches(), "Incorrect workspace name, it must be between 3 and 100 characters and may contain digits, " + "latin letters, underscores, dots, dashes and must start and end only with digits, " + "latin letters or underscores"); check(!isNullOrEmpty(config.getDefaultEnv()), "Workspace default environment name required"); checkNotNull(config.getEnvironments(), "Workspace must contain at least one environment"); check( config.getEnvironments().containsKey(config.getDefaultEnv()), "Workspace default environment configuration required"); for (Environment environment : config.getEnvironments().values()) { checkNotNull(environment, "Environment must not be null"); Recipe recipe = environment.getRecipe(); checkNotNull(recipe, "Environment recipe must not be null"); checkNotNull(recipe.getType(), "Environment recipe type must not be null"); for (Entry<String, ? extends MachineConfig> machineEntry : environment.getMachines().entrySet()) { validateMachine(machineEntry.getKey(), machineEntry.getValue()); } } for (Command command : config.getCommands()) { check( !isNullOrEmpty(command.getName()), "Workspace %s contains command with null or empty name", config.getName()); check( !isNullOrEmpty(command.getCommandLine()), "Command line required for command '%s' in workspace '%s'", command.getName(), config.getName()); } }
Source:
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { writer.keyword("DROP"); writer.keyword("CATALOG"); catalogName.unparse(writer, leftPrec, rightPrec); }

Target:
public void unparse(SqlWriter writer, int leftPrec, int rightPrec) { writer.keyword("DROP"); writer.keyword("CATALOG"); if (ifExists) { writer.keyword("IF EXISTS"); } catalogName.unparse(writer, leftPrec, rightPrec); }
Source:
public BindOsSupport getOsSupport() { BindOsSupport result = osSupport; if (result == null) { synchronized(this) { result = osSupport; if (result == null) { boolean yumExists = newScript("testing for yum") .body.append(BashCommands.requireExecutable("yum")) .execute() == 0; osSupport = result = yumExists ? BindOsSupport.forRhel() : BindOsSupport.forDebian(); } } } return result; }

Target:
public BindOsSupport getOsSupport() { BindOsSupport result = osSupport; if (result == null) { synchronized (osSupportMutex) { result = osSupport; if (result == null) { boolean yumExists = newScript("testing for yum") .body.append(BashCommands.requireExecutable("yum")) .execute() == 0; osSupport = result = yumExists ? BindOsSupport.forRhel() : BindOsSupport.forDebian(); } } } return result; }
Source:
public void testDecisionServerSecondContainerAMQ() throws Exception { checkDecisionServerSecondContainerAMQ(); }

Target:
public void testDecisionServerSecondContainerAMQ() throws UnsupportedEncodingException, NamingException, NoSuchAlgorithmException { checkDecisionServerSecondContainerAMQ(); }
Source:
public GradientDescent withMaxIterations(int maxIterations) { if (maxIterations < 0) throw new IllegalArgumentException("Number of iterations must be non-negative but got " + maxIterations); this.maxIterations = maxIterations; return this; }

Target:
public GradientDescent withMaxIterations(int maxIterations) { assert maxIterations >= 0; this.maxIterations = maxIterations; return this; }
Source:
public void listen(@SuppressWarnings("unused") AutosaveEvent event) { if (timer != null) { timer.cancel(); } timer = new Timer(); timer.schedule(new TimerTask() { @Override public void run() { try { new SaveDatabaseAction(panel, Globals.prefs, Globals.entryTypesManager).save(SaveDatabaseAction.SaveDatabaseMode.SILENT); } catch (Throwable e) { LOGGER.error("Problem occured while saving.", e); } } }, 200); }

Target:
public void listen(@SuppressWarnings("unused") AutosaveEvent event) { try { new SaveDatabaseAction(panel, Globals.prefs, Globals.entryTypesManager).save(SaveDatabaseAction.SaveDatabaseMode.SILENT); } catch (Throwable e) { LOGGER.error("Problem occurred while saving.", e); } }
Source:
public void testMultiplePerTargetAspects() throws SecurityException, NoSuchMethodException { TestBean target = new TestBean(); int realAge = 65; target.setAge(realAge); List<Advisor> advisors = new LinkedList<>(); PerTargetAspect aspect1 = new PerTargetAspect(); aspect1.count = 100; aspect1.setOrder(10); advisors.addAll( getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect1, "someBean1"))); PerTargetAspect aspect2 = new PerTargetAspect(); aspect2.setOrder(5); advisors.addAll( getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect2, "someBean2"))); advisors.sort(new OrderComparator()); TestBean itb = (TestBean) createProxy(target, advisors, TestBean.class); assertThat(itb.getAge()).as("Around advice must NOT apply").isEqualTo(realAge); itb.getSpouse(); assertThat(itb.getAge()).as("Around advice must apply").isEqualTo(0); assertThat(itb.getAge()).as("Around advice must apply").isEqualTo(1); }

Target:
public void testMultiplePerTargetAspects() throws SecurityException, NoSuchMethodException { TestBean target = new TestBean(); int realAge = 65; target.setAge(realAge); List<Advisor> advisors = new LinkedList<>(); PerTargetAspect aspect1 = new PerTargetAspect(); aspect1.count = 100; aspect1.setOrder(10); advisors.addAll( getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect1, "someBean1"))); PerTargetAspect aspect2 = new PerTargetAspect(); aspect2.setOrder(5); advisors.addAll( getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(aspect2, "someBean2"))); OrderComparator.sort(advisors); TestBean itb = (TestBean) createProxy(target, advisors, TestBean.class); assertThat(itb.getAge()).as("Around advice must NOT apply").isEqualTo(realAge); itb.getSpouse(); assertThat(itb.getAge()).as("Around advice must apply").isEqualTo(0); assertThat(itb.getAge()).as("Around advice must apply").isEqualTo(1); }
Source:
@Nullable public String getAuthURL() { for (FormGroup formGroup : form) { for (FormField formField : formGroup.getFields()) { if (formField.getId().equals("authURL")) { return formField.getValue().toString(); } } } return null; }

Target:
@Nullable public String getAuthURL() { return getValueFromField(FormField.AUTH_URL); }
Source:
public void run() { workerLastStartAt.set(System.currentTimeMillis()); try { final List<QueuedRequestId> queuedRequestIds = requestManager.getQueuedRequestIds(); if (!queuedRequestIds.isEmpty()) { final Set<String> handledServices = Sets.newHashSet(); for (QueuedRequestId queuedRequestId : queuedRequestIds) { if (!handledServices.contains(queuedRequestId.getServiceId())) { synchronized (BaragonRequestWorker.class) { handleQueuedRequest(queuedRequestId); } handledServices.add(queuedRequestId.getServiceId()); } } } requestManager.failStuckPendingRequests(); } catch (Exception e) { LOG.warn("Caught exception", e); } }

Target:
public void run() { workerLastStartAt.set(System.currentTimeMillis()); try { final List<QueuedRequestId> queuedRequestIds = requestManager.getQueuedRequestIds(); if (!queuedRequestIds.isEmpty()) { final Set<String> handledServices = Sets.newHashSet(); for (QueuedRequestId queuedRequestId : queuedRequestIds) { if (!handledServices.contains(queuedRequestId.getServiceId())) { synchronized (BaragonRequestWorker.class) { handleQueuedRequest(queuedRequestId); } handledServices.add(queuedRequestId.getServiceId()); } } } } catch (Exception e) { LOG.warn("Caught exception", e); } }
Source:
private void addNewlines(Node n) { Node nextNode = n.getNext(); if (nextNode != null) { int lineSpacing = nextNode.getLineno() - n.getLineno(); if (lineSpacing > 1 || (nextNode.getToken() == Token.MEMBER_FUNCTION_DEF ^ n.getToken() == Token.EMPTY)) { add("\n"); } } }

Target:
private void addNewlines(Node n) { Node nextNode = n.getNext(); if (nextNode != null) { int lineSpacing = nextNode.getLineno() - n.getLineno(); if (lineSpacing > 1 || (nextNode.getToken() == Token.MEMBER_FUNCTION_DEF && n.getToken() != Token.EMPTY)) { add("\n"); } } }
Source:
public Builder type(BlockType type) { checkNotNull(type); internalState = type.getDefaultState(); return this; }

Target:
public Builder type(BlockType type) { checkNotNull(type); this.type = type; return this; }
Source:
public void setBasicAuthorizationHeaderForUserAndPassword(String user, String password) { String credential = user + ":" + password; String base64credential = Base64.getEncoder().encodeToString(credential.getBytes()); setValueForHeader("Basic " + base64credential, "Authorization"); }

Target:
public void setBasicAuthorizationHeaderForUserAndPassword(String user, String password) { String credential = user + ":" + password; try { String base64credential = Base64.getEncoder().encodeToString(credential.getBytes("ISO-8859-1")); setValueForHeader("Basic " + base64credential, "Authorization"); } catch (UnsupportedEncodingException e) { throw new SlimFixtureException("ISO-8859-1 encoding unavailable!", e); } }
Source:
public void signInForAdmin() throws Exception { SignIn signIn = new SignIn.Builder().withStudy("originalStudy") .withEmail(TestConstants.EMAIL).withPassword("password").build(); TestUtils.mockPlayContextWithJson(signIn); when(authService.signIn(eq(study), any(CriteriaContext.class), signInCaptor.capture())).thenReturn(session); Result result = controller.signInForAdmin(); TestUtils.assertResult(result, 200); assertEquals("originalStudy", session.getStudyIdentifier().getIdentifier()); assertEquals("api", signInCaptor.getValue().getStudyId()); }

Target:
public void signInForAdmin() throws Exception { when(bridgeConfig.getEnvironment()).thenReturn(Environment.LOCAL); SignIn signIn = new SignIn.Builder().withStudy("originalStudy") .withEmail(TestConstants.EMAIL).withPassword("password").build(); Response response = TestUtils.mockPlayContextWithJson(signIn); when(authService.signIn(eq(study), any(CriteriaContext.class), signInCaptor.capture())).thenReturn(session); Result result = controller.signInForAdmin(); TestUtils.assertResult(result, 200); assertEquals("originalStudy", session.getStudyIdentifier().getIdentifier()); assertEquals("api", signInCaptor.getValue().getStudyId()); verify(response).setCookie(BridgeConstants.SESSION_TOKEN_HEADER, session.getSessionToken(), BridgeConstants.BRIDGE_SESSION_EXPIRE_IN_SECONDS, "/", bridgeConfig.get("domain"), false, false); }
Source:
private static void checkFlattenedConfig(Collection<? extends Map<String, ?>> configs) { Splitter splitter = Splitter.on('/'); configs.forEach( config -> { if ( !config.isEmpty() ) { List<String> firstKey = splitter.splitToList(config.keySet().iterator().next()); String configType = firstKey.get(0); boolean oldStlyeConfig = firstKey.size() == 2; config.keySet().forEach( key -> { List<String> keyParts = splitter.splitToList(key); checkArgument(Objects.equals(configType, keyParts.get(0)), "Invalid config type: %s. Should be: %s", keyParts.get(0), configType); if (oldStlyeConfig) { checkArgument(keyParts.size() == 2, "Expected key in [config_type/property_name] format, found [%s]", key); } else { String propertiesType = keyParts.get(1); checkArgument( keyParts.size() == 3 && PROPERTIES_PROPERTY_ID.equals(propertiesType) || keyParts.size() == 4 && PROPERTIES_ATTRIBUTES_PROPERTY_ID.equals(propertiesType), "Expected key in [config_type/properties/config_name] or [config_type/properties_attributes/attribute_name/property_name]" + " format, found [%s]", key); } }); } }); }

Target:
private static void checkFlattenedConfig(Collection<? extends Map<String, ?>> configs) { configs.forEach( config -> { if ( !config.isEmpty() ) { List<String> firstKey = splitConfigurationKey(config.keySet().iterator().next()); String configType = firstKey.get(0); boolean legacyConfig = isKeyInLegacyFormat(firstKey); config.keySet().forEach( key -> { List<String> keyParts = splitConfigurationKey(key); checkArgument(Objects.equals(configType, keyParts.get(0)), "Invalid config type: %s. Should be: %s", keyParts.get(0), configType); checkArgument(legacyConfig && isKeyInLegacyFormat(keyParts) || !legacyConfig && isKeyInNewFormat(keyParts), "Expected key in %s format, found [%s]", legacyConfig ? "[config_type/property_name]" : "[config_type/properties/config_name] or [config_type/properties_attributes/attribute_name/property_name]", key); }); } }); }
Source:
protected void buildAuditMessage(StringBuilder builder) { super.buildAuditMessage(builder); builder.append(", Operation(User login), Roles("); if (roles != null && !roles.isEmpty()) { List<String> lines = new LinkedList<>(); for (Map.Entry<String, List<String>> entry : roles.entrySet()) { lines.add("(" + " " + entry.getKey() + ": " + StringUtils.join(entry.getValue(), ", ") + ")"); } builder.append(StringUtils.join(lines, ")")); } builder.append("), Status(") .append(reasonOfFailure == null ? "Success" : "Failed"); if (reasonOfFailure != null) { builder.append("), Reason(") .append(reasonOfFailure); builder.append("), Consecutive failures(") .append((consecutiveFailures == null) ? "UNKNOWN USER" : String.valueOf(consecutiveFailures)); } builder.append(")"); }

Target:
protected void buildAuditMessage(StringBuilder builder) { super.buildAuditMessage(builder); builder.append(", Operation(User login), Roles("); if (roles != null && !roles.isEmpty()) { List<String> lines = new LinkedList<>(); for (Map.Entry<String, List<String>> entry : roles.entrySet()) { lines.add(entry.getKey() + ": " + StringUtils.join(entry.getValue(), ", ")); } builder.append(StringUtils.join(lines, ",")); } builder.append("), Status(") .append(reasonOfFailure == null ? "Success" : "Failed"); if (reasonOfFailure != null) { builder.append("), Reason(") .append(reasonOfFailure); builder.append("), Consecutive failures(") .append((consecutiveFailures == null) ? "UNKNOWN USER" : String.valueOf(consecutiveFailures)); } builder.append(")"); }
Source:
public Writer<Result> createWriter(RuntimeContainer adaptor) { return new MarkLogicRowReader(this, adaptor, inputProperties); }

Target:
public MarkLogicRowProcessor createWriter(RuntimeContainer adaptor) { return new MarkLogicRowProcessor(this, adaptor, inputProperties); }
Source:
String gtk_rgba_to_css_string (GdkRGBA rgba) { GdkRGBA toConvert; if (rgba != null) { toConvert = rgba; } else { GdkColor defaultGdkColor = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND).handle; toConvert = new GdkRGBA (); toConvert = display.toGdkRGBA (defaultGdkColor); } long str = OS.gdk_rgba_to_string (toConvert); int length = OS.strlen (str); byte buffer = new byte [length]; OS.memmove (buffer, str, length); return new String (Converter.mbcsToWcs (null, buffer)); }

Target:
String gtk_rgba_to_css_string (GdkRGBA rgba) { GdkRGBA toConvert; if (rgba != null) { toConvert = rgba; } else { GdkColor defaultGdkColor = display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND).handle; toConvert = display.toGdkRGBA (defaultGdkColor); } long str = OS.gdk_rgba_to_string (toConvert); int length = OS.strlen (str); byte buffer = new byte [length]; OS.memmove (buffer, str, length); return new String (Converter.mbcsToWcs (null, buffer)); }
Source:
protected Integer doTaskBackground(Void... params) { SqlStorage<FormRecord> storage = CommCareApplication._().getUserStorage(FormRecord.class); Vector<Integer> recordsToRemove = storage.getIDsForValues( new String[]{FormRecord.META_STATUS}, new String[]{FormRecord.STATUS_SAVED}); int numOldRecordsRemoved = recordsToRemove.size(); Vector<Integer> unindexedRecords = storage.getIDsForValues(new String[] { FormRecord.META_STATUS}, new String[] { FormRecord.STATUS_UNINDEXED }); int count = 0; for(int recordID : unindexedRecords) { FormRecord r = storage.read(recordID); try { updateAndWriteUnindexedRecord(context, platform, r, storage); } catch (FileNotFoundException | InvalidStructureException e) { recordsToRemove.add(recordID); } catch(XmlPullParserException | IOException | UnfullfilledRequirementsException e) { } count++; this.publishProgress(count, unindexedRecords.size()); } this.publishProgress(STATUS_CLEANUP); SqlStorage<SessionStateDescriptor> ssdStorage = CommCareApplication._().getUserStorage(SessionStateDescriptor.class); for(int recordID : recordsToRemove) { wipeRecord(context, -1, recordID, storage, ssdStorage); } int totalRecordsRemoved = recordsToRemove.size(); Log.d(TAG, "Synced: " + unindexedRecords.size() + ". Removed: " + numOldRecordsRemoved + " old records, and " + (totalRecordsRemoved - numOldRecordsRemoved) + " busted new ones"); return SUCCESS; }

Target:
protected Integer doTaskBackground(Void... params) { SqlStorage<FormRecord> storage = CommCareApplication._().getUserStorage(FormRecord.class); String currentAppId = CommCareApplication._().getCurrentApp().getAppRecord().getApplicationId(); Vector<Integer> recordsToRemove = storage.getIDsForValues( new String[]{FormRecord.META_STATUS, FormRecord.META_APP_ID}, new String[]{FormRecord.STATUS_SAVED, currentAppId}); int numOldRecordsRemoved = recordsToRemove.size(); Vector<Integer> unindexedRecords = storage.getIDsForValues(new String[] { FormRecord.META_STATUS}, new String[] { FormRecord.STATUS_UNINDEXED }); int count = 0; for(int recordID : unindexedRecords) { FormRecord r = storage.read(recordID); try { updateAndWriteUnindexedRecord(context, platform, r, storage); } catch (FileNotFoundException | InvalidStructureException e) { recordsToRemove.add(recordID); } catch(XmlPullParserException | IOException | UnfullfilledRequirementsException e) { } count++; this.publishProgress(count, unindexedRecords.size()); } this.publishProgress(STATUS_CLEANUP); SqlStorage<SessionStateDescriptor> ssdStorage = CommCareApplication._().getUserStorage(SessionStateDescriptor.class); for(int recordID : recordsToRemove) { wipeRecord(context, -1, recordID, storage, ssdStorage); } int totalRecordsRemoved = recordsToRemove.size(); Log.d(TAG, "Synced: " + unindexedRecords.size() + ". Removed: " + numOldRecordsRemoved + " old records, and " + (totalRecordsRemoved - numOldRecordsRemoved) + " busted new ones"); return SUCCESS; }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CheckpointStatistics that = (CheckpointStatistics) o; return id == that.id && savepoint == that.savepoint && triggerTimestamp == that.triggerTimestamp && latestAckTimestamp == that.latestAckTimestamp && stateSize == that.stateSize && duration == that.duration && alignmentBuffered == that.alignmentBuffered && numSubtasks == that.numSubtasks && numAckSubtasks == that.numAckSubtasks && status == that.status && Objects.equals(checkPointType, that.checkPointType) && Objects.equals(checkpointStatisticsPerTask, that.checkpointStatisticsPerTask); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } CheckpointStatistics that = (CheckpointStatistics) o; return id == that.id && savepoint == that.savepoint && triggerTimestamp == that.triggerTimestamp && latestAckTimestamp == that.latestAckTimestamp && stateSize == that.stateSize && duration == that.duration && alignmentBuffered == that.alignmentBuffered && processedData == processedData && persistedData == that.persistedData && numSubtasks == that.numSubtasks && numAckSubtasks == that.numAckSubtasks && status == that.status && Objects.equals(checkpointType, that.checkpointType) && Objects.equals(checkpointStatisticsPerTask, that.checkpointStatisticsPerTask); }
Source:
public String toString() { final StringBuffer buffer = new StringBuffer(); boolean addPlus = false; for (final Vector.Element element : parameters.nonZeroes()) { if (addPlus) { buffer.append(" + "); } buffer.append(String.valueOf(element.get())); final int index = element.index(); if (index != parameters.size() - 1) { buffer.append(String.format("x%d", index + 1)); } addPlus = true; } return buffer.toString(); }

Target:
public String toString() { final StringBuffer buffer = new StringBuffer(); boolean addPlus = false; for (final Vector.Element element : parameters.nonZeroes()) { if (addPlus) { buffer.append(" + "); } buffer.append(String.format("%e", element.get())); final int index = element.index(); if (index != parameters.size() - 1) { buffer.append(String.format(" * x%d", index + 1)); } addPlus = true; } return buffer.toString(); }
Source:
public static void logWarning(final String message, final Throwable thr) { getDefault().getLog().log(warning(message, thr)); }

Target:
public static void logWarning(final String message, final Throwable thr) { handleIssue(IStatus.WARNING, message, thr, false); }
Source:
public void log() { Set<Map.Entry<Object, Object>> properties = internalProperties.entrySet(); for (Map.Entry property : properties) { LOG.debug("Dolphin Platform starts with value for " + property.getKey() + " = " + property.getValue()); } }

Target:
public void log() { final Set<Map.Entry<Object, Object>> properties = internalProperties.entrySet(); for (Map.Entry property : properties) { LOG.debug("Dolphin Platform starts with value for " + property.getKey() + " = " + property.getValue()); } }
Source:
public void executeQueryFromExecutor(RequestScope scope) { log.info("AsyncExecutorService executor object: {}", asyncExecutorService); asyncExecutorService.executeQuery(query, queryType, scope.getUser(), id); }

Target:
public void executeQueryFromExecutor(RequestScope scope) { asyncExecutorService.executeQuery(this, scope.getUser()); }