auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addStream(long id, File streamFile) throws CTFException { final File file = streamFile; if (file == null) { throw new CTFException("cannot create a stream with no file"); } ICTFStream stream = fStreams.computeIfAbsent(id, k -> new CTFStream(this)); if (stream instanceof CTFStream) { CTFStream ctfStream = (CTFStream) stream; ctfStream.addInput(new CTFStreamInput(stream, file)); } else { throw new CTFException("Stream does not support adding input"); } }

Target:
public void addStream(long id, File streamFile) throws CTFException { final File file = streamFile; if (file == null) { throw new CTFException("cannot create a stream with no file"); } ICTFStream stream = fStreams.computeIfAbsent(id, ctfStream -> new CTFStream(this)); if (stream instanceof CTFStream) { CTFStream ctfStream = (CTFStream) stream; ctfStream.addInput(new CTFStreamInput(stream, file)); } else { throw new CTFException("Stream does not support adding input"); } }
Source:
public void testCloseShouldTearDownZkConnectionOnInterruptedException() throws Exception { CountDownLatch latch = new CountDownLatch(1); ZkClient zkClient = new ZkClient("127.0.0.1:" + zkServer.getPort()); ZkUtils zkUtils = new ZkUtils(KEY_BUILDER, zkClient, SESSION_TIMEOUT_MS, new NoOpMetricsRegistry()); Thread threadToInterrupt = new Thread(() -> { try { latch.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } zkUtils.close(); }); threadToInterrupt.start(); threadToInterrupt.interrupt(); threadToInterrupt.join(); Field field = ZkClient.class.getDeclaredField("_closed"); field.setAccessible(true); Assert.assertTrue(field.getBoolean(zkClient)); }

Target:
public void testCloseShouldTearDownZkConnectionOnInterruptedException() throws Exception { CountDownLatch latch = new CountDownLatch(1); ZkClient zkClient = new ZkClient("127.0.0.1:" + zkServer.getPort()); ZkUtils zkUtils = new ZkUtils(KEY_BUILDER, zkClient, SESSION_TIMEOUT_MS, new NoOpMetricsRegistry()); Thread threadToInterrupt = new Thread(() -> { try { latch.await(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } zkUtils.close(); }); threadToInterrupt.start(); Field field = ZkClient.class.getDeclaredField("_closed"); field.setAccessible(true); Assert.assertFalse(field.getBoolean(zkClient)); threadToInterrupt.interrupt(); threadToInterrupt.join(); Assert.assertTrue(field.getBoolean(zkClient)); }
Source:
private void startPlugins() { IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint point = registry.getExtensionPoint(PlatformUI.PLUGIN_ID, IWorkbenchRegistryConstants.PL_STARTUP); final IExtension[] extensions = point.getExtensions(); if (extensions.length == 0) { return; } int numProcessors = Runtime.getRuntime().availableProcessors(); final JobGroup jobGroup = new JobGroup("Early startup job group", numProcessors, 1); Job job = new Job("Workbench early startup") { @Override protected IStatus run(IProgressMonitor monitor) { HashSet disabledPlugins = new HashSet(Arrays .asList(getDisabledEarlyActivatedPlugins())); monitor.beginTask(WorkbenchMessages.Workbench_startingPlugins, extensions.length); for (int i = 0; i < extensions.length; ++i) { if (monitor.isCanceled() || !isRunning()) { return Status.CANCEL_STATUS; } final IExtension extension = extensions[i]; if (!disabledPlugins.contains(extension.getNamespace())) { monitor.subTask(extension.getNamespace()); Job extensionJob = new Job("Early stattup job") { @Override protected IStatus run(IProgressMonitor monitor) { monitor.beginTask(extension.getNamespaceIdentifier(), 1); SafeRunner.run(new EarlyStartupRunnable(extension)); monitor.done(); return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return EARLY_STARTUP_FAMILY.equals(family); } }; extensionJob.setSystem(true); extensionJob.setJobGroup(jobGroup); extensionJob.schedule(); } monitor.worked(1); } monitor.done(); return Status.OK_STATUS; } @Override public boolean belongsTo(Object family) { return EARLY_STARTUP_FAMILY.equals(family); } }; job.setSystem(true); job.setJobGroup(jobGroup); job.schedule(); }

Target:
private void startPlugins() { IExtensionRegistry registry = Platform.getExtensionRegistry(); IExtensionPoint point = registry.getExtensionPoint(PlatformUI.PLUGIN_ID, IWorkbenchRegistryConstants.PL_STARTUP); final IExtension[] extensions = point.getExtensions(); if (extensions.length == 0) { return; } int numProcessors = Runtime.getRuntime().availableProcessors(); final JobGroup jobGroup = new JobGroup("Workbench early startup job group", numProcessors * 2, 1); new EarlyStartupJob(jobGroup) { @Override protected IStatus run(IProgressMonitor monitor) { HashSet<String> disabledPlugins = new HashSet<String>(Arrays .asList(getDisabledEarlyActivatedPlugins())); monitor.beginTask(WorkbenchMessages.Workbench_startingPlugins, extensions.length); for (int i = 0; i < extensions.length; ++i) { if (monitor.isCanceled() || !isRunning()) { return Status.CANCEL_STATUS; } final IExtension extension = extensions[i]; if (!disabledPlugins.contains(extension.getNamespace())) { new EarlyStartupJob(jobGroup) { @Override protected IStatus run(IProgressMonitor monitor) { monitor.beginTask(extension.getNamespaceIdentifier(), 1); SafeRunner.run(new EarlyStartupRunnable(extension)); monitor.done(); return Status.OK_STATUS; } }.schedule(); } monitor.worked(1); } monitor.done(); return Status.OK_STATUS; } }.schedule(); }
Source:
private void initializeLags() { Map<TopicPartition, Long> endOffsets = kafkaConsumer.endOffsets(topicPartitions2SSP.keySet()); endOffsets.forEach((tp, offset) -> { SystemStreamPartition ssp = topicPartitions2SSP.get(tp); long startingOffset = nextOffsets.get(ssp); long initialLag = endOffsets.get(tp) - startingOffset; LOG.info("Initial lag for SSP is (end={}, startOffset={})", ssp, initialLag, endOffsets.get(tp), startingOffset); latestLags.put(ssp, initialLag); sink.setIsAtHighWatermark(ssp, initialLag == 0); }); refreshLatencyMetrics(); }

Target:
private void initializeLags() { Map<TopicPartition, Long> endOffsets = kafkaConsumer.endOffsets(topicPartitionToSSP.keySet()); endOffsets.forEach((tp, offset) -> { SystemStreamPartition ssp = topicPartitionToSSP.get(tp); long startingOffset = nextOffsets.get(ssp); long initialLag = endOffsets.get(tp) - startingOffset; LOG.info("Initial lag for SSP is (end={}, startOffset={})", ssp, initialLag, endOffsets.get(tp), startingOffset); latestLags.put(ssp, initialLag); sink.setIsAtHighWatermark(ssp, initialLag == 0); }); refreshLagMetrics(); }
Source:
private void viewAnnotation(JSONObject op, StringBuilder sb){ JSONObject config = (JSONObject)op.get("config"); if(config == null) return; JSONObject viewConfig = (JSONObject)config.get("viewConfig"); if(viewConfig == null) return; String name = (String)viewConfig.get("name"); String port = (String)viewConfig.get("port"); Double bufferTime = (Double)viewConfig.get("bufferTime"); Long sampleSize = (Long)viewConfig.get("sampleSize"); sb.append("@view(name = \""); sb.append(splBasename(name)); sb.append("\", port = " + port); sb.append(", bufferTime = " + bufferTime + ", "); sb.append("sampleSize = " + sampleSize + ", "); sb.append("activateOption = firstAccess)\n"); }

Target:
private void viewAnnotation(JSONObject op, StringBuilder sb){ JSONObject config = (JSONObject)op.get("config"); if(config == null) return; JSONArray viewConfigs = (JSONArray) config.get("viewConfigs"); if (viewConfigs == null || viewConfigs.isEmpty()) { return; } for (int i = 0; i < viewConfigs.size(); i++) { JSONObject viewConfig = (JSONObject) viewConfigs.get(i); String name = (String)viewConfig.get("name"); String port = (String)viewConfig.get("port"); Double bufferTime = ((Number)viewConfig.get("bufferTime")).doubleValue(); Long sampleSize = ((Number)viewConfig.get("sampleSize")).longValue(); sb.append("@view(name = \""); sb.append(splBasename(name)); sb.append("\", port = " + port); sb.append(", bufferTime = " + bufferTime + ", "); sb.append("sampleSize = " + sampleSize + ", "); sb.append("activateOption = firstAccess)\n"); } }
Source:
protected Node visitShowSchemas(ShowSchemas node, Void context) { if (!node.getCatalog().isPresent() && !session.getCatalog().isPresent()) { throw new SemanticException(CATALOG_NOT_SPECIFIED, node, "Catalog must be specified when session catalog is not set"); } String catalog = node.getCatalog().map(Identifier::getValue).orElseGet(() -> session.getCatalog().get()); accessControl.checkCanShowSchemas(session.getRequiredTransactionId(), session.getIdentity(), catalog); Optional<Expression> predicate = Optional.empty(); Optional<String> likePattern = node.getLikePattern(); if (likePattern.isPresent()) { Optional<String> escape = node.getEscape(); if (escape.isPresent()) { predicate = Optional.of(new LikePredicate(identifier("schema_name"), new StringLiteral(likePattern.get()), new StringLiteral(escape.get()))); } else { predicate = Optional.of(new LikePredicate(identifier("schema_name"), new StringLiteral(likePattern.get()), null)); } } return simpleQuery( selectList(aliasedName("schema_name", "Schema")), from(catalog, TABLE_SCHEMATA), predicate, Optional.of(ordering(ascending("schema_name")))); }

Target:
protected Node visitShowSchemas(ShowSchemas node, Void context) { if (!node.getCatalog().isPresent() && !session.getCatalog().isPresent()) { throw new SemanticException(CATALOG_NOT_SPECIFIED, node, "Catalog must be specified when session catalog is not set"); } String catalog = node.getCatalog().map(Identifier::getValue).orElseGet(() -> session.getCatalog().get()); accessControl.checkCanShowSchemas(session.getRequiredTransactionId(), session.getIdentity(), catalog); Optional<Expression> predicate = Optional.empty(); Optional<String> likePattern = node.getLikePattern(); if (likePattern.isPresent()) { predicate = Optional.of(new LikePredicate(identifier("schema_name"), new StringLiteral(likePattern.get()), null)); } return simpleQuery( selectList(aliasedName("schema_name", "Schema")), from(catalog, TABLE_SCHEMATA), predicate, Optional.of(ordering(ascending("schema_name")))); }
Source:
private void parseMenuURI(String menuURI) throws URISyntaxException { if (menuId != null) { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_OnlyOneLocationURIPerScheme, MENU_SCHEME)); } if (menuURI.substring(MENU_SCHEME.length()).startsWith(SEPARATOR)) { String id = menuURI.substring(MENU_SCHEME.length() + SEPARATOR.length()).trim(); if (id.length() == 0) { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_NoId, MENU_SCHEME + SEPARATOR)); } menuId = id; } else if (menuURI.length() == MENU_SCHEME.length()) { menuId = ROOT_MENU_ID; } else { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_WrongFormat, MENU_SCHEME + SEPARATOR + "menuId", menuURI)); } }

Target:
private void parseMenuURI(String menuURI) throws URISyntaxException { if (menuId != null) { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_OnlyOneLocationURIPerScheme, MENU_SCHEME)); } if (menuURI.substring(MENU_SCHEME.length()).trim().startsWith(SEPARATOR)) { String id = menuURI.substring(MENU_SCHEME.length()).trim().substring(SEPARATOR.length()).trim(); if (id.length() == 0) { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_NoId, MENU_SCHEME + SEPARATOR)); } menuId = id; } else if (menuURI.length() == MENU_SCHEME.length()) { menuId = ROOT_MENU_ID; } else { throw new URISyntaxException(string, MessageFormat.format(Messages.LocationURI_ParsePb_WrongFormat, MENU_SCHEME + SEPARATOR + "menuId", menuURI)); } }
Source:
protected Endpoint createEndpoint( String uri, String remaining, Map<String, Object> parameters ) throws Exception { KieConfiguration kieConfiguration = new KieConfiguration(); kieConfiguration.configure( new URI( uri ) ); setProperties(kieConfiguration, parameters); KieServicesConfiguration config = remaining.startsWith( "jms" ) ? KieServicesFactory.newJMSConfiguration( (InitialContext)null, null, null ) : KieServicesFactory.newRestConfiguration( remaining, null, null ); config.setUserName( kieConfiguration.getUsername() ); config.setPassword( kieConfiguration.getPassword() ); return new KieEndpoint(uri, this, config); }

Target:
protected Endpoint createEndpoint( String uri, String remaining, Map<String, Object> parameters ) throws Exception { KieConfiguration kieConfiguration = getConfiguration().copy(); kieConfiguration.configure( remaining ); setProperties(kieConfiguration, parameters); KieServicesConfiguration config = remaining.startsWith( "jms" ) ? KieServicesFactory.newJMSConfiguration( (InitialContext)null, null, null ) : KieServicesFactory.newRestConfiguration( remaining, null, null ); config.setUserName( kieConfiguration.getUsername() ); config.setPassword( kieConfiguration.getPassword() ); return new KieEndpoint(uri, this, config); }
Source:
private boolean evaluateDefaultLocale() { if (mCurrentDefaultLocale == null || mAvailableStrLocals == null) { return false; } boolean notInAvailableLangauges = true; try { String defaultLocaleStr = mCurrentDefaultLocale.getISO3Language(); if (!TextUtils.isEmpty(mCurrentDefaultLocale.getISO3Country())) { defaultLocaleStr += "-" + mCurrentDefaultLocale.getISO3Country(); } if (!TextUtils.isEmpty(mCurrentDefaultLocale.getVariant())) { defaultLocaleStr += "-" + mCurrentDefaultLocale.getVariant(); } for (String loc : mAvailableStrLocals) { if (loc.equalsIgnoreCase(defaultLocaleStr)) { notInAvailableLangauges = false; break; } } } catch (MissingResourceException e) { if (DBG) Log.wtf(TAG, "MissingResourceException", e); updateWidgetState(false); return false; } int defaultAvailable = mTts.setLanguage(mCurrentDefaultLocale); if (defaultAvailable == TextToSpeech.LANG_NOT_SUPPORTED || defaultAvailable == TextToSpeech.LANG_MISSING_DATA || notInAvailableLangauges) { if (DBG) Log.d(TAG, "Default locale for this TTS engine is not supported."); updateEngineStatus(R.string.tts_status_not_supported); updateWidgetState(false); return false; } else { if (isNetworkRequiredForSynthesis()) { updateEngineStatus(R.string.tts_status_requires_network); } else { updateEngineStatus(R.string.tts_status_ok); } updateWidgetState(true); return true; } }

Target:
private boolean evaluateDefaultLocale() { if (mCurrentDefaultLocale == null || mAvailableStrLocals == null) { return false; } boolean notInAvailableLangauges = true; try { String defaultLocaleStr = mCurrentDefaultLocale.getISO3Language(); if (!TextUtils.isEmpty(mCurrentDefaultLocale.getISO3Country())) { defaultLocaleStr += "-" + mCurrentDefaultLocale.getISO3Country(); } if (!TextUtils.isEmpty(mCurrentDefaultLocale.getVariant())) { defaultLocaleStr += "-" + mCurrentDefaultLocale.getVariant(); } for (String loc : mAvailableStrLocals) { if (loc.equalsIgnoreCase(defaultLocaleStr)) { notInAvailableLangauges = false; break; } } } catch (MissingResourceException e) { if (DBG) Log.wtf(TAG, "MissingResourceException", e); updateEngineStatus(R.string.tts_status_not_supported); updateWidgetState(false); return false; } int defaultAvailable = mTts.setLanguage(mCurrentDefaultLocale); if (defaultAvailable == TextToSpeech.LANG_NOT_SUPPORTED || defaultAvailable == TextToSpeech.LANG_MISSING_DATA || notInAvailableLangauges) { if (DBG) Log.d(TAG, "Default locale for this TTS engine is not supported."); updateEngineStatus(R.string.tts_status_not_supported); updateWidgetState(false); return false; } else { if (isNetworkRequiredForSynthesis()) { updateEngineStatus(R.string.tts_status_requires_network); } else { updateEngineStatus(R.string.tts_status_ok); } updateWidgetState(true); return true; } }
Source:
public ExtendedModifiedSinceTerm(final long modSeq) { this(modSeq, null, null); }

Target:
public ExtendedModifiedSinceTerm(final long modSeq) { this.entryName = null; this.entryType = null; this.modSeq = modSeq; }
Source:
private static Slice stUnion(Iterable<Slice> slices) { ListeningGeometryCursor[] cursorsByDimension = new ListeningGeometryCursor[NUMBER_OF_DIMENSIONS]; GeometryCursor[] operatorsByDimension = new GeometryCursor[NUMBER_OF_DIMENSIONS]; setAll(cursorsByDimension, i -> new ListeningGeometryCursor()); setAll(operatorsByDimension, i -> OperatorUnion.local().execute(cursorsByDimension[i], null, null)); for (Slice slice : slices) { if (slice.getInput().available() == 0) { continue; } for (OGCGeometry geometry : flattenCollection(deserialize(slice))) { int dimension = geometry.dimension(); cursorsByDimension[dimension].tick(geometry.getEsriGeometry()); operatorsByDimension[dimension].tock(); } } List<OGCGeometry> outputs = new ArrayList<>(); for (GeometryCursor operator : operatorsByDimension) { OGCGeometry unionedGeometry = createFromEsriGeometry(operator.next(), null); if (unionedGeometry != null) { outputs.add(unionedGeometry); } } if (outputs.isEmpty()) { return null; } if (outputs.size() == 1) { return serialize(outputs.get(0)); } return serialize(new OGCConcreteGeometryCollection(outputs, null).flattenAndRemoveOverlaps().reduceFromMulti()); }

Target:
private static Slice stUnion(Iterable<Slice> slices) { ListeningGeometryCursor[] cursorsByDimension = new ListeningGeometryCursor[NUMBER_OF_DIMENSIONS]; GeometryCursor[] operatorsByDimension = new GeometryCursor[NUMBER_OF_DIMENSIONS]; setAll(cursorsByDimension, i -> new ListeningGeometryCursor()); setAll(operatorsByDimension, i -> OperatorUnion.local().execute(cursorsByDimension[i], null, null)); Iterator<Slice> slicesIterator = slices.iterator(); if (!slicesIterator.hasNext()) { return null; } while (slicesIterator.hasNext()) { Slice slice = slicesIterator.next(); if (slice.getInput().available() == 0) { continue; } for (OGCGeometry geometry : flattenCollection(deserialize(slice))) { int dimension = geometry.dimension(); cursorsByDimension[dimension].tick(geometry.getEsriGeometry()); operatorsByDimension[dimension].tock(); } } List<OGCGeometry> outputs = new ArrayList<>(); for (GeometryCursor operator : operatorsByDimension) { OGCGeometry unionedGeometry = createFromEsriGeometry(operator.next(), null); if (unionedGeometry != null) { outputs.add(unionedGeometry); } } if (outputs.size() == 1) { return serialize(outputs.get(0)); } return serialize(new OGCConcreteGeometryCollection(outputs, null).flattenAndRemoveOverlaps().reduceFromMulti()); }
Source:
public void testIndenting() throws Exception { ITargetPlatformService service = PDECore.getDefault().acquireService(ITargetPlatformService.class); ITargetDefinition targetDefinition = service.newTarget(); targetDefinition.setOS("test_os"); ByteArrayOutputStream actualOutput = new ByteArrayOutputStream(); TargetDefinitionPersistenceHelper.persistXML(targetDefinition, actualOutput); try (Scanner s = new Scanner(FrameworkUtil.getBundle(this.getClass()) .getEntry("testing-files/target-files/IndentingTestCaseTarget.txt").openStream()).useDelimiter("\\A")) { String result = s.hasNext() ? s.next() : ""; IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode("org.eclipse.ui.editors"); boolean spacesForTabs = preferences.getBoolean("spacesForTabs", false); if (spacesForTabs) { char[] chars = new char[preferences.getInt("tabWidth", 4)]; Arrays.fill(chars, ' '); result.replace("\t", new String(chars)); } assertEquals(result, actualOutput.toString(StandardCharsets.UTF_8.toString())); } catch (Exception e) { } }

Target:
public void testIndenting() throws Exception { ITargetPlatformService service = PDECore.getDefault().acquireService(ITargetPlatformService.class); ITargetDefinition targetDefinition = service.newTarget(); targetDefinition.setOS("test_os"); ByteArrayOutputStream actualOutput = new ByteArrayOutputStream(); TargetDefinitionPersistenceHelper.persistXML(targetDefinition, actualOutput); try (Scanner s = new Scanner(FrameworkUtil.getBundle(this.getClass()) .getEntry("testing-files/target-files/IndentingTestCaseTarget.txt").openStream()).useDelimiter("\\A")) { String result = s.hasNext() ? s.next() : ""; IEclipsePreferences preferences = InstanceScope.INSTANCE.getNode("org.eclipse.ui.editors"); boolean spacesForTabs = preferences.getBoolean("spacesForTabs", false); if (spacesForTabs) { char[] chars = new char[preferences.getInt("tabWidth", 4)]; Arrays.fill(chars, ' '); result.replace("\t", new String(chars)); } assertEquals(result, actualOutput.toString(StandardCharsets.UTF_8.toString())); } catch (IOException e) { } }
Source:
public void shouldThrowOnV0IfNotLiteral() { DescribeAclsResponse.prepareResponse(10, ApiError.NONE, aclBindings(PREFIXED_ACL1)).toStruct(V0); }

Target:
public void shouldThrowOnV0IfNotLiteral() { buildResponse(10, Errors.NONE, Collections.singletonList(PREFIXED_ACL1)).toStruct(V0); }
Source:
public void allTests() throws Exception { testEditPage(); testStudentSubmitPage(); }

Target:
public void allTests() throws Exception { testEditPage(); }
Source:
public static ResultFactory configureResultFactory(String resultType, String resultFactoryName,BeanFactory beanFactory) { boolean bothHaveText = StringUtils.hasText(resultFactoryName) && StringUtils.hasText(resultType); ResultFactory resultFactory=null; Assert.state(!bothHaveText, "Only one of 'result-factory' or 'result-type' should be specified."); if (StringUtils.hasText(resultType)) { Assert.state(resultType.equals(DOM_RESULT) || resultType.equals(STRING_RESULT), "Result type must be either 'DOMResult' or 'StringResult'"); } if (StringUtils.hasText(resultFactoryName)) { resultFactory=(ResultFactory) beanFactory.getBean(resultFactoryName); } else if (STRING_RESULT.equals(resultType)) { resultFactory=new StringResultFactory(); } else if (DOM_RESULT.equals(resultType)) { resultFactory=new DomResultFactory(); } return resultFactory; }

Target:
private ResultFactory configureResultFactory(String resultType, String resultFactoryName,BeanFactory beanFactory) { boolean bothHaveText = StringUtils.hasText(resultFactoryName) && StringUtils.hasText(resultType); ResultFactory resultFactory=null; Assert.state(!bothHaveText, "Only one of 'result-factory' or 'result-type' should be specified."); if (StringUtils.hasText(resultType)) { Assert.state(resultType.equals(DOM_RESULT) || resultType.equals(STRING_RESULT), "Result type must be either 'DOMResult' or 'StringResult'"); } if (StringUtils.hasText(resultFactoryName)) { resultFactory=(ResultFactory) beanFactory.getBean(resultFactoryName); } else if (STRING_RESULT.equals(resultType)) { resultFactory=new StringResultFactory(); } else if (DOM_RESULT.equals(resultType)) { resultFactory=new DomResultFactory(); } return resultFactory; }
Source:
public void setAcceptableValues(Collection<K> values) { buttons.clear(); panels.clear(); wrapperPanel.clear(); for (final K value : values) { addValue(value); } updateButtons(); }

Target:
public void setAcceptableValues(Collection<K> values) { buttons.clear(); panels.clear(); wrapperPanel.clear(); if (values != null) { for (final K value : values) { addValue(value); } } updateButtons(); }
Source:
public void run() { log.info("Elf Kingdom"); createKingdom(Kingdom.FactoryMaker.makeFactory(Kingdom.FactoryMaker.KingdomType.ELF)); log.info(kingdom.getArmy().getDescription()); log.info(kingdom.getCastle().getDescription()); log.info(kingdom.getKing().getDescription()); log.info("Orc Kingdom"); createKingdom(Kingdom.FactoryMaker.makeFactory(Kingdom.FactoryMaker.KingdomType.ORC)); log.info(kingdom.getArmy().getDescription()); log.info(kingdom.getCastle().getDescription()); log.info(kingdom.getKing().getDescription()); }

Target:
public void run() { log.info("Elf Kingdom"); createKingdom(Kingdom.FactoryMaker.KingdomType.ELF); log.info(kingdom.getArmy().getDescription()); log.info(kingdom.getCastle().getDescription()); log.info(kingdom.getKing().getDescription()); log.info("Orc Kingdom"); createKingdom(Kingdom.FactoryMaker.KingdomType.ORC); log.info(kingdom.getArmy().getDescription()); log.info(kingdom.getCastle().getDescription()); log.info(kingdom.getKing().getDescription()); }
Source:
private static void assertStartsWithExpectedWarnings(SQLWarning warning, SQLWarning expected) { if (warning == null) { assertNull(expected); return; } assertNotNull(expected); while (true) { assertWarningsEqual(warning, expected); warning = warning.getNextWarning(); expected = expected.getNextWarning(); if (expected == null) { return; } else { assertNotNull(warning); } } }

Target:
private static void assertStartsWithExpectedWarnings(SQLWarning warning, SQLWarning expected) { assertNotNull(expected); assertNotNull(warning); while (true) { assertWarningsEqual(warning, expected); warning = warning.getNextWarning(); expected = expected.getNextWarning(); if (expected == null) { return; } assertNotNull(warning); } }
Source:
private void startContainer() throws Exception { this.servletContainer .withNetwork(Network.SHARED) .withNetworkAliases(this.testConfiguration.getServletEngine().getInternalIP()) .withExposedPorts(this.testConfiguration.getServletEngine().getInternalPort()) .waitingFor( Wait.forHttp("/xwiki/bin/get/Main/WebHome") .forStatusCode(200).withStartupTimeout(Duration.of(480, SECONDS))); File testResoucesDirectory = new File("./target/", "test-classes"); if (testResoucesDirectory.exists()) { mountFromHostToContainer(testResoucesDirectory, this.testConfiguration.getServletEngine().getTestResourcesPath()); } if (this.testConfiguration.isOffline()) { String repoLocation = this.repositoryResolver.getSession().getLocalRepository().getBasedir().toString(); this.servletContainer.withFileSystemBind(repoLocation, "/root/.m2/repository"); } start(this.servletContainer, this.testConfiguration); }

Target:
private void startContainer() throws Exception { this.servletContainer .withNetwork(Network.SHARED) .withNetworkAliases(this.testConfiguration.getServletEngine().getInternalIP()) .withExposedPorts(this.testConfiguration.getServletEngine().getInternalPort()) .waitingFor( Wait.forHttp("/xwiki/bin/get/Main/WebHome") .forStatusCode(200).withStartupTimeout(Duration.of(480, SECONDS))); if (this.testConfiguration.isOffline()) { String repoLocation = this.repositoryResolver.getSession().getLocalRepository().getBasedir().toString(); this.servletContainer.withFileSystemBind(repoLocation, "/root/.m2/repository"); } start(this.servletContainer, this.testConfiguration); }
Source:
protected void executeVmCommand() { this.setVmName(getVmStaticDao().get(getParameters().getVmId()).getName()); VmNic iface = getVmNicDao().get(getParameters().getInterfaceId()); if (iface != null) { interfaceName = iface.getName(); String interType = VmInterfaceType.forValue(iface.getType()).getDescription(); if (interType != null) { addCustomValue("InterfaceType", interType); } new ExternalNetworkManager(iface).deallocateIfExternal(); getMacPool().freeMac(iface.getMacAddress()); } TransactionSupport.executeInNewTransaction(() -> { vmStaticDao.incrementDbGeneration(getVm().getId()); getVmNicDao().remove(getParameters().getInterfaceId()); getDbFacade().getVmNetworkStatisticsDao().remove(getParameters().getInterfaceId()); getDbFacade().getVmDeviceDao().remove(new VmDeviceId(getParameters().getInterfaceId(), getParameters().getVmId())); setSucceeded(true); return null; }); }

Target:
protected void executeVmCommand() { this.setVmName(getVmStaticDao().get(getParameters().getVmId()).getName()); VmNic iface = getVmNicDao().get(getParameters().getInterfaceId()); if (iface != null) { interfaceName = iface.getName(); String interType = VmInterfaceType.forValue(iface.getType()).getDescription(); if (interType != null) { addCustomValue("InterfaceType", interType); } new ExternalNetworkManager(iface).deallocateIfExternal(); getMacPool().freeMac(iface.getMacAddress()); } TransactionSupport.executeInNewTransaction(() -> { vmStaticDao.incrementDbGeneration(getParameters().getVmId()); getVmNicDao().remove(getParameters().getInterfaceId()); getDbFacade().getVmNetworkStatisticsDao().remove(getParameters().getInterfaceId()); getDbFacade().getVmDeviceDao().remove(new VmDeviceId(getParameters().getInterfaceId(), getParameters().getVmId())); setSucceeded(true); return null; }); }
Source:
public final Result process(Conveyor conveyor) { Map<DispatchingId, InboxMessage> dispatchToCatchUp = new HashMap<>(); for (InboxMessage message : conveyor) { for (CatchUp job : jobs) { CatchUpStatus jobStatus = job.getStatus(); if (job.matches(message)) { DispatchingId dispatchingId = new DispatchingId(message); if (jobStatus == IN_PROGRESS) { if (message.getStatus() == TO_CATCH_UP) { if (dispatchToCatchUp.containsKey(dispatchingId)) { conveyor.remove(message); } else { dispatchToCatchUp.put(dispatchingId, message); } } else if (message.getStatus() == TO_DELIVER) { conveyor.remove(message); } } else if (jobStatus == FINALIZING) { if (message.getStatus() == TO_DELIVER) { conveyor.markCatchUp(message); } } else if (jobStatus == COMPLETED) { if (message.getStatus() == TO_CATCH_UP) { if (!dispatchToCatchUp.containsKey(dispatchingId)) { dispatchToCatchUp.put(dispatchingId, message); conveyor.keepForLonger(message, HOW_LONG_TO_KEEP); } else { conveyor.remove(message); } } else if (message.getStatus() == TO_DELIVER && dispatchToCatchUp.containsKey(dispatchingId)) { conveyor.remove(message); } } } } } return dispatch(conveyor, dispatchToCatchUp); }

Target:
public final Result process(Conveyor conveyor) { JobFilter jobFilter = new JobFilter(jobs, conveyor); Collection<InboxMessage> toDispatch = jobFilter.messagesToDispatch(); return dispatch(toDispatch, conveyor); }
Source:
private long getRetainedSizeOf(Object object) { Class type = object.getClass(); if (type == PageBuilder.class) { return ((PageBuilder) object).getRetainedSizeInBytes(); } else if (type.isArray()) { if (type == int[].class) { return sizeOf((int[]) object); } else if (type == boolean[].class) { return sizeOf((boolean[]) object); } else if (type == byte[].class) { return sizeOf((byte[]) object); } else if (type == long[].class) { return sizeOf((long[]) object); } else if (type == short[].class) { return sizeOf((short[]) object); } else if (type == Block[].class) { Object[] objects = (Object[]) object; return Arrays.stream(objects) .mapToLong(this::getRetainedSizeOf) .sum(); } else { throw new UnsupportedOperationException(format("Unknown type encountered: %s", type)); } } else { long retainedSize = ClassLayout.parseClass(type).instanceSize(); Field[] fields = type.getDeclaredFields(); for (Field field : fields) { try { if (field.getType().isPrimitive()) { continue; } field.setAccessible(true); retainedSize += getRetainedSizeOf(field.get(object)); } catch (IllegalAccessException | IllegalArgumentException t) { throw new RuntimeException(t); } } return retainedSize; } }

Target:
private long getRetainedSizeOf(Object object) { if (object instanceof PageBuilder) { return ((PageBuilder) object).getRetainedSizeInBytes(); } if (object instanceof Block) { return ((Block) object).getRetainedSizeInBytes(); } Class type = object.getClass(); if (type.isArray()) { if (type == int[].class) { return sizeOf((int[]) object); } else if (type == boolean[].class) { return sizeOf((boolean[]) object); } else if (type == byte[].class) { return sizeOf((byte[]) object); } else if (type == long[].class) { return sizeOf((long[]) object); } else if (type == short[].class) { return sizeOf((short[]) object); } else if (type == Block[].class) { Object[] objects = (Object[]) object; return Arrays.stream(objects) .mapToLong(this::getRetainedSizeOf) .sum(); } else { throw new IllegalArgumentException(format("Unknown type encountered: %s", type)); } } long retainedSize = ClassLayout.parseClass(type).instanceSize(); Field[] fields = type.getDeclaredFields(); for (Field field : fields) { try { if (field.getType().isPrimitive() || Modifier.isStatic(field.getModifiers())) { continue; } field.setAccessible(true); retainedSize += getRetainedSizeOf(field.get(object)); } catch (IllegalAccessException t) { throw new RuntimeException(t); } } return retainedSize; }
Source:
public void visitEnd() { if (_containsSyntheticLambda) { String classToVisit = _methodInsnOwner.replace('/', '.'); try { SyntheticLambdaAnalyzer syntheticLambdaAnalyzer = new SyntheticLambdaAnalyzer(api, classToVisit, _methodInsnName); ClassReader cr = new ClassReader(classToVisit); cr.accept(syntheticLambdaAnalyzer, 0); _inferredOperationConsumer.accept(new InferredOperation(_methodInsnOpcode, syntheticLambdaAnalyzer.getInferredOperation())); } catch (IOException e) { LOGGER.error("Unable to read class: " + classToVisit, e.getMessage()); } } else { if (_methodInsnOpcode == Opcodes.INVOKESTATIC) { String functionName = Util.extractSimpleName(_methodInsnOwner, "/") + "::" + _methodInsnName; _inferredOperationConsumer.accept(new InferredOperation(Opcodes.INVOKESTATIC, functionName)); } else { String classToVisit = _lambdaSourcePointer._className.replace('/', '.'); try { FindMethodCallAnalyzer methodCallAnalyzer = new FindMethodCallAnalyzer(api, classToVisit, _lambdaSourcePointer, _methodInsnName); ClassReader cr = new ClassReader(classToVisit); cr.accept(methodCallAnalyzer, 0); _inferredOperationConsumer.accept(new InferredOperation(_methodInsnOpcode, methodCallAnalyzer.getInferredOperation())); } catch (IOException e) { LOGGER.error("Unable to read class: " + classToVisit, e.getMessage()); } } } super.visitEnd(); }

Target:
public void visitEnd() { if (_containsSyntheticLambda) { String classToVisit = _methodInsnOwner.replace('/', '.'); try { SyntheticLambdaAnalyzer syntheticLambdaAnalyzer = new SyntheticLambdaAnalyzer(api, classToVisit, _methodInsnName); ClassReader cr = new ClassReader(classToVisit); cr.accept(syntheticLambdaAnalyzer, 0); _inferredOperationConsumer.accept(new InferredOperation(_methodInsnOpcode, syntheticLambdaAnalyzer.getInferredOperation())); } catch (IOException e) { System.out.println("Unable to read class: " + classToVisit); } } else { if (_methodInsnOpcode == Opcodes.INVOKESTATIC) { String functionName = Util.extractSimpleName(_methodInsnOwner, "/") + "::" + _methodInsnName; _inferredOperationConsumer.accept(new InferredOperation(Opcodes.INVOKESTATIC, functionName)); } else { String classToVisit = _lambdaSourcePointer._className.replace('/', '.'); try { FindMethodCallAnalyzer methodCallAnalyzer = new FindMethodCallAnalyzer(api, classToVisit, _lambdaSourcePointer, _methodInsnName); ClassReader cr = new ClassReader(classToVisit); cr.accept(methodCallAnalyzer, 0); _inferredOperationConsumer.accept(new InferredOperation(_methodInsnOpcode, methodCallAnalyzer.getInferredOperation())); } catch (IOException e) { System.out.println("Unable to read class: " + classToVisit); } } } super.visitEnd(); }
Source:
public boolean perform(AbstractBuild<?, ?> build, BuildListener listener, long effectiveTimeout) { new AbortOperation().perform(build, listener, effectiveTimeout); if (checkMaxRestarts(build)) { ParametersAction action = build.getAction(ParametersAction.class); build.getRootBuild().getProject().scheduleBuild(0, new BuildTimeoutAbortAndRestartCause(build), action); } return true; }

Target:
public boolean perform(AbstractBuild<?, ?> build, BuildListener listener, long effectiveTimeout) { long effectiveTimeoutMinutes = MINUTES.convert(effectiveTimeout,MILLISECONDS); listener.getLogger().println(hudson.plugins.build_timeout.Messages.Timeout_Message( effectiveTimeoutMinutes, hudson.plugins.build_timeout.Messages.Timeout_Aborted()) ); Executor e = build.getExecutor(); if (e != null) { e.interrupt(Result.ABORTED); } if(isPresent()){ FixedDelay sd = new FixedDelay(0); int maxRestarts = 0; try { maxRestarts = Integer.parseInt(build.getEnvironment(listener).expand(this.maxRestarts)); build.addAction(new com.chikli.hudson.plugin.naginator.NaginatorScheduleAction(maxRestarts, sd, false)); } catch (IOException e1) { listener.getLogger().println("Failed to expand environment variables. " + e1); } catch (InterruptedException e1) { listener.getLogger().println("Failed to expand environment variables. " + e1); } } return true; }
Source:
public void initialize(IRecordBuilder rb) throws Exception { this.rootRecordBuilder = rb; this.rootRecordDefinition = rb.getRecordDefinition(); if (this.rootRecordDefinition == null) { throw new Exception("Error initializing BinaryRecordReader. IRecordBuilder provided a null record definition."); } }

Target:
public void initialize(IRecordBuilder rb) throws Exception { this.rootRecordBuilder = rb; if (rb == null) { throw new Exception("Error initializing BinaryRecordReader. IRecordBuilder must not be null."); } this.rootRecordDefinition = rb.getRecordDefinition(); if (this.rootRecordDefinition == null) { throw new Exception("Error initializing BinaryRecordReader. IRecordBuilder provided a null record definition."); } }
Source:
protected Set<IEclipsePreferences> getPreferences() { if (prefs == null) { prefs = new HashSet<IEclipsePreferences>(); PlatformAdmin admin = WorkbenchSWTActivator.getDefault() .getPlatformAdmin(); if (admin == null) { return prefs; } State state = admin.getState(false); BundleDescription[] bundles = state.getBundles(); for (BundleDescription desc : bundles) { if (desc.getName() != null) { prefs.add(InstanceScope.INSTANCE.getNode(desc.getName())); } } } return prefs; }

Target:
protected Set<IEclipsePreferences> getPreferences() { if (prefs == null) { PlatformAdmin admin = WorkbenchSWTActivator.getDefault() .getPlatformAdmin(); if (admin == null) { return Collections.emptySet(); } State state = admin.getState(false); BundleDescription[] bundles = state.getBundles(); prefs = new HashSet<IEclipsePreferences>(); for (BundleDescription desc : bundles) { if (desc.getName() != null) { prefs.add(InstanceScope.INSTANCE.getNode(desc.getName())); } } } return prefs; }
Source:
public String toString() { return String.format("vdsId = %s vmId = %s volumeId = %s", getVdsId(), getVmId(), diskImage.getId()); }

Target:
public String toString() { return String.format("%s, volumeId = %s", super.toString(), diskImage.getId()); }
Source:
public void testGetClosestTopLevelDataType() { final DataType dataType0 = makeDataType("name", "Text", false); final DataType dataType1 = makeDataType("name", "Text", false); final DataType dataType2 = makeDataType("name", "Text", false); final DataType dataType3 = makeDataType("city", "tCity", false); final DataType dataType5 = makeDataType("street", "Structure", false, dataType1); final DataType dataType4 = makeDataType("tCity", "Structure", true, dataType0, dataType5); final DataType dataType6 = makeDataType("tPerson", "Structure", true, dataType2, dataType3); doReturn(dataType4).when(handler).parent(dataType0); doReturn(dataType4).when(handler).parent(dataType5); doReturn(dataType5).when(handler).parent(dataType1); doReturn(dataType6).when(handler).parent(dataType2); doReturn(dataType6).when(handler).parent(dataType3); when(dataTypeStore.getTopLevelDataTypes()).thenReturn(asList(dataType4, dataType6)); final Optional<DataType> closestTopLevelDataType = handler.getClosestTopLevelDataType(dataType1); final DataType actualDataType = closestTopLevelDataType.orElseThrow(UnsupportedOperationException::new); assertEquals(dataType4, actualDataType); }

Target:
public void testGetClosestTopLevelDataType() { final DataType dataType0 = makeDataType("name", "Text", false); final DataType dataType1 = makeDataType("name", "Text", false); final DataType dataType2 = makeDataType("name", "Text", false); final DataType dataType3 = makeDataType("city", "tCity", false); final DataType dataType5 = makeDataType("street", "Structure", false, dataType1); final DataType dataType4 = makeDataType("tCity", "Structure", true, dataType0, dataType5); final DataType dataType6 = makeDataType("tPerson", "Structure", true, dataType2, dataType3); doReturn(dataType4).when(handler).parent(dataType0); doReturn(dataType4).when(handler).parent(dataType5); doReturn(dataType5).when(handler).parent(dataType1); doReturn(dataType6).when(handler).parent(dataType2); doReturn(dataType6).when(handler).parent(dataType3); when(dataTypeStore.getTopLevelDataTypes()).thenReturn(asList(dataType4, dataType6)); final DataType closestTopLevelDataTypeForDataType1 = handler.getClosestTopLevelDataType(dataType1).orElseThrow(UnsupportedOperationException::new); final DataType closestTopLevelDataTypeForDataType3 = handler.getClosestTopLevelDataType(dataType3).orElseThrow(UnsupportedOperationException::new); assertEquals(dataType4, closestTopLevelDataTypeForDataType1); assertEquals(dataType6, closestTopLevelDataTypeForDataType3); }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getGlusterVolume().getStatus() == GlusterStatus.DOWN) { failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_DOWN, getGlusterVolumeName()); } if (getGlusterVolume().getAsyncTask().getStatus() == JobExecutionStatus.STARTED) { failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_OPERATION_IN_PROGRESS, getGlusterVolumeName(), getVdsGroupName()); } return true; }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getGlusterVolume().getStatus() != GlusterStatus.DOWN) { failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_IS_UP, getGlusterVolumeName()); } for (GlusterGeoRepSession session : georepSessions) { if (session.getSlaveVolumeId() == null || session.getSlaveNodeUuid() == null) { failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_REMOTE_CLUSTER_NOT_MAINTAINED_BY_ENGINE); } } return true; }
Source:
public void testCDAVDSDoesNotSupportVirtServices() { vds.setId(Guid.newGuid()); vds.setClusterSupportsVirtService(false); ValidateTestUtils.runAndAssertValidateFailure("validate did not fail on cluster withou virt services", command, EngineMessage.CANNOT_FORCE_SELECT_SPM_CLUSTER_DOES_NOT_SUPPORT_VIRT_SERVICES); }

Target:
public void testCDAVDSDoesNotSupportVirtServices() { vds.setId(Guid.newGuid()); vds.setClusterSupportsVirtService(false); ValidateTestUtils.runAndAssertValidateFailure("validate did not fail on host without virt services", command, EngineMessage.CANNOT_FORCE_SELECT_SPM_HOST_DOES_NOT_SUPPORT_VIRT_SERVICES); }
Source:
private void fillFieldsFromMetadataFile() throws PreferencesException { if (this.rdf != null) { for (AdditionalField field : this.additionalFields) { if (field.isUghbinding() && field.getShowDependingOnDoctype()) { DocStructInterface myTempStruct = this.rdf.getDigitalDocument().getLogicalDocStruct(); if (field.getDocstruct().equals("firstchild")) { try { myTempStruct = this.rdf.getDigitalDocument().getLogicalDocStruct().getAllChildren().get(0); } catch (RuntimeException e) { logger.error(e.getMessage(), e); } } if (field.getDocstruct().equals("boundbook")) { myTempStruct = this.rdf.getDigitalDocument().getPhysicalDocStruct(); } try { if (field.getMetadata().equals("ListOfCreators")) { StringBuilder authors = new StringBuilder(); if (myTempStruct.getAllPersons() != null) { for (PersonInterface p : myTempStruct.getAllPersons()) { authors.append(p.getLastName()); if (StringUtils.isNotBlank(p.getFirstName())) { authors.append(", "); authors.append(p.getFirstName()); } authors.append("; "); } if (authors.toString().endsWith("; ")) { authors.setLength(authors.length() - 2); } } field.setValue(authors.toString()); } else { MetadataTypeInterface mdt = UghHelper.getMetadataType( serviceManager.getRulesetService().getPreferences(this.prozessKopie.getRuleset()), field.getMetadata()); MetadataInterface md = UghHelper.getMetadata(myTempStruct, mdt); if (md != null) { field.setValue(md.getValue()); md.setStringValue(field.getValue().replace("&amp;", "&")); } } } catch (UghHelperException e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung(e.getMessage(), ""); } if (field.getValue() != null && !field.getValue().equals("")) { field.setValue(field.getValue().replace("&amp;", "&")); } } } } }

Target:
private void fillFieldsFromMetadataFile() throws PreferencesException { if (this.rdf != null) { for (AdditionalField field : this.additionalFields) { if (field.isUghbinding() && field.getShowDependingOnDoctype()) { DocStructInterface myTempStruct = this.rdf.getDigitalDocument().getLogicalDocStruct(); if (field.getDocstruct().equals("firstchild")) { try { myTempStruct = this.rdf.getDigitalDocument().getLogicalDocStruct().getAllChildren().get(0); } catch (RuntimeException e) { logger.error(e.getMessage(), e); } } if (field.getDocstruct().equals("boundbook")) { myTempStruct = this.rdf.getDigitalDocument().getPhysicalDocStruct(); } try { if (field.getMetadata().equals("ListOfCreators")) { field.setValue(getAuthors(myTempStruct.getAllPersons())); } else { MetadataTypeInterface mdt = UghHelper.getMetadataType( serviceManager.getRulesetService().getPreferences(this.prozessKopie.getRuleset()), field.getMetadata()); MetadataInterface md = UghHelper.getMetadata(myTempStruct, mdt); if (md != null) { field.setValue(md.getValue()); md.setStringValue(field.getValue().replace("&amp;", "&")); } } } catch (UghHelperException e) { Helper.setErrorMessage(e.getMessage(), logger, e); } if (field.getValue() != null && !field.getValue().equals("")) { field.setValue(field.getValue().replace("&amp;", "&")); } } } } }
Source:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck, boolean checkFilemode, FS fs) { if (entry.isAssumeValid()) return false; if (getEntryLength() != entry.getLength()) return true; if (checkFilemode) { if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode()) && !fs.supportsExecute()) { if (!FileMode.REGULAR_FILE.equals(getEntryRawMode())) return true; } else { if (entry.getRawMode() != getEntryRawMode()) return true; } } long cacheLastModified = entry.getLastModified(); long fileLastModified = getEntryLastModified(); if (cacheLastModified % 1000 == 0) fileLastModified = fileLastModified - fileLastModified % 1000; if ((fileLastModified != cacheLastModified) && !forceContentCheck) return true; return (!getEntryObjectId().equals(entry.getObjectId())); }

Target:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck, boolean checkFilemode, FS fs) { if (entry.isAssumeValid()) return false; if (getEntryLength() != entry.getLength()) return true; int modeDiff = getEntryRawMode() ^ entry.getRawMode(); if (!checkFilemode) modeDiff &= ~FileMode.EXECUTABLE_FILE.getBits(); if (modeDiff!=0) return true; long cacheLastModified = entry.getLastModified(); long fileLastModified = getEntryLastModified(); if (cacheLastModified % 1000 == 0) fileLastModified = fileLastModified - fileLastModified % 1000; if ((fileLastModified != cacheLastModified) && !forceContentCheck) return true; if (forceContentCheck) { if (fileLastModified == cacheLastModified) return false; else return !getEntryObjectId().equals(entry.getObjectId()); } else { return fileLastModified != cacheLastModified; } }
Source:
public void testCompletingCheckoutWithNullCheckoutToken() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(1); try { buyClient.completeCheckout(paymentToken, null); } catch (IllegalArgumentException e) { latch.countDown(); return; } latch.await(); fail("Expected an IllegalArgumentException"); }

Target:
public void testCompletingCheckoutWithNullCheckoutToken() throws InterruptedException { try { buyClient.completeCheckout(paymentToken, null); } catch (IllegalArgumentException e) { return; } fail("Expected an IllegalArgumentException"); }
Source:
public Factory(RuntimeConfiguration runtimeConfiguration, Article parentArticle, Collection<Annotation> comments) { this.competingInterestThreshold = Date.from(runtimeConfiguration.getCompetingInterestThreshold() .atStartOfDay(ZoneId.systemDefault()).toInstant()); this.parentArticle = ArticleVisibility.create(parentArticle); this.commentsByParent = comments.stream() .filter(comment -> comment.getParentID() != null) .collect(Collectors.groupingBy(Annotation::getParentID)); }

Target:
public Factory(RuntimeConfiguration runtimeConfiguration, Article parentArticle, Collection<Annotation> comments) { this.competingInterestPolicyStart = Date.from(runtimeConfiguration.getCompetingInterestPolicyStart() .atStartOfDay(ZoneId.systemDefault()).toInstant()); this.parentArticle = ArticleVisibility.create(parentArticle); this.commentsByParent = comments.stream() .filter(comment -> comment.getParentID() != null) .collect(Collectors.groupingBy(Annotation::getParentID)); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Group group = (Group) o; return layout == group.layout; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; if (!super.equals(o)) return false; Group group = (Group) o; return layout == group.layout; }