auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testDeviceMapping() { final Device device = new Device(); device.setDeviceIdentification("nr1"); device.setDeviceType("typeA"); device.setCommunicationMethod("skype"); device.setCommunicationProvider("internet"); device.setICCId("iccId1"); device.setDSMRVersion("dsmrVersion1"); device.setSupplier("supplier1"); device.setHLS3Active(true); device.setHLS4Active(true); device.setHLS5Active(true); device.setMasterKey("masterKey"); device.setGlobalEncryptionUnicastKey("uniCastKey"); device.setAuthenticationKey("authenticationKey"); <START> device.setDeliveryDate(this.deliveryDate); <END> final SmartMeteringDevice smartMeteringDevice = this.mapperFactory.getMapperFacade().map(device, SmartMeteringDevice.class); assertNotNull(smartMeteringDevice); assertEquals(device.getDeviceIdentification(), smartMeteringDevice.getDeviceIdentification()); assertEquals(device.getDeviceType(), smartMeteringDevice.getDeviceType()); assertEquals(device.getCommunicationMethod(), smartMeteringDevice.getCommunicationMethod()); assertEquals(device.getCommunicationProvider(), smartMeteringDevice.getCommunicationProvider()); assertEquals(device.getICCId(), smartMeteringDevice.getICCId()); assertEquals(device.getDSMRVersion(), smartMeteringDevice.getDSMRVersion()); assertEquals(device.getSupplier(), smartMeteringDevice.getSupplier()); assertEquals(device.isHLS3Active(), smartMeteringDevice.isHLS3Active()); assertEquals(device.isHLS4Active(), smartMeteringDevice.isHLS4Active()); assertEquals(device.isHLS5Active(), smartMeteringDevice.isHLS5Active()); assertEquals(device.getMasterKey(), smartMeteringDevice.getMasterKey()); assertEquals(device.getGlobalEncryptionUnicastKey(), smartMeteringDevice.getGlobalEncryptionUnicastKey()); assertEquals(device.getAuthenticationKey(), smartMeteringDevice.getAuthenticationKey()); final DateTime dateTime = new DateTime(smartMeteringDevice.getDeliveryDate().getTime()); assertEquals(device.getDeliveryDate().getYear(), dateTime.getYear()); assertEquals(device.getDeliveryDate().getMonth(), dateTime.getMonthOfYear()); assertEquals(device.getDeliveryDate().getDay(), dateTime.getDayOfMonth()); }</code><technical_language>I a private method like: 'createDevice()' returns Device. code more clean</technical_language>

Target:
public void testDeviceMapping() { final Device device = this.createDevice(); final SmartMeteringDevice smartMeteringDevice = this.installationMapper.map(device, SmartMeteringDevice.class); this.checkDeviceToSmartMeteringDeviceMapping(smartMeteringDevice); }
Source:
<code>catch (Exception e) { <START> throw Throwables.propagate(e); <END> }</code><technical_language>put a meaningful message exception. "Exception thrown while find unmap method MappedByteBuffer, this method exist VM in order for this work."</technical_language>

Target:
catch (Exception e) { throw new UOE(e, "Exception thrown while trying to find unmap method on MappedByteBuffer, this method must exist in your VM in order for this to work"); }
Source:
<code>private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException { SavePreferences preferences = prefs.loadForSaveFromPreferences() .withEncoding(encoding) .withSaveType(saveType); try (AtomicFileWriter fileWriter = new AtomicFileWriter(file, preferences.getEncoding(), preferences.makeBackup())) { BibtexDatabaseWriter databaseWriter = new BibtexDatabaseWriter(fileWriter, preferences, entryTypesManager); if (selectedOnly) { databaseWriter.savePartOfDatabase(panel.getBibDatabaseContext(), panel.getSelectedEntries()); panel.getSelectedEntries().forEach(bibEntry -> { <START> bibEntry.setChanged(false); <END> }); } else { databaseWriter.saveDatabase(panel.getBibDatabaseContext()); panel.getBibDatabaseContext().getEntries().forEach(bibEntry -> { bibEntry.setChanged(false); }); } panel.registerUndoableChanges(databaseWriter.getSaveActionsFieldChanges()); if (fileWriter.hasEncodingProblems()) { saveWithDifferentEncoding(file, selectedOnly, preferences.getEncoding(), fileWriter.getEncodingProblems(), saveType); } } catch (UnsupportedCharsetException ex) { throw new SaveException(Localization.lang("Character encoding '%0' is not supported.", encoding.displayName()), ex); } catch (IOException ex) { throw new SaveException("Problems saving:", ex); } return true; }</code><technical_language>I need reset parsed serialization. code <LINK_0> results in a wrong serialization for case: - Open library - Change entry - Save (entry written correctly) - Save (entry is original entry) if is worth change semantics of changed (right is "changed library loaded" want "changed library saved")</technical_language>

Target:
private boolean saveDatabase(Path file, boolean selectedOnly, Charset encoding, SavePreferences.DatabaseSaveType saveType) throws SaveException { SavePreferences preferences = prefs.loadForSaveFromPreferences() .withEncoding(encoding) .withSaveType(saveType); try (AtomicFileWriter fileWriter = new AtomicFileWriter(file, preferences.getEncoding(), preferences.makeBackup())) { BibtexDatabaseWriter databaseWriter = new BibtexDatabaseWriter(fileWriter, preferences, entryTypesManager); if (selectedOnly) { databaseWriter.savePartOfDatabase(panel.getBibDatabaseContext(), panel.getSelectedEntries()); } else { databaseWriter.saveDatabase(panel.getBibDatabaseContext()); } panel.registerUndoableChanges(databaseWriter.getSaveActionsFieldChanges()); if (fileWriter.hasEncodingProblems()) { saveWithDifferentEncoding(file, selectedOnly, preferences.getEncoding(), fileWriter.getEncodingProblems(), saveType); } } catch (UnsupportedCharsetException ex) { throw new SaveException(Localization.lang("Character encoding '%0' is not supported.", encoding.displayName()), ex); } catch (IOException ex) { throw new SaveException("Problems saving:", ex); } return true; }
Source:
<code>public void prepareRun(BatchSinkContext context) throws Exception { Job job = context.getHadoopJob(); job.setOutputKeyClass(WritableComparable.class); job.setOutputValueClass(DefaultHCatRecord.class); Configuration configuration = job.getConfiguration(); configuration.set("hive.metastore.uris", config.metaStoreURI); HCatOutputFormat.setOutput(configuration, job.getCredentials(), OutputJobInfo.create(Objects.firstNonNull( config.dbName, DEFAULT_HIVE_DATABASE), config.tableName, getPartitions())); HCatSchema hiveSchema = HCatOutputFormat.getTableSchema(configuration); if (config.schema != null) { hiveSchema = HiveSchemaConverter.toHiveSchema(Schema.parseJson(config.schema), hiveSchema); } HCatOutputFormat.setSchema(configuration, hiveSchema); <START> HiveSchemaStore.storeHiveSchema(context, Objects.firstNonNull(config.dbName, DEFAULT_HIVE_DATABASE), <END> config.tableName, hiveSchema); context.addOutput(config.tableName, new SinkOutputFormatProvider()); }</code><technical_language>this, a no-args constructor for HiveSinkConfig sets dbName default value</technical_language>

Target:
public void prepareRun(BatchSinkContext context) throws Exception { Job job = context.getHadoopJob(); job.setOutputKeyClass(WritableComparable.class); job.setOutputValueClass(DefaultHCatRecord.class); Configuration configuration = job.getConfiguration(); configuration.set("hive.metastore.uris", config.metaStoreURI); HCatOutputFormat.setOutput(configuration, job.getCredentials(), OutputJobInfo.create(config.dbName, config.tableName, getPartitions())); HCatSchema hiveSchema = HCatOutputFormat.getTableSchema(configuration); if (config.schema != null) { hiveSchema = HiveSchemaConverter.toHiveSchema(Schema.parseJson(config.schema), hiveSchema); } HCatOutputFormat.setSchema(configuration, hiveSchema); HiveSchemaStore.storeHiveSchema(context, config.dbName, config.tableName, hiveSchema); context.addOutput(config.tableName, new SinkOutputFormatProvider()); }
Source:
<code>public void accumulate(InternalFactHandle handle, A a, B b) { Runnable undo = acc.accumulate(a, b); <START> Runnable previousUndo = this.undoMap.put(handle.getId(), undo); <END> if (previousUndo != null) { throw new IllegalStateException("Undo for fact handle (" + handle.getId() + ") already exists."); } }</code><technical_language>nitpick code consistently: optaplanner code captures return of map.put() list.add(), typically called old*, previous*. => Runnable oldUndo</technical_language>

Target:
public void accumulate(InternalFactHandle handle, A a, B b) { Runnable undo = acc.accumulate(a, b); Runnable oldUndo = this.undoMap.put(handle.getId(), undo); if (oldUndo != null) { throw new IllegalStateException("Undo for fact handle (" + handle.getId() + ") already exists."); } }
Source:
<code>public String toString() { List<String> sortedList = getSortedList(); <START> StringBuilder result = new StringBuilder(); <END> for (String name : sortedList) { if (result.length() > 0) { result.append(','); } result.append(name); } if (result.length() == 0) { return null; } return result.toString(); }</code><technical_language>simplify this String.join(",", getSortedList())</technical_language>

Target:
public String toString() { return String.join(",", nameSet); }
Source:
<code>public void testServices() { ViewerSorter comparator = ProjectViewerComparator.createProjectTreeSorter(); IService service1 = Mockito.mock(IService.class); when(service1.getName()).thenReturn("s1"); when(service1.toString()).thenReturn("z"); ObservableTreeItem i1 = new ObservableTreeItem(service1); IService service2 = Mockito.mock(IService.class); when(service2.getName()).thenReturn("s2"); when(service2.toString()).thenReturn("a"); ObservableTreeItem i2 = new ObservableTreeItem(service2); <START> assertTrue(comparator.compare(null, i1, i2) < 0); <END> }</code><technical_language>check comparator.compare(null, i2, i1) comparator.compare(null, i1, i1)</technical_language>

Target:
public void testServices() { ViewerComparator comparator = ProjectViewerComparator.createProjectTreeSorter(); ObservableTreeItem i1 = new ObservableTreeItem(mockService("s1", "z")); ObservableTreeItem i2 = new ObservableTreeItem(mockService("s2", "a")); assertTrue(comparator.compare(null, i1, i2) < 0); assertTrue(comparator.compare(null, i2, i1) > 0); assertEquals(0, comparator.compare(null, i1, i1)); }
Source:
<code>public DnsServerAddressStream nameServerAddressStream(String hostname) { long last = lastRefresh.get(); Map<String, DnsServerAddresses> resolverMap = currentMappings; if (System.nanoTime() - last > REFRESH_INTERVAL) { if (lastRefresh.compareAndSet(last, System.nanoTime())) { resolverMap = currentMappings = retrieveCurrentMappings(); } } final String originalHostname = hostname; for (;;) { int i = hostname.indexOf('.', 1); if (i < 0 || i == hostname.length() - 1) { DnsServerAddresses addresses = resolverMap.get(StringUtil.EMPTY_STRING); if (addresses != null) { return addresses.stream(); } <START> return UNIX_PROVIDER.nameServerAddressStream(originalHostname); <END> } DnsServerAddresses addresses = resolverMap.get(hostname); if (addresses != null) { return addresses.stream(); } hostname = hostname.substring(i + 1); } }</code><technical_language>IIUC, is a chance users hit this path. Therefore, is need load initialize DnsServerAddressStreamProviders in advance. DnsServerAddressStreamProviders.unixDefault() instead of a static constant</technical_language>

Target:
public DnsServerAddressStream nameServerAddressStream(String hostname) { long last = lastRefresh.get(); Map<String, DnsServerAddresses> resolverMap = currentMappings; if (System.nanoTime() - last > REFRESH_INTERVAL) { if (lastRefresh.compareAndSet(last, System.nanoTime())) { resolverMap = currentMappings = retrieveCurrentMappings(); } } final String originalHostname = hostname; for (;;) { int i = hostname.indexOf('.', 1); if (i < 0 || i == hostname.length() - 1) { DnsServerAddresses addresses = resolverMap.get(StringUtil.EMPTY_STRING); if (addresses != null) { return addresses.stream(); } return DnsServerAddressStreamProviders.unixDefault().nameServerAddressStream(originalHostname); } DnsServerAddresses addresses = resolverMap.get(hostname); if (addresses != null) { return addresses.stream(); } hostname = hostname.substring(i + 1); } }
Source:
<code>public void testConstructExternalResourceDriversFromConfig() throws Exception { final Configuration config = new Configuration(); final String resourceName = "test"; final String driverClassName = "org.apache.flink.runtime.externalresource.TestingExternalResourceDriverFactory"; <START> final PluginManager mockPluginManager = Mockito.mock(PluginManager.class); Mockito.when(mockPluginManager.load(ExternalResourceDriverFactory.class)).thenReturn(IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory())); <END> config.setString(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, resourceName); config.setString(ExternalResourceConstants.EXTERNAL_RESOURCE_PREFIX + resourceName + ExternalResourceConstants.EXTERNAL_RESOURCE_DRIVER_FACTORY_SUFFIX, driverClassName); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, mockPluginManager); assertThat(externalResourceDrivers.size(), is(1)); assertTrue(externalResourceDrivers.get(resourceName) instanceof TestingExternalResourceDriver); }</code><technical_language>Mockito avoid introducing a TestingPluginManager</technical_language>

Target:
public void testConstructExternalResourceDriversFromConfig() { final Configuration config = new Configuration(); final String driverFactoryClassName = TestingExternalResourceDriverFactory.class.getName(); final Map<Class<?>, Iterator<?>> plugins = new HashMap<>(); plugins.put(ExternalResourceDriverFactory.class, IteratorUtils.singletonIterator(new TestingExternalResourceDriverFactory())); final PluginManager testingPluginManager = new TestingPluginManager(plugins); config.set(ExternalResourceOptions.EXTERNAL_RESOURCE_LIST, Collections.singletonList(RESOURCE_NAME_1)); config.setString(ExternalResourceOptions.getExternalResourceDriverFactoryConfigOptionForResource(RESOURCE_NAME_1), driverFactoryClassName); final Map<String, ExternalResourceDriver> externalResourceDrivers = ExternalResourceUtils.externalResourceDriversFromConfig(config, testingPluginManager); assertThat(externalResourceDrivers.size(), is(1)); assertThat(externalResourceDrivers.get(RESOURCE_NAME_1), instanceOf(TestingExternalResourceDriver.class)); }
Source:
<code>public void postInit(FMLPostInitializationEvent event) { proxy.cape(); CrossModLoader.postinit(); crossBC = new CrossBuildcraft(); crossIC2 = new CrossIndustrialCraft2(); crossRailcraft = new CrossRailcraft(); crossRF = new CrossRF(); crossClassic = new CrossIndustrialCraft2Classic(); if (crossClassic.doesIC2ClassicExist()) { if (recipes.equalsIgnoreCase("normal-force")) { <START> logger.info("Loading normal recipes with IC2 Classic may prevent certain recipes working") <END> RecipesNew.addRecipes(); } else if (recipes.equalsIgnoreCase("gregtech-force")) { logger.info("Loading Gregtech recipes with IC2 Classic will prevent certain recipes working") GregtechRecipes.addRecipes(); } else { RecipesOld.addOldRecipes(); } } else if (recipes.equalsIgnoreCase("normal")) { RecipesNew.addRecipes(); } else if (recipes.equalsIgnoreCase("old")) { RecipesOld.addOldRecipes(); } else if (recipes.equalsIgnoreCase("gregtech") || recipes.equalsIgnoreCase("gregtech5")) { GregtechRecipes.addRecipes(); logger.info("Hard... I mean, FUN recipes turned on! Have fun!"); } }</code><technical_language>Broah, pretty need semicolons in java :P</technical_language>

Target:
public void postInit(FMLPostInitializationEvent event) { proxy.cape(); CrossModLoader.postinit(); crossBC = new CrossBuildcraft(); crossIC2 = new CrossIndustrialCraft2(); crossRailcraft = new CrossRailcraft(); crossRF = new CrossRF(); crossClassic = new CrossIndustrialCraft2Classic(); if (crossClassic.doesIC2ClassicExist()) { if (recipes.equalsIgnoreCase("normal-force")) { logger.info("Loading normal recipes with IC2 Classic may prevent certain recipes working"); RecipesNew.addRecipes(); } else if (recipes.equalsIgnoreCase("gregtech-force")) { logger.info("Loading Gregtech recipes with IC2 Classic will prevent certain recipes working"); GregtechRecipes.addRecipes(); } else { RecipesOld.addOldRecipes(); } } else if (recipes.equalsIgnoreCase("normal")) { RecipesNew.addRecipes(); } else if (recipes.equalsIgnoreCase("old")) { RecipesOld.addOldRecipes(); } else if (recipes.equalsIgnoreCase("gregtech") || recipes.equalsIgnoreCase("gregtech5")) { GregtechRecipes.addRecipes(); logger.info("Hard... I mean, FUN recipes turned on! Have fun!"); } }
Source:
<code>public Collection<Summary> read() throws IOException { SummarizerFactory factory = new SummarizerFactory(); ConfigurationCopy acuconf = new ConfigurationCopy(DefaultConfiguration.getInstance()); Configuration conf = in.getFileSystem().getConf(); <START> config.forEach((k, v) -> acuconf.set(k, v)); <END> RFileSource[] sources = in.getSources(); try { SummaryCollection all = new SummaryCollection(); for (RFileSource source : sources) { SummaryReader fileSummary = SummaryReader.load(conf, acuconf, source.getInputStream(), source.getLength(), summarySelector, factory, CryptoServiceFactory.newInstance(acuconf)); SummaryCollection sc = fileSummary .getSummaries(Collections.singletonList(new Gatherer.RowRange(startRow, endRow))); all.merge(sc, factory); } return all.getSummaries(); } finally { for (RFileSource source : sources) { source.getInputStream().close(); } } }</code><technical_language>nice move this line immediately declaration of acuconf. Declaring conf threw I looked code. names conf config real reason I thrown for for a second</technical_language>

Target:
public Collection<Summary> read() throws IOException { SummarizerFactory factory = new SummarizerFactory(); ConfigurationCopy acuconf = new ConfigurationCopy(DefaultConfiguration.getInstance()); config.forEach((k, v) -> acuconf.set(k, v)); RFileSource[] sources = in.getSources(); try { SummaryCollection all = new SummaryCollection(); for (RFileSource source : sources) { SummaryReader fileSummary = SummaryReader.load(in.getFileSystem().getConf(), acuconf, source.getInputStream(), source.getLength(), summarySelector, factory, CryptoServiceFactory.newInstance(acuconf)); SummaryCollection sc = fileSummary .getSummaries(Collections.singletonList(new Gatherer.RowRange(startRow, endRow))); all.merge(sc, factory); } return all.getSummaries(); } finally { for (RFileSource source : sources) { source.getInputStream().close(); } } }
Source:
<code>public void printTasks() { if (!console.isVerbose()) { return; } int i = 0; for (Task task : tasks) { StringBuilder message = new StringBuilder() .append("Task ").append(i++).append(": ").append(task); for (Task blocker : task.tasksThatMustFinishFirst) { message.append("\n depends on completed task: ").append(blocker); } for (Task blocker : task.tasksThatMustFinishSuccessfullyFirst) { message.append("\n depends on successful task: ").append(blocker); } console.verbose(message.toString()); } <START> dotTasks(); <END> }</code><technical_language>give a more suggestive name (maybe printTaskDependencies())</technical_language>

Target:
public void printTasks() { if (!console.isVerbose()) { return; } int i = 0; for (Task task : tasks) { StringBuilder message = new StringBuilder() .append("Task ").append(i++).append(": ").append(task); for (Task blocker : task.tasksThatMustFinishFirst) { message.append("\n depends on completed task: ").append(blocker); } for (Task blocker : task.tasksThatMustFinishSuccessfullyFirst) { message.append("\n depends on successful task: ").append(blocker); } console.verbose(message.toString()); } printTasksDependencies(); }
Source:
<code>public void addQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); if (isRunning()) { for (Queue queue : queues) { <START> Assert.isTrue(StringUtils.hasText(queue.getName()), "Cannot add broker-named queues dynamically"); <END> } } this.queues.addAll(Arrays.asList(queues)); }</code><technical_language>Asesrt.hasText() work here</technical_language>

Target:
public void addQueues(Queue... queues) { Assert.notNull(queues, "'queues' cannot be null"); Assert.noNullElements(queues, "'queues' cannot contain null elements"); if (isRunning()) { for (Queue queue : queues) { Assert.hasText(queue.getName(), "Cannot add broker-named queues dynamically"); } } this.queues.addAll(Arrays.asList(queues)); }
Source:
<code>private AggregationNode.Aggregation countWithFilter(Expression condition) { return new AggregationNode.Aggregation( <START> functionManager.lookupFunction("count", ImmutableList.of()), <END> ImmutableList.of(), Optional.of(condition), Optional.empty(), false, Optional.<Symbol>empty()); }</code><technical_language>add countFunction() function resolution</technical_language>

Target:
private AggregationNode.Aggregation countWithFilter(Expression condition) { return new AggregationNode.Aggregation( new CallExpression( "count", functionResolution.countFunction(), BIGINT, ImmutableList.of()), Optional.of(castToRowExpression(condition)), Optional.empty(), false, Optional.empty()); }
Source:
<code>void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); Options.Builder optionBuilder = new Options.Builder().setShowNativeLearnMoreButton(false).setShowPromoImage(false).setUseExoPlayer(true); <START> if(!selectedFormat.equalsIgnoreCase("default")) <END> optionBuilder.setPlayerInfo(new CustomPlayerInfo(selectedFormat)); if(hevcMode.equalsIgnoreCase("HEVCPreferred")) optionBuilder.enableHevc(true); else if(hevcMode.equalsIgnoreCase("HEVCNotPreferred")) optionBuilder.enableHevc(false); Options options = optionBuilder.build(); player = new OoyalaPlayer(pcode, playerDomain, options); if(isStaging) { Log.i(TAG, "Environment Set to Staging:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.STAGING, Environment.PROTOCOL_HTTPS); } JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { if(autoPlay) player.play(); } else { Log.e(TAG, "Asset Failure"); } } }</code><technical_language>add curly braces if</technical_language>

Target:
void completePlayerSetup(boolean asked) { if (asked) { skinLayout = (OoyalaSkinLayout) findViewById(R.id.ooyalaSkin); PlayerDomain playerDomain = new PlayerDomain(domain); player = new OoyalaPlayer(pcode, playerDomain, getOptions()); if(isStaging) { Log.i(TAG, "Environment Set to Staging:"); OoyalaPlayer.setEnvironment(Environment.EnvironmentType.STAGING, Environment.PROTOCOL_HTTPS); } else { OoyalaPlayer.setEnvironment(Environment.EnvironmentType.PRODUCTION, Environment.PROTOCOL_HTTPS); } JSONObject overrides = createSkinOverrides(); SkinOptions skinOptions = new SkinOptions.Builder().setSkinOverrides(overrides).build(); playerLayoutController = new OoyalaSkinLayoutController(getApplication(), skinLayout, player, skinOptions); playerLayoutController.addObserver(this); player.addObserver(this); if (player.setEmbedCode(embedCode)) { if(autoPlay) { player.play(); } } else { Log.e(TAG, "Asset Failure"); } } }
Source:
<code>public void handleEvent(final Event event) { final FlowRunner flowRunner = (FlowRunner) event.getRunner(); <START> final ExecutableFlow flow = flowRunner.getExecutableFlow(); <END> if (event.getType() != null && flow != null) { LOGGER.info( "Handling event for Flow execution " + flow.getExecutionId() + " and the event type is " + event.getType()); } if (event.getType() == EventType.FLOW_FINISHED || event.getType() == EventType.FLOW_STARTED) { if (event.getType() == EventType.FLOW_FINISHED) { this.recentlyFinishedFlows.put(flow.getExecutionId(), flow); LOGGER.info("Flow " + flow.getExecutionId() + " is finished. Adding it to recently finished flows list."); this.runningFlows.remove(flow.getExecutionId()); this.deleteExecutionDir(flow.getExecutionId()); } else if (event.getType() == EventType.FLOW_STARTED) { this.triggerManager .addTrigger(flow.getExecutionId(), SlaOption.getFlowLevelSLAOptions(flow .getExecutionOptions().getSlaOptions())); } } }</code><technical_language>Please add a todo states this piece of code backs original state structure changed</technical_language>

Target:
public void handleEvent(final Event event) { final FlowRunner flowRunner = (FlowRunner) event.getRunner(); final ExecutableFlow flow = flowRunner.getExecutableFlow(); if (event.getType() != null && flow != null) { LOGGER.info( "Handling event for Flow execution " + flow.getExecutionId() + " and the event type is " + event.getType()); } else { LOGGER.info("Invalid event type or flow."); } if (event.getType() == EventType.FLOW_FINISHED || event.getType() == EventType.FLOW_STARTED) { if (event.getType() == EventType.FLOW_FINISHED) { this.recentlyFinishedFlows.put(flow.getExecutionId(), flow); LOGGER.info("Flow " + flow.getExecutionId() + " is finished. Adding it to recently finished flows list."); this.runningFlows.remove(flow.getExecutionId()); this.deleteExecutionDir(flow.getExecutionId()); } else if (event.getType() == EventType.FLOW_STARTED) { this.triggerManager .addTrigger(flow.getExecutionId(), SlaOption.getFlowLevelSLAOptions(flow .getExecutionOptions().getSlaOptions())); } } }
Source:
<code>protected void loadConfig() { InputStream input = null; try { <START> input = new FileInputStream(new File(getInstallLocation() + "/conf/storm.yaml")); <END> setConfig((Map<String, Object>)new Yaml().load(input)); LOG.info("Setting port for log viewer to " + config.get(LOG_VIEWER_PORT)); setPort(Optional.of((Integer)getConfig().get(LOG_VIEWER_PORT))); } catch (Exception e) { LOG.error("Failed to configure the log viewer controller,", e); setPort(Optional.fromNullable(((Integer)null))); } finally { IOUtils.closeQuietly(input); } }</code><technical_language>Again, join paths idiomatic way. I do new File(path1, path2) in Java</technical_language>

Target:
protected void loadConfig() { InputStream input = null; try { input = new FileInputStream(Paths.get(getInstallLocation(), "/conf/storm.yaml").toFile()); setConfig((Map<String, Object>) new Yaml().load(input)); LOG.info("Setting port for log viewer to " + config.get(LOG_VIEWER_PORT)); setPort(Optional.of((Integer) getConfig().get(LOG_VIEWER_PORT))); } catch (Exception e) { LOG.error("Failed to configure the log viewer controller,", e); setPort(Optional.fromNullable(((Integer) null))); } finally { IOUtils.closeQuietly(input); } }
Source:
<code>static public void sendXbmcNotification(@ParamDoc(name="host") String host,@ParamDoc(name="port") int port,@ParamDoc(name="title") String title,@ParamDoc(name="message") String message,@ParamDoc(name="image") String image,@ParamDoc(name="displayTime") long displayTime) { <START> String url = "http://" + host + ":" + port + "/jsonrpc?request="; <END> StringBuilder content = new StringBuilder(); content.append("{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"" + title + "\",\"message\":\"" + message + "\""); if (StringUtils.isNotEmpty(image)) content.append(",\"image\":\"" + image + "\""); if (displayTime >= 1500 && displayTime <= 2147483647) content.append(",\"displaytime\":" + displayTime); content.append("}}"); HttpUtil.executeUrl("POST", url, IOUtils.toInputStream(content.toString()), CONTENT_TYPE_JSON, 1000); }</code><technical_language>is ?request= part good for? is a POST request, this sense, it</technical_language>

Target:
static public void sendXbmcNotification(@ParamDoc(name="host") String host,@ParamDoc(name="port") int port,@ParamDoc(name="title") String title,@ParamDoc(name="message") String message,@ParamDoc(name="image") String image,@ParamDoc(name="displayTime") long displayTime) { String url = "http://" + host + ":" + port + "/jsonrpc"; StringBuilder content = new StringBuilder(); content.append("{\"id\":1,\"jsonrpc\":\"2.0\",\"method\":\"GUI.ShowNotification\",\"params\":{\"title\":\"" + title + "\",\"message\":\"" + message + "\""); if (StringUtils.isNotEmpty(image)) content.append(",\"image\":\"" + image + "\""); if (displayTime >= 1500 && displayTime <= 2147483647) content.append(",\"displaytime\":" + displayTime); content.append("}}"); HttpUtil.executeUrl("POST", url, IOUtils.toInputStream(content.toString()), CONTENT_TYPE_JSON, 1000); }
Source:
<code>public MessageSourcePollingTemplate(MessageSource<?> source) { <START> this.source = source; <END> }</code><technical_language>Assert.notNull()</technical_language>

Target:
public MessageSourcePollingTemplate(MessageSource<?> source) { Assert.notNull(source, "'source' cannot be null"); this.source = source; }
Source:
<code>public static Options getCommonOptions() { Options o = new Options(); o.addOption("h", "help", false, "print usage information"); o.addOption("V", "version", false, "print version information"); o.addOption("v", "verbose", false, "increased logging"); o.addOption("vv", "very-verbose", false, "high logging"); o.addOption("vvv", "very-very-verbose", false, "maximum logging"); o.addOption("p", "prefix", true, "add a prefix 'foo: http://bar'"); o.addOption("P", "prefixes", true, "use prefixes from JSON-LD file"); o.addOption("noprefixes", false, "do not use default prefixes"); <START> o.addOption("e", "entities", false, "use entity substitution when saving XML ontology"); <END> return o; }</code><technical_language>prefer a single long option for this: --xml-entities</technical_language>

Target:
public static Options getCommonOptions() { Options o = new Options(); o.addOption("h", "help", false, "print usage information"); o.addOption("V", "version", false, "print version information"); o.addOption("v", "verbose", false, "increased logging"); o.addOption("vv", "very-verbose", false, "high logging"); o.addOption("vvv", "very-very-verbose", false, "maximum logging"); o.addOption("p", "prefix", true, "add a prefix 'foo: http://bar'"); o.addOption("P", "prefixes", true, "use prefixes from JSON-LD file"); o.addOption("noprefixes", false, "do not use default prefixes"); o.addOption("x", "xml-entities", false, "use entity substitution with ontology XML output"); return o; }
Source:
<code>public Optional<String> namespace() { <START> return Optional.of("InMemory namespace"); <END> }</code><technical_language>above: spaces OK in namespace strings</technical_language>

Target:
public Optional<String> namespace() { return Optional.of("test"); }
Source:
<code>protected void statementExecuteUpdateBefore(StatementProxy statement, String sql) { super.statementExecuteUpdateBefore(statement,sql); <START> try { <END> Before(statement,sql); }catch (Exception e){ } }</code><technical_language>some concerns in this file. I some defensive code, possibly ways do this in code. for example, if blocks defense, delegation methods need to</technical_language>

Target:
protected void statementExecuteUpdateBefore(StatementProxy statement, String sql) { super.statementExecuteUpdateBefore(statement,sql); Before(statement,sql); }
Source:
<code>public ObjectSpecification download(String objectId, long offset, long length, boolean forExternalUse) { <START> Preconditions.checkArgument(offset > -1); <END> ObjectSpecification objectSpec = download(objectId); if (!forExternalUse && (offset == 0 && length < 0)) { return objectSpec; } if (length < 0) { length = objectSpec.getObjectSize() - offset; } if ((offset + length) > objectSpec.getObjectSize()) { throw new InternalUnrecoverableError("specified parameters exceed object size (object id: " + objectId + ", offset: " + offset + ", length: " + length + ")"); } String objectKey = ObjectStoreUtil.getObjectKey(dataDir, objectId); List<Part> parts; if (forExternalUse) { parts = partCalculator.specify(offset, length); } else { parts = partCalculator.divide(offset, length); } fillUrl(objectKey, parts, forExternalUse); ObjectSpecification spec = new ObjectSpecification(objectKey, objectId, objectId, parts, length); return spec; }</code><technical_language>Please static import Preconditions thanks</technical_language>

Target:
public ObjectSpecification download(String objectId, long offset, long length, boolean forExternalUse) { checkArgument(offset > -1L); ObjectSpecification objectSpec = download(objectId); if (!forExternalUse && (offset == 0L && length < 0L)) { return objectSpec; } if (!forExternalUse && (length < 0L)) { length = objectSpec.getObjectSize() - offset; } if ((offset + length) > objectSpec.getObjectSize()) { throw new InternalUnrecoverableError("specified parameters exceed object size (object id: " + objectId + ", offset: " + offset + ", length: " + length + ")"); } String objectKey = ObjectStoreUtil.getObjectKey(dataDir, objectId); List<Part> parts; if (forExternalUse) { parts = partCalculator.specify(0L, -1L); } else { parts = partCalculator.divide(offset, length); } fillUrl(objectKey, parts, forExternalUse); ObjectSpecification spec = new ObjectSpecification(objectKey, objectId, objectId, parts, length); return spec; }
Source:
<code>public String getIgnoredMessage(Description description) { Ignore ignore = description.getAnnotation(Ignore.class); <START> return ignore == null ? "Test ignored (without reason)!" : ignore.value(); <END> }</code><technical_language>add method</technical_language>

Target:
public String getIgnoredMessage(Description description) { Ignore ignore = description.getAnnotation(Ignore.class); return ignore == null || ignore.value().isEmpty() ? "Test ignored (without reason)!" : ignore.value(); }
Source:
<code>private void _add(String key, Collection<String> values) { <START> if (values != null) { <END> checkKey(key); List<String> checked = checkValues(values); if (!checked.isEmpty()) { List<String> currentSet = headerMap.get(key); if (currentSet == null) { headerMap.put(key, checked); } else { currentSet.addAll(checked); } serialized = null; } } }</code><technical_language>this function convert String's ByteBuffer's inserting headerMap. Accessors need return strings do reverse</technical_language>

Target:
private void _add(String key, Collection<String> values) { if (values != null) { Checker checked = new Checker(key, values); if (checked.hasValues()) { List<String> currentSet = headerMap.get(key); if (currentSet == null) { headerMap.put(key, checked.list); } else { currentSet.addAll(checked.list); } serialized = null; projectedLength += key.length() + checked.length; } } }
Source:
<code>public static void lowBatteryLevelRequest(Context context){ int batteryLevel = Util.getBatteryLevel(context); SyncUrl model = new SyncUrl(); for(SyncUrl syncUrl : model.loadByStatus(ServicesConstants.ACTIVE_SYNC_URL)) { if (syncUrl.getUrl() != null && !syncUrl.getUrl().equals("")) { MainHttpClient client = new MainHttpClient(syncUrl.getUrl(), context); try { <START> client.setMethod("GET"); <END> client.addParam("Task", "alert"); client.addParam("message", context.getResources().getString(R.string.battery_level_message, batteryLevel)); client.execute(); } catch (Exception e) { Util.logActivities(context, e.getMessage()); } finally { if (HttpStatus.SC_OK == client.getResponseCode()) { Util.logActivities(context, context.getResources().getString(R.string.successful_alert_to_server)); } } } } if (!Prefs.alertPhoneNumber.matches("")) { new ProcessSms(context).sendSms(Prefs.alertPhoneNumber,context.getResources().getString(R.string.battery_level_message, batteryLevel)); } }</code><technical_language>send this a POST request</technical_language>

Target:
public static void lowBatteryLevelRequest(Context context){ int batteryLevel = Util.getBatteryLevel(context); SyncUrl model = new SyncUrl(); for(SyncUrl syncUrl : model.loadByStatus(ServicesConstants.ACTIVE_SYNC_URL)) { if (syncUrl.getUrl() != null && !syncUrl.getUrl().equals("")) { MainHttpClient client = new MainHttpClient(syncUrl.getUrl(), context); try { client.setMethod(METHOD_POST); client.addParam(TASK_PARAM, "alert"); client.addParam(MESSAGE_PARAM, context.getResources().getString(R.string.battery_level_message, batteryLevel)); client.execute(); } catch (Exception e) { Util.logActivities(context, e.getMessage()); } finally { if (HttpStatus.SC_OK == client.getResponseCode()) { Util.logActivities(context, context.getResources().getString(R.string.successful_alert_to_server)); } } } } if (!Prefs.alertPhoneNumber.matches("")) { new ProcessSms(context).sendSms(Prefs.alertPhoneNumber,context.getResources().getString(R.string.battery_level_message, batteryLevel)); } }
Source:
<code>public boolean equals(Object o) { <START> if (!(o instanceof LabelVote)) { return false; } <END> LabelVote l = (LabelVote) o; return Objects.equal(name, l.name) && value == l.value; }</code><technical_language>I prefer if (o instanceof LabelVote) { LabelVote l = (LabelVote) o; ... } return false;</technical_language>

Target:
public boolean equals(Object o) { if (o instanceof LabelVote) { LabelVote l = (LabelVote) o; return Objects.equal(name, l.name) && value == l.value; } return false; }
Source:
<code>private void assertVariableValuesMatch(final TestContext testContext, final String name1, final String name2) { <START> String val1 = testContext.getVariable(name1); <END> String val2 = testContext.getVariable(name2); if (val1.equals(val2)) { log.debug(String.format("Values match for variables %s and %s. Value: %s", name1, name2, val1)); } else { throw new RuntimeException(String.format("Values don't match for variables. %s: %s, %s: %s", name1, val1, name2, val2)); } }</code><technical_language>issue for assertVariableValuesMatchWhenReadMultipleTimes suggestion String val1 = testContext.resolveDynamicValue(testContext.getVariable(name1));</technical_language>

Target:
private void assertVariableValuesMatch(final TestContext testContext, final String name1, final String name2) { String val1 = testContext.resolveDynamicValue(testContext.getVariable(name1)); String val2 = testContext.resolveDynamicValue(testContext.getVariable(name2)); if (val1.equals(val2)) { log.debug(String.format("Values match for variables %s and %s. Value: %s", name1, name2, val1)); } else { throw new RuntimeException(String.format("Values don't match for variables. %s: %s, %s: %s", name1, val1, name2, val2)); } }
Source:
<code>public void compare() { Preconditions.checkArgument(maxElapsedTime > 0, "A positive maxElapsedTime is expected"); Preconditions.checkArgument(minElapsedTime > 0, "A positive minElapsedTime is expected"); Preconditions.checkArgument(remoteElapsedTime > 0, "A positive remoteElapsedTime is expected"); if (hasTooMuchTimeElapsedSincePreviousRequest()) { events.tooMuchTimeSincePreviousRequest(minElapsedTime); return; } if (requestsTookTooLongToComplete()) { events.requestsTookTooLong(minElapsedTime, maxElapsedTime); return; } if (hasSkew()) { long skew; <START> if (remoteElapsedTime < minElapsedTime) { <END> skew = minElapsedTime - remoteElapsedTime; } else { skew = remoteElapsedTime - maxElapsedTime; } events.clockSkew(server, skew); } events.requestPace(server, minElapsedTime, maxElapsedTime, remoteElapsedTime); }</code><technical_language>this logic duplicated in hasSkew; a getSkew method a nonzero some skew</technical_language>

Target:
public void compare() { Preconditions.checkArgument(maxElapsedTime > 0, "A positive maxElapsedTime is expected"); Preconditions.checkArgument(minElapsedTime > 0, "A positive minElapsedTime is expected"); Preconditions.checkArgument(remoteElapsedTime > 0, "A positive remoteElapsedTime is expected"); if (hasTooMuchTimeElapsedSincePreviousRequest()) { events.tooMuchTimeSincePreviousRequest(minElapsedTime); return; } if (requestsTookTooLongToComplete()) { events.requestsTookTooLong(minElapsedTime, maxElapsedTime); return; } long skew = getSkew(); if (skew != 0) { events.clockSkew(server, skew); } events.requestPace(server, minElapsedTime, maxElapsedTime, remoteElapsedTime); }
Source:
<code>private <T> Task<Response<T>> createTaskWithTimeout(final String name, final Request<T> request, final RequestContext requestContext, RequestConfig config) { ConfigValue<Long> timeout = config.getTimeoutMs(); if (timeout.getValue() != null && timeout.getValue() > 0 && ParSeqGlobalConfiguration.isD2RequestTimeoutEnabled()) { reconcileRequestTimeout(requestContext, timeout.getValue()); } Task<Response<T>> requestTask; if (RequestGroup.isBatchable(request, config)) { requestTask = createBatchableTask(name, request, requestContext, config); } else { requestTask = Task.async(name, () -> sendRequest(request, requestContext)); } if (!ParSeqGlobalConfiguration.isD2RequestTimeoutEnabled()) { return withTimeout(requestTask, timeout); } else { <START> return requestTask.transform((Try<Response<T>> tryGet) -> { <END> if (tryGet.isFailed()) { if (tryGet.getError() instanceof TimeoutException && timeout.getValue() != null && timeout.getValue() > 0) { Optional<String> desc = timeout.getSource().map(src -> "src: " + src); String timeoutDetails = "withTimeout " + Math.min(timeout.getValue(), Integer.MAX_VALUE) + TimeUnitHelper.toString(TimeUnit.MILLISECONDS) + (desc != null ? " " + desc : ""); String timeoutExceptionMessage = "task: '" + requestTask.getName() + "' " + timeoutDetails; return Failure.of(Exceptions.timeoutException(timeoutExceptionMessage)); } else { return Failure.of(tryGet.getError()); } } else { return Success.of(tryGet.get()); } }); } }</code><technical_language>get this transform Task a name - preferably original withTimeout i.e. includes configuration key caused timeout applied</technical_language>

Target:
private <T> Task<Response<T>> createTaskWithTimeout(final String name, final Request<T> request, final RequestContext requestContext, RequestConfig config) { ConfigValue<Long> timeout = config.getTimeoutMs(); int reconciledTimeout = 0; if (timeout.getValue() != null && timeout.getValue() > 0 && _d2RequestTimeoutEnabled) { reconciledTimeout = reconcileRequestTimeout(requestContext, timeout.getValue()); } Task<Response<T>> requestTask; if (RequestGroup.isBatchable(request, config)) { requestTask = createBatchableTask(name, request, requestContext, config); } else { requestTask = Task.async(name, () -> sendRequest(request, requestContext)); } if (timeout.getValue() == null || timeout.getValue() <= 0) { return requestTask; } else { if (!_d2RequestTimeoutEnabled) { return withTimeout(requestTask, timeout); } else { assert reconciledTimeout > 0; String srcDesc = (reconciledTimeout < timeout.getValue().intValue()) ? " src: request context" : timeout.getSource().map(src -> " src: " + src).orElse(""); String timeoutTaskName = "withTimeout " + reconciledTimeout + TimeUnitHelper.toString(TimeUnit.MILLISECONDS) + srcDesc; return withD2Timeout(requestTask, timeoutTaskName); } } }
Source:
<code><START> public String decode(byte[] wbxmlBody) { <END> try { int i = 4; if (false == ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x05)) { return ""; } if (false == ((wbxmlBody[i] & WBXML_TOKEN_WITH_ATTRS) == WBXML_TOKEN_WITH_ATTRS)) { return ""; } i++; if ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x05) { i += 8; } if (false == ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x06 || (wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x07)) { return ""; } if (wbxmlBody[i + 1] != WBXML_INLINE_STRING) { return ""; } i += 2; int j = i; while (wbxmlBody[j] != 0) { j++; } String value = new String(wbxmlBody, i, j-i); return value; } catch (ArrayIndexOutOfBoundsException e) { if (Email.DEBUG) { Log.d(Email.LOG_TAG, "ArrayIndexOutOfBoundsException while handling " + "CONTENT_MIME_TYPE_B_EMN"); } } catch (Exception e) { if (Email.DEBUG) { Log.d(Email.LOG_TAG, "Exception while handling CONTENT_MIME_TYPE_B_EMN " + e); } } return ""; }</code><technical_language>better. I change is return null (not empty string) simplify test above</technical_language>

Target:
public String decode(byte[] wbxmlBody) { try { int i = 4; if (false == ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x05)) { return null; } if (false == ((wbxmlBody[i] & WBXML_TOKEN_WITH_ATTRS) == WBXML_TOKEN_WITH_ATTRS)) { return null; } i++; if ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x05) { i += 8; } if (false == ((wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x06 || (wbxmlBody[i] & WBXML_TOKEN_MASK) == 0x07)) { return null; } if (wbxmlBody[i + 1] != WBXML_INLINE_STRING) { return null; } i += 2; int j = i; while (wbxmlBody[j] != 0) { j++; } String value = new String(wbxmlBody, i, j-i); return value; } catch (ArrayIndexOutOfBoundsException e) { if (Email.DEBUG) { Log.d(Email.LOG_TAG, "ArrayIndexOutOfBoundsException while handling " + "CONTENT_MIME_TYPE_B_EMN"); } } catch (Exception e) { if (Email.DEBUG) { Log.d(Email.LOG_TAG, "Exception while handling CONTENT_MIME_TYPE_B_EMN " + e); } } return null; }
Source:
<code>public void testLanguageRangeSupport() throws NoSuchMethodException, SecurityException { ValidatorFactory validatorFactory = getValidatorFactoryWithInitializedLocales( Locale.FRANCE, new Locale( "es", "ES" ) ); HibernateMessageInterpolator messageInterpolator = (HibernateMessageInterpolator) validatorFactory.getMessageInterpolator(); <START> <END> StaticFieldLocaleResolver.acceptLanguage = "fr-FR,fr;q=0.9"; assertThat( messageInterpolator.interpolate( "{javax.validation.constraints.AssertFalse.message}", new TestContext() ) ) .isEqualTo( "doit avoir la valeur faux" ); }</code><technical_language>Knowing this solution, is HibernateMessageInterpolator interface useful? understanding interface is supposed used, honest</technical_language>

Target:
public void testLanguageRangeSupport() throws NoSuchMethodException, SecurityException { ValidatorFactory validatorFactory = getValidatorFactoryWithInitializedLocales( Locale.FRANCE, new Locale( "es", "ES" ) ); MessageInterpolator messageInterpolator = validatorFactory.getMessageInterpolator(); StaticFieldLocaleResolver.acceptLanguage = "fr-FR,fr;q=0.9"; assertThat( messageInterpolator.interpolate( "{javax.validation.constraints.AssertFalse.message}", new TestContext() ) ) .isEqualTo( "doit avoir la valeur faux" ); }
Source:
<code>public BaseTestClass() { KerberosHelper.loginFromKeytab(MerlinConstants.CURRENT_USER_NAME); prism = new PrismHelper(MERLIN_PROPERTIES, PRISM_PREFIX); servers = getServers(); serverFS = new ArrayList<FileSystem>(); serverOC = new ArrayList<OozieClient>(); serverHC = new ArrayList<HCatClient>(); for (ColoHelper server : servers) { try { serverFS.add(server.getClusterHelper().getHadoopFS()); serverOC.add(server.getClusterHelper().getOozieClient()); <START> serverHC.add(server.getClusterHelper().getHCatClient()); <END> HadoopUtil.createDir(baseHDFSDir, serverFS.get(serverFS.size ()-1)); } catch (IOException e) { e.printStackTrace(); System.exit(1); } } bundles = new Bundle[serverNames.length]; }</code><technical_language>test hcat client this done in test itself? I want avoid users hcat properties if running tests</technical_language>

Target:
public BaseTestClass() { KerberosHelper.loginFromKeytab(MerlinConstants.CURRENT_USER_NAME); prism = new PrismHelper(MERLIN_PROPERTIES, PRISM_PREFIX); servers = getServers(); serverFS = new ArrayList<FileSystem>(); serverOC = new ArrayList<OozieClient>(); for (ColoHelper server : servers) { try { serverFS.add(server.getClusterHelper().getHadoopFS()); serverOC.add(server.getClusterHelper().getOozieClient()); HadoopUtil.createDir(baseHDFSDir, serverFS.get(serverFS.size ()-1)); } catch (IOException e) { e.printStackTrace(); System.exit(1); } } bundles = new Bundle[serverNames.length]; }
Source:
<code>public void visitVariable(VariableTree tree) { scan(tree.modifiers()); completeMetadata(((VariableTreeImpl) tree).getSymbol(), tree.modifiers().annotations()); <START> if (tree.initializer() != null) { <END> resolveAs(tree.initializer(), JavaSymbol.VAR); if(((JavaType) tree.initializer().symbolType()).isTagged(JavaType.DEFERRED)) { setInferedType(tree.type().symbolType(), (DeferredType) tree.initializer().symbolType()); } } }</code><technical_language>clearer a variable for initializer instead of calling this method 4 times</technical_language>

Target:
public void visitVariable(VariableTree tree) { scan(tree.modifiers()); completeMetadata(((VariableTreeImpl) tree).getSymbol(), tree.modifiers().annotations()); ExpressionTree initializer = tree.initializer(); if (initializer != null) { resolveAs(initializer, JavaSymbol.VAR); if(((JavaType) initializer.symbolType()).isTagged(JavaType.DEFERRED)) { setInferedType(tree.type().symbolType(), (DeferredType) initializer.symbolType()); } } }