auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public TrimResult trimFields(Project project, ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields) { for (Ord<RexNode> ord : Ord.zip(project.getProjects())) { if (fieldsUsed.get(ord.i)) { if (this.viewProjectToTableSchema != null && this.viewProjectToTableSchema.containsKey(project)) { Table tab = this.viewProjectToTableSchema.get(project); if (this.directColumnAccessInfo != null) { this.directColumnAccessInfo.add(tab.getCompleteName(), tab.getAllCols().get(ord.i).getName()); } if (this.allColumnAccessInfo != null) { this.allColumnAccessInfo.add(tab.getCompleteName(), tab.getAllCols().get(ord.i).getName()); } } } } return super.trimFields(project, fieldsUsed, extraFields); }

Target:
public TrimResult trimFields(Project project, ImmutableBitSet fieldsUsed, Set<RelDataTypeField> extraFields) { if (this.columnAccessInfo != null && this.viewProjectToTableSchema != null && this.viewProjectToTableSchema.containsKey(project)) { for (Ord<RexNode> ord : Ord.zip(project.getProjects())) { if (fieldsUsed.get(ord.i)) { Table tab = this.viewProjectToTableSchema.get(project); this.columnAccessInfo.add(tab.getCompleteName(), tab.getAllCols().get(ord.i).getName()); } } } return super.trimFields(project, fieldsUsed, extraFields); }
Source:
public <T extends ObjectId> AsyncRevObjectQueue parseAny( Iterable<T> objectIds, boolean reportMissing) { List<T> need = new ArrayList<T>(); List<RevObject> have = new ArrayList<RevObject>(); for (T id : objectIds) { RevObject r = objects.get(id); if (r != null && (r.flags & PARSED) != 0) have.add(r); else need.add(id); } final Iterator<RevObject> objItr = have.iterator(); if (need.isEmpty()) { return new AsyncRevObjectQueue() { public RevObject next() { return objItr.hasNext() ? objItr.next() : null; } public boolean cancel(boolean mayInterruptIfRunning) { return true; } public void release() { } }; } final AsyncObjectLoaderQueue<T> lItr = reader.open(need, reportMissing); return new AsyncRevObjectQueue() { public RevObject next() throws MissingObjectException, IncorrectObjectTypeException, IOException { if (objItr.hasNext()) return objItr.next(); if (!lItr.next()) return null; ObjectId id = lItr.getObjectId(); ObjectLoader ldr = lItr.open(); RevObject r = objects.get(id); if (r == null) r = parseNew(id, ldr); else if (r instanceof RevCommit) { initializeShallowCommits(); byte[] raw = ldr.getCachedBytes(); ((RevCommit) r).parseCanonical(RevWalk.this, raw); } else if (r instanceof RevTag) { byte[] raw = ldr.getCachedBytes(); ((RevTag) r).parseCanonical(RevWalk.this, raw); } else r.flags |= PARSED; return r; } public boolean cancel(boolean mayInterruptIfRunning) { return lItr.cancel(mayInterruptIfRunning); } public void release() { lItr.release(); } }; }

Target:
public <T extends ObjectId> AsyncRevObjectQueue parseAny( Iterable<T> objectIds, boolean reportMissing) { List<T> need = new ArrayList<T>(); List<RevObject> have = new ArrayList<RevObject>(); for (T id : objectIds) { RevObject r = objects.get(id); if (r != null && (r.flags & PARSED) != 0) have.add(r); else need.add(id); } final Iterator<RevObject> objItr = have.iterator(); if (need.isEmpty()) { return new AsyncRevObjectQueue() { public RevObject next() { return objItr.hasNext() ? objItr.next() : null; } public boolean cancel(boolean mayInterruptIfRunning) { return true; } public void release() { } }; } final AsyncObjectLoaderQueue<T> lItr = reader.open(need, reportMissing); return new AsyncRevObjectQueue() { public RevObject next() throws MissingObjectException, IncorrectObjectTypeException, IOException { if (objItr.hasNext()) return objItr.next(); if (!lItr.next()) return null; ObjectId id = lItr.getObjectId(); ObjectLoader ldr = lItr.open(); RevObject r = objects.get(id); if (r == null) r = parseNew(id, ldr); else if (r instanceof RevCommit) { byte[] raw = ldr.getCachedBytes(); ((RevCommit) r).parseCanonical(RevWalk.this, raw); } else if (r instanceof RevTag) { byte[] raw = ldr.getCachedBytes(); ((RevTag) r).parseCanonical(RevWalk.this, raw); } else r.flags |= PARSED; return r; } public boolean cancel(boolean mayInterruptIfRunning) { return lItr.cancel(mayInterruptIfRunning); } public void release() { lItr.release(); } }; }
Source:
public Command perform(Object... args) { String id = (String) args[0]; boolean verbose = true; if (args.length > 1) { if (args[1] instanceof Boolean) { verbose = (Boolean) args[1]; } } if (controller.getModel().getScenes().size() == 1) { if (verbose) { controller.getViews().showDialog( InfoDialogBuilder.NAME, controller.getApplicationAssets().getI18N() .m("scene.delete.error-message")); } } else { EditorGame game = controller.getModel().getGame(); List<Command> commandList = new ArrayList<Command>(); String alternateScene = null; if (game.getEditScene().equals(id)) { alternateScene = findAlternateScene(id); commandList.add(new FieldCommand(game, FieldNames.EDIT_SCENE, alternateScene, false)); } if (controller.getModel().getGame().getInitialScene().equals(id)) { if (alternateScene != null) { alternateScene = findAlternateScene(id); } commandList.add(new FieldCommand(controller.getModel() .getGame(), FieldNames.INITIAL_SCENE, alternateScene, false)); } commandList.add(new MapCommand.RemoveFromMapCommand(controller .getModel().getScenes(), id)); commandList.add(new ListCommand.RemoveFromListCommand(game .getSceneorder(), id)); CompositeCommand deleteSceneCommand = new CompositeCommand( commandList); return deleteSceneCommand; } return null; }

Target:
public Command perform(Object... args) { String id = (String) args[0]; boolean verbose = true; if (args.length > 1) { verbose = (Boolean) args[1]; } if (controller.getModel().getScenes().size() == 1) { if (verbose) { controller.getViews().showDialog( InfoDialogBuilder.NAME, controller.getApplicationAssets().getI18N() .m("scene.delete.error-message")); } } else { EditorGame game = controller.getModel().getGame(); List<Command> commandList = new ArrayList<Command>(); String alternateScene = null; if (game.getEditScene().equals(id)) { alternateScene = findAlternateScene(id); commandList.add(new FieldCommand(game, FieldNames.EDIT_SCENE, alternateScene, false)); } if (controller.getModel().getGame().getInitialScene().equals(id)) { if (alternateScene != null) { alternateScene = findAlternateScene(id); } commandList.add(new FieldCommand(controller.getModel() .getGame(), FieldNames.INITIAL_SCENE, alternateScene, false)); } commandList.add(new MapCommand.RemoveFromMapCommand(controller .getModel().getScenes(), id)); commandList.add(new ListCommand.RemoveFromListCommand(game .getSceneorder(), id)); CompositeCommand deleteSceneCommand = new CompositeCommand( commandList); return deleteSceneCommand; } return null; }
Source:
private Object[] transformParameters(Object[] params) { if (params == null) { return null; } Object[] result = new Object[params.length * 2]; for (int stringIndex = 0, originalIndex = params.length; stringIndex < params.length; ++stringIndex, ++originalIndex) { Object param = params[stringIndex]; if (param != null) { result[stringIndex] = param.toString(); result[originalIndex] = params[stringIndex]; } } return result; }

Target:
private static Object[] transformParameters(Object[] params) { if (params == null) { return null; } Object[] result = new Object[params.length * 2]; for (int stringParamsIndex = 0, originalParamsIndex = params.length; stringParamsIndex < params.length; ++stringParamsIndex, ++originalParamsIndex) { Object param = params[stringParamsIndex]; if (param != null) { result[stringParamsIndex] = param.toString(); result[originalParamsIndex] = params[stringParamsIndex]; } } return result; }
Source:
public static void main(String... args) { LOGGER.info("Starting Kafka Consumers"); final ExecutorService executor = Executors.newSingleThreadExecutor(); final ApnsConsumer apnsConsumer = new ApnsConsumer(); executor.submit(apnsConsumer); Runtime.getRuntime().addShutdownHook(new Thread() { @Override public void run() { apnsConsumer.shutdown(); executor.shutdown(); try { executor.awaitTermination(5000, TimeUnit.MILLISECONDS); } catch (InterruptedException ie) { LOGGER.log(Level.SEVERE, "Error on close", ie); } } }); }

Target:
public static void main(String... args) { LOGGER.info("Starting Kafka Consumers"); final ExecutorService executor = Executors.newSingleThreadExecutor(); final ApnsConsumer apnsConsumer = new ApnsConsumer(); executor.submit(apnsConsumer); Runtime.getRuntime().addShutdownHook(new Thread(() -> { apnsConsumer.shutdown(); executor.shutdown(); try { executor.awaitTermination(5000, TimeUnit.MILLISECONDS); } catch (InterruptedException ie) { LOGGER.log(Level.SEVERE, "Error on close", ie); } })); }
Source:
private Constraint maximizeMergesPerWord(ConstraintFactory cf) { return cf.from(ScrabbleWordAssignment.class) .join(ScrabbleCell.class, new FilteringBiJoiner<>((swa, sc) -> sc.getWordSet().contains(swa) && sc.hasMerge())) .groupBy((swa, sc) -> swa.getId(), ConstraintCollectors.countBi()) .penalize("Maximize merges per word", HardMediumSoftScore.ONE_MEDIUM, (id, count) -> count * count); }

Target:
private Constraint maximizeMergesPerWord(ConstraintFactory cf) { return cf.from(ScrabbleWordAssignment.class) .join(ScrabbleCell.class, Joiners.filtering((swa, sc) -> sc.getWordSet().contains(swa) && sc.hasMerge())) .groupBy((swa, sc) -> swa.getId(), ConstraintCollectors.countBi()) .reward("Maximize merges per word", HardMediumSoftScore.ONE_MEDIUM, (id, count) -> count * count); }
Source:
public static synchronized JobValidatorRegistry getInstance() { if (instance == null) { instance = new JobValidatorRegistry(); } return instance; }

Target:
public static synchronized JobValidatorRegistry getInstance() { return LazyHolder.INSTANCE; }
Source:
private void loadContacts() { showNoContactPermissionFragment(false); mContactList.setEmptyText(getString(R.string.main_activity_contact_list_loading_contacts)); ContactsProvider.getContacts(this, new FullContactsListener() { @Override public void onGetContacts(final Set<ContactDataComplete> contacts, final ContactsProvider.Error error) { Lg.i("onGetContacts error=", error); if (!mContactList.isVisible() && isFinishing()) { Lg.i("onGetContacts the fragment went away"); return; } switch (error) { case NONE: mAdapter.setContacts(contacts); mContactList.setEmptyText(getString(R.string.main_activity_contact_list_no_contacts_found)); break; case BUG: mAdapter.clear(); mContactList.setEmptyText(getString(R.string.main_activity_contact_list_error_loading_contacts)); break; case NO_INTERNET_CONNECTION: mAdapter.clear(); mContactList.setEmptyText(getString(R.string.main_activity_contact_list_error_loading_contacts_no_internet)); break; case PERMISSION_DENIED: showNoContactPermissionFragment(true); break; } GooglePlayServicesHelper.registerGcmIfNeeded(MainActivity.this); } }); }

Target:
private void loadContacts() { showNoContactPermissionFragment(false); mContactList.setEmptyText(getString(R.string.main_activity_contact_list_loading_contacts)); ContactsProvider.getContacts(this, new FullContactsListener() { @Override public void onGetContacts(final Set<ContactDataComplete> contacts, final ContactsProvider.Error error) { Lg.i("onGetContacts error=", error); if (!mContactList.isVisible() || isFinishing()) { Lg.i("onGetContacts the fragment went away"); return; } switch (error) { case NONE: mAdapter.setContacts(contacts); mContactList.setEmptyText(getString(R.string.main_activity_contact_list_no_contacts_found)); break; case BUG: mAdapter.clear(); mContactList.setEmptyText(getString(R.string.main_activity_contact_list_error_loading_contacts)); break; case NO_INTERNET_CONNECTION: mAdapter.clear(); mContactList.setEmptyText(getString(R.string.main_activity_contact_list_error_loading_contacts_no_internet)); break; case PERMISSION_DENIED: showNoContactPermissionFragment(true); break; } GooglePlayServicesHelper.registerGcmIfNeeded(MainActivity.this); } }); }
Source:
AnalyzedStatement analyzeShowTransaction(Analysis analysis) { AnalyzedStatement analyzedStatement = analyzer.unboundAnalyze(rewriteShowTransaction(), analysis.sessionContext(), ParamTypeHints.EMPTY); analysis.rootRelation((AnalyzedRelation) analyzedStatement); return analyzedStatement; }

Target:
AnalyzedStatement analyzeShowTransaction(Analysis analysis) { return unboundAnalyze(rewriteShowTransaction(), analysis); }
Source:
private void createOpenShiftRoute(String serviceName, String serverRef, String workspaceName) { String routeName = CHE_OPENSHIFT_RESOURCES_PREFIX + workspaceName + "." + serverRef; if (cheServerExternalAddress == null) { throw new NullPointerException("Property che.docker.ip.external must be set when using openshift."); } String serviceHost = serverRef + "." + workspaceName + "." + this.cheServerExternalAddress; Route route = openShiftClient .routes() .inNamespace(this.openShiftCheProjectName) .createNew() .withNewMetadata() .withName(routeName) .addToLabels(OPENSHIFT_DEPLOYMENT_LABEL,serviceName) .endMetadata() .withNewSpec() .withHost(serviceHost) .withNewTo() .withKind("Service") .withName(serviceName) .endTo() .withNewPort() .withNewTargetPort() .withStrVal(serverRef) .endTargetPort() .endPort() .endSpec() .done(); LOG.info("OpenShift route created", route.getMetadata().getName()); }

Target:
private void createOpenShiftRoute(String serviceName, String serverRef, String workspaceName) { String routeName = CHE_OPENSHIFT_RESOURCES_PREFIX + workspaceName + "." + serverRef; if (cheServerExternalAddress == null) { throw new IllegalArgumentException("Property che.docker.ip.external must be set when using openshift."); } String serviceHost = serverRef + "." + workspaceName + "." + this.cheServerExternalAddress; Route route = openShiftClient .routes() .inNamespace(this.openShiftCheProjectName) .createNew() .withNewMetadata() .withName(routeName) .addToLabels(OPENSHIFT_DEPLOYMENT_LABEL,serviceName) .endMetadata() .withNewSpec() .withHost(serviceHost) .withNewTo() .withKind("Service") .withName(serviceName) .endTo() .withNewPort() .withNewTargetPort() .withStrVal(serverRef) .endTargetPort() .endPort() .endSpec() .done(); LOG.info("OpenShift route created", route.getMetadata().getName()); }
Source:
public void onMessage(String messageType, JSONObject messagePayload) { if (!fragment.isAdded()) { return; } if (messageType.equals("editSectionClicked")) { if (messagePayload.has("mainPencilClicked") && DescriptionEditClient.isEditAllowed(currentPage)) { View tempView = new View(fragment.requireContext()); tempView.setX(DimenUtil.dpToPx(messagePayload.optInt("x"))); tempView.setY(DimenUtil.dpToPx(messagePayload.optInt("y")) - fragment.getWebView().getScrollY()); ((ViewGroup) fragment.getView()).addView(tempView); PopupMenu menu = new PopupMenu(fragment.requireContext(), tempView, GravityCompat.END, 0, R.style.PagePopupMenu); menu.getMenuInflater().inflate(R.menu.menu_page_header_edit, menu.getMenu()); menu.setOnMenuItemClickListener(new EditMenuClickListener()); menu.setOnDismissListener(menu1 -> ((ViewGroup) fragment.getView()).removeView(tempView)); menu.show(); } else if (messagePayload.has("editDescriptionClicked") && DescriptionEditClient.isEditAllowed(currentPage)) { verifyDescriptionEditable(); } else { startEditingSection(messagePayload.optInt("sectionID"), null); } } }

Target:
public void onMessage(String messageType, JSONObject messagePayload) { if (!fragment.isAdded()) { return; } if (messageType.equals("editSectionClicked")) { if (messagePayload.has("mainPencilClicked") && DescriptionEditClient.isEditAllowed(currentPage)) { View tempView = new View(fragment.requireContext()); tempView.setX(DimenUtil.dpToPx(messagePayload.optInt("x"))); tempView.setY(DimenUtil.dpToPx(messagePayload.optInt("y")) - fragment.getWebView().getScrollY()); ((ViewGroup) fragment.getView()).addView(tempView); PopupMenu menu = new PopupMenu(fragment.requireContext(), tempView, 0, 0, R.style.PagePopupMenu); menu.getMenuInflater().inflate(R.menu.menu_page_header_edit, menu.getMenu()); menu.setOnMenuItemClickListener(new EditMenuClickListener()); menu.setOnDismissListener(menu1 -> ((ViewGroup) fragment.getView()).removeView(tempView)); menu.show(); } else if (messagePayload.has("editDescriptionClicked") && DescriptionEditClient.isEditAllowed(currentPage)) { verifyDescriptionEditable(); } else { startEditingSection(messagePayload.optInt("sectionID"), null); } } }
Source:
public void exportCurrentDataSetLookup(ExportFormat format, int maxRows, ExportCallback callback) { int allRows = lastLookedUpDataSet.getRowCountNonTrimmed(); if (allRows > 0 && allRows > maxRows) { callback.tooManyRows(allRows); return; } if (lastLookedUpDataSet.getRowCount() == 0) { callback.noData(); return; } try { DataSetExportReadyCallback exportReadyCallback = new DataSetExportReadyCallback() { @Override public void exportReady(Path exportFilePath) { final String u = clientServices.getDownloadFileUrl(exportFilePath); callback.exportFileUrl(u); } @Override public void onError(ClientRuntimeError error) { callback.error(error); } }; DataSetLookup exportLookup = getCurrentDataSetLookup().cloneInstance(); exportLookup.setRowOffset(0); exportLookup.setNumberOfRows(maxRows); if (ExportFormat.XLS.equals(format)) { clientServices.exportDataSetExcel(exportLookup, exportReadyCallback); } else { clientServices.exportDataSetCSV(exportLookup, exportReadyCallback); } } catch (Exception e) { callback.error(new ClientRuntimeError(e)); } }

Target:
public void exportCurrentDataSetLookup(ExportFormat format, int maxRows, ExportCallback callback) { if (lastLookedUpDataSet == null || lastLookedUpDataSet.getRowCount() == 0) { callback.noData(); return; } int allRows = lastLookedUpDataSet.getRowCountNonTrimmed(); if (maxRows > 0 && allRows > maxRows) { callback.tooManyRows(allRows); return; } try { DataSetExportReadyCallback exportReadyCallback = new DataSetExportReadyCallback() { @Override public void exportReady(Path exportFilePath) { final String u = clientServices.getDownloadFileUrl(exportFilePath); callback.exportFileUrl(u); } @Override public void onError(ClientRuntimeError error) { callback.error(error); } }; DataSetLookup exportLookup = getCurrentDataSetLookup().cloneInstance(); exportLookup.setRowOffset(0); exportLookup.setNumberOfRows(maxRows); if (ExportFormat.XLS.equals(format)) { clientServices.exportDataSetExcel(exportLookup, exportReadyCallback); } else { clientServices.exportDataSetCSV(exportLookup, exportReadyCallback); } } catch (Exception e) { callback.error(new ClientRuntimeError(e)); } }
Source:
protected InputTransformer lookupTransformerReference(String namespaceUri) throws InvalidSyntaxException { LOGGER.trace("Looking up Input Transformer by schema : {}", namespaceUri); Bundle bundle = FrameworkUtil.getBundle(this.getClass()); if (bundle != null) { BundleContext bundleContext = bundle.getBundleContext(); Collection<ServiceReference<InputTransformer>> transformerReference = bundleContext.getServiceReferences( InputTransformer.class, "(schema=" + namespaceUri + ")"); if (transformerReference.isEmpty()) { LOGGER.trace("Failed to find Input Transformer by schema : {}", namespaceUri); } else { LOGGER.trace( "Found Input Transformer by schema {}", transformerReference.iterator().next().getBundle().getSymbolicName(), namespaceUri); return bundleContext.getService(transformerReference.iterator().next()); } } return null; }

Target:
protected InputTransformer lookupTransformerReference(String namespaceUri) throws InvalidSyntaxException { LOGGER.trace("Looking up Input Transformer by schema : {}", namespaceUri); Bundle bundle = FrameworkUtil.getBundle(this.getClass()); if (bundle != null) { BundleContext bundleContext = bundle.getBundleContext(); Collection<ServiceReference<InputTransformer>> transformerReference = bundleContext.getServiceReferences( InputTransformer.class, "(schema=" + namespaceUri + ")"); if (!transformerReference.isEmpty()) { ServiceReference<InputTransformer> transformer = transformerReference.iterator().next(); LOGGER.trace( "Found Input Transformer by schema {}", transformer.getBundle().getSymbolicName(), namespaceUri); return bundleContext.getService(transformer); } LOGGER.trace("Failed to find Input Transformer by schema : {}", namespaceUri); } return null; }
Source:
public void postInit(KeycloakSessionFactory factory) { factory.register(event -> { if (event instanceof UserRemovedEvent) { KeycloakSession keycloakSession = ((UserRemovedEvent) event).getKeycloakSession(); AuthorizationProvider provider = keycloakSession.getProvider(AuthorizationProvider.class); StoreFactory storeFactory = provider.getStoreFactory(); PolicyStore policyStore = storeFactory.getPolicyStore(); UserModel removedUser = ((UserRemovedEvent) event).getUser(); RealmModel realm = ((UserRemovedEvent) event).getRealm(); ResourceServerStore resourceServerStore = storeFactory.getResourceServerStore(); resourceServerStore .findByClients(realm.getClients().stream().map(clientModel -> clientModel.getId()).toArray(String[]::new)) .forEach(resourceServer -> { if (resourceServer != null) { policyStore.findByType(getId(), resourceServer.getId()).forEach(policy -> { List<String> users = new ArrayList<>(); for (String userId : getUsers(policy)) { if (!userId.equals(removedUser.getId())) { users.add(userId); } } try { if (users.isEmpty()) { policyStore.delete(policy.getId()); } else { policy.getConfig().put("users", JsonSerialization.writeValueAsString(users)); } } catch (IOException e) { throw new RuntimeException( "Error while synchronizing users with policy [" + policy.getName() + "].", e); } }); } }); } }); }

Target:
public void postInit(KeycloakSessionFactory factory) { factory.register(event -> { if (event instanceof UserRemovedEvent) { KeycloakSession keycloakSession = ((UserRemovedEvent) event).getKeycloakSession(); AuthorizationProvider provider = keycloakSession.getProvider(AuthorizationProvider.class); StoreFactory storeFactory = provider.getStoreFactory(); PolicyStore policyStore = storeFactory.getPolicyStore(); UserModel removedUser = ((UserRemovedEvent) event).getUser(); RealmModel realm = ((UserRemovedEvent) event).getRealm(); ResourceServerStore resourceServerStore = storeFactory.getResourceServerStore(); realm.getClients().forEach(clientModel -> { ResourceServer resourceServer = resourceServerStore.findByClient(clientModel.getId()); if (resourceServer != null) { policyStore.findByType(getId(), resourceServer.getId()).forEach(policy -> { List<String> users = new ArrayList<>(); for (String userId : getUsers(policy)) { if (!userId.equals(removedUser.getId())) { users.add(userId); } } try { if (users.isEmpty()) { policyStore.delete(policy.getId()); } else { policy.putConfig("users", JsonSerialization.writeValueAsString(users)); } } catch (IOException e) { throw new RuntimeException("Error while synchronizing users with policy [" + policy.getName() + "].", e); } }); } }); } }); }
Source:
private ConfigBagExtendingParent(ConfigBag parentBag) { this.parentBag = parentBag; }

Target:
private ConfigBagExtendingParent(ConfigBag parentBag) { this.parentBag = parentBag; copy(parentBag); }
Source:
private static boolean isValidIndexVersionOperationList(List<IndexVersionOperation> indexVersionOperations) { boolean isValid = false; IndexVersionOperation lastNoopOperationIndexVersion = null; IndexVersionOperation indexWithDeleteHiddenOp = null; for (int i = 0; i < indexVersionOperations.size(); i++) { if (indexVersionOperations.get(i).getOperation() == Operation.NOOP) { lastNoopOperationIndexVersion = indexVersionOperations.get(i); } if (indexVersionOperations.get(i).getOperation() == Operation.DELETE_HIDDEN_AND_DISABLE) { indexWithDeleteHiddenOp = indexVersionOperations.get(i); } } if (lastNoopOperationIndexVersion.getIndexName().getCustomerVersion() == 0) { isValid = true; } else if (lastNoopOperationIndexVersion.getIndexName().getCustomerVersion() != 0) { if (indexWithDeleteHiddenOp != null) { isValid = true; } } if (!isValid) { log.info("IndexVersionOperation List is not valid for index {}", lastNoopOperationIndexVersion.getIndexName().getNodeName()); } return isValid; }

Target:
private static boolean isValidIndexVersionOperationList(List<IndexVersionOperation> indexVersionOperations) { boolean isValid = false; IndexVersionOperation lastNoopOperationIndexVersion = null; IndexVersionOperation indexWithDeleteHiddenOp = null; for (IndexVersionOperation indexVersionOperation : indexVersionOperations) { if (indexVersionOperation.getOperation() == Operation.NOOP) { lastNoopOperationIndexVersion = indexVersionOperation; } if (indexVersionOperation.getOperation() == Operation.DELETE_HIDDEN_AND_DISABLE) { indexWithDeleteHiddenOp = indexVersionOperation; } } if (lastNoopOperationIndexVersion.getIndexName().getCustomerVersion() == 0) { isValid = true; } else if (lastNoopOperationIndexVersion.getIndexName().getCustomerVersion() != 0) { if (indexWithDeleteHiddenOp != null && lastNoopOperationIndexVersion.getIndexName().getProductVersion() == indexWithDeleteHiddenOp.getIndexName().getProductVersion()) { isValid = true; } } if (!isValid) { LOG.info("IndexVersionOperation List is not valid for index {}", lastNoopOperationIndexVersion.getIndexName().getNodeName()); } return isValid; }
Source:
public SpongeSkinPart(int ordinal, String id) { this.ordinal = ordinal; this.mask = 1 << this.ordinal; this.id = id; this.translation = new SpongeTranslation("options.modelPart." + this.id); }

Target:
public SpongeSkinPart(int ordinal, String id) { super("minecraft:" + id, new SpongeTranslation("options.modelPart." + id)); this.ordinal = ordinal; this.mask = 1 << this.ordinal; }
Source:
private Set<Symbol> getAlternativeDefinitions(Symbol symbol, List<Usage> bindingUsages) { Set<Symbol> alternativeDefinitions = new HashSet<>(); for (Usage bindingUsage : bindingUsages) { switch (bindingUsage.kind()) { case FUNC_DECLARATION: FunctionDef functionDef = (FunctionDef) bindingUsage.tree().parent(); FunctionSymbolImpl functionSymbol = new FunctionSymbolImpl(functionDef, symbol.fullyQualifiedName(), pythonFile); ParameterList parameters = functionDef.parameters(); if (parameters != null) { functionSymbol.addParameters(parameters); } ((FunctionDefImpl) functionDef).setFunctionSymbol(functionSymbol); alternativeDefinitions.add(functionSymbol); break; case CLASS_DECLARATION: ClassSymbolImpl classSymbol = new ClassSymbolImpl(symbol.name(), symbol.fullyQualifiedName()); ClassDef classDef = (ClassDef) bindingUsage.tree().parent(); resolveTypeHierarchy(classDef, classSymbol); Scope classScope = scopesByRootTree.get(classDef); classSymbol.addMembers(getClassMembers(classScope.symbolsByName, classScope.instanceAttributesByName)); alternativeDefinitions.add(classSymbol); break; default: SymbolImpl alternativeSymbol = new SymbolImpl(symbol.name(), symbol.fullyQualifiedName()); alternativeDefinitions.add(alternativeSymbol); } } return alternativeDefinitions; }

Target:
private Set<Symbol> getAlternativeDefinitions(Symbol symbol, List<Usage> bindingUsages) { Set<Symbol> alternativeDefinitions = new HashSet<>(); for (Usage bindingUsage : bindingUsages) { switch (bindingUsage.kind()) { case FUNC_DECLARATION: FunctionDef functionDef = (FunctionDef) bindingUsage.tree().parent(); FunctionSymbolImpl functionSymbol = new FunctionSymbolImpl(functionDef, symbol.fullyQualifiedName(), pythonFile); ((FunctionDefImpl) functionDef).setFunctionSymbol(functionSymbol); alternativeDefinitions.add(functionSymbol); break; case CLASS_DECLARATION: ClassSymbolImpl classSymbol = new ClassSymbolImpl(symbol.name(), symbol.fullyQualifiedName()); ClassDef classDef = (ClassDef) bindingUsage.tree().parent(); resolveTypeHierarchy(classDef, classSymbol, pythonFile, scopesByRootTree.get(fileInput).symbolsByName); Scope classScope = scopesByRootTree.get(classDef); classSymbol.addMembers(getClassMembers(classScope.symbolsByName, classScope.instanceAttributesByName)); alternativeDefinitions.add(classSymbol); break; default: SymbolImpl alternativeSymbol = new SymbolImpl(symbol.name(), symbol.fullyQualifiedName()); alternativeDefinitions.add(alternativeSymbol); } } return alternativeDefinitions; }
Source:
public boolean isAvailable(String featureName) { return Boolean.getBoolean(featureName) || Boolean.parseBoolean(features.getProperty(featureName, "true")); }

Target:
public boolean isAvailable(String featureName) { String name = FEATURE_PREFIX + featureName; String sysprop = SecurityActions.getProperty(name); if (sysprop != null) { return Boolean.parseBoolean(sysprop); } else { return Boolean.parseBoolean(features.getProperty(name, "true")); } }
Source:
public void testIsFragment() throws Exception { String bundleName = getName(); File config = RuntimeTestsPlugin.getContext().getDataFile(bundleName); config.mkdirs(); Map<String, String> headers = new HashMap<>(); headers.put(Constants.BUNDLE_SYMBOLICNAME, bundleName); headers.put(Constants.BUNDLE_VERSION, "1.0.0"); File testBundleJarFile = createBundle(config, bundleName, headers, emptyMap()); Bundle hostBundle = getContext().installBundle(testBundleJarFile.getName(), new FileInputStream(testBundleJarFile)); assertNotNull(hostBundle); assertFalse(Platform.isFragment(hostBundle)); String fragmentName = bundleName + "_fragment"; headers.put(Constants.BUNDLE_SYMBOLICNAME, fragmentName); headers.put(Constants.BUNDLE_VERSION, "1.0.0"); headers.put(Constants.FRAGMENT_HOST, bundleName); testBundleJarFile = createBundle(config, fragmentName, headers, emptyMap()); Bundle fragmentBundle = getContext().installBundle(testBundleJarFile.getName(), new FileInputStream(testBundleJarFile)); assertNotNull(fragmentBundle); assertTrue(Platform.isFragment(fragmentBundle)); }

Target:
public void testIsFragment() throws Exception { String bundleName = getName(); File config = RuntimeTestsPlugin.getContext().getDataFile(bundleName); Files.createDirectories(config.toPath()); Map<String, String> headers = new HashMap<>(); headers.put(Constants.BUNDLE_SYMBOLICNAME, bundleName); headers.put(Constants.BUNDLE_VERSION, "1.0.0"); File testBundleJarFile = createBundle(config, bundleName, headers, emptyMap()); Bundle hostBundle = getContext().installBundle(testBundleJarFile.getName(), new FileInputStream(testBundleJarFile)); assertNotNull(hostBundle); assertFalse(Platform.isFragment(hostBundle)); String fragmentName = bundleName + "_fragment"; headers.put(Constants.BUNDLE_SYMBOLICNAME, fragmentName); headers.put(Constants.BUNDLE_VERSION, "1.0.0"); headers.put(Constants.FRAGMENT_HOST, bundleName); testBundleJarFile = createBundle(config, fragmentName, headers, emptyMap()); Bundle fragmentBundle = getContext().installBundle(testBundleJarFile.getName(), new FileInputStream(testBundleJarFile)); assertNotNull(fragmentBundle); assertTrue(Platform.isFragment(fragmentBundle)); }
Source:
private void createBranch(final String textForBranch, boolean doCheckout, RevCommit commit, IProgressMonitor monitor) throws CoreException { monitor.setTaskName(UIText.FetchGerritChangePage_CreatingBranchTaskName); CreateLocalBranchOperation bop = new CreateLocalBranchOperation( repository, textForBranch, commit); bop.execute(monitor); if (doCheckout) { CheckoutResult result; try { result = checkout(textForBranch, monitor); } catch (OperationCanceledException | InterruptedException e1) { return; } if (result.getStatus() == Status.CONFLICTS) { PlatformUI.getWorkbench().getDisplay().asyncExec(() -> { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, UIText.BranchResultDialog_CheckoutConflictsTitle, UIText.AbstractRebaseCommandHandler_cleanupDialog_text, repository, result.getConflictList()); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { try { checkout(textForBranch, monitor); } catch (InterruptedException e) { Activator.logError(e.getMessage(), e); } } }); } } monitor.worked(1); }

Target:
private void createBranch(final String textForBranch, boolean doCheckout, RevCommit commit, IProgressMonitor monitor) throws CoreException { SubMonitor progress = SubMonitor.convert(monitor, UIText.FetchGerritChangePage_CreatingBranchTaskName, 10); CreateLocalBranchOperation bop = new CreateLocalBranchOperation( repository, textForBranch, commit); bop.execute(progress.newChild(8)); if (doCheckout) { CheckoutResult result; try { result = checkout(textForBranch, progress.newChild(1)); } catch (OperationCanceledException | InterruptedException e1) { return; } if (result.getStatus() == Status.CONFLICTS) { PlatformUI.getWorkbench().getDisplay().asyncExec(() -> { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, UIText.BranchResultDialog_CheckoutConflictsTitle, UIText.AbstractRebaseCommandHandler_cleanupDialog_text, repository, result.getConflictList()); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { try { checkout(textForBranch, progress.newChild(1)); } catch (InterruptedException e) { Activator.logError(e.getMessage(), e); } } }); } else { progress.setWorkRemaining(0); } } monitor.worked(1); }
Source:
public void speakNames() { if (settings.getAutomaticTts()) { textToSpeechManager.speak(chosenNamesText, settings.getSpeechLanguage()); } }

Target:
public void speakNames() { textToSpeechManager.speak(chosenNamesText, settings.getSpeechLanguage()); }
Source:
public void initialize() { layersById.clear(); Resource baseDir = resourceLoader.get(baseDirectory); LOGGER.info("GeoServer TileLayer store base directory is: " + baseDir.path()); final List<Resource> tileLayerFiles = Resources.list(baseDir, new Filter<Resource>() { @Override public boolean accept(Resource res) { return res.name().endsWith(".xml"); } }); LOGGER.info("Loading tile layers from " + baseDir.path()); tileLayerFiles.parallelStream().forEach(res -> { GeoServerTileLayerInfoImpl info; try { info = depersist(res); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Error depersisting tile layer information from file " + res.name(), e); return; } layersById.put(info.getId(), info.getName()); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Loaded tile layer '" + info.getName() + "'"); } }); this.initialized = true; }

Target:
public void initialize() { layersById.clear(); Resource baseDir = resourceLoader.get(baseDirectory); LOGGER.info("GeoServer TileLayer store base directory is: " + baseDir.path()); final List<Resource> tileLayerFiles = Resources.list(baseDir, new Filter<Resource>() { @Override public boolean accept(Resource res) { return res.name().endsWith(".xml"); } }); LOGGER.info("Loading tile layers from " + baseDir.path()); for (Resource res : tileLayerFiles) { GeoServerTileLayerInfoImpl info; try { info = depersist(res); } catch (Exception e) { LOGGER.log(Level.SEVERE, "Error depersisting tile layer information from file " + res.name(), e); continue; } layersById.put(info.getId(), info.getName()); if (LOGGER.isLoggable(Level.FINER)) { LOGGER.finer("Loaded tile layer '" + info.getName() + "'"); } } this.initialized = true; }
Source:
public boolean isEmpty() { return normalizedName.isEmpty(); }

Target:
public boolean isEmpty() { return normalisedName.isEmpty(); }
Source:
@Test public void delegates() throws IOException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new Converter.Factory() { @Nullable @Override public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { if (getRawType(type) == Optional.class) { return null; } return new Converter<ResponseBody, Object>() { @Override public Object convert(ResponseBody value) { return null; } }; } }) .addConverterFactory(GuavaOptionalConverterFactory.create()) .build(); server.enqueue(new MockResponse()); Service service = retrofit.create(Service.class); Optional<Object> optional = service.optional().execute().body(); assertThat(optional).isNotNull(); assertThat(optional.isPresent()).isFalse(); }

Target:
@Test public void delegates() throws IOException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new Converter.Factory() { @Nullable @Override public Converter<ResponseBody, ?> responseBodyConverter(Type type, Annotation[] annotations, Retrofit retrofit) { if (getRawType(type) != Object.class) { return null; } return new Converter<ResponseBody, Object>() { @Override public Object convert(ResponseBody value) { return null; } }; } }) .addConverterFactory(GuavaOptionalConverterFactory.create()) .build(); server.enqueue(new MockResponse()); Service service = retrofit.create(Service.class); Optional<Object> optional = service.optional().execute().body(); assertThat(optional).isNotNull(); assertThat(optional.isPresent()).isFalse(); }
Source:
void testMergeWithSingleSegmentRejected() throws InterruptedException { int numberOfSegments = 1; initProcessor(TrackingEventProcessorConfiguration.forParallelProcessing(numberOfSegments)); testSubject.start(); waitForActiveThreads(1); CompletableFuture<Boolean> actual = testSubject.mergeSegment(0); assertFalse(actual.join(), "Expected merge to be rejected"); waitForProcessingNotInStatus(0, EventTrackerStatus::isMerging); }

Target:
void testMergeWithSingleSegmentRejected() throws InterruptedException { int numberOfSegments = 1; initProcessor(TrackingEventProcessorConfiguration.forParallelProcessing(numberOfSegments)); int segmentId = 0; testSubject.start(); waitForActiveThreads(1); CompletableFuture<Boolean> actual = testSubject.mergeSegment(segmentId); assertFalse(actual.join(), "Expected merge to be rejected"); assertFalse(testSubject.processingStatus().get(segmentId).isMerging()); }
Source:
public void testGetAllForTemplateWithPermissionsForUnprivilegedUser() { List<VmNetworkInterface> result = dao.getAllForTemplate(TEMPLATE_ID, UNPRIVILEGED_USER_ID, true); assertNotNull(result); assertTrue(result.size() == 0); }

Target:
public void testGetAllForTemplateWithPermissionsForUnprivilegedUser() { List<VmNetworkInterface> result = dao.getAllForTemplate(TEMPLATE_ID, UNPRIVILEGED_USER_ID, true); assertNotNull(result); assertTrue(result.isEmpty()); }
Source:
public long getTableVolume(TableDesc table, Optional<EvalNode> filter) throws UnsupportedException { long totalVolume; try { totalVolume = getRawSplits("", table, filter.orElse(null)).stream() .map(f -> f.getLength()) .filter(size -> size > 0) .reduce(0L, (sum, size) -> sum + size); } catch (TajoException e) { throw new TajoRuntimeException(e); } catch (Throwable ioe) { throw new TajoInternalError(ioe); } return totalVolume; }

Target:
public long getTableVolume(TableDesc table, Optional<EvalNode> filter) { long totalVolume; try { totalVolume = getRawSplits("", table, filter.orElse(null)).stream() .map(f -> f.getLength()) .filter(size -> size > 0) .reduce(0L, Long::sum); } catch (TajoException e) { throw new TajoRuntimeException(e); } catch (Throwable ioe) { throw new TajoInternalError(ioe); } return totalVolume; }
Source:
public Change perform(IProgressMonitor pm) throws CoreException { pm.beginTask("", 1); try { IQ7NamedElement e = (IQ7NamedElement) getElement(); IQ7NamedElement copy = null; boolean isWorkingCopy = e.isWorkingCopy(); try { copy = isWorkingCopy ? e : e.getWorkingCopy(new NullProgressMonitor()); List<String> references = getContextsReferences(copy); int index = references.indexOf(getContextId()); if (index != -1) { references.remove(index); if (copy instanceof ITestCase) { ((ITestCase) copy).setContexts(references .toArray(new String[references.size()])); } else if (copy instanceof IQ7ProjectMetadata) { NamedElement namedElement = copy.getNamedElement(); if (namedElement instanceof ProjectMetadata) { ProjectMetadata meta = (ProjectMetadata) namedElement; meta.getContexts().clear(); meta.getContexts().addAll(references); } } else { NamedElement namedElement = copy.getNamedElement(); if (namedElement instanceof GroupContext) { GroupContext ctx = (GroupContext) namedElement; ctx.getContextReferences().clear(); ctx.getContextReferences().addAll(references); } } WriteAccessChecker writeAccessChecker = new WriteAccessChecker(); if (writeAccessChecker.makeResourceWritable(copy)) { copy.commitWorkingCopy(true, new NullProgressMonitor()); } return new UndoDeleteContextReferenceChange(getElement(), (IFile) (getElement().getResource()), getContext(), getContextId(), index); } } finally { if (!isWorkingCopy) copy.discardWorkingCopy(); } return null; } finally { pm.done(); } }

Target:
public Change perform(IProgressMonitor pm) throws CoreException { pm.beginTask("", 1); try { IQ7NamedElement e = (IQ7NamedElement) getElement(); IQ7NamedElement copy = null; boolean isWorkingCopy = e.isWorkingCopy(); try { copy = isWorkingCopy ? e : e.getWorkingCopy(new NullProgressMonitor()); List<String> references = getContextsReferences(copy); int index = references.indexOf(getContextId()); if (index != -1) { references.remove(index); if (copy instanceof ITestCase) { ((ITestCase) copy).setContexts(references .toArray(new String[references.size()])); } else if (copy instanceof IQ7ProjectMetadata) { NamedElement namedElement = copy.getNamedElement(); if (namedElement instanceof ProjectMetadata) { ProjectMetadata meta = (ProjectMetadata) namedElement; meta.getContexts().clear(); meta.getContexts().addAll(references); } } else { NamedElement namedElement = copy.getNamedElement(); if (namedElement instanceof GroupContext) { GroupContext ctx = (GroupContext) namedElement; ctx.getContextReferences().clear(); ctx.getContextReferences().addAll(references); } } copy.commitWorkingCopy(true, new NullProgressMonitor()); return new UndoDeleteContextReferenceChange(getElement(), (IFile) (getElement().getResource()), getContext(), getContextId(), index); } } finally { if (!isWorkingCopy) copy.discardWorkingCopy(); } return null; } finally { pm.done(); } }
Source:
public List<ImapResponse> internalOpen(OpenMode mode) throws MessagingException { if (isOpen() && mMode == mode) { try { List<ImapResponse> responses = executeSimpleCommand("NOOP"); return responses; } catch (IOException ioe) { ioExceptionHandler(mConnection, ioe); } } releaseConnection(mConnection); synchronized (this) { mConnection = getConnection(); } try { msgSeqUidMap.clear(); String command = String.format("%s %s", mode == OpenMode.READ_WRITE ? "SELECT" : "EXAMINE", encodeString(encodeFolderName(getPrefixedName()))); List<ImapResponse> responses = executeSimpleCommand(command); mMode = mode; for (ImapResponse response : responses) { if (response.size() >= 2) { Object bracketedObj = response.get(1); if (!(bracketedObj instanceof ImapList)) { continue; } ImapList bracketed = (ImapList) bracketedObj; if (bracketed.isEmpty()) { continue; } ImapList flags = bracketed.getKeyedList("PERMANENTFLAGS"); if (flags != null) { parseFlags(flags, mPermanentFlagsIndex); } else { Object keyObj = bracketed.get(0); if (keyObj instanceof String) { String key = (String) keyObj; if (response.mTag != null) { if ("READ-ONLY".equalsIgnoreCase(key)) { mMode = OpenMode.READ_ONLY; } else if ("READ-WRITE".equalsIgnoreCase(key)) { mMode = OpenMode.READ_WRITE; } } } } } } mExists = true; return responses; } catch (IOException ioe) { throw ioExceptionHandler(mConnection, ioe); } catch (MessagingException me) { Log.e(K9.LOG_TAG, "Unable to open connection for " + getLogId(), me); throw me; } }

Target:
public List<ImapResponse> internalOpen(OpenMode mode) throws MessagingException { if (isOpen() && mMode == mode) { try { List<ImapResponse> responses = executeSimpleCommand("NOOP"); return responses; } catch (IOException ioe) { ioExceptionHandler(mConnection, ioe); } } releaseConnection(mConnection); synchronized (this) { mConnection = getConnection(); } try { msgSeqUidMap.clear(); String command = String.format("%s %s", mode == OpenMode.READ_WRITE ? "SELECT" : "EXAMINE", encodeString(encodeFolderName(getPrefixedName()))); List<ImapResponse> responses = executeSimpleCommand(command); mMode = mode; for (ImapResponse response : responses) { if (response.size() >= 2) { Object bracketedObj = response.get(1); if (!(bracketedObj instanceof ImapList)) { continue; } ImapList bracketed = (ImapList) bracketedObj; if (bracketed.isEmpty()) { continue; } ImapList flags = bracketed.getKeyedList("PERMANENTFLAGS"); if (flags != null) { parseFlags(flags); } else { Object keyObj = bracketed.get(0); if (keyObj instanceof String) { String key = (String) keyObj; if (response.mTag != null) { if ("READ-ONLY".equalsIgnoreCase(key)) { mMode = OpenMode.READ_ONLY; } else if ("READ-WRITE".equalsIgnoreCase(key)) { mMode = OpenMode.READ_WRITE; } } } } } } mExists = true; return responses; } catch (IOException ioe) { throw ioExceptionHandler(mConnection, ioe); } catch (MessagingException me) { Log.e(K9.LOG_TAG, "Unable to open connection for " + getLogId(), me); throw me; } }
Source:
protected void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @Nullable String[] args) { if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return; mHandler.runWithScissors(() -> mTimeDetectorStrategy.dump(pw, args), 0); }

Target:
protected void dump(@NonNull FileDescriptor fd, @NonNull PrintWriter pw, @Nullable String[] args) { if (!DumpUtils.checkDumpPermission(mContext, TAG, pw)) return; synchronized (mStrategyLock) { mTimeDetectorStrategy.dump(pw, args); } }
Source:
private Map<Method, Handler> buildHandlersFor(Class<?> sqlObjectType, SqlObject config) { return handlersCache.computeIfAbsent(sqlObjectType, type -> { final MemberResolver mr = new MemberResolver(typeResolver); final ResolvedType sql_object_type = typeResolver.resolve(sqlObjectType); final ResolvedTypeWithMembers d = mr.resolve(sql_object_type, null, null); final Map<Method, Handler> handlers = new HashMap<>(); for (final ResolvedMethod method : d.getMemberMethods()) { final Method raw_method = method.getRawMember(); if (raw_method.isAnnotationPresent(SqlQuery.class)) { handlers.put(raw_method, new QueryHandler(sqlObjectType, method, ResultReturnThing.forType(method))); } else if (raw_method.isAnnotationPresent(SqlUpdate.class)) { handlers.put(raw_method, new UpdateHandler(sqlObjectType, method)); } else if (raw_method.isAnnotationPresent(SqlBatch.class)) { handlers.put(raw_method, new BatchHandler(sqlObjectType, method)); } else if (raw_method.isAnnotationPresent(SqlCall.class)) { handlers.put(raw_method, new CallHandler(sqlObjectType, method)); } else if (raw_method.isAnnotationPresent(CreateSqlObject.class)) { handlers.put(raw_method, new CreateSqlObjectHandler(raw_method.getReturnType(), config)); } else if (raw_method.isAnnotationPresent(Transaction.class)) { handlers.put(raw_method, new PassThroughTransactionHandler(raw_method, raw_method.getAnnotation(Transaction.class))); } else if (mixinHandlers.containsKey(raw_method)) { handlers.put(raw_method, mixinHandlers.get(raw_method)); } else { handlers.put(raw_method, new PassThroughHandler(raw_method)); } } handlers.putAll(EqualsHandler.handler()); handlers.putAll(ToStringHandler.handler(sqlObjectType.getName())); handlers.putAll(HashCodeHandler.handler()); return handlers; }); }

Target:
private Map<Method, Handler> buildHandlersFor(Class<?> sqlObjectType, SqlObject config) { return handlersCache.computeIfAbsent(sqlObjectType, type -> { final MemberResolver mr = new MemberResolver(typeResolver); final ResolvedType sql_object_type = typeResolver.resolve(sqlObjectType); final ResolvedTypeWithMembers d = mr.resolve(sql_object_type, null, null); final Map<Method, Handler> handlers = new HashMap<>(); for (final ResolvedMethod method : d.getMemberMethods()) { final Method rawMethod = method.getRawMember(); Optional<? extends Class<? extends HandlerFactory>> factoryClass = Stream.of(rawMethod.getAnnotations()) .map(a -> a.annotationType().getAnnotation(SqlMethodAnnotation.class)) .filter(Objects::nonNull) .map(a -> a.value()) .findFirst(); if (factoryClass.isPresent()) { HandlerFactory factory = buildFactory(factoryClass.get()); Handler handler = factory.buildHandler(sqlObjectType, method, config); handlers.put(rawMethod, handler); } else if (mixinHandlers.containsKey(rawMethod)) { handlers.put(rawMethod, mixinHandlers.get(rawMethod)); } else { handlers.put(rawMethod, new PassThroughHandler(rawMethod)); } } handlers.putAll(EqualsHandler.handler()); handlers.putAll(ToStringHandler.handler(sqlObjectType.getName())); handlers.putAll(HashCodeHandler.handler()); return handlers; }); }
Source:
public ControlledProcessStateService getService() { return service; }

Target:
ControlledProcessStateService getService() { return service; }