auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public ProcessStatusPage() { ProcessStatusProvider provider = new ProcessStatusProvider(); table = new GeoServerTablePanel<ExecutionStatus>("table", provider, true) { @Override protected Component getComponentForProperty( String id, IModel<ExecutionStatus> itemModel, Property<ExecutionStatus> property) { Object value = property.getPropertyValue(itemModel.getObject()); if (value instanceof Date) { <START> SimpleDateFormat gmtFrmt = <END> new SimpleDateFormat( "E, d MMM yyyy HH:mm:ss.SSS 'GMT'", Session.get().getLocale()); return DateLabel.forDatePattern( id, Model.of((Date) value), gmtFrmt.toPattern()); } return null; } @Override protected void onSelectionUpdate(AjaxRequestTarget target) { dismissSelected.setEnabled(table.getSelection().size() > 0); target.add(dismissSelected); } }; table.setOutputMarkupId(true); table.setSelectable(true); add(table); add(dialog = new GeoServerDialog("dialog")); setHeaderPanel(headerPanel()); }</code><technical_language>here, 'GMT' in format is a static string, if want output follow GMT SimpleDateFormat desired timezone calling gmtFrmt.setTimeZone(TimeZone.getTimeZone("GMT")</technical_language>

Target:
public ProcessStatusPage() { ProcessStatusProvider provider = new ProcessStatusProvider(); table = new GeoServerTablePanel<ExecutionStatus>("table", provider, true) { @Override protected Component getComponentForProperty( String id, IModel<ExecutionStatus> itemModel, Property<ExecutionStatus> property) { Object value = property.getPropertyValue(itemModel.getObject()); if (value instanceof Date) { SimpleDateFormat gmtFrmt = new SimpleDateFormat( "E, d MMM yyyy HH:mm:ss.SSS 'GMT'", Session.get().getLocale()); gmtFrmt.setTimeZone(TimeZone.getTimeZone("GMT")); return new Label(id, gmtFrmt.format((Date) value)); } return null; } @Override protected void onSelectionUpdate(AjaxRequestTarget target) { dismissSelected.setEnabled(table.getSelection().size() > 0); target.add(dismissSelected); } }; table.setOutputMarkupId(true); table.setSelectable(true); add(table); add(dialog = new GeoServerDialog("dialog")); setHeaderPanel(headerPanel()); }
Source:
<code><START> public WebSocketClientHandshaker08(URI webSocketURL, WebSocketVersion version, String subprotocol, <END> boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, String httpRequestEncoderName, String httpResponseDecoderName) { super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis, absoluteUpgradeUrl, httpRequestEncoderName, httpResponseDecoderName); this.allowExtensions = allowExtensions; this.performMasking = performMasking; this.allowMaskMismatch = allowMaskMismatch; }</code><technical_language>this package-private for</technical_language>

Target:
WebSocketClientHandshaker08(URI webSocketURL, WebSocketVersion version, String subprotocol, boolean allowExtensions, HttpHeaders customHeaders, int maxFramePayloadLength, boolean performMasking, boolean allowMaskMismatch, long forceCloseTimeoutMillis, boolean absoluteUpgradeUrl, String httpRequestEncoderName, String httpResponseDecoderName) { super(webSocketURL, version, subprotocol, customHeaders, maxFramePayloadLength, forceCloseTimeoutMillis, absoluteUpgradeUrl, httpRequestEncoderName, httpResponseDecoderName); this.allowExtensions = allowExtensions; this.performMasking = performMasking; this.allowMaskMismatch = allowMaskMismatch; }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; case R.id.action_remove_all_history: new MaterialDialog.Builder(this) .title(R.string.title_clear_history_dialog) .content(R.string.text_clear_history_dialog) .onPositive((dialog, which) -> { mHistoryProductDao.deleteAll(); <START> ; <END> productItems.clear(); recyclerHistoryScanView.getAdapter().notifyDataSetChanged(); }) .positiveText(R.string.txtYes) .negativeText(R.string.txtNo) .show(); return true; case R.id.action_export_all_history: if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) { new MaterialDialog.Builder(this) .title(R.string.action_about) .content(R.string.permision_write_external_storage) .neutralText(R.string.txtOk) .show(); } else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Utils.MY_PERMISSIONS_REQUEST_STORAGE); } } else { exportCSV(); } return true; default: return super.onOptionsItemSelected(item); } }</code><technical_language>remove duplicate ';'</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: NavUtils.navigateUpFromSameTask(this); return true; case R.id.action_remove_all_history: new MaterialDialog.Builder(this) .title(R.string.title_clear_history_dialog) .content(R.string.text_clear_history_dialog) .onPositive((dialog, which) -> { mHistoryProductDao.deleteAll(); productItems.clear(); recyclerHistoryScanView.getAdapter().notifyDataSetChanged(); }) .positiveText(R.string.txtYes) .negativeText(R.string.txtNo) .show(); return true; case R.id.action_export_all_history: if (ContextCompat.checkSelfPermission(this, Manifest.permission.WRITE_EXTERNAL_STORAGE) != PackageManager.PERMISSION_GRANTED) { if (ActivityCompat.shouldShowRequestPermissionRationale(this, Manifest.permission.WRITE_EXTERNAL_STORAGE)) { new MaterialDialog.Builder(this) .title(R.string.action_about) .content(R.string.permision_write_external_storage) .neutralText(R.string.txtOk) .show(); } else { ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, Utils.MY_PERMISSIONS_REQUEST_STORAGE); } } else { exportCSV(); } return true; default: return super.onOptionsItemSelected(item); } }
Source:
<code>public static void fail( @SqlType(StandardTypes.INTEGER) long errorCode, @SqlType(StandardTypes.VARCHAR) Slice message) { for (StandardErrorCode standardErrorCode : StandardErrorCode.values()) { if (standardErrorCode.toErrorCode().getCode() == errorCode) { throw new PrestoException(standardErrorCode, message.toStringUtf8()); } } <START> throw new PrestoException(StandardErrorCode.GENERIC_USER_ERROR, "Unable to find error for code: " + errorCode); <END> }</code><technical_language>Internal presto error (e.g: invalid error code) is mixed intentional query error. a dedicated failure method for subquery? do think</technical_language>

Target:
public static void fail( @SqlType(StandardTypes.INTEGER) long errorCode, @SqlType(StandardTypes.VARCHAR) Slice message) { for (StandardErrorCode standardErrorCode : StandardErrorCode.values()) { if (standardErrorCode.toErrorCode().getCode() == errorCode) { throw new PrestoException(standardErrorCode, message.toStringUtf8()); } } throw new PrestoException(StandardErrorCode.GENERIC_INTERNAL_ERROR, "Unable to find error for code: " + errorCode); }
Source:
<code>public void statusUpdateReceived(EventObject event, String iporSerialPort, String data) { DeviceConfig deviceConfig = findDevice(iporSerialPort); if (deviceConfig != null) { logger.debug("Received status update '{}' from device {}", data, (deviceConfig.serialPortName != null) ? deviceConfig.serialPortName : deviceConfig.host); for (OnkyoBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { HashMap<String, String> values = provider.getDeviceCommands(itemName); for (String cmd : values.keySet()) { String[] commandParts = values.get(cmd).split(":"); String deviceName = commandParts[0]; String deviceCmd = commandParts[1]; boolean match = false; if (!deviceConfig.deviceId.equals(deviceName)) { continue; } if (deviceCmd.startsWith(ADVANCED_COMMAND_KEY)) { if (data.startsWith(deviceCmd.substring(1, 4))) { match = true; } } else { try { String eiscpCmd = EiscpCommand.valueOf(deviceCmd).getCommand(); if (data.startsWith(eiscpCmd.substring(0, 3))) { match = true; } } catch (Exception e) { <START> logger.error("Unregonized command '" + deviceCmd + "'", e); <END> } } if (match) { Class<? extends Item> itemType = provider.getItemType(itemName); State v = convertDeviceValueToOpenHabState(itemType, data); eventPublisher.postUpdate(itemName, v); break; } } } } } }</code><technical_language>"Unrecognized" is correct. Please undo. Also, parameterized logging instead of string concatenation</technical_language>

Target:
public void statusUpdateReceived(EventObject event, String iporSerialPort, String data) { DeviceConfig deviceConfig = findDevice(iporSerialPort); if (deviceConfig != null) { logger.debug("Received status update '{}' from device {}", data, (deviceConfig.serialPortName != null) ? deviceConfig.serialPortName : deviceConfig.host); for (OnkyoBindingProvider provider : providers) { for (String itemName : provider.getItemNames()) { HashMap<String, String> values = provider.getDeviceCommands(itemName); for (String cmd : values.keySet()) { String[] commandParts = values.get(cmd).split(":"); String deviceId = commandParts[0]; String deviceCmd = commandParts[1]; if (!deviceConfig.deviceId.equals(deviceId)) { continue; } boolean match = false; if (deviceCmd.startsWith(ADVANCED_COMMAND_KEY)) { if (data.startsWith(deviceCmd.substring(1))) { match = true; } } else { try { String eiscpCmd = EiscpCommand.valueOf(deviceCmd).getCommand(); if (data.startsWith(eiscpCmd.substring(0, 3))) { match = true; } } catch (Exception e) { logger.error("Unrecognized command ", e); } } if (match) { Class<? extends Item> itemType = provider.getItemType(itemName); State v = convertDeviceValueToOpenHabState(itemType, data); eventPublisher.postUpdate(itemName, v); break; } } } } } }
Source:
<code>public void tearDown(){ <START> account.deleteDB("lightcouch-db-test"; <END> account.shutdown(); }</code><technical_language>Missing )</technical_language>

Target:
public void tearDown(){ account.deleteDB("lightcouch-db-test"); account.shutdown(); }
Source:
<code>private void createContextMenu() { final MenuManager contextMenu = new MenuManager(); contextMenu.add(new GroupMarker(GROUP_REORGANIZE)); contextMenu.add(getSortByNameAction()); contextMenu.add(getSortByIdAction()); contextMenu.add(getSortByTimeAction()); contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); TreeViewer treeViewer = getTimeGraphCombo().getTreeViewer(); Tree tree = treeViewer.getTree(); Menu menu = contextMenu.createContextMenu(tree); tree.setMenu(menu); <START> getSite().registerContextMenu(ID_CONTEXT_TREE, contextMenu, <END> treeViewer); }</code><technical_language>I register default (part it). generalizing this change AbstractTimeGraphView level soon, if default id want break extensions add Call Stack view context menu</technical_language>

Target:
private void createContextMenu() { final MenuManager contextMenu = new MenuManager(); contextMenu.add(new GroupMarker(IWorkbenchActionConstants.GROUP_REORGANIZE)); contextMenu.add(getSortByNameAction()); contextMenu.add(getSortByIdAction()); contextMenu.add(getSortByTimeAction()); contextMenu.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS)); TreeViewer treeViewer = getTimeGraphCombo().getTreeViewer(); Tree tree = treeViewer.getTree(); Menu menu = contextMenu.createContextMenu(tree); tree.setMenu(menu); getSite().registerContextMenu(contextMenu, treeViewer); }
Source:
<code>public void shutdown() { try { myScheduler.shutdown(true); } catch (SchedulerException e) { <START> ourLog.error("Failed to shut down scheduler"); <END> throw new ConfigurationException("Failed to shut down scheduler", e); } }</code><technical_language>log exception</technical_language>

Target:
public void shutdown() { if (myScheduler == null) { return; } try { myScheduler.shutdown(true); } catch (SchedulerException e) { ourLog.error("Failed to shut down scheduler", e); throw new ConfigurationException("Failed to shut down scheduler", e); } }
Source:
<code>public Response settingsScopesScopeGet(String username, String scopeName, MessageContext messageContext) { String[] userRoles; ScopeSettingsDTO scopeSettingsDTO = new ScopeSettingsDTO(); ErrorDTO errorDTO = new ErrorDTO(); try { if (APIUtil.isUserExist(username) && APIUtil.getRESTAPIScopesForTenant(MultitenantUtils .getTenantDomain(username)).containsKey(scopeName)) { userRoles = APIUtil.getListOfRoles(username); SettingsMappingUtil settingsMappingUtil = new SettingsMappingUtil(); if (settingsMappingUtil.GetRoleScopeList(userRoles, username).contains(scopeName)) { scopeSettingsDTO.setName(scopeName); } } else { errorDTO.setCode(404l); errorDTO.description("Username or Scope does not exist"); errorDTO.setMessage("Not Found"); return Response.ok().entity(errorDTO).build(); } } catch (APIManagementException e) { <START> String errorMessage = "Error when getting the list of scopes"; <END> RestApiUtil.handleInternalServerError(errorMessage, e, log); } return Response.ok().entity(scopeSettingsDTO).build(); }</code><technical_language>add username in log</technical_language>

Target:
public Response settingsScopesScopeGet(String username, String scopeName, MessageContext messageContext) { String[] userRoles; ScopeSettingsDTO scopeSettingsDTO = new ScopeSettingsDTO(); ErrorDTO errorDTO = new ErrorDTO(); Map<String, String> scopeRoleMapping = APIUtil.getRESTAPIScopesForTenant(MultitenantUtils .getTenantDomain(username)); try { if (APIUtil.isUserExist(username) && scopeRoleMapping.containsKey(scopeName)) { userRoles = APIUtil.getListOfRoles(username); SettingsMappingUtil settingsMappingUtil = new SettingsMappingUtil(); if (settingsMappingUtil.GetRoleScopeList(userRoles, scopeRoleMapping).contains(scopeName)) { scopeSettingsDTO.setName(scopeName); } } else { errorDTO.setCode(404l); errorDTO.description("Username or Scope does not exist. Username: " + username + ", " + "Scope: " + scopeName); errorDTO.setMessage("Not Found"); return Response.ok().entity(errorDTO).build(); } } catch (APIManagementException e) { String errorMessage = "Error when getting the list of scopes. Username: " + username + " , " + "Scope: " + scopeName; RestApiUtil.handleInternalServerError(errorMessage, e, log); } return Response.ok().entity(scopeSettingsDTO).build(); }
Source:
<code><START> public void setSystemProperty(CoreSession session, List<String> ids, boolean value) { <END> List<DocumentRef> updatedRefs = new ArrayList<>(ids.size()); String query = String.format(SYSPROP_QUERY_TEMPLATE, value ? "0" : "1", String.join("', '", ids)); try (IterableQueryResult res = session.queryAndFetch(query, NXQL.NXQL)) { for (Map<String, Serializable> map : res) { DocumentRef ref = new IdRef((String) map.get(ECM_UUID)); try { session.setDocumentSystemProp(ref, "isTrashed", value); updatedRefs.add(ref); } catch (NuxeoException e) { log.warn("Cannot set system property: isTrashed on: " + ref.toString(), e); } } } try { session.save(); if (!updatedRefs.isEmpty()) { fireEvent(session, value ? DOCUMENT_TRASHED : DOCUMENT_UNTRASHED, updatedRefs); } } catch (PropertyException e) { log.warn("Cannot save session", e); } }</code><technical_language>change public method signature this break compatibility a customer code compile in a case passed param is a null value. if a client code call this method a null param compile fail NPE line 119 this behaviour</technical_language>

Target:
public void setSystemProperty(CoreSession session, List<String> ids, boolean value) { List<DocumentRef> updatedRefs = new ArrayList<>(ids.size()); String query = String.format(SYSPROP_QUERY_TEMPLATE, value ? "0" : "1", String.join("', '", ids)); try (IterableQueryResult res = session.queryAndFetch(query, NXQL.NXQL)) { TrashService trashService = Framework.getService(TrashService.class); for (Map<String, Serializable> map : res) { DocumentRef ref = new IdRef((String) map.get(ECM_UUID)); try { String docName = (String) map.get(ECM_NAME); if (value || !trashService.isMangledName(docName)) { session.setDocumentSystemProp(ref, "isTrashed", value); updatedRefs.add(ref); } } catch (NuxeoException e) { log.warn("Cannot set system property: isTrashed on: " + ref.toString(), e); } } } try { session.save(); if (!updatedRefs.isEmpty()) { fireEvent(session, value ? DOCUMENT_TRASHED : DOCUMENT_UNTRASHED, updatedRefs); } } catch (PropertyException e) { log.warn("Cannot save session", e); } }
Source:
<code>private boolean updateVms() { for (VmStatic vm : vmsLockedForUpdate) { VmManagementParametersBase updateParams = new VmManagementParametersBase(vm); updateParams.setLockProperties(LockProperties.create(LockProperties.Scope.None)); updateParams.setClusterLevelChangeFromVersion(oldCluster.getCompatibilityVersion()); upgradeGraphicsDevices(vm, updateParams); updateRngDeviceIfNecessary(vm.getId(), vm.getCustomCompatibilityVersion(), updateParams); VdcReturnValueBase result = runInternalAction( VdcActionType.UpdateVm, updateParams, cloneContextAndDetachFromParent()); <START> if (!result.getSucceeded()) { <END> addCustomValue("VmName", vm.getName()); addCustomValue("Message", "todo"); auditLogDirector.log(this, AuditLogType.CLUSTER_CANNOT_UPDATE_VM_COMPATIBILITY_VERSION); vm.setCustomCompatibilityVersion(oldCluster.getCompatibilityVersion()); vmStaticDao.update(vm); } } return true; }</code><technical_language>need remember list of VM names failed updated return a good message FE present user a good explanation do (e.g. edit VM dialog save potentially follow validation errors)</technical_language>

Target:
private boolean updateVms() { for (VmStatic vm : vmsLockedForUpdate) { VmManagementParametersBase updateParams = new VmManagementParametersBase(vm); updateParams.setLockProperties(LockProperties.create(LockProperties.Scope.None)); updateParams.setClusterLevelChangeFromVersion(oldCluster.getCompatibilityVersion()); upgradeGraphicsDevices(vm, updateParams); updateRngDeviceIfNecessary(vm.getId(), vm.getCustomCompatibilityVersion(), updateParams); VdcReturnValueBase result = runInternalAction( VdcActionType.UpdateVm, updateParams, cloneContextAndDetachFromParent()); if (!result.getSucceeded()) { failedUpgradeNames.add(vm.getName()); addCustomValue("VmName", vm.getName()); addCustomValue("Message", parseErrorMessage(result.getValidationMessages())); auditLogDirector.log(this, AuditLogType.CLUSTER_CANNOT_UPDATE_VM_COMPATIBILITY_VERSION); vm.setCustomCompatibilityVersion(oldCluster.getCompatibilityVersion()); vmStaticDao.update(vm); } } return true; }
Source:
<code>@Override public boolean addAll(Collection<? extends E> c) { if (c.isEmpty()) { return false; } lock.lock(); try { for (E e : c) { queue.add(e); } nonEmpty.signal(); return true; } catch (IOException e) { QueueFile.<Error>getSneakyThrowable(e); <START> return false; <END> } finally { lock.unlock(); } }</code><technical_language>throws</technical_language>

Target:
@Override public boolean addAll(Collection<? extends E> c) { if (c.isEmpty()) { return false; } lock.lock(); try { for (E e : c) { queue.add(e); } nonEmpty.signal(); return true; } catch (IOException e) { throw QueueFile.<Error>getSneakyThrowable(e); } finally { lock.unlock(); } }
Source:
<code>public abstract void create() throws IOException; public abstract void close(); <START> public abstract boolean hasVersioning(); <END> public abstract boolean isNameConflicting(String name) throws IOException; @NonNull public Collection<String> getConflictingNames(String name) throws IOException { Map<String, Ref> allRefs = getRefs(ALL); int lastSlash = name.lastIndexOf('/'); while (0 < lastSlash) { String needle = name.substring(0, lastSlash); if (allRefs.containsKey(needle)) return Collections.singletonList(needle); lastSlash = name.lastIndexOf('/', lastSlash - 1); } List<String> conflicting = new ArrayList<>(); String prefix = name + '/'; for (String existing : allRefs.keySet()) if (existing.startsWith(prefix)) conflicting.add(existing); return conflicting; }</code><technical_language>this default false? easier for implementers (since if want override default do)</technical_language>

Target:
public abstract void create() throws IOException; public abstract void close(); public boolean hasVersioning() { return false; }
Source:
<code><START> public WriteAttributesRequest(int objectId, AttributeSet attributes) { <END> this(new LwM2mPath(objectId), attributes); }</code><technical_language>Throws InvalidRequestException added new constructors</technical_language>

Target:
public WriteAttributesRequest(int objectId, AttributeSet attributes) throws InvalidRequestException { this(new LwM2mPath(objectId), attributes); }
Source:
<code>private Collection<FeedbackResponse> getFeedbackResponseEntitiesFromGiverForQuestionInSection( String feedbackQuestionId, String giverEmail, String section) { Map<String, FeedbackResponse> feedbackResponses = new HashMap<String, FeedbackResponse>(); for (FeedbackResponse response : load() .filter("feedbackQuestionId =", feedbackQuestionId) .filter("giverEmail =", giverEmail) .filter("giverSection =", section) .list()) { feedbackResponses.put(response.getId(), response); } for (FeedbackResponse response : load() .filter("feedbackQuestionId =", feedbackQuestionId) .filter("giverEmail =", giverEmail) .filter("receiverSection =", section) <START> .list()) { <END> feedbackResponses.put(response.getId(), response); } return feedbackResponses.values(); }</code><technical_language>extract load().filter... a separate line for readability</technical_language>

Target:
private Collection<FeedbackResponse> getFeedbackResponseEntitiesFromGiverForQuestionInSection( String feedbackQuestionId, String giverEmail, String section) { Map<String, FeedbackResponse> feedbackResponses = new HashMap<>(); List<FeedbackResponse> firstQueryResponses = load() .filter("feedbackQuestionId =", feedbackQuestionId) .filter("giverEmail =", giverEmail) .filter("giverSection =", section) .list(); for (FeedbackResponse response : firstQueryResponses) { feedbackResponses.put(response.getId(), response); } List<FeedbackResponse> secondQueryResponses = load() .filter("feedbackQuestionId =", feedbackQuestionId) .filter("giverEmail =", giverEmail) .filter("receiverSection =", section) .list(); for (FeedbackResponse response : secondQueryResponses) { feedbackResponses.put(response.getId(), response); } return feedbackResponses.values(); }
Source:
<code>private static String[] splitInput(String input) { if (input.startsWith("{") && input.endsWith("}")) { List<String> result = new ArrayList<String>(); int openBracket = 0; Integer lastStartIdx = null; for (int i = 0; i < input.length(); i++) { char c = input.charAt(i); if (c == '{') { openBracket++; if (lastStartIdx == null) { lastStartIdx = i; } } if (c == '}') { openBracket--; if (openBracket == 0 && lastStartIdx != null) { String substring = input.substring(lastStartIdx, i + 1); result.add(substring); lastStartIdx = null; } } } return result.toArray(new String[result.size()]); } <START> return input.split(","); END> }</code><technical_language>wicket-util's Strings#split() for performance</technical_language>

Target:
private static String[] splitInput(String input) { if (input.startsWith("{") && input.endsWith("}")) { List<String> result = new ArrayList<String>(); int openBracket = 0; Integer lastStartIdx = null; for (int i = 0; i < input.length(); i++) { char c = input.charAt(i); if (c == '{') { openBracket++; if (lastStartIdx == null) { lastStartIdx = i; } } if (c == '}') { openBracket--; if (openBracket == 0 && lastStartIdx != null) { String substring = input.substring(lastStartIdx, i + 1); result.add(substring); lastStartIdx = null; } } } return result.toArray(new String[result.size()]); } return Strings.split(input, ','); }
Source:
<code>public String[] transform(InputRow inputRow) { final String value = inputRow.getValue(countryColumn); final Country country = Country.find(value, defaultCountry); final String countryName; if (country == null) { countryName = null; } else { switch (outputFormat) { case ISO2: countryName = country.getTwoLetterISOCode(); break; case ISO3: countryName = country.getThreeLetterISOCode(); break; case NAME: countryName = country.getCountryName(); break; default: throw new IllegalStateException("Unexpected output format: " + outputFormat); } } final String correctedCountryName; if(countryName != null){ correctedCountryName = countryName; } else { correctedCountryName = LabelUtils.UNEXPECTED_LABEL; } synchronized (this) { if (!countryCountMap.containsKey(countryName)) { countryCountMap.put(correctedCountryName, _rowAnnotationFactory.createAnnotation()); } <START> _rowAnnotationFactory.annotate(inputRow, 1, countryCountMap.get(correctedCountryName)); <END> } return new String[] { countryName }; }</code><technical_language>annotate method is thread-safe is in synchronized block. A slight improvement separate resolving of RowAnnotation (in synchronized block) annotate call (outside)</technical_language>

Target:
public String[] transform(InputRow inputRow) { final String value = inputRow.getValue(countryColumn); final Country country = Country.find(value, defaultCountry); final String countryName; if (country == null) { countryName = null; } else { switch (outputFormat) { case ISO2: countryName = country.getTwoLetterISOCode(); break; case ISO3: countryName = country.getThreeLetterISOCode(); break; case NAME: countryName = country.getCountryName(); break; default: throw new IllegalStateException("Unexpected output format: " + outputFormat); } } final String correctedCountryName; if(countryName != null){ correctedCountryName = countryName; } else { correctedCountryName = LabelUtils.UNEXPECTED_LABEL; } final RowAnnotation annotation; synchronized (this) { if (!countryCountMap.containsKey(countryName)) { countryCountMap.put(correctedCountryName, _rowAnnotationFactory.createAnnotation()); } annotation = countryCountMap.get(correctedCountryName); } _rowAnnotationFactory.annotate(inputRow, 1, annotation); return new String[] { countryName }; }
Source:
<code>public Tree create( @NotNull(message = "params can't be NULL") final JsonObject params ) throws IOException { final Directives dirs = new Directives().xpath(this.xpath()) .add("tree"); for (final Entry<String, JsonValue> entry : params.entrySet()) { dirs.add(entry.getKey()).set(entry.getValue().toString()).up(); } this.storage.apply(dirs); new MkReferences(this.storage, this.self, this.coords).create( new StringBuilder().append("refs/trees/").append( params.getString("name") ).toString(), params.getString("sha") ); <START> return this.get(params.getString("sha")); <END> }</code><technical_language>calling params.getString("sha") twice, if called a local variable</technical_language>

Target:
public Tree create( @NotNull(message = "params can't be NULL") final JsonObject params ) throws IOException { final String sha = params.getString("sha"); final Directives dirs = new Directives().xpath(this.xpath()) .add("tree"); for (final Entry<String, JsonValue> entry : params.entrySet()) { dirs.add(entry.getKey()).set(entry.getValue().toString()).up(); } this.storage.apply(dirs); new MkReferences(this.storage, this.self, this.coords).create( new StringBuilder().append("refs/trees/").append( params.getString("name") ).toString(), sha ); return this.get(sha); }
Source:
<code><START> private static List<FormRecognizerError> transformTrainingErrors(List<ErrorInformation> trainingErrorList) { <END> if (CoreUtils.isNullOrEmpty(trainingErrorList)) { return new ArrayList<>(); } else { return trainingErrorList.stream().map(errorInformation -> new FormRecognizerError(errorInformation.getCode(), errorInformation.getMessage())).collect(Collectors.toList()); } }</code><technical_language>Lets this return IterableStream instead, I List return for other constructing IterableStream. this change optimize null empty case return IterableStream.of(null) optimizes a static immutable instance</technical_language>

Target:
private static List<FormRecognizerError> transformTrainingErrors( List<ErrorInformation> trainingErrorList) { if (CoreUtils.isNullOrEmpty(trainingErrorList)) { return Collections.emptyList(); } else { return trainingErrorList.stream() .map(errorInformation -> new FormRecognizerError(errorInformation.getCode(), errorInformation.getMessage())) .collect(Collectors.toList()); } }
Source:
<code>public static Node parse(ResourceLoader resourceLoader, String resourcePath, Reader reader) { try { ObjectMapper mapper = new ObjectMapper(); JsonNode rootNode = mapper.readValue(reader, JsonNode.class); return new JModelWrapper(resourceLoader, resourcePath).wrap(rootNode); } catch (JsonMappingException | JsonParseException e) { return ErrorNodeFactory.createInvalidJsonExampleNode(e.getOriginalMessage()); } catch (IOException e) { <START> e.printStackTrace(); <END> } return null; }</code><technical_language>return errorNode instead of printing stack trace</technical_language>

Target:
public static Node parse(ResourceLoader resourceLoader, String resourcePath, Reader reader) { try { ObjectMapper mapper = new ObjectMapper(); JsonNode rootNode = mapper.readValue(reader, JsonNode.class); return new JModelWrapper(resourceLoader, resourcePath).wrap(rootNode); } catch (JsonMappingException | JsonParseException e) { return ErrorNodeFactory.createInvalidJsonExampleNode(e.getOriginalMessage()); } catch (IOException e) { return new ErrorNode(e.getMessage()); } }
Source:
<code>public Tier loadComplete(Tier newTier) throws EntityNotFoundException { Query query = getEntityManager() .createQuery( "select p from Tier p fetch all properties where p.name = :name and p.vdc =:vdc and p.environmentname= :environmentname"); query.setParameter("name", newTier.getName()); query.setParameter("vdc", newTier.getVdc()); query.setParameter("environmentname", newTier.getEnviromentName()); Tier tier = null; try { tier = (Tier) query.getResultList().get(0); tier.getNetworks(); tier.getProductReleases(); } catch (Exception e) { <START> String message = " Tier don't exist in database "; <END> throw new EntityNotFoundException(Tier.class, message, newTier.getName()); } return tier; }</code><technical_language>Tier exist in database</technical_language>

Target:
public Tier loadComplete(Tier newTier) throws EntityNotFoundException { Query query = getEntityManager() .createQuery( "select p from Tier p fetch all properties where p.name = :name and p.vdc =:vdc and p.environmentname= :environmentname"); query.setParameter("name", newTier.getName()); query.setParameter("vdc", newTier.getVdc()); query.setParameter("environmentname", newTier.getEnviromentName()); Tier tier = null; try { tier = (Tier) query.getResultList().get(0); tier.getNetworks(); tier.getProductReleases(); } catch (Exception e) { String message = " Tier does not exist in database "; throw new EntityNotFoundException(Tier.class, message, newTier.getName()); } return tier; }
Source:
<code>private static Optional<Pair<Integer, Integer>> pairIsNullToIndePair(RexNode leftConj, RexNode rightConj) { <START> if (!(leftConj.isA(SqlKind.IS_NULL)) || !(rightConj.isA(SqlKind.IS_NULL))) { <END> return Optional.empty(); } else { return pairInputRefToIndePair(((RexCall) leftConj).getOperands().get(0), ((RexCall) rightConj).getOperands().get(0)); } }</code><technical_language>Another side note: Calcite parse expression "col IS NULL"? I assume (IS_NULL(c))</technical_language>

Target:
private static Optional<Pair<Integer, Integer>> pairIsNullToIndePair(RexNode leftConj, RexNode rightConj) { if (!(leftConj.isA(SqlKind.IS_NULL)) || !(rightConj.isA(SqlKind.IS_NULL))) { return Optional.empty(); } else { return pairInputRefToIndexPair(((RexCall) leftConj).getOperands().get(0), ((RexCall) rightConj).getOperands().get(0)); } }
Source:
<code>public boolean isSampleCheckboxEnabled(String sampleName) { String checkboxId = format(CHECKBOX_BY_SAMPLE_NAME_ID_TEMPLATE, sampleName); <START> String locator = format(" END> return seleniumWebDriverHelper .waitVisibilityAndGetAttribute(By.xpath(locator), "aria-checked") .equals("true"); }</code><technical_language>Locator of is this</technical_language>

Target:
public boolean isSampleCheckboxEnabled(String sampleName) { String checkboxId = format(CHECKBOX_BY_SAMPLE_NAME_ID_TEMPLATE, sampleName); String checkboxLocator = format(" return seleniumWebDriverHelper .waitVisibilityAndGetAttribute(By.xpath(checkboxLocator), "aria-checked") .equals("true"); }
Source:
<code>public Optional<VirtualFile> findChild(String name) { try { <START> if (childProvider == null) { <END> return Optional.empty(); } return childProvider.findChild(this, name); } catch (Exception e) { throw handleErrorInCallback(e, "childProvider.findChild"); } }</code><technical_language>I inverting this if check improve readability/flow woudl consistent other methods in this class</technical_language>

Target:
public Optional<VirtualFile> findChild(String name) { try { if (childProvider != null) { return childProvider.findChild(this, name); } return Optional.empty(); } catch (Exception e) { throw handleErrorInCallback(e, "childProvider.findChild"); } }
Source:
<code>public void edit(QosModel<StorageQos, StorageQosParametersModel> object) { qosWidget.edit(object.getQosParametersModel()); <START> driver.edit(object); <END> }</code><technical_language>call driver's edit</technical_language>

Target:
public void edit(QosModel<StorageQos, StorageQosParametersModel> object) { driver.edit(object); qosWidget.edit(object.getQosParametersModel()); }
Source:
<code><START> public Mono<ServiceBusReceivedMessage> receiveDeferredMessage(long sequenceNumber, String sessionId) { <END> if (validateSessionId(sessionId)) { return monoError(logger, new IllegalArgumentException(String.format( "This receiver client is tied to session %s. It can't be used for another session(%s).", receiverOptions.getSessionId(), sessionId))); } return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(node -> node.receiveDeferredMessages(receiverOptions.getReceiveMode(), sessionId, getLinkName(sessionId), Collections.singleton(sequenceNumber)).last()) .map(receivedMessage -> { if (CoreUtils.isNullOrEmpty(receivedMessage.getLockToken())) { return receivedMessage; } if (receiverOptions.getReceiveMode() == ReceiveMode.PEEK_LOCK) { receivedMessage.setLockedUntil(managementNodeLocks.addOrUpdate(receivedMessage.getLockToken(), receivedMessage.getLockedUntil(), receivedMessage.getLockedUntil())); } return receivedMessage; }); }</code><technical_language>If this client is tied a single session only, do need sessionId in method args</technical_language>

Target:
Mono<ServiceBusReceivedMessage> receiveDeferredMessage(long sequenceNumber, String sessionId) { return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(node -> node.receiveDeferredMessages(receiverOptions.getReceiveMode(), sessionId, getLinkName(sessionId), Collections.singleton(sequenceNumber)).last()) .map(receivedMessage -> { if (CoreUtils.isNullOrEmpty(receivedMessage.getLockToken())) { return receivedMessage; } if (receiverOptions.getReceiveMode() == ReceiveMode.PEEK_LOCK) { receivedMessage.setLockedUntil(managementNodeLocks.addOrUpdate(receivedMessage.getLockToken(), receivedMessage.getLockedUntil(), receivedMessage.getLockedUntil())); } return receivedMessage; }); }
Source:
<code>public WMTSMapLayer(WebMapTileServer wmts, Layer layer) { <START> super( new WMTSCoverageReader(wmts, layer), STYLE ); <END> }</code><technical_language>Danger danger, Style objects mutable, if style changes it, affect static variable subsequent requests. create style time</technical_language>

Target:
public WMTSMapLayer(WebMapTileServer wmts, Layer layer) { super(new WMTSCoverageReader(wmts, layer), createStyle()); }
Source:
<code>public void shouldReturnNameWithMultipleTags() throws Exception { String metricName = MetricNameUtils.getMetricName("metricName", ImmutableMap.of("tag1", "tagVal1", "tag2", "tagVal2")); <START> assertThat(metricName).isEqualTo("metricName;tag1=tagVal1;tag2=tagVal2"); <END> }</code><technical_language>Pretty nitpicky, prefer if contains equality pairs (or equal this line tag order flipped). This is safe, relying ImmutableMap preserving iteration order - if pass a HashMap, say, guarantee this test pass get metricName;tag2=tagVal2;tag1=tagVal1</technical_language>

Target:
public void shouldReturnNameWithMultipleTags() throws Exception { String metricName = MetricNameUtils.getMetricName(METRIC_NAME, ImmutableMap.of(TAG_KEY_2, TAG_VALUE_2, TAG_KEY_1, TAG_VALUE_1)); assertThat(metricName).isIn("metricName;tag1=tagVal1;tag2=tagVal2", "metricName;tag2=tagVal2;tag1=tagVal1"); }
Source:
<code>private void resolveGroupsMemberships(List<ExtMap> groupsToResolve, Set<String> resolvedGroups) throws IOException, SQLException { if (groupsToResolve != null) { for (ExtMap groupRecord : groupsToResolve) { if (!resolvedGroups.contains(groupRecord.<String>get(Authz.GroupRecord.ID))) { resolvedGroups.add(groupRecord.<String>get(Authz.GroupRecord.ID)); groupRecord.put(Authz.GroupRecord.GROUPS, getGroupMemberships(groupRecord)); resolveGroupsMemberships( <START> groupRecord.<List<ExtMap>>get(Authz.PrincipalRecord.GROUPS), <END> resolvedGroups); } } } }</code><technical_language>This work for case is: group2 -> group1 -> user1 for case is: group3 -> group2 -> group1 -> user1 I be: groupRecord.<List<ExtMap>>get(Authz.GroupRecord.GROUPS),</technical_language>

Target:
private void resolveGroupsMemberships(List<ExtMap> groupsToResolve, Set<String> resolvedGroups) throws IOException, SQLException { if (groupsToResolve != null) { for (ExtMap groupRecord : groupsToResolve) { if (!resolvedGroups.contains(groupRecord.<String>get(Authz.GroupRecord.ID))) { resolvedGroups.add(groupRecord.<String>get(Authz.GroupRecord.ID)); groupRecord.put(Authz.GroupRecord.GROUPS, getGroupMemberships(groupRecord)); resolveGroupsMemberships( groupRecord.<List<ExtMap>>get(Authz.GroupRecord.GROUPS), resolvedGroups); } } } }
Source:
<code>public final void appendNext(PageBuilder pageBuilder, int outputChannelOffset) { BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(outputChannelOffset); elementType.appendTo(arrayBlock, position, blockBuilder); position++; <START> } <END></code><technical_language>requireNonNull(arrayBlock? checkState</technical_language>

Target:
public final void appendNext(PageBuilder pageBuilder, int outputChannelOffset) { checkState(arrayBlock != null, "arrayBlock is null"); BlockBuilder blockBuilder = pageBuilder.getBlockBuilder(outputChannelOffset); elementType.appendTo(arrayBlock, position, blockBuilder); position++; }
Source:
<code>public Promise<Response> request(final InetSocketAddress address, final Request request) throws InterruptedException { Channel ch = this.channelManager.findOrNew(address, this.clientBootstrap); ch.write(request); <START> ResponseDispatcher responseDispatcher = ch.pipeline().get(ResponseDispatcher.class); <END> Promise<Response> responsePromise = new DefaultPromise<>(GlobalEventExecutor.INSTANCE); responseDispatcher.put(request.getId(), responsePromise); ch.flush(); return responsePromise; }</code><technical_language>hmm this odd</technical_language>

Target:
public Promise<Response> request(final InetSocketAddress address, final Request request) throws InterruptedException { Channel ch = this.channelManager.findOrNew(address, this.clientBootstrap); ch.write(request); Promise<Response> responsePromise = new DefaultPromise<>(GlobalEventExecutor.INSTANCE); ResponseDispatcher responseDispatcher = ch.pipeline().get(ResponseDispatcher.class); responseDispatcher.put(request.getId(), responsePromise); ch.flush(); return responsePromise; }
Source:
<code>protected boolean canAddLease() { if (!getParameters().getVmStaticData().isAutoStartup()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_LEASES_ARE_NOT_SUPPORTED_WITH_HA_OFF); } <START> if (!FeatureSupported.isVmLeasesSupported(getEffectiveCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_LEASES_ARE_NOT_SUPPORTED); } <END> return validateLeaseStorageDomain(getParameters().getVmStaticData().getLeaseStorageDomainId()); }</code><technical_language>validation</technical_language>

Target:
protected boolean canAddLease() { if (!FeatureSupported.isVmLeasesSupported(getEffectiveCompatibilityVersion())) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_LEASES_ARE_NOT_SUPPORTED); } if (!getParameters().getVmStaticData().isAutoStartup()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_VM_LEASES_ARE_NOT_SUPPORTED_WITH_HA_OFF); } return validateLeaseStorageDomain(getParameters().getVmStaticData().getLeaseStorageDomainId()); }
Source:
<code>public void handleNetworkException(VDSNetworkException ex) { boolean saveToDb = true; if (cachedVds.getStatus() != VDSStatus.Down) { long timeoutToFence = calcTimeoutToFence(cachedVds.getVmCount(), cachedVds.getSpmStatus()); if (isHostInGracePeriod(false)) { if (cachedVds.getStatus() != VDSStatus.Connecting <START> && cachedVds.getStatus() != VDSStatus.Unassigned <END> && cachedVds.getStatus() != VDSStatus.PreparingForMaintenance && cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, cachedVds); logChangeStatusToConnecting(timeoutToFence); } else { saveToDb = false; } mUnrespondedAttempts.incrementAndGet(); } else { if (cachedVds.getStatus() == VDSStatus.Maintenance) { saveToDb = false; } else { if (cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.NonResponsive, cachedVds); moveVMsToUnknown(); logHostFailToRespond(ex, timeoutToFence); resourceManager.getEventListener().vdsNotResponding(cachedVds); } else { setStatus(VDSStatus.NonResponsive, cachedVds); } } } } if (saveToDb) { updateDynamicData(cachedVds.getDynamicData()); updateStatisticsData(cachedVds.getStatisticsData()); } }</code><technical_language>Is this needed change in VdsBrokerCommand</technical_language>

Target:
public void handleNetworkException(VDSNetworkException ex) { boolean saveToDb = true; if (cachedVds.getStatus() != VDSStatus.Down) { long timeoutToFence = calcTimeoutToFence(cachedVds.getVmCount(), cachedVds.getSpmStatus()); if (isHostInGracePeriod(false)) { if (cachedVds.getStatus() != VDSStatus.Connecting && cachedVds.getStatus() != VDSStatus.PreparingForMaintenance && cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, cachedVds); logChangeStatusToConnecting(timeoutToFence); } else { saveToDb = false; } mUnrespondedAttempts.incrementAndGet(); } else { if (cachedVds.getStatus() == VDSStatus.Maintenance) { saveToDb = false; } else { if (cachedVds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.NonResponsive, cachedVds); moveVMsToUnknown(); logHostFailToRespond(ex, timeoutToFence); resourceManager.getEventListener().vdsNotResponding(cachedVds); } else { setStatus(VDSStatus.NonResponsive, cachedVds); } } } } if (saveToDb) { updateDynamicData(cachedVds.getDynamicData()); updateStatisticsData(cachedVds.getStatisticsData()); } }
Source:
<code>private Flux<IndexBatchResponse> sendBatch( List<com.azure.search.documents.implementation.models.IndexAction> actions, int actionsOffset, Context context) { return client.indexDocumentsWithResponse(actions, true, context) .delaySubscription(currentRetryDelay) .flatMapMany(response -> Flux.just( new IndexBatchResponse(response.getStatusCode(), response.getValue().getResults(), actionsOffset, actions.size(), false))) .onErrorResume(IndexBatchException.class, exception -> Flux .just(new IndexBatchResponse(207, exception.getIndexingResults(), actionsOffset, actions.size(), true))) .onErrorResume(HttpResponseException.class, exception -> { int statusCode = exception.getResponse().getStatusCode(); <START> if (exception.getResponse().getStatusCode() == HttpURLConnection.HTTP_ENTITY_TOO_LARGE) { <END> int actionCount = actions.size(); if (actionCount == 1) { return Flux.just(new IndexBatchResponse(statusCode, null, actionsOffset, actionCount, true)); } int splitOffset = Math.round(actionCount / 2.0f); return Flux.concat( sendBatch(actions.subList(0, splitOffset), 0, context), sendBatch(actions.subList(splitOffset, actionCount), splitOffset, context) ); } return Flux.just(new IndexBatchResponse(statusCode, null, actionsOffset, actions.size(), true)); }); }</code><technical_language>suggestion if (statusCode == HttpURLConnection.HTTP_ENTITY_TOO_LARGE) {</technical_language>

Target:
private Flux<IndexBatchResponse> sendBatch( List<com.azure.search.documents.implementation.models.IndexAction> actions, int actionsOffset, Context context) { return client.indexDocumentsWithResponse(actions, true, context) .delaySubscription(currentRetryDelay) .flatMapMany(response -> Flux.just( new IndexBatchResponse(response.getStatusCode(), response.getValue().getResults(), actionsOffset, actions.size(), false))) .onErrorResume(IndexBatchException.class, exception -> Flux .just(new IndexBatchResponse(207, exception.getIndexingResults(), actionsOffset, actions.size(), true))) .onErrorResume(HttpResponseException.class, exception -> { int statusCode = exception.getResponse().getStatusCode(); if (statusCode == HttpURLConnection.HTTP_ENTITY_TOO_LARGE) { int actionCount = actions.size(); if (actionCount == 1) { return Flux.just(new IndexBatchResponse(statusCode, null, actionsOffset, actionCount, true)); } int splitOffset = Math.round(actionCount / 2.0f); return Flux.concat( sendBatch(actions.subList(0, splitOffset), 0, context), sendBatch(actions.subList(splitOffset, actionCount), splitOffset, context) ); } return Flux.just(new IndexBatchResponse(statusCode, null, actionsOffset, actions.size(), true)); }); }
Source:
<code>public List<ScanResult> scan() { String javaClassPath = AccessController.doPrivileged(new GetSystemPropertyAction(JAVA_CLASS_PATH_SYSTEM_PROPERTY)); if (javaClassPath == null) { throw CommonLogger.LOG.cannotReadJavaClassPathSystemProperty(); } ImmutableList.Builder<ScanResult> results = ImmutableList.builder(); <START> Set<String> entries = ImmutableSet.copyOf(Arrays.asList(javaClassPath.split(Pattern.quote(File.pathSeparator)))); <END> logger.debugv("Scanning class path entries: {0}", entries); for (String entry : entries) { if (entry == null || entry.isEmpty()) { continue; } File entryFile = new File(entry); if (!entryFile.canRead()) { throw CommonLogger.LOG.cannotReadClassPathEntry(entryFile); } try { if (entryFile.isDirectory()) { scanDirectory(entryFile, results); } else { scanJarFile(entryFile, results); } } catch (IOException e) { throw CommonLogger.LOG.cannotScanClassPathEntry(entryFile, e); } } return results.build(); }</code><technical_language>org.jboss.weld.util.collections.ImmutableSet.of(T...)</technical_language>

Target:
public List<ScanResult> scan() { String javaClassPath = AccessController.doPrivileged(new GetSystemPropertyAction(JAVA_CLASS_PATH_SYSTEM_PROPERTY)); if (javaClassPath == null) { throw CommonLogger.LOG.cannotReadJavaClassPathSystemProperty(); } ImmutableList.Builder<ScanResult> results = ImmutableList.builder(); Set<String> entries = ImmutableSet.of(javaClassPath.split(Pattern.quote(File.pathSeparator))); logger.debugv("Scanning class path entries: {0}", entries); for (String entry : entries) { if (entry == null || entry.isEmpty()) { continue; } File entryFile = new File(entry); if (!entryFile.canRead()) { throw CommonLogger.LOG.cannotReadClassPathEntry(entryFile); } try { if (entryFile.isDirectory()) { scanDirectory(entryFile, results); } else { scanJarFile(entryFile, results); } } catch (IOException e) { throw CommonLogger.LOG.cannotScanClassPathEntry(entryFile, e); } } return results.build(); }