auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public GetDetailedObjectsResult call() throws Exception { final ImmutableList<DetailedS3Object> suspectBulkObjects; Predicate<DetailedS3Object> filterPredicate; if (Guard.isMapNullOrEmpty(this.filterParams)) { filterPredicate = new Predicate<DetailedS3Object>() { @Override public boolean apply(@Nullable final DetailedS3Object input) { return (input != null); }}; } else { long larger = 0L; long smaller = Long.MAX_VALUE; Date newer = new Date(0); Date older = new Date(Long.MAX_VALUE); <START> for (final String paramChange : this.filterParams.keySet()) { <END> final String paramNewValue = this.filterParams.get(paramChange); if ("largerthan".equalsIgnoreCase(paramChange)) { larger = Long.parseLong(paramNewValue); } else if ("smallerthan".equalsIgnoreCase(paramChange)) { smaller = Long.parseLong(paramNewValue); } else if ("newerthan".equalsIgnoreCase(paramChange)) { newer = new Date(new Date().getTime() - Utils.dateDiffToSeconds(paramNewValue) * 1000); } else if ("olderthan".equalsIgnoreCase(paramChange)) { older = new Date(new Date().getTime() - Utils.dateDiffToSeconds(paramNewValue) * 1000); } else { throw new CommandException("Unrecognized filter parameter: " + paramChange); } } final long largerthan = larger; final long smallerthan = smaller; final Date newerthan = newer; final Date olderthan = older; filterPredicate = new Predicate<DetailedS3Object>() { @Override public boolean apply(@Nullable final DetailedS3Object input) { if (input == null) { return false; } return (input.getSize() > largerthan && input.getSize() < smallerthan && input.getCreationDate().after(newerthan) && input.getCreationDate().before(olderthan) ); } }; } suspectBulkObjects = ImmutableList.copyOf( FluentIterable.from(new LazyIterable<DetailedS3Object>( new GetObjectsFullDetailsLoaderFactory(getClient(), this.bucketName, this.prefix, 100, 5, true))).filter( filterPredicate)); return new GetDetailedObjectsResult(suspectBulkObjects.iterator()); }</code><technical_language>This logic split out function</technical_language>

Target:
public GetDetailedObjectsResult call() throws Exception { final Iterable suspectBulkObjects; final Predicate<DetailedS3Object> filterPredicate = getPredicate(); suspectBulkObjects = FluentIterable.from(new LazyIterable<DetailedS3Object>( new GetObjectsFullDetailsLoaderFactory(getClient(), this.bucketName, this.prefix, 100, 5, true))) .filter(filterPredicate); return new GetDetailedObjectsResult(suspectBulkObjects); }
Source:
<code>protected boolean canDoAction() { StorageServerConnections paramConnection = getParameters().getStorageServerConnection(); if (paramConnection.getstorage_type() == StorageType.NFS && !new NfsMountPointConstraint().isValid(paramConnection.getconnection(), null)) { return failCanDoAction(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_INVALID); } if (paramConnection.getstorage_type() == StorageType.POSIXFS && (StringUtils.isEmpty(paramConnection.getVfsType()))) { return failCanDoAction(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE); } if (getParameters().getVdsId().equals(Guid.Empty)) { <START> if (!InitializeVds()) { <END> return false; } } else if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_INVALID_SERVER_ID); } else if (getVds().getStatus() != VDSStatus.Up) { return failCanDoAction(VdcBllMessages.VDS_ADD_STORAGE_SERVER_STATUS_MUST_BE_UP); } return super.canDoAction(); }</code><technical_language>I put super.canDoAction() beginning of CDA implementation of InitializeVds() storage pool id (getStoragePool()), I fail super.canDoAction</technical_language>

Target:
protected boolean canDoAction() { if(super.canDoAction()) { StorageServerConnections paramConnection = getParameters().getStorageServerConnection(); if (paramConnection.getstorage_type() == StorageType.NFS && !new NfsMountPointConstraint().isValid(paramConnection.getconnection(), null)) { return failCanDoAction(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_INVALID); } if (paramConnection.getstorage_type() == StorageType.POSIXFS && (StringUtils.isEmpty(paramConnection.getVfsType()))) { return failCanDoAction(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_EMPTY_VFSTYPE); } if (getParameters().getVdsId().equals(Guid.Empty)) { if (!InitializeVds()) { return false; } } else if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_INVALID_SERVER_ID); } else if (getVds().getStatus() != VDSStatus.Up) { return failCanDoAction(VdcBllMessages.VDS_ADD_STORAGE_SERVER_STATUS_MUST_BE_UP); } return true; } return false; }
Source:
<code>public void printTime(String header, boolean fromStart) { long dur = logTime(fromStart); <START> System.out.println(String.format("%s (%,6d sec; DB cache: %,6d; Docs: %,6d)", header, dur / 1000, getCacheCounts(fromStart), docs.size())); <END> }</code><technical_language>nice if log total elapsed time script started. easier estimate long conversion take</technical_language>

Target:
public void printTime(String header, boolean fromStart) { long dur = logTime(fromStart); long totalDur = logTime(true); String stotalDur = duration(totalDur); System.out.println(String.format("%s (%,6d sec; %s; DB cache: %,6d; Docs: %,6d)", header, dur/1000, stotalDur, getCacheCounts(fromStart), docs.size())); }
Source:
<code>public <T> Flux<T> multiGet(Query query, Class<T> clazz, IndexCoordinates index) { Assert.notNull(index, "index must not be null"); Assert.notEmpty(query.getIds(), "No Id define for Query"); MultiGetRequest request = requestFactory.multiGetRequest(query, index); return Flux.from(execute(cl -> cl.multiGet(request))) .handle((result, sink) -> { <START> Document document = DocumentAdapters.from(result); <END> if (document != null) { T entity = getElasticsearchConverter().mapDocument(document, clazz); if (entity != null) { sink.next(entity); } } }); }</code><technical_language>a result null? (i.e. do regularly need consider source is attached)</technical_language>

Target:
public <T> Flux<T> multiGet(Query query, Class<T> clazz, IndexCoordinates index) { Assert.notNull(index, "Index must not be null"); Assert.notNull(clazz, "Class must not be null"); Assert.notNull(query, "Query must not be null"); Assert.notEmpty(query.getIds(), "No Id define for Query"); MultiGetRequest request = requestFactory.multiGetRequest(query, index); return Flux.from(execute(client -> client.multiGet(request))) .handle((result, sink) -> { Document document = DocumentAdapters.from(result); T entity = converter.mapDocument(document, clazz); if (entity != null) { sink.next(entity); } }); }
Source:
<code>private String removeType(String value) { <START> if (value != null && value.startsWith("mvel: ")) { <END> return value.substring(6); } else { return value; } }</code><technical_language>is this type possible? reflection</technical_language>

Target:
private String removeType(String value) { if(value != null) { if(value.startsWith("mvel: ")) { return value.substring(6); } else if(value.startsWith("reflection: ")) { return value.substring(12); } else { return value; } } else { return value; } }
Source:
<code>public static boolean isNetworkConnectionPresent(Context ctx) { ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); boolean isConnected = activeNetwork != null && activeNetwork.isConnected(); <START> return isConnected; <END> }</code><technical_language>inline variable isConnected</technical_language>

Target:
public static boolean isNetworkConnectionPresent(Context ctx) { ConnectivityManager cm = (ConnectivityManager) ctx.getSystemService(Context.CONNECTIVITY_SERVICE); NetworkInfo activeNetwork = cm.getActiveNetworkInfo(); return activeNetwork != null && activeNetwork.isConnected(); }
Source:
<code>public void should_pass_all_samples_when_config_has_1_percentage() throws Exception { samplerConfiguration.setPercentage(1d); <START> boolean passed = new PercentageBasedSampler(samplerConfiguration, traceAccessor).next(null); <END> for (int i = 0; i < 10; i++) { then(passed).isTrue(); } }</code><technical_language>I bet love next(null) right? :P</technical_language>

Target:
public void should_pass_all_samples_when_config_has_1_percentage() throws Exception { samplerConfiguration.setPercentage(1f); for (int i = 0; i < 10; i++) { then(new PercentageBasedSampler(samplerConfiguration, traceAccessor, stringToUuidConverter).next(null)).isTrue(); } }
Source:
<code>protected void doStop() { try { this.active = false; <START> this.lifecycleCondition.await(Math.min(this.stopTimeout, this.receiveTimeout), TimeUnit.MILLISECONDS); <END> } catch (InterruptedException e) { logger.debug("Thread interrupted while stopping the endpoint"); Thread.currentThread().interrupt(); } finally { this.listening = false; } }</code><technical_language>max ? This bad if a lot of endpoints. I if blocking here; SmartLifecycle stop callback</technical_language>

Target:
protected void doStop() { super.doStop(); this.active = this.listening = false; }
Source:
<code>public SCMProbeStat stat(@NonNull String path) throws IOException { try { String depotPath = base + "/" + path; if (p4.hasFile(depotPath)) { return SCMProbeStat.fromType(SCMFile.Type.REGULAR_FILE); } <START> } catch (Exception e) { <END> logger.warning("Unable to check file: " + e.getMessage()); } return SCMProbeStat.fromType(SCMFile.Type.NONEXISTENT); }</code><technical_language>Do squash here, propagate IOException</technical_language>

Target:
public SCMProbeStat stat(@NonNull String path) throws IOException { try { String depotPath = base + "/" + path; if (p4.hasFile(depotPath)) { return SCMProbeStat.fromType(SCMFile.Type.REGULAR_FILE); } } catch (Exception e) { throw new IOException("Unable to check file: " + e.getMessage()); } return SCMProbeStat.fromType(SCMFile.Type.NONEXISTENT); }
Source:
<code>public T getValue() { if (!this.isInitialized) { <START> throw new NoSuchElementException("No value present"); <END> } return this.value; }</code><technical_language>Do want state initialized</technical_language>

Target:
public T getValue() { if (!this.isInitialized) { throw new NoSuchElementException("No value initialized"); } return this.value; }
Source:
<code>private WikipediaApp getApplication() { <START> return (WikipediaApp) getPageActivity().getApplication(); <END> }</code><technical_language>WikipediaApp.getInstance() instead</technical_language>

Target:
private WikipediaApp getApplication() { return WikipediaApp.getInstance(); }
Source:
<code>public String getPassword() { String user = getUsername(); <START> String defPass = null; <END> if( "openshift-dev".equals(user)) { defPass = "devel"; } else { defPass = "developer"; } String pass = env.containsKey(DOTCDK_AUTH_PASS) ? env.get(DOTCDK_AUTH_PASS) : defPass; return pass; }</code><technical_language>![MINOR](<LINK_1> 'Severity: MINOR') Immediately return this expression instead of assigning temporary variable "user". [![rule](<LINK_0>](<LINK_2></technical_language>

Target:
public String getPassword() { String user = getUsername(); String defPass = null; if(DEFAULT_CDK_USER.equals(user)) { defPass = DEFAULT_CDK_PASS; } else if( DEFAULT_MINISHIFT_USER.equals(user)){ defPass = DEFAULT_MINISHIFT_PASS; } String pass = env.containsKey(DOTCDK_AUTH_PASS) ? env.get(DOTCDK_AUTH_PASS) : defPass; return pass; }
Source:
<code>@OnCheckedChanged(R.id.wiki_language_checkbox) void onCheckedChanged() { if (callback != null) { callback.onCheckedChanged(position); containerView.setBackgroundColor(checkBox.isChecked() ? <START> getResources().getColor(R.color.accent90) : <END> ResourceUtil.getThemedColor(getContext(), R.attr.paper_color)); } }</code><technical_language>This R.attr.multi_select_background_color, account for dark/black mode</technical_language>

Target:
@OnCheckedChanged(R.id.wiki_language_checkbox) void onCheckedChanged() { if (callback != null) { callback.onCheckedChanged(position); containerView.setBackgroundColor(checkBox.isChecked() ? ResourceUtil.getThemedColor(getContext(), R.attr.multi_select_background_color) : ResourceUtil.getThemedColor(getContext(), R.attr.paper_color)); } }
Source:
<code>protected void updateVirtioScsiEnabled(final Guid vmId, int osId) { VDSGroup cluster = getModel().getSelectedCluster(); Version clusterVersion = cluster != null ? cluster.getcompatibility_version() : null; AsyncDataProvider.getDiskInterfaceList(osId, clusterVersion, new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ArrayList<DiskInterface> diskInterfaces = (ArrayList<DiskInterface>) returnValue; boolean isOsSupportVirtioScsi = diskInterfaces.contains(DiskInterface.VirtIO_SCSI); getModel().getIsVirtioScsiEnabled().setIsChangable(isOsSupportVirtioScsi); if (!isOsSupportVirtioScsi) { getModel().getIsVirtioScsiEnabled().setEntity(false); getModel().getIsVirtioScsiEnabled().setChangeProhibitionReason(constants.cannotEnableVirtioScsiForOs()); } else { if (Guid.isNullOrEmpty(vmId)) { VDSGroup cluster = getModel().getSelectedCluster(); boolean isVirtioScsiEnabled = (Boolean) AsyncDataProvider.getConfigValuePreConverted( <START> ConfigurationValues.VirtIoScsiEnabled, cluster.getcompatibility_version().getValue()); <END> getModel().getIsVirtioScsiEnabled().setEntity(isVirtioScsiEnabled); } else { AsyncDataProvider.isVirtioScsiEnabledForVm(new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { getModel().getIsVirtioScsiEnabled().setEntity((Boolean) returnValue); } }), vmId); } } } })); }</code><technical_language>is a chance cluster null this point NPE</technical_language>

Target:
protected void updateVirtioScsiEnabled(final Guid vmId, int osId) { final VDSGroup cluster = getModel().getSelectedCluster(); if (cluster == null) { return; } AsyncDataProvider.getDiskInterfaceList(osId, cluster.getcompatibility_version(), new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { ArrayList<DiskInterface> diskInterfaces = (ArrayList<DiskInterface>) returnValue; boolean isOsSupportVirtioScsi = diskInterfaces.contains(DiskInterface.VirtIO_SCSI); getModel().getIsVirtioScsiEnabled().setIsChangable(isOsSupportVirtioScsi); if (!isOsSupportVirtioScsi) { getModel().getIsVirtioScsiEnabled().setEntity(false); getModel().getIsVirtioScsiEnabled().setChangeProhibitionReason(constants.cannotEnableVirtioScsiForOs()); } else { if (Guid.isNullOrEmpty(vmId)) { boolean isVirtioScsiEnabled = (Boolean) AsyncDataProvider.getConfigValuePreConverted( ConfigurationValues.VirtIoScsiEnabled, cluster.getcompatibility_version().getValue()); getModel().getIsVirtioScsiEnabled().setEntity(isVirtioScsiEnabled); } else { AsyncDataProvider.isVirtioScsiEnabledForVm(new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { getModel().getIsVirtioScsiEnabled().setEntity((Boolean) returnValue); } }), vmId); } } } })); }
Source:
<code><START> public BackgroundLocationManager(LocationClient locationClient, BackgroundLocationHelper helper) { <END> currentState = BackgroundLocationState.NOT_APPLICABLE; this.locationClient = locationClient; this.helper = helper; this.locationListener = this; }</code><technical_language>BackgroundLocationHelper is reminds of ["Delegate" pattern](<LINK_0> nerdy call a BackgroundLocationDelegate instead? that, cool BackgroundLocationManager depend interface a concrete class. clearer separation is</technical_language>

Target:
public BackgroundLocationManager(LocationClient locationClient, BackgroundLocationHelper helper) { currentState = BackgroundLocationState.NO_BACKGROUND_LOCATION_NEEDED; this.locationClient = locationClient; this.helper = helper; this.locationListener = this; }
Source:
<code>public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put("security.config-file", "/test.json") .put("security.refresh-period", "1s") .build(); FileBasedAccessControlConfig expected = new FileBasedAccessControlConfig() .setConfigFile("/test.json") <START> .setRefreshPeriod(Duration.valueOf("1s")); <END> assertFullMapping(properties, expected); }</code><technical_language>new Duration(1, SECOND)</technical_language>

Target:
public void testExplicitPropertyMappings() { Map<String, String> properties = new ImmutableMap.Builder<String, String>() .put(SECURITY_CONFIG_FILE, "/test.json") .put(SECURITY_REFRESH_PERIOD, "1s") .build(); FileBasedAccessControlConfig expected = new FileBasedAccessControlConfig() .setConfigFile("/test.json") .setRefreshPeriod(new Duration(1, TimeUnit.SECONDS)); assertFullMapping(properties, expected); }
Source:
<code>private void reject(final Message message) { if (!coapstack.supportsRejects()) { LOGGER.log(Level.FINE, "Rejects not supported under this stack."); return; } <START> EmptyMessage rst = EmptyMessage.newRST(message); <END> rst.setToken(new byte[0]); for (MessageInterceptor messageInterceptor : interceptors) { messageInterceptor.sendEmptyMessage(rst); } if (!rst.isCanceled()) { connector.send(serializer.serializeEmptyMessage(rst)); } }</code><technical_language>be, I wrong, impression: if parameter message is a RST for a original message, soruce/destination is exchanged. > EmptyMessage.newRST(message); exchange source/destination again</technical_language>

Target:
private void reject(final Message message) { EmptyMessage rst = EmptyMessage.newRST(message); rst.setToken(new byte[0]); for (MessageInterceptor messageInterceptor : interceptors) { messageInterceptor.sendEmptyMessage(rst); } if (!rst.isCanceled()) { connector.send(serializer.serializeEmptyMessage(rst)); } }
Source:
<code>public void startEntity(final String name) { final Matcher fieldNameMatcher = FIELD_NAME_PATTERN.matcher(name); if (!fieldNameMatcher.matches()) { throw new FormatException(name); <START> } <END> builder.append(name.trim()+ " "); idnControlSubField = !ignoreRecordId && name.trim().equals("003@"); this.entityOpen = true; }</code><technical_language>check in entity</technical_language>

Target:
public void startEntity(final String name) { final Matcher fieldNameMatcher = FIELD_NAME_PATTERN.matcher(name); if (!fieldNameMatcher.matches()) { throw new FormatException(name); } if (entityOpen) { throw new FormatException(name); } builder.append(name.trim()+ " "); idnControlSubField = !ignoreRecordId && FIELD_IDN_INTERN.equals(name.trim()); this.entityOpen = true; }
Source:
<code>protected MutableBoundedValue<Short> constructValue(Short actualValue) { return SpongeValueFactory.boundedBuilder(Keys.SPAWNER_MAXIMUM_DELAY) .minimum((short) 1) .maximum(Short.MAX_VALUE) <START> .defaultValue((short) 800) <END> .actualValue(actualValue) .build(); }</code><technical_language>DataConstants please</technical_language>

Target:
protected MutableBoundedValue<Short> constructValue(Short actualValue) { return SpongeValueFactory.boundedBuilder(Keys.SPAWNER_MAXIMUM_DELAY) .minimum(DataConstants.MINIMUM_SPAWNER_MAXIMUM_SPAWN_DELAY) .maximum(Short.MAX_VALUE) .defaultValue(DataConstants.DEFAULT_SPAWNER_MAXIMUM_SPAWN_DELAY) .actualValue(actualValue) .build(); }
Source:
<code>public void test_parallelPrefix$D() { Random rand = new Random(0); double[] list = new double[1000]; for(int i = 0; i < list.length; ++i) { list[i] = rand.nextDouble() <START> % 1000; END> } double[] seqResult = list.clone(); for(int i = 0; i < seqResult.length - 1; ++i) { seqResult[i + 1] += seqResult[i]; } Arrays.parallelPrefix(list, (x, y) -> x + y); int[] listInInt = Arrays.stream(list).mapToInt(x -> (int) x).toArray(); int[] seqResultInInt = Arrays.stream(seqResult).mapToInt(x -> (int) x).toArray(); assertTrue(Arrays.equals(seqResultInInt, listInInt)); try { Arrays.parallelPrefix(list, null); fail(); } catch (NullPointerException expected) { } try { Arrays.parallelPrefix((double[]) null, (x, y) -> x + y); fail(); } catch (NullPointerException expected) { } }</code><technical_language>remove, nextDouble is in [0,1) range</technical_language>

Target:
public void test_setAll$D() { double[] list = new double[3]; list[0] = 0.0d; list[1] = 1.0d; list[2] = 2.0d; Arrays.setAll(list, x -> x + 0.5); assertEquals(0.5d, list[0]); assertEquals(1.5d, list[1]); assertEquals(2.5d, list[2]); try { Arrays.setAll(list, null); fail(); } catch (NullPointerException expected) { } try { Arrays.setAll((double[]) null, x -> x + 0.5); fail(); } catch (NullPointerException expected) { } }
Source:
<code>public void handleStatus(int status) { status = status / 100; <START> switch (status) { <END> case 1: informationalResponseCounter.increment(); break; case 2: successResponseCounter.increment(); break; case 3: redirectResponseCounter.increment(); break; case 4: clientErrorResponseCounter.increment(); break; case 5: serverErrorResponseCounter.increment(); break; } }</code><technical_language>maven build output warning is switch default section</technical_language>

Target:
public void handleStatus(int status) { status = status / 100; switch (status) { case 1: informationalResponseCounter.increment(); break; case 2: successResponseCounter.increment(); break; case 3: redirectResponseCounter.increment(); break; case 4: clientErrorResponseCounter.increment(); break; case 5: serverErrorResponseCounter.increment(); break; default: LOG.warn("Unhandled HTTP status ", status); } }
Source:
<code>public static List<String> getAllBroadcastAddresses() { List<String> broadcastAddresses = new LinkedList<String>(); try { final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { final NetworkInterface networkInterface = networkInterfaces.nextElement(); final List<InterfaceAddress> interfaceAddresses = networkInterface.getInterfaceAddresses(); for (InterfaceAddress interfaceAddress : interfaceAddresses) { final InetAddress addr = interfaceAddress.getAddress(); if (addr instanceof Inet4Address && !addr.isLinkLocalAddress() && !addr.isLoopbackAddress()) { <START> InetAddress broadCast = interfaceAddress.getBroadcast(); <END> if (broadCast != null) { broadcastAddresses.add(broadCast.getHostAddress()); } } } } } catch (SocketException ex) { LOGGER.error("Could not find broadcast address: {}", ex.getMessage(), ex); } return broadcastAddresses; }</code><technical_language>internet claims "broadcast" is a single word</technical_language>

Target:
public static List<String> getAllBroadcastAddresses() { List<String> broadcastAddresses = new LinkedList<String>(); try { final Enumeration<NetworkInterface> networkInterfaces = NetworkInterface.getNetworkInterfaces(); while (networkInterfaces.hasMoreElements()) { final NetworkInterface networkInterface = networkInterfaces.nextElement(); final List<InterfaceAddress> interfaceAddresses = networkInterface.getInterfaceAddresses(); for (InterfaceAddress interfaceAddress : interfaceAddresses) { final InetAddress addr = interfaceAddress.getAddress(); if (addr instanceof Inet4Address && !addr.isLinkLocalAddress() && !addr.isLoopbackAddress()) { InetAddress broadcast = interfaceAddress.getBroadcast(); if (broadcast != null) { broadcastAddresses.add(broadcast.getHostAddress()); } } } } } catch (SocketException ex) { LOGGER.error("Could not find broadcast address: {}", ex.getMessage(), ex); } return broadcastAddresses; }
Source:
<code>protected void captureAndVerifyCommentEventNotification(Supplier<DocumentModel> supplier, String commentEventType, String documentEventType) { try (CapturingEventListener listener = new CapturingEventListener(commentEventType, documentEventType)) { DocumentModel commentDocumentModel = supplier.get(); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(commentEventType)); assertTrue(listener.hasBeenFired(documentEventType)); <START> List<Event> handledEvents = listener.getCapturedEvents() <END> .stream() .filter(e -> commentEventType.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); Event expectedEvent = handledEvents.get(0); assertEquals(commentEventType, expectedEvent.getName()); checkDocumentEventContext(expectedEvent, commentDocumentModel, commentedDocumentModel); } }</code><technical_language>streamCapturedEvents</technical_language>

Target:
protected void captureAndVerifyCommentEventNotification(Supplier<DocumentModel> supplier, String commentEventType, String documentEventType) { try (CapturingEventListener listener = new CapturingEventListener(commentEventType, documentEventType)) { DocumentModel commentDocumentModel = supplier.get(); transactionalFeature.nextTransaction(); assertTrue(listener.hasBeenFired(commentEventType)); assertTrue(listener.hasBeenFired(documentEventType)); List<Event> handledEvents = listener.streamCapturedEvents() .filter(e -> commentEventType.equals(e.getName())) .collect(Collectors.toList()); assertEquals(1, handledEvents.size()); checkDocumentEventContext(handledEvents.get(0), commentDocumentModel, commentedDocumentModel); } }
Source:
<code>private int getTotalGlobalRefCount() { int totalRefCount = 0; <START> for (RealmCacheType type : RealmCacheType.values()) { <END> totalRefCount += refAndCountMap.get(type).globalCount; } return totalRefCount; }</code><technical_language>Iterating refAndCountMap.entrieSet() is more efficient. RealmCacheType.values() allocates new array in call, refAndCountMap.entrieSet() caches returned object. avoid hash table lookup</technical_language>

Target:
private int getTotalGlobalRefCount() { int totalRefCount = 0; for (RefAndCount refAndCount : refAndCountMap.values()) { totalRefCount += refAndCount.globalCount; } return totalRefCount; }
Source:
<code>private File createZipFile(Set<String> bundles) throws IOException { File rootDirectory = SupportPlugin.getRootDirectory(); <START> File zipFile = File.createTempFile( <END> String.format("multiBundle(%s)-", bundles.size()), ".zip");; try(FileOutputStream fos = new FileOutputStream(zipFile); ZipOutputStream zos = new ZipOutputStream(fos)) { byte[] buffer = new byte[1024]; for (String bundle: bundles) { File file = new File(rootDirectory, bundle); try(FileInputStream fis = new FileInputStream(file)) { zos.putNextEntry(new ZipEntry(file.getName())); int length; while ((length = fis.read(buffer)) > 0) { zos.write(buffer, 0, length); } } } } catch (IOException e) { logger.log(Level.SEVERE, "Error creating zip file: " + zipFile.getAbsolutePath(), e); } return zipFile; }</code><technical_language>I mark deletion of temp file Jenkins exits [zipFile.deleteOnExit()](<LINK_0></technical_language>

Target:
private File createZipFile(Set<String> bundles) throws IOException { File rootDirectory = SupportPlugin.getRootDirectory(); File zipFile = File.createTempFile( String.format("multiBundle(%s)-", bundles.size()), ".zip"); zipFile.deleteOnExit(); try(FileOutputStream fos = new FileOutputStream(zipFile); ZipOutputStream zos = new ZipOutputStream(fos)) { byte[] buffer = new byte[1024]; for (String bundle: bundles) { File file = new File(rootDirectory, bundle); try(FileInputStream fis = new FileInputStream(file)) { zos.putNextEntry(new ZipEntry(file.getName())); int length; while ((length = fis.read(buffer)) > 0) { zos.write(buffer, 0, length); } } } } catch (IOException e) { logger.log(Level.SEVERE, "Error creating zip file: " + zipFile.getAbsolutePath(), e); } return zipFile; }
Source:
<code>String serialize(final String uniqueUserId) throws AuthenticationException { if (StringExtensions.IsNullOrBlank(uniqueUserId)) { throw new IllegalArgumentException("uniqueUserId"); } if ((new BrokerProxy(mContext)).canSwitchToBroker()) { throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT,"Failed to export the FID because broker is enabled."); } final String cacheKey = CacheKey.createCacheKey(this.getAuthority(), null, AuthenticationConstants.MS_FAMILY_ID, true, uniqueUserId); <START> final TokenCacheItem tokenItem = this.getCache().getItem(cacheKey); <END> if (tokenItem == null) { Logger.i(TAG, "Cannot find the FoCI token cache item for this userID", ""); return null; } final SSOStateContainer blobContainer = new SSOStateContainer(tokenItem); Logger.i(TAG, "prepare to serialize",""); return blobContainer.serialize(); }</code><technical_language>nit: I this. in this code. Is this new pattern</technical_language>

Target:
String serialize(final String uniqueUserId) throws AuthenticationException { if (StringExtensions.IsNullOrBlank(uniqueUserId)) { throw new IllegalArgumentException("uniqueUserId"); } if (mBrokerProxy.canSwitchToBroker()) { throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "Failed to export the family refresh token cache item because broker is enabled."); } final String cacheKey = CacheKey.createCacheKeyForFRT(this.getAuthority(), AuthenticationConstants.MS_FAMILY_ID, uniqueUserId); final TokenCacheItem tokenItem = this.getCache().getItem(cacheKey); if (tokenItem == null) { Logger.i(TAG, "Cannot find the family token cache item for this userID", ""); throw new UsageAuthenticationException(ADALError.FAIL_TO_EXPORT, "Failed to export the FID because no family token cache item is found."); } if (!StringExtensions.IsNullOrBlank(tokenItem.getFamilyClientId())) { return SSOStateSerializer.serialize(tokenItem); } else { throw new IllegalArgumentException("tokenItem does not contain family refresh token"); } }
Source:
<code>public synchronized void dispose() { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); launchManager.removeLaunchConfigurationListener(this); launchManager.removeLaunchListener(this); for (ISourceLookupParticipant participant : fParticipants) { if(participant != this) { participant.dispose(); } } fParticipants.clear(); if (fSourceContainers != null) { for (ISourceContainer <START> fSourceContainer : <END> fSourceContainers) { fSourceContainer.dispose(); } } fSourceContainers = null; fResolvedElements = null; }</code><technical_language>rename container sourceContainer</technical_language>

Target:
public synchronized void dispose() { ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager(); launchManager.removeLaunchConfigurationListener(this); launchManager.removeLaunchListener(this); for (ISourceLookupParticipant participant : fParticipants) { if(participant != this) { participant.dispose(); } } fParticipants.clear(); if (fSourceContainers != null) { for (ISourceContainer container : fSourceContainers) { container.dispose(); } } fSourceContainers = null; fResolvedElements = null; }
Source:
<code>public void execute(final TSDB tsdb, final HttpQuery query) { if (!query.hasQueryStringParam("json") && !query.hasQueryStringParam("png") && !query.hasQueryStringParam("ascii")) { String uri = query.request().getUri(); if (uri.length() < 4) { uri = "/"; } else { <START> uri = "/#" + uri.substring(2); END> } query.redirect(uri); return; } try { doGraph(tsdb, query); } catch (IOException e) { query.internalError(e); } catch (IllegalArgumentException e) { query.badRequest(e.getMessage()); } }</code><technical_language>This work, instead of removing /q? removes /q leaves ? behind. I guess need lines of uri = uri.replaceFirst("q\?", "#") of effect</technical_language>

Target:
public void execute(final TSDB tsdb, final HttpQuery query) { if (!query.hasQueryStringParam("json") && !query.hasQueryStringParam("png") && !query.hasQueryStringParam("ascii")) { String uri = query.request().getUri(); if (uri.length() < 4) { uri = "/"; } else { uri = "/#" + uri.substring(3); } query.redirect(uri); return; } try { doGraph(tsdb, query); } catch (IOException e) { query.internalError(e); } catch (IllegalArgumentException e) { query.badRequest(e.getMessage()); } }
Source:
<code>private void offLine(final int status, Object device) { String err = Errors.getErrorMessage(status); <START> this.logger.warn("Warning: " + status + (err == null ? " " : err)); <END> if (UDClientStatus.isBusy()) { return; } if (status == 1050) { this.socket_open_failed_count++; } if (this.socket_open_failed_count < 3) { return; } this.socket_open_failed_count = 0; if (device == null) { device = UDControlPoint.firstDevice; } if (device != null && device instanceof UDProxyDevice) { UDControlPoint.getInstance().offLine((UDProxyDevice) device); } }</code><technical_language>Need parameterized logging instead of string concatenation</technical_language>

Target:
private void offLine(final int status, Object device) { String err = Errors.getErrorMessage(status); this.logger.warn("Warning: {}", status, (err == null ? " " : err)); if (UDClientStatus.isBusy()) { return; } if (status == 1050) { this.socket_open_failed_count++; } if (this.socket_open_failed_count < 3) { return; } this.socket_open_failed_count = 0; if (device == null) { device = UDControlPoint.firstDevice; } if (device != null && device instanceof UDProxyDevice) { UDControlPoint.getInstance().offLine((UDProxyDevice) device); } }
Source:
<code><START> public static <T> void persistToKnoxShell(String fileName, Map<String, List<T>> map) { String s = JsonUtils.renderAsJsonString(map); String home = System.getProperty("user.home"); try { FileUtils.write(new File( home + File.separator + ".knoxshell" + File.separator + fileName), s, StandardCharsets.UTF_8); } catch (IOException e) { e.printStackTrace(); } } <END></code><technical_language>read/write methods for histories scare a bit. multiple knoxshells reading/writing once? lock file Java NIO methods? methods synchronized prevent multiple usage JVM. Is directory ".knoxshell" assumed exist already? This applies reading well</technical_language>

Target:
public static <T> void persistToKnoxShell(String fileName, Map<String, List<T>> map) { String s = JsonUtils.renderAsJsonString(map); String home = System.getProperty("user.home"); try { write(new File( home + File.separator + ".knoxshell" + File.separator + fileName), s, StandardCharsets.UTF_8); } catch (IOException e) { e.printStackTrace(); } }
Source:
<code>public void init(String name, Class<? extends ITmfEvent> type) { super.init(name); fType = type; fDataQueue = (fQueueSize > 1) ? new LinkedBlockingQueue<ITmfEvent>(fQueueSize) : new SynchronousQueue<ITmfEvent>(); fExecutor.init(); fSignalDepth = 0; synchronized (fLock) { <START> fTimer = new Timer(); <END> } TmfProviderManager.register(fType, this); }</code><technical_language>of constructors calls init() directly, this create a thread construction. is called "fake traces"? I safer lazy-init done in previous version. getTimer() dispose() synchronized (so synchronizes "this"), do fLock</technical_language>

Target:
public void init(String name, Class<? extends ITmfEvent> type) { super.init(name); fType = type; fExecutor.init(); fSignalDepth = 0; synchronized (fLock) { fTimer = new Timer(); } TmfProviderManager.register(fType, this); }
Source:
<code>private CardDetailsEntity buildCardDetailsEntity(AuthCardDetails authCardDetails) { CardDetailsEntity detailsEntity = new CardDetailsEntity(); detailsEntity.setCardBrand(sanitize(authCardDetails.getCardBrand())); detailsEntity.setCardHolderName(sanitize(authCardDetails.getCardHolder())); detailsEntity.setExpiryDate(authCardDetails.getEndDate()); <START> if (authCardDetails.getCardNo().length() > 6) { <END> detailsEntity.setFirstDigitsCardNumber(FirstDigitsCardNumber.of(StringUtils.left(authCardDetails.getCardNo(), 6))); } detailsEntity.setLastDigitsCardNumber(LastDigitsCardNumber.of(StringUtils.right(authCardDetails.getCardNo(), 4))); if (authCardDetails.getAddress().isPresent()) detailsEntity.setBillingAddress(new AddressEntity(authCardDetails.getAddress().get())); return detailsEntity; }</code><technical_language>I assume for Apple Pay this is digits (because a full card number, digits) I fully understand on. explain please</technical_language>

Target:
private CardDetailsEntity buildCardDetailsEntity(AuthCardDetails authCardDetails) { CardDetailsEntity detailsEntity = new CardDetailsEntity(); detailsEntity.setCardBrand(sanitize(authCardDetails.getCardBrand())); detailsEntity.setCardHolderName(sanitize(authCardDetails.getCardHolder())); detailsEntity.setExpiryDate(authCardDetails.getEndDate()); if (hasFullCardNumber(authCardDetails)) { detailsEntity.setFirstDigitsCardNumber(FirstDigitsCardNumber.of(StringUtils.left(authCardDetails.getCardNo(), 6))); } detailsEntity.setLastDigitsCardNumber(LastDigitsCardNumber.of(StringUtils.right(authCardDetails.getCardNo(), 4))); if (authCardDetails.getAddress().isPresent()) detailsEntity.setBillingAddress(new AddressEntity(authCardDetails.getAddress().get())); return detailsEntity; }
Source:
<code>public Observable<Visit> getVisitByID(final Long visitID) { return makeObservable(visitTable.getVisitById(visitID)) <START> .subscribeOn(Schedulers.computation()); <END> }</code><technical_language>makeObservable call subscribeOn returning do repeat everywhere</technical_language>

Target:
public Observable<Visit> getVisitByID(final Long visitID) { return createObservableIO(() -> { DBOpenHelper helper = OpenMRSDBOpenHelper.getInstance().getDBOpenHelper(); Visit visit = null; String where = String.format("%s = ?", VisitTable.Column.ID); String[] whereArgs = new String[]{visitID.toString()}; String orderBy = VisitTable.Column.START_DATE + " DESC"; final Cursor cursor = helper.getReadableDatabase().query(VisitTable.TABLE_NAME, null, where, whereArgs, null, null, orderBy); if (null != cursor) { try { if (cursor.moveToFirst()) { int visitUUID_CI = cursor.getColumnIndex(VisitTable.Column.UUID); int visitID_CI = cursor.getColumnIndex(VisitTable.Column.ID); int visitType_CI = cursor.getColumnIndex(VisitTable.Column.VISIT_TYPE); int visitPlace_CI = cursor.getColumnIndex(VisitTable.Column.VISIT_PLACE); int visitStart_CI = cursor.getColumnIndex(VisitTable.Column.START_DATE); int visitStop_CI = cursor.getColumnIndex(VisitTable.Column.STOP_DATE); int visitPatientID_CI = cursor.getColumnIndex(VisitTable.Column.PATIENT_KEY_ID); visit = new Visit(); visit.setUuid(cursor.getString(visitUUID_CI)); visit.setId(cursor.getLong(visitID_CI)); visit.setVisitType(new VisitType(cursor.getString(visitType_CI))); visit.setLocation(LocationDAO.findLocationByName(cursor.getString(visitPlace_CI))); visit.setStartDatetime(cursor.getString(visitStart_CI)); visit.setStopDatetime(cursor.getString(visitStop_CI)); visit.setEncounters(new EncounterDAO().findEncountersByVisitID(visitID)); visit.setPatient(new PatientDAO().findPatientByID(String.valueOf(cursor.getLong(visitPatientID_CI)))); } } finally { cursor.close(); } } return visit; }); }
Source:
<code>public void listPatchesAgainstBase() throws Exception { add(git, FILE_D, "4"); createCommit(git, admin.getIdent(), SUBJECT_1); pushHead(git, "refs/heads/master", false); add(git, FILE_A, "1"); rm(git, FILE_D); Commit c = createCommit(git, admin.getIdent(), SUBJECT_2); pushHead(git, "refs/for/master", false); List<PatchListEntry> entries = getCurrentPatches(c.getChangeId()); <START> assertThat(3).isEqualTo(entries.size()); <END> assertAdded(Patch.COMMIT_MSG, entries.get(0)); assertAdded(FILE_A, entries.get(1)); assertDeleted(FILE_D, entries.get(2)); add(git, FILE_B, "2"); c = amendCommit(git, admin.getIdent(), SUBJECT_2, c.getChangeId()); pushHead(git, "refs/for/master", false); entries = getCurrentPatches(c.getChangeId()); assertThat(4).isEqualTo(entries.size()); assertAdded(Patch.COMMIT_MSG, entries.get(0)); assertAdded(FILE_A, entries.get(1)); assertAdded(FILE_B, entries.get(2)); assertDeleted(FILE_D, entries.get(3)); }</code><technical_language>changing unrelated change. 'assertThat(entries).hasSize(3)' is better</technical_language>

Target:
public void listPatchesAgainstBase() throws Exception { add(git, FILE_D, "4"); createCommit(git, admin.getIdent(), SUBJECT_1); pushHead(git, "refs/heads/master", false); add(git, FILE_A, "1"); rm(git, FILE_D); Commit c = createCommit(git, admin.getIdent(), SUBJECT_2); pushHead(git, "refs/for/master", false); List<PatchListEntry> entries = getCurrentPatches(c.getChangeId()); assertThat(entries).hasSize(3); assertAdded(Patch.COMMIT_MSG, entries.get(0)); assertAdded(FILE_A, entries.get(1)); assertDeleted(FILE_D, entries.get(2)); add(git, FILE_B, "2"); c = amendCommit(git, admin.getIdent(), SUBJECT_2, c.getChangeId()); pushHead(git, "refs/for/master", false); entries = getCurrentPatches(c.getChangeId()); assertThat(entries).hasSize(4); assertAdded(Patch.COMMIT_MSG, entries.get(0)); assertAdded(FILE_A, entries.get(1)); assertAdded(FILE_B, entries.get(2)); assertDeleted(FILE_D, entries.get(3)); }
Source:
<code>public String toString() { StringBuffer bufStr = new StringBuffer(); if (cacheBuffers != null) { for (MemoryBuffer mb : cacheBuffers) { <START> bufStr.append(mb.getClass().getSimpleName() + " with " + mb.getByteBufferRaw().remaining() + " bytes, "); <END> } } return "ColumnStreamData [cacheBuffers=[" + bufStr.toString() + "], indexBaseOffset=" + indexBaseOffset + "]"; }</code><technical_language>I a bit more this. "+" concatenation. .append() I proposed addressed this issue (HIVE-23540), happy defer this PR <LINK_0></technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); if (cacheBuffers != null) { Iterator<MemoryBuffer> iter = cacheBuffers.iterator(); while (iter.hasNext()) { MemoryBuffer mb = iter.next(); sb.append(mb.getClass().getSimpleName()); sb.append(" with "); sb.append(mb.getByteBufferRaw().remaining()); sb.append(" bytes"); if (iter.hasNext()) { sb.append(", "); } } } return "ColumnStreamData [cacheBuffers=[" + sb.toString() + "], indexBaseOffset=" + indexBaseOffset + "]"; }
Source:
<code>public Cost getCost() throws SQLException { Long byteCount = getEstimatedBytesToScan(); if (byteCount == null) { return Cost.ZERO; } <START> int parallelLevel = 1; <END> Cost cost = CostUtil.estimateAggregateCost(byteCount, !groupBy.isUngroupedAggregate(), clientAggregators.getEstimatedByteSize(), parallelLevel); if (!orderBy.getOrderByExpressions().isEmpty()) { double outputBytes = CostUtil.estimateAggregateOutputBytes( byteCount, !groupBy.isUngroupedAggregate(), clientAggregators.getEstimatedByteSize()); Cost orderByCost = CostUtil.estimateOrderByCost(outputBytes, parallelLevel); cost = cost.plus(orderByCost); } return super.getCost().plus(cost); }</code><technical_language>parallelLevel is 1 aggregation is done client-side instead of pushed cluster, right? good doc thinking calculating cost throughout</technical_language>

Target:
public Cost getCost() { Long byteCount = null; try { byteCount = getEstimatedBytesToScan(); } catch (SQLException e) { } if (byteCount == null) { return Cost.UNKNOWN; } int parallelLevel = CostUtil.estimateParallelLevel( false, context.getConnection().getQueryServices()); Cost cost = CostUtil.estimateAggregateCost(byteCount, groupBy, clientAggregators.getEstimatedByteSize(), parallelLevel); if (!orderBy.getOrderByExpressions().isEmpty()) { double outputBytes = CostUtil.estimateAggregateOutputBytes( byteCount, groupBy, clientAggregators.getEstimatedByteSize()); Cost orderByCost = CostUtil.estimateOrderByCost(outputBytes, parallelLevel); cost = cost.plus(orderByCost); } return super.getCost().plus(cost); }
Source:
<code>public ConnectorAccessControl getConnectorAccessControl(FileBasedAccessControlConfig config) throws IOException { if (config.getRefreshPeriod() != null) { return refreshingConnectorAccessControl( () -> { <START> log.info("Refreshing access control, because '%s' was modified", config.getConfigFile()); <END> try { return new FileBasedAccessControl(config); } catch (IOException e) { throw new UncheckedIOException(e); } }, wasFileModified(Paths.get(config.getConfigFile())), config.getRefreshPeriod()); } return new FileBasedAccessControl(config); }</code><technical_language>add connector message. Include catalog name</technical_language>

Target:
public ConnectorAccessControl getConnectorAccessControl(FileBasedAccessControlConfig config) { if (config.getRefreshPeriod() != null) { return ForwardingConnectorAccessControl.of(memoizeWithExpiration( () -> { log.info("Refreshing system access control from %s", config.getConfigFile()); return new FileBasedAccessControl(config); }, config.getRefreshPeriod().toMillis(), MILLISECONDS)); } return new FileBasedAccessControl(config); }
Source:
<code><START> public @Nonnull String getAccessToken() { <END> return accessToken.getPlainText(); }</code><technical_language>this returning a String? I desirable for return hudson.util.Secret internal type. @stephenc thoughts</technical_language>

Target:
public @Nonnull Secret getAccessToken() { return accessToken; }
Source:
<code>public synchronized AdHocPlannedStatement planSqlCalcite(SqlTask task) throws ValidationException, RelConversionException, PlannerFallbackException { <START> CacheUse cacheUse = CacheUse.FAIL; <END> SqlNode node = task.getParsedQuery(); SqlNode node0 = node.clone(node.getParserPosition()); if (m_plannerStats != null) { m_plannerStats.startStatsCollection(); } try { AdHocPlannedStatement cachedPlan = m_calciteCache.getWithSQL(task.getSQL()); if (cachedPlan != null) { cacheUse = CacheUse.HIT1; return cachedPlan; } else { cacheUse = CacheUse.MISS; } AdHocPlannedStatement ahps = null; ParameterizedSqlTask ptask = new ParameterizedSqlTask(task); String parameterizedQuery = ptask.getParsedQuery().toString(); final CorePlan corePlan = m_calciteCache.getWithParsedQuery(parameterizedQuery); if (corePlan != null) { ahps = new AdHocPlannedStatement(ptask.getSQL().getBytes(Constants.UTF8ENCODING), corePlan, ParameterSet.fromArrayNoCopy(generateVoltParams(ptask)), null); } else { CompiledPlan plan = getCompiledPlanCalcite(m_schemaPlus, node); plan.sql = task.getSQL(); CorePlan core = new CorePlan(plan, m_catalogHash); ahps = new AdHocPlannedStatement(plan.sql.getBytes(Constants.UTF8ENCODING), core, ParameterSet.fromArrayNoCopy(generateVoltParams(ptask)), null); } throw new PlannerFallbackException(); } finally { if (m_plannerStats != null) { m_plannerStats.endStatsCollection(m_calciteCache.getLiteralCacheSize(), m_calciteCache.getCoreCacheSize(), cacheUse, -1); } } }</code><technical_language>Move a separate function</technical_language>

Target:
public synchronized AdHocPlannedStatement planSqlCalcite(SqlTask task) throws ValidationException, RelConversionException, PlannerFallbackException { CacheUse cacheUse = CacheUse.FAIL; SqlNode node = task.getParsedQuery(); if (m_plannerStats != null) { m_plannerStats.startStatsCollection(); } try { AdHocPlannedStatement cachedPlan = m_calciteCache.getWithSQL(task.getSQL()); if (cachedPlan != null) { cacheUse = CacheUse.CHIT1; throw new PlannerFallbackException(); } else { cacheUse = CacheUse.CMISS; } VoltPlanner planner = new VoltPlanner(m_schemaPlus); AdHocPlannedStatement ahps = null; ParameterizedSqlTask ptask = new ParameterizedSqlTask(task); String parameterizedQuery = ptask.getParsedQuery().toString(); final CorePlan corePlan = m_calciteCache.getWithParsedQuery(parameterizedQuery); if (corePlan != null) { ahps = new AdHocPlannedStatement(ptask.getSQL().getBytes(Constants.UTF8ENCODING), corePlan, ParameterSet.fromArrayNoCopy(generateVoltParams(ptask)), null); cacheUse = CacheUse.CHIT2; } else { planner.validate(node); CompiledPlan plan = getCompiledPlanCalcite(planner, m_schemaPlus, node); plan.sql = task.getSQL(); CorePlan core = new CorePlan(plan, m_catalogHash); ahps = new AdHocPlannedStatement(plan.sql.getBytes(Constants.UTF8ENCODING), core, ParameterSet.fromArrayNoCopy(generateVoltParams(ptask)), null); m_calciteCache.put(task.getSQL(), parameterizedQuery, ahps, null, false, false); } throw new PlannerFallbackException(); } finally { if (m_plannerStats != null) { m_plannerStats.endStatsCollection(m_calciteCache.getLiteralCacheSize(), m_calciteCache.getCoreCacheSize(), cacheUse, -1); } } }
Source:
<code>private static IConfiguration helper_getActiveConfiguration(IProject project) { IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project); <START> IConfiguration ActiveConf = buildInfo.getDefaultConfiguration(); <END> return ActiveConf; }</code><technical_language>Please stick java convention for naming variables - letter case. this is another case local variable is needed return directly</technical_language>

Target:
private static IConfiguration helper_getActiveConfiguration(IProject project) { IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project); return buildInfo.getDefaultConfiguration(); }