auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean handle(String[] args) throws RandoopTextuiException { try { String[] nonargs = foptions.parse(args); if (nonargs.length > 0) { throw new Options.ArgException("Unrecognized arguments: " + Arrays.toString(nonargs)); } } catch (Options.ArgException ae) { usage("while parsing command-line arguments: %s", ae.getMessage()); throw new RandoopTextuiException("See usage."); } if (Minimize.suitepath == null) { throw new RandoopTextuiException( "You must specify an input file path to the 'minimize' command. Use the --suitepath option."); } if (!FilenameUtils.getExtension(Minimize.suitepath).equals("java")) { throw new RandoopTextuiException("The input file must be a Java file."); } if (Minimize.testsuitetimeout <= 0) { throw new RandoopTextuiException("You must specify a positive timeout value."); } File originalFile = new File(suitepath); boolean success = false; try { success = mainMinimize(originalFile, suiteclasspath, testsuitetimeout, verboseminimizer); } catch (IOException e) { System.err.println("IOException: " + e.getMessage()); e.printStackTrace(); } return success; }

Target:
public boolean handle(String[] args) throws RandoopTextuiException { try { String[] nonargs = foptions.parse(args); if (nonargs.length > 0) { throw new Options.ArgException("Unrecognized arguments: " + Arrays.toString(nonargs)); } } catch (Options.ArgException ae) { throw new RandoopTextuiException(ae.getMessage()); } if (Minimize.suitepath == null) { throw new RandoopTextuiException("Use --suitepath to specify a file to be minimized."); } if (!FilenameUtils.getExtension(Minimize.suitepath).equals("java")) { throw new RandoopTextuiException("The input file must be a Java file: " + Minimize.suitepath); } if (Minimize.testsuitetimeout <= 0) { throw new RandoopTextuiException( "Timout must be positive, was given as " + Minimize.testsuitetimeout + "."); } if (Minimize.minimizetimeout <= 0) { throw new RandoopTextuiException( "Minimizer timout must be positive, was given as " + Minimize.minimizetimeout + "."); } final File originalFile = new File(suitepath); ExecutorService executor = Executors.newFixedThreadPool(1); Future<Boolean> future = executor.submit( new Callable<Boolean>() { @Override public Boolean call() throws IOException { return mainMinimize( originalFile, suiteclasspath, testsuitetimeout, verboseminimizer); } }); executor.shutdown(); boolean success = false; try { success = future.get(Minimize.minimizetimeout, TimeUnit.SECONDS); } catch (InterruptedException e) { System.err.println("Minimization process was interrupted."); } catch (ExecutionException e) { System.err.println("Minimizer exception: " + e.getCause()); } catch (TimeoutException e) { future.cancel(true); System.err.println("Minimization process timed out."); } try { if (!executor.awaitTermination(5, TimeUnit.SECONDS)) { executor.shutdownNow(); } } catch (InterruptedException e) { System.err.println("Minimization process force terminated."); } return success; }
Source:
public void filter(ContainerRequestContext requestContext) throws IOException { if (GrillServices.get().isStopping()) { requestContext.abortWith(Response.status(Status.SERVICE_UNAVAILABLE) .entity("Server is going down").build()); } }

Target:
public void filter(ContainerRequestContext requestContext) throws IOException { if (GrillServices.get().isStopping() || GrillServices.get().getServiceState().equals(STATE.NOTINITED) || GrillServices.get().getServiceState().equals(STATE.STOPPED)) { requestContext.abortWith(Response.status(Status.SERVICE_UNAVAILABLE) .entity("Server is going down or is getting initialized").build()); } }
Source:
public void onClusterRoleChange(TopologyDescriptor newTopology) { if (localClusterDescriptor.getRole() == ClusterRole.ACTIVE) { stopLogReplication(); } updateLocalTopology(newTopology); logReplicationMetadataManager.setupTopologyConfigId(topologyDescriptor.getTopologyConfigId()); log.debug("Persist new topologyConfigId {}, cluster id={}, status={}", topologyDescriptor.getTopologyConfigId(), localClusterDescriptor.getClusterId(), localClusterDescriptor.getRole()); updateReplicationManagerTopology(newTopology); interClusterReplicationService.getLogReplicationServer().getSinkManager() .updateTopologyConfigId(topologyDescriptor.getTopologyConfigId()); interClusterReplicationService.getLogReplicationServer().getSinkManager().reset(); logReplicationServerHandler.setActive(localClusterDescriptor.getRole().equals(ClusterRole.ACTIVE)); if (isLeader.get()) { onLeadershipAcquire(); } }

Target:
public void onClusterRoleChange(TopologyDescriptor newTopology) { if (localClusterDescriptor.getRole() == ClusterRole.ACTIVE) { stopLogReplication(); } updateLocalTopology(newTopology); logReplicationMetadataManager.setupTopologyConfigId(topologyDescriptor.getTopologyConfigId()); log.debug("Persist new topologyConfigId {}, cluster id={}, role={}", topologyDescriptor.getTopologyConfigId(), localClusterDescriptor.getClusterId(), localClusterDescriptor.getRole()); updateReplicationManagerTopology(newTopology); interClusterReplicationService.getLogReplicationServer().getSinkManager() .updateTopologyConfigId(topologyDescriptor.getTopologyConfigId()); interClusterReplicationService.getLogReplicationServer().getSinkManager().reset(); logReplicationServerHandler.setActive(localClusterDescriptor.getRole().equals(ClusterRole.ACTIVE)); if (isLeader.get()) { onLeadershipAcquire(); } }
Source:
public QueryResult query(final Query query) { Call<QueryResult> call; if (query.requiresPost()) { call = this.influxDBService.postQuery(this.username, this.password, query.getDatabase(), query.getCommand()); } else { String encodedCommand = UrlEscapers.urlFormParameterEscaper().escape(query.getCommand()); call = this.influxDBService.query(this.username, this.password, query.getDatabase(), encodedCommand); } return execute(call); }

Target:
public QueryResult query(final Query query) { Call<QueryResult> call; if (query.requiresPost()) { call = this.influxDBService.postQuery(this.username, this.password, query.getDatabase(), query.getCommandWithUrlEncoded()); } else { call = this.influxDBService.query(this.username, this.password, query.getDatabase(), query.getCommandWithUrlEncoded()); } return execute(call); }
Source:
protected boolean updateSelection(IStructuredSelection selection) { BuildState buildState = BuildState.STOPPED; if (selection.getFirstElement() instanceof IBuildPlan) { IBuildPlan buildPlan = (IBuildPlan) selection.getFirstElement(); return buildPlan.getState() == BuildState.RUNNING; } return false; }

Target:
protected boolean updateSelection(IStructuredSelection selection) { if (selection.getFirstElement() instanceof IBuildPlan) { IBuildPlan buildPlan = (IBuildPlan) selection.getFirstElement(); return buildPlan.getState() == BuildState.RUNNING; } return false; }
Source:
protected Result check() throws Exception { return Result.healthy(); }

Target:
protected Result check() throws Exception { if (this.metricRegistry.getMeters().get(AbstractAsyncProducer.failedMessageMeterName).getFifteenMinuteRate() > 0) { return Result.unhealthy(">1 messages failed to be sent to Kafka in the past 15minutes"); } else { return Result.healthy(); } }
Source:
public EventsRegistry events() { if (events == null) { throw new IllegalStateException("An EventFiringWebDriver instance is required to use events. " + "You should set 'eventsEnabled' configuration property to 'true' " + "or override newWebDriver() to FluentDriver an EventFiringWebDriver."); } return events; }

Target:
public EventsRegistry events() { if (events == null) { throw new IllegalStateException("An EventFiringWebDriver instance is required to use events. " + "You should set 'eventsEnabled' configuration property to 'true' " + "or override newWebDriver() to build an EventFiringWebDriver."); } return events; }
Source:
private String calculateCommandName(String value) { StringBuilder builder = new StringBuilder(); int commandIndex = value.toLowerCase().indexOf("command"); if (commandIndex != -1) { value = value.substring(0, commandIndex); } if (Strings.isNullOrEmpty(value)) { throw new IllegalArgumentException("It isn't possible to parse a null value"); } if (Character.isUpperCase(value.charAt(0))) { value = value.replace(value.charAt(0), Character.toLowerCase(value.charAt(0))); } for (int index = 0; index < value.length(); index++) { char charValue = value.charAt(index); if (Character.isUpperCase(charValue)) { builder.append("-").append(Character.toLowerCase(charValue)); } else { builder.append(charValue); } } return builder.toString(); }

Target:
static String calculateCommandName(String value) { StringBuilder builder = new StringBuilder(); if (Strings.isNullOrEmpty(value)) { throw new IllegalArgumentException("It isn't possible to parse a null value"); } if (value.toLowerCase().endsWith("command")) { value = value.substring(0, value.toLowerCase().lastIndexOf("command")); } value = value .replaceFirst(Character.toString(value.charAt(0)), Character.toString(value.charAt(0)).toLowerCase()); for (int index = 0; index < value.length(); index++) { char charValue = value.charAt(index); if (index > 0 && Character.isUpperCase(charValue) && Character.isLowerCase(value.charAt(index - 1))) { builder.append("-").append(Character.toLowerCase(charValue)); } else { builder.append(Character.toLowerCase(charValue)); } } return builder.toString(); }
Source:
public boolean removeServer(QueryableDruidServer server) { synchronized (this) { Set<QueryableDruidServer> priorityServers; if (server.getServer().getType() == ServerType.REALTIME) { priorityServers = realtimeServers.computeIfAbsent( server.getServer().getPriority(), p -> new HashSet<>());; } else { priorityServers = historicalServers.computeIfAbsent( server.getServer().getPriority(), p -> new HashSet<>()); } if (priorityServers == null) { return false; } return priorityServers.remove(server); } }

Target:
public boolean removeServer(QueryableDruidServer server) { synchronized (this) { Int2ObjectRBTreeMap<Set<QueryableDruidServer>> servers; Set<QueryableDruidServer> priorityServers; int priority = server.getServer().getPriority(); if (server.getServer().getType() == ServerType.HISTORICAL) { servers = historicalServers; priorityServers = historicalServers.get(priority); } else { servers = realtimeServers; priorityServers = realtimeServers.get(priority); } if (priorityServers == null) { return false; } boolean result = priorityServers.remove(server); if (priorityServers.isEmpty()) { servers.remove(priority); } return result; } }
Source:
public void sortChildren(String inode) throws DotDataException { inode = SQLUtil.sanitizeParameter( inode ); Statement s = null; Connection conn = null; ResultSet rs = null; try { CategorySQL catSQL= CategorySQL.getInstance(); conn = DbConnectionFactory.getDataSource().getConnection(); conn.setAutoCommit(false); s = conn.createStatement(); String sql = ""; sql = catSQL.getCreateSortChildren(inode); s.executeUpdate( sql ); sql = catSQL.getUpdateSort(); s.executeUpdate( sql ); sql = catSQL.getDropSort(); s.executeUpdate(sql); conn.commit(); sql = catSQL.getSortedChildren(inode); rs = s.executeQuery(sql); while(rs.next()) { Category cat = null; try { cat = (Category) HibernateUtil.load(Category.class, rs.getString("inode")); } catch (DotHibernateException e) { if(!(e.getCause() instanceof ObjectNotFoundException)) throw e; } if(cat != null) try { catCache.put(cat); } catch (DotCacheException e) { throw new DotDataException(e.getMessage(), e); } } } catch (SQLException e) { try { conn.rollback(); } catch (SQLException e1) { e1.printStackTrace(); } e.printStackTrace(); } finally { try { rs.close(); s.close(); conn.close(); } catch (SQLException e) { e.printStackTrace(); } } }

Target:
public void sortChildren(String inode) throws DotDataException { Statement statement = null; Connection conn = null; ResultSet rs = null; try { CategorySQL catSQL= CategorySQL.getInstance(); conn = DbConnectionFactory.getDataSource().getConnection(); conn.setAutoCommit(false); statement = conn.createStatement(); String sql; PreparedStatement createSortPreparedStatement = conn.prepareStatement( catSQL.getCreateSortChildren() ); createSortPreparedStatement.setString( 1, inode ); createSortPreparedStatement.executeUpdate(); sql = catSQL.getUpdateSort(); statement.executeUpdate( sql ); sql = catSQL.getDropSort(); statement.executeUpdate(sql); conn.commit(); PreparedStatement getSortedPreparedStatement = conn.prepareStatement( catSQL.getSortedChildren() ); getSortedPreparedStatement.setString( 1, inode ); rs = getSortedPreparedStatement.executeQuery(); putResultInCatCache( rs ); } catch (SQLException e) { try { conn.rollback(); } catch (SQLException sqlException) { Logger.debug( this, "Error trying to rollback connection", sqlException ); } Logger.debug( this, "Error trying to execute statements", e ); } finally { closeEverything( statement, conn, rs ); } }
Source:
public static DbKeyValueServiceConfig getKvsConfig() { DockerPort port = docker.containers() .container("postgres") .port(POSTGRES_PORT_NUMBER); InetSocketAddress postgresAddress = new InetSocketAddress(port.getIp(), port.getExternalPort()); ConnectionConfig connectionConfig = ImmutablePostgresConnectionConfig.builder() .dbName("atlas") .dbLogin("palantir") .dbPassword(ImmutableMaskedValue.of("palantir")) .host(postgresAddress.getHostName()) .port(postgresAddress.getPort()) .build(); return ImmutableDbKeyValueServiceConfig.builder() .connection(connectionConfig) .ddl(ImmutablePostgresDdlConfig.builder() .compactInterval(HumanReadableDuration.milliseconds(10)) .build()) .build(); }

Target:
public static DbKeyValueServiceConfig getKvsConfig() { DockerPort port = docker.containers() .container("postgres") .port(POSTGRES_PORT_NUMBER); InetSocketAddress postgresAddress = new InetSocketAddress(port.getIp(), port.getExternalPort()); ConnectionConfig connectionConfig = ImmutablePostgresConnectionConfig.builder() .dbName("atlas") .dbLogin("palantir") .dbPassword(ImmutableMaskedValue.of("palantir")) .host(postgresAddress.getHostName()) .port(postgresAddress.getPort()) .build(); return ImmutableDbKeyValueServiceConfig.builder() .connection(connectionConfig) .ddl(ImmutablePostgresDdlConfig.builder() .compactInterval(HumanReadableDuration.days(2)) .build()) .build(); }
Source:
private void updatePreviousEmailDraft(String previousEmailId, String subject, List<String> addressReceiver, List<String> groupReceiver, String content ) { AdminEmailAttributes newDraft = AdminEmailAttributes .builder(subject, addressReceiver, groupReceiver, new Text(content)) .withSendDate(null) .build(); try { logic.updateAdminEmailById(newDraft, previousEmailId); } catch (InvalidParametersException | EntityDoesNotExistException e) { isError = true; setStatusForException(e); } }

Target:
private void updatePreviousEmailDraft(String previousEmailId, String subject, List<String> addressReceiver, List<String> groupReceiver, String content ) { AdminEmailAttributes newDraft = AdminEmailAttributes .builder(subject, addressReceiver, groupReceiver, new Text(content)) .build(); try { logic.updateAdminEmailById(newDraft, previousEmailId); } catch (InvalidParametersException | EntityDoesNotExistException e) { isError = true; setStatusForException(e); } }
Source:
private void bindPositional(Binding params, PreparedStatement statement) { int paramCount = stmt.getParams().size(); for (int i = 0; i < paramCount; i++) { int index = i; Argument a = params.findForPosition(i) .orElseThrow(() -> { String msg = String.format("Unable to execute, no positional parameter bound at position %s", index); return new UnableToExecuteStatementException(msg, context); }); try { a.apply(i + 1, statement, this.context); } catch (SQLException e) { throw new UnableToExecuteStatementException( String.format("Exception while binding positional param at (0 based) position %d", i), e, context); } } }

Target:
private void bindPositional(Binding params, PreparedStatement statement) { for (int i = 0; i < stmt.getParams().size(); i++) { int index = i; try { params.findForPosition(i) .orElseThrow(() -> new UnableToExecuteStatementException( "Unable to execute, no positional parameter bound at position " + index, context)) .apply(i + 1, statement, context); } catch (SQLException e) { throw new UnableToExecuteStatementException( "Exception while binding positional param at (0 based) position " + i, e, context); } } }
Source:
private void handleChannel(String[] args, Iterator<String> iter, String name) { List<String> commands = new ArrayList<>(); String line = iter.next(); while (!line.equals("}")) { commands.add(line); line = iter.next(); } Payload initialPayload = new PayloadImpl(args[1], args[2]); TestSubscriber<Payload> testsub = new TestSubscriber<>(1L); ParseChannel superpc = null; CountDownLatch c = new CountDownLatch(1); ReactiveSocket client = createClient.get(); PCTWrapper mypct = new PCTWrapper(); Publisher<Payload> pub = client.requestChannel(new Publisher<Payload>() { @Override public void subscribe(Subscriber<? super Payload> s) { ParseMarble pm = new ParseMarble(s); TestSubscription ts = new TestSubscription(pm, initialPayload, s); s.onSubscribe(ts); ParseChannel pc = new ParseChannel(commands, testsub, pm, name); ParseChannelThread pct = new ParseChannelThread(pc); pct.start(); mypct.set(pct); c.countDown(); } }); pub.subscribe(testsub); try { c.await(); } catch (InterruptedException e) { System.out.println("interrupted"); } mypct.get().join(); }

Target:
private void handleChannel(String[] args, Iterator<String> iter, String name) { List<String> commands = new ArrayList<>(); String line = iter.next(); while (!line.equals("}")) { commands.add(line); line = iter.next(); } Payload initialPayload = new PayloadImpl(args[1], args[2]); TestSubscriber<Payload> testsub = new TestSubscriber<>(1L); ParseChannel superpc = null; CountDownLatch c = new CountDownLatch(1); ReactiveSocket client = createClient.get(); AtomicReference<ParseChannelThread> mypct = new AtomicReference<>(); Publisher<Payload> pub = client.requestChannel(new Publisher<Payload>() { @Override public void subscribe(Subscriber<? super Payload> s) { ParseMarble pm = new ParseMarble(s); TestSubscription ts = new TestSubscription(pm, initialPayload, s); s.onSubscribe(ts); ParseChannel pc = new ParseChannel(commands, testsub, pm, name); ParseChannelThread pct = new ParseChannelThread(pc); pct.start(); mypct.set(pct); c.countDown(); } }); pub.subscribe(testsub); try { c.await(); } catch (InterruptedException e) { System.out.println("interrupted"); } mypct.get().join(); }
Source:
public void setUp() throws Exception { AbstractProject<?, ?> project = jenkinsRule.createFreeStyleProject("GhprbRepoTest"); project.addProperty(new GithubProjectProperty("<LINK_0>" + TEST_REPO_NAME)); trigger = GhprbTestUtil.getTrigger(null); doReturn(gt).when(trigger).getGitHub(); given(gt.getRepository(anyString())).willReturn(ghRepository); GHRateLimit initRateLimit = new GHRateLimit(); initRateLimit.limit = 5000; given(gt.getRateLimit()).willReturn(initRateLimit); trigger.start(project, true); trigger.setHelper(helper); pulls = new ConcurrentHashMap<Integer, GhprbPullRequest>(); doReturn(mock(QueueTaskFuture.class)).when(trigger).scheduleBuild(any(GhprbCause.class), any(GhprbRepository.class)); initGHPRWithTestData(); given(ghPullRequest.getUser()).willReturn(ghUser); given(helper.getGitHub()).willReturn(gitHub); given(helper.getTrigger()).willReturn(trigger); given(gt.getRepository(anyString())).willReturn(ghRepository); given(gt.getRateLimit()).willReturn(ghRateLimit); increaseRateLimitToDefaults(); addSimpleStatus(); }

Target:
public void setUp() throws Exception { project = jenkinsRule.createFreeStyleProject("GhprbRepoTest"); project.addProperty(new GithubProjectProperty("<LINK_0>" + TEST_REPO_NAME)); getNewTrigger(); startTrigger(); pulls = new ConcurrentHashMap<Integer, GhprbPullRequest>(); doReturn(mock(QueueTaskFuture.class)).when(trigger).scheduleBuild(any(GhprbCause.class), any(GhprbRepository.class)); initGHPRWithTestData(); given(ghPullRequest.getUser()).willReturn(ghUser); given(helper.getGitHub()).willReturn(gitHub); given(helper.getTrigger()).willReturn(trigger); addSimpleStatus(); }
Source:
public boolean isNetworkLinkCreated(String networkId, PagedList<VirtualNetworkLinkInner> virtualNetworkLinks) { return virtualNetworkLinks.stream() .filter(networkLink -> networkId.equals(networkLink.name())) .anyMatch(networkLink -> networkLink.provisioningState() == SUCCEEDED && networkLink.virtualNetworkLinkState() == VirtualNetworkLinkState.COMPLETED); }

Target:
public boolean isNetworkLinkCreated(String networkId, PagedList<VirtualNetworkLinkInner> virtualNetworkLinks) { return virtualNetworkLinks.stream() .filter(networkLink -> networkId.equals(networkLink.name())) .anyMatch(networkLink -> networkLink.provisioningState().equals(SUCCEEDED) && networkLink.virtualNetworkLinkState().equals(VirtualNetworkLinkState.COMPLETED)); }
Source:
public Void call() throws Exception { LOGGER.info("\n\nThread Starting " + threadName + " ; '" + query.getStatement() + "' for " + numberOfExecutions + " times\n\n"); Long start = EnvironmentEdgeManager.currentTimeMillis(); for (long i = 0; i < numberOfExecutions; i++) { if ((EnvironmentEdgeManager.currentTimeMillis() - start) >= executionDurationInMs) { LOGGER.info("Queryset timeout of " + executionDurationInMs + " ms reached; current time is " + ((EnvironmentEdgeManager.currentTimeMillis() - start)) + " ms." + "\nStopping queryset execution for query " + query.getId() + " on thread " + threadName + "..."); break; } synchronized (workloadExecutor) { if (!timedQuery(i+1)) { break; } if ((EnvironmentEdgeManager.currentTimeMillis() - lastResultWritten) > 1000) { resultManager.write(dataModelResult, ruleApplier); lastResultWritten = EnvironmentEdgeManager.currentTimeMillis(); } } } synchronized (workloadExecutor) { resultManager.flush(); } LOGGER.info("\n\nThread exiting." + threadName + "\n\n"); return null; }

Target:
public Void call() throws Exception { LOGGER.info("\n\nThread Starting " + threadName + " ; '" + query.getStatement() + "' for " + numberOfExecutions + " times\n\n"); Long threadStartTime = EnvironmentEdgeManager.currentTimeMillis(); for (long i = 0; i < numberOfExecutions; i++) { long threadElapsedTime = EnvironmentEdgeManager.currentTimeMillis() - threadStartTime; if (threadElapsedTime >= executionDurationInMs) { LOGGER.info("Queryset timeout of " + executionDurationInMs + " ms reached; current time is " + threadElapsedTime + " ms." + "\nStopping queryset execution for query " + query.getId() + " on thread " + threadName + "..."); break; } synchronized (workloadExecutor) { if (!timedQuery(i+1)) { break; } if ((EnvironmentEdgeManager.currentTimeMillis() - lastResultWritten) > 1000) { resultManager.write(dataModelResult, ruleApplier); lastResultWritten = EnvironmentEdgeManager.currentTimeMillis(); } } } synchronized (workloadExecutor) { resultManager.flush(); } LOGGER.info("\n\nThread exiting." + threadName + "\n\n"); return null; }
Source:
private BeanDefinition getOAuth2OidcAuthProvider(Element element, BeanMetadataElement accessTokenResponseClient, String oauth2UserAuthMapperRef, ParserContext parserContext) { BeanDefinition oauth2OidcAuthProvider = null; boolean oidcAuthenticationProviderEnabled = ClassUtils .isPresent("org.springframework.security.oauth2.jwt.JwtDecoder", this.getClass().getClassLoader()); if (oidcAuthenticationProviderEnabled) { BeanMetadataElement oidcUserService = getOAuth2OidcUserService(element); BeanDefinitionBuilder oauth2OidcAuthProviderBuilder = BeanDefinitionBuilder.rootBeanDefinition( "org.springframework.security.oauth2.client.oidc.authentication.OidcAuthorizationCodeAuthenticationProvider") .addConstructorArgValue(accessTokenResponseClient).addConstructorArgValue(oidcUserService); if (!StringUtils.isEmpty(oauth2UserAuthMapperRef)) { oauth2OidcAuthProviderBuilder.addPropertyReference("authoritiesMapper", oauth2UserAuthMapperRef); } String jwtDecoderFactoryRef = element.getAttribute(ATT_JWT_DECODER_FACTORY_REF); if (!StringUtils.isEmpty(jwtDecoderFactoryRef)) { oauth2OidcAuthProviderBuilder.addPropertyReference("jwtDecoderFactory", jwtDecoderFactoryRef); } oauth2OidcAuthProvider = oauth2OidcAuthProviderBuilder.getBeanDefinition(); } else { oauth2OidcAuthProvider = BeanDefinitionBuilder.rootBeanDefinition( "org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer.OidcAuthenticationRequestChecker") .getBeanDefinition(); } return oauth2OidcAuthProvider; }

Target:
private BeanDefinition getOAuth2OidcAuthProvider(Element element, BeanMetadataElement accessTokenResponseClient, String oauth2UserAuthMapperRef, ParserContext parserContext) { BeanDefinition oauth2OidcAuthProvider = null; boolean oidcAuthenticationProviderEnabled = ClassUtils .isPresent("org.springframework.security.oauth2.jwt.JwtDecoder", this.getClass().getClassLoader()); if (oidcAuthenticationProviderEnabled) { BeanMetadataElement oidcUserService = getOAuth2OidcUserService(element); BeanDefinitionBuilder oauth2OidcAuthProviderBuilder = BeanDefinitionBuilder.rootBeanDefinition( "org.springframework.security.oauth2.client.oidc.authentication.OidcAuthorizationCodeAuthenticationProvider") .addConstructorArgValue(accessTokenResponseClient).addConstructorArgValue(oidcUserService); if (!StringUtils.isEmpty(oauth2UserAuthMapperRef)) { oauth2OidcAuthProviderBuilder.addPropertyReference("authoritiesMapper", oauth2UserAuthMapperRef); } String jwtDecoderFactoryRef = element.getAttribute(ATT_JWT_DECODER_FACTORY_REF); if (!StringUtils.isEmpty(jwtDecoderFactoryRef)) { oauth2OidcAuthProviderBuilder.addPropertyReference("jwtDecoderFactory", jwtDecoderFactoryRef); } oauth2OidcAuthProvider = oauth2OidcAuthProviderBuilder.getBeanDefinition(); } else { oauth2OidcAuthProvider = BeanDefinitionBuilder.rootBeanDefinition(OidcAuthenticationRequestChecker.class) .getBeanDefinition(); } return oauth2OidcAuthProvider; }
Source:
public TranslationsSpinnerAdapter(Context context, int resource, String[] translationNames, List<LocalTranslation> translations, Set<String> selectedItems, OnSelectionChangedListener listener) { super(context, resource, new ArrayList<>()); this.layoutInflater = LayoutInflater.from(context); List<String> transList = new ArrayList<String>(Arrays.asList(translationNames)); transList.add("More Translations"); translationNames = transList.toArray(new String[transList.size()]); this.translationNames = translationNames; this.translations = translations; this.selectedItems = selectedItems; this.listener = listener; addAll(translationNames); }

Target:
public TranslationsSpinnerAdapter(Context context, int resource, String[] translationNames, List<LocalTranslation> translations, Set<String> selectedItems, OnSelectionChangedListener listener) { super(context, resource, new ArrayList<>()); this.context = context; this.layoutInflater = LayoutInflater.from(this.context); translationNames = updateTranslationNames(translationNames); this.translationNames = translationNames; this.translations = translations; this.selectedItems = selectedItems; this.listener = listener; addAll(translationNames); }
Source:
public void edit(final VolumeRebalanceStatusModel object) { driver.edit(object); rebalanceHostsTable.asEditor().edit(object.getRebalanceSessions()); object.getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { PropertyChangedEventArgs e = (PropertyChangedEventArgs) args; if(e.PropertyName.equals("IS_STATUS_APPLICABLE")) { Label completedStatus = new Label(); completedStatus.setText(constants.rebalanceComplete()); completedStatus.getElement().getStyle().setPaddingTop(36, Unit.PX); completedStatus.getElement().getStyle().setFontSize(14, Unit.PX); completedStatus.getElement().getStyle().setFontWeight(FontWeight.BOLD); completedStatus.setVisible(object.isStatusAvailable()); status.add(completedStatus); } else if(e.PropertyName.equals("IS_STOP_TIME_APPLICABLE")) { sdPanel.setSize("1000px", "550px"); sPanel.setSize("981px", "415px"); vPanel2.remove(clusterEditor); vPanel2.remove(statusTimeEditor); stopTime.setLabel(constants.rebalanceStopTime()); stopTime.getElement().getStyle().setPaddingTop(30, Unit.PX); vPanel2.add(stopTime); status.add(clusterEditor); status.add(statusTimeEditor); } } }); }

Target:
public void edit(final VolumeRebalanceStatusModel object) { driver.edit(object); rebalanceHostsTable.asEditor().edit(object.getRebalanceSessions()); object.getPropertyChangedEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { PropertyChangedEventArgs e = (PropertyChangedEventArgs) args; if(e.PropertyName.equals("IS_STATUS_APPLICABLE")) { Label completedStatus = new Label(); completedStatus.setText(constants.rebalanceComplete()); completedStatus.getElement().getStyle().setPaddingTop(36, Unit.PX); completedStatus.getElement().getStyle().setFontSize(14, Unit.PX); completedStatus.getElement().getStyle().setFontWeight(FontWeight.BOLD); completedStatus.setVisible(object.isStatusAvailable()); status.add(completedStatus); } else if(e.PropertyName.equals("IS_STOP_TIME_APPLICABLE")) { statusOrStopTimePanel.remove(clusterEditor); statusOrStopTimePanel.remove(statusTimeEditor); stopTime.setLabel(constants.rebalanceStopTime()); stopTime.getElement().getStyle().setPaddingTop(30, Unit.PX); statusOrStopTimePanel.add(stopTime); status.add(clusterEditor); status.add(statusTimeEditor); } } }); }
Source:
public void flip(final long x) { int high = RoaringIntPacking.high(x); BitmapDataProvider lowBitmap = highToBitmap.get(high); if (lowBitmap == null) { addLong(x); } else { int low = RoaringIntPacking.low(x); if (lowBitmap instanceof RoaringBitmap) { ((RoaringBitmap) lowBitmap).flip(low); } else if (lowBitmap instanceof MutableRoaringBitmap) { ((MutableRoaringBitmap) lowBitmap).flip(low); } else { if (lowBitmap.contains(low)) { lowBitmap.remove(low); } else { lowBitmap.add(low); } } } }

Target:
public void flip(final long x) { int high = RoaringIntPacking.high(x); BitmapDataProvider lowBitmap = highToBitmap.get(high); if (lowBitmap == null) { addLong(x); } else { int low = RoaringIntPacking.low(x); if (lowBitmap instanceof RoaringBitmap) { ((RoaringBitmap) lowBitmap).flip(low); } else if (lowBitmap instanceof MutableRoaringBitmap) { ((MutableRoaringBitmap) lowBitmap).flip(low); } else { if (lowBitmap.contains(low)) { lowBitmap.remove(low); } else { lowBitmap.add(low); } } } invalidateAboveHigh(high); }
Source:
public void onListItemClick(ListView l, View v, int position, long id) { ActivityEntry item = (ActivityEntry) l.getItemAtPosition(position); if (item.getType() != null && item.getType().startsWith(ActivityEventAdapter.PREFIX_DATALIST) || item.getType().startsWith(ActivityEventAdapter.PREFIX_FOLDER)) { return; } String identifier = item.getData(CloudConstant.NODEREF_VALUE); if (identifier == null) { identifier = item.getData(CloudConstant.OBJECTID_VALUE); } if (identifier != null && !"org.alfresco.documentlibrary.file-deleted".equals(item.getType())) { NodeLoaderCallback call = new NodeLoaderCallback(getActivity(), alfSession, identifier); LoaderManager lm = getLoaderManager(); lm.restartLoader(NodeLoader.ID, null, call); lm.getLoader(NodeLoader.ID).forceLoad(); DisplayUtils.switchSingleOrTwo(getActivity(), true); } }

Target:
public void onListItemClick(ListView l, View v, int position, long id) { ActivityEntry item = (ActivityEntry) l.getItemAtPosition(position); if (item.getType() != null && item.getType().startsWith(ActivityEventAdapter.PREFIX_DATALIST) || item.getType().startsWith(ActivityEventAdapter.PREFIX_FOLDER)) { return; } String identifier = item.getData(CloudConstant.NODEREF_VALUE); if (identifier == null) { identifier = item.getData(CloudConstant.OBJECTID_VALUE); } if (identifier != null && !TYPE_FILE_DELETE.equals(item.getType())) { NodeLoaderCallback call = new NodeLoaderCallback(getActivity(), alfSession, identifier); LoaderManager lm = getLoaderManager(); lm.restartLoader(NodeLoader.ID, null, call); lm.getLoader(NodeLoader.ID).forceLoad(); DisplayUtils.switchSingleOrTwo(getActivity(), true); } }
Source:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true); builder.clustering().stateTransfer().chunkSize(32); createClusteredCaches(2, cacheName(), builder); }

Target:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true); builder.clustering().stateTransfer().chunkSize(2); createClusteredCaches(2, cacheName(), builder); }
Source:
public boolean removeDnsSupportForSubnet(Network network) throws ResourceUnavailableException { if (_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, getProvider())) { return true; } else { return deleteDhcpSupportForSubnet(network, Service.Dns); } }

Target:
public boolean removeDnsSupportForSubnet(Network network) throws ResourceUnavailableException { if (_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, getProvider())) { return true; } else { return removeDhcpSupportForSubnet(network, Service.Dns); } }
Source:
public BulkLoaderVertexProgram create(final Graph... graphs) { if (graphs.length == 0) { throw new IllegalStateException("Must provide at least one graph to use"); } ConfigurationUtils.append(graphs[0].configuration().subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX), configuration); return (BulkLoaderVertexProgram) VertexProgram.createVertexProgram(configuration, graphs); }

Target:
public BulkLoaderVertexProgram create(final Graph... graphs) { if (graphs.length == 0) { throw new IllegalArgumentException("Must provide at least one graph to use"); } ConfigurationUtils.append(graphs[0].configuration().subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX), configuration); return (BulkLoaderVertexProgram) VertexProgram.createVertexProgram(configuration, graphs); }
Source:
public PowerUpSpawner(PlayingField pf) { this.pf = pf; this.intervalTicks = settings.getInteger("POWERUP_SPAWN_INTERVAL") * pf.getFPS(); this.tickCounter = 0; this.minX = 0; this.maxX = pf.getWidth(); this.log = Log.getLogger(); pf.getGameThread().registerListener(this); }

Target:
public PowerUpSpawner(PlayingField pf) { this.pf = pf; this.intervalTicks = getInterval() * pf.getFPS(); this.tickCounter = 0; this.minX = 0; this.maxX = (int) pf.getWidth(); this.log = Log.getLogger(); pf.getGameThread().registerListener(this); }
Source:
public DatastoreProvider initiateService(SessionFactoryImplementor sessionFactory, Configuration configuration, ServiceRegistryImplementor registry) { ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configuration ); DatastoreProvider datastoreProvider = propertyReader.propertyByType( OgmProperties.DATASTORE_PROVIDER, DatastoreProvider.class ) .withClassLoaderService( registry.getService( ClassLoaderService.class ) ) .withDefaultImplementation( DEFAULT_DATASTORE_PROVIDER ) .withShortNameResolver( DatastoreProviderShortNameResolver.INSTANCE ) .getValue(); log.useDatastoreProvider( datastoreProvider.getClass().getName() ); return datastoreProvider; }

Target:
public DatastoreProvider initiateService(SessionFactoryImplementor sessionFactory, Configuration configuration, ServiceRegistryImplementor registry) { ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configuration ); DatastoreProvider datastoreProvider = propertyReader.property( OgmProperties.DATASTORE_PROVIDER, DatastoreProvider.class ) .instantiate() .withClassLoaderService( registry.getService( ClassLoaderService.class ) ) .withDefaultImplementation( DEFAULT_DATASTORE_PROVIDER ) .withShortNameResolver( DatastoreProviderShortNameResolver.INSTANCE ) .getValue(); log.useDatastoreProvider( datastoreProvider.getClass().getName() ); return datastoreProvider; }
Source:
public String getContentSlotImport() { if (contentSlot == null) { return ""; } String importString = "import " + getContentSlot() + ";"; return importString; }

Target:
public String getContentSlotImport() { if (contentSlotClass == null) { return ""; } return "import " + contentSlotClass.getQualifiedName() + ";"; }
Source:
public void acquireToken(Activity activity, String resource, String clientId, String redirectUri, PromptBehavior prompt, String extraQueryParameters, AuthenticationCallback<AuthenticationResult> callback) { if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_4); apiEvent.setSilentRequestPromptBehavior(prompt.toString()); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, null, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } }

Target:
public void acquireToken(Activity activity, String resource, String clientId, String redirectUri, PromptBehavior prompt, String extraQueryParameters, AuthenticationCallback<AuthenticationResult> callback) { if (checkPreRequirements(resource, clientId, callback)) { redirectUri = getRedirectUri(redirectUri); final String requestId = Telemetry.registerNewRequest(); final APIEvent apiEvent = createApiEvent(mContext, clientId, requestId, EventStrings.ACQUIRE_TOKEN_4); apiEvent.setPromptBehavior(prompt.toString()); final AuthenticationRequest request = new AuthenticationRequest(mAuthority, resource, clientId, redirectUri, null, prompt, extraQueryParameters, getRequestCorrelationId(), getExtendedLifetimeEnabled()); request.setTelemetryRequestId(requestId); createAcquireTokenRequest(apiEvent).acquireToken(wrapActivity(activity), false, request, callback); } }
Source:
private Map<String, Object> processHistoryResult(String mbeanHistory, String range) throws IOException { mbeanHistory = removingInternalEscaping(mbeanHistory); Map<String, Object> jsonMap = parseJSON(mbeanHistory); Map<String, Object> processedJsonMap = new HashMap<>(); if (jsonMap == null) { return null; } long currentTime = new Date().getTime() / 1000; long duration = StatHistory.Range.valueOf(range).getDuration(); int size = Optional.ofNullable(((ArrayList) jsonMap.entrySet().iterator().next().getValue()).size()).orElse(0); long step = duration / size; List<String> labels = new ArrayList<>(); for (int i = 0; i <= size; i++) { long t = currentTime - duration + step * i; Date date = new Date(t * 1000); labels.add(DATE_FORMAT.format(date)); } JSONObject measureInfo; JSONArray measureInfoList; for (String key : jsonMap.keySet()) { ArrayList values = (ArrayList) jsonMap.get(key); measureInfoList = new JSONArray(); for (int i = 0; i < size; i++) { measureInfo = new JSONObject(); measureInfo.put("value", Optional.ofNullable(values.get(i)).orElse(0)); measureInfo.put("from", labels.get(i)); measureInfo.put("to", labels.get(i + 1)); measureInfoList.add(measureInfo); } processedJsonMap.put(key, measureInfoList); } return processedJsonMap; }

Target:
private Map<String, Object> processHistoryResult(String mbeanHistory, String range) throws IOException { mbeanHistory = removingInternalEscaping(mbeanHistory); Map<String, Object> jsonMap = parseJSON(mbeanHistory); if (jsonMap == null) { return null; } Map<String, Object> processedJsonMap = new HashMap<>(); long currentTime = new Date().getTime() / 1000; long duration = StatHistory.Range.valueOf(range).getDuration(); int size = Optional.ofNullable(((ArrayList) jsonMap.entrySet().iterator().next().getValue()).size()).orElse(0); long step = duration / size; List<String> labels = new ArrayList<>(size + 1); for (int i = 0; i <= size; i++) { long t = currentTime - duration + step * i; Date date = new Date(t * 1000); labels.add(DATE_FORMAT.format(date)); } JSONObject measureInfo; JSONArray measureInfoList; for (String key : jsonMap.keySet()) { ArrayList values = (ArrayList) jsonMap.get(key); measureInfoList = new JSONArray(); for (int i = 0; i < size; i++) { measureInfo = new JSONObject(); measureInfo.put("value", values.get(i)); measureInfo.put("from", labels.get(i)); measureInfo.put("to", labels.get(i + 1)); measureInfoList.add(measureInfo); } processedJsonMap.put(key, measureInfoList); } return processedJsonMap; }
Source:
public static LicenceType fromValue(String v) { try { return valueOf(v); } catch (IllegalArgumentException ex) { return UNRECOGNIZED; } }

Target:
public static LicenceType fromValue(String v) { return Enums .getIfPresent(LicenceType.class, v) .or(UNRECOGNIZED); }
Source:
private SAMRecord writeAndReadSamRecord(final String format, SAMRecord rec) throws IOException { final File bamFile = File.createTempFile("htsjdk-writeAndReadSamRecord.", "." + format); final SAMFileWriter bamWriter = new SAMFileWriterFactory().makeWriter(rec.getHeader(), false, bamFile, REF_FILE); bamWriter.addAlignment(rec); bamWriter.close(); final SamReader reader = SamReaderFactory.makeDefault().referenceSequence(REF_FILE).open(bamFile); SAMRecordIterator iterator = reader.iterator(); Assert.assertTrue(iterator.hasNext()); rec = iterator.next(); iterator.close(); reader.close(); bamFile.delete(); return rec; }

Target:
private SAMRecord writeAndReadSamRecord(final String format, SAMRecord rec) throws IOException { final File bamFile = File.createTempFile("htsjdk-writeAndReadSamRecord.", "." + format); final SAMFileWriter bamWriter = new SAMFileWriterFactory().makeWriter(rec.getHeader(), false, bamFile, REF_FILE); bamWriter.addAlignment(rec); bamWriter.close(); try(final SamReader reader = SamReaderFactory.makeDefault().referenceSequence(REF_FILE).open(bamFile); final SAMRecordIterator iterator = reader.iterator()) { Assert.assertTrue(iterator.hasNext()); rec = iterator.next(); } bamFile.delete(); return rec; }
Source:
private void adjustCreateGameButtonBackgroundColor(String newValue) { if (Strings.isNullOrEmpty(newValue)) { titleTextField.setStyle("-fx-background-color: -bad;"); } else { titleTextField.setStyle("-fx-background-color: transparent;"); } }

Target:
private void adjustCreateGameButtonBackgroundColor(String newValue) { PseudoClass invalidClass = PseudoClass.getPseudoClass("invalid"); if (Strings.isNullOrEmpty(newValue)) { titleTextField.pseudoClassStateChanged(invalidClass, true); } else { titleTextField.pseudoClassStateChanged(invalidClass, false); } }
Source:
private List<GeoTrackPoint> processCSVFile(IngestJobContext context, AbstractFile DATFile, String csvFilePath) throws DroneIngestException { List<GeoTrackPoint> trackPoints = new ArrayList<>(); try (BufferedReader reader = new BufferedReader(new FileReader(new File(csvFilePath)))) { String line = reader.readLine(); Map<String, Integer> headerMap = makeHeaderMap(line.split(",")); while ((line = reader.readLine()) != null) { if (context.dataSourceIngestIsCancelled()) { return null; } String[] values = line.split(","); GeoTrackPoint point = createTrackPoint(headerMap, values); if (point != null) { trackPoints.add(point); } } } catch (IOException ex) { throw new DroneIngestException(String.format("Failed to read DAT csvFile %s", csvFilePath), ex); } return trackPoints; }

Target:
private List<GeoTrackPoint> processCSVFile(IngestJobContext context, AbstractFile DATFile, String csvFilePath) throws DroneIngestException { List<GeoTrackPoint> trackPoints = new ArrayList<>(); try (BufferedReader reader = new BufferedReader(new FileReader(new File(csvFilePath)))) { String line = reader.readLine(); Map<String, Integer> headerMap = makeHeaderMap(line.split(",")); while ((line = reader.readLine()) != null) { if (context.dataSourceIngestIsCancelled()) { return null; } String[] values = line.split(","); GeoTrackPoint point = createTrackPoint(headerMap, values); if (point != null) { trackPoints.add(point); } } } catch (IOException ex) { throw new DroneIngestException(String.format("Failed to read DAT csvFile %s created for AbstractFile: %s", csvFilePath, DATFile.getId()), ex); } return trackPoints; }
Source:
public CloseableHttpResponse execute(HttpRequestBase request) throws IOException { if (StringUtils.isNotEmpty(config.getAuthToken())) { request.setHeader(HttpHeaders.AUTHORIZATION, AUTHENTICATION_HEADER_PREFIX_BEARER + config.getAuthToken()); } if (StringUtils.isNotEmpty(config.getApiKey())) { request.setHeader(CONTINUUITY_API_KEY_HEADER_NAME, config.getApiKey()); } LOG.debug("Execute Http Request: " + request); return httpClient.execute(request); }

Target:
public CloseableHttpResponse execute(HttpRequestBase request) throws IOException { if (StringUtils.isNotEmpty(config.getAuthToken())) { request.setHeader(HttpHeaders.AUTHORIZATION, AUTHENTICATION_HEADER_PREFIX_BEARER + config.getAuthToken()); } if (StringUtils.isNotEmpty(config.getAPIKey())) { request.setHeader(CONTINUUITY_API_KEY_HEADER_NAME, config.getAPIKey()); } LOG.debug("Execute Http Request: {}", request); return httpClient.execute(request); }
Source:
public IPath append(IPath tail) { if (tail == null || tail.segmentCount() == 0) return this; if (this.isEmpty() && ((separators & IS_WINDOWS) == 0) == tail.isValidSegment(":")) return tail.setDevice(device).makeRelative().makeUNC(isUNC()); if (this.isRoot() && ((separators & IS_WINDOWS) == 0) == tail.isValidSegment(":")) return tail.setDevice(device).makeAbsolute().makeUNC(isUNC()); int myLen = segments.length; int tailLen = tail.segmentCount(); String[] newSegments = new String[myLen + tailLen]; System.arraycopy(segments, 0, newSegments, 0, myLen); for (int i = 0; i < tailLen; i++) { newSegments[myLen + i] = tail.segment(i); } Path result = new Path(device, newSegments, (separators & (HAS_LEADING | IS_UNC | IS_WINDOWS)) | (tail.hasTrailingSeparator() ? HAS_TRAILING : 0)); String tailFirstSegment = newSegments[myLen]; if (tailFirstSegment.equals("..") || tailFirstSegment.equals(".")) { result.canonicalize(); } return result; }

Target:
public IPath append(IPath tail) { if (tail == null || tail.segmentCount() == 0) return this; if (this.isEmpty() && ((flags & IS_FOR_WINDOWS) == 0) == tail.isValidSegment(":")) return tail.setDevice(device).makeRelative().makeUNC(isUNC()); if (this.isRoot() && ((flags & IS_FOR_WINDOWS) == 0) == tail.isValidSegment(":")) return tail.setDevice(device).makeAbsolute().makeUNC(isUNC()); int myLen = segments.length; int tailLen = tail.segmentCount(); String[] newSegments = new String[myLen + tailLen]; System.arraycopy(segments, 0, newSegments, 0, myLen); for (int i = 0; i < tailLen; i++) { newSegments[myLen + i] = tail.segment(i); } Path result = new Path(device, newSegments, (flags & (HAS_LEADING | IS_UNC | IS_FOR_WINDOWS)) | (tail.hasTrailingSeparator() ? HAS_TRAILING : 0)); String tailFirstSegment = newSegments[myLen]; if (tailFirstSegment.equals("..") || tailFirstSegment.equals(".")) { result.canonicalize(); } return result; }
Source:
protected void keyTyped(char c, int i) throws IOException { if (search.isFocused()){ if (!search.isEmpty() && search.handleKey(c, i)) return; } else if (GuiScreen.isAltKeyDown() && ChatAllowedCharacters.isAllowedCharacter(c)) { this.mouseClicked(search.getLeft(), search.getTop(), 0); search.setContent(""); search.handleKey(c, i); return; } if (!itemDisplay.keyTyped(c, i)) { if (i == 1 || !search.handleKey(c, i)) { super.keyTyped(c, i); } } }

Target:
protected void keyTyped(char c, int i) throws IOException { if (search.isFocused()) { if (!search.isEmpty() && search.handleKey(c, i)) return; } else if (GuiScreen.isAltKeyDown() && ChatAllowedCharacters.isAllowedCharacter(c)) { itemDisplay.setFocused(false); search.setFocused(true); search.setText(""); search.handleKey(c, i); return; } if (!itemDisplay.keyTyped(c, i)) { if (i == 1 || !search.handleKey(c, i)) { super.keyTyped(c, i); } } }