auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void assertAllInstructorSessionsMatch(FeedbackSessionsData sessionsData, List<FeedbackSessionAttributes> expectedSessions) { <START> for (FeedbackSessionData sessionData : sessionsData.getFeedbackSessions()) { <END> List<FeedbackSessionAttributes> matchedSessions = expectedSessions.stream().filter(session -> session.getFeedbackSessionName().equals( sessionData.getFeedbackSessionName()) && session.getCourseId().equals(sessionData.getCourseId())).collect(Collectors.toList()); assertEquals(1, matchedSessions.size()); assertAllInformationMatch(sessionData, matchedSessions.get(0)); } }</code><technical_language>check size of same</technical_language>

Target:
private void assertAllInstructorSessionsMatch(FeedbackSessionsData sessionsData, List<FeedbackSessionAttributes> expectedSessions) { assertEquals(sessionsData.getFeedbackSessions().size(), expectedSessions.size()); for (FeedbackSessionData sessionData : sessionsData.getFeedbackSessions()) { List<FeedbackSessionAttributes> matchedSessions = expectedSessions.stream().filter(session -> session.getFeedbackSessionName().equals( sessionData.getFeedbackSessionName()) && session.getCourseId().equals(sessionData.getCourseId())).collect(Collectors.toList()); assertEquals(1, matchedSessions.size()); assertAllInformationMatch(sessionData, matchedSessions.get(0)); } }
Source:
<code>public void deserializeColumn(final ByteBuffer buffer, final ColumnBuilder builder) { <START> final GenericIndexed<DoublesSketch> column = GenericIndexed.read(buffer, strategy); <END> builder.setComplexColumn(new ComplexColumnPartSupplier(getTypeName(), column)); }</code><technical_language>GenericIndexed.read(buffer, strategy, builder.getFileMapper()) similar thetaSketch enable largeColumns. Override getSerializer method @Override public GenericColumnSerializer getSerializer(IOPeon peon, String column) { return LargeColumnSupportedComplexColumnSerializer.create(peon, column, this.getObjectStrategy()); }</technical_language>

Target:
public void deserializeColumn(final ByteBuffer buffer, final ColumnBuilder builder) { final GenericIndexed<DoublesSketch> column = GenericIndexed.read(buffer, strategy, builder.getFileMapper()); builder.setComplexColumn(new ComplexColumnPartSupplier(getTypeName(), column)); }
Source:
<code>private LoginContext createLoginContext(final String loginConfig, final Subject subject, final CallbackHandler handler) throws RealmUnavailableException { if (WildFlySecurityManager.isChecking()) { try { <START> return AccessController.doPrivileged(new CreateLoginContextAction(loginConfig, subject, handler)); <END> } catch (PrivilegedActionException pae) { throw ElytronMessages.log.failedToCreateLoginContext(pae.getCause()); } } else { try { return new LoginContext(loginConfig, subject, handler); } catch (LoginException le) { throw ElytronMessages.log.failedToCreateLoginContext(le); } } }</code><technical_language>some point I change this, is critical for this pull request I prefer a pattern code privileged action is for non-privileged case. I find a bug a while code is split this diverged ended a bug security manager enabled</technical_language>

Target:
private LoginContext createLoginContext(final String loginConfig, final Subject subject, final CallbackHandler handler) throws RealmUnavailableException { if (WildFlySecurityManager.isChecking()) { try { return AccessController.doPrivileged((PrivilegedExceptionAction<LoginContext>) () -> new LoginContext(loginConfig, subject, handler)); } catch (PrivilegedActionException pae) { throw ElytronMessages.log.failedToCreateLoginContext(pae.getCause()); } } else { try { return new LoginContext(loginConfig, subject, handler); } catch (LoginException le) { throw ElytronMessages.log.failedToCreateLoginContext(le); } } }
Source:
<code>public int run(TestScenario testScenario) { if (testScenario.getEnvironment().getDockerCompose() != null && testScenario.getEnvironment().getImage() != null) { <START> throw new IllegalArgumentException("Ambiguous environment: defined docker image and docker-compose"); <END> } System.out.println("Starting test scenario: " + testScenario); int successfulTestCases = 0; for (TestCase test: testScenario.getTests()) { if (test.isSkip()) { continue; } TestEnvironmentExecutor testEnvironmentExecutor = testEnvironmentExecutor(testScenario); try { runTestCase(testScenario, test, testEnvironmentExecutor); successfulTestCases++; } catch (TestFailException ex) { System.out.println("Test case failed: " + ex.toString()); System.out.println(ex.getMessage()); ex.printStackTrace(); } testEnvironmentExecutor.close(); } return successfulTestCases; }</code><technical_language>"Ambiguous environment: 'docker image' 'docker compose' defined, expect of defined!"</technical_language>

Target:
public int run(TestScenario testScenario) { if (testScenario.getEnvironment().getDockerCompose() != null && testScenario.getEnvironment().getImage() != null) { throw new IllegalArgumentException("Ambiguous environment: defined docker image and docker-compose" + ", but we expect only one of them to be defined!"); } log.info(String.format("Starting test scenario: %s", testScenario)); int successfulTestCases = 0; for (TestCase test: testScenario.getTests()) { if (test.isSkip()) { continue; } TestEnvironmentExecutor testEnvironmentExecutor = createTestEnvironmentExecutor(testScenario); try { runTestCase(testScenario, test, testEnvironmentExecutor); successfulTestCases++; } catch (TestFailException ex) { log.severe(String.format("Test case failed: %s\n%s", ex.toString(), ex.getMessage())); ex.printStackTrace(); } testEnvironmentExecutor.close(); } return successfulTestCases; }
Source:
<code>protected boolean clearLastAddedTripPattern(String feedId) { <START> return lastAddedTripPattern.keySet().removeAll(lastAddedTripPattern.keySet().stream() <END> .filter(lastAddedTripPattern -> feedId.equals(lastAddedTripPattern.getFeedId())) .collect(Collectors.toSet())); }</code><technical_language>a removeIf more efficient</technical_language>

Target:
protected boolean clearLastAddedTripPattern(String feedId) { return lastAddedTripPattern.keySet().removeIf(lastAddedTripPattern -> feedId.equals(lastAddedTripPattern.getFeedId())); }
Source:
<code>public PdpFeedPayeeIdEntry buildPayeeIdEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedPayeeIdEntry payeeIdEntry = new PdpFeedPayeeIdEntry(); payeeIdEntry.setContent(line.getEmployeeId()); if (StringUtils.equalsIgnoreCase(line.getEmployeeStatus(), ConcurConstants.StandardAccountingExtractPdpConstants.EMPLOYEE_STATUS_CODE)) { payeeIdEntry.setIdType(ConcurConstants.StandardAccountingExtractPdpConstants.EMPLOYEE_PAYEE_STATUS_TYPE_CODE); } else { <START> payeeIdEntry.setIdType(ConcurConstants.StandardAccountingExtractPdpConstants.NON_EMPLOYEE_PAYEE_STATUS_TYPE_CODE); <END> } return payeeIdEntry; }</code><technical_language>assuming other values equal EMPLOYEE set Y. spec for SAE request extract data of "NON-EMPLOYEE" set Y. this implies other values Concur in column besides EMPLOYEE NON-EMPLOYEE. Thoughts</technical_language>

Target:
public PdpFeedPayeeIdEntry buildPayeeIdEntry(ConcurStandardAccountingExtractDetailLine line) { PdpFeedPayeeIdEntry payeeIdEntry = new PdpFeedPayeeIdEntry(); payeeIdEntry.setContent(line.getEmployeeId()); if (StringUtils.equalsIgnoreCase(line.getEmployeeStatus(), ConcurConstants.StandardAccountingExtractPdpConstants.EMPLOYEE_STATUS_CODE)) { payeeIdEntry.setIdType(ConcurConstants.StandardAccountingExtractPdpConstants.EMPLOYEE_PAYEE_STATUS_TYPE_CODE); } else if (StringUtils.equalsIgnoreCase(line.getEmployeeStatus(), ConcurConstants.StandardAccountingExtractPdpConstants.NON_EMPLOYEE_STATUS_CODE)) { payeeIdEntry.setIdType(ConcurConstants.StandardAccountingExtractPdpConstants.NON_EMPLOYEE_PAYEE_STATUS_TYPE_CODE); } else { LOG.error("buildPayeeIdEntry, Unable to to set the payee ID type based do the line's employee status " + line.getEmployeeStatus()); } return payeeIdEntry; }
Source:
<code>public List<EmpiLink> findEmpiLinksByTarget(Patient theTargetResource) { <START> @Nullable Long pid = myIdHelperService.getPidOrNull(theTargetResource); <END> if (pid == null) { return Collections.emptyList(); } EmpiLink empiLink = new EmpiLink().setTargetPid(pid); Example<EmpiLink> example = Example.of(empiLink); return myEmpiLinkDao.findAll(example); }</code><technical_language>this nullable annotation provide here? I surface of API, impl</technical_language>

Target:
public List<EmpiLink> findEmpiLinksByTarget(Patient theTargetResource) { Long pid = myIdHelperService.getPidOrNull(theTargetResource); if (pid == null) { return Collections.emptyList(); } EmpiLink empiLink = new EmpiLink().setTargetPid(pid); Example<EmpiLink> example = Example.of(empiLink); return myEmpiLinkDao.findAll(example); }
Source:
<code>protected void executeCommand() { <START> boolean succeeded = true; <END> final SetUpMountBrokerParameters parameters = getParameters(); final List<Callable<VDSReturnValue>> mountBrokerSetupReturnStatuses = new ArrayList<>(); for(final Guid currentRemoteServerId : getParameters().getRemoteServerIds()) { mountBrokerSetupReturnStatuses.add(new Callable<VDSReturnValue>() { @Override public VDSReturnValue call() throws Exception { return getCurrentMountBrokerSetUpCallable(currentRemoteServerId, parameters.getRemoteUserName(), parameters.getRemoteUserGroup(), parameters.getRemoteVolumeName(), parameters.isPartial()); } }); } List<VDSReturnValue> returnValues = ThreadPoolUtil.invokeAll(mountBrokerSetupReturnStatuses); List<String> errors = new ArrayList<String>(); for (VDSReturnValue currentReturnValue : returnValues) { if (!currentReturnValue.getSucceeded()) { succeeded = false; errors.add(getVdsDAO().get(currentReturnValue.getVdsError().getVdsId()).getName() + " " + currentReturnValue.getVdsError().getMessage()); } } if (!errors.isEmpty()) { propagateFailure(AuditLogType.GLUSTER_GEOREP_SETUP_MOUNT_BROKER_FAILED, errors); } setSucceeded(succeeded); }</code><technical_language>Please format class</technical_language>

Target:
protected void executeCommand() { boolean succeeded = true; final SetUpMountBrokerParameters parameters = getParameters(); final List<Callable<VDSReturnValue>> mountBrokerSetupReturnStatuses = new ArrayList<>(); for (final Guid currentRemoteServerId : getParameters().getRemoteServerIds()) { mountBrokerSetupReturnStatuses.add(new Callable<VDSReturnValue>() { @Override public VDSReturnValue call() throws Exception { return setUpMountBrokerPartial(currentRemoteServerId, parameters.getRemoteUserName(), parameters.getRemoteUserGroup(), parameters.getRemoteVolumeName(), parameters.isPartial()); } }); } List<VDSReturnValue> returnValues = ThreadPoolUtil.invokeAll(mountBrokerSetupReturnStatuses); List<String> errors = new ArrayList<String>(); for (VDSReturnValue currentReturnValue : returnValues) { if (!currentReturnValue.getSucceeded()) { succeeded = false; errors.add(currentReturnValue.getVdsError().getMessage()); } } if (!errors.isEmpty()) { propagateFailure(AuditLogType.GLUSTER_GEOREP_SETUP_MOUNT_BROKER_FAILED, errors); } setSucceeded(succeeded); }
Source:
<code>public final void onOpen(final SocketSession iSession) { failedStarts = 0; started = true; reachedEof = false; connected = true; queing = false; this.session = iSession; <START> LOG.info("Connection was succesful for: ", this.getClass().getSimpleName()); <END> }</code><technical_language>add {}</technical_language>

Target:
public final void onOpen(final SocketSession iSession) { failedStarts = 0; started = true; reachedEof = false; connected = true; queing = false; this.session = iSession; LOG.info("Connection was succesful for: {}", this.getClass().getSimpleName()); }
Source:
<code>protected void keepBackwardCompatibility() { if (classifications == null) { classifications = new LinkedList<>(); } if (sortingMethod == null) { sortingMethod = SortingMethod.NATURAL.name(); } if (reportTitle == null) { <START> reportTitle = ""; <END> } if (StringUtils.isEmpty(directoryQualifier)) { directoryQualifier = CucumberReportPublisher.DEFAULT_DIRECTORY_QUALIFIER; } }</code><technical_language>consider StringUtils.defaultString</technical_language>

Target:
protected void keepBackwardCompatibility() { if (classifications == null) { classifications = new ArrayList<>(); } if (sortingMethod == null) { sortingMethod = SortingMethod.NATURAL.name(); } reportTitle = StringUtils.defaultString(reportTitle); }
Source:
<code>private SIPDialog findSIPDialogFromInjectionListeners(String dialogId) { SIPDialog dialog = null; <START> synchronized (dialogInjectionListeners) { <END> for(SIPDialogInjectionListener listener : dialogInjectionListeners) { SIPDialog tempDialog = listener.getExternalSIPDialog(dialogId); if(tempDialog != null && tempDialog.getDialogId().equals(dialogId)) { dialog = tempDialog; break; } } } return dialog; }</code><technical_language>kind of concurrent access sync? In this case, prevent multiple invocations findSIPDialogFromInjectionListeners concurrent?if yes, why, readOnly scenario? If sync add/remove writing scenarios, iterator is protected concurrent modifcation, shouldnt synchronize scenarios well? Is becuase subsequent invocation "putDialog"? if yes, why? dialogTable synced a concurrent Map</technical_language>

Target:
private SIPDialog findSIPDialogFromInjectionListeners(String dialogId) { SIPDialog dialog = null; for(SIPDialogInjectionListener listener : dialogInjectionListeners) { SIPDialog tempDialog = listener.getExternalSIPDialog(dialogId); if(tempDialog != null && tempDialog.getDialogId().equals(dialogId)) { dialog = tempDialog; break; } } return dialog; }
Source:
<code>public void run(TaskSource taskSource, Schema schema, FileInput input, PageOutput output) { PluginTask task = taskSource.loadTask(PluginTask.class); final boolean stopOnInvalidRecord = task.getStopOnInvalidRecord(); final Column column = schema.getColumn(0); try (PageBuilder pageBuilder = newPageBuilder(schema, output); FileInputInputStream in = new FileInputInputStream(input)) { while (in.nextFile()) { Exec.getLogger(JsonParserPlugin.class).info("Loading file [{}]", input.hintOfInputFileNameForLogging().orElse("-")); <START> <END> boolean evenOneJsonParsed = false; try (JsonParser.Stream stream = newJsonStream(in, task)) { Value value; while ((value = stream.next()) != null) { try { if (!value.isMapValue()) { throw new JsonRecordValidateException( String.format("A Json record must not represent map value but it's %s", value.getValueType().name())); } pageBuilder.setJson(column, value); pageBuilder.addRecord(); evenOneJsonParsed = true; } catch (JsonRecordValidateException e) { if (stopOnInvalidRecord) { throw new DataException(String.format("Invalid record: %s", value.toJson()), e); } log.warn(String.format("Skipped record (%s): %s", e.getMessage(), value.toJson())); } } } catch (IOException | JsonParseException e) { if (Exec.isPreview() && evenOneJsonParsed) { break; } throw new DataException(e); } } pageBuilder.finish(); } }</code><technical_language>CSV Parser. file name information additional hint for existing parse error logs</technical_language>

Target:
public void run(TaskSource taskSource, Schema schema, FileInput input, PageOutput output) { PluginTask task = taskSource.loadTask(PluginTask.class); final boolean stopOnInvalidRecord = task.getStopOnInvalidRecord(); final Column column = schema.getColumn(0); try (PageBuilder pageBuilder = newPageBuilder(schema, output); FileInputInputStream in = new FileInputInputStream(input)) { while (in.nextFile()) { final String fileName = input.hintOfCurrentInputFileNameForLogging().orElse("-"); boolean evenOneJsonParsed = false; try (JsonParser.Stream stream = newJsonStream(in, task)) { Value value; while ((value = stream.next()) != null) { try { if (!value.isMapValue()) { throw new JsonRecordValidateException( String.format("A Json record must not represent map value but it's %s", value.getValueType().name())); } pageBuilder.setJson(column, value); pageBuilder.addRecord(); evenOneJsonParsed = true; } catch (JsonRecordValidateException e) { if (stopOnInvalidRecord) { throw new DataException(String.format("Invalid record in %s: %s", fileName, value.toJson()), e); } log.warn(String.format("Skipped record in %s (%s): %s", fileName, e.getMessage(), value.toJson())); } } } catch (IOException | JsonParseException e) { if (Exec.isPreview() && evenOneJsonParsed) { break; } throw new DataException(String.format("Failed to parse JSON: %s", fileName), e); } } pageBuilder.finish(); } }
Source:
<code>public void verifyOperationClientSecretBasic() { val request = new MockHttpServletRequest(); val response = new MockHttpServletResponse(); request.addHeader("Authorization", "Basic " + EncodingUtils.encodeBase64(RequestValidatorTestUtils.SUPPORTING_CLIENT_ID + ":" + RequestValidatorTestUtils.SHARED_SECRET)); request.setParameter(OAuth20Constants.TOKEN, SUPPORTING_SERVICE_TICKET); assertTrue(this.validator.validate(new JEEContext(request, response))); request.removeHeader("Authorization"); request.removeAllParameters(); <START> request.addHeader("Authorization", "Basic " + EncodingUtils.encodeBase64(RequestValidatorTestUtils.SUPPORTING_CLIENT_ID + ":" + RequestValidatorTestUtils.SHARED_SECRET)); <END> assertFalse(this.validator.supports(new JEEContext(request, response))); request.removeHeader("Authorization"); request.removeAllParameters(); request.removeHeader("Authorization"); request.addHeader("Authorization", "Basic " + EncodingUtils.encodeBase64(RequestValidatorTestUtils.NON_SUPPORTING_CLIENT_ID + ":" + RequestValidatorTestUtils.SHARED_SECRET)); request.setParameter(OAuth20Constants.TOKEN, SUPPORTING_SERVICE_TICKET); assertFalse(this.validator.validate(new JEEContext(request, response))); }</code><technical_language>Replace HttpUtils#createBasicAuthHeaders</technical_language>

Target:
public void verifyOperationClientSecretBasic() { val request = new MockHttpServletRequest(); val response = new MockHttpServletResponse(); HttpUtils.createBasicAuthHeaders(RequestValidatorTestUtils.SUPPORTING_CLIENT_ID, RequestValidatorTestUtils.SHARED_SECRET).forEach(request::addHeader); request.setParameter(OAuth20Constants.TOKEN, SUPPORTING_SERVICE_TICKET); assertTrue(this.validator.validate(new JEEContext(request, response))); request.removeHeader("Authorization"); request.removeAllParameters(); HttpUtils.createBasicAuthHeaders(RequestValidatorTestUtils.SUPPORTING_CLIENT_ID, RequestValidatorTestUtils.SHARED_SECRET).forEach(request::addHeader); assertFalse(this.validator.supports(new JEEContext(request, response))); request.removeHeader("Authorization"); request.removeAllParameters(); HttpUtils.createBasicAuthHeaders(RequestValidatorTestUtils.NON_SUPPORTING_CLIENT_ID, RequestValidatorTestUtils.SHARED_SECRET).forEach(request::addHeader); request.setParameter(OAuth20Constants.TOKEN, SUPPORTING_SERVICE_TICKET); assertFalse(this.validator.validate(new JEEContext(request, response))); }
Source:
<code>public Result addOrUpdate() { final Alert alert; final Organization organization = _organizationProvider.getOrganization(request()); try { <START> final JsonNode jsonBody = request().body().asJson(); <END> if (jsonBody == null) { return badRequest("empty request body."); } final models.view.Alert viewAlert = OBJECT_MAPPER.treeToValue(jsonBody, models.view.Alert.class); alert = viewAlert.toInternal(organization, OBJECT_MAPPER); } catch (final IOException | ConstraintsViolatedException e) { LOGGER.error() .setMessage("Failed to build an alert.") .setThrowable(e) .log(); return badRequest("Invalid request body."); } try { _alertRepository.addOrUpdateAlert(alert, _organizationProvider.getOrganization(request())); } catch (final Exception e) { LOGGER.error() .setMessage("Failed to add an alert.") .setThrowable(e) .log(); return internalServerError(); } return noContent(); }</code><technical_language>If is body, is body() null</technical_language>

Target:
public Result addOrUpdate() { final Alert alert; final Organization organization = _organizationProvider.getOrganization(request()); try { final JsonNode jsonBody = request().body().asJson(); if (jsonBody == null) { return badRequest("empty request body."); } final models.view.Alert viewAlert = OBJECT_MAPPER.treeToValue(jsonBody, models.view.Alert.class); alert = viewAlert.toInternal(organization, OBJECT_MAPPER); } catch (final IOException | ConstraintsViolatedException e) { LOGGER.error() .setMessage("Failed to build an alert.") .setThrowable(e) .log(); return badRequest("Invalid request body."); } try { _alertRepository.addOrUpdateAlert(alert, organization); } catch (final Exception e) { LOGGER.error() .setMessage("Failed to add an alert.") .setThrowable(e) .log(); return internalServerError(); } return noContent(); }
Source:
<code>protected HashMap<ServerFormDetails, String> doInBackground(ArrayList<ServerFormDetails>... values) { HashMap<ServerFormDetails, String> results = new HashMap<>(); int index = 1; for (ServerFormDetails serverFormDetails : values[0]) { try { String currentFormNumber = String.valueOf(index); String totalForms = String.valueOf(values[0].size()); publishProgress(serverFormDetails.getFormName(), currentFormNumber, totalForms); formDownloader.downloadForm(serverFormDetails, count -> { String message = Collect.getInstance().getString(R.string.form_download_progress, serverFormDetails.getFormName(), String.valueOf(count), String.valueOf(serverFormDetails.getManifest().getMediaFiles().size()) ); publishProgress(message, currentFormNumber, totalForms); }, this::isCancelled); results.put(serverFormDetails, Collect.getInstance().getString(R.string.success)); } catch (FormDownloadException e) { results.put(serverFormDetails, Collect.getInstance().getString(R.string.failure)); } <START> index++; <END> } return results; }</code><technical_language>showing "Failure" more specific message part of match changes, right? this change behavior</technical_language>

Target:
protected Map<ServerFormDetails, String> doInBackground(ArrayList<ServerFormDetails>... values) { HashMap<ServerFormDetails, String> results = new HashMap<>(); int index = 1; for (ServerFormDetails serverFormDetails : values[0]) { try { String currentFormNumber = String.valueOf(index); String totalForms = String.valueOf(values[0].size()); publishProgress(serverFormDetails.getFormName(), currentFormNumber, totalForms); formDownloader.downloadForm(serverFormDetails, count -> { String message = Collect.getInstance().getString(R.string.form_download_progress, serverFormDetails.getFormName(), String.valueOf(count), String.valueOf(serverFormDetails.getManifest().getMediaFiles().size()) ); publishProgress(message, currentFormNumber, totalForms); }, this::isCancelled); results.put(serverFormDetails, Collect.getInstance().getString(R.string.success)); } catch (FormDownloadException e) { results.put(serverFormDetails, Collect.getInstance().getString(R.string.failure)); } catch (InterruptedException e) { return emptyMap(); } index++; } return results; }
Source:
<code>ChromeCacheExtractor(Content dataSource, IngestJobContext context ) { <START> moduleName = NbBundle.getMessage(ChromeCacheExtractor.class, "ChromeCacheExtractor.moduleName"); <END> this.dataSource = dataSource; this.context = context; }</code><technical_language>this Bundles.ChromeCacheExtractor.moduleName() instead of getMessage</technical_language>

Target:
ChromeCacheExtractor(Content dataSource, IngestJobContext context ) { moduleName = Bundle.ChromeCacheExtractor_moduleName(); this.dataSource = dataSource; this.context = context; }
Source:
<code>public Map<String, Integer> getNumberOpenedSocketsByUri() { Map<String, Integer> numberOpenedSocketByUri = new LinkedHashMap<>(); <START> for (WebSocketDispatcher dispatcher : dispatchers) { <END> for (Map.Entry<String, Integer> socketByUri : dispatcher.getNumberOpenedSockets().entrySet()) { if (!numberOpenedSocketByUri.containsKey(socketByUri.getKey())) { numberOpenedSocketByUri.put(socketByUri.getKey(), socketByUri.getValue()); } else { numberOpenedSocketByUri.put(socketByUri.getKey(), numberOpenedSocketByUri.get(socketByUri.getKey()) + socketByUri.getValue()); } } } return numberOpenedSocketByUri; }</code><technical_language>needs protected concurrent modification</technical_language>

Target:
public Map<String, Integer> getNumberOpenedSocketsByUri() { Map<String, Integer> numberOpenedSocketByUri = new LinkedHashMap<>(); synchronized (this) { for (WebSocketDispatcher dispatcher : dispatchers) { for (Map.Entry<String, Integer> socketByUri : dispatcher.getNumberOpenedSockets().entrySet()) { if (!numberOpenedSocketByUri.containsKey(socketByUri.getKey())) { numberOpenedSocketByUri.put(socketByUri.getKey(), socketByUri.getValue()); } else { numberOpenedSocketByUri.put(socketByUri.getKey(), numberOpenedSocketByUri.get(socketByUri.getKey()) + socketByUri.getValue()); } } } } return numberOpenedSocketByUri; }
Source:
<code>public List<String> getUsages() { return Arrays.asList(new String[] { <START> buildCommandUsage(SUBCMD_PLAY + " <sink> <filename> <volume>", <END> "plays a sound file from the sounds folder through the optionally specified audio sink(s)"), buildCommandUsage(SUBCMD_STREAM + " <sink> <url> <volume>", "streams the sound from the url through the optionally specified audio sink(s)"), buildCommandUsage(SUBCMD_SOURCES, "lists the audio sources"), buildCommandUsage(SUBCMD_SINKS, "lists the audio sinks") }); }</code><technical_language>bee correct (IMHO), touched changed text " <sink> [<filename> [<volume>]]" (same below)</technical_language>

Target:
public List<String> getUsages() { return Arrays.asList(new String[] { buildCommandUsage(SUBCMD_PLAY + " [<sink>] <filename>", "plays a sound file from the sounds folder through the optionally specified audio sink(s)"), buildCommandUsage(SUBCMD_PLAY + " <sink> <filename> <volume>", "plays a sound file from the sounds folder through the specified audio sink(s) with the specified volume"), buildCommandUsage(SUBCMD_STREAM + " [<sink>] <url>", "streams the sound from the url through the optionally specified audio sink(s)"), buildCommandUsage(SUBCMD_SOURCES, "lists the audio sources"), buildCommandUsage(SUBCMD_SINKS, "lists the audio sinks") }); }
Source:
<code>private void unindent() { <START> indent--; <END> }</code><technical_language>throw negative</technical_language>

Target:
private void unindent() { indent--; checkState(indent >= 0, "indentation level below zero"); }
Source:
<code>private ClientResponse makeRemoteCallWithFollowRedirect(Action action, String serviceUrl) throws Throwable { URI targetUrl = new URI(serviceUrl); for(int followRedirectCount = 0; followRedirectCount < 10; followRedirectCount++) { ClientResponse clientResponse = makeRemoteCall(action, targetUrl.toString()); if(clientResponse.getStatus() < 300) { if(followRedirectCount > 0) { Matcher pathMatcher = REDIRECT_PATH_REGEX.matcher(targetUrl.getPath()); <START> if(pathMatcher.matches()) { <END> URI baseUri = UriBuilder.fromUri(targetUrl).replacePath(pathMatcher.group(1)).replaceQuery(null).build(); lastRedirect.set(baseUri.toString()); } else { logger.warn("Invalid redirect URL {}; ignoring it", targetUrl); } } return clientResponse; } targetUrl = clientResponse.getLocation(); } String message = "Follow redirect limit crossed for URI " + serviceUrl; logger.warn(message); throw new IOException(message); }</code><technical_language>redirects server need ignore</technical_language>

Target:
private ClientResponse makeRemoteCallWithFollowRedirect(Action action, String serviceUrl) throws Throwable { URI targetUrl = new URI(serviceUrl); for (int followRedirectCount = 0; followRedirectCount < MAX_FOLLOWED_REDIRECTS; followRedirectCount++) { ClientResponse clientResponse = makeRemoteCall(action, targetUrl.toString()); if (clientResponse.getStatus() != 302) { if (followRedirectCount > 0) { if(isQueryAction(action)) { lastQueryRedirect.set(targetUrl.toString()); } else { lastRegisterRedirect.set(targetUrl.toString()); } } return clientResponse; } targetUrl = getRedirectBaseUri(clientResponse.getLocation()); if (targetUrl == null) { throw new IOException("Invalid redirect URL " + clientResponse.getLocation()); } } String message = "Follow redirect limit crossed for URI " + serviceUrl; logger.warn(message); throw new IOException(message); }
Source:
<code><START> public void testGetCommandLineNonNullModSeq() throws IOException, IllegalArgumentException, IllegalAccessException, SearchException, ImapAsyncClientException { <END> final ExtendedModifiedSinceTerm extendedModifiedSinceTerm = new ExtendedModifiedSinceTerm(1L); final MessageNumberSet[] msgsets = null; final ImapRequest cmd = new SearchCommand(msgsets, extendedModifiedSinceTerm, null); Assert.assertEquals(cmd.getCommandLine(), "SEARCH MODSEQ 1\r\n", "Expected result mismatched."); cmd.cleanup(); for (final Field field : fieldsToCheck) { Assert.assertNull(field.get(cmd), "Cleanup should set " + field.getName() + " as null"); } }</code><technical_language>Line exceeding max length (150 chars)</technical_language>

Target:
public void testGetCommandLineNonNullModSeq() throws IOException, IllegalArgumentException, IllegalAccessException, SearchException, ImapAsyncClientException { final ExtendedModifiedSinceTerm extendedModifiedSinceTerm = new ExtendedModifiedSinceTerm(1L); final MessageNumberSet[] msgsets = null; final ImapRequest cmd = new SearchCommand(msgsets, extendedModifiedSinceTerm, null); Assert.assertEquals(cmd.getCommandLine(), "SEARCH MODSEQ 1\r\n", "getCommandLine() mismatched."); cmd.cleanup(); for (final Field field : fieldsToCheck) { Assert.assertNull(field.get(cmd), "Cleanup should set " + field.getName() + " as null"); } }
Source:
<code>public static void wipeCacheForCurrentApp() { SQLiteDatabase userDb = CommCareApplication.instance().getUserDbHandle(); userDb.beginTransaction(); try { <START> userDb.delete(TABLE_NAME, COL_APP_ID + " = ?", new String[]{ReportingUtils.getAppId()}); <END> String uuid = CommCareApplication.instance().getSession().getLoggedInUser().getUniqueId(); setEntityCacheWipedPref(uuid, CommCareApplication.instance().getCurrentApp().getAppRecord().getVersionNumber()); userDb.setTransactionSuccessful(); } finally { userDb.endTransaction(); } }</code><technical_language>pretty uncomfortable current app ID ReportingUtils. I move more semantically "important", I anticipate making changes ReportingUtils assuming break core app behavior if changes</technical_language>

Target:
public static void wipeCacheForCurrentApp() { SQLiteDatabase userDb = CommCareApplication.instance().getUserDbHandle(); userDb.beginTransaction(); try { userDb.delete(TABLE_NAME, COL_APP_ID + " = ?", new String[]{AppUtils.getCurrentAppId()}); String uuid = CommCareApplication.instance().getSession().getLoggedInUser().getUniqueId(); setEntityCacheWipedPref(uuid, CommCareApplication.instance().getCurrentApp().getAppRecord().getVersionNumber()); userDb.setTransactionSuccessful(); } finally { userDb.endTransaction(); } }
Source:
<code>protected Object doWork() { final CopyNumberTriStateHiddenMarkovModel model = modelArguments.createModel(); final TargetCollection<Target> targets = targetArguments.readTargetCollection(false); final ReadCountCollection inputCounts = readAndSortCountsByTargetCoordinates(targets); checkForMissingTargetsInInputCounts(targets, inputCounts); <START> final Map<String, List<CopyNumberTriStateSegment>> allSegments = <END> calculateBestPathSegments(model, inputCounts); final Iterator<CopyNumberTriStateSegmentRecord> allSegmentsSorted = composeATargetSortedSegmentRecordIterator(targets, allSegments); writeSegmentsInOutputFile(allSegmentsSorted); return "SUCCESS"; }</code><technical_language>variable name String keys samples</technical_language>

Target:
protected Object doWork() { final CopyNumberTriStateHiddenMarkovModel model = modelArguments.createModel(); final TargetCollection<Target> targets = targetArguments.readTargetCollection(false); final ReadCountCollection inputCounts = readAndSortCountsByTargetCoordinates(targets); checkForMissingTargetsInInputCounts(targets, inputCounts); final Map<String, List<CopyNumberTriStateSegment>> allSegmentsBySampleName = calculateBestPathSegments(model, inputCounts); final Iterator<CopyNumberTriStateSegmentRecord> allSegmentRecordsSortedByCoordinates = composeATargetSortedSegmentRecordIterator(targets, allSegmentsBySampleName); writeSegmentsInOutputFile(allSegmentRecordsSortedByCoordinates); return "SUCCESS"; }
Source:
<code>public void addOperation(final String key, final Operation o) { MemcachedNode placeIn=null; MemcachedNode primary = locator.getPrimary(key); if(primary.isActive() || failureMode == FailureMode.Retry) { placeIn=primary; } else if(failureMode == FailureMode.Cancel) { o.setHandlingNode(primary); o.cancel("node is not active"); <START> } else { <END> for(Iterator<MemcachedNode> i=locator.getSequence(key); placeIn == null && i.hasNext(); ) { MemcachedNode n=i.next(); if(n.isActive()) { placeIn=n; } } if(placeIn == null) { placeIn = primary; } } assert o.isCancelled() || placeIn != null : "No node found for key " + key; if(placeIn != null) { addOperation(placeIn, o); } else { assert o.isCancelled() : "No not found for " + key + " (and not immediately cancelled)"; } }</code><technical_language>"inactive node"</technical_language>

Target:
public void addOperation(final String key, final Operation o) { MemcachedNode placeIn=null; MemcachedNode primary = locator.getPrimary(key); if(primary.isActive() || failureMode == FailureMode.Retry) { placeIn=primary; } else if(failureMode == FailureMode.Cancel) { o.setHandlingNode(primary); o.cancel("inactive node"); } else { for(Iterator<MemcachedNode> i=locator.getSequence(key); placeIn == null && i.hasNext(); ) { MemcachedNode n=i.next(); if(n.isActive()) { placeIn=n; } } if(placeIn == null) { placeIn = primary; } } assert o.isCancelled() || placeIn != null : "No node found for key " + key; if(placeIn != null) { addOperation(placeIn, o); } else { assert o.isCancelled() : "No not found for " + key + " (and not immediately cancelled)"; } }
Source:
<code>public void shouldFailureReturnNotNull() { <START> Try<Object> _try = failure(new Error("error")); <END> assertThat(_try).isNotNull(); assertThat(_try.isFailure()).isTrue(); }</code><technical_language>I "error" is redundant</technical_language>

Target:
public void shouldFailureReturnNotNull() { final Try<?> t = Failure(new Error()); assertThat(t).isNotNull(); assertThat(t.isFailure()).isTrue(); }
Source:
<code><START> public Responses getResponsesObject() { return responsesObject; } <END></code><technical_language>this needs return responsesObject (converted Map) responses depending null status of two. this is achieved for responseSchema schema in response</technical_language>

Target:
public Responses getResponsesObject() { if (responses == null && responsesObject != null) { responses = new LinkedHashMap<String, Response>(); for (String key : this.responsesObject.keySet()) { responses.put(key, responsesObject.get(key)); } } return responsesObject; }
Source:
<code>public static List<Symbol> extractAll(RowExpression expression) { <START> ImmutableList.Builder<Symbol> builder = ImmutableList.builder(); <END> expression.accept(new VariableBuilderVisitor(), builder); return builder.build(); }</code><technical_language>If change this a VariableReferenceExpression builder save a lines of code I get this part for symbol variable refactoring, lol</technical_language>

Target:
public static List<VariableReferenceExpression> extractAll(RowExpression expression) { ImmutableList.Builder<VariableReferenceExpression> builder = ImmutableList.builder(); expression.accept(new VariableBuilderVisitor(), builder); return builder.build(); }
Source:
<code>public EntityTraversal<Vertex, User> fold() { <START> return __.<Vertex, Object>project("id", "uuid", "password", "enabled", "roles", "securityTokenKey", "lastUpdated", "sourceId") <END> .by(__.id()) .by(__.enrichPropertyValue("uuid")) .by(__.enrichPropertyValue("password")) .by(__.enrichPropertyValue("enabled")) .by(__.enrichPropertyValue("roles")) .by(__.enrichPropertyValue("securityTokenKey")) .by(__.enrichPropertyValue("lastUpdated")) .by(__.enrichPropertyValue("sourceId")) .map(this::map); }</code><technical_language>Cosmetic: of parameters a separate line, a long list. do think</technical_language>

Target:
public EntityTraversal<Vertex, User> fold() { return __.<Vertex, Object>project("id", "uuid", "password", "enabled", "roles", "securityTokenKey", "lastUpdated", "sourceId") .by(__.id()) .by(__.enrichPropertyValue("uuid")) .by(__.enrichPropertyValue("password")) .by(__.enrichPropertyValue("enabled")) .by(__.outE(Edges.USER_HAS_SECURITY_ROLES) .inV() .map(securityRoleAdapter.fold()) .map(EntityTraversalUtils::castToObject) .fold()) .by(__.enrichPropertyValue("securityTokenKey")) .by(__.enrichPropertyValue("lastUpdated")) .by(__.enrichPropertyValue("sourceId")) .map(this::map); }
Source:
<code>public void onInfoWindowClick(Marker marker) { <START> Intent i = new Intent(EntityMapActivity.this.getIntent()); <END> TreeReference ref = markerReferences.get(marker); SerializationUtil.serializeToIntent(i, EntityDetailActivity.CONTEXT_REFERENCE, ref); setResult(RESULT_OK, i); EntityMapActivity.this.finish(); }</code><technical_language>full EntityMapActivity.this.getIntent() is necessary in nested anonymous class. In this case getIntent() suffice</technical_language>

Target:
public void onInfoWindowClick(Marker marker) { Intent i = new Intent(getIntent()); TreeReference ref = markerReferences.get(marker); SerializationUtil.serializeToIntent(i, EntityDetailActivity.CONTEXT_REFERENCE, ref); setResult(RESULT_OK, i); finish(); }
Source:
<code>public void clear() { fieldBinding.clear(); <START> if(dataBindingEditor != null) { <END> FormsElementWrapperWidgetUtil.clear(this); } formRenderer.unBind(); modal.clear(); }</code><technical_language>suggestion if (dataBindingEditor != null) {</technical_language>

Target:
public void clear() { fieldBinding.clear(); if (dataBindingEditor != null) { wrapperWidgetUtil.clear(this); } formRenderer.unBind(); modal.clear(); }
Source:
<code>private void runUpdateStatisticsTool(String fullTableName) { UpdateStatisticsTool tool = new UpdateStatisticsTool(); tool.setConf(utility.getConfiguration()); String randomDir = getUtility().getRandomDir().toString(); final String[] cmdArgs = getArgValues(fullTableName, randomDir); try { int status = tool.run(cmdArgs); <START> assertEquals(0, status); <END> HBaseAdmin hBaseAdmin = utility.getHBaseAdmin(); assertEquals(0, hBaseAdmin.listSnapshots(tool.getSnapshotName()).size()); } catch (Exception e) { fail("Exception when running UpdateStatisticsTool for " + tableName + " Exception: " + e); } finally { Job job = tool.getJob(); assertEquals(job.getConfiguration().get(MAPREDUCE_JOB_TYPE), UPDATE_STATS.name()); } }</code><technical_language>nit: Please add error message this alternatively throw more descriptive exception</technical_language>

Target:
private void runUpdateStatisticsTool(String fullTableName) { UpdateStatisticsTool tool = new UpdateStatisticsTool(); tool.setConf(utility.getConfiguration()); String randomDir = getUtility().getRandomDir().toString(); final String[] cmdArgs = getArgValues(fullTableName, randomDir); try { int status = tool.run(cmdArgs); assertEquals("MR Job should complete successfully", 0, status); HBaseAdmin hBaseAdmin = utility.getHBaseAdmin(); assertEquals("Snapshot should be automatically deleted when UpdateStatisticsTool has completed", 0, hBaseAdmin.listSnapshots(tool.getSnapshotName()).size()); } catch (Exception e) { fail("Exception when running UpdateStatisticsTool for " + tableName + " Exception: " + e); } finally { Job job = tool.getJob(); assertEquals("MR Job should have been configured with UPDATE_STATS job type", job.getConfiguration().get(MAPREDUCE_JOB_TYPE), UPDATE_STATS.name()); } }
Source:
<code>private static Collection<Unit> getCanCarry( final Unit carrier, final Collection<Unit> selectFrom, final GamePlayer playerWhoIsDoingTheMovement, final GameData data) { final UnitAttachment ua = UnitAttachment.get(carrier.getType()); final Collection<Unit> canCarry = new ArrayList<>(); int available = ua.getCarrierCapacity(); for (final Unit plane : selectFrom) { final UnitAttachment planeAttachment = UnitAttachment.get(plane.getType()); final int cost = planeAttachment.getCarrierCost(); <START> if (available >= cost <END> && ((carrier.getAlreadyMoved().compareTo(plane.getAlreadyMoved()) == 0) || (Matches.unitHasNotMoved().test(plane) && Matches.unitHasNotMoved().test(carrier)) || (Matches.unitIsOwnedBy(playerWhoIsDoingTheMovement).negate().test(plane) && Matches.alliedUnit(playerWhoIsDoingTheMovement, data).test(plane)))) { available -= cost; canCarry.add(plane); } if (available == 0) { break; } } return canCarry; }</code><technical_language>Consider simplifying this complex logical expression</technical_language>

Target:
private static Collection<Unit> getCanCarry( final Unit carrier, final Collection<Unit> selectFrom, final GamePlayer playerWhoIsDoingTheMovement, final GameData data) { final UnitAttachment ua = UnitAttachment.get(carrier.getType()); final Collection<Unit> canCarry = new ArrayList<>(); int available = ua.getCarrierCapacity(); for (final Unit plane : selectFrom) { final UnitAttachment planeAttachment = UnitAttachment.get(plane.getType()); final int cost = planeAttachment.getCarrierCost(); if (available >= cost) { if ((carrier.getAlreadyMoved().compareTo(plane.getAlreadyMoved()) == 0) || (Matches.unitHasNotMoved().test(plane) && Matches.unitHasNotMoved().test(carrier)) || (Matches.unitIsOwnedBy(playerWhoIsDoingTheMovement).negate().test(plane) && Matches.alliedUnit(playerWhoIsDoingTheMovement, data).test(plane))) { available -= cost; canCarry.add(plane); } } if (available == 0) { break; } } return canCarry; }
Source:
<code>public void onNext(CRUDEvent event) { Collection<LifeCycleHook> hooks = dictionary.getTriggers( event.getResource().getResourceClass(), this.annotation, event.getFieldName()); if (!event.getFieldName().isEmpty()) { hooks.addAll(dictionary.getTriggers(event.getResource().getResourceClass(), this.annotation)); } <START> <END> hooks.forEach((hook) -> { hook.execute( event.getResource().getObject(), event.getResource().getRequestScope(), event.getChanges()); }); }</code><technical_language>is safe modify returned collection this? if changes immutable changes list set, for instance this alter semantics of addAll logic below. create a new this</technical_language>

Target:
public void onNext(CRUDEvent event) { ArrayList<LifeCycleHook> hooks = new ArrayList<>(); hooks.addAll(dictionary.getTriggers( event.getResource().getResourceClass(), this.annotation, event.getFieldName())); if (!event.getFieldName().isEmpty()) { hooks.addAll(dictionary.getTriggers(event.getResource().getResourceClass(), this.annotation)); } try { hooks.forEach((hook) -> { hook.execute( event.getResource().getObject(), event.getResource().getRequestScope(), event.getChanges()); }); } catch (RuntimeException e) { exception = Optional.of(e); if (throwsExceptions) { throw e; } } }
Source:
<code>private void onHighPriority(MenuItem item) { if (isHighPriority) { item.setTitle(getString(R.string.priority_urgent)); this.isHighPriority = false; setTitle(getTitle().toString().split(",")[0]); } else { item.setTitle(getString(R.string.priority_normal)); this.isHighPriority = true; <START> setTitle(getTitle()+","+getString(R.string.priority_urgent)); <END> } }</code><technical_language>Please use: getString(R.string.priority_urgent, getTitle()); of formatting arguments</technical_language>

Target:
private void onHighPriority(MenuItem item) { if (isHighPriority) { item.setTitle(getString(R.string.priority_high)); setTitle(getString(R.string.compose_title_compose)); this.isHighPriority = false; } else { item.setTitle(getString(R.string.priority_normal)); setTitle(getString(R.string.compose_title_compose)+","+getString(R.string.priority_high)); this.isHighPriority = true; } }
Source:
<code>public static void dropTable(Connection c, String storageKey) { String sqlStatement = "DROP TABLE IF EXISTS " + storageKey; try { <START> PreparedStatement preparedStatement = c.prepareStatement(sqlStatement); <END> preparedStatement.execute(); } catch (SQLException e) { System.out.println("didn't drop table"); } }</code><technical_language>I important explicitly close PreparedStatement instance create done it. If FindBugs plugin for Android Studio warn this</technical_language>

Target:
public static void dropTable(Connection c, String storageKey) { String sqlStatement = "DROP TABLE IF EXISTS " + storageKey; PreparedStatement preparedStatement = null; try { preparedStatement = c.prepareStatement(sqlStatement); preparedStatement.execute(); } catch (SQLException e) { Logger.log("E", "Could not drop table: " + e.getMessage()); } finally { if (preparedStatement != null) { try { preparedStatement.close(); } catch (SQLException e) { throw new RuntimeException(e); } } } }
Source:
<code>public void testRecomputePictureViews() throws Exception { DocumentModel doc = session.createDocumentModel("/", "pictureDoc", "Picture"); Blob blob = Blobs.createBlob(FileUtils.getResourceFileFromContext("images/test.jpg"), "image/jpeg", StandardCharsets.UTF_8.name(), "test.jpg"); doc.setPropertyValue("file:content", (Serializable) blob); doc = session.createDocument(doc); txFeature.nextTransaction(); doc = session.getDocument(doc.getRef()); List<Serializable> pictureViews = (List<Serializable>) doc.getPropertyValue("picture:views"); assertNotNull(pictureViews); assertFalse(pictureViews.isEmpty()); doc.setPropertyValue("picture:views", new ArrayList<>()); session.saveDocument(doc); txFeature.nextTransaction(); doc = session.getDocument(doc.getRef()); pictureViews = (List<Serializable>) doc.getPropertyValue("picture:views"); assertNotNull(pictureViews); assertTrue(pictureViews.isEmpty()); Map<String, String> parameters = Collections.singletonMap("query", "SELECT * FROM Document WHERE ecm:mixinType = 'Picture'"); try (OperationContext ctx = new OperationContext(session)) { automationService.run(ctx, RecomputePictureViews.ID, parameters); } <START> bulkService.await(Duration.ofSeconds(60)); <END> txFeature.nextTransaction(); doc = session.getDocument(doc.getRef()); pictureViews = (List<Serializable>) doc.getPropertyValue("picture:views"); assertNotNull(pictureViews); assertFalse(pictureViews.isEmpty()); }</code><technical_language>txFeature handle wait</technical_language>

Target:
public void testRecomputePictureViews() throws Exception { DocumentModel doc = session.createDocumentModel("/", "pictureDoc", "Picture"); Blob blob = Blobs.createBlob(FileUtils.getResourceFileFromContext("images/test.jpg"), "image/jpeg", StandardCharsets.UTF_8.name(), "test.jpg"); doc.setPropertyValue("file:content", (Serializable) blob); doc = session.createDocument(doc); txFeature.nextTransaction(); doc = session.getDocument(doc.getRef()); List<Serializable> pictureViews = (List<Serializable>) doc.getPropertyValue("picture:views"); assertNotNull(pictureViews); assertFalse(pictureViews.isEmpty()); doc.setPropertyValue("picture:views", new ArrayList<>()); session.saveDocument(doc); txFeature.nextTransaction(); doc = session.getDocument(doc.getRef()); pictureViews = (List<Serializable>) doc.getPropertyValue("picture:views"); assertNotNull(pictureViews); assertTrue(pictureViews.isEmpty()); Map<String, String> parameters = Collections.singletonMap("query", "SELECT * FROM Document WHERE ecm:mixinType = 'Picture'"); try (OperationContext ctx = new OperationContext(session)) { automationService.run(ctx, RecomputePictureViews.ID, parameters); } txFeature.nextTransaction(); doc = session.getDocument(doc.getRef()); pictureViews = (List<Serializable>) doc.getPropertyValue("picture:views"); assertNotNull(pictureViews); assertFalse(pictureViews.isEmpty()); }