auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public String toString() { String content = ""; for (Term term : contents) if (term != null) content += term + ","; if (content.length() > 1) content = content.substring(0, content.length() - 2); return "'amb(" + content + ")"; }

Target:
public String toString() { String content = ""; for (Term term : contents) if (term != null) content += term + ","; if (content.length() > 1) content = content.substring(0, content.length() - 1); return "'amb(" + content + ")"; }
Source:
private static boolean isOptionalProperty(Class beanClass, PropertyDescriptor beanProp) { Field field = getField(beanClass, beanProp.getName()); return field != null ? beanProp.getReadMethod().getAnnotationsByType(Optional.class).length > 0 || field.getAnnotationsByType(Optional.class).length > 0 : beanProp.getReadMethod().getAnnotationsByType(Optional.class).length > 0; }

Target:
private static boolean isOptionalProperty(Class beanClass, PropertyDescriptor beanProp) { if (beanProp.getReadMethod().getAnnotationsByType(Optional.class).length > 0) { return true; } Field field = getField(beanClass, beanProp.getName()); return field != null && field.getAnnotationsByType(Optional.class).length > 0; }
Source:
public Iterable<AbstractConfigNode> children() { return children; }

Target:
final public Collection<AbstractConfigNode> children() { return children; }
Source:
public IItemFilter read(@Nonnull Registry registry, @Nonnull Set<NBTAction> phase, @Nonnull NBTTagCompound nbt, @Nullable Field field, @Nonnull String name, @Nullable IItemFilter object) throws IllegalArgumentException, IllegalAccessException, InstantiationException, NoHandlerFoundException { if (object == null) { // Note: This will be called with no nbt when a fresh itemstack is placed---output should be null! if (nbt.hasKey(name)) { object = FilterRegistry.loadFilterFromNbt(nbt.getCompoundTag(name)); } else { return object; } } object.readFromNBT(nbt.getCompoundTag(name)); return object; }

Target:
public IItemFilter read(@Nonnull Registry registry, @Nonnull Set<NBTAction> phase, @Nonnull NBTTagCompound nbt, @Nullable Field field, @Nonnull String name, @Nullable IItemFilter object) throws IllegalArgumentException, IllegalAccessException, InstantiationException, NoHandlerFoundException { if (object == null && !nbt.hasKey(name)) { // Note: This will be called with no nbt when a fresh itemstack is placed---output should be null! return object; } object = FilterRegistry.loadFilterFromNbt(nbt.getCompoundTag(name)); return object; }
Source:
public PDataType getDataType() { // WE need to implement getDataType for which need to check the datatype if (baseType == null) { PDataType elementType = null; for (int i = 0; i < children.size(); i++) { Expression child = children.get(i); // Should we check for mismatch here? I think not needed here if (child.getDataType() != elementType) { elementType = child.getDataType(); } } baseType = elementType; } return PDataType.fromTypeId(baseType.getSqlType() + Types.ARRAY); }

Target:
public PDataType getDataType() { return PDataType.fromTypeId(baseType.getSqlType() + Types.ARRAY); }
Source:
public Object toObject(String value) { // TODO: How can this be done? throw new IllegalDataException("This operation is not suppported"); }

Target:
public Object toObject(String value) { // TODO: Do this as done in CSVLoader throw new IllegalArgumentException("This operation is not suppported"); }
Source:
ToolType(Material bukkitMaterial, ToolType better) { this.bukkitMaterial = bukkitMaterial; this.better = better; }

Target:
private ToolType(Material bukkitMaterial, ToolType better) { this.bukkitMaterial = bukkitMaterial; this.better = better; }
Source:
private void traceBlockPowerStartSolid(GlowBlock srcBlock, RSManager rsManager, BlockFace toDir, boolean isDirect) { // Get the destination block and ensure that it is suitable. GlowBlock destBlock = srcBlock.getRelative(toDir); if (destBlock == null) { return; } Material destMat = destBlock.getType(); if (destMat == Material.REDSTONE_WIRE) { // Will trace } else { return; } // Trace to target. rsManager.traceFromBlock(srcBlock, toDir, 15, isDirect); }

Target:
private void traceBlockPowerStartSolid(GlowBlock srcBlock, RSManager rsManager, BlockFace toDir, boolean isDirect) { // Get the destination block and ensure that it is suitable. GlowBlock destBlock = srcBlock.getRelative(toDir); if (destBlock == null) { return; } Material destMat = destBlock.getType(); if (destMat != Material.REDSTONE_WIRE) { return; } // Trace to target. rsManager.traceFromBlock(srcBlock, toDir, 15, isDirect); }
Source:
public GlowHorse(Location location) { super(location, EntityType.HORSE); Random rand = new Random(); // Todo make this cleaner and safer to use for spawning random horses this.variant = Variant.HORSE; this.horseStyle = Style.values()[rand.nextInt(4)]; this.horseColor = Color.values()[rand.nextInt(6)]; }

Target:
public GlowHorse(Location location) { this(location, null); }
Source:
private boolean containsComment(GHPullRequest ghPullRequest, String expectedBody) { List<GHIssueComment> prComments = null; try { prComments = ghPullRequest.getComments(); } catch (IOException e) { logger.log(Level.WARNING, "Failed to get comments for PR " + ghPullRequest, e); return false; } for (GHIssueComment comment : prComments) { if (comment.getBody() != null && comment.getBody().contains(expectedBody)) { return true; } } return false; }

Target:
private boolean containsComment(GHPullRequest ghPullRequest, String expectedBody) { List<GHIssueComment> prComments; try { prComments = ghPullRequest.getComments(); } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to get comments for PR " + ghPullRequest, e); // return false in case of an error - probably safer to have multiple comments than possibly none return false; } for (GHIssueComment comment : prComments) { if (comment.getBody() != null && comment.getBody().equals(expectedBody)) { return true; } } return false; }
Source:
public boolean matches(ScriptPath path) { String mob = path.eventArgLowerAt(1); if (!mob.equals("mob") && runGenericCheck(mob, mythicmob.getMobType().getInternalName())) { return false; } if (!runInCheck(path, location)) { return false; } return super.matches(path); }

Target:
public boolean matches(ScriptPath path) { String mob = path.eventArgLowerAt(1); if (!mob.equals("mob") && !runGenericCheck(mob, mythicmob.getMobType().getInternalName())) { return false; } if (!runInCheck(path, location)) { return false; } return super.matches(path); }
Source:
public String getAttribute(Attribute attribute) { if (attribute == null) { return null; } //Getting the ViaVersion API object ViaAPI api = Via.getAPI(); // <--[tag] // @attribute <PlayerTag.viaversion> // @returns ElementTag(Number) // @description // Returns the protocol version number of the player's client. // See https://wiki.vg/Protocol_version_numbers as a reference list. // @Plugin Depenizen, ViaVersion. // --> if (attribute.startsWith("viaversion")) { return new ElementTag(api.getPlayerVersion(player.getOfflinePlayer().getUniqueId())) .getAttribute(attribute.fulfill(1)); } return null; }

Target:
public String getAttribute(Attribute attribute) { if (attribute == null) { return null; } // <--[tag] // @attribute <PlayerTag.viaversion> // @returns ElementTag(Number) // @description // Returns the protocol version number of the player's client. // See <@link url https://wiki.vg/Protocol_version_numbers> as a reference list. // @Plugin Depenizen, ViaVersion // --> if (attribute.startsWith("viaversion")) { ViaAPI api = Via.getAPI(); return new ElementTag(api.getPlayerVersion(player.getOfflinePlayer().getUniqueId())) .getAttribute(attribute.fulfill(1)); } return null; }
Source:
protected TreeSet<CClassType> getTypes() { TreeSet<CClassType> t = new TreeSet<>(Comparator.comparing(CClassType::getFQCN)); for(FullyQualifiedClassName type : types) { try { t.add(CClassType.get(type)); } catch (ClassNotFoundException ex) { // This can't happen, because throw new Error(ex); } } return t; }

Target:
protected Set<CClassType> getTypes() { Set<CClassType> t = new TreeSet<>(Comparator.comparing(CClassType::getFQCN)); for(FullyQualifiedClassName type : types) { try { t.add(CClassType.get(type)); } catch (ClassNotFoundException ex) { // This can't happen, because throw new Error(ex); } } return t; }
Source:
public void setGlowing(Boolean glow) { if(ReflectionUtils.hasMethod(e.getClass(), "setGlowing", null)) { // Added around 1.9 e.setGlowing(glow); } }

Target:
public void setGlowing(Boolean glow) { e.setGlowing(glow); }
Source:
public void onTrimMemory(int level) { if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) { //Log.d(TAG, "app went to background"); isInBackground = true; } if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_MODERATE) { MemoryCacheHelper.trimMemory(); } }

Target:
public void onTrimMemory(int level) { if (level >= android.content.ComponentCallbacks2.TRIM_MEMORY_MODERATE) { MemoryCacheHelper.trimMemory(); } }
Source:
public static int getPrimaryColor(Context context) { if (primaryColor == -1) { String primaryColorStr = PreferenceManager.getDefaultSharedPreferences(context).getString("primary-color", COLOR_DEFAULT_STR); // Transparent can't be displayed for text color, replace with light gray. if (primaryColorStr.equals("#00000000") || primaryColorStr.equals(("#AAFFFFFF"))) { return 0xFFBDBDBD; } primaryColor = Color.parseColor(primaryColorStr); } return primaryColor; }

Target:
public static int getPrimaryColor(Context context) { if (primaryColor == -1) { String primaryColorStr = PreferenceManager.getDefaultSharedPreferences(context).getString("primary-color", COLOR_DEFAULT_STR); // Transparent can't be displayed for text color, replace with light gray. if (primaryColorStr.equals("#00000000") || primaryColorStr.equals(("#AAFFFFFF"))) { primaryColor = 0xFFBDBDBD; } else { primaryColor = Color.parseColor(primaryColorStr); } } return primaryColor; }
Source:
public void setTags(String tags) { // Set the actual user-friendly name this.tags = tags; if (tags != null) { this.tags = this.tags.replaceAll("<", "&lt;"); // Normalize name for faster searching Pair<String, int[]> normalized = StringNormalizer.normalizeWithMap(this.tags); this.tagsNormalized = normalized.first; this.tagsPositionMap = normalized.second; } }

Target:
public void setTags(String tags) { // Set the actual user-friendly name this.tags = tags; if (this.tags != null) { this.tags = this.tags.replaceAll("<", "&lt;"); // Normalize name for faster searching Pair<String, int[]> normalized = StringNormalizer.normalizeWithMap(this.tags); this.tagsNormalized = normalized.first; this.tagsPositionMap = normalized.second; } }
Source:
public int mapTagsPosition(int position) { if (this.tagsPositionMap != null) { if (position < this.tagsPositionMap.length) { return this.tagsPositionMap[position]; } else { return this.tags.length(); } } else { // No mapping defined if (position < this.tags.length()) { return position; } else { return this.tags.length(); } } }

Target:
public int mapTagsPosition(int position) { if (this.tagsPositionMap != null) { if (position < this.tagsPositionMap.length) { return this.tagsPositionMap[position]; } return this.tags.length(); } else { // No mapping defined if (position < this.tags.length()) { return position; } return this.tags.length(); } }
Source:
public MePage go() { // Using the settings button as a marker for successfully navigating to the page while (!isElementDisplayed(appSettings)) { clickOn(R.id.nav_sites); clickOn(onView(allOf(withId(R.id.me_item), withEffectiveVisibility(Visibility.VISIBLE)))); } if (!isSelfHosted()) { displayName.check(matches(isDisplayed())); } return this; }

Target:
public MePage go() { // Using the settings button as a marker for successfully navigating to the page while (!isElementDisplayed(appSettings)) { clickOn(R.id.nav_sites); clickOn(R.id.me_item); } if (!isSelfHosted()) { displayName.check(matches(isDisplayed())); } return this; }
Source:
public void configureResources(Context context) { if (context == null) { return; } mNormalTextColor = ContextExtensionsKt.getColorFromAttribute(context, R.attr.colorOnSurface); mNormalBackgroundColor = ContextExtensionsKt.getColorFromAttribute(context, R.attr.colorSurface); mAgoTextColor = ContextExtensionsKt.getColorFromAttribute(context, R.attr.wpColorOnSurfaceMedium); mUnapprovedTextColor = ContextExtensionsKt.getColorFromAttribute(context, R.attr.wpColorWarningDark); // Double margin_extra_large for increased indent in comment replies mIndentedLeftPadding = context.getResources().getDimensionPixelSize(R.dimen.margin_extra_large) * 2; }

Target:
public void configureResources(Context context) { if (context == null) { return; } mNormalBackgroundColor = ContextExtensionsKt.getColorFromAttribute(context, R.attr.colorSurface); // Double margin_extra_large for increased indent in comment replies mIndentedLeftPadding = context.getResources().getDimensionPixelSize(R.dimen.margin_extra_large) * 2; }
Source:
@Override public void helpHandleDiscoveryError( String siteAddress, String endpointAddress, String username, String password, String userAvatarUrl, int errorMessage) { // Not used in WordPress app }

Target:
public void helpHandleDiscoveryError( String siteAddress, String endpointAddress, String username, String password, String userAvatarUrl, int errorMessage) { // Not used in WordPress app }
Source:
public static void addPostWithHWAccelerationOff(int localSiteId, int localPostId) { if (localSiteId == 0 || localPostId == 0 || isPostWithHWAccelerationOff(localSiteId, localPostId)) { return; } String key = localSiteId + "-" + localPostId; List<String> currentIds = getPostWithHWAccelerationOff(); currentIds.add(key); // store in prefs String idsAsString = TextUtils.join(",", currentIds); setString(DeletablePrefKey.AZTEC_EDITOR_DISABLE_HW_ACC_KEYS, idsAsString); }

Target:
public static void addPostWithHWAccelerationOff(int localSiteId, int localPostId) { if (localSiteId == 0 || localPostId == 0 || isPostWithHWAccelerationOff(localSiteId, localPostId)) { return; } String key = localSiteId + "-" + localPostId; List<String> currentIds = new ArrayList<>(getPostWithHWAccelerationOff()); currentIds.add(key); // store in prefs String idsAsString = TextUtils.join(",", currentIds); setString(DeletablePrefKey.AZTEC_EDITOR_DISABLE_HW_ACC_KEYS, idsAsString); }
Source:
protected void onPostExecute(UploadPostTaskResult result) { switch (result) { case ERROR: mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(mPost); mPostUploadNotifier.updateNotificationErrorForPost(mPost, mSite, mErrorMessage, 0); finishUpload(); break; case NOTHING_TO_UPLOAD: mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(mPost); finishUpload(); break; case PUSH_POST_DISPATCHED: // will be handled in OnPostChanged break; } }

Target:
protected void onPostExecute(UploadPostTaskResult result) { switch (result) { case ERROR: mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(mPost); mPostUploadNotifier.updateNotificationErrorForPost(mPost, mSite, mErrorMessage, 0); finishUpload(); break; case NOTHING_TO_UPLOAD: // we need to force increment the uploaded count as we know the post was enqueued twice. If we // didn't force incremented it, the `PostUploadNotifier.isPostAlreadyInPostCount()` would return // true and we'd end up with a dangling upload notification. mPostUploadNotifier.incrementUploadedPostCountFromForegroundNotification(mPost, true); finishUpload(); break; case PUSH_POST_DISPATCHED: // will be handled in OnPostChanged break; } }
Source:
private void primaryAction() { switch (getPrimaryAction()) { case UPDATE: showUpdateConfirmationDialogAndUploadPost(); return; case PUBLISH_NOW: showPublishConfirmationDialogAndPublishPost(); return; case SCHEDULE: uploadPost(false); return; // In other cases, we'll upload the post without changing its status case SUBMIT_FOR_REVIEW: case SAVE: uploadPost(false); break; } }

Target:
private void primaryAction() { switch (getPrimaryAction()) { case UPDATE: showUpdateConfirmationDialogAndUploadPost(); return; case PUBLISH_NOW: showPublishConfirmationDialogAndPublishPost(); return; // In other cases, we'll upload the post without changing its status case SCHEDULE: case SUBMIT_FOR_REVIEW: case SAVE: uploadPost(false); break; } }
Source:
protected void onPostExecute(Spanned spanned) { if (mPost != null && spanned != null) { mTextView.setVisibility(View.GONE); mWebView.setVisibility(View.VISIBLE); mWebView.loadDataWithBaseURL("file:///android_asset/", spanned.toString(), "text/html", "utf-8", null); } mLoadTask = null; }

Target:
protected void onPostExecute(Spanned spanned) { if (mPost != null && spanned != null) { mWebView.loadDataWithBaseURL("file:///android_asset/", spanned.toString(), "text/html", "utf-8", null); } mLoadTask = null; }
Source:
public void close() { input.close(); }

Target:
public void close() { try { if (input != null) input.close(); } catch (IOException e) { // ignored } }
Source:
RedirectAuthoritativeDnsServerCache(AuthoritativeDnsServerCache authoritativeDnsServerCache) { // Unwrap to prevent the possibility of an StackOverflowError when wrapping another // RedirectAuthoritativeDnsServerCache. if (authoritativeDnsServerCache instanceof RedirectAuthoritativeDnsServerCache) { this.wrapped = ((RedirectAuthoritativeDnsServerCache) authoritativeDnsServerCache).wrapped; } else { this.wrapped = authoritativeDnsServerCache; } }

Target:
RedirectAuthoritativeDnsServerCache(AuthoritativeDnsServerCache authoritativeDnsServerCache) { this.wrapped = authoritativeDnsServerCache; }
Source:
public V map(String hostname) { if (hostname != null) { hostname = normalize(hostname); // Let's try an exact match first V value = map.get(hostname); if (value != null) { return value; } // No exact match, let's try a wildcard match. int idx = hostname.indexOf('.'); if (idx != -1) { value = map.get('*' + hostname.substring(idx)); if (value != null) { return value; } } } return defaultValue; }

Target:
public V map(String hostname) { if (hostname != null) { hostname = normalize(hostname); // Let's try an exact match first V value = map.get(hostname); if (value != null) { return value; } // No exact match, let's try a wildcard match. int idx = hostname.indexOf('.'); if (idx != -1) { value = map.get(hostname.substring(idx)); if (value != null) { return value; } } } return defaultValue; }
Source:
private void parse8(int nameStart, int valueStart, int valueEnd) { if (header.regionMatches(true, nameStart, CookieHeaderNames.HTTPONLY, 0, 8)) { httpOnly = true; } else if (header.regionMatches(true, nameStart, CookieHeaderNames.SAMESITE, 0, 8)) { String sameSiteValue = computeValue(valueStart, valueEnd); try { sameSite = SameSite.of(sameSiteValue); } catch (IllegalArgumentException e) { logger.debug("Skipping SameSite attribute because value '{}' is invalid", sameSiteValue); } } }

Target:
private void parse8(int nameStart, int valueStart, int valueEnd) { if (header.regionMatches(true, nameStart, CookieHeaderNames.HTTPONLY, 0, 8)) { httpOnly = true; } else if (header.regionMatches(true, nameStart, CookieHeaderNames.SAMESITE, 0, 8)) { sameSite = SameSite.of(computeValue(valueStart, valueEnd)); } }
Source:
public Queue<AbstractMap.SimpleEntry<Object, ChannelPromise>> tempInboundMessages() { if (tempInboundMessages == null) { tempInboundMessages = new ArrayDeque<AbstractMap.SimpleEntry<Object, ChannelPromise>>(); } return tempInboundMessages; }

Target:
private Queue<AbstractMap.SimpleEntry<Object, ChannelPromise>> tempInboundMessages() { if (tempInboundMessages == null) { tempInboundMessages = new ArrayDeque<AbstractMap.SimpleEntry<Object, ChannelPromise>>(); } return tempInboundMessages; }
Source:
public ChannelFuture writeOneInbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { if (!config().isAutoRead()) { Queue<AbstractMap.SimpleEntry<Object, ChannelPromise>> tempInboundMessages = tempInboundMessages(); if (tempInboundMessages != null) { tempInboundMessages.add(new AbstractMap.SimpleEntry<Object, ChannelPromise>(msg, promise)); } return promise; } else { pipeline().fireChannelRead(msg); } } return checkException(promise); }

Target:
public ChannelFuture writeOneInbound(Object msg, ChannelPromise promise) { if (checkOpen(true)) { if (!config().isAutoRead()) { Queue<AbstractMap.SimpleEntry<Object, ChannelPromise>> tempInboundMessages = tempInboundMessages(); tempInboundMessages.add(new AbstractMap.SimpleEntry<Object, ChannelPromise>(msg, promise)); return promise; } else { pipeline().fireChannelRead(msg); } } return checkException(promise); }
Source:
final int drainTasks() { int numTasks = 0; for (;;) { Runnable runnable = taskQueue.poll(); if (runnable == null) { break; } // WAKEUP_TASKS should be just discarded as these are added internally. // The important bit is that we not have any user tasks left. if (AbstractScheduledEventExecutor.WAKEUP_TASK != runnable) { numTasks++; } } return numTasks; }

Target:
final int drainTasks() { int numTasks = 0; for (;;) { Runnable runnable = taskQueue.poll(); if (runnable == null) { break; } // WAKEUP_TASK should be just discarded as these are added internally. // The important bit is that we not have any user tasks left. if (WAKEUP_TASK != runnable) { numTasks++; } } return numTasks; }
Source:
KeyManagerFactoryWrapper(KeyManager km) { ObjectUtil.checkNotNull(km, "km"); this.km = km; }

Target:
KeyManagerFactoryWrapper(KeyManager km) { this.km = ObjectUtil.checkNotNull(km, "km"); }
Source:
TrustManagerFactoryWrapper(TrustManager tm) throws Exception { ObjectUtil.checkNotNull(tm, "tm"); this.tm = tm; }

Target:
TrustManagerFactoryWrapper(TrustManager tm) { this.tm = ObjectUtil.checkNotNull(tm, "tm"); }
Source:
WeakOrderQueue newWeakOrderQueue(Thread thread) { return WeakOrderQueue.newQueue(this, thread); }

Target:
private WeakOrderQueue newWeakOrderQueue(Thread thread) { return WeakOrderQueue.newQueue(this, thread); }
Source:
ByteBuf duplicate() { // We can only use the cached slice safely if it's equal to the source buffer, // otherwise it might not be fully visible to us return (slice == srcBuf ? srcBuf : srcBuf.slice()).duplicate(); }

Target:
ByteBuf duplicate() { return srcBuf.duplicate(); }
Source:
private boolean fetchFromScheduledTaskQueue() { if (scheduledTaskQueue == null || scheduledTaskQueue.isEmpty()) { return true; } long nanoTime = AbstractScheduledEventExecutor.nanoTime(); for (Runnable scheduledTask; (scheduledTask = pollScheduledTask(nanoTime)) != null;) { if (!taskQueue.offer(scheduledTask)) { // No space left in the task queue add it back to the scheduledTaskQueue so we pick it up again. scheduledTaskQueue.add((ScheduledFutureTask<?>) scheduledTask); return false; } } return true; }

Target:
private boolean fetchFromScheduledTaskQueue() { if (scheduledTaskQueue == null || scheduledTaskQueue.isEmpty()) { return true; } long nanoTime = AbstractScheduledEventExecutor.nanoTime(); for (;;) { Runnable scheduledTask = pollScheduledTask(nanoTime); if (scheduledTask == null) { return true; } if (!taskQueue.offer(scheduledTask)) { // No space left in the task queue add it back to the scheduledTaskQueue so we pick it up again. scheduledTaskQueue.add((ScheduledFutureTask<?>) scheduledTask); return false; } } }
Source:
void fireChildRead(Http2Frame frame) { assert eventLoop().inEventLoop(); if (!isActive()) { ReferenceCountUtil.release(frame); } else { final RecvByteBufAllocator.Handle allocHandle = unsafe.recvBufAllocHandle(); flowControlledBytes += unsafe.doRead0(frame, allocHandle); // We currently don't need to check for readEOS because the parent channel and child channel are limited // to the same EventLoop thread. There are a limited number of frame types that may come after EOS is // read (unknown, reset) and the trade off is less conditionals for the hot path (headers/data) at the // cost of additional readComplete notifications on the rare path. if (allocHandle.continueReading()) { if (!readCompletePending) { readCompletePending = true; addChannelToReadCompletePendingQueue(); } } else { unsafe.notifyReadComplete(allocHandle, true); } } }

Target:
void fireChildRead(Http2Frame frame) { assert eventLoop().inEventLoop(); if (!isActive()) { ReferenceCountUtil.release(frame); } else { unsafe.doRead0(frame); if (!readCompletePending) { readCompletePending = true; addChannelToReadCompletePendingQueue(); } } }
Source:
public static void encodeDomainName(String name, ByteBuf buf) { if (ROOT.equals(name)) { // Root domain buf.writeByte(0); return; } final String[] labels = name.split("\\."); for (String label : labels) { final int labelLen = label.length(); if (labelLen == 0) { // zero-length label means the end of the name. break; } buf.writeByte(labelLen); ByteBufUtil.writeAscii(buf, label); } buf.writeByte(0); // marks end of name field }

Target:
static void encodeDomainName(String name, ByteBuf buf) { if (ROOT.equals(name)) { // Root domain buf.writeByte(0); return; } final String[] labels = name.split("\\."); for (String label : labels) { final int labelLen = label.length(); if (labelLen == 0) { // zero-length label means the end of the name. break; } buf.writeByte(labelLen); ByteBufUtil.writeAscii(buf, label); } buf.writeByte(0); // marks end of name field }
Source:
private LineHeaderExtractor(int maxHeaderSize) { super(maxHeaderSize); }

Target:
LineHeaderExtractor(int maxHeaderSize) { super(maxHeaderSize); }
Source:
public static void freeDirectBuffer(ByteBuffer buffer) { // Copied locally to prevent race CustomCleaner localCustomCleaner = DirectCleaner.customCleaner; if (!ALLOW_CUSTOM_CLEANER || localCustomCleaner == null) { PlatformDependent.freeDirectBuffer(buffer); } else { localCustomCleaner.freeDirectMemory(buffer); } }

Target:
public static void freeDirectBuffer(ByteBuffer buffer) { // Copied locally to prevent race CustomCleaner localCustomCleaner; if (!ALLOW_CUSTOM_CLEANER || (localCustomCleaner = DirectCleaner.customCleaner) == null) { PlatformDependent.freeDirectBuffer(buffer); } else { localCustomCleaner.freeDirectMemory(buffer); } }
Source:
private void transfer(EmbeddedChannel outChannel, EmbeddedChannel inChannel) { // Transfer encoded data into decoder // Loop because there might be multiple frames (gathering write) while (true) { ByteBuf encoded = outChannel.readOutbound(); if (encoded == null) { return; } inChannel.writeInbound(encoded); } }

Target:
private void transfer(EmbeddedChannel outChannel, EmbeddedChannel inChannel) { // Transfer encoded data into decoder // Loop because there might be multiple frames (gathering write) for (;;) { ByteBuf encoded = outChannel.readOutbound(); if (encoded == null) { return; } inChannel.writeInbound(encoded); } }
Source:
public String toString() { // E.g.: "1000 Bye", "1009 Message too big" return code() + " " + reasonText(); }

Target:
public String toString() { String text = this.text; if (text == null) { // E.g.: "1000 Bye", "1009 Message too big" this.text = text = code() + " " + reasonText(); } return text; }
Source:
public void testMulticast(Bootstrap sb, Bootstrap cb) throws Throwable { // Run this test with IP_RECVORIGDSTADDR option enabled sb.option(EpollChannelOption.IP_RECVORIGDSTADDR, true); super.testMulticast(sb, cb); sb.option(EpollChannelOption.IP_RECVORIGDSTADDR, false); }

Target:
public void testMulticast(Bootstrap sb, Bootstrap cb) throws Throwable { super.testMulticast(sb, cb); }
Source:
public <T> T getOption(ChannelOption<T> option) { if (option == EpollChannelOption.DOMAIN_SOCKET_READ_MODE) { return (T) getReadMode(); } if (option == EpollChannelOption.ALLOW_HALF_CLOSURE) { return (T) Boolean.valueOf(isAllowHalfClosure()); } return super.getOption(option); }

Target:
public <T> T getOption(ChannelOption<T> option) { if (option == DOMAIN_SOCKET_READ_MODE) { return (T) getReadMode(); } if (option == ALLOW_HALF_CLOSURE) { return (T) Boolean.valueOf(isAllowHalfClosure()); } return super.getOption(option); }
Source:
public final void handlerRemoved(ChannelHandlerContext ctx) throws Exception { if (decodeState == STATE_CALLING_CHILD_DECODE) { decodeState = STATE_HANDLER_REMOVED_PENDING; return; } ByteBuf buf = cumulation; if (buf != null) { // Directly set this to null so we are sure we not access it in any other method here anymore. cumulation = null; int readable = buf.readableBytes(); if (readable > 0) { ctx.fireChannelRead(buf); ctx.fireChannelReadComplete(); } else { buf.release(); } } handlerRemoved0(ctx); decodeState = STATE_REMOVED; }

Target:
public final void handlerRemoved(ChannelHandlerContext ctx) throws Exception { if (decodeState == STATE_CALLING_CHILD_DECODE) { decodeState = STATE_HANDLER_REMOVED_PENDING; return; } try { ByteBuf buf = cumulation; if (buf != null) { // Directly set this to null so we are sure we not access it in any other method here anymore. cumulation = null; int readable = buf.readableBytes(); if (readable > 0) { ctx.fireChannelRead(buf); ctx.fireChannelReadComplete(); } else { buf.release(); } } handlerRemoved0(ctx); } finally { decodeState = STATE_REMOVED; } }
Source:
private PartialCumulationDecoder(int messageSize) { this.messageSize = messageSize; setCumulator(new PartialCumulator()); }

Target:
PartialCumulationDecoder(int messageSize) { this.messageSize = messageSize; setCumulator(new PartialCumulator()); }
Source:
public final void deallocate() { // this is to avoid overriding isAccessible(), so that it can be // final in AbstractReferenceCountedByteBuf maxCapacity(-rawMaxCapacity()); wrapped.deallocate(); }

Target:
public final void deallocate() { wrapped.deallocate(); }
Source:
boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int normCapacity) { final long handle; if ((normCapacity & subpageOverflowMask) != 0) { // >= pageSize handle = allocateRun(normCapacity); } else { handle = allocateSubpage(normCapacity); } if (handle > 0) { ByteBuffer nioBuffer = cachedNioBuffers != null ? cachedNioBuffers.pollLast() : null; initBuf(buf, nioBuffer, handle, reqCapacity); return true; } return false; }

Target:
boolean allocate(PooledByteBuf<T> buf, int reqCapacity, int normCapacity) { final long handle; if ((normCapacity & subpageOverflowMask) != 0) { // >= pageSize handle = allocateRun(normCapacity); } else { handle = allocateSubpage(normCapacity); } if (handle < 0) { return false; } ByteBuffer nioBuffer = cachedNioBuffers != null ? cachedNioBuffers.pollLast() : null; initBuf(buf, nioBuffer, handle, reqCapacity); return true; }
Source:
public void shutdown() { if (poisoned.compareAndSet(false, true)) { while (true) { if (tasks.offer(POISON_PILL)) { break; } } try { executorThread.join(); } catch (InterruptedException e) { //we're quite trusty :) } } }

Target:
public void shutdown() { if (poisoned.compareAndSet(false, true)) { while (!tasks.offer(POISON_PILL)) { // Just try again } try { executorThread.join(); } catch (InterruptedException e) { //We're quite trusty :) } } }
Source:
public boolean isSnapshot() { String version = getVersion(); if (StringUtils.isNotBlank(version)) { if (version.contains("SNAPSHOT")) {//$NON-NLS-1$ return true; } } return false; }

Target:
public boolean isSnapshot() { String version = getVersion(); return StringUtils.isNotBlank(version) && version.contains("SNAPSHOT"); }
Source:
public boolean isSnapshotAllowed() { if (containsKey(SrampConstants.SRAMP_SNAPSHOT_ALLOWED)) { String value = getConfigProperty(SrampConstants.SRAMP_SNAPSHOT_ALLOWED, "false"); //$NON-NLS-1$ if (StringUtils.isNotBlank(value) && value.equals("true")) { //$NON-NLS-1$ return true; } else { return false; } } else { if (isSnapshot()) { return true; } else { return false; } } }

Target:
public boolean isSnapshotAllowed() { if (containsKey(SrampConstants.SRAMP_SNAPSHOT_ALLOWED)) { String value = getConfigProperty(SrampConstants.SRAMP_SNAPSHOT_ALLOWED, "false"); //$NON-NLS-1$ return StringUtils.isNotBlank(value) && value.equals("true"); //$NON-NLS-1$ } else { return isSnapshot(); } }
Source:
public boolean isSitePublished(String siteId) { boolean siteIsPublished = false; try { Site site = SiteService.getSite(siteId); if (site != null) { siteIsPublished = site.isPublished(); } } catch (IdUnusedException e) { // not a site after all } return siteIsPublished; }

Target:
public boolean isSitePublished(String siteId) { boolean siteIsPublished = false; try { Site site = SiteService.getSite(siteId); siteIsPublished = site.isPublished(); } catch (IdUnusedException e) { // not a site after all } return siteIsPublished; }
Source:
public void testSubstVarsTwoLevelsWithDefault() { // Example input taken from LOGBCK-943 bug report context.putProperty("APP_NAME", "LOGBACK"); context.putProperty("ARCHIVE_SUFFIX", "archive.log"); context.putProperty("LOG_HOME", "${logfilepath.default:-logs}"); context.putProperty("LOG_PATH", "${LOG_HOME}/${APP_NAME}"); context.putProperty("ARCHIVE_PATH", "${LOG_HOME}/archive/${APP_NAME}"); String result = OptionHelper.substVars("${ARCHIVE_PATH}_trace_${ARCHIVE_SUFFIX}", context); assertEquals("logs/archive/LOGBACK_trace_archive.log", result); }

Target:
public void testSubstVarsTwoLevelsWithDefault() { // Example input taken from LOGBCK-943 bug report context.putProperty("APP_NAME", "LOGBACK"); context.putProperty("ARCHIVE_SUFFIX", "archive.log"); context.putProperty("LOG_HOME", "${logfilepath.default:-logs}"); context.putProperty("ARCHIVE_PATH", "${LOG_HOME}/archive/${APP_NAME}"); String result = OptionHelper.substVars("${ARCHIVE_PATH}_trace_${ARCHIVE_SUFFIX}", context); assertEquals("logs/archive/LOGBACK_trace_archive.log", result); }
Source:
public void start() throws Exception { LOG.info("Applying current configs..."); applyCurrentConfigs(); LOG.info("Starting leader latch..."); leaderLatch.start(); LOG.info("Adding to known-agents..."); String agentKey = localHostname + ":" + Integer.toString(httpPort); knownAgentsDatastore.addKnownAgent(loadBalancerConfiguration.getName(), baragonAgentMetadata, agentKey); }

Target:
public void start() throws Exception { LOG.info("Applying current configs..."); applyCurrentConfigs(); LOG.info("Starting leader latch..."); leaderLatch.start(); LOG.info("Adding to known-agents..."); knownAgentsDatastore.addKnownAgent(loadBalancerConfiguration.getName(), baragonAgentMetadata); }
Source:
public void incrementUsageCount(Long templateId) { // Use object instead of Native Queries to update count //also catch/log exceptions so that create dataset will succeed //Issue 4847 SEK 7/16/2018 try { Template toUpdate = em.find(Template.class, templateId); Long usage = toUpdate.getUsageCount(); usage++; toUpdate.setUsageCount(usage); em.merge(toUpdate); } catch (Exception e) { logger.log(Level.INFO, "Increment usage count failed on template id {0}. ", templateId); } }

Target:
public void incrementUsageCount(Long templateId) { Template toUpdate = em.find(Template.class, templateId); Long usage = toUpdate.getUsageCount(); usage++; toUpdate.setUsageCount(usage); em.merge(toUpdate); }
Source:
public void toggleAllSelected(){ System.out.print("in toggle all"); this.selectAllFiles = !this.selectAllFiles; toggleSelectedFiles(this.selectAllFiles); }

Target:
public void toggleAllSelected(){ //This is here so that if the user selects all on the dataset page // s/he will get all files on download this.selectAllFiles = !this.selectAllFiles; }
Source:
public List<Object[]> getDvObjectInfoForMyData(List<Long> dvObjectIdList){ //msgt("getAssigneeAndRoleIdListFor"); String dvObjectClause = getDvObjectIdListClause(dvObjectIdList); if (dvObjectClause==null){ return null; } String qstr = "SELECT dv.id, dv.dtype, dv.owner_id"; // dv.modificationtime, qstr += " FROM dvobject dv"; qstr += " WHERE dv.id IN " + dvObjectClause; qstr += ";"; return em.createNativeQuery(qstr, Object[].class).getResultList(); }

Target:
public List<Object[]> getDvObjectInfoForMyData(List<Long> dvObjectIdList){ //msgt("getAssigneeAndRoleIdListFor"); String dvObjectClause = getDvObjectIdListClause(dvObjectIdList); if (dvObjectClause==null){ return null; } String qstr = "SELECT dv.id, dv.dtype, dv.owner_id"; // dv.modificationtime, qstr += " FROM dvobject dv"; qstr += " WHERE dv.id IN " + dvObjectClause; qstr += ";"; return em.createNativeQuery(qstr).getResultList(); }
Source:
public String init() { System.out.println("_YE_OLDE_QUERY_COUNTER_"); // for debug purposes if ((session.getUser() != null) && (session.getUser().isAuthenticated()) && (session.getUser().isSuperuser())) { authUser = (AuthenticatedUser) session.getUser(); userListMaker = new UserListMaker(userService); runUserSearch(); } else { return permissionsWrapper.notAuthorized(); // redirect to login OR give some type ‘you must be logged in message' } return null; }

Target:
public String init() { if ((session.getUser() != null) && (session.getUser().isAuthenticated()) && (session.getUser().isSuperuser())) { authUser = (AuthenticatedUser) session.getUser(); userListMaker = new UserListMaker(userService); runUserSearch(); } else { return permissionsWrapper.notAuthorized(); // redirect to login OR give some type ‘you must be logged in message' } return null; }
Source:
protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception { ByteBuf payloadAndCrc = (ByteBuf) super.decode(ctx, in); assert header != null; if (payloadAndCrc == null) { return null; } else { Segment segment = segmentCodec.decode(header, payloadAndCrc); header = null; return segment; } }

Target:
protected Object decode(ChannelHandlerContext ctx, ByteBuf in) throws Exception { try { ByteBuf payloadAndCrc = (ByteBuf) super.decode(ctx, in); if (payloadAndCrc == null) { return null; } else { assert header != null; Segment segment = segmentCodec.decode(header, payloadAndCrc); header = null; return segment; } } catch (Exception e) { // Don't hold on to a stale header if we failed to decode the rest of the segment header = null; throw e; } }
Source:
public static void maybeCreateSchema(CqlSession session) throws Exception { session.execute( SimpleStatement.newInstance( "CREATE KEYSPACE IF NOT EXISTS killrvideo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}") .setExecutionProfileName("slow")); session.execute("USE killrvideo"); for (String statement : getStatements("killrvideo_schema.cql")) { session.execute(SimpleStatement.newInstance(statement).setExecutionProfileName("slow")); } }

Target:
private static void maybeCreateSchema(CqlSession session) throws Exception { session.execute( SimpleStatement.newInstance( "CREATE KEYSPACE IF NOT EXISTS killrvideo WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1}") .setExecutionProfileName("slow")); session.execute("USE killrvideo"); for (String statement : getStatements("killrvideo_schema.cql")) { session.execute(SimpleStatement.newInstance(statement).setExecutionProfileName("slow")); } }
Source:
boolean nullSavingStrategyExplicitlySet(Element methodElement, Class<?> javaClass) { Optional<AnnotationMirror> annotationMirrorForJavaClass = getAnnotationMirrorForJavaClass(methodElement, javaClass); // Find out if NullSavingStrategy was set explicitly if (annotationMirrorForJavaClass.isPresent()) { for (ExecutableElement executableElement : annotationMirrorForJavaClass.get().getElementValues().keySet()) { if (executableElement.getSimpleName().contentEquals("nullSavingStrategy")) { return true; } } } return false; }

Target:
private boolean nullSavingStrategyExplicitlySet(Element methodElement, Class<?> javaClass) { Optional<AnnotationMirror> annotationMirrorForJavaClass = getAnnotationMirrorForJavaClass(methodElement, javaClass); // Find out if NullSavingStrategy was set explicitly if (annotationMirrorForJavaClass.isPresent()) { for (ExecutableElement executableElement : annotationMirrorForJavaClass.get().getElementValues().keySet()) { if (executableElement.getSimpleName().contentEquals("nullSavingStrategy")) { return true; } } } return false; }
Source:
public static void setValue( CodeBlock cqlName, PropertyType type, CodeBlock valueExtractor, String targetName, MethodSpec.Builder methodBuilder, BindableHandlingSharedCode enclosingClass) { // invoke with SET_TO_NULL to preserve default behaviour when retrieving an entity setValue( cqlName, type, valueExtractor, targetName, methodBuilder, enclosingClass, CodeBlock.of("$T.$L", NullSavingStrategy.class, NullSavingStrategy.SET_TO_NULL)); }

Target:
public static void setValue( CodeBlock cqlName, PropertyType type, CodeBlock valueExtractor, String targetName, MethodSpec.Builder methodBuilder, BindableHandlingSharedCode enclosingClass) { setValue(cqlName, type, valueExtractor, targetName, methodBuilder, enclosingClass, false); }
Source:
public String addQueryProvider( ExecutableElement methodElement, TypeMirror providerClass, List<ClassName> entityHelperTypes) { // Invokers are not shared between methods, so always generate a new name String fieldName = nameIndex.uniqueField(methodElement.getSimpleName().toString() + "Invoker"); List<String> entityHelperNames = new ArrayList<>(); for (ClassName type : entityHelperTypes) { entityHelperNames.add(addEntityHelperField(type)); } queryProviders.add( new GeneratedQueryProvider(methodElement, fieldName, providerClass, entityHelperNames)); return fieldName; }

Target:
public String addQueryProvider( ExecutableElement methodElement, TypeMirror providerClass, List<ClassName> entityHelperTypes) { // Invokers are not shared between methods, so always generate a new name String fieldName = nameIndex.uniqueField(methodElement.getSimpleName().toString() + "Invoker"); List<String> entityHelperNames = new ArrayList<>(); for (ClassName type : entityHelperTypes) { entityHelperNames.add(addEntityHelperField(type)); } queryProviders.add(new GeneratedQueryProvider(fieldName, providerClass, entityHelperNames)); return fieldName; }
Source:
private Builder() { try { this.configDirectory = Files.createTempDirectory("ccm"); } catch (IOException e) { // change to unchecked for now. throw new RuntimeException(e); } // disable auto_snapshot by default to reduce disk usage when destroying schema. withCassandraConfiguration("auto_snapshot", "false"); // mark the ccm temp directories for deletion when the JVM exits if (this.configDirectory != null) { this.configDirectory.toFile().deleteOnExit(); } }

Target:
private Builder() { try { this.configDirectory = Files.createTempDirectory("ccm"); // mark the ccm temp directories for deletion when the JVM exits this.configDirectory.toFile().deleteOnExit(); } catch (IOException e) { // change to unchecked for now. throw new RuntimeException(e); } // disable auto_snapshot by default to reduce disk usage when destroying schema. withCassandraConfiguration("auto_snapshot", "false"); }
Source:
private static File createTempStore(String storePath) { File f = null; try (OutputStream os = new FileOutputStream(f = File.createTempFile("server", ".store"))) { Resources.copy(CcmBridge.class.getResource(storePath), os); } catch (IOException e) { logger.warn("Failure to write keystore, SSL-enabled servers may fail to start.", e); } finally { // ensure the temp store files are deleted when the JVM exits if (f != null) { f.deleteOnExit(); } } return f; }

Target:
private static File createTempStore(String storePath) { File f = null; try (OutputStream os = new FileOutputStream(f = File.createTempFile("server", ".store"))) { f.deleteOnExit(); Resources.copy(CcmBridge.class.getResource(storePath), os); } catch (IOException e) { logger.warn("Failure to write keystore, SSL-enabled servers may fail to start.", e); } return f; }
Source:
public DefaultNode(InetSocketAddress connectAddress, InternalDriverContext context) { this.connectAddress = connectAddress; // We leak a reference to a partially constructed object (this), but in practice this won't be a // problem because the node updater only needs the connect address to initialize. this.metricUpdater = context.metricUpdaterFactory().newNodeUpdater(this); this.state = NodeState.UNKNOWN; this.distance = NodeDistance.IGNORED; this.rawTokens = Collections.emptySet(); this.extras = Collections.emptyMap(); }

Target:
public DefaultNode(InetSocketAddress connectAddress, InternalDriverContext context) { this.connectAddress = connectAddress; this.state = NodeState.UNKNOWN; this.distance = NodeDistance.IGNORED; this.rawTokens = Collections.emptySet(); this.extras = Collections.emptyMap(); // We leak a reference to a partially constructed object (this), but in practice this won't be a // problem because the node updater only needs the connect address to initialize. this.metricUpdater = context.metricUpdaterFactory().newNodeUpdater(this); }
Source:
public PreparedStatement addPrepared(PreparedStatement stmt) { PreparedStatement previous = preparedQueries.putIfAbsent(stmt.getPreparedId().boundValuesMetadata.id, stmt); if (previous != null) { logger.warn("Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. " + "Consider preparing the statement only once. Query='{}'", stmt.getQueryString()); // The one object in the cache will get GCed once it's not referenced by the client anymore since we use a weak reference. // So we need to make sure that the instance we do return to the user is the one that is in the cache. if (com.google.common.base.Objects.equal(previous.getPreparedId().resultSetMetadata.id, stmt.getPreparedId().resultSetMetadata.id)) return previous; } return stmt; }

Target:
public PreparedStatement addPrepared(PreparedStatement stmt) { PreparedStatement previous = preparedQueries.putIfAbsent(stmt.getPreparedId().boundValuesMetadata.id, stmt); if (previous != null) { logger.warn("Re-preparing already prepared query is generally an anti-pattern and will likely affect performance. " + "Consider preparing the statement only once. Query='{}'", stmt.getQueryString()); // The one object in the cache will get GCed once it's not referenced by the client anymore since we use a weak reference. // So we need to make sure that the instance we do return to the user is the one that is in the cache. // However if the result metadata changed since the last PREPARE call, this also needs to be updated. previous.getPreparedId().resultSetMetadata = stmt.getPreparedId().resultSetMetadata; return previous; } return stmt; }
Source:
static <T extends Annotation> T getTypeAnnotation(Class<T> annotation, Class<?> annotatedClass) { T instance = annotatedClass.getAnnotation(annotation); if (instance == null) throw new IllegalStateException(String.format("@%s annotation was not found on %s", annotation.getSimpleName(), annotatedClass)); // Check that no other mapping annotations are present validateAnnotations(annotatedClass, annotation); return instance; }

Target:
static <T extends Annotation> T getTypeAnnotation(Class<T> annotation, Class<?> annotatedClass) { T instance = annotatedClass.getAnnotation(annotation); if (instance == null) throw new IllegalArgumentException(String.format("@%s annotation was not found on %s", annotation.getSimpleName(), annotatedClass)); // Check that no other mapping annotations are present validateAnnotations(annotatedClass, annotation); return instance; }
Source:
private String joinJvmArgs() { StringBuilder allJvmArgs = new StringBuilder(""); for (String jvmArg : jvmArgs) { // Windows requires jvm arguments to be quoted, while *nix requires unquoted. String quote = isWindows() ? "\"" : ""; allJvmArgs.append(" "); allJvmArgs.append(quote); allJvmArgs.append("--jvm_arg="); allJvmArgs.append(randomizePorts(jvmArg)); allJvmArgs.append(quote); } return allJvmArgs.toString(); }

Target:
private String joinJvmArgs() { StringBuilder allJvmArgs = new StringBuilder(""); String quote = isWindows() ? "\"" : ""; for (String jvmArg : jvmArgs) { // Windows requires jvm arguments to be quoted, while *nix requires unquoted. allJvmArgs.append(" "); allJvmArgs.append(quote); allJvmArgs.append("--jvm_arg="); allJvmArgs.append(randomizePorts(jvmArg)); allJvmArgs.append(quote); } return allJvmArgs.toString(); }
Source:
private <V> V as(TypeToken<V> javaType) { if (OBJECT_TYPE.equals(javaType)) { // we're handling a getObject() call @SuppressWarnings("unchecked") V v = (V)asObject(); // Since V is Object, this is a safe cast return v; } else { // we're handling a typed getter call assert javaType != null; return with(codecFor(javaType)); } }

Target:
private <V> V as(TypeToken<V> javaType) { return with(codecFor(javaType)); }