auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testExtend() { final TestSubscriber<Object> subscriber = new TestSubscriber<Object>(); final Object value = new Object(); Observable.just(value).x(new ConversionFunc<Object,Object>(){ @Override public Object convert(OnSubscribe<Object> onSubscribe) { onSubscribe.call(subscriber); subscriber.assertNoErrors(); subscriber.assertCompleted(); subscriber.assertValue(value); return subscriber.getOnNextEvents().get(0); }}); }

Target:
public void testExtend() { final TestSubscriber<Object> subscriber = new TestSubscriber<Object>(); final Object value = new Object(); Observable.just(value).x(new Func1<OnSubscribe<Object>,Object>(){ @Override public Object call(OnSubscribe<Object> onSubscribe) { onSubscribe.call(subscriber); subscriber.assertNoErrors(); subscriber.assertCompleted(); subscriber.assertValue(value); return subscriber.getOnNextEvents().get(0); }}); }
Source:
public synchronized void releaseTimer() { int count = refCount.decrementAndGet(); if (count > 0) { LOGGER.log(Level.FINEST, "Outstanding references still exist so not closing shared Timer"); } else if (count == 0) { LOGGER.log(Level.FINEST, "No outstanding references to shared Timer, will cancel and close it"); if (timer != null) { timer.cancel(); timer = null; } } else { LOGGER.log(Level.FINE, "releaseTimer() called too many times; there is probably a bug in the calling code"); refCount.set(0); } }

Target:
public synchronized void releaseTimer() { int count = refCount.decrementAndGet(); if (count > 0) { LOGGER.log(Level.FINEST, "Outstanding references still exist so not closing shared Timer"); } else if (count == 0) { LOGGER.log(Level.FINEST, "No outstanding references to shared Timer, will cancel and close it"); if (timer != null) { timer.cancel(); timer = null; } } else { LOGGER.log(Level.WARNING, "releaseTimer() called too many times; there is probably a bug in the calling code"); refCount.set(0); } }
Source:
public final MaxentModel train(ObjectStream<Event> events) throws IOException { if (!isValid()) { throw new IllegalArgumentException("trainParams are not valid!"); } HashSumEventStream hses = new HashSumEventStream(events); DataIndexer indexer = getDataIndexer(hses); MaxentModel model = doTrain(indexer); parameters.addToReport("Training-Eventhash", hses.calculateHashSum().toString(16)); parameters.addToReport(AbstractTrainer.TRAINER_TYPE_PARAM, EventTrainer.EVENT_VALUE); return model; }

Target:
public final MaxentModel train(ObjectStream<Event> events) throws IOException { if (!isValid()) { throw new IllegalArgumentException("trainParams are not valid!"); } HashSumEventStream hses = new HashSumEventStream(events); DataIndexer indexer = getDataIndexer(hses); return train(indexer); }
Source:
public Set<String> getRequiredColumns() { return null; }

Target:
public Set<String> getRequiredColumns() { return Collections.emptySet(); }
Source:
public synchronized void close() { synchronized (this) { if (timerID >= 0) { client.getVertx().cancelTimer(timerID); timerID = -1; } } endpointMap.clear(); for (HttpClientConnection conn : connectionMap.values()) { conn.close(); } }

Target:
public void close() { synchronized (this) { if (timerID >= 0) { client.getVertx().cancelTimer(timerID); timerID = -1; } } endpointMap.clear(); for (HttpClientConnection conn : connectionMap.values()) { conn.close(); } }
Source:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: prepareToFinish(true); break; case R.id.send: checkToSendMessage(); break; case R.id.save: checkToSaveDraftAndSave(); break; case R.id.discard: askBeforeDiscard(); break; case R.id.add_from_contacts: recipientPresenter.onMenuAddFromContacts(); break; case R.id.openpgp_inline_enable: recipientPresenter.onMenuSetPgpInline(true); updateMessageFormat(); break; case R.id.openpgp_inline_disable: recipientPresenter.onMenuSetPgpInline(false); updateMessageFormat(); break; case R.id.openpgp_sign_only: recipientPresenter.onMenuSetSignOnly(true); break; case R.id.openpgp_sign_only_disable: recipientPresenter.onMenuSetSignOnly(false); break; case R.id.add_attachment: attachmentPresenter.onClickAddAttachment(recipientPresenter); break; case R.id.read_receipt: onReadReceipt(); break; case R.id.is_urgent: if (!isHighPriority) { item.setTitle("Normal"); this.isHighPriority = true; setTitle(getTitle() + ":U"); } else { item.setTitle("Urgent"); this.isHighPriority = false; setTitle(getTitle().toString().split(":")[0]); } break; default: return super.onOptionsItemSelected(item); } return true; }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: prepareToFinish(true); break; case R.id.send: checkToSendMessage(); break; case R.id.save: checkToSaveDraftAndSave(); break; case R.id.discard: askBeforeDiscard(); break; case R.id.add_from_contacts: recipientPresenter.onMenuAddFromContacts(); break; case R.id.openpgp_inline_enable: recipientPresenter.onMenuSetPgpInline(true); updateMessageFormat(); break; case R.id.openpgp_inline_disable: recipientPresenter.onMenuSetPgpInline(false); updateMessageFormat(); break; case R.id.openpgp_sign_only: recipientPresenter.onMenuSetSignOnly(true); break; case R.id.openpgp_sign_only_disable: recipientPresenter.onMenuSetSignOnly(false); break; case R.id.add_attachment: attachmentPresenter.onClickAddAttachment(recipientPresenter); break; case R.id.read_receipt: onReadReceipt(); break; case R.id.is_high_priority: onHighPriority(item); break; default: return super.onOptionsItemSelected(item); } return true; }
Source:
public void attachments_with_different_media_types_can_be_created() throws IOException { given().a_report_model(); attachments .and().an_attachment_with_content_$_and_mediaType(JSON_SAMPLE, MediaType.JSON_UTF_8) .and().file_name("jsonfile") .and().an_attachment_with_binary_content_$_and_mediaType(BINARY_SAMPLE, MediaType.PNG) .and().file_name("pngfile"); given() .and().the_attachments_are_added_to_step_$_of_case_$(1,1); jsonReports .and().the_report_exist_as_JSON_file(); when().the_HTML_Report_Generator_is_executed(); String folder = "data/attachments/Test".replaceAll("/", File.separator.replaceAll("\\\\","\\\\\\\\")); then().a_file_$_exists_in_folder_$("jsonfile.json", folder) .with().content(JSON_SAMPLE) .and().a_file_$_exists_in_folder_$("pngfile.png", folder) .with().binary_content(BINARY_SAMPLE); }

Target:
public void attachments_with_different_media_types_can_be_created() throws IOException { given().a_report_model(); attachments .and().an_attachment_with_content_$_and_mediaType(JSON_SAMPLE, MediaType.JSON_UTF_8) .and().file_name("jsonfile") .and().an_attachment_with_binary_content_$_and_mediaType(BINARY_SAMPLE, MediaType.PNG) .and().file_name("pngfile"); given() .and().the_attachments_are_added_to_step_$_of_case_$(1,1); jsonReports .and().the_report_exist_as_JSON_file(); when().the_HTML_Report_Generator_is_executed(); String folder = "data/attachments/Test".replaceAll("/", Matcher.quoteReplacement(File.separator)); then().a_file_$_exists_in_folder_$("jsonfile.json", folder) .with().content(JSON_SAMPLE) .and().a_file_$_exists_in_folder_$("pngfile.png", folder) .with().binary_content(BINARY_SAMPLE); }
Source:
private void register(Type javaType, JdbcType jdbcType, TypeHandler<?> handler) { if (javaType != null) { Map<JdbcType, TypeHandler<?>> map = typeHandlerMap.get(javaType); if (map == null || map == NULL_TYPE_HANDLER_MAP) { map = new HashMap<>(); map.put(jdbcType, handler); typeHandlerMap.put(javaType, map); } else { map.put(jdbcType, handler); } } allTypeHandlersMap.put(handler.getClass(), handler); }

Target:
private void register(Type javaType, JdbcType jdbcType, TypeHandler<?> handler) { if (javaType != null) { Map<JdbcType, TypeHandler<?>> map = typeHandlerMap.get(javaType); if (map == null || map == NULL_TYPE_HANDLER_MAP) { map = new HashMap<>(); } map.put(jdbcType, handler); typeHandlerMap.put(javaType, map); } allTypeHandlersMap.put(handler.getClass(), handler); }
Source:
public void cloneForRevision_shouldSetAllTheRelevantFields() throws Exception { OrderTest.assertThatAllFieldsAreCopied(new DrugOrder(), "cloneForRevision", "creator", "dateCreated", "action", "changedBy", "concept", "dateChanged", "voided", "dateVoided", "voidedBy", "voidReason", "encounter", "orderNumber", "orderer", "previousOrder", "startDate", "dateStopped", "accessionNumber"); }

Target:
public void cloneForRevision_shouldSetAllTheRelevantFields() throws Exception { DrugOrder drugOrder = new DrugOrder(); Drug drug = new Drug(); drug.setConcept(new Concept()); drugOrder.setDrug(drug); OrderTest.assertThatAllFieldsAreCopied(drugOrder, "cloneForRevision", "creator", "dateCreated", "action", "changedBy", "dateChanged", "voided", "dateVoided", "voidedBy", "voidReason", "encounter", "orderNumber", "orderer", "previousOrder", "startDate", "dateStopped", "accessionNumber"); }
Source:
public Stream<Issue> getUpstreamReferences() throws NameNotFoundException { if (upstreamReferences == null) { JiraIssueHomeImpl home = new JiraIssueHomeImpl(); upstreamReferences = home.findUpstreamReferences(this); } return upstreamReferences; }

Target:
public Stream<Issue> getUpstreamReferences() throws NameNotFoundException { if (upstreamReferences == null) { upstreamReferences = super.getUpstreamReferences(); } return upstreamReferences; }
Source:
public void onStopped() { if (wasHiding && getUserVisibleHint()) { try { wasHiding = false; youTubePlayer.play(); } catch (Exception error) { initializeYoutubePlayer(); } } else if (!getUserVisibleHint()) { youTubePlayer.release(); } }

Target:
public void onStopped() { if (!isInForeground && getUserVisibleHint()) { try { isInForeground = true; youTubePlayer.play(); } catch (Exception error) { initializeYoutubePlayer(); } } }
Source:
public void start(BundleContext context) throws Exception { super.start(context); PreferencesHint.registerPreferenceStore(DiagramUIPlugin.DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); dynamicPreferences = new DynamicDiagramUIPreferences(getPreferenceStore()); adapterFactory = createAdapterFactory(); descriptorsToImages = new HashMap<ImageWithDimensionDescriptor, Image>(); ressourceMissingDocumentProvider = new ResourceMissingDocumentProvider(); workspaceImageFigureRefresher = new WorkspaceImageFigureRefresher(); workspaceImageFigureRefresher.init(); imageSelectorDescriptorRegistryListener = new ImageSelectorDescriptorRegistryListener(); imageSelectorDescriptorRegistryListener.init(); formatDataManagerRegistryListener = new FormatDataManagerRegistryListener(); formatDataManagerRegistryListener.init(); layoutDataManagerRegistryListener = new LayoutDataManagerRegistryListener(); layoutDataManagerRegistryListener.init(); registerDecorationProviders(); }

Target:
public void start(BundleContext context) throws Exception { super.start(context); PreferencesHint.registerPreferenceStore(DiagramUIPlugin.DIAGRAM_PREFERENCES_HINT, getPreferenceStore()); dynamicPreferences = new DynamicDiagramUIPreferences(getPreferenceStore()); adapterFactory = createAdapterFactory(); descriptorsToImages = new HashMap<ImageWithDimensionDescriptor, Image>(); ressourceMissingDocumentProvider = new ResourceMissingDocumentProvider(); workspaceImageFigureRefresher = new WorkspaceImageFigureRefresher(); workspaceImageFigureRefresher.init(); imageSelectorDescriptorRegistryListener = new ImageSelectorDescriptorRegistryListener(); imageSelectorDescriptorRegistryListener.init(); formatDataManagerRegistryListener = new FormatDataManagerRegistryListener(); formatDataManagerRegistryListener.init(); layoutDataManagerRegistryListener = new LayoutDataManagerRegistryListener(); layoutDataManagerRegistryListener.init(); registerCoreDecorationProviders(); }
Source:
public void testCountWindowedStream() { final WindowOperatorStream<Tuple2<String, Integer>> countWindowedStream = (WindowOperatorStream)mappedStream .window(new CountWindowInformation(windowSize, windowEmissionInterval)); Assert.assertEquals(countWindowedStream.getBasicType(), StreamType.BasicType.WINDOWED); Assert.assertEquals(countWindowedStream.getOperatorType(), StreamType.OperatorType.COUNT_WINDOW); final FixedSizeWindowInformation windowInfo = (FixedSizeWindowInformation) countWindowedStream.getWindowInfo(); Assert.assertEquals(windowInfo.getWindowSize(), windowSize); Assert.assertEquals(windowInfo.getWindowEmissionInterval(), windowEmissionInterval); checkEdges(queryBuilder.build().getDAG(), 2, mappedStream, countWindowedStream, StreamType.Direction.LEFT); }

Target:
public void testCountWindowedStream() { final WindowOperatorStream<Tuple2<String, Integer>> countWindowedStream = mappedStream .window(new CountWindowInformation(windowSize, windowEmissionInterval)); Assert.assertEquals(countWindowedStream.getBasicType(), StreamType.BasicType.WINDOWED); Assert.assertEquals(countWindowedStream.getOperatorType(), StreamType.OperatorType.COUNT_WINDOW); final FixedSizeWindowInformation windowInfo = (FixedSizeWindowInformation) countWindowedStream.getWindowInfo(); Assert.assertEquals(windowInfo.getWindowSize(), windowSize); Assert.assertEquals(windowInfo.getWindowEmissionInterval(), windowEmissionInterval); checkEdges(queryBuilder.build().getDAG(), 2, mappedStream, countWindowedStream, StreamType.Direction.LEFT); }
Source:
public void testCharTrailingSpace() throws Exception { execute("CREATE TABLE tpch.char_trailing_space (x char(10))"); assertUpdate("INSERT INTO char_trailing_space VALUES ('test')", 1); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test'", "VALUES 'test'"); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test '", "VALUES 'test'"); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test '", "VALUES 'test'"); assertEquals(getQueryRunner().execute("SELECT * FROM char_trailing_space WHERE x = char ' test'").getRowCount(), 0); QueryRunner queryRunner = createQueryRunnerWithLegacyCoercion(); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test'").getRowCount(), 0); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '").getRowCount(), 0); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '").getRowCount(), 0); MaterializedResult result = queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '"); assertEquals(result.getRowCount(), 1); assertEquals(result.getMaterializedRows().get(0).getField(0), "test "); assertUpdate("DROP TABLE char_trailing_space"); }

Target:
public void testCharTrailingSpace() throws Exception { execute("CREATE TABLE tpch.char_trailing_space (x char(10))"); assertUpdate("INSERT INTO char_trailing_space VALUES ('test')", 1); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test'", "VALUES 'test'"); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test '", "VALUES 'test'"); assertQuery("SELECT * FROM char_trailing_space WHERE x = char 'test '", "VALUES 'test'"); assertEquals(getQueryRunner().execute("SELECT * FROM char_trailing_space WHERE x = char ' test'").getRowCount(), 0); Map<String, String> properties = ImmutableMap.of("deprecated.legacy-char-to-varchar-coercion", "true"); Map<String, String> connectorProperties = ImmutableMap.of("connection-url", postgreSqlServer.getJdbcUrl()); try (QueryRunner queryRunner = new DistributedQueryRunner(getSession(), 3, properties);) { queryRunner.installPlugin(new PostgreSqlPlugin()); queryRunner.createCatalog("postgresql", "postgresql", connectorProperties); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test'").getRowCount(), 0); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '").getRowCount(), 0); assertEquals(queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '").getRowCount(), 0); MaterializedResult result = queryRunner.execute("SELECT * FROM char_trailing_space WHERE x = char 'test '"); assertEquals(result.getRowCount(), 1); assertEquals(result.getMaterializedRows().get(0).getField(0), "test "); } assertUpdate("DROP TABLE char_trailing_space"); }
Source:
public CollisionMask getBoundingArea() { return (CollisionMask) boundingArea; }

Target:
public CollisionMask getBoundingArea() { return boundingArea; }
Source:
public VoltTable[] run(SystemProcedureExecutionContext ctx, String exportSource, String[] targets, String operationMode) throws Exception { VoltTable results = new VoltTable( new ColumnInfo("SOURCE", VoltType.STRING), new ColumnInfo("TARGET", VoltType.STRING), new ColumnInfo("PARTITIONID", VoltType.BIGINT), new ColumnInfo("STATUS", VoltType.BIGINT), new ColumnInfo("MESSAGE", VoltType.STRING)); try { OperationMode.valueOf(operationMode.toUpperCase()); } catch (IllegalArgumentException e){ results.addRow("", "", -1, VoltSystemProcedure.STATUS_FAILURE, e.getMessage()); return new VoltTable[] {results}; } exportSource = exportSource == null ? "" : exportSource; LOG.info("Export " + operationMode + " source:" + exportSource + " targets:" + Arrays.toString(targets)); if (!"".equals(exportSource)) { RealVoltDB volt = (RealVoltDB)VoltDB.instance(); Set<String> exportStreams = CatalogUtil.getExportTableNames( volt.getCatalogContext().database); boolean isThere = exportStreams.stream().anyMatch(exportSource::equalsIgnoreCase); if (!isThere) { results.addRow(exportSource, "", -1,VoltSystemProcedure.STATUS_FAILURE, "Export stream " + exportSource + " does not exist."); return new VoltTable[] {results}; } } return performExportControl(exportSource, targets, operationMode); }

Target:
public VoltTable[] run(SystemProcedureExecutionContext ctx, String exportSource, String[] targets, String operationMode) throws Exception { VoltTable results = new VoltTable( new ColumnInfo("SOURCE", VoltType.STRING), new ColumnInfo("TARGET", VoltType.STRING), new ColumnInfo("PARTITIONID", VoltType.BIGINT), new ColumnInfo("STATUS", VoltType.BIGINT), new ColumnInfo("MESSAGE", VoltType.STRING)); try { OperationMode.valueOf(operationMode.toUpperCase()); } catch (IllegalArgumentException e){ results.addRow("", "", -1, VoltSystemProcedure.STATUS_FAILURE, e.getMessage()); return new VoltTable[] {results}; } exportSource = exportSource == null ? "" : exportSource; LOG.info("Export " + operationMode + " source:" + exportSource + " targets:" + Arrays.toString(targets)); if (!StringUtil.isEmpty(exportSource)) { RealVoltDB volt = (RealVoltDB)VoltDB.instance(); Set<String> exportStreams = CatalogUtil.getExportTableNames( volt.getCatalogContext().database); boolean isThere = exportStreams.stream().anyMatch(exportSource::equalsIgnoreCase); if (!isThere) { results.addRow(exportSource, "", -1,VoltSystemProcedure.STATUS_FAILURE, "Export stream " + exportSource + " does not exist."); return new VoltTable[] {results}; } } return performExportControl(exportSource, targets, operationMode); }
Source:
public String getType(Uri uri) { return "application/xml"; }

Target:
public String getType(Uri uri) { ExportAndShareTask.FileTypes type = ExportAndShareTask.sharedFiles.get(uri.getLastPathSegment()).fileType; return (type == ExportAndShareTask.FileTypes.ZIP) ? "application/zip" : "application/xml"; }
Source:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); FeedbackSessionInfo.FeedbackSessionSaveRequest saveRequest = getAndValidateRequestBody(FeedbackSessionInfo.FeedbackSessionSaveRequest.class); feedbackSession.setInstructions(saveRequest.getInstructions()); feedbackSession.setStartTime(saveRequest.getSubmissionStartTime()); feedbackSession.setEndTime(saveRequest.getSubmissionEndTimestamp()); feedbackSession.setGracePeriodMinutes(saveRequest.getGracePeriod()); feedbackSession.setSessionVisibleFromTime(saveRequest.getSessionVisibleFromTime()); feedbackSession.setResultsVisibleFromTime(saveRequest.getResultsVisibleFromTime()); feedbackSession.setClosingEmailEnabled(saveRequest.isClosingEmailEnabled()); feedbackSession.setPublishedEmailEnabled(saveRequest.isPublishedEmailEnabled()); try { logic.updateFeedbackSession(feedbackSession); } catch (InvalidParametersException | EntityDoesNotExistException e) { throw new InvalidHttpRequestBodyException(e.getMessage(), e); } return new JsonResult(new FeedbackSessionInfo.FeedbackSessionResponse(feedbackSession)); }

Target:
public ActionResult execute() { String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId); FeedbackSessionInfo.FeedbackSessionSaveRequest saveRequest = getAndValidateRequestBody(FeedbackSessionInfo.FeedbackSessionSaveRequest.class); feedbackSession.setInstructions(saveRequest.getInstructions()); feedbackSession.setStartTime(saveRequest.getSubmissionStartTime()); feedbackSession.setEndTime(saveRequest.getSubmissionEndTimestamp()); feedbackSession.setGracePeriodMinutes(saveRequest.getGracePeriod()); feedbackSession.setSessionVisibleFromTime(saveRequest.getSessionVisibleFromTime()); feedbackSession.setResultsVisibleFromTime(saveRequest.getResultsVisibleFromTime()); feedbackSession.setClosingEmailEnabled(saveRequest.isClosingEmailEnabled()); feedbackSession.setPublishedEmailEnabled(saveRequest.isPublishedEmailEnabled()); try { logic.updateFeedbackSession(feedbackSession); } catch (InvalidParametersException ipe) { throw new InvalidHttpRequestBodyException(ipe.getMessage(), ipe); } catch (EntityDoesNotExistException ednee) { return new JsonResult(ednee.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } return new JsonResult(new FeedbackSessionInfo.FeedbackSessionResponse(feedbackSession)); }
Source:
public SearchResult search(Market market, Category category, String queryText, IProgressMonitor monitor) throws CoreException { SearchResult result = new SearchResult(); if (queryText == null || queryText.trim().length() == 0) { result.setMatchCount(0); result.setNodes(new ArrayList<Node>()); } else { String relativeUrl; try { relativeUrl = API_URI_SUFFIX + "/search/apachesolr_search/" + URLEncoder.encode(queryText.trim(), UTF_8); String queryString = ""; if (market != null || category != null) { queryString += "filters="; if (category != null) { queryString += "tid:" + URLEncoder.encode(category.getId(), UTF_8); if (market != null) { queryString += "%20"; } } if (market != null) { queryString += "tid:" + URLEncoder.encode(market.getId(), UTF_8); } } if (queryString.length() > 0) { relativeUrl += '?' + queryString; } } catch (UnsupportedEncodingException e) { throw new IllegalStateException(); } Marketplace marketplace = processRequest(relativeUrl, monitor); Search search = marketplace.getSearch(); if (search == null) { throw new CoreException(createErrorStatus(Messages.DefaultMarketplaceService_unexpectedResponse, null)); } result.setMatchCount(search.getCount()); result.setNodes(search.getNode()); } return result; }

Target:
public SearchResult search(Market market, Category category, String queryText, IProgressMonitor monitor) throws CoreException { SearchResult result = new SearchResult(); if (queryText == null || queryText.trim().length() == 0) { result.setMatchCount(0); result.setNodes(new ArrayList<Node>()); } else { String relativeUrl = computeRelativeSearchUrl(market, category, queryText); Marketplace marketplace = processRequest(relativeUrl, monitor); Search search = marketplace.getSearch(); if (search == null) { throw new CoreException(createErrorStatus(Messages.DefaultMarketplaceService_unexpectedResponse, null)); } result.setMatchCount(search.getCount()); result.setNodes(search.getNode()); } return result; }
Source:
public List<Object> identifyPutGarbage(Object locator, K key, V value) { List<Object> garbage = new ArrayList<>(); garbage.addAll(locatorStore.addUnsafe(key, (SMRRecordLocator) locator)); return garbage; }

Target:
public List<Object> identifyPutGarbage(Object locator, K key, V value) { return new ArrayList<>(locatorStore.addUnsafe(key, (SMRRecordLocator) locator)); }
Source:
protected void executeCommand() { GlusterVolumeEntity volume = getGlusterVolume(); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), volume.getBricks(), volume.getReplicaCount())); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_FAILED, returnValue.getVdsError().getMessage()); return; } endStepJob(); releaseVolumeLock(); getReturnValue().setActionReturnValue(returnValue.getReturnValue()); }

Target:
protected void executeCommand() { GlusterVolumeEntity volume = getGlusterVolume(); VDSReturnValue returnValue = runVdsCommand(VDSCommandType.StopRemoveGlusterVolumeBricks, new GlusterVolumeRemoveBricksVDSParameters(getUpServer().getId(), volume.getName(), getParameters().getBricks())); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(AuditLogType.GLUSTER_VOLUME_REMOVE_BRICKS_FAILED, returnValue.getVdsError().getMessage()); return; } endStepJob(); releaseVolumeLock(); getReturnValue().setActionReturnValue(returnValue.getReturnValue()); }
Source:
public static JTabbedPane newJTabbedPane(final int width, final int height) { final JTabbedPane tabbedPane = new JTabbedPaneWithFixedWidthTabs(); tabbedPane.setPreferredSize(new Dimension(width, height)); return tabbedPane; }

Target:
public static JTabbedPane newJTabbedPane(final int width, final int height) { final JTabbedPane tabbedPane = new JTabbedPane(); tabbedPane.setPreferredSize(new Dimension(width, height)); return tabbedPane; }
Source:
private void initGlusterPeerProcess() { List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), getVds())) { try { glusterPeerProbe(upServer.getId(), getVds().gethost_name()); } catch (Exception e) { log.errorFormat("Could not peer probe the gluster server {0}. Error: {1}", getVds().getvds_name(), e.getMessage()); } } } } }

Target:
private void initGlusterPeerProcess() { List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), getVds())) { try { glusterPeerProbe(upServer.getId(), getVds().gethost_name()); } catch (Exception e) { log.errorFormat("Could not peer probe the gluster server {0}. Error: {1}", getVds().gethost_name(), e.getMessage()); } } } } }
Source:
public static RuleViolation addViolationSourceUUID(final String uuid, final RuleViolation violation) { try { ((AbstractRuleViolation) violation).setUuid(uuid); } catch (final ClassCastException ignored) { } return violation; }

Target:
public static RuleViolation addViolationSourceUUID(final String uuid, final RuleViolation violation) { if (violation instanceof AbstractRuleViolation) { ((AbstractRuleViolation) violation).setUuid(uuid); } return violation; }
Source:
private void checkTableTypeConversion(Database db, Table oldTbl, Table newTbl) throws InvalidOperationException { if (!oldTbl.getTableType().equalsIgnoreCase(newTbl.getTableType()) && !conf.getBoolean(MetastoreConf.ConfVars.STRICT_MANAGED_TABLES.getHiveName(), false) && ReplChangeManager.isSourceOfReplication(db)) { throw new InvalidOperationException("Table type cannot be changed from " + oldTbl.getTableType() + " to " + newTbl.getTableType() + " for the table " + TableName.getQualified(oldTbl.getCatName(), oldTbl.getDbName(), oldTbl.getTableName()) + " as it is enabled for replication."); } }

Target:
private void checkTableTypeConversion(Database db, Table oldTbl, Table newTbl) throws InvalidOperationException { if (!conf.getBoolean(MetastoreConf.ConfVars.STRICT_MANAGED_TABLES.getHiveName(), false) && !oldTbl.getTableType().equalsIgnoreCase(newTbl.getTableType()) && ReplChangeManager.isSourceOfReplication(db)) { throw new InvalidOperationException("Table type cannot be changed from " + oldTbl.getTableType() + " to " + newTbl.getTableType() + " for the table " + TableName.getQualified(oldTbl.getCatName(), oldTbl.getDbName(), oldTbl.getTableName()) + " as it is enabled for replication."); } }
Source:
public void populate(final int row, final MergeStrategySection ms) { table.setText(row, 1, ms.getName()); table.setText(row, 2, Util.toLongString(ms.getSubmitType())); final Image upImage = new Image(AdminResources.I.deleteHover()); final PushButton deleteMergeStrategyButton = new PushButton(upImage); deleteMergeStrategyButton.setStylePrimaryName(AdminResources.I.css() .deleteMergeStrategyButton()); deleteMergeStrategyButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { table.removeRow(row); } }); table.setWidget(row, 3, deleteMergeStrategyButton); final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.addStyleName(row, 1, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 2, Gerrit.RESOURCES.css().dataCell()); fmt.addStyleName(row, 3, Gerrit.RESOURCES.css().dataCell()); fmt.setVisible(row, 3, false); setRowItem(row, ms); }

Target:
public void populate(final int row, final MergeStrategySection ms) { table.setText(row, 1, ms.getName()); table.setText(row, 2, Util.toLongString(ms.getSubmitType())); if (ms.isUseContentMerge()) { table.setWidget(row, 3, new Image(Gerrit.RESOURCES.greenCheck())); } setDeleteAvailable(row); final FlexCellFormatter fmt = table.getFlexCellFormatter(); fmt.setVisible(row, 4, false); setRowItem(row, ms); }
Source:
private void sendResponseMessageToRequestingUser(UserDto respondingUser, DisclosureRequestMessage requestMessageEntity, String message) { UserAnonymizedDto toUser = userAnonymizedService.getUserAnonymized( requestMessageEntity.getRelatedUserAnonymizedId().orElseThrow(() -> new IllegalStateException( "Message with ID " + requestMessageEntity.getId() + " does not have a related user anonymized ID"))); assert toUser != null; messageService.sendMessageAndFlushToDatabase( DisclosureResponseMessage.createInstance(BuddyMessageDto.createBuddyInfoParametersInstance(respondingUser), requestMessageEntity.getTargetGoalConflictMessage(), requestMessageEntity.getStatus(), message), toUser); }

Target:
private void sendResponseMessageToRequestingUser(UserDto respondingUser, DisclosureRequestMessage requestMessageEntity, String message) { UserAnonymizedDto toUser = userAnonymizedService.getUserAnonymized( requestMessageEntity.getRelatedUserAnonymizedId().orElseThrow(() -> new IllegalStateException( "Message with ID " + requestMessageEntity.getId() + " does not have a related user anonymized ID"))); messageService.sendMessageAndFlushToDatabase( DisclosureResponseMessage.createInstance(BuddyMessageDto.createBuddyInfoParametersInstance(respondingUser), requestMessageEntity.getTargetGoalConflictMessage(), requestMessageEntity.getStatus(), message), toUser); }
Source:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select" + " pl.id" + " from project_links pl" + " where" + " not exists (select 1 from projects p where p.uuid = pl.component_uuid and p.scope = ? and p.qualifier in (?,?))") .setString(1, "PRJ") .setString(2, "TRK") .setString(3, "VW"); massUpdate.update("delete from project_links where id = ?"); massUpdate.rowPluralName("orphan project links"); massUpdate.execute(CleanOrphanRowsInProjectLinks::handle); }

Target:
protected void execute(Context context) throws SQLException { MassUpdate massUpdate = context.prepareMassUpdate(); massUpdate.select("select" + " pl.id" + " from project_links pl" + " where" + " not exists (" + " select" + " 1" + " from projects" + " p" + " where" + " p.uuid = pl.component_uuid" + " and p.scope = ?" + " and p.qualifier in (?,?)" + " and p.enabled = ?" + " )") .setString(1, "PRJ") .setString(2, "TRK") .setString(3, "VW") .setBoolean(4, true); massUpdate.update("delete from project_links where id = ?"); massUpdate.rowPluralName("orphan project links"); massUpdate.execute(CleanOrphanRowsInProjectLinks::handle); }
Source:
public VmTemplate mapRow(ResultSet rs, int rowNum) throws SQLException { final VmTemplate entity = new VmTemplate(); map(rs, entity); entity.setId(getGuidDefaultEmpty(rs, "vmt_guid")); entity.setChildCount(rs.getInt("child_count")); entity.setName(rs.getString("name")); entity.setClusterId(getGuid(rs, "cluster_id")); entity.setStatus(VmTemplateStatus.forValue(rs.getInt("status"))); entity.setClusterName(rs.getString("cluster_name")); entity.setClusterCompatibilityVersion(new VersionRowMapper("cluster_compatibility_version").mapRow(rs, rowNum)); entity.setStoragePoolId(getGuid(rs, "storage_pool_id")); entity.setStoragePoolName(rs.getString("storage_pool_name")); entity.setQuotaName(rs.getString("quota_name")); entity.setQuotaEnforcementType(QuotaEnforcementTypeEnum.forValue(rs.getInt("quota_enforcement_type"))); entity.setDisabled(rs.getBoolean("is_disabled")); entity.setTrustedService(rs.getBoolean("trusted_service")); entity.setTemplateType(VmEntityType.valueOf(rs.getString("entity_type"))); entity.setClusterArch(ArchitectureType.forValue(rs.getInt("architecture"))); entity.setBaseTemplateId(getGuidDefaultEmpty(rs, "base_template_id")); entity.setTemplateVersionNumber(rs.getInt("template_version_number")); entity.setTemplateVersionName(rs.getString("template_version_name")); entity.setUseTscFrequency(rs.getBoolean("use_tsc_frequency")); return entity; }

Target:
public VmTemplate mapRow(ResultSet rs, int rowNum) throws SQLException { final VmTemplate entity = new VmTemplate(); map(rs, entity); entity.setId(getGuidDefaultEmpty(rs, "vmt_guid")); entity.setChildCount(rs.getInt("child_count")); entity.setName(rs.getString("name")); entity.setClusterId(getGuid(rs, "cluster_id")); entity.setStatus(VmTemplateStatus.forValue(rs.getInt("status"))); entity.setClusterName(rs.getString("cluster_name")); entity.setClusterCompatibilityVersion(new VersionRowMapper("cluster_compatibility_version").mapRow(rs, rowNum)); entity.setStoragePoolId(getGuid(rs, "storage_pool_id")); entity.setStoragePoolName(rs.getString("storage_pool_name")); entity.setQuotaName(rs.getString("quota_name")); entity.setQuotaEnforcementType(QuotaEnforcementTypeEnum.forValue(rs.getInt("quota_enforcement_type"))); entity.setDisabled(rs.getBoolean("is_disabled")); entity.setTrustedService(rs.getBoolean("trusted_service")); entity.setTemplateType(VmEntityType.valueOf(rs.getString("entity_type"))); entity.setClusterArch(ArchitectureType.forValue(rs.getInt("architecture"))); entity.setBaseTemplateId(getGuidDefaultEmpty(rs, "base_template_id")); entity.setTemplateVersionNumber(rs.getInt("template_version_number")); entity.setTemplateVersionName(rs.getString("template_version_name")); return entity; }
Source:
public void shouldReturnTrueIfUserWithinARoleCanViewAndEditTemplates() { ArrayList<PipelineTemplateConfig> templateList = new ArrayList<PipelineTemplateConfig>(); for (int i = 0; i < 100; i++) { templateList.add(PipelineTemplateConfigMother.createTemplate("template" + i)); } CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin"); Role securityConfigRole = new Role(new CaseInsensitiveString("role1"), new RoleUser(templateAdmin)); AdminRole templateAdminRole = new AdminRole(securityConfigRole); templateList.add(PipelineTemplateConfigMother.createTemplate("templateName", new Authorization(new AdminsConfig(templateAdminRole)), StageConfigMother.manualStage("stage-name"))); TemplatesConfig templates = new TemplatesConfig(templateList.toArray(new PipelineTemplateConfig[0])); List<Role> roles = new ArrayList<>(); roles.add(securityConfigRole); assertThat(templates.canViewAndEditTemplate(templateAdmin, roles), is(true)); }

Target:
public void shouldReturnTrueIfUserWithinARoleCanViewAndEditTemplates() { CaseInsensitiveString templateAdmin = new CaseInsensitiveString("template-admin"); Role securityConfigRole = getSecurityConfigRole(templateAdmin); List<Role> roles = setupRoles(securityConfigRole); ArrayList<PipelineTemplateConfig> templateList = new ArrayList<PipelineTemplateConfig>(); templateList.add(PipelineTemplateConfigMother.createTemplate("templateName", new Authorization(new AdminsConfig(new AdminRole(securityConfigRole))), StageConfigMother.manualStage("some-random-stage"))); TemplatesConfig templates = new TemplatesConfig(templateList.toArray(new PipelineTemplateConfig[0])); assertThat(templates.canViewAndEditTemplate(templateAdmin, roles), is(true)); }
Source:
private static boolean isUnreasonableName(final String name) { if (name.length() == 0) return true; if (name.indexOf('\\') >= 0) return true; if (name.charAt(0) == '/') return true; if (new File(name).isAbsolute()) return true; if (name.startsWith("../")) return true; if (name.contains("/../")) return true; if (name.contains("/./")) return true; if (name.contains(" return true; return false; }

Target:
private static boolean isUnreasonableName(final String name) { if (name.length() == 0) return true; if (name.indexOf('\\') >= 0) return true; if (new File(name).isAbsolute()) return true; if (name.startsWith("../")) return true; if (name.contains("/../")) return true; if (name.contains("/./")) return true; if (name.contains(" return true; return false; }
Source:
public static List<QueryParam> buildTopologyIdAndVersionIdAwareQueryParams(Long topologyId, Long versionId, UriInfo uriInfo) { List<QueryParam> queryParams = new ArrayList<>(); queryParams.add(new QueryParam("topologyId", topologyId.toString())); queryParams.add(new QueryParam("versionId", versionId.toString())); addQueryParams(uriInfo, queryParams); return queryParams; }

Target:
public static List<QueryParam> buildTopologyIdAndVersionIdAwareQueryParams(Long topologyId, Long versionId, UriInfo uriInfo) { List<QueryParam> queryParams = new ArrayList<>(); queryParams.add(new QueryParam(TOPOLOGY_ID, topologyId.toString())); queryParams.addAll(versionIdQueryParam(versionId)); addQueryParams(uriInfo, queryParams); return queryParams; }
Source:
public void configure(CamelContext camelContext) { TransformerDefinition transformer; if (uri != null) { EndpointTransformerDefinition etd = new EndpointTransformerDefinition(); etd.setUri(uri); transformer = etd; } else if (dataFormat != null) { DataFormatTransformerDefinition dtd = new DataFormatTransformerDefinition(); dtd.setDataFormatType(dataFormat); transformer = dtd; } else if (clazz != null) { CustomTransformerDefinition ctd = new CustomTransformerDefinition(); ctd.setType(clazz.getName()); transformer = ctd; } else if (beanRef != null) { CustomTransformerDefinition ctd = new CustomTransformerDefinition(); ctd.setRef(beanRef); transformer = ctd; } else { throw new IllegalArgumentException("No Transformer type was specified"); } if (scheme != null) { transformer.setScheme(scheme); } else { transformer.setFrom(from); transformer.setTo(to); } camelContext.getTransformers().add(transformer); }

Target:
public void configure(CamelContext camelContext) { TransformerDefinition transformer; if (uri != null) { EndpointTransformerDefinition etd = new EndpointTransformerDefinition(); etd.setUri(uri); transformer = etd; } else if (dataFormat != null) { DataFormatTransformerDefinition dtd = new DataFormatTransformerDefinition(); dtd.setDataFormatType(dataFormat); transformer = dtd; } else if (clazz != null) { CustomTransformerDefinition ctd = new CustomTransformerDefinition(); ctd.setType(clazz.getName()); transformer = ctd; } else if (beanRef != null) { CustomTransformerDefinition ctd = new CustomTransformerDefinition(); ctd.setRef(beanRef); transformer = ctd; } else { throw new IllegalArgumentException("No Transformer type was specified"); } if (scheme != null) { transformer.setScheme(scheme); } else { transformer.setFromType(from); transformer.setToType(to); } camelContext.getTransformers().add(transformer); }
Source:
private InMemoryManager getOrDefaultInMemoryManagerByTestId(Config config) { if (!config.containsKey(TEST_ID) || config.get(TEST_ID) == null) { return DEFAULT_MANAGER; } IN_MEMORY_MANAGERS.putIfAbsent(Integer.parseInt(config.get(TEST_ID)), new InMemoryManager()); return IN_MEMORY_MANAGERS.get(Integer.parseInt(config.get(TEST_ID))); }

Target:
private InMemoryManager getOrDefaultInMemoryManagerByTestId(Config config) { InMemorySystemConfig inMemorySystemConfig = new InMemorySystemConfig(config); return IN_MEMORY_MANAGERS.computeIfAbsent(inMemorySystemConfig.getInMemoryScope(), key -> new InMemoryManager()); }
Source:
public static DeletePropertyFileResponseType deletePropertyFile(DeletePropertyFileRequestType part1) throws PropertyAccessException { DeletePropertyFileResponseType oOutput = new DeletePropertyFileResponseType(); if (part1 != null && part1.getPropertyFile() != null && part1.getPropertyFile().length() > 0) { String sPropertyFile = part1.getPropertyFile(); PropertyFileManager.deletePropertyFile(sPropertyFile); } oOutput.setSuccess(true); return oOutput; }

Target:
public static DeletePropertyFileResponseType deletePropertyFile(DeletePropertyFileRequestType part1) throws PropertyAccessException { DeletePropertyFileResponseType oOutput = new DeletePropertyFileResponseType(); if (part1 != null && StringUtils.isNotEmpty(part1.getPropertyFile())) { String sPropertyFile = part1.getPropertyFile(); PropertyFileManager.deletePropertyFile(sPropertyFile); } oOutput.setSuccess(true); return oOutput; }
Source:
public static H2ODrm RowRange(H2ODrm drmA, final Range R) { Frame A = drmA.frame; Vec keys = drmA.keys; Frame Arr = new MRTask() { public void map(Chunk chks[], NewChunk ncs[]) { int chunk_size = chks[0].len(); long chunk_start = chks[0].start(); if (chunk_start > R.end() || (chunk_start + chunk_size) < R.start()) return; for (int r = 0; r < chunk_size; r++) { if (!R.contains(chunk_start + r)) continue; for (int c = 0; c < chks.length; c++) ncs[c].addNum(chks[c].at0(r)); } } }.doAll(A.numCols(), A).outputFrame(null, null); Vec Vrr = (keys == null) ? null : new MRTask() { public void map(Chunk chk, NewChunk nc) { int chunk_size = chk.len(); long chunk_start = chk.start(); ValueString vstr = new ValueString(); if (chunk_start > R.end() || (chunk_start + chunk_size) < R.start()) return; for (int r = 0; r < chunk_size; r++) { if (!R.contains(chunk_start + r)) continue; nc.addStr(chk.atStr0(vstr, r).toString()); } } }.doAll(1, keys).outputFrame(null, null).anyVec(); return new H2ODrm(Arr, Vrr); }

Target:
public static H2ODrm RowRange(H2ODrm drmA, final Range R) { Frame A = drmA.frame; Vec keys = drmA.keys; Frame Arr = new MRTask() { public void map(Chunk chks[], NewChunk ncs[]) { int chunk_size = chks[0].len(); long chunk_start = chks[0].start(); if (chunk_start > R.end() || (chunk_start + chunk_size) < R.start()) { return; } for (int r = 0; r < chunk_size; r++) { if (!R.contains(chunk_start + r)) { continue; } for (int c = 0; c < chks.length; c++) { ncs[c].addNum(chks[c].at0(r)); } } } }.doAll(A.numCols(), A).outputFrame(null, null); Vec Vrr = (keys == null) ? null : new MRTask() { public void map(Chunk chk, NewChunk nc) { int chunk_size = chk.len(); long chunk_start = chk.start(); ValueString vstr = new ValueString(); if (chunk_start > R.end() || (chunk_start + chunk_size) < R.start()) { return; } for (int r = 0; r < chunk_size; r++) { if (!R.contains(chunk_start + r)) { continue; } nc.addStr(chk.atStr0(vstr, r)); } } }.doAll(1, keys).outputFrame(null, null).anyVec(); return new H2ODrm(Arr, Vrr); }
Source:
public void stop() { super.stop(); createdStores.clear(); diskPersistenceService = null; }

Target:
public void stop() { try { createdStores.clear(); diskPersistenceService = null; } finally { super.stop(); } }
Source:
public static InterpretedStatus from(SmartpayStatus gatewayStatus) { Optional<StatusMap> statusMap = validStatuses .stream() .filter(validStatus -> validStatus.getFromStatus().equals(gatewayStatus)) .findFirst(); if (statusMap.isEmpty()) { return new UnknownStatus(); } Optional<Status> statusMaybe = statusMap.flatMap(StatusMap::getToStatus); if (statusMaybe.isEmpty()) { return new IgnoredStatus(); } Status status = statusMaybe.get(); if (status instanceof ChargeStatus) { return new MappedChargeStatus((ChargeStatus) status); } if (status instanceof RefundStatus) { return new MappedRefundStatus((RefundStatus) status); } return new UnknownStatus(); }

Target:
public static InterpretedStatus from(SmartpayStatus gatewayStatus) { Optional<StatusMap> statusMap = validStatuses .stream() .filter(validStatus -> validStatus.getFromStatus().equals(gatewayStatus)) .findFirst(); if (statusMap.isEmpty()) { return new UnknownStatus(); } return statusMap .flatMap(StatusMap::getToStatus) .map(status -> { if (status instanceof ChargeStatus) { return new MappedChargeStatus((ChargeStatus) status); } if (status instanceof RefundStatus) { return new MappedRefundStatus((RefundStatus) status); } return new UnknownStatus(); }) .orElseGet(IgnoredStatus::new); }
Source:
public void testSsModule() { fTrace.openTrace(); TmfStateSystemAnalysisModule module = (TmfStateSystemAnalysisModule) fTrace.getAnalysisModule(MODULE_SS); ITmfStateSystem ss = null; ss = module.getStateSystem(); assertNull(ss); module.schedule(); if (module.waitForCompletion(new NullProgressMonitor())) { ss = module.getStateSystem(); assertNotNull(ss); } else { fail("Module did not complete properly"); } }

Target:
public void testSsModule() { TmfSignalManager.deregister(fTrace); fTrace.traceOpened(new TmfTraceOpenedSignal(this, fTrace, null)); TmfStateSystemAnalysisModule module = (TmfStateSystemAnalysisModule) fTrace.getAnalysisModule(MODULE_SS); ITmfStateSystem ss = null; ss = module.getStateSystem(); assertNull(ss); module.schedule(); if (module.waitForCompletion(new NullProgressMonitor())) { ss = module.getStateSystem(); assertNotNull(ss); } else { fail("Module did not complete properly"); } }
Source:
public LocalDatasetBuilder(Map<K, V> upstreamMap, IgniteBiPredicate<K, V> filter, int partitions) { this.upstreamMap = upstreamMap; this.filter = filter; this.partitions = partitions; this.transformers = new LinkedList<>(); this.transformerDataSuppliers = new LinkedList<>(); }

Target:
public LocalDatasetBuilder(Map<K, V> upstreamMap, IgniteBiPredicate<K, V> filter, int partitions) { this.upstreamMap = upstreamMap; this.filter = filter; this.partitions = partitions; this.upstreamTransformers = UpstreamTransformerChain.empty(); }
Source:
private void disableLuceneAutomaticCommit() { Config cfg = dbInjector.getInstance(Key.get(Config.class, GerritServerConfig.class)); if (cfg.getEnum("index", null, "type", IndexType.SQL).equals( IndexType.LUCENE)) { cfg.setString("index", "changes_open", "commitWithin", "-1"); cfg.setString("index", "changes_closed", "commitWithin", "-1"); } }

Target:
private void disableLuceneAutomaticCommit() { Config cfg = dbInjector.getInstance(Key.get(Config.class, GerritServerConfig.class)); if (IndexModule.getIndexType(dbInjector) == IndexType.LUCENE) { cfg.setLong("index", "changes_open", "commitWithin", -1); cfg.setLong("index", "changes_closed", "commitWithin", -1); } }
Source:
public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return new byte[] { NULL }; try (BinaryWriterExImpl writer = new BinaryWriterExImpl(ctx)) { writer.marshal(obj); byte[] bytes = writer.array(); if (fullCompressionMode && !CompressionUtils.isCompressionType(bytes[0])) { byte[] buffer; Compressor compressor = compressorsSelector.get(fullCompressionType); buffer = CompressionUtils.compress(compressor, bytes); byte[] compressed = new byte[buffer.length + 1]; compressed[0] = (byte)fullCompressionType.getMode().typeId(); System.arraycopy(buffer, 0, compressed, 1, buffer.length); return compressed; } return bytes; } }

Target:
public byte[] marshal(@Nullable Object obj) throws BinaryObjectException { if (obj == null) return new byte[] { NULL }; try (BinaryWriterExImpl writer = new BinaryWriterExImpl(ctx)) { writer.marshal(obj); if (fullCompressionMode) { byte[] arr = writer.array(); assert arr[0] != COMPRESSED : "Compressed byte array not allowed here, mode: " + arr[0]; byte[] buf = U.compress(compressor, arr); byte[] compressed = new byte[buf.length + 1]; compressed[0] = COMPRESSED; System.arraycopy(buf, 0, compressed, 1, buf.length); return compressed; } return writer.array(); } }