auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String getWelcomePageUrl() { String welcomePageUrl = null; IService service = OpenShiftServerUtils.getService(server); IProject project = service.getProject(); if (project != null) { List<IRoute> routes = project.getResources(ResourceKind.ROUTE); String url = OpenShiftServerUtils.getRouteURL(server); if(!StringUtils.isEmpty(url)) { for (IRoute route: routes) { if(url.equals(route.getURL())) { return welcomePageUrl = url; } } } IRoute route = getRoute(routes); if (route != null) { welcomePageUrl = route.getURL(); } } return welcomePageUrl; }

Target:
public String getWelcomePageUrl() { String welcomePageUrl = null; IService service = OpenShiftServerUtils.getService(server); IProject project = service.getProject(); if (project != null) { List<IRoute> routes = project.getResources(ResourceKind.ROUTE); IRoute route = getRoute(OpenShiftServerUtils.getRouteURL(server), routes); if (route == null) { route = getRoute(routes); } if (route != null) { welcomePageUrl = route.getURL(); } } return welcomePageUrl; }
Source:
public static HostnameResolver chooseResolver( Config config, LogProvider logProvider, LogProvider userLogProvider ) { CausalClusteringSettings.DiscoveryType discoveryType = config.get( CausalClusteringSettings.discovery_type ); if ( discoveryType == CausalClusteringSettings.DiscoveryType.DNS ) { return new DnsHostnameResolver( logProvider, userLogProvider, new DomainNameResolverImpl() ); } else if ( discoveryType == CausalClusteringSettings.DiscoveryType.SRV ) { return new SrvHostnameResolver( logProvider, userLogProvider, new SrvRecordResolverImpl() ); } else { return new NoOpHostnameResolver(); } }

Target:
public static HostnameResolver chooseResolver( Config config, LogProvider logProvider, LogProvider userLogProvider ) { CausalClusteringSettings.DiscoveryType discoveryType = config.get( CausalClusteringSettings.discovery_type ); return discoveryType.getHostnameResolver( logProvider, userLogProvider ); }
Source:
public void start() { try { if ( !checkRequiredSettings() ) { throw new HibernateException( "Please configure Redis on hibernate.properties correctly." ); } log.info( "Redis starting ..." ); setUpRedis(); } catch ( Exception ex ) { stop(); } }

Target:
public void start() { try { Map<String, String> unSetRequiredProperties = checkRequiredSettings(); if ( !unSetRequiredProperties.isEmpty() ) { throw log.missingPropertiesAtStartup( unSetRequiredProperties.toString() ); } log.redisStarting(); setUpRedis(); } catch ( Exception ex ) { stop(); throw log.cannotStartRedis( ex ); } }
Source:
private void updateOptionInDb(final GlusterVolumeOption option) { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { if(getGlusterVolume().getOptionValue(option.getKey()) != null) { glusterVolumeDao.updateVolumeOption(option); } else { glusterVolumeDao.addVolumeOption(option); } return null; } }); }

Target:
private void updateOptionInDb(final GlusterVolumeOption option) { if (getGlusterVolume().getOptionValue(option.getKey()) != null) { getGlusterVolumeDao().updateVolumeOption(option); } else { getGlusterVolumeDao().addVolumeOption(option); } }
Source:
public void testDeserialization() throws Exception { final Subscription subscription = readObjectFromResource("/notification/subscription.json", Subscription.class); assertThat(subscription.getMeta(), is(notNullValue())); assertThat(subscription.getMeta().getUri(), is("/gdc/projects/be2lnpzun7cybpvd7gs1mvtczzr9ijv7/users/876ec68f5630b38de65852ed5d6236ff/subscriptions/59dca8f260b2c601f3c72e1c")); assertThat(subscription.getMeta().getTitle(), is("test subscription")); assertThat(subscription.getChannels(), hasItems("/gdc/account/profile/876ec68f5630b38de65852ed5d6236ff/channelConfigurations/59dca8f160b2c601f3c72e1b")); assertThat(subscription.getCondition(), is(notNullValue())); assertThat(subscription.getCondition().getExpression(), is("true")); assertThat(subscription.getTriggers(), hasSize(2)); assertThat(subscription.getTemplate(), is(notNullValue())); assertThat(subscription.getTemplate().getExpression(), is("test message")); }

Target:
public void testDeserialization() throws Exception { final Subscription subscription = readObjectFromResource("/notification/subscription.json", Subscription.class); assertThat(subscription.getMeta(), is(notNullValue())); assertThat(subscription.getMeta().getUri(), is("/gdc/projects/be2lnpzun7cybpvd7gs1mvtczzr9ijv7/users/876ec68f5630b38de65852ed5d6236ff/subscriptions/59dca8f260b2c601f3c72e1c")); assertThat(subscription.getMeta().getTitle(), is("test subscription")); assertThat(subscription.getChannels(), is(singletonList("/gdc/account/profile/876ec68f5630b38de65852ed5d6236ff/channelConfigurations/59dca62e60b2c601f3c72e18"))); assertThat(subscription.getCondition(), is(notNullValue())); assertThat(subscription.getCondition().getExpression(), is("true")); assertThat(subscription.getTriggers(), hasSize(2)); assertThat(subscription.getTemplate(), is(notNullValue())); assertThat(subscription.getTemplate().getExpression(), is("test message")); }
Source:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.Theme_MaterialComponents_NoActionBar_App); setContentView(R.layout.activity_running); ButterKnife.bind(this); Bundle extra = getIntent().getBundleExtra(TEST); testSuites = (ArrayList<AbstractSuite>) extra.getSerializable(TEST); if (testSuites == null) finish(); runtTest(); }

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(R.style.Theme_MaterialComponents_NoActionBar_App); setContentView(R.layout.activity_running); ButterKnife.bind(this); Bundle extra = getIntent().getBundleExtra(TEST); testSuites = (ArrayList<AbstractSuite>) extra.getSerializable(TEST); if (testSuites == null) { finish(); return; } runTest(); }
Source:
public void testNothing() { assertNotNull("asciidoc parser was not created", parseToHtml("test")); }

Target:
public void testNothing() { assertNotNull("This test method is here since if I don't have it surefire complains there are no tests"); }
Source:
protected Void doInBackground() { HttpURLConnection urlConnection = null; File updateFile = null; try { URL url = new URL(myDownloadURL); urlConnection = (HttpURLConnection) url.openConnection(); int responseCode = urlConnection.getResponseCode(); String saveFilePath = System.getProperty("java.io.tmpdir") + File.separator + "gantt-update"; updateFile = File.createTempFile(saveFilePath, ".tmp"); if (responseCode == HttpURLConnection.HTTP_OK) { downloadZip(urlConnection, updateFile); } else { throw new IOException("No file to download. Server replied HTTP code: " + responseCode); } unzipUpdates(updateFile); } catch (IOException ex) { ex.printStackTrace(); cancel(true); } finally { urlConnection.disconnect(); updateFile.delete(); } return null; }

Target:
protected Void doInBackground() { HttpURLConnection urlConnection = null; File updateFile = null; try { URL url = new URL(myDownloadURL); urlConnection = (HttpURLConnection) url.openConnection(); int responseCode = urlConnection.getResponseCode(); updateFile = File.createTempFile("gantt-update", ".tmp"); if (responseCode == HttpURLConnection.HTTP_OK) { downloadZip(urlConnection, updateFile); } else { throw new IOException("No file to download. Server replied HTTP code: " + responseCode); } unzipUpdates(updateFile); } catch (IOException ex) { GPLogger.log(ex); cancel(true); } finally { if (urlConnection != null) { urlConnection.disconnect(); } if (updateFile != null) { updateFile.delete(); } } return null; }
Source:
public void handleModifyEvent(CatalogModifyEvent event) throws CatalogException { CatalogInfo source = event.getSource(); if (!(source instanceof StyleInfo)) { return; } final List<String> propertyNames = event.getPropertyNames(); if (!propertyNames.contains("name") && !propertyNames.contains("workspace")) { return; } final int nameIdx = propertyNames.indexOf("name"); final String oldName = (String) event.getOldValues().get(nameIdx); final String newName = (String) event.getNewValues().get(nameIdx); final int workspaceIdx = propertyNames.indexOf("wokspace"); final String oldWorkspaceName = workspaceIdx != -1 ? (String) event.getOldValues().get( workspaceIdx) : null; final String newWorkspaceName = workspaceIdx != -1 ? (String) event.getNewValues().get( workspaceIdx) : null; final String oldStyleName = getPrefixedName(oldWorkspaceName, oldName); final String newStyleName = getPrefixedName(newWorkspaceName, newName); if (oldName.equals(newName)) { return; } List<GeoServerTileLayer> affectedLayers; affectedLayers = mediator.getTileLayersForStyle(oldName); for (GeoServerTileLayer tl : affectedLayers) { LayerInfo layerInfo = tl.getLayerInfo(); if (layerInfo == null) { continue; } GeoServerTileLayerInfo info = tl.getInfo(); ImmutableSet<String> styleNames = info.cachedStyles(); if (styleNames.contains(oldStyleName)) { tl.resetParameterFilters(); mediator.truncateByLayerAndStyle(tl.getName(), oldStyleName); Set<String> newStyles = new HashSet<String>(styleNames); newStyles.remove(oldStyleName); newStyles.add(newStyleName); String defaultStyle = layerInfo.getDefaultStyle() == null ? null : layerInfo .getDefaultStyle().prefixedName(); TileLayerInfoUtil.setCachedStyles(info, defaultStyle, newStyles); mediator.save(tl); } } }

Target:
public void handleModifyEvent(CatalogModifyEvent event) throws CatalogException { CatalogInfo source = event.getSource(); if (source instanceof StyleInfo) { final List<String> propertyNames = event.getPropertyNames(); if (!propertyNames.contains("name") && !propertyNames.contains("workspace")) { return; } final int nameIdx = propertyNames.indexOf("name"); final String oldName = (String) event.getOldValues().get(nameIdx); final String newName = (String) event.getNewValues().get(nameIdx); final int workspaceIdx = propertyNames.indexOf("wokspace"); final String oldWorkspaceName = workspaceIdx != -1 ? (String) event.getOldValues().get( workspaceIdx) : null; final String newWorkspaceName = workspaceIdx != -1 ? (String) event.getNewValues().get( workspaceIdx) : null; final String oldStyleName = getPrefixedName(oldWorkspaceName, oldName); final String newStyleName = getPrefixedName(newWorkspaceName, newName); handleStyleRenamed(oldStyleName, newStyleName); } else if (source instanceof WorkspaceInfo) { PRE_MODIFY_EVENT.set(event); } }
Source:
@Override public void checkPageCompressionSupported(Path storagePath, int pageSize) throws IgniteCheckedException { if (testMode) return; if (!U.isLinux()) throw new IgniteCheckedException("Currently page compression is supported only for Linux."); FileSystemUtils.checkSupported(); int fsBlockSize = FileSystemUtils.getFileSystemBlockSize(storagePath); if (fsBlockSize <= 0) throw new IgniteCheckedException("Failed to get file system block size: " + storagePath); if (!U.isPow2(fsBlockSize)) throw new IgniteCheckedException("Storage block size must be power of 2: " + fsBlockSize); if (pageSize < fsBlockSize * 2) { throw new IgniteCheckedException("Page size (now configured to " + pageSize + " bytes) " + "must be at least 2 times larger than the underlying storage block size (detected to be " + fsBlockSize + " bytes at '" + storagePath + "') for page compression."); } }

Target:
@Override public void checkPageCompressionSupported(Path storagePath, int pageSize) throws IgniteCheckedException { if (!U.isLinux()) throw new IgniteCheckedException("Currently page compression is supported only for Linux."); FileSystemUtils.checkSupported(); int fsBlockSize = FileSystemUtils.getFileSystemBlockSize(storagePath); if (fsBlockSize <= 0) throw new IgniteCheckedException("Failed to get file system block size: " + storagePath); if (!U.isPow2(fsBlockSize)) throw new IgniteCheckedException("Storage block size must be power of 2: " + fsBlockSize); if (pageSize < fsBlockSize * 2) { throw new IgniteCheckedException("Page size (now configured to " + pageSize + " bytes) " + "must be at least 2 times larger than the underlying storage block size (detected to be " + fsBlockSize + " bytes at '" + storagePath + "') for page compression."); } }
Source:
public RecentWikiActivity openDiffPage() { wait.forElementClickable(seeDiffArrow); String urlToBeRedirected = seeDiffArrow.getAttribute("href"); seeDiffArrow.click(); loading.handleAsyncPageReload(); PageObjectLogging.logInfo("The arrow redirecting to the diff page was clicked"); Assertion.assertTrue(driver.getCurrentUrl().contains(urlToBeRedirected), "You were not redirected to the diff page"); PageObjectLogging.logInfo("You were redirected to the diff page"); return this; }

Target:
public RecentWikiActivity openDiffPage() { wait.forElementClickable(seeDiffArrow); String urlPath = seeDiffArrow.getAttribute("href"); seeDiffArrow.click(); loading.handleAsyncPageReload(); Assertion.assertTrue(driver.getCurrentUrl().contains(urlPath), "Url does not contain: " + urlPath); PageObjectLogging.logInfo("Diff page: " + urlPath + ", was opened"); return this; }
Source:
public void removeAccounts() { Account[] accountList = mAcctManager .getAccountsByType(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE); SharedPreferences prefs = mContext.getSharedPreferences(KEY_SHARED_PREF_ACCOUNT_LIST, Activity.MODE_PRIVATE); String delAccount = prefs.getString(KEY_APP_ACCOUNTS_FOR_TOKEN_REMOVAL, ""); StringTokenizer st = new StringTokenizer(delAccount, KEY_ACCOUNT_LIST_DELIM); while (st.hasMoreTokens()) { String name = st.nextToken(); if (name != null && !name.isEmpty()) { Logger.v(TAG, "Removing account:" + name); Account targetAccount = getAccount(accountList, name); if (targetAccount != null) { mAcctManager.removeAccount(targetAccount, null, null); Logger.v(TAG, "Account exists and removed:" + name); } } } }

Target:
public void removeAccounts() { Account[] accountList = mAcctManager .getAccountsByType(AuthenticationConstants.Broker.BROKER_ACCOUNT_TYPE); SharedPreferences prefs = mContext.getSharedPreferences(KEY_SHARED_PREF_ACCOUNT_LIST, Activity.MODE_PRIVATE); String delAccount = prefs.getString(KEY_APP_ACCOUNTS_FOR_TOKEN_REMOVAL, ""); StringTokenizer st = new StringTokenizer(delAccount, KEY_ACCOUNT_LIST_DELIM); while (st.hasMoreTokens()) { String name = st.nextToken(); if (name != null && !name.isEmpty()) { Logger.v(TAG, "Removing account:" + name); Account targetAccount = getAccount(accountList, name); if (targetAccount != null) { mAcctManager.removeAccount(targetAccount, null, null); Logger.v(TAG, "Account exists and removed:" + name); } else { Logger.w(TAG, "Account does not exists" + name, "", ADALError.BROKER_ACCOUNT_DOES_NOT_EXIST); } } } }
Source:
public void testStitchCommandHashCode() { Sprite sprite = new Sprite("firstSprite"); StitchCommand command1 = new DSTStitchCommand(0, 0, 0, sprite); StitchCommand command2 = new DSTStitchCommand(0, 1, 0, sprite); StitchCommand command3 = new DSTStitchCommand(0, 0, 1, sprite); StitchCommand command4 = new DSTStitchCommand(0, 0, 0, new Sprite("secondSprite")); StitchCommand command5 = command1; assertEquals(command1.hashCode(), command5.hashCode()); assertNotEquals(command1.hashCode(), command2.hashCode()); assertNotEquals(command1.hashCode(), command3.hashCode()); assertNotEquals(command1.hashCode(), command4.hashCode()); }

Target:
public void testStitchCommandHashCode() { Sprite sprite = new Sprite("firstSprite"); StitchCommand command1 = new DSTStitchCommand(0, 0, 0, sprite); StitchCommand command2 = new DSTStitchCommand(0, 1, 0, sprite); StitchCommand command3 = new DSTStitchCommand(0, 0, 1, sprite); StitchCommand command4 = new DSTStitchCommand(0, 0, 0, new Sprite("secondSprite")); StitchCommand command5 = new DSTStitchCommand(0, 0, 0, sprite); assertEquals(command1.hashCode(), command5.hashCode()); assertNotEquals(command1.hashCode(), command2.hashCode()); assertNotEquals(command1.hashCode(), command3.hashCode()); assertNotEquals(command1.hashCode(), command4.hashCode()); }
Source:
protected boolean isGitRepository() { return appContext.getActiveProject().isTypeOf("git"); }

Target:
protected boolean isGitRepository() { if (appContext.getActiveProject() == null) { return false; } else { return appContext.getActiveProject().isTypeOf("git"); } }
Source:
private String getSortValue() { if (account != null) { if (account.email != null) { return account.email; } return account.name; } return group; }

Target:
private String getSortValue() { if (account != null) { if (account.email != null) { return account.email; } return Strings.nullToEmpty(account.name); } return group; }
Source:
public void performHaResevationCheck() { log.debug("HA Reservation check timer entered."); List<Cluster> clusters = getClusterDao().getAll(); if (clusters != null) { HaReservationHandling haReservationHandling = new HaReservationHandling(getPendingResourceManager()); for (Cluster cluster : clusters) { if (cluster.supportsHaReservation()) { List<VDS> returnedFailedHosts = new ArrayList<>(); boolean clusterHaStatus = haReservationHandling.checkHaReservationStatusForCluster(cluster, returnedFailedHosts); if (!clusterHaStatus) { AuditLogable logable = createEventForCluster(cluster); String failedHostsStr = returnedFailedHosts.stream().map(VDS::getName).collect(Collectors.joining(", ")); logable.addCustomValue("Hosts", failedHostsStr); auditLogDirector.log(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION); log.info("Cluster '{}' fail to pass HA reservation check.", cluster.getName()); } boolean clusterHaStatusFromPreviousCycle = clusterId2isHaReservationSafe.containsKey(cluster.getId()) ? clusterId2isHaReservationSafe.get(cluster.getId()) : true; clusterId2isHaReservationSafe.put(cluster.getId(), clusterHaStatus); if (!clusterHaStatusFromPreviousCycle && clusterHaStatus) { AuditLogable logable = createEventForCluster(cluster); auditLogDirector.log(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION_DOWN); } } } } log.debug("HA Reservation check timer finished."); }

Target:
private void performHaResevationCheck() { log.debug("HA Reservation check timer entered."); List<Cluster> clusters = getClusterDao().getAll(); if (clusters != null) { HaReservationHandling haReservationHandling = new HaReservationHandling(getPendingResourceManager()); for (Cluster cluster : clusters) { if (cluster.supportsHaReservation()) { List<VDS> returnedFailedHosts = new ArrayList<>(); boolean clusterHaStatus = haReservationHandling.checkHaReservationStatusForCluster(cluster, returnedFailedHosts); if (!clusterHaStatus) { AuditLogable logable = createEventForCluster(cluster); String failedHostsStr = returnedFailedHosts.stream().map(VDS::getName).collect(Collectors.joining(", ")); logable.addCustomValue("Hosts", failedHostsStr); auditLogDirector.log(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION); log.info("Cluster '{}' fail to pass HA reservation check.", cluster.getName()); } boolean clusterHaStatusFromPreviousCycle = clusterId2isHaReservationSafe.containsKey(cluster.getId()) ? clusterId2isHaReservationSafe.get(cluster.getId()) : true; clusterId2isHaReservationSafe.put(cluster.getId(), clusterHaStatus); if (!clusterHaStatusFromPreviousCycle && clusterHaStatus) { AuditLogable logable = createEventForCluster(cluster); auditLogDirector.log(logable, AuditLogType.CLUSTER_ALERT_HA_RESERVATION_DOWN); } } } } log.debug("HA Reservation check timer finished."); }
Source:
private CompletionStage<Void> startTransfer(StateRequestCommand.Type type) { if (isCancelled) return completionFuture; IntSet segmentsCopy = getSegments(); if (segmentsCopy.isEmpty()) { log.tracef("Segments list is empty, skipping source %s", source); completionFuture.complete(null); return completionFuture; } if (trace) { log.tracef("Requesting state (%s) from node %s for segments %s", type, source, segmentsCopy); } StateRequestCommand cmd = commandsFactory.buildStateRequestCommand(type, rpcManager.getAddress(), topologyId, segmentsCopy); CompletionStage<Response> remoteStage = rpcManager.invokeCommand(source, cmd, PassthroughSingleResponseCollector.INSTANCE, rpcOptions); return handleAndCompose(remoteStage, (response, throwable) -> { if (throwable != null) { if (!isCancelled) { log.failedToRequestSegments(cacheName, source, segmentsCopy, throwable); completionFuture.completeExceptionally(throwable); } } else if (response instanceof SuccessfulResponse) { if (trace) { log.tracef("Successfully requested state (%s) from node %s for segments %s", type, source, segmentsCopy); } } else if (response instanceof CacheNotFoundResponse) { if (trace) log.tracef("State source %s was suspected, another source will be selected", source); completionFuture.completeExceptionally(new SuspectException()); } else { Exception e = new CacheException(String.valueOf(response)); log.failedToRequestSegments(cacheName, source, segmentsCopy, e); completionFuture.completeExceptionally(e); } return completionFuture; }); }

Target:
private CompletionStage<Void> startTransfer(StateRequestCommand.Type type) { if (isCancelled) return completionFuture; IntSet segmentsCopy = getSegments(); if (segmentsCopy.isEmpty()) { if (trace) log.tracef("Segments list is empty, skipping source %s", source); completionFuture.complete(null); return completionFuture; } if (trace) { log.tracef("Requesting state (%s) from node %s for segments %s", type, source, segmentsCopy); } StateRequestCommand cmd = commandsFactory.buildStateRequestCommand(type, rpcManager.getAddress(), topologyId, segmentsCopy); CompletionStage<Response> remoteStage = rpcManager.invokeCommand(source, cmd, PassthroughSingleResponseCollector.INSTANCE, rpcOptions); return handleAndCompose(remoteStage, (response, throwable) -> { if (throwable != null) { if (!isCancelled) { log.failedToRequestSegments(cacheName, source, segmentsCopy, throwable); completionFuture.completeExceptionally(throwable); } } else if (response instanceof SuccessfulResponse) { if (trace) { log.tracef("Successfully requested state (%s) from node %s for segments %s", type, source, segmentsCopy); } } else if (response instanceof CacheNotFoundResponse) { if (trace) log.tracef("State source %s was suspected, another source will be selected", source); completionFuture.completeExceptionally(new SuspectException()); } else { Exception e = new CacheException(String.valueOf(response)); log.failedToRequestSegments(cacheName, source, segmentsCopy, e); completionFuture.completeExceptionally(e); } return completionFuture; }); }
Source:
public boolean equals(Object obj) { return obj != null && obj instanceof GlusterGeoRepSessionConfiguration && ObjectUtils.objectsEqual(getId(), ((GlusterGeoRepSessionConfiguration) obj).getId()) && ObjectUtils.haveSameElements(allowedValues, ((GlusterGeoRepSessionConfiguration) obj).getAllowedValues()) && super.equals(obj); }

Target:
public boolean equals(Object obj) { return obj != null && obj instanceof GlusterGeoRepSessionConfiguration && ObjectUtils.objectsEqual(getId(), ((GlusterGeoRepSessionConfiguration) obj).getId()) && super.equals(obj); }
Source:
void addSegment(Segment seg) { if (seg == null) return; MapKey me = new MapKey(seg); if (segmentPreferences.containsKey(me)) { segmentPreferences.get(me).setInSource(convertSegment(seg)); try { segmentPreferences.get(me).setXUnits(xunits); segmentPreferences.get(me).setYUnits(yunits); } catch (UnitsException ex) { throw new RuntimeException(ex); } return; } SegmentLayer layer = new SegmentLayer(convertSegment(seg)); int count = 0; String id = layer.getSuffix(); while (!isUniqueLayerSuffix(id)) { count++; id = layer.getSuffix() + " " + count; } layer.setSuffix(id); layer.getInSource().setName(id); String hexColor = ColorPalette.colorToHex(colors.getNextColor()); layer.setMarkColor(hexColor); layer.setLabel(id); setUnits(seg, layer); segmentPreferences.put(me, layer); }

Target:
void addSegment(Segment seg) { if (seg == null) return; MapKey me = new MapKey(seg); if (segmentPreferences.containsKey(me)) { segmentPreferences.get(me).setInSource(convertSegment(seg)); return; } SegmentLayer layer = new SegmentLayer(convertSegment(seg)); int count = 0; String id = layer.getSuffix(); while (!isUniqueLayerSuffix(id)) { count++; id = layer.getSuffix() + " " + count; } layer.setSuffix(id); layer.getInSource().setName(id); String hexColor = ColorPalette.colorToHex(colors.getNextColor()); layer.setMarkColor(hexColor); layer.setLabel(id); setUnits(seg, layer); segmentPreferences.put(me, layer); }
Source:
public static LabelType initCodeReviewLabel(ProjectConfig c) { LabelType type = new LabelType("Code-Review", ImmutableList.of( new LabelValue((short) 2, "Looks good to me, approved"), new LabelValue((short) 1, "Looks good to me, but someone else must approve"), new LabelValue((short) 0, "No score"), new LabelValue((short) -1, "I would prefer this is not merged as is"), new LabelValue((short) -2, "This shall not be merged"))); type.setAbbreviation("CR"); type.setCopyMinScore(true); type.setDefaultValue(new LabelValue((short) 0, "No Score")); c.getLabelSections().put(type.getName(), type); return type; }

Target:
public static LabelType initCodeReviewLabel(ProjectConfig c) { LabelType type = new LabelType("Code-Review", ImmutableList.of( new LabelValue((short) 2, "Looks good to me, approved"), new LabelValue((short) 1, "Looks good to me, but someone else must approve"), new LabelValue((short) 0, "No score"), new LabelValue((short) -1, "I would prefer this is not merged as is"), new LabelValue((short) -2, "This shall not be merged"))); type.setAbbreviation("CR"); type.setCopyMinScore(true); c.getLabelSections().put(type.getName(), type); return type; }
Source:
protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { super.decodeLast(ctx, in, out); if (in.readableBytes() > 0) { String discardedData = in.readBytes(in.readableBytes()).toString(Charset.forName("UTF-8")); if (StringUtils.isNotBlank(discardedData)) { logger.warning("Client " + PortUnificationHandler.getRemoteName(ctx) + " disconnected, leaving unterminated " + "string. Input (" + in.readableBytes() + " bytes) discarded: \"" + discardedData + "\""); } } }

Target:
protected void decodeLast(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception { super.decodeLast(ctx, in, out); if (in.readableBytes() > 0) { String discardedData = in.readBytes(in.readableBytes()).toString(Charset.forName("UTF-8")); if (StringUtils.isNotBlank(discardedData)) { logger.warning("Client " + PortUnificationHandler.getRemoteName(ctx) + " disconnected, leaving unterminated string. Input (" + in.readableBytes() + " bytes) discarded: \"" + discardedData + "\""); } } }
Source:
public void setUp() { try { customMapsDirectory.newFolder(testMapNameGenerator); fafDataDirectory.newFolder(MapGeneratorService.GENERATOR_EXECUTABLE_SUB_DIRECTORY); Files.createFile(fafDataDirectory.getRoot().toPath().resolve(MapGeneratorService.GENERATOR_EXECUTABLE_SUB_DIRECTORY).resolve(String.format(MapGeneratorService.getGENERATOR_EXECUTABLE_FILENAME(), versionGeneratorPresent))); } catch (IOException e) { e.printStackTrace(); throw new RuntimeException("Could not create test map generator folder!"); } when(preferencesService.getFafDataDirectory()).thenReturn(fafDataDirectory.getRoot().toPath()); when(preferencesService.getPreferences()).thenReturn(preferences); when(preferences.getForgedAlliance()).thenReturn(forgedAlliancePrefs); when(forgedAlliancePrefs.getCustomMapsDirectory()).thenReturn(customMapsDirectory.getRoot().toPath()); instance = new MapGeneratorService(applicationContext, preferencesService, taskService); assertThat(Arrays.asList(Objects.requireNonNull(customMapsDirectory.getRoot().list())), not(contains(testMapNameGenerator))); when(downloadMapGeneratorTask.getFuture()).thenReturn(CompletableFuture.completedFuture(null)); when(generateMapTask.getFuture()).thenReturn(CompletableFuture.completedFuture(null)); doAnswer(invocation -> { @SuppressWarnings("unchecked") CompletableTask<Void> task = invocation.getArgument(0); WaitForAsyncUtils.asyncFx(task); task.getFuture().get(); return task; }).when(taskService).submitTask(any()); }

Target:
public void setUp() throws IOException { customMapsDirectory.newFolder(testMapNameGenerator); fafDataDirectory.newFolder(MapGeneratorService.GENERATOR_EXECUTABLE_SUB_DIRECTORY); String generatorExecutableName = String.format(MapGeneratorService.getGENERATOR_EXECUTABLE_FILENAME(), versionGeneratorPresent); Files.createFile(fafDataDirectory.getRoot().toPath().resolve(MapGeneratorService.GENERATOR_EXECUTABLE_SUB_DIRECTORY).resolve(generatorExecutableName)); when(preferencesService.getFafDataDirectory()).thenReturn(fafDataDirectory.getRoot().toPath()); Preferences preferences = new Preferences(); preferences.getForgedAlliance().setCustomMapsDirectory(customMapsDirectory.getRoot().toPath()); when(preferencesService.getPreferences()).thenReturn(preferences); instance = new MapGeneratorService(applicationContext, preferencesService, taskService); instance.postConstruct(); assertThat(Arrays.asList(Objects.requireNonNull(customMapsDirectory.getRoot().list())), not(contains(testMapNameGenerator))); when(downloadMapGeneratorTask.getFuture()).thenReturn(CompletableFuture.completedFuture(null)); when(generateMapTask.getFuture()).thenReturn(CompletableFuture.completedFuture(null)); doAnswer(invocation -> { @SuppressWarnings("unchecked") CompletableTask<Void> task = invocation.getArgument(0); task.getFuture().get(); return task; }).when(taskService).submitTask(any()); }
Source:
public static ReadBuffer wrapUnsafe(ByteBuffer buffer) { if (buffer.hasArray()) { int pos = buffer.position(); return wrap(buffer.array(), buffer.arrayOffset() + pos); } return new ReadBuffer.Buff(buffer); }

Target:
public static ReadBuffer wrapUnsafe(ByteBuffer buffer) { if (buffer.hasArray()) { int offset = buffer.arrayOffset() + buffer.position(); int limit = offset + buffer.remaining(); return wrap(buffer.array(), offset, limit); } return buffer.order() == ByteOrder.BIG_ENDIAN ? new BigEndianByteBuffer(buffer) : new LittleEndianByteBuffer(buffer); }
Source:
public java.util.Calendar getLastModifiedAsCalendar() { final java.util.Calendar cal = new java.util.GregorianCalendar(); cal.setTimeInMillis(lastModified); return cal; }

Target:
public Calendar getLastModifiedAsCalendar() { final Calendar cal = new GregorianCalendar(); cal.setTimeInMillis(lastModified); return cal; }
Source:
public void testClientOpenThrowsTransportExceptionIfNatsNotConnected() throws Exception { when(mockConn.getState()).thenReturn(Constants.ConnState.DISCONNECTED); try { client.open(); } catch(TTransportException ex) { assertEquals(TTransportException.NOT_OPEN, ex.getType()); assertEquals("NATS not connected, has status DISCONNECTED", ex.getMessage()); } }

Target:
public void testClientOpenThrowsTransportExceptionIfNatsNotConnected() throws Exception { when(mockConn.getState()).thenReturn(Constants.ConnState.DISCONNECTED); try { client.open(); fail(); } catch(TTransportException ex) { assertEquals(TTransportException.NOT_OPEN, ex.getType()); assertEquals("NATS not connected, has status DISCONNECTED", ex.getMessage()); } }
Source:
public String getType() { return null; }

Target:
public String getType() { return "Polygon"; }
Source:
public void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput sliceOutput, Block block) { AbstractMapBlock mapBlock = (AbstractMapBlock) block; int positionCount = mapBlock.getPositionCount(); int offsetBase = mapBlock.getOffsetBase(); int[] offsets = mapBlock.getOffsets(); int[] hashTable = mapBlock.getHashTables(); int entriesStartOffset = offsets[offsetBase]; int entriesEndOffset = offsets[offsetBase + positionCount]; TypeSerde.writeType(sliceOutput, mapBlock.keyType); blockEncodingSerde.writeBlock(sliceOutput, mapBlock.getKeys().getRegion(entriesStartOffset, entriesEndOffset - entriesStartOffset)); blockEncodingSerde.writeBlock(sliceOutput, mapBlock.getValues().getRegion(entriesStartOffset, entriesEndOffset - entriesStartOffset)); sliceOutput.appendInt((entriesEndOffset - entriesStartOffset) * HASH_MULTIPLIER); sliceOutput.writeBytes(wrappedIntArray(hashTable, entriesStartOffset * HASH_MULTIPLIER, (entriesEndOffset - entriesStartOffset) * HASH_MULTIPLIER)); sliceOutput.appendInt(positionCount); for (int position = 0; position < positionCount + 1; position++) { sliceOutput.writeInt(offsets[offsetBase + position] - entriesStartOffset); } EncoderUtil.encodeNullsAsBits(sliceOutput, block); }

Target:
public void writeBlock(BlockEncodingSerde blockEncodingSerde, SliceOutput sliceOutput, Block block) { AbstractMapBlock mapBlock = (AbstractMapBlock) block; int positionCount = mapBlock.getPositionCount(); int offsetBase = mapBlock.getOffsetBase(); int[] offsets = mapBlock.getOffsets(); int[] hashTable = mapBlock.getHashTables(); int entriesStartOffset = offsets[offsetBase]; int entriesEndOffset = offsets[offsetBase + positionCount]; TypeSerde.writeType(sliceOutput, mapBlock.keyType); blockEncodingSerde.writeBlock(sliceOutput, mapBlock.getRawKeyBlock().getRegion(entriesStartOffset, entriesEndOffset - entriesStartOffset)); blockEncodingSerde.writeBlock(sliceOutput, mapBlock.getRawValueBlock().getRegion(entriesStartOffset, entriesEndOffset - entriesStartOffset)); sliceOutput.appendInt((entriesEndOffset - entriesStartOffset) * HASH_MULTIPLIER); sliceOutput.writeBytes(wrappedIntArray(hashTable, entriesStartOffset * HASH_MULTIPLIER, (entriesEndOffset - entriesStartOffset) * HASH_MULTIPLIER)); sliceOutput.appendInt(positionCount); for (int position = 0; position < positionCount + 1; position++) { sliceOutput.writeInt(offsets[offsetBase + position] - entriesStartOffset); } EncoderUtil.encodeNullsAsBits(sliceOutput, block); }
Source:
public Response manifestDetails(@Context HttpServletRequest request) { ServletContext context = request.getSession().getServletContext(); try { InputStream manifestStream = context.getResourceAsStream("/META-INF/MANIFEST.MF"); return Response.ok(new Manifest(manifestStream).getMainAttributes()).build(); } catch (Exception e) { return Response.serverError().build(); } }

Target:
public Response manifestDetails(@Context HttpServletRequest request) { final ServletContext context = request.getSession().getServletContext(); try { final InputStream manifestStream = context.getResourceAsStream("/META-INF/MANIFEST.MF"); return Response.ok(new Manifest(manifestStream).getMainAttributes()).build(); } catch (Exception e) { return Response.status(Response.Status.NOT_FOUND).entity("Could not find version information").build(); } }
Source:
public void visitBinaryExpression(BinaryExpressionTree tree) { Tree.Kind peek = stack.peek(); Tree.Kind kind = getKind(tree); if (TABLE.get(peek, kind) == Boolean.TRUE) { raiseIssue(tree); } stack.push(kind); super.visitBinaryExpression(tree); stack.pop(); }

Target:
public void visitBinaryExpression(BinaryExpressionTree tree) { Tree.Kind peek = stack.peek(); Tree.Kind kind = getKind(tree); if (requiresParenthesis(peek, kind)) { raiseIssue(tree); } stack.push(kind); super.visitBinaryExpression(tree); stack.pop(); }
Source:
public void beforeTest() { SWTBotUtils.createProject(PROJECT_NAME); SWTBotTreeItem treeItem = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); assertNotNull(treeItem); final CtfTmfTestTrace cygProfile = CtfTmfTestTrace.CYG_PROFILE; final File file = new File(cygProfile.getTrace().getPath()); SWTBotUtils.openTrace(PROJECT_NAME, file.getAbsolutePath(), UST_ID); SWTBotUtils.openView(CallStackView.ID); SWTBotUtils.waitForJobs(); fExpected = ImmutableList.of("40472b", "4045c8", "404412", "", ""); }

Target:
public void beforeTest() { SWTBotUtils.createProject(PROJECT_NAME); SWTBotTreeItem treeItem = SWTBotUtils.selectTracesFolder(fBot, PROJECT_NAME); assertNotNull(treeItem); final CtfTmfTestTrace cygProfile = CtfTmfTestTrace.CYG_PROFILE; assumeTrue(cygProfile.exists()); final File file = new File(cygProfile.getTrace().getPath()); SWTBotUtils.openTrace(PROJECT_NAME, file.getAbsolutePath(), UST_ID); SWTBotUtils.openView(CallStackView.ID); SWTBotUtils.waitForJobs(); fExpected = ImmutableList.of("40472b", "4045c8", "404412", "", ""); }
Source:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.CALL_EXPR, ctx -> { CallExpression callExpression = (CallExpression) ctx.syntaxNode(); Expression callee = callExpression.callee(); if (!callee.type().canHaveMember("__call__")) { Optional<String> nameOptional = nameFromExpression(callee); if (nameOptional.isPresent()) { ctx.addIssue(callee, String.format("Fix this call; \"%s\" is not callable.", nameOptional.get())); } else { ctx.addIssue(callee, "Fix this call; this expression is not callable."); } } }); }

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.CALL_EXPR, ctx -> { CallExpression callExpression = (CallExpression) ctx.syntaxNode(); Expression callee = callExpression.callee(); InferredType calleeType = callee.type(); if (!calleeType.canHaveMember("__call__") || NON_CALLABLE_TYPES.stream().anyMatch(calleeType::canOnlyBe)) { String name = nameFromExpression(callee); if (name != null) { ctx.addIssue(callee, String.format("Fix this call; \"%s\" is not callable.", name)); } else { ctx.addIssue(callee, "Fix this call; this expression is not callable."); } } }); }
Source:
public List<FeatureTypeStyle> transformInternal(MBStyle styleContext) { PolygonSymbolizer symbolizer; MBStyleTransformer transformer = new MBStyleTransformer(parse); Fill fill; DisplacementImpl displacement = new DisplacementImpl(); displacement.setDisplacementX(getFillExtrusionBase().doubleValue()); displacement.setDisplacementY(getFillExtrusionHeight().doubleValue()); if (getFillExtrusionPattern() != null) { ExternalGraphic eg = transformer.createExternalGraphicForSprite(getFillExtrusionPattern(), styleContext); GraphicFill gf = sf.graphicFill(Arrays.asList(eg), fillExtrusionOpacity(), null, null, null, displacement); fill = sf.fill(gf, null, null); } else { fill = sf.fill(null, fillExtrusionColor(), fillExtrusionOpacity()); } symbolizer = sf.polygonSymbolizer( getId(), ff.property((String)null), sf.description(Text.text("fill"),null), NonSI.PIXEL, null, fill, displacement, ff.literal(0)); MBFilter filter = getFilter(); Rule rule = sf.rule( getId(), null, null, 0.0, Double.POSITIVE_INFINITY, Arrays.asList(symbolizer), filter.filter()); rule.setLegendGraphic(new Graphic[0]); return null; }

Target:
public List<FeatureTypeStyle> transformInternal(MBStyle styleContext) { PolygonSymbolizer symbolizer; MBStyleTransformer transformer = new MBStyleTransformer(parse); Fill fill; DisplacementImpl displacement = new DisplacementImpl(); displacement.setDisplacementX(getFillExtrusionBase().doubleValue()); displacement.setDisplacementY(getFillExtrusionHeight().doubleValue()); if (getFillExtrusionPattern() != null) { ExternalGraphic eg = transformer.createExternalGraphicForSprite(getFillExtrusionPattern(), styleContext); GraphicFill gf = sf.graphicFill(Arrays.asList(eg), fillExtrusionOpacity(), null, null, null, displacement); fill = sf.fill(gf, null, null); } else { fill = sf.fill(null, fillExtrusionColor(), fillExtrusionOpacity()); } symbolizer = sf.polygonSymbolizer( getId(), ff.property((String)null), sf.description(Text.text("fill"),null), NonSI.PIXEL, null, fill, displacement, ff.literal(0)); MBFilter filter = getFilter(); Rule rule = sf.rule( getId(), null, null, 0.0, Double.POSITIVE_INFINITY, Arrays.asList(symbolizer), filter.filter()); rule.setLegendGraphic(new Graphic[0]); return Collections.singletonList(sf.featureTypeStyle( getId(), sf.description( Text.text("MBStyle "+getId()), Text.text("Generated for "+getSourceLayer())), null, Collections.emptySet(), filter.semanticTypeIdentifiers(), Arrays.asList(rule) )); }
Source:
protected boolean canDoAction() { updateVmDisksFromDb(); Snapshot snapshot = getSnapshotDao().get(getParameters().getDstSnapshotId()); SnapshotsValidator snapshotsValidator = new SnapshotsValidator(); VmValidator vmValidator = new VmValidator(getVm()); boolean result = validate(vmValidator.vmDown()) && validate(snapshotsValidator.vmNotDuringSnapshot(getVmId())) && validate(snapshotsValidator.vmNotInPreview(getVmId())) && validate(snapshotsValidator.snapshotExists(snapshot)) && validate(snapshotsValidator.snapshotNotBroken(snapshot)); Collection<DiskImage> diskImages = ImagesHandler.filterImageDisks(getVm().getDiskMap().values(), false, true); if (!diskImages.isEmpty()) { result = result && validate(new StoragePoolValidator(getStoragePool()).isUp()) && ImagesHandler.PerformImagesChecks( getReturnValue().getCanDoActionMessages(), getVm().getStoragePoolId(), Guid.Empty, true, true, false, false, true, true, diskImages); } if (result && LinqUtils.foreach(diskImages, new Function<DiskImage, Guid>() { @Override public Guid eval(DiskImage disk) { return disk.getvm_snapshot_id().getValue(); } }).contains(getParameters().getDstSnapshotId())) { result = false; addCanDoActionMessage(VdcBllMessages.CANNOT_PREIEW_CURRENT_IMAGE); } if (!result) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__PREVIEW); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__SNAPSHOT); } return result; }

Target:
protected boolean canDoAction() { Snapshot snapshot = getSnapshotDao().get(getParameters().getDstSnapshotId()); SnapshotsValidator snapshotsValidator = new SnapshotsValidator(); VmValidator vmValidator = new VmValidator(getVm()); boolean result = validate(vmValidator.vmDown()) && validate(snapshotsValidator.vmNotDuringSnapshot(getVmId())) && validate(snapshotsValidator.vmNotInPreview(getVmId())) && validate(snapshotsValidator.snapshotExists(snapshot)) && validate(snapshotsValidator.snapshotNotBroken(snapshot)); updateVmDisksFromDb(); Collection<DiskImage> diskImages = ImagesHandler.filterImageDisks(getVm().getDiskMap().values(), false, true); if (!diskImages.isEmpty()) { result = result && validate(new StoragePoolValidator(getStoragePool()).isUp()) && ImagesHandler.PerformImagesChecks( getReturnValue().getCanDoActionMessages(), getVm().getStoragePoolId(), Guid.Empty, true, true, false, false, true, true, diskImages); } if (result && LinqUtils.foreach(diskImages, new Function<DiskImage, Guid>() { @Override public Guid eval(DiskImage disk) { return disk.getvm_snapshot_id().getValue(); } }).contains(getParameters().getDstSnapshotId())) { result = false; addCanDoActionMessage(VdcBllMessages.CANNOT_PREIEW_CURRENT_IMAGE); } if (!result) { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__PREVIEW); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__SNAPSHOT); } return result; }
Source:
public void open(Configuration parameters) throws Exception { Preconditions.checkState( getRuntimeContext().getNumberOfParallelSubtasks() == 1, "The parallelism of SocketServerSink must be 1"); initBuffer(); version = UUID.randomUUID().toString(); lastCheckpointId = Long.MIN_VALUE; serverThread = new ServerThread(); serverThread.start(); Preconditions.checkNotNull(eventGateway, "Operator event gateway hasn't been set"); InetSocketAddress address = serverThread.getServerSocketAddress(); LOG.info("Collect sink server established, address = " + address); CollectSinkAddressEvent addressEvent = new CollectSinkAddressEvent(address); eventGateway.sendEventToCoordinator(addressEvent); }

Target:
public void open(Configuration parameters) throws Exception { Preconditions.checkState( getRuntimeContext().getNumberOfParallelSubtasks() == 1, "The parallelism of CollectSinkFunction must be 1"); initBuffer(); version = UUID.randomUUID().toString(); serverThread = new ServerThread(); serverThread.start(); Preconditions.checkNotNull(eventGateway, "Operator event gateway hasn't been set"); InetSocketAddress address = serverThread.getServerSocketAddress(); LOG.info("Collect sink server established, address = " + address); CollectSinkAddressEvent addressEvent = new CollectSinkAddressEvent(address); eventGateway.sendEventToCoordinator(addressEvent); }
Source:
DTLSMessage getNextMessage(Record candidate) throws GeneralSecurityException, HandshakeException { int recordEpoch = candidate.getEpoch(); int sessionEpoch = session.getReadEpoch(); if (recordEpoch == sessionEpoch) { DTLSMessage fragment = candidate.getFragment(); if (fragment == null) { LOGGER.debug("Cannot process message of type [{}], discarding...", candidate.getType()); return null; } if (fragment.getContentType() != ContentType.HANDSHAKE && fragment.getContentType() != ContentType.CHANGE_CIPHER_SPEC) { LOGGER.debug("Drop message of type [{}], discarding...", candidate.getType()); return null; } switch (fragment.getContentType()) { case CHANGE_CIPHER_SPEC: if (isChangeCipherSpecMessageExpected()) { return fragment; } else { LOGGER.debug("Change Cipher Spec is not expected and therefore kept for later processing!"); changeCipherSpec = (ChangeCipherSpecMessage) fragment; return null; } case HANDSHAKE: HandshakeMessage handshakeMessage = (HandshakeMessage) fragment; int messageSeq = handshakeMessage.getMessageSeq(); if (messageSeq == nextReceiveSeq) { return handshakeMessage; } else if (messageSeq > nextReceiveSeq) { LOGGER.debug( "Queued newer message from current epoch, message_seq > next_receive_seq [{}]", messageSeq, nextReceiveSeq); queue.add(candidate); return null; } else { LOGGER.debug("Discarding old message_seq < next_receive_seq [{}]", handshakeMessage.getMessageType(), messageSeq, nextReceiveSeq); return null; } default: LOGGER.debug("Cannot process message of type [{}], discarding...", fragment.getContentType()); return null; } } else { throw new IllegalArgumentException("record epoch " + recordEpoch + " doesn't match session " + sessionEpoch); } }

Target:
DTLSMessage getNextMessage(Record candidate) throws GeneralSecurityException, HandshakeException { int recordEpoch = candidate.getEpoch(); int sessionEpoch = session.getReadEpoch(); if (recordEpoch == sessionEpoch) { DTLSMessage fragment = candidate.getFragment(); switch (fragment.getContentType()) { case CHANGE_CIPHER_SPEC: if (isChangeCipherSpecMessageExpected()) { return fragment; } else { LOGGER.debug("Change Cipher Spec is not expected and therefore kept for later processing!"); changeCipherSpec = (ChangeCipherSpecMessage) fragment; return null; } case HANDSHAKE: HandshakeMessage handshakeMessage = (HandshakeMessage) fragment; int messageSeq = handshakeMessage.getMessageSeq(); if (messageSeq == nextReceiveSeq) { return handshakeMessage; } else if (messageSeq > nextReceiveSeq) { LOGGER.debug( "Queued newer message from current epoch, message_seq > next_receive_seq [{}]", messageSeq, nextReceiveSeq); queue.add(candidate); return null; } else { LOGGER.debug("Discarding old message_seq < next_receive_seq [{}]", handshakeMessage.getMessageType(), messageSeq, nextReceiveSeq); return null; } default: LOGGER.warn("Cannot process message of type [{}], discarding...", fragment.getContentType()); return null; } } else { throw new IllegalArgumentException("record epoch " + recordEpoch + " doesn't match session " + sessionEpoch); } }
Source:
public void dispose () { if (screen != null) screen.hide(); if (nextScreen != null) nextScreen.hide(); }

Target:
public void dispose () { if (screen != null) screen.hide(); if (nextScreen != null) nextScreen.hide(); this.currentScreenFBO.dispose(); this.nextScreenFBO.dispose(); }
Source:
private static void validateValue(Object value) { Class<?> clazz = value.getClass(); if (simples.contains(clazz)) return; if (simpleArrays.contains(clazz) || primitiveArrays.contains(clazz)) return; if (value instanceof Collection) { for (Object name : (Collection<?>) value) { Class<?> containedClazz = name.getClass(); if (!simples.contains(containedClazz)) { throw new IllegalArgumentException(containedClazz.getName() + " in " + clazz.getName()); } } return; } throw new IllegalArgumentException(clazz.getName()); }

Target:
private static void validateValue(Object value) { Class<?> clazz = value.getClass(); if (simples.contains(clazz)) return; if (simpleArrays.contains(clazz) || primitiveArrays.contains(clazz)) return; if (value instanceof Collection) { for (Object simple : (Collection<?>) value) { Class<?> containedClazz = simple.getClass(); if (!simples.contains(containedClazz)) { throw new IllegalArgumentException(containedClazz.getName() + " in " + clazz.getName()); } } return; } throw new IllegalArgumentException(clazz.getName()); }