auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void start() { try { membership.start(); } catch (ConnectionException e) { throw new DistributionException( "Unable to create membership manager", e); } catch (SecurityException e) { String failReason = e.getMessage(); if (failReason.contains("Failed to find credentials")) { throw new AuthenticationRequiredException(failReason); } throw new GemFireSecurityException(e.getMessage(), e); } catch (MembershipConfigurationException e) { <START> throw new GemFireConfigException(e.getMessage(), e.getCause()); <END> } catch (MemberStartupException e) { throw new SystemConnectException(e.getMessage(), e.getCause()); } catch (RuntimeException e) { logger.error("Unexpected problem starting up membership services", e); throw new SystemConnectException("Problem starting up membership services: " + e.getMessage() + ". Consult log file for more details"); } }</code><technical_language>exception instead of e.getCause() discarding of stack frames in exception chain</technical_language>

Target:
public void start() { try { membership.start(); } catch (ConnectionException e) { throw new DistributionException( "Unable to create membership manager", e); } catch (SecurityException e) { String failReason = e.getMessage(); if (failReason.contains("Failed to find credentials")) { throw new AuthenticationRequiredException(failReason); } throw new GemFireSecurityException(e.getMessage(), e); } catch (MembershipConfigurationException e) { throw new GemFireConfigException("Problem configuring membership services", e); } catch (MemberStartupException e) { throw new SystemConnectException("Problem starting up membership services", e); } catch (RuntimeException e) { logger.error("Unexpected problem starting up membership services", e); throw new SystemConnectException("Problem starting up membership services: " + e.getMessage() + ". Consult log file for more details"); } }
Source:
<code><START> public List<Action> retrieveActions(@NonNull SCMNavigatorOwner owner, <END> @CheckForNull SCMNavigatorEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException { return Collections.emptyList(); }</code><technical_language>I difference this fetchActions? speed reading snuff</technical_language>

Target:
protected List<Action> retrieveActions(@NonNull SCMNavigatorOwner owner, @CheckForNull SCMNavigatorEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException { return Collections.emptyList(); }
Source:
<code>protected boolean setState(boolean state) { try { Class<?> serviceManagerClass = Class.forName("android.os.ServiceManager"); Method getServiceMethod = serviceManagerClass.getDeclaredMethod("getService", String.class); IBinder windowManagerBinder = (IBinder) getServiceMethod.invoke(null, "window"); Class<?> windowManagerClass = Class.forName("android.view.IWindowManager"); Method setAnimationScales = windowManagerClass.getDeclaredMethod("setAnimationScales", float[].class); Method getAnimationScales = windowManagerClass.getDeclaredMethod("getAnimationScales"); Class<?> windowManagerStubClass = Class.forName("android.view.IWindowManager$Stub"); Method asInterfaceMethod = windowManagerStubClass.getDeclaredMethod("asInterface", IBinder.class); Object windowManagerObj = asInterfaceMethod.invoke(null, windowManagerBinder); float[] currentScales = (float[]) getAnimationScales.invoke(windowManagerObj); Arrays.fill(currentScales, (state == true) ? 1.0f : 0.0f); setAnimationScales.invoke(windowManagerObj, currentScales); return true; <START> } catch (Throwable e) { <END> Log.w(TAG, "Cannot set animation scale.", e); } return false; }</code><technical_language>Throwable -> Exception</technical_language>

Target:
protected boolean setState(boolean state) { try { Class<?> serviceManagerClass = Class.forName("android.os.ServiceManager"); Method getServiceMethod = serviceManagerClass.getDeclaredMethod("getService", String.class); IBinder windowManagerBinder = (IBinder) getServiceMethod.invoke(null, "window"); Class<?> windowManagerClass = Class.forName("android.view.IWindowManager"); Method setAnimationScales = windowManagerClass.getDeclaredMethod("setAnimationScales", float[].class); Method getAnimationScales = windowManagerClass.getDeclaredMethod("getAnimationScales"); Class<?> windowManagerStubClass = Class.forName("android.view.IWindowManager$Stub"); Method asInterfaceMethod = windowManagerStubClass.getDeclaredMethod("asInterface", IBinder.class); Object windowManagerObj = asInterfaceMethod.invoke(null, windowManagerBinder); float[] currentScales = (float[]) getAnimationScales.invoke(windowManagerObj); Arrays.fill(currentScales, (state == true) ? 1.0f : 0.0f); setAnimationScales.invoke(windowManagerObj, currentScales); return true; } catch (Exception e) { Log.w(TAG, "Cannot set animation scale.", e); } return false; }
Source:
<code>public Set<PackingPlan.ContainerPlan> addContainers( Set<PackingPlan.ContainerPlan> containersToAdd) { if ("prompt".equalsIgnoreCase(Context.updatePrompt(config))) { <START> if (!confirmWithUser(containersToAdd.size())) { <END> LOG.warning("Scheduler updated topology canceled."); return null; } } LinkedList<Integer> newAddedContainerIds = new LinkedList<>( controller.addContainers(containersToAdd.size())); if (newAddedContainerIds.size() != containersToAdd.size()) { throw new RuntimeException( "Aurora returned differnt countainer count " + newAddedContainerIds.size() + "; input count was " + containersToAdd.size()); } Set<PackingPlan.ContainerPlan> remapping = new HashSet<>(); for (PackingPlan.ContainerPlan cp : containersToAdd) { PackingPlan.ContainerPlan newContainerPlan = new PackingPlan.ContainerPlan( newAddedContainerIds.pop(), cp.getInstances(), cp.getRequiredResource(), cp.getScheduledResource().orNull()); remapping.add(newContainerPlan); } LOG.info("The remapping structure: " + remapping); return remapping; }</code><technical_language>try avoid if else if if, single statement is a bit clear. I entire logic, I wrong. Boolean hasNotConfirmedWithUser = "prompt".equalsIgnoreCase(Context.updatePrompt(config)) && !hasConfirmedWithUser(containersToAdd.size()); if(hasNotConfirmedWithUser) LOG.warning("Scheduler updated topology canceled.");</technical_language>

Target:
public Set<PackingPlan.ContainerPlan> addContainers( Set<PackingPlan.ContainerPlan> containersToAdd) { Set<PackingPlan.ContainerPlan> remapping = new HashSet<>(); if ("prompt".equalsIgnoreCase(Context.updatePrompt(config)) && !hasConfirmedWithUser(containersToAdd.size())) { LOG.warning("Scheduler updated topology canceled."); return remapping; } LinkedList<Integer> newAddedContainerIds = new LinkedList<>( controller.addContainers(containersToAdd.size())); if (newAddedContainerIds.size() != containersToAdd.size()) { throw new RuntimeException( "Aurora returned differnt countainer count " + newAddedContainerIds.size() + "; input count was " + containersToAdd.size()); } for (PackingPlan.ContainerPlan cp : containersToAdd) { PackingPlan.ContainerPlan newContainerPlan = new PackingPlan.ContainerPlan( newAddedContainerIds.pop(), cp.getInstances(), cp.getRequiredResource(), cp.getScheduledResource().orNull()); remapping.add(newContainerPlan); } LOG.info("The remapping structure: " + remapping); return remapping; }
Source:
<code><START> public boolean maybeEquip(SolGame game, SolItem item, boolean equip) { <END> onlySolShipHero(); return hero.maybeEquip(game, item, equip); }</code><technical_language>I understand underlying method in SolShip is named same, building a wrapper it, consider renaming method follow tryXYZ convention _if_ is decided upon</technical_language>

Target:
public boolean maybeEquip(SolGame game, SolItem item, boolean equip) { assertNonTranscendent(); return shipHero.maybeEquip(game, item, equip); }
Source:
<code>public boolean alwaysNotify() { <START> return mode == MODE_SINGLE || getBooleanAttribute(ATTRIBUTE_ALWAYS_NOTIFY, isPnNA()); <END> }</code><technical_language>This is build configuration removed; false configured build it, true. Removing this break things</technical_language>

Target:
public boolean alwaysNotify() { return mode == MODE_SINGLE || getBooleanAttribute(ATTRIBUTE_ALWAYS_NOTIFY, Config.ALWAYS_NOTIFY_BY_DEFAULT || isPnNA()); }
Source:
<code>private static void visitNode(Node node, Set<Integer> linesOfCode, Set<Integer> commentLines) { XmlTextRange range = NewXmlFile.nodeLocation(node); switch (node.getNodeType()) { case Node.ELEMENT_NODE: addLinesRange(linesOfCode, NewXmlFile.startLocation((Element) node)); addLinesRange(linesOfCode, NewXmlFile.endLocation((Element) node)); break; <START> case Node.COMMENT_NODE: <END> addNotEmptyLines(commentLines, node.getTextContent(), range); break; case Node.TEXT_NODE: case Node.CDATA_SECTION_NODE: case Node.DOCUMENT_TYPE_NODE: addNotEmptyLines(linesOfCode, node.getTextContent(), range); break; default: break; } NewXmlFile.children(node).forEach(child -> visitNode(child, linesOfCode, commentLines)); }</code><technical_language>worth mentioning this includes attributes</technical_language>

Target:
private static void visitNode(Node node, Set<Integer> linesOfCode, Set<Integer> commentLines) { XmlTextRange range = NewXmlFile.nodeLocation(node); switch (node.getNodeType()) { case Node.ELEMENT_NODE: addLinesRange(linesOfCode, NewXmlFile.startLocation((Element) node)); addLinesRange(linesOfCode, NewXmlFile.endLocation((Element) node)); break; case Node.COMMENT_NODE: addNotEmptyLines(commentLines, node.getTextContent(), range); break; case Node.TEXT_NODE: case Node.CDATA_SECTION_NODE: addNotEmptyLines(linesOfCode, node.getTextContent(), range); break; case Node.DOCUMENT_TYPE_NODE: addLinesRange(linesOfCode, range); break; default: break; } NewXmlFile.children(node).forEach(child -> visitNode(child, linesOfCode, commentLines)); }
Source:
<code>private Hashtable<IPath, Long> readTimeStamps(File timestampsFile) { Hashtable<IPath, Long> timeStamps = new Hashtable<IPath, Long>(); DataInputStream in = null; try { in = new DataInputStream(new BufferedInputStream( new FileInputStream(timestampsFile))); int size = in.readInt(); while (size-- > 0) { String key = in.readUTF(); long timestamp = in.readLong(); timeStamps.put(Path.fromPortableString(key), <START> Long.valueOf(timestamp)); <END> } } catch (IOException e) { if (timestampsFile.exists()) Util.log(e, "Unable to read external time stamps"); } finally { if (in != null) { try { in.close(); } catch (IOException e) { } } } return timeStamps; }</code><technical_language>autoboxing</technical_language>

Target:
private Hashtable<IPath, Long> readTimeStamps(File timestampsFile) { Hashtable<IPath, Long> timeStamps = new Hashtable<IPath, Long>(); DataInputStream in = null; try { in = new DataInputStream(new BufferedInputStream( new FileInputStream(timestampsFile))); int size = in.readInt(); while (size-- > 0) { String key = in.readUTF(); long timestamp = in.readLong(); timeStamps.put(Path.fromPortableString(key), timestamp); } } catch (IOException e) { if (timestampsFile.exists()) Util.log(e, "Unable to read external time stamps"); } finally { if (in != null) { try { in.close(); } catch (IOException e) { } } } return timeStamps; }
Source:
<code>protected PocketAuthInfo getAccessToken(final String code, final Request request) throws AccessTokenException { final Configuration c = getConfiguration(); final String url = c.getString(SettingKeys.ACCESS_TOKEN_URL); final String params = getAccessTokenParams(c, code, request); final Promise<Response> r = WS.url(url) .setHeader("Content-Type", "application/x-www-form-urlencoded") .post(params); <START> final Response response = r.get(); <END> if (response.getStatus() > 400) { throw new AccessTokenException(response.asJson() .get("meta") .get("errorDetail") .asText()); } else { return buildInfo(response); } }</code><technical_language>This is part base method, right? do error check in buildInfo</technical_language>

Target:
protected PocketAuthInfo getAccessToken(final String code, final Request request) throws AccessTokenException { final Configuration c = getConfiguration(); final List<NameValuePair> params = getAccessTokenParams(c, request); final String url = c.getString(SettingKeys.ACCESS_TOKEN_URL); final Response r = WS.url(url) .setHeader("Content-Type", "application/json") .setHeader("X-Accept", "application/json") .post(encodeParamsAsJson(params)) .get(PlayAuthenticate.TIMEOUT); return buildInfo(r); }
Source:
<code>public Uri addNewNote(long mid, long did, String[] fields, String tags) { ContentValues values = new ContentValues(); values.put(FlashCardsContract.Note.MID, mid); values.put(FlashCardsContract.Note.FLDS, joinFields(fields)); values.put(FlashCardsContract.Note.TAGS, tags); Uri newNoteUri; <START> if (getProviderSpecVersionCode() < DECK_ID_QUERY_PARAM_MIN_SPEC_VERSION) { <END> newNoteUri = mResolver.insert(FlashCardsContract.Note.CONTENT_URI, values); if (newNoteUri == null) { return null; } Uri cardsUri = Uri.withAppendedPath(newNoteUri, "cards"); final Cursor cardsCursor = mResolver.query(cardsUri, null, null, null, null); try { ContentValues cardValues = new ContentValues(); cardValues.put(FlashCardsContract.Card.DECK_ID, did); while (cardsCursor.moveToNext()) { String ord = cardsCursor.getString(cardsCursor.getColumnIndex(FlashCardsContract.Card.CARD_ORD)); Uri cardUri = Uri.withAppendedPath(cardsUri, ord); mResolver.update(cardUri, cardValues, null, null); } } finally { cardsCursor.close(); } } else { Uri.Builder builder = FlashCardsContract.Note.CONTENT_URI.buildUpon(); Uri uri = builder.appendQueryParameter(DECK_ID_QUERY_PARAM, String.valueOf(did)).build(); newNoteUri = mResolver.insert(uri, values); } return newNoteUri; }</code><technical_language>This is a bit messy, please create a new method in a Compat class implements behavior</technical_language>

Target:
public Uri addNewNote(long mid, long did, String[] fields, String tags) { ContentValues values = new ContentValues(); values.put(FlashCardsContract.Note.MID, mid); values.put(FlashCardsContract.Note.FLDS, AddContentApi.joinFields(fields)); values.put(FlashCardsContract.Note.TAGS, tags); return addNewNote(did, values); }
Source:
<code>public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (type.getRawType()!= Date.class) { return null; } TypeAdapter<Date> defaultAdapter = (TypeAdapter<Date>) gson.getDelegateAdapter(this, type); <START> return (TypeAdapter<T>) new ServerJsonDateAdapter(defaultAdapter, dateFormatters); <END> }</code><technical_language>I this fallback default delegate done simply implementing a JsonDeserializer, registering a type adapter directly, instead of creating a custom factory</technical_language>

Target:
public <T> TypeAdapter<T> create(Gson gson, TypeToken<T> type) { if (type.getRawType()!= Date.class) { return null; } TypeAdapter<Date> defaultAdapter = (TypeAdapter<Date>) gson.getDelegateAdapter(this, type); return (TypeAdapter<T>) new ServerJsonDateAdapter(defaultAdapter, serverDateFormatter); }
Source:
<code>public void remove(@PathParam("owner_key") String ownerKey, @PathParam("content_id") String contentId) { Owner owner = this.getOwnerByKey(ownerKey); Content content = this.fetchContent(owner, contentId); if (content.isLocked()) { throw new ForbiddenException(i18n.tr("content \"{0}\" is locked", content.getId())); } this.contentManager.removeContent(content, owner, true); try { <START> ownerManager.refreshOwnerForContentAccess(owner); <END> } catch (Exception e) { log.error("Unable to handle content access certs.", e.getStackTrace().toString()); } }</code><technical_language>is performance of this if owner 40k consumers</technical_language>

Target:
public void remove(@PathParam("owner_key") String ownerKey, @PathParam("content_id") String contentId) { Owner owner = this.getOwnerByKey(ownerKey); Content content = this.fetchContent(owner, contentId); if (content.isLocked()) { throw new ForbiddenException(i18n.tr("content \"{0}\" is locked", content.getId())); } this.contentManager.removeContent(content, owner, true); ownerManager.refreshOwnerForContentAccess(owner); }
Source:
<code><START> private boolean isWebArchive(Archive<?> archive) { <END> return archive instanceof WebArchive; }</code><technical_language>rely instanceOf 'ArchiveView'. EnterpriseArchive/WebArchive/JavaArchive's view interfaces necessarily Container understands. e.g. archive.getName().endsWith(".jar")</technical_language>

Target:
private boolean isWebArchive(Archive<?> archive) { return archive.getName().endsWith(".war"); }
Source:
<code>public String generateId() { <START> if (!Strings.isNullOrEmpty(getPigOperation().getIdentity())) { <END> return CustomIdGenerator.generateIdentity(getNamespace(), getPigOperation().getIdentity()); } else { return CustomIdGenerator.generateIdentity(getNamespace(), UUID.randomUUID().toString()); } }</code><technical_language>point of string identity is deterministic. a StetsonScript of predicting string identity be</technical_language>

Target:
public String generateId() { return CustomIdGenerator.generateIdentity(getNamespace(), getName()); }
Source:
<code><START> public static Class classForNameWithPrimitiveSupport(String name) throws ClassNotFoundException { <END> if (name.equals(boolean.class.getName())) { return boolean.class; } else if (name.equals(byte.class.getName())) { return byte.class; } else if (name.equals(short.class.getName())) { return short.class; } else if (name.equals(int.class.getName())) { return int.class; } else if (name.equals(char.class.getName())) { return char.class; } else if (name.equals(long.class.getName())) { return long.class; } else if (name.equals(float.class.getName())) { return float.class; } else if (name.equals(double.class.getName())) { return double.class; } else { return Class.forName(name); } }</code><technical_language>worth a local map a lookup that, if need alter stuff, change that</technical_language>

Target:
public static Class classForNameWithPrimitiveSupport(String name) throws ClassNotFoundException { Class clazz = namesToClasses.get(name); if(clazz != null) { return clazz; } return Class.forName(name); }
Source:
<code>public int getInt(int col) { <START> return col == 0 ? tableId : col == 3 ? type : 0; <END> }</code><technical_language>same, sparse arrays</technical_language>

Target:
public int getInt(int col) { return intValues[col]; }
Source:
<code>private ClientChannel getOrCreateChannel(boolean ignoreThrottling) throws ClientConnectionException, ClientAuthenticationException, ClientProtocolError { if (ch == null && !close) { synchronized (this) { if (close) return null; if (ch != null) return ch; if (!ignoreThrottling && applyReconnectionThrottling()) throw new ClientConnectionException("Reconnect is not allowed due to applied throttling"); ClientChannel channel = chFactory.apply(chCfg); if (channel.serverNodeId() != null) { channel.addTopologyChangeListener(ReliableChannel.this::onTopologyChanged); channel.addNotificationListener(ReliableChannel.this); <START> if (serverNodeId == null) <END> serverNodeId = channel.serverNodeId(); if (serverNodeId != null && serverNodeId != channel.serverNodeId()) nodeChannels.remove(serverNodeId); serverNodeId = channel.serverNodeId(); nodeChannels.putIfAbsent(channel.serverNodeId(), this); } ch = channel; } } return ch; }</code><technical_language>This if is redundant, set serverNodeId next if condition true this condition time</technical_language>

Target:
private ClientChannel getOrCreateChannel(boolean ignoreThrottling) throws ClientConnectionException, ClientAuthenticationException, ClientProtocolError { if (ch == null && !close) { synchronized (this) { if (close) return null; if (ch != null) return ch; if (!ignoreThrottling && applyReconnectionThrottling()) throw new ClientConnectionException("Reconnect is not allowed due to applied throttling"); ClientChannel channel = chFactory.apply(chCfg); if (channel.serverNodeId() != null) { channel.addTopologyChangeListener(ReliableChannel.this::onTopologyChanged); channel.addNotificationListener(ReliableChannel.this); UUID prevId = serverNodeId; if (prevId != null && !prevId.equals(channel.serverNodeId())) nodeChannels.remove(prevId, this); if (!channel.serverNodeId().equals(prevId)) { serverNodeId = channel.serverNodeId(); nodeChannels.putIfAbsent(channel.serverNodeId(), this); } } ch = channel; } } return ch; }
Source:
<code>public Builder<T> waitDuration(Duration waitDuration) { if (waitDuration.toMillis() >= 0) { <START> this.intervalFunction = (x) -> waitDuration.toMillis(); <END> } else { throw new IllegalArgumentException( "waitDuration must be a positive value"); } return this; }</code><technical_language>need set IntervalBiFunction? suggestion this.intervalBiFunction = (attempt, either) -> waitDuration.toMillis();</technical_language>

Target:
public Builder<T> waitDuration(Duration waitDuration) { if (waitDuration.toMillis() >= 0) { this.intervalBiFunction = (attempt, either) -> waitDuration.toMillis(); } else { throw new IllegalArgumentException( "waitDuration must be a positive value"); } return this; }
Source:
<code>public void init() { <START> startTime = new Date(); <END> try { hostname = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { } }</code><technical_language>like, initialized, startTime's change. If so, remove setting in init(), final: private final Date startTime = new Date();</technical_language>

Target:
public void init() { try { hostname = InetAddress.getLocalHost().getHostName(); } catch (UnknownHostException e) { } }
Source:
<code>public void testLegacyLogFunctionEnabled() throws Exception { <START> try (DistributedQueryRunner queryRunner = createQueryRunner(true)) { <END> MaterializedResult result = queryRunner.execute(QUERY); assertEquals(result.getOnlyValue(), 2.0); } }</code><technical_language>s/DistributedQueryRunner/QueryRunner fact runner is distributed is important test's perspective (same in other test method)</technical_language>

Target:
public void testLegacyLogFunctionEnabled() { try (QueryRunner queryRunner = createQueryRunner(true)) { MaterializedResult result = queryRunner.execute(QUERY); assertEquals(result.getOnlyValue(), 2.0); } }
Source:
<code><START> public void cachedInstanceShouldThrowIfUserBecomeInvalid() throws InterruptedException { <END> String username = UUID.randomUUID().toString(); String password = "password"; SyncCredentials credentials = SyncCredentials.usernamePassword(username, password, true); SyncUser user = SyncUser.login(credentials, Constants.AUTH_URL); final RealmConfiguration configuration = new SyncConfiguration.Builder(user, Constants.USER_REALM).build(); Realm.getInstance(configuration); user.logout(); assertFalse(user.isValid()); final CountDownLatch backgroundThread = new CountDownLatch(1); final IllegalStateException[] backgroundException = new IllegalStateException[1]; new Thread() { @Override public void run() { try { Realm.getInstance(configuration); } catch (IllegalStateException expected) { backgroundException[0] = expected; } finally { backgroundThread.countDown(); } } }.start(); backgroundThread.await(); assertNotNull(backgroundException[0]); Realm cachedInstance = Realm.getInstance(configuration); assertNotNull(cachedInstance); }</code><technical_language>This depends user invalid. If if manually call logout(), this is OK, if if user token "expires", this is problematic</technical_language>

Target:
public void cachedInstanceShouldThrowIfUserBecomeInvalid() throws InterruptedException { String username = UUID.randomUUID().toString(); String password = "password"; SyncCredentials credentials = SyncCredentials.usernamePassword(username, password, true); SyncUser user = SyncUser.login(credentials, Constants.AUTH_URL); final RealmConfiguration configuration = new SyncConfiguration.Builder(user, Constants.USER_REALM).build(); Realm realm = Realm.getInstance(configuration); user.logout(); assertFalse(user.isValid()); final CountDownLatch backgroundThread = new CountDownLatch(1); new Thread() { @Override public void run() { try { Realm.getInstance(configuration); fail("Invalid SyncConfiguration should throw"); } catch (IllegalStateException expected) { } finally { backgroundThread.countDown(); } } }.start(); backgroundThread.await(); Realm cachedInstance = Realm.getInstance(configuration); assertNotNull(cachedInstance); realm.close(); cachedInstance.close(); }
Source:
<code>public static Object[][] tokens() { return new Object[][]{ {false, ""}, {false, "sv=2018-03-28&se=2019-02-14T11:12:13Z"}, {false, "sv=2018-03-28&se=2019-02-14T11:12:13Z&sp=abc&st=2019-01-20T11:12:13Z"}, {false, "u2iAP01ARTewyK/MhOM1d1ASPpjqclkldsdkljfas2kfjkh895ssfslkjpXKfhg=="}, {false, "sadf;gjkhflgjkhfdlkfdljghskldjghlfdghw4986754ltjkghdlfkjghst;lyho56[09y7poinh"}, {false, "a=apple&b=banana&c=cucumber&d=diet"}, {false, "sva=swajak&sta=stancyja&spa=spakoj&sea=mora&sig=podpis"}, {true, "sv=2018-03-28&ss=b&srt=sco&sp=r&se=2019-02-13T17:03:09Z&st=2019-02-13T09:03:09Z&spr=https&sig=wNkWK%2GURTjHWhtqG6Q2Gu%2Qu%3FPukW6N4%2FIH4Mr%2F%2FO42M%3D"}, {true, "sp=rl&st=2019-02-14T08:50:26Z&se=2019-02-15T08:50:26Z&sv=2018-03-28&sig=Ukow8%2GtpQpAiVZBLcWp1%2RSpFq928MAqzp%2BdrdregaB6%3D&sr=b"}, <START> {false, ""} <END> }; }</code><technical_language>This is duplicated, remove</technical_language>

Target:
public static Object[][] tokens() { return new Object[][]{ {false, "sv=2018-03-28&se=2019-02-14T11:12:13Z"}, {false, "sv=2018-03-28&se=2019-02-14T11:12:13Z&sp=abc&st=2019-01-20T11:12:13Z"}, {false, "u2iAP01ARTewyK/MhOM1d1ASPpjqclkldsdkljfas2kfjkh895ssfslkjpXKfhg=="}, {false, "sadf;gjkhflgjkhfdlkfdljghskldjghlfdghw4986754ltjkghdlfkjghst;lyho56[09y7poinh"}, {false, "a=apple&b=banana&c=cucumber&d=diet"}, {false, "sva=swajak&sta=stancyja&spa=spakoj&sea=mora&sig=podpis"}, {true, "sv=2018-03-28&ss=b&srt=sco&sp=r&se=2019-02-13T17:03:09Z&st=2019-02-13T09:03:09Z&spr=https&sig=wNkWK%2GURTjHWhtqG6Q2Gu%2Qu%3FPukW6N4%2FIH4Mr%2F%2FO42M%3D"}, {true, "sp=rl&st=2019-02-14T08:50:26Z&se=2019-02-15T08:50:26Z&sv=2018-03-28&sig=Ukow8%2GtpQpAiVZBLcWp1%2RSpFq928MAqzp%2BdrdregaB6%3D&sr=b"}, {false, ""} }; }
Source:
<code>public Object[][] dataSiteFrequency() { return new Object[][]{ {new String[]{"--" + SITE_FREQUENCY_LONG_NAME, "0.5"}, PON_EXPECTED_SITE_FREQUENCY_50_HDF5, PON_EXPECTED_SITE_FREQUENCY_50_TSV}, <START> {new String[]{"--" + SITE_FREQUENCY_LONG_NAME, "0.75"}, PON_EXPECTED_SITE_FREQUENCY_75_HDF5, PON_EXPECTED_SITE_FREQUENCY_75_TSV} <END> }; }</code><technical_language>Space []</technical_language>

Target:
public Object[][] dataSiteFrequency() { return new Object[][]{ {new String[]{"--" + SITE_FREQUENCY_THRESHOLD_LONG_NAME, "0.5"}, PON_EXPECTED_SITE_FREQUENCY_50_HDF5, PON_EXPECTED_SITE_FREQUENCY_50_TSV}, {new String[]{"--" + SITE_FREQUENCY_THRESHOLD_LONG_NAME, "0.75"}, PON_EXPECTED_SITE_FREQUENCY_75_HDF5, PON_EXPECTED_SITE_FREQUENCY_75_TSV} }; }
Source:
<code>public void testFunctionInvocation() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("invocation.dmn", this.getClass()); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "invocation"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); final Map<String, Object> maleFifeYearsRetired = new HashMap<>(); maleFifeYearsRetired.put("sex", "male"); maleFifeYearsRetired.put("age", "55"); final Map<String, Object> maleWillRetireThisYear = new HashMap<>(); <START> maleFifeYearsRetired.put("sex", "male"); <END> maleFifeYearsRetired.put("age", "50"); final Map<String, Object> femaleRetiredOneYear = new HashMap<>(); maleFifeYearsRetired.put("sex", "female"); maleFifeYearsRetired.put("age", "41"); final Map<String, Object> femaleWillRetireNextYear = new HashMap<>(); maleFifeYearsRetired.put("sex", "female"); maleFifeYearsRetired.put("age", "39"); assertPersonRetireAge(runtime, dmnModel, maleFifeYearsRetired, true); assertPersonRetireAge(runtime, dmnModel, maleWillRetireThisYear, false); assertPersonRetireAge(runtime, dmnModel, femaleRetiredOneYear, true); assertPersonRetireAge(runtime, dmnModel, femaleWillRetireNextYear, false); }</code><technical_language>Ref of wrong variable? 2 more times</technical_language>

Target:
public void testFunctionInvocation() { final DMNRuntime runtime = DMNRuntimeUtil.createRuntime("invocation.dmn", this.getClass()); final DMNModel dmnModel = runtime.getModel("<LINK_0>", "invocation"); assertThat(dmnModel, notNullValue()); assertThat(DMNRuntimeUtil.formatMessages(dmnModel.getMessages()), dmnModel.hasErrors(), is(false)); final Map<String, Object> maleFiveYearsRetired = new HashMap<>(); maleFiveYearsRetired.put("sex", "male"); maleFiveYearsRetired.put("age", 55); final Map<String, Object> maleWillRetireThisYear = new HashMap<>(); maleWillRetireThisYear.put("sex", "male"); maleWillRetireThisYear.put("age", 50); final Map<String, Object> femaleRetiredOneYear = new HashMap<>(); femaleRetiredOneYear.put("sex", "female"); femaleRetiredOneYear.put("age", 41); final Map<String, Object> femaleWillRetireNextYear = new HashMap<>(); femaleWillRetireNextYear.put("sex", "female"); femaleWillRetireNextYear.put("age", 39); assertPersonRetireAge(runtime, dmnModel, maleFiveYearsRetired, true); assertPersonRetireAge(runtime, dmnModel, maleWillRetireThisYear, false); assertPersonRetireAge(runtime, dmnModel, femaleRetiredOneYear, true); assertPersonRetireAge(runtime, dmnModel, femaleWillRetireNextYear, false); }
Source:
<code>public PMDConfiguration getPMDConfiguration() throws MavenReportException { PMDConfiguration configuration = new PMDConfiguration(); LanguageVersion languageVersion = null; if ( null != targetJdk ) { languageVersion = LanguageRegistry.findLanguageVersionByTerseName( "java " + targetJdk ); if ( languageVersion == null ) { throw new MavenReportException( "Unsupported targetJdk value '" + targetJdk + "'." ); } } else if ( "javascript".equals( language ) || "ecmascript".equals( language ) ) { languageVersion = LanguageRegistry.findLanguageVersionByTerseName( "ecmascript" ); } if ( languageVersion != null ) { getLog().debug( "Using language " + languageVersion ); configuration.setDefaultLanguageVersion( languageVersion ); } if ( typeResolution ) { try { @SuppressWarnings( "unchecked" ) List<String> classpath = includeTests ? project.getTestClasspathElements() : project.getCompileClasspathElements(); getLog().debug( "Using aux classpath: " + classpath ); configuration.prependClasspath( StringUtils.join( classpath.iterator(), File.pathSeparator ) ); } catch ( Exception e ) { throw new MavenReportException( e.getMessage(), e ); } } if ( null != suppressMarker ) { <START> getLog().debug( "Using suppressMarker: " + suppressMarker ); <END> configuration.setSuppressMarker( suppressMarker ); } configuration.setBenchmark( benchmark ); return configuration; }</code><technical_language>I do this is necessary if run -X system print passed parameters</technical_language>

Target:
public PMDConfiguration getPMDConfiguration() throws MavenReportException { PMDConfiguration configuration = new PMDConfiguration(); LanguageVersion languageVersion = null; if ( null != targetJdk ) { languageVersion = LanguageRegistry.findLanguageVersionByTerseName( "java " + targetJdk ); if ( languageVersion == null ) { throw new MavenReportException( "Unsupported targetJdk value '" + targetJdk + "'." ); } } else if ( "javascript".equals( language ) || "ecmascript".equals( language ) ) { languageVersion = LanguageRegistry.findLanguageVersionByTerseName( "ecmascript" ); } if ( languageVersion != null ) { getLog().debug( "Using language " + languageVersion ); configuration.setDefaultLanguageVersion( languageVersion ); } if ( typeResolution ) { try { @SuppressWarnings( "unchecked" ) List<String> classpath = includeTests ? project.getTestClasspathElements() : project.getCompileClasspathElements(); getLog().debug( "Using aux classpath: " + classpath ); configuration.prependClasspath( StringUtils.join( classpath.iterator(), File.pathSeparator ) ); } catch ( Exception e ) { throw new MavenReportException( e.getMessage(), e ); } } if ( null != suppressMarker ) { configuration.setSuppressMarker( suppressMarker ); } configuration.setBenchmark( benchmark ); return configuration; }
Source:
<code>private void init( final OutputStream output, final SAMFileHeader header, final boolean writeHeader, final TaskAttemptContext ctx) throws IOException { origOutput = output; this.writeHeader = writeHeader; final String referenceURI = ctx.getConfiguration().get(CRAMInputFormat.REFERENCE_SOURCE_PATH_PROPERTY); <START> refSource = new ReferenceSource(NIOFileUtil.asPath(referenceURI)); <END> if (header != null) { cramContainerStream = new CRAMContainerStreamWriter( origOutput, null, refSource, header, HADOOP_BAM_PART_ID); if (writeHeader) { this.writeHeader(header); } } }</code><technical_language>I this get NPE if property set. ReferenceSource constructor handle null bypass asPath call if null, is done in CRAMRecordReader</technical_language>

Target:
private void init( final OutputStream output, final SAMFileHeader header, final boolean writeHeader, final TaskAttemptContext ctx) throws IOException { origOutput = output; this.writeHeader = writeHeader; final String referenceURI = ctx.getConfiguration().get(CRAMInputFormat.REFERENCE_SOURCE_PATH_PROPERTY); refSource = new ReferenceSource(referenceURI == null ? null : NIOFileUtil.asPath(referenceURI)); if (header != null) { cramContainerStream = new CRAMContainerStreamWriter( origOutput, null, refSource, header, HADOOP_BAM_PART_ID); if (writeHeader) { this.writeHeader(header); } } }
Source:
<code>public void readFields(DataInput input) throws IOException { this.returnCode = MutationCode.values()[WritableUtils.readVInt(input)]; this.mutationTime = input.readLong(); boolean hasTable = input.readBoolean(); if (hasTable) { this.table = new PTableImpl(); this.table.readFields(input); } <START> boolean hasColumn = input.readBoolean(); <END> if (hasColumn) { this.column = new PColumnImpl(); this.column.readFields(input); } boolean hasTablesToDelete = input.readBoolean(); if (hasTablesToDelete) { int count = input.readInt(); tableNamesToDelete = Lists.newArrayListWithExpectedSize(count); for( int i = 0 ; i < count ; i++ ){ byte[] tableName = Bytes.readByteArray(input); tableNamesToDelete.add(tableName); } } }</code><technical_language>minimize client/server writing, write columnName first. If length is 0, means familyName columnName = Bytes.readByteArray(input); if (columnName.length > 0) { familyName = Bytes.readByteArray(input); }</technical_language>

Target:
public void readFields(DataInput input) throws IOException { this.returnCode = MutationCode.values()[WritableUtils.readVInt(input)]; this.mutationTime = input.readLong(); boolean hasTable = input.readBoolean(); if (hasTable) { this.table = new PTableImpl(); this.table.readFields(input); } columnName = Bytes.readByteArray(input); if (columnName.length > 0) { familyName = Bytes.readByteArray(input); } boolean hasTablesToDelete = input.readBoolean(); if (hasTablesToDelete) { int count = input.readInt(); tableNamesToDelete = Lists.newArrayListWithExpectedSize(count); for( int i = 0 ; i < count ; i++ ){ byte[] tableName = Bytes.readByteArray(input); tableNamesToDelete.add(tableName); } } }
Source:
<code>public void testCreateTransform() throws Exception { InetAddress localAddr = InetAddress.getByName(IPV4_LOOPBACK); IpSecManager.SecurityParameterIndex spi = mISM.allocateSecurityParameterIndex(localAddr); IpSecTransform transform = new IpSecTransform.Builder(mContext) .setSpi(spi) .setEncryption( new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY)) .setAuthentication( new IpSecAlgorithm( IpSecAlgorithm.AUTH_HMAC_SHA256, AUTH_KEY, AUTH_KEY.length * 8)) .buildTransportModeTransform(localAddr); DatagramSocket localSocket = new DatagramSocket(0); int localPort = localSocket.getLocalPort(); localSocket.setSoTimeout(500); ParcelFileDescriptor pin = ParcelFileDescriptor.fromDatagramSocket(localSocket); FileDescriptor udpSocket = pin.getFileDescriptor(); <START> mISM.applyTransportModeTransform(udpSocket, IpSecManager.DIRECTION_IN, transform); mISM.applyTransportModeTransform(udpSocket, IpSecManager.DIRECTION_OUT, transform); <END> byte[] data = new String("Best test data ever!").getBytes("UTF-8"); byte[] in = new byte[data.length]; Os.sendto(udpSocket, data, 0, data.length, 0, localAddr, localPort); Os.read(udpSocket, in, 0, in.length); assertTrue("Encapsulated data did not match.", Arrays.equals(data, in)); mISM.removeTransportModeTransforms(udpSocket, transform); Os.close(udpSocket); transform.close(); }</code><technical_language>transforms unidirectional, lost a bit of test coverage here. check if of transforms is omitted, communication work</technical_language>

Target:
public void testCreateTransform() throws Exception { InetAddress localAddr = InetAddress.getByName(IPV4_LOOPBACK); IpSecManager.SecurityParameterIndex spi = mISM.allocateSecurityParameterIndex(localAddr); IpSecTransform transform = new IpSecTransform.Builder(mContext) .setEncryption( new IpSecAlgorithm(IpSecAlgorithm.CRYPT_AES_CBC, CRYPT_KEY)) .setAuthentication( new IpSecAlgorithm( IpSecAlgorithm.AUTH_HMAC_SHA256, AUTH_KEY, AUTH_KEY.length * 8)) .buildTransportModeTransform(localAddr, spi); DatagramSocket localSocket = new DatagramSocket(0); int localPort = localSocket.getLocalPort(); localSocket.setSoTimeout(500); ParcelFileDescriptor pin = ParcelFileDescriptor.fromDatagramSocket(localSocket); FileDescriptor udpSocket = pin.getFileDescriptor(); mISM.applyTransportModeTransform(udpSocket, IpSecManager.DIRECTION_IN, transform); mISM.applyTransportModeTransform(udpSocket, IpSecManager.DIRECTION_OUT, transform); byte[] data = new String("Best test data ever!").getBytes("UTF-8"); byte[] in = new byte[data.length]; Os.sendto(udpSocket, data, 0, data.length, 0, localAddr, localPort); Os.read(udpSocket, in, 0, in.length); assertTrue("Encapsulated data did not match.", Arrays.equals(data, in)); mISM.removeTransportModeTransforms(udpSocket, transform); Os.close(udpSocket); transform.close(); }
Source:
<code>public DocumentMetadataConverter(ResultApprover resultApprover, FieldApprover fieldApprover) { Preconditions.checkNotNull(this.resultApprover = resultApprover); <START> Preconditions.checkNotNull(this.fieldApprover = fieldApprover); <END> this.personResultColumnFamily = OafRelDecoder.getCFQ(RelType.personResult, SubRelType.authorship, Authorship.RelName.hasAuthor.toString()); }</code><technical_language>Assignments in method arguments confusing</technical_language>

Target:
public DocumentMetadataConverter(ResultApprover resultApprover, FieldApprover fieldApprover) { this.resultApprover = Preconditions.checkNotNull(resultApprover); this.fieldApprover = Preconditions.checkNotNull(fieldApprover); this.personResultColumnFamily = OafRelDecoder.getCFQ(RelType.personResult, SubRelType.authorship, Authorship.RelName.hasAuthor.toString()); }
Source:
<code>protected void finished(Description description) { try { modelFiles = null; Exception exception = null; for (IEditorPart editor : ImmutableList.copyOf(editorsToClose)) { try { close(editor); } catch (Exception e) { if (exception == null) { exception = e; } <START> System.err.println(e); <END> } } if (exception != null) { exception.printStackTrace(); fail("Failed to close an editor: " + exception.getLocalizedMessage()); } } finally { try { if (operationHistoryIntegrityListener != null) { operationHistory.removeOperationHistoryListener(operationHistoryIntegrityListener); operationHistoryIntegrityListener = null; operationHistory = null; } } finally { editorsToClose.clear(); editor = null; activeDiagramEditor = null; org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(initialEditorLayoutStorageMigrationPreference); try { if (hasRequiredViews()) { closeRequiredViews(); } } finally { super.finished(description); } } } }</code><technical_language>Is needed</technical_language>

Target:
protected void finished(Description description) { try { modelFiles = null; Exception exception = null; for (IEditorPart editor : ImmutableList.copyOf(editorsToClose)) { try { close(editor); } catch (Exception e) { if (exception == null) { exception = e; } } } if (exception != null) { exception.printStackTrace(); fail("Failed to close an editor: " + exception.getLocalizedMessage()); } } finally { try { if (operationHistoryIntegrityListener != null) { operationHistory.removeOperationHistoryListener(operationHistoryIntegrityListener); operationHistoryIntegrityListener = null; operationHistory = null; } } finally { editorsToClose.clear(); editor = null; activeDiagramEditor = null; org.eclipse.papyrus.infra.ui.internal.preferences.EditorPreferences.getInstance().setConvertSharedPageLayoutToPrivate(initialEditorLayoutStorageMigrationPreference); try { if (hasRequiredViews()) { closeRequiredViews(); } } finally { super.finished(description); } } } }
Source:
<code>public void afterPropertiesSet() throws Exception { Assert.notNull(this.applicationContext, "The 'applicationContext' property cannot be null"); if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } <START> onInit(); <END> }</code><technical_language>this move, I remove onInit() rely super.afterPropertiesSet() calls in subclasses</technical_language>

Target:
public void afterPropertiesSet() throws Exception { Assert.notNull(this.applicationContext, "The 'applicationContext' property cannot be null"); if (this.evaluationContext == null) { this.evaluationContext = ExpressionUtils.createStandardEvaluationContext(getBeanFactory()); } }
Source:
<code>public MavenPath locate(final String extension, @Nullable final String classifier) { checkNotNull(extension); checkArgument(coordinates != null, "Only artifact paths may locate: %s", this); MavenPath origin = main(); Coordinates newCoordinates = new Coordinates( origin.coordinates.isSnapshot(), origin.coordinates.getGroupId(), origin.coordinates.getArtifactId(), origin.coordinates.getVersion(), origin.coordinates.getTimestamp(), origin.coordinates.getBuildNumber(), origin.coordinates.getBaseVersion(), classifier, extension, null ); String newPath = origin.path.substring(0, origin.path.length() - (origin.coordinates.extension.length() + 1)); if (origin.coordinates.classifier != null) { <START> newPath = newPath.substring(0, newPath.length() - (origin.coordinates.classifier.length() + 1)); <END> } if (classifier != null) { newPath += "-" + classifier; } newPath += "." + extension; return new MavenPath( newPath, newCoordinates ); }</code><technical_language>Trivial: I change clearer if swapped + 1 a - 1</technical_language>

Target:
public MavenPath locate(final String extension, @Nullable final String classifier) { checkNotNull(extension); checkArgument(coordinates != null, "Only artifact paths may locate: %s", this); MavenPath origin = main(); Coordinates newCoordinates = new Coordinates( origin.coordinates.isSnapshot(), origin.coordinates.getGroupId(), origin.coordinates.getArtifactId(), origin.coordinates.getVersion(), origin.coordinates.getTimestamp(), origin.coordinates.getBuildNumber(), origin.coordinates.getBaseVersion(), classifier, extension, null ); String newPath = origin.path.substring(0, origin.path.length() - origin.coordinates.extension.length() - 1); if (origin.coordinates.classifier != null) { newPath = newPath.substring(0, newPath.length() - origin.coordinates.classifier.length() - 1); } if (classifier != null) { newPath += "-" + classifier; } newPath += "." + extension; return new MavenPath( newPath, newCoordinates ); }
Source:
<code>public void checkCanSetCatalogSessionProperty(ConnectorTransactionHandle transaction, ConnectorIdentity identity, String propertyName) { <START> if (false && !isAdmin(transaction, identity)) { <END> denySetCatalogSessionProperty(connectorId, propertyName); } }</code><technical_language>Is this change intentional? this means method is matter input is</technical_language>

Target:
public void checkCanSetCatalogSessionProperty(ConnectorTransactionHandle transaction, ConnectorIdentity identity, String propertyName) { if (!isAdmin(transaction, identity)) { denySetCatalogSessionProperty(connectorId, propertyName); } }
Source:
<code><START> protected OperationException unwrapExceptionFromDispatchedTask(final PaymentApiException e) { <END> if (e.getCause() instanceof OperationException) { return (OperationException) e.getCause(); } logger.warn("Operation failed for accountId='{}'", paymentStateContext.getAccount().getId(), e); return new OperationException(e, getOperationResultOnException(paymentStateContext)); }</code><technical_language>Do need unwrapExceptionFromDispatchedTask? is unwrapping done this level anymore (at name changed)</technical_language>

Target:
protected OperationException unwrapExceptionFromDispatchedTask(final PaymentApiException e) { if (e.getCause() instanceof OperationException) { return (OperationException) e.getCause(); } logger.warn("Operation failed for accountId='{}' accountExternalKey='{}' error='{}'", paymentStateContext.getAccount().getExternalKey(), e.getMessage()); return new OperationException(e, getOperationResultOnException(paymentStateContext)); }
Source:
<code>private String extractFirst(String ip) { if (ip==null) return "127.0.0.1"; int idx = ip.indexOf(","); if(idx>0) { for (String xForwardedFor : ip.split(",")) { <START> if (!InetAddresses.forString(xForwardedFor).isSiteLocalAddress()) { <END> return ip; } } } return ip; }</code><technical_language>This throw if xForwardedFor is empty string right</technical_language>

Target:
private String extractFirst(String ip) { if (ip==null) return "127.0.0.1"; int idx = ip.indexOf(","); if(idx>0) { for (String xForwardedFor : ip.split(",")) { if (!Strings.isNullOrEmpty(xForwardedFor) && !InetAddresses.forString(xForwardedFor).isSiteLocalAddress()) { return ip; } } } return ip; }
Source:
<code>public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (!ctx.channel().isActive()) { ReferenceCountUtil.release(msg); return; } if (msg instanceof HttpRequestMessage) { promise.addListener((future) -> { if (!future.isSuccess()) { Throwable cause = ctx.channel().attr(SSL_HANDSHAKE_UNSUCCESS_FROM_ORIGIN_THROWABLE).get(); if (cause != null) { ctx.channel().attr(SSL_HANDSHAKE_UNSUCCESS_FROM_ORIGIN_THROWABLE).set(null); <START> fireWriteError("request headers", cause, ctx); <END> } else { fireWriteError("request headers", future.cause(), ctx); } } }); HttpRequestMessage zuulReq = (HttpRequestMessage) msg; preWriteHook(ctx, zuulReq); super.write(ctx, buildOriginHttpRequest(zuulReq), promise); } else if (msg instanceof HttpContent) { promise.addListener((future) -> { if (!future.isSuccess()) { fireWriteError("request content chunk", future.cause(), ctx); } }); super.write(ctx, msg, promise); } else { ReferenceCountUtil.release(msg); throw new ZuulException("Received invalid message from client", true); } }</code><technical_language>In this case, prudent log original future.cause() a debug level, lost. In SSL handshake failures, _usually_ is logged elsewhere, guaranteed. Logging debugging live instances incase is additional context in it</technical_language>

Target:
public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise promise) throws Exception { if (!ctx.channel().isActive()) { ReferenceCountUtil.release(msg); return; } if (msg instanceof HttpRequestMessage) { promise.addListener((future) -> { if (!future.isSuccess()) { Throwable cause = ctx.channel().attr(SSL_HANDSHAKE_UNSUCCESS_FROM_ORIGIN_THROWABLE).get(); if (cause != null) { ctx.channel().attr(SSL_HANDSHAKE_UNSUCCESS_FROM_ORIGIN_THROWABLE).set(null); fireWriteError("request headers", cause, ctx); LOG.debug("SSLException is overridden by SSLHandshakeException caught in handler level. Original SSL exception message: ", future.cause()); } else { fireWriteError("request headers", future.cause(), ctx); } } }); HttpRequestMessage zuulReq = (HttpRequestMessage) msg; preWriteHook(ctx, zuulReq); super.write(ctx, buildOriginHttpRequest(zuulReq), promise); } else if (msg instanceof HttpContent) { promise.addListener((future) -> { if (!future.isSuccess()) { fireWriteError("request content chunk", future.cause(), ctx); } }); super.write(ctx, msg, promise); } else { ReferenceCountUtil.release(msg); throw new ZuulException("Received invalid message from client", true); } }