auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private boolean isGerrit() throws MalformedURLException, IOException { final String GERRIT_XSSI_MAGIC_STRING = ")]}\'\n"; if (uri.startsWith("https://") || uri.startsWith("http://")) { String u = uri; int protocolEnd = uri.indexOf("://") + 3; HttpURLConnection httpConnection = null; try { <START> while (true) { <END> InputStream in = null; try { httpConnection = (HttpURLConnection) new URL(u + "/config/server/version").openConnection(); httpConnection.setRequestMethod("GET"); int responseCode = httpConnection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: in = httpConnection.getInputStream(); String response = readFully(in, "UTF-8"); if (response.startsWith(GERRIT_XSSI_MAGIC_STRING)) { return true; } else { return false; } case HttpURLConnection.HTTP_NOT_FOUND: int slash = u.lastIndexOf('/'); if (slash <= protocolEnd) { return false; } u = u.substring(0, u.lastIndexOf('/')); break; default: return false; } } finally { if (in != null) { in.close(); } } } } finally { if (httpConnection != null) { httpConnection.disconnect(); } } } return false; }</code><technical_language>I'e this url worked: <LINK_3> this url OK: <LINK_0> required 5 4 http requests get final answer time. I start search of path end avoid spamming server delays client side. I propose recognize http*://git.eclipse.org/* urls try <LINK_2> in this case: Eclipse web master end users happy need single shot get result. Additionally example shows automatic Gerrit config for git.eclipse.org/gitroot/ URL's work all</technical_language>

Target:
private boolean isGerrit() throws MalformedURLException, IOException, URISyntaxException { if (uri.startsWith(ECLIPSE_GERRIT_SERVER)) { return true; } URIish u = new URIish(uri); String s = u.getScheme(); if (s.equals("http") || s.equals("https")) { String baseURL = uri.substring(0, uri.lastIndexOf(u.getPath())); String path = ""; HttpURLConnection httpConnection = null; try { while (true) { int slash = 1; InputStream in = null; try { httpConnection = (HttpURLConnection) new URL(baseURL + path + "/config/server/version").openConnection(); httpConnection.setRequestMethod("GET"); int responseCode = httpConnection.getResponseCode(); switch (responseCode) { case HttpURLConnection.HTTP_OK: in = httpConnection.getInputStream(); String response = readFully(in, "UTF-8"); if (response.startsWith(GERRIT_XSSI_MAGIC_STRING)) { return true; } else { return false; } case HttpURLConnection.HTTP_NOT_FOUND: String p = u.getPath(); slash = p.indexOf('/', slash); if (slash == p.length()) { return false; } else if (slash == -1) { slash = p.length() - 1; } path = p.substring(0, slash); break; default: return false; } } finally { if (in != null) { in.close(); } } } } finally { if (httpConnection != null) { httpConnection.disconnect(); } } } return false; }
Source:
<code>public void equalsWithNullUserTest() throws ComponentLookupException { Collaborator c = new DefaultCollaborator(null, this.access, this.helper); Assert.assertTrue(c.equals(c)); Assert.assertFalse(c.equals(null)); <START> AccessLevel otherAccess = mock(AccessLevel.class); <END> Collaborator other = new DefaultCollaborator(null, this.access, this.helper); Assert.assertTrue(c.equals(other)); other = new DefaultCollaborator(null, otherAccess, this.helper); Assert.assertFalse(c.equals(other)); other = new DefaultCollaborator(new DocumentReference("xwiki", "XWiki", "padams"), this.access, this.helper); Assert.assertFalse(c.equals(other)); other = new DefaultCollaborator(new DocumentReference("xwiki", "XWiki", "padams"), otherAccess, this.helper); Assert.assertFalse(c.equals(other)); Assert.assertFalse(c.equals("other")); }</code><technical_language>This later, move this declaration line 184</technical_language>

Target:
public void equalsWithNullUserTest() throws ComponentLookupException { Collaborator c = new DefaultCollaborator(null, this.access, this.helper); Assert.assertTrue(c.equals(c)); Assert.assertFalse(c.equals(null)); Collaborator other = new DefaultCollaborator(null, this.access, this.helper); Assert.assertTrue(c.equals(other)); Assert.assertTrue(other.equals(c)); AccessLevel otherAccess = mock(AccessLevel.class); other = new DefaultCollaborator(null, otherAccess, this.helper); Assert.assertFalse(c.equals(other)); Assert.assertFalse(other.equals(c)); other = new DefaultCollaborator(new DocumentReference("xwiki", "XWiki", "padams"), this.access, this.helper); Assert.assertFalse(c.equals(other)); Assert.assertFalse(other.equals(c)); other = new DefaultCollaborator(new DocumentReference("xwiki", "XWiki", "padams"), otherAccess, this.helper); Assert.assertFalse(c.equals(other)); Assert.assertFalse(other.equals(c)); Assert.assertFalse(c.equals("other")); }
Source:
<code>protected JSONSignatureValidator getJsonSignatureValidator(@CheckForNull String name) { if (name == null) { <START> return getJsonSignatureValidator(); <END> } return new JSONSignatureValidator(name); }</code><technical_language>Strange passing of calls methods. add default name specification pass null non-parameterized getJsonSignatureValidator</technical_language>

Target:
protected JSONSignatureValidator getJsonSignatureValidator(@CheckForNull String name) { if (name == null) { name = signatureValidatorPrefix + " '" + id + "'"; } return new JSONSignatureValidator(name); }
Source:
<code>public static void main(String[] args) throws InterruptedException, ExecutionException { if (args.length != 4) { throw new IllegalArgumentException("Should accept 4 parameters: [mode], " + "[number of partitions], [number of instances], [number of records]"); } String mode = args[0]; int numPartitions = Integer.valueOf(args[1]); int numInstances = Integer.valueOf(args[2]); int numRecords = Integer.valueOf(args[3]); recreateTopics(numPartitions); CountDownLatch prePopulateLatch = new CountDownLatch(1); final boolean isAsync = false; <START> final boolean enableIdempotency = true; <END> Producer producerThread = new Producer(INPUT_TOPIC, isAsync, null, enableIdempotency, numRecords, prePopulateLatch); producerThread.start(); prePopulateLatch.await(5, TimeUnit.MINUTES); CountDownLatch transactionalCopyLatch = new CountDownLatch(numInstances); for (int instanceIdx = 0; instanceIdx < numInstances; instanceIdx++) { ExactlyOnceMessageProcessor messageProcessor = new ExactlyOnceMessageProcessor(mode, INPUT_TOPIC, OUTPUT_TOPIC, numPartitions, numInstances, instanceIdx, transactionalCopyLatch); messageProcessor.start(); } transactionalCopyLatch.await(5, TimeUnit.MINUTES); CountDownLatch consumeLatch = new CountDownLatch(1); Consumer consumerThread = new Consumer(OUTPUT_TOPIC, "Verify-consumer", true, numRecords, consumeLatch); consumerThread.start(); consumeLatch.await(5, TimeUnit.MINUTES); consumerThread.shutdown(); System.out.println("All finished!"); }</code><technical_language>nit: pass in boolean values directly</technical_language>

Target:
public static void main(String[] args) throws InterruptedException, ExecutionException { if (args.length != 4) { throw new IllegalArgumentException("Should accept 4 parameters: [mode], " + "[number of partitions], [number of instances], [number of records]"); } String mode = args[0]; int numPartitions = Integer.valueOf(args[1]); int numInstances = Integer.valueOf(args[2]); int numRecords = Integer.valueOf(args[3]); recreateTopics(numPartitions); CountDownLatch prePopulateLatch = new CountDownLatch(1); Producer producerThread = new Producer(INPUT_TOPIC, false, null, true, numRecords, prePopulateLatch); producerThread.start(); prePopulateLatch.await(5, TimeUnit.MINUTES); CountDownLatch transactionalCopyLatch = new CountDownLatch(numInstances); for (int instanceIdx = 0; instanceIdx < numInstances; instanceIdx++) { ExactlyOnceMessageProcessor messageProcessor = new ExactlyOnceMessageProcessor(mode, INPUT_TOPIC, OUTPUT_TOPIC, numPartitions, numInstances, instanceIdx, transactionalCopyLatch); messageProcessor.start(); } transactionalCopyLatch.await(5, TimeUnit.MINUTES); CountDownLatch consumeLatch = new CountDownLatch(1); Consumer consumerThread = new Consumer(OUTPUT_TOPIC, "Verify-consumer", true, numRecords, consumeLatch); consumerThread.start(); consumeLatch.await(5, TimeUnit.MINUTES); consumerThread.shutdown(); System.out.println("All finished!"); }
Source:
<code>private void checkWalCanSync(ServerContext context) { VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironmentImpl(VolumeChooserEnvironment.ChooserScope.LOGGER, context); String logPath = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR + ServerConstants.WAL_DIR; if (!fs.canSyncAndFlush(new Path(logPath))) { <START> try { <END> Thread.sleep(5000); } catch (Exception ignored) { } log.warn("WAL directory ({}) implementation does not support sync or flush." + " Data loss may occur.", logPath); } }</code><technical_language>UtilWaitThread.sleep() internal Accumulo util</technical_language>

Target:
private void checkWalCanSync(ServerContext context) { VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironmentImpl(VolumeChooserEnvironment.ChooserScope.LOGGER, context); String logPath = fs.choose(chooserEnv, ServerConstants.getBaseUris(context)) + Path.SEPARATOR + ServerConstants.WAL_DIR; if (!fs.canSyncAndFlush(new Path(logPath))) { UtilWaitThread.sleep(5000); log.warn("WAL directory ({}) implementation does not support sync or flush." + " Data loss may occur.", logPath); } }
Source:
<code>public void newNetwork() { if (getWindow() != null) { return; } final NetworkModel networkModel = new NewNetworkModel(this); setWindow(networkModel); <START> networkModel.startProgress(null); <END> initDcList(networkModel); }</code><technical_language>do do part of initDcList()</technical_language>

Target:
public void newNetwork() { if (getWindow() != null) { return; } final NetworkModel networkModel = new NewNetworkModel(this); setWindow(networkModel); initDcList(networkModel); }
Source:
<code>public OpaqueObjectsNode(Context context) { componentSystemManager = context.get(ComponentSystemManager.class); <START> worldRenderer = context.get(WorldRenderer.class); <END> wireframeStateChange = new SetWireframe(true); renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); }</code><technical_language>This line playerCamera line below..</technical_language>

Target:
public OpaqueObjectsNode(Context context) { componentSystemManager = context.get(ComponentSystemManager.class); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); worldRenderer = context.get(WorldRenderer.class); Camera playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThrough(playerCamera)); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, context.get(DisplayResolutionDependentFBOs.class))); }
Source:
<code>public static synchronized List<SingleThreadMonitor> getThreadMonitors(List<SingleThreadMonitor> output, boolean aliveThreadsOnly) { Preconditions.checkNotNull(output, "The parameter 'output' must not be null"); output.clear(); <START> output.addAll(THREAD_INFO_BY_ID.values().stream().filter(entry -> !aliveThreadsOnly || entry.isAlive()).collect(Collectors.toList())); <END> return output; }</code><technical_language>I find original version easier read in this case</technical_language>

Target:
public static synchronized List<SingleThreadMonitor> getThreadMonitors(List<SingleThreadMonitor> output, boolean aliveThreadsOnly) { Preconditions.checkNotNull(output, "The parameter 'output' must not be null"); output.clear(); for (SingleThreadMonitor entry : THREAD_INFO_BY_ID.values()) { if (!aliveThreadsOnly || entry.isAlive()) { output.add(entry); } } return output; }
Source:
<code>public void registerKafkaConsumerMetrics(Consumer<?, ?> consumer, String clientId) { <START> if (consumer == null || StringUtils.isBlank(clientId)) { <END> _errorLogger.warn("Cannot register the Kafka consumer metrics, either the consumer is null or the client.id is blank"); return; } Supplier<Double> watermarkSpanSupplier = () -> getConsumerOffsetWatermarkSpanMetric(consumer, clientId); DYNAMIC_METRICS_MANAGER.registerGauge(_className, _key, CONSUMER_OFFSET_WATERMARK_SPAN, watermarkSpanSupplier); Supplier<Double> offsetResetSupplier = () -> getConsumerLiclosestDataLossEstimationMetric(consumer, clientId); DYNAMIC_METRICS_MANAGER.registerGauge(_className, _key, CONSUMER_LICLOSEST_DATA_LOSS_ESTIMATION, offsetResetSupplier); _kafkaConsumerMetricsRegistered = true; }</code><technical_language>throw null consumer (and possibly clientId well)</technical_language>

Target:
public void registerKafkaConsumerMetrics(Consumer<?, ?> consumer, String clientId) { if (StringUtils.isBlank(clientId)) { _errorLogger.warn("Cannot register the Kafka consumer metrics, the client.id is blank"); return; } Supplier<Double> watermarkSpanSupplier = () -> getConsumerOffsetWatermarkSpanMetric(consumer, clientId); DYNAMIC_METRICS_MANAGER.registerGauge(_className, _key, CONSUMER_OFFSET_WATERMARK_SPAN, watermarkSpanSupplier); Supplier<Double> offsetResetSupplier = () -> getConsumerLiclosestDataLossEstimationMetric(consumer, clientId); DYNAMIC_METRICS_MANAGER.registerGauge(_className, _key, CONSUMER_LICLOSEST_DATA_LOSS_ESTIMATION, offsetResetSupplier); }
Source:
<code>public boolean onCreate() { <START> mDatabaseAdapter = new DataBaseAdapter(getContext(), SharedData.getInstance()); <END> return true; }</code><technical_language>SharedData DataBaseAdapter</technical_language>

Target:
public boolean onCreate() { mDatabaseAdapter = new DataBaseAdapter(getContext()); return true; }
Source:
<code>public <T> T evalExpression(String expression, Class<T> expectedType) throws ELException { <START> ValueExpressionDetails veDetails = getValueExpressionDetails(expression, Boolean.class); <END> return (T) veDetails.valueExpression.getValue(veDetails.context); }</code><technical_language>Instead of Boolean.class expectedType, right</technical_language>

Target:
public <T> T evalExpression(String expression, Class<T> expectedType) throws ELException { ExpressionDetails veDetails = getExpressionDetails(expression, Boolean.class); return (T) veDetails.valueExpression.getValue(veDetails.context); }
Source:
<code>public ExecutorServiceProvider(int corePoolSize, int maxPoolSize, int queueCapacity) { this( corePoolSize, maxPoolSize, queueCapacity, <START> (r, executor1) -> LOG.warn("Executor rejected to handle the payload {}", r)); <END> }</code><technical_language>I e a variable name prettier executor1</technical_language>

Target:
public ExecutorServiceProvider(int corePoolSize, int maxPoolSize, int queueCapacity) { this( corePoolSize, maxPoolSize, queueCapacity, (r, e) -> LOG.warn("Executor rejected to handle the payload {}", r)); }
Source:
<code>public void shouldReturnNoChanges() throws Exception { resetRepositoryToCreateInitialTag(); changeFilesInProject(); launchSynchronization(SynchronizeWithAction_localRepoName, HEAD, SynchronizeWithAction_localRepoName, MASTER, false); <START> setGitChangeSetPresenentationModel(); <END> SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree(); assertEquals(0, syncViewTree.getAllItems().length); }</code><technical_language>typo in method name s/Presenentation/Presentation/</technical_language>

Target:
public void shouldReturnNoChanges() throws Exception { resetRepositoryToCreateInitialTag(); changeFilesInProject(); launchSynchronization(SynchronizeWithAction_localRepoName, HEAD, SynchronizeWithAction_localRepoName, MASTER, false); setGitChangeSetPresentationModel(); SWTBotTree syncViewTree = bot.viewByTitle("Synchronize").bot().tree(); assertEquals(0, syncViewTree.getAllItems().length); }
Source:
<code><START> public static boolean collationsContainKeysOrderless( <END> List<RelCollation> collations, List<Integer> keys) { final List<Integer> distinctKeys = Util.distinctList(keys); for (RelCollation collation : collations) { if (containsOrderless(collation, distinctKeys)) { return true; } } return false; }</code><technical_language>I name this method (and one) containsOrderless, i.e. provide 4 overloaded methods name</technical_language>

Target:
public static boolean collationsContainKeysOrderless( List<RelCollation> collations, List<Integer> keys) { for (RelCollation collation : collations) { if (containsOrderless(collation, keys)) { return true; } } return false; }
Source:
<code><START> protected byte[] randomData(String prefix) { <END> return Bytes.toBytes(prefix + RandomStringUtils.randomAlphanumeric(8)); }</code><technical_language>public</technical_language>

Target:
public byte[] randomData(String prefix) { return Bytes.toBytes(prefix + RandomStringUtils.randomAlphanumeric(8)); }
Source:
<code>public void findByLocationNearWithShape() { final City mumbai = new City("1001", "Mumbai", new Point(19.0990358,72.9612976)); final City pune = new City("1002", "Pune", new Point(18.5247663,73.792756)); final City bangalore = new City("1003", "Bangalore", new Point(12.9542944,77.4905127)); final Point solapur = new Point(17.661548,75.8835121); final Circle circle100 = new Circle(solapur, new Distance(100, Metrics.KILOMETERS)); final Circle circle250 = new Circle(solapur, new Distance(250, Metrics.KILOMETERS)); final Circle circle350 = new Circle(solapur, new Distance(350, Metrics.KILOMETERS)); this.cityMap.put(mumbai.getId(), mumbai); this.cityMap.put(pune.getId(), pune); this.cityMap.put(bangalore.getId(), bangalore); <START> List<City> matches = this.cityRepository.findByLocationWithin(circle100); <END> int len = matches.size(); assertThat("Nothing should returned", len, equalTo(0)); matches = this.cityRepository.findByLocationWithin(circle250); len = matches.size(); assertThat("Pune should return", len, equalTo(1)); assertThat("Pune should return", matches.get(0), hasProperty("name", equalTo("Pune"))); matches = this.cityRepository.findByLocationWithin(circle350); len = matches.size(); assertThat("Pune and Mumbai should return", len, equalTo(2)); assertThat("Pune and Mumbai should return", matches, containsInAnyOrder(hasProperty("name", equalTo("Pune")), hasProperty("name", equalTo("Mumbai")))); this.cityMap.remove(mumbai.getId()); this.cityMap.remove(pune.getId()); this.cityMap.remove(bangalore.getId()); }</code><technical_language>Nit: Indentation? I tabs instead of spaces for this line</technical_language>

Target:
public void findByLocationNearWithShape() { final City mumbai = new City("1001", "Mumbai", new Point(19.0990358,72.9612976)); final City pune = new City("1002", "Pune", new Point(18.5247663,73.792756)); final City bangalore = new City("1003", "Bangalore", new Point(12.9542944,77.4905127)); final Point solapur = new Point(17.661548,75.8835121); final Circle circle100 = new Circle(solapur, new Distance(100, Metrics.KILOMETERS)); final Circle circle250 = new Circle(solapur, new Distance(250, Metrics.KILOMETERS)); final Circle circle350 = new Circle(solapur, new Distance(350, Metrics.KILOMETERS)); this.cityMap.put(mumbai.getId(), mumbai); this.cityMap.put(pune.getId(), pune); this.cityMap.put(bangalore.getId(), bangalore); List<City> matches = this.cityRepository.findByLocationWithin(circle100); int len = matches.size(); assertThat("Nothing should returned", len, equalTo(0)); matches = this.cityRepository.findByLocationWithin(circle250); len = matches.size(); assertThat("Pune should return", len, equalTo(1)); assertThat("Pune should return", matches.get(0), equalTo(pune)); matches = this.cityRepository.findByLocationWithin(circle350); len = matches.size(); assertThat("Pune and Mumbai should return", len, equalTo(2)); assertThat("Pune and Mumbai should return", matches, containsInAnyOrder(pune, mumbai)); this.cityMap.remove(mumbai.getId()); this.cityMap.remove(pune.getId()); this.cityMap.remove(bangalore.getId()); }
Source:
<code><START> public static String map2String(Map<String, String> map){ <END> Set<Entry<String, String>> entrySet = map.entrySet(); StringBuilder sb = new StringBuilder(); for (Entry<String, String> entry : entrySet) { if (sb.length() > 0) { sb.append(DELIMITER); } sb.append(entry.getKey()); sb.append(SEP); sb.append(entry.getValue()); } return sb.toString(); }</code><technical_language>worth check if map null</technical_language>

Target:
public static String map2String(Map<String, String> map){ StringBuilder sb = new StringBuilder(); Set<Entry<String, String>> entrySet = map.entrySet(); if (map != null) { for (Entry<String, String> entry : entrySet) { if (sb.length() > 0) { sb.append(DELIMITER); } sb.append(entry.getKey()); sb.append(SEP); sb.append(entry.getValue()); } } return sb.toString(); }
Source:
<code>public boolean isExtensionEnabled() { if (enablement != null) { try { <START> return enablement.getExpression().evaluate(new EvaluationContext(null, new Object())) <END> .equals(EvaluationResult.TRUE); } catch (CoreException e) { } } return true; }</code><technical_language>move this EnablementTester.evaluate(...) method</technical_language>

Target:
public boolean isExtensionEnabled() { return enablement != null ? enablement.evaluate() : true; }
Source:
<code>private String createProcessorId(Config config) { ApplicationConfig appConfig = new ApplicationConfig(config); if (appConfig.getProcessorId() != null) { return appConfig.getProcessorId(); } else if (appConfig.getAppProcessorIdGeneratorClass() != null) { ProcessorIdGenerator idGenerator = ClassLoaderHelper.fromClassName(appConfig.getAppProcessorIdGeneratorClass(), ProcessorIdGenerator.class); return idGenerator.generateProcessorId(config); } else { throw new ConfigException(String .format("Expected either %s or %s to be configured", ApplicationConfig.PROCESSOR_ID, <START> ApplicationConfig.APP_PROCESSOR_ID_GENERATOR_CLASS)); <END> } }</code><technical_language>here, method instead of referring config name</technical_language>

Target:
private String createProcessorId(Config config) { ApplicationConfig appConfig = new ApplicationConfig(config); if (appConfig.getProcessorId() != null) { return appConfig.getProcessorId(); } ProcessorIdGenerator idGenerator = ClassLoaderHelper.fromClassName(appConfig.getAppProcessorIdGeneratorClass(), ProcessorIdGenerator.class); return idGenerator.generateProcessorId(config); }
Source:
<code>void testFilter() { for (String region : ec2Api.getConfiguredRegions()) { Set<SecurityGroup> allResults = client.describeSecurityGroupsInRegion(region); assertNotNull(allResults); if (allResults.size() >= 1) { final SecurityGroup group = getLast(allResults); ImmutableSet<SecurityGroup> expected = FluentIterable.from(allResults) .filter(new Predicate<SecurityGroup>() { @Override public boolean apply(SecurityGroup in) { return group.getName().equals(in.getName()); } }).toSet(); ImmutableSet<SecurityGroup> result = ImmutableSet.copyOf(client.describeSecurityGroupsInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("group-name", group.getName()).build())); <START> assertTrue(expected.containsAll(result)); <END> } } }</code><technical_language>Add message</technical_language>

Target:
void testFilter() { for (String region : ec2Api.getConfiguredRegions()) { Set<SecurityGroup> allResults = client.describeSecurityGroupsInRegion(region); assertNotNull(allResults); if (!allResults.isEmpty()) { final SecurityGroup group = getLast(allResults); ImmutableSet<SecurityGroup> expected = FluentIterable.from(allResults) .filter(new Predicate<SecurityGroup>() { @Override public boolean apply(SecurityGroup in) { return group.getName().equals(in.getName()); } }).toSet(); ImmutableSet<SecurityGroup> result = ImmutableSet.copyOf(client.describeSecurityGroupsInRegionWithFilter(region, ImmutableMultimap.<String, String>builder() .put("group-name", group.getName()).build())); assertTrue(expected.containsAll(result), "group(s) for name not found"); } } }
Source:
<code>public LifeAreaInformation getAreaInformation() { LifeAreaInformation info = new LifeAreaInformation(lifeArea); Object dot[] = areaNotation.getAll(); int x = 0, y = 0; for (int i = 0; i < dot.length; i++) { x = ((Dot) dot[i]).getX(); y = ((Dot) dot[i]).getY(); <START> if (info.getArea()[x][y] == 1) info.getArea()[x][y] = 0; <END> } return info; }</code><technical_language>braces</technical_language>

Target:
public LifeAreaInformation getAreaInformation() { LifeAreaInformation info = new LifeAreaInformation(lifeArea); Object dot[] = areaNotation.getAll(); int x = 0, y = 0; for (int i = 0; i < dot.length; i++) { x = ((Dot) dot[i]).getX(); y = ((Dot) dot[i]).getY(); if (info.getArea()[x][y] == 1) { info.getArea()[x][y] = 0; } } return info; }
Source:
<code>private void setSearchEnabled(boolean value) { if (searchEnabled != value) { searchEnabled = value; onPropertyChanged(new <START> PropertyChangedEventArgs("EnableSearchBar")); <END> } }</code><technical_language>simply call property changed event "SearchEnabled"</technical_language>

Target:
private void setSearchEnabled(boolean value) { if (searchEnabled != value) { searchEnabled = value; onPropertyChanged(new PropertyChangedEventArgs("SearchEnabled")); } }
Source:
<code>public List<Map<String, String>> taskConfigs(int maxTasks) { final List<Map<String, String>> configs = new ArrayList<>(3); for (int i = 0; i < 3; i++) { <START> config.put("forestName","java-unittest-"+(i+1)); <END> configs.add(config); } return configs; }</code><technical_language>item in list a Map? If Map, put() "forestName" assignment for tasks? sense create a new Map loop, copy properties putAll(), set "forestName"</technical_language>

Target:
public List<Map<String, String>> taskConfigs(int maxTasks) { logger.info("*********** MarklogicSourceConnector.taskConfigs ************"); final List<Map<String, String>> configs = new ArrayList<>(3); for (int i = 0; i < 3; i++) { config.put("forestName","java-unittest-"+(i+1)); configs.add(config); } return configs; }
Source:
<code>public static String generateScenarioRegexp(String scenarioId) { <START> return "(^.*" + USER_SCENARIO_ID + scenarioId + US_STEP_ID + ".*$)|(^.*" + scenarioId + ".*(-sum|-Success rate|-Number of fails).*$)"; <END> }</code><technical_language>"(^.*" + USER_SCENARIO_ID + scenarioId + ".\*$" enough</technical_language>

Target:
public static String generateScenarioRegexp(String scenarioId) { return String.format(SCENARIO_REGEXP_TEMPLATE, scenarioId, scenarioId); }
Source:
<code>public void testCannotIncreaseBy2AsNoSessionKey() throws Exception { exception.expect(ConfigurationException.class); exception.expectMessage("sessionKey must be filled"); session.put("a", "4"); pipe.setIncrement(2); pipe.configure(); doPipe(pipe, "doesnt matter", session); <START> assertEquals(session.get("a"), "6"); <END> }</code><technical_language>This wont triggered expecting doPipe throw exception correct</technical_language>

Target:
public void testCannotIncreaseBy2AsNoSessionKey() throws Exception { exception.expect(ConfigurationException.class); exception.expectMessage("sessionKey must be filled"); session.put("a", "4"); pipe.setIncrement(2); pipe.configure(); doPipe(pipe, "doesnt matter", session); fail("this is expected to fail"); }
Source:
<code>public void testEquation2DOp() { final IterableInterval<DoubleType> image = ops.create().img(dimensions, new DoubleType()); final UnaryFunctionOp<long[], Double> op = new AbstractUnaryFunctionOp<long[], Double>() { @Override public Double calculate(final long[] coords) { final double result = Math.pow(start[0] + coords[0] * spacing[0], 2) + Math.pow(start[1] + coords[1] * spacing[1], 2); return result; } }; <START> ops.image().equation(image, op); <END> assertEquals(6801.346801346799, ops.stats().sum(image).getRealDouble(), 0.00001); }</code><technical_language>above, please ops().run(...)</technical_language>

Target:
public void testEquation2DOp() { final IterableInterval<DoubleType> image = ops.create().img(dimensions, new DoubleType()); final UnaryFunctionOp<long[], Double> op = new AbstractUnaryFunctionOp<long[], Double>() { @Override public Double calculate(final long[] coords) { final double result = Math.pow(start[0] + coords[0] * spacing[0], 2) + Math.pow(start[1] + coords[1] * spacing[1], 2); return result; } }; ops.run(DefaultCoordinatesEquation.class, image, op); assertEquals(6801.346801346799, ops.stats().sum(image).getRealDouble(), 0.00001); }
Source:
<code>private void stopGlusterServices(Guid vdsId) { ResourceManager resourceManager = ResourceManager.getInstance(); GlusterBrickDao glusterBrickDao = DbFacade.getInstance().getGlusterBrickDao(); boolean succeeded = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("glusterd"), "stop")).getSucceeded(); if (succeeded) { succeeded = resourceManager.runVdsCommand(VDSCommandType.StopGlusterProcesses, new VdsIdVDSCommandParametersBase(vdsId)).getSucceeded(); if (succeeded) { <START> List<GlusterBrickEntity> bricks = <END> glusterBrickDao.getGlusterVolumeBricksByServerId(vdsId); for (GlusterBrickEntity brick : bricks) { brick.setStatus(GlusterStatus.DOWN); } glusterBrickDao.updateBrickStatuses(bricks); } } if (!succeeded) { log.error("Failed to stop gluster services while moving the host '{}' to maintenance", getHostName(vdsId)); } }</code><technical_language>2 lines united</technical_language>

Target:
private void stopGlusterServices(Guid vdsId) { ResourceManager resourceManager = ResourceManager.getInstance(); GlusterBrickDao glusterBrickDao = DbFacade.getInstance().getGlusterBrickDao(); boolean succeeded = resourceManager.runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vdsId, Arrays.asList("glusterd"), "stop")).getSucceeded(); if (succeeded) { succeeded = resourceManager.runVdsCommand(VDSCommandType.StopGlusterProcesses, new VdsIdVDSCommandParametersBase(vdsId)).getSucceeded(); if (succeeded) { List<GlusterBrickEntity> bricks = glusterBrickDao.getGlusterVolumeBricksByServerId(vdsId); bricks.stream().forEach(brick -> brick.setStatus(GlusterStatus.DOWN)); glusterBrickDao.updateBrickStatuses(bricks); } } if (!succeeded) { log.error("Failed to stop gluster services while moving the host '{}' to maintenance", getHostName(vdsId)); } }
Source:
<code>public List<SlotExecutionVertexAssignment> allocateSlotsFor( List<ExecutionVertexSchedulingRequirements> executionVertexSchedulingRequirements) { List<ExecutionVertexID> executionVertexIds = executionVertexSchedulingRequirements .stream() .map(ExecutionVertexSchedulingRequirements::getExecutionVertexId) .collect(Collectors.toList()); SharedSlotProfileRetriever sharedSlotProfileRetriever = sharedSlotProfileRetrieverFactory .createFromBulk(new HashSet<>(executionVertexIds)); Map<ExecutionSlotSharingGroup, List<ExecutionVertexID>> executionsByGroup = executionVertexIds .stream() .collect(Collectors.groupingBy(slotSharingStrategy::getExecutionSlotSharingGroup)); <START> Map<ExecutionVertexID, SlotExecutionVertexAssignment> assignments = executionsByGroup .entrySet() .stream() .flatMap(entry -> allocateLogicalSlotsFromSharedSlot(sharedSlotProfileRetriever, entry.getKey(), entry.getValue())) .collect(Collectors.toMap(SlotExecutionVertexAssignment::getExecutionVertexId, a -> a)); <END> bulkChecker.schedulePendingRequestBulkTimeoutCheck(createBulk(executionsByGroup), allocationTimeout); return executionVertexIds.stream().map(assignments::get).collect(Collectors.toList()); }</code><technical_language>I convinced stream API is right choice. is do computations side effects. For I prefer a traditional for-each loop</technical_language>

Target:
public List<SlotExecutionVertexAssignment> allocateSlotsFor( List<ExecutionVertexSchedulingRequirements> executionVertexSchedulingRequirements) { List<ExecutionVertexID> executionVertexIds = executionVertexSchedulingRequirements .stream() .map(ExecutionVertexSchedulingRequirements::getExecutionVertexId) .collect(Collectors.toList()); SharedSlotProfileRetriever sharedSlotProfileRetriever = sharedSlotProfileRetrieverFactory .createFromBulk(new HashSet<>(executionVertexIds)); Map<ExecutionSlotSharingGroup, List<ExecutionVertexID>> executionsByGroup = executionVertexIds .stream() .collect(Collectors.groupingBy(slotSharingStrategy::getExecutionSlotSharingGroup)); Map<ExecutionVertexID, SlotExecutionVertexAssignment> assignments = allocateLogicalSlotsFromSharedSlots(sharedSlotProfileRetriever, executionsByGroup); bulkChecker.schedulePendingRequestBulkTimeoutCheck(createBulk(executionsByGroup), allocationTimeout); return executionVertexIds.stream().map(assignments::get).collect(Collectors.toList()); }
Source:
<code>protected void initializeService() { <START> lastCheckedAt = new Date(); <END> lastSerializedAt = new Date(); }</code><technical_language>Other removed well</technical_language>

Target:
protected void initializeService() { lastCheckedAt = new Date(); }
Source:
<code>public @Nullable String toString() { Number startValue = fBegin.getValue(); Number endValue = fEnd.getValue(); if (startValue != null && endValue != null) { return "[" + String.valueOf(fBegin) + " - " + String.valueOf(fEnd) + "]"; } <START> return null; <END> }</code><technical_language>here, empty string "null" preferable</technical_language>

Target:
public @Nullable String toString() { Long startValue = fBegin.getValue(); Long endValue = fEnd.getValue(); if (startValue != null && endValue != null) { return "[" + String.valueOf(fBegin) + " - " + String.valueOf(fEnd) + "]"; } return null; }
Source:
<code>protected void verify(GlusterVolume model, GlusterVolume transform) { assertNotNull(transform); assertNotNull(transform.getId()); assertEquals(model.getId(), transform.getId()); assertNotNull(transform.getName()); assertEquals(model.getName(), transform.getName()); assertNotNull(transform.getVolumeType()); assertEquals(model.getVolumeType(), transform.getVolumeType()); assertNotNull(transform.getTransportTypes()); assertArrayEquals(model.getTransportTypes().getTransportTypes().toArray(), transform.getTransportTypes().getTransportTypes().toArray()); assertNotNull(transform.getReplicaCount()); assertEquals(model.getReplicaCount(), transform.getReplicaCount()); assertNotNull(transform.getStripeCount()); assertEquals(model.getStripeCount(), transform.getStripeCount()); verifyBricks(model, transform); <START> } <END></code><technical_language>assuming brick mapping logic is removed VolumeMapper, remove brick mapping verification form test</technical_language>

Target:
protected void verify(GlusterVolume model, GlusterVolume transform) { assertNotNull(transform); assertNotNull(transform.getId()); assertEquals(model.getId(), transform.getId()); assertNotNull(transform.getName()); assertEquals(model.getName(), transform.getName()); assertNotNull(transform.getVolumeType()); assertEquals(model.getVolumeType(), transform.getVolumeType()); assertNotNull(transform.getTransportTypes()); assertArrayEquals(model.getTransportTypes().getTransportTypes().toArray(), transform.getTransportTypes().getTransportTypes().toArray()); assertNotNull(transform.getReplicaCount()); assertEquals(model.getReplicaCount(), transform.getReplicaCount()); assertNotNull(transform.getStripeCount()); assertEquals(model.getStripeCount(), transform.getStripeCount()); verifyOptions(model, transform); }
Source:
<code>private Map<String, String> createAuthorizationHeaders() { <START> switch (Intercom.getAuthKeyType()) { <END> case TOKEN: headers.put("Authorization", "Basic " + generateAuthString(Intercom.getToken(),"")); break; } return headers; }</code><technical_language>If removing API_KEY remove this switch run headers.put("Authorization", "Basic " + generateAuthString(Intercom.getToken(),"")); remove getAuthKeyType() in Intercom class get rid of AuthKeyType enum altogether. @thewheat wdyt</technical_language>

Target:
private Map<String, String> createAuthorizationHeaders() { headers.put("Authorization", "Basic " + generateAuthString(Intercom.getToken(),"")); return headers; }
Source:
<code>public void stopServer() { if (server instanceof GrizzlyServer) { <START> ((GrizzlyServer) server).setCleanIdleConnections(); <END> } server.stop(); }</code><technical_language>I setCleanIdleConnections name of function parmeters. add a parameter</technical_language>

Target:
public void stopServer() { if (server instanceof GrizzlyServer) { ((GrizzlyServer) server).setCleanIdleConnections(true); } server.stop(); }
Source:
<code><START> public <E extends BoxItemFilter> void setBoxItemFilter(E filter) { <END> mArgs.putSerializable(ARG_BOX_ITEM_FILTER, filter); }</code><technical_language>a reason for changing this? This a contract. Serializable is a kind of unusual interface in inherited relies private methods</technical_language>

Target:
public <E extends Serializable & BoxItemFilter> void setBoxItemFilter(E filter) { mArgs.putSerializable(ARG_BOX_ITEM_FILTER, filter); }
Source:
<code>public Response get(@Context final HttpServletRequest request, @Context final HttpServletResponse response, @Context UriInfo uriInfo, @PathParam("folder") final String folderName, @PathParam("path") final String pathParams) { final InitDataObject initDataObject = this.webResource.init (pathParams, false, request, false, null); final DotJSONCacheStrategy cacheStrategy = getCacheStrategy(HTTPMethod.GET); final Optional<DotJSON> dotJSONOptional = cacheStrategy.get(request, initDataObject.getUser()); if(dotJSONOptional.isPresent()) { return Response.ok(dotJSONOptional.get()).build(); } try { final FileAsset getFileAsset = getVTLFile(HTTPMethod.GET, request, folderName, initDataObject.getUser()); final Map<String, Object> contextParams = CollectionsUtils.map( "urlParams", initDataObject.getParamsMap(), "queryParams", uriInfo.getQueryParameters()); return evalVTLFile(request, response, getFileAsset, contextParams, initDataObject.getUser(), cacheStrategy); } catch(DotContentletStateException e) { <START> final String errorMessage = "Unable to find velocity file '" + HTTPMethod.GET.fileName + FILE_EXTENSION <END> + "' under path '" + VTL_PATH + StringPool.SLASH + folderName + StringPool.SLASH + "'"; Logger.error(this, errorMessage, e); return ResponseUtil.mapExceptionResponse(new DotDataException(errorMessage)); } catch(Exception e) { Logger.error(this,"Exception on VTL endpoint. GET method: " + e.getMessage(), e); return ResponseUtil.mapExceptionResponse(e); } }</code><technical_language>a StringBuilder instead</technical_language>

Target:
public Response get(@Context final HttpServletRequest request, @Context final HttpServletResponse response, @Context UriInfo uriInfo, @PathParam("folder") final String folderName, @PathParam("path") final String pathParams) { final InitDataObject initDataObject = this.webResource.init (pathParams, false, request, false, null); final DotJSONCache cache = getCacheStrategy(HTTPMethod.GET); final Optional<DotJSON> dotJSONOptional = cache.get(request, initDataObject.getUser()); if(dotJSONOptional.isPresent()) { return Response.ok(dotJSONOptional.get()).build(); } try { final FileAsset getFileAsset = getVTLFile(HTTPMethod.GET, request, folderName, initDataObject.getUser()); final Map<String, Object> contextParams = CollectionsUtils.map( "urlParams", initDataObject.getParamsMap(), "queryParams", uriInfo.getQueryParameters()); return evalVTLFile(request, response, getFileAsset, contextParams, initDataObject.getUser(), cache); } catch(DotContentletStateException e) { final String errorMessage = "Unable to find velocity file '" + HTTPMethod.GET.fileName() + FILE_EXTENSION + "' under path '" + VTL_PATH + StringPool.SLASH + folderName + StringPool.SLASH + "'"; Logger.error(this, errorMessage, e); return ResponseUtil.mapExceptionResponse(new DotDataException(errorMessage)); } catch(Exception e) { Logger.error(this,"Exception on VTL endpoint. GET method: " + e.getMessage(), e); return ResponseUtil.mapExceptionResponse(e); } }
Source:
<code>private void postDescription(@NonNull String editToken) { newDescription = null; final String description = <START> StringUtil.emptyIfNull(editView.getDescription()); <END> descriptionEditCall = new DescriptionEditClient().request(wikiData, pageTitle, description, editToken, new DescriptionEditClient.Callback() { @Override public void success(@NonNull Call<DescriptionEdit> call) { if (getActivity() == null) { return; } newDescription = description; DeviceUtil.hideSoftKeyboard(getActivity()); editView.setSaveState(false); startActivityForResult(DescriptionEditSuccessActivity.newIntent(getContext()), Constants.ACTIVITY_REQUEST_DESCRIPTION_EDIT_SUCCESS); } @Override public void abusefilter(@NonNull Call<DescriptionEdit> call, String info) { editView.setSaveState(false); editView.setError(info); } @Override public void failure(@NonNull Call<DescriptionEdit> call, @NonNull Throwable caught) { editFailed(caught); } }); }</code><technical_language>I DescriptionEditView.getDescription() is marked @NonNull</technical_language>

Target:
private void postDescription(@NonNull String editToken) { newDescription = null; final String description = editView.getDescription(); descriptionEditCall = new DescriptionEditClient().request(wikiData, pageTitle, description, editToken, new DescriptionEditClient.Callback() { @Override public void success(@NonNull Call<DescriptionEdit> call) { Prefs.setLastDescriptionEditTime(new Date().getTime()); WikipediaApp.getInstance().listenForNotifications(); if (getActivity() != null) { newDescription = description; DeviceUtil.hideSoftKeyboard(getActivity()); editView.setSaveState(false); startActivityForResult(DescriptionEditSuccessActivity.newIntent(getContext()), Constants.ACTIVITY_REQUEST_DESCRIPTION_EDIT_SUCCESS); } } @Override public void abusefilter(@NonNull Call<DescriptionEdit> call, String info) { editView.setSaveState(false); editView.setError(info); } @Override public void failure(@NonNull Call<DescriptionEdit> call, @NonNull Throwable caught) { editFailed(caught); } }); }
Source:
<code>public void build(Set<Bean<?>> beans) { if (isBuilt()) { throw new IllegalStateException("BeanIdentifier index is already built!"); } if (beans.isEmpty()) { index = new BeanIdentifier[0]; reverseIndex = Collections.emptyMap(); return; } List<BeanIdentifier> tempIndex = new ArrayList<BeanIdentifier>(beans.size()); for (Bean<?> bean : beans) { if (bean instanceof CommonBean<?>) { tempIndex.add(((CommonBean<?>) bean).getIdentifier()); } else if (bean instanceof PassivationCapable) { tempIndex.add(new StringBeanIdentifier(((PassivationCapable) bean).getId())); } } Collections.sort(tempIndex, new Comparator<BeanIdentifier>() { @Override public int compare(BeanIdentifier o1, BeanIdentifier o2) { return o1.asString().compareTo(o2.asString()); } }); index = tempIndex.toArray(new BeanIdentifier[tempIndex.size()]); ImmutableMap.Builder<BeanIdentifier, Integer> builder = ImmutableMap.builder(); for (int i = 0; i < index.length; i++) { builder.put(index[i], i); } reverseIndex = builder.build(); indexHash = Arrays.hashCode(index); <START> BootstrapLogger.LOG.beanIdentifierIndexBuilt(getDebugInfo()); <END> }</code><technical_language>add isDebugEnabled() check building debug info</technical_language>

Target:
public void build(Set<Bean<?>> beans) { if (isBuilt()) { throw new IllegalStateException("BeanIdentifier index is already built!"); } if (beans.isEmpty()) { index = new BeanIdentifier[0]; reverseIndex = Collections.emptyMap(); return; } List<BeanIdentifier> tempIndex = new ArrayList<BeanIdentifier>(beans.size()); for (Bean<?> bean : beans) { if (bean instanceof CommonBean<?>) { tempIndex.add(((CommonBean<?>) bean).getIdentifier()); } else if (bean instanceof PassivationCapable) { tempIndex.add(new StringBeanIdentifier(((PassivationCapable) bean).getId())); } } Collections.sort(tempIndex, new Comparator<BeanIdentifier>() { @Override public int compare(BeanIdentifier o1, BeanIdentifier o2) { return o1.asString().compareTo(o2.asString()); } }); index = tempIndex.toArray(new BeanIdentifier[tempIndex.size()]); ImmutableMap.Builder<BeanIdentifier, Integer> builder = ImmutableMap.builder(); for (int i = 0; i < index.length; i++) { builder.put(index[i], i); } reverseIndex = builder.build(); indexHash = Arrays.hashCode(index); if(BootstrapLogger.LOG.isDebugEnabled()) { BootstrapLogger.LOG.beanIdentifierIndexBuilt(getDebugInfo()); } }
Source:
<code>public AnnotationAuditingConfigurationSupport(AnnotationMetadata metadata, Class<? extends Annotation> annotation) { <START> attributes = new AnnotationAttributes(metadata.getAnnotationAttributes(annotation.getName())); <END> }</code><technical_language>non-null assertions</technical_language>

Target:
public AnnotationAuditingConfigurationSupport(AnnotationMetadata metadata, Class<? extends Annotation> annotation) { Assert.notNull(metadata, "metadata must not be null!"); Assert.notNull(annotation, "annotation must not be null!"); attributes = new AnnotationAttributes(metadata.getAnnotationAttributes(annotation.getName())); }
Source:
<code>private void replayTuplesIfRequired() { for (WorkItem item : waitingTuples) { item.taskHandle = executor.submit(new Processor(item)); <START> item.processState = State.SUBMITTED; <END> item.processStartTime = 0; item.outTuple = null; } }</code><technical_language>This possibly overwrites state of processed item</technical_language>

Target:
private void replayTuplesIfRequired() { for (WorkItem item : waitingTuples) { item.processState = State.SUBMITTED; item.processStartTime = 0; item.outTuple = null; item.taskHandle = executor.submit(new Processor(item)); } }
Source:
<code>public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); out.writeInt(leftResultSetNumber); out.writeInt(leftNumCols); out.writeInt(rightNumCols); writeNullableString(restrictionMethodName, out); writeNullableString(userSuppliedOptimizerOverrides, out); out.writeBoolean(oneRowRightSide); out.writeBoolean(notExistsRightSide); out.writeBoolean(rightFromSSQ); out.writeBoolean(wasRightOuterJoin); out.writeBoolean(isOuterJoin); writeNullableString(emptyRowFunMethodName, out); out.writeBoolean(serializeLeftResultSet); if(serializeLeftResultSet) out.writeObject(leftResultSet); out.writeBoolean(serializeRightResultSet); if(serializeRightResultSet) out.writeObject(rightResultSet); if(!serializeRightResultSet||!serializeLeftResultSet){ out.writeObject(mergedRow); out.writeObject(leftRow); out.writeObject(rightRow); out.writeObject(mergedRowTemplate); } boolean sparkExpressionPresent = (sparkExpressionTreeAsString != null && sparkExpressionTreeAsString.length() != 0); out.writeBoolean(sparkExpressionPresent); <START> if (sparkExpressionPresent) { <END> if (sparkJoinPredicate == null) sparkJoinPredicate = (SparkExpressionNode) SerializationUtils. deserialize(Base64.decodeBase64(sparkExpressionTreeAsString)); out.writeObject(sparkJoinPredicate); } }</code><technical_language>delay decoding used? For NLJoins serialize operation in order clone it, paying overhead anyway</technical_language>

Target:
public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal(out); out.writeInt(leftResultSetNumber); out.writeInt(leftNumCols); out.writeInt(rightNumCols); writeNullableString(restrictionMethodName, out); writeNullableString(userSuppliedOptimizerOverrides, out); out.writeBoolean(oneRowRightSide); out.writeBoolean(notExistsRightSide); out.writeBoolean(rightFromSSQ); out.writeBoolean(wasRightOuterJoin); out.writeBoolean(isOuterJoin); writeNullableString(emptyRowFunMethodName, out); out.writeBoolean(serializeLeftResultSet); if(serializeLeftResultSet) out.writeObject(leftResultSet); out.writeBoolean(serializeRightResultSet); if(serializeRightResultSet) out.writeObject(rightResultSet); if(!serializeRightResultSet||!serializeLeftResultSet){ out.writeObject(mergedRow); out.writeObject(leftRow); out.writeObject(rightRow); out.writeObject(mergedRowTemplate); } boolean sparkExpressionPresent = (sparkExpressionTreeAsString != null && sparkExpressionTreeAsString.length() != 0); out.writeBoolean(sparkExpressionPresent); if (sparkExpressionPresent) out.writeUTF(sparkExpressionTreeAsString); }