auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Person getPerson(Integer personId) { final Optional<Person> maybePerson; maybePerson = personService.getPersonByID(personId); if (maybePerson.isEmpty()) { throw new ResponseStatusException(BAD_REQUEST, "No person found for id = " + personId); } return maybePerson.get(); }

Target:
private Person getPerson(Integer personId) { return personService.getPersonByID(personId) .orElseThrow(() -> new ResponseStatusException(BAD_REQUEST, "No person found for id = " + personId)); }
Source:
public boolean isThereAnInternalTraceBetween(EObject first, EObject second) { if (first.equals(second)) { return false; } else if (first instanceof INamed && second instanceof INamed) { if (first.eCrossReferences().contains(second) || second.eCrossReferences().contains(first)) { return true; } } return false; }

Target:
public boolean isThereAnInternalTraceBetween(EObject first, EObject second) { if (first.equals(second)) { return false; } else if (first instanceof INamed && second instanceof INamed) { if (!first.eCrossReferences().isEmpty() && !second.eCrossReferences().isEmpty()) { if (first.eCrossReferences().contains(second) || second.eCrossReferences().contains(first)) { return true; } } } return false; }
Source:
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { if (handler instanceof HandlerMethod) { HandlerMethod handlerMethod = (HandlerMethod) handler; String controller = handlerMethod.getMethod().getDeclaringClass().getSimpleName(); if (controllersToExclude.contains(controller)) { return; } Integer status = response.getStatus(); if (ex != null) { status = 500; } Id id = registry.createId(metricName) .withTag("controller", controller) .withTag("method", handlerMethod.getMethod().getName()) .withTag("status", status.toString().charAt(0) + "xx") .withTag("statusCode", status.toString()) .withTag("reqContentLength", Long.toString(request.getContentLengthLong())); Map variables = (Map) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); for (String pathVariable : pathVariablesToTag) { if (variables.containsKey(pathVariable)) { id = id.withTag(pathVariable, variables.get(pathVariable).toString()); } } if (ex != null) { id = id.withTag("success", "false").withTag("cause", ex.getClass().getSimpleName()); } else { id = id.withTag("success", "true"); } registry.timer(id).record( getNanoTime() - ((Long) request.getAttribute(TIMER_ATTRIBUTE)), TimeUnit.NANOSECONDS ); } }

Target:
public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception { if (handler instanceof HandlerMethod) { HandlerMethod handlerMethod = (HandlerMethod) handler; String controller = handlerMethod.getMethod().getDeclaringClass().getSimpleName(); if (controllersToExclude.contains(controller)) { return; } Integer status = response.getStatus(); if (ex != null) { status = 500; } Id id = registry.createId(metricName) .withTag("controller", controller) .withTag("method", handlerMethod.getMethod().getName()) .withTag("status", status.toString().charAt(0) + "xx") .withTag("statusCode", status.toString()); Map variables = (Map) request.getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE); for (String pathVariable : pathVariablesToTag) { if (variables.containsKey(pathVariable)) { id = id.withTag(pathVariable, variables.get(pathVariable).toString()); } } if (ex != null) { id = id.withTag("success", "false").withTag("cause", ex.getClass().getSimpleName()); } else { id = id.withTag("success", "true"); } registry.timer(id).record( getNanoTime() - ((Long) request.getAttribute(TIMER_ATTRIBUTE)), TimeUnit.NANOSECONDS ); Id contentLengthId = registry.createId(contentLengthMetricName).withTags(id.tags()); registry.distributionSummary(contentLengthId).record(request.getContentLengthLong()); } }
Source:
public ApplyDeferredLightingNode(Context context) { DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); SwappableFBO gBuffer = displayResolutionDependentFBOs.getGBuffer(); gBuffer.swap(); addDesiredStateChange(new BindFbo(gBuffer.getWriteFbo())); addDesiredStateChange(new EnableMaterial(DEFERRED_LIGHTING_MATERIAL)); FBO gBufferRead = displayResolutionDependentFBOs.getGBuffer().getReadFbo(); int textureSlot = 0; addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, gBufferRead, ColorTexture, displayResolutionDependentFBOs, DEFERRED_LIGHTING_MATERIAL, "texSceneOpaque")); addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, gBufferRead, DepthStencilTexture, displayResolutionDependentFBOs, DEFERRED_LIGHTING_MATERIAL, "texSceneOpaqueDepth")); addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, gBufferRead, NormalsTexture, displayResolutionDependentFBOs, DEFERRED_LIGHTING_MATERIAL, "texSceneOpaqueNormals")); addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, gBufferRead, LightAccumulationTexture, displayResolutionDependentFBOs, DEFERRED_LIGHTING_MATERIAL, "texSceneOpaqueLightBuffer")); }

Target:
public ApplyDeferredLightingNode(Context context) { DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); SwappableFBO gBufferPair = displayResolutionDependentFBOs.getGBufferPair(); addDesiredStateChange(new BindFbo(gBufferPair.getStaleFbo())); addDesiredStateChange(new EnableMaterial(DEFERRED_LIGHTING_MATERIAL_URN)); FBO lastUpdatedGBuffer = displayResolutionDependentFBOs.getGBufferPair().getLastUpdatedFbo(); int textureSlot = 0; addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, ColorTexture, displayResolutionDependentFBOs, DEFERRED_LIGHTING_MATERIAL_URN, "texSceneOpaque")); addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, DepthStencilTexture, displayResolutionDependentFBOs, DEFERRED_LIGHTING_MATERIAL_URN, "texSceneOpaqueDepth")); addDesiredStateChange(new SetInputTextureFromFbo(textureSlot++, lastUpdatedGBuffer, NormalsTexture, displayResolutionDependentFBOs, DEFERRED_LIGHTING_MATERIAL_URN, "texSceneOpaqueNormals")); addDesiredStateChange(new SetInputTextureFromFbo(textureSlot, lastUpdatedGBuffer, LightAccumulationTexture, displayResolutionDependentFBOs, DEFERRED_LIGHTING_MATERIAL_URN, "texSceneOpaqueLightBuffer")); addDesiredStateChange(new SwapGBuffers(gBufferPair)); }
Source:
public void getObs_ShouldPopulateModelAndViewWithObsForGivenObsAndGivenValidOrder() throws Exception { ModelAndView modelAndView = radiologyObsFormController.getObs(ValidorderId, ValidObsIdForOrder20); assertNotNull(modelAndView); assertThat(modelAndView.getViewName(), is("module/radiology/radiologyObsForm")); assertTrue(modelAndView.getModelMap().containsKey("obs")); Obs obs = (Obs) modelAndView.getModelMap().get("obs"); assertNotNull(obs); assertNotNull(obs.getPerson()); assertNotNull(obs.getOrder()); assertThat(obs.getOrder().getId(), is(mockOrder.getId())); assertThat(obs.getPerson().getId(), is(RadiologyTestData.getMockPatient1().getId())); }

Target:
public void getObs_ShouldPopulateModelAndViewWithObsForGivenObsAndGivenValidOrder() throws Exception { ModelAndView modelAndView = radiologyObsFormController.getObs(validorderId, validObsIdForOrder20); assertTrue(modelAndView.getModelMap().containsKey("obs")); Obs obs = (Obs) modelAndView.getModelMap().get("obs"); assertNotNull(obs); assertNotNull(obs.getPerson()); assertNotNull(obs.getOrder()); assertThat(obs.getOrder().getId(), is(mockOrder.getId())); assertThat(obs.getPerson().getId(), is(RadiologyTestData.getMockPatient1().getId())); }
Source:
public DataSerializableFactory createFactory() { return new DataSerializableFactory() { @Override public IdentifiedDataSerializable create(int typeId) { switch (typeId) { case EVENT_JOURNAL_INITIAL_SUBSCRIBER_STATE: return new EventJournalInitialSubscriberState(); case DESERIALIZING_ENTRY: return new DeserializingEntry<>(); default: return null; } } }; }

Target:
public DataSerializableFactory createFactory() { return new DataSerializableFactory() { @Override public IdentifiedDataSerializable create(int typeId) { switch (typeId) { case EVENT_JOURNAL_INITIAL_SUBSCRIBER_STATE: return new EventJournalInitialSubscriberState(); case DESERIALIZING_ENTRY: return new DeserializingEntry(); default: return null; } } }; }
Source:
public List<Pair<Guid, Integer>> score(List<VDS> hosts, VM vm, Map<String, String> parameters) { final VdsDynamic lastHost = getLastHost(vm, hosts); if (lastHost == null) { return noWeights(hosts); } final OS lastHostOs = OS.fromPackageVersionString(lastHost.getHostOs()); if (!lastHostOs.isValid()) { log.debug("Reference host provides an invalid or incomplete OS identifier. Found {}.", lastHost.getId(), lastHost.getHostOs()); return noWeights(hosts); } final List<Pair<Guid, Integer>> weights = new ArrayList<>(); for (final VDS host : hosts) { final OS hostOs = OS.fromPackageVersionString(host.getHostOs()); if (!hostOs.isValid()) { log.debug("Host does not provides an invalid or incomplete OS identifier. Found {}.", host.getId(), host.getHostOs()); weights.add(toWeight(host, BAD_WEIGHT)); } else if (!hostOs.isSameOs(lastHostOs)) { log.debug("Host does not run the same operating system. Expected {}, found {}", host.getId(), lastHostOs.getName(), hostOs.getName()); weights.add(toWeight(host, BAD_WEIGHT)); } else if (hostOs.isOlderThan(lastHostOs)) { weights.add(toWeight(host, BAD_WEIGHT)); } else if (!hostOs.isNewerThan(lastHostOs)) { weights.add(toWeight(host, BETTER_WEIGHT)); } else { weights.add(toWeight(host, BEST_WEIGHT)); } } return weights; }

Target:
public List<Pair<Guid, Integer>> score(List<VDS> hosts, VM vm, Map<String, String> parameters) { final VdsDynamic lastHost = getLastHost(vm); if (lastHost == null) { return noWeights(hosts); } final OS lastHostOs = OS.fromPackageVersionString(lastHost.getHostOs()); if (!lastHostOs.isValid()) { log.debug("Reference host provides an invalid or incomplete OS identifier. Found {}.", lastHost.getId(), lastHost.getHostOs()); return noWeights(hosts); } final List<Pair<Guid, Integer>> weights = new ArrayList<>(); for (final VDS host : hosts) { final OS hostOs = OS.fromPackageVersionString(host.getHostOs()); if (!hostOs.isValid()) { log.debug("Host does not provides an invalid or incomplete OS identifier. Found {}.", host.getId(), host.getHostOs()); weights.add(toWeight(host, BAD_WEIGHT)); } else if (!hostOs.isSameOs(lastHostOs)) { log.debug("Host does not run the same operating system. Expected {}, found {}", host.getId(), lastHostOs.getName(), hostOs.getName()); weights.add(toWeight(host, BAD_WEIGHT)); } else if (hostOs.isOlderThan(lastHostOs)) { weights.add(toWeight(host, BAD_WEIGHT)); } else if (!hostOs.isNewerThan(lastHostOs)) { weights.add(toWeight(host, BETTER_WEIGHT)); } else { weights.add(toWeight(host, BEST_WEIGHT)); } } return weights; }
Source:
private static KMeansModel pmmlToKMeansModel(PMML pmml) { ClusteringModel clusteringModel = (ClusteringModel) pmml.getModels().get(0); List<Cluster> clusters = clusteringModel.getClusters(); Vector[] clusterCenters = new Vector[clusters.size()]; for (Cluster cluster : clusters) { clusterCenters[Integer.parseInt(cluster.getId())] = parseVector(TextUtils.parseDelimited(cluster.getArray().getValue(), ' ')); } return new KMeansModel(clusterCenters); }

Target:
private static KMeansModel pmmlToKMeansModel(PMML pmml) { List<ClusterInfo> clusterInfos = KMeansPMMLUtils.read(pmml); Vector[] clusterCenters = new Vector[clusterInfos.size()]; for (ClusterInfo clusterInfo : clusterInfos) { clusterCenters[clusterInfo.getID()] = Vectors.dense(clusterInfo.getCenter()); } return new KMeansModel(clusterCenters); }
Source:
public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } if (model.isSetPromisc()) { model.setPromisc(entity.isPromisc()); } return entity; }

Target:
public static VmNetworkInterface map(NIC model, VmNetworkInterface template) { VmNetworkInterface entity = template != null ? template : new VmNetworkInterface(); if (model.isSetVm() && model.getVm().isSetId()) { entity.setVmId(new Guid(model.getVm().getId())); } if (model.isSetId()) { entity.setId(new Guid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetMac() && model.getMac().isSetAddress()) { entity.setMacAddress(model.getMac().getAddress()); } if (model.isSetNetwork() && model.getNetwork().isSetName()) { entity.setNetworkName(model.getNetwork().getName()); } if (model.isSetInterface()) { NicInterface nicType = NicInterface.fromValue(model.getInterface()); if (nicType != null) { entity.setType(map(nicType)); } } if (model.isSetActive()) { entity.setActive(model.isActive()); } if (model.isSetPromiscuous()) { model.setPromiscuous(entity.isPromisc()); } return entity; }
Source:
public void setSendingEnabled(PerunSession sess, List<ApplicationMail> mails, boolean enabled) throws PerunException { if (mails == null) { throw new InternalErrorException("Mails definitions to update can't be null"); } for (ApplicationMail mail : mails) { if (Compatibility.isPostgreSql()) { int existence = jdbc.update("update application_mails set send=? where id=?", (enabled) ? "1" : "0", mail.getId()); if (existence < 1) throw new ApplicationMailNotExistsException("Application mail does not exist.", mail); } else { int existence = jdbc.update("update application_mails set send=? where id=?", enabled, mail.getId()); if (existence < 1) throw new ApplicationMailNotExistsException("Application mail does not exist.", mail); } perun.getAuditer().log(sess, new MailSending(mail, enabled)); } }

Target:
public void setSendingEnabled(PerunSession sess, List<ApplicationMail> mails, boolean enabled) throws PerunException { if (mails == null) { throw new InternalErrorException("Mails definitions to update can't be null"); } for (ApplicationMail mail : mails) { if (Compatibility.isPostgreSql()) { try { int existence = jdbc.update("update application_mails set send=? where id=?", (enabled) ? "1" : "0", mail.getId()); if (existence < 1) throw new ApplicationMailNotExistsException("Application mail does not exist.", mail); } catch (RuntimeException e) { throw new InternalErrorException(e); } } else { int existence = jdbc.update("update application_mails set send=? where id=?", enabled, mail.getId()); if (existence < 1) throw new ApplicationMailNotExistsException("Application mail does not exist.", mail); } perun.getAuditer().log(sess, new MailSending(mail, enabled)); } }
Source:
public EntitleByProductsJobConfig setOwner(final Owner owner) { if (owner == null) { throw new IllegalArgumentException("Owner is null"); } this.setJobArgument(OWNER_KEY, owner.getKey()) .setLogLevel(owner.getLogLevel()); return this; }

Target:
public EntitleByProductsJobConfig setOwner(final Owner owner) { if (owner == null) { throw new IllegalArgumentException("owner is null"); } this.setJobMetadata(OWNER_KEY, owner.getKey()) .setLogLevel(owner.getLogLevel()); return this; }
Source:
public Location resolve(String spec, Map locationFlags) { try { Set<String> seenSoFar = specsSeen.get(); if (seenSoFar==null) { seenSoFar = new LinkedHashSet<String>(); specsSeen.set(seenSoFar); } if (seenSoFar.contains(spec)) throw new IllegalStateException("Circular reference in definition of location '"+spec+"' ("+seenSoFar+")"); seenSoFar.add(spec); LocationResolver resolver = getSpecResolver(spec); if (resolver != null) { return resolver.newLocationFromString(locationFlags, spec, this); } throw new NoSuchElementException("No resolver found for '"+spec+"': " + "known resolvers are "+resolvers.keySet()+"; if you do not see an expected resolver, ensure your classpath is correct include META-INF/services"); } finally { specsSeen.remove(); } }

Target:
public Location resolve(String spec, Map locationFlags) { try { Set<String> seenSoFar = specsSeen.get(); if (seenSoFar==null) { seenSoFar = new LinkedHashSet<String>(); specsSeen.set(seenSoFar); } if (seenSoFar.contains(spec)) throw new IllegalStateException("Circular reference in definition of location '"+spec+"' ("+seenSoFar+")"); seenSoFar.add(spec); LocationResolver resolver = getSpecResolver(spec); if (resolver != null) { return resolver.newLocationFromString(locationFlags, spec, this); } throw new NoSuchElementException("No resolver found for '"+spec+"': " + "known resolvers are "+resolvers.keySet()+"; if you do not see an expected resolver, " + "ensure your classpath is correct and includes META-INF/services"); } finally { specsSeen.remove(); } }
Source:
public void testMatchesWithDescriptors() throws Exception { RichColumnDescriptor tableColumn = getTableColumn(); String val = "Test"; Slice slice = Slices.utf8Slice(val); TupleDomain<ColumnDescriptor> effectivePredicate = getEffectivePredicate(tableColumn, VarcharType.createVarcharType(255), val); List<RichColumnDescriptor> tableColumns = Collections.singletonList(tableColumn); TupleDomainParquetPredicate predicate = new TupleDomainParquetPredicate(effectivePredicate, tableColumns); ParquetDictionaryPage page = new ParquetDictionaryPage(slice, 2, ParquetEncoding.PLAIN_DICTIONARY); assertTrue(predicate.matches(Collections.singletonMap(tableColumn, new ParquetDictionaryDescriptor(tableColumn, Optional.of(page))))); }

Target:
public void testMatchesWithDescriptors() { RichColumnDescriptor column = getColumn(); String value = "Test2"; TupleDomain<ColumnDescriptor> effectivePredicate = getEffectivePredicate(column, createVarcharType(255), value); List<RichColumnDescriptor> columns = singletonList(column); TupleDomainParquetPredicate predicate = new TupleDomainParquetPredicate(effectivePredicate, columns); ParquetDictionaryPage page = new ParquetDictionaryPage(utf8Slice(value), 2, PLAIN_DICTIONARY); assertTrue(predicate.matches(singletonMap(column, new ParquetDictionaryDescriptor(column, Optional.of(page))))); }
Source:
public static String makeApiCall(String... urlChunks){ String url = canvasURL + CANVAS_API_VERSION; for (String chunk : urlChunks) { url = url + chunk; } M_log.info("API call: " + url); HttpResponse response = Utils.processApiCall(new HttpGet(url)); if (response == null) { M_log.error(String.format("The Api call %s failed with errors", url)); return null; } int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { M_log.error(String.format("The Api call %s has failed with status code %s", url, statusCode)); return null; } String apiResponse; String errMsg = "The API call %s has failed to extract the response due to %s"; try { apiResponse = EntityUtils.toString(response.getEntity(), "UTF-8"); } catch (IOException e) { M_log.error(String.format(errMsg, url, e.getMessage())); return null; } catch (Exception e) { M_log.error(String.format(errMsg, url, e.getMessage())); return null; } return apiResponse; }

Target:
public static String makeApiCall(String... urlChunks){ String url = canvasURL + CANVAS_API_VERSION; for (String chunk : urlChunks) { url += chunk; } M_log.info("API call: " + url); HttpResponse response = Utils.executeApiCall(new HttpGet(url)); if (response == null) { M_log.error(String.format("The Api call %s failed with errors", url)); return null; } int statusCode = response.getStatusLine().getStatusCode(); if (statusCode != HttpStatus.SC_OK) { M_log.error(String.format("The Api call %s has failed with status code %s", url, statusCode)); return null; } String apiResponse; String errMsg = "The API call %s has failed to extract the response due to %s"; try { apiResponse = EntityUtils.toString(response.getEntity(), "UTF-8"); } catch (IOException e) { M_log.error(String.format(errMsg, url, e.getMessage())); return null; } catch (Exception e) { M_log.error(String.format(errMsg, url, e.getMessage())); return null; } return apiResponse; }
Source:
public List<Runnable> shutdownNow() { shutdown(true); final ArrayList<Runnable> list = new ArrayList<>(); TaskNode head = this.head; QNode headNext; for (;;) { headNext = head.getNext(); if (headNext != head && headNext instanceof TaskNode) { TaskNode taskNode = (TaskNode) headNext; if (compareAndSetHead(head, taskNode)) { head.setNextRelaxed(head); if (! NO_QUEUE_LIMIT) decreaseQueueSize(); head = taskNode; list.add(taskNode.task); } } else { return list; } } }

Target:
public List<Runnable> shutdownNow() { shutdown(true); final ArrayList<Runnable> list = new ArrayList<>(); TaskNode head = this.head; QNode headNext; for (;;) { headNext = head.getNext(); if (headNext == head) { head = this.head; continue; } if (headNext instanceof TaskNode) { TaskNode taskNode = (TaskNode) headNext; if (compareAndSetHead(head, taskNode)) { head.setNextOrdered(head); if (! NO_QUEUE_LIMIT) decreaseQueueSize(); head = taskNode; list.add(taskNode.task); } } else { return list; } } }
Source:
public Map<String, String> getAvailableStorageResourceIdList() throws AppCatalogException { try { Map<String, String> storageResourceMap = new HashMap<String, String>(); List<StorageResourceDescription> storageResourceDescriptionList = select(QueryConstants.FIND_ALL_STORAGE_RESOURCES, 0); if (storageResourceDescriptionList != null) { for (StorageResourceDescription storageResourceDescription: storageResourceDescriptionList) { if (storageResourceDescription.isEnabled()) { storageResourceMap.put(storageResourceDescription.getStorageResourceId(), storageResourceDescription.getHostName()); } } } return storageResourceMap; } catch (Exception e) { logger.error("Error while retrieving storage resource ID list", e); throw new AppCatalogException(e); } }

Target:
public Map<String, String> getAvailableStorageResourceIdList() throws AppCatalogException { try { Map<String, String> storageResourceMap = new HashMap<String, String>(); List<StorageResourceDescription> storageResourceDescriptionList = select(QueryConstants.FIND_ALL_AVAILABLE_STORAGE_RESOURCES, 0); return getStorageResourceMap(storageResourceDescriptionList); } catch (Exception e) { logger.error("Error while retrieving available storage resource ID map", e); throw new AppCatalogException("Error while retrieving available storage resource ID map", e); } }
Source:
private void showAccessRestrictionDialog(BPListElement selElement) { AccessRulesDialog dialog = new AccessRulesDialog(getShell(), selElement, fCurrJProject, fPageContainer != null); int res = dialog.open(); if (res == Window.OK || res == AccessRulesDialog.SWITCH_PAGE) { selElement.setAttribute(BPListElement.ACCESSRULES, dialog .getAccessRules()); selElement.setAttribute(BPListElement.COMBINE_ACCESSRULES, Boolean.valueOf(dialog.doCombineAccessRules())); fProjectsList.refresh(); fBuildpathList.dialogFieldChanged(); if (res == AccessRulesDialog.SWITCH_PAGE) { dialog.performPageSwitch(fPageContainer); } } }

Target:
private void showAccessRestrictionDialog(BPListElement selElement) { AccessRulesDialog dialog = new AccessRulesDialog(getShell(), selElement, fCurrJProject, fPageContainer != null); int res = dialog.open(); if (res == Window.OK || res == AccessRulesDialog.SWITCH_PAGE) { selElement.setAttribute(BPListElement.ACCESSRULES, dialog .getAccessRules()); selElement.setAttribute(BPListElement.COMBINE_ACCESSRULES, dialog.doCombineAccessRules()); fProjectsList.refresh(); fBuildpathList.dialogFieldChanged(); if (res == AccessRulesDialog.SWITCH_PAGE) { dialog.performPageSwitch(fPageContainer); } } }
Source:
@Test public void testInsertCreateNewCompositeUdt() throws Exception { try (Connection c = connect(); Statement s = c.createStatement()) { boolean b = s.execute("create type mytype as (i int, j int)"); assertThat(b, is(false)); b = s.execute("create table w (i int not null, j mytype)"); assertThat(b, is(false)); int x = s.executeUpdate("insert into w " + "values (1, mytype(1, 1))"); assertThat(x, is(1)); try (ResultSet r = s.executeQuery("select * from w")) { assertThat(r.next(), is(true)); assertThat(r.getInt("i"), is(1)); assertArrayEquals(r.getObject("j", Struct.class).getAttributes(), new Object[] {1, 1}); assertThat(r.next(), is(false)); } } }

Target:
@Test public void testInsertCreateNewCompositeUdt() throws Exception { try (Connection c = connect(); Statement s = c.createStatement()) { boolean b = s.execute("create type mytype as (i int, j int)"); assertFalse(b); b = s.execute("create table w (i int not null, j mytype)"); assertFalse(b); int x = s.executeUpdate("insert into w " + "values (1, mytype(1, 1))"); assertEquals(x, 1); try (ResultSet r = s.executeQuery("select * from w")) { assertTrue(r.next()); assertEquals(r.getInt("i"), 1); assertArrayEquals(r.getObject("j", Struct.class).getAttributes(), new Object[] {1, 1}); assertFalse(r.next()); } } }
Source:
private void registerTransformers(SubsystemRegistration subsystem) { ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(subsystem.getSubsystemVersion()); ResourceTransformationDescriptionBuilder buildWfly10 = chainedBuilder.createBuilder(subsystem.getSubsystemVersion(), MODEL_VERSION_WFLY10); ResourceTransformationDescriptionBuilder builderEap64 = chainedBuilder.createBuilder(MODEL_VERSION_WFLY10, MODEL_VERSION_EAP64); builderEap64.getAttributeBuilder() .addRename(TransactionSubsystemRootResourceDefinition.USE_JOURNAL_STORE, CommonAttributes.USE_HORNETQ_STORE) .addRename(TransactionSubsystemRootResourceDefinition.JOURNAL_STORE_ENABLE_ASYNC_IO, CommonAttributes.HORNETQ_STORE_ENABLE_ASYNC_IO) .addRename(TransactionSubsystemRootResourceDefinition.STATISTICS_ENABLED, CommonAttributes.ENABLE_STATISTICS) .setDiscard(DiscardAttributeChecker.ALWAYS, TransactionSubsystemRootResourceDefinition.USE_ACTIONSTATUSSERVICE_RECOVERY_FILTER); ResourceTransformationDescriptionBuilder builderEap63 = chainedBuilder.createBuilder(MODEL_VERSION_EAP64, MODEL_VERSION_EAP63); builderEap63.rejectChildResource(CMResourceResourceDefinition.PATH_CM_RESOURCE); ResourceTransformationDescriptionBuilder builderEap62 = chainedBuilder.createBuilder(MODEL_VERSION_EAP63, MODEL_VERSION_EAP62); chainedBuilder.buildAndRegister(subsystem, new ModelVersion[]{ MODEL_VERSION_WFLY10, MODEL_VERSION_EAP62, MODEL_VERSION_EAP63, MODEL_VERSION_EAP64, }); }

Target:
private void registerTransformers(SubsystemRegistration subsystem) { ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(subsystem.getSubsystemVersion()); ResourceTransformationDescriptionBuilder builderEap64 = chainedBuilder.createBuilder(subsystem.getSubsystemVersion(), MODEL_VERSION_EAP64); builderEap64.getAttributeBuilder() .addRename(TransactionSubsystemRootResourceDefinition.USE_JOURNAL_STORE, CommonAttributes.USE_HORNETQ_STORE) .addRename(TransactionSubsystemRootResourceDefinition.JOURNAL_STORE_ENABLE_ASYNC_IO, CommonAttributes.HORNETQ_STORE_ENABLE_ASYNC_IO) .addRename(TransactionSubsystemRootResourceDefinition.STATISTICS_ENABLED, CommonAttributes.ENABLE_STATISTICS); ResourceTransformationDescriptionBuilder builderEap63 = chainedBuilder.createBuilder(MODEL_VERSION_EAP64, MODEL_VERSION_EAP63); builderEap63.rejectChildResource(CMResourceResourceDefinition.PATH_CM_RESOURCE); ResourceTransformationDescriptionBuilder builderEap62 = chainedBuilder.createBuilder(MODEL_VERSION_EAP63, MODEL_VERSION_EAP62); chainedBuilder.buildAndRegister(subsystem, new ModelVersion[]{ MODEL_VERSION_EAP62, MODEL_VERSION_EAP63, MODEL_VERSION_EAP64, }); }
Source:
private void updateHead() { while (headRecord == null && !fifoQueue.isEmpty()) { final ConsumerRecord<byte[], byte[]> raw = fifoQueue.pollFirst(); final ConsumerRecord<Object, Object> deserialized = recordDeserializer.deserialize(processorContext, raw); if (deserialized == null) { continue; } final long timestamp; try { timestamp = timestampExtractor.extract(deserialized, partitionTime); } catch (final StreamsException internalFatalExtractorException) { throw internalFatalExtractorException; } catch (final Exception fatalUserException) { throw new StreamsException( String.format("Fatal user code error in TimestampExtractor callback for record %s.", deserialized), fatalUserException); } log.trace("Source node extracted timestamp for record {}", source.name(), timestamp, deserialized); if (timestamp < 0) { log.warn( "Skipping record due to negative extracted timestamp. topic=[{}] partition=[{}] offset=[{}] extractedTimestamp=[{}] extractor=[{}]", deserialized.topic(), deserialized.partition(), deserialized.offset(), timestamp, timestampExtractor.getClass().getCanonicalName() ); skipRecordsSensor.record(); continue; } headRecord = new StampedRecord(deserialized, timestamp); if (timestamp > partitionTime) { partitionTime = timestamp; } } }

Target:
private void updateHead() { while (headRecord == null && !fifoQueue.isEmpty()) { final ConsumerRecord<byte[], byte[]> raw = fifoQueue.pollFirst(); final ConsumerRecord<Object, Object> deserialized = recordDeserializer.deserialize(processorContext, raw); if (deserialized == null) { continue; } final long timestamp; try { timestamp = timestampExtractor.extract(deserialized, partitionTime); } catch (final StreamsException internalFatalExtractorException) { throw internalFatalExtractorException; } catch (final Exception fatalUserException) { throw new StreamsException( String.format("Fatal user code error in TimestampExtractor callback for record %s.", deserialized), fatalUserException); } log.trace("Source node extracted timestamp for record {}", source.name(), timestamp, deserialized); if (timestamp < 0) { log.warn( "Skipping record due to negative extracted timestamp. topic=[{}] partition=[{}] offset=[{}] extractedTimestamp=[{}] extractor=[{}]", deserialized.topic(), deserialized.partition(), deserialized.offset(), timestamp, timestampExtractor.getClass().getCanonicalName() ); skipRecordsSensor.record(); continue; } headRecord = new StampedRecord(deserialized, timestamp); partitionTime = Math.max(partitionTime, timestamp); } }
Source:
public HasValueContainer(final String key, final Predicate predicate, final Object value, Collection<PropertyDefinition> propertyDefinitions) { this.key = key; this.value = value; this.predicate = predicate; this.propertyDefinitions = propertyDefinitions; PropertyDefinition propertyDefinition = PropertyDefinition.findPropertyDefinition(propertyDefinitions, key); if (!predicate.isSupported(propertyDefinition)) { throw new VertexiumException("Check your TextIndexHint settings. Predicate " + predicate.toString() + " cannot be used with property " + key); } }

Target:
public HasValueContainer(final String key, final Predicate predicate, final Object value, Collection<PropertyDefinition> propertyDefinitions) { this.key = key; this.value = value; this.predicate = predicate; this.propertyDefinitions = propertyDefinitions; PropertyDefinition propertyDefinition = PropertyDefinition.findPropertyDefinition(propertyDefinitions, key); predicate.validate(propertyDefinition); }
Source:
protected void executeQueryCommand() { List<VmTemplate> vmTemplateList = getDbFacade().getVmTemplateDao() .getAllForNetwork(getParameters().getNetworkId()); List<VmNetworkInterface> vmNetworkInterfaceList = getDbFacade().getVmNetworkInterfaceDao() .getAllForTemplatesByNetwork(getParameters().getNetworkId()); final Map<Guid, VmTemplate> vmTemplatesById = Entities.businessEntitiesById(vmTemplateList); List<Pair<VmNetworkInterface, VmTemplate>> vmInterfaceVmPairs = new ArrayList<Pair<VmNetworkInterface, VmTemplate>>(); for (VmNetworkInterface vmNetworkInterface : vmNetworkInterfaceList) { vmInterfaceVmPairs.add(new Pair(vmNetworkInterface, vmTemplatesById.get(vmNetworkInterface.getVmTemplateId()))); } getQueryReturnValue().setReturnValue(vmInterfaceVmPairs); }

Target:
protected void executeQueryCommand() { List<VmTemplate> vmTemplateList = getDbFacade().getVmTemplateDao() .getAllForNetwork(getParameters().getNetworkId()); List<VmNetworkInterface> vmNetworkInterfaceList = getDbFacade().getVmNetworkInterfaceDao() .getAllForTemplatesByNetwork(getParameters().getNetworkId()); final Map<Guid, VmTemplate> vmTemplatesById = Entities.businessEntitiesById(vmTemplateList); List<PairQueryable<VmNetworkInterface, VmTemplate>> vmInterfaceVmPairs = new ArrayList<PairQueryable<VmNetworkInterface, VmTemplate>>(); for (VmNetworkInterface vmNetworkInterface : vmNetworkInterfaceList) { vmInterfaceVmPairs.add(new PairQueryable(vmNetworkInterface, vmTemplatesById.get(vmNetworkInterface.getVmTemplateId()))); } getQueryReturnValue().setReturnValue(vmInterfaceVmPairs); }
Source:
private void processConnectionRequest(final XMPPAccount account) { JID currentJID = connectionHandler.getLocalJID(); JID newJID = new JID(account.getUsername(), account.getDomain()); if (currentJID == null) { connectToAccount(account, false); return; } if (newJID.strictlyEquals(currentJID)) { LOG.debug( "Ignoring connection action as account is already connected. current JID: " + currentJID + ", new JID: " + newJID); return; } ISarosSession sarosSession = sarosSessionManager.getSession(); if (sarosSession == null) { connectToAccount(account, true); return; } String message = Messages.ConnectServerAction_leave_session_confirmation_message; if (sarosSession.isHost()) { message += Messages.ConnectServerAction_leave_session_confirmation_host_addendum_message; } boolean reallyReconnect; try { reallyReconnect = SafeDialogUtils.showYesNoDialog( project, message, Messages.ConnectServerAction_leave_session_confirmation_title); } catch (IllegalAWTContextException e) { LOG.error("Failed to show question on whether to really switch accounts to user", e); NotificationPanel.showError( MessageFormat.format( Messages.ConnectServerAction_leave_session_confirmation_host_addendum_error_message, e.getMessage()), Messages.ConnectServerAction_leave_session_confirmation_host_addendum_error_title); return; } if (reallyReconnect) { connectToAccount(account, true); } }

Target:
private void processConnectionRequest(final XMPPAccount account) { JID currentJID = connectionHandler.getLocalJID(); JID newJID = new JID(account.getUsername(), account.getDomain()); if (currentJID == null) { connectToAccount(account, false, false); return; } if (newJID.equals(currentJID)) { LOG.debug( "Ignoring connection action as account is already connected. current JID: " + currentJID + ", new JID: " + newJID); return; } ISarosSession sarosSession = sarosSessionManager.getSession(); if (sarosSession == null) { connectToAccount(account, true, false); return; } String message = Messages.ConnectServerAction_leave_session_confirmation_message; if (sarosSession.isHost()) { message += Messages.ConnectServerAction_leave_session_confirmation_host_addendum_message; } boolean reallyReconnect; try { reallyReconnect = SafeDialogUtils.showYesNoDialog( project, message, Messages.ConnectServerAction_leave_session_confirmation_title); } catch (IllegalAWTContextException e) { LOG.error("Failed to show question on whether to really switch accounts to user", e); NotificationPanel.showError( MessageFormat.format( Messages.ConnectServerAction_leave_session_confirmation_host_addendum_error_message, e.getMessage()), Messages.ConnectServerAction_leave_session_confirmation_host_addendum_error_title); return; } if (reallyReconnect) { connectToAccount(account, true, true); } }
Source:
public Operation exec(Prolog engine) throws PrologException { engine.setB0(); Term a1 = arg1.dereference(); Term a2 = arg2.dereference(); Term a3 = arg3.dereference(); PrologEnvironment env = (PrologEnvironment) engine.control; final PatchSet.Id id = StoredValues.PATCH_SET_ID.get(engine); PatchSetInfoFactory psiFactory = env.getInjector().getInstance(PatchSetInfoFactory.class); Term idTerm; Term nameTerm = Prolog.Nil; Term emailTerm = Prolog.Nil; try { UserIdentity author = psiFactory.get(id).getAuthor(); Account.Id authorId = author.getAccount(); if (authorId == null) { idTerm = SymbolTerm.intern("anonymous"); } else { idTerm = new IntegerTerm(authorId.get()); } String name = author.getName(); if (name != null && !name.equals("")) { nameTerm = SymbolTerm.intern(name); } String email = author.getEmail(); if (email != null && !email.equals("")) { emailTerm = SymbolTerm.intern(email); } } catch (PatchSetInfoNotAvailableException err) { throw new JavaException(this, 1, err); } if (!a1.unify(new StructureTerm(user, idTerm), engine.trail)) { return engine.fail(); } if (!a2.unify(nameTerm, engine.trail)) { return engine.fail(); } if (!a3.unify(emailTerm, engine.trail)) { return engine.fail(); } return cont; }

Target:
public Operation exec(Prolog engine) throws PrologException { engine.setB0(); PatchSetInfo psInfo = StoredValues.PATCH_SET_INFO.get(engine); UserIdentity author = psInfo.getAuthor(); return exec(engine, author); }
Source:
public static List<ProcessVariableSummary> adaptCollection(List<VariableInstance> variables, Map<String, String> properties, long processInstanceId, String deploymentId, String serverTemplateId) { List<VariableInstance> filteredVariables = variables.stream() .filter(variable -> !excludedVariables.contains(variable.getVariableName())) .collect(Collectors.toList()); List<ProcessVariableSummary> variablesSummary = new ArrayList<>(); properties.forEach((key, value) -> { VariableProcessor processor = processors.getOrDefault(value, new DefaultVariableProcessor()); processor.process(processInstanceId, key, value, filteredVariables, variableSummary -> { variablesSummary.add(variableSummary); variableSummary.setDeploymentId(deploymentId); variableSummary.setServerTemplateId(serverTemplateId); }); }); if (!filteredVariables.isEmpty()) { filteredVariables.forEach(variable -> { ProcessVariableSummary variableSummary = new ProcessVariableSummary(variable.getVariableName(), variable.getVariableName(), variable.getProcessInstanceId(), variable.getOldValue(), variable.getValue(), variable.getDate().getTime(), ""); variablesSummary.add(variableSummary); variableSummary.setDeploymentId(deploymentId); variableSummary.setServerTemplateId(serverTemplateId); }); } variablesSummary.sort(Comparator.comparing(ProcessVariableSummary::getName)); return variablesSummary; }

Target:
public static List<ProcessVariableSummary> adaptCollection(List<VariableInstance> variables, Map<String, String> properties, long processInstanceId, String deploymentId, String serverTemplateId) { List<VariableInstance> filteredVariables = variables.stream() .filter(variable -> !excludedVariables.contains(variable.getVariableName())) .collect(toList()); List<ProcessVariableSummary> variablesSummary = new ArrayList<>(); properties.forEach((key, value) -> { VariableProcessor processor = processors.getOrDefault(value, new DefaultVariableProcessor()); processor.process(processInstanceId, key, value, filteredVariables, deploymentId, serverTemplateId, variableSummary -> variablesSummary.add(variableSummary)); }); variablesSummary.addAll(ofNullable(filteredVariables).orElse(emptyList()) .stream() .map(new ProcessInstanceVariableMapper(deploymentId, serverTemplateId, "")) .collect(toList())); variablesSummary.sort(Comparator.comparing(ProcessVariableSummary::getName)); return variablesSummary; }
Source:
public MarshallingResponseBuilder messages(List<MarshallingMessage> messages) { this.messages.addAll(messages); return this; }

Target:
public MarshallingResponseBuilder<T> messages(List<MarshallingMessage> messages) { this.messages.addAll(messages); return this; }
Source:
public String run(String[] args) throws Exception { JCommander jc = new JCommander(this); jc.setProgramName(this.getClass().getSimpleName()); try { jc.parse(args); if (mBaseParameters.mHelp) { jc.usage(); System.exit(0); } } catch (Exception e) { LOG.error("Failed to parse command: ", e); jc.usage(); throw e; } prepare(); AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); String className = this.getClass().getCanonicalName(); if (mBaseParameters.mCluster) { long jobId = JobGrpcClientUtils.run(generateJobConfig(args), 0, conf); JobInfo jobInfo = JobGrpcClientUtils.getJobStatus(jobId, conf, true); return jobInfo.getResult().toString(); } if (mBaseParameters.mInProcess) { LOG.debug("Run in process, mDistributed={}", mBaseParameters.mDistributed); T result = runLocal(); if (mBaseParameters.mDistributed) { return result.toJson(); } final String s = result.aggregator().aggregate(Collections.singletonList(result)).toJson(); return s; } else { List<String> command = new ArrayList<>(); command.add(conf.get(PropertyKey.HOME) + "/bin/alluxio"); command.add("runClass"); command.add(className); command.addAll(Arrays.asList(args)); command.add(BaseParameters.IN_PROCESS_FLAG); command.addAll(mBaseParameters.mJavaOpts); LOG.debug("running command: " + String.join(" ", command)); return ShellUtils.execCommand(command.toArray(new String[0])); } }

Target:
public String run(String[] args) throws Exception { JCommander jc = new JCommander(this); jc.setProgramName(this.getClass().getSimpleName()); try { jc.parse(args); if (mBaseParameters.mHelp) { jc.usage(); System.exit(0); } } catch (Exception e) { LOG.error("Failed to parse command: ", e); jc.usage(); throw e; } prepare(); AlluxioConfiguration conf = new InstancedConfiguration(ConfigurationUtils.defaults()); String className = this.getClass().getCanonicalName(); if (mBaseParameters.mCluster) { long jobId = JobGrpcClientUtils.run(generateJobConfig(args), 0, conf); JobInfo jobInfo = JobGrpcClientUtils.getJobStatus(jobId, conf, true); return jobInfo.getResult().toString(); } if (mBaseParameters.mInProcess) { T result = runLocal(); if (mBaseParameters.mDistributed) { return result.toJson(); } final String s = result.aggregator().aggregate(Collections.singletonList(result)).toJson(); return s; } else { List<String> command = new ArrayList<>(); command.add(conf.get(PropertyKey.HOME) + "/bin/alluxio"); command.add("runClass"); command.add(className); command.addAll(Arrays.asList(args)); command.add(BaseParameters.IN_PROCESS_FLAG); command.addAll(mBaseParameters.mJavaOpts); LOG.info("running command: " + String.join(" ", command)); return ShellUtils.execCommand(command.toArray(new String[0])); } }
Source:
public String toString() { int resultSize = computeLength(); if (resultSize <= 0) return EMPTY_STRING; char[] result = new char[resultSize]; int offset = 0; if (device != null) { int size = device.length(); device.getChars(0, size, result, offset); offset += size; } if ((separators & HAS_LEADING) != 0) result[offset++] = SEPARATOR; if ((separators & IS_UNC) != 0) result[offset++] = SEPARATOR; int len = segments.length - 1; if (len >= 0) { for (int i = 0; i < len; i++) { int size = segments[i].length(); segments[i].getChars(0, size, result, offset); offset += size; result[offset++] = SEPARATOR; } int size = segments[len].length(); segments[len].getChars(0, size, result, offset); offset += size; } if ((separators & HAS_TRAILING) != 0) result[offset++] = SEPARATOR; return new String(result); }

Target:
public String toString() { int resultSize = computeLength(); if (resultSize <= 0) return EMPTY_STRING; char[] result = new char[resultSize]; int offset = 0; if (device != null) { int size = device.length(); device.getChars(0, size, result, offset); offset += size; } if ((flags & HAS_LEADING) != 0) result[offset++] = SEPARATOR; if ((flags & IS_UNC) != 0) result[offset++] = SEPARATOR; int len = segments.length - 1; if (len >= 0) { for (int i = 0; i < len; i++) { int size = segments[i].length(); segments[i].getChars(0, size, result, offset); offset += size; result[offset++] = SEPARATOR; } int size = segments[len].length(); segments[len].getChars(0, size, result, offset); offset += size; } if ((flags & HAS_TRAILING) != 0) result[offset++] = SEPARATOR; return new String(result); }
Source:
public void saveModuleDerivedParser(ParsedDefinitionWrapper wrapper, String moduleName, KExceptionManager kem) { UserParser parser = wrapper.getModuleDerviedParser(moduleName, kem); String fileName = "extras/" + moduleName +"_Parser.bin"; loader.saveOrDie(files.resolveKompiled(fileName), parser); }

Target:
public void saveModuleDerivedParser(ParsedDefinitionWrapper wrapper, String moduleName, KExceptionManager kem) { UserParser parser = wrapper.getModuleDerviedParser(moduleName, kem); String modulePath = FileUtil.moduleDerivedParserPath(moduleName); loader.saveOrDie(files.resolveKompiled(modulePath), parser); }
Source:
public String toString() { final StringBuilder sb = new StringBuilder("ClientMessage{"); sb.append("connection=").append(connection); sb.append(", length=").append(getFrameLength()); sb.append(", correlationId=").append(getCorrelationId()); sb.append(", operation=").append(getOperationName()); sb.append(", messageType=").append(getMessageType()); sb.append(", isRetryable=").append(isRetryable()); sb.append(", isEvent=").append(isFlagSet(get(0).flags, IS_EVENT)); sb.append('}'); return sb.toString(); }

Target:
public String toString() { final StringBuilder sb = new StringBuilder("ClientMessage{"); sb.append("connection=").append(connection); if (size() > 0) { sb.append(", length=").append(getFrameLength()); sb.append(", correlationId=").append(getCorrelationId()); sb.append(", operation=").append(getOperationName()); sb.append(", messageType=").append(getMessageType()); sb.append(", isRetryable=").append(isRetryable()); sb.append(", isEvent=").append(isFlagSet(get(0).flags, IS_EVENT_FLAG)); sb.append(", isFragmented=").append(!isFlagSet(get(0).flags, UNFRAGMENTED_MESSAGE)); } sb.append('}'); return sb.toString(); }
Source:
public SEPTADatabase(Context context, int databaseVersion, String databaseFileName) { super(context, databaseFileName, null, databaseVersion); setDatabaseVersion(databaseVersion); CrashlyticsManager.log(Log.INFO, TAG, "Initializing DB: " + databaseVersion); setForcedUpgrade(); execSQL(new String[]{ "CREATE INDEX stop_srd_index ON stop_route_direction (stop_id);", "CREATE INDEX route_srd_index ON stop_route_direction (route_id);", "CREATE INDEX direction_srd_index ON stop_route_direction (direction_id);", "CREATE INDEX trips_bus_route_id_index ON trips_bus (route_id);", "CREATE INDEX trips_rail_route_id_trip_id_index ON trips_rail (route_id, trip_id);", "CREATE INDEX trips_rail_trip_id_route_id_index ON trips_rail (trip_id, route_id);", "CREATE INDEX routes_bus_route_id_index ON routes_bus (route_id);", "CREATE INDEX routes_rail_route_id_index ON routes_rail (route_id);", "CREATE INDEX reverseStopSearch_reverse_stop_id_stop_id_index ON reverseStopSearch (reverse_stop_id, stop_id);", "CREATE INDEX reverseStopSearch_stop_id_reverse_stop_id_index ON reverseStopSearch (stop_id, reverse_stop_id);", "CREATE INDEX bus_stop_directions_Route_index ON bus_stop_directions (Route);", "CREATE INDEX stop_times_rail_trip_id_stop_id_stop_sequence_index ON stop_times_rail (trip_id, stop_id, stop_sequence);", "CREATE INDEX stop_times_rail_stop_id_trip_id_index ON stop_times_rail (stop_id, trip_id);", "VACUUM;" }); }

Target:
public SEPTADatabase(Context context, int databaseVersion, String databaseFileName) { super(context, databaseFileName, null, databaseVersion); setDatabaseVersion(databaseVersion); CrashlyticsManager.log(Log.INFO, TAG, "Initializing DB: " + databaseVersion); setForcedUpgrade(); execSQL(new String[]{GeneralUtils.readRawTextFile(context, R.raw.db_init_script)}); }
Source:
public Pair<Segment, Closeable> getAndIncrementSegment() { ReferenceCountingSegment segment = adapter.get(); while (true) { if (segment.increment()) { return new Pair<>(segment, segment.decrementOnce()); } ReferenceCountingSegment newSegment = adapter.get(); if (segment == newSegment) { throw new ISE("segment.close() is called somewhere outside FireHydrant.swapSegment()"); } segment = newSegment; } }

Target:
public Pair<Segment, Closeable> getAndIncrementSegment() { ReferenceCountingSegment segment = getIncrementedSegment(); return new Pair<>(segment, segment.decrementOnceCloseable()); }