auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private List<ReferenceCountExchangeClient> getSharedClient(URL url, int connectNum) { String key = url.getAddress(); List<ReferenceCountExchangeClient> clients = referenceClientMap.get(key); boolean firstBuild = false; if (clients == null) { List<ReferenceCountExchangeClient> referenceCountExchangeClients = buildReferenceCountExchangeClientList(url, key, connectNum); referenceClientMap.put(key, referenceCountExchangeClients); clients = referenceCountExchangeClients; firstBuild = true; } for (int i = 0; i < clients.size(); i++) { ReferenceCountExchangeClient client = clients.get(i); if (client.isClosed()) { client = buildReferenceCountExchangeClient(url, key); clients.set(i, client); } else if (!firstBuild) { client.incrementAndGetCount(); } } return clients; }

Target:
private List<ReferenceCountExchangeClient> getSharedClient(URL url, int connectNum) { String key = url.getAddress(); List<ReferenceCountExchangeClient> clients = referenceClientMap.get(key); if (checkClientCanUse(clients)) { batchClientRefIncr(clients); return clients; } locks.putIfAbsent(key, new Object()); synchronized (locks.get(key)) { clients = referenceClientMap.get(key); if (checkClientCanUse(clients)) { batchClientRefIncr(clients); return clients; } connectNum = Math.max(connectNum, 1); if (CollectionUtils.isEmpty(clients)) { clients = buildReferenceCountExchangeClientList(url, connectNum); referenceClientMap.put(key, clients); } else { for (int i = 0; i < clients.size(); i++) { ReferenceCountExchangeClient referenceCountExchangeClient = clients.get(i); if (referenceCountExchangeClient == null || referenceCountExchangeClient.isClosed()) { clients.set(i, buildReferenceCountExchangeClient(url)); continue; } referenceCountExchangeClient.incrementAndGetCount(); } } locks.remove(key); return clients; } }
Source:
public void getCallSetWithInvalidIDShouldFail() throws AvroRemoteException { final String nonexistentCallSetId = Utils.randomId(); final GAWrapperException t = Utils.catchGAWrapperException(() -> client.variants.getCallSet(nonexistentCallSetId)); assertThat(t.getHttpStatusCode()).isEqualTo(HttpURLConnection.HTTP_NOT_FOUND); }

Target:
public void getCallSetWithInvalidIDShouldFail() throws AvroRemoteException { final String nonexistentCallSetId = Utils.randomId(); final GAWrapperException gae = Utils.catchGAWrapperException(() -> client.variants.getCallSet(nonexistentCallSetId)); assertThat(gae.getHttpStatusCode()).isEqualTo(HttpURLConnection.HTTP_NOT_FOUND); }
Source:
public Jdbi installPlugin(JdbiPlugin plugin) { Unchecked.runnable(() -> plugin.customizeJdbi(this)).run(); plugins.add(plugin); return this; }

Target:
public Jdbi installPlugin(JdbiPlugin plugin) { Unchecked.consumer(plugin::customizeJdbi).accept(this); plugins.add(plugin); return this; }
Source:
public void touch() { log.debug("Stateful bean instance has been touched"); }

Target:
public void touch() { log.trace("Stateful bean instance has been touched"); }
Source:
public String sanitize(String key, String value) { if (value != null && StringUtils.hasText(value)) { for (Pattern pattern : this.keysToSanitize) { if (pattern.matcher(key).matches()) { value = REDACTION_STRING; break; } } } return value; }

Target:
public String sanitize(String key, String value) { if (StringUtils.hasText(value)) { for (Pattern pattern : this.keysToSanitize) { if (pattern.matcher(key).matches()) { value = REDACTION_STRING; break; } } } return value; }
Source:
public void evaluate() throws Throwable { try ( CompatibilityOverride co = new CompatibilityOverride(config); PlatformCompatOverride pco = new PlatformCompatOverride(config); ) { co.init(); pco.init(testType); testStatement.evaluate(); } }

Target:
public void evaluate() throws Throwable { Compatibility.setOverrides(config); try { setPlatformCompatOverrides(); try { testStatement.evaluate(); } finally { cleanupPlatformCompatOverrides(); } } catch (RemoteException e) { throw new RuntimeException("Could not call IPlatformCompat binder method!", e); } finally { Compatibility.clearOverrides(); } }
Source:
public List<WebElement> getColumnByIndex(int index) { return getWrappedElement().findElements( By.cssSelector("tr > td:nth-of-type(" + index + ")")); }

Target:
public List<WebElement> getColumnByIndex(int index) { return getWrappedElement().findElements( By.cssSelector(String.format("tr > td:nth-of-type(%d)", index))); }
Source:
public Object createVerticesWithException() { createVertexWithCommit(); createVertexWithNesteedCommit(); throw new RuntimeException(); }

Target:
public Object createVerticesWithException() { createVertexWithCommit(); createVertexWithNestedCommit(); throw new RuntimeException(); }
Source:
public static ExecutorService getExecutorService() { ensureInitialized(); return sExecutorService; }

Target:
public static ExecutorService getExecutorService() { return sExecutorService; }
Source:
public void reloadItems() { logger.debug("Size of providers : {}", providers.size()); for (Ipx800BindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { try { createItem(itemName, provider); } catch (Ipx800UnknownDeviceException e) { logger.error("Item " + itemName + " will be ignored"); e.printStackTrace(); } } } }

Target:
public void reloadItems() { logger.trace("Size of providers : {}", providers.size()); for (Ipx800BindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { try { createInternalItem(itemName, provider); } catch (Ipx800UnknownDeviceException e) { logger.error("Item will be ignored", itemName); } } } }
Source:
Collection<EntityColumn> readColumns() { BeanInfo entityDescriptor; try { entityDescriptor = Introspector.getBeanInfo(entityClass); } catch (IntrospectionException e) { throw new IllegalStateException(e); } Collection<EntityColumn> entityColumns = newLinkedList(); PropertyDescriptor[] propertyDescriptors = entityDescriptor.getPropertyDescriptors(); Arrays.stream(propertyDescriptors) .filter(ColumnReader::hasAccessor) .filter(ColumnReader::accessorIsAnnotated) .map(PropertyDescriptor::getReadMethod) .forEach(readMethod -> entityColumns.add(EntityColumn.from(readMethod))); checkRepeatedColumnNames(entityColumns); return entityColumns; }

Target:
Collection<EntityColumn> readColumns() { BeanInfo entityDescriptor; try { entityDescriptor = Introspector.getBeanInfo(entityClass); } catch (IntrospectionException e) { throw new IllegalStateException(e); } PropertyDescriptor[] propertyDescriptors = entityDescriptor.getPropertyDescriptors(); ImmutableSet<EntityColumn> columns = Arrays .stream(propertyDescriptors) .map(PropertyDescriptor::getReadMethod) .filter(Objects::nonNull) .filter(ColumnReader::isAnnotated) .map(EntityColumn::from) .collect(toImmutableSet()); checkRepeatedColumnNames(columns); return columns; }
Source:
private List<BridgeJsonParameters> getBridgeList() { try { Gson gson = new Gson(); String json = HttpUtil.executeUrl("GET", url, timeout); return gson.fromJson(json, new TypeToken<List<BridgeJsonParameters>>() { }.getType()); } catch (IOException e) { logger.error("Error accessing the Philips Hue NUPnP service.", e); } return null; }

Target:
private List<BridgeJsonParameters> getBridgeList() { try { Gson gson = new Gson(); String json = doGetRequest(DISCOVERY_URL); return gson.fromJson(json, new TypeToken<List<BridgeJsonParameters>>() { }.getType()); } catch (IOException e) { logger.debug("Philips Hue NUPnP service not reachable. Can't discover bridges"); } catch (JsonParseException je) { logger.debug("Invalid json respone from Hue NUPnP service. Can't discover bridges"); } return new ArrayList<BridgeJsonParameters>(); }
Source:
public boolean retryRequest(final IOException exception, final int executionCount, final HttpContext context) { final Object disableRetry = context.getAttribute(CONTEXT_ATTRIBUTE_MANTA_RETRY_DISABLE); if (disableRetry instanceof Boolean && (Boolean) disableRetry) { return false; } if (logger.isDebugEnabled()) { if (NON_RETRIABLE.contains(exception)) { logger.debug("Request failed, unable to retry.", exception); } else if (executionCount <= getRetryCount()) { String msg = String.format("Request failed, %d/%d retry.", executionCount, getRetryCount()); logger.debug(msg, exception); } } return super.retryRequest(exception, executionCount, context); }

Target:
public boolean retryRequest(final IOException exception, final int executionCount, final HttpContext context) { final Object disableRetry = context.getAttribute(CONTEXT_ATTRIBUTE_MANTA_RETRY_DISABLE); if (disableRetry instanceof Boolean && (Boolean) disableRetry) { return false; } final boolean toBeRetried = super.retryRequest(exception, executionCount, context); if (logger.isDebugEnabled()) { if (toBeRetried) { String msg = String.format("Request failed, %d/%d retry.", executionCount, getRetryCount()); logger.debug(msg, exception); } else { logger.debug("Request failed, unable to retry.", exception); } } return toBeRetried; }
Source:
public void testDropMultipleGetPmCommands() { GetPresentationModelCommand cmd1 = new GetPresentationModelCommand(); cmd1.setPmId("1"); GetPresentationModelCommand cmd2 = new GetPresentationModelCommand(); cmd2.setPmId("1"); OnFinishedHandler sameHandler = new OnFinishedHandler() { @Override public void onFinished() { } }; List<CommandAndHandler> list = new ArrayList<CommandAndHandler>(); ((ArrayList<CommandAndHandler>) list).add(new CommandAndHandler(cmd1, sameHandler)); ((ArrayList<CommandAndHandler>) list).add(new CommandAndHandler(cmd2, sameHandler)); ((ArrayList<CommandAndHandler>) list).add(new CommandAndHandler(cmd2)); for (CommandAndHandler commandAndHandler : list) { batcher.batch(commandAndHandler); } try { List<CommandAndHandler> nextBatch = batcher.getWaitingBatches().getVal(); Assert.assertEquals(1, nextBatch.size()); Assert.assertEquals(GetPresentationModelCommand.class, nextBatch.get(0).getCommand().getClass()); Assert.assertTrue(batcher.isEmpty()); } catch (InterruptedException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }

Target:
public void testDropMultipleGetPmCommands() { GetPresentationModelCommand cmd1 = new GetPresentationModelCommand(); cmd1.setPmId("1"); GetPresentationModelCommand cmd2 = new GetPresentationModelCommand(); cmd2.setPmId("1"); OnFinishedHandler sameHandler = new OnFinishedHandler() { @Override public void onFinished() { } }; List<CommandAndHandler> list = new ArrayList<CommandAndHandler>(); list.add(new CommandAndHandler(cmd1, sameHandler)); list.add(new CommandAndHandler(cmd2, sameHandler)); list.add(new CommandAndHandler(cmd2)); for (CommandAndHandler commandAndHandler : list) { batcher.batch(commandAndHandler); } try { List<CommandAndHandler> nextBatch = batcher.getWaitingBatches().getVal(); Assert.assertEquals(1, nextBatch.size()); Assert.assertEquals(GetPresentationModelCommand.class, nextBatch.get(0).getCommand().getClass()); Assert.assertTrue(batcher.isEmpty()); } catch (InterruptedException e) { e.printStackTrace(); Assert.fail(e.getMessage()); } }
Source:
public void setCredentialsFactoryConfig(CredentialsFactoryConfig credentialsFactoryConfig) { this.credentialsFactoryConfig = credentialsFactoryConfig; }

Target:
public ClientSecurityConfig setCredentialsFactoryConfig(CredentialsFactoryConfig credentialsFactoryConfig) { this.credentialsFactoryConfig = credentialsFactoryConfig; return this; }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.liger_main); AppConfig mAppConfig = AppConfig.getAppConfig(this); LigerFragmentFactory.mContext = this; mRootPageFragment = LigerFragmentFactory.openPage(mAppConfig.getRootPageName(), mAppConfig.getRootPageTitle(), mAppConfig.getRootPageArgs(), mAppConfig.getRootPageOptions()); if(mRootPageFragment != null) { FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); mRootPageFragment.addFragments(ft, R.id.content_frame); ft.commit(); } if (savedInstanceState != null) { lastChildArgs = savedInstanceState.getString(SAVE_CHILD_ARGS); } Config.init(this); if(mAppConfig.getNotificationsEnabled()) { GcmRegistrationHelper gcmHelper = new GcmRegistrationHelper(this, this); gcmHelper.registerGcm(); } }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.liger_main); AppConfig mAppConfig = AppConfig.getAppConfig(this); LigerFragmentFactory.mContext = this; mRootPageFragment = LigerFragmentFactory.openPage(mAppConfig.getRootPageName(), mAppConfig.getRootPageTitle(), mAppConfig.getRootPageArgs(), mAppConfig.getRootPageOptions()); if(mRootPageFragment != null) { FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); mRootPageFragment.addFragments(ft, R.id.content_frame); mRootPageFragment.setRootPageListener(this); ft.commit(); } if (savedInstanceState != null) { lastChildArgs = savedInstanceState.getString(SAVE_CHILD_ARGS); } Config.init(this); if(mAppConfig.getNotificationsEnabled()) { GcmRegistrationHelper gcmHelper = new GcmRegistrationHelper(this, this); gcmHelper.registerGcm(); } }
Source:
private ProgramState checkConstraint(CheckerContext context, Tree syntaxNode, SymbolicValue currentVal) { ProgramState programState = context.getState(); Constraint constraint = programState.getConstraint(currentVal); if (constraint != null && constraint.isNull()) { String message = "NullPointerException might be thrown as '" + SyntaxTreeNameFinder.getName(syntaxNode) + "' is nullable here"; Set<List<JavaFileScannerContext.Location>> flows = new HashSet<>(); flows.add(flow(context.getNode(), currentVal)); context.reportIssue(syntaxNode, this, message, flows); return null; } constraint = programState.getConstraint(currentVal); if (constraint == null) { return programState.addConstraint(currentVal, ObjectConstraint.NOT_NULL); } return programState; }

Target:
private ProgramState checkConstraint(CheckerContext context, Tree syntaxNode, SymbolicValue currentVal) { ProgramState programState = context.getState(); Constraint constraint = programState.getConstraint(currentVal); if (constraint != null && constraint.isNull()) { String message = "NullPointerException might be thrown as '" + SyntaxTreeNameFinder.getName(syntaxNode) + "' is nullable here"; Set<List<JavaFileScannerContext.Location>> flows = new HashSet<>(); flows.add(SECheck.flow(context.getNode(), currentVal)); context.reportIssue(syntaxNode, this, message, flows); return null; } constraint = programState.getConstraint(currentVal); if (constraint == null) { return programState.addConstraint(currentVal, ObjectConstraint.NOT_NULL); } return programState; }
Source:
public void multipleDrillDownTest() { Search srch = db.search("views101/animals"); SearchResult<Animal> rslt = srch.includeDocs(true) .counts(new String[]{"class", "diet"}) .ranges("{ \"min_length\": {\"small\": \"[0 TO 1.0]\"," + "\"medium\": \"[1.1 TO 3.0]\", \"large\": \"[3.1 TO 9999999]\"} }") .drillDown("class", "bird") .drillDown("diet", "omnivore") .querySearchResult("class:bird", Animal.class); assertNotNull(rslt); assertNotNull(rslt.getRanges()); assertEquals(rslt.getRanges().entrySet().size(), 1); assertEquals(rslt.getRanges().get("min_length").entrySet().size(), 3); assertEquals(rslt.getRanges().get("min_length").get("small"), new Long(1)); assertEquals(rslt.getRanges().get("min_length").get("medium"), new Long(0)); assertEquals(rslt.getRanges().get("min_length").get("large"), new Long(0)); }

Target:
public void multipleDrillDownTest() { Search srch = db.search("views101/animals"); SearchResult<Animal> rslt = srch.includeDocs(true) .counts(new String[]{"class", "diet"}) .ranges("{ \"min_length\": {\"small\": \"[0 TO 1.0]\"," + "\"medium\": \"[1.1 TO 3.0]\", \"large\": \"[3.1 TO 9999999]\"} }") .drillDown("class", "bird") .drillDown("diet", "omnivore") .querySearchResult("class:bird", Animal.class); assertNotNull(rslt); assertNotNull(rslt.getRanges()); assertEquals(1, rslt.getRanges().entrySet().size()); assertEquals(3, rslt.getRanges().get("min_length").entrySet().size()); assertEquals(new Long(1), rslt.getRanges().get("min_length").get("small")); assertEquals(new Long(0), rslt.getRanges().get("min_length").get("medium")); assertEquals(new Long(0), rslt.getRanges().get("min_length").get("large")); }
Source:
public static Iterable<Object[]> data() { Collection<Object[]> ids = new ArrayList<Object[]>(); String[] delimeters = {"", "_", "3", "*", " "}; for (String colPrefix : delimeters) { for (String colSuffix : delimeters) { for (String columnName : new String[]{"returning", "returningreturning"}) { for (String prefix : delimeters) { for (String suffix : delimeters) { for (String returning : new String[]{"returning", "returningreturning"}) { ids.add(new Object[]{columnName, colPrefix, colSuffix, returning, prefix, suffix}); } } } } } } return ids; }

Target:
public static Iterable<Object[]> data() { Collection<Object[]> ids = new ArrayList<Object[]>(); String[] delimiters = {"", "_", "3", "*", " "}; for (String columnName : new String[]{"returning", "returningreturning"}) { for (String prefix : delimiters) { for (String suffix : delimiters) { for (String returning : new String[]{"returning", "returningreturning"}) { ids.add(new Object[]{columnName, returning, prefix, suffix}); } } } } return ids; }
Source:
public URL map(ResultSet r, int columnNumber, StatementContext ctx) throws SQLException { URL url = null; try { url = URI.create(r.getString(columnNumber)).toURL(); } catch (MalformedURLException e) { e.printStackTrace(); } return url; }

Target:
public URL map(ResultSet r, int columnNumber, StatementContext ctx) throws SQLException { try { return new URL(r.getString(columnNumber)); } catch (MalformedURLException e) { throw new SQLException(e); } }
Source:
public void addName(IASTName name) { if (!name.isActive()) return; if (name instanceof ICPPASTQualifiedName) { IBinding b= getClassType(); final ICPPASTQualifiedName qname = (ICPPASTQualifiedName) name; final ICPPASTNameSpecifier[] qualifier = qname.getQualifier(); for (int i = qualifier.length; --i >= 0;) { if (b == null) return; char[] segmentName; if (qualifier[i] instanceof IASTName) segmentName = ((IASTName) qualifier[i]).getLookupKey(); else { IBinding segmentBinding = qualifier[i].resolveBinding(); if (segmentBinding == null) return; segmentName = segmentBinding.getNameCharArray(); } if (!CharArrayUtils.equals(segmentName, b.getNameCharArray())) return; b= b.getOwner(); } if (qname.isFullyQualified() && b != null) return; } IASTNode parent = name.getParent(); if (parent instanceof IASTDeclarator) { if (CPPVisitor.isConstructor(this, (IASTDeclarator) parent)) { addConstructor(name); return; } } super.addName(name); }

Target:
public void addName(IASTName name) { if (!name.isActive()) return; if (name instanceof ICPPASTQualifiedName) { IBinding b= getClassType(); final ICPPASTQualifiedName qname = (ICPPASTQualifiedName) name; final ICPPASTNameSpecifier[] qualifier = qname.getQualifier(); for (int i = qualifier.length; --i >= 0;) { if (b == null) return; char[] segmentName; if (qualifier[i] instanceof IASTName) { segmentName = ((IASTName) qualifier[i]).getLookupKey(); } else { IBinding segmentBinding = qualifier[i].resolveBinding(); if (segmentBinding == null) return; segmentName = segmentBinding.getNameCharArray(); } if (!CharArrayUtils.equals(segmentName, b.getNameCharArray())) return; b= b.getOwner(); } if (qname.isFullyQualified() && b != null) return; } IASTNode parent = name.getParent(); if (parent instanceof IASTDeclarator) { if (CPPVisitor.isConstructor(this, (IASTDeclarator) parent)) { addConstructor(name); return; } } super.addName(name); }
Source:
static AsteroidConfig load(String moduleName){ JSONObject asteroidConfigs; try{ asteroidConfigs = Assets.getJson(moduleName + ":asteroidsConfig").getJsonValue(); }catch (RuntimeException e){ asteroidConfigs = Assets.getJson("engine:asteroidsConfig").getJsonValue(); } float MIN_SPLIT_SZ = asteroidConfigs.getFloat("MIN_SPLIT_SZ"); float MIN_BURN_SZ = asteroidConfigs.getFloat("MIN_BURN_SZ"); float SZ_TO_LIFE = asteroidConfigs.getFloat("SZ_TO_LIFE"); float MAX_SPLIT_SPD = asteroidConfigs.getFloat("MAX_SPLIT_SPD"); float DUR = asteroidConfigs.getFloat("DUR"); return new AsteroidConfig(MIN_SPLIT_SZ, MIN_BURN_SZ, SZ_TO_LIFE, MAX_SPLIT_SPD, DUR); }

Target:
static AsteroidConfig load(String moduleName) { JSONObject asteroidConfigs; try{ asteroidConfigs = Assets.getJson(moduleName + ":asteroidsConfig").getJsonValue(); }catch (RuntimeException e){ asteroidConfigs = Assets.getJson("engine:asteroidsConfig").getJsonValue(); } float minSplitSz = asteroidConfigs.getFloat("MIN_SPLIT_SZ"); float minBurnSz = asteroidConfigs.getFloat("MIN_BURN_SZ"); float szToLife = asteroidConfigs.getFloat("SZ_TO_LIFE"); float maxSplitSpd = asteroidConfigs.getFloat("MAX_SPLIT_SPD"); float dur = asteroidConfigs.getFloat("DUR"); return new AsteroidConfig(minSplitSz, minBurnSz, szToLife, maxSplitSpd, dur); }
Source:
public void testGetOsDetails() { Task<OsDetails> detailsTask = app.getExecutionContext().submit(OsTasks.getOsDetails(app)); OsDetails details = detailsTask.getUnchecked(); assertNotNull(details); assertNotNull(details.getArch()); assertNotNull(details.getName()); assertNotNull(details.getVersion()); }

Target:
public void testGetOsDetails() { Task<OsDetails> detailsTask = app.getExecutionContext().submit(OsTasks.getOsDetails(app)); OsDetails details = detailsTask.getUnchecked(); LOG.info("testGetOsDetails found the following on localhost: name={}, version={}, arch={}, is64bit={}", new Object[] {details.getName(), details.getVersion(), details.getArch(), details.is64bit()}); assertNotNull(details); assertNotNull(details.getArch()); assertNotNull(details.getName()); assertNotNull(details.getVersion()); }
Source:
public static CriticalHitEvent getCriticalHit(EntityPlayer player, Entity target, boolean vanillaCritical, float damageModifier) { CriticalHitEvent hitResult = new CriticalHitEvent(player, target, damageModifier); MinecraftForge.EVENT_BUS.post(hitResult); if (hitResult.getResult() != Event.Result.DENY) { if (hitResult.getResult() == Event.Result.ALLOW || vanillaCritical) { return hitResult; } } return null; }

Target:
public static CriticalHitEvent getCriticalHit(EntityPlayer player, Entity target, boolean vanillaCritical, float damageModifier) { CriticalHitEvent hitResult = new CriticalHitEvent(player, target, damageModifier); MinecraftForge.EVENT_BUS.post(hitResult); if (hitResult.getResult() == Event.Result.ALLOW || (vanillaCritical && hitResult.getResult() == Event.Result.DEFAULT)) { return hitResult; } return null; }
Source:
public String getDetail(String name) { assert (details != null) : "Did you forget to load the details?"; return details.get(name); }

Target:
public String getDetail(String name) { return details.get(name); }
Source:
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object result; boolean interrupted = false; int retryCounter = 0; try { do { try { result = method.invoke(targetProxy, args); break; } catch (InvocationTargetException x) { Throwable e = x.getCause(); if (retryCounter++ >= MAX_RETRIES_ON_REMOTING_INTERRUPTION || !shouldRetry(method, e)) { throw e; } interrupted = true; } } while (true); } finally { if (interrupted) { Thread.currentThread().interrupt(); } } return result; }

Target:
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { Object result; boolean interrupted = false; int retryCounter = 0; try { do { try { result = method.invoke(targetProxy, args); break; } catch (InvocationTargetException x) { Throwable e = x.getCause(); if (!shouldRetry(method, e, retryCounter++)) { throw e; } interrupted = true; } } while (true); } finally { if (interrupted) { Thread.currentThread().interrupt(); } } return result; }
Source:
public UnhandledServerException(String exceptionMessage, Throwable cause) { super(Response.Status.UNSUPPORTED_MEDIA_TYPE, String.format(MESSAGE, exceptionMessage), cause); }

Target:
public UnhandledServerException(String exceptionMessage, Throwable cause) { super(Response.Status.INTERNAL_SERVER_ERROR, String.format(MESSAGE, exceptionMessage), cause); }
Source:
public FileHeader createFileHeader(DiffEntry ent) throws IOException { ByteArrayOutputStream buf = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(buf, true, Constants.CHARSET.name()); final EditList editList; writeDiffHeader(ps, ent); if (ent.getOldMode() == GITLINK || ent.getNewMode() == GITLINK) { writeGitLinkDiffText(ps, ent); editList = new EditList(); } else { byte[] aRaw = open(ent.getOldMode(), ent.getOldId()); byte[] bRaw = open(ent.getNewMode(), ent.getNewId()); if (RawText.isBinary(aRaw) || RawText.isBinary(bRaw)) { ps.write(encodeASCII("Binary files differ\n")); editList = new EditList(); } else { RawText a = rawTextFactory.create(aRaw); RawText b = rawTextFactory.create(bRaw); editList = new MyersDiff(a, b).getEdits(); } } ps.flush(); return new FileHeader(buf.toByteArray(), editList); }

Target:
public FileHeader createFileHeader(DiffEntry ent) throws IOException, CorruptObjectException, MissingObjectException { ByteArrayOutputStream buf = new ByteArrayOutputStream(); final EditList editList; writeDiffHeader(buf, ent); if (ent.getOldMode() == GITLINK || ent.getNewMode() == GITLINK) { writeGitLinkDiffText(buf, ent); editList = new EditList(); } else { byte[] aRaw = open(ent.getOldMode(), ent.getOldId()); byte[] bRaw = open(ent.getNewMode(), ent.getNewId()); if (RawText.isBinary(aRaw) || RawText.isBinary(bRaw)) { buf.write(encodeASCII("Binary files differ\n")); editList = new EditList(); } else { RawText a = rawTextFactory.create(aRaw); RawText b = rawTextFactory.create(bRaw); editList = new MyersDiff(a, b).getEdits(); } } buf.flush(); return new FileHeader(buf.toByteArray(), editList); }
Source:
public synchronized KeyPair getKeyPair() throws AmazonClientException, IOException { if (usableKeyPair == null) usableKeyPair = resolvePrivateKey(this).find(connect()); return usableKeyPair; }

Target:
public synchronized KeyPair getKeyPair() throws AmazonClientException, IOException { if (usableKeyPair == null) { EC2PrivateKey ec2PrivateKey = this.resolvePrivateKey(); if (ec2PrivateKey != null) { usableKeyPair = ec2PrivateKey.find(connect()); } } return usableKeyPair; }
Source:
public static void initWithContext(@NonNull Context context) { logger.verbose("initWithContext(context) called!"); if (context == null) { Log(LOG_LEVEL.WARN, "context is null, ignoring!"); return; } boolean wasAppContextNull = (appContext == null); appContext = context.getApplicationContext(); if (context instanceof Activity) appActivity = new WeakReference<>((Activity) context); setupActivityLifecycleListener(wasAppContextNull); setupPrivacyConsent(appContext); logger.verbose("initWithContext(context) finished, checking if appId has been set before proceeding..."); if (appId == null) { String oldAppId = getSavedAppId(); if (oldAppId == null) { logger.warning("appContext set, but please call setAppId(appId) with a valid appId to complete OneSignal init!"); } else { logger.verbose("appContext set and an old appId was found, attempting to call setAppId(oldAppId)"); setAppId(oldAppId); } return; } logger.verbose("initWithContext(context) successful and appId is set, continuing OneSignal init..."); init(context); }

Target:
public static void initWithContext(@NonNull Context context) { if (context == null) { logger.warning("initWithContext called with null context, ignoring!"); return; } boolean wasAppContextNull = (appContext == null); appContext = context.getApplicationContext(); if (context instanceof Activity) appActivity = new WeakReference<>((Activity) context); setupActivityLifecycleListener(wasAppContextNull); setupPrivacyConsent(appContext); if (appId == null) { String oldAppId = getSavedAppId(); if (oldAppId == null) { logger.warning("appContext set, but please call setAppId(appId) with a valid appId to complete OneSignal init!"); } else { logger.verbose("appContext set and cached app id found, calling setAppId with: " + oldAppId); setAppId(oldAppId); } return; } else { logger.verbose("initWithContext called with: " + context); } init(context); }
Source:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, List<String> messages) { if (StringUtils.isNotEmpty(vm.getCpuName())) { List<VDS> hostsToRunOn = new ArrayList<VDS>(); for (VDS host : hosts) { int compareResult = CpuFlagsManagerHandler.compareCpuLevels(vm.getCpuName(), host.getCpuName().getCpuName(), vm.getVdsGroupCompatibilityVersion()); if (compareResult >= 0) { hostsToRunOn.add(host); } else { messages.add(VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPU_LEVEL.toString()); log.debugFormat("Host {0} has CPU level ({1}) which is lower than the CPU level the VM was run with ({2})", host.getName(), host.getCpuName(), vm.getCpuName()); } } return hostsToRunOn; } else { return hosts; } }

Target:
public List<VDS> filter(List<VDS> hosts, VM vm, Map<String, String> parameters, List<String> messages) { boolean filteredOutHosts = false; if (StringUtils.isNotEmpty(vm.getCpuName())) { List<VDS> hostsToRunOn = new ArrayList<VDS>(); for (VDS host : hosts) { String hostCpuName = CpuFlagsManagerHandler.FindMaxServerCpuByFlags(host.getCpuFlags(), host.getVdsGroupCompatibilityVersion()).getCpuName(); int compareResult = CpuFlagsManagerHandler.compareCpuLevels(vm.getCpuName(), hostCpuName, vm.getVdsGroupCompatibilityVersion()); if (compareResult <= 0) { hostsToRunOn.add(host); log.debugFormat("Host {0} wasn't filtered out as it has a CPU level ({1}) which is higher or equal than the CPU level the VM was run with ({2})", host.getName(), hostCpuName, vm.getCpuName()); } else { log.debugFormat("Host {0} was filtered out as it has a CPU level ({1}) which is lower than the CPU level the VM was run with ({2})", host.getName(), hostCpuName, vm.getCpuName()); filteredOutHosts = true; } } if (filteredOutHosts) { messages.add(VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPU_LEVEL.toString()); } return hostsToRunOn; } else { return hosts; } }
Source:
public void testgetStreamWithPhysicalNameInConfig() { Config config = buildStreamConfig(STREAM_ID, StreamConfig.PHYSICAL_NAME(), TEST_PHYSICAL_NAME, StreamConfig.SYSTEM(), TEST_SYSTEM); AbstractApplicationRunner env = new TestAbstractApplicationRunnerImpl(config); StreamSpec spec = env.getStream(STREAM_ID); assertEquals(TEST_PHYSICAL_NAME, spec.getPhysicalName()); }

Target:
public void testgetStreamWithPhysicalNameInConfig() { Config config = buildStreamConfig(STREAM_ID, StreamConfig.PHYSICAL_NAME(), TEST_PHYSICAL_NAME, StreamConfig.SYSTEM(), TEST_SYSTEM); AbstractApplicationRunner runner = new TestAbstractApplicationRunnerImpl(config); StreamSpec spec = runner.getStream(STREAM_ID); assertEquals(TEST_PHYSICAL_NAME, spec.getPhysicalName()); }
Source:
public void testSyncProcessorMetrics() { SyncRequestProcessor syncProcessor = new SyncRequestProcessor(zks, null); for (int i=0; i<500; i++) { syncProcessor.processRequest(createRquest(1, i)); } Map<String, Object> values = ServerMetrics.getAllValues(); Assert.assertEquals(500L, values.get("sync_processor_request_queued")); syncProcessor.start(); try { Thread.sleep(500); } catch (Exception e){ } values = ServerMetrics.getAllValues(); Assert.assertEquals(502L, values.get("cnt_sync_processor_queue_size")); Assert.assertEquals(500L, values.get("max_sync_processor_queue_size")); Assert.assertEquals(0L, values.get("min_sync_processor_queue_size")); Assert.assertEquals(500L, values.get("cnt_sync_processor_real_queue_time_ms")); Assert.assertThat((long)values.get("max_sync_processor_real_queue_time_ms"), greaterThan(0L)); Assert.assertEquals(500L, values.get("cnt_sync_process_time")); Assert.assertThat((long)values.get("max_sync_process_time"), greaterThan(0L)); Assert.assertEquals(1L, values.get("cnt_sync_processor_queue_flush_time_ms")); Assert.assertThat((long)values.get("max_sync_processor_queue_flush_time_ms"), greaterThanOrEqualTo(100L)); Assert.assertEquals(500L, values.get("cnt_sync_processor_queue_time_ms")); Assert.assertThat((long)values.get("max_sync_processor_queue_time_ms"), greaterThanOrEqualTo(100L)); }

Target:
public void testSyncProcessorMetrics() throws Exception{ SyncRequestProcessor syncProcessor = new SyncRequestProcessor(zks, nextProcessor); for (int i=0; i<500; i++) { syncProcessor.processRequest(createRquest(1, i)); } Map<String, Object> values = MetricsUtils.currentServerMetrics(); Assert.assertEquals(500L, values.get("sync_processor_request_queued")); allRequestsFlushed = new CountDownLatch(500); syncProcessor.start(); allRequestsFlushed.await(5000, TimeUnit.MILLISECONDS); values = MetricsUtils.currentServerMetrics(); Assert.assertEquals(501L, values.get("cnt_sync_processor_queue_size")); Assert.assertEquals(500L, values.get("max_sync_processor_queue_size")); Assert.assertEquals(0L, values.get("min_sync_processor_queue_size")); Assert.assertEquals(500L, values.get("cnt_sync_processor_queue_time_ms")); Assert.assertThat((long)values.get("max_sync_processor_queue_time_ms"), greaterThan(0L)); Assert.assertEquals(500L, values.get("cnt_sync_processor_queue_and_flush_time_ms")); Assert.assertThat((long)values.get("max_sync_processor_queue_and_flush_time_ms"), greaterThan(0L)); Assert.assertEquals(500L, values.get("cnt_sync_process_time")); Assert.assertThat((long)values.get("max_sync_process_time"), greaterThan(0L)); Assert.assertEquals(500L, values.get("max_sync_processor_batch_size")); Assert.assertEquals(1L, values.get("cnt_sync_processor_queue_flush_time_ms")); Assert.assertThat((long)values.get("max_sync_processor_queue_flush_time_ms"), greaterThanOrEqualTo(100L)); syncProcessor.shutdown(); }
Source:
private void handleInstallMessage(Object arg) { installed.set(configureNativeComponents()); }

Target:
private void handleInstallMessage(Object arg) { lock.lock(); try { if (installed.get()) { warn("Received duplicate setup message with arg: " + arg); return; } String reportPath = reportDirectory + UUID.randomUUID().toString() + ".crash"; install(reportPath, true, Build.VERSION.SDK_INT); installed.set(true); } finally { lock.unlock(); } }
Source:
public void retryableConfigurationDefaultTest() throws Exception { doTestHttpClient(new Runnable() { @Override public void run() { final HttpRequestRetryHandler handler = getCurrentHttpClient(); assertNotNull( handler ); assertThat( handler, instanceOf( DefaultHttpRequestRetryHandler.class ) ); final DefaultHttpRequestRetryHandler impl = DefaultHttpRequestRetryHandler.class.cast(handler); assertEquals( 3, impl.getRetryCount() ); assertFalse( impl.isRequestSentRetryEnabled() ); } }); }

Target:
public void retryableConfigurationDefaultTest() throws Exception { doTestHttpClient( new Runnable() { @Override public void run() { final HttpRequestRetryHandler handler = getCurrentHandler(); assertNotNull( handler ); assertThat( handler, instanceOf( DefaultHttpRequestRetryHandler.class ) ); final DefaultHttpRequestRetryHandler impl = DefaultHttpRequestRetryHandler.class.cast(handler); assertEquals( 3, impl.getRetryCount() ); assertFalse( impl.isRequestSentRetryEnabled() ); } }); }
Source:
private void audit() { try { GerritCall call = currentCall.get(); Audit note = (Audit) call.getMethod().getAnnotation(Audit.class); if (note != null) { final Gson gson = createGsonBuilder() .setDateFormat(DateFormat.LONG) .setFieldNamingPolicy(FieldNamingPolicy.UPPER_CAMEL_CASE) .setVersion(1.0) .create(); final String sid = call.getWebSession().getToken(); final String username = extractUsername(call); final List<Object> args = extractParams(note, call, gson); final String what = extractWhat(note, call.getMethod().getName()); final Object result = call.getResult(); audit.dispatch(new AuditEvent(sid, username, what, call.getWhen(), args, result)); } } catch (Throwable all) { LOG.error("Unable to log the call", all); } }

Target:
private void audit() { try { GerritCall call = currentCall.get(); Audit note = (Audit) call.getMethod().getAnnotation(Audit.class); if (note != null) { final String sid = call.getWebSession().getToken(); final CurrentUser username = call.getWebSession().getCurrentUser(); final List<Object> args = extractParams(note, call, auditGson); final String what = extractWhat(note, call.getMethod().getName()); final Object result = call.getResult(); audit.dispatch(new AuditEvent(sid, username, what, call.getWhen(), args, result)); } } catch (Throwable all) { log.error("Unable to log the call", all); } }
Source:
public void done() { if (external != null) { addRowsToDisk(); } else { if (isAnyDistinct()) { rows = distinctRows.values(); } if (sort != null) { if (offset > 0 || limit > 0) { sort.sort(rows, offset, limit < 0 || withTies ? rows.size() : limit); } else { sort.sort(rows); } } } applyOffsetAndLimit(); reset(); }

Target:
public void done() { if (external != null) { addRowsToDisk(); } else { if (isAnyDistinct()) { rows = distinctRows.values(); } if (sort != null && limit != 0) { boolean withLimit = limit > 0 && !withTies; if (offset > 0 || withLimit) { sort.sort(rows, offset, withLimit ? limit : rows.size()); } else { sort.sort(rows); } } } applyOffsetAndLimit(); reset(); }
Source:
public static Block serializeObject(Type type, BlockBuilder builder, Object object) { if (ROW.equals(type.getTypeSignature().getBase())) { return serializeStruct(type, builder, object); } else if (MAP.equals(type.getTypeSignature().getBase()) || ARRAY.equals(type.getTypeSignature().getBase())) { throw new RuntimeException("Type not supported in Elasticsearch: " + type.getDisplayName()); } else { serializePrimitive(type, builder, object); return null; } }

Target:
public static Block serializeObject(Type type, BlockBuilder builder, Object object) { if (ROW.equals(type.getTypeSignature().getBase())) { return serializeStruct(type, builder, object); } if (MAP.equals(type.getTypeSignature().getBase()) || ARRAY.equals(type.getTypeSignature().getBase())) { throw new IllegalArgumentException("Type not supported: " + type.getDisplayName()); } serializePrimitive(type, builder, object); return null; }
Source:
int maybeCommitActiveTasksPerUserRequested() { if (!rebalanceInProgress) { return active.maybeCommitPerUserRequested(); } return -1; }

Target:
int maybeCommitActiveTasksPerUserRequested() { return rebalanceInProgress ? -1 : active.maybeCommitPerUserRequested(); }
Source:
public VenusGlobalNavPageObject clickWikiaLogo() { wikiaLogo.click(); return this; }

Target:
public HomePageObject clickWikiaLogo() { String environment = ConfigurationFactory.getConfig().getEnv(); if (!environment.equals("prod") && !environment.contains("dev")) { WebDriverWait wait = new WebDriverWait(driver, 5); wait.until( CommonExpectedConditions.valueToBePresentInElementsAttribute(wikiaLogo, "href", environment) ); } wikiaLogo.click(); return new HomePageObject(driver); }
Source:
public List<StorageServerConnections> getAllForDomain(Guid domainId) { return getCallsHandler().executeReadList("GetStorageServerConnectionsOfDomain",mapper, getCustomMapSqlParameterSource().addValue("storage_domain_id", domainId)); }

Target:
public List<StorageServerConnections> getAllForDomain(Guid domainId) { return getCallsHandler().executeReadList("GetStorageServerConnectionsForDomain",mapper, getCustomMapSqlParameterSource().addValue("storage_domain_id", domainId)); }
Source:
public Function<@NonNull ISegment, @Nullable Long> getMapper() { return (o) -> { return o.getStart(); }; }

Target:
public Function<@NonNull ISegment, @Nullable Long> getMapper() { return o -> o.getStart(); }
Source:
public long getOrderItemId() { return orderItemId; }

Target:
public long getOrderItemId() { return mOrderItemId; }
Source:
public boolean onKeyUp(int keyCode, KeyEvent event) { Intent serviceIntent = new Intent(this, PlaybackService.class); serviceIntent.putExtra(MediaButtonReceiver.EXTRA_HARDWAREBUTTON, true); AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE); Integer customKeyCode = null; switch (keyCode) { case KeyEvent.KEYCODE_ENTER: case KeyEvent.KEYCODE_SPACE: customKeyCode = KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE; break; case KeyEvent.KEYCODE_DPAD_LEFT: customKeyCode = KeyEvent.KEYCODE_MEDIA_REWIND; break; case KeyEvent.KEYCODE_DPAD_RIGHT: customKeyCode = KeyEvent.KEYCODE_MEDIA_FAST_FORWARD; break; case KeyEvent.KEYCODE_M: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_TOGGLE_MUTE, 0); } else { if (audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) == 0) { audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC), 0); } else { audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0); } } break; case KeyEvent.KEYCODE_DPAD_UP: audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); break; case KeyEvent.KEYCODE_DPAD_DOWN: audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI); break; default: return super.onKeyUp(keyCode, event); } if (customKeyCode != null) { serviceIntent.putExtra(MediaButtonReceiver.EXTRA_KEYCODE, customKeyCode); ContextCompat.startForegroundService(this, serviceIntent); } return true; }

Target:
public boolean onKeyUp(int keyCode, KeyEvent event) { AudioManager audioManager = (AudioManager) getSystemService(AUDIO_SERVICE); Integer customKeyCode = null; switch (keyCode) { case KeyEvent.KEYCODE_P: customKeyCode = KeyEvent.KEYCODE_MEDIA_PLAY_PAUSE; break; case KeyEvent.KEYCODE_J: case KeyEvent.KEYCODE_A: case KeyEvent.KEYCODE_COMMA: customKeyCode = KeyEvent.KEYCODE_MEDIA_REWIND; break; case KeyEvent.KEYCODE_K: case KeyEvent.KEYCODE_D: case KeyEvent.KEYCODE_PERIOD: customKeyCode = KeyEvent.KEYCODE_MEDIA_FAST_FORWARD; break; case KeyEvent.KEYCODE_PLUS: case KeyEvent.KEYCODE_W: audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_RAISE, AudioManager.FLAG_SHOW_UI); return true; case KeyEvent.KEYCODE_MINUS: case KeyEvent.KEYCODE_S: audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, AudioManager.FLAG_SHOW_UI); return true; case KeyEvent.KEYCODE_M: if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_TOGGLE_MUTE, AudioManager.FLAG_SHOW_UI); return true; } break; } if (customKeyCode != null) { Intent intent = new Intent(this, PlaybackService.class); intent.putExtra(MediaButtonReceiver.EXTRA_KEYCODE, customKeyCode); ContextCompat.startForegroundService(this, intent); return true; } return super.onKeyUp(keyCode, event); }
Source:
ProjectOwnerGroupsProvider(@GerritServerConfig final Config config, SchemaFactory<ReviewDb> db, @ProjectCreatorGroups Set<AccountGroup.Id> creatorGroups) { String[] ownerGroupNames = config.getStringList("repository", "*", "ownerGroup"); Set<AccountGroup.Id> ownerGroups = ConfigUtil.groupsFor(db, ownerGroupNames, log); if (ownerGroups.isEmpty()){ groupIds = creatorGroups; }else{ groupIds = ownerGroups; } }

Target:
ProjectOwnerGroupsProvider(@GerritServerConfig final Config config, SchemaFactory<ReviewDb> db, @ProjectCreatorGroups Set<AccountGroup.Id> creatorGroups) { String[] names = config.getStringList("repository", "*", "ownerGroup"); Set<AccountGroup.Id> ownerGroups = ConfigUtil.groupsFor(db, names, log); if (ownerGroups.isEmpty()) { groupIds = creatorGroups; } else { groupIds = ownerGroups; } }
Source:
private boolean isInWorkingSet(IResource resource) { if (wSetResources == null) { computeWorkingSetResources(); } for (IResource setResource : wSetResources) { if(setResource.getFullPath().isPrefixOf(resource.getFullPath())){ return true; } } return false; }

Target:
private boolean isInWorkingSet(IResource resource) { if (wSetResources == null) { computeWorkingSetResources(); } for (IResource wSetResource : wSetResources) { if(wSetResource.getFullPath().isPrefixOf(resource.getFullPath())){ return true; } } return false; }
Source:
protected void fallbackOnDefaultCache() { CacheService cacheService = Framework.getService(CacheService.class); if (cacheService != null) { if (descriptor.cacheEntryName == null) { cache.setEntryCacheName("cache-" + getName()); cacheService.registerCache("cache-" + getName()); } if (descriptor.cacheEntryWithoutReferencesName == null) { cache.setEntryCacheWithoutReferencesName("cacheWithoutReference-" + getName()); cacheService.registerCache("cacheWithoutReference-" + getName()); } } }

Target:
protected void fallbackOnDefaultCache() { CacheService cacheService = Framework.getService(CacheService.class); if (cacheService != null) { if (descriptor.cacheEntryName == null) { String cacheEntryName = "cache-" + getName(); cache.setEntryCacheName(cacheEntryName); cacheService.registerCache(cacheEntryName); } if (descriptor.cacheEntryWithoutReferencesName == null) { String cacheEntryWithoutReferencesName = "cacheWithoutReference-" + getName(); cache.setEntryCacheWithoutReferencesName(cacheEntryWithoutReferencesName); cacheService.registerCache(cacheEntryWithoutReferencesName); } } }
Source:
public int fill(final FluidStack resource, final boolean doFill) { if (resource == null) return 0; if (resource.amount <= 0) return 0; if (!matchesFilter(resource)) return 0; int ret = super.fill(resource, doFill); if (ret != 0 && updateCallback != null) updateCallback.accept(this); return ret; }

Target:
public int fill(final FluidStack resource, final boolean doFill) { if (resource == null) return 0; if (resource.amount <= 0) return 0; int ret = super.fill(resource, doFill); if (ret != 0 && updateCallback != null) updateCallback.accept(this); return ret; }
Source:
public void testAboveKInstance() throws Exception { verifyRoundtrip("{\"type\":\"abovek\",\"k\":0.0,\"inner\":{\"type\":\"EmptyInstance\"}}", new AboveKInstance(0), AboveKInstance.class); }

Target:
public void testAboveKInstance() throws Exception { verifyRoundtrip("{\"type\":\"abovek\",\"k\":0.0}", new AboveKInstance(0), AboveKInstance.class); }
Source:
private ContextMenu createTabContextMenu(KeyBindingRepository keyBindingRepository) { ContextMenu contextMenu = new ContextMenu(); ActionFactory factory = new ActionFactory(keyBindingRepository); contextMenu.getItems().addAll( factory.createMenuItem(StandardActions.CLOSE_LIBRARY, new CloseDatabaseAction()), factory.createMenuItem(StandardActions.CLOSE_OTHER_LIBRARIES, new CloseOthersDatabaseAction()), factory.createMenuItem(StandardActions.CLOSE_ALL_LIBRARIES, new CloseAllDatabaseAction()), new SeparatorMenuItem(), factory.createMenuItem(StandardActions.LIBRARY_PROPERTIES, new LibraryPropertiesAction(this, stateManager)), factory.createMenuItem(StandardActions.MANAGE_CITE_KEY_PATTERNS, new BibtexKeyPatternAction(this, stateManager)) ); return contextMenu; }

Target:
private ContextMenu createTabContextMenu(KeyBindingRepository keyBindingRepository) { ContextMenu contextMenu = new ContextMenu(); ActionFactory factory = new ActionFactory(keyBindingRepository); contextMenu.getItems().addAll( factory.createMenuItem(StandardActions.CLOSE_LIBRARY, new CloseDatabaseAction()), factory.createMenuItem(StandardActions.CLOSE_OTHER_LIBRARIES, new CloseOthersDatabaseAction()), factory.createMenuItem(StandardActions.CLOSE_ALL_LIBRARIES, new CloseAllDatabaseAction()), new SeparatorMenuItem(), factory.createMenuItem(StandardActions.OPEN_DATABASE_FOLDER, new OpenDatabaseFolder()), factory.createMenuItem(StandardActions.OPEN_CONSOLE, new OpenConsoleAction(stateManager)) ); return contextMenu; }
Source:
private void setupAndDropAndCreateIndex() { setupHelper.start() .withIndex( INDEX_NAME, ctx -> { IndexSchemaElement root = ctx.getSchemaElement(); root.field( "field", f -> f.asString() ) .toReference(); }, indexManager -> this.indexManager = indexManager ) .withSchemaManagement( StubMappingSchemaManagementStrategy.DROP_ON_SHUTDOWN_ONLY ) .withBackendProperty( ElasticsearchBackendSettings.ANALYSIS_CONFIGURER, (ElasticsearchAnalysisConfigurer) (ElasticsearchAnalysisConfigurationContext context) -> { } ) .setup(); Futures.unwrappedExceptionJoin( ElasticsearchIndexSchemaManagerOperation.DROP_AND_CREATE.apply( indexManager.getSchemaManager() ) ); }

Target:
private void setupAndDropAndCreateIndex() { setupHelper.start() .withIndex( INDEX_NAME, ctx -> { IndexSchemaElement root = ctx.getSchemaElement(); root.field( "field", f -> f.asString() ) .toReference(); }, indexManager -> this.indexManager = indexManager ) .withSchemaManagement( StubMappingSchemaManagementStrategy.DROP_ON_SHUTDOWN_ONLY ) .withBackendProperty( ElasticsearchBackendSettings.ANALYSIS_CONFIGURER, (ElasticsearchAnalysisConfigurer) (ElasticsearchAnalysisConfigurationContext context) -> { } ) .setup(); Futures.unwrappedExceptionJoin( indexManager.getSchemaManager().dropAndCreate() ); }