auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void initEvictor() { MapEvictionPolicy mapEvictionPolicy = mapConfig.getMapEvictionPolicy(); if (mapEvictionPolicy == null) { evictor = NULL_EVICTOR; } else { MemoryInfoAccessor memoryInfoAccessor = getMemoryInfoAccessor(); EvictionChecker evictionChecker = new EvictionChecker(memoryInfoAccessor, mapServiceContext); IPartitionService partitionService = mapServiceContext.getNodeEngine().getPartitionService(); evictor = new EvictorImpl(mapEvictionPolicy, evictionChecker, partitionService); } }

Target:
public void initEvictor() { MapEvictionPolicy mapEvictionPolicy = mapConfig.getMapEvictionPolicy(); if (mapEvictionPolicy == null) { evictor = NULL_EVICTOR; } else { MemoryInfoAccessor memoryInfoAccessor = getMemoryInfoAccessor(); EvictionChecker evictionChecker = new EvictionChecker(memoryInfoAccessor, mapServiceContext); NodeEngine nodeEngine = mapServiceContext.getNodeEngine(); IPartitionService partitionService = nodeEngine.getPartitionService(); int batchSize = nodeEngine.getProperties().getInteger(MAP_EVICTION_BATCH_SIZE); evictor = new EvictorImpl(mapEvictionPolicy, evictionChecker, partitionService, batchSize); } }
Source:
public static Set<Evidence> getEvidencesByUUIDs(Set<String> uuids) { synEvidences(); Set<Evidence> mappedEvis = new HashSet<>(); if (uuids != null) { for (Map.Entry<Integer, Set<Evidence>> map : evidences.entrySet()) { for (Evidence evidence : map.getValue()) { if (uuids.contains(evidence.getUuid())) { mappedEvis.add(evidence); } } } } return mappedEvis; }

Target:
public static Set<Evidence> getEvidencesByUUIDs(Set<String> uuids) { synEvidences(); Set<Evidence> mappedEvis = new HashSet<>(); if (uuids != null) { for (Map.Entry<Integer, Set<Evidence>> map : evidences.entrySet()) { for (Evidence evidence : map.getValue()) { if (evidence != null && uuids.contains(evidence.getUuid())) { mappedEvis.add(evidence); } } } } return mappedEvis; }
Source:
private void createBigDir(final String path) throws IOException { final String verylongprefix = "123123123123123123123123123123123113123111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "11231312312312312312313121111111111111111111111111111111111111111111111111"; for (int i = 1; i <= 400; i++) { final File tmpDir = new File(path + "/" + verylongprefix + "dir" + i); tmpDir.mkdir(); for (int j = 1; j <= 100; j++) { final File tmp = new File(tmpDir.getAbsolutePath() + "/" + j); tmp.createNewFile(); } } }

Target:
private void createBigDir(final String path) throws IOException { final String verylongprefix = "123123123123123123123123123123123113123111111111111111111111111111111111111111111111111111" + "111111111111111111111111111111111111111111111111111111111111111111111111111111111111" + "11231312312312312312313121111111111111111111111111111111111111111111111111"; for (int i = 1; i <= 400; i++) { final Path tmpDirPath = Paths.get(path, verylongprefix + "dir" + i); Files.createDirectory(tmpDirPath); for (int j = 1; j <= 100; j++) { final Path tmp = Paths.get(tmpDirPath.toAbsolutePath().toString(), String.valueOf(j)); Files.createFile(tmp); } } }
Source:
void initHighlighting(File file) { InputFile inputFile = fileSystem.inputFile(fileSystem.predicates().is(file)); if (inputFile == null) { throw new IllegalArgumentException("Cannot get " + Highlightable.class.getCanonicalName() + " for a null file"); } Highlightable highlightable = resourcePerspectives.as(Highlightable.class, inputFile); if (highlightable == null) { throw new IllegalStateException("Could not get " + Highlightable.class.getCanonicalName() + " for " + inputFile); } this.highlighting = highlightable.newHighlighting(); this.offsets = new SourceFileOffsets(file, fileSystem.encoding()); }

Target:
private HighlightingBuilder initHighlighting(File file) { InputFile inputFile = fileSystem.inputFile(fileSystem.predicates().is(file)); if (inputFile == null) { throw new IllegalArgumentException("Cannot get " + Highlightable.class.getCanonicalName() + " for a null file"); } Highlightable highlightable = resourcePerspectives.as(Highlightable.class, inputFile); if (highlightable == null) { LOG.warn("Could not get " + Highlightable.class.getCanonicalName() + " for " + inputFile.file()); return null; } else { highlighting = highlightable.newHighlighting(); offsets = new SourceFileOffsets(file, fileSystem.encoding()); return this.highlighting; } }
Source:
protected ICommand getAfterMoveCommand(final MoveRequest request) { ICommand moveCommand = super.getAfterMoveCommand(request); Set<View> viewsToDestroy = new HashSet<View>(); Object parameter = request.getParameter(DefaultCreationEditPolicy.TYPE_MOVING); if ((null == parameter) || (!DefaultCreationEditPolicy.TYPE_MOVING_DIAGRAM.equals(parameter))) { @SuppressWarnings("unchecked") Iterator<EObject> it = request.getElementsToMove().keySet().iterator(); while (it.hasNext()) { EObject eObject = it.next(); viewsToDestroy.addAll(getMemberViewsToDestroy(eObject)); } Iterator<View> viewToDestroyIterator = viewsToDestroy.iterator(); while (viewToDestroyIterator.hasNext()) { View view = viewToDestroyIterator.next(); DeleteCommand destroyViewsCommand = new DeleteCommand(request.getEditingDomain(), view); moveCommand = CompositeCommand.compose(moveCommand, destroyViewsCommand); } } return moveCommand; }

Target:
protected ICommand getAfterMoveCommand(final MoveRequest request) { ICommand moveCommand = super.getAfterMoveCommand(request); Set<View> viewsToDestroy = new HashSet<View>(); Object parameter = request.getParameter(RequestParameterConstants.TYPE_MOVING); if ((null == parameter) || (!RequestParameterConstants.TYPE_MOVING_DIAGRAM.equals(parameter))) { @SuppressWarnings("unchecked") Iterator<EObject> it = request.getElementsToMove().keySet().iterator(); while (it.hasNext()) { EObject eObject = it.next(); viewsToDestroy.addAll(getMemberViewsToDestroy(eObject)); } Iterator<View> viewToDestroyIterator = viewsToDestroy.iterator(); while (viewToDestroyIterator.hasNext()) { View view = viewToDestroyIterator.next(); DeleteCommand destroyViewsCommand = new DeleteCommand(request.getEditingDomain(), view); moveCommand = CompositeCommand.compose(moveCommand, destroyViewsCommand); } } return moveCommand; }
Source:
private Map<String, LookupExtractorFactoryContainer> tryGetLookupListFromCoordinator(String tier) throws Exception { final FullResponseHolder response = fetchLookupsForTier(tier); if (!response.getStatus().equals(HttpResponseStatus.OK)) { LOG.error( "Error while fetching lookup code from Coordinator with status[%s] and content[%s]", response.getStatus(), response.getContent() ); throw new Exception(); } if (response.getContent().startsWith("[")) { LOG.info( "Failed to retrieve lookup information from coordinator. " + "Attempting to load lookups using snapshot instead" ); return null; } else { return jsonMapper.readValue(response.getContent(), LOOKUPS_ALL_REFERENCE); } }

Target:
private Map<String, LookupExtractorFactoryContainer> tryGetLookupListFromCoordinator(String tier) throws Exception { final FullResponseHolder response = fetchLookupsForTier(tier); if (response.getStatus().equals(HttpResponseStatus.NOT_FOUND)) { LOG.warn("No lookups found for tier [%s], response [%s]", tier, response); return null; } else if (!response.getStatus().equals(HttpResponseStatus.OK)) { throw new IOE( "Error while fetching lookup code from Coordinator with status[%s] and content[%s]", response.getStatus(), response.getContent() ); } if (response.getContent().startsWith("[")) { LOG.info( "Failed to retrieve lookup information from coordinator, " + "because coordinator appears to be running on older Druid version. " + "Attempting to load lookups using snapshot instead" ); return null; } else { return jsonMapper.readValue(response.getContent(), LOOKUPS_ALL_REFERENCE); } }
Source:
void runTest(WindupProcessor processor, GraphContext graphContext, String inputPath, boolean sourceMode) throws Exception { Assert.assertNotNull(processor); Assert.assertNotNull(processor.toString()); WindupConfigurationModel windupCfg = graphContext.getFramed().addVertex(null, WindupConfigurationModel.class); windupCfg.setInputPath(inputPath); windupCfg.setSourceMode(sourceMode); Path outputPath = Paths.get(FileUtils.getTempDirectory().toString(), "windupreport"); FileUtils.deleteDirectory(outputPath.toFile()); Files.createDirectories(outputPath); windupCfg.setOutputPath(outputPath.toAbsolutePath().toString()); windupCfg.setSourceMode(false); try { processor.execute(); } finally { for (Vertex v : graphContext.getGraph().getVertices()) { v.remove(); } for (Edge e : graphContext.getGraph().getEdges()) { e.remove(); } } }

Target:
void runTest(WindupProcessor processor, GraphContext graphContext, String inputPath, boolean sourceMode) throws Exception { Assert.assertNotNull(processor); Assert.assertNotNull(processor.toString()); WindupConfigurationModel windupCfg = graphContext.getFramed().addVertex(null, WindupConfigurationModel.class); windupCfg.setInputPath(inputPath); windupCfg.setSourceMode(sourceMode); Path outputPath = Paths.get(FileUtils.getTempDirectory().toString(), "windupreport"); FileUtils.deleteDirectory(outputPath.toFile()); Files.createDirectories(outputPath); windupCfg.setOutputPath(outputPath.toAbsolutePath().toString()); windupCfg.setSourceMode(false); processor.execute(); }
Source:
private void fillReadAheadCache(long orginalLedgerId, long firstEntryId, long firstEntryLocation) { try { long firstEntryLogId = (firstEntryLocation >> 32); long currentEntryLogId = firstEntryLogId; long currentEntryLocation = firstEntryLocation; int count = 0; long size = 0; while (count < readAheadCacheBatchSize && currentEntryLogId == firstEntryLogId) { ByteBuf entry = entryLogger.internalReadEntry(orginalLedgerId, -1, currentEntryLocation); long currentEntryLedgerId = entry.getLong(0); long currentEntryId = entry.getLong(8); if (currentEntryLedgerId != orginalLedgerId) { entry.release(); return; } readCache.put(orginalLedgerId, currentEntryId, entry); count++; size += entry.readableBytes(); currentEntryLocation += 4 + entry.readableBytes(); currentEntryLogId = currentEntryLocation >> 32; entry.release(); } readAheadBatchCountStats.registerSuccessfulValue(count); readAheadBatchSizeStats.registerSuccessfulValue(size); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Exception during read ahead for ledger: {}: e", orginalLedgerId, e); } } }

Target:
private void fillReadAheadCache(long orginalLedgerId, long firstEntryId, long firstEntryLocation) { try { long firstEntryLogId = (firstEntryLocation >> 32); long currentEntryLogId = firstEntryLogId; long currentEntryLocation = firstEntryLocation; int count = 0; long size = 0; while (count < readAheadCacheBatchSize && currentEntryLogId == firstEntryLogId) { ByteBuf entry = entryLogger.internalReadEntry(orginalLedgerId, -1, currentEntryLocation); try { long currentEntryLedgerId = entry.getLong(0); long currentEntryId = entry.getLong(8); if (currentEntryLedgerId != orginalLedgerId) { entry.release(); return; } readCache.put(orginalLedgerId, currentEntryId, entry); count++; size += entry.readableBytes(); currentEntryLocation += 4 + entry.readableBytes(); currentEntryLogId = currentEntryLocation >> 32; } finally { entry.release(); } } readAheadBatchCountStats.registerSuccessfulValue(count); readAheadBatchSizeStats.registerSuccessfulValue(size); } catch (Exception e) { if (log.isDebugEnabled()) { log.debug("Exception during read ahead for ledger: {}: e", orginalLedgerId, e); } } }
Source:
public MutableList<String> split( String self, String sep, Object maxSplitO, Location loc, Environment env) throws EvalException { if (sep.isEmpty()) { throw new EvalException(loc, "Empty separator"); } int maxSplit = Integer.MAX_VALUE; if (maxSplitO != Runtime.NONE) { maxSplit = (Integer) maxSplitO; } List<String> res = new ArrayList<>(); int start = 0; while (true) { int end = self.indexOf(sep, start); if (end < 0 || maxSplit-- == 0) { res.add(self.substring(start)); break; } res.add(self.substring(start, end)); start = end + sep.length(); } return MutableList.copyOf(env, res); }

Target:
public MutableList<String> split( String self, String sep, Object maxSplitO, Location loc, Environment env) throws EvalException { if (sep.isEmpty()) { throw new EvalException(loc, "Empty separator"); } int maxSplit = Integer.MAX_VALUE; if (maxSplitO != Runtime.NONE) { maxSplit = (Integer) maxSplitO; } ArrayList<String> res = new ArrayList<>(); int start = 0; while (true) { int end = self.indexOf(sep, start); if (end < 0 || maxSplit-- == 0) { res.add(self.substring(start)); break; } res.add(self.substring(start, end)); start = end + sep.length(); } return MutableList.wrapUnsafe(env, res); }
Source:
protected void verifyOutput(PermissionBlueprintInfo source, PermissionBlueprintDTO dest, boolean childrenGenerated) { if (source != null) { assertNull(dest.getId()); assertEquals(source.getTypeName(), dest.getType()); assertEquals(source.getAccessLevel(), dest.getAccess()); if (childrenGenerated) { OwnerDTO ownerDTO = new OwnerDTO(); ownerDTO.setId(dest.getOwner().getId()); ownerDTO.setKey(dest.getOwner().getKey()); ownerDTO.setDisplayName(dest.getOwner().getDisplayName()); this.ownerTranslatorTest.verifyOutput(source.getOwner(), ownerDTO, true); } else { assertNull(dest.getOwner()); } } else { assertNull(dest); } }

Target:
protected void verifyOutput(PermissionBlueprintInfo source, PermissionBlueprintDTO dest, boolean childrenGenerated) { if (source != null) { assertNull(dest.getId()); assertEquals(source.getTypeName(), dest.getType()); assertEquals(source.getAccessLevel(), dest.getAccess()); if (source.getOwner() != null && dest.getOwner() != null) { assertEquals(source.getOwner().getKey(), dest.getOwner().getKey()); } } else { assertNull(dest); } }
Source:
public void testView() throws Exception { try { methodWatcher.executeUpdate("create view v1 as (select a1 from showcreatetableit.t1)"); methodWatcher.execute("call syscs_util.SHOW_CREATE_TABLE('SYS','SYSTABLES')"); Assert.fail("Expected to fail"); } catch (SQLException e) { String sqlState = e.getSQLState(); Assert.assertEquals("42X62",sqlState); } }

Target:
public void testView() throws Exception { try { methodWatcher.executeUpdate("create view showcreatetableit.v1 as (select a1 from showcreatetableit.t1)"); methodWatcher.execute("call syscs_util.SHOW_CREATE_TABLE('SHOWCREATETABLEIT','V1')"); Assert.fail("Expected to fail"); } catch (SQLException e) { String sqlState = e.getSQLState(); Assert.assertEquals("42Y62",sqlState); } }
Source:
public void postProcess(ServerResponse response) { if (current.get(MetaData.class).hasKey("async") && Boolean.TRUE.equals((Boolean) current.get(MetaData.class).get("async"))) { SessionUtils.getCurrentHttpServletRequest().setAttribute("ovirt_aaa_restapi_async", true); } sessionHelper.clean(); }

Target:
public void postProcess(ServerResponse response) { if (Boolean.TRUE.equals((Boolean) current.get(MetaData.class).get("async"))) { request.setAttribute(SessionConstants.REQUEST_ASYNC_KEY, true); } sessionHelper.clean(); }
Source:
public void bindTo(MeterRegistry registry) { successResponseCounter = Counter.builder("che.server.api.response.success") .description("Che Server Tomcat success responses (2xx responses)") .tags("code=200", "area=http") .register(registry); redirectResponseCounter = Counter.builder("che.server.api.response.redirect") .description("Che Server Tomcat redirect responses (3xx responses)") .tags("code=300", "area=http") .register(registry); clientErrorResponseCounter = Counter.builder("che.server.api.response.client.error") .description("Che Server Tomcat client errors (4xx responses)") .tags("code=400", "area=http") .register(registry); serverErrorResponseCounter = Counter.builder("che.server.api.response.server.error") .description("Che Server Tomcat server errors (5xx responses)") .tags("code=500", "area=http") .register(registry); }

Target:
public void bindTo(MeterRegistry registry) { informationalResponseCounter = Counter.builder("che.server.api.response") .description("Che Server Tomcat informational responses (1xx responses)") .tag("code", "1xx") .tag("area", "http") .register(registry); successResponseCounter = Counter.builder("che.server.api.response") .description("Che Server Tomcat success responses (2xx responses)") .tag("code", "2xx") .tag("area", "http") .register(registry); redirectResponseCounter = Counter.builder("che.server.api.response") .description("Che Server Tomcat redirect responses (3xx responses)") .tag("code", "3xx") .tag("area", "http") .register(registry); clientErrorResponseCounter = Counter.builder("che.server.api.response") .description("Che Server Tomcat client errors (4xx responses)") .tag("code", "4xx") .tag("area", "http") .register(registry); serverErrorResponseCounter = Counter.builder("che.server.api.response") .description("Che Server Tomcat server errors (5xx responses)") .tag("code", "5xx") .tag("area", "http") .register(registry); }
Source:
public void testArchiveWithLongFilename() throws Exception { StringBuilder filename = new StringBuilder(""); List<String> l = new ArrayList<String>(); for (int i = 0; i < 20; i++) { filename.append("1234567890/"); l.add(filename.toString()); } filename.append("1234567890"); l.add(filename.toString()); writeTrashFile(filename.toString(), "file with long path"); git.add().addFilepattern("1234567890").call(); git.commit().setMessage("file with long name").call(); byte[] result = CLIGitCommand.executeRaw( "git archive --format=zip HEAD", db).outBytes(); assertArrayEquals(l.toArray(new String[l.size()]), listZipEntries(result)); }

Target:
public void testArchiveWithLongFilename() throws Exception { StringBuilder filename = new StringBuilder(); List<String> l = new ArrayList<String>(); for (int i = 0; i < 20; i++) { filename.append("1234567890/"); l.add(filename.toString()); } filename.append("1234567890"); l.add(filename.toString()); writeTrashFile(filename.toString(), "file with long path"); git.add().addFilepattern("1234567890").call(); git.commit().setMessage("file with long name").call(); byte[] result = CLIGitCommand.executeRaw( "git archive --format=zip HEAD", db).outBytes(); assertArrayEquals(l.toArray(new String[l.size()]), listZipEntries(result)); }
Source:
public List<IDockerImageListener> getImageListeners() { final IDockerImageListener[] listeners = new IDockerImageListener[this.imageListeners .size()]; for (int i = 0; i < imageListeners.getListeners().length; i++) { listeners[i] = (IDockerImageListener) imageListeners .getListeners()[i]; } return Arrays.asList(listeners); }

Target:
public List<IDockerImageListener> getImageListeners() { final IDockerImageListener[] result = new IDockerImageListener[this.imageListeners .size()]; final Object[] listeners = imageListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { result[i] = (IDockerImageListener) listeners[i]; } return Arrays.asList(result); }
Source:
public static String stripReferer ( HttpServletRequest request, String referer ) throws IllegalArgumentException { if(referer==null) return referer; String ref = referer; if(Config.getBooleanProperty("DISABLE_EXTERNAL_REFERERS", false) && ref.contains("://")) { try { User systemUser = APILocator.getUserAPI().getSystemUser(); URL url = new URL( referer ); String refererHost = url.getHost(); String serverName = request.getServerName(); } catch ( Exception e ) { throw new IllegalArgumentException( "Error validating URL " + referer, e ); } } ref = Xss.strip(ref); if(ref.contains("%0d") || ref.contains("%0a")) ref = "/"; return ref; }

Target:
public static String stripReferer ( HttpServletRequest request, String referer ) throws IllegalArgumentException { if(referer==null) return referer; String ref = referer; ref = Xss.strip(ref); if(ref.contains("%0d") || ref.contains("%0a")) ref = "/"; return ref; }
Source:
private Object mapFollowUpResourceToField(Resource resource, ValueMap valueMap, Field field, String propertyName) { final Class<?> fieldType = field.getType(); Object value = valueMap.get(propertyName); if (value == null) { if (LOG.isDebugEnabled()) { LOG.debug( "the property [{}/{}] is undefined, assigning null value for [{}#{}]", new Object[] { resource.getPath(), propertyName, fieldType.getCanonicalName(), field.getName() }); } return null; } if (!(value instanceof String)) { if (LOG.isDebugEnabled()) { LOG.debug( "the property [{}/{}] annotated is not of String type as required by " + "@JcrProperty(..., follow = true) in the model, assigning null " + "value for [{}#{}]", new Object[] { resource.getPath(), propertyName, fieldType.getCanonicalName(), field.getName() }); } return null; } String nestedResourcePath = (String) value; Resource followUpResource = resource.getResourceResolver().getResource(nestedResourcePath); if (followUpResource == null) { if (LOG.isDebugEnabled()) { LOG.debug( "the nested resource [{}/{}] expected under path doesn't exist, " + "assigning null value for [{}#{}]", new Object[] { resource.getPath(), propertyName, nestedResourcePath, fieldType.getCanonicalName(), field.getName() }); } return null; } return modelProvider.get(fieldType, followUpResource); }

Target:
private Object mapFollowUpResourceToField(Resource resource, ValueMap valueMap, Field field, String propertyName) { final Class<?> fieldType = field.getType(); Resource followUpResource = FollowUpProcessorUtil.getFollowUpResource(resource, valueMap, field, propertyName); return modelProvider.get(fieldType, followUpResource); }
Source:
protected static String[] handleNodeLabeling(String[] argArray) { Configuration conf = new Configuration(); boolean nodeLabelingYarn = conf.getBoolean(YARN_CONF_NODE_LABELING_ENABLED, false); String nodeLabelingProp = System.getenv(HadoopSparkJob.SPARK_NODE_LABELING_ENV_VAR); boolean nodeLabelingPolicy = nodeLabelingProp != null && nodeLabelingProp.equals(Boolean.TRUE.toString()); String autoNodeLabelProp = System.getenv(HadoopSparkJob.SPARK_AUTO_NODE_LABELING_ENV_VAR); boolean autoNodeLabeling = autoNodeLabelProp != null && autoNodeLabelProp.equals(Boolean.TRUE.toString()); String desiredNodeLabel = System.getenv(HadoopSparkJob.SPARK_DESIRED_NODE_LABEL_ENV_VAR); SparkConf sparkConf = getSparkProperties(); if (nodeLabelingYarn && nodeLabelingPolicy) { ignoreUserSpecifiedNodeLabelParameter(argArray, autoNodeLabeling); int queueParameterIndex = getUserSpecifiedQueueParameterIndex(argArray); if (queueParameterIndex != -1) { logger.info( "Azbakan enforces node labeling. Ignore user param: " + argArray[queueParameterIndex] + " " + argArray[ queueParameterIndex + 1]); argArray[queueParameterIndex] = null; argArray[queueParameterIndex + 1] = null; } if (autoNodeLabeling) { if (isLargeContainerRequired(argArray, conf, sparkConf)) { LinkedList<String> argList = new LinkedList<String>(Arrays.asList(argArray)); argList.addFirst(SPARK_EXECUTOR_NODE_LABEL_EXP + "=" + desiredNodeLabel); argList.addFirst(SparkJobArg.SPARK_CONF_PREFIX.sparkParamName); argArray = argList.toArray(new String[argList.size()]); } } } return argArray; }

Target:
protected static String[] handleNodeLabeling(String[] argArray) { Configuration conf = new Configuration(); boolean nodeLabelingYarn = conf.getBoolean(YARN_CONF_NODE_LABELING_ENABLED, false); String nodeLabelingProp = System.getenv(HadoopSparkJob.SPARK_NODE_LABELING_ENV_VAR); boolean nodeLabelingPolicy = nodeLabelingProp != null && nodeLabelingProp.equals(Boolean.TRUE.toString()); String autoNodeLabelProp = System.getenv(HadoopSparkJob.SPARK_AUTO_NODE_LABELING_ENV_VAR); boolean autoNodeLabeling = autoNodeLabelProp != null && autoNodeLabelProp.equals(Boolean.TRUE.toString()); String desiredNodeLabel = System.getenv(HadoopSparkJob.SPARK_DESIRED_NODE_LABEL_ENV_VAR); SparkConf sparkConf = getSparkProperties(); if (nodeLabelingYarn && nodeLabelingPolicy) { ignoreUserSpecifiedNodeLabelParameter(argArray, autoNodeLabeling); if (autoNodeLabeling) { if (isLargeContainerRequired(argArray, conf, sparkConf)) { LinkedList<String> argList = new LinkedList<String>(Arrays.asList(argArray)); argList.addFirst(SPARK_EXECUTOR_NODE_LABEL_EXP + "=" + desiredNodeLabel); argList.addFirst(SparkJobArg.SPARK_CONF_PREFIX.sparkParamName); argArray = argList.toArray(new String[argList.size()]); } } } return argArray; }
Source:
public void export_dir_button_opens_a_file_dialog() { component = ConfigurationPanelPageObject.setUpDefaultPanel(robot(), empty().build(), true); component.show(); component.clickChooseExportDirButton(); assertThat(component.fileDialog(2000), is(GenericUIMatchers.visible())); component.cancelFileDialog(); }

Target:
public void export_dir_button_opens_a_file_dialog() { component = ConfigurationPanelPageObject.setUpDefaultPanel(robot(), empty().build(), true, true); component.show(); component.clickChooseExportDirButton(); assertThat(component.fileDialog(2000), is(GenericUIMatchers.visible())); component.cancelFileDialog(); }
Source:
private void startTrackingService(boolean checkPermission, boolean permission) { if (checkPermission) { Set<String> missingPermissions = new HashSet<>(); if (!hasPermission(Manifest.permission.ACCESS_FINE_LOCATION)) { missingPermissions.add(Manifest.permission.ACCESS_FINE_LOCATION); } if (!hasPermission(Manifest.permission.ACCESS_COARSE_LOCATION)) { missingPermissions.add(Manifest.permission.ACCESS_COARSE_LOCATION); } if (missingPermissions.isEmpty()) { permission = true; } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { requestPermissions(missingPermissions.toArray(new String[missingPermissions.size()]), PERMISSIONS_REQUEST_LOCATION); } return; } } if (permission) { setPreferencesEnabled(false); startService(new Intent(this, TrackingService.class)); alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, 15000, 15000, alarmIntent); String locationProviders = Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED); if (locationProviders == null || locationProviders.equals("")) { displayPromptForEnablingGPS(this); } } else { sharedPreferences.edit().putBoolean(KEY_STATUS, false).commit(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { TwoStatePreference preference = (TwoStatePreference) findPreference(KEY_STATUS); preference.setChecked(false); } else { CheckBoxPreference preference = (CheckBoxPreference) findPreference(KEY_STATUS); preference.setChecked(false); } } }

Target:
private void startTrackingService(boolean checkPermission, boolean permission) { if (checkPermission) { Set<String> missingPermissions = new HashSet<>(); if (!hasPermission(Manifest.permission.ACCESS_FINE_LOCATION)) { missingPermissions.add(Manifest.permission.ACCESS_FINE_LOCATION); } if (!hasPermission(Manifest.permission.ACCESS_COARSE_LOCATION)) { missingPermissions.add(Manifest.permission.ACCESS_COARSE_LOCATION); } if (missingPermissions.isEmpty()) { permission = true; } else { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { requestPermissions(missingPermissions.toArray(new String[missingPermissions.size()]), PERMISSIONS_REQUEST_LOCATION); } return; } } if (permission) { setPreferencesEnabled(false); startService(new Intent(this, TrackingService.class)); alarmManager.setInexactRepeating(AlarmManager.ELAPSED_REALTIME_WAKEUP, 15000, 15000, alarmIntent); if (TextUtils.isEmpty(Settings.Secure.getString(getContentResolver(), Settings.Secure.LOCATION_PROVIDERS_ALLOWED))) { promptForEnablingLocationService(this); } } else { sharedPreferences.edit().putBoolean(KEY_STATUS, false).commit(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { TwoStatePreference preference = (TwoStatePreference) findPreference(KEY_STATUS); preference.setChecked(false); } else { CheckBoxPreference preference = (CheckBoxPreference) findPreference(KEY_STATUS); preference.setChecked(false); } } }
Source:
public Response copy(Action action) { validateParameters(action, "storageDomain.id|name"); Guid storageDomainId = getStorageDomainId(action); Disk disk = get(); Guid imageId = asGuid(disk.getImageId()); Guid sourceStorageDomainId = getSourceStorageDomainId(disk); MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(imageId, sourceStorageDomainId, storageDomainId, ImageOperation.Copy); params.setImageGroupID(asGuid(disk.getId())); if (action.isSetName() && !StringUtils.isEmpty(action.getName())) { params.setNewAlias(action.getName()); } return doAction(VdcActionType.MoveOrCopyDisk, params, action); }

Target:
public Response copy(Action action) { validateParameters(action, "storageDomain.id|name"); Guid storageDomainId = getStorageDomainId(action); Disk disk = get(); Guid imageId = asGuid(disk.getImageId()); Guid sourceStorageDomainId = getSourceStorageDomainId(disk); MoveOrCopyImageGroupParameters params = new MoveOrCopyImageGroupParameters(imageId, sourceStorageDomainId, storageDomainId, ImageOperation.Copy); params.setImageGroupID(asGuid(disk.getId())); Disk actionDisk = action.getDisk(); if (actionDisk != null) { String name = actionDisk.getName(); String alias = actionDisk.getAlias(); if (name != null && !StringUtils.isEmpty(name)) { params.setNewAlias(name); } else if (alias != null && !StringUtils.isEmpty(alias)) { params.setNewAlias(alias); } } return doAction(VdcActionType.MoveOrCopyDisk, params, action); }
Source:
public void deleteWorkbookDefinition() throws Exception { respondWith(204); HttpResponse resp = service.delete("my_wb"); assertEquals(resp.getStatus(), 204); }

Target:
public void deleteWorkbookDefinition() throws Exception { respondWith(204); ActionResponse resp = service.delete("my_wb"); assertEquals(resp.getCode(), 200); }
Source:
private void handleVersionUpgrades(Connection conn, Long schemaID, int version) throws SQLException, InvalidSchemaError { boolean shouldResave = false; if ( version < 1 ) { if ( this.schema != null && this.schema.findDatabase("mysql") == null ) { LOGGER.info("Could not find mysql db, adding it to schema"); SchemaCapturer sc = new SchemaCapturer(conn, sensitivity, "mysql"); Database db = sc.capture().findDatabase("mysql"); this.schema.addDatabase(db); this.shouldSnapshotNextSchema = true; } fixUnsignedColumns(conn); } }

Target:
private void handleVersionUpgrades(Connection conn, Long schemaID, int version) throws SQLException, InvalidSchemaError { if ( version < 1 ) { if ( this.schema != null && this.schema.findDatabase("mysql") == null ) { LOGGER.info("Could not find mysql db, adding it to schema"); SchemaCapturer sc = new SchemaCapturer(conn, sensitivity, "mysql"); Database db = sc.capture().findDatabase("mysql"); this.schema.addDatabase(db); this.shouldSnapshotNextSchema = true; } fixUnsignedColumns(conn); } }
Source:
private IProject getOrCreateProject(String name, Connection connection) { IProject project = OpenShiftResourceUtils.getProject(name, connection); if (project == null) { LOGGER.debug(NLS.bind("Project {0} doesnt exist yet in {1}, creating it.", name, connection.getHost())); project = createProject(projectSpec, connection); } return project; }

Target:
private IProject getOrCreateProject(String name, Connection connection) { IProject project = OpenShiftResourceUtils.getProject(name, connection); if (project == null) { LOGGER.debug(NLS.bind("Project {0} doesnt exist yet in {1}, creating it.", name, connection.getHost())); project = createProject(name, projectSpec, connection); new WaitUntil(new OpenShiftProjectExists(name, connection)); } return project; }
Source:
public void run() { try { Throwable t = createThrowable(); ExceptionUtil.<Error>sneakyThrow(t); } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { ExceptionUtil.<Error>sneakyThrow(e); } }

Target:
public void run() { ExceptionUtil.<Error>sneakyThrow(mThrowable); }
Source:
public void deleteResultsCollection(Collection<AsyncQuery> asyncQueryList) { log.debug("deleteResultsCollection"); Collection<AsyncQueryResultStorage> asyncQueryResultStorage = null; try { asyncQueryResultStorage = (Collection<AsyncQueryResultStorage>) DBUtil.executeInTransaction(elide, dataStore, (tx, scope) -> { EntityProjection asyncQueryCollection = EntityProjection.builder() .type(AsyncQueryResultStorage.class) .build(); Iterator<AsyncQuery> itr = asyncQueryList.iterator(); Object loaded = null; while (itr.hasNext()) { AsyncQuery query = itr.next(); loaded = tx.loadObject(asyncQueryCollection, query.getId(), scope); Object result = loaded; if (result != null) { tx.delete(result, scope); } } return loaded; }); } catch (Exception e) { log.error("Exception: {}", e); } }

Target:
public void deleteResultsCollection(Collection<AsyncQuery> asyncQueryList) { log.debug("deleteAsyncQueryResultsCollection"); }
Source:
public Seq<Tuple2<TopicPartition, FetchResponse.PartitionData<Records>>> fetchFromLeader(FetchRequest.Builder fetchRequest) { return JavaConverters.asScalaIteratorConverter(new ArrayList<Tuple2<TopicPartition, FetchResponse.PartitionData<Records>>>().iterator()).asScala().toSeq(); }

Target:
public Map<TopicPartition, FetchResponse.PartitionData<Records>> fetchFromLeader(FetchRequest.Builder fetchRequest) { return new scala.collection.mutable.HashMap<>(); }
Source:
public List<Object> getArticles(HomeController context, SectionSpec section, Site site, int start) throws IOException { Map<?, ?> result = context.solrSearchService.getHomePageArticles( Collections.singletonList(site.getJournalKey()), start, section.resultCount, SolrSearchService.SolrSortOrder.DATE_NEWEST_FIRST); return sanitizeSolrResults(result); }

Target:
public List<Object> getArticles(HomeController context, SectionSpec section, Site site, int start) throws IOException { Map<?, ?> result = context.solrSearchService.getHomePageArticles(site.getJournalKey(), start, section.resultCount, SolrSearchService.SolrSortOrder.DATE_NEWEST_FIRST); return sanitizeSolrResults(result); }
Source:
private void updateWithParameters(ClusterConfig clusterConfig) { clusterConfig.setExposePorts(isExposedHostPorts()); clusterConfig.setTimeout(getTimeout()); ZooKeeperConfig zooKeeperConfig = (clusterConfig.getZookeeper() != null) ? clusterConfig.getZookeeper() : new ZooKeeperConfig(); zooKeeperConfig.setImageTag(getZooKeeperImageTag()); clusterConfig.setZookeeper(zooKeeperConfig); MesosMasterConfig masterConfig = (clusterConfig.getMaster() != null) ? clusterConfig.getMaster() : new MesosMasterConfig(); masterConfig.setImageTag(getMesosImageTag()); masterConfig.setLoggingLevel(clusterConfig.getLoggingLevel()); clusterConfig.setMaster(masterConfig); MarathonConfig marathonConfig = (clusterConfig.getMarathon() != null) ? clusterConfig.getMarathon() : new MarathonConfig(); marathonConfig.setImageTag(getMarathonImageTag()); clusterConfig.setMarathon(marathonConfig); List<MesosAgentConfig> agentConfigs = clusterConfig.getAgents(); List<MesosAgentConfig> updatedConfigs = new ArrayList<>(); for (int i = 0; i < getNumAgents(); i++) { MesosAgentConfig agentConfig = (agentConfigs.size() > i) ? agentConfigs.get(i) : new MesosAgentConfig(); agentConfig.setImageTag(getMesosImageTag()); agentConfig.setLoggingLevel(clusterConfig.getLoggingLevel()); updatedConfigs.add(agentConfig); } clusterConfig.setAgents(updatedConfigs); ConsulConfig consulConfig = clusterConfig.getConsul(); if (consulConfig == null && getStartConsul()) { consulConfig = new ConsulConfig(); } clusterConfig.setConsul(consulConfig); }

Target:
private void updateWithParameters(ClusterConfig clusterConfig) { clusterConfig.setExposePorts(isExposedHostPorts()); clusterConfig.setTimeout(getTimeout()); ZooKeeperConfig zooKeeperConfig = (clusterConfig.getZookeeper() != null) ? clusterConfig.getZookeeper() : new ZooKeeperConfig(); zooKeeperConfig.setImageTag(getZooKeeperImageTag()); clusterConfig.setZookeeper(zooKeeperConfig); MesosMasterConfig masterConfig = (clusterConfig.getMaster() != null) ? clusterConfig.getMaster() : new MesosMasterConfig(); masterConfig.setImageTag(getMesosImageTag()); clusterConfig.setMaster(masterConfig); MarathonConfig marathonConfig = (clusterConfig.getMarathon() != null) ? clusterConfig.getMarathon() : new MarathonConfig(); marathonConfig.setImageTag(getMarathonImageTag()); clusterConfig.setMarathon(marathonConfig); List<MesosAgentConfig> agentConfigs = clusterConfig.getAgents(); List<MesosAgentConfig> updatedConfigs = new ArrayList<>(); for (int i = 0; i < getNumAgents(); i++) { MesosAgentConfig agentConfig = (agentConfigs.size() > i) ? agentConfigs.get(i) : new MesosAgentConfig(); agentConfig.setImageTag(getMesosImageTag()); updatedConfigs.add(agentConfig); } clusterConfig.setAgents(updatedConfigs); ConsulConfig consulConfig = clusterConfig.getConsul(); if (consulConfig == null && getStartConsul()) { consulConfig = new ConsulConfig(); } clusterConfig.setConsul(consulConfig); }
Source:
void setApiVersion(final String apiVersion) { getEventList().add(new Pair<>(EventStrings.HTTP_API_VERSION, apiVersion)); }

Target:
void setApiVersion(final String apiVersion) { setEvent(EventStrings.HTTP_API_VERSION, apiVersion); }
Source:
public List<?> parseFields(String data) throws ParseException { return Lists.newArrayList(PARSER_OUTPUT.keySet()); }

Target:
public List<?> parseFields(String data) throws ParseException { return Lists.newArrayList(PARSER_OUTPUT.values()); }
Source:
public static NIC map(VmNetworkInterface entity, NIC template) { NIC model = template != null ? template : new NIC(); if (entity.getVmId() != null) { model.setVm(new VM()); model.getVm().setId(entity.getVmId().toString()); } if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getMacAddress() != null) { model.setMac(new MAC()); model.getMac().setAddress(entity.getMacAddress()); } if (entity.getNetworkName() != null) { model.setNetwork(new Network()); model.getNetwork().setName(entity.getNetworkName()); } if (entity.isPortMirroring()) { PortMirroring portMirroring = new PortMirroring(); Networks networks = new Networks(); Network net = new Network(); net.setName(entity.getNetworkName()); portMirroring.setNetworks(networks); portMirroring.getNetworks().getNetworks().add(net); model.setPortMirroring(portMirroring); } model.setInterface(map(entity.getType())); model.setActive(entity.isActive()); return model; }

Target:
public static NIC map(VmNetworkInterface entity, NIC template) { NIC model = template != null ? template : new NIC(); if (entity.getVmId() != null) { model.setVm(new VM()); model.getVm().setId(entity.getVmId().toString()); } if (entity.getId() != null) { model.setId(entity.getId().toString()); } if (entity.getName() != null) { model.setName(entity.getName()); } if (entity.getMacAddress() != null) { model.setMac(new MAC()); model.getMac().setAddress(entity.getMacAddress()); } if (entity.getNetworkName() != null) { model.setNetwork(new Network()); model.getNetwork().setName(entity.getNetworkName()); } if (entity.isPortMirroring()) { PortMirroring portMirroring = new PortMirroring(); Networks networks = new Networks(); Network net = new Network(); portMirroring.setNetworks(networks); portMirroring.getNetworks().getNetworks().add(net); model.setPortMirroring(portMirroring); } model.setInterface(map(entity.getType())); model.setActive(entity.isActive()); return model; }
Source:
private Component createDefaultAnnotationLayerSelector() { IModel<List<? extends AnnotationLayer>> annotationLayerIModel = new IModel <List<? extends AnnotationLayer>>() { List<? extends AnnotationLayer> annotationLayers; @Override public List<? extends AnnotationLayer> getObject() { return annotationLayers; } @Override public void setObject(List<? extends AnnotationLayer> annotationLayers) { this.annotationLayers = annotationLayers; } @Override public void detach() { } }; annotationLayerIModel.setObject(annotationLayers); return new AnnotationFeatureForm.LayerSelector("defaultAnnotationLayer", annotationLayerIModel); }

Target:
private LayerSelector createDefaultAnnotationLayerSelector() { return new LayerSelector("defaultAnnotationLayer", new PropertyModel<>(this, "annotationLayers")); }
Source:
public StreamMessage(String event, String id, String data) { this.event = event; this.id = id; this.data = data; if (isKind(Kind.CONTROL)) { kind = Kind.CONTROL; } else if (isKind(Kind.INFORMATION)) { kind = Kind.INFORMATION; } else if (isKind(Kind.METADATA)) { kind = Kind.METADATA; } else if (isKind(Kind.DATA)) { kind = Kind.DATA; } else if (isKind(Kind.EVENT)) { kind = Kind.EVENT; } else if (isKind(Kind.ERROR)) { kind = Kind.ERROR; } else { kind = Kind.INFORMATION; } }

Target:
public StreamMessage(String event, String id, String data) { this.event = event; this.id = id; this.data = data; try { this.kind = Kind.fromSpecName(event); } catch (IllegalArgumentException ex) { kind = Kind.INFORMATION; } }
Source:
public boolean dispatchKeyEvent(KeyEvent event) { if (event.getAction() == KeyEvent.ACTION_UP) { int code = event.getKeyCode(); if(code == disableTouchKeyCode && (disableTouch || disableTouchOptionEnabled)) { disableTouch = !disableTouch; settings.setDisableTouchLastState(disableTouch); Log.d(TAG, "toggling touch screen, now disableTouch is " + disableTouch); showDisableTouchToast(); return true; } switch (code) { case KeyEvent.KEYCODE_PAGE_UP: case KeyEvent.KEYCODE_PAGE_DOWN: scroll(code == KeyEvent.KEYCODE_PAGE_UP, screenScrollingPercent, smoothScrolling); return true; case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: if (volumeButtonsScrolling) { scroll(code == KeyEvent.KEYCODE_VOLUME_UP, screenScrollingPercent, smoothScrolling); return true; } break; } } return super.dispatchKeyEvent(event); }

Target:
public boolean dispatchKeyEvent(KeyEvent event) { int code = event.getKeyCode(); boolean triggerAction; if (code == KeyEvent.KEYCODE_PAGE_UP || code == KeyEvent.KEYCODE_PAGE_DOWN) { triggerAction = (event.getAction() == KeyEvent.ACTION_UP); } else { triggerAction = (event.getAction() == KeyEvent.ACTION_DOWN); } if (triggerAction) { if(code == disableTouchKeyCode && (disableTouch || disableTouchOptionEnabled)) { disableTouch = !disableTouch; settings.setDisableTouchLastState(disableTouch); Log.d(TAG, "toggling touch screen, now disableTouch is " + disableTouch); showDisableTouchToast(); return true; } switch (code) { case KeyEvent.KEYCODE_PAGE_UP: case KeyEvent.KEYCODE_PAGE_DOWN: scroll(code == KeyEvent.KEYCODE_PAGE_UP, screenScrollingPercent, smoothScrolling); return true; case KeyEvent.KEYCODE_VOLUME_UP: case KeyEvent.KEYCODE_VOLUME_DOWN: if (volumeButtonsScrolling) { scroll(code == KeyEvent.KEYCODE_VOLUME_UP, screenScrollingPercent, smoothScrolling); return true; } break; } } return super.dispatchKeyEvent(event); }
Source:
public ContainerDTO getContainer() { return container.get(); }

Target:
public ContainerDTO getContainer() { return this.container.get(); }
Source:
public void testGetDepth() { try { attributeNode.getDepth(); fail("Exception is excepted"); } catch (UnsupportedOperationException ex) { assertWithMessage("Invalid exception message") .that(ex) .hasMessageThat() .isEqualTo("Operation is not supported"); } }

Target:
public void testGetDepth() { final UnsupportedOperationException exception = assertThrows(UnsupportedOperationException.class, () -> { attributeNode.getDepth(); }); assertWithMessage("Invalid exception message") .that(exception) .hasMessageThat() .isEqualTo("Operation is not supported"); }
Source:
public GanttCategoryDataset createDebugEventGanttChartDataset() { splitEventsIntoAListPerType(); final TaskSeries allTasks = new TaskSeries("Debug Events"); allTasks.add( createTaskForEventsWithName(bpAddEvents, "Breakpoint Added")); allTasks.add(createTaskForEventsWithName(bpChangeEvents, "Breakpoint Changed")); allTasks.add(createTaskForEventsWithName(bpRemoveEvents, "Breakpoint Removed")); allTasks.add(createTaskForEventsWithName(suspendBpEvents, "Suspended (breakpoint)")); allTasks.add(createTaskForEventsWithName(suspendClientEvents, "Suspended (client)")); allTasks.add(createTaskForEventsWithName(stepOutEvents, "Stepped Out")); allTasks.add( createTaskForEventsWithName(stepIntoEvents, "Stepped Into")); allTasks.add( createTaskForEventsWithName(stepOverEvents, "Stepped Over")); allTasks.add(createTaskForEventsWithName(resumeClientEvents, "Resumed (client)")); allTasks.add(createTaskForEventsWithName(inspectEvents, "Inspected Variable")); allTasks.add(createTaskForEventsWithName(defineWatchEvents, "Defined Watch")); allTasks.add(createTaskForEventsWithName(evalExpressionEvents, "Evaluated Expression")); allTasks.add(createTaskForEventsWithName(modVarValueEvents, "Modified Variable Value")); final TaskSeriesCollection collection = new TaskSeriesCollection(); collection.add(allTasks); return collection; }

Target:
public GanttCategoryDataset createDebugEventGanttChartDataset() { splitEventsIntoAListPerType(); TaskSeries allTasks = new TaskSeries("Debug Events"); allTasks.add( createTaskForEventsWithName(bpAddEvents, "Breakpoint Added")); allTasks.add(createTaskForEventsWithName(bpChangeEvents, "Breakpoint Changed")); allTasks.add(createTaskForEventsWithName(bpRemoveEvents, "Breakpoint Removed")); allTasks.add(createTaskForEventsWithName(suspendBpEvents, "Suspended (breakpoint)")); allTasks.add(createTaskForEventsWithName(suspendClientEvents, "Suspended (client)")); allTasks.add(createTaskForEventsWithName(stepOutEvents, "Stepped Out")); allTasks.add( createTaskForEventsWithName(stepIntoEvents, "Stepped Into")); allTasks.add( createTaskForEventsWithName(stepOverEvents, "Stepped Over")); allTasks.add(createTaskForEventsWithName(resumeClientEvents, "Resumed (client)")); allTasks.add(createTaskForEventsWithName(inspectEvents, "Inspected Variable")); allTasks.add(createTaskForEventsWithName(defineWatchEvents, "Defined Watch")); allTasks.add(createTaskForEventsWithName(evalExpressionEvents, "Evaluated Expression")); allTasks.add(createTaskForEventsWithName(modVarValueEvents, "Modified Variable Value")); TaskSeriesCollection collection = new TaskSeriesCollection(); collection.add(allTasks); return collection; }
Source:
private Credential authorizeAndCreateCredentials() throws IOException { GoogleClientSecrets clientSecrets = loadClientSecretFromJson(); GoogleAuthorizationCodeFlow flow = buildFlow(clientSecrets); if (useFreshCredentials) { flow.getCredentialDataStore().clear(); } if (flow.getCredentialDataStore().isEmpty()) { System.out.println("Please login as: " + username); } return getCredentialFromFlow(flow); }

Target:
private Credential authorizeAndCreateCredentials() throws IOException { GoogleClientSecrets clientSecrets = loadClientSecretFromJson(); GoogleAuthorizationCodeFlow flow = buildFlow(clientSecrets); if (shouldUseFreshCredentials) { flow.getCredentialDataStore().delete(username); } if (flow.getCredentialDataStore().get(username) == null) { System.out.println("Please login as: " + username); } return getCredentialFromFlow(flow); }
Source:
@Override public AffinityTopologyVersion topologyVersion() { assert exchangeDone() : "Should not be called before exchange is finished"; if (isDone()) return result(); ExchangeContext exchCtx0 = state == ExchangeLocalState.MERGED ? mergedWith.exchCtx : exchCtx; return exchCtx0.events().topologyVersion(); }

Target:
@Override public AffinityTopologyVersion topologyVersion() { assert exchangeDone() : "Should not be called before exchange is finished"; if (isDone()) return result(); final ExchangeContext exchCtx0; synchronized (mux) { if (state == ExchangeLocalState.MERGED) { assert mergedWith != null; exchCtx0 = mergedWith.exchCtx; } else exchCtx0 = exchCtx; } return exchCtx0.events().topologyVersion(); }
Source:
public boolean isNegotiationAuth() { return context.get(ExtensionProperties.AAA_IS_NEGOTIATION_AUTH) != null ? (Boolean) context.get(ExtensionProperties.AAA_IS_NEGOTIATION_AUTH) : false; }

Target:
public boolean isNegotiationAuth() { return context.get(ExtensionProperties.AAA_AUTHENTICATION_CAPABILITIES) != null ? (Extension.AAAFlags.AAA_NEGOTIATION_AUTH_FLAG & (int) context.get(ExtensionProperties.AAA_AUTHENTICATION_CAPABILITIES)) == Extension.AAAFlags.AAA_NEGOTIATION_AUTH_FLAG : false; }