auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public KeyAwareLockPromise lockAll(Collection<?> keys, Object lockOwner, long time, TimeUnit unit) { Objects.requireNonNull(keys, "Keys must be non null"); Objects.requireNonNull(lockOwner, "Lock owner must be non null"); Objects.requireNonNull(unit, "Time unit must be non null"); if (keys.isEmpty()) { if (trace) { log.tracef("Lock all: no keys found for owner=%s", lockOwner); } return KeyAwareLockPromise.NO_OP; } else if (keys.size() == 1) { return lock(keys.iterator().next(), lockOwner, time, unit); } final Set<Object> uniqueKeys = filterDistinctKeys(keys); if (uniqueKeys.size() == 1) { return lock(uniqueKeys.iterator().next(), lockOwner, time, unit); } if (trace) { log.tracef("Lock all keys=%s for owner=%s. timeout=%s (%s)", toStr(uniqueKeys), lockOwner, time, unit); } <START> final CompositeLockPromise compositeLockPromise = new CompositeLockPromise(uniqueKeys.size(), blockingExecutor); <END> synchronized (this) { for (Object key : uniqueKeys) { compositeLockPromise.addLock(new KeyAwareExtendedLockPromise(lockContainer.acquire(key, lockOwner, time, unit), key, unit.toMillis(time))); } } compositeLockPromise.scheduleLockTimeoutTask(scheduler, time, unit); compositeLockPromise.markListAsFinal(); return compositeLockPromise; }</code><technical_language>I execution needs stay a non-blocking thread here, needs a new thread thread unlocked keys continue executing (possibly unlocking other keys, sending a response). in PerKeyLockContainer StripedLockContainer</technical_language>

Target:
public KeyAwareLockPromise lockAll(Collection<?> keys, Object lockOwner, long time, TimeUnit unit) { Objects.requireNonNull(keys, "Keys must be non null"); Objects.requireNonNull(lockOwner, "Lock owner must be non null"); Objects.requireNonNull(unit, "Time unit must be non null"); if (keys.isEmpty()) { if (trace) { log.tracef("Lock all: no keys found for owner=%s", lockOwner); } return KeyAwareLockPromise.NO_OP; } else if (keys.size() == 1) { return lock(keys.iterator().next(), lockOwner, time, unit); } final Set<Object> uniqueKeys = filterDistinctKeys(keys); if (uniqueKeys.size() == 1) { return lock(uniqueKeys.iterator().next(), lockOwner, time, unit); } if (trace) { log.tracef("Lock all keys=%s for owner=%s. timeout=%s (%s)", toStr(uniqueKeys), lockOwner, time, unit); } final CompositeLockPromise compositeLockPromise = new CompositeLockPromise(uniqueKeys.size(), nonBlockingExecutor); synchronized (this) { for (Object key : uniqueKeys) { compositeLockPromise.addLock(new KeyAwareExtendedLockPromise(lockContainer.acquire(key, lockOwner, time, unit), key, unit.toMillis(time))); } } compositeLockPromise.scheduleLockTimeoutTask(scheduler, time, unit); compositeLockPromise.markListAsFinal(); return compositeLockPromise; }
Source:
<code>IoFuture<Connection> getConnection(final EndpointImpl endpoint, final ConnectionKey key, final AuthenticationConfiguration authenticationConfiguration, boolean doConnect) { try { <START> pendingAttemptsLock.readLock().lock(); <END> if (authenticationConfiguration.equals(this.authenticationConfiguration)) { return attempt; } else { FutureResult<Connection> futureResult = pendingAttempts.get(authenticationConfiguration); if (futureResult != null) { return futureResult.getIoFuture(); } else { if (! doConnect) { return null; } futureResult = new FutureResult<>(endpoint.getExecutor()); final FutureResult<Connection> appearing = pendingAttempts.putIfAbsent(authenticationConfiguration, futureResult); if (appearing != null) { return appearing.getIoFuture(); } } assert doConnect; final IoFuture<Connection> ioFuture = futureResult.getIoFuture(); final AtomicBoolean cancelFlag = new AtomicBoolean(); final FutureResult<Connection> finalFutureResult = futureResult; futureResult.addCancelHandler(new Cancellable() { public Cancellable cancel() { cancelFlag.set(true); finalFutureResult.setCancelled(); return this; } }); return ioFuture; } } finally { pendingAttemptsLock.readLock().unlock(); } }</code><technical_language>note: * Lock acquisition happen try, if lock fails for reason, unlock is called thread lock, causing IllegalMonitorStateException similar. * ReentrantReadWriteLock is heavy for this usage of block is short-lived non-blocking. drop a plain map synchronized, revisit if is substantial contention</technical_language>

Target:
IoFuture<Connection> getConnection(final EndpointImpl endpoint, final ConnectionKey key, final AuthenticationConfiguration authenticationConfiguration, boolean doConnect) { synchronized (pendingAttempts) { if (authenticationConfiguration.equals(this.authenticationConfiguration)) { return attempt; } else { FutureResult<Connection> futureResult = pendingAttempts.get(authenticationConfiguration); if (futureResult != null) { return futureResult.getIoFuture(); } else { if (! doConnect) { return null; } futureResult = new FutureResult<>(endpoint.getExecutor()); pendingAttempts.put(authenticationConfiguration, futureResult); } assert doConnect; final IoFuture<Connection> ioFuture = futureResult.getIoFuture(); final AtomicBoolean cancelFlag = new AtomicBoolean(); final FutureResult<Connection> finalFutureResult = futureResult; futureResult.addCancelHandler(new Cancellable() { public Cancellable cancel() { cancelFlag.set(true); finalFutureResult.setCancelled(); return this; } }); return ioFuture; } } }
Source:
<code>public Value<Entity> vehicle() { <START> return new SpongeValue<Entity>(Keys.VEHICLE, vehicle); <END> }</code><technical_language>~~Use SpongeEntityValue here.~~ ~~Hmm, I need some changes class.~~ Nevermind</technical_language>

Target:
public Value<Entity> vehicle() { return new SpongeEntityValue(Keys.VEHICLE, vehicle.get()); }
Source:
<code>public PngChunkText(final int length, final int chunkType, final int crc, final byte[] bytes) throws ImageReadException, IOException { super(length, chunkType, crc, bytes); final int index = findNull(bytes); if (index < 0) { throw new ImageReadException( "PNG tEXt chunk keyword is not terminated."); } keyword = new String(bytes, 0, index, StandardCharsets.ISO_8859_1); final int textLength = bytes.length - (index + 1); text = new String(bytes, index + 1, textLength, StandardCharsets.ISO_8859_1); <START> if (LOGGER.isLoggable(Level.FINE)) { <END> LOGGER.fine("Keyword: " + keyword); LOGGER.fine("Text: " + text); } }</code><technical_language>Uhg, JUL level names AWFUL :=(</technical_language>

Target:
public PngChunkText(final int length, final int chunkType, final int crc, final byte[] bytes) throws ImageReadException, IOException { super(length, chunkType, crc, bytes); final int index = findNull(bytes); if (index < 0) { throw new ImageReadException( "PNG tEXt chunk keyword is not terminated."); } keyword = new String(bytes, 0, index, StandardCharsets.ISO_8859_1); final int textLength = bytes.length - (index + 1); text = new String(bytes, index + 1, textLength, StandardCharsets.ISO_8859_1); if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("Keyword: " + keyword); LOGGER.finest("Text: " + text); } }
Source:
<code>public static int findOpenPort(int basePort) { <START> final int startPort = basePort == -1 ? -1 : rnd.nextInt(0x7fff) + basePort; <END> return findOpenPortFrom(startPort); }</code><technical_language>this check for negatives instead of -1</technical_language>

Target:
public static int findOpenPort(int basePort) { final int startPort = basePort < 0 ? -1 : rnd.nextInt(0x7fff) + basePort; return findOpenPortFrom(startPort); }
Source:
<code>public Guid getHostForExecution(Guid poolId, Collection<Guid> hostsToFilter) { return getHostForExecution(poolId, vds -> <START> !hostsToFilter.contains(vds)); <END> }</code><technical_language>check for VDS in collection of Guids vds.getId()</technical_language>

Target:
public Guid getHostForExecution(Guid poolId, Collection<Guid> hostsToFilter) { return getHostForExecution(poolId, vds -> !hostsToFilter.contains(vds.getId())); }
Source:
<code>public void testWarningsAreAvailableAsap() throws SQLException, InterruptedException, ExecutionException { con.createStatement() .execute("CREATE OR REPLACE FUNCTION notify_then_sleep() RETURNS VOID AS " + "$BODY$ " + "BEGIN " + "RAISE NOTICE 'Test 1'; " + "RAISE NOTICE 'Test 2'; " + "EXECUTE pg_sleep(2); " + "END " + "$BODY$ " + "LANGUAGE plpgsql;"); con.createStatement().execute("SET SESSION client_min_messages = 'NOTICE'"); final PreparedStatement preparedStatement = con.prepareStatement("SELECT notify_then_sleep()"); final AtomicReference<SQLWarning> warning = new AtomicReference<SQLWarning>(); ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1); ScheduledFuture<?> future = executorService.schedule(new Runnable() { @Override public void run() { try { <START> warning.set(preparedStatement.getWarnings()); <END> } catch (SQLException e) { fail("Exception thrown: " + e.getMessage()); } } }, 1000, TimeUnit.MILLISECONDS); preparedStatement.execute(); future.get(); executorService.shutdown(); assertNotNull(warning.get()); assertEquals(warning.get().getMessage(), "Test 1"); assertEquals(warning.get().getNextWarning().getMessage(), "Test 2"); }</code><technical_language>this return preparedStatement.getWarnings() (and AtomicReference removed)</technical_language>

Target:
public void testWarningsAreAvailableAsap() throws Exception { final Connection outerLockCon = TestUtil.openDB(); outerLockCon.setAutoCommit(false); outerLockCon.createStatement().execute("LOCK TABLE test_lock IN ACCESS EXCLUSIVE MODE;"); con.createStatement() .execute("CREATE OR REPLACE FUNCTION notify_then_sleep() RETURNS VOID AS " + "$BODY$ " + "BEGIN " + "RAISE NOTICE 'Test 1'; " + "RAISE NOTICE 'Test 2'; " + "LOCK TABLE test_lock IN ACCESS EXCLUSIVE MODE; " + "END " + "$BODY$ " + "LANGUAGE plpgsql;"); con.createStatement().execute("SET SESSION client_min_messages = 'NOTICE'"); con.createStatement().execute("SET SESSION statement_timeout = 1000"); final PreparedStatement preparedStatement = con.prepareStatement("SELECT notify_then_sleep()"); final Callable<Void> warningReader = new Callable<Void>() { @Override public Void call() throws SQLException, InterruptedException { while (true) { SQLWarning warning = preparedStatement.getWarnings(); if (warning != null) { assertEquals("First warning received not first notice raised", "Test 1", warning.getMessage()); SQLWarning next = warning.getNextWarning(); if (next != null) { assertEquals("Second warning received not second notice raised", "Test 2", next.getMessage()); outerLockCon.commit(); return null; } } Thread.sleep(0); } } }; ExecutorService executorService = Executors.newSingleThreadExecutor(); try { Future<Void> future = executorService.submit(warningReader); preparedStatement.execute(); future.get(2, TimeUnit.SECONDS); } finally { executorService.shutdownNow(); } }
Source:
<code>public Response getHistogram(@QueryParam("queryId") final Long queryId, @QueryParam("fragmentId") final Long fragmentId, @QueryParam("start") final Long start, @QueryParam("end") final Long end, @QueryParam("step") final Long step, @DefaultValue("true") @QueryParam("onlyRootOp") final boolean onlyRootOp, @Context final UriInfo uriInfo) throws DbException { Preconditions.checkArgument(queryId != null, "Missing required field queryId."); Preconditions.checkArgument(fragmentId != null, "Missing required field fragmentId."); Preconditions.checkArgument(start != null, "Missing required field start."); Preconditions.checkArgument(end != null, "Missing required field end."); Preconditions.checkArgument(step != null, "Missing required field step."); ResponseBuilder response = Response.ok(); response.type(MediaType.TEXT_PLAIN); PipedOutputStream writerOutput = new PipedOutputStream(); PipedInputStream input; try { input = new PipedInputStream(writerOutput, MyriaConstants.DEFAULT_PIPED_INPUT_STREAM_SIZE); } catch (IOException e) { throw new DbException(e); } PipedStreamingOutput entity = new PipedStreamingOutput(input); response.entity(entity); TupleWriter writer = new CsvTupleWriter(writerOutput); <START> try { <END> server.startHistogramDataStream(queryId, fragmentId, start, end, step, onlyRootOp, writer); } catch (IllegalArgumentException e) { throw new MyriaApiException(Status.BAD_REQUEST, e); } return response.build(); }</code><technical_language>.. wow refactoring job is save a lot of boilerplate</technical_language>

Target:
public Response getHistogram(@QueryParam("queryId") final Long queryId, @QueryParam("fragmentId") final Long fragmentId, @QueryParam("start") final Long start, @QueryParam("end") final Long end, @QueryParam("step") final Long step, @DefaultValue("true") @QueryParam("onlyRootOp") final boolean onlyRootOp, @Context final UriInfo uriInfo) throws DbException { Preconditions.checkArgument(queryId != null, "Missing required field queryId."); Preconditions.checkArgument(fragmentId != null, "Missing required field fragmentId."); Preconditions.checkArgument(start != null, "Missing required field start."); Preconditions.checkArgument(end != null, "Missing required field end."); Preconditions.checkArgument(step != null, "Missing required field step."); ResponseBuilder response = Response.ok(); response.type(MediaType.TEXT_PLAIN); PipedOutputStream writerOutput = new PipedOutputStream(); PipedInputStream input; try { input = new PipedInputStream(writerOutput, MyriaConstants.DEFAULT_PIPED_INPUT_STREAM_SIZE); } catch (IOException e) { throw new DbException(e); } PipedStreamingOutput entity = new PipedStreamingOutput(input); response.entity(entity); TupleWriter writer = new CsvTupleWriter(writerOutput); server.startHistogramDataStream(queryId, fragmentId, start, end, step, onlyRootOp, writer); return response.build(); }
Source:
<code>public IApsEntity getEntityPrototype() { Content content = (Content) super.getEntityPrototype(); <START> content.setStatus(STATUS_DRAFT); <END> content.setVersion(INIT_VERSION); content.setViewPage(viewPage); content.setListModel(listModel); content.setDefaultModel(defaultModel); return content; }</code><technical_language>status of prototype "new", draft is status editor apply a content</technical_language>

Target:
public IApsEntity getEntityPrototype() { Content content = (Content) super.getEntityPrototype(); content.setStatus(STATUS_NEW); content.setVersion(INIT_VERSION); content.setViewPage(viewPage); content.setListModel(listModel); content.setDefaultModel(defaultModel); return content; }
Source:
<code>public void convert() { String value = "2010-12-07T00:00:00Z"; <START> assertEquals(new LocalDate(2010, 12, 07), converter.convert(value)); <END> }</code><technical_language>issue. for is a weird 7 in octal numeral system</technical_language>

Target:
public void convert() { String value = "2010-12-07T00:00:00Z"; assertEquals(new LocalDate(2010, 12, 7), converter.convert(value)); }
Source:
<code>protected void doDelete(){ final String name = group.getName(); AuthorizationPolicy authzPolicy = permissionManager.getAuthorizationPolicy(); authorizationService.call(r -> { <START> deleteGroupEvent.fire(new DeleteGroupEvent(name)); <END> workbenchNotification.fire(new NotificationEvent(UsersManagementWidgetsConstants.INSTANCE.groupRemoved(name), INFO)); }, errorCallback).deletePolicyByGroup(group, authzPolicy); }</code><technical_language>done in doSave method, consider calling showLoadingBox service call hideLoadingBox in callback</technical_language>

Target:
protected void doDelete(){ final String name = group.getName(); AuthorizationPolicy authzPolicy = permissionManager.getAuthorizationPolicy(); showLoadingBox(); authorizationService.call(r -> { hideLoadingBox(); deleteGroupEvent.fire(new DeleteGroupEvent(name)); workbenchNotification.fire(new NotificationEvent(UsersManagementWidgetsConstants.INSTANCE.groupRemoved(name), INFO)); }, errorCallback).deletePolicyByGroup(group, authzPolicy); }
Source:
<code>public FileChannel newChannel(ChannelPipeline pipeline) { <START> return new FileChannel(this, pipeline, new FileChannelSink()); <END> }</code><technical_language>FileChannelSink factory, channel</technical_language>

Target:
public FileChannel newChannel(ChannelPipeline pipeline) { return new FileChannel(this, pipeline, fileChannelSink); }
Source:
<code>public void ArticleCRUDUser_001_addBySpecialPage() { WikiBasePageObject base = new WikiBasePageObject(driver); String articleContent = PageContent.articleText; String articleTitle = PageContent.articleNamePrefix + base.getTimeStamp(); SpecialCreatePagePageObject specialCreatePage = base.openSpecialCreatePage(wikiURL); VisualEditModePageObject visualEditMode = specialCreatePage.populateTitleField(articleTitle); visualEditMode.addContent(articleContent); <START> ArticlePageObject article = (ArticlePageObject) visualEditMode.submit(PageType.Article); <END> article.verifyContent(articleContent); article.verifyArticleTitle(articleTitle); }</code><technical_language>casting baaaad</technical_language>

Target:
public void ArticleCRUDUser_001_addBySpecialPage() { WikiBasePageObject base = new WikiBasePageObject(driver); String articleContent = PageContent.articleText; String articleTitle = PageContent.articleNamePrefix + base.getTimeStamp(); SpecialCreatePagePageObject specialCreatePage = base.openSpecialCreatePage(wikiURL); VisualEditModePageObject visualEditMode = specialCreatePage.populateTitleField(articleTitle); visualEditMode.addContent(articleContent); ArticlePageObject article = visualEditMode.submitArticle(); article.verifyContent(articleContent); article.verifyArticleTitle(articleTitle); }
Source:
<code>private void changeSchedulerVer(Integer ver) throws ConfirmModSchemaException { if (ver == schedVer()) { return; } if (!fSupportedSchedulerVersions.contains(ver)) { throw new RuntimeException("Unsupported scheduler version"); } modSchema(true); SchedV2 v2Sched = new SchedV2(this); if (ver == 1) { <START> v2Sched.moveToV1() <END> } else { v2Sched.moveToV2(); } try { mConf.put("schedVer", ver); } catch (JSONException e) { throw new RuntimeException(e); } setMod(); _loadScheduler(); }</code><technical_language>missing a semi-colon here, this compile</technical_language>

Target:
private void changeSchedulerVer(Integer ver) throws ConfirmModSchemaException { if (ver == schedVer()) { return; } if (!fSupportedSchedulerVersions.contains(ver)) { throw new RuntimeException("Unsupported scheduler version"); } modSchema(true); SchedV2 v2Sched = new SchedV2(this); if (ver == 1) { v2Sched.moveToV1(); } else { v2Sched.moveToV2(); } try { mConf.put("schedVer", ver); } catch (JSONException e) { throw new RuntimeException(e); } setMod(); _loadScheduler(); }
Source:
<code>public Promise getContent() { flush(); <START> displayNotifications(false); <END> AbstractCanvasHandler canvasHandler = (AbstractCanvasHandler) getCanvasHandler(); validator.validate(canvasHandler, violations -> { if (!violations.isEmpty()) { List<String> violationMessages = new ArrayList<>(); for (DiagramElementViolation<RuleViolation> next : violations) { final Collection<DomainViolation> domainViolations = next.getDomainViolations(); domainViolations.forEach(item -> violationMessages.add("Error: " + item.getUUID() + " - " + item.getMessage() + " - " + item.getViolationType())); } getEditor().getSessionPresenter().getView().showWarning("Errors: " + violationMessages); } }); displayNotifications(true); return diagramServices.transform(getEditor().getEditorProxy().getContentSupplier().get()); }</code><technical_language>displayNotifications set false, set true end of this method? tricky... I expecting a single (unique) call setting displayNotifications = false, presenter instance is loaded for time, need for more calls. call getEditor().getSessionPresenter().getView().showWarning(...); work anyway, it</technical_language>

Target:
public Promise getContent() { flush(); getSessionPresenter().displayNotifications(t -> false); AbstractCanvasHandler canvasHandler = (AbstractCanvasHandler) getCanvasHandler(); validator.validate(canvasHandler, violations -> { String errorMessage = getTranslationService().getValue(StunnerWidgetsConstants.MarshallingResponsePopup_ErrorMessageLabel); if (!violations.isEmpty()) { List<String> violationMessages = new ArrayList<>(); for (DiagramElementViolation<RuleViolation> next : violations) { final Collection<DomainViolation> domainViolations = next.getDomainViolations(); domainViolations.forEach(item -> violationMessages.add(errorMessage + ": " + item.getUUID() + " - " + item.getMessage() + " - " + item.getViolationType())); } getEditor().getSessionPresenter().getView().showWarning(errorMessage + "(s): " + violationMessages); } }); getSessionPresenter().displayNotifications(t -> true); return diagramServices.transform(getEditor().getEditorProxy().getContentSupplier().get()); }
Source:
<code><START> public synchronized static <T> EventType<T> addCustomEventType(String name, Class<T> listenerClass) { <END> if ( name == null || listenerClass == null ) { throw new HibernateException( "Custom EventType name and associated class must be non-null." ); } final EventType existingEventType = EVENT_TYPE_BY_NAME_MAP.get( name ); if ( existingEventType != null ) { if ( listenerClass.equals( existingEventType.baseListenerInterface ) ) { LOG.warn( "EventType [" + name + "] with listener Class [" + listenerClass + "] was added more than once." ); return existingEventType; } else { throw new HibernateException( "Could not add EventType [" + name + "] with listener Class [" + "]. An EventType with that name already exists with listener [" + listenerClass.getName() + "]." ); } } else { final EventType<T> eventType = create( name, listenerClass ); EVENT_TYPE_BY_NAME_MAP.put( name, eventType ); LOG.info( "Added custom EventType: [" + name + "], ordinal=[" +eventType.ordinal + "], listener=[" + listenerClass + "]." ); return eventType; } }</code><technical_language>EVENT_TYPE_BY_NAME_MAP is safe for concurrent access; I added a synchronized this method, is correct performs write operations map. this implies need lock reads well; map changed HashMap a ConcurrentHashMap? Alternatively, I if map statically initialized discovering a service. If define a "CustomEventTypeContributor" interface, Hibernate RX implement load this class is initialized</technical_language>

Target:
public static synchronized <T> EventType<T> addCustomEventType(String name, Class<T> listenerClass) { if ( name == null || listenerClass == null ) { throw new HibernateException( "Custom EventType name and associated class must be non-null." ); } final EventType eventType = EVENT_TYPE_BY_NAME_MAP.computeIfAbsent( name, ( e -> { final EventType eventTypeNew = EventType.create( name, listenerClass ); LOG.debugf( "Added custom EventType: [%s], ordinal=[%d], listener=[%s].", name, eventTypeNew.ordinal, listenerClass.toString() ); return eventTypeNew; } ) ); if ( !listenerClass.equals( eventType.baseListenerInterface ) ) { throw new HibernateException( "Could not add EventType [" + name + "] with listener Class [" + "]. An EventType with that name already exists with listener [" + listenerClass.getName() + "]." ); } return eventType; }
Source:
<code>public static Media from(MwQueryPage page) { ImageInfo imageInfo = page.imageInfo(); if (imageInfo == null) { return null; } String imagedescription; try { imagedescription = imageInfo.getMetadata().imageDescription().value(); } catch (NullPointerException e) { <START> imagedescription = "null"; <END> } Date dateCreated; try { dateCreated = DateUtils.getDateFromString(imageInfo.getMetadata().getDateTimeOriginal().value()); } catch (NullPointerException e) { dateCreated = new Date(); } Date dateUploaded; try { dateUploaded = DateUtils.getDateFromString(imageInfo.getMetadata().getDateTime().value()); } catch (NullPointerException e) { dateUploaded = new Date(); } String creator; try { creator = StringUtils.getParsedStringFromHtml(imageInfo.getMetadata().getArtist().value()); } catch (NullPointerException e) { creator = "null"; } Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), imagedescription, 0, dateCreated, dateUploaded, creator ); String license; try { license = imageInfo.getMetadata().getLicenseShortName().value(); } catch (NullPointerException e) { license = "null"; } media.setLicense(license); return media; }</code><technical_language>Return empty values instead. :)</technical_language>

Target:
public static Media from(MwQueryPage page) { ImageInfo imageInfo = page.imageInfo(); if (imageInfo == null) { return null; } String imagedescription; try { imagedescription = imageInfo.getMetadata().imageDescription().value(); } catch (NullPointerException e) { imagedescription = ""; } Date dateCreated; try { dateCreated = DateUtils.getDateFromString(imageInfo.getMetadata().getDateTimeOriginal().value()); } catch (NullPointerException e) { dateCreated = new Date(); } Date dateUploaded; try { dateUploaded = DateUtils.getDateFromString(imageInfo.getMetadata().getDateTime().value()); } catch (NullPointerException e) { dateUploaded = new Date(); } String creator; try { creator = StringUtils.getParsedStringFromHtml(imageInfo.getMetadata().getArtist().value()); } catch (NullPointerException e) { creator = ""; } Media media = new Media(null, imageInfo.getOriginalUrl(), page.title(), imagedescription, 0, dateCreated, dateUploaded, creator ); String license; try { license = imageInfo.getMetadata().getLicenseShortName().value(); } catch (NullPointerException e) { license = ""; } media.setLicense(license); return media; }
Source:
<code>private void handleAllocation(CorfuPayloadMsg<TokenRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { final TokenRequest req = msg.getPayload(); long newTail = globalLogTail + req.getNumTokens(); ImmutableMap.Builder<UUID, Long> backPointerMap = ImmutableMap.builder(); for (UUID id : req.getStreams()) { streamTailToGlobalTailMap.compute(id, (k, v) -> { if (v == null) { backPointerMap.put(k, Address.NON_EXIST); return newTail - 1; } else { backPointerMap.put(k, v); return newTail - 1; } <START> }); <END> streamsAddressSpaceMap.compute(id, (k, v) -> { if (v == null) { final Roaring64NavigableMap addressMap = new Roaring64NavigableMap(); for (long i=globalLogTail; i < newTail; i++) { addressMap.addLong(i); } return new StreamAddressSpace(Address.NON_EXIST, addressMap); } else { for (long i=globalLogTail; i < newTail; i++) { v.addAddress(i); } return v; } }); } if (req.getTxnResolution() != null) { req.getTxnResolution() .getWriteConflictParams() .forEach((key, value) -> { value.forEach(conflictParam -> cache.put(new ConflictTxStream(key, conflictParam), newTail - 1)); }); } log.trace("token backpointers {}", globalLogTail, backPointerMap.build()); Token token = new Token(sequencerEpoch, globalLogTail); globalLogTail = newTail; r.sendResponse(ctx, msg, CorfuMsgType.TOKEN_RES.payloadMsg( new TokenResponse(token, backPointerMap.build()))); }</code><technical_language>please reformat code</technical_language>

Target:
private void handleAllocation(CorfuPayloadMsg<TokenRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { final TokenRequest req = msg.getPayload(); long newTail = globalLogTail + req.getNumTokens(); ImmutableMap.Builder<UUID, Long> backPointerMap = ImmutableMap.builder(); for (UUID id : req.getStreams()) { streamTailToGlobalTailMap.compute(id, (k, v) -> { if (v == null) { backPointerMap.put(k, Address.NON_EXIST); return newTail - 1; } else { backPointerMap.put(k, v); return newTail - 1; } }); streamsAddressMap.compute(id, (streamId, addressMap) -> { if (addressMap == null) { addressMap = new StreamAddressSpace(Address.NON_ADDRESS, new Roaring64NavigableMap()); } for (long i = globalLogTail; i < newTail; i++) { addressMap.addAddress(i); } return addressMap; }); } if (req.getTxnResolution() != null) { req.getTxnResolution() .getWriteConflictParams() .forEach((key, value) -> { value.forEach(conflictParam -> cache.put(new ConflictTxStream(key, conflictParam), newTail - 1)); }); } log.trace("token backpointers {}", globalLogTail, backPointerMap.build()); Token token = new Token(sequencerEpoch, globalLogTail); globalLogTail = newTail; r.sendResponse(ctx, msg, CorfuMsgType.TOKEN_RES.payloadMsg( new TokenResponse(token, backPointerMap.build()))); }
Source:
<code>private synchronized CorfuGuid getCorrectedTimestamp() { long currentTimestamp = System.currentTimeMillis(); if (currentTimestamp == previousTimestamp) { resolutionCorrection++; if (resolutionCorrection > CorfuGuid.MAX_CORRECTION) { while (currentTimestamp == previousTimestamp) { currentTimestamp = System.currentTimeMillis(); } resolutionCorrection = 0; } <START> } else { <END> resolutionCorrection = 0; } if (currentTimestamp < previousTimestamp) { driftCorrection++; if (driftCorrection > CorfuGuid.MAX_CORRECTION) { log.info("updateInstanceId: Time went backward too many times "+ " timestamp={} previousTimestamp={} correction={} instanceId={}", currentTimestamp, previousTimestamp, driftCorrection, instanceId); driftCorrection = 0; updateInstanceId(); } } else if (driftCorrection > 0 && currentTimestamp > previousTimestamp) { CorfuGuid currentTs = new CorfuGuid(currentTimestamp, 0, 0, 0); CorfuGuid previousTs = new CorfuGuid(previousTimestamp, driftCorrection, 0, 0); if (currentTs.getLong() > previousTs.getLong()) { driftCorrection = 0; } } previousTimestamp = currentTimestamp; return new CorfuGuid(currentTimestamp, driftCorrection, resolutionCorrection, instanceId); }</code><technical_language>please move this line of code if condition. need this else block</technical_language>

Target:
private synchronized CorfuGuid getCorrectedTimestamp() { long currentTimestamp = System.currentTimeMillis(); if (currentTimestamp == previousTimestamp) { resolutionCorrection++; if (resolutionCorrection > CorfuGuid.MAX_CORRECTION) { while (currentTimestamp == previousTimestamp) { currentTimestamp = System.currentTimeMillis(); } resolutionCorrection = 0; } } else { resolutionCorrection = 0; } if (currentTimestamp < previousTimestamp) { driftCorrection++; if (driftCorrection > CorfuGuid.MAX_CORRECTION) { log.info("updateInstanceId: Time went backward too many times "+ " timestamp={} previousTimestamp={} correction={} instanceId={}", currentTimestamp, previousTimestamp, driftCorrection, instanceId); driftCorrection = 0; updateInstanceId(); } } previousTimestamp = currentTimestamp; return new CorfuGuid(currentTimestamp, driftCorrection, resolutionCorrection, instanceId); }
Source:
<code>public Iterable<Language> languages() { final RtJson rtJson = new RtJson( this.request.uri() .path("/languages") .back() ); final JsonObject json; try { json = rtJson.fetch(); <START> } catch (final IOException ex) { <END> throw new IllegalStateException(ex); } final List<Language> languages = new ArrayList<Language>(json.size()); for (final Map.Entry<String, JsonValue> value : json.entrySet()) { final String name = value.getKey(); languages.add( new RtLanguage( name, json.getJsonNumber(name).longValue() ) ); } return languages; }</code><technical_language>I this exception bubble declare in throws of method. this is other methods in library work</technical_language>

Target:
public Iterable<Language> languages() throws IOException { final RtJson json = new RtJson( this.request.uri() .path("/languages") .back() ); final JsonObject object = json.fetch(); final List<Language> languages = new ArrayList<Language>(object.size()); for (final Map.Entry<String, JsonValue> value : object.entrySet()) { final String name = value.getKey(); languages.add( new RtLanguage( name, object.getJsonNumber(name).longValue() ) ); } return languages; }
Source:
<code>public final void run() { CloseableRestResponse response = artifactResolver.get(url); <START> IOUtils.closeQuietly(response); <END> }</code><technical_language>I know, if this in code, a org.carlspring.strongbox.resource.ResourceCloser class. For consistency, I suggest instead, IOUtils is for (in case do a general refactoring). please change this this pull request</technical_language>

Target:
public final void run() { CloseableRestResponse response = artifactResolver.get(url); ResourceCloser.close(response, LOGGER); }
Source:
<code><START> public MethodRule methodRule1() { <END> return new Increment(); }</code><technical_language>this return Increment test code allows methods annotated @Rule return a subclass of MethodRule</technical_language>

Target:
public Increment methodRule1() { return new Increment(); }
Source:
<code>private boolean rowTypesAreEquivalent( MutableRel rel0, MutableRel rel1, Litmus litmus) { if (rel0.rowType.getFieldCount() != rel1.rowType.getFieldCount()) { return litmus.fail("Mismatch for column count: [{}]", Pair.of(rel0, rel1)); } for (Pair<RelDataTypeField, RelDataTypeField> pair : Pair.zip(rel0.rowType.getFieldList(), rel1.rowType.getFieldList())) { if (!pair.left.getType().equals(pair.right.getType())) { <START> return litmus.fail("Mismatch for column type: [{}]", Pair.of(rel0, rel1)); <END> } } return litmus.succeed(); }</code><technical_language>give a test case, thanks</technical_language>

Target:
static boolean rowTypesAreEquivalent( MutableRel rel0, MutableRel rel1, Litmus litmus) { if (rel0.rowType.getFieldCount() != rel1.rowType.getFieldCount()) { return litmus.fail("Mismatch for column count: [{}]", Pair.of(rel0, rel1)); } for (Pair<RelDataTypeField, RelDataTypeField> pair : Pair.zip(rel0.rowType.getFieldList(), rel1.rowType.getFieldList())) { if (!pair.left.getType().equals(pair.right.getType())) { return litmus.fail("Mismatch for column type: [{}]", Pair.of(rel0, rel1)); } } return litmus.succeed(); }
Source:
<code>public void edit(final NetworkAttachmentModel object) { driver.edit(object); qosWidget.edit(object.getQosModel()); enableDisableByBootProtocol(object); object.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { NetworkAttachmentModel model = (NetworkAttachmentModel) sender; String propertyName = args.propertyName; if ("BootProtocolsAvailable".equals(propertyName)) { enableDisableByBootProtocol(model); } } }); if (object.getIsToSync().getIsChangable()) { isToSyncInfo.setVisible(true); } customPropertiesTab.setVisible(object.getCustomPropertiesModel().getIsAvailable()); customPropertiesWidget.edit(object.getCustomPropertiesModel()); customPropertiesLabel.setEnabled(object.getCustomPropertiesModel().getIsChangable()); <START> dnsConfigurationTab.setVisible(true); <END> dnsConfigurationWidget.edit(object.getDnsConfigurationModel()); }</code><technical_language>is this necessary? Is tab hidden</technical_language>

Target:
public void edit(final NetworkAttachmentModel object) { driver.edit(object); qosWidget.edit(object.getQosModel()); enableDisableByBootProtocol(object); object.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { NetworkAttachmentModel model = (NetworkAttachmentModel) sender; String propertyName = args.propertyName; if ("BootProtocolsAvailable".equals(propertyName)) { enableDisableByBootProtocol(model); } } }); if (object.getIsToSync().getIsChangable()) { isToSyncInfo.setVisible(true); } customPropertiesTab.setVisible(object.getCustomPropertiesModel().getIsAvailable()); customPropertiesWidget.edit(object.getCustomPropertiesModel()); customPropertiesLabel.setEnabled(object.getCustomPropertiesModel().getIsChangable()); dnsConfigurationWidget.edit(object.getDnsConfigurationModel()); }
Source:
<code>public String resolveExpressions( final String value, final String... activeProfileIds ) { if ( !containsExpression( value ) ) { return value; } <START> List<String> prefixs = new ArrayList<>(); <END> prefixs.add( PrefixAwareRecursionInterceptor.DEFAULT_START_TOKEN ); PrefixAwareRecursionInterceptor ri = new PrefixAwareRecursionInterceptor( prefixs ); return resolveExpressions( value, ri, activeProfileIds ); }</code><technical_language>do null check in resolveExpressions(String, RecursionInterceptor, String...) anyway, move this method, call a null ri here..</technical_language>

Target:
public String resolveExpressions( final String value, final String... activeProfileIds ) { if ( !containsExpression( value ) ) { return value; } return resolveExpressions( value, null, activeProfileIds ); }
Source:
<code><START> protected void onUnhandledInboundMessage(ChannelHandlerContext ctx, Object msg) { <END> try { if (logger.isDebugEnabled()) { logger.debug( "Discarded inbound message that reached at the tail of the pipeline {}. Channel : {}. " + "Please check your pipeline configuration.", msg, ctx.pipeline().names(), ctx.channel()); } } finally { ReferenceCountUtil.release(msg); } }</code><technical_language>this is public API do this this is a breaking change :/</technical_language>

Target:
protected void onUnhandledInboundMessage(ChannelHandlerContext ctx, Object msg) { onUnhandledInboundMessage(msg); if (logger.isDebugEnabled()) { logger.debug("Discarded message pipeline : {}. Channel : {}.", ctx.pipeline().names(), ctx.channel()); } }
Source:
<code><START> private IssuesRecorder enableCheckStyle(final FreeStyleProject job, boolean setRunAlways) { <END> IssuesRecorder publisher = new IssuesRecorder(); publisher.setEnabledForFailure(setRunAlways); publisher.setTools( Collections.singletonList(new ToolConfiguration("**/checkstyle-result.xml", new CheckStyle()))); job.getPublishersList().add(publisher); return publisher; }</code><technical_language>final</technical_language>

Target:
final private IssuesRecorder enableCheckStyle(final FreeStyleProject job, boolean setRunAlways) { IssuesRecorder publisher = new IssuesRecorder(); publisher.setEnabledForFailure(setRunAlways); publisher.setTools( Collections.singletonList(new ToolConfiguration("**/*issues.txt", new CheckStyle()))); job.getPublishersList().add(publisher); return publisher; }
Source:
<code>private DataGeneratorFactory createDataGeneratorFactory() { DataGeneratorFactoryBuilder builder = new DataGeneratorFactoryBuilder(getContext(), dataFormat.getGeneratorFormat()); if(charset == null || charset.trim().isEmpty()) { charset = "UTF-8"; } builder.setCharset(Charset.forName(charset)); switch(dataFormat) { case JSON: builder.setMode(jsonMode); break; case DELIMITED: builder.setMode(csvFileFormat); builder.setMode(csvHeader); builder.setConfig(DelimitedDataGeneratorFactory.REPLACE_NEWLINES_KEY, csvReplaceNewLines); break; case TEXT: builder.setConfig(TextDataGeneratorFactory.FIELD_PATH_KEY, textFieldPath); builder.setConfig(TextDataGeneratorFactory.EMPTY_LINE_IF_NULL_KEY, textEmptyLineIfNull); break; case SDC_JSON: break; case AVRO: builder.setConfig(AvroDataGeneratorFactory.SCHEMA_KEY, avroSchema); break; case XML: default: <START> throw new IllegalStateException(Utils.format("Unknown date format error :{}")); <END> } return builder.build(); }</code><technical_language>This message is missing argument</technical_language>

Target:
private DataGeneratorFactory createDataGeneratorFactory() { DataGeneratorFactoryBuilder builder = new DataGeneratorFactoryBuilder(getContext(), dataFormat.getGeneratorFormat()); if(charset == null || charset.trim().isEmpty()) { charset = "UTF-8"; } builder.setCharset(Charset.forName(charset)); switch(dataFormat) { case JSON: builder.setMode(jsonMode); break; case DELIMITED: builder.setMode(csvFileFormat); builder.setMode(csvHeader); builder.setConfig(DelimitedDataGeneratorFactory.REPLACE_NEWLINES_KEY, csvReplaceNewLines); break; case TEXT: builder.setConfig(TextDataGeneratorFactory.FIELD_PATH_KEY, textFieldPath); builder.setConfig(TextDataGeneratorFactory.EMPTY_LINE_IF_NULL_KEY, textEmptyLineIfNull); break; case SDC_JSON: break; case AVRO: builder.setConfig(AvroDataGeneratorFactory.SCHEMA_KEY, avroSchema); break; case XML: default: throw new IllegalStateException(Utils.format("Unknown data format: {}", dataFormat)); } return builder.build(); }
Source:
<code>public IReviewItemSet createModel(IReview review, PatchSetDetail patchSetDetail) { PatchSet patchSet = patchSetDetail.getPatchSet(); IReviewItemSet itemSet = IReviewsFactory.INSTANCE.createReviewItemSet(); itemSet.setName(NLS.bind("Patch Set {0}", patchSet.getPatchSetId())); itemSet.setCreationDate(patchSet.getCreatedOn()); <START> itemSet.setId(Integer.toString(patchSet.getPatchSetId())); <END> itemSet.setReference(patchSet.getRefName()); itemSet.setRevision(patchSet.getRevision().get()); review.getSets().add(itemSet); return itemSet; }</code><technical_language>Again, I wrong existing of implicit casting. easier scan</technical_language>

Target:
public IReviewItemSet createModel(IReview review, PatchSetDetail patchSetDetail) { PatchSet patchSet = patchSetDetail.getPatchSet(); IReviewItemSet itemSet = IReviewsFactory.INSTANCE.createReviewItemSet(); itemSet.setName(NLS.bind("Patch Set {0}", patchSet.getPatchSetId())); itemSet.setCreationDate(patchSet.getCreatedOn()); itemSet.setId(patchSet.getPatchSetId() + ""); itemSet.setReference(patchSet.getRefName()); itemSet.setRevision(patchSet.getRevision().get()); review.getSets().add(itemSet); return itemSet; }
Source:
<code>public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { checkResultSet(columnIndex); if (wasNullFlag) return null; <START> int sqlType = getSQLType(columnIndex); <END> if (isBinary(columnIndex) && sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { Object obj = internalGetObject(columnIndex, fields[columnIndex - 1]); if (obj == null) return null; if (obj instanceof Long || obj instanceof Integer || obj instanceof Byte) { return BigDecimal.valueOf(((Number) obj).longValue(), scale); } return toBigDecimal(trimMoney(String.valueOf(obj)), scale); } Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastBigDecimal(columnIndex); } catch (NumberFormatException ex) { } } return toBigDecimal( getFixedString(columnIndex), scale ); }</code><technical_language>nit: is worth deferring getSQLType if column is binary? if (isBinary(columnIndex)) { int sqlType = getSQLType(columnIndex); if (sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { Object obj = internalGetObject(columnIndex, fields[columnIndex - 1]); if (obj == null) return null; if (obj instanceof Long || obj instanceof Integer || obj instanceof Byte) { return BigDecimal.valueOf(((Number) obj).longValue(), scale); } return toBigDecimal(trimMoney(String.valueOf(obj)), scale); } }</technical_language>

Target:
public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException { checkResultSet(columnIndex); if (wasNullFlag) return null; if (isBinary(columnIndex)) { int sqlType = getSQLType(columnIndex); if (sqlType != Types.NUMERIC && sqlType != Types.DECIMAL) { Object obj = internalGetObject(columnIndex, fields[columnIndex - 1]); if (obj == null) return null; if (obj instanceof Long || obj instanceof Integer || obj instanceof Byte) { return BigDecimal.valueOf(((Number) obj).longValue(), scale); } return toBigDecimal(trimMoney(String.valueOf(obj)), scale); } } Encoding encoding = connection.getEncoding(); if (encoding.hasAsciiNumbers()) { try { return getFastBigDecimal(columnIndex); } catch (NumberFormatException ex) { } } return toBigDecimal( getFixedString(columnIndex), scale ); }
Source:
<code>void removeNonExistingSystemEntityTypes() { List<String> removedSystemEntityIds = <START> dataService <END> .findAll(ENTITY_TYPE_META_DATA, EntityType.class) .filter(EntityTypeUtils::isSystemEntity) .filter(this::isNotExists) .map(EntityType::getId) .collect(toList()); dataService.getMeta().deleteEntityTypes(removedSystemEntityIds); removedSystemEntityIds.forEach( entityTypeId -> mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityTypeId))); }</code><technical_language>need id adding a fetch speed a bit</technical_language>

Target:
void removeNonExistingSystemEntityTypes() { List<String> removedSystemEntityIds = new ArrayList<>(); dataService .getRepository(ENTITY_TYPE_META_DATA, EntityType.class) .forEachBatched( new Fetch().field(ID).field(PACKAGE), entityTypes -> entityTypes.stream() .filter(EntityTypeUtils::isSystemEntity) .filter(this::isNotExists) .map(EntityType::getId) .forEach(removedSystemEntityIds::add), 1000); dataService.getMeta().deleteEntityTypes(removedSystemEntityIds); removedSystemEntityIds.forEach( entityTypeId -> mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityTypeId))); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: navigateUp = true; <START> prepareToFinish(); <END> break; case R.id.send: checkToSendMessage(); break; case R.id.save: checkToSaveDraftAndSave(); break; case R.id.discard: askBeforeDiscard(); break; case R.id.add_from_contacts: recipientPresenter.onMenuAddFromContacts(); break; case R.id.openpgp_inline_enable: recipientPresenter.onMenuSetPgpInline(true); updateMessageFormat(); break; case R.id.openpgp_inline_disable: recipientPresenter.onMenuSetPgpInline(false); updateMessageFormat(); break; case R.id.openpgp_sign_only: recipientPresenter.onMenuSetSignOnly(true); break; case R.id.openpgp_sign_only_disable: recipientPresenter.onMenuSetSignOnly(false); break; case R.id.add_attachment: attachmentPresenter.onClickAddAttachment(recipientPresenter); break; case R.id.read_receipt: onReadReceipt(); break; default: return super.onOptionsItemSelected(item); } return true; }</code><technical_language>together. cleaner set field prepareToFinish()</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: prepareToFinish(true); break; case R.id.send: checkToSendMessage(); break; case R.id.save: checkToSaveDraftAndSave(); break; case R.id.discard: askBeforeDiscard(); break; case R.id.add_from_contacts: recipientPresenter.onMenuAddFromContacts(); break; case R.id.openpgp_inline_enable: recipientPresenter.onMenuSetPgpInline(true); updateMessageFormat(); break; case R.id.openpgp_inline_disable: recipientPresenter.onMenuSetPgpInline(false); updateMessageFormat(); break; case R.id.openpgp_sign_only: recipientPresenter.onMenuSetSignOnly(true); break; case R.id.openpgp_sign_only_disable: recipientPresenter.onMenuSetSignOnly(false); break; case R.id.add_attachment: attachmentPresenter.onClickAddAttachment(recipientPresenter); break; case R.id.read_receipt: onReadReceipt(); break; default: return super.onOptionsItemSelected(item); } return true; }
Source:
<code>DocumentReference getOrGenerateUserDocRef(String accountName) { accountName = Strings.nullToEmpty(accountName); if (accountName.isEmpty()) { accountName = RandomStringUtils.randomAlphanumeric(12); } DocumentReference userDocRef = resolveUserDocRef(accountName); <START> while (modelAccess.exists(userDocRef)) { <END> userDocRef = new DocumentReference(RandomStringUtils.randomAlphanumeric(12), getUserSpaceRef()); } return userDocRef; }</code><technical_language>need get a XWiki lock in new docref ensure mutex clusters</technical_language>

Target:
synchronized DocumentReference getOrGenerateUserDocRef(String accountName) { accountName = Strings.nullToEmpty(accountName); if (accountName.isEmpty()) { accountName = RandomStringUtils.randomAlphanumeric(12); } DocumentReference userDocRef = resolveUserDocRef(accountName); while (modelAccess.exists(userDocRef)) { userDocRef = new DocumentReference(RandomStringUtils.randomAlphanumeric(12), getUserSpaceRef()); } return userDocRef; }
Source:
<code>public O compute1(final I input) { if (obf == null) { obf = new OutOfBoundsConstantValueFactory<T, RandomAccessibleInterval<T>>( Util.getTypeFromInterval(input).createVariable()); } <START> Interval inputInterval = ops().filter().paddingIntervalCentered(input, <END> paddedDimensions); return (O) Views.interval(Views.extend(input, obf), inputInterval); }</code><technical_language>initialize</technical_language>

Target:
public O compute1(final I input) { if (obf == null) { obf = new OutOfBoundsConstantValueFactory<T, RandomAccessibleInterval<T>>( Util.getTypeFromInterval(input).createVariable()); } Interval inputInterval = paddingIntervalCentered.compute2(input, paddedDimensions); return (O) Views.interval(Views.extend(input, obf), inputInterval); }