auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean applyTo(Project project) throws FileNotFoundException { final Module[] modules = ModuleManager.getInstance(project).getModules(); for (Module module : modules) { ModuleData data = myData.get(module.getName()); if (data == null) { return false; } AndroidFacet androidFacet = AndroidFacet.getInstance(module); VirtualFile moduleFile = module.getModuleFile(); if (androidFacet != null && moduleFile != null && moduleFile.exists()) { File moduleFilePath = new File(FileUtil.toSystemDependentName(moduleFile.getPath())); File moduleRootDirPath = moduleFilePath.getParentFile(); if <START> (moduleRootDirPath == null) { <END> throw new FileNotFoundException("Unable to reconstruct the module root directory."); } IdeaAndroidProject ideaAndroidProject = new IdeaAndroidProject(module.getName(), moduleRootDirPath, data.myAndroidProject, data.mySelectedVariant); androidFacet.setIdeaAndroidProject(ideaAndroidProject); } AndroidGradleFacet gradleFacet = AndroidGradleFacet.getInstance(module); if (gradleFacet != null) { gradleFacet.setGradleProject(data.myIdeaGradleProject); } JavaGradleFacet javaFacet = JavaGradleFacet.getInstance(module); if (javaFacet != null && data.myJavaModel != null) { javaFacet.setJavaModel(data.myJavaModel); } } GradleSyncState syncState = GradleSyncState.getInstance(project); syncState.setLastGradleSyncTimestamp(myLastGradleSyncTimestamp); return true; }</code><technical_language>Is this possible? accessing VfsUtil.virtualToIoFile(moduleFile.getParent())? I feel uneasy treating this case sense is expected</technical_language>

Target:
public boolean applyTo(Project project) throws FileNotFoundException { final Module[] modules = ModuleManager.getInstance(project).getModules(); for (Module module : modules) { ModuleData data = myData.get(module.getName()); if (data == null) { return false; } AndroidFacet androidFacet = AndroidFacet.getInstance(module); VirtualFile moduleFile = module.getModuleFile(); if (androidFacet != null) { if (moduleFile != null && moduleFile.exists()) { assert moduleFile.getParent() != null : moduleFile.getPath(); File moduleRootDirPath = VfsUtilCore.virtualToIoFile(moduleFile.getParent()); IdeaAndroidProject ideaAndroidProject = new IdeaAndroidProject(module.getName(), moduleRootDirPath, data.myAndroidProject, data.mySelectedVariant); androidFacet.setIdeaAndroidProject(ideaAndroidProject); } else { return false; } } AndroidGradleFacet gradleFacet = AndroidGradleFacet.getInstance(module); if (gradleFacet != null) { gradleFacet.setGradleProject(data.myIdeaGradleProject); } JavaGradleFacet javaFacet = JavaGradleFacet.getInstance(module); if (javaFacet != null && data.myJavaModel != null) { javaFacet.setJavaModel(data.myJavaModel); } } GradleSyncState syncState = GradleSyncState.getInstance(project); syncState.setLastGradleSyncTimestamp(myLastGradleSyncTimestamp); return true; }
Source:
<code><START> private void setUp() throws CTFReaderException { <END> assumeTrue(testTrace.exists()); fixture = new Metadata(testTrace.getTrace()); }</code><technical_language>setUp for @Before another method "init". assumeTrue stay in setUp</technical_language>

Target:
public void setUp() throws CTFReaderException { assumeTrue(testTrace.exists()); fixture = new Metadata(testTrace.getTrace()); }
Source:
<code>private static void setOxfordNanoporeRunValues(@Nonnull OxfordNanoporeNotificationDto from, @Nonnull OxfordNanoporeRun to){ <START> String[] softwareVersions = from.getSoftware().split("\\ \\+\\ "); <END> to.setMinKnowVersion(softwareVersions[0]); to.setProtocolVersion(softwareVersions[1]); }</code><technical_language>splitting strings in client, sense change run scanner's ONT DTO protocol version minknow version separate fields</technical_language>

Target:
private static void setOxfordNanoporeRunValues(@Nonnull OxfordNanoporeNotificationDto from, @Nonnull OxfordNanoporeRun to){ to.setMinKnowVersion(from.getSoftware()); to.setProtocolVersion(from.getProtocolVersion()); }
Source:
<code>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) { <START> System.err.println("IOException: " + e.getMessage()); <END> e.printStackTrace(); } return success; }</code><technical_language>Simply printing error overlooked, users confused result. I this throw exception instead</technical_language>

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:
<code>public void filter(ContainerRequestContext requestContext) throws IOException { <START> if (GrillServices.get().isStopping()) { <END> requestContext.abortWith(Response.status(Status.SERVICE_UNAVAILABLE) .entity("Server is going down").build()); } }</code><technical_language>deny requests while recovering a shutdown</technical_language>

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:
<code>public void onClusterRoleChange(TopologyDescriptor newTopology) { if (localClusterDescriptor.getRole() == ClusterRole.ACTIVE) { stopLogReplication(); } updateLocalTopology(newTopology); logReplicationMetadataManager.setupTopologyConfigId(topologyDescriptor.getTopologyConfigId()); <START> log.debug("Persist new topologyConfigId {}, cluster id={}, status={}", topologyDescriptor.getTopologyConfigId(), <END> 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(); } }</code><technical_language>status -> role</technical_language>

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:
<code>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 { <START> String encodedCommand = UrlEscapers.urlFormParameterEscaper().escape(query.getCommand()); <END> call = this.influxDBService.query(this.username, this.password, query.getDatabase(), encodedCommand); } return execute(call); }</code><technical_language>need this (I notice encoded=true in query methods)? if need it, loss in write method 333 line</technical_language>

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:
<code>protected boolean updateSelection(IStructuredSelection selection) { <START> BuildState buildState = BuildState.STOPPED; <END> if (selection.getFirstElement() instanceof IBuildPlan) { IBuildPlan buildPlan = (IBuildPlan) selection.getFirstElement(); return buildPlan.getState() == BuildState.RUNNING; } return false; }</code><technical_language>this is unused</technical_language>

Target:
protected boolean updateSelection(IStructuredSelection selection) { if (selection.getFirstElement() instanceof IBuildPlan) { IBuildPlan buildPlan = (IBuildPlan) selection.getFirstElement(); return buildPlan.getState() == BuildState.RUNNING; } return false; }
Source:
<code>protected Result check() throws Exception { <START> return Result.healthy(); <END> }</code><technical_language>message consumption rate production rate dropped significantly, return unhealthy</technical_language>

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:
<code>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' " <START> + "or override newWebDriver() to FluentDriver an EventFiringWebDriver."); <END> } return events; }</code><technical_language>This message change. Is a mistake</technical_language>

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:
<code>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)) { <START> builder.append("-").append(Character.toLowerCase(charValue)); <END> } else { builder.append(charValue); } } return builder.toString(); }</code><technical_language>append "-" if a lowercase previously Eg: NewUICommand calculated "new-u-i" "new-ui-command"</technical_language>

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:
<code>public boolean removeServer(QueryableDruidServer server) { synchronized (this) { Set<QueryableDruidServer> priorityServers; if (server.getServer().getType() == ServerType.REALTIME) { <START> priorityServers = realtimeServers.computeIfAbsent( <END> 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); } }</code><technical_language>computeIfPreset(), similar <LINK_0></technical_language>

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:
<code>public void sortChildren(String inode) throws DotDataException { <START> inode = SQLUtil.sanitizeParameter( inode ); <END> 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(); } } }</code><technical_language>a question ignorance; sanitizing inode</technical_language>

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:
<code>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() <START> .compactInterval(HumanReadableDuration.milliseconds(10)) <END> .build()) .build(); }</code><technical_language>this some custom class instead of a normal TimeInterval</technical_language>

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:
<code>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)) <START> .withSendDate(null) <END> .build(); try { logic.updateAdminEmailById(newDraft, previousEmailId); } catch (InvalidParametersException | EntityDoesNotExistException e) { isError = true; setStatusForException(e); } }</code><technical_language>remove</technical_language>

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:
<code>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(() -> { <START> String msg = String.format("Unable to execute, no positional parameter bound at position %s", <END> 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); } } }</code><technical_language>I "Unable execute, positional parameter bound position " + index. index is place, useful String.format</technical_language>

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:
<code>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); <START> c.countDown(); <END> } }); pub.subscribe(testsub); try { c.await(); } catch (InterruptedException e) { System.out.println("interrupted"); } mypct.get().join(); }</code><technical_language>wait for thread finish? Also, a Thread, synchronous code here</technical_language>

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:
<code>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); <START> GHRateLimit initRateLimit = new GHRateLimit(); <END> 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(); }</code><technical_language>This do anything. rate limit is set in GhprbTestUtil returning trigger</technical_language>

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:
<code>public boolean isNetworkLinkCreated(String networkId, PagedList<VirtualNetworkLinkInner> virtualNetworkLinks) { return virtualNetworkLinks.stream() .filter(networkLink -> networkId.equals(networkLink.name())) <START> .anyMatch(networkLink -> networkLink.provisioningState() == SUCCEEDED && networkLink.virtualNetworkLinkState() == VirtualNetworkLinkState.COMPLETED); <END> }</code><technical_language>real enums, please equals</technical_language>

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:
<code>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) { <START> LOGGER.info("Queryset timeout of " + executionDurationInMs + " ms reached; current time is " + ((EnvironmentEdgeManager.currentTimeMillis() - start)) + " ms." <END> + "\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; }</code><technical_language>log line is _actual_ diff right? want confirm change logic for queryset</technical_language>

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:
<code>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( <START> "org.springframework.security.config.annotation.web.configurers.oauth2.client.OAuth2LoginConfigurer.OidcAuthenticationRequestChecker") <END> .getBeanDefinition(); } return oauth2OidcAuthProvider; }</code><technical_language>OidcAuthenticationRequestChecker is private this fail? way, reference Java Config XML Config. Please create internal copy of OidcAuthenticationRequestChecker this parser instead</technical_language>

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:
<code>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); <START> List<String> transList = new ArrayList<String>(Arrays.asList(translationNames)); <END> 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); }</code><technical_language>List<String> transList = Arrays.asList(translationName);</technical_language>

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:
<code>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"); <START> sPanel.setSize("981px", "415px"); END> 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); } } }); }</code><technical_language>re-size dialog, is opened</technical_language>

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:
<code>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); } <START> } <END> } }</code><technical_language>a good choice. I mentioning miss in dev. needed methods yet, is wait for next iteration component</technical_language>

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:
<code>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); } <START> if (identifier != null && !"org.alfresco.documentlibrary.file-deleted".equals(item.getType())) <END> { 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); } }</code><technical_language>String defined a constant</technical_language>

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:
<code>protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true); <START> builder.clustering().stateTransfer().chunkSize(32); <END> createClusteredCaches(2, cacheName(), builder); }</code><technical_language>32 128</technical_language>

Target:
protected void createCacheManagers() throws Throwable { ConfigurationBuilder builder = getDefaultClusteredCacheConfig(getCacheMode(), true); builder.clustering().stateTransfer().chunkSize(2); createClusteredCaches(2, cacheName(), builder); }
Source:
<code>public boolean removeDnsSupportForSubnet(Network network) throws ResourceUnavailableException { if (_networkModel.isProviderSupportServiceInNetwork(network.getId(), Service.Dhcp, getProvider())) { return true; <START> } else { <END> return deleteDhcpSupportForSubnet(network, Service.Dns); } }</code><technical_language>This else block is unnecessary if block returns. Please remove it</technical_language>

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:
<code>public BulkLoaderVertexProgram create(final Graph... graphs) { if (graphs.length == 0) { <START> throw new IllegalStateException("Must provide at least one graph to use"); <END> } ConfigurationUtils.append(graphs[0].configuration().subset(BULK_LOADER_VERTEX_PROGRAM_CFG_PREFIX), configuration); return (BulkLoaderVertexProgram) VertexProgram.createVertexProgram(configuration, graphs); }</code><technical_language>a IllegalArgumentException in this case validation is argument create() ? I changed in "programs" validate in manner</technical_language>

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:
<code>public PowerUpSpawner(PlayingField pf) { this.pf = pf; <START> this.intervalTicks = settings.getInteger("POWERUP_SPAWN_INTERVAL") * pf.getFPS(); <END> this.tickCounter = 0; this.minX = 0; this.maxX = pf.getWidth(); this.log = Log.getLogger(); pf.getGameThread().registerListener(this); }</code><technical_language>getInterval() instead. <feature</technical_language>

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:
<code>public DatastoreProvider initiateService(SessionFactoryImplementor sessionFactory, Configuration configuration, ServiceRegistryImplementor registry) { ConfigurationPropertyReader propertyReader = new ConfigurationPropertyReader( configuration ); <START> DatastoreProvider datastoreProvider = propertyReader.propertyByType( OgmProperties.DATASTORE_PROVIDER, DatastoreProvider.class ) <END> .withClassLoaderService( registry.getService( ClassLoaderService.class ) ) .withDefaultImplementation( DEFAULT_DATASTORE_PROVIDER ) .withShortNameResolver( DatastoreProviderShortNameResolver.INSTANCE ) .getValue(); log.useDatastoreProvider( datastoreProvider.getClass().getName() ); return datastoreProvider; }</code><technical_language>I I get reason for property(...) propertyByType(...). simpler merge property(...)</technical_language>

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:
<code>public String getContentSlotImport() { if (contentSlot == null) { return ""; } <START> String importString = "import " + getContentSlot() + ";"; <END> return importString; }</code><technical_language>nl return</technical_language>

Target:
public String getContentSlotImport() { if (contentSlotClass == null) { return ""; } return "import " + contentSlotClass.getQualifiedName() + ";"; }
Source:
<code>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); <START> apiEvent.setSilentRequestPromptBehavior(prompt.toString()); <END> 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); } }</code><technical_language>setSilentRequestPromptBehavior [](start = 21, length = 30) silent request a prompt behavior :) #Resolved</technical_language>

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:
<code>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; <START> } <END> 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; }</code><technical_language>if (jsonMap == null) { return null; } Map<String, Object> processedJsonMap = new HashMap<>(); Switching order avoid instantiate processJsonMap jsonMap is null</technical_language>

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:
<code>public static LicenceType fromValue(String v) { try { return valueOf(v); } catch (IllegalArgumentException ex) { return UNRECOGNIZED; <START> } <END> }</code><technical_language>approach in other enums</technical_language>

Target:
public static LicenceType fromValue(String v) { return Enums .getIfPresent(LicenceType.class, v) .or(UNRECOGNIZED); }