auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<String> getMapping(Request request, Response response) throws RecipientRewriteTableException { <START> final MappingSource mappingSource = mappingSourceFrom(request); <END> return Optional.ofNullable(recipientRewriteTable.getAllMappings().get(mappingSource)) .filter(mappings -> !mappings.isEmpty()) .filter(mappings -> mappings.contains(Mapping.Type.Domain)) .map(this::toDomainList) .orElseThrow(() -> ErrorResponder.builder() .statusCode(HttpStatus.NOT_FOUND_404) .type(ErrorResponder.ErrorType.NOT_FOUND) .message(String.format("Cannot find mappings for %s", mappingSource.getFixedDomain())) .haltError()); }</code><technical_language>do final variable :-)</technical_language>

Target:
public List<String> getMapping(Request request, Response response) throws RecipientRewriteTableException { MappingSource mappingSource = mappingSourceFrom(request); return Optional.ofNullable(recipientRewriteTable.getUserDomainMappings(mappingSource).select(Mapping.Type.Domain)) .filter(mappings -> !mappings.isEmpty()) .filter(mappings -> mappings.contains(Mapping.Type.Domain)) .map(this::toDomainList) .orElseThrow(() -> ErrorResponder.builder() .statusCode(HttpStatus.NOT_FOUND_404) .type(ErrorResponder.ErrorType.NOT_FOUND) .message(String.format("Cannot find mappings for %s", mappingSource.getFixedDomain())) .haltError()); }
Source:
<code>public static void exportClientCertificates(String archivePath, ApiTypeWrapper apiTypeWrapper, int tenantId, APIProvider provider, ExportFormat exportFormat) throws APIImportExportException { List<ClientCertificateDTO> certificateMetadataDTOS; try { <START> if (!apiTypeWrapper.isAPIProduct()) { certificateMetadataDTOS = provider.searchClientCertificates(tenantId, null, apiTypeWrapper.getApi().getId()); } else { <END> certificateMetadataDTOS = provider.searchClientCertificates(tenantId, null, apiTypeWrapper.getApiProduct().getId()); } if (!certificateMetadataDTOS.isEmpty()) { CommonUtil.createDirectory(archivePath + File.separator + APIImportExportConstants.META_INFO_DIRECTORY); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String element = gson.toJson(certificateMetadataDTOS, new TypeToken<ArrayList<ClientCertificateDTO>>() { }.getType()); switch (exportFormat) { case YAML: String yaml = CommonUtil.jsonToYaml(element); CommonUtil.writeFile(archivePath + APIImportExportConstants.YAML_CLIENT_CERTIFICATE_FILE, yaml); break; case JSON: CommonUtil.writeFile(archivePath + APIImportExportConstants.JSON_CLIENT_CERTIFICATE_FILE, element); } } } catch (IOException e) { String errorMessage = "Error while retrieving saving as YAML"; log.error(errorMessage, e); throw new APIImportExportException(errorMessage, e); } catch (APIManagementException e) { String errorMsg = "Error retrieving certificate meta data. tenantId [" + tenantId + "] api [" + tenantId + "]"; throw new APIImportExportException(errorMsg, e); } }</code><technical_language>Remove "!" swap blocks. couple of other places fix</technical_language>

Target:
public static void exportClientCertificates(String archivePath, ApiTypeWrapper apiTypeWrapper, int tenantId, APIProvider provider, ExportFormat exportFormat) throws APIImportExportException { List<ClientCertificateDTO> certificateMetadataDTOS; try { if (apiTypeWrapper.isAPIProduct()) { certificateMetadataDTOS = provider.searchClientCertificates(tenantId, null, apiTypeWrapper.getApiProduct().getId()); } else { certificateMetadataDTOS = provider.searchClientCertificates(tenantId, null, apiTypeWrapper.getApi().getId()); } if (certificateMetadataDTOS.isEmpty()) { return; } CommonUtil.createDirectory(archivePath + File.separator + APIImportExportConstants.META_INFO_DIRECTORY); Gson gson = new GsonBuilder().setPrettyPrinting().create(); String element = gson.toJson(certificateMetadataDTOS, new TypeToken<ArrayList<ClientCertificateDTO>>() { }.getType()); switch (exportFormat) { case YAML: CommonUtil.writeFile(archivePath + APIImportExportConstants.YAML_CLIENT_CERTIFICATE_FILE, CommonUtil.jsonToYaml(element)); break; case JSON: CommonUtil.writeFile(archivePath + APIImportExportConstants.JSON_CLIENT_CERTIFICATE_FILE, element); } } catch (IOException e) { String errorMessage = "Error while retrieving saving as YAML"; throw new APIImportExportException(errorMessage, e); } catch (APIManagementException e) { String errorMsg = "Error retrieving certificate meta data. tenantId [" + tenantId + "] api [" + tenantId + "]"; throw new APIImportExportException(errorMsg, e); } }
Source:
<code>public LiveData<Resource<TwitterFeed>> getPosts(String query, int count, String source) { Publisher<Resource<TwitterFeed>> publisher = TwitterApi.getLoklakAPI().getTwitterFeed(query, count, source) .map(Resource::success) .onErrorReturn(throwable -> { Timber.e(throwable); return Resource.error(throwable.getMessage(), null); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .toFlowable(BackpressureStrategy.BUFFER); <START> feedLiveData = LiveDataReactiveStreams.fromPublisher(publisher); <END> return feedLiveData; }</code><technical_language>This initialized once, returned</technical_language>

Target:
public LiveData<Resource<TwitterFeed>> getPosts(String query, int count, String source) { if (feedLiveData == null) { Publisher<Resource<TwitterFeed>> publisher = TwitterApi.getLoklakAPI().getTwitterFeed(query, count, source) .map(Resource::success) .onErrorReturn(throwable -> { Timber.e(throwable); return Resource.error(throwable.getMessage(), null); }) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .toFlowable(BackpressureStrategy.BUFFER); feedLiveData = LiveDataReactiveStreams.fromPublisher(publisher); } return feedLiveData; }
Source:
<code>protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { HttpServletRequest filteredRequest = request; HttpServletResponse filteredResponse = response; String contentEncoding = request.getHeader(HttpHeaders.CONTENT_ENCODING); <START> if (contentEncoding != null && contentEncoding.contains("gzip")) { <END> filteredRequest = new GzipHttpServletRequestWrapper(request); } String acceptEncoding = request.getHeader(HttpHeaders.ACCEPT_ENCODING); if (acceptEncoding != null && acceptEncoding.contains("gzip")) { filteredResponse = new GzipHttpServletResponseWrapper(response); } filterChain.doFilter(filteredRequest, filteredResponse); if (filteredResponse instanceof GzipHttpServletResponseWrapper) { ((GzipHttpServletResponseWrapper) filteredResponse).finish(); } }</code><technical_language>a side note: restructure code resolve duplication here</technical_language>

Target:
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws ServletException, IOException { HttpServletRequest filteredRequest = request; HttpServletResponse filteredResponse = response; if (isGzipEncoding(request.getHeader(HttpHeaders.CONTENT_ENCODING))) { filteredRequest = new GzipHttpServletRequestWrapper(request); } if (isGzipEncoding(request.getHeader(HttpHeaders.ACCEPT_ENCODING))) { filteredResponse = new GzipHttpServletResponseWrapper(response); } filterChain.doFilter(filteredRequest, filteredResponse); if (filteredResponse instanceof GzipHttpServletResponseWrapper) { ((GzipHttpServletResponseWrapper) filteredResponse).finish(); } }
Source:
<code><START> public I2CBus getBus(final int busNumber, final long lockAquireTimeout, final TimeUnit lockAquireTimeoutUnit) throws UnsupportedBusNumberException, IOException { <END> Integer number = Integer.valueOf(busNumber); if(!devices.containsKey(number)) { throw new UnsupportedBusNumberException(); } I2CBusImpl result = new I2CBusImpl(busNumber, devices.get(number), lockAquireTimeout, lockAquireTimeoutUnit); result.open(); return result; }</code><technical_language>sense add additional overload for getBus takes a bus path string (in addition bus-number caching above)? I in project, I configure actual bus path (it sense dealing multiple devices/busses register /sys), do a reverse mapping anyways</technical_language>

Target:
public I2CBus getBus(final int busNumber, final long lockAquireTimeout, final TimeUnit lockAquireTimeoutUnit) throws UnsupportedBusNumberException, IOException { final File sysfs = new File("/sys/bus/i2c/devices/i2c-" + busNumber); if (!sysfs.exists() || !sysfs.isDirectory()) { throw new UnsupportedBusNumberException(); } final File devfs = new File("/dev/i2c-" + busNumber); if (!devfs.exists() || !devfs.canRead() || !devfs.canWrite()) { throw new UnsupportedBusNumberException(); } I2CBusImpl result = new I2CBusImpl(busNumber, devfs.getCanonicalPath(), lockAquireTimeout, lockAquireTimeoutUnit); result.open(); return result; }
Source:
<code>private IFileStore doUpdate(IProgressMonitor monitor) throws IOException { SubMonitor subMon = SubMonitor.convert(monitor, 100); try { IRemoteFileManager fileManager = fRemoteConnection.getRemoteServices().getFileManager(fRemoteConnection); IFileStore directory = fileManager.getResource(getWorkingDir()); <START> synchronized (this) { <END> directory.mkdir(EFS.NONE, subMon.newChild(10)); } if (checkAndUploadPayload(directory, subMon.newChild(30))) { if (!subMon.isCanceled()) { unpackPayload(directory, subMon.newChild(30)); } } return directory; } catch (CoreException e) { throw new IOException(e.getMessage()); } finally { if (monitor != null) { monitor.done(); } } }</code><technical_language>explain need for this</technical_language>

Target:
private IFileStore doUpdate(IProgressMonitor monitor) throws IOException { SubMonitor subMon = SubMonitor.convert(monitor, 100); try { IRemoteFileManager fileManager = fRemoteConnection.getRemoteServices().getFileManager(fRemoteConnection); IFileStore directory = fileManager.getResource(getWorkingDir()); directory.mkdir(EFS.NONE, subMon.newChild(10)); if (checkAndUploadPayload(directory, subMon.newChild(30))) { if (!subMon.isCanceled()) { unpackPayload(directory, subMon.newChild(30)); } } return directory; } catch (CoreException e) { throw new IOException(e.getMessage()); } finally { if (monitor != null) { monitor.done(); } } }
Source:
<code>public void init() throws Exception { fileName = getPath("InputXpathQueryGenerator.java"); <START> final File file = new File(fileName); <END> rootAst = TestUtils.parseFile(file); }</code><technical_language>BeforeClass annotation</technical_language>

Target:
public void init() throws Exception { final File file = new File(getPath("InputXpathQueryGenerator.java")); fileText = new FileText(file, StandardCharsets.UTF_8.name()); rootAst = TestUtils.parseFile(file); }
Source:
<code>public String getCellLinkHrefFromDataTable(int row, int column) { <START> WebElement tableElement = browser.driver.findElements(By.className("table")).get(0); <END> WebElement trElement = tableElement.findElements(By.tagName("tr")).get(row); WebElement tdElement = trElement.findElements(By.tagName("td")).get(column); return tdElement.findElement(By.tagName("a")).getAttribute("href"); }</code><technical_language>Follow more general approach of getCellValueFromDataTable (include a table index instead of hardcoding 0)</technical_language>

Target:
public String getCellLinkHrefFromDataTable(int row, int column) { return getCellLinkHrefFromDataTable(0, row, column); }
Source:
<code>private static boolean containsNonNullFilter(Map<Subfield, TupleDomainFilter> columnFilters) { <START> return columnFilters != null && !columnFilters.entrySet().stream().map(Map.Entry::getValue).allMatch(filter -> filter.testNull()); <END> }</code><technical_language>entrySet().stream().map(Map.Entry::getValue) simplified values().stream() - TupleDomainFilter::testNull in allMatch - check if filters deterministic well? return columnFilters != null && !columnFilters.values().stream().allMatch(TupleDomainFilter::testNull);</technical_language>

Target:
private static boolean containsNonNullFilter(Map<Subfield, TupleDomainFilter> columnFilters) { return columnFilters != null && !columnFilters.values().stream().allMatch(TupleDomainFilter::testNull); }
Source:
<code>public Tree createListControl(Composite parent) { Tree table = (Tree) getTreeControl(); if (table == null) { listParent = parent; treeViewer = doCreateTreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION); table = treeViewer.getTree(); table.setFont(parent.getFont()); treeViewer.setComparator(new ViewerComparator()); treeViewer.addCheckStateListener(this); } <START> else { <END> } return table; }</code><technical_language>Remove 'else' branch</technical_language>

Target:
public Tree createListControl(Composite parent) { Tree table = (Tree) getTreeControl(); if (table == null) { listParent = parent; treeViewer = doCreateTreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION); table = treeViewer.getTree(); table.setFont(parent.getFont()); treeViewer.setComparator(new ViewerComparator()); treeViewer.addCheckStateListener(this); } return table; }
Source:
<code>public void process( RowData element, RuntimeContext ctx, RequestIndexer indexer) { switch (element.getRowKind()) { case INSERT: case UPDATE_AFTER: processUpsert(element, indexer); break; case DELETE: processDelete(element, indexer); <START> break; <END> default: throw new TableException("Unsupported message kind: " + element.getRowKind()); } }</code><technical_language>For now, add case UPDATE_BEFORE here, ignore is optimization. is cases ignored, e.g. multi-sink (one requires before), filter agg result (FLINK-9528)</technical_language>

Target:
public void process( RowData element, RuntimeContext ctx, RequestIndexer indexer) { switch (element.getRowKind()) { case INSERT: case UPDATE_AFTER: processUpsert(element, indexer); break; case UPDATE_BEFORE: case DELETE: processDelete(element, indexer); break; default: throw new TableException("Unsupported message kind: " + element.getRowKind()); } }
Source:
<code>private Map<Method, Method> toFallbackMethod(Map<Method, MethodHandler> dispatch) { Map<Method, Method> result = new HashMap<Method, Method>(); for (Map.Entry<Method, MethodHandler> entry : dispatch.entrySet()) { Method key = entry.getKey(); <START> key.setAccessible(true); <END> result.put(key, key); } return result; }</code><technical_language>setAccessible is mutating, need save this</technical_language>

Target:
private Map<Method, Method> toFallbackMethod(Map<Method, MethodHandler> dispatch) { Map<Method, Method> result = new HashMap<Method, Method>(); for (Method method : dispatch.keySet()) { method.setAccessible(true); result.put(method, method); } return result; }
Source:
<code>public void visitObjectLiteral(ObjectLiteralTree tree) { <START> HashMap<String, Tree> keys = new HashMap<>(); <END> for (Tree property : tree.properties()) { if (property.is(Tree.Kind.PAIR_PROPERTY)) { visitPairProperty(keys, (PairPropertyTree) property); } if (property.is(Kind.IDENTIFIER_REFERENCE)) { IdentifierTree identifier = (IdentifierTree) property; addKey(keys, identifier.name(), (IdentifierTree)property); } } super.visitObjectLiteral(tree); }</code><technical_language>@vilchik-elena HashMap Map</technical_language>

Target:
public void visitObjectLiteral(ObjectLiteralTree tree) { Map<String, Tree> keys = new HashMap<>(); for (Tree property : tree.properties()) { if (property.is(Tree.Kind.PAIR_PROPERTY)) { visitPairProperty(keys, (PairPropertyTree) property); } if (property.is(Kind.IDENTIFIER_REFERENCE)) { IdentifierTree identifier = (IdentifierTree) property; addKey(keys, identifier.name(), (IdentifierTree)property); } } super.visitObjectLiteral(tree); }
Source:
<code>protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RAS_Node node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { <START> Collection<WorkerSlot> topologyUsedSlots = oneWorkerPerExecutor ? node.getUsedSlots(td.getId()) : null; <END> for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (topologyUsedSlots == null || !topologyUsedSlots.contains(ws)) { if (node.wouldFit(ws, exec, td)) { return ws; } } } } } return null; }</code><technical_language>Set this Collections.emptySet() instead of null, get rid of null check below</technical_language>

Target:
protected WorkerSlot findWorkerForExec(ExecutorDetails exec, TopologyDetails td, Iterable<String> sortedNodes) { for (String id : sortedNodes) { RAS_Node node = nodes.getNodeById(id); if (node.couldEverFit(exec, td)) { Collection<WorkerSlot> topologyUsedSlots = oneExecutorPerWorker ? node.getUsedSlots(td.getId()) : Collections.emptySet(); for (WorkerSlot ws : node.getSlotsAvailableToScheduleOn()) { if (!topologyUsedSlots.contains(ws)) { if (node.wouldFit(ws, exec, td)) { return ws; } } } } } return null; }
Source:
<code>public AmqpAnnotatedMessage(AmqpAnnotatedMessage message) { Objects.requireNonNull(message, "'message' cannot be null."); Objects.requireNonNull(message.getBody(), "'message.body' cannot be null."); AmqpBodyType bodyType = message.getBody().getBodyType(); switch (bodyType) { case DATA: amqpMessageBody = new AmqpDataBody((AmqpDataBody) message.getBody()); break; case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Body type not supported yet " + bodyType.toString())); default: <START> logger.warning("Invalid body type {}.", bodyType); throw logger.logExceptionAsError(new IllegalStateException("Body type not valid " <END> + bodyType.toString())); } applicationProperties = new HashMap<>(message.getApplicationProperties()); deliveryAnnotations = new HashMap<>(message.getDeliveryAnnotations()); messageAnnotations = new HashMap<>(message.getMessageAnnotations()); footer = new HashMap<>(message.getFooter()); header = new AmqpMessageHeader(message.getHeader()); properties = new AmqpMessageProperties(message.getProperties()); }</code><technical_language>logging a warning exception here</technical_language>

Target:
public AmqpAnnotatedMessage(AmqpAnnotatedMessage message) { Objects.requireNonNull(message, "'message' cannot be null."); Objects.requireNonNull(message.getBody(), "'message.body' cannot be null."); AmqpBodyType bodyType = message.getBody().getBodyType(); switch (bodyType) { case DATA: amqpMessageBody = new AmqpDataBody((AmqpDataBody) message.getBody()); break; case SEQUENCE: case VALUE: throw logger.logExceptionAsError(new UnsupportedOperationException("Body type not supported yet " + bodyType.toString())); default: throw logger.logExceptionAsError(new IllegalStateException("Body type not valid " + bodyType.toString())); } applicationProperties = new HashMap<>(message.getApplicationProperties()); deliveryAnnotations = new HashMap<>(message.getDeliveryAnnotations()); messageAnnotations = new HashMap<>(message.getMessageAnnotations()); footer = new HashMap<>(message.getFooter()); header = new AmqpMessageHeader(message.getHeader()); properties = new AmqpMessageProperties(message.getProperties()); }
Source:
<code>protected void onResume() { super.onResume(); if (userAuthenticationIsInvalid()) { startLoginActivity(true); Intent intent = getIntent(); if (intent.hasExtra(KEY_WIDGET_CLICK) && intent.getExtras() != null && intent.getExtras().getSerializable(KEY_WIDGET_CLICK) == NOTE_WIDGET_SIGN_IN_TAPPED) { AnalyticsTracker.track( NOTE_WIDGET_SIGN_IN_TAPPED, CATEGORY_WIDGET, <START> "note_widget_sign_in_tapped" <END> ); } } disableScreenshotsIfLocked(this); mNotesBucket.start(); mTagsBucket.start(); mNotesBucket.addOnNetworkChangeListener(this); mNotesBucket.addOnSaveObjectListener(this); mNotesBucket.addOnDeleteObjectListener(this); mTagsBucket.addListener(mTagsMenuUpdater); updateNavigationDrawerItems(); if (userIsUnauthorized()) { if (-1 == mTagsAdapter.getPosition(mSelectedTag)) { mSelectedTag = null; mDrawerList.setSelection(TagsAdapter.DEFAULT_ITEM_POSITION); } } setSelectedTagActive(); if (mCurrentNote != null && mShouldSelectNewNote) { onNoteSelected(mCurrentNote.getSimperiumKey(), 0, null, mCurrentNote.isMarkdownEnabled()); mShouldSelectNewNote = false; } if (mIsShowingMarkdown) { setMarkdownShowing(false); } }</code><technical_language>added indentations unnecessary changes reverted</technical_language>

Target:
protected void onResume() { super.onResume(); if (userAuthenticationIsInvalid()) { startLoginActivity(true); Intent intent = getIntent(); if (intent.hasExtra(KEY_WIDGET_CLICK) && intent.getExtras() != null && intent.getExtras().getSerializable(KEY_WIDGET_CLICK) == NOTE_WIDGET_SIGN_IN_TAPPED) { AnalyticsTracker.track( NOTE_WIDGET_SIGN_IN_TAPPED, CATEGORY_WIDGET, "note_widget_sign_in_tapped" ); } } disableScreenshotsIfLocked(this); mNotesBucket.start(); mTagsBucket.start(); mNotesBucket.addOnNetworkChangeListener(this); mNotesBucket.addOnSaveObjectListener(this); mNotesBucket.addOnDeleteObjectListener(this); mTagsBucket.addListener(mTagsMenuUpdater); updateNavigationDrawerItems(); if (userIsUnauthorized()) { if (-1 == mTagsAdapter.getPosition(mSelectedTag)) { mSelectedTag = null; mDrawerList.setSelection(TagsAdapter.DEFAULT_ITEM_POSITION); } } setSelectedTagActive(); if (mCurrentNote != null && mShouldSelectNewNote) { onNoteSelected(mCurrentNote.getSimperiumKey(), 0, null, mCurrentNote.isMarkdownEnabled()); mShouldSelectNewNote = false; } if (mIsShowingMarkdown) { setMarkdownShowing(false); } FragmentTransaction ft = getSupportFragmentManager().beginTransaction(); if(DisplayUtils.isLargeScreenLandscape(this)) { if (mIsTabetFullscreen) { ft.hide(mNoteListFragment); } else { ft.show(mNoteListFragment); } } else { ft.show(mNoteListFragment); } ft.commitNow(); }
Source:
<code>public List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws InternalErrorException, WrongAttributeAssignmentException { try { AttributeDefinition attributeDef = getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, attributeName); <START> Attribute attribute = new Attribute(attributeDef); <END> attribute.setValue(attributeValue); getPerunBl().getAttributesManagerBl().checkNamespace(sess, attribute, AttributesManager.NS_FACILITY_ATTR); if (!(getPerunBl().getAttributesManagerBl().isDefAttribute(sess, attribute) || getPerunBl().getAttributesManagerBl().isOptAttribute(sess, attribute))) throw new WrongAttributeAssignmentException("This method can process only def and opt attributes"); return getFacilitiesManagerImpl().getFacilitiesByAttribute(sess, attribute); } catch (AttributeNotExistsException e) { throw new ConsistencyErrorException("Attribute name:'" + attributeName + "', value:'" + attributeValue + "' not exists ", e); } }</code><technical_language>is missing check in a code, passed attribute is a large type. Please AttributesManagerImpl.isLargeAttribute(sess, attrDef) throw some exception in case - InternalErrorException probably</technical_language>

Target:
public List<Facility> getFacilitiesByAttribute(PerunSession sess, String attributeName, String attributeValue) throws InternalErrorException, WrongAttributeAssignmentException { try { AttributeDefinition attributeDef = getPerunBl().getAttributesManagerBl().getAttributeDefinition(sess, attributeName); if (Utils.isLargeAttribute(sess, attributeDef)) { throw new InternalErrorException("Attribute " + attributeName + " is large attribute, which is not supported."); } Attribute attribute = new Attribute(attributeDef); attribute.setValue(attributeValue); getPerunBl().getAttributesManagerBl().checkNamespace(sess, attribute, AttributesManager.NS_FACILITY_ATTR); if (!(getPerunBl().getAttributesManagerBl().isDefAttribute(sess, attribute) || getPerunBl().getAttributesManagerBl().isOptAttribute(sess, attribute))) throw new WrongAttributeAssignmentException("This method can process only def and opt attributes"); return getFacilitiesManagerImpl().getFacilitiesByAttribute(sess, attribute); } catch (AttributeNotExistsException e) { throw new ConsistencyErrorException("Attribute name:'" + attributeName + "', value:'" + attributeValue + "' not exists ", e); } }
Source:
<code>public void testDisable() throws IOException { Admin admin = connection.getAdmin(); TableName tableName = IntegrationTests.TABLE_NAME; <START> Table table = connection.getTable(TABLE_NAME); <END> Get get = new Get("row".getBytes()); table.get(get); admin.disableTable(tableName); boolean throwsException = false; try { table.get(get); } catch (TableNotEnabledException e) { throwsException = true; } Assert.assertTrue(throwsException); admin.enableTable(tableName); table.get(get); }</code><technical_language>If a test is disable table (or do interfere other tests), prefer a new created. Though, I aware of wanting limit table creation</technical_language>

Target:
public void testDisable() throws IOException { Admin admin = connection.getAdmin(); TableName tableName = TableName.valueOf("test_table-" + UUID.randomUUID().toString()); IntegrationTests.CreateTable(tableName); Table table = connection.getTable(tableName); Get get = new Get("row".getBytes()); table.get(get); admin.disableTable(tableName); boolean throwsException = false; try { table.get(get); } catch (TableNotEnabledException e) { throwsException = true; } Assert.assertTrue(throwsException); admin.enableTable(tableName); table.get(get); }
Source:
<code>List<IRemoteTest> createIndividualTests(Set<TestInfo> testInfos, String configPath) { CLog.i("Creating individual tests for configuration: %s", configPath); List<IRemoteTest> tests = new ArrayList<>(); if (configPath == null) { <START> throw new RuntimeException(String.format("Configuration path is null.")); <END> } File configFie = new File(configPath); if (!configFie.exists()) { throw new RuntimeException( String.format("Configuration path: %s doesn't exits.", configPath)); } testInfos = dedupTestInfos(testInfos); for (TestInfo testInfo : testInfos) { super.cleanUpSuiteSetup(); super.clearModuleArgs(); super.clearConfigPaths(); super.addConfigPaths(configFie); parseOptions(testInfo); LinkedHashMap<String, IConfiguration> config = super.loadTests(); for (Map.Entry<String, IConfiguration> entry : config.entrySet()) { tests.addAll(entry.getValue().getTests()); } } return tests; }</code><technical_language>Assert.assertNotNull(configPath)</technical_language>

Target:
List<IRemoteTest> createIndividualTests(Set<TestInfo> testInfos, String configPath) { CLog.i("Creating individual tests for configuration: %s", configPath); List<IRemoteTest> tests = new ArrayList<>(); assertNotNull(configPath); File configFie = new File(configPath); if (!configFie.exists()) { throw new RuntimeException( String.format("Configuration path: %s doesn't exits.", configPath)); } testInfos = dedupTestInfos(testInfos); for (TestInfo testInfo : testInfos) { super.cleanUpSuiteSetup(); super.clearModuleArgs(); super.clearConfigPaths(); super.addConfigPaths(configFie); parseOptions(testInfo); LinkedHashMap<String, IConfiguration> config = super.loadTests(); for (Map.Entry<String, IConfiguration> entry : config.entrySet()) { tests.addAll(entry.getValue().getTests()); } } return tests; }
Source:
<code>static <T, R> WorkProcessor<R> transform(WorkProcessor<T> processor, Transformation<T, R> transformation) { return create(new WorkProcessor.Process<R>() { Optional<T> element = Optional.empty(); @Override public ProcessorState<R> process() { while (true) { if (!element.isPresent() && !processor.isFinished()) { if (processor.process()) { if (!processor.isFinished()) { element = Optional.of(processor.getResult()); } } else if (processor.isBlocked()) { return ProcessorState.blocked(processor.getBlockedFuture()); } else { return ProcessorState.yield(); } } ProcessorState<R> state = requireNonNull(transformation.process(element), "state is null"); if (state.needsMoreData) { <START> checkState(!processor.isFinished(), "Cannot request more data when base processor is finished"); <END> element = Optional.empty(); } if (state.type != ProcessorState.Type.NEEDS_MORE_DATA) { return state; } } } }); }</code><technical_language>transoromation is processing (Optional) present element element. IMO nice easier if Transformation method read consumed output</technical_language>

Target:
static <T, R> WorkProcessor<R> transform(WorkProcessor<T> processor, Transformation<T, R> transformation) { return create(new WorkProcessor.Process<R>() { Optional<T> element = Optional.empty(); @Override public ProcessorState<R> process() { while (true) { if (!element.isPresent() && !processor.isFinished()) { if (processor.process()) { if (!processor.isFinished()) { element = Optional.of(processor.getResult()); } } else if (processor.isBlocked()) { return ProcessorState.blocked(processor.getBlockedFuture()); } else { return ProcessorState.yield(); } } ProcessorState<R> state = requireNonNull(transformation.process(element), "state is null"); if (state.isNeedsMoreData()) { checkState(!processor.isFinished(), "Cannot request more data when base processor is finished"); element = Optional.empty(); } if (state.getType() != NEEDS_MORE_DATA) { return state; } } } }); }
Source:
<code>public static void testGetAllActivitiesPaginated() throws MambuApiException{ String methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); ActivitiesService activitiesService = MambuAPIFactory.getActivitiesService(); Calendar toDate = Calendar.getInstance(); Calendar fromDate = Calendar.getInstance(); fromDate.add(Calendar.DAY_OF_MONTH, -10); <START> List<JSONActivity> jsonActivities = activitiesService.getActivities(fromDate.getTime(), toDate.getTime(), <END> null, null, 0, 5); printMambuEntityAndActivitiesDetails(null, null, jsonActivities, fromDate.getTime(), toDate.getTime()); }</code><technical_language>point test method public List<JSONActivity> getActivities(Date fromDate, Date toDate, Integer offset, Integer limit) throws MambuApiException ActivitiesService, parameters, is public partners. Indeed, scenes calls overloaded method, sending null values for mambuEntity entityId, respectively, a test for in DemoTestActivitiesService.java</technical_language>

Target:
public static void testGetAllActivitiesPaginated() throws MambuApiException{ String methodName = new Object() {}.getClass().getEnclosingMethod().getName(); System.out.println(methodName = "\nIn " + methodName); ActivitiesService activitiesService = MambuAPIFactory.getActivitiesService(); Calendar toDate = Calendar.getInstance(); Calendar fromDate = Calendar.getInstance(); fromDate.add(Calendar.DAY_OF_MONTH, -10); List<JSONActivity> jsonActivities = activitiesService.getActivities(fromDate.getTime(), toDate.getTime(), 0, 5); printMambuEntityAndActivitiesDetails(null, null, jsonActivities, fromDate.getTime(), toDate.getTime()); }
Source:
<code>public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents.isEmpty()) { <START> setScopeAwareComponents(); <END> } return scopeAwareComponents.stream(); }</code><technical_language>prefix set is commonly for property setters. avoid confusion, I suggest initializeScopeAwareComponents, lookupScopeAwareComponents</technical_language>

Target:
public Stream<ScopeAware> provideScopeAwareStream(ScopeDescriptor scopeDescriptor) { if (scopeAwareComponents.isEmpty()) { lookupScopeAwareComponents(); } return scopeAwareComponents.stream(); }
Source:
<code>public void insert(final List<ProcessedAccessRecord> batch) { transactionTemplate.execute(new TransactionCallback<Void>() { @Override public Void doInTransaction(TransactionStatus status) { template.batchUpdate(INSERT, new BatchPreparedStatementSetter() { @Override public int getBatchSize() { return batch.size(); } @Override public void setValues(PreparedStatement ps, int i) throws SQLException { ProcessedAccessRecord par = batch.get(i); ps.setString(1, par.getSessionId()); ps.setLong(2, par.getTimestamp()); if (par.getEntityId() != null) { ps.setLong(3, par.getEntityId()); ps.setLong(7, par.getEntityId()); } else { ps.setNull(3, Types.BIGINT); ps.setNull(7, Types.BIGINT); } ps.setString(4, par.getClient().name()); ps.setString(8, par.getClient().name()); <START> if (par.getClientVersion() != null) { <END> ps.setLong(5, par.getEntityId()); ps.setLong(9, par.getEntityId()); } else { ps.setNull(5, Types.CHAR); ps.setNull(9, Types.CHAR); } ps.setString(6, par.getNormalizedMethodSignature()); ps.setString(10, par.getNormalizedMethodSignature()); } }); return null; } }); }</code><technical_language>please consider defining constants for column indices</technical_language>

Target:
public void insert(final List<ProcessedAccessRecord> batch) { transactionTemplate.execute(new TransactionCallback<Void>() { @Override public Void doInTransaction(TransactionStatus status) { template.batchUpdate(INSERT, new BatchPreparedStatementSetter() { @Override public int getBatchSize() { return batch.size(); } @Override public void setValues(PreparedStatement ps, int i) throws SQLException { ProcessedAccessRecord par = batch.get(i); ps.setString(INSERT_SESSION_ID_INDEX, par.getSessionId()); ps.setLong(INSERT_TIMESTAMP_INDEX, par.getTimestamp()); if (par.getEntityId() != null) { ps.setLong(INSERT_ENTITY_ID_INDEX, par.getEntityId()); ps.setLong(UPDATE_ENTITY_ID_INDEX, par.getEntityId()); } else { ps.setNull(INSERT_ENTITY_ID_INDEX, Types.BIGINT); ps.setNull(UPDATE_ENTITY_ID_INDEX, Types.BIGINT); } ps.setString(INSERT_CLIENT_INDEX, par.getClient().name()); ps.setString(UPDATE_CLIENT_INDEX, par.getClient().name()); if (par.getClientVersion() != null) { ps.setString(INSERT_CLIENT_VERSION_INDEX, par.getClientVersion()); ps.setString(UPDATE_CLIENT_VERSION_INDEX, par.getClientVersion()); } else { ps.setNull(INSERT_CLIENT_VERSION_INDEX, Types.CHAR); ps.setNull(UPDATE_CLIENT_VERSION_INDEX, Types.CHAR); } ps.setString(INSERT_NMS_INDEX, par.getNormalizedMethodSignature()); ps.setString(UPDATE_NMS_INDEX, par.getNormalizedMethodSignature()); } }); return null; } }); }
Source:
<code>private boolean readAndHandle(InputStream inputStream, PodLogHandler handler) { <START> if (inputStream == null) { <END> LOG.debug( "Given InputStream for reading the logs for '{} {}' is null.", namespace, podName, containerName); return false; } try (BufferedReader in = new BufferedReader(new InputStreamReader(inputStream))) { String logMessage; while ((logMessage = in.readLine()) != null) { if (!this.isErrorMessage(logMessage)) { handler.handle(logMessage, containerName); } else { LOG.debug("error message [{}]", logMessage); LOG.debug( "failed to get the logs for [{} : {}], should try again if enough time.", podName, containerName); return false; } } } catch (IOException e) { LOG.debug( "End of watching log of [{} : : {}]. It could be either intended or some connection failure.", namespace, podName, containerName); LOG.trace("End of watching log of [{} : : {}]", namespace, podName, containerName, e); } return true; }</code><technical_language>responsibility of caller</technical_language>

Target:
private boolean readAndHandle(InputStream inputStream, PodLogHandler handler) { try (BufferedReader in = new BufferedReader(new InputStreamReader(inputStream))) { String logMessage; while ((logMessage = in.readLine()) != null) { if (!this.isErrorMessage(logMessage)) { handler.handle(logMessage, containerName); } else { LOG.debug("error message [{}]", logMessage); LOG.debug( "failed to get the logs for [{} : {}], should try again if enough time.", podName, containerName); return false; } } } catch (IOException e) { LOG.debug( "End of watching log of [{} : : {}]. It could be either intended or some connection failure.", namespace, podName, containerName); LOG.trace("End of watching log of [{} : : {}]", namespace, podName, containerName, e); } return true; }
Source:
<code>protected String findMimeType(String uploadFileName) { String mimeType = URLConnection.guessContentTypeFromName(uploadFileName); if (StringUtils.isEmpty(mimeType)) { LOG.error("findMimeType, could not determine mime type from file name using URLConnection object. the file name is " + uploadFileName); String[] splitFileName = StringUtils.split(uploadFileName, "."); if (splitFileName != null) { <START> int lastArrayElement = splitFileName.length - 1; <END> if (lastArrayElement > -1) { mimeType = splitFileName[lastArrayElement]; LOG.info("findMimeType, determined mime type from file name's last extension value: " + mimeType); } else { LOG.error("findMimeType, could not parse the file name, setting mime type to empty string"); mimeType = StringUtils.EMPTY; } } } return StringUtils.lowerCase(mimeType); }</code><technical_language>This variable renamed, clear holds element index element itself</technical_language>

Target:
protected String findMimeType(String uploadFileName) { if (StringUtils.isBlank(uploadFileName)) { return StringUtils.EMPTY; } String mimeType = URLConnection.guessContentTypeFromName(uploadFileName); if (StringUtils.isBlank(mimeType)) { LOG.error("findMimeType, could not determine mime type from file name using URLConnection object. the file name is " + uploadFileName); String[] splitFileName = StringUtils.split(uploadFileName, "."); if (splitFileName != null) { int lastArrayElementIndex = splitFileName.length - 1; if (lastArrayElementIndex > -1) { mimeType = splitFileName[lastArrayElementIndex]; LOG.info("findMimeType, determined mime type from file name's last extension value: " + mimeType); } else { LOG.error("findMimeType, could not parse the file name, setting mime type to empty string"); mimeType = StringUtils.EMPTY; } } } return StringUtils.lowerCase(mimeType); }
Source:
<code>public DB allocateDB(final int expiryMinutes) { final String versionPostgreSQLDriver = System.getProperty("version.postgresql"); if (StringUtils.isEmpty(versionPostgreSQLDriver)) { throw new IllegalArgumentException("version.postgresql must not be empty"); } final String user = System.getProperty("pgsql.user"); if (StringUtils.isEmpty(user)) { throw new IllegalArgumentException("pgsql.user must not be empty"); } final String password = System.getProperty("pgsql.password"); if (StringUtils.isEmpty(password)) { throw new IllegalArgumentException("pgsql.password must not be empty"); } final String servername = System.getProperty("pgsql.servername"); if (StringUtils.isEmpty(servername)) { throw new IllegalArgumentException("pgsql.servername must not be empty"); } final String portnumber = System.getProperty("pgsql.portnumber"); final int port; if (StringUtils.isEmpty(portnumber)) { throw new IllegalArgumentException("pgsql.portnumber must not be empty"); } else { port = Integer.parseInt(portnumber); <START> if (port > 65535 || port < 1025) { <END> throw new IllegalArgumentException("pgsql.portnumber out of expected range [1025, 65535]"); } } final String databasename = System.getProperty("pgsql.databasename"); if (StringUtils.isEmpty(databasename)) { throw new IllegalArgumentException("pgsql.databasename must not be empty"); } return new DB.Builder() .dsType("org.postgresql.xa.PGXADataSource") .dsUsername(user) .dsUser(user) .dsPassword(password) .dsDbName(databasename) .dsDbPort(String.valueOf(port)) .dsDbHostname(servername) .dsUrl(String.format("jdbc:postgresql://%s:%d/%s", servername, port, databasename)) .dsLoginTimeout("0") .dsFactory("org.postgresql.xa.PGXADataSourceFactory") .tdsType("javax.sql.XADataSource") .dbDriverArtifact("postgresql:postgresql:" + versionPostgreSQLDriver) .build(); }</code><technical_language>I a bad behaviour run port 1025 know. I personally vote checking range leave user handle himself</technical_language>

Target:
public DB allocateDB(final int expiryMinutes) { final String versionPostgreSQLDriver = getProp("version.postgresql"); final String user = getProp("pgsql.user"); final String password = getProp("pgsql.password"); final String servername = getProp("pgsql.servername"); final String portnumber = getProp("pgsql.portnumber"); final int port = Integer.parseInt(portnumber); if (port > 65535 || port < 1025) { throw new IllegalArgumentException("pgsql.portnumber out of expected range [1025, 65535]"); } final String databasename = getProp("pgsql.databasename"); return new DB.Builder() .dsType("org.postgresql.xa.PGXADataSource") .dsUsername(user) .dsUser(user) .dsPassword(password) .dsDbName(databasename) .dsDbPort(String.valueOf(port)) .dsDbHostname(servername) .dsUrl(String.format("jdbc:postgresql://%s:%d/%s", servername, port, databasename)) .dsLoginTimeout("0") .dsFactory("org.postgresql.xa.PGXADataSourceFactory") .tdsType("javax.sql.XADataSource") .dbDriverArtifact("postgresql:postgresql:" + versionPostgreSQLDriver) .build(); }
Source:
<code>public List<SurveyedLocale> getDataPointList(Long surveyId, Long deviceId) { List<DataPointAssignment> assList = dataPointAssignmentDao.listByDeviceAndSurvey(deviceId, surveyId); if (assList.isEmpty()) { SurveyAssignmentDao saDao = new SurveyAssignmentDao(); List<SurveyAssignment> allAssigmentsToDevice = saDao.listAllContainingDevice(deviceId); List<SurveyAssignment> filteredAssignments = allAssigmentsToDevice.stream().filter(assignment -> assignment.getSurveyId().equals(surveyId)).collect(Collectors.toList()); if (filteredAssignments.isEmpty()) { <START> return Collections.emptyList(); <END> } return surveyedLocaleDao.listLocalesBySurveyGroupId(surveyId); } Set<Long> pointSet = new HashSet<>(); for (DataPointAssignment ass : assList) { pointSet.addAll(ass.getDataPointIds()); } if (ALL_DATAPOINTS.equals(pointSet)) { return surveyedLocaleDao.listLocalesBySurveyGroupId(surveyId); } List<Long> pointList = new ArrayList<>(pointSet); return surveyedLocaleDao.listByKeys(pointList); }</code><technical_language>This branch exceptional one.. log some kind of error here. is a survey a device attempting retrieve assignment find</technical_language>

Target:
public List<SurveyedLocale> getDataPointList(Long surveyId, Long deviceId) { List<DataPointAssignment> assList = dataPointAssignmentDao.listByDeviceAndSurvey(deviceId, surveyId); if (assList.isEmpty()) { SurveyAssignmentDao saDao = new SurveyAssignmentDao(); List<SurveyAssignment> allAssigmentsToDevice = saDao.listAllContainingDevice(deviceId); List<SurveyAssignment> filteredAssignments = allAssigmentsToDevice.stream().filter(assignment -> assignment.getSurveyId().equals(surveyId)).collect(Collectors.toList()); if (filteredAssignments.isEmpty()) { log.log(Level.SEVERE, "No assignment found for surveyId: " + surveyId + " - deviceId: " + deviceId); return null; } return surveyedLocaleDao.listLocalesBySurveyGroupId(surveyId); } Set<Long> pointSet = new HashSet<>(); for (DataPointAssignment ass : assList) { pointSet.addAll(ass.getDataPointIds()); } if (ALL_DATAPOINTS.equals(pointSet)) { return surveyedLocaleDao.listLocalesBySurveyGroupId(surveyId); } List<Long> pointList = new ArrayList<>(pointSet); return surveyedLocaleDao.listByKeys(pointList); }
Source:
<code>public String visit(SystemStreamPartition systemStreamPartition, StartpointTimestamp startpointTimestamp) { Preconditions.checkNotNull(startpointTimestamp, "Startpoint cannot be null"); Preconditions.checkNotNull(startpointTimestamp.getTimestampOffset(), "Timestamp field in startpoint cannot be null"); TopicPartition topicPartition = toTopicPartition(systemStreamPartition); Map<TopicPartition, Long> topicPartitionToTimestamp = ImmutableMap.of(topicPartition, startpointTimestamp.getTimestampOffset()); LOG.info("Finding offset for timestamp: in topic partition: {}.", startpointTimestamp.getTimestampOffset(), topicPartition); Map<TopicPartition, OffsetAndTimestamp> topicPartitionToOffsetTimestamps = threadSafeKafkaConsumer.execute(consumer -> consumer.offsetsForTimes(topicPartitionToTimestamp)); OffsetAndTimestamp offsetAndTimestamp = topicPartitionToOffsetTimestamps.get(topicPartition); if (offsetAndTimestamp != null) { return String.valueOf(offsetAndTimestamp.offset()); } else { <START> return getEndOffset(systemStreamPartition); <END> } }</code><technical_language>a log message useful here</technical_language>

Target:
public String visit(SystemStreamPartition systemStreamPartition, StartpointTimestamp startpointTimestamp) { Preconditions.checkNotNull(startpointTimestamp, "Startpoint cannot be null"); Preconditions.checkNotNull(startpointTimestamp.getTimestampOffset(), "Timestamp field in startpoint cannot be null"); TopicPartition topicPartition = toTopicPartition(systemStreamPartition); Map<TopicPartition, Long> topicPartitionToTimestamp = ImmutableMap.of(topicPartition, startpointTimestamp.getTimestampOffset()); LOG.info("Finding offset for timestamp: in topic partition: {}.", startpointTimestamp.getTimestampOffset(), topicPartition); Map<TopicPartition, OffsetAndTimestamp> topicPartitionToOffsetTimestamps = threadSafeKafkaConsumer.execute(consumer -> consumer.offsetsForTimes(topicPartitionToTimestamp)); OffsetAndTimestamp offsetAndTimestamp = topicPartitionToOffsetTimestamps.get(topicPartition); if (offsetAndTimestamp != null) { return String.valueOf(offsetAndTimestamp.offset()); } else { LOG.info("Offset for timestamp: does not exist for partition: {}. Falling back to end offset.", startpointTimestamp.getTimestampOffset(), topicPartition); return getEndOffset(systemStreamPartition); } }
Source:
<code>@Test public void annotation() throws Exception { TypeSpec annotation = TypeSpec.annotationBuilder("MyAnnotation") .addModifiers(Modifier.PUBLIC) .addMethod(MethodSpec.methodBuilder("test") .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT) .initializer("$L", 0) .returns(int.class) .build()) .build(); assertThat(toString(annotation)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "public @interface MyAnnotation {\n" <START> + " int test() default 0;\n" <END> + "}\n" ); }</code><technical_language>good ideas :+1:</technical_language>

Target:
@Test public void annotation() throws Exception { TypeSpec annotation = TypeSpec.annotationBuilder("MyAnnotation") .addModifiers(Modifier.PUBLIC) .addMethod(MethodSpec.methodBuilder("test") .addModifiers(Modifier.PUBLIC, Modifier.ABSTRACT) .defaultValue("$L", 0) .returns(int.class) .build()) .build(); assertThat(toString(annotation)).isEqualTo("" + "package com.squareup.tacos;\n" + "\n" + "public @interface MyAnnotation {\n" + " int test() default 0;\n" + "}\n" ); }
Source:
<code>protected String getId() { <START> return "GNU C compiler 4 (ld)"; <END> }</code><technical_language>ID is restore files (from older release) this changed</technical_language>

Target:
protected String getId() { return "GNU compiler 4 (ld)"; }
Source:
<code>private MetadataInterface createMetadataForLogicalPageNumber(int currentPhysicalOrder, String defaultPagination) throws MetadataTypeNotAllowedException { <START> MetadataTypeInterface metadataTypeInterface = this.myPrefs.getMetadataTypeByName("logicalPageNumber"); <END> MetadataInterface metadataInterface = UghImplementation.INSTANCE.createMetadata(metadataTypeInterface); metadataInterface.setStringValue(determinePagination(currentPhysicalOrder, defaultPagination)); return metadataInterface; }</code><technical_language>Interface appended variable name</technical_language>

Target:
private MetadataInterface createMetadataForLogicalPageNumber(int currentPhysicalOrder, String defaultPagination) throws MetadataTypeNotAllowedException { MetadataTypeInterface metadataType = this.myPrefs.getMetadataTypeByName("logicalPageNumber"); MetadataInterface metadata = UghImplementation.INSTANCE.createMetadata(metadataType); metadata.setStringValue(determinePagination(currentPhysicalOrder, defaultPagination)); return metadata; }
Source:
<code>private String getExternalSSOProvider(){ try { return properties.getProperty(USERGRID_EXTERNAL_PROVIDER); } <START> catch(NullPointerException e ){ <END> throw new IllegalArgumentException("External SSO provider is enabled but the provider name is empty"); } }</code><technical_language>I this throw NPE return null caller of getExternalSSOProvider()</technical_language>

Target:
private String getExternalSSOProvider(){ return properties.getProperty(USERGRID_EXTERNAL_PROVIDER); }