auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void verifyTOCsectionLinkWorks(int numberOfTheSection) { WebElement sectionTOClink = tableOfContentsSectionsList.get(numberOfTheSection-1); String sectionID = sectionTOClink.getAttribute("href").substring(getCurrentUrl().length()); WebElement sectionOnArticle = driver.findElement(By.cssSelector(sectionID)); int sectionYbefore = sectionOnArticle.getLocation().getY(); tableOfContentsSectionsList.get(numberOfTheSection-1).click(); int sectionYafter = sectionOnArticle.getLocation().getY(); Assertion.assertNotEquals(sectionYbefore, sectionYafter); Assertion.assertTrue(sectionYafter < 5); PageObjectLogging.log("verifyTOCsectionLinkWorks", "choosen section "+sectionID+" was scrolled up", true); }

Target:
public void verifyTOCsectionLinkWorks(int numberOfTheSection) { WebElement sectionTOClink = tableOfContentsSectionsList.get(numberOfTheSection-1); String sectionID = sectionTOClink.getAttribute("href").substring(getCurrentUrl().length()); WebElement sectionOnArticle = driver.findElement(By.cssSelector(sectionID)); int sectionYbefore = sectionOnArticle.getLocation().getY(); sectionTOClink.click(); int sectionYafter = sectionOnArticle.getLocation().getY(); Assertion.assertNotEquals(sectionYbefore, sectionYafter); Assertion.assertTrue(sectionYafter < 5); PageObjectLogging.log("verifyTOCsectionLinkWorks", "choosen section "+sectionID+" was scrolled up", true); }
Source:
public void removeBrick(Guid brickId) { getCallsHandler().executeModification("DeleteGlusterVolumeBrick", getCustomMapSqlParameterSource().addValue("id", brickId.getUuid())); }

Target:
public void removeBrick(Guid brickId) { getCallsHandler().executeModification("DeleteGlusterVolumeBrick", getCustomMapSqlParameterSource().addValue("id", brickId)); }
Source:
@Test public void unacknowledgedPingFailsConnection() { client = client.newBuilder() .pingInterval(500, TimeUnit.MILLISECONDS) .build(); final CountDownLatch latch = new CountDownLatch(1); webServer.enqueue(new MockResponse().withWebSocketUpgrade(new WebSocketListener() { @Override public void onOpen(WebSocket webSocket, Response response) { try { latch.await(); } catch (InterruptedException e) { throw new AssertionError(e); } } })); long openAtNanos = System.nanoTime(); newWebSocket(); clientListener.assertOpen(); clientListener.assertFailure(SocketTimeoutException.class, "sent ping but didn't receive pong within 500ms (after 0 successful ping/pongs)"); latch.countDown(); long elapsedUntilFailure = System.nanoTime() - openAtNanos; assertThat((double) TimeUnit.NANOSECONDS.toMillis(elapsedUntilFailure)).isCloseTo((double) 1000, offset( 250d)); }

Target:
@Test public void unacknowledgedPingFailsConnection() { client = client.newBuilder() .pingInterval(500, TimeUnit.MILLISECONDS) .build(); final CountDownLatch latch = new CountDownLatch(1); webServer.enqueue(new MockResponse().withWebSocketUpgrade(new WebSocketListener() { @Override public void onOpen(WebSocket webSocket, Response response) { try { latch.await(); } catch (InterruptedException e) { throw new AssertionError(e); } } })); long openAtNanos = System.nanoTime(); newWebSocket(); clientListener.assertOpen(); clientListener.assertFailure(SocketTimeoutException.class, "sent ping but didn't receive pong within 500ms (after 0 successful ping/pongs)"); latch.countDown(); long elapsedUntilFailure = System.nanoTime() - openAtNanos; assertThat(TimeUnit.NANOSECONDS.toMillis(elapsedUntilFailure)) .isCloseTo(1000L, offset(250L)); }
Source:
protected void recycle() { _metaData = null; _originalURI = null; if (_context != null) throw new IllegalStateException("Request in context!"); if (_inputState == INPUT_READER) { try { int r = _reader.read(); while (r != -1) { r = _reader.read(); } } catch (Exception e) { LOG.ignore(e); _reader = null; } } _dispatcherType = null; setAuthentication(Authentication.NOT_CHECKED); getHttpChannelState().recycle(); if (_async != null) _async.reset(); _async = null; _asyncNotSupportedSource = null; _handled = false; _attributes = Attributes.unwrap(_attributes); if (ServletAttributes.class.equals(_attributes.getClass())) _attributes.clearAttributes(); else _attributes = new ServletAttributes(); _contentType = null; _characterEncoding = null; _contextPath = null; if (_cookies != null) _cookies.reset(); _cookiesExtracted = false; _context = null; _newContext = false; _pathInfo = null; _queryEncoding = null; _requestedSessionId = null; _requestedSessionIdFromCookie = false; _secure = false; _session = null; _sessionHandler = null; _scope = null; _servletPath = null; _timeStamp = 0; _queryParameters = null; _contentParameters = null; _parameters = null; _contentParamsExtracted = false; _inputState = INPUT_NONE; _multiParts = null; _remote = null; _sessions = null; _input.recycle(); _requestAttributeListeners.clear(); }

Target:
protected void recycle() { _metaData = null; _originalURI = null; if (_context != null) throw new IllegalStateException("Request in context!"); if (_inputState == INPUT_READER) { try { int r = _reader.read(); while (r != -1) { r = _reader.read(); } } catch (Exception e) { LOG.ignore(e); _reader = null; } } _dispatcherType = null; setAuthentication(Authentication.NOT_CHECKED); getHttpChannelState().recycle(); if (_async != null) _async.reset(); _async = null; _asyncNotSupportedSource = null; _handled = false; _attributes = Attributes.unwrap(_attributes); if (_attributes != null) { if (ServletAttributes.class.equals(_attributes.getClass())) _attributes.clearAttributes(); else _attributes = null; } _contentType = null; _characterEncoding = null; _contextPath = null; if (_cookies != null) _cookies.reset(); _cookiesExtracted = false; _context = null; _newContext = false; _pathInfo = null; _queryEncoding = null; _requestedSessionId = null; _requestedSessionIdFromCookie = false; _secure = false; _session = null; _sessionHandler = null; _scope = null; _servletPath = null; _timeStamp = 0; _queryParameters = null; _contentParameters = null; _parameters = null; _contentParamsExtracted = false; _inputState = INPUT_NONE; _multiParts = null; _remote = null; _sessions = null; _input.recycle(); _requestAttributeListeners.clear(); }
Source:
public void setUp() { SimpleDependecyInjector.getInstance().bind(OsRepository.class, osRepository); final int osId = 0; Map<Integer, Map<Version, List<DisplayType>>> displayTypeMap = new HashMap<>(); displayTypeMap.put(osId, new HashMap<Version, List<DisplayType>>()); displayTypeMap.get(osId).put(null, Arrays.asList(DisplayType.qxl)); when(osRepository.getDisplayTypes()).thenReturn(displayTypeMap); mockVdsGroup(); try { xmlOvfData = new String(Files.readAllBytes(Paths.get(VM_OVF_XML_DATA))); } catch (IOException e) { e.printStackTrace(); } }

Target:
public void setUp() { SimpleDependecyInjector.getInstance().bind(OsRepository.class, osRepository); final int osId = 0; Map<Integer, Map<Version, List<DisplayType>>> displayTypeMap = new HashMap<>(); displayTypeMap.put(osId, new HashMap<Version, List<DisplayType>>()); displayTypeMap.get(osId).put(null, Arrays.asList(DisplayType.qxl)); when(osRepository.getDisplayTypes()).thenReturn(displayTypeMap); mockVdsGroup(); setXmlOvfData(); }
Source:
protected void expandRepositoryGroup(ExecutionEvent event, RepositoryGroup group) throws ExecutionException { IWorkbenchPart part = HandlerUtil.getActivePartChecked(event); if (part instanceof RepositoriesView) { ((RepositoriesView) part).expandNodeForGroup(group); } }

Target:
protected void expandRepositoryGroup(ExecutionEvent event, RepositoryGroup group) throws ExecutionException { if (group != null) { RepositoriesView view = null; IWorkbenchPart part = HandlerUtil.getActivePartChecked(event); if (part instanceof RepositoriesView) { view = ((RepositoriesView) part); } else { view = getRepositoriesView(); } if (view != null) { view.expandNodeForGroup(group); } } }
Source:
public String getAlgorithm() { return "ECDSA-SK"; }

Target:
public String getAlgorithm() { return ALGORITHM; }
Source:
protected void initFieldMaps() { try { initMiningFieldMap(); initOutputFieldMap(); } catch(Exception e) { logger.error(e.getMessage()); } }

Target:
protected void initFieldMaps() throws IllegalArgumentException { initMiningFieldMap(); initOutputFieldMap(); }
Source:
public boolean isReady() { long readyTimestamp = ((FileSystemDataset<E>)dataset).getReadyTimestamp(getConstraints()); return readyTimestamp != -1; }

Target:
public boolean isReady() { if (signalManager != null) { long readyTimestamp = signalManager.getReadyTimestamp(getConstraints()); return readyTimestamp != -1; } return false; }
Source:
public void checkProperties(Properties properties) { properties.setProperty("log4j.shutdownCallbackRegistry", "io.druid.common.config.Log4jShutdown"); properties.setProperty("log4j.shutdownHookEnabled", "true"); }

Target:
public void checkProperties(Properties properties) { if (!properties.contains("log4j.shutdownCallbackRegistry")) { properties.setProperty("log4j.shutdownCallbackRegistry", "io.druid.common.config.Log4jShutdown"); } if (!properties.contains("log4j.shutdownHookEnabled")) { properties.setProperty("log4j.shutdownHookEnabled", "true"); } }
Source:
public void createControl(Composite parent) { super.createControl(parent); final Composite control = (Composite) this.getControl(); control.setLayout(new GridLayout(2, false)); control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); final Table selectedFiles = new Table(control, SWT.NONE); selectedFiles.clearAll(); selectedFiles.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); Composite buttonArea = new Composite(control, SWT.None); buttonArea.setLayout(new RowLayout()); ((RowLayout) buttonArea.getLayout()).type = SWT.VERTICAL; buttonArea.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false)); Button addFile = new Button(buttonArea, SWT.PUSH); addFile.setText(Messages.ImportTraceWizardPageSelectDirectories_0); addFile.addSelectionListener(new AddFileHandler()); Button addDirectory = new Button(buttonArea, SWT.PUSH); addDirectory.setText(Messages.ImportTraceWizardPageSelectDirectories_1); addDirectory.addSelectionListener(new AddDirectoryHandler()); Button removeFile = new Button(buttonArea, SWT.PUSH); removeFile.setText(Messages.ImportTraceWizardPageSelectDirectories_2); removeFile.addSelectionListener(new RemoveFileHandler(selectedFiles)); this.setTitle(Messages.ImportTraceWizardPageSelectDirectories_3); }

Target:
public void createControl(Composite parent) { super.createControl(parent); final Composite control = (Composite) this.getControl(); control.setLayout(new GridLayout(2, false)); control.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); final Table selectedFiles = new Table(control, SWT.H_SCROLL | SWT.V_SCROLL); selectedFiles.clearAll(); selectedFiles.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true)); selectedFiles.setLinesVisible(true); Composite buttonArea = new Composite(control, SWT.None); buttonArea.setLayout(new GridLayout()); buttonArea.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false)); Button addFile = new Button(buttonArea, SWT.PUSH); addFile.setText(Messages.ImportTraceWizardAddFile); addFile.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); addFile.addSelectionListener(new AddFileHandler()); addFile.setAlignment(SWT.LEFT); Button addDirectory = new Button(buttonArea, SWT.PUSH); addDirectory.setText(Messages.ImportTraceWizardAddDirectory); addDirectory.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); addDirectory.addSelectionListener(new AddDirectoryHandler()); addDirectory.setAlignment(SWT.LEFT); Button removeFile = new Button(buttonArea, SWT.PUSH); removeFile.setText(Messages.ImportTraceWizardRemove); removeFile.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false)); removeFile.addSelectionListener(new RemoveFileHandler(selectedFiles)); removeFile.setAlignment(SWT.LEFT); this.setTitle(Messages.ImportTraceWizardDirectoryCaption); }
Source:
public Object apply(ConfigResource resource) throws AuthException, BadRequestException, ResourceConflictException { List<TopMenu.MenuEntry> enties = Lists.newArrayList(); for (TopMenu extension : extensions) { enties.addAll(extension.getEntries()); } return enties; }

Target:
public Object apply(ConfigResource resource) throws AuthException, BadRequestException, ResourceConflictException { List<TopMenu.MenuEntry> entries = Lists.newArrayList(); for (TopMenu extension : extensions) { entries.addAll(extension.getEntries()); } return entries; }
Source:
public Response update(T entity) throws SQLException { Context.getPermissionsManager().checkReadonly(getUserId()); if (baseClass.equals(Device.class)) { Context.getPermissionsManager().checkDeviceReadonly(getUserId()); } if (baseClass.equals(User.class)) { User before = Context.getPermissionsManager().getUser(entity.getId()); Context.getPermissionsManager().checkUserUpdate(getUserId(), before, (User) entity); } Context.getPermissionsManager().checkPermission(baseClass, getUserId(), entity.getId()); Context.getManager(baseClass).updateItem(entity); if (baseClass.equals(Group.class) || baseClass.equals(Device.class)) { Context.getPermissionsManager().refreshDeviceAndGroupPermissions(); Context.getPermissionsManager().refreshAllExtendedPermissions(); } if (baseClass.equals(User.class) && Context.getNotificationManager() != null) { Context.getNotificationManager().refresh(); } return Response.ok(entity).build(); }

Target:
public Response update(T entity) throws SQLException { Context.getPermissionsManager().checkReadonly(getUserId()); if (baseClass.equals(Device.class)) { Context.getPermissionsManager().checkDeviceReadonly(getUserId()); } else if (baseClass.equals(User.class)) { User before = Context.getPermissionsManager().getUser(entity.getId()); Context.getPermissionsManager().checkUserUpdate(getUserId(), before, (User) entity); } Context.getPermissionsManager().checkPermission(baseClass, getUserId(), entity.getId()); Context.getManager(baseClass).updateItem(entity); if (baseClass.equals(Group.class) || baseClass.equals(Device.class)) { Context.getPermissionsManager().refreshDeviceAndGroupPermissions(); Context.getPermissionsManager().refreshAllExtendedPermissions(); } else if (baseClass.equals(User.class) && Context.getNotificationManager() != null) { Context.getNotificationManager().refresh(); } return Response.ok(entity).build(); }
Source:
public void setLimitRate(String limitRate) { String unit = limitRate.substring(limitRate.length() - 1, limitRate.length()).toLowerCase(); int value = Integer.parseInt(limitRate.substring(0, limitRate.length() - 1).toLowerCase()); switch (unit) { case "m": value = value * 1000; break; case "g": value = value * 1000 * 1000; break; default: break; } this.limitRate = value * 1024 / 8; }

Target:
public void setLimitRate(String limitRate) { String unit = limitRate.substring(limitRate.length() - 1, limitRate.length()).toLowerCase(); int value = Integer.parseInt(limitRate.substring(0, limitRate.length() - 1).toLowerCase()); switch (unit) { case "k": this.limitRate = value * ONE_KILOBYTE_IN_CPS; break; case "m": this.limitRate = value * ONE_KILOBYTE_IN_CPS * 1000; break; case "g": this.limitRate = value * ONE_KILOBYTE_IN_CPS * 1000000; break; default: break; } }
Source:
public void removeListener() { if (mLocationManager == null) { return; } mLocationManager.removeGpsStatusListener(mSatelliteListener); enableLocationListener(false, mGpsLocationListener); enableLocationListener(false, mNetworkLocationListener); mLocationManager = null; }

Target:
public void removeListener() { if (mLocationManager == null) { return; } mLocationManager.removeGpsStatusListener(mSatelliteListener); enableLocationListener(false, mGpsLocationListener); enableLocationListener(false, mNetworkLocationListener); }
Source:
public long getLastExtentIndexId() throws Exception{ long lastIndex; Connection connection = connect(); PreparedStatement getLastIndex; try { getLastIndex = connection.prepareStatement( "SELECT MAX(" + EXTENT_INDEX_ID + ") AS " + EXTENT_INDEX_ID + " FROM " + EXTENT_TABLE); } catch (SQLiteException e) { throw new SQLiteException(e.getMessage() + ". SQL query was: SELECT MAX(" + EXTENT_INDEX_ID + ") AS " + EXTENT_INDEX_ID + " FROM " + EXTENT_TABLE, e.getResultCode()); } ResultSet results = getLastIndex.executeQuery(); if (results.next()) { lastIndex = results.getLong(EXTENT_INDEX_ID); } else { lastIndex = 0; LOGGER.log(Level.FINEST,"[" + getName() + "] no products in extentSummary table; using index 0"); } getLastIndex.close(); return lastIndex; }

Target:
public long getLastExtentIndexId() throws Exception{ long lastIndex; Connection connection = connect(); String sql = "SELECT MAX(" + EXTENT_INDEX_ID + ") AS " + EXTENT_INDEX_ID + " FROM " + EXTENT_TABLE; try (PreparedStatement getLastIndex = connection.prepareStatement(sql)) { ResultSet results = getLastIndex.executeQuery(); if (results.next()) { lastIndex = results.getLong(EXTENT_INDEX_ID); } else { lastIndex = 0; LOGGER.log(Level.FINEST, "[" + getName() + "] no products in extentSummary table; using index 0"); } } catch (SQLiteException e) { throw new SQLiteException(e.getMessage() + ". SQL query was: " + sql, e.getResultCode()); } return lastIndex; }
Source:
public void commitMeasurements() { if (!filter.noMeasurementsAvailable()) { double runningAverage = filter.calculateRunningAverage(); mBeacon.setRunningAverageRssi(runningAverage); LogManager.d(TAG, "calculated new runningAverageRssi: %s", runningAverage); } else { LogManager.d(TAG, "No measurements available to calculate running average"); } }

Target:
public void commitMeasurements() { if (!filter.noMeasurementsAvailable()) { double runningAverage = filter.calculateRssi(); mBeacon.setRunningAverageRssi(runningAverage); LogManager.d(TAG, "calculated new runningAverageRssi: %s", runningAverage); } else { LogManager.d(TAG, "No measurements available to calculate running average"); } }
Source:
private List<Interval> getUnionSortedIntervals(List<List<Interval>> intervals) { if (intervals.isEmpty()) { return null; } return getUnionSortedIntervals(intervals, 0, intervals.size()); }

Target:
private List<Interval> getUnionSortedIntervals(List<List<Interval>> intervals) { return getUnionSortedIntervals(intervals, 0, intervals.size()); }
Source:
public Dataverse getDataverse() { if (datasetVersion != null) { return datasetVersion.getDataset().getOwner(); } else if (parentDatasetFieldCompoundValue != null) { return parentDatasetFieldCompoundValue.getParentDatasetField().getDataverse(); } else if (template != null) { return template.getDataverse(); } else { System.out.print("getDataverseException: " + this.datasetFieldType.getDisplayName()); System.out.print("getDataverseException Compound: " + this.getCompoundDisplayValue()); System.out.print("getDataverseException Regular: " + this.getDisplayValue()); throw new IllegalStateException("DatasetField is in an illegal state: no dataset version, compound value, or template is set as its parent."); } }

Target:
public Dataverse getDataverse() { if (datasetVersion != null) { return datasetVersion.getDataset().getOwner(); } else if (parentDatasetFieldCompoundValue != null) { return parentDatasetFieldCompoundValue.getParentDatasetField().getDataverse(); } else if (template != null) { return template.getDataverse(); } else { throw new IllegalStateException("DatasetField is in an illegal state: no dataset version, compound value, or template is set as its parent."); } }
Source:
public static void setUp() { final String password = PASSWORD_ENCODER.encode(PASSWORD); final Map<String, Object> properties1 = new HashMap<>(); properties1.put(USERNAME, GOOD_USERNAME); properties1.put(FIRSTNAME, FIRSTNAME_VALUE); CommonProfile profile = new CommonProfile(); profile.build(IDPERSON1, properties1); inMemoryProfileService.create(profile, PASSWORD); final Map<String, Object> properties2 = new HashMap<>(); properties2.put(USERNAME, MULTIPLE_USERNAME); profile = new CommonProfile(); profile.build(IDPERSON2, properties2); inMemoryProfileService.create(profile, PASSWORD); final Map<String, Object> properties3 = new HashMap<>(); properties3.put(USERNAME, MULTIPLE_USERNAME); properties3.put(PASSWORD, password); profile = new CommonProfile(); profile.build(IDPERSON3, properties3); inMemoryProfileService.create(profile, PASSWORD); }

Target:
public void setUp() { inMemoryProfileService = new InMemoryProfileService<CommonProfile>(x -> new CommonProfile()); inMemoryProfileService.setPasswordEncoder(PASSWORD_ENCODER); final String password = PASSWORD_ENCODER.encode(PASSWORD); final Map<String, Object> properties1 = new HashMap<>(); properties1.put(USERNAME, GOOD_USERNAME); properties1.put(FIRSTNAME, FIRSTNAME_VALUE); CommonProfile profile = new CommonProfile(); profile.build(IDPERSON1, properties1); inMemoryProfileService.create(profile, PASSWORD); final Map<String, Object> properties2 = new HashMap<>(); properties2.put(USERNAME, MULTIPLE_USERNAME); profile = new CommonProfile(); profile.build(IDPERSON2, properties2); inMemoryProfileService.create(profile, PASSWORD); final Map<String, Object> properties3 = new HashMap<>(); properties3.put(USERNAME, MULTIPLE_USERNAME); properties3.put(PASSWORD, password); profile = new CommonProfile(); profile.build(IDPERSON3, properties3); inMemoryProfileService.create(profile, PASSWORD); }
Source:
public Response postDownloadDatafiles(String fileIds, @QueryParam("gbrecs") boolean gbrecs, @QueryParam("key") String apiTokenParam, @Context UriInfo uriInfo, @Context HttpHeaders headers, @Context HttpServletResponse response) throws WebApplicationException { fileIds = fileIds.substring(8); return downloadDatafiles(fileIds, gbrecs, apiTokenParam, uriInfo, headers, response); }

Target:
public Response postDownloadDatafiles(String fileIds, @QueryParam("gbrecs") boolean gbrecs, @QueryParam("key") String apiTokenParam, @Context UriInfo uriInfo, @Context HttpHeaders headers, @Context HttpServletResponse response) throws WebApplicationException { return downloadDatafiles(fileIds, gbrecs, apiTokenParam, uriInfo, headers, response); }
Source:
public List<BibEntry> linkAssociatedFiles(List<BibEntry> entries, NamedCompound ce) { List<BibEntry> changedEntries = new ArrayList<>(); List<IOException> fileExceptions = new ArrayList<>(); for (BibEntry entry : entries) { List<LinkedFile> linkedFiles = new ArrayList<>(); try { linkedFiles = findAssociatedNotLinkedFiles(entry); } catch (IOException e) { fileExceptions.add(e); LOGGER.error("Problem finding files", e); } if (ce != null) { if (!fileExceptions.isEmpty()) { errorDialog.notify(Localization.lang("Problem finding files")); } for (LinkedFile linkedFile : linkedFiles) { String newVal = FileFieldWriter.getStringRepresentation(linkedFile); String oldVal = entry.getField(StandardField.FILE).orElse(null); UndoableFieldChange fieldChange = new UndoableFieldChange(entry, StandardField.FILE, oldVal, newVal); ce.addEdit(fieldChange); DefaultTaskExecutor.runInJavaFXThread(() -> { entry.addFile(linkedFile); }); } changedEntries.add(entry); } } return changedEntries; }

Target:
public LinkFilesResult linkAssociatedFiles(List<BibEntry> entries, NamedCompound ce) { LinkFilesResult result = new LinkFilesResult(); for (BibEntry entry : entries) { List<LinkedFile> linkedFiles = new ArrayList<>(); try { linkedFiles = findAssociatedNotLinkedFiles(entry); } catch (IOException e) { result.addFileException(e); LOGGER.error("Problem finding files", e); } if (ce != null) { boolean changed = false; for (LinkedFile linkedFile : linkedFiles) { String newVal = FileFieldWriter.getStringRepresentation(linkedFile); String oldVal = entry.getField(StandardField.FILE).orElse(null); UndoableFieldChange fieldChange = new UndoableFieldChange(entry, StandardField.FILE, oldVal, newVal); ce.addEdit(fieldChange); changed = true; DefaultTaskExecutor.runInJavaFXThread(() -> { entry.addFile(linkedFile); }); } if (changed) { result.addBibEntry(entry); } } } return result; }
Source:
private void rewriteGoogScope(Node n) { Node blockOfScopeContents = n.getLastChild().getLastChild().getLastChild(); blockOfScopeContents.detachFromParent(); Node insertAfterThisNode = n; @Nullable Node nodeToMove = blockOfScopeContents.getFirstChild(); while (nodeToMove != null) { @Nullable Node nodeToCheck = maybeRewriteAlias(nodeToMove); if (null != nodeToCheck) { nodeToMove = nodeToCheck; continue; } Node nextNodeToMove = nodeToMove.getNext(); nodeToMove.detachFromParent(); n.getParent().addChildAfter(nodeToMove, insertAfterThisNode); insertAfterThisNode = nodeToMove; nodeToMove = nextNodeToMove; } n.detachFromParent(); compiler.reportCodeChange(); }

Target:
private void rewriteGoogScope(Node n) { Node blockOfScopeContents = n.getLastChild().getLastChild().getLastChild(); blockOfScopeContents.detachFromParent(); Node insertAfterThisNode = n; @Nullable Node nodeToMove = blockOfScopeContents.getFirstChild(); while (nodeToMove != null) { @Nullable Node nodeToCheck = maybeRewriteAlias(nodeToMove); if (nodeToCheck != null) { nodeToMove = nodeToCheck; continue; } Node nextNodeToMove = nodeToMove.getNext(); nodeToMove.detachFromParent(); n.getParent().addChildAfter(nodeToMove, insertAfterThisNode); insertAfterThisNode = nodeToMove; nodeToMove = nextNodeToMove; } n.detachFromParent(); compiler.reportCodeChange(); }
Source:
public void testNormalizeWithUnicode() { assertNormalized("föö/.bàr/*[<>|^~/bé\\z", "föö/bàr/bé-z"); }

Target:
public void testNormalizeWithUnicode() { assertNormalized("f\u00f6\u00f6/.b\u00e0r ", "\u5165\u53e3_entrance;/\u51fa\u53e3_ex-it"); }
Source:
private int countFailedTests(TaskResult taskResult){ int failed = 0; for (Submission submission: taskResult.getSubmissions()){ for (TestResult testResult: submission.getTestResults()){ failed = testResult.isGreen() ? failed : failed + 1; } } return failed; }

Target:
private int countFailedTests(TaskResult taskResult){ int failed = 0; for (Submission submission: taskResult.getSubmissions()){ for (TestResult testResult: submission.getTestResults()){ if (!testResult.isGreen()){ failed++; } } } return failed; }
Source:
public boolean shouldInvoke(C context) { cleanupExpiredSuppressions(); if (cache.containsKey(context)) return false; Suppression<C> suppression = new Suppression<>(context, System.nanoTime() + ttlNanos); if (cache.putIfAbsent(context, suppression) != null) return false; suppressions.offer(suppression); while (suppressions.size() > maximumSize) { tryClearOneSuppression(); } return true; }

Target:
public boolean shouldInvoke(C context) { cleanupExpiredSuppressions(); if (cache.containsKey(context)) return false; Suppression<C> suppression = new Suppression<>(ticker, context, ticker.read() + ttlNanos); if (cache.putIfAbsent(context, suppression) != null) return false; suppressions.offer(suppression); if (suppressions.size() > cardinality) removeOneSuppression(); return true; }
Source:
private void processReplaceCommand(final ReplaceCommand command, final InvocationContext ctx, final Object valueReplaced, TransactionContext transactionContext) { Object key = extractValue(command.getKey()); if (valueReplaced != null && command.isSuccessful() && shouldModifyIndexes(command, ctx, key)) { final boolean usingSkipIndexCleanupFlag = usingSkipIndexCleanup(command); Object p2 = extractValue(command.getNewValue()); final boolean newValueIsIndexed = updateKnownTypesIfNeeded(p2); if (!usingSkipIndexCleanupFlag) { final Object p1 = extractValue(command.getOldValue()); final boolean originalIsIndexed = updateKnownTypesIfNeeded(p1); if (p1 != null && originalIsIndexed) { transactionContext = transactionContext == null ? makeTransactionalEventContext() : transactionContext; removeFromIndexes(p1, key, transactionContext); } } if (newValueIsIndexed) { transactionContext = transactionContext == null ? makeTransactionalEventContext() : transactionContext; updateIndexes(usingSkipIndexCleanupFlag, p2, key, transactionContext); } } }

Target:
private void processReplaceCommand(final ReplaceCommand command, final InvocationContext ctx, final Object valueReplaced, TransactionContext transactionContext) { if (valueReplaced != null && command.isSuccessful()) { Object key = extractValue(command.getKey()); if (shouldModifyIndexes(command, ctx, key)) { final boolean usingSkipIndexCleanupFlag = usingSkipIndexCleanup(command); Object p2 = extractValue(command.getNewValue()); final boolean newValueIsIndexed = updateKnownTypesIfNeeded(p2); if (!usingSkipIndexCleanupFlag) { final Object p1 = extractValue(command.getOldValue()); final boolean originalIsIndexed = updateKnownTypesIfNeeded(p1); if (p1 != null && originalIsIndexed) { transactionContext = transactionContext == null ? makeTransactionalEventContext() : transactionContext; removeFromIndexes(p1, key, transactionContext); } } if (newValueIsIndexed) { transactionContext = transactionContext == null ? makeTransactionalEventContext() : transactionContext; updateIndexes(usingSkipIndexCleanupFlag, p2, key, transactionContext); } } } }
Source:
private S fetchFromSchemaRegistry(String topic, String id) { try { S schema = registry.getSchemaByID(topic, id); return schema; } catch (SchemaNotFoundException e) { addFetchToFailureHistory(id); throw new SchemaNotFoundException(e); } }

Target:
private synchronized S fetchFromSchemaRegistry(String topic, String id) { try { S schema = registry.getSchemaByID(topic, id); return schema; } catch (SchemaNotFoundException e) { addFetchToFailureHistory(id); throw e; } }
Source:
private void createCodebookAnnotations(JCas aJCas, List<String> headers, CSVRecord record) throws CollectionException { AnnotationFS codebookAnnotation; for (int i = 2; i < record.size() - 1; i++) { Type codebook = aJCas.getTypeSystem().getType(headers.get(i)); if (codebook == null) throw new CollectionException(); codebookAnnotation = aJCas.getCas().createAnnotation(codebook, 0, aJCas.getDocumentText().length() - 1); codebookAnnotation.setFeatureValueFromString(codebook.getFeatureByBaseName("code"), record.get(i)); aJCas.addFsToIndexes(codebookAnnotation); } }

Target:
private void createCodebookAnnotations(JCas aJCas, List<String> headers, CSVRecord record) throws IOException { AnnotationFS codebookAnnotation; for (int i = 2; i < record.size() - 1; i++) { Type codebook = aJCas.getTypeSystem().getType(headers.get(i)); if (codebook == null) throw new IOException("Codebook Type with name '" + headers.get(i) + "' is not registered in the typesystem!"); codebookAnnotation = aJCas.getCas().createAnnotation(codebook, 0, aJCas.getDocumentText().length() - 1); codebookAnnotation.setFeatureValueFromString(codebook.getFeatureByBaseName("code"), record.get(i)); aJCas.addFsToIndexes(codebookAnnotation); } }
Source:
public RegistryResponseType processRequest(AdhocQueryRequest msg, AssertionType assertion) { LOG.debug("Running through AdapterDeferredResponseOptionProxyWebServiceUnsecuredImpl"); RegistryResponseType response = null; try { if (msg == null) { throw new IllegalArgumentException("Request Message must be provided"); } response = (RegistryResponseType) invokeClientPort(msg, assertion); } catch (final Exception ex) { response = AdapterResponseHelper.createRegistryResponseTypeWithXdsQueryFailure(ERROR_MSG); throw new ErrorEventException(ex, response, ERROR_MSG); } return response; }

Target:
public RegistryResponseType processRequest(AdhocQueryRequest msg, AssertionType assertion) { LOG.debug("Running through AdapterDeferredResponseOptionProxyWebServiceUnsecuredImpl"); RegistryResponseType response = null; try { if (msg == null) { throw new IllegalArgumentException("Request Message must be provided"); } response = (RegistryResponseType) invokeClientPort(msg, assertion); } catch (final Exception ex) { response = AdapterResponseHelper.createFailureWithMessage(ERROR_MSG); throw new ErrorEventException(ex, response, ERROR_MSG); } return response; }
Source:
public Sequence<Row> runQueryOnSegments(final List<File> segmentDirs, final Query query) { final List<AbstractSegment> segments = Lists.transform( segmentDirs, new Function<File, AbstractSegment>() { @Override public AbstractSegment apply(File segmentDir) { try { return new QueryableIndexSegment("", indexIO.loadIndex(segmentDir)); } catch (IOException ex) { throw Throwables.propagate(ex); } } } ); try { return runQueryOnSegmentsObjs(segments, query); } finally { for(Segment segment: segments) { CloseQuietly.close(segment); } } }

Target:
public Sequence<Row> runQueryOnSegments(final List<File> segmentDirs, final Query query) { final List<Segment> segments = Lists.transform( segmentDirs, new Function<File, Segment>() { @Override public Segment apply(File segmentDir) { try { return new QueryableIndexSegment("", indexIO.loadIndex(segmentDir)); } catch (IOException ex) { throw Throwables.propagate(ex); } } } ); try { return runQueryOnSegmentsObjs(segments, query); } finally { for(Segment segment: segments) { CloseQuietly.close(segment); } } }
Source:
public void canRetrieveFromAccount() { GenericAccount account = new GenericAccount(); account.setDataGroups(Sets.newHashSet("group1","group2")); account.setNotifyByEmail(true); account.setExternalId("testExternalID"); account.setLanguages(TestUtils.newLinkedHashSet("en","de")); account.setSharingScope(SharingScope.ALL_QUALIFIED_RESEARCHERS); account.setTimeZone(DateTimeZone.forOffsetHours(-7)); String result = ParticipantOption.DATA_GROUPS.fromAccount(account); assertTrue(result.contains("group1")); assertTrue(result.contains("group2")); result = ParticipantOption.EMAIL_NOTIFICATIONS.fromAccount(account); assertEquals("true", result); result = ParticipantOption.EXTERNAL_IDENTIFIER.fromAccount(account); assertEquals("testExternalID", result); result = ParticipantOption.LANGUAGES.fromAccount(account); assertEquals("en,de", result); result = ParticipantOption.SHARING_SCOPE.fromAccount(account); assertEquals(SharingScope.ALL_QUALIFIED_RESEARCHERS.name(), result); result = ParticipantOption.TIME_ZONE.fromAccount(account); assertEquals("-07:00", result); }

Target:
public void canRetrieveFromAccount() { GenericAccount account = new GenericAccount(); account.setDataGroups(Sets.newHashSet("group1","group2")); account.setNotifyByEmail(false); account.setExternalId("testExternalID"); account.setLanguages(TestUtils.newLinkedHashSet("en","de")); account.setSharingScope(SharingScope.ALL_QUALIFIED_RESEARCHERS); account.setTimeZone(DateTimeZone.forOffsetHours(-7)); String result = ParticipantOption.DATA_GROUPS.fromAccount(account); assertTrue(result.contains("group1")); assertTrue(result.contains("group2")); result = ParticipantOption.EMAIL_NOTIFICATIONS.fromAccount(account); assertEquals("false", result); result = ParticipantOption.EXTERNAL_IDENTIFIER.fromAccount(account); assertEquals("testExternalID", result); result = ParticipantOption.LANGUAGES.fromAccount(account); assertEquals("en,de", result); result = ParticipantOption.SHARING_SCOPE.fromAccount(account); assertEquals(SharingScope.ALL_QUALIFIED_RESEARCHERS.name(), result); result = ParticipantOption.TIME_ZONE.fromAccount(account); assertEquals("-07:00", result); }
Source:
public void shutdown() { wantShutdown = true; if ((channel != null) && channel.isConnected()) { try { ChannelFuture closeFuture = channel.getCloseFuture(); channel.close(); closeFuture.await(); } catch (InterruptedException e) { throw new RuntimeException(e); } } bootstrap.releaseExternalResources(); }

Target:
public void shutdown() { wantShutdown = true; synchronized(channelSync) { if ((channel != null) && channel.isConnected()) { try { ChannelFuture closeFuture = channel.getCloseFuture(); channel.close(); closeFuture.await(); } catch (InterruptedException e) { log.log(Level.WARNING, "Got exception during shutdown", e); } } bootstrap.releaseExternalResources(); } }
Source:
protected void onConstructorFound(NewClassTree newClassTree) { Optional<Symbol> variable = lookupInitializedSymbol(newClassTree); if (!variable.isPresent()) { variable = lookupAssignedSymbol(newClassTree); } variable .filter(Symbol::isVariableSymbol) .map(Symbol::owner) .filter(Symbol::isMethodSymbol) .filter(ReuseRandomCheck::isNotConstructorOrStaticMain) .ifPresent(owner -> reportIssue(newClassTree.identifier(), "Save and re-use this \"Random\".")); }

Target:
protected void onConstructorFound(NewClassTree newClassTree) { if (assignedToLocalVariablesNotInConstructorOrStaticMain(newClassTree)) { reportIssue(newClassTree.identifier(), "Save and re-use this \"Random\"."); } }
Source:
private NumberPicker createNumberPicker() { NumberPicker picker = new NumberPicker(getActivity()); picker.setLayoutParams(new LayoutParams(WRAP_CONTENT, WRAP_CONTENT, CENTER)); picker.setMinValue(0); picker.setMaxValue(5); picker.setValue(mValue); picker.setWrapSelectorWheel(false); Log.d("folder fragment", "create number picker "+mValue); return picker; }

Target:
private NumberPicker createNumberPicker() { NumberPicker picker = new NumberPicker(getActivity()); picker.setLayoutParams(new LayoutParams(WRAP_CONTENT, WRAP_CONTENT, CENTER)); picker.setMinValue(0); picker.setMaxValue(5); picker.setValue(mValue); picker.setWrapSelectorWheel(false); return picker; }
Source:
public static Boolean shouldReplicate(ReplicationSpec replicationSpec, Table tableHandle, HiveConf hiveConf) { if (replicationSpec == null) { replicationSpec = new ReplicationSpec(); } if (replicationSpec.isNoop() || tableHandle == null) { return false; } if (tableHandle.isNonNative()) { return false; } if (!hiveConf.getBoolVar(HiveConf.ConfVars.REPL_INCLUDE_EXTERNAL_TABLES) && MetaStoreUtils.isExternalTable(tableHandle.getTTable()) && !replicationSpec.isMetadataOnly() && replicationSpec.isInReplicationScope()) { return false; } if (replicationSpec.isInReplicationScope()) { boolean isAcidTable = AcidUtils.isTransactionalTable(tableHandle); if (isAcidTable) { return hiveConf.getBoolVar(HiveConf.ConfVars.REPL_DUMP_INCLUDE_ACID_TABLES); } return !tableHandle.isTemporary(); } return true; }

Target:
public static Boolean shouldReplicate(ReplicationSpec replicationSpec, Table tableHandle, HiveConf hiveConf) { if (replicationSpec == null) { replicationSpec = new ReplicationSpec(); } if (replicationSpec.isNoop() || tableHandle == null) { return false; } if (tableHandle.isNonNative()) { return false; } if (replicationSpec.isInReplicationScope()) { if (!hiveConf.getBoolVar(HiveConf.ConfVars.REPL_INCLUDE_EXTERNAL_TABLES) && MetaStoreUtils.isExternalTable(tableHandle.getTTable()) && !replicationSpec.isMetadataOnly()) { return false; } boolean isAcidTable = AcidUtils.isTransactionalTable(tableHandle); if (isAcidTable) { return hiveConf.getBoolVar(HiveConf.ConfVars.REPL_DUMP_INCLUDE_ACID_TABLES); } return !tableHandle.isTemporary(); } return true; }
Source:
private void init(Notifier input) { final boolean wasInitializing = initializing; initializing = true; try { this.input = input; validationChangeListener = new ValidationChangeListener(input); TreeIterator<Object> allContents; if (ResourceSet.class.isInstance(input)) { allContents = EcoreUtil.getAllContents(ResourceSet.class.cast(input), false); } else if (Resource.class.isInstance(input)) { allContents = EcoreUtil.getAllContents(Resource.class.cast(input), false); } else if (EObject.class.isInstance(input)) { allContents = EcoreUtil.getAllContents(EObject.class.cast(input), false); } else { return; } if (EObject.class.isInstance(input)) { updateCacheWithoutRefresh(EObject.class.cast(input), this); } while (allContents.hasNext()) { final Object next = allContents.next(); if (!EObject.class.isInstance(next)) { continue; } updateCacheWithoutRefresh(EObject.class.cast(next), this); } } finally { initializing = wasInitializing; } }

Target:
private void init(Notifier input) { final boolean wasInitializing = initializing; initializing = true; try { this.input = input; validationChangeListener = new ValidationChangeListener(input); TreeIterator<Object> allContents; if (ResourceSet.class.isInstance(input)) { allContents = EcoreUtil.getAllContents(ResourceSet.class.cast(input), false); } else if (Resource.class.isInstance(input)) { allContents = EcoreUtil.getAllContents(Resource.class.cast(input), false); } else if (EObject.class.isInstance(input)) { allContents = EcoreUtil.getAllContents(Collections.singleton(EObject.class.cast(input)), false); } else { return; } while (allContents.hasNext()) { final Object next = allContents.next(); if (!EObject.class.isInstance(next)) { continue; } updateCacheWithoutRefresh(EObject.class.cast(next), this); } } finally { initializing = wasInitializing; } }
Source:
public void testAdvanceTest0004() throws Exception { String reqResNo; Set<String> policies = new HashSet<String>(); policies.add("TestPolicy_0004.xml"); log.info("Advance Test 0004 is started. This test is for Jira <LINK_0>"); for (int i = 1; i < 2; i++) { if (i < 10) { reqResNo = "0" + i; } else { reqResNo = Integer.toString(i); } String request = TestUtil.createRequest(ROOT_DIRECTORY, VERSION_DIRECTORY, "request_0004_" + reqResNo + ".xml"); if (request != null) { log.info("Request that is sent to the PDP : " + request); ResponseCtx response = TestUtil.evaluate(getPDPNewInstance(policies), request); if (response != null) { log.info("Response that is received from the PDP : " + response.encode()); ResponseCtx expectedResponseCtx = TestUtil.createResponse(ROOT_DIRECTORY, VERSION_DIRECTORY, "response_0004_" + reqResNo + ".xml"); validate(response); if (expectedResponseCtx != null) { assertTrue(TestUtil.isMatching(response, expectedResponseCtx)); } else { assertTrue("Response read from file is Null", false); } } else { assertFalse("Response received PDP is Null", false); } } else { assertTrue("Request read from file is Null", false); } log.info("Advance Test 0004 is finished"); } }

Target:
public void testAdvanceTest0004() throws Exception { String reqResNo; Set<String> policies = new HashSet<String>(); policies.add("TestPolicy_0004.xml"); log.info("Advance Test 0004 is started. This test is for Jira <LINK_0>"); String request = TestUtil.createRequest(ROOT_DIRECTORY, VERSION_DIRECTORY, "request_0004_01.xml"); if (request != null) { log.info("Request that is sent to the PDP : " + request); ResponseCtx response = TestUtil.evaluate(getPDPNewInstance(policies), request); if (response != null) { log.info("Response that is received from the PDP : " + response.encode()); ResponseCtx expectedResponseCtx = TestUtil.createResponse(ROOT_DIRECTORY, VERSION_DIRECTORY, "response_0004_01.xml"); validate(response); if (expectedResponseCtx != null) { assertTrue(TestUtil.isMatching(response, expectedResponseCtx)); } else { assertTrue("Response read from file is Null", false); } } else { assertFalse("Response received PDP is Null", false); } } else { assertTrue("Request read from file is Null", false); } log.info("Advance Test 0004 is finished"); }
Source:
public void logChange(final String storeName, final Bytes key, final byte[] value, final long timestamp) { recordCollector().send( storeName + "-changelog", key, value, null, taskId().partition, timestamp, KEY_SERIALIZER, VALUE_SERIALIZER); }

Target:
public void logChange(final String storeName, final Bytes key, final byte[] value, final long timestamp) { recordCollector().send( storeName + "-changelog", key, value, null, taskId().partition, timestamp, BYTES_KEY_SERIALIZER, BYTEARRAY_VALUE_SERIALIZER); }
Source:
public void testSeekToReadaheadExactlyAndRead() throws Throwable { describe("Seek to readahead limit and call InputStream.read(byte[])"); Path path = path("testSeekToReadaheadExactlyAndRead"); FileSystem fs = getFileSystem(); writeTestDataset(path); try (FSDataInputStream in = fs.open(path)) { readAtEndAndReturn(in); final byte[] temp = new byte[5]; int offset = READAHEAD; in.seek(offset); int l = in.read(temp); LOG.info("Read of byte array at offset returned bytes", offset, l); assertTrue("Reading in temp data", l > 0); assertDatasetEquals(offset, "read at end of boundary", temp, l); } }

Target:
public void testSeekToReadaheadExactlyAndRead() throws Throwable { describe("Seek to exactly the readahead limit and call" + " InputStream.read(byte[])"); Path path = path("testSeekToReadaheadExactlyAndRead"); FileSystem fs = getFileSystem(); writeTestDataset(path); try (FSDataInputStream in = fs.open(path)) { readAtEndAndReturn(in); final byte[] temp = new byte[5]; int offset = READAHEAD; in.seek(offset); int l = in.read(temp); LOG.info("Read of byte array at offset returned bytes", offset, l); assertTrue("Reading in temp data", l > 0); assertDatasetEquals(offset, "read at end of boundary", temp, l); } }
Source:
public List<QuestionnaireResponse> getQuestionnaires() { return dataService.query(ENTITY_TYPE_META_DATA, EntityType.class) .eq(EntityTypeMetadata.EXTENDS, QUESTIONNAIRE) .findAll() .filter(entityType -> userPermissionEvaluator.hasPermission( new EntityTypeIdentity(entityType.getId()), EntityTypePermission.WRITE)) .map(entityType -> { String entityTypeId = entityType.getId(); Questionnaire questionnaireEntity = findQuestionnaireEntity(entityTypeId); if (questionnaireEntity == null) { Questionnaire questionnaire = questionnaireFactory.create( entityManager.create(entityType, POPULATE)); questionnaire.setOwner(getCurrentUsername()); questionnaire.setStatus(NOT_STARTED); dataService.add(entityType.getId(), questionnaire); return QuestionnaireResponse.create(questionnaire); } return QuestionnaireResponse.create(questionnaireEntity); }) .collect(toList()); }

Target:
public List<QuestionnaireResponse> getQuestionnaires() { return dataService.query(ENTITY_TYPE_META_DATA, EntityType.class) .eq(EntityTypeMetadata.EXTENDS, QUESTIONNAIRE) .findAll() .filter(entityType -> userPermissionEvaluator.hasPermission( new EntityTypeIdentity(entityType.getId()), EntityTypePermission.WRITE)) .map(this::createQuestionnaireResponse) .collect(toList()); }
Source:
public static SubscriptionInfo decode(final ByteBuffer data) { data.rewind(); final int version = data.getInt(); if (version > LATEST_SUPPORTED_VERSION) { final int latestSupportedVersion = data.getInt(); final SubscriptionInfoData subscriptionInfoData = new SubscriptionInfoData(); subscriptionInfoData.setVersion(version); subscriptionInfoData.setLatestSupportedVersion(latestSupportedVersion); return new SubscriptionInfo(subscriptionInfoData); } else { data.rewind(); final ByteBufferAccessor accessor = new ByteBufferAccessor(data); final SubscriptionInfoData subscriptionInfoData = new SubscriptionInfoData(accessor, (short) version); return new SubscriptionInfo(subscriptionInfoData); } }

Target:
public static SubscriptionInfo decode(final ByteBuffer data) { data.rewind(); final int version = data.getInt(); if (version > LATEST_SUPPORTED_VERSION) { final int latestSupportedVersion = data.getInt(); final SubscriptionInfoData subscriptionInfoData = new SubscriptionInfoData(); subscriptionInfoData.setVersion(version); subscriptionInfoData.setLatestSupportedVersion(latestSupportedVersion); LOG.info("Unable to decode subscription data: used version: {}; latest supported version: {}", version, latestSupportedVersion); return new SubscriptionInfo(subscriptionInfoData); } else { data.rewind(); final ByteBufferAccessor accessor = new ByteBufferAccessor(data); final SubscriptionInfoData subscriptionInfoData = new SubscriptionInfoData(accessor, (short) version); return new SubscriptionInfo(subscriptionInfoData); } }
Source:
public static String[] fromFullName(String name) { return new String[]{ name.substring(0, name.lastIndexOf(SEPARATOR)), name.substring(name.lastIndexOf(SEPARATOR) + 1) }; }

Target:
public static T2<String, String> fromFullName(String name) { return new T2<> ( name.substring(0, name.lastIndexOf(SEPARATOR)), name.substring(name.lastIndexOf(SEPARATOR) + 1) ); }