auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Object getFieldValue(Object svc, String fieldName) { Object result = null; try { Field field = getField(svc, fieldName); field.setAccessible(true); result = field.get(svc); } catch (IllegalArgumentException e) { logger.warn(e.getMessage(), e); } catch (IllegalAccessException e) { logger.warn(e.getMessage(), e); } catch (NoSuchFieldException e) { logger.warn(e.getMessage(), e); } return result; }

Target:
public static Object getFieldValue(Object svc, String fieldName) throws NoSuchFieldException { Object result = null; Field field = getField(svc, fieldName); try { field.setAccessible(true); result = field.get(svc); } catch (IllegalArgumentException e) { logger.warn(e.getMessage(), e); } catch (IllegalAccessException e) { logger.warn(e.getMessage(), e); } return result; }
Source:
static GatewayServer startGatewayServer() throws ExecutionException, InterruptedException { CompletableFuture<GatewayServer> gatewayServer = new CompletableFuture<>(); Thread thread = new Thread(() -> { int freePort; try { freePort = findFreePort(); } catch (IOException e) { throw new RuntimeException("Could not find a free port for Py4jCallbackClient."); } GatewayServer server = new GatewayServer.GatewayServerBuilder() .gateway(new Gateway(new ConcurrentHashMap<String, Object>(), new CallbackClient(freePort))) .javaPort(0) .build(); gatewayServer.complete(server); server.start(true); }); thread.setName("py4j-gateway"); thread.setDaemon(true); thread.start(); thread.join(); return gatewayServer.get(); }

Target:
static GatewayServer startGatewayServer() throws ExecutionException, InterruptedException { CompletableFuture<GatewayServer> gatewayServerFuture = new CompletableFuture<>(); Thread thread = new Thread(() -> { try { int freePort = NetUtils.getAvailablePort(); GatewayServer server = new GatewayServer.GatewayServerBuilder() .gateway(new Gateway(new ConcurrentHashMap<String, Object>(), new CallbackClient(freePort))) .javaPort(0) .build(); CallbackClient callbackClient = (CallbackClient) server.getCallbackClient(); Field executor = CallbackClient.class.getDeclaredField("executor"); executor.setAccessible(true); ((ScheduledExecutorService) executor.get(callbackClient)).shutdown(); executor.set(callbackClient, Executors.newScheduledThreadPool(1, Thread::new)); Method setupCleaner = CallbackClient.class.getDeclaredMethod("setupCleaner"); setupCleaner.setAccessible(true); setupCleaner.invoke(callbackClient); gatewayServerFuture.complete(server); server.start(true); } catch (Throwable e) { gatewayServerFuture.completeExceptionally(e); } }); thread.setName("py4j-gateway"); thread.setDaemon(true); thread.start(); thread.join(); return gatewayServerFuture.get(); }
Source:
public Meetup(int monthOfYear, int year) { startOfMonth = LocalDate.of(year, monthOfYear, 1); }

Target:
Meetup(int monthOfYear, int year) { startOfMonth = LocalDate.of(year, monthOfYear, 1); }
Source:
private <T> T _to(String tailApiUrl, Class<T> type, T instance) throws IOException { int retries = 5; while (true) { try { return __to(tailApiUrl, type, instance); } catch (IOException e) { retries--; if (retries == 0) { throw e; } else { LOGGER.log(Level.INFO, "Sleeping before retrying... (" + retries + ")"); try { Thread.sleep(5000); } catch (InterruptedException _) { throw (IOException)new InterruptedIOException().initCause(e); } } } } }

Target:
private <T> T _to(String tailApiUrl, Class<T> type, T instance) throws IOException { if (!isMethodWithBody() && !args.isEmpty()) { boolean questionMarkFound = tailApiUrl.indexOf('?') != -1; tailApiUrl += questionMarkFound ? '&' : '?'; for (Iterator<Entry> it = args.listIterator(); it.hasNext();) { Entry arg = it.next(); tailApiUrl += arg.key + '=' + URLEncoder.encode(arg.value.toString(),"UTF-8"); if (it.hasNext()) { tailApiUrl += '&'; } } } while (true) { setupConnection(root.getApiURL(tailApiUrl)); buildRequest(); try { T result = parse(type, instance); if (type != null && type.isArray()) { final String links = uc.getHeaderField("link"); if (links != null && links.contains("rel=\"next\"")) { Pattern nextLinkPattern = Pattern.compile(".*<(.*)>; rel=\"next\""); Matcher nextLinkMatcher = nextLinkPattern.matcher(links); if (nextLinkMatcher.find()) { final String link = nextLinkMatcher.group(1); T nextResult = _to(link, type, instance); setResponseHeaders(nextResult); final int resultLength = Array.getLength(result); final int nextResultLength = Array.getLength(nextResult); T concatResult = (T) Array.newInstance(type.getComponentType(), resultLength + nextResultLength); System.arraycopy(result, 0, concatResult, 0, resultLength); System.arraycopy(nextResult, 0, concatResult, resultLength, nextResultLength); result = concatResult; } } } return setResponseHeaders(result); } catch (IOException e) { handleApiError(e); } finally { noteRateLimit(tailApiUrl); } } }
Source:
public final boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TableDataSource) || !getClass().equals(o.getClass())) { return false; } TableDataSource that = (TableDataSource) o; if (!name.equals(that.name)) { return false; } return true; }

Target:
public final boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof TableDataSource)) { return false; } if ((o instanceof GlobalTableDataSource || this instanceof GlobalTableDataSource) && !getClass().equals(o.getClass())) { return false; } TableDataSource that = (TableDataSource) o; if (!name.equals(that.name)) { return false; } return true; }
Source:
public Args(String arg) throws BadFencingConfigurationException { try { user = UserGroupInformation.getCurrentUser().getShortUserName(); } catch(IOException ex) { LOG.warn("Unable to get user name. Fall back to system property " + "user.name", ex); user = System.getProperty("user.name"); } sshPort = DEFAULT_SSH_PORT; if (arg != null && !arg.isEmpty()) { Matcher m = USER_PORT_RE.matcher(arg); if (!m.matches()) { throw new BadFencingConfigurationException( "Unable to parse user and SSH port: "+ arg); } if (m.group(1) != null) { user = m.group(1); } if (m.group(2) != null) { sshPort = parseConfiggedPort(m.group(2)); } } }

Target:
public Args(String arg) throws BadFencingConfigurationException { user = System.getProperty("user.name"); sshPort = DEFAULT_SSH_PORT; if (arg != null && !arg.isEmpty()) { Matcher m = USER_PORT_RE.matcher(arg); if (!m.matches()) { throw new BadFencingConfigurationException( "Unable to parse user and SSH port: "+ arg); } if (m.group(1) != null) { user = m.group(1); } if (m.group(2) != null) { sshPort = parseConfiggedPort(m.group(2)); } } }
Source:
private static NioClient createClient( Peer peer, int port, int connectionTimeout ) throws IOException { InetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLocalHost(), port); NioClient client = new NioClient(serverAddress, peer, connectionTimeout); return client; }

Target:
private static NioClient createClient(Peer peer, int port, int connectionTimeout) throws IOException { InetSocketAddress serverAddress = new InetSocketAddress(InetAddress.getLocalHost(), port); return new NioClient(serverAddress, peer, connectionTimeout); }
Source:
public Object execute(ExecutionEvent event) throws ExecutionException { TransactionalEditingDomain editingDomain = getTableEditingDomain(); Table table = getTable(); if (null != editingDomain && null != table) { BooleanValueStyle wrapTextValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.WRAP_TEXT); if (null != wrapTextValue) { Assert.isTrue(wrapTextValue.isBooleanValue()); BooleanValueStyle autoResizeValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); if (null != autoResizeValue && autoResizeValue.isBooleanValue()) { NatEventData natEventData = getNatEventData(); if (null != natEventData && null != natEventData.getNatTable()) { final NatTable natTable = natEventData.getNatTable(); natTable.getConfigRegistry().registerConfigAttribute(NattableConfigAttributes.REINITIALISE_ROW_HEIGHT, true); } } StyleUtils.deleteBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT); } else { StyleUtils.initBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT, true); } } return null; }

Target:
public Object execute(ExecutionEvent event) throws ExecutionException { TransactionalEditingDomain editingDomain = getTableEditingDomain(); Table table = getTable(); if (null != editingDomain && null != table) { BooleanValueStyle wrapTextValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.WRAP_TEXT); if (null != wrapTextValue) { if (wrapTextValue.isBooleanValue()) { BooleanValueStyle autoResizeValue = (BooleanValueStyle) table.getNamedStyle(NattablestylePackage.eINSTANCE.getBooleanValueStyle(), NamedStyleConstants.AUTO_RESIZE_CELL_HEIGHT); if (null != autoResizeValue && autoResizeValue.isBooleanValue()) { NatEventData natEventData = getNatEventData(); if (null != natEventData && null != natEventData.getNatTable()) { final NatTable natTable = natEventData.getNatTable(); natTable.getConfigRegistry().registerConfigAttribute(NattableConfigAttributes.REINITIALISE_ROW_HEIGHT, true); } } StyleUtils.deleteBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT); } else { StyleUtils.setBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT, NamedStyleConstants.ENABLE_WRAP_TEXT); } } else { StyleUtils.initBooleanNamedStyle(editingDomain, table, NamedStyleConstants.WRAP_TEXT, NamedStyleConstants.ENABLE_WRAP_TEXT); } } return null; }
Source:
public static K parseWithModule(CharSequence theTextToParse, String startSymbol, org.kframework.definition.Module kastModule) { ParseInModule parser = new ParseInModule(kastModule); Term cleaned = parser.parseString(theTextToParse, startSymbol)._1().right().get(); return TreeNodesToKORE.apply(cleaned); }

Target:
public static K parseWithModule(CharSequence theTextToParse, String startSymbol, org.kframework.definition.Module kastModule) { ParseInModule parser = new ParseInModule(kastModule); return parseWithModule(theTextToParse, startSymbol, parser); }
Source:
private PageId ensureValue() { if (mValue == null) { for (; mIter.isValid(); mIter.next()) { PageId id = getPageId(mIter.key()); if (id != null) { mValue = id; break; } } } return mValue; }

Target:
private PageId ensureValue() { if (mValue == null) { for (; mIter.isValid(); mIter.next()) { PageId id = getPageIdFromKey(mIter.key()); if (id != null) { mValue = id; break; } } } return mValue; }
Source:
protected String getLabel(final EObject element, final String type) { String result = null; IItemLabelProvider provider = getDelegate(element); String umlResult = (provider == null) ? ModelUtils.getDefaultName(element) : provider.getText(element); if (umlResult != null) { Matcher m = UML2_LABEL_PATTERN.matcher(umlResult); if (m.matches()) { LabelTypesEnum typeEnum = LabelTypesEnum.getByLiteral(type); switch (typeEnum) { case LABEL: result = m.group(3); break; case STEREOTYPE: result = m.group(1); break; case METACLASS: result = m.group(2); break; case DASH_SEPARATOR: result = SEPARATOR_DASH; break; case COLON_SEPARATOR: result = SEPARATOR_COLON; break; case QUALIFY_NAME: result = ((NamedElement) element).getQualifiedName(); break; default: break; } } } return null != result ? result : ""; }

Target:
protected String getLabel(final EObject element, final String type) { String result = null; IItemLabelProvider provider = getDelegate(element); String umlResult = (provider == null) ? ModelUtils.getDefaultName(element) : provider.getText(element); if (null != umlResult) { Matcher m = UML2_LABEL_PATTERN.matcher(umlResult); if (m.matches()) { LabelTypesEnum typeEnum = LabelTypesEnum.getByLiteral(type); switch (typeEnum) { case LABEL: result = m.group(3); break; case STEREOTYPE: result = m.group(1); break; case METACLASS: result = m.group(2); break; case DASH_SEPARATOR: result = SEPARATOR_DASH; break; case COLON_SEPARATOR: result = SEPARATOR_COLON; break; case QUALIFY_NAME: result = ((NamedElement) element).getQualifiedName(); break; default: break; } } } return null != result ? result : ""; }
Source:
public void testSortedSerialization() throws Exception { final String[] strings = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"}; GenericIndexed<String> deserialized = serializeAndDeserialize( GenericIndexed.fromArray( strings, GenericIndexed.STRING_STRATEGY ) ); checkBasicAPIs(strings, deserialized, deserialized.isAllowReverseLookup()); Assert.assertEquals(-13, deserialized.indexOf("q")); Assert.assertEquals(-9, deserialized.indexOf("howdydo")); Assert.assertEquals(-1, deserialized.indexOf("1111")); }

Target:
public void testSortedSerialization() throws Exception { final String[] strings = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l"}; GenericIndexed<String> deserialized = serializeAndDeserialize( GenericIndexed.fromArray( strings, GenericIndexed.STRING_STRATEGY ) ); checkBasicAPIs(strings, deserialized, true); Assert.assertEquals(-13, deserialized.indexOf("q")); Assert.assertEquals(-9, deserialized.indexOf("howdydo")); Assert.assertEquals(-1, deserialized.indexOf("1111")); }
Source:
private CallerContext(Builder builder) { this.context = builder.sb.length() > 0 ? builder.sb.toString() : null; this.signature = builder.signature; }

Target:
private CallerContext(Builder builder) { this.context = builder.getContext(); this.signature = builder.getSignature(); }
Source:
private static File unmarshalFile( ReadableChannel channel ) throws IOException { int characters = channel.getInt(); byte[] name = new byte[characters]; channel.get( name, characters ); return new File( new String( name ) ); }

Target:
private static File unmarshalFile( ReadableChannel channel ) throws IOException { byte[] name = readBytes( channel ); return new File( UTF8.decode( name ) ); }
Source:
public void descriptorOnHeapTest() { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, heap(10)) .build(); ManagementRegistryService managementRegistry = new DefaultManagementRegistryService(new DefaultManagementRegistryConfiguration().setCacheManagerAlias("myCM")); CacheManager cacheManager1 = CacheManagerBuilder.newCacheManagerBuilder() .withCache("aCache", cacheConfiguration) .using(managementRegistry) .build(true); assertThat(managementRegistry.getCapabilities(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getName(), equalTo("ActionsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getName(), equalTo("StatisticsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(2).getName(), equalTo("StatisticCollectorCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(3).getName(), equalTo("SettingsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getDescriptors(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getDescriptors(), hasSize(35)); cacheManager1.close(); }

Target:
public void descriptorOnHeapTest() { CacheManager cacheManager1 = null; try { CacheConfiguration<Long, String> cacheConfiguration = CacheConfigurationBuilder.newCacheConfigurationBuilder(Long.class, String.class, heap(10)) .build(); ManagementRegistryService managementRegistry = new DefaultManagementRegistryService(new DefaultManagementRegistryConfiguration().setCacheManagerAlias("myCM")); cacheManager1 = CacheManagerBuilder.newCacheManagerBuilder() .withCache("aCache", cacheConfiguration) .using(managementRegistry) .build(true); assertThat(managementRegistry.getCapabilities(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getName(), equalTo("ActionsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getName(), equalTo("StatisticsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(2).getName(), equalTo("StatisticCollectorCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(3).getName(), equalTo("SettingsCapability")); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(0).getDescriptors(), hasSize(4)); assertThat(new ArrayList<Capability>(managementRegistry.getCapabilities()).get(1).getDescriptors(), hasSize(35)); } finally { if(cacheManager1 != null) cacheManager1.close(); } }
Source:
public SynchronizedStatesManager() { m_ssm_es = s_shared_es; m_zk = null; m_registeredStateMachines = null; m_ssmRootNode = "MockRootForZooKeeper"; m_stateMachineRoot = "MockRootForSSM"; m_stateMachineMemberPath = "MockRootMembershipNode"; m_memberId = "MockMemberId"; m_canonical_memberId = "MockCanonicalMemberId"; m_resetAllowance = 5; m_resetLimit = m_resetAllowance; }

Target:
public SynchronizedStatesManager() { m_executor = s_sharedExecutor; m_zk = null; m_registeredStateMachines = null; m_ssmRootNode = "MockRootForZooKeeper"; m_stateMachineRoot = "MockRootForSSM"; m_stateMachineMemberPath = "MockRootMembershipNode"; m_memberId = "MockMemberId"; m_canonical_memberId = "MockCanonicalMemberId"; m_resetAllowance = 5; m_resetLimit = m_resetAllowance; }
Source:
private static List<String> tokens(final Request req) throws IOException { final Pattern pattern = Pattern.compile("(\\w+)\\/([\\d\\.]+)"); final List<String> tokens = new LinkedList<>(); final Iterable<String> headers = new RqHeaders.Base(req).header("User-Agent"); for (final String header : headers) { final Matcher matcher = pattern.matcher(header); if (matcher.matches()) { tokens.add(matcher.group()); } } return tokens; }

Target:
private static List<String> tokens(final Request req) throws IOException { final List<String> tokens = new LinkedList<>(); final Iterable<String> headers = new RqHeaders.Base(req).header("User-Agent"); for (final String header : headers) { final Matcher matcher = PATTERN.matcher(header); if (matcher.matches()) { tokens.add(matcher.group()); } } return tokens; }
Source:
public static boolean allowed(@NotNull PsiFile file) { final String name = file.getName(); if (StringUtil.startsWithChar(name, '_') || StringUtil.startsWithChar(name, '.')) { return false; } if (!goodOSArchFile(file)) { return false; } if (!(file instanceof GoFile)) { return false; } String flags = ((GoFile)file).getBuildFlags(); if (null == flags || flags.isEmpty()) { return true; } Collection<String> lines = StringUtil.split(flags, "|"); loop: for (final String line : lines) { for (final String tag : WHITESPACES.split(line)) { if (match(tag)) { continue loop; } } return false; } return true; }

Target:
public static boolean allowed(@NotNull PsiFile file) { return buildMatcher.matchFile(file); }
Source:
public void onStartup(final PlaceRequest placeRequest) { view.init(this); final String title = placeRequest.getParameter("title", view.getTrySamplesLabel()); view.setTitle(title); final String repositoryUrl = placeRequest.getParameter("repositoryUrl", null); view.showBusyIndicator(view.getLoadingMessage()); libraryService.call((Set<ExampleProject> projects) -> { view.hideBusyIndicator(); if (projects == null || projects.isEmpty()) { showNoProjects(); return; } projectWidgetsByName = new HashMap<>(); projects.forEach(project -> { TileWidget tileWidget = tileWidgets.get(); tileWidget.init(project.getName(), project.getDescription(), null, null, selectCommand(tileWidget)); projectWidgetsByName.put(project, tileWidget); }); updateView(projectWidgetsByName.values()); }, new DefaultErrorCallback() { @Override public boolean error(final Message message, final Throwable throwable) { showNoProjects(); return super.error(message, throwable); } }).getProjects(repositoryUrl); }

Target:
public void onStartup(final PlaceRequest placeRequest) { view.init(this); final String title = placeRequest.getParameter("title", view.getTrySamplesLabel()); view.setTitle(title); final String repositoryUrl = placeRequest.getParameter("repositoryUrl", null); view.showBusyIndicator(view.getLoadingMessage()); libraryService.call((Set<ExampleProject> projects) -> { view.hideBusyIndicator(); if (projects == null || projects.isEmpty()) { showNoProjects(); return; } projectWidgetsByName = new HashMap<>(); projects.forEach(project -> { TileWidget projectWidget = createProjectWidget(project); projectWidgetsByName.put(project, projectWidget); }); updateView(projectWidgetsByName.values()); }, new DefaultErrorCallback() { @Override public boolean error(final Message message, final Throwable throwable) { view.hideBusyIndicator(); showNoProjects(); return super.error(message, throwable); } }).getProjects(repositoryUrl); }
Source:
public void deleteTicket(Guid ticketUUID) { BasicHttpRequest request = getRequest("DELETE", TICKETS_URI + ticketUUID); HttpEntity response = sendRequest(request); consumeEntity(response); }

Target:
public void deleteTicket(Guid ticketUUID) { BasicHttpRequest request = getRequest("DELETE", TICKETS_URI + ticketUUID); HttpEntity response = executeRequest(request); consumeEntity(response); }
Source:
public void setUp() { gambling = ActivityCategory.createInstance("gambling", false, new HashSet<String>(Arrays.asList("poker", "lotto")), Collections.emptySet()); news = ActivityCategory.createInstance("news", false, new HashSet<String>(Arrays.asList("refdag", "bbc")), Collections.emptySet()); activityCategories.add(gambling); activityCategories.add(news); when(mockRepository.findAll()).thenReturn(Collections.unmodifiableSet(activityCategories)); when(mockRepository.findOne(gambling.getID())).thenReturn(gambling); when(mockRepository.findOne(news.getID())).thenReturn(news); when(mockRepository.save(any(ActivityCategory.class))).thenAnswer(new Answer<ActivityCategory>() { @Override public ActivityCategory answer(InvocationOnMock invocation) throws Throwable { Object[] args = invocation.getArguments(); return (ActivityCategory) args[0]; } }); }

Target:
public void setUp() { setUp(mockRepository); }
Source:
private void mill(Game game, MoveContext context, Player currentPlayer) { if (currentPlayer.getHand().size() <= 1) { return; } ArrayList<Card> handCopy = Util.copy(currentPlayer.getHand()); Card[] cardsToDiscard = currentPlayer.controlPlayer.mill_cardsToDiscard(context); if (cardsToDiscard == null || cardsToDiscard.length != 2) { return; } ArrayList<Card> copy = Util.copy(currentPlayer.hand); for (Card cardToKeep : cardsToDiscard) { if (!copy.remove(cardToKeep)) { return; } } for (Card card : cardsToDiscard) { currentPlayer.discard(card, this.controlCard, null); currentPlayer.hand.remove(card); } context.addCoins(2, this.controlCard); }

Target:
private void mill(Game game, MoveContext context, Player currentPlayer) { if (currentPlayer.getHand().size() == 0) { return; } ArrayList<Card> handCopy = Util.copy(currentPlayer.getHand()); Card[] cardsToDiscard = currentPlayer.controlPlayer.mill_cardsToDiscard(context); if (cardsToDiscard == null || !(cardsToDiscard.length == 2 || cardsToDiscard.length == 1 && currentPlayer.getHand().size() == 1)) { return; } ArrayList<Card> copy = Util.copy(currentPlayer.hand); for (Card cardToKeep : cardsToDiscard) { if (!copy.remove(cardToKeep)) { return; } } for (Card card : cardsToDiscard) { currentPlayer.discard(card, this.controlCard, context); currentPlayer.hand.remove(card); } if (cardsToDiscard.length == 2) { context.addCoins(2, this.controlCard); } }
Source:
public boolean isValid(RealmModel realm, UserModel user, CredentialInput input) { if (!WebAuthnCredentialModel.class.isInstance(input)) return false; WebAuthnCredentialModel context = WebAuthnCredentialModel.class.cast(input); List<WebAuthnCredentialModel> auths = getWebAuthnCredentialModelList(realm, user); WebAuthnAuthenticationContextValidator webAuthnAuthenticationContextValidator = new WebAuthnAuthenticationContextValidator(); try { for (WebAuthnCredentialModel auth : auths) { byte[] credentialId = auth.getAttestedCredentialData().getCredentialId(); if (Arrays.equals(credentialId, context.getAuthenticationContext().getCredentialId())) { Authenticator authenticator = new AuthenticatorImpl( auth.getAttestedCredentialData(), auth.getAttestationStatement(), auth.getCount() ); WebAuthnAuthenticationContextValidationResponse response = webAuthnAuthenticationContextValidator.validate( context.getAuthenticationContext(), authenticator); logger.infov("response.getAuthenticatorData().getFlags() = {0}", response.getAuthenticatorData().getFlags()); long count = auth.getCount(); auth.setCount(count + 1); CredentialModel cred = createCredentialModel(auth); session.userCredentialManager().updateCredential(realm, user, cred); dumpCredentialModel(cred); dumpWebAuthnCredentialModel(auth); return true; } } } catch (WebAuthnException wae) { wae.printStackTrace(); throw(wae); } return false; }

Target:
public boolean isValid(RealmModel realm, UserModel user, CredentialInput input) { if (!WebAuthnCredentialModel.class.isInstance(input)) return false; WebAuthnCredentialModel context = WebAuthnCredentialModel.class.cast(input); List<WebAuthnCredentialModel> auths = getWebAuthnCredentialModelList(realm, user); WebAuthnAuthenticationContextValidator webAuthnAuthenticationContextValidator = new WebAuthnAuthenticationContextValidator(); try { for (WebAuthnCredentialModel auth : auths) { byte[] credentialId = auth.getAttestedCredentialData().getCredentialId(); if (Arrays.equals(credentialId, context.getAuthenticationContext().getCredentialId())) { Authenticator authenticator = new AuthenticatorImpl( auth.getAttestedCredentialData(), auth.getAttestationStatement(), auth.getCount() ); WebAuthnAuthenticationContextValidationResponse response = webAuthnAuthenticationContextValidator.validate( context.getAuthenticationContext(), authenticator); logger.infov("response.getAuthenticatorData().getFlags() = {0}", response.getAuthenticatorData().getFlags()); long count = auth.getCount(); auth.setCount(count + 1); CredentialModel cred = createCredentialModel(auth); session.userCredentialManager().updateCredential(realm, user, cred); if(logger.isDebugEnabled()) { dumpCredentialModel(cred); dumpWebAuthnCredentialModel(auth); } return true; } } } catch (WebAuthnException wae) { wae.printStackTrace(); throw(wae); } return false; }
Source:
Mono<Response<Void>> deleteDigitalTwinWithResponse(String digitalTwinId, DeleteDigitalTwinRequestOptions options, Context context) { return protocolLayer .getDigitalTwins() .deleteWithResponseAsync(digitalTwinId, options.getIfMatch(), context); }

Target:
Mono<Response<Void>> deleteDigitalTwinWithResponse(String digitalTwinId, DeleteDigitalTwinRequestOptions options, Context context) { String ifMatch = options != null ? options.getIfMatch() : null; return protocolLayer .getDigitalTwins() .deleteWithResponseAsync(digitalTwinId, ifMatch, context); }
Source:
public static @Nonnull String getExecutable(@CheckForNull String name, @CheckForNull Node node, @Nullable TaskListener listener, @CheckForNull EnvVars env) throws IOException, InterruptedException { if (name != null) { Jenkins j = Jenkins.getInstance(); if (j != null) { for (DockerTool tool : j.getDescriptorByType(DescriptorImpl.class).getInstallations()) { if (tool.getName().equals(name)) { if (node != null) { tool = tool.forNode(node, listener); } if (env != null) { tool = tool.forEnvironment(env); } String home = Util.fixEmpty(tool.getHome()); if (home != null) { return home + "/bin/docker"; } } } } } return COMMAND; }

Target:
public static @Nonnull String getExecutable(@CheckForNull String name, @CheckForNull Node node, @Nullable TaskListener listener, @CheckForNull EnvVars env) throws IOException, InterruptedException { if (name != null) { Jenkins j = Jenkins.getInstance(); if (j != null) { for (DockerTool tool : j.getDescriptorByType(DescriptorImpl.class).getInstallations()) { if (tool.getName().equals(name)) { if (node != null) { tool = tool.forNode(node, listener); } if (env != null) { tool = tool.forEnvironment(env); } String home = Util.fixEmpty(tool.getHome()); if (home != null) { if (node != null) { FilePath homeFP = node.createPath(home); if (homeFP != null) { return homeFP.child("bin/docker").getRemote(); } } return home + "/bin/docker"; } } } } } return COMMAND; }
Source:
protected boolean isRegistered(final String uuid) { return handlers.containsKey(uuid) && !handlers.get(uuid).isEmpty(); }

Target:
protected boolean isRegistered(final String uuid) { return handlers.containsKey(uuid); }
Source:
public DataStream<RowData> getDataStream(StreamExecutionEnvironment execEnv) { List<HiveTablePartition> allHivePartitions = initAllPartitions(); @SuppressWarnings("unchecked") TypeInformation<RowData> typeInfo = (TypeInformation<RowData>) TypeInfoDataTypeConverter.fromDataTypeToTypeInfo(getProducedDataType()); HiveTableInputFormat inputFormat = getInputFormat( allHivePartitions, flinkConf.get(HiveOptions.TABLE_EXEC_HIVE_FALLBACK_MAPRED_READER)); if (isStreamingSource()) { if (catalogTable.getPartitionKeys().isEmpty()) { throw new UnsupportedOperationException( "Non-partition table not support streaming read now."); } return createStreamSource(execEnv, typeInfo, inputFormat); } else { return createBatchSource(execEnv, typeInfo, inputFormat); } }

Target:
public DataStream<RowData> getDataStream(StreamExecutionEnvironment execEnv) { List<HiveTablePartition> allHivePartitions = initAllPartitions(); @SuppressWarnings("unchecked") TypeInformation<RowData> typeInfo = (TypeInformation<RowData>) TypeInfoDataTypeConverter.fromDataTypeToTypeInfo(getProducedDataType()); HiveTableInputFormat inputFormat = getInputFormat( allHivePartitions, flinkConf.get(HiveOptions.TABLE_EXEC_HIVE_FALLBACK_MAPRED_READER)); if (isStreamingSource()) { if (catalogTable.getPartitionKeys().isEmpty()) { throw new UnsupportedOperationException( "Non-partition table does not support streaming read now."); } return createStreamSource(execEnv, typeInfo, inputFormat); } else { return createBatchSource(execEnv, typeInfo, inputFormat); } }
Source:
public void testTransitionProbabilities() { final double[] weights = MathUtils.normalizeFromRealSpace(new double[] {0.2, 0.2, 0.6, 0.1, 0.9, 0.1}); final double[] minorAlleleFractions = new double[] {0.1, 0.2, 0.3, 0.4, 0.23, 0.11}; final double memoryLength = 5e6; AlleleFractionHiddenMarkovModel model = new AlleleFractionHiddenMarkovModel(minorAlleleFractions, weights, memoryLength, AllelicPanelOfNormals.EMPTY_PON, NO_BIAS_OR_OUTLIERS_PARAMS); final int pos1 = 100; final int pos2 = (int) (pos1 + 100*memoryLength); final int pos3 = (int) (pos1 + memoryLength/1000); final SimpleInterval position1 = new SimpleInterval("chr1", pos1, pos1); final SimpleInterval position2 = new SimpleInterval("chr1", pos2, pos2); final SimpleInterval position3 = new SimpleInterval("chr1", pos3, pos3); for (int fromState = 0; fromState < weights.length; fromState++) { for (int toState = 0; toState < weights.length; toState++) { Assert.assertEquals(model.logTransitionProbability(fromState, position1, toState, position2), model.logPriorProbability(toState, position2), 1e-3); if (toState == fromState) { Assert.assertEquals(model.logTransitionProbability(fromState, position1, toState, position3), Math.log(1), 1e-3); } else { Assert.assertTrue(model.logTransitionProbability(fromState, position1, toState, position3) < Math.log(1e-3)); } } } }

Target:
public void testTransitionProbabilities() { final double[] weights = MathUtils.normalizeFromRealSpace(new double[] {0.2, 0.2, 0.6, 0.1, 0.9, 0.1}); final double[] minorAlleleFractions = new double[] {0.1, 0.2, 0.3, 0.4, 0.23, 0.11}; final double memoryLength = 5e6; final AlleleFractionHiddenMarkovModel model = new AlleleFractionHiddenMarkovModel(minorAlleleFractions, weights, memoryLength, AllelicPanelOfNormals.EMPTY_PON, NO_BIAS_OR_OUTLIERS_PARAMS); final int pos1 = 100; final int pos2 = (int) (pos1 + 100*memoryLength); final int pos3 = (int) (pos1 + memoryLength/1000); final SimpleInterval position1 = new SimpleInterval("chr1", pos1, pos1); final SimpleInterval position2 = new SimpleInterval("chr1", pos2, pos2); final SimpleInterval position3 = new SimpleInterval("chr1", pos3, pos3); for (int fromState = 0; fromState < weights.length; fromState++) { for (int toState = 0; toState < weights.length; toState++) { Assert.assertEquals(model.logTransitionProbability(fromState, position1, toState, position2), model.logPriorProbability(toState, position2), 1e-3); if (toState == fromState) { Assert.assertEquals(model.logTransitionProbability(fromState, position1, toState, position3), Math.log(1), 1e-3); } else { Assert.assertTrue(model.logTransitionProbability(fromState, position1, toState, position3) < Math.log(1e-3)); } } } }
Source:
public static Thread[] findThreadsByName(final String threadName) { if (threadName == null) { throw new IllegalArgumentException("The threadName must not be null"); } final Thread[] allThreads = getAllThreads(); final List<Thread> threads = new ArrayList<Thread>(); for (int i = 0; i < allThreads.length; i++) { final Thread thread = allThreads[i]; if (thread != null && threadName.equals(thread.getName())) { threads.add(thread); } } return threads.toArray(new Thread[threads.size()]); }

Target:
public static Collection<Thread> findThreadsByName(final String threadName) { return selectThreads(new NamePredicate(threadName)); }
Source:
public void readFromNbt(NBTTagCompound compound) { this.reset(); NBTTagList nbttaglist = compound.getTagList("Inventory", 10); this.inventory.readFromNBT(nbttaglist); final NBTTagCompound spongeCompound = compound.getCompoundTag(NbtDataUtil.FORGE_DATA).getCompoundTag(NbtDataUtil.SPONGE_DATA); CustomDataNbtUtil.readCustomData(spongeCompound, ((DataHolder) this)); if (!spongeCompound.hasNoTags()) { final NBTTagList spawnList = spongeCompound.getTagList(NbtDataUtil.USER_SPAWN_LIST, NbtDataUtil.TAG_COMPOUND); for (int i = 0; i < spawnList.tagCount(); i++) { final NBTTagCompound spawnCompound = spawnList.getCompoundTagAt(i); final UUID uuid = spawnCompound.getUniqueId(NbtDataUtil.UUID); if (uuid.getLeastSignificantBits() != 0 && uuid.getMostSignificantBits() != 0) { final double xPos = spawnCompound.getDouble(NbtDataUtil.USER_SPAWN_X); final double yPos = spawnCompound.getDouble(NbtDataUtil.USER_SPAWN_Y); final double zPos = spawnCompound.getDouble(NbtDataUtil.USER_SPAWN_Z); final boolean forced = spawnCompound.getBoolean(NbtDataUtil.USER_SPAWN_FORCED); this.spawnLocations.put(uuid, new RespawnLocation.Builder() .forceSpawn(forced) .position(new Vector3d(xPos, yPos, zPos)) .world(uuid) .build()); } } } }

Target:
public void readFromNbt(NBTTagCompound compound) { this.reset(); this.nbt = compound; final NBTTagCompound spongeCompound = compound.getCompoundTag(NbtDataUtil.FORGE_DATA).getCompoundTag(NbtDataUtil.SPONGE_DATA); CustomDataNbtUtil.readCustomData(spongeCompound, ((DataHolder) this)); if (!spongeCompound.hasNoTags()) { final NBTTagList spawnList = spongeCompound.getTagList(NbtDataUtil.USER_SPAWN_LIST, NbtDataUtil.TAG_COMPOUND); for (int i = 0; i < spawnList.tagCount(); i++) { final NBTTagCompound spawnCompound = spawnList.getCompoundTagAt(i); final UUID uuid = spawnCompound.getUniqueId(NbtDataUtil.UUID); if (uuid.getLeastSignificantBits() != 0 && uuid.getMostSignificantBits() != 0) { final double xPos = spawnCompound.getDouble(NbtDataUtil.USER_SPAWN_X); final double yPos = spawnCompound.getDouble(NbtDataUtil.USER_SPAWN_Y); final double zPos = spawnCompound.getDouble(NbtDataUtil.USER_SPAWN_Z); final boolean forced = spawnCompound.getBoolean(NbtDataUtil.USER_SPAWN_FORCED); this.spawnLocations.put(uuid, new RespawnLocation.Builder() .forceSpawn(forced) .position(new Vector3d(xPos, yPos, zPos)) .world(uuid) .build()); } } } }
Source:
public void onFinish(@NonNull final PageTitle title) { try { client.get(title.getText(), new BecauseYouReadClient.BecauseYouReadCallback() { @Override public void success(MwQueryResponse<BecauseYouReadClient.Pages> pages) { if (!fragment.isAdded()) { return; } fragment.addNewBecauseYouReadCard(title, pages); } @Override public void failure(Throwable t) { L.w("Error fetching 'because you read' suggestions", t); } }); } catch (IOException e) { L.w("Error fetching 'because you read' suggestions", e); } }

Target:
public void onFinish(@NonNull final PageTitle title) { try { new BecauseYouReadClient(title.getSite()).get(title.getText(), new BecauseYouReadClient.BecauseYouReadCallback() { @Override public void success(MwQueryResponse<BecauseYouReadClient.Pages> pages) { cb.success(title, pages); } @Override public void failure(Throwable t) { L.w("Error fetching 'because you read' suggestions", t); } }); } catch (IOException e) { L.w("Error fetching 'because you read' suggestions", e); } }
Source:
private boolean canCreateBrick(){ if (getItems() == null || getItems().isEmpty()) { return false; } boolean canCreateBrick = false; for (StorageDevice device : getItems()) { if (device.getCanCreateBrick()) { canCreateBrick = true; break; } } if (canCreateBrick) { List<StorageDevice> selectedDevices = getSelectedItems(); if (selectedDevices != null) { for (StorageDevice device : selectedDevices) { if(!device.getCanCreateBrick()){ canCreateBrick = false; break; } } } } return canCreateBrick; }

Target:
private boolean canCreateBrick(){ boolean canCreateBrick = false; List<StorageDevice> selectedDevices = getSelectedItems(); if (selectedDevices != null) { for (StorageDevice device : selectedDevices) { if (device.getCanCreateBrick()) { canCreateBrick = true; } else { canCreateBrick = false; break; } } } return canCreateBrick; }
Source:
public void getGIIEventsReturnsCorrectEvents() { HARegionQueue spy = spy(haRegionQueue); List<EventID> giiEvents; spy.positionBeforeGII = 1; spy.positionAfterGII = 4; HAEventWrapper wrapper1 = mock(HAEventWrapper.class); HAEventWrapper wrapper2 = mock(HAEventWrapper.class); when(wrapper1.getEventId()).thenReturn(id1); when(wrapper2.getEventId()).thenReturn(id2); Region.Entry entry1 = mock(Region.Entry.class); Region.Entry entry2 = mock(Region.Entry.class); Region.Entry entry3 = mock(Region.Entry.class); when(entry1.getValue()).thenReturn(wrapper1); when(entry3.getValue()).thenReturn(wrapper2); when(entry2.getValue()).thenReturn(id3); when(haRegion.getEntry(1L)).thenReturn(entry1); when(haRegion.getEntry(2L)).thenReturn(entry2); when(haRegion.getEntry(3L)).thenReturn(null); when(haRegion.getEntry(4L)).thenReturn(entry3); giiEvents = spy.getGIIEvents(); assertThat(giiEvents.size()).isEqualTo(2); assertThat(giiEvents.contains(id1)); assertThat(giiEvents.contains(id2)); }

Target:
public void getGIIEventsReturnsCorrectEvents() { HARegionQueue spy = spy(haRegionQueue); List<EventID> giiEvents; spy.positionBeforeGII = 1; spy.positionAfterGII = 4; HAEventWrapper wrapper1 = mock(HAEventWrapper.class); HAEventWrapper wrapper2 = mock(HAEventWrapper.class); when(wrapper1.getEventId()).thenReturn(id1); when(wrapper2.getEventId()).thenReturn(id2); Region.Entry<Object, Object> entry1 = uncheckedCast(mock(Region.Entry.class)); Region.Entry<Object, Object> entry2 = uncheckedCast(mock(Region.Entry.class)); Region.Entry<Object, Object> entry3 = uncheckedCast(mock(Region.Entry.class)); when(entry1.getValue()).thenReturn(wrapper1); when(entry2.getValue()).thenReturn(new Object()); when(entry3.getValue()).thenReturn(wrapper2); when(haRegion.getEntry(1L)).thenReturn(entry1); when(haRegion.getEntry(2L)).thenReturn(entry2); when(haRegion.getEntry(3L)).thenReturn(null); when(haRegion.getEntry(4L)).thenReturn(entry3); giiEvents = spy.getGIIEvents(); assertThat(giiEvents).containsExactlyInAnyOrder(id1, id2); }
Source:
public <ClusterID> ClusterClientFactory<ClusterID> getClusterClientFactory(final Configuration configuration) { checkNotNull(configuration); final List<ClusterClientFactory> compatibleFactories = new ArrayList<>(); final Iterator<ClusterClientFactory> factories = defaultLoader.iterator(); while (factories.hasNext()) { try { final ClusterClientFactory factory = factories.next(); if (factory != null && factory.isCompatibleWith(configuration)) { compatibleFactories.add(factory); } } catch (Throwable e) { if (e.getCause() instanceof NoClassDefFoundError) { LOG.info("Could not load factory due to missing dependencies."); } else { throw e; } } } if (compatibleFactories.size() > 1) { final List<String> configStr = configuration.toMap().entrySet().stream() .map(e -> e.getKey() + "=" + e.getValue()) .collect(Collectors.toList()); throw new IllegalStateException("Multiple compatible client factories found for:\n" + String.join("\n", configStr) + "."); } if (compatibleFactories.isEmpty()) { throw new IllegalStateException( "No ClusterClientFactory found to execute the application." + " If you were targeting a Yarn cluster, please make sure to have " + "hadoop in your classpath. For more information refer to the " + "\"Deployment & Operations\" section of the official Apache Flink documentation."); } return (ClusterClientFactory<ClusterID>) compatibleFactories.get(0); }

Target:
public <ClusterID> ClusterClientFactory<ClusterID> getClusterClientFactory(final Configuration configuration) { checkNotNull(configuration); final List<ClusterClientFactory> compatibleFactories = new ArrayList<>(); final Iterator<ClusterClientFactory> factories = defaultLoader.iterator(); while (factories.hasNext()) { try { final ClusterClientFactory factory = factories.next(); if (factory != null && factory.isCompatibleWith(configuration)) { compatibleFactories.add(factory); } } catch (Throwable e) { if (e.getCause() instanceof NoClassDefFoundError) { LOG.info("Could not load factory due to missing dependencies."); } else { throw e; } } } if (compatibleFactories.size() > 1) { final List<String> configStr = configuration.toMap().entrySet().stream() .map(e -> e.getKey() + "=" + e.getValue()) .collect(Collectors.toList()); throw new IllegalStateException("Multiple compatible client factories found for:\n" + String.join("\n", configStr) + "."); } if (compatibleFactories.isEmpty()) { throw new IllegalStateException( "No ClusterClientFactory found. If you were targeting a Yarn cluster, " + "please make sure to export the HADOOP_CLASSPATH environment variable or have hadoop in your " + "classpath. For more information refer to the \"Deployment & Operations\" section of the official " + "Apache Flink documentation."); } return (ClusterClientFactory<ClusterID>) compatibleFactories.get(0); }
Source:
public void testEnoughSpaceToMergeSnapshotsWithMultipleDiskAndDomains() { ArrayList<DiskImage> imagesDisks = mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID, 4); imagesDisks.addAll(mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID2, 4)); doReturn(imagesDisks).when(cmd).getSourceImages(); mockStorageDomainDAOGetForStoragePool(22, STORAGE_DOMAIN_ID); mockStorageDomainDAOGetForStoragePool(22, STORAGE_DOMAIN_ID2); assertTrue("Validation should succeed. Free space minus threshold should be bigger then summarize all disks size for each domain", cmd.isEnoughSpaceToMergeSnapshots()); }

Target:
public void testEnoughSpaceToMergeSnapshotsWithMultipleDiskAndDomains() { List<DiskImage> imagesDisks = mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID, IMAGE_ACTUAL_SIZE_GB); imagesDisks.addAll(mockMultipleSourceImagesForDomain(4, STORAGE_DOMAIN_ID2, IMAGE_ACTUAL_SIZE_GB)); doReturn(imagesDisks).when(cmd).getSourceImages(); mockStorageDomainDAOGetForStoragePool(22, STORAGE_DOMAIN_ID); mockStorageDomainDAOGetForStoragePool(22, STORAGE_DOMAIN_ID2); assertTrue("Validation should succeed. Free space minus threshold should be bigger then summarize all disks size for each domain", cmd.isEnoughSpaceToMergeSnapshots()); }
Source:
private String getLocalDateTime(Date modificationTime) {; SimpleDateFormat dt = new SimpleDateFormat("EEE LLL dd yyyy", Locale.getDefault()); return dt.format(modificationTime); }

Target:
private String getLocalDateTime(Date modificationTime) { SimpleDateFormat dt = new SimpleDateFormat("EEE LLL dd yyyy", Locale.getDefault()); return dt.format(modificationTime); }
Source:
public List<Address> listAddresses(List<String> names, EntityStatus status) { List<Address> results = null; Session session = null; Query query; try { session = DaoUtils.getSession(); if (names != null && !names.isEmpty()) { query = session.getNamedQuery("getAddress"); query.setParameterList("emailList", names); } else { query = session.getNamedQuery("getAddressByStatus"); } query.setParameter("status", status == null ? status : status.ordinal()); results = query.list(); if (results == null) { results = new ArrayList<>(); } log.debug("Addresses found: " + results.size()); } catch (Exception e) { log.error("Exception while getting the list of addresses: ", e); } finally { DaoUtils.closeSession(session); } return results; }

Target:
public List<Address> listAddresses(List<String> names, EntityStatus status) { List<Address> results = null; Session session = null; Query query; try { session = DaoUtils.getSession(); if (CollectionUtils.isNotEmpty(names)) { query = session.getNamedQuery("getAddress"); query.setParameterList("emailList", names); } else { query = session.getNamedQuery("getAddressByStatus"); } query.setParameter("status", status == null ? status : status.ordinal()); results = query.list(); if (results == null) { results = new ArrayList<>(); } log.debug("Addresses found: " + results.size()); } finally { DaoUtils.closeSession(session); } return results; }
Source:
public void testPushDownConstantFilterPredicate() { assertPlan( "SELECT sum(totalprice) FILTER(WHERE FALSE) FROM orders", anyTree( aggregation( ImmutableMap.of("sum_6", functionCall("sum", ImmutableList.of("totalprice"))), project( values("totalprice"))))); assertPlan( "SELECT sum(totalprice) FILTER(WHERE TRUE) FROM orders", anyTree( aggregation( ImmutableMap.of("sum", functionCall("sum", ImmutableList.of("sum_6"))), exchange( aggregation( ImmutableMap.of("sum_6", functionCall("sum", ImmutableList.of("totalprice"))), project( tableScan( "orders", ImmutableMap.of("totalprice", "totalprice")))))))); }

Target:
public void testPushDownConstantFilterPredicate() { assertPlanContainsNoFilter("SELECT sum(totalprice) FILTER(WHERE FALSE) FROM orders"); assertPlanContainsNoFilter("SELECT sum(totalprice) FILTER(WHERE TRUE) FROM orders"); }
Source:
public byte[] unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey) { return withContext(context -> client.unwrapKey(algorithm, encryptedKey, context)).block(); }

Target:
public KeyUnwrapResult unwrapKey(KeyWrapAlgorithm algorithm, byte[] encryptedKey) { return unwrapKey(algorithm, encryptedKey, Context.NONE); }
Source:
public void onApplicationEvent(ContextRefreshedEvent event) { ConfigurableApplicationContext ctx = (ConfigurableApplicationContext) event.getSource(); if (!ObjectUtils.isEmpty(this.properties.getProperties())) { for (PropertySource source : ctx.getEnvironment().getPropertySources()) { if (source instanceof EnumerablePropertySource) { EnumerablePropertySource e = (EnumerablePropertySource) source; for (String propertyName : e.getPropertyNames()) { RelaxedNames relaxedNames = new RelaxedNames(propertyName); outer: for (String relaxedPropertyName : relaxedNames) { if (isMatch(relaxedPropertyName, this.properties.getProperties(), null)) { whitelistedProperties.put(RelaxedPropertiesUtils.findCanonicalFormat(relaxedNames), source.getProperty(propertyName)); break outer; } } } } } } }

Target:
public void onApplicationEvent(ContextRefreshedEvent event) { ConfigurableApplicationContext ctx = (ConfigurableApplicationContext) event.getSource(); if (!ObjectUtils.isEmpty(this.properties.getProperties())) { for (PropertySource source : ctx.getEnvironment().getPropertySources()) { if (source instanceof EnumerablePropertySource) { EnumerablePropertySource e = (EnumerablePropertySource) source; for (String propertyName : e.getPropertyNames()) { RelaxedNames relaxedNames = new RelaxedNames(propertyName); relaxedLoop: for (String relaxedPropertyName : relaxedNames) { if (isMatch(relaxedPropertyName, this.properties.getProperties(), null)) { whitelistedProperties.put(RelaxedPropertiesUtils.findCanonicalFormat(relaxedNames), source.getProperty(propertyName)); break relaxedLoop; } } } } } } }