auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static UpdateRepository pluginFront50UpdateRepository( Environment environment, ApplicationContext applicationContext, Map<String, PluginRepositoryProperties> pluginRepositoriesConfig) { OkHttpClientConfigurationProperties okHttpClientProperties = Binder.get(environment) .bind("ok-http-client", Bindable.of(OkHttpClientConfigurationProperties.class)) .orElseThrow(IllegalStateException::new); OkHttpClient okHttpClient = new OkHttp3ClientConfiguration(okHttpClientProperties) .create() .retryOnConnectionFailure(okHttpClientProperties.isRetryOnConnectionFailure()) .build(); ObjectMapper objectMapper = new ObjectMapper() .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .configure(SerializationFeature.INDENT_OUTPUT, true) .setSerializationInclusion(JsonInclude.Include.NON_NULL); PluginRepositoryProperties front50RepositoryProps = pluginRepositoriesConfig.get(PluginsConfigurationProperties.FRONT5O_REPOSITORY); Front50Service front50Service = new Retrofit.Builder() .addConverterFactory(JacksonConverterFactory.create(objectMapper)) .baseUrl(front50RepositoryProps.getUrl()) .client(okHttpClient) .build() .create(Front50Service.class); return new Front50UpdateRepository( PluginsConfigurationProperties.FRONT5O_REPOSITORY, applicationContext.getApplicationName(), front50RepositoryProps.getUrl(), FileDownloaderProvider.get(front50RepositoryProps.fileDownloader), new CompoundVerifier(), front50Service); }

Target:
public static UpdateRepository pluginFront50UpdateRepository( Environment environment, ApplicationContext applicationContext, Map<String, PluginRepositoryProperties> pluginRepositoriesConfig) { OkHttpClientConfigurationProperties okHttpClientProperties = Binder.get(environment) .bind("ok-http-client", Bindable.of(OkHttpClientConfigurationProperties.class)) .orElseThrow( () -> new BeanCreationException( "Unable to bind ok-http-client property to " + OkHttpClientConfigurationProperties.class.getSimpleName())); OkHttpClient okHttpClient = new OkHttp3ClientConfiguration(okHttpClientProperties) .create() .retryOnConnectionFailure(okHttpClientProperties.isRetryOnConnectionFailure()) .build(); ObjectMapper objectMapper = new ObjectMapper() .registerModule(new KotlinModule()) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .configure(SerializationFeature.INDENT_OUTPUT, true) .setSerializationInclusion(JsonInclude.Include.NON_NULL); PluginRepositoryProperties front50RepositoryProps = pluginRepositoriesConfig.get(PluginsConfigurationProperties.FRONT5O_REPOSITORY); Front50Service front50Service = new Retrofit.Builder() .addConverterFactory(JacksonConverterFactory.create(objectMapper)) .baseUrl(front50RepositoryProps.getUrl()) .client(okHttpClient) .build() .create(Front50Service.class); return new Front50UpdateRepository( PluginsConfigurationProperties.FRONT5O_REPOSITORY, applicationContext.getApplicationName(), front50RepositoryProps.getUrl(), FileDownloaderProvider.get(front50RepositoryProps.fileDownloader), new CompoundVerifier(), front50Service); }
Source:
public void waitUntilReceived(long seconds) { logger.info("Expecting to receive messages", expectedMessages.size()); await().atMost(adjust(new Duration(seconds, TimeUnit.SECONDS))).until(() -> receivedRequests.size() >= expectedMessages.size()); assertThat(receivedRequests.stream().map(LoggedRequest::getBodyAsString).collect(toList())).containsAll(expectedMessages); }

Target:
public void waitUntilReceived(long seconds) { logger.info("Expecting to receive messages", expectedMessages.size()); await().atMost(adjust(new Duration(seconds, TimeUnit.SECONDS))).until(() -> assertThat(receivedRequests.size()).isGreaterThanOrEqualTo(expectedMessages.size())); assertThat(receivedRequests.stream().map(LoggedRequest::getBodyAsString).collect(toList())).containsAll(expectedMessages); }
Source:
protected boolean isAuthorized() { final ImmutablePair<Integer, Integer> keys = getKeysIds(); if (keys.left < 0 || keys.right < 0) { return false; } return Settings.hasOCAuthorization(keys.left, keys.right); }

Target:
protected boolean isAuthorized() { if (oAuthMapping.publicKeyId < 0 || oAuthMapping.secretKeyId < 0) { return false; } return Settings.hasOAuthAuthorization(oAuthMapping.publicKeyId, oAuthMapping.secretKeyId); }
Source:
public Connection getConnectionInternal() { for (int retryCount = 0; retryCount < getConnectionMaxRetries; ++retryCount) { try { if (conn == null) { Class.forName(driverClass); conn = DriverManager.getConnection(connectionString, username.orNull(), password.orNull()); } else if (isExpired() || !conn.isValid(validationTimeoutSeconds)) { resetConnection(); } updateExpiration(); return conn; } catch (Exception e) { if (retryCount == getConnectionMaxRetries- 1) { throw new RuntimeException(String.format("Could not establish connection after %d attempts", getConnectionMaxRetries), e); } try { Thread.sleep(Math.round(Math.pow(2, retryCount)) * 1000); } catch (Exception ignored) { } } } throw new RuntimeException(String.format("Could not establish connection after %d attempts", getConnectionMaxRetries)); }

Target:
public Connection getConnectionInternal() { for (int retryCount = 0; retryCount < connectionMaxRetries; ++retryCount) { try { if (conn == null) { Class.forName(driverClass); conn = DriverManager.getConnection(connectionString, username.orNull(), password.orNull()); } else if (isExpired() || !conn.isValid(validationTimeoutSeconds)) { resetConnection(); } updateExpiration(); return conn; } catch (Exception e) { if (retryCount == connectionMaxRetries - 1) { throw new RuntimeException(String.format("Could not establish connection after %d attempts", connectionMaxRetries ), e); } try { Thread.sleep(Math.round(Math.pow(2, retryCount)) * 1000); } catch (Exception ignored) { } } } throw new RuntimeException(String.format("Could not establish connection after %d attempts", connectionMaxRetries )); }
Source:
public Stacks[] getStacks(String jobName, IProgressMonitor monitor, StacksType... types) { ArrayList<Stacks> ret = new ArrayList<Stacks>(); monitor.beginTask(jobName, types.length * 100); for( int i = 0; i < types.length; i++ ) { String url = null; switch(types[i] ) { case STACKS_TYPE: url = STACKS_URL; break; case PRESTACKS_TYPE: url = PRESTACKS_URL; break; default: break; } if( url != null ) { ret.add(getStacks(url, jobName, new SubProgressMonitor(monitor, 100))); } } monitor.done(); return (Stacks[]) ret.toArray(new Stacks[ret.size()]); }

Target:
public Stacks[] getStacks(String jobName, IProgressMonitor monitor, StacksType... types) { if( types == null ) return new Stacks[0]; ArrayList<Stacks> ret = new ArrayList<Stacks>(types.length); monitor.beginTask(jobName, types.length * 100); for( int i = 0; i < types.length; i++ ) { switch(types[i] ) { case STACKS_TYPE: ret.add(getStacks(STACKS_URL, jobName, new SubProgressMonitor(monitor, 100))); break; case PRESTACKS_TYPE: ret.add(getStacks(PRESTACKS_URL, jobName, new SubProgressMonitor(monitor, 100))); break; default: break; } } monitor.done(); return (Stacks[]) ret.toArray(new Stacks[ret.size()]); }
Source:
public Saml2RedirectAuthenticationRequest createRedirectAuthenticationRequest(Saml2AuthenticationRequestContext context) { String xml = createAuthenticationRequest(context, emptyList()); List<Saml2X509Credential> signingCredentials = context.getRelyingPartyRegistration().getSigningCredentials(); Builder result = Saml2RedirectAuthenticationRequest.withAuthenticationRequestContext(context); String deflatedAndEncoded = samlEncode(samlDeflate(xml)); Map<String, String> signedParams = this.saml.signQueryParameters( signingCredentials, deflatedAndEncoded, context.getRelayState() ); Assert.hasText(signedParams.get("SAMLRequest"), "SAMLRequest is a required http parameter and must be present"); result.samlRequest(signedParams.get("SAMLRequest")) .relayState(signedParams.get("RelayState")) .sigAlg(signedParams.get("SigAlg")) .signature(signedParams.get("Signature")); return result.build(); }

Target:
public Saml2RedirectAuthenticationRequest createRedirectAuthenticationRequest(Saml2AuthenticationRequestContext context) { String xml = createAuthenticationRequest(context, emptyList()); List<Saml2X509Credential> signingCredentials = context.getRelyingPartyRegistration().getSigningCredentials(); Builder result = Saml2RedirectAuthenticationRequest.withAuthenticationRequestContext(context); String deflatedAndEncoded = samlEncode(samlDeflate(xml)); Map<String, String> signedParams = this.saml.signQueryParameters( signingCredentials, deflatedAndEncoded, context.getRelayState() ); result.samlRequest(signedParams.get("SAMLRequest")) .relayState(signedParams.get("RelayState")) .sigAlg(signedParams.get("SigAlg")) .signature(signedParams.get("Signature")); return result.build(); }
Source:
public CheckResult check() { try { CheckResult failure = kafkaWorkers.failure.get(); if (failure != null) return failure; if (adminClient == null) adminClient = AdminClient.create(properties); KafkaFuture<String> maybeClusterId = adminClient.describeCluster().clusterId(); maybeClusterId.get(1, TimeUnit.SECONDS); return CheckResult.OK; } catch (RuntimeException | TimeoutException | ExecutionException | InterruptedException e) { return CheckResult.failed(e); } }

Target:
public CheckResult check() { try { CheckResult failure = kafkaWorkers.failure.get(); if (failure != null) return failure; KafkaFuture<String> maybeClusterId = getAdminClient().describeCluster().clusterId(); maybeClusterId.get(1, TimeUnit.SECONDS); return CheckResult.OK; } catch (Exception e) { return CheckResult.failed(e); } }
Source:
public void configure() { this.setVerticalScrollBarEnabled(true); this.setScrollBarStyle(SCROLLBARS_INSIDE_OVERLAY); this.setLongClickable(true); if (K9.getK9MessageViewTheme() == Theme.DARK) { this.setBackgroundColor(0xff000000); } final WebSettings webSettings = this.getSettings(); webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); webSettings.setSupportZoom(true); webSettings.setBuiltInZoomControls(true); webSettings.setUseWideViewPort(true); if (K9.autofitWidth()) { webSettings.setLoadWithOverviewMode(true); } disableDisplayZoomControls(); webSettings.setJavaScriptEnabled(false); webSettings.setLoadsImagesAutomatically(true); webSettings.setRenderPriority(RenderPriority.HIGH); webSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS); setOverScrollMode(OVER_SCROLL_NEVER); webSettings.setTextZoom(K9.getFontSizes().getMessageViewContentAsPercent()); blockNetworkData(true); }

Target:
public void configure() { this.setVerticalScrollBarEnabled(true); this.setVerticalScrollbarOverlay(true); this.setScrollBarStyle(SCROLLBARS_INSIDE_OVERLAY); this.setLongClickable(true); if (K9.getK9MessageViewTheme() == Theme.DARK) { this.setBackgroundColor(0xff000000); } final WebSettings webSettings = this.getSettings(); webSettings.setCacheMode(WebSettings.LOAD_NO_CACHE); webSettings.setSupportZoom(true); webSettings.setBuiltInZoomControls(true); webSettings.setUseWideViewPort(true); if (K9.autofitWidth()) { webSettings.setLoadWithOverviewMode(true); } disableDisplayZoomControls(); webSettings.setJavaScriptEnabled(false); webSettings.setLoadsImagesAutomatically(true); webSettings.setRenderPriority(RenderPriority.HIGH); webSettings.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS); setOverScrollMode(OVER_SCROLL_NEVER); webSettings.setTextZoom(K9.getFontSizes().getMessageViewContentAsPercent()); blockNetworkData(true); }
Source:
private void assertResponse(Response response) { assertEquals(200, response.getStatus()); assertNotNull(response.getEntity()); responseStr = response.readEntity(String.class); }

Target:
private void assertResponse(Response response) { assertNotNull(response); assertEquals(200, response.getStatus()); assertNotNull(response.getEntity()); }
Source:
public static void main(String[] args) throws Exception { Schema schema = new Schema(3, "fr.gaulupeau.apps.Poche.entity"); Entity article = schema.addEntity("Article"); article.addIdProperty(); article.addIntProperty("articleId").columnName("article_id").unique(); article.addStringProperty("content").columnName("content"); article.addStringProperty("author").columnName("author"); article.addStringProperty("title").columnName("title"); article.addStringProperty("url").columnName("url"); article.addBooleanProperty("favorite").columnName("favorite"); article.addBooleanProperty("archive").columnName("archive"); article.addBooleanProperty("sync").columnName("sync"); article.addDateProperty("updateDate").columnName("update_date"); article.addDoubleProperty("articleProgress").columnName("article_progress"); Entity offlineURL = schema.addEntity("OfflineURL"); offlineURL.addIdProperty(); offlineURL.addStringProperty("url").columnName("url").unique(); Entity queueItem = schema.addEntity("QueueItem"); queueItem.addIdProperty(); queueItem.addIntProperty("status").notNull(); queueItem.addLongProperty("queueNumber").columnName("queue_number"); queueItem.addIntProperty("action").notNull(); queueItem.addIntProperty("articleId").columnName("article_id"); queueItem.addStringProperty("extra"); new DaoGenerator().generateAll(schema, "./app/src-gen"); }

Target:
public static void main(String[] args) throws Exception { Schema schema = new Schema(5, "fr.gaulupeau.apps.Poche.entity"); Entity article = schema.addEntity("Article"); article.addIdProperty(); article.addIntProperty("articleId").columnName("article_id").unique(); article.addStringProperty("content").columnName("content"); article.addStringProperty("author").columnName("author"); article.addStringProperty("title").columnName("title"); article.addStringProperty("url").columnName("url"); article.addBooleanProperty("favorite").columnName("favorite"); article.addBooleanProperty("archive").columnName("archive"); article.addDateProperty("updateDate").columnName("update_date"); article.addDoubleProperty("articleProgress").columnName("article_progress"); Entity queueItem = schema.addEntity("QueueItem"); queueItem.addIdProperty(); queueItem.addLongProperty("queueNumber").columnName("queue_number"); queueItem.addIntProperty("action").notNull(); queueItem.addIntProperty("articleId").columnName("article_id"); queueItem.addStringProperty("extra"); new DaoGenerator().generateAll(schema, "./app/src-gen"); }
Source:
public static Tenor ofMonths(int months) { if (months < 24) { return new Tenor(Period.ofMonths(months), months + "M"); } Period period = Period.of(months / 12, months % 12, 0); return new Tenor(period, period.toString().substring(1)); }

Target:
public static Tenor ofMonths(int months) { return new Tenor(Period.ofMonths(months), months + "M"); }
Source:
public DiskImage getImageAsDiskImage(String id) { DiskImage diskImage = new DiskImage(); Image glanceImage; try { glanceImage = getClient().images().show(id).execute(); } catch (RuntimeException e) { log.error("Exception: {}", e.getMessage()); log.debug("Exception", e); throw new OpenStackImageException( OpenStackImageException.ErrorType.UNABLE_TO_ACCESS_IMAGE_REPOSITORY, "Cannot access the image repository. Please make sure it's accessible."); } validateContainerFormat(glanceImage); String shortHash = glanceImage.getId().substring(0, 7); if (glanceImage.getName() != null) { diskImage.setDiskDescription(glanceImage.getName() + " (" + shortHash + ")"); } else { diskImage.setDiskDescription("Glance disk: " + shortHash); } setDiskAttributes(diskImage, glanceImage); if (glanceImage.getDiskFormat().equals(GlanceImageFormat.RAW.getValue())) { diskImage.setVolumeFormat(VolumeFormat.RAW); } else if (glanceImage.getDiskFormat().equals(GlanceImageFormat.COW.getValue())) { diskImage.setVolumeFormat(VolumeFormat.COW); } else { throw new OpenStackImageException( OpenStackImageException.ErrorType.UNSUPPORTED_DISK_FORMAT, "Unknown disk format: " + glanceImage.getDiskFormat()); } return diskImage; }

Target:
public DiskImage getImageAsDiskImage(String id) { DiskImage diskImage = new DiskImage(); Image glanceImage; try { glanceImage = getClient().images().show(id).execute(); } catch (RuntimeException e) { log.error("Exception: {}", e.getMessage()); log.debug("Exception", e); throw new OpenStackImageException( OpenStackImageException.ErrorType.UNABLE_TO_ACCESS_IMAGE_REPOSITORY, "Cannot access the image repository."); } validateContainerFormat(glanceImage); String shortHash = glanceImage.getId().substring(0, 7); if (glanceImage.getName() != null) { diskImage.setDiskDescription(glanceImage.getName() + " (" + shortHash + ")"); } else { diskImage.setDiskDescription("Glance disk: " + shortHash); } setDiskAttributes(diskImage, glanceImage); if (glanceImage.getDiskFormat().equals(GlanceImageFormat.RAW.getValue())) { diskImage.setVolumeFormat(VolumeFormat.RAW); } else if (glanceImage.getDiskFormat().equals(GlanceImageFormat.COW.getValue())) { diskImage.setVolumeFormat(VolumeFormat.COW); } else { throw new OpenStackImageException( OpenStackImageException.ErrorType.UNSUPPORTED_DISK_FORMAT, "Unknown disk format: " + glanceImage.getDiskFormat()); } return diskImage; }
Source:
private static @Nullable Integer getCgroupRootQuark(ITmfStateSystemBuilder ss, @Nullable String path) { if (path == null) { return null; } int hierarchiesQuark = ss.getQuarkAbsoluteAndAdd(ContainerAttributes.CGROUPS_HIERARCHIES); File cgrpRoot = new File(path); while (cgrpRoot != null) { try { return ss.getQuarkRelative(hierarchiesQuark, cgrpRoot.getPath()); } catch (AttributeNotFoundException e) { cgrpRoot = cgrpRoot.getParentFile(); } } return null; }

Target:
private static @Nullable Integer getCgroupRootQuark(ITmfStateSystemBuilder ss, @Nullable String path) { if (path == null) { return null; } int hierarchiesQuark = ss.getQuarkAbsoluteAndAdd(ContainerAttributes.CGROUPS_HIERARCHIES); File cgrpRoot = new File(path); int q; while (cgrpRoot != null) { q = ss.optQuarkRelative(hierarchiesQuark, cgrpRoot.getPath()); if (q == ITmfStateSystem.INVALID_ATTRIBUTE) { cgrpRoot = cgrpRoot.getParentFile(); } else { return q; } } return null; }
Source:
public KeyMaker(String vmId, ConsoleContext context) { super(); this.vmId = vmId; this.context = context; }

Target:
public KeyMaker(String vmId, ConsoleContext context) { this.vmId = vmId; this.context = context; }
Source:
public Future<?> apply(final ClientRequest jerseyRequest, final AsyncConnectorCallback callback) { final Request jettyRequest = translateRequest(jerseyRequest); final ContentProvider entity = getStreamProvider(jerseyRequest); if (entity != null) { jettyRequest.content(entity); } final Throwable[] failure = new Throwable[1]; final ClientResponse[] jerseyResponse = new ClientResponse[1]; try { buildAsyncRequest(jettyRequest) .send(new Response.Listener.Empty() { @Override public void onContent(Response jettyResponse, ByteBuffer content) { jerseyResponse[0] = translateResponse(jerseyRequest, jettyResponse, content); callback.response(jerseyResponse[0]); } @Override public void onFailure(Response response, Throwable t) { failure[0] = t; callback.failure(t); } }); return Futures.immediateFuture(jerseyResponse[0]); } catch (Throwable t) { failure[0] = t; callback.failure(t); } final SettableFuture<Object> errorFuture = SettableFuture.create(); errorFuture.setException(failure[0]); return errorFuture; }

Target:
public Future<?> apply(final ClientRequest jerseyRequest, final AsyncConnectorCallback callback) { final Request jettyRequest = translateRequest(jerseyRequest); final ContentProvider entity = getStreamProvider(jerseyRequest); if (entity != null) { jettyRequest.content(entity); } final AtomicBoolean callbackInvoked = new AtomicBoolean(false); Throwable failure; try { final SettableFuture<ClientResponse> responseFuture = SettableFuture.create(); Futures.addCallback(responseFuture, new FutureCallback<ClientResponse>() { @Override public void onSuccess(ClientResponse result) { } @Override public void onFailure(Throwable t) { if (t instanceof CancellationException) { jettyRequest.abort(t); } } }); final AtomicReference<ClientResponse> jerseyResponse = new AtomicReference<ClientResponse>(); final ByteBufferInputStream entityStream = new ByteBufferInputStream(); buildAsyncRequest(jettyRequest) .send(new Response.Listener.Empty() { @Override public void onHeaders(Response jettyResponse) { if (responseFuture.isDone()) if (!callbackInvoked.compareAndSet(false, true)) { return; } final ClientResponse response = translateResponse(jerseyRequest, jettyResponse, entityStream); jerseyResponse.set(response); callback.response(response); } @Override public void onContent(Response jettyResponse, ByteBuffer content) { try { entityStream.put(content); } catch (InterruptedException ex) { final ProcessingException pe = new ProcessingException(ex); entityStream.closeQueue(pe); responseFuture.setException(pe); Thread.currentThread().interrupt(); } } @Override public void onComplete(Result result) { entityStream.closeQueue(); responseFuture.set(jerseyResponse.get()); } @Override public void onFailure(Response response, Throwable t) { entityStream.closeQueue(t); responseFuture.setException(t); if (callbackInvoked.compareAndSet(false, true)) { callback.failure(t); } } }); return responseFuture; } catch (Throwable t) { failure = t; } if (callbackInvoked.compareAndSet(false, true)) { callback.failure(failure); } return Futures.immediateFailedFuture(failure); }
Source:
Map<byte[], List<byte[]>> findLower(Map<byte[], Long> sequenceids) { Map<byte[], List<byte[]>> toFlush = null; synchronized (tieLock) { for (Map.Entry<byte[], Long> e : sequenceids.entrySet()) { Map<ImmutableByteArray, Long> m = this.lowestUnflushedSequenceIds.get(e.getKey()); if (m == null) { continue; } for (Map.Entry<ImmutableByteArray, Long> me : m.entrySet()) { if (me.getValue() <= e.getValue()) { if (toFlush == null) { toFlush = new HashMap<>(); } toFlush.computeIfAbsent(e.getKey(), k -> new ArrayList<>()).add(Bytes.toBytes(me.getKey().toString())); } } } } return toFlush == null ? null : toFlush; }

Target:
Map<byte[], List<byte[]>> findLower(Map<byte[], Long> sequenceids) { Map<byte[], List<byte[]>> toFlush = null; synchronized (tieLock) { for (Map.Entry<byte[], Long> e : sequenceids.entrySet()) { Map<ImmutableByteArray, Long> m = this.lowestUnflushedSequenceIds.get(e.getKey()); if (m == null) { continue; } for (Map.Entry<ImmutableByteArray, Long> me : m.entrySet()) { if (me.getValue() <= e.getValue()) { if (toFlush == null) { toFlush = new TreeMap(Bytes.BYTES_COMPARATOR); } toFlush.computeIfAbsent(e.getKey(), k -> new ArrayList<>()) .add(Bytes.toBytes(me.getKey().toString())); } } } } return toFlush; }
Source:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_EDIT_COMMENT) .setDescription("Edit a comment.<br/>" + "Requires authentication and the following permission: 'Browse' on the project of the specified issue.") .setSince("3.6") .setChangelog( new Change("6.3", "the response returns the issue with all its details"), new Change("6.3", format("the 'key' parameter has been renamed %s", PARAM_COMMENT)) ) .setHandler(this) .setResponseExample(Resources.getResource(this.getClass(), "edit_comment-example.json")) .setPost(true); action.createParam(PARAM_COMMENT) .setDescription("Comment key") .setDeprecatedKey("key", "6.3") .setSince("6.3") .setRequired(true) .setExampleValue(UUID_EXAMPLE_01); action.createParam(PARAM_TEXT) .setDescription("Comment text") .setRequired(true) .setExampleValue("Won't fix because it doesn't apply to the context"); }

Target:
public void define(WebService.NewController context) { WebService.NewAction action = context.createAction(ACTION_EDIT_COMMENT) .setDescription("Edit a comment.<br/>" + "Requires authentication and the following permission: 'Browse' on the project of the specified issue.") .setSince("3.6") .setChangelog( new Change("6.3", "the response returns the issue with all its details"), new Change("6.3", format("the 'key' parameter has been renamed %s", PARAM_COMMENT)), new Change("6.5", "the database ids of the components are removed from the response"), new Change("6.5", "the response field components.uuid is deprecated. Use components.key instead.")) .setHandler(this) .setResponseExample(Resources.getResource(this.getClass(), "edit_comment-example.json")) .setPost(true); action.createParam(PARAM_COMMENT) .setDescription("Comment key") .setDeprecatedKey("key", "6.3") .setSince("6.3") .setRequired(true) .setExampleValue(UUID_EXAMPLE_01); action.createParam(PARAM_TEXT) .setDescription("Comment text") .setRequired(true) .setExampleValue("Won't fix because it doesn't apply to the context"); }
Source:
private HashSet<CableBlockEntity> visitCableNode(CableBlockEntity currentEntity, HashSet<CableBlockEntity> visitedNodes) { visitedNodes.add(currentEntity); HashSet<CableBlockEntity> seenNodes = new HashSet<>(); if (currentEntity != null) { TechReborn.LOGGER.debug( "Visiting node on behalf of ({} visited total)", currentEntity.getPos().asLong(), this, visitedNodes.size()); seenNodes.add(currentEntity); for (Direction face : Direction.values()) { BlockPos blockToCheckPos = currentEntity.getPos().offset(face); BlockEntity blockEntity = currentEntity.getWorld().getBlockEntity(blockToCheckPos); if (!(blockEntity instanceof CableBlockEntity) || visitedNodes.contains(blockEntity)) { continue; } CableBlockEntity targetEntity = (CableBlockEntity) blockEntity; TechReborn.LOGGER.debug( "Node is on network {}", targetEntity.getPos().asLong(), targetEntity.getElectricNetwork()); if (currentEntity.canConnectTo(targetEntity)) { TechReborn.LOGGER.debug("Seen another node -- {}", blockToCheckPos.asLong()); seenNodes.add(targetEntity); } } } return seenNodes; }

Target:
private Set<CableBlockEntity> visitCableNode(CableBlockEntity currentEntity, HashSet<CableBlockEntity> visitedNodes) { visitedNodes.add(currentEntity); HashSet<CableBlockEntity> seenNodes = new HashSet<>(); if (currentEntity != null) { TechReborn.LOGGER.debug( "Visiting node on behalf of ({} visited total)", currentEntity.getPos().asLong(), this, visitedNodes.size()); seenNodes.add(currentEntity); for (Direction face : Direction.values()) { BlockPos blockToCheckPos = currentEntity.getPos().offset(face); BlockEntity blockEntity = currentEntity.getWorld().getBlockEntity(blockToCheckPos); if (!(blockEntity instanceof CableBlockEntity) || visitedNodes.contains(blockEntity)) { continue; } CableBlockEntity targetEntity = (CableBlockEntity) blockEntity; TechReborn.LOGGER.debug( "Node is on network {}", targetEntity.getPos().asLong(), targetEntity.getElectricNetwork()); if (currentEntity.canConnectTo(targetEntity)) { TechReborn.LOGGER.debug("Seen another node -- {}", blockToCheckPos.asLong()); seenNodes.add(targetEntity); } } } return seenNodes; }
Source:
public void testDisable() throws Exception { for (String regionId : regions) { assertNotNull(api.cdnApiInRegion(regionId).disable(name)); } }

Target:
public void testDisable() throws Exception { for (String regionId : regions) { assertTrue(api.cdnApiInRegion(regionId).disable(name)); CDNContainer container = api.cdnApiInRegion(regionId).get(name); assertFalse(container.isEnabled()); } }
Source:
private Node convert(AResource r) { if (!r.isAnonymous()) return NodeFactory.createURI(r.getURI()); Node rr = (Node) r.getUserData(); if (rr == null) { rr = NodeFactory.createBlankNode(); r.setUserData(rr); } return rr; }

Target:
private Node convert(AResource r) { if (!r.isAnonymous()) { String uriStr = r.getURI() ; if ( errorForSpaceInURI ) { if ( uriStr.contains(" ") ) { int i = uriStr.indexOf(' '); String s = uriStr.substring(0,i); String msg = String.format("Bad character in IRI (space): <%s[space]...>", s); riotErrorHandler.error(msg, -1, -1); throw new RiotParseException(msg, -1, -1); } } return NodeFactory.createURI(uriStr); } Node rr = (Node) r.getUserData(); if (rr == null) { rr = NodeFactory.createBlankNode(); r.setUserData(rr); } return rr; }
Source:
public WebViewMapFragment build() { if (options == null) { options = new MapboxWebMapType(accessToken, mapId); } if (options instanceof MapboxWebMapType) { return MapboxWebViewMapFragment.newInstance(options); } return null; }

Target:
public WebViewMapFragment build() { if (options == null) { options = new MapboxWebMapType(accessToken, mapId); } if (options instanceof MapboxWebMapType) { return MapboxWebViewMapFragment.newInstance(options); } throw new IllegalStateException("Unable to build MapboxWebMapViewFragment." + " options == '" + options + "'"); }
Source:
public boolean accept(File pathname) { return (pathname.isDirectory() && pathname.getName().equals("index")); }

Target:
public boolean accept(File pathname) { return (pathname.isDirectory() && pathname.getName().equals(INDEX_DIRECTORY)); }
Source:
private RequestContextSubscriber(CoreSubscriber<T> delegate, Authentication authentication) { this.delegate = delegate; Context parentContext = this.delegate.currentContext(); Context context; if (parentContext.hasKey(REQUEST_CONTEXT_DATA_HOLDER_ATTR_NAME)) { context = parentContext; } else { context = parentContext.put(REQUEST_CONTEXT_DATA_HOLDER_ATTR_NAME, new RequestContextDataHolder(authentication)); } this.context = context; }

Target:
private RequestContextSubscriber(CoreSubscriber<T> delegate, Authentication authentication) { this.delegate = delegate; Context parentContext = this.delegate.currentContext(); Context context; if (authentication == null || parentContext.hasKey(REQUEST_CONTEXT_DATA_HOLDER_ATTR_NAME)) { context = parentContext; } else { context = parentContext.put(REQUEST_CONTEXT_DATA_HOLDER_ATTR_NAME, new RequestContextDataHolder(authentication)); } this.context = context; }
Source:
public void testCopyFileInvalid() throws IOException { Path created = FileHelper.createFile(fileSystem.getPath(getCurrentTestName())); FileHelper.copyFile(created, fileSystem.getPath("../" + getCurrentTestName())); }

Target:
public void testCopyFileInvalid() throws IOException { Path created = FileHelper.createFile(fileSystem.getPath(getCurrentTestName())); Path copy = FileHelper.copyFile(created, fileSystem.getPath("../" + getCurrentTestName())); fail(String.format("Unexpected success in copying file to %s", copy.toString())); }
Source:
public static void setup() { FloatInputPoll pressureInput = Igneous.makeAnalogInput(0); FloatStatus min = ControlInterface.mainTuning.getFloat("pressure-min", 0.0f); FloatStatus max = ControlInterface.mainTuning.getFloat("pressure-max", 1.0f); EventStatus setMin = new EventStatus(); EventStatus setMax = new EventStatus(); FloatMixing.pumpWhen(setMin, pressureInput, min); FloatMixing.pumpWhen(setMax, pressureInput, max); pressureGauge = FloatMixing.createDispatch(FloatMixing.normalizeFloat(pressureInput, min, max), Igneous.globalPeriodic); Cluck.publish("Pressure Switch", pressureSwitch); Cluck.publish("Pressure Gauge", pressureGauge); Cluck.publish("Compressor Enable", compressor); Cluck.publish("Pressure Min Set", setMin); Cluck.publish("Pressure Max Set", setMax); }

Target:
public static void setup() { FloatInput pressureInput = FloatMixing.createDispatch(Igneous.makeAnalogInput(0), Igneous.globalPeriodic); FloatStatus min = ControlInterface.mainTuning.getFloat("pressure-min", 0.0f); FloatStatus max = ControlInterface.mainTuning.getFloat("pressure-max", 1.0f); pressureGauge = FloatMixing.createDispatch(FloatMixing.normalizeFloat(pressureInput, min, max), Igneous.globalPeriodic); Cluck.publish("Pressure Switch", pressureSwitch); Cluck.publish("Pressure Gauge", pressureGauge); Cluck.publish("Pressure Gauge Raw", pressureInput); Cluck.publish("Compressor Enable", compressor); Cluck.publish("Pressure Min Set", FloatMixing.pumpEvent(pressureInput, min)); Cluck.publish("Pressure Max Set", FloatMixing.pumpEvent(pressureInput, max)); }
Source:
public Response getPolicies(@PathParam("tenant") String tenant, @PathParam("subject") String subject) { try { LOGGER.debug("Getting policies for [" + tenant + "] and subject [" + subject + "]"); Collection<Policy> policyList = dao.getPolicies(tenant, subject); PolicySet ps = new PolicySet(tenant + ":" + subject, policyList); Document setDocument = ps.toXml(); String result = Xml.toString(setDocument); return Response.ok(result).build(); } catch (IOException ex) { return Response.status(500).build(); } catch (SAXException ex) { return Response.status(500).build(); } catch (TransformerException ex) { return Response.status(500).build(); } }

Target:
public Response getPolicies(@PathParam("tenant") String tenant, @PathParam("subject") String subject) { try { LOGGER.debug("Getting policies for and subject [{}]", tenant, subject); Collection<Policy> policyList = dao.getPolicies(tenant, subject); PolicySet ps = new PolicySet(tenant + ":" + subject, policyList); Document setDocument = ps.toXml(); String result = Xml.toString(setDocument); return Response.ok(result).build(); } catch (IOException ex) { return Response.status(500).build(); } catch (SAXException ex) { return Response.status(500).build(); } catch (TransformerException ex) { return Response.status(500).build(); } }
Source:
private SharedRealm(long nativeSharedRealmPtr, OsRealmConfig osRealmConfig) { this.nativePtr = nativeSharedRealmPtr; this.osRealmConfig = osRealmConfig; this.schemaInfo = new OsSchemaInfo(nativeGetSchemaInfo(nativePtr), this); this.context = osRealmConfig.getContext(); this.isPhantomRef = false; this.capabilities = new AndroidCapabilities(); this.realmNotifier = null; nativeSetAutoRefresh(nativePtr, false); }

Target:
private SharedRealm(long nativeSharedRealmPtr, OsRealmConfig osRealmConfig) { this.nativePtr = nativeSharedRealmPtr; this.osRealmConfig = osRealmConfig; this.schemaInfo = new OsSchemaInfo(nativeGetSchemaInfo(nativePtr), this); this.context = osRealmConfig.getContext(); this.context.addReference(this); this.capabilities = new AndroidCapabilities(); this.realmNotifier = null; nativeSetAutoRefresh(nativePtr, false); }
Source:
private void configureCommand(TransportCommand<?, ?> command) { command.setTimeout(this.timeout); command.setTransportConfigCallback(this.transportConfigCallback); command.setCredentialsProvider(getCredentialsProvider()); }

Target:
private void configureCommand(TransportCommand<?, ?> command) { command.setTimeout(this.timeout); if (this.transportConfigCallback != null) { command.setTransportConfigCallback(this.transportConfigCallback); } CredentialsProvider credentialsProvider = getCredentialsProvider(); if (credentialsProvider != null) { command.setCredentialsProvider(credentialsProvider); } }
Source:
private void createKerberosLdapAAAConfigurations() { for (String domain : Config.<String> getValue(ConfigValues.DomainName).split("[,]", 0)) { if (!domain.isEmpty()) { Properties authConfig = new Properties(); authConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapAuthenticator"); authConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.authentication"); authConfig.put(ExtensionsManager.ENABLED, "true"); authConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); authConfig.put(ExtensionsManager.NAME, String.format("builtin-authn-%1$s", domain)); authConfig.put("ovirt.engine.aaa.authn.profile.name", domain); authConfig.put("ovirt.engine.aaa.authn.authz.plugin", domain); ExtensionsManager.getInstance().load(authConfig); Properties dirConfig = new Properties(); dirConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapDirectory"); dirConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.authorization"); dirConfig.put(ExtensionsManager.ENABLED, "true"); dirConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); dirConfig.put(ExtensionsManager.NAME, domain); ExtensionsManager.getInstance().load(dirConfig); } } }

Target:
private void createKerberosLdapAAAConfigurations() { for (String domain : Config.<String> getValue(ConfigValues.DomainName).split("[,]", 0)) { domain = domain.trim(); if (!domain.isEmpty()) { Properties authConfig = new Properties(); authConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapAuthenticator"); authConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.authentication"); authConfig.put(ExtensionsManager.ENABLED, "true"); authConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); authConfig.put(ExtensionsManager.NAME, String.format("builtin-authn-%1$s", domain)); authConfig.put("ovirt.engine.aaa.authn.profile.name", domain); authConfig.put("ovirt.engine.aaa.authn.authz.plugin", domain); ExtensionsManager.getInstance().load(authConfig); Properties dirConfig = new Properties(); dirConfig.put(ExtensionsManager.CLASS, "org.ovirt.engine.extensions.aaa.builtin.kerberosldap.KerberosLdapDirectory"); dirConfig.put(ExtensionsManager.PROVIDES, "org.ovirt.engine.authorization"); dirConfig.put(ExtensionsManager.ENABLED, "true"); dirConfig.put(ExtensionsManager.MODULE, "org.ovirt.engine.extensions.builtin"); dirConfig.put(ExtensionsManager.NAME, domain); ExtensionsManager.getInstance().load(dirConfig); } } }
Source:
public ExtendedLockPromise acquire(Object key, Object lockOwner, long time, TimeUnit timeUnit) { AtomicReference<ExtendedLockPromise> reference = new AtomicReference<>(); lockMap.compute(key, (aKey, lock) -> { if (lock == null) { lock = createInfinispanLock(aKey); } reference.set(lock.acquire(lockOwner, time, timeUnit)); return lock; }); return reference.get(); }

Target:
public ExtendedLockPromise acquire(Object key, Object lockOwner, long time, TimeUnit timeUnit) { ByRef<ExtendedLockPromise> reference = ByRef.create(null); lockMap.compute(key, (aKey, lock) -> { if (lock == null) { lock = createInfinispanLock(aKey); } reference.set(lock.acquire(lockOwner, time, timeUnit)); return lock; }); return reference.get(); }
Source:
private void discard(Throwable cause) { for (;;) { PendingWrite currentWrite = this.currentWrite; if (this.currentWrite == null) { currentWrite = queue.poll(); } else { this.currentWrite = null; } if (currentWrite == null) { break; } Object message = currentWrite.msg; if (message instanceof ChunkedInput) { ChunkedInput<?> in = (ChunkedInput<?>) message; try { boolean endOfInput = in.isEndOfInput(); long inputLength = in.length(); closeInput(in); if (!endOfInput) { if (cause == null) { cause = new ClosedChannelException(); } currentWrite.fail(cause); } else { currentWrite.success(inputLength); } } catch (Exception e) { closeInput(in); currentWrite.fail(e); if (logger.isWarnEnabled()) { logger.warn(ChunkedInput.class.getSimpleName() + " failed", e); } } } else { if (cause == null) { cause = new ClosedChannelException(); } currentWrite.fail(cause); } } }

Target:
private void discard(Throwable cause) { for (;;) { PendingWrite currentWrite = this.currentWrite; if (this.currentWrite == null) { currentWrite = queue.poll(); } else { this.currentWrite = null; } if (currentWrite == null) { break; } Object message = currentWrite.msg; if (message instanceof ChunkedInput) { ChunkedInput<?> in = (ChunkedInput<?>) message; boolean endOfInput; long inputLength; try { endOfInput = in.isEndOfInput(); inputLength = in.length(); closeInput(in); } catch (Exception e) { closeInput(in); currentWrite.fail(e); if (logger.isWarnEnabled()) { logger.warn(ChunkedInput.class.getSimpleName() + " failed", e); } continue; } if (!endOfInput) { if (cause == null) { cause = new ClosedChannelException(); } currentWrite.fail(cause); } else { currentWrite.success(inputLength); } } else { if (cause == null) { cause = new ClosedChannelException(); } currentWrite.fail(cause); } } }
Source:
public void time() throws Exception { TimeStat stat = new TimeStat(ticker); stat.time((Callable<Void>) () -> { ticker.increment(10, TimeUnit.MILLISECONDS); return null; }); TimeDistribution allTime = stat.getAllTime(); assertEquals(allTime.getCount(), 1.0); assertEquals(allTime.getMin(), 0.010); assertEquals(allTime.getMax(), 0.010); }

Target:
public void time() throws Exception { TimeStat stat = new TimeStat(ticker); stat.time(() -> { ticker.increment(10, TimeUnit.MILLISECONDS); return null; }); TimeDistribution allTime = stat.getAllTime(); assertEquals(allTime.getCount(), 1.0); assertEquals(allTime.getMin(), 0.010); assertEquals(allTime.getMax(), 0.010); }
Source:
public SlackTextMessage execute(String... args) { SecurityContext ctx = ACL.impersonate(ACL.SYSTEM); String response = "*Projects:*\n"; Jenkins j = Jenkins.getInstance(); if (j == null) { throw new IllegalStateException(); } List<AbstractProject> jobs = j.getAllItems(AbstractProject.class); SecurityContextHolder.setContext(ctx); StringBuffer buf = new StringBuffer(); for (AbstractProject job : jobs) { if (job.isBuildable()) { AbstractBuild lastBuild = job.getLastBuild(); String buildNumber = "TBD"; String status = "TBD"; if (lastBuild != null) { buildNumber = Integer.toString(lastBuild.getNumber()); if (lastBuild.isBuilding()) { status = "BUILDING"; } Result result = lastBuild.getResult(); if (result != null) { status = result.toString(); } } if (jobs.size() <= 10) { buf.append(">*") .append(job.getDisplayName()) .append("*\n>*Last Build:* #") .append(buildNumber) .append("\n>*Status:* ") .append(status) .append("\n\n\n"); } else { buf.append(">*") .append(job.getDisplayName()) .append("* :: *Last Build:* #") .append(buildNumber) .append(" :: *Status:* ") .append(status) .append("\n\n"); } } } response += buf.toString(); if (jobs.size() == 0) response += ">_No projects found_"; return new SlackTextMessage(response); }

Target:
public SlackTextMessage execute(String... args) { SecurityContext ctx = ACL.impersonate(ACL.SYSTEM); Jenkins jenkins = Jenkins.getActiveInstance(); List<AbstractProject> jobs = jenkins.getAllItems(AbstractProject.class); SecurityContextHolder.setContext(ctx); StringBuilder builder = new StringBuilder("*Projects:*\n"); for (AbstractProject job : jobs) { if (job.isBuildable()) { AbstractBuild lastBuild = job.getLastBuild(); String buildNumber = "TBD"; String status = "TBD"; if (lastBuild != null) { buildNumber = Integer.toString(lastBuild.getNumber()); if (lastBuild.isBuilding()) { status = "BUILDING"; } Result result = lastBuild.getResult(); if (result != null) { status = result.toString(); } } if (jobs.size() <= 10) { builder.append(">*") .append(job.getDisplayName()) .append("*\n>*Last Build:* #") .append(buildNumber) .append("\n>*Status:* ") .append(status) .append("\n\n\n"); } else { builder.append(">*") .append(job.getDisplayName()) .append("* :: *Last Build:* #") .append(buildNumber) .append(" :: *Status:* ") .append(status) .append("\n\n"); } } } if (jobs.size() == 0) builder.append(">_No projects found_"); return new SlackTextMessage(builder.toString()); }
Source:
@Override public synchronized void close() { closed = true; asyncRunner.shutdown(); try { asyncRunner.awaitTermination(EXECUTOR_SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException ignore) { } if (channels.get() != null) { for (ClientChannelHolder hld: channels.get()) hld.close(); } }

Target:
@Override public synchronized void close() { closed = true; asyncRunner.shutdown(); try { asyncRunner.awaitTermination(EXECUTOR_SHUTDOWN_TIMEOUT, TimeUnit.MILLISECONDS); } catch (InterruptedException ignore) { } List<ClientChannelHolder> holders = channels; if (holders != null) { for (ClientChannelHolder hld: holders) hld.close(); } }
Source:
public PageProjectionOutput project(ConnectorSession session, DriverYieldSignal yieldSignal, Page page, SelectedPositions selectedPositions) { blockBuilder = blockBuilder.newBlockBuilderLike(new BlockBuilderStatus()); try { return pageProjectionOutputClass .getDeclaredConstructor(BlockBuilder.class, ConnectorSession.class, DriverYieldSignal.class, Page.class, SelectedPositions.class) .newInstance(blockBuilder, session, yieldSignal, page, selectedPositions); } catch (ReflectiveOperationException e) { throw new RuntimeException(e); } }

Target:
public PageProjectionOutput project(ConnectorSession session, DriverYieldSignal yieldSignal, Page page, SelectedPositions selectedPositions) { blockBuilder = blockBuilder.newBlockBuilderLike(new BlockBuilderStatus()); try { return (PageProjectionOutput) pageProjectionOutputFactory.invoke(blockBuilder, session, yieldSignal, page, selectedPositions); } catch (Throwable e) { throw new RuntimeException(e); } }
Source:
public void setFieldName(String name) { if(state == null) { if (name.equals("imports")) { if(seenImports) throw new UnsupportedOperationException("Two import declarations found."); state = State.preImp; } else if (name.equals("symbols")) { if(decSymbols.size() > 0) throw new UnsupportedOperationException("Two symbol list declarations found."); state = State.preSym; } else { throw new UnsupportedOperationException(); } } else if(state == State.impDesc) { if(name.equals("name")) { state = State.impName; } else if(name.equals("version")) { state = State.impVer; } else if(name.equals("max_id")) { state = State.impMID; } } else { throw new UnsupportedOperationException(); } }

Target:
public void setFieldName(String name) { if(state == State.LST_STRUCT) { if (name.equals("imports")) { if(seenImports) throw new UnsupportedOperationException("Two import declarations found."); state = State.PRE_IMPORT_LIST; } else if (name.equals("symbols")) { if(seenSymbols) throw new UnsupportedOperationException("Two symbol list declarations found."); state = State.PRE_SYMBOL_LIST; } else { throw new UnsupportedOperationException(); } } else if(state == State.IMPORT_DESCRIPTOR) { if(name.equals("name")) { state = State.IMPORT_NAME; } else if(name.equals("version")) { state = State.IMPORT_VERSION; } else if(name.equals("max_id")) { state = State.IMPORT_MAX_ID; } } else { throw new UnsupportedOperationException(); } }
Source:
private void setUpGameWorlds() { gameWorlds.subscribeSelection((widget, worldInfo) -> { if (worldInfo == null) { return; } descriptionTitle.setText(translationSystem.translate("${engine:menu#game-details-world-description}")); description.setText(getWorldDescription(worldInfo)); gameModules.setSelection(null); biomes.setSelection(null); blocks.setSelection(null); }); gameWorlds.setItemRenderer(new AbstractItemRenderer<WorldInfo>() { @Override public void draw(WorldInfo value, Canvas canvas) { if(value.getCustomTitle().isEmpty()==true) { canvas.drawText(value.getTitle()); } else { canvas.drawText(value.getCustomTitle()); } } @Override public Vector2i getPreferredSize(WorldInfo value, Canvas canvas) { String text = value.getCustomTitle(); return new Vector2i(canvas.getCurrentStyle().getFont().getWidth(text), canvas.getCurrentStyle().getFont().getLineHeight()); } }); }

Target:
private void setUpGameWorlds() { gameWorlds.subscribeSelection((widget, worldInfo) -> { if (worldInfo == null) { return; } descriptionTitle.setText(translationSystem.translate("${engine:menu#game-details-world-description}")); description.setText(getWorldDescription(worldInfo)); gameModules.setSelection(null); biomes.setSelection(null); blocks.setSelection(null); }); gameWorlds.setItemRenderer(new AbstractItemRenderer<WorldInfo>() { @Override public void draw(WorldInfo value, Canvas canvas) { if(value.getCustomTitle().isEmpty()) { canvas.drawText(value.getTitle()); } else { canvas.drawText(value.getCustomTitle()); } } @Override public Vector2i getPreferredSize(WorldInfo value, Canvas canvas) { String text = value.getCustomTitle(); return new Vector2i(canvas.getCurrentStyle().getFont().getWidth(text), canvas.getCurrentStyle().getFont().getLineHeight()); } }); }
Source:
public PotionRemoveEvent(EntityLivingBase living, Potion potion) { super(living, living.getActivePotionMap().get(potion)); toRemove = potion; }

Target:
public PotionRemoveEvent(EntityLivingBase living, Potion potion) { super(living, living.getActivePotionMap().get(potion)); this.potion = potion; }