auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testWebsocketConnectionWithUsernamePassword() throws Exception { MockMqttClient mockClient = new MockMqttClient(); AWSIotMqttManager awsIotMqttManager = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); awsIotMqttManager.setMqttClient(mockClient); TestClientStatusCallback csb = new TestClientStatusCallback(); awsIotMqttManager.connect("user", "password", csb); Thread.sleep(500); mockClient.mockConnectSuccess(); assertEquals(1, mockClient.connectCalls); assertTrue(mockClient.mostRecentOptions.isCleanSession()); assertEquals(300, mockClient.mostRecentOptions.getKeepAliveInterval()); assertEquals(2, csb.statuses.size()); assertEquals(AWSIotMqttClientStatusCallback.AWSIotMqttClientStatus.Connecting, csb.statuses.get(0)); assertEquals(AWSIotMqttClientStatusCallback.AWSIotMqttClientStatus.Connected, csb.statuses.get(1)); assertEquals(MqttManagerConnectionState.Connected, awsIotMqttManager.getConnectionState()); }

Target:
public void testWebsocketConnectionWithUsernamePassword() throws Exception { MockMqttClient mockClient = new MockMqttClient(); AWSIotMqttManager awsIotMqttManager = new AWSIotMqttManager("test-client", Region.getRegion(Regions.US_EAST_1), TEST_ENDPOINT_PREFIX); awsIotMqttManager.setMqttClient(mockClient); TestClientStatusCallback csb = new TestClientStatusCallback(); awsIotMqttManager.connect("user", "pass", csb); csb.latch.await(500, TimeUnit.MILLISECONDS); mockClient.mockConnectSuccess(); assertEquals(1, mockClient.connectCalls); assertTrue(mockClient.mostRecentOptions.isCleanSession()); assertEquals(300, mockClient.mostRecentOptions.getKeepAliveInterval()); assertEquals(2, csb.statuses.size()); assertEquals( Arrays.asList(AWSIotMqttClientStatus.Connecting, AWSIotMqttClientStatus.Connected), csb.statuses ); assertEquals(MqttManagerConnectionState.Connected, awsIotMqttManager.getConnectionState()); }
Source:
public void setLabelClass(String value) { if (!value.startsWith(ChunkContextToolbar.CHUNK_CLASS_PREFIX + CHUNK_OUTPUT_PREFIX)) value = new String(ChunkContextToolbar.CHUNK_CLASS_PREFIX + CHUNK_OUTPUT_PREFIX + value); value = StringUtil.getCssIdentifier(value); if (value != label_) { if (!StringUtil.isNullOrEmpty(label_)) this.removeStyleName(label_); label_ = value; this.addStyleName(label_); } }

Target:
public void setLabelClass(String value) { if (!value.startsWith(ChunkContextToolbar.CHUNK_CLASS_PREFIX + CHUNK_OUTPUT_PREFIX)) value = new String(ChunkContextToolbar.CHUNK_CLASS_PREFIX + CHUNK_OUTPUT_PREFIX + value); value = StringUtil.getCssIdentifier(value); if (!StringUtil.equals(value, label_)) { if (!StringUtil.isNullOrEmpty(label_)) this.removeStyleName(label_); label_ = value; this.addStyleName(label_); } }
Source:
public void clearCache() throws SQLException { ((Session)this.getDBConnection().getSession()).clear(); }

Target:
public void clearCache() throws SQLException { this.getDBConnection().clearCache(); }
Source:
public void clearAnswer() { Toast.makeText(getContext(), "URL is readonly", Toast.LENGTH_SHORT).show(); }

Target:
public void clearAnswer() { ToastUtils.showShortToast("URL is readonly"); }
Source:
private void parseResource(Archive archive, String parent) throws Exception { ResourceBuilder rb = new ResourceBuilder(); Version frameworkVersion = toFrameworkVersion(archive.revision.version.getOSGiVersion()); String bsn = archive.revision.program.toString(); try { File binary = repo.get(archive) .getValue(); if (!rb.addFile(binary, binary.toURI())) { addReserveIdentity(rb, bsn, frameworkVersion); } addInformationCapability(rb, archive.toString(), parent); } catch (Exception e) { Throwable theException = e; if (e instanceof InvocationTargetException) { theException = e.getCause(); } addReserveIdentity(rb, bsn, frameworkVersion); addInformationCapability(rb, archive.toString(), parent, theException); } resources.put(archive, rb.build()); }

Target:
private void parseResource(Archive archive, String parent) throws Exception { ResourceBuilder rb = new ResourceBuilder(); Version frameworkVersion = toFrameworkVersion(archive.revision.version.getOSGiVersion()); String bsn = archive.revision.program.toString(); try { File binary = repo.get(archive) .getValue(); if (!rb.addFile(binary, binary.toURI())) { addReserveIdentity(rb, bsn, frameworkVersion); } addInformationCapability(rb, archive.toString(), parent); } catch (Exception e) { Throwable theException = Exceptions.unrollCause(e, InvocationTargetException.class); addReserveIdentity(rb, bsn, frameworkVersion); addInformationCapability(rb, archive.toString(), parent, theException); } resources.put(archive, rb.build()); }
Source:
public List<JiraIssueParameterDefinition.Result> getIssues() throws IOException, TimeoutException { Job<?, ?> context = Stapler.getCurrentRequest().findAncestorObject(Job.class); JiraSite site = JiraSite.get(context); if (site == null) throw new IllegalStateException("Jira site needs to be configured in the project " + context.getFullDisplayName()); JiraSession session = site.getSession(null); if (session == null) throw new IllegalStateException("Remote access for Jira isn't configured in Jenkins"); List<Issue> issues = session.getIssuesFromJqlSearch(jiraIssueFilter); List<Result> issueValues = new ArrayList<>(); for (Issue issue : fixNull(issues)) { issueValues.add(new Result(issue, this.altSummaryFields)); } return issueValues; }

Target:
public List<JiraIssueParameterDefinition.Result> getIssues() throws IOException, TimeoutException { Job<?, ?> job = Stapler.getCurrentRequest().findAncestorObject(Job.class); JiraSite site = JiraSite.get(job); if (site == null) throw new IllegalStateException("Jira site needs to be configured in the project " + job.getFullDisplayName()); JiraSession session = site.getSession(job); if (session == null) throw new IllegalStateException("Remote access for Jira isn't configured in Jenkins"); List<Issue> issues = session.getIssuesFromJqlSearch(jiraIssueFilter); List<Result> issueValues = new ArrayList<>(); for (Issue issue : fixNull(issues)) { issueValues.add(new Result(issue, this.altSummaryFields)); } return issueValues; }
Source:
public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (confirmed != null ? confirmed.hashCode() : 0); result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0); result = 31 * result + (role != null ? role.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); result = 31 * result + (updatedAt != null ? updatedAt.hashCode() : 0); result = 31 * result + (email != null ? email.hashCode() : 0); result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (deletedAt != null ? deletedAt.hashCode() : 0); result = 31 * result + (reportsTo != null ? reportsTo.hashCode() : 0); result = 31 * result + (timezone != null ? timezone.hashCode() : 0); result = 31 * result + (group != null ? group.hashCode() : 0); result = 31 * result + roles.hashCode(); return result; }

Target:
public int hashCode() { int result = id != null ? id.hashCode() : 0; result = 31 * result + (id != null ? id.hashCode() : 0); result = 31 * result + (confirmed != null ? confirmed.hashCode() : 0); result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0); result = 31 * result + (role != null ? role.hashCode() : 0); result = 31 * result + (status != null ? status.hashCode() : 0); result = 31 * result + (updatedAt != null ? updatedAt.hashCode() : 0); result = 31 * result + (email != null ? email.hashCode() : 0); result = 31 * result + (name != null ? name.hashCode() : 0); result = 31 * result + (deletedAt != null ? deletedAt.hashCode() : 0); result = 31 * result + (reportsTo != null ? reportsTo.hashCode() : 0); result = 31 * result + (timezone != null ? timezone.hashCode() : 0); result = 31 * result + (phoneNumber != null ? phoneNumber.hashCode() : 0); result = 31 * result + (teamName != null ? teamName.hashCode() : 0); result = 31 * result + (group != null ? group.hashCode() : 0); result = 31 * result + roles.hashCode(); return result; }
Source:
private static STRtree buildRTree(LongArrayList addresses, List<List<Block>> channels, int geometryChannel) { STRtree rtree = new STRtree(); for (int position = 0; position < addresses.size(); position++) { long pageAddress = addresses.getLong(position); int blockIndex = decodeSliceIndex(pageAddress); int blockPosition = decodePosition(pageAddress); Block block = channels.get(geometryChannel).get(blockIndex); if (block.isNull(blockPosition)) { continue; } Slice slice = block.getSlice(blockPosition, 0, block.getSliceLength(blockPosition)); OGCGeometry ogcGeometry = deserialize(slice); if (ogcGeometry.isEmpty()) { continue; } rtree.insert(getEnvelope(ogcGeometry), new PagesRTreeIndex.GeometryWithAddress(ogcGeometry, pageAddress)); } if (rtree.isEmpty()) { return null; } rtree.query(ZERO_ENVELOPE); return rtree; }

Target:
private static STRtree buildRTree(LongArrayList addresses, List<List<Block>> channels, int geometryChannel) { STRtree rtree = new STRtree(); for (int position = 0; position < addresses.size(); position++) { long pageAddress = addresses.getLong(position); int blockIndex = decodeSliceIndex(pageAddress); int blockPosition = decodePosition(pageAddress); Block block = channels.get(geometryChannel).get(blockIndex); if (block.isNull(blockPosition)) { continue; } Slice slice = block.getSlice(blockPosition, 0, block.getSliceLength(blockPosition)); OGCGeometry ogcGeometry = deserialize(slice); verify(ogcGeometry != null); if (ogcGeometry.isEmpty()) { continue; } rtree.insert(getEnvelope(ogcGeometry), new GeometryWithAddress(ogcGeometry, pageAddress)); } rtree.build(); return rtree; }
Source:
public PageTitleListCardItemView(Context context) { super(context); int paddingX = (int) getResources().getDimension(R.dimen.list_item_horizontal_padding); int paddingY = (int) getResources().getDimension(R.dimen.list_item_vertical_padding); setPadding(paddingX, paddingY, paddingX, paddingY); setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); setBackgroundResource(ResourceUtil.getThemedAttributeId(context, android.R.attr.selectableItemBackground)); setClickable(true); setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { if (callback != null && title != null) { callback.onSelectPage(title); } } }); }

Target:
public PageTitleListCardItemView(Context context) { super(context); setOnClickListener(new OnClickListener() { @Override public void onClick(View view) { if (callback != null && title != null) { callback.onSelectPage(title); } } }); }
Source:
public void refresh(Detail detail, TreeReference reference, int index, boolean hasDetailCalloutListener) { mEntityDetailPagerAdapter = new EntityDetailPagerAdapter(mContext.getSupportFragmentManager(), detail, index, reference, hasDetailCalloutListener, new DefaultEDVModifier() ); mViewPager.setAdapter(mEntityDetailPagerAdapter); if(!useNewTabStyle) markSelectedTab(0); }

Target:
public void refresh(Detail detail, TreeReference reference, int index, boolean hasDetailCalloutListener) { mEntityDetailPagerAdapter = new EntityDetailPagerAdapter(mContext.getSupportFragmentManager(), detail, index, reference, hasDetailCalloutListener, new DefaultEDVModifier() ); mViewPager.setAdapter(mEntityDetailPagerAdapter); }
Source:
public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException { VirtualFile mountPoint = VFS.getRootVirtualFile().getChild( "ROOT.war" ); try { VFS.mountReal( content, mountPoint ); SelfContainedContentService service = new SelfContainedContentService( mountPoint ); serviceActivatorContext.getServiceTarget().addService( SelfContainedContentService.NAME, service ).install(); } catch (IOException e) { e.printStackTrace(); throw new ServiceRegistryException(e); } }

Target:
public void activate(ServiceActivatorContext serviceActivatorContext) throws ServiceRegistryException { VirtualFile mountPoint = VFS.getRootVirtualFile().getChild( "ROOT.war" ); try { VFS.mountReal( content, mountPoint ); SelfContainedContentService service = new SelfContainedContentService( mountPoint ); serviceActivatorContext.getServiceTarget().addService( SelfContainedContentService.NAME, service ).install(); } catch (IOException e) { throw new ServiceRegistryException(e); } }
Source:
protected void parseSynchronusly() throws IOException { Optional<RDFFormat> formatByMimeType = getContentType().flatMap(Rio::getParserFormatForMIMEType); String base = getBase().map(IRI::getIRIString).orElse(null); ParserConfig parserConfig = new ParserConfig(); RDFLoader loader = new RDFLoader(parserConfig, rdf4jTermFactory.getValueFactory()); RDFHandler rdfHandler = makeRDFHandler(); if (getSourceFile().isPresent()) { Optional<RDFFormat> formatByFilename = getSourceFile().map(Path::getFileName).map(Path::toString) .flatMap(Rio::getParserFormatForFileName); RDFFormat format = formatByMimeType.orElse(formatByFilename.orElse(null)); try (InputStream in = Files.newInputStream(getSourceFile().get())) { loader.load(in, base, format, rdfHandler); } } else if (getSourceIri().isPresent()) { try { URL url = new URL(getSourceIri().get().getIRIString()); loader.load(url, base, formatByMimeType.orElse(null), makeRDFHandler()); } catch (MalformedURLException ex) { throw new IOException("Can't handle source URL: " + getSourceIri().get(), ex); } } loader.load(getSourceInputStream().get(), base, formatByMimeType.orElse(null), rdfHandler); }

Target:
protected void parseSynchronusly() throws IOException { Optional<RDFFormat> formatByMimeType = getContentType().flatMap(Rio::getParserFormatForMIMEType); String base = getBase().map(IRI::getIRIString).orElse(null); ParserConfig parserConfig = getParserConfig(); RDFLoader loader = new RDFLoader(parserConfig, rdf4jTermFactory.getValueFactory()); RDFHandler rdfHandler = makeRDFHandler(); if (getSourceFile().isPresent()) { Optional<RDFFormat> formatByFilename = getSourceFile().map(Path::getFileName).map(Path::toString) .flatMap(Rio::getParserFormatForFileName); RDFFormat format = formatByMimeType.orElse(formatByFilename.orElse(null)); try (InputStream in = Files.newInputStream(getSourceFile().get())) { loader.load(in, base, format, rdfHandler); } } else if (getSourceIri().isPresent()) { try { URL url = new URL(getSourceIri().get().getIRIString()); loader.load(url, base, formatByMimeType.orElse(null), makeRDFHandler()); } catch (MalformedURLException ex) { throw new IOException("Can't handle source URL: " + getSourceIri().get(), ex); } } loader.load(getSourceInputStream().get(), base, formatByMimeType.orElse(null), rdfHandler); }
Source:
public void testFieldNameIncrement() throws InterruptedException { assertNotNull(this.sink.input()); Message<String> message = MessageBuilder.withPayload("{\"test\": \"Hi\"}").build(); sink.input().send(message); message = MessageBuilder.withPayload("{\"test\": \"Hello\"}").build(); sink.input().send(message); message = MessageBuilder.withPayload("{\"test\": \"Hi\"}").build(); sink.input().send(message); assertEquals(2, this.fieldValueCounterRepository.findOne("FVCounter").getFieldValueCounts().get("Hi").longValue()); assertEquals(1, this.fieldValueCounterRepository.findOne("FVCounter").getFieldValueCounts().get("Hello").longValue()); }

Target:
public void testFieldNameIncrement() { assertNotNull(this.sink.input()); Message<String> message = MessageBuilder.withPayload("{\"test\": \"Hi\"}").build(); sink.input().send(message); message = MessageBuilder.withPayload("{\"test\": \"Hello\"}").build(); sink.input().send(message); message = MessageBuilder.withPayload("{\"test\": \"Hi\"}").build(); sink.input().send(message); assertEquals(2, this.fieldValueCounterRepository.findOne(FVC_NAME).getFieldValueCounts().get("Hi").longValue()); assertEquals(1, this.fieldValueCounterRepository.findOne(FVC_NAME).getFieldValueCounts().get("Hello").longValue()); }
Source:
public void testParsLong() { Assert.assertTrue(Objects.equals(Long.parseLong("+100"), GuavaUtils.tryParseLong("+100"))); }

Target:
public void testParsLong() { Assert.assertNull(Longs.tryParse("+100")); Assert.assertNull(GuavaUtils.tryParseLong("")); Assert.assertNull(GuavaUtils.tryParseLong(null)); Assert.assertNull(GuavaUtils.tryParseLong("+")); Assert.assertNull(GuavaUtils.tryParseLong("++100")); Assert.assertEquals((Object) Long.parseLong("+100"), GuavaUtils.tryParseLong("+100")); Assert.assertEquals((Object) Long.parseLong("-100"), GuavaUtils.tryParseLong("-100")); Assert.assertNotEquals(new Long(100), GuavaUtils.tryParseLong("+101")); }
Source:
public void no_parents() { FileInput fileInput = parse( "class C: ", " pass"); assertThat(fileInput.globalVariables()).hasSize(1); }

Target:
public void no_parents() { FileInput fileInput = parse( "class C: ", " pass"); ClassDef classDef = (ClassDef) fileInput.statements().statements().get(0); Symbol symbol = classDef.name().symbol(); assertThat(symbol instanceof ClassSymbol).isTrue(); assertThat(symbol.kind().equals(Symbol.Kind.CLASS)).isTrue(); ClassSymbol classSymbol = (ClassSymbol) symbol; assertThat(classSymbol.parents()).hasSize(0); assertThat(classSymbol.hasUnresolvedParents()).isFalse(); }
Source:
public void rejectsInvalidRelease() throws IOException { final Repo repo = new MkGithub().randomRepo(); final Issue issue = repo.issues().create("", ""); final Agent agent = new CommentsTag(repo.github()); repo.releases().create("1.0"); repo.releases().create("2.0"); repo.releases().create("3.0-b"); final Talk talk = CommentsTagTest.talk(issue, "4.0-alpha"); agent.execute(talk); final Comment.Smart response = new Comment.Smart( repo.issues().get(1).comments().get(1) ); MatcherAssert.assertThat( response.body(), Matchers.containsString("version tag is invalid") ); }

Target:
public void rejectsInvalidRelease() throws IOException { CommentsTagTest.assertInvalidRelease("4.0-alpha"); CommentsTagTest.assertInvalidRelease(".1"); CommentsTagTest.assertInvalidRelease("a.b.c"); }
Source:
protected String getExcludeSuiteFilter(Class<?> klass) throws Exception { ExcludeSuiteFilter excludeSuiteFilterAnnotation = (ExcludeSuiteFilter)klass.getAnnotation(ExcludeSuiteFilter.class); if (excludeSuiteFilterAnnotation == null) { return null; } else if (!"".equals(excludeSuiteFilterAnnotation.value())) { return excludeSuiteFilterAnnotation.value(); } else if (!"".equals(excludeSuiteFilterAnnotation.systemProperty())) { return System.getProperty(excludeSuiteFilterAnnotation.systemProperty()); } else { throw new InitializationError("In annotation @ExcludeSuiteFilter you have to specify either \'value\' or \'systemProperty\'"); } }

Target:
protected String getExcludeSuiteFilter(Class<?> klass) throws Exception { String excludeSuiteFilter = System.getProperty(EXCLUDE_SUITE_FILTER_OVERRIDE_VARIABLE_NAME); if (StringUtils.isEmpty(excludeSuiteFilter)) { return super.getExcludeSuiteFilter(klass); } return excludeSuiteFilter; }
Source:
public ArrayList<LunModel> getLunsToRefresh() { ArrayList<LunModel> luns = new ArrayList<>(); if (!getIsGrouppedByTarget()) { List<LunModel> items = (List<LunModel>) getItems(); luns.addAll(items.stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .distinct() .collect(Collectors.toList())); } else { List<SanTargetModel> sanTargetModels = (List<SanTargetModel>) getItems(); for (SanTargetModel sanTargetModel : sanTargetModels) { luns.addAll(sanTargetModel.getLuns().stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .distinct() .collect(Collectors.toList())); } } return luns; }

Target:
public List<LunModel> getLunsToRefresh() { List<LunModel> luns = Collections.emptyList(); if (!getIsGrouppedByTarget()) { List<LunModel> items = (List<LunModel>) getItems(); luns.addAll(items.stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .distinct() .collect(Collectors.toList())); } else { List<SanTargetModel> sanTargetModels = (List<SanTargetModel>) getItems(); for (SanTargetModel sanTargetModel : sanTargetModels) { luns = sanTargetModel.getLuns().stream() .filter(LunModel::getIsIncluded) .filter(LunModel::isAdditionalAvailableSizeSelected) .distinct() .collect(Collectors.toList()); } } return luns; }
Source:
public void testWasitUntilElementPipedLocator() { Grid.driver().get(url); try { WebDriverWaitUtils.waitUntilElementIsPresent(pipedLocator); assertTrue(true); } catch (WaitTimedOutException e) { fail(e.getMessage()); } }

Target:
public void testWasitUntilElementPipedLocator() { Grid.driver().get(url); WebDriverWaitUtils.waitUntilElementIsPresent(pipedLocator); }
Source:
public void testLocalBroadcast() { String action = "TEST_ACTION"; IntentFilter intentFilter = new IntentFilter(action); Application application = Robolectric.application; Observable<Intent> observable = AndroidObservable.fromLocalBroadcast(application, intentFilter); final Observer<Intent> observer = mock(Observer.class); final Subscription subscription = observable.subscribe(new TestObserver<Intent>(observer)); final InOrder inOrder = inOrder(observer); inOrder.verify(observer, never()).onNext(any(Intent.class)); Intent intent = new Intent(action); LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(application); localBroadcastManager.sendBroadcast(intent); inOrder.verify(observer, times(1)).onNext(intent); localBroadcastManager.sendBroadcast(intent); inOrder.verify(observer, times(1)).onNext(intent); subscription.unsubscribe(); inOrder.verify(observer, never()).onNext(any(Intent.class)); inOrder.verify(observer, never()).onError(any(Throwable.class)); inOrder.verify(observer, never()).onCompleted(); }

Target:
public void testLocalBroadcast() { String action = "TEST_ACTION"; IntentFilter intentFilter = new IntentFilter(action); Application application = Robolectric.application; Observable<Intent> observable = AndroidObservable.fromLocalBroadcast(application, intentFilter); final Observer<Intent> observer = mock(Observer.class); final Subscription subscription = observable.subscribe(new TestObserver<Intent>(observer)); final InOrder inOrder = inOrder(observer); inOrder.verify(observer, never()).onNext(any(Intent.class)); Intent intent = new Intent(action); LocalBroadcastManager localBroadcastManager = LocalBroadcastManager.getInstance(application); localBroadcastManager.sendBroadcast(intent); inOrder.verify(observer, times(1)).onNext(intent); localBroadcastManager.sendBroadcast(intent); inOrder.verify(observer, times(1)).onNext(intent); subscription.unsubscribe(); localBroadcastManager.sendBroadcast(intent); inOrder.verify(observer, never()).onNext(any(Intent.class)); inOrder.verify(observer, never()).onError(any(Throwable.class)); inOrder.verify(observer, never()).onCompleted(); }
Source:
public void update() { IDebuggerConsole[] consoles = getDebuggerConsoleManager().getConsoles(); setEnabled(consoles.length > 1); }

Target:
public void update() { IDebuggerConsole[] consoles = getDebuggerConsoleManager().getConsoles(); setEnabled(consoles.length > 0); }
Source:
private JComponent createBrowsePanel(Map<String[], String> formatFilter, Map<URI, Object> dataMap, URI uri, DescriptionType inputOrOutput){ JPanel dataComponent = new JPanel(); dataComponent.setLayout(new FlowLayout(FlowLayout.LEFT)); JTextField jtf = new JTextField(); jtf.setColumns(25); jtf.getDocument().putProperty("dataMap", dataMap); jtf.getDocument().putProperty("uri", uri); jtf.addMouseListener(EventHandler.create(MouseListener.class, this, "onSelected", "", "mouseClicked")); jtf.getDocument().addDocumentListener(EventHandler.create(DocumentListener.class, this, "saveDocumentText", "document")); OpenFilePanel filePanel = null; if(inputOrOutput instanceof Input){ filePanel = new OpenFilePanel("RawDataUI.File", "Select File"); } else if(inputOrOutput instanceof Output){ filePanel = new SaveFilePanel("RawDataUI.File", "Select File"); } for(Map.Entry<String[], String> entry : formatFilter.entrySet()){ filePanel.addFilter(entry.getKey(), entry.getValue()); } filePanel.setCurrentFilter(0); filePanel.loadState(); if(dataMap.get(uri) != null) jtf.setText(dataMap.get(uri).toString()); else { jtf.setText(filePanel.getCurrentDirectory().getAbsolutePath()); } dataComponent.add(jtf); JButton button = new JButton("Browse"); button.putClientProperty("dataMap", dataMap); button.putClientProperty("uri", uri); button.putClientProperty("JTextField", jtf); button.putClientProperty("filePanel", filePanel); button.addActionListener(EventHandler.create(ActionListener.class, this, "openLoadPanel", "")); dataComponent.add(button); return dataComponent; }

Target:
private JComponent createBrowsePanel(Map<String[], String> formatFilter, Map<URI, Object> dataMap, URI uri, DescriptionType inputOrOutput){ JPanel dataComponent = new JPanel(); dataComponent.setLayout(new FlowLayout(FlowLayout.LEFT)); JTextField jtf = new JTextField(); jtf.setColumns(BROWSETEXTFIELD_WIDTH); jtf.getDocument().putProperty("dataMap", dataMap); jtf.getDocument().putProperty("uri", uri); jtf.addMouseListener(EventHandler.create(MouseListener.class, this, "onSelected", "", "mouseClicked")); jtf.getDocument().addDocumentListener(EventHandler.create(DocumentListener.class, this, "saveDocumentText", "document")); OpenFilePanel filePanel = null; if(inputOrOutput instanceof Input){ filePanel = new OpenFilePanel("RawDataUI.File", "Select File"); } else if(inputOrOutput instanceof Output){ filePanel = new SaveFilePanel("RawDataUI.File", "Select File"); } for(Map.Entry<String[], String> entry : formatFilter.entrySet()){ filePanel.addFilter(entry.getKey(), entry.getValue()); } filePanel.setCurrentFilter(0); filePanel.loadState(); if(dataMap.get(uri) != null) jtf.setText(dataMap.get(uri).toString()); else { jtf.setText(filePanel.getCurrentDirectory().getAbsolutePath()); } dataComponent.add(jtf); JButton button = new JButton("Browse"); button.putClientProperty("dataMap", dataMap); button.putClientProperty("uri", uri); button.putClientProperty("JTextField", jtf); button.putClientProperty("filePanel", filePanel); button.addActionListener(EventHandler.create(ActionListener.class, this, "openLoadPanel", "")); dataComponent.add(button); return dataComponent; }
Source:
private void checkQuestionableHashingAlgorithm(SubscriptionContext ctx) { PyNameTree name = (PyNameTree) ctx.syntaxNode(); if (isWithinImport(name)) { return; } String fullyQualifiedName = name.symbol() != null ? name.symbol().fullyQualifiedName() : ""; if (questionableHashlibAlgorithm.contains(fullyQualifiedName) || questionablePasslibAlgorithm.contains(fullyQualifiedName)) { ctx.addIssue(name, MESSAGE); } }

Target:
private static void checkQuestionableHashingAlgorithm(SubscriptionContext ctx) { PyNameTree name = (PyNameTree) ctx.syntaxNode(); if (isWithinImport(name)) { return; } String fullyQualifiedName = name.symbol() != null ? name.symbol().fullyQualifiedName() : ""; if (questionableHashlibAlgorithm.contains(fullyQualifiedName) || questionablePasslibAlgorithm.contains(fullyQualifiedName)) { ctx.addIssue(name, MESSAGE); } }
Source:
public long getLong(int length, boolean signed) { if (length > BIT_LONG) { throw new IllegalArgumentException("Cannot read a long longer than 64 bits. Rquested: " + length); } if (length == BIT_LONG) { long a = getInt(); long b = getInt(); a &= 0xFFFFFFFFL; b &= 0xFFFFFFFFL; if (this.byteOrder == ByteOrder.BIG_ENDIAN) { return (a << 32) | b; } return (b << 32) | a; } long a = getInt() & 0x00000000FFFFFFFFL; long b = getInt(length - BIT_INT, false); long retVal; a &= 0xFFFFFFFFL; b &= ((1 << (length - BIT_INT)) - 1); retVal = (this.byteOrder == ByteOrder.BIG_ENDIAN) ? ((a << length) | b) : ((b << BIT_INT) | a); if (signed && ((retVal & (1L << (length - 1))) != 0L)) { retVal |= ~((1L << length) - 1L); } return retVal; }

Target:
public long getLong(int length, boolean signed) throws CTFReaderException { if (length > BIT_LONG) { throw new CTFReaderException("Cannot read a long longer than 64 bits. Rquested: " + length); } if (length > BIT_INT) { final int highShift = length-BIT_INT; long a = getInt() & 0x00000000FFFFFFFFL; long b = getInt(highShift, false); long retVal; a &= 0xFFFFFFFFL; b &= ((1L << highShift) - 1L); retVal = (this.byteOrder == ByteOrder.BIG_ENDIAN) ? ((a << highShift) | b) : ((b << BIT_INT) | a); if (signed && ((retVal & (1L << (length - 1))) != 0L)) { int signExtendBits = BIT_LONG - length; long l = retVal << signExtendBits; long m = l >> signExtendBits; retVal = m; } return retVal; } return getInt(length, signed); }
Source:
public void bind(UserFeed feed, String avatarUrl) { if (avatarUrl == null) { client.profile(feed.getLogin()) .compose(bindToLifecycle()) .observeOn(AndroidSchedulers.mainThread()) .subscribe(user -> setAvatar(user.getAvatarUrl())); } else { setAvatar(avatarUrl); } name.setText(feed.getLogin()); switch (feed.getAction()) { case WATCH: setWatchAction(feed); break; case NEW: setNewAction(feed); break; } }

Target:
public void bind(UserFeed feed, String avatarUrl) { setAvatar(avatarUrl); name.setText(feed.getLogin()); switch (feed.getAction()) { case WATCH: setWatchAction(feed); break; case NEW: setNewAction(feed); break; } }
Source:
public void setCatchKey(int keycode, boolean catchKey) { }

Target:
public void setCatchKey(int keycode, boolean catchKey) { input.setCatchKey(keycode, catchKey); }
Source:
private void sendMagicLinkRequest() { if (!NetworkUtils.isNetworkAvailable(getActivity())) { ToastUtils.showToast(getActivity(), R.string.no_network_message, ToastUtils.Duration.LONG); return; } disableRequestEmailButtonAndShowProgressDialog(); Map<String, String> params = new HashMap<>(); params.put(EMAIL_KEY, mEmail); params.put(CLIENT_ID_KEY, BuildConfig.OAUTH_APP_ID); params.put(CLIENT_SECRET_KEY, BuildConfig.OAUTH_APP_SECRET); WordPress.getRestClientUtilsV1_1().sendLoginEmail(params, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { mProgressDialog.cancel(); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_MAGIC_LINK_REQUESTED); if (mListener != null) { mListener.onMagicLinkSent(); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { HashMap<String, String> errorProperties = new HashMap<>(); errorProperties.put(ERROR_KEY, error.getMessage()); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_MAGIC_LINK_FAILED, errorProperties); mProgressDialog.cancel(); ToastUtils.showToast(getActivity(), R.string.magic_link_unavailable_error_message, ToastUtils.Duration.LONG); if (mListener != null) { mListener.onEnterPasswordRequested(); } } }); }

Target:
private void sendMagicLinkRequest() { if (!NetworkUtils.isNetworkAvailable(getActivity())) { ToastUtils.showToast(getActivity(), R.string.no_network_message, ToastUtils.Duration.LONG); return; } disableRequestEmailButtonAndShowProgressDialog(); Map<String, String> params = new HashMap<>(); params.put(EMAIL_KEY, mEmail); params.put(CLIENT_ID_KEY, BuildConfig.OAUTH_APP_ID); params.put(CLIENT_SECRET_KEY, BuildConfig.OAUTH_APP_SECRET); WordPress.getRestClientUtilsV1_1().sendLoginEmail(params, new RestRequest.Listener() { @Override public void onResponse(JSONObject response) { mProgressDialog.cancel(); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_MAGIC_LINK_REQUESTED); if (mListener != null) { mListener.onMagicLinkSent(); } } }, new RestRequest.ErrorListener() { @Override public void onErrorResponse(VolleyError error) { HashMap<String, String> errorProperties = new HashMap<>(); errorProperties.put(ERROR_KEY, error.getMessage()); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_MAGIC_LINK_FAILED, errorProperties); mProgressDialog.cancel(); if (isAdded()) { ToastUtils.showToast(getActivity(), R.string.magic_link_unavailable_error_message, ToastUtils.Duration.LONG); } if (mListener != null) { mListener.onEnterPasswordRequested(); } } }); }
Source:
public void testNullPropertyWillNotRemoveOldValue() { try { ServerConfiguration configuration = ConfigurationFileLoader.loadConfiguration(); configuration.setProperty("test-key", "a"); configuration.setProperty("test-key", null); assertEquals(configuration.getProperty("test-key", null), "a"); assertEquals(configuration.getProperty("test-key", "b"), "a"); assertTrue(configuration.getPropertyKeys().contains("test-key")); } catch (Exception e) { fail("Error in test", e); } }

Target:
public void testNullPropertyWillNotRemoveOldValue() { try { final ServerConfiguration configuration = ConfigurationFileLoader.loadConfiguration(); configuration.setProperty("test-key", "a"); configuration.setProperty("test-key", null); assertEquals(configuration.getProperty("test-key", null), "a"); assertEquals(configuration.getProperty("test-key", "b"), "a"); assertTrue(configuration.getPropertyKeys().contains("test-key")); } catch (Exception e) { fail("Error in test", e); } }
Source:
public void treatNullGuestListsAsEmptyGuestLists() throws Exception { Owner owner = new Owner("admin"); Map<String, List<GuestId>> hostGuestMap = new HashMap<String, List<GuestId>>(); hostGuestMap.put("HYPERVISOR_A", null); when(ownerCurator.lookupByKey(eq(owner.getKey()))).thenReturn(owner); when(consumerCurator.getHostConsumersMap(any(Owner.class), any(Set.class))) .thenReturn(new VirtConsumerMap()); when(consumerCurator.getGuestConsumersMap(any(Owner.class), any(Set.class))) .thenReturn(new VirtConsumerMap()); when(consumerCurator.getGuestsHostMap(any(Owner.class), any(Set.class))). thenReturn(new VirtConsumerMap()); when(ownerCurator.lookupByKey(eq(owner.getKey()))).thenReturn(owner); when(principal.canAccess(eq(owner), eq(SubResource.CONSUMERS), eq(Access.CREATE))) .thenReturn(true); when(consumerTypeCurator.lookupByLabel(eq(ConsumerTypeEnum.HYPERVISOR.getLabel()))) .thenReturn(hypervisorType); when(idCertService.generateIdentityCert(any(Consumer.class))) .thenReturn(new IdentityCertificate()); HypervisorCheckInResult result = hypervisorResource.hypervisorCheckIn( hostGuestMap, principal, owner.getKey(), true); assertNotNull(result); assertNotNull(result.getCreated()); System.out.println(result); List<Consumer> created = new ArrayList<Consumer>(result.getCreated()); assertEquals(1, created.size()); List<GuestId> gids = created.get(0).getGuestIds(); assertEquals(0, gids.size()); }

Target:
public void treatNullGuestListsAsEmptyGuestLists() throws Exception { Owner owner = new Owner("admin"); Map<String, List<GuestId>> hostGuestMap = new HashMap<String, List<GuestId>>(); hostGuestMap.put("HYPERVISOR_A", null); when(ownerCurator.lookupByKey(eq(owner.getKey()))).thenReturn(owner); when(consumerCurator.getHostConsumersMap(any(Owner.class), any(Set.class))) .thenReturn(new VirtConsumerMap()); when(consumerCurator.getGuestConsumersMap(any(Owner.class), any(Set.class))) .thenReturn(new VirtConsumerMap()); when(consumerCurator.getGuestsHostMap(any(Owner.class), any(Set.class))). thenReturn(new VirtConsumerMap()); when(ownerCurator.lookupByKey(eq(owner.getKey()))).thenReturn(owner); when(principal.canAccess(eq(owner), eq(SubResource.CONSUMERS), eq(Access.CREATE))) .thenReturn(true); when(consumerTypeCurator.lookupByLabel(eq(ConsumerTypeEnum.HYPERVISOR.getLabel()))) .thenReturn(hypervisorType); when(idCertService.generateIdentityCert(any(Consumer.class))) .thenReturn(new IdentityCertificate()); HypervisorCheckInResult result = hypervisorResource.hypervisorCheckIn( hostGuestMap, principal, owner.getKey(), true); assertNotNull(result); assertNotNull(result.getCreated()); List<Consumer> created = new ArrayList<Consumer>(result.getCreated()); assertEquals(1, created.size()); List<GuestId> gids = created.get(0).getGuestIds(); assertEquals(0, gids.size()); }
Source:
public String getProperties(String key) { return properties.get(key).toString(); }

Target:
public String getProperties(String key) { return (String)properties.get(key); }
Source:
public void testLinearIndex(String testName, String filepath, int problemReference, int problemWindowStart, int problemWindowEnd, int expectedCount) { final SamReader sfr = SamReaderFactory.makeDefault().open(new File(filepath)); for (int problemWindow = problemWindowStart; problemWindow <= problemWindowEnd; problemWindow++) { int count = countAlignmentsInWindow(problemReference, problemWindow, sfr, expectedCount); if (expectedCount != -1) assertEquals(expectedCount, count); } }

Target:
public void testLinearIndex(String testName, String filepath, int problemReference, int problemWindowStart, int problemWindowEnd, int expectedCount) { final SamReader sfr = SamReaderFactory.makeDefault().open(new File(filepath)); for (int problemWindow = problemWindowStart; problemWindow <= problemWindowEnd; problemWindow++) { int count = countAlignmentsInWindow(problemReference, problemWindow, sfr, expectedCount); if (expectedCount != -1) assertEquals(expectedCount, count); } CloserUtil.close(sfr); }
Source:
public ProxyConfig convert(ProxyRequest source) { ProxyConfig proxyConfig = new ProxyConfig(); proxyConfig.setName(source.getName()); proxyConfig.setDescription(source.getDescription()); proxyConfig.setProtocol(source.getProtocol()); proxyConfig.setServerHost(source.getHost()); proxyConfig.setServerPort(source.getPort()); if (StringUtils.isNoneBlank(source.getUserName())) { proxyConfig.setUserName(source.getUserName()); } if (StringUtils.isNoneBlank(source.getPassword())) { proxyConfig.setPassword(source.getPassword()); } return proxyConfig; }

Target:
public ProxyConfig convert(ProxyRequest source) { ProxyConfig proxyConfig = new ProxyConfig(); proxyConfig.setName(source.getName()); proxyConfig.setDescription(source.getDescription()); proxyConfig.setProtocol(source.getProtocol()); proxyConfig.setServerHost(source.getHost()); proxyConfig.setServerPort(source.getPort()); if (StringUtils.isNoneBlank(source.getUserName(), source.getPassword())) { proxyConfig.setUserName(source.getUserName()); proxyConfig.setPassword(source.getPassword()); } return proxyConfig; }
Source:
protected List<LiveMigrateVmDisksParameters> getLiveMigrateDisksParametersList() { List<LiveMigrateVmDisksParameters> liveMigrateDisksParametersList = new ArrayList<LiveMigrateVmDisksParameters>(); for (Map.Entry<Guid, List<LiveMigrateDiskParameters>> entry : vmsLiveMigrateParametersMap.entrySet()) { LiveMigrateVmDisksParameters liveMigrateDisksParameters = new LiveMigrateVmDisksParameters(entry.getValue(), entry.getKey()); liveMigrateDisksParameters.setParentCommand(VdcActionType.MoveDisks); liveMigrateDisksParameters.setSessionId(getParameters().getSessionId()); liveMigrateDisksParametersList.add(liveMigrateDisksParameters); } return liveMigrateDisksParametersList; }

Target:
protected ArrayList<VdcActionParametersBase> getLiveMigrateDisksParametersList() { ArrayList<VdcActionParametersBase> liveMigrateDisksParametersList = new ArrayList<VdcActionParametersBase>(); for (Map.Entry<Guid, List<LiveMigrateDiskParameters>> entry : vmsLiveMigrateParametersMap.entrySet()) { LiveMigrateVmDisksParameters liveMigrateDisksParameters = new LiveMigrateVmDisksParameters(entry.getValue(), entry.getKey()); liveMigrateDisksParameters.setParentCommand(VdcActionType.MoveDisks); liveMigrateDisksParameters.setSessionId(getParameters().getSessionId()); liveMigrateDisksParametersList.add(liveMigrateDisksParameters); } return liveMigrateDisksParametersList; }
Source:
public void onConnectionWrapped(ConnectionInformation connectionInformation) { final Metric2Registry metricRegistry = corePlugin.getMetricRegistry(); final TraceContext traceContext = TracingUtils.getTraceContext(); if (connectionInformation.getDataSource() instanceof DataSource && corePlugin.isInitialized() && !traceContext.isEmpty()) { final Span span = traceContext.getCurrentSpan(); DataSource dataSource = (DataSource) connectionInformation.getDataSource(); ensureUrlExistsForDataSource(dataSource, connectionInformation.getConnection()); MetaData metaData = dataSourceUrlMap.get(dataSource); metricRegistry.timer(getConnectionTemplate.build(metaData.serviceName)).update(connectionInformation.getTimeToGetConnectionNs(), TimeUnit.NANOSECONDS); span.setTag("connection_wait_time_ms", connectionInformation.getTimeToGetConnectionNs() / 1000.0D); } }

Target:
public void onConnectionWrapped(ConnectionInformation connectionInformation) { final Metric2Registry metricRegistry = corePlugin.getMetricRegistry(); if (connectionInformation.getDataSource() instanceof DataSource && corePlugin.isInitialized()) { DataSource dataSource = (DataSource) connectionInformation.getDataSource(); ensureUrlExistsForDataSource(dataSource, connectionInformation.getConnection()); MetaData metaData = dataSourceUrlMap.get(dataSource); metricRegistry.timer(getConnectionTemplate.build(metaData.serviceName)).update(connectionInformation.getTimeToGetConnectionNs(), TimeUnit.NANOSECONDS); final Span span = TracingPlugin.getCurrentSpan(); final Long connectionWrappedCountSum = incrementAndGetContextValue(span, CONNECTION_WRAPPED_COUNT_ATTRIBUTE, 1L); span.setTag("jdbc_get_connection_count", connectionWrappedCountSum); final double timeToGetConnectionMs = connectionInformation.getTimeToGetConnectionNs() / MILLISECOND_IN_NANOS; final Double connectionWaitTimeMsSum = incrementAndGetContextValue(span, TIME_TO_GET_CONNECTION_MS_ATTRIBUTE, timeToGetConnectionMs); span.setTag("jdbc_connection_wait_time_ms", connectionWaitTimeMsSum); } }
Source:
public boolean allowsReferenceCallback() { return !isNonDestructive(); }

Target:
public boolean allowsReferenceCallback() { return !nonDestructive; }
Source:
private <U> void doEmit(SubscriptionQueryMessage<?, ?, ?> query, FluxSinkWrapper<?> updateHandler, SubscriptionQueryUpdateMessage<U> update) { MessageMonitor.MonitorCallback monitorCallback = updateMessageMonitor.onMessageIngested(update); try { ((FluxSinkWrapper<SubscriptionQueryUpdateMessage<U>>) updateHandler).next(update); monitorCallback.reportSuccess(); } catch (Exception e) { logger.error(format( "An error happened while trying to emit an update to a query: %s.", query), e); monitorCallback.reportFailure(e); updateHandlers.remove(query); updateHandler.error(e); } }

Target:
private <U> void doEmit(SubscriptionQueryMessage<?, ?, ?> query, FluxSinkWrapper<?> updateHandler, SubscriptionQueryUpdateMessage<U> update) { MessageMonitor.MonitorCallback monitorCallback = updateMessageMonitor.onMessageIngested(update); try { ((FluxSinkWrapper<SubscriptionQueryUpdateMessage<U>>) updateHandler).next(update); monitorCallback.reportSuccess(); } catch (Exception e) { logger.info("An error occurred while trying to emit an update to a query '{}'. " + "The subscription will be cancelled. Exception summary: {}", query.getQueryName(), e.toString(), logger.isDebugEnabled() ? e : ""); monitorCallback.reportFailure(e); updateHandlers.remove(query); emitError(query, e, updateHandler); } }
Source:
public Object getProperty(String key, Object defaultValue) { Object value = null; String prefix = Environment.calculatePrefix(this.prefix, this.id); if (StringUtils.isNotEmpty(prefix)) { value = getInternalProperty(prefix + key); } if (value == null) { value = super.getProperty(key, defaultValue); } return value; }

Target:
public Object getProperty(String key, Object defaultValue) { Object value = null; if (StringUtils.isNotEmpty(prefix) && StringUtils.isNotEmpty(id)) { value = getInternalProperty(prefix + id + "." + key); } if (value == null && StringUtils.isNotEmpty(prefix)) { value = getInternalProperty(prefix + key); } if (value == null) { value = super.getProperty(key, defaultValue); } return value; }
Source:
public static void renderItemLayerPre(ItemStack stack, int index) { MinecraftForge.EVENT_BUS.post(new RenderItemLayerEvent.Pre(stack, index, currentTransformType)); Tessellator.getInstance().getBuffer().begin(7, DefaultVertexFormats.ITEM); }

Target:
public static void renderItemLayerPre(ItemStack stack, int index) { if (!isItemInGui && stack.getItem().shouldRenderFullbright(stack, index == -1 ? 0 : index)) { Minecraft.getMinecraft().entityRenderer.disableLightmap(); GlStateManager.disableLighting(); } Tessellator.getInstance().getBuffer().begin(GL11.GL_QUADS, DefaultVertexFormats.ITEM); }
Source:
private void attachAccessibilityDelegateOnBind(ViewHolder holder) { if (isAccessibilityEnabled()) { final View itemView = holder.itemView; if (ViewCompat.getImportantForAccessibility(itemView) == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) { ViewCompat.setImportantForAccessibility(itemView, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); } AccessibilityDelegateCompat delegate = ViewCompat.getAccessibilityDelegate(itemView); if (delegate == null || delegate.isDefaultOrEmptyAccessibilityDelegateCompat()) { holder.addFlags(ViewHolder.FLAG_SET_A11Y_ITEM_DELEGATE); ViewCompat.setAccessibilityDelegate(itemView, mAccessibilityDelegate.getItemDelegate()); } } }

Target:
private void attachAccessibilityDelegateOnBind(ViewHolder holder) { if (isAccessibilityEnabled()) { final View itemView = holder.itemView; if (ViewCompat.getImportantForAccessibility(itemView) == ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_AUTO) { ViewCompat.setImportantForAccessibility(itemView, ViewCompat.IMPORTANT_FOR_ACCESSIBILITY_YES); } AccessibilityDelegateCompat delegate = ViewCompat.getAccessibilityDelegate(itemView); if (delegate == null || delegate.getClass().equals(AccessibilityDelegateCompat.class)) { holder.addFlags(ViewHolder.FLAG_SET_A11Y_ITEM_DELEGATE); ViewCompat.setAccessibilityDelegate(itemView, mAccessibilityDelegate.getItemDelegate()); } } }
Source:
public static String normalizeVariableName(String name) { if (normalizationCache.containsKey(name)){ return normalizationCache.get(name); } String normalized = SPACES_PATTERN.matcher( name.trim() ).replaceAll( " " ); normalizationCache.put(name, normalized); return normalized; }

Target:
public static String normalizeVariableName(String name) { return SPACES_PATTERN.matcher( name.trim() ).replaceAll( " " ); }
Source:
protected void verifyCheckedState() { IDebugTarget[] targets= getDebugTargets(); IDebugTarget target; IThread[] threads; boolean checkedThread; for (IDebugTarget target2 : targets) { target= target2; if (!fThreadViewer.getChecked(target)) { continue; } try { threads= target.getThreads(); } catch (DebugException exception) { JDIDebugUIPlugin.log(exception); continue; } checkedThread= false; for (IThread thread : threads) { if (fThreadViewer.getChecked(thread)) { checkedThread= true; break; } } if (checkedThread) { fPage.setErrorMessage(null); } else { fPage.setErrorMessage(PropertyPageMessages.ThreadFilterEditor_2); } } }

Target:
protected void verifyCheckedState() { IDebugTarget[] targets= getDebugTargets(); IDebugTarget target; IThread[] threads; boolean checkedThread; for (IDebugTarget debugTarget : targets) { target= debugTarget; if (!fThreadViewer.getChecked(target)) { continue; } try { threads= target.getThreads(); } catch (DebugException exception) { JDIDebugUIPlugin.log(exception); continue; } checkedThread= false; for (IThread thread : threads) { if (fThreadViewer.getChecked(thread)) { checkedThread= true; break; } } if (checkedThread) { fPage.setErrorMessage(null); } else { fPage.setErrorMessage(PropertyPageMessages.ThreadFilterEditor_2); } } }
Source:
private VmDevice createMemoryDevice() { Map<String, Object> specParams = new HashMap<>(); Guid guid = Guid.newGuid(); String alias = FeatureSupported.isDomainXMLSupported(getVm().getClusterCompatibilityVersion()) ? String.format("ua-%s", guid.toString()) : ""; specParams.put(DEVICE_SIZE_FIELD_KEY, String.valueOf(getParameters().getMemoryDeviceSizeMb())); specParams.put(DEVICE_NODE_FIELD_KEY, String.valueOf(getParameters().getNumaNode())); return new VmDevice(new VmDeviceId(guid, getVmId()), VmDeviceGeneralType.MEMORY, VmDeviceType.MEMORY.getName(), "", specParams, true, true, false, alias, null, null, null); }

Target:
private VmDevice createMemoryDevice() { Map<String, Object> specParams = new HashMap<>(); Guid guid = Guid.newGuid(); String alias = FeatureSupported.isDomainXMLSupported(getVm().getClusterCompatibilityVersion()) ? String.format("%s%s", DomainXmlUtils.USER_ALIAS_PREFIX, guid) : ""; specParams.put(DEVICE_SIZE_FIELD_KEY, String.valueOf(getParameters().getMemoryDeviceSizeMb())); specParams.put(DEVICE_NODE_FIELD_KEY, String.valueOf(getParameters().getNumaNode())); return new VmDevice(new VmDeviceId(guid, getVmId()), VmDeviceGeneralType.MEMORY, VmDeviceType.MEMORY.getName(), "", specParams, true, true, false, alias, null, null, null); }