auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); speakerName = getIntent().getStringExtra(Speaker.Companion.getSPEAKER()); setSupportActionBar(toolbar); if(getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); collapsingToolbarLayout.setTitle(" "); appBarLayout.addOnOffsetChangedListener(this); speakerDetailsViewModel = ViewModelProviders.of(this).get(SpeakerDetailsViewModel.class); DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics(); float width = displayMetrics.widthPixels / displayMetrics.density; int spanCount = (int) (width / 250.00); sessionRecyclerView.setHasFixedSize(true); gridLayoutManager = new GridLayoutManager(this, spanCount); sessionRecyclerView.setLayoutManager(gridLayoutManager); sessionsListAdapter = new SessionsListAdapter(this, sessions, spearkerWiseSessionList); sessionsListAdapter.setOnBookmarkSelectedListener(this); sessionsListAdapter.setHandleItemClickListener(this); sessionRecyclerView.setNestedScrollingEnabled(false); sessionRecyclerView.setAdapter(sessionsListAdapter); sessionRecyclerView.setItemAnimator(new DefaultItemAnimator()); handleVisibility(); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); speakerName = getIntent().getStringExtra(Speaker.SPEAKER); setSupportActionBar(toolbar); if(getSupportActionBar() != null) getSupportActionBar().setDisplayHomeAsUpEnabled(true); collapsingToolbarLayout.setTitle(" "); appBarLayout.addOnOffsetChangedListener(this); speakerDetailsViewModel = ViewModelProviders.of(this).get(SpeakerDetailsViewModel.class); DisplayMetrics displayMetrics = this.getResources().getDisplayMetrics(); float width = displayMetrics.widthPixels / displayMetrics.density; int spanCount = (int) (width / 250.00); sessionRecyclerView.setHasFixedSize(true); gridLayoutManager = new GridLayoutManager(this, spanCount); sessionRecyclerView.setLayoutManager(gridLayoutManager); sessionsListAdapter = new SessionsListAdapter(this, sessions, spearkerWiseSessionList); sessionsListAdapter.setOnBookmarkSelectedListener(this); sessionsListAdapter.setHandleItemClickListener(this); sessionRecyclerView.setNestedScrollingEnabled(false); sessionRecyclerView.setAdapter(sessionsListAdapter); sessionRecyclerView.setItemAnimator(new DefaultItemAnimator()); handleVisibility(); }
Source:
private Property resolveApiAnnotated(ModelConverterContext context, Property property, Annotation[] annotations, ApiModelProperty mp, JavaType propType) { String or = mp.dataType(); JavaType innerJavaType = null; LOGGER.debug("overriding datatype from " + propType + " to " + or); if (or.toLowerCase().startsWith("list[")) { String innerType = or.substring(5, or.length() - 1); ArrayProperty p = new ArrayProperty(); Property primitiveProperty = PrimitiveType.createProperty(innerType); if (primitiveProperty != null) { p.setItems(primitiveProperty); } else { innerJavaType = getInnerType(innerType); p.setItems(context.resolveProperty(innerJavaType, annotations)); } property = p; } else if (or.toLowerCase().startsWith("map[")) { int pos = or.indexOf(","); if (pos > 0) { String innerType = or.substring(pos + 1, or.length() - 1); MapProperty p = new MapProperty(); Property primitiveProperty = PrimitiveType.createProperty(innerType); if (primitiveProperty != null) { p.setAdditionalProperties(primitiveProperty); } else { innerJavaType = getInnerType(innerType); p.setAdditionalProperties(context.resolveProperty(innerJavaType, annotations)); } property = p; } } else { Property primitiveProperty = PrimitiveType.createProperty(or); if (primitiveProperty != null) { property = primitiveProperty; } else { innerJavaType = getInnerType(or); property = context.resolveProperty(innerJavaType, annotations); } } if (innerJavaType != null) { context.resolve(innerJavaType); } return property; }

Target:
private Property resolveApiAnnotated(ModelConverterContext context, Property property, Annotation[] annotations, ApiModelProperty mp, JavaType propType) { String or = mp.dataType(); JavaType innerJavaType = null; log.debug("overriding datatype from to {}", propType, or); if (or.toLowerCase().startsWith("list[")) { String innerType = or.substring(5, or.length() - 1); ArrayProperty p = new ArrayProperty(); Property primitiveProperty = PrimitiveType.createProperty(innerType); if (primitiveProperty != null) { p.setItems(primitiveProperty); } else { innerJavaType = getInnerType(innerType); p.setItems(context.resolveProperty(innerJavaType, annotations)); } property = p; } else if (or.toLowerCase().startsWith("map[")) { int pos = or.indexOf(","); if (pos > 0) { String innerType = or.substring(pos + 1, or.length() - 1); MapProperty p = new MapProperty(); Property primitiveProperty = PrimitiveType.createProperty(innerType); if (primitiveProperty != null) { p.setAdditionalProperties(primitiveProperty); } else { innerJavaType = getInnerType(innerType); p.setAdditionalProperties(context.resolveProperty(innerJavaType, annotations)); } property = p; } } else { Property primitiveProperty = PrimitiveType.createProperty(or); if (primitiveProperty != null) { property = primitiveProperty; } else { innerJavaType = getInnerType(or); property = context.resolveProperty(innerJavaType, annotations); } } if (innerJavaType != null) { context.resolve(innerJavaType); } return property; }
Source:
public void recognizeCustomFormLabeledDataWithNullModelId(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner(data -> beginTrainingLabeledRunner((trainingFilesUrl, useTrainingLabels) -> { SyncPoller<OperationResult, CustomFormModel> syncPoller = getFormTrainingAsyncClient(httpClient, serviceVersion).beginTraining(trainingFilesUrl, useTrainingLabels).getSyncPoller(); syncPoller.waitForCompletion(); Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms(toFluxByteBuffer(data), null, CUSTOM_FORM_FILE_LENGTH, FormContentType.APPLICATION_PDF, true, null) .getSyncPoller()); assertEquals(EXPECTED_MODEL_ID_IS_REQUIRED_EXCEPTION_MESSAGE, ex.getMessage()); })); }

Target:
public void recognizeCustomFormLabeledDataWithNullModelId(HttpClient httpClient, FormRecognizerServiceVersion serviceVersion) { client = getFormRecognizerAsyncClient(httpClient, serviceVersion); customFormDataRunner((data, dataLength) -> { Exception ex = assertThrows(RuntimeException.class, () -> client.beginRecognizeCustomForms( new RecognizeCustomFormsOptions(toFluxByteBuffer(data), dataLength, null).setFormContentType(FormContentType.APPLICATION_PDF).setIncludeTextContent(true) .setPollInterval(durationTestMode)).getSyncPoller()); assertEquals(EXPECTED_MODEL_ID_IS_REQUIRED_EXCEPTION_MESSAGE, ex.getMessage()); }); }
Source:
public ResourceTypeHelper() { mMimeMatcher = new MimeMatcher<Page.ResourceType>(); mMimeMatcher.addRule("text/css", Page.ResourceType.STYLESHEET); mMimeMatcher.addRule("image/*", Page.ResourceType.IMAGE); mMimeMatcher.addRule("application/x-javascript", Page.ResourceType.SCRIPT); mMimeMatcher.addRule("text/javascript", Page.ResourceType.XHR); mMimeMatcher.addRule("application/json", Page.ResourceType.XHR); mMimeMatcher.addRule( DownloadingAsyncPrettyPrinterFactory.PrettyPrinterDisplayType.JSON.getDisplayType(), Page.ResourceType.XHR); mMimeMatcher.addRule("text/*", Page.ResourceType.DOCUMENT); mMimeMatcher.addRule( DownloadingAsyncPrettyPrinterFactory.PrettyPrinterDisplayType.HTML.getDisplayType(), Page.ResourceType.DOCUMENT); mMimeMatcher.addRule( DownloadingAsyncPrettyPrinterFactory.PrettyPrinterDisplayType.TEXT.getDisplayType(), Page.ResourceType.DOCUMENT); mMimeMatcher.addRule("*", Page.ResourceType.OTHER); }

Target:
public ResourceTypeHelper() { mMimeMatcher = new MimeMatcher<Page.ResourceType>(); mMimeMatcher.addRule("text/css", Page.ResourceType.STYLESHEET); mMimeMatcher.addRule("image/*", Page.ResourceType.IMAGE); mMimeMatcher.addRule("application/x-javascript", Page.ResourceType.SCRIPT); mMimeMatcher.addRule("text/javascript", Page.ResourceType.XHR); mMimeMatcher.addRule("application/json", Page.ResourceType.XHR); mMimeMatcher.addRule("text/*", Page.ResourceType.DOCUMENT); mMimeMatcher.addRule("*", Page.ResourceType.OTHER); }
Source:
public void visitClass(ClassTree tree) { for (AnnotationTree annotationTree : Iterables.filter(tree.modifiers().annotations(), ANNOTATION_TREE_PREDICATE)) { if (ClassParserUtils.is(annotationTree, Connector.class)) { verifyConnector(tree, (IdentifierTree) annotationTree.annotationType()); } } super.visitClass(tree); }

Target:
public final void visitClass(ClassTree tree) { for (AnnotationTree annotationTree : Iterables.filter(tree.modifiers().annotations(), ANNOTATION_TREE_PREDICATE)) { if (ClassParserUtils.is(annotationTree, Connector.class)) { verifyConnector(tree, (IdentifierTree) annotationTree.annotationType()); } } super.visitClass(tree); }
Source:
public void testNoChannelId() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); Notification notification = mpPushSpy.createNotification(intent); verify(builderSpy).setChannelId(anyString()); assertEquals(notification.getChannelId(), MixpanelPushNotification.NotificationData.DEFAULT_CHANNEL_ID); }

Target:
public void testNoChannelId() { final Intent intent = new Intent(); intent.putExtra("mp_message", "MESSAGE"); Notification notification = mpPushSpy.createNotification(intent); verify(builderSpy).setChannelId(MixpanelPushNotification.NotificationData.DEFAULT_CHANNEL_ID); assertEquals(notification.getChannelId(), MixpanelPushNotification.NotificationData.DEFAULT_CHANNEL_ID); }
Source:
public Map<Integer, ?> getValues() { return Collections.unmodifiableMap(instances); }

Target:
public Map<Integer, ?> getValues() { Map<Integer, Object> val = new HashMap<>(); for (Entry<Integer, LwM2mResourceInstance> entry : instances.entrySet()) { val.put(entry.getKey(), entry.getValue().getValue()); } return Collections.unmodifiableMap(val); }
Source:
public void testMethodInvalidInboundName() throws Exception { try { SpringApplication.run(TestMethodInvalidInboundName.class, "--server.port=0"); fail("Exception expected on using invalid inbound name"); } catch (Exception e) { assertThat(e.getCause()).isInstanceOf(IllegalStateException.class); assertThat(e.getCause()).hasMessageContaining(INVALID_BOUND_TARGET_NAME); } }

Target:
public void testMethodInvalidInboundName() throws Exception { try { SpringApplication.run(TestMethodInvalidInboundName.class, "--server.port=0"); fail("Exception expected on using invalid inbound name"); } catch (BeanCreationException e) { assertThat(e.getCause()).isInstanceOf(IllegalArgumentException.class); assertThat(e.getCause()).hasMessageContaining(StreamListenerErrorMessages.INVALID_DECLARATIVE_METHOD_PARAMETERS); } }
Source:
public void should_use_infopath_if_location_param_is_not_defined() throws Exception { when(req.getMethod()).thenReturn("GET"); when(req.getParameter("location")).thenReturn(null); when(req.getPathInfo()).thenReturn("/bonita.css"); final String resourceLocation = resourceLocationReader.getResourceLocationFromRequest(req); verify(req, times(1)).getPathInfo(); assertThat(resourceLocation).isEqualTo("bonita.css"); }

Target:
public void should_use_infopath_if_location_param_is_not_defined() throws Exception { when(req.getParameter("location")).thenReturn(null); when(req.getPathInfo()).thenReturn("/bonita.css"); final String resourceLocation = resourceLocationReader.getResourceLocationFromRequest(req); verify(req, times(1)).getPathInfo(); assertThat(resourceLocation).isEqualTo("bonita.css"); }
Source:
public static int determineModularClasspathProperty(IClasspathEntry entry) { return Arrays.stream(entry.getExtraAttributes()) .anyMatch(p -> p.getName().equals(IClasspathAttribute.MODULE) && p.getValue().equals("true")) ? IRuntimeClasspathEntry.MODULE_PATH : IRuntimeClasspathEntry.CLASS_PATH; }

Target:
public static int determineModularClasspathProperty(IClasspathEntry entry) { return Arrays.stream(entry.getExtraAttributes()) .anyMatch(p -> p.getName().equals(IClasspathAttribute.MODULE) && "true".equals(p.getValue())) ? IRuntimeClasspathEntry.MODULE_PATH : IRuntimeClasspathEntry.CLASS_PATH; }
Source:
public void setMainTabSelectedItem(VDS selectedItem) { hostInterfaceForm = new HostInterfaceForm(getDetailModel()); contentPanel.remove(contentPanel.getWidgetCount() - 1); contentPanel.add(hostInterfaceForm); contentPanel.getParent().getElement().getStyle().setOverflowX(Overflow.AUTO); }

Target:
public void setMainTabSelectedItem(VDS selectedItem) { hostInterfaceForm = new HostInterfaceForm(getDetailModel()); contentPanel.remove(contentPanel.getWidgetCount() - 1); contentPanel.add(hostInterfaceForm); if (contentPanel.getParent() != null) { contentPanel.getParent().getElement().getStyle().setOverflowX(Overflow.AUTO); } }
Source:
protected boolean delete(XWikiContext context) throws XWikiException { XWiki xwiki = context.getWiki(); XWikiRequest request = context.getRequest(); XWikiResponse response = context.getResponse(); XWikiDocument doc = context.getDoc(); String sindex = request.getParameter(RECYCLED_DOCUMENT_ID_PARAM); String emptyBin = request.getParameter(EMPTY_RECYCLE_BIN); if ("1".equals(emptyBin)) { return deleteAllFromRecycleBin(context); } else if (sindex != null && xwiki.hasRecycleBin(context)) { deleteFromRecycleBin(Long.parseLong(sindex), context); return true; } else if (doc.isNew()) { sendRedirect(response, Utils.getRedirect("view", context)); return true; } else { return deleteToRecycleBin(context); } }

Target:
protected boolean delete(XWikiContext context) throws XWikiException { XWiki xwiki = context.getWiki(); XWikiRequest request = context.getRequest(); XWikiResponse response = context.getResponse(); XWikiDocument doc = context.getDoc(); String sindex = request.getParameter(RECYCLED_DOCUMENT_ID_PARAM); String emptyBin = request.getParameter(EMPTY_RECYCLE_BIN); if ("true".equals(emptyBin)) { return deleteAllFromRecycleBin(context); } else if (sindex != null && xwiki.hasRecycleBin(context)) { deleteFromRecycleBin(Long.parseLong(sindex), context); return true; } else if (doc.isNew()) { sendRedirect(response, Utils.getRedirect("view", context)); return true; } else { return deleteToRecycleBin(context); } }
Source:
public void testListenInvalidPort() throws Exception { server.close(); try(ServerSocket occupied = new ServerSocket(0)){ occupied.setReuseAddress(false); server = vertx.createHttpServer(new HttpServerOptions().setPort(occupied.getLocalPort())); server.requestHandler(noOpHandler()).listen(onFailure(server -> testComplete())); await(); } }

Target:
public void testListenInvalidPort() throws Exception { server.close(); ServerSocket occupied = null; try{ occupied = new ServerSocket(0); occupied.setReuseAddress(false); server = vertx.createHttpServer(new HttpServerOptions().setPort(occupied.getLocalPort())); server.requestHandler(noOpHandler()).listen(onFailure(server -> testComplete())); await(); }finally { if( occupied != null ) { occupied.close(); } } }
Source:
public void processWesCommands(final List<String> args) { if (args.isEmpty() || containsHelpRequest(args)) { launchHelp(); } else { this.wesUri = optVal(args, "--wes-url", null); this.wesAuth = optVal(args, "--wes-auth", null); if (args.contains("launch")) { out("Launching workflow using WES"); args.remove(0); launch(args); } else { WorkflowExecutionServiceApi clientWorkflowExecutionServiceApi = getWorkflowExecutionServiceApi(getWesUri(), getWesAuth()); if (args.contains("status")) { String workflowId = reqVal(args, "--id"); out("Getting status of WES workflow"); if (args.contains("--verbose")) { try { RunLog response = clientWorkflowExecutionServiceApi.getRunLog(workflowId); out("Verbose run status is: " + response.toString()); } catch (io.swagger.wes.client.ApiException e) { e.printStackTrace(); } } else { try { RunStatus response = clientWorkflowExecutionServiceApi.getRunStatus(workflowId); out("Brief run status is: " + response.toString()); } catch (io.swagger.wes.client.ApiException e) { e.printStackTrace(); } } } else if (args.contains("cancel")) { out("Canceling WES workflow"); String workflowId = reqVal(args, "--id"); try { RunId response = clientWorkflowExecutionServiceApi.cancelRun(workflowId); out("Cancelled run with id: " + response.toString()); } catch (io.swagger.wes.client.ApiException e) { e.printStackTrace(); } } } } }

Target:
public void processWesCommands(final List<String> args) { if (args.isEmpty() || containsHelpRequest(args)) { launchHelp(); } else { this.wesUri = optVal(args, "--wes-url", null); this.wesAuth = optVal(args, "--wes-auth", null); if (args.get(0).equals("launch")) { out("Launching workflow using WES"); args.remove(0); launch(args); } else { WorkflowExecutionServiceApi clientWorkflowExecutionServiceApi = getWorkflowExecutionServiceApi(getWesUri(), getWesAuth()); if (args.get(0).equals("status")) { String workflowId = reqVal(args, "--id"); out("Getting status of WES workflow"); if (args.contains("--verbose")) { try { RunLog response = clientWorkflowExecutionServiceApi.getRunLog(workflowId); out("Verbose run status is: " + response.toString()); } catch (io.swagger.wes.client.ApiException e) { LOG.error("Error getting verbose WES run status", e); } } else { try { RunStatus response = clientWorkflowExecutionServiceApi.getRunStatus(workflowId); out("Brief run status is: " + response.toString()); } catch (io.swagger.wes.client.ApiException e) { LOG.error("Error getting brief WES run status", e); } } } else if (args.get(0).equals("cancel")) { out("Canceling WES workflow"); String workflowId = reqVal(args, "--id"); try { RunId response = clientWorkflowExecutionServiceApi.cancelRun(workflowId); out("Cancelled run with id: " + response.toString()); } catch (io.swagger.wes.client.ApiException e) { LOG.error("Error canceling WES run", e); } } } } }
Source:
private static String jobRefToUId(final JobRef<?> ref) { return String.format( "repoType-%s--orgId-%s--jobId-%s", ref.getRepositoryType().getCanonicalName(), ref.getOrganization().getId(), ref.getJobId()); }

Target:
private static String jobRefToUId(final JobRef<?> ref) { return String.join( "_", ref.getRepositoryType().getCanonicalName(), ref.getOrganization().getId().toString(), ref.getJobId().toString()); }
Source:
private boolean findChildren(CalledFunction node, int depth, ITmfStateSystem ss, int maxQuark, IProgressMonitor monitor) { fStore.add(node); long curTime = node.getStart(); long limit = node.getEnd(); ITmfStateInterval interval = null; while (curTime < limit) { if (monitor.isCanceled()) { return false; } try { if (depth + 1 < fCurrentQuarks.size()) { interval = ss.querySingleState(curTime, fCurrentQuarks.get(depth + 1)); } else { return true; } } catch (StateSystemDisposedException e) { Activator.getInstance().logError(Messages.QueringStateSystemError, e); return false; } ITmfStateValue stateValue = interval.getStateValue(); if (!stateValue.isNull()) { long intervalStart = interval.getStartTime(); long intervalEnd = interval.getEndTime(); CalledFunction segment = new CalledFunction(intervalStart, intervalEnd + 1, stateValue.unboxLong(), node.getDepth() + 1); findChildren(segment, depth + 1, ss, maxQuark, monitor); node.addChild(segment); curTime = interval.getEndTime() + 1; } else { curTime = interval.getEndTime() + 1; } } return true; }

Target:
private boolean findChildren(CalledFunction node, int depth, ITmfStateSystem ss, int maxQuark, IProgressMonitor monitor) { fStore.add(node); long curTime = node.getStart(); long limit = node.getEnd(); ITmfStateInterval interval = null; while (curTime < limit) { if (monitor.isCanceled()) { return false; } try { if (depth + 1 < fCurrentQuarks.size()) { interval = ss.querySingleState(curTime, fCurrentQuarks.get(depth + 1)); } else { return true; } } catch (StateSystemDisposedException e) { Activator.getInstance().logError(Messages.QueringStateSystemError, e); return false; } ITmfStateValue stateValue = interval.getStateValue(); if (!stateValue.isNull()) { long intervalStart = interval.getStartTime(); long intervalEnd = interval.getEndTime(); if (intervalStart < node.getStart() || intervalEnd > limit) { return true; } CalledFunction segment = new CalledFunction(intervalStart, intervalEnd + 1, stateValue.unboxLong(), node.getDepth() + 1); findChildren(segment, depth + 1, ss, maxQuark, monitor); node.addChild(segment); } curTime = interval.getEndTime() + 1; } return true; }
Source:
public Object getReplacementValue(Object initialValue) { Object replacementValue = ""; if (initialValue != null) { if (initialValue instanceof Cohort) { replacementValue = new Integer(((Cohort) initialValue).size()); } else if (initialValue instanceof IndicatorResult) { replacementValue =((IndicatorResult) initialValue).getValue(); } else { replacementValue = initialValue; } } return replacementValue; }

Target:
public Object getReplacementValue(Object initialValue) { Object replacementValue = ""; if (initialValue != null) { if (initialValue instanceof Cohort) { replacementValue = new Integer(((Cohort) initialValue).size()); } else if (initialValue instanceof IndicatorResult) { IndicatorResult ir = (IndicatorResult) initialValue; replacementValue = ir.getValue(); } else { replacementValue = initialValue; } } return replacementValue; }
Source:
@Test public void startActivityWithIntent() throws Exception { assertTrue(((Predicate<AndroidDriver>) driver -> { final Activity activity = new Activity("com.android.mms", ".ui.ComposeMessageActivity"); activity.setIntentAction("android.intent.action.SEND"); activity.setIntentCategory("android.intent.category.DEFAULT"); activity.setIntentFlags("0x4000000"); activity.setOptionalIntentArguments("-d \"TestIntent\" -t \"text/plain\""); driver.startActivity(activity); return true; }).test(driver)); }

Target:
@Test public void startActivityWithIntent() throws Exception { Predicate<AndroidDriver> predicate = driver -> { Activity activity = new Activity("com.android.mms", ".ui.ComposeMessageActivity") .setIntentAction("android.intent.action.SEND") .setIntentCategory("android.intent.category.DEFAULT") .setIntentFlags("0x4000000") .setOptionalIntentArguments("-d \"TestIntent\" -t \"text/plain\""); driver.startActivity(activity); return true; }; assertTrue(predicate.test(driver)); }
Source:
public DialogBox createNoProjectsDialog(boolean showDialog) { final NoProjectDialogBox dialogBox = new NoProjectDialogBox(); dialogBox.show(); return dialogBox; }

Target:
public DialogBox createNoProjectsDialog(boolean showDialog) { final NoProjectDialogBox dialogBox = new NoProjectDialogBox(); if (showDialog) { dialogBox.show(); } return dialogBox; }
Source:
private static IEditorDescriptor getEditorDescriptor(String name, IEditorRegistry editorReg, IEditorDescriptor defaultDescriptor, boolean allowInteractive) throws PartInitException, OperationCanceledException { if (defaultDescriptor != null) { return defaultDescriptor; } IUnknownEditorStrategy strategy = null; if (allowInteractive ) { strategy = getUnknowEditorStrategy(); } else { strategy = new SystemEditorOrTextEditorStrategy(); } IEditorDescriptor editorDesc; try { editorDesc = strategy.getEditorDescriptor(name, editorReg); } catch (CoreException e) { throw new PartInitException(IDEWorkbenchMessages.IDE_noFileEditorFound, e); } if (editorDesc == null) { throw new PartInitException( IDEWorkbenchMessages.IDE_noFileEditorFound); } return editorDesc; }

Target:
private static IEditorDescriptor getEditorDescriptor(String name, IEditorRegistry editorReg, IEditorDescriptor defaultDescriptor, boolean allowInteractive) throws PartInitException, OperationCanceledException { if (defaultDescriptor != null) { return defaultDescriptor; } IUnknownEditorStrategy strategy = getUnknowEditorStrategy(allowInteractive); if (strategy == null) { strategy = new SystemEditorOrTextEditorStrategy(); } IEditorDescriptor editorDesc; try { editorDesc = strategy.getEditorDescriptor(name, editorReg); } catch (CoreException e) { throw new PartInitException(IDEWorkbenchMessages.IDE_noFileEditorFound, e); } if (editorDesc == null) { throw new PartInitException( IDEWorkbenchMessages.IDE_noFileEditorFound); } return editorDesc; }
Source:
public static SmartSyncSDKManager getInstance() { if (INSTANCE != null) { SalesforceSDKManager.getInstance().registerUsedAppFeature(FEATURE_SMART_SYNC); return (SmartSyncSDKManager) INSTANCE; } else { throw new RuntimeException("Applications need to call SmartSyncSDKManager.init() first."); } }

Target:
public static SmartSyncSDKManager getInstance() { if (INSTANCE != null) { return (SmartSyncSDKManager) INSTANCE; } else { throw new RuntimeException("Applications need to call SmartSyncSDKManager.init() first."); } }
Source:
public void testSameDiff() throws Exception { write(new File(db.getDirectory().getParent(), "test.txt"), "test"); File folder = new File(db.getDirectory().getParent(), "folder"); folder.mkdir(); write(new File(folder, "folder.txt"), "\n\n\n\nfolder"); Git git = new Git(db); git.add().addFilepattern(".").call(); git.commit().setMessage("Initial commit").call(); write(new File(folder, "folder.txt"), "\n\n\n\nfolder change"); PatchIdDiffFormatter df = new PatchIdDiffFormatter(); df.setRepository(db); df.setPathFilter(PathFilter.create("folder")); DirCacheIterator oldTree = new DirCacheIterator(db.readDirCache()); FileTreeIterator newTree = new FileTreeIterator(db); df.format(oldTree, newTree); df.flush(); assertEquals("AnyObjectId[08fca5ac531383eb1da8bf6b6f7cf44411281407]", df.getCalulatedPatchId().toString()); write(new File(folder, "folder.txt"), "a\n\n\n\nfolder"); git.add().addFilepattern(".").call(); git.commit().setMessage("Initial commit").call(); write(new File(folder, "folder.txt"), "a\n\n\n\nfolder change"); df = new PatchIdDiffFormatter(); df.setRepository(db); df.setPathFilter(PathFilter.create("folder")); oldTree = new DirCacheIterator(db.readDirCache()); newTree = new FileTreeIterator(db); df.format(oldTree, newTree); df.flush(); assertEquals("AnyObjectId[08fca5ac531383eb1da8bf6b6f7cf44411281407]", df.getCalulatedPatchId().toString()); }

Target:
public void testSameDiff() throws Exception { write(new File(db.getDirectory().getParent(), "test.txt"), "test"); File folder = new File(db.getDirectory().getParent(), "folder"); folder.mkdir(); write(new File(folder, "folder.txt"), "\n\n\n\nfolder"); Git git = new Git(db); git.add().addFilepattern(".").call(); git.commit().setMessage("Initial commit").call(); write(new File(folder, "folder.txt"), "\n\n\n\nfolder change"); PatchIdDiffFormatter df = new PatchIdDiffFormatter(); df.setRepository(db); df.setPathFilter(PathFilter.create("folder")); DirCacheIterator oldTree = new DirCacheIterator(db.readDirCache()); FileTreeIterator newTree = new FileTreeIterator(db); df.format(oldTree, newTree); df.flush(); assertEquals("08fca5ac531383eb1da8bf6b6f7cf44411281407", df .getCalulatedPatchId().name()); write(new File(folder, "folder.txt"), "a\n\n\n\nfolder"); git.add().addFilepattern(".").call(); git.commit().setMessage("Initial commit").call(); write(new File(folder, "folder.txt"), "a\n\n\n\nfolder change"); df = new PatchIdDiffFormatter(); df.setRepository(db); df.setPathFilter(PathFilter.create("folder")); oldTree = new DirCacheIterator(db.readDirCache()); newTree = new FileTreeIterator(db); df.format(oldTree, newTree); df.flush(); assertEquals("08fca5ac531383eb1da8bf6b6f7cf44411281407", df .getCalulatedPatchId().name()); }
Source:
public void testnameEqualsWhenEqual() { assertTrue(nameEquals("jclouds").apply(ref)); }

Target:
public void testnameEqualsWhenEqual() { assertTrue(nameEquals("jclouds").apply(ref), "expected 'jclouds' as the name of " + ref); }
Source:
protected ApiRequest validateLaunchConfigs(Service service, ApiRequest request) { Map<String, Object> data = CollectionUtils.toMap(request.getRequestObject()); List<Object> modifiedSlcs = new ArrayList<>(); if (data.get(ServiceConstants.FIELD_SECONDARY_LAUNCH_CONFIGS) != null) { List<Object> slcs = (List<Object>) data.get(ServiceConstants.FIELD_SECONDARY_LAUNCH_CONFIGS); for (Object slcObj : slcs) { Map<String, Object> slc = (Map<String, Object>) slcObj; slc.put(InstanceConstants.FIELD_NETWORK_MODE, NetworkConstants.NETWORK_MODE_CONTAINER); slc.put(InstanceConstants.FIELD_NETWORK_CONTAINER_ID, service.getName()); modifiedSlcs.add(slc); } data.put(ServiceConstants.FIELD_SECONDARY_LAUNCH_CONFIGS, modifiedSlcs); request.setRequestObject(data); } Object newName = data.get("name"); String serviceName = newName != null ? newName.toString() : service.getName(); List<Map<String, Object>> launchConfigs = populateLaunchConfigs(service, request); validateLaunchConfigNames(service, serviceName, launchConfigs); validateLaunchConfigsCircularRefs(service, serviceName, launchConfigs); validateScale(service, request); return request; }

Target:
protected void validateLaunchConfigs(Service service, ApiRequest request) { Map<String, Object> data = CollectionUtils.toMap(request.getRequestObject()); Object newName = data.get("name"); String serviceName = newName != null ? newName.toString() : service.getName(); List<Map<String, Object>> launchConfigs = populateLaunchConfigs(service, request); validateLaunchConfigNames(service, serviceName, launchConfigs); validateLaunchConfigsCircularRefs(service, serviceName, launchConfigs); validateScale(service, request); }
Source:
public int hashCode() { return Objects.hash(id, status, savepoint, triggerTimestamp, latestAckTimestamp, stateSize, duration, alignmentBuffered, numSubtasks, numAckSubtasks, checkPointType, checkpointStatisticsPerTask); }

Target:
public int hashCode() { return Objects.hash( id, status, savepoint, triggerTimestamp, latestAckTimestamp, stateSize, duration, alignmentBuffered, processedData, persistedData, numSubtasks, numAckSubtasks, checkpointType, checkpointStatisticsPerTask); }
Source:
protected void assertSameLastUpdateTime() { assertTrueEventually(() -> { long lastUpdateTime = localCollectionStats.getLastUpdateTime(); assertEqualsStringFormat("Expected the lastUpdateTime to be %d, but was %d", previousUpdateTime, lastUpdateTime); previousUpdateTime = lastUpdateTime; }); }

Target:
protected void assertSameLastUpdateTime() { long lastUpdateTime = localCollectionStats.getLastUpdateTime(); assertEqualsStringFormat("Expected the lastUpdateTime to be %d, but was %d", previousUpdateTime, lastUpdateTime); previousUpdateTime = lastUpdateTime; }
Source:
private static void expectedCounts( List<Metacard> metacards, int total, int queryTemplates, int resultTemplates) { assertThat( "Expected total number of generated metacards to be " + total, metacards.size(), is(total)); assertThat( "Expected number of generated query template metacards to be " + queryTemplates, metacards.stream().filter(QueryTemplateMetacardImpl::isQueryTemplateMetacard).count(), is((long) queryTemplates)); assertThat( "Expected number of generated result template metacards to be " + resultTemplates, metacards.stream().filter(ResultTemplateMetacardImpl::isResultTemplateMetacard).count(), is((long) resultTemplates)); }

Target:
private static void expectedCounts( List<Metacard> metacards, int total, int queryTemplates, int resultTemplates) { assertThat( "Expected total number of generated metacards to be " + total, metacards, hasSize(total)); assertThat( "Expected number of generated query template metacards to be " + queryTemplates, metacards.stream().filter(QueryTemplateMetacard::isQueryTemplateMetacard).count(), is((long) queryTemplates)); assertThat( "Expected number of generated result template metacards to be " + resultTemplates, metacards.stream().filter(AttributeGroupMetacard::isAttributeGroupMetacard).count(), is((long) resultTemplates)); }
Source:
private void generateDeepLinkLoader(List<DeepLinkAnnotatedElement> elements) throws IOException { MethodSpec.Builder loadMethod = MethodSpec.methodBuilder("load") .returns(void.class); FieldSpec registry = FieldSpec .builder(ParameterizedTypeName.get(List.class, DeepLinkEntry.class), "registry", Modifier.PRIVATE, Modifier.FINAL) .initializer("new $T<>()", TypeName.get(LinkedList.class)) .build(); for (DeepLinkAnnotatedElement element : elements) { String type = "DeepLinkEntry.Type." + element.getAnnotationType().toString(); ClassName activity = ClassName.bestGuess(element.getActivity()); Object method = element.getMethod() == null ? null : element.getMethod(); String uri = element.getUri(); loadMethod.addStatement("registry.add(new DeepLinkEntry($S, $L, $T.class, $S))", uri, type, activity, method); } MethodSpec parseMethod = MethodSpec.methodBuilder("parseUri") .addParameter(String.class, "uri") .returns(DeepLinkEntry.class) .beginControlFlow("for (DeepLinkEntry entry : registry)") .beginControlFlow("if (entry.matches(uri))") .addStatement("return entry") .endControlFlow() .endControlFlow() .addStatement("return null") .build(); TypeSpec deepLinkLoader = TypeSpec.classBuilder("DeepLinkLoader") .addModifiers(Modifier.PUBLIC, Modifier.FINAL) .addField(registry) .addMethod(loadMethod.build()) .addMethod(parseMethod) .build(); JavaFile.builder("com.airbnb.deeplinkdispatch", deepLinkLoader) .build() .writeTo(filer); }

Target:
private void generateDeepLinkLoader(List<DeepLinkAnnotatedElement> elements) throws IOException { FieldSpec registry = FieldSpec .builder(ParameterizedTypeName.get(List.class, DeepLinkEntry.class), "registry", Modifier.PRIVATE, Modifier.FINAL) .initializer("new $T<>()", TypeName.get(LinkedList.class)) .build(); MethodSpec.Builder loadMethod = MethodSpec.methodBuilder("load") .returns(void.class); for (DeepLinkAnnotatedElement element : elements) { String type = "DeepLinkEntry.Type." + element.getAnnotationType().toString(); ClassName activity = ClassName.bestGuess(element.getActivity()); Object method = element.getMethod() == null ? null : element.getMethod(); String uri = element.getUri(); loadMethod.addStatement("registry.add(new DeepLinkEntry($S, $L, $T.class, $S))", uri, type, activity, method); } MethodSpec parseMethod = MethodSpec.methodBuilder("parseUri") .addParameter(String.class, "uri") .returns(DeepLinkEntry.class) .beginControlFlow("for (DeepLinkEntry entry : registry)") .beginControlFlow("if (entry.matches(uri))") .addStatement("return entry") .endControlFlow() .endControlFlow() .addStatement("return null") .build(); TypeSpec deepLinkLoader = TypeSpec.classBuilder("DeepLinkLoader") .addModifiers(Modifier.PUBLIC, Modifier.FINAL) .addField(registry) .addMethod(loadMethod.build()) .addMethod(parseMethod) .build(); JavaFile.builder("com.airbnb.deeplinkdispatch", deepLinkLoader) .build() .writeTo(filer); }
Source:
public final Boolean isAABBInsideMaterial(World world, BlockPos pos, AxisAlignedBB aabb, Material material) { IMicroblockContainerTile tile = getMicroblockTile(world, pos); Boolean def = isAABBInsideMaterialDefault(world, pos, aabb, material); if (tile == null) { return def; } Boolean is = tile.getMicroblockContainer().getPartContainer().isAABBInsideMaterial(aabb, material); if ((def != null && def == true) || (is != null && is == true)) { return true; } if ((def != null && def == false) || (is != null && is == false)) { return false; } return null; }

Target:
public final Boolean isAABBInsideMaterial(World world, BlockPos pos, AxisAlignedBB aabb, Material material) { IMicroblockContainerTile tile = getMicroblockTile(world, pos); Boolean def = isAABBInsideMaterialDefault(world, pos, aabb, material); if (tile != null) { Boolean is = tile.getMicroblockContainer().getPartContainer().isAABBInsideMaterial(aabb, material); if ((def != null && def == true) || (is != null && is == true)) { return true; } if ((def != null && def == false) || (is != null && is == false)) { return false; } return null; } return def; }
Source:
public void setExceptionHandler(UncaughtExceptionHandler exceptionHandler) { this.uncaughtExceptionHandler = exceptionHandler; this.bookie.setExceptionHandler(exceptionHandler); }

Target:
public void setExceptionHandler(UncaughtExceptionHandler exceptionHandler) { this.uncaughtExceptionHandler = exceptionHandler; }
Source:
public String getReference() { return "<LINK_0>"; }

Target:
public String getReference() { return REFERENCE; }
Source:
void addIntermediateStream(StreamSpec streamSpec, JobNode from, JobNode to) { StreamEdge edge = getOrCreateStreamEdge(streamSpec); edge.addSourceNode(from); edge.addTargetNode(to); edge.setIsIntermediate(true); from.addOutEdge(edge); to.addInEdge(edge); intermediateStreams.add(edge); }

Target:
void addIntermediateStream(StreamSpec streamSpec, JobNode from, JobNode to) { StreamEdge edge = getOrCreateStreamEdge(streamSpec, true); edge.addSourceNode(from); edge.addTargetNode(to); from.addOutEdge(edge); to.addInEdge(edge); intermediateStreams.add(edge); }
Source:
public static Version parse(String version) { final Matcher matcher = VERSION_PATTERN.matcher(version); if (matcher.find() && matcher.groupCount() == 4) { final int major = Integer.parseInt(matcher.group(1)); final int minor = Integer.parseInt(matcher.group(2)); final int patch = Integer.parseInt(matcher.group(3)); if (major < 0) { throw new IllegalArgumentException("Major version number cannot be negative!"); } if (minor < 0) { throw new IllegalArgumentException("Minor version number cannot be negative!"); } if (patch < 0) { throw new IllegalArgumentException("Patch version number cannot be negative!"); } final String stability = parseStability(matcher.group(4)); return new Version(major, minor, patch, stability); } else { throw new IllegalArgumentException("Could not parse version: " + version); } }

Target:
public static Version parse(String version) { final Matcher matcher = VERSION_PATTERN.matcher(version); if (matcher.find() && matcher.groupCount() == 4) { final int major = Integer.parseInt(matcher.group(1)); final int minor = Integer.parseInt(matcher.group(2)); final int patch = Integer.parseInt(matcher.group(3)); final String stability = parseStability(matcher.group(4)); return new Version(major, minor, patch, stability); } else { throw new IllegalArgumentException("Could not parse version: " + version); } }
Source:
public Integer when() { final Object value = this.get("when"); return (null != value) ? new Integer(value.toString()) : null; }

Target:
public Integer when() { return (Integer) this.get("when"); }
Source:
public static void saveRecordTreesToLocalStore(SyncManager syncManager, SyncTarget target, ParentInfo parentInfo, ChildrenInfo childrenInfo, JSONArray recordTrees) throws JSONException { SmartStore smartStore = syncManager.getSmartStore(); SmartSyncSDKManager.getInstance().registerUsedAppFeature(FEATURE_RELATED_RECORDS); synchronized(smartStore.getDatabase()) { try { smartStore.beginTransaction(); for (int i=0; i<recordTrees.length(); i++) { JSONObject record = recordTrees.getJSONObject(i); JSONObject parent = new JSONObject(record.toString()); JSONArray children = (JSONArray) parent.remove(childrenInfo.sobjectTypePlural); target.cleanRecord(parent); target.cleanAndSaveInSmartStore(smartStore, parentInfo.soupName, parent, false); if (children != null) { for (int j = 0; j < children.length(); j++) { JSONObject child = children.getJSONObject(j); child.put(childrenInfo.parentIdFieldName, parent.get(parentInfo.idFieldName)); target.cleanRecord(child); target.cleanAndSaveInSmartStore(smartStore, childrenInfo.soupName, child, false); } } } smartStore.setTransactionSuccessful(); } finally { smartStore.endTransaction(); } } }

Target:
public static void saveRecordTreesToLocalStore(SyncManager syncManager, SyncTarget target, ParentInfo parentInfo, ChildrenInfo childrenInfo, JSONArray recordTrees) throws JSONException { SmartStore smartStore = syncManager.getSmartStore(); synchronized(smartStore.getDatabase()) { try { smartStore.beginTransaction(); for (int i=0; i<recordTrees.length(); i++) { JSONObject record = recordTrees.getJSONObject(i); JSONObject parent = new JSONObject(record.toString()); JSONArray children = (JSONArray) parent.remove(childrenInfo.sobjectTypePlural); target.cleanRecord(parent); target.cleanAndSaveInSmartStore(smartStore, parentInfo.soupName, parent, false); if (children != null) { for (int j = 0; j < children.length(); j++) { JSONObject child = children.getJSONObject(j); child.put(childrenInfo.parentIdFieldName, parent.get(parentInfo.idFieldName)); target.cleanRecord(child); target.cleanAndSaveInSmartStore(smartStore, childrenInfo.soupName, child, false); } } } smartStore.setTransactionSuccessful(); } finally { smartStore.endTransaction(); } } }
Source:
public void testIsSatisfied() { Bundle bundle = mock(Bundle.class); Dictionary<String, String> headers = new Hashtable<>(); headers.put("Bundle-SymbolicName", "bundle2"); when(bundle.getHeaders()).thenReturn(headers); BundleNameCondition bundleNameCondition = new BundleNameCondition( bundle, new ConditionInfo( BundleNameCondition.class.getName(), new String[] {"bundle1/bundle2/bundle3"})); boolean satisfied = bundleNameCondition.isSatisfied(); assertThat(satisfied, is(true)); satisfied = bundleNameCondition.isSatisfied(); assertThat(satisfied, is(true)); }

Target:
public void testIsSatisfied() { Bundle bundle = mock(Bundle.class); Dictionary<String, String> headers = new Hashtable<>(); headers.put("Bundle-SymbolicName", "bundle2"); when(bundle.getHeaders()).thenReturn(headers); BundleNameCondition bundleNameCondition = new BundleNameCondition( bundle, new ConditionInfo( BundleNameCondition.class.getName(), new String[] {"bundle1", "bundle2", "bundle3"})); boolean satisfied = bundleNameCondition.isSatisfied(); assertThat(satisfied, is(true)); satisfied = bundleNameCondition.isSatisfied(); assertThat(satisfied, is(true)); }
Source:
public void setUp() { context = InstrumentationRegistry.getTargetContext(); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); editor = sharedPreferences.edit(); editor.clear(); editor.commit(); exception = new RuntimeException("Error"); }

Target:
public void setUp() { context = InstrumentationRegistry.getTargetContext(); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); editor = sharedPreferences.edit(); editor.clear(); editor.putBoolean(SettingsActivity.SETTINGS_CRASH_REPORTS, true); editor.commit(); exception = new RuntimeException("Error"); CrashReporter.setIsCrashReportEnabled(true); CrashReporter.initialize(context); }
Source:
void runOnceForTable(TableToSweep tableToSweep, Optional<SweepBatchConfig> newSweepBatchConfig, boolean saveSweepResults) { Stopwatch watch = Stopwatch.createStarted(); TableReference tableRef = tableToSweep.getTableRef(); byte[] startRow = tableToSweep.getStartRow(); SweepBatchConfig batchConfig = newSweepBatchConfig.orElse(getAdjustedBatchConfig()); try { SweepResults results = sweepRunner.run( tableRef, batchConfig, startRow); long elapsedMillis = watch.elapsed(TimeUnit.MILLISECONDS); log.info("Swept successfully.", LoggingArgs.tableRef("tableRef", tableRef), UnsafeArg.of("startRow", startRowToHex(startRow)), SafeArg.of("cell+ts pairs examined", results.getCellTsPairsExamined()), SafeArg.of("cell+ts pairs deleted", results.getStaleValuesDeleted()), SafeArg.of("time taken", elapsedMillis), SafeArg.of("last swept timestamp", results.getSweptTimestamp())); sweepPerfLogger.logSweepResults( SweepPerformanceResults.builder() .sweepResults(results) .tableName(tableRef.getQualifiedName()) .elapsedMillis(elapsedMillis) .build()); if (saveSweepResults) { saveSweepResults(tableToSweep, results); } } catch (RuntimeException e) { log.info("Failed to sweep.", LoggingArgs.tableRef("tableRef", tableRef), UnsafeArg.of("startRow", startRowToHex(startRow)), SafeArg.of("batchConfig", batchConfig)); throw e; } }

Target:
void runOnceForTable(TableToSweep tableToSweep, Optional<SweepBatchConfig> newSweepBatchConfig, boolean saveSweepResults) { Stopwatch watch = Stopwatch.createStarted(); TableReference tableRef = tableToSweep.getTableRef(); byte[] startRow = tableToSweep.getStartRow(); SweepBatchConfig batchConfig = newSweepBatchConfig.orElse(getAdjustedBatchConfig()); try { SweepResults results = sweepRunner.run( tableRef, batchConfig, startRow); long elapsedMillis = watch.elapsed(TimeUnit.MILLISECONDS); log.info("Swept successfully.", LoggingArgs.tableRef("tableRef", tableRef), UnsafeArg.of("startRow", startRowToHex(startRow)), SafeArg.of("cellTs pairs examined", results.getCellTsPairsExamined()), SafeArg.of("cellTs pairs deleted", results.getStaleValuesDeleted()), SafeArg.of("time taken", elapsedMillis), SafeArg.of("last swept timestamp", results.getSweptTimestamp())); sweepPerfLogger.logSweepResults( SweepPerformanceResults.builder() .sweepResults(results) .tableName(tableRef.getQualifiedName()) .elapsedMillis(elapsedMillis) .build()); if (saveSweepResults) { saveSweepResults(tableToSweep, results); } } catch (RuntimeException e) { log.info("Failed to sweep.", LoggingArgs.tableRef("tableRef", tableRef), UnsafeArg.of("startRow", startRowToHex(startRow)), SafeArg.of("batchConfig", batchConfig)); throw e; } }
Source:
public void rollback() throws IllegalStateException, SecurityException, SystemException { notifyAssociationListeners(getTransaction(), TransactionEvent.DISASSOCIATING); transactionManager.rollback(); }

Target:
public void rollback() throws IllegalStateException, SecurityException, SystemException { notifyAssociationListeners(getTransaction(), EnumSet.of(EventType.DISASSOCIATING)); transactionManager.rollback() ; }
Source:
public void joinTest() { assertEquals("<LINK_0>path", URIUtil.join("<LINK_1>base", "path")); assertEquals("<LINK_0>path/to", URIUtil.join("<LINK_1>", "base/", "/path", "to/")); assertEquals("path/to", URIUtil.join("", "path", "to")); assertEquals("<LINK_0>path", URIUtil.join(URI.create("<LINK_1>base"), "path")); }

Target:
public void joinTest() { assertEquals("<LINK_2>", URIUtil.join("<LINK_1>")); assertEquals("<LINK_1>base", URIUtil.join("<LINK_0>", new String[0])); assertEquals("<LINK_0>path", URIUtil.join("<LINK_1>base", "path")); assertEquals("<LINK_0>path/to", URIUtil.join("<LINK_1>", "base/", "/path", "to/")); assertEquals("path/to", URIUtil.join("", "path", "to")); assertEquals("path/to", URIUtil.join((String) null, "path", "to")); assertEquals("<LINK_0>path", URIUtil.join(URI.create("<LINK_1>base"), "path")); assertEquals("path", URIUtil.join((URI) null, "path")); }
Source:
public void replaceWithMoreThanMaxItems() { List<Object> items = createItems(); String[] messageItems = ReplacementUtils.replaceWith(PROPERTY_NAME, items); validateMessageContainsProperties(messageItems); assertTrue(messageItems[1].contains(String.valueOf(items.size()))); }

Target:
public void replaceWithMoreThanMaxItems() { List<Object> items = createItems(); String[] messageItems = ReplacementUtils.replaceWith(PROPERTY_NAME, items); validateMessageContainsProperties(messageItems); validateMessageDoesNotContainUnexpectedItems(messageItems[0], items); assertTrue(messageItems[1].contains(String.valueOf(items.size()))); }
Source:
public static Collection<Tile> parseTileMetrics(final File tileMetricsOutFile, final Map<Integer, File> phasingMetricsFiles, final ReadStructure readStructure, final ValidationStringency validationStringency) throws FileNotFoundException { Map<Integer, Map<Integer, Collection<TilePhasingValue>>> phasingValues = getTilePhasingValues(phasingMetricsFiles, readStructure); TileMetricsOutReader tileMetricsIterator = new TileMetricsOutReader(tileMetricsOutFile, TileMetricsOutReader.TileMetricsVersion.THREE); final Collection<IlluminaTileMetrics> tileMetrics = determineLastValueForLaneTileMetricsCode(tileMetricsIterator); final Map<String, ? extends Collection<IlluminaTileMetrics>> locationToMetricsMap = partitionTileMetricsByLocation(tileMetrics); return getTileClusterRecordsV3(locationToMetricsMap, phasingValues, tileMetricsIterator.getDensity()); }

Target:
public static Collection<Tile> parseTileMetrics(final File tileMetricsOutFile, final Map<Integer, File> phasingMetricsFiles, final ReadStructure readStructure, final ValidationStringency validationStringency) throws FileNotFoundException { final Map<Integer, Map<Integer, Collection<TilePhasingValue>>> phasingValues = getTilePhasingValues(phasingMetricsFiles, readStructure); final TileMetricsOutReader tileMetricsIterator = new TileMetricsOutReader(tileMetricsOutFile, TileMetricsOutReader.TileMetricsVersion.THREE); final Collection<IlluminaTileMetrics> tileMetrics = determineLastValueForLaneTileMetricsCode(tileMetricsIterator); final Map<String, ? extends Collection<IlluminaTileMetrics>> locationToMetricsMap = partitionTileMetricsByLocation(tileMetrics); return getTileClusterRecordsV3(locationToMetricsMap, phasingValues, tileMetricsIterator.getDensity()); }
Source:
private boolean isBoardNameDuplicate(String newName) { if (prefs.getAllBoards().containsKey(newName)) { return true; } return false; }

Target:
private boolean isBoardNameDuplicate(String newName) { return prefs.getAllBoards().containsKey(newName); }