auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void dispatchHeartbeats() { uiSynchronizer.asyncExec( () -> clientDocs.forEach( (path, jupiter) -> { JupiterActivity heartbeat = jupiter.generateJupiterActivity( new NoOperation(), sarosSession.getLocalUser(), path); fireActivity(heartbeat); })); }

Target:
private void dispatchHeartbeats() { uiSynchronizer.asyncExec( () -> jupiter .getClientDocs() .forEach( (path, jupiter) -> { JupiterActivity heartbeat = jupiter.generateJupiterActivity( new NoOperation(), sarosSession.getLocalUser(), path); fireActivity(heartbeat); })); }
Source:
public void testJdbcComputePushdownUnsupported() { String table = "test_table"; String schema = "test_schema"; String predicate = "(c1 + c2) > c2"; TypeProvider typeProvider = TypeProvider.copyOf(ImmutableMap.of("c1", BIGINT, "c2", BIGINT)); RowExpression rowExpression = sqlToRowExpressionTranslator.translateAndOptimize(expression(predicate), typeProvider); Set<ColumnHandle> columns = Arrays.asList("c1", "c2").stream().map(TestJdbcComputePushdown::intJdbcColumnHandle).collect(Collectors.toSet()); PlanNode original = filter(jdbcTableScan(schema, table, "c1", "c2"), rowExpression); JdbcTableHandle jdbcTableHandle = new JdbcTableHandle(CONNECTOR_ID, new SchemaTableName(schema, table), CATALOG_NAME, schema, table); JdbcTableLayoutHandle jdbcTableLayoutHandle = new JdbcTableLayoutHandle(jdbcTableHandle, TupleDomain.none(), Optional.empty()); ConnectorSession session = new TestingConnectorSession(ImmutableList.of()); PlanNode actual = this.jdbcComputePushdown.optimize(original, session, null, ID_ALLOCATOR); assertPlanMatch(actual, PlanMatchPattern.filter( predicate, JdbcTableScanMatcher.jdbcTableScanPattern(jdbcTableLayoutHandle, columns))); }

Target:
public void testJdbcComputePushdownUnsupported() { String table = "test_table"; String schema = "test_schema"; String expression = "(c1 + c2) > c2"; TypeProvider typeProvider = TypeProvider.copyOf(ImmutableMap.of("c1", BIGINT, "c2", BIGINT)); RowExpression rowExpression = sqlToRowExpressionTranslator.translateAndOptimize(expression(expression), typeProvider); Set<ColumnHandle> columns = Stream.of("c1", "c2").map(TestJdbcComputePushdown::integerJdbcColumnHandle).collect(Collectors.toSet()); PlanNode original = filter(jdbcTableScan(schema, table, BIGINT, "c1", "c2"), rowExpression); JdbcTableHandle jdbcTableHandle = new JdbcTableHandle(CONNECTOR_ID, new SchemaTableName(schema, table), CATALOG_NAME, schema, table); JdbcTableLayoutHandle jdbcTableLayoutHandle = new JdbcTableLayoutHandle(jdbcTableHandle, TupleDomain.none(), Optional.empty()); ConnectorSession session = new TestingConnectorSession(ImmutableList.of()); PlanNode actual = this.jdbcComputePushdown.optimize(original, session, null, ID_ALLOCATOR); assertPlanMatch(actual, PlanMatchPattern.filter( expression, JdbcTableScanMatcher.jdbcTableScanPattern(jdbcTableLayoutHandle, columns))); }
Source:
@Override public RelDataType deriveDecimalModType(RelDataTypeFactory typeFactory, RelDataType type1, RelDataType type2) { if (SqlTypeUtil.isExactNumeric(type1) && SqlTypeUtil.isExactNumeric(type2)) { if (SqlTypeUtil.isDecimal(type1) || SqlTypeUtil.isDecimal(type2)) { type1 = RelDataTypeFactoryImpl.isJavaType(type1) ? typeFactory.decimalOf(type1) : type1; type2 = RelDataTypeFactoryImpl.isJavaType(type2) ? typeFactory.decimalOf(type2) : type2; int p1 = type1.getPrecision(); int p2 = type2.getPrecision(); int s1 = type1.getScale(); int s2 = type2.getScale(); if (s1 == 0 && s2 == 0) { return type2; } int scale = Math.max(s1, s2); assert scale <= getMaxNumericScale(); int precision = Math.min(p1 - s1, p2 - s2) + Math.max(s1, s2); precision = Math.min(precision, getMaxNumericPrecision()); assert precision > 0; RelDataType ret; ret = typeFactory.createSqlType( SqlTypeName.DECIMAL, precision, scale); return ret; } } return null; }

Target:
@Override public RelDataType deriveDecimalModType(RelDataTypeFactory typeFactory, RelDataType type1, RelDataType type2) { if (SqlTypeUtil.isExactNumeric(type1) && SqlTypeUtil.isExactNumeric(type2)) { if (SqlTypeUtil.isDecimal(type1) || SqlTypeUtil.isDecimal(type2)) { type1 = RelDataTypeFactoryImpl.isJavaType(type1) ? typeFactory.decimalOf(type1) : type1; type2 = RelDataTypeFactoryImpl.isJavaType(type2) ? typeFactory.decimalOf(type2) : type2; int p1 = type1.getPrecision(); int p2 = type2.getPrecision(); int s1 = type1.getScale(); int s2 = type2.getScale(); if (s1 == 0 && s2 == 0) { return type2; } int scale = Math.max(s1, s2); assert scale <= getMaxNumericScale(); int precision = Math.min(p1 - s1, p2 - s2) + Math.max(s1, s2); precision = Math.min(precision, getMaxNumericPrecision()); assert precision > 0; return typeFactory.createSqlType(SqlTypeName.DECIMAL, precision, scale); } } return null; }
Source:
public List<WorkflowAction> findInitialAvailableActionsByContentType(ContentType contentType, User user) throws DotDataException, DotSecurityException{ final ImmutableList.Builder<WorkflowAction> actions = new ImmutableList.Builder<>(); final List<WorkflowScheme> schemes = findSchemesForContentType(contentType); for(WorkflowScheme scheme: schemes){ List<WorkflowStep> steps = findSteps(scheme); actions.addAll(findActions(steps.get(0), user)); } return actions.build(); }

Target:
public List<WorkflowAction> findInitialAvailableActionsByContentType(ContentType contentType, User user) throws DotDataException, DotSecurityException{ final ImmutableList.Builder<WorkflowAction> actions = new ImmutableList.Builder<>(); final List<WorkflowScheme> schemes = findSchemesForContentType(contentType); for(WorkflowScheme scheme: schemes){ List<WorkflowStep> steps = findSteps(scheme); actions.addAll(findActions(steps.stream().findFirst().orElse(null), user)); } return actions.build(); }
Source:
public String buildDefaultResourceDescription(HostPort hostPort, JBossProduct product) { return String.format("Standalone %s server", product.FULL_NAME); }

Target:
String buildDefaultResourceDescription(HostPort hostPort, JBossProduct product) { return String.format("Standalone %s server", product.FULL_NAME); }
Source:
void postConstruct() { chatPrefs = preferencesService.getPreferences().getChatPrefs(); userToCssStyle.put(userService.getUsername(), chatPrefs.getSelfChatColor()); mentionPattern = Pattern.compile("\\b" + Pattern.quote(userService.getUsername()) + "\\b"); initChatView(); addFocusListeners(); addImagePasteListener(); }

Target:
void postConstruct() { mentionPattern = Pattern.compile("\\b" + Pattern.quote(userService.getUsername()) + "\\b"); Platform.runLater(this::initChatView); addFocusListeners(); addImagePasteListener(); }
Source:
public static void sortOrdersBasedOnDateActivatedOrDateStopped(List<Order> orders, final String sortOrder, final String status) { Collections.sort(orders, new Comparator<Order>() { @Override public int compare(Order o1, Order o2) { if (status.equalsIgnoreCase("inactive")) { return sortOrder.equalsIgnoreCase("ASC") ? o1.getDateStopped().compareTo(o2.getDateStopped()) : o2 .getDateStopped().compareTo(o1.getDateStopped()); } else { return sortOrder.equalsIgnoreCase("asc") ? o1.getDateActivated().compareTo(o2.getDateActivated()) : o2 .getDateActivated().compareTo(o1.getDateActivated()); } } }); }

Target:
public List<Order> sortOrdersBasedOnDateActivatedOrDateStopped(List<Order> orders, final String sortOrder, final String status) { List<Order> sortedList = new ArrayList<Order>(orders); Collections.sort(sortedList, new Comparator<Order>() { @Override public int compare(Order o1, Order o2) { if (status.equalsIgnoreCase("inactive")) { return sortOrder.equalsIgnoreCase("ASC") ? getUsableDate(o1).compareTo(getUsableDate(o2)) : getUsableDate(o2).compareTo(getUsableDate(o1)); } else { return sortOrder.equalsIgnoreCase("asc") ? getActiveOrderSortDate(o1).compareTo(getActiveOrderSortDate(o2)) : getActiveOrderSortDate(o2).compareTo(getActiveOrderSortDate(o1)); } } }); return sortedList; }
Source:
private boolean areComparableForDuplicates(final ReadEndsForMarkDuplicates lhs, final ReadEndsForMarkDuplicates rhs, final boolean compareRead2, final boolean useBarcodes) { boolean retval = lhs.libraryId == rhs.libraryId; if (retval && useBarcodes) { if (retval) retval = 0 == compareInteger(((ReadEndsForMarkDuplicatesWithBarcodes) lhs).barcode, ((ReadEndsForMarkDuplicatesWithBarcodes) rhs).barcode); if (retval) retval = 0 == compareInteger(((ReadEndsForMarkDuplicatesWithBarcodes) lhs).readOneBarcode, ((ReadEndsForMarkDuplicatesWithBarcodes) rhs).readOneBarcode); if (retval) retval = 0 == compareInteger(((ReadEndsForMarkDuplicatesWithBarcodes) lhs).readTwoBarcode, ((ReadEndsForMarkDuplicatesWithBarcodes) rhs).readTwoBarcode); } if (retval) { retval = lhs.read1ReferenceIndex == rhs.read1ReferenceIndex && lhs.read1Coordinate == rhs.read1Coordinate && lhs.orientation == rhs.orientation; } if (retval && compareRead2) { retval = lhs.read2ReferenceIndex == rhs.read2ReferenceIndex && lhs.read2Coordinate == rhs.read2Coordinate; } return retval; }

Target:
private boolean areComparableForDuplicates(final ReadEndsForMarkDuplicates lhs, final ReadEndsForMarkDuplicates rhs, final boolean compareRead2, final boolean useBarcodes) { boolean areComparable = lhs.libraryId == rhs.libraryId; if (useBarcodes && areComparable) { final ReadEndsForMarkDuplicatesWithBarcodes lhsWithBarcodes = (ReadEndsForMarkDuplicatesWithBarcodes) lhs; final ReadEndsForMarkDuplicatesWithBarcodes rhsWithBarcodes = (ReadEndsForMarkDuplicatesWithBarcodes) rhs; areComparable = lhsWithBarcodes.barcode == rhsWithBarcodes.barcode && lhsWithBarcodes.readOneBarcode == rhsWithBarcodes.readOneBarcode && lhsWithBarcodes.readTwoBarcode == rhsWithBarcodes.readTwoBarcode; } if (areComparable) { areComparable = lhs.read1ReferenceIndex == rhs.read1ReferenceIndex && lhs.read1Coordinate == rhs.read1Coordinate && lhs.orientation == rhs.orientation; } if (areComparable && compareRead2) { areComparable = lhs.read2ReferenceIndex == rhs.read2ReferenceIndex && lhs.read2Coordinate == rhs.read2Coordinate; } return areComparable; }
Source:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? AuditLogType.VDS_GET_CAPABILITIES : AuditLogType.VDS_GET_CAPABILITIES_FAILED; }

Target:
public AuditLogType getAuditLogTypeValue() { return getSucceeded() ? AuditLogType.HOST_REFRESHED_CAPABILITIES : AuditLogType.HOST_REFRESHED_CAPABILITIES_FAILED; }
Source:
private Authentication getAuthentication(boolean isExpired, String... scopes) { val request = new OAuth2Request(emptyMap(), "", emptyList(), true, new TreeSet<>(Arrays.asList(scopes)), emptySet(), "", emptySet(), emptyMap()); return ExpiringOauth2Authentication.from(new OAuth2Authentication(request, null), isExpired ? 0 : 3600); }

Target:
private Authentication getAuthentication(boolean isExpired, String... scopes) { val map = new HashMap<String, Object>(); map.put("exp", isExpired ? 0 : 3600); map.put("scope", new TreeSet<>(Arrays.asList(scopes))); return new AccessTokenConverterWithExpiry().extractAuthentication(map); }
Source:
public void validateDirectory(File path, boolean verbose) throws IOException { File[] files = path.listFiles(); Arrays.sort(files); int problemsDetectedInIndexFiles = 0, problemsDetectedInDataFiles = 0, problemsDetectedInIndexAndDataFilesMatch = 0; for (File file: files) { if (file.length() == 0) { if (verbose) { System.out.println("Skipping empty file: " + file.getName()); } } else if (file.getName().endsWith(ReadOnlyUtils.INDEX_FILE_EXTENSION)) { problemsDetectedInIndexFiles += validateIndexFile(file, verbose); problemsDetectedInIndexAndDataFilesMatch += validateIndexAndDataFileMatch(file, verbose); } else if (file.getName().endsWith(ReadOnlyUtils.DATA_FILE_EXTENSION)) { problemsDetectedInDataFiles += validateDataFile(file, verbose); } else { System.out.println("Skipping file: " + file.getName()); } } System.out.println(); if (problemsDetectedInIndexFiles == 0 && problemsDetectedInDataFiles == 0 && problemsDetectedInIndexAndDataFilesMatch == 0 ) { System.out.println("No problems detected in any of the files in this directory."); } else { System.err.println("Number of problems detected in index files: " + problemsDetectedInIndexFiles); System.err.println("Number of problems detected in data files: " + problemsDetectedInDataFiles); System.err.println("Number of problems detected in the matching of index and data files: " + problemsDetectedInIndexAndDataFilesMatch); } }

Target:
public void validateDirectory(File path, boolean verbose) throws IOException { File[] files = path.listFiles(); Arrays.sort(files); int problemsDetectedInIndexFiles = 0, problemsDetectedInDataFiles = 0, problemsDetectedInIndexAndDataFilesMatch = 0; for (File file: files) { if (file.length() == 0) { if (verbose) { printInfo("Skipping empty file: " + file.getName()); } } else if (file.getName().endsWith(ReadOnlyUtils.INDEX_FILE_EXTENSION)) { problemsDetectedInIndexFiles += validateIndexFile(file, verbose); problemsDetectedInIndexAndDataFilesMatch += validateIndexAndDataFileMatch(file, verbose); } else if (file.getName().endsWith(ReadOnlyUtils.DATA_FILE_EXTENSION)) { problemsDetectedInDataFiles += validateDataFile(file, verbose); } else { printInfo("Skipping file: " + file.getName()); } } printInfo(""); if (problemsDetectedInIndexFiles == 0 && problemsDetectedInDataFiles == 0 && problemsDetectedInIndexAndDataFilesMatch == 0 ) { printInfo("No problems detected in any of the files in this directory."); } else { printError("Number of problems detected in index files: " + problemsDetectedInIndexFiles); printError("Number of problems detected in data files: " + problemsDetectedInDataFiles); printError("Number of problems detected in the matching of index and data files: " + problemsDetectedInIndexAndDataFilesMatch); } }
Source:
public List<SyncResponse.FileDownload> getFirmwareUpdate(final String deviceId, final String group, final int currentFirmwareVersion) { Map<Integer, List<SyncResponse.FileDownload>> fw_files = Collections.emptyMap(); try { fw_files = s3FWCache.get(group); } catch (ExecutionException e) { LOGGER.error("Exception while retrieving S3 file list."); } if (fw_files.isEmpty()) { LOGGER.error("Failed to retrieve S3 file list."); return Collections.EMPTY_LIST; } final Integer firmwareVersion = new ArrayList<>(fw_files.keySet()).get(0); LOGGER.warn("Versions to update: {}, current version = for deviceId = {}", firmwareVersion, currentFirmwareVersion, deviceId); if (firmwareVersion.equals(currentFirmwareVersion)) { LOGGER.warn("Versions match: {}, current version = {}", firmwareVersion, currentFirmwareVersion); return Collections.EMPTY_LIST; } return fw_files.get(firmwareVersion); }

Target:
public List<SyncResponse.FileDownload> getFirmwareUpdate(final String deviceId, final String group, final int currentFirmwareVersion) { Pair<Integer, List<SyncResponse.FileDownload>> fw_files = new Pair(-1, Collections.EMPTY_LIST); try { fw_files = s3FWCache.get(group, new Callable<Pair<Integer, List<SyncResponse.FileDownload>>>() { @Override public Pair<Integer, List<SyncResponse.FileDownload>> call() throws Exception { LOGGER.debug("Nothing in cache found for group: [{}]. Grabbing info from S3.", group); return getFirmwareFilesForGroup(group); } }); } catch (ExecutionException e) { LOGGER.error("Exception while retrieving S3 file list."); } final Integer firmwareVersion = fw_files.getKey(); if (firmwareVersion == -1) { LOGGER.error("Failed to retrieve S3 file list."); return Collections.EMPTY_LIST; } LOGGER.warn("Versions to update: {}, current version = for deviceId = {}", firmwareVersion, currentFirmwareVersion, deviceId); if (firmwareVersion.equals(currentFirmwareVersion)) { LOGGER.warn("Versions match: {}, current version = {}", firmwareVersion, currentFirmwareVersion); return Collections.EMPTY_LIST; } return fw_files.getValue(); }
Source:
public void init() throws APIManagerIntegrationTestException, APIManagementException, RemoteException, UserAdminUserAdminException { createUserWithPublisherAndCreatorRole(API_CREATOR_PUBLISHER_USER, API_CREATOR_PUBLISHER_USER, ADMIN, ADMIN); apiPublisher = new APIPublisherRestClient(publisherURL); apiPublisher.login(API_CREATOR_PUBLISHER_USER, API_CREATOR_PUBLISHER_USER); createUserWithSubscriberRole(API_SUBSCRIBER_USER, API_SUBSCRIBER_USER, ADMIN, ADMIN); apiStore = new APIStoreRestClient(storeURL); apiStore.login(API_SUBSCRIBER_USER, API_SUBSCRIBER_USER); }

Target:
public void init() throws APIManagerIntegrationTestException, APIManagementException, RemoteException, UserAdminUserAdminException { createUserWithPublisherAndCreatorRole(API_CREATOR_PUBLISHER_USERNAME, API_CREATOR_PUBLISHER_PW, ADMIN_USERNAME, ADMIN_PW); apiPublisher = new APIPublisherRestClient(publisherURL); apiPublisher.login(API_CREATOR_PUBLISHER_USERNAME, API_CREATOR_PUBLISHER_PW); createUserWithSubscriberRole(API_SUBSCRIBER_USERNAME, API_SUBSCRIBER_PW, ADMIN_USERNAME, ADMIN_PW); apiStore = new APIStoreRestClient(storeURL); apiStore.login(API_SUBSCRIBER_USERNAME, API_SUBSCRIBER_PW); }
Source:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case STUDENT_SUBMISSION: case STUDENT_RESULT: if (userInfo == null && StringHelper.isEmpty(getRequestParamValue(Const.ParamsNames.REGKEY))) { throw new UnauthorizedAccessException("Instructor or Student account is required to access this resource."); } StudentAttributes studentAttributes = getStudentOfCourseFromRequest(courseId); checkAccessControlForStudentFeedbackSubmission(studentAttributes, feedbackSession); break; case FULL_DETAIL: if (userInfo == null) { throw new UnauthorizedAccessException("Instructor account is required to access this resource."); } gateKeeper.verifyAccessible( logic.getInstructorForGoogleId(courseId, userInfo.getId()), feedbackSession); break; case INSTRUCTOR_SUBMISSION: case INSTRUCTOR_RESULT: if (userInfo == null) { throw new UnauthorizedAccessException("Instructor account is required to access this resource."); } InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(courseId); checkAccessControlForInstructorFeedbackSubmission(instructorAttributes, feedbackSession); break; default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }

Target:
public void checkSpecificAccessControl() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case STUDENT_SUBMISSION: case STUDENT_RESULT: StudentAttributes studentAttributes = getStudentOfCourseFromRequest(courseId); checkAccessControlForStudentFeedbackSubmission(studentAttributes, feedbackSession); break; case FULL_DETAIL: gateKeeper.verifyLoggedInUserPrivileges(); gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(courseId, userInfo.getId()), feedbackSession); break; case INSTRUCTOR_SUBMISSION: case INSTRUCTOR_RESULT: InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(courseId); checkAccessControlForInstructorFeedbackSubmission(instructorAttributes, feedbackSession); break; default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }
Source:
public void initOAuthClient() { authenticatedClient = JerseyClientHelper.clientBuilder() .setRedirectsEnabled(false) .setCredentials("Administrator", "Administrator") .build(); client = JerseyClientHelper.clientBuilder() .setRedirectsEnabled(false) .setConnectionRequestTimeout(500000) .setSocketTimeout(500000) .setConnectTimeout(500000) .build(); transientStore = (TransientStoreProvider) transientStoreService.getStore(AuthorizationRequest.STORE_NAME); tokenStore = new OAuth2TokenStore(TOKEN_SERVICE); }

Target:
public void initOAuthClient() { authenticatedClient = JerseyClientHelper.clientBuilder() .setRedirectsEnabled(false) .setCredentials("Administrator", "Administrator") .build(); client = JerseyClientHelper.clientBuilder().setRedirectsEnabled(false).build(); transientStore = (TransientStoreProvider) transientStoreService.getStore(AuthorizationRequest.STORE_NAME); tokenStore = new OAuth2TokenStore(TOKEN_SERVICE); }
Source:
private void detectIndexChanges() { if (isBare()) { return; } File indexFile = getIndexFile(); boolean notify = false; synchronized (this) { if (snapshot == null) { snapshot = FileSnapshot.save(indexFile); } else if (snapshot.isModified(indexFile)) { notify = true; } } if (notify) { notifyIndexChanged(false); } }

Target:
private void detectIndexChanges() { if (isBare()) { return; } File indexFile = getIndexFile(); lock.lock(); try { if (snapshot == null) { snapshot = FileSnapshot.save(indexFile); } else if (snapshot.isModified(indexFile)) { notifyIndexChanged(false); } } finally { if (lock.isHeldByCurrentThread()) { lock.unlock(); } } }
Source:
public boolean isTriggerExpired() { isExpired = isExpired || expireCondition.isMet(); return isExpired; }

Target:
public boolean isTriggerExpired() { return expireCondition.isMet(); }
Source:
public ConfigXml(Context context) { mConfigFile = getConfigFile(context); boolean isFirstStart = !mConfigFile.exists(); if (isFirstStart) { Log.i(TAG, "App started for the first time. Generating keys and config."); generateKeysConfig(context); } for (int i = 0; i < 10; i++) { try { DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); mConfig = db.parse(mConfigFile); } catch (SAXException | ParserConfigurationException | IOException e) { Log.w(TAG, "Failed to open config, moving to " + INVALID_CONFIG_FILE + " and creating blank config"); File dest = new File(mConfigFile.getParent(), INVALID_CONFIG_FILE); if (dest.exists()) dest.delete(); mConfigFile.renameTo(dest); generateKeysConfig(context); isFirstStart = true; mConfigFile = getConfigFile(context); } if (mConfig != null) break; } if (mConfig == null) { Log.i(TAG, "Failed to set up config file"); Toast.makeText(context, "Failed to set up config file", Toast.LENGTH_LONG).show(); return; } if (isFirstStart) { changeDefaultFolder(); } updateIfNeeded(); }

Target:
public ConfigXml(Context context) { mConfigFile = getConfigFile(context); boolean isFirstStart = !mConfigFile.exists(); if (isFirstStart) { Log.i(TAG, "App started for the first time. Generating keys and config."); generateKeysConfig(context); } do { try { DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder(); mConfig = db.parse(mConfigFile); } catch (SAXException | ParserConfigurationException | IOException e) { Log.w(TAG, "Failed to open config, moving to " + INVALID_CONFIG_FILE + " and creating blank config"); File dest = new File(mConfigFile.getParent(), INVALID_CONFIG_FILE); if (dest.exists()) dest.delete(); mConfigFile.renameTo(dest); generateKeysConfig(context); isFirstStart = true; mConfigFile = getConfigFile(context); } } while (mConfig == null); if (isFirstStart) { changeDefaultFolder(); } updateIfNeeded(); }
Source:
public int getBaseTime() { int time = 0; if (campaign.getCampaignOptions().useAeroSystemHits()) { time = 120; if (unit != null && unit.getEntity().hasNavalC3()) { time *= 2; } if (hits == 1) { time *= 1; } if (hits == 2) { time *= 2; } return time; } if(isSalvaging()) { time = 4320; } else { time = 120; } return time; }

Target:
public int getBaseTime() { int time = 0; if (campaign.getCampaignOptions().useAeroSystemHits()) { time = 120; if (unit != null && unit.getEntity().hasNavalC3()) { time *= 2; } if (hits == 2) { time *= 2; } return time; } if(isSalvaging()) { time = 4320; } else { time = 120; } return time; }
Source:
public void loadDimensionIterable(Iterable<String> oldDimensionOrder) { int i = 0; for (String dim : oldDimensionOrder) { dimensionOrder.put(dim, i); dimensions.add(dim); dimValues.add(dim); } }

Target:
public void loadDimensionIterable(Iterable<String> oldDimensionOrder) { synchronized (dimensionDescs) { if (!dimensionDescs.isEmpty()) { throw new ISE("Cannot load dimension order when existing order[%s] is not empty.", dimensionDescs.keySet()); } for (String dim : oldDimensionOrder) { if (dimensionDescs.get(dim) == null) { ColumnCapabilitiesImpl capabilities = new ColumnCapabilitiesImpl(); capabilities.setType(ValueType.STRING); columnCapabilities.put(dim, capabilities); DimensionDesc desc = new DimensionDesc(dimensionDescs.size(), dim, newDimDim(dim), capabilities); dimensionDescs.put(dim, desc); } } } }
Source:
private String renderPopoverJs() { StringBuilder builder = new StringBuilder(); builder.append("var popup = " + getJsId() + ";"); builder.append("var element = popup.getElement();"); builder.append("$(element).popover('destroy');"); builder.append("popup.setPosition(" + position.renderJs() + ");"); builder.append("$(element).popover({"); if (titleModel != null) { builder.append("'title': '" + Strings.escapeMarkup(titleModel.getObject()) + "',"); } if (placement != null) { builder.append("'placement': '" + placement + "',"); } if (html != null) { builder.append("'html': '" + html + "',"); } if (html != null) { builder.append("'content': '" + Strings.escapeMarkup(model.getObject()) + "',"); } builder.append("});"); return builder.toString(); }

Target:
private String renderPopoverJs() { StringBuilder builder = new StringBuilder(); builder.append("var popup = " + getJsId() + ";"); builder.append("var element = popup.getElement();"); builder.append("$(element).popover('destroy');"); builder.append("popup.setPosition(" + position.renderJs() + ");"); builder.append("$(element).popover({"); if (titleModel != null) { builder.append("'title': '" + escapeQuoteJs(titleModel.getObject()) + "',"); } if (placement != null) { builder.append("'placement': '" + placement + "',"); } builder.append("'html': '" + html + "',"); if (html) { builder.append("'content': '" + escapeQuoteJs(model.getObject()) + "',"); } else { builder.append("'content': '" + Strings.escapeMarkup(model.getObject()) + "',"); } builder.append("});"); return builder.toString(); }
Source:
public List<UserLotteryPrizeView> findUserLotteryPrizeViewsByHeadlinesToday(String mobile,LotteryPrize selectPrize,ActivityCategory prizeType,Date startTime,Date endTime,Integer index,Integer pageSize, String authenticationType){ List<UserLotteryPrizeView> lotteryPrizeViewList = userLotteryPrizeMapper.findUserLotteryPrizeViews(mobile, selectPrize, prizeType, startTime, endTime, index, pageSize); if(authenticationType.equals("0")){ return lotteryPrizeViewList.stream() .filter(userLotteryPrizeView -> Strings.isNullOrEmpty(userLotteryPrizeView.getUserName())) .collect(Collectors.toList()); } else if(authenticationType.equals("1")){ return lotteryPrizeViewList.stream() .filter(userLotteryPrizeView -> !Strings.isNullOrEmpty(userLotteryPrizeView.getUserName())) .collect(Collectors.toList()); } lotteryPrizeViewList = Lists.transform(lotteryPrizeViewList, userLotteryPrizeView -> { userLotteryPrizeView.setInvestFlag(investMapper.sumSuccessInvestCountByLoginName(userLotteryPrizeView.getLoginName()) > 0 ? "是" : "否"); return userLotteryPrizeView; }); return lotteryPrizeViewList; }

Target:
public List<UserLotteryPrizeView> findUserLotteryPrizeViewsByHeadlinesToday(String mobile, LotteryPrize selectPrize, ActivityCategory prizeType, Date startTime, Date endTime, Integer index, Integer pageSize, String authenticationType) { List<UserLotteryPrizeView> lotteryPrizeViewList = userLotteryPrizeMapper.findUserLotteryPrizeViews(mobile, selectPrize, prizeType, startTime, endTime, index, pageSize); return lotteryPrizeViewList.stream() .filter((UserLotteryPrizeView userLotteryPrizeView) -> isSpecialAuthType(authenticationType, userLotteryPrizeView)) .map(userLotteryPrizeView -> { userLotteryPrizeView.setInvestFlag(investMapper.sumSuccessInvestCountByLoginName(userLotteryPrizeView.getLoginName()) > 0 ? "是" : "否"); return userLotteryPrizeView; }).collect(Collectors.toList()); }
Source:
public static String encode(String s, Charset enc) { try { return encode(s, enc.displayName()); } catch (UnsupportedEncodingException e) { throw new AssertionError(e); } }

Target:
public static String encode(String s, Charset enc) { Objects.requireNonNull(s); Objects.requireNonNull(enc); StringBuffer buf = new StringBuffer(s.length() + 16); int start = -1; for (int i = 0; i < s.length(); i++) { char ch = s.charAt(i); if (ch >= 'a' && ch <= 'z' || ch >= 'A' && ch <= 'Z' || ch >= '0' && ch <= '9' || " .-*_".indexOf(ch) > -1) { if (start >= 0) { convert(s.substring(start, i), buf, enc); start = -1; } if (ch != ' ') { buf.append(ch); } else { buf.append('+'); } } else { if (start < 0) { start = i; } } } if (start >= 0) { convert(s.substring(start), buf, enc); } return buf.toString(); }
Source:
private boolean areChangesSubmittable(List<ChangeData> changes, IdentifiedUser identifiedUser) { for (ChangeData c : changes) { try { ChangeControl changeControl = c.changeControl().forUser( identifiedUser); if (!changeControl.canSubmit()) { return false; } } catch (OrmException e) { log.error("Failed to get a ChangeControl for Change.Id " + String.valueOf(c.getId()), e); return false; } } for (ChangeData c : changes) { try { checkSubmitRule(c, c.currentPatchSet(), false); } catch (OrmException | ResourceConflictException e) { return false; } } return true; }

Target:
private String areChangesSubmittable(List<ChangeData> changes, IdentifiedUser identifiedUser) { for (ChangeData c : changes) { try { ChangeControl changeControl = c.changeControl().forUser( identifiedUser); if (!changeControl.isVisible(dbProvider.get())) { return submitTopicTooltipHiddenBlocked; } if (!changeControl.canSubmit()) { return submitTopicTooltipBlocked; } checkSubmitRule(c, c.currentPatchSet(), false); } catch (OrmException e) { log.error(String.valueOf(e)); throw new OrmRuntimeException(e); } catch (ResourceConflictException e) { return submitTopicTooltipBlocked; } } return null; }
Source:
public <Q, R> Stream<QueryResponseMessage<R>> scatterGather(QueryMessage<Q, R> query, long timeout, TimeUnit unit) { MessageMonitor.MonitorCallback monitorCallback = messageMonitor.onMessageIngested(query); QueryMessage<Q, R> interceptedQuery = intercept(query); List<MessageHandler<? super QueryMessage<?, ?>>> handlers = getHandlersForMessage(interceptedQuery); if (handlers.isEmpty()) { monitorCallback.reportIgnored(); return Stream.empty(); } long deadline = System.currentTimeMillis() + unit.toMillis(timeout); return handlers.stream() .map(handler -> { try { long leftTimeout = deadline - System.currentTimeMillis(); leftTimeout = leftTimeout < 0 ? 0 : leftTimeout; QueryResponseMessage<R> response = interceptAndInvoke(DefaultUnitOfWork.startAndGet(interceptedQuery), handler) .get(leftTimeout, TimeUnit.MILLISECONDS); monitorCallback.reportSuccess(); return response; } catch (Exception e) { monitorCallback.reportFailure(e); errorHandler.onError(e, interceptedQuery, handler); return null; } }).filter(Objects::nonNull); }

Target:
public <Q, R> Stream<QueryResponseMessage<R>> scatterGather(QueryMessage<Q, R> query, long timeout, TimeUnit unit) { MessageMonitor.MonitorCallback monitorCallback = messageMonitor.onMessageIngested(query); QueryMessage<Q, R> interceptedQuery = intercept(query); List<MessageHandler<? super QueryMessage<?, ?>>> handlers = getHandlersForMessage(interceptedQuery); if (handlers.isEmpty()) { monitorCallback.reportIgnored(); return Stream.empty(); } long deadline = System.currentTimeMillis() + unit.toMillis(timeout); return handlers.stream() .map(handler -> { try { long leftTimeout = getRemainingOfDeadline(deadline); QueryResponseMessage<R> response = interceptAndInvoke(DefaultUnitOfWork.startAndGet(interceptedQuery), handler) .get(leftTimeout, TimeUnit.MILLISECONDS); monitorCallback.reportSuccess(); return response; } catch (Exception e) { monitorCallback.reportFailure(e); errorHandler.onError(e, interceptedQuery, handler); return null; } }).filter(Objects::nonNull); }
Source:
public ProxyUtil(Class<O> interfaceClazz, ClassLoader parentClassLoader) { this.interfaceClazz = interfaceClazz; this.parentClassLoader = parentClassLoader; this.cachedClassLoaders = new HashMap<>(); }

Target:
public ProxyUtil(Class<O> interfaceClazz, ClassLoader parentClassLoader) { this.interfaceClazz = interfaceClazz; this.parentClassLoader = parentClassLoader; this.cachedClassLoaders = new ConcurrentHashMap<>(); }
Source:
private SearchParameters getSearchParameters(SearchType searchType, String constraint) { SearchParameters searchParams = new SearchParameters(constraint, searchType); HashMap<String, String> queryConstraints = QueryHelper.getQueryConstraints(getUriInfo(), FROM_CONSTRAINT_PARAMETER); HashMap<String, String> matrixConstraints = QueryHelper.getMatrixConstraints(getUriInfo(), CASE_SENSITIVE_CONSTRAINT_PARAMETER); if (queryConstraints.containsKey(FROM_CONSTRAINT_PARAMETER)) { try { searchParams.setSearchFrom(Long.parseLong(queryConstraints.get(FROM_CONSTRAINT_PARAMETER))); } catch (Exception ex) { LOG.error("Unwrapping of '"+FROM_CONSTRAINT_PARAMETER+"' search parameter failed.", ex); } } if (matrixConstraints.containsKey(CASE_SENSITIVE_CONSTRAINT_PARAMETER)) { try { searchParams.setCaseSensitive(Boolean.parseBoolean(matrixConstraints.get(CASE_SENSITIVE_CONSTRAINT_PARAMETER))); } catch (Exception ex) { LOG.error("Unwrapping of '"+CASE_SENSITIVE_CONSTRAINT_PARAMETER+"' search parameter failed.", ex); } } if (QueryHelper.hasMatrixParam(getUriInfo(), MAX)) { searchParams.setMaxCount(getMaxResults()); } return searchParams; }

Target:
private SearchParameters getSearchParameters(SearchType searchType, String constraint) { SearchParameters searchParams = new SearchParameters(constraint, searchType); HashMap<String, String> queryConstraints = QueryHelper.getQueryConstraints(getUriInfo(), FROM_CONSTRAINT_PARAMETER); HashMap<String, String> matrixConstraints = QueryHelper.getMatrixConstraints(getUriInfo(), CASE_SENSITIVE_CONSTRAINT_PARAMETER); if (queryConstraints.containsKey(FROM_CONSTRAINT_PARAMETER)) { try { searchParams.setSearchFrom(Long.parseLong(queryConstraints.get(FROM_CONSTRAINT_PARAMETER))); } catch (Exception ex) { LOG.error("Unwrapping of '"+FROM_CONSTRAINT_PARAMETER+"' search parameter failed.", ex); } } if (matrixConstraints.containsKey(CASE_SENSITIVE_CONSTRAINT_PARAMETER)) { try { searchParams.setCaseSensitive(Boolean.parseBoolean(matrixConstraints.get(CASE_SENSITIVE_CONSTRAINT_PARAMETER))); } catch (Exception ex) { LOG.error("Unwrapping of '"+CASE_SENSITIVE_CONSTRAINT_PARAMETER+"' search parameter failed.", ex); } } if (QueryHelper.hasMatrixParam(getUriInfo(), MAX) && getMaxResults()!=NO_LIMIT) { searchParams.setMaxCount(getMaxResults()); } return searchParams; }
Source:
public Block copyPositions(int[] positions, int offset, int length) { checkValidPositions(positions, offset, length, positionCount); int finalLength = 0; for (int i = offset; i < offset + length; ++i) { finalLength += getSliceLength(positions[i]); } SliceOutput newSlice = Slices.allocate(finalLength).getOutput(); int[] newOffsets = new int[length + 1]; boolean[] newValueIsNull = new boolean[length]; for (int i = 0; i < length; i++) { int position = positions[offset + i]; if (isEntryNull(position)) { newValueIsNull[i] = true; } else { newSlice.appendBytes(slice.getBytes(getPositionOffset(position), getSliceLength(position))); } newOffsets[i + 1] = newSlice.size(); } return new VariableWidthBlock(length, newSlice.slice(), newOffsets, newValueIsNull); }

Target:
public Block copyPositions(int[] positions, int offset, int length) { checkValidPositions(positions, offset, length, positionCount); int finalLength = stream(positions, offset, offset + length) .map(this::getSliceLength) .sum(); SliceOutput newSlice = Slices.allocate(finalLength).getOutput(); int[] newOffsets = new int[length + 1]; boolean[] newValueIsNull = new boolean[length]; for (int i = 0; i < length; i++) { int position = positions[offset + i]; if (isEntryNull(position)) { newValueIsNull[i] = true; } else { newSlice.appendBytes(slice.getBytes(getPositionOffset(position), getSliceLength(position))); } newOffsets[i + 1] = newSlice.size(); } return new VariableWidthBlock(length, newSlice.slice(), newOffsets, newValueIsNull); }
Source:
private boolean basePosUpdated(TpeContext oldCtx, TpeContext newCtx) { SPTarget oldBasePos = oldCtx.targets().baseOrNull(); SPTarget newBasePos = newCtx.targets().baseOrNull(); if (newBasePos == null) return oldBasePos != null; if (oldBasePos == null) return true; ITarget oldBase = oldBasePos.getTarget(); ITarget newBase = newBasePos.getTarget(); Option<Long> oldWhen = oldCtx.schedulingBlockJava().map(SchedulingBlock::start); Option<Long> newWhen = oldCtx.schedulingBlockJava().map(SchedulingBlock::start); return (oldBase.getRaDegrees(oldWhen) != newBase.getRaDegrees(newWhen) || oldBase.getDecDegrees(oldWhen) != newBase.getDecDegrees(newWhen)); }

Target:
private boolean basePosUpdated(TpeContext oldCtx, TpeContext newCtx) { SPTarget oldBasePos = oldCtx.targets().baseOrNull(); SPTarget newBasePos = newCtx.targets().baseOrNull(); if (newBasePos == null) return oldBasePos != null; if (oldBasePos == null) return true; ITarget oldBase = oldBasePos.getTarget(); ITarget newBase = newBasePos.getTarget(); Option<Long> oldWhen = oldCtx.schedulingBlockJava().map(SchedulingBlock::start); Option<Long> newWhen = newCtx.schedulingBlockJava().map(SchedulingBlock::start); return (!(oldBase.getRaDegrees(oldWhen).equals(newBase.getRaDegrees(newWhen)) && oldBase.getDecDegrees(oldWhen).equals(newBase.getDecDegrees(newWhen))); }
Source:
public boolean conforms() { return in().numDimensions() == 2; }

Target:
public boolean conforms() { if (in().numDimensions() == 2) { long max_dist = in().dimension(0) * in().dimension(0) + in().dimension(1) * in().dimension(1); return ((in().numDimensions() == 2) && (max_dist <= Integer.MAX_VALUE)); } return false; }
Source:
private void handleInetSockLocalOut(ITmfEvent event) { Object cpuObj = TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpuObj == null) { throw new NullPointerException(); } Integer cpu = (Integer) cpuObj; String host = event.getTrace().getHostId(); LttngInterruptContext intCtx = fSystem.peekContextStack(host, cpu); Context context = intCtx.getContext(); LttngWorker sender = null; if (context == Context.NONE) { sender = fSystem.getWorkerOnCpu(event.getTrace().getHostId(), cpu); } else if (context == Context.SOFTIRQ) { sender = getOrCreateKernelWorker(event, cpu); } if (sender == null) { return; } TmfVertex endpoint = stateExtend(sender, event.getTimestamp().getValue()); fTcpNodes.put(event, endpoint); fTcpMatching.matchEvent(event, event.getTrace(), new NullProgressMonitor()); }

Target:
private void handleInetSockLocalOut(ITmfEvent event) { Object cpuObj = TmfTraceUtils.resolveEventAspectOfClassForEvent(event.getTrace(), TmfCpuAspect.class, event); if (cpuObj == null) { throw new NullPointerException(); } Integer cpu = (Integer) cpuObj; String host = event.getTrace().getHostId(); LttngSystemModel system = getProvider().getSystem(); LttngInterruptContext intCtx = system.peekContextStack(host, cpu); Context context = intCtx.getContext(); LttngWorker sender = null; if (context == Context.NONE) { sender = system.getWorkerOnCpu(event.getTrace().getHostId(), cpu); } else if (context == Context.SOFTIRQ) { sender = getOrCreateKernelWorker(event, cpu); } if (sender == null) { return; } TmfVertex endpoint = stateExtend(sender, event.getTimestamp().getValue()); fTcpNodes.put(event, endpoint); fTcpMatching.matchEvent(event, event.getTrace(), new NullProgressMonitor()); }
Source:
protected void mergeOptions(FieldMapper other, List<String> conflicts) { if (this.enablePositionIncrements != ((TokenCountFieldMapper)other).enablePositionIncrements) { conflicts.add("mapper [" + name() + "] has a different [enable_position_increments] setting"); } if (Objects.equals(this.nullValue, ((TokenCountFieldMapper)other).nullValue) == false) { conflicts.add("mapper [" + name() + "] has a different [null_value] setting"); } this.analyzer = ((TokenCountFieldMapper)other).analyzer; }

Target:
protected void mergeOptions(FieldMapper other, List<String> conflicts) { if (this.enablePositionIncrements != ((TokenCountFieldMapper)other).enablePositionIncrements) { conflicts.add("mapper [" + name() + "] has a different [enable_position_increments] setting"); } this.analyzer = ((TokenCountFieldMapper)other).analyzer; }
Source:
public void setMaxPerRepository(String repository, int max) { if (max > 0) { HttpRoute httpRoute = getHttpRouteFromRepository(repository); poolingHttpClientConnectionManager.setMaxPerRoute(httpRoute, max); } else { LOGGER.warn("Not setting max repository connections to as it is no positive value", max); } }

Target:
public void setMaxPerRepository(String repository, int max) { if (max > 0) { HttpRoute httpRoute = getHttpRouteFromRepository(repository); poolingHttpClientConnectionManager.setMaxPerRoute(httpRoute, max); } else { logger.warn("Not setting max repository connections to as it is no positive value", max); } }
Source:
static long calculateRocksDBDefaultArenaBlockSize(long writeBufferSize) { long arenaBlockSize = writeBufferSize / 8; long align = 4 * 1024; return ((arenaBlockSize + align - 1) / align) * align; }

Target:
static long calculateRocksDBDefaultArenaBlockSize(long writeBufferSize) { long arenaBlockSize = writeBufferSize / 8; final long align = 4 * 1024; return ((arenaBlockSize + align - 1) / align) * align; }
Source:
OpenVRState() { for (int c = 0; c < 2; c++) { lastControllerState[c] = new VRControllerState_t(); controllerPose[c] = new Matrix4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); eyePoses[c] = new Matrix4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); projectionMatrices[c] = new Matrix4f(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1); for (int i = 0; i < 5; i++) { lastControllerState[c].rAxis[i] = new VRControllerAxis_t(); } } }

Target:
public OpenVRState() { for (int handIndex = 0; handIndex < 2; handIndex++) { lastControllerState[handIndex] = new VRControllerState_t(); controllerPose[handIndex] = OpenVRUtil.createIdentityMatrix4f(); eyePoses[handIndex] = OpenVRUtil.createIdentityMatrix4f(); projectionMatrices[handIndex] = OpenVRUtil.createIdentityMatrix4f(); for (int i = 0; i < 5; i++) { lastControllerState[handIndex].rAxis[i] = new VRControllerAxis_t(); } } }
Source:
public Object execute(final ExecutionEvent event) { final ImageBuild wizard = new ImageBuild(); final WizardDialog wizardDialog = new NonModalWizardDialog(HandlerUtil.getActiveShell(event), wizard); wizardDialog.create(); IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); IWorkbenchPage activePage = null; IWorkbenchPart activePart = null; if (window != null) activePage = window.getActivePage(); if (activePage != null) activePart = activePage.getActivePart(); connection = CommandUtils.getCurrentConnection(activePart); if (connection == null) { IDockerConnection[] connections = DockerConnectionManager .getInstance().getConnections(); if (connections.length > 0) connection = connections[0]; } if (connection == null || connection.isOpen()) { Display.getDefault().syncExec(() -> MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(), WizardMessages.getString("ErrorNoActiveConnection.msg"), WizardMessages.getString("ErrorNoActiveConnection.desc"))); return null; } final boolean buildImage = wizardDialog.open() == Window.OK; if (buildImage) { performBuildImage(wizard); } return null; }

Target:
public Object execute(final ExecutionEvent event) { final ImageBuild wizard = new ImageBuild(); final WizardDialog wizardDialog = new NonModalWizardDialog(HandlerUtil.getActiveShell(event), wizard); wizardDialog.create(); IWorkbenchWindow window = PlatformUI.getWorkbench() .getActiveWorkbenchWindow(); IWorkbenchPage activePage = null; IWorkbenchPart activePart = null; if (window != null) activePage = window.getActivePage(); if (activePage != null) activePart = activePage.getActivePart(); connection = CommandUtils.getCurrentConnection(activePart); if (connection == null) { IDockerConnection[] connections = DockerConnectionManager .getInstance().getConnections(); if (connections.length > 0) connection = connections[0]; } if (connection == null || !connection.isOpen()) { Display.getDefault().syncExec(() -> MessageDialog.openError( PlatformUI.getWorkbench().getActiveWorkbenchWindow() .getShell(), WizardMessages.getString("ErrorNoActiveConnection.msg"), WizardMessages.getString("ErrorNoActiveConnection.desc"))); return null; } final boolean buildImage = wizardDialog.open() == Window.OK; if (buildImage) { performBuildImage(wizard); } return null; }
Source:
public void executeCommand(CommandSender sender, List<String> arguments) { Set<OfflinePlayer> bannedPlayers = bukkitService.getBannedPlayers(); Set<String> namedBanned = new HashSet<>(bannedPlayers.size()); for (OfflinePlayer offlinePlayer : bannedPlayers) { namedBanned.add(offlinePlayer.getName()); } purgeService.purgePlayers(sender, namedBanned, bannedPlayers.toArray(new OfflinePlayer[0])); }

Target:
public void executeCommand(CommandSender sender, List<String> arguments) { Set<OfflinePlayer> bannedPlayers = bukkitService.getBannedPlayers(); Set<String> namedBanned = new HashSet<>(bannedPlayers.size()); for (OfflinePlayer offlinePlayer : bannedPlayers) { namedBanned.add(offlinePlayer.getName()); } purgeService.purgePlayers(sender, namedBanned, bannedPlayers.toArray(new OfflinePlayer[bannedPlayers.size()])); }
Source:
public void run() { ch.qos.logback.core.rolling.RollingFileAppender appender = null; ch.qos.logback.classic.Logger logger = initLogger("metricsLogger"); try { createDirs(stateDirPath); createFile(stateDirPath + "/" + metricsFileName); appender = initAppender(stateDirPath.getAbsolutePath(), metricsFileName); writeMetricsHeader(logger, appender); while (isRunning()) { Thread.sleep(metricsSleepInterval); String currentDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()); writeMetrics(logger, appender, currentDate); resetMetrics(); } } catch (InterruptedException e) { LOG.debug("Metric Processor was interrupted"); } finally { if (appender != null) { String currentDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()); writeMetrics(logger, appender, currentDate); appender.stop(); } } LOG.info("Metrics Processor stopped"); }

Target:
public void run() { RollingFileAppender appender = null; ch.qos.logback.classic.Logger logger = initLogger("metricsLogger"); try { createDirs(stateDirPath); createFile(stateDirPath + "/" + metricsFileName); appender = initAppender(stateDirPath.getAbsolutePath(), metricsFileName); writeMetricsHeader(logger, appender); while (isRunning()) { Thread.sleep(metricsSleepInterval); String currentDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()); writeMetrics(logger, appender, currentDate); resetMetrics(); } } catch (InterruptedException e) { LOG.debug("Metric Processor was interrupted"); } finally { if (appender != null) { String currentDate = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS").format(new Date()); writeMetrics(logger, appender, currentDate); appender.stop(); } } LOG.info("Metrics Processor stopped"); }
Source:
public void execute() throws TranslatorException { String path = this.visitor.getParquetPath(); if(this.visitor.getTable().getProperty(ParquetMetadataProcessor.PARTITIONING_SCHEME) != null && this.visitor.getTable().getProperty(ParquetMetadataProcessor.PARTITIONING_SCHEME).equals("directory")){ path += getDirectoryPath(this.visitor.getColumnPredicates(), this.visitor.getTable().getProperty(ParquetMetadataProcessor.PARTITIONED_COLUMNS)); } this.parquetFiles = VirtualFileConnection.Util.getFiles(path, this.connection, true); VirtualFile nextParquetFile = getNextParquetFile(); if (nextParquetFile != null) { this.rowIterator = readParquetFile(nextParquetFile); } }

Target:
public void execute() throws TranslatorException { String path = this.visitor.getParquetPath(); if(this.visitor.getTable().getProperty(ParquetMetadataProcessor.PARTITIONED_COLUMNS) != null) { path += getDirectoryPath(this.visitor.getColumnPredicates(), this.visitor.getTable().getProperty(ParquetMetadataProcessor.PARTITIONED_COLUMNS)); } this.parquetFiles = VirtualFileConnection.Util.getFiles(path, this.connection, true, false); VirtualFile nextParquetFile = getNextParquetFile(); if (nextParquetFile != null) { this.rowIterator = readParquetFile(nextParquetFile); } }