auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void test19CloseImportedProjectsZipFile() throws Exception { IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); String zipName = "ImportExistingProjectsWizardTestRebuildProject"; zipLocation = copyZipLocation(zipName, zipName); IProject[] workspaceProjects = root.getProjects(); for (IProject workspaceProject : workspaceProjects) { FileUtil.deleteProject(workspaceProject); } WizardProjectsImportPage wpip = getNewWizard(); HashSet<String> projects = new HashSet<>(); projects.add("ImportExistingProjectsWizardTestRebuildProject"); wpip.getProjectFromDirectoryRadio().setSelection(false); wpip.setCloseProjectsAfterImport(true); wpip.updateProjectsList(zipLocation); ProjectRecord[] selectedProjects = wpip.getProjectRecords(); ArrayList<String> projectNames = new ArrayList<>(); for (ProjectRecord selectedProject : selectedProjects) { projectNames.add(selectedProject.getProjectName()); } assertTrue("Expected import wizard to find projects: " + projects + ", instead it detects: " + projectNames, projectNames.containsAll(projects)); CheckboxTreeViewer projectsList = wpip.getProjectsList(); projectsList.setCheckedElements(selectedProjects); wpip.createProjects(); IProject testProject = root.getProject("ImportExistingProjectsWizardTestRebuildProject"); assertFalse("Expected imported project to be closd due to setting dialog option checkbox", testProject.isAccessible()); }

Target:
public void test19CloseImportedProjectsZipFile() throws Exception { WizardProjectsImportPage wpip = createImportWizardWithZipLocation( "ImportExistingProjectsWizardTestRebuildProject"); wpip.setCloseProjectsAfterImport(true); wpip.createProjects(); IProject testProject = ResourcesPlugin.getWorkspace().getRoot() .getProject("ImportExistingProjectsWizardTestRebuildProject"); assertFalse("Expected imported project to be closd due to setting dialog option checkbox", testProject.isAccessible()); }
Source:
public void testDrivingInternalRepartitioningForwardingTimestampTopology() { driver = new TopologyTestDriver(createInternalRepartitioningWithValueTimestampTopology(), props); final TestInputTopic<String, String> inputTopic = driver.createInputTopic(INPUT_TOPIC_1, STRING_SERIALIZER, STRING_SERIALIZER); inputTopic.pipeInput("key1", "value1@1000"); inputTopic.pipeInput("key2", "value2@2000"); inputTopic.pipeInput("key3", "value3@3000"); assertThat(driver.readOutput(OUTPUT_TOPIC_1, STRING_DESERIALIZER, STRING_DESERIALIZER), equalTo(new ProducerRecord<>(OUTPUT_TOPIC_1, null, 1000L, "key1", "value1"))); assertThat(driver.readOutput(OUTPUT_TOPIC_1, STRING_DESERIALIZER, STRING_DESERIALIZER), equalTo(new ProducerRecord<>(OUTPUT_TOPIC_1, null, 2000L, "key2", "value2"))); assertThat(driver.readOutput(OUTPUT_TOPIC_1, STRING_DESERIALIZER, STRING_DESERIALIZER), equalTo(new ProducerRecord<>(OUTPUT_TOPIC_1, null, 3000L, "key3", "value3"))); }

Target:
public void testDrivingInternalRepartitioningForwardingTimestampTopology() { driver = new TopologyTestDriver(createInternalRepartitioningWithValueTimestampTopology(), props); final TestInputTopic<String, String> inputTopic = driver.createInputTopic(INPUT_TOPIC_1, STRING_SERIALIZER, STRING_SERIALIZER); inputTopic.pipeInput("key1", "value1@1000"); inputTopic.pipeInput("key2", "value2@2000"); inputTopic.pipeInput("key3", "value3@3000"); final TestOutputTopic<String, String> outputTopic = driver.createOutputTopic(OUTPUT_TOPIC_1, STRING_DESERIALIZER, STRING_DESERIALIZER); assertThat(outputTopic.readRecord(), equalTo(new TestRecord<>("key1", "value1", null, 1000L))); assertThat(outputTopic.readRecord(), equalTo(new TestRecord<>("key2", "value2", null, 2000L))); assertThat(outputTopic.readRecord(), equalTo(new TestRecord<>("key3", "value3", null, 3000L))); }
Source:
protected String quoteStringLiteral(String value) { StringWriter sw = new StringWriter(); JsonWriter writer = new JsonWriter(sw); try { writer.setLenient(true); writer.value(value); writer.flush(); writer.close(); } catch (IOException ex) { throw new RuntimeException("Unexpected I/O failure: " + ex.getLocalizedMessage(), ex); } return sw.toString(); }

Target:
protected String quoteStringLiteral(String value) { StringWriter sw = new StringWriter(); try (JsonWriter writer = new JsonWriter(sw)) { writer.setLenient(true); writer.value(value); writer.flush(); } catch (IOException ex) { throw new RuntimeException("Unexpected I/O failure: " + ex.getLocalizedMessage(), ex); } return sw.toString(); }
Source:
public static WeatherChangeEvent createWeatherChange(Game game, WeatherUniverse weatherUniverse, Weather initialWeather, Weather resultingWeather) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("initialWeather", initialWeather); values.put("weatherVolume", weatherUniverse); values.put("resultingWeather", resultingWeather); return createEvent(WeatherChangeEvent.class, values); }

Target:
public static WeatherChangeEvent createWeatherChange(Game game, WeatherUniverse weatherUniverse, Weather initialWeather, Weather resultingWeather) { Map<String, Object> values = Maps.newHashMap(); values.put("game", game); values.put("initialWeather", initialWeather); values.put("weatherUniverse", weatherUniverse); values.put("resultingWeather", resultingWeather); return createEvent(WeatherChangeEvent.class, values); }
Source:
public AuthorizationPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) { Capabilities capabilities = capabilities(descriptor.id()); PluggableInstanceSettings authConfigSettings = authConfigSettings(descriptor.id()); PluggableInstanceSettings roleSettings = roleSettings(descriptor.id(), capabilities); Image image = image(descriptor.id()); return new AuthorizationPluginInfo(descriptor, authConfigSettings, roleSettings, image, capabilities, null); }

Target:
public AuthorizationPluginInfo pluginInfoFor(GoPluginDescriptor descriptor) { Capabilities capabilities = capabilities(descriptor.id()); PluggableInstanceSettings authConfigSettings = authConfigSettings(descriptor.id()); PluggableInstanceSettings roleSettings = roleSettings(descriptor.id(), capabilities); PluggableInstanceSettings pluginSettingsAndView = getPluginSettingsAndView(descriptor, extension); Image image = image(descriptor.id()); return new AuthorizationPluginInfo(descriptor, authConfigSettings, roleSettings, image, capabilities, pluginSettingsAndView); }
Source:
@Test public void testHasSomeEffect() { Policy p = Parser.parse("script-src *", "<LINK_0>"); assertFalse(p.hasSomeEffect()); p = Parser.parse("script-src a; upgrade-insecure-requests; report-to a", "<LINK_0>"); assertTrue(p.hasSomeEffect()); p = Parser.parse("report-to a", "<LINK_0>"); assertFalse(p.hasSomeEffect()); }

Target:
@Test public void testHasSomeEffect() { Policy p = Parser.parse("", "<LINK_0>"); assertFalse(p.hasSomeEffect()); p = Parser.parse("script-src a; upgrade-insecure-requests; report-to a", "<LINK_0>"); assertTrue(p.hasSomeEffect()); p = Parser.parse("report-to a", "<LINK_0>"); assertFalse(p.hasSomeEffect()); }
Source:
private CachedBytecodeGenerator mockCachePerClassLoaderOf(ClassLoader classLoader) { classLoader = classLoader == null ? BOOT_LOADER : classLoader; CachedBytecodeGenerator generator = avoidingClassLeakageCache.get(new StrongKey<ClassLoader>(classLoader)), newGenerator; if (generator == null) { generator = avoidingClassLeakageCache.putIfAbsent(new WeakKey<ClassLoader>(classLoader, this), newGenerator = new CachedBytecodeGenerator(mockBytecodeGenerator, weak)); if (generator == null) { generator = newGenerator; } } return generator; }

Target:
private CachedBytecodeGenerator mockCachePerClassLoaderOf(ClassLoader classLoader) { classLoader = classLoader == null ? BOOT_LOADER : classLoader; CachedBytecodeGenerator generator = avoidingClassLeakageCache.get(new LookupKey(classLoader)); if (generator == null) { CachedBytecodeGenerator newGenerator = new CachedBytecodeGenerator(mockBytecodeGenerator, weak); generator = avoidingClassLeakageCache.putIfAbsent(new WeakKey(classLoader, this), newGenerator); if (generator == null) { generator = newGenerator; } } return generator; }
Source:
public void setParticipantDetails() { if (fParticipant.getEmail() == null || fParticipant.getEmail().equals("")) { if (fParticipant.getId().equals( R4EUIPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.P_USER_ID))) { String email = R4EUIPlugin.getDefault() .getPreferenceStore() .getString(PreferenceConstants.P_USER_EMAIL); fParticipant.setEmail(email); } else if (R4EUIModelController.isUserQueryAvailable()) { try { final IQueryUser query = new QueryUserFactory().getInstance(); final List<IUserInfo> info = query.searchByUserId(fParticipant.getId()); if (info.size() > 0) { final IUserInfo userInfo = info.get(0); fParticipantDetails = UIUtils.buildUserDetailsString(userInfo); if (null == fParticipant.getEmail() || fParticipant.getEmail().length() < 1) { fParticipant.setEmail(userInfo.getEmail()); } } } catch (NamingException e) { R4EUIPlugin.Ftracer.traceWarning("Exception: " + e.toString() + " (" + e.getMessage() + ")"); } catch (IOException e) { R4EUIPlugin.Ftracer.traceWarning("Exception: " + e.toString() + " (" + e.getMessage() + ")"); } } else { fParticipant.setEmail(""); } } }

Target:
public void setParticipantDetails() { if (fParticipant.getEmail() == null || fParticipant.getEmail().equals("")) { if (fParticipant.getId().equals( R4EUIPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.P_USER_ID))) { String email = R4EUIPlugin.getDefault() .getPreferenceStore() .getString(PreferenceConstants.P_USER_EMAIL); fParticipant.setEmail(email); } if (R4EUIModelController.isUserQueryAvailable()) { try { final IQueryUser query = new QueryUserFactory().getInstance(); final List<IUserInfo> info = query.searchByUserId(fParticipant.getId()); if (info.size() > 0) { final IUserInfo userInfo = info.get(0); fParticipantDetails = UIUtils.buildUserDetailsString(userInfo); if (null == fParticipant.getEmail() || fParticipant.getEmail().length() < 1) { fParticipant.setEmail(userInfo.getEmail()); } } } catch (NamingException e) { R4EUIPlugin.Ftracer.traceWarning("Exception: " + e.toString() + " (" + e.getMessage() + ")"); } catch (IOException e) { R4EUIPlugin.Ftracer.traceWarning("Exception: " + e.toString() + " (" + e.getMessage() + ")"); } } if (fParticipant.getEmail() == null) { fParticipant.setEmail(""); } } }
Source:
public FileFormat getFormat() { try { return FileFormat.valueOf(format.toUpperCase()); } catch (IllegalArgumentException e) { String values = Arrays.stream(FileFormat.values()) .map(f -> f.name().toLowerCase()) .collect(Collectors.joining(", ")); throw new IllegalArgumentException(String.format("Invalid format '%s'. The value must be one of %s", format, values)); } }

Target:
public FileFormat getFormat() { return FileFormat.from(format); }
Source:
private void peerProbeAlternateInterfaces(Network glusterNetwork, VDS host) { GlusterServer glusterServer = getGlusterServerDao().get(host.getId()); if (glusterNetwork != null && host.getStatus() == VDSStatus.Up && glusterServer != null) { List<VdsNetworkInterface> interfaces = getInterfaceDao().getAllInterfacesForVds(host.getId()); for (VdsNetworkInterface iface : interfaces) { if (glusterNetwork.getName().equals(iface.getNetworkName()) && !StringUtils.isBlank(iface.getAddress()) && !glusterServer.getKnownAddresses().contains(iface.getAddress())) { VDS upServer = getAlternateUpServerInCluster(host.getVdsGroupId(), host.getId()); if (upServer != null) { Boolean peerProbed = glusterPeerProbeAdditionalInterface(upServer.getId(), iface.getAddress()); if (peerProbed) { getGlusterServerDao().addKnownAddress(host.getId(), iface.getAddress()); } } } } } }

Target:
private void peerProbeAlternateInterfaces(Network glusterNetwork, VDS host) { if (glusterNetwork == null || host.getStatus() != VDSStatus.Up) { return; } GlusterServer glusterServer = getGlusterServerDao().get(host.getId()); if (glusterServer == null) { return; } List<VdsNetworkInterface> interfaces = getInterfaceDao().getAllInterfacesForVds(host.getId()); for (VdsNetworkInterface iface : interfaces) { if (glusterNetwork.getName().equals(iface.getNetworkName()) && StringUtils.isNotBlank(iface.getAddress()) && !glusterServer.getKnownAddresses().contains(iface.getAddress())) { VDS upServer = getAlternateUpServerInCluster(host.getVdsGroupId(), host.getId()); if (upServer != null) { boolean peerProbed = glusterPeerProbeAdditionalInterface(upServer.getId(), iface.getAddress()); if (peerProbed) { getGlusterServerDao().addKnownAddress(host.getId(), iface.getAddress()); } } } } }
Source:
protected void collect(final Object message) { final ActorRef self = self(); final Collect request = (Collect) message; stop(lastEvent); Object signal; if (request.type() == Collect.Type.DTMF) { final PlayCollect.Builder builder = PlayCollect.builder(); for (final URI prompt : request.prompts()) { builder.addPrompt(prompt); } builder.setClearDigitBuffer(true); builder.setDigitPattern(request.pattern()); builder.setFirstDigitTimer(request.timeout()); builder.setInterDigitTimer(request.timeout()); builder.setEndInputKey(request.endInputKey()); builder.setMaxNumberOfDigits(request.numberOfDigits()); signal = builder.build(); this.lastEvent = AUMgcpEvent.aupc; } else { this.lastEvent = AsrSignal.REQUEST_ASR; signal = new AsrSignal(request.getDriver(), request.lang(), request.prompts(), request.endInputKey(), 60, request.timeout(), request.timeout(), request.getHints(), request.type().toString() ,request.numberOfDigits()); } this.originator = sender(); ivr.tell(signal, self); ivrInUse = true; }

Target:
protected void collect(final Object message) { final ActorRef self = self(); final Collect request = (Collect) message; stop(lastEvent); Object signal; if (request.type() == Collect.Type.DTMF) { final PlayCollect.Builder builder = PlayCollect.builder(); for (final URI prompt : request.prompts()) { builder.addPrompt(prompt); } builder.setClearDigitBuffer(true); builder.setDigitPattern(request.pattern()); builder.setFirstDigitTimer(request.timeout()); builder.setInterDigitTimer(request.timeout()); builder.setEndInputKey(request.endInputKey()); builder.setMaxNumberOfDigits(request.numberOfDigits()); signal = builder.build(); this.lastEvent = AUMgcpEvent.aupc; } else { this.lastEvent = AsrSignal.REQUEST_ASR; signal = new AsrSignal(request.getDriver(), request.lang(), request.prompts(), request.endInputKey(), request.timeout(), request.timeout(), request.timeout(), request.getHints(), request.type().toString() ,request.numberOfDigits()); } this.originator = sender(); ivr.tell(signal, self); ivrInUse = true; }
Source:
public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) { this.problemReporter = problemReporter; this.options = problemReporter.options; this.optimizeStringLiterals = optimizeStringLiterals; initializeScanner(); this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8; this.parsingJava9Plus = this.options.sourceLevel >= ClassFileConstants.JDK9; this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11; this.parsingJava12Plus = this.options.sourceLevel >= ClassFileConstants.JDK12; this.parsingJava13Plus = this.options.sourceLevel >= ClassFileConstants.JDK13; this.astLengthStack = new int[50]; this.expressionLengthStack = new int[30]; this.typeAnnotationLengthStack = new int[30]; this.intStack = new int[50]; this.identifierStack = new char[30][]; this.identifierLengthStack = new int[30]; this.nestedMethod = new int[30]; this.realBlockStack = new int[30]; this.identifierPositionStack = new long[30]; this.variablesCounter = new int[30]; this.javadocParser = createJavadocParser(); }

Target:
public Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals) { this.problemReporter = problemReporter; this.options = problemReporter.options; this.optimizeStringLiterals = optimizeStringLiterals; initializeScanner(); this.parsingJava8Plus = this.options.sourceLevel >= ClassFileConstants.JDK1_8; this.parsingJava9Plus = this.options.sourceLevel >= ClassFileConstants.JDK9; this.parsingJava14Plus = this.options.sourceLevel >= ClassFileConstants.JDK14; this.parsingJava11Plus = this.options.sourceLevel >= ClassFileConstants.JDK11; this.astLengthStack = new int[50]; this.patternLengthStack = new int[20]; this.expressionLengthStack = new int[30]; this.typeAnnotationLengthStack = new int[30]; this.intStack = new int[50]; this.identifierStack = new char[30][]; this.identifierLengthStack = new int[30]; this.nestedMethod = new int[30]; this.realBlockStack = new int[30]; this.identifierPositionStack = new long[30]; this.variablesCounter = new int[30]; this.recordNestedMethodLevels = new HashMap<>(); this.javadocParser = createJavadocParser(); }
Source:
private void toFront(float delta) { ComeToFrontAction mComeToFrontAction = new ComeToFrontAction(); mComeToFrontAction.setSprite(sprite); mComeToFrontAction.update(delta); }

Target:
private void toFront(float delta) { Action comeToFrontAction = sprite.getActionFactory().createComeToFrontAction(sprite); comeToFrontAction.act(delta); }
Source:
public Optional<String> getOpenArgString() { return Optional.ofNullable(openArg); }

Target:
public String getOpenArgString() { return this.openArg; }
Source:
EWAHCompressedBitmap getBitmap() { Object r = bitmapContainer; if (r instanceof EWAHCompressedBitmap) return (EWAHCompressedBitmap) r; EWAHCompressedBitmap out = ((XorCompressedBitmap) r).bitmap; StoredBitmap sb = this; while ((sb = sb.xorBitmap()) != null) out = out.xor(sb.bitmap()); bitmapContainer = out; return out; }

Target:
EWAHCompressedBitmap getBitmap() { Object r = bitmapContainer; if (r instanceof EWAHCompressedBitmap) return (EWAHCompressedBitmap) r; XorCompressedBitmap xb = (XorCompressedBitmap) r; EWAHCompressedBitmap out = xb.bitmap; while (true) { r = xb.xorBitmap.bitmapContainer; if (r instanceof EWAHCompressedBitmap) { bitmapContainer = out = out.xor((EWAHCompressedBitmap) r); return out; } xb = (XorCompressedBitmap) r; out = out.xor(xb.bitmap); } }
Source:
static Node getFirstGetterMatchingKey(Node n, String keyName) { Preconditions.checkState(n.isClassMembers()); for (Node keyNode : n.children()) { if (keyNode.isGetterDef() && keyNode.getString().equals(keyName)) { return keyNode; } } return null; }

Target:
static Node getFirstGetterMatchingKey(Node n, String keyName) { Preconditions.checkState(n.isClassMembers() || n.isObjectLit()); for (Node keyNode : n.children()) { if (keyNode.isGetterDef() && keyNode.getString().equals(keyName)) { return keyNode; } } return null; }
Source:
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { SoulNetwork network = NetworkHelper.getSoulNetwork(player); if (!world.isRemote) if (player.isSneaking()) { network.setCurrentEssence(Integer.MAX_VALUE); player.sendMessage(new TextComponentTranslation("commands.bloodmagic.network.fill.success", player.getDisplayName().getFormattedText())); } else { network.setCurrentEssence(NetworkHelper.getMaximumForTier(network.getOrbTier())); player.sendMessage(new TextComponentTranslation("commands.bloodmagic.network.cap.success", player.getDisplayName().getFormattedText())); } return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }

Target:
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand) { SoulNetwork network = NetworkHelper.getSoulNetwork(player); if (!world.isRemote) if (player.isSneaking()) { network.setCurrentEssence(Integer.MAX_VALUE); player.sendMessage(new TextComponentTranslation("commands.bloodmagic.network.fill.success", player.getDisplayName())); } else { network.setCurrentEssence(NetworkHelper.getMaximumForTier(network.getOrbTier())); player.sendMessage(new TextComponentTranslation("commands.bloodmagic.network.cap.success", player.getDisplayName())); } return new ActionResult<>(EnumActionResult.SUCCESS, player.getHeldItem(hand)); }
Source:
private boolean _doCookieLogin(String encryptedId, HttpServletRequest request, HttpServletResponse response) { try { String decryptedId = PublicEncryptionFactory.decryptString(encryptedId); User user = null; if (Validator.isEmailAddress(decryptedId)) user = userAPI.loadByUserByEmail(decryptedId, systemUser, false); else user = userAPI.loadUserById(decryptedId, systemUser, false); try { String userName = (authByEmail) ? user.getEmailAddress() : user.getUserId(); return _doLogin(userName, null, true, request, response, true); } catch (Exception e) { SecurityLogger.logInfo(this.getClass(), "An invalid attempt to login (No user found) from IP: " + request.getRemoteAddr() + " : " + e); return false; } } catch (Exception e) { SecurityLogger.logInfo(this.getClass(), "Auto login failed (No user found) from IP: " + request.getRemoteAddr() + " : " + e); if (useCASLoginFilter) { String decryptedId = PublicEncryptionFactory.decryptString(encryptedId); Logger.info(this.getClass(), "Try to retrieve user from LDAP/CAS with id: " + decryptedId); User newUser = CASAuthUtils.loadUserFromLDAP(decryptedId); if (UtilMethods.isSet(newUser)) { User user = null; try { user = (authByEmail) ? userAPI.loadByUserByEmail(decryptedId, systemUser, false) : userAPI.loadUserById(decryptedId, systemUser, false); String userIdFromCAS = (String) request.getSession(false) .getAttribute("edu.yale.its.tp.cas.client.filter.user"); if (UtilMethods.isSet(userIdFromCAS)) { CASAuthUtils.setUserValuesOnSession(user, request, response, true); } return true; } catch (Exception ex) { return false; } } else Logger.info(this.getClass(), "Unable to retrieve user from LDAP/CAS with id: " + decryptedId); } doLogout(request, response); return false; } }

Target:
private boolean _doCookieLogin(String encryptedId, HttpServletRequest request, HttpServletResponse response) { try { String decryptedId = PublicEncryptionFactory.decryptString(encryptedId); User user = null; if (Validator.isEmailAddress(decryptedId)) user = userAPI.loadByUserByEmail(decryptedId, systemUser, false); else user = userAPI.loadUserById(decryptedId, systemUser, false); try { String userName = (authByEmail) ? user.getEmailAddress() : user.getUserId(); return _doLogin(userName, null, true, request, response, true); } catch (Exception e) { SecurityLogger.logInfo(this.getClass(), "An invalid attempt to login (No user found) from IP: " + request.getRemoteAddr() + " : " + e); return false; } } catch (Exception e) { SecurityLogger.logInfo(this.getClass(), "Auto login failed (No user found) from IP: " + request.getRemoteAddr() + " : " + e); doLogout(request, response); return false; } }
Source:
public void lock() { this.delegate.lock(); while (true) { try { while (!doLock()) { Thread.sleep(100); } break; } catch (CannotSerializeTransactionException e) { } catch (TransactionTimedOutException | QueryTimeoutException e) { } catch (InterruptedException e) { } catch (Exception e) { this.delegate.unlock(); rethrowAsLockException(e); } } }

Target:
public void lock() { this.delegate.lock(); while (true) { try { while (!doLock()) { Thread.sleep(100); } break; } catch (CannotSerializeTransactionException e) { } catch (TransactionTimedOutException e) { } catch (QueryTimeoutException e) { } catch (InterruptedException e) { } catch (Exception e) { this.delegate.unlock(); rethrowAsLockException(e); } } }
Source:
private List<WebElement> getShadowRoots(final SearchContext host, String sh, final int limit) { if (null == sh) sh = ""; final StringBuilder sb = new StringBuilder(); sb.append("const sh=arguments[1].replace(/\\/{3,}/g,' sb.append("ptn=/(^[^\\/]*)\\/?(.*$)/,es=[],doc=arguments[0],lmt=arguments[2],f1=function(e,s){"); sb.append(" const rt=e.shadowRoot;"); sb.append(" if(rt&&(0>=lmt||lmt>es.length))0==s.length?(es[es.length]=e):f2(rt,s);"); sb.append("},f2=function(rt,s){"); sb.append(" const p1=s.match(ptn),p2=p1[2].match(ptn);"); sb.append(" if(''==p1[1]){"); sb.append(" rt.querySelectorAll(p2[1]).forEach(function(c){f1(c,p2[2])});"); sb.append(" rt.querySelectorAll('*').forEach(function(c){f1(c,s)});"); sb.append(" }else{"); sb.append(" rt.querySelectorAll(p1[1]).forEach(function(c){f1(c,p1[2])});"); sb.append(" }"); sb.append("};"); sb.append("(doc.shadowRoot?f1:f2)(doc,sh);"); sb.append("return es;"); return (List<WebElement>) getJavascriptExecutor(host).executeScript(sb.toString(), host, sh, limit); }

Target:
private List<WebElement> getShadowRoots(final SearchContext host, String sh, final int limit) { if (null == sh) sh = ""; sh = sh.replace(" ArrayList<WebElement> elems = new ArrayList<WebElement>(); ShadowRootFinder.find(host, sh, (elem) ->{ elems.add((WebElement)elem); return 0<limit && limit <= elems.size(); }); System.out.println("elems.size:"+elems.size()); return elems; }
Source:
public static void main(String[] args ) { try { String apiKey = "You GitHub client id"; String apiSecret = "You Git client secret"; OAuthService service = new ServiceBuilder() .provider(GitHubApi.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback("You github's redirect uri") .build(); Scanner in = new Scanner(System.in); System.out.println("Fetching the Authorization URL..."); String authorizationUrl = service.getAuthorizationUrl(null); System.out.println("Got the Authorization URL!"); System.out.println("Now go and authorize Scribe here:"); System.out.println(authorizationUrl); System.out.println("And paste the authorization code here"); System.out.print(">>"); String nextLine = ""; nextLine = in.nextLine(); Verifier verifier = new Verifier(nextLine); System.out.println(); System.out.println("Trading the Request Token for an Access Token..."); Token accessToken = service.getAccessToken(null, verifier); System.out.println("Got the Access Token!"); System.out.println("(if your curious it looks like this: " + accessToken + " )"); System.out.println(); OAuthRequest request = new OAuthRequest(Verb.GET, "<LINK_0>"); service.signRequest(accessToken, request); Response response = request.send(); System.out.println("Got it! Lets see what we found..."); System.out.println(); System.out.println(response.getCode()); System.out.println(response.getBody()); System.out.println(); System.out.println("Thats it man! Go and build something awesome with Scribe! :)"); } catch(Exception ex) { ex.printStackTrace(); } }

Target:
public static void main(String[] args) { String apiKey = "You GitHub client id"; String apiSecret = "You Git client secret"; OAuthService service = new ServiceBuilder().provider(GitHubApi.class) .apiKey(apiKey) .apiSecret(apiSecret) .callback("You github's redirect uri") .build(); Scanner in = new Scanner(System.in); System.out.println("Fetching the Authorization URL..."); String authorizationUrl = service.getAuthorizationUrl(null); System.out.println("Got the Authorization URL!"); System.out.println("Now go and authorize Scribe here:"); System.out.println(authorizationUrl); System.out.println("And paste the authorization code here"); System.out.print(">>"); String nextLine = ""; nextLine = in.nextLine(); Verifier verifier = new Verifier(nextLine); System.out.println(); System.out.println("Trading the Request Token for an Access Token..."); Token accessToken = service.getAccessToken(null, verifier); System.out.println("Got the Access Token!"); System.out.println("(if your curious it looks like this: "+ accessToken + " )"); System.out.println(); OAuthRequest request = new OAuthRequest(Verb.GET, "<LINK_0>"); service.signRequest(accessToken, request); Response response = request.send(); System.out.println("Got it! Lets see what we found..."); System.out.println(); System.out.println(response.getCode()); System.out.println(response.getBody()); System.out.println(); System.out.println("Thats it man! Go and build something awesome with Scribe! :)"); }
Source:
protected void onDestroy() { SyncthingService mSyncthingService = getService(); if (mSyncthingService != null) { mSyncthingService.registeronServiceStateChangeListener(this); } mWebView.destroy(); mWebView = null; super.onDestroy(); }

Target:
protected void onDestroy() { SyncthingService mSyncthingService = getService(); if (mSyncthingService != null) { mSyncthingService.unregisterOnServiceStateChangeListener(this); } mWebView.destroy(); mWebView = null; super.onDestroy(); }
Source:
private void encodeAltSequences(final Collection<String> alternativeSequences) { List<String> orderedAltSeqs = new ArrayList<>(alternativeSequences); orderedAltSeqs.sort(String::compareTo); setAttribute(ALTERNATIVE_SEQUENCE_NAME_TAG, StringUtil.join(ALTERNATIVE_SEQUENCE_NAME_SEPARATOR, orderedAltSeqs)); }

Target:
private void encodeAltSequences(final Collection<String> alternativeSequences) { setAttribute(ALTERNATIVE_SEQUENCE_NAME_TAG, alternativeSequences.isEmpty() ? null : alternativeSequences.stream() .sorted() .distinct() .peek(SAMSequenceRecord::validateAltRegExp) .collect(Collectors.joining(ALTERNATIVE_SEQUENCE_NAME_SEPARATOR))); }
Source:
private void dismissPreparingDialog() { PrepareDialogFragment fragment = (PrepareDialogFragment) getSupportFragmentManager().findFragmentByTag(getString(R.string.preparedialog)); if (fragment != null && fragment.isAdded()) { fragment.dismiss(); } }

Target:
private void dismissPreparingDialog() { PrepareDialogFragment fragment = (PrepareDialogFragment) getSupportFragmentManager().findFragmentByTag("prepare_dialog"); if (fragment != null && fragment.isAdded()) { fragment.dismiss(); } }
Source:
public Object getValue(int index) throws IndexOutOfBoundsException { final List<SelectItem> scalarFunctionSelectItems = _scalarFunctionDataSet .getScalarFunctionSelectItemsToEvaluate(); final int scalarFunctionCount = scalarFunctionSelectItems.size(); if (index >= scalarFunctionCount) { return _row.getValue(index - scalarFunctionCount); } final SelectItem selectItem = scalarFunctionSelectItems.get(index); if (selectItem.getScalarFunction().equals(FunctionType.CONCAT)) { Object[] parameters = selectItem.getFunctionParameters(); StringBuilder strBuilder = new StringBuilder(); for (Object parameter: parameters) { if (parameter instanceof String) { strBuilder.append(parameter); } else { SelectItem[] items = ((DefaultRow) _row).getHeader().getSelectItems(); String parameterName = ((Column) parameter).getName(); int i = 0; boolean found = false; while (i < items.length && !found) { String columnName = items[i].getColumn().getName(); if (parameterName.equals(columnName)) { strBuilder.append(_row.getValue(i)); found = true; } i++; } } } return strBuilder.toString(); } else { final SelectItem selectItemWithoutFunction = selectItem.replaceFunction(null); return selectItem.getScalarFunction().evaluate(_row, selectItem.getFunctionParameters(), selectItemWithoutFunction); } }

Target:
public Object getValue(int index) throws IndexOutOfBoundsException { final List<SelectItem> scalarFunctionSelectItems = _scalarFunctionDataSet .getScalarFunctionSelectItemsToEvaluate(); final int scalarFunctionCount = scalarFunctionSelectItems.size(); if (index >= scalarFunctionCount) { return _row.getValue(index - scalarFunctionCount); } final SelectItem selectItem = scalarFunctionSelectItems.get(index); final SelectItem selectItemWithoutFunction = selectItem.replaceFunction(null); return selectItem.getScalarFunction().evaluate(_row, selectItem.getFunctionParameters(), selectItemWithoutFunction); }
Source:
protected IStructuredSelection getSelection() { ISelection selection; IHandlerService hsr = (IHandlerService) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getService(IHandlerService.class); IEvaluationContext ctx = hsr.createContextSnapshot(true); selection = (ISelection) ctx .getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (selection instanceof IStructuredSelection) return (IStructuredSelection) selection; return new StructuredSelection(); }

Target:
protected IStructuredSelection getSelection() { ISelection selection; IHandlerService hsr = (IHandlerService) PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getService(IHandlerService.class); IEvaluationContext ctx = hsr.getCurrentState(); selection = (ISelection) ctx .getVariable(ISources.ACTIVE_MENU_SELECTION_NAME); if (selection instanceof IStructuredSelection) return (IStructuredSelection) selection; return new StructuredSelection(); }
Source:
private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD.toString()); getReturnValue().setCanDoAction(false); } return plugVmNicReturnValue.getSucceeded(); }

Target:
private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD.name()); getReturnValue().setCanDoAction(false); } return plugVmNicReturnValue.getSucceeded(); }
Source:
public void after() { LRALogger.logger.debugf("Finised test %s", testName); lraClient.close(); }

Target:
public void after() { LRALogger.logger.debugf("Finished test %s", testName); lraClient.close(); }
Source:
private void updateObjectProperties(ObjectVersionReference version, FedoraObject object, QuadAcc triplesToRemove, QuadDataAcc triplesToInsert) { if (version.isLastVersion()) { for (ObjectProperty p : version.getObjectProperties().listProperties()) { String pred = p.getName(); String obj = p.getValue(); if (pred.equals("info:fedora/fedora-system:def/model#createdDate")) { pred = "<LINK_4>"; } else if (pred.equals("info:fedora/fedora-system:def/model#state")) { pred = "<LINK_0>"; } else if (pred.equals("info:fedora/fedora-system:def/view#lastModifiedDate")) { pred = "<LINK_2>"; updateTriple(triplesToRemove, triplesToInsert, "<LINK_1>", "migration"); } if (isDateProperty(p.getName())) { updateDateTriple(triplesToRemove, triplesToInsert, pred, obj); } else { updateTriple(triplesToRemove, triplesToInsert, pred, obj); } } } if (!triplesToInsert.getQuads().isEmpty() && !triplesToRemove.getQuads().isEmpty()) { updateResourceProperties(object, triplesToRemove, triplesToInsert); } }

Target:
protected void updateObjectProperties(ObjectVersionReference version, FedoraObject object, QuadAcc triplesToRemove, QuadDataAcc triplesToInsert) { if (version.isFirstVersion()) { String now = getCurrentTimeInXSDDateTime(); if (now != null) { addDateEvent(triplesToInsert, "<LINK_3>", getCurrentTimeInXSDDateTime()); } } if (version.isLastVersion()) { for (ObjectProperty p : version.getObjectProperties().listProperties()) { mapObjectProperty(p, triplesToRemove, triplesToInsert); } } if (!triplesToInsert.getQuads().isEmpty() && !triplesToRemove.getQuads().isEmpty()) { updateResourceProperties(object, triplesToRemove, triplesToInsert); } }
Source:
public void layoutIfNecessary() { if (dirtySize != null && control != null && control instanceof Composite) { if (control.getSize().equals(dirtySize)) { ((Composite) control).layout(); flushChildren = false; } } dirtySize = null; }

Target:
public void layoutIfNecessary() { if (dirtySize != null && control != null && control instanceof Composite) { if (control.getSize().equals(dirtySize)) { ((Composite)control).layout(flushChildren); flushChildren = false; } } dirtySize = null; }
Source:
protected Observable<HealthStatusUpdate<EurekaHealthStatusAggregator>> connect() { Observable<HealthStatusUpdate<EurekaHealthStatusAggregator>> updateObservable = registry.healthStatusProviders() .flatMap(new Func1<List<HealthStatusProvider<?>>, Observable<Status>>() { @Override public Observable<Status> call(List<HealthStatusProvider<?>> healthStatusProviders) { List<Observable<HealthStatusUpdate<?>>> healthObservables = new ArrayList<>(healthStatusProviders.size()); for (final HealthStatusProvider provider : healthStatusProviders) { Observable<HealthStatusUpdate<?>> updateObservable = provider.healthStatus(); healthObservables.add(updateObservable); } return Observable.combineLatest(healthObservables, new FuncN<Status>() { @Override public Status call(Object... updates) { Status aggregate = Status.UP; for (Object update : updates) { Status next = ((HealthStatusUpdate<?>) update).getStatus(); if (STATUS_PRIORITY_MAP.get(next) < STATUS_PRIORITY_MAP.get(aggregate)) { aggregate = next; } } return aggregate; } }); } }) .distinct() .map(new Func1<Status, HealthStatusUpdate<EurekaHealthStatusAggregator>>() { @Override public HealthStatusUpdate<EurekaHealthStatusAggregator> call(Status status) { return new HealthStatusUpdate<EurekaHealthStatusAggregator>(status, DESCRIPTOR); } }); BehaviorSubject<HealthStatusUpdate<EurekaHealthStatusAggregator>> subject = BehaviorSubject.create(); updateObservable.subscribe(subject); return subject; }

Target:
protected Observable<HealthStatusUpdate<EurekaHealthStatusAggregator>> connect() { Observable<HealthStatusUpdate<EurekaHealthStatusAggregator>> updateObservable = registry.healthStatusProviders() .flatMap(new Func1<List<HealthStatusProvider<?>>, Observable<Status>>() { @Override public Observable<Status> call(List<HealthStatusProvider<?>> healthStatusProviders) { List<Observable<HealthStatusUpdate<?>>> healthObservables = new ArrayList<>(healthStatusProviders.size()); for (final HealthStatusProvider provider : healthStatusProviders) { Observable<HealthStatusUpdate<?>> updateObservable = provider.healthStatus(); healthObservables.add(updateObservable); } return Observable.combineLatest(healthObservables, new FuncN<Status>() { @Override public Status call(Object... updates) { Status aggregate = Status.UP; for (Object update : updates) { Status next = ((HealthStatusUpdate<?>) update).getStatus(); if (STATUS_PRIORITY_MAP.get(next) < STATUS_PRIORITY_MAP.get(aggregate)) { aggregate = next; } } return aggregate; } }); } }) .distinctUntilChanged() .map(new Func1<Status, HealthStatusUpdate<EurekaHealthStatusAggregator>>() { @Override public HealthStatusUpdate<EurekaHealthStatusAggregator> call(Status status) { return new HealthStatusUpdate<EurekaHealthStatusAggregator>(status, DESCRIPTOR); } }); BehaviorSubject<HealthStatusUpdate<EurekaHealthStatusAggregator>> subject = BehaviorSubject.create(); updateObservable.subscribe(subject); return subject; }
Source:
public static SimpleTableDef[] detectSchema(Client client) { List<String> indexNames = new ArrayList<>(); ClusterStateResponse clusterStateResponse = client.admin().cluster().prepareState().execute().actionGet(); ImmutableOpenMap<String,IndexMetaData> indexes = clusterStateResponse.getState().getMetaData().getIndices(); for (ObjectCursor<String> typeCursor : indexes.keys()) indexNames.add(typeCursor.value); List<SimpleTableDef> result = new ArrayList<>(); for (String indexName : indexNames) { ClusterState cs = client.admin().cluster().prepareState().setIndices(indexName).execute().actionGet().getState(); IndexMetaData imd = cs.getMetaData().index(indexName); ImmutableOpenMap<String, MappingMetaData> mappings = imd.getMappings(); ObjectLookupContainer types = mappings.keys(); for (Object type: types) { String typeName = ((ObjectCursor) type).value.toString(); typeAndIndexes.put(typeName, indexName); try { SimpleTableDef table = detectTable(client, indexName, typeName); result.add(table); } catch(Exception e) } } SimpleTableDef[] tableDefArray = (SimpleTableDef[]) result.toArray(new SimpleTableDef[result.size()]); return tableDefArray; }

Target:
public static SimpleTableDef[] detectSchema(Client client) { List<String> indexNames = new ArrayList(); ClusterStateResponse clusterStateResponse = client.admin().cluster().prepareState().execute().actionGet(); ImmutableOpenMap<String,IndexMetaData> indexes = clusterStateResponse.getState().getMetaData().getIndices(); for (ObjectCursor<String> typeCursor : indexes.keys()) indexNames.add(typeCursor.value); List<SimpleTableDef> result = new ArrayList(); for (String indexName : indexNames) { ClusterState cs = client.admin().cluster().prepareState().setIndices(indexName).execute().actionGet().getState(); IndexMetaData imd = cs.getMetaData().index(indexName); ImmutableOpenMap<String, MappingMetaData> mappings = imd.getMappings(); ObjectLookupContainer indexTypes = mappings.keys(); for (Object indexType: indexTypes) { String typeName = ((ObjectCursor) indexType).value.toString(); try { SimpleTableDef table = detectTable(cs, indexName, typeName); result.add(table); } catch(Exception e) { logger.error("Unexpected error during detectSchema for table: "+typeName, e); } } } SimpleTableDef[] tableDefArray = (SimpleTableDef[]) result.toArray(new SimpleTableDef[result.size()]); return tableDefArray; }
Source:
public void testJoinerConfigWithoutRequiredInputs() { Schema outputSchema = Schema.recordOf( "joined", Schema.Field.of("film_id", Schema.of(Schema.Type.STRING)), Schema.Field.of("film_name", Schema.of(Schema.Type.STRING)), Schema.Field.of("renamed_actor", Schema.nullableOf(Schema.of(Schema.Type.STRING))), Schema.Field.of("renamed_category", Schema.nullableOf(Schema.of(Schema.Type.STRING)))); Map<String, Map<String, String>> selectedFields = new HashMap<>(); selectedFields.put("film", com.google.common.collect.ImmutableMap.of("film_id", "film_id", "film_name", "film_name")); selectedFields.put("filmActor", com.google.common.collect.ImmutableMap.of("actor_name", "renamed_actor")); selectedFields.put("filmCategory", com.google.common.collect.ImmutableMap.of("category_name", "renamed_category")); JoinerConfig config = new JoinerConfig("film.film_id=filmActor.film_id=filmCategory.film_id&" + "film.film_name=filmActor.film_name=filmCategory.film_name", GSON.toJson(selectedFields), "film"); MockPipelineConfigurer pipelineConfigurer = new MockPipelineConfigurer( ImmutableMap.<String, Schema>of("film", filmSchema, "filmActor", filmActorSchema, "filmCategory", filmCategorySchema)); Joiner joiner = new Joiner(config); joiner.configurePipeline(pipelineConfigurer); Assert.assertEquals(outputSchema, pipelineConfigurer.getOutputSchema()); }

Target:
public void testJoinerConfigWithoutRequiredInputs() { Schema outputSchema = Schema.recordOf( "joined", Schema.Field.of("film_id", Schema.of(Schema.Type.STRING)), Schema.Field.of("film_name", Schema.of(Schema.Type.STRING)), Schema.Field.of("renamed_actor", Schema.nullableOf(Schema.of(Schema.Type.STRING))), Schema.Field.of("renamed_category", Schema.nullableOf(Schema.of(Schema.Type.STRING)))); JoinerConfig config = new JoinerConfig("film.film_id=filmActor.film_id=filmCategory.film_id&" + "film.film_name=filmActor.film_name=filmCategory.film_name", selectedFields, "film"); MockPipelineConfigurer pipelineConfigurer = new MockPipelineConfigurer( ImmutableMap.of("film", filmSchema, "filmActor", filmActorSchema, "filmCategory", filmCategorySchema)); Joiner joiner = new Joiner(config); joiner.configurePipeline(pipelineConfigurer); Assert.assertEquals(outputSchema, pipelineConfigurer.getOutputSchema()); }
Source:
private LookupRef lowestIdFromPrecedentSource( Set<LookupRef> selectedEquivs, Application application ) { LookupRef lowestId = null; for (LookupRef lookupRef : Iterables.filter(selectedEquivs, fromSource(application.getConfiguration().getEnabledReadSources().asList().get(0)))) { lowestId = nullSafeRefById.min(lowestId, lookupRef); } return lowestId; }

Target:
private LookupRef lowestIdFromPrecedentSource( Set<LookupRef> selectedEquivs, Application application ) { LookupRef lowestId = null; Publisher publisher = application.getConfiguration() .getReadPrecedenceOrdering() .sortedCopy(application.getConfiguration().getEnabledReadSources()) .get(0); Iterable<LookupRef> lookupRefs = selectedEquivs.stream() .filter(fromSource(publisher)::apply) .collect(Collectors.toList()); for (LookupRef lookupRef : lookupRefs) { lowestId = nullSafeRefById.min(lowestId, lookupRef); } return lowestId; }
Source:
public void acceptAST(ICompilationUnit source, CompilationUnit ast) { String cuKey; IJavaElement parent = source.getParent(); if (parent == null) cuKey = source.getElementName(); else cuKey = String.format("%s/%s", parent.getElementName().replace('.', '/'), source.getElementName()); context.getUnprocessed().remove(cuKey); ProjectState state = context.getState(); HashMap<String, String> dsKeys = new HashMap<String, String>(); HashSet<DSAnnotationProblem> problems = new HashSet<DSAnnotationProblem>(); ast.accept(new AnnotationVisitor(this, state, dsKeys, problems)); Collection<String> oldDSKeys = state.updateMappings(cuKey, dsKeys); if (oldDSKeys != null) { oldDSKeys.removeAll(dsKeys.values()); context.getAbandoned().addAll(oldDSKeys); } if (!problems.isEmpty()) { char[] filename = source.getResource().getFullPath().toString().toCharArray(); for (DSAnnotationProblem problem : problems) { problem.setOriginatingFileName(filename); if (problem.getSourceStart() >= 0) problem.setSourceLineNumber(ast.getLineNumber(problem.getSourceStart())); } BuildContext buildContext = fileMap.get(source); if (buildContext != null) buildContext.recordNewProblems(problems.toArray(new CategorizedProblem[problems.size()])); } }

Target:
public void acceptAST(ICompilationUnit source, CompilationUnit ast) { String cuKey; IJavaElement parent = source.getParent(); if (parent == null) cuKey = source.getElementName(); else cuKey = String.format("%s/%s", parent.getElementName().replace('.', '/'), source.getElementName()); context.getUnprocessed().remove(cuKey); ProjectState state = context.getState(); HashMap<String, String> dsKeys = new HashMap<>(); HashSet<DSAnnotationProblem> problems = new HashSet<>(); ast.accept(new AnnotationVisitor(this, state, dsKeys, problems)); Collection<String> oldDSKeys = state.updateMappings(cuKey, dsKeys); if (oldDSKeys != null) { oldDSKeys.removeAll(dsKeys.values()); context.getAbandoned().addAll(oldDSKeys); } if (!problems.isEmpty()) { char[] filename = source.getResource().getFullPath().toString().toCharArray(); for (DSAnnotationProblem problem : problems) { problem.setOriginatingFileName(filename); if (problem.getSourceStart() >= 0) problem.setSourceLineNumber(ast.getLineNumber(problem.getSourceStart())); } BuildContext buildContext = fileMap.get(source); if (buildContext != null) buildContext.recordNewProblems(problems.toArray(new CategorizedProblem[problems.size()])); } }
Source:
public OutputColumns getOutputColumns() { return new OutputColumns(String.class, baseColumn.getName() + " (subtracted)"); }

Target:
public OutputColumns getOutputColumns() { return new OutputColumns(String.class, baseColumn.getName() + " (substring removed)"); }
Source:
public void GIICompletesSuccessfullyWhenRunningDuringClearWithThirdDatastore() { initDataStores(NUM_SERVERS + 1); configureServers(regionShortcut); verifyRegionSizes(DATA_SIZE); dataStores[1].invoke(new SerializableRunnable() { @Override public void run() { PauseDuringGIICallback myAfterReceivedImageReply = new PauseDuringGIICallback( InitialImageOperation.GIITestHookType.AfterReceivedRequestImage, "_B__testPR_9"); InitialImageOperation.setGIITestHook(myAfterReceivedImageReply); } }); cluster.stop(2); createDelta(50); restartServerOnVM(2); AsyncInvocation async = createRegionAsync(dataStores[1]); invokeClear(dataStores[0]); dataStores[1].invoke(() -> InitialImageOperation.resetGIITestHook( InitialImageOperation.GIITestHookType.AfterReceivedRequestImage, true)); try { async.getResult(30000); } catch (InterruptedException ex) { Assert.fail("Async create interupted" + ex.getMessage()); } verifyRegionSizes(0); }

Target:
public void GIICompletesSuccessfullyWhenRunningDuringClearWithThirdDatastore() { startServers(NUM_SERVERS + 1); verifyRegionSizes(DATA_SIZE); serverVMs[1].invoke(() -> { PauseDuringGIICallback myAfterReceivedImageReply = new PauseDuringGIICallback( InitialImageOperation.GIITestHookType.AfterReceivedRequestImage, "_B__testPR_9"); InitialImageOperation.setGIITestHook(myAfterReceivedImageReply); }); cluster.stop(2); createDelta(50); restartServerOnVM(2); AsyncInvocation async = createRegionAsync(serverVMs[1]); invokeClear(serverVMs[0]); serverVMs[1].invoke(() -> InitialImageOperation.resetGIITestHook( InitialImageOperation.GIITestHookType.AfterReceivedRequestImage, true)); try { async.getResult(30000); } catch (InterruptedException ex) { Assert.fail("Async create interupted" + ex.getMessage()); } verifyRegionSizes(0); }