auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String createStyledText() { if (!StringUtility.hasText(m_text)) { return ""; } String styledText = m_text; <START> if (htmlPattern.matcher(styledText).matches()) { <END> styledText = StringUtility.getTag(styledText, "html"); } if (bodyPattern.matcher(styledText).matches()) { styledText = StringUtility.getTag(styledText, "body"); } String align = "left"; String valign = "top"; if (m_horizontalAlignment == SwingConstants.HORIZONTAL) { align = "center"; } else if (m_horizontalAlignment == SwingConstants.RIGHT) { align = "right"; } else { align = "left"; } if (m_verticalAlignment == SwingConstants.CENTER) { valign = "middle"; } else if (m_verticalAlignment == SwingConstants.BOTTOM) { valign = "bottom"; } else { valign = "top"; } String wrapText = "normal"; if (!m_textWrap) { wrapText = "nowrap"; } String bodyStyle = ""; if (StringUtility.hasText(ColorUtility.createStringFromColor(m_backgroundColor))) { bodyStyle = "background-color: " + ColorUtility.createStringFromColor(m_backgroundColor) + ";"; } styledText = "<html><body style=\"" + bodyStyle + "\"><div align=\"" + align + "\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"" + valign + "\" height=\"" + m_height + "px\" style=\"white-space:" + wrapText + ";\">" + styledText + "</td></tr></table></div></body></html>"; return styledText; }</code><technical_language>create a simple test for a text contains html</technical_language>

Target:
public String createStyledText() { if (!StringUtility.hasText(getText())) { return ""; } String styledText = getText(); if (HTML_PATTERN.matcher(styledText).matches()) { styledText = StringUtility.getTag(styledText, "html"); } if (BODY_PATTERN.matcher(styledText).matches()) { styledText = StringUtility.getTag(styledText, "body"); } String align = "left"; String valign = "top"; if (getHorizontalAlignment() == SwingConstants.HORIZONTAL) { align = "center"; } else if (getHorizontalAlignment() == SwingConstants.RIGHT) { align = "right"; } else { align = "left"; } if (getVerticalAlignment() == SwingConstants.CENTER) { valign = "middle"; } else if (getVerticalAlignment() == SwingConstants.BOTTOM) { valign = "bottom"; } else { valign = "top"; } String wrapText = "normal"; if (!isTextWrap()) { wrapText = "nowrap"; } String bodyStyle = ""; if (StringUtility.hasText(ColorUtility.createStringFromColor(getBackgroundColor()))) { bodyStyle = "background-color: " + ColorUtility.createStringFromColor(getBackgroundColor()) + ";"; } styledText = "<html><body style=\"" + bodyStyle + "\"><div align=\"" + align + "\"><table cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"" + valign + "\" height=\"" + getHeight() + "px\" style=\"white-space:" + wrapText + ";\">" + styledText + "</td></tr></table></div></body></html>"; return styledText; }
Source:
<code>public int draw(GC gc, StyledText textWidget, Color color, int x, int y) { <START> String title= getLabel() != null ? getLabel() : "no command"; END> gc.drawText(title, x, y); return gc.stringExtent(title).x; }</code><technical_language>If is draw, skipping drawing return 0</technical_language>

Target:
public Point draw(GC gc, StyledText textWidget, Color color, int x, int y) { String title= getLabel() != null ? getLabel() : "no command"; gc.drawText(title, x, y); return gc.stringExtent(title); }
Source:
<code>public void updateItems(List<FatekPLCItem> items) throws FatekIOException, FatekException { Set<Reg> regsToUpdate = new HashSet<>(); for (FatekPLCItem item : items) { regsToUpdate.addAll(item.getRegs()); } Map<Reg, RegValue> response; synchronized (fatekPLC) { response = new FatekReadMixDataCmd(fatekPLC, regsToUpdate).send(); } for (FatekPLCItem fatekItem : items) { State newState = fatekItem.getState(response); State currentState; Item item; try { item = itemRegistry.getItem(fatekItem.getItemName()); currentState = item.getState(); } catch (ItemNotFoundException e) { logger.warn("", e); currentState = null; item = null; } logger.debug("new state: {}, current state: {}, item: {}", newState, currentState, item); <START> if (!newState.equals(currentState)) { <END> eventPublisher.postUpdate(fatekItem.getItemName(), newState); } } }</code><technical_language>I is unwise suppress item state updates inspecting item's current state-bindings stateless possible. Do extraordinary circumstances Fatek PLC justifies suppressing repeated updates of state</technical_language>

Target:
public void updateItems(List<FatekPLCItem> items) throws FatekIOException, FatekException { Set<Reg> regsToUpdate = new HashSet<>(); for (FatekPLCItem item : items) { regsToUpdate.addAll(item.getRegs()); } Map<Reg, RegValue> response; synchronized (fatekPLC) { response = new FatekReadMixDataCmd(fatekPLC, regsToUpdate).send(); } for (FatekPLCItem fatekItem : items) { State newState = fatekItem.getState(response); if (stateCache.isStateChange(fatekItem, newState)) { eventPublisher.postUpdate(fatekItem.getItemName(), newState); } } }
Source:
<code>public String createQuestion(@Valid @ModelAttribute TopicDto topicDto, BindingResult result, Model model, @RequestParam(BRANCH_ID) Long branchId, HttpServletRequest request) throws NotFoundException{ VelocityEngine engine = new VelocityEngine(getProperties()); engine.init(); Branch branch = getPluginBranchService().get(branchId); Map<String, Object> data = getDefaultModel(request); topicDto.getTopic().setBranch(branch); if (result.hasErrors()) { <START> data.put(BREADCRUMB_LIST, breadcrumbBuilder.getForumBreadcrumb(topicDto.getTopic())); <END> data.put(TOPIC_DTO, topicDto); data.put(RESULT, result); model.addAttribute(CONTENT, getMergedTemplate(engine, QUESTION_FORM_TEMPLATE_PATH, "UTF-8", data)); return PLUGIN_VIEW_NAME; } topicDto.getTopic().setType(QuestionsAndAnswersPlugin.TOPIC_TYPE); Topic createdQuestion = getTypeAwarePluginTopicService().createTopic(topicDto.getTopic(), topicDto.getBodyText()); return "redirect:" + QuestionsAndAnswersPlugin.CONTEXT + "/" + createdQuestion.getId(); }</code><technical_language>This fix problem for questions. OK. discussions code review? problem exist for topic types</technical_language>

Target:
public String createQuestion(@Valid @ModelAttribute TopicDto topicDto, BindingResult result, Model model, @RequestParam(BRANCH_ID) Long branchId, HttpServletRequest request) throws NotFoundException{ VelocityEngine engine = new VelocityEngine(getProperties()); engine.init(); Branch branch = getPluginBranchService().get(branchId); Map<String, Object> data = getDefaultModel(request); topicDto.getTopic().setBranch(branch); if (result.hasErrors()) { data.put(BREADCRUMB_LIST, breadcrumbBuilder.getForumBreadcrumb(branch)); data.put(TOPIC_DTO, topicDto); data.put(RESULT, result); model.addAttribute(CONTENT, getMergedTemplate(engine, QUESTION_FORM_TEMPLATE_PATH, "UTF-8", data)); return PLUGIN_VIEW_NAME; } topicDto.getTopic().setType(QuestionsAndAnswersPlugin.TOPIC_TYPE); Topic createdQuestion = getTypeAwarePluginTopicService().createTopic(topicDto.getTopic(), topicDto.getBodyText()); return "redirect:" + QuestionsAndAnswersPlugin.CONTEXT + "/" + createdQuestion.getId(); }
Source:
<code>private RequestFuture<ByteBuffer> onJoinLeader(JoinGroupResponse joinResponse) { try { Map<String, ByteBuffer> groupAssignment = performAssignment(joinResponse.data().leader(), joinResponse.data().protocolName(), joinResponse.data().members()); List<SyncGroupRequestData.SyncGroupRequestAssignment> groupAssignmentList = new ArrayList<>(); for (Map.Entry<String, ByteBuffer> assignment : groupAssignment.entrySet()) { groupAssignmentList.add(new SyncGroupRequestData.SyncGroupRequestAssignment() .setMemberId(assignment.getKey()) <START> .setAssignment(assignment.getValue().array()) <END> ); } SyncGroupRequest.Builder requestBuilder = new SyncGroupRequest.Builder( new SyncGroupRequestData() .setGroupId(groupId) .setMemberId(generation.memberId) .setGenerationId(generation.generationId) .setAssignments(groupAssignmentList) ); log.debug("Sending leader SyncGroup to coordinator {}: {}", this.coordinator, requestBuilder); return sendSyncGroupRequest(requestBuilder); } catch (RuntimeException e) { return RequestFuture.failure(e); } }</code><technical_language>a careful calling array() here? safer Utils.toArray. more careful accessing this ByteBuffer in place is provided plugins. I problem in ConsumerCoordinator.metadata()</technical_language>

Target:
private RequestFuture<ByteBuffer> onJoinLeader(JoinGroupResponse joinResponse) { try { Map<String, ByteBuffer> groupAssignment = performAssignment(joinResponse.data().leader(), joinResponse.data().protocolName(), joinResponse.data().members()); List<SyncGroupRequestData.SyncGroupRequestAssignment> groupAssignmentList = new ArrayList<>(); for (Map.Entry<String, ByteBuffer> assignment : groupAssignment.entrySet()) { groupAssignmentList.add(new SyncGroupRequestData.SyncGroupRequestAssignment() .setMemberId(assignment.getKey()) .setAssignment(Utils.toArray(assignment.getValue())) ); } SyncGroupRequest.Builder requestBuilder = new SyncGroupRequest.Builder( new SyncGroupRequestData() .setGroupId(groupId) .setMemberId(generation.memberId) .setGenerationId(generation.generationId) .setAssignments(groupAssignmentList) ); log.debug("Sending leader SyncGroup to coordinator {}: {}", this.coordinator, requestBuilder); return sendSyncGroupRequest(requestBuilder); } catch (RuntimeException e) { return RequestFuture.failure(e); } }
Source:
<code>public Level getAntLogLevel() { Class<?> clazz; int maxLevel = Project.MSG_ERR; for (final BuildListener l : project.getBuildListeners()) { clazz = l.getClass(); Field declaredField = null; try { while (BuildListener.class.isAssignableFrom(clazz)) { try { <START> declaredField = l.getClass().getDeclaredField("msgOutputLevel"); <END> } catch (final NoSuchFieldException ignored) { try { declaredField = l.getClass().getDeclaredField("logLevel"); } catch (final NoSuchFieldException expected) { } } if (declaredField != null) { break; } clazz = clazz.getSuperclass(); } if (declaredField != null) { declaredField.setAccessible(true); final int level = declaredField.getInt(l); if (maxLevel < level) { maxLevel = level; } } } catch (final IllegalArgumentException | IllegalAccessException ignored) { } } return LOG_LEVELS[maxLevel]; }</code><technical_language>This is broken. l.getClass() clazz. Btw interested in Apache's FieldUtils, getDeclaredField readField methods, this kind of logic more concise</technical_language>

Target:
public Level getAntLogLevel() { for (final BuildListener l : project.getBuildListeners()) { Field declaredField = null; try { if (l instanceof DefaultLogger) { declaredField = DefaultLogger.class.getDeclaredField("msgOutputLevel"); } else if (l instanceof XmlLogger) { declaredField = XmlLogger.class.getDeclaredField("msgOutputLevel"); } else if (l instanceof RecorderEntry) { declaredField = RecorderEntry.class.getDeclaredField("loglevel"); } else { try { declaredField = l.getClass().getDeclaredField("logLevel"); } catch (final NoSuchFieldException e) { project.log("Unsupported build listener: " + l.getClass(), Project.MSG_WARN); } } if (declaredField != null) { declaredField.setAccessible(true); return LOG_LEVELS[declaredField.getInt(l)]; } } catch (final NoSuchFieldException | IllegalArgumentException | IllegalAccessException ignored) { } } return Level.FINEST; }
Source:
<code>private void handlePing(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { <START> log.info("handlePing[{}]: Ping message received from {}", req.getHeader().getRequestId(), <END> req.getHeader().getClientId().getMsb(), req.getHeader().getClientId().getLsb()); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getPingResponseMsg()); r.sendResponse(response, ctx); }</code><technical_language>Info is verbose for a ping. Change change info debug level</technical_language>

Target:
public void handlePing(RequestMsg req, ChannelHandlerContext ctx, IServerRouter r) { log.trace("handlePing[{}]: Ping message received from {}", req.getHeader().getRequestId(), req.getHeader().getClientId().getMsb(), req.getHeader().getClientId().getLsb()); HeaderMsg responseHeader = getHeaderMsg(req.getHeader(), false, true); ResponseMsg response = getResponseMsg(responseHeader, getPingResponseMsg()); r.sendResponse(response, ctx); }
Source:
<code>public String toString() { <START> return "ControlFlowEvent start=" + fTime + " end=" + (fTime + fDuration) + " duration=" + fDuration + " value=" + fValue; END> }</code><technical_language>"BarChartEvent" in fact getClass().getSimpleName(), classes extend reimplement it</technical_language>

Target:
public String toString() { return getClass().getSimpleName() + " start=" + fTime + " end=" + (fTime + fDuration) + " duration=" + fDuration + " value=" + fValue; }
Source:
<code>public void postConstruct(Object instance, Object creationMetaData) throws InjectionProviderException { <START> try { <END> injectionContainer.newInstance(instance); } catch (Exception e) { throw new InjectionProviderException(e); } }</code><technical_language>A check is needed beginning of this method injectionContainer is null</technical_language>

Target:
public void postConstruct(Object instance, Object creationMetaData) throws InjectionProviderException { if (injectionContainer != null) { try { injectionContainer.newInstance(instance); } catch (Exception e) { throw new InjectionProviderException(e); } } }
Source:
<code>private String search(SearchRequest searchRequest, Model model, HttpServletRequest request) { SearchResultResponse resultResponse = doSearch(searchRequest, model, request); String queryText = formatQueryText(request); model.addAttribute("resultType", "searchResults"); <START> model.addAttribute("pageSubtitle", "Search results for <span class=\"query-request\">\"" <END> + queryText + "\"</span>"); return "searchResults"; }</code><technical_language>formatting/mark out of controllers. put queryText model attribute in searchResults.jsp</technical_language>

Target:
private String search(SearchRequest searchRequest, Model model, HttpServletRequest request) { SearchResultResponse resultResponse = doSearch(searchRequest, model, request); String queryText = formatQueryText(request); model.addAttribute("resultType", "searchResults"); model.addAttribute("pageSubtitle", queryText); return "searchResults"; }
Source:
<code>public IQueryBackend create(IQueryBackendContext context) { return new <START> LocalSearchBackend(context) { <END> @Override protected AbstractLocalSearchResultProvider initializeResultProvider(PQuery query, QueryEvaluationHint hints) throws QueryProcessingException { return new GenericLocalSearchResultProvider(this, context, query, planProvider, hints); } }; }</code><technical_language>calling geteAttributesByTypeForEClass a generic LS backend throw IllegalStateException</technical_language>

Target:
public IQueryBackend create(IQueryBackendContext context) { return new LocalSearchBackend(context) { @Override protected AbstractLocalSearchResultProvider initializeResultProvider(PQuery query, QueryEvaluationHint hints) throws QueryProcessingException { return new GenericLocalSearchResultProvider(this, context, query, planProvider, hints); } @Override public Table<EDataType, EClass, Set<EAttribute>> geteAttributesByTypeForEClass() { throw new UnsupportedOperationException("geteAttributesByTypeForEClass() is a legacy call not supported by the generic LS backend."); } }; }
Source:
<code>public static Response buildChangePasswordResponse(UserCredentialWrapper credentials) throws MDMAPIException { UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager(); ResponsePayload responsePayload = new ResponsePayload(); try { byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword()); byte[] decodedOldPassword = Base64.decodeBase64(credentials.getOldPassword()); userStoreManager.updateCredential(credentials.getUsername(), new String( decodedNewPassword, "UTF-8"), new String(decodedOldPassword, "UTF-8")); responsePayload.setStatusCode(HttpStatus.SC_CREATED); responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() + " was successfully changed."); return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build(); } catch (UserStoreException e) { <START> String errorMsg = "Exception in trying to change the password by username: " + credentials.getUsername(); <END> log.error(errorMsg, e); responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer("Old password does not match."); return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build(); } catch (UnsupportedEncodingException e) { String errorMsg = "Exception in trying to change the password by username: " + credentials.getUsername(); log.error(errorMsg, e); throw new MDMAPIException(errorMsg, e); } }</code><technical_language>explaining specific error message for of exception putting a generic message</technical_language>

Target:
public static Response buildChangePasswordResponse(UserCredentialWrapper credentials) throws MDMAPIException { UserStoreManager userStoreManager = MDMAPIUtils.getUserStoreManager(); ResponsePayload responsePayload = new ResponsePayload(); try { byte[] decodedNewPassword = Base64.decodeBase64(credentials.getNewPassword()); byte[] decodedOldPassword = Base64.decodeBase64(credentials.getOldPassword()); userStoreManager.updateCredential(credentials.getUsername(), new String( decodedNewPassword, "UTF-8"), new String(decodedOldPassword, "UTF-8")); responsePayload.setStatusCode(HttpStatus.SC_CREATED); responsePayload.setMessageFromServer("User password by username: " + credentials.getUsername() + " was successfully changed."); return Response.status(HttpStatus.SC_CREATED).entity(responsePayload).build(); } catch (UserStoreException e) { log.error(e.getMessage(), e); responsePayload.setStatusCode(HttpStatus.SC_BAD_REQUEST); responsePayload.setMessageFromServer("Old password does not match."); return Response.status(HttpStatus.SC_BAD_REQUEST).entity(responsePayload).build(); } catch (UnsupportedEncodingException e) { String errorMsg = "Could not change the password of the user: " + credentials.getUsername() + ". The Character Encoding is not supported."; log.error(errorMsg, e); throw new MDMAPIException(errorMsg, e); } }
Source:
<code>protected void onDetachedFromWindow() { super.onDetachedFromWindow(); <START> if (duration == 0) { <END> return; } listener.onVideoDetached(duration); }</code><technical_language>fire listener do this check in listener implementation. good separate this out this PR</technical_language>

Target:
protected void onDetachedFromWindow() { super.onDetachedFromWindow(); listener.onVideoDetached(duration); }
Source:
<code>public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); <START> if(!sconfig.isAsync.equalsIgnoreCase("true") && !sconfig.isAsync.equalsIgnoreCase("false")) { <END> throw new IllegalArgumentException("Async flag has to be either TRUE or FALSE."); } }</code><technical_language>Boolean.parseBoolean</technical_language>

Target:
public void configurePipeline(PipelineConfigurer pipelineConfigurer) { super.configurePipeline(pipelineConfigurer); isAsync = Boolean.parseBoolean(producerConfig.async); if (!producerConfig.async.equalsIgnoreCase("true") && !producerConfig.async.equalsIgnoreCase("false")) { throw new IllegalArgumentException("Async flag has to be either TRUE or FALSE."); } }
Source:
<code>private void updateAlbumArt() { final RadioDroidApp radioDroidApp = (RadioDroidApp) requireActivity().getApplication(); TrackMetadataSearcher trackMetadataSearcher = radioDroidApp.getTrackMetadataSearcher(); final StreamLiveInfo liveInfo = PlayerServiceUtil.getMetadataLive(); trackMetadataSearcher.fetchTrackMetadata(liveInfo.getArtist(), liveInfo.getTrack(), new TrackMetadataCallback() { @Override <START> public void onFailure() { <END> } @Override public void onSuccess(@NonNull final TrackMetadata trackMetadata) { requireActivity().runOnUiThread(() -> { final List<TrackMetadata.AlbumArt> albumArts = trackMetadata.getAlbumArts(); if (!albumArts.isEmpty()) { final String albumArtUrl = albumArts.get(0).url; if (!TextUtils.isEmpty(albumArtUrl)) { Picasso.with(getContext()) .load(albumArtUrl) .into(artAndInfoPagerAdapter.imageViewArt); trackHistoryRepository.setCurrentPlayingTrackArtUrl(albumArtUrl); } } }); } }); }</code><technical_language>Please fall station logo here, sth. like: DataRadioStation station = PlayerServiceUtil.getCurrentStation(); if (station != null) { Picasso.with(getContext()) .load(station.IconUrl) .into(artAndInfoPagerAdapter.imageViewArt);</technical_language>

Target:
private void updateAlbumArt() { if (trackMetadataCallback != null) { trackMetadataCallback.cancel(); } if (PlayerServiceUtil.getCurrentStation() == null) { return; } final RadioDroidApp radioDroidApp = (RadioDroidApp) requireActivity().getApplication(); TrackMetadataSearcher trackMetadataSearcher = radioDroidApp.getTrackMetadataSearcher(); final StreamLiveInfo liveInfo = PlayerServiceUtil.getMetadataLive(); final WeakReference<FragmentPlayerFull> fragmentWeakReference = new WeakReference<>(this); trackHistoryRepository.getLastInsertedHistoryItem((trackHistoryEntry, dao) -> { if (trackHistoryEntry == null) { Log.e(TAG, "trackHistoryEntry is null in updateAlbumArt which should not happen."); return; } FragmentPlayerFull fragment = fragmentWeakReference.get(); if (fragment != null) { fragment.requireActivity().runOnUiThread(() -> { if (fragment.isResumed()) { fragment.trackMetadataCallback = new PlayerTrackMetadataCallback(fragmentWeakReference, trackHistoryEntry); trackMetadataSearcher.fetchTrackMetadata(liveInfo.getArtist(), liveInfo.getTrack(), fragment.trackMetadataCallback); } }); } }); }
Source:
<code>public String getColumnText(@Nullable Object element, int columnIndex) { String value = ""; if (element instanceof HiddenTreeViewerEntry) { if (columnIndex == 0) { value = ((HiddenTreeViewerEntry) element).getName(); } } else { LatencyTreeViewerEntry obj = (LatencyTreeViewerEntry) element; if (obj != null) { if (columnIndex == 0) { <START> return checkNotNull(String.valueOf(obj.getName())); <END> } if (obj.getEntry().getNbSegments() > 0) { if (columnIndex == 1) { value = toFormattedString(obj.getEntry().getMin()); } else if (columnIndex == 2) { value = String.valueOf(toFormattedString(obj.getEntry().getMax())); } else if (columnIndex == 3) { value = String.valueOf(toFormattedString(obj.getEntry().getAverage())); } } } } return checkNotNull(value); }</code><technical_language>great, rename obj latencyTreeViewerEntry</technical_language>

Target:
public String getColumnText(@Nullable Object element, int columnIndex) { String value = ""; if (element instanceof HiddenTreeViewerEntry) { if (columnIndex == 0) { value = ((HiddenTreeViewerEntry) element).getName(); } } else if (element instanceof LatencyTreeViewerEntry) { LatencyTreeViewerEntry entry = (LatencyTreeViewerEntry) element; if (columnIndex == 0) { return checkNotNull(String.valueOf(entry.getName())); } if (entry.getEntry().getNbSegments() > 0) { if (columnIndex == 1) { value = toFormattedString(entry.getEntry().getMin()); } else if (columnIndex == 2) { value = String.valueOf(toFormattedString(entry.getEntry().getMax())); } else if (columnIndex == 3) { value = String.valueOf(toFormattedString(entry.getEntry().getAverage())); } } } return checkNotNull(value); }
Source:
<code>public void spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError_shouldBeIgnored() throws Throwable { requireTestSkip(new ThrowingRunnable() { @Override public void run() throws Throwable { new IdentityProcessorVerification(newTestEnvironment(), DEFAULT_TIMEOUT_MILLIS){ @Override public Processor createIdentityProcessor(int bufferSize) { return new NoopProcessor(); } @Override public ExecutorService publisherExecutorService() { return ex; } @Override public Object createElement(int element) { <START> return null; <END> } @Override public Publisher createHelperPublisher(long elements) { return SKIP; } @Override public Publisher createErrorStatePublisher() { return SKIP; } @Override public long maxSupportedSubscribers() { return 1; } }.spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError(); } }, "The Publisher under test only supports 1 subscribers, while this test requires at least 2 to run"); }</code><technical_language>return null</technical_language>

Target:
public void spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError_shouldBeIgnored() throws Throwable { requireTestSkip(new ThrowingRunnable() { @Override public void run() throws Throwable { new IdentityProcessorVerification<Integer>(newTestEnvironment(), DEFAULT_TIMEOUT_MILLIS){ @Override public Processor<Integer, Integer> createIdentityProcessor(int bufferSize) { return new NoopProcessor(); } @Override public ExecutorService publisherExecutorService() { return ex; } @Override public Integer createElement(int element) { return element; } @Override public Publisher<Integer> createHelperPublisher(long elements) { return SKIP; } @Override public Publisher<Integer> createErrorStatePublisher() { return SKIP; } @Override public long maxSupportedSubscribers() { return 1; } }.spec104_mustCallOnErrorOnAllItsSubscribersIfItEncountersANonRecoverableError(); } }, "The Publisher under test only supports 1 subscribers, while this test requires at least 2 to run"); }
Source:
<code>private int filterFeedbackResponseCommentResults( FeedbackResponseCommentSearchResultBundle frCommentSearchResults, List<InstructorAttributes> instructors, int totalResultsSize) { Iterator<Entry<String, List<FeedbackResponseAttributes>>> iterFr = frCommentSearchResults.responses.entrySet().iterator(); while (iterFr.hasNext()) { List<FeedbackResponseAttributes> frs = iterFr.next().getValue(); Iterator<FeedbackResponseAttributes> fr = frs.iterator(); while (fr.hasNext()) { FeedbackResponseAttributes response = fr.next(); FeedbackQuestionAttributes relatedQuestion = getRelatedQuestionOfResponse( frCommentSearchResults, response); InstructorAttributes instructor = this.getInstructorForCourseId( <START> response.courseId, instructors); <END> boolean isVisibleResponse = true; boolean needCheckPrivilege = relatedQuestion == null || !(relatedQuestion.recipientType == FeedbackParticipantType.NONE || relatedQuestion.recipientType == FeedbackParticipantType.INSTRUCTORS || relatedQuestion.recipientType == FeedbackParticipantType.STUDENTS); boolean isNotAllowedForInstructor = instructor == null || !(instructor.isAllowedForPrivilege(response.giverSection, response.feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)) || !(instructor.isAllowedForPrivilege(response.recipientSection, response.feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); if (needCheckPrivilege && isNotAllowedForInstructor) { isVisibleResponse = false; } if (!isVisibleResponse) { int sizeOfCommentList = frCommentSearchResults.comments.get(response.getId()).size(); totalResultsSize -= sizeOfCommentList; frCommentSearchResults.comments.remove(response.getId()); fr.remove(); } } } return totalResultsSize; }</code><technical_language>need break this line</technical_language>

Target:
private int filterFeedbackResponseCommentResults( FeedbackResponseCommentSearchResultBundle frCommentSearchResults, List<InstructorAttributes> instructors, int totalResultsSize) { Iterator<Entry<String, List<FeedbackResponseAttributes>>> iterFr = frCommentSearchResults.responses.entrySet().iterator(); while (iterFr.hasNext()) { List<FeedbackResponseAttributes> frs = iterFr.next().getValue(); Iterator<FeedbackResponseAttributes> fr = frs.iterator(); while (fr.hasNext()) { FeedbackResponseAttributes response = fr.next(); InstructorAttributes instructor = this.getInstructorForCourseId(response.courseId, instructors); boolean isVisibleResponse = true; boolean isNotAllowedForInstructor = instructor == null || !(instructor.isAllowedForPrivilege(response.giverSection, response.feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)) || !(instructor.isAllowedForPrivilege(response.recipientSection, response.feedbackSessionName, Const.ParamsNames.INSTRUCTOR_PERMISSION_VIEW_SESSION_IN_SECTIONS)); if (isNotAllowedForInstructor) { isVisibleResponse = false; } if (!isVisibleResponse) { int sizeOfCommentList = frCommentSearchResults.comments.get(response.getId()).size(); totalResultsSize -= sizeOfCommentList; frCommentSearchResults.comments.remove(response.getId()); fr.remove(); } } } return totalResultsSize; }
Source:
<code>public static String formatType(int pgType) { int valueType; switch (pgType) { case 0: return "-"; case PG_TYPE_BOOL: valueType = Value.BOOLEAN; break; case PG_TYPE_BYTEA: valueType = Value.VARBINARY; break; case 18: return "char"; case 19: return "name"; case PG_TYPE_INT8: valueType = Value.BIGINT; break; case PG_TYPE_INT2: valueType = Value.SMALLINT; break; case 22: return "int2vector"; case PG_TYPE_INT4: valueType = Value.INTEGER; break; case 24: return "regproc"; case PG_TYPE_TEXT: valueType = Value.CLOB; break; case PG_TYPE_FLOAT4: valueType = Value.REAL; break; case PG_TYPE_FLOAT8: valueType = Value.DOUBLE; break; <START> case PG_TYPE_INT2_ARRAY: return "_int2"; case PG_TYPE_INT4_ARRAY: return "_int4"; case PG_TYPE_VARCHAR_ARRAY: return "_varchar"; <END> case PG_TYPE_BPCHAR: valueType = Value.CHAR; break; case PG_TYPE_VARCHAR: valueType = Value.VARCHAR; break; case PG_TYPE_DATE: valueType = Value.DATE; break; case PG_TYPE_TIME: valueType = Value.TIME; break; case PG_TYPE_TIMETZ: valueType = Value.TIME_TZ; break; case PG_TYPE_TIMESTAMP: valueType = Value.TIMESTAMP; break; case PG_TYPE_TIMESTAMPTZ: valueType = Value.TIMESTAMP_TZ; break; case PG_TYPE_NUMERIC: valueType = Value.NUMERIC; break; case 2205: return "regclass"; default: return "???"; } return DataType.getDataType(valueType).name; }</code><technical_language>strings from? real PostgreSQL returns smallint[], integer[], character varying[] format_type() function</technical_language>

Target:
public static String formatType(int pgType) { int valueType; switch (pgType) { case 0: return "-"; case PG_TYPE_BOOL: valueType = Value.BOOLEAN; break; case PG_TYPE_BYTEA: valueType = Value.VARBINARY; break; case 18: return "char"; case 19: return "name"; case PG_TYPE_INT8: valueType = Value.BIGINT; break; case PG_TYPE_INT2: valueType = Value.SMALLINT; break; case 22: return "int2vector"; case PG_TYPE_INT4: valueType = Value.INTEGER; break; case 24: return "regproc"; case PG_TYPE_TEXT: valueType = Value.CLOB; break; case PG_TYPE_FLOAT4: valueType = Value.REAL; break; case PG_TYPE_FLOAT8: valueType = Value.DOUBLE; break; case PG_TYPE_INT2_ARRAY: return "smallint[]"; case PG_TYPE_INT4_ARRAY: return "integer[]"; case PG_TYPE_VARCHAR_ARRAY: return "character varying[]"; case PG_TYPE_BPCHAR: valueType = Value.CHAR; break; case PG_TYPE_VARCHAR: valueType = Value.VARCHAR; break; case PG_TYPE_DATE: valueType = Value.DATE; break; case PG_TYPE_TIME: valueType = Value.TIME; break; case PG_TYPE_TIMETZ: valueType = Value.TIME_TZ; break; case PG_TYPE_TIMESTAMP: valueType = Value.TIMESTAMP; break; case PG_TYPE_TIMESTAMPTZ: valueType = Value.TIMESTAMP_TZ; break; case PG_TYPE_NUMERIC: valueType = Value.NUMERIC; break; case 2205: return "regclass"; default: return "???"; } return DataType.getDataType(valueType).name; }
Source:
<code>public boolean create(String path, T data, int options) { String clientPath = path; String serverPath = prependChroot(clientPath); Cache<T> cache = getCache(serverPath); if (cache != null) { try { cache.lockWrite(); ZkBaseDataAccessor<T>.AccessResult result = <START> _baseAccessor.doCreate(_zkclient, serverPath, data, options); <END> boolean success = (result._retCode == RetCode.OK); updateCache(cache, result._pathCreated, success, serverPath, data, ZNode.ZERO_STAT); return success; } finally { cache.unlockWrite(); } } return _baseAccessor.create(serverPath, data, options); }</code><technical_language>If public API instead of removing, need change this all. In other words, diffs in CacheBaseDataAccessor</technical_language>

Target:
public boolean create(String path, T data, int options) { String clientPath = path; String serverPath = prependChroot(clientPath); Cache<T> cache = getCache(serverPath); if (cache != null) { try { cache.lockWrite(); ZkBaseDataAccessor<T>.AccessResult result = _baseAccessor.doCreate(serverPath, data, options); boolean success = (result._retCode == RetCode.OK); updateCache(cache, result._pathCreated, success, serverPath, data, ZNode.ZERO_STAT); return success; } finally { cache.unlockWrite(); } } return _baseAccessor.create(serverPath, data, options); }
Source:
<code>PkgControl(final String pkgName, final boolean regex) { parent = null; this.regex = regex; <START> fullPackage = addGroupingIfNecessary(pkgName, regex); <END> if (regex) { patternForPartialMatch = createPatternForPartialMatch(); patternForExactMatch = createPatternForExactMatch(); } else { patternForPartialMatch = null; patternForExactMatch = null; } }</code><technical_language>lets remove addGroupingIfNecessary need add groups for root item</technical_language>

Target:
PkgControl(final String pkgName, final boolean regex) { parent = null; this.regex = regex; if (regex) { fullPackage = encloseInGroup(pkgName); patternForPartialMatch = createPatternForPartialMatch(fullPackage); patternForExactMatch = createPatternForExactMatch(fullPackage); } else { fullPackage = pkgName; patternForPartialMatch = null; patternForExactMatch = null; } }
Source:
<code>private void createDirectoryForLeaderForEachClientUseCase(String namespace) { <START> if (Paths.get(tempFolder.getRoot().toPath().toString(), <END> PaxosTimeLockConstants.LEADER_PAXOS_NAMESPACE, PaxosTimeLockConstants.MULTI_LEADER_PAXOS_NAMESPACE, namespace).toFile().mkdirs()) { return; } throw new RuntimeException("Unexpected error when creating a subdirectory"); }</code><technical_language>nit: I nicer do tempFolder.getRoot().toPath().resolve(LEADER_PAXOS_NAMESPACE).resolve(...) behave in</technical_language>

Target:
private void createDirectoryForLeaderForEachClientUseCase(String namespace) { if (tempFolder.getRoot().toPath() .resolve(PaxosTimeLockConstants.LEADER_PAXOS_NAMESPACE) .resolve(PaxosTimeLockConstants.MULTI_LEADER_PAXOS_NAMESPACE) .resolve(namespace) .toFile() .mkdirs()) { return; } throw new RuntimeException("Unexpected error when creating a subdirectory"); }
Source:
<code>public QueryBuilder projection(SelectExpression... selectExpressions) { if (builder == null) throw new IllegalArgumentException("You have to call projection() on root query builder!"); String[] stringAttributes = new String[selectExpressions.length]; <START> for (int i = 0; i < selectExpressions.length; i++) { <END> stringAttributes[i] = selectExpressions[i].attribute; } builder.setProjection(stringAttributes); return this; }</code><technical_language>throw exception if selectExpression.function !=</technical_language>

Target:
public QueryBuilder projection(SelectExpression... selectExpressions) { if (builder == null) throw new IllegalArgumentException("You have to call projection() on root query builder!"); String[] stringAttributes = new String[selectExpressions.length]; for (int i = 0; i < selectExpressions.length; i++) { if (selectExpressions[i].function != AggregationFunction.NONE) { throw new IllegalArgumentException("This version of infinispan doesn't support aggregations!"); } stringAttributes[i] = selectExpressions[i].attribute; } builder.setProjection(stringAttributes); return this; }
Source:
<code><START> private Object readResolve() { <END> if (StringUtils.isBlank(name)) { LOGGER.log(Level.WARNING, "Read install state with blank name: ''{0}''. It will be ignored", name); return UNKNOWN; } InstallState state = InstallState.valueOf(name); if (state == null) { LOGGER.log(Level.WARNING, "Cannot locate an extension point for the state ''{0}''. It will be ignored", name); return UNKNOWN; } return state; }</code><technical_language>a final class. extension point, potentially some migrations in custom implementations plugins</technical_language>

Target:
protected Object readResolve() { if (StringUtils.isBlank(name)) { LOGGER.log(Level.WARNING, "Read install state with blank name: ''{0}''. It will be ignored", name); return UNKNOWN; } InstallState state = InstallState.valueOf(name); if (state == null) { LOGGER.log(Level.WARNING, "Cannot locate an extension point for the state ''{0}''. It will be ignored", name); return UNKNOWN; } return state; }
Source:
<code>private int applyFilterFunctions(int[] positions, int positionCount) { BlockLease[] blockLeases = new BlockLease[getStreamReaders().length]; Block[] blocks = new Block[getStreamReaders().length]; for (int columnIndex : filterFunctionInputs) { blockLeases[columnIndex] = getStreamReaders()[columnIndex].getBlockView(positions, positionCount); blocks[columnIndex] = blockLeases[columnIndex].get(); } try { initializeOutputPositions(positionCount); for (FilterFunction function : filterFunctions) { int[] inputs = function.getInputChannels(); Block[] inputBlocks = new Block[inputs.length]; for (int i = 0; i < inputs.length; i++) { inputBlocks[i] = blocks[filterFunctionInputMapping.get(inputs[i])]; } Page page = new Page(positionCount, inputBlocks); positionCount = function.filter(page, outputPositions, positionCount, errors); if (positionCount == 0) { break; } } for (int i = 0; i < positionCount; i++) { if (errors[i] != null) { throw errors[i]; } } for (int i = 0; i < positionCount; i++) { outputPositions[i] = positions[outputPositions[i]]; } return positionCount; } finally { <START> for (int i = 0; i < blockLeases.length; i++) { <END> if (blockLeases[i] != null) { blockLeases[i].close(); } } } }</code><technical_language>java for (BlockLease blockLease : blockLeases) { if (blockLease != null) { blockLease.close(); } }</technical_language>

Target:
private int applyFilterFunctions(int[] positions, int positionCount) { BlockLease[] blockLeases = new BlockLease[getStreamReaders().length]; Block[] blocks = new Block[getStreamReaders().length]; for (int columnIndex : filterFunctionInputs) { blockLeases[columnIndex] = getStreamReaders()[columnIndex].getBlockView(positions, positionCount); blocks[columnIndex] = blockLeases[columnIndex].get(); } try { initializeOutputPositions(positionCount); for (FilterFunction function : filterFunctions) { int[] inputs = function.getInputChannels(); Block[] inputBlocks = new Block[inputs.length]; for (int i = 0; i < inputs.length; i++) { inputBlocks[i] = blocks[filterFunctionInputMapping.get(inputs[i])]; } Page page = new Page(positionCount, inputBlocks); positionCount = function.filter(page, outputPositions, positionCount, errors); if (positionCount == 0) { break; } } for (int i = 0; i < positionCount; i++) { if (errors[i] != null) { throw errors[i]; } } for (int i = 0; i < positionCount; i++) { outputPositions[i] = positions[outputPositions[i]]; } return positionCount; } finally { for (BlockLease blockLease : blockLeases) { if (blockLease != null) { blockLease.close(); } } } }
Source:
<code>public boolean isTaskExecutable(NodeSet selectedNodes, EligibleTaskDescriptor task) { logger.info("PolicyWhichThrowsExceptions::isTaskExecutable is called " + counter); <START> if(counter == 1 || counter == 2 || counter == 3 || counter == 4){ <END> ++counter; throw new Error("Error for TestRMReconnectioBug test"); }else{ ++counter; return super.isTaskExecutable(selectedNodes, task); } }</code><technical_language>if(counter > 0 && counter <= 4){</technical_language>

Target:
public boolean isTaskExecutable(NodeSet selectedNodes, EligibleTaskDescriptor task) { logger.info("PolicyWhichThrowsExceptions::isTaskExecutable is called " + counter); if (1 <= counter && counter <= 4) { ++counter; throw new Error("This error is thrown to perform reconnection to RM"); } else { ++counter; return super.isTaskExecutable(selectedNodes, task); } }
Source:
<code>public Map<Address, Response> forwardCommandIfNeeded(TopologyAffectedCommand command, Set<Object> affectedKeys, Address origin) { LocalizedCacheTopology cacheTopology = distributionManager.getCacheTopology(); if (cacheTopology == null) { if (trace) { log.tracef("Not fowarding command %s because topology is null.", command); } return Collections.emptyMap(); } int cmdTopologyId = command.getTopologyId(); int localTopologyId = cacheTopology.getTopologyId(); if (trace) { log.tracef("CommandTopologyId=%s, localTopologyId=%s", cmdTopologyId, localTopologyId); } if (cmdTopologyId < localTopologyId) { <START> Collection<Address> writeTargets = cacheTopology.getWriteTargets(affectedKeys); <END> Set<Address> newTargets = new HashSet<>(writeTargets != null ? writeTargets : cacheTopology.getMembers()); newTargets.remove(rpcManager.getAddress()); newTargets.remove(origin); if (!newTargets.isEmpty()) { command.setTopologyId(localTopologyId); if (trace) { log.tracef("Forwarding command %s to new targets %s", command, newTargets); } final RpcOptions rpcOptions = rpcManager.getDefaultRpcOptions(false, DeliverOrder.NONE); return rpcManager.invokeRemotely(newTargets, command, rpcOptions); } } return Collections.emptyMap(); }</code><technical_language>LCT.getWriteOwners, returning null better. Some people consider null anachronism :)</technical_language>

Target:
public Map<Address, Response> forwardCommandIfNeeded(TopologyAffectedCommand command, Set<Object> affectedKeys, Address origin) { LocalizedCacheTopology cacheTopology = distributionManager.getCacheTopology(); if (cacheTopology == null) { if (trace) { log.tracef("Not fowarding command %s because topology is null.", command); } return Collections.emptyMap(); } int cmdTopologyId = command.getTopologyId(); int localTopologyId = cacheTopology.getTopologyId(); if (trace) { log.tracef("CommandTopologyId=%s, localTopologyId=%s", cmdTopologyId, localTopologyId); } if (cmdTopologyId < localTopologyId) { Collection<Address> newTargets = new HashSet<>(cacheTopology.getWriteOwners(affectedKeys)); newTargets.remove(rpcManager.getAddress()); newTargets.remove(origin); if (!newTargets.isEmpty()) { command.setTopologyId(localTopologyId); if (trace) { log.tracef("Forwarding command %s to new targets %s", command, newTargets); } final RpcOptions rpcOptions = rpcManager.getDefaultRpcOptions(false, DeliverOrder.NONE); return rpcManager.invokeRemotely(newTargets, command, rpcOptions); } } return Collections.emptyMap(); }
Source:
<code>public void setLocalStorageProviderId(String id) { if (!mLocalStorageProviderId.equals(id)) { boolean successful = false; try { switchLocalStorage(id); successful = true; } catch (MessagingException e) { <START> Timber.e("Switching local storage provider from " + <END> mLocalStorageProviderId + " to " + id + " failed.", e); } if (!successful) { return; } mLocalStorageProviderId = id; } }</code><technical_language>switch string concatenations in log messages. Timber supports format strings. this be: java Timber.e(e, "Switching local storage provider %s %s failed", mLocalStorageProviderId, id);</technical_language>

Target:
public void setLocalStorageProviderId(String id) { if (!mLocalStorageProviderId.equals(id)) { boolean successful = false; try { switchLocalStorage(id); successful = true; } catch (MessagingException e) { Timber.e(e, "Switching local storage provider from %s to %s failed.", mLocalStorageProviderId, id); } if (!successful) { return; } mLocalStorageProviderId = id; } }
Source:
<code>private void checkServiceClientNaming(DetailAST classDefToken) { if (!hasServiceClientAnnotation) { return; } final String className = classDefToken.findFirstToken(TokenTypes.IDENT).getText(); if (isAsync && !className.endsWith(ASYNC_CLIENT)) { <START> log(classDefToken, String.format("Async class ''%s'' should named <ServiceName>AsyncClient ", className)); <END> } if (!isAsync && !className.endsWith(CLIENT)) { log(classDefToken, String.format("Sync class %s should named <ServiceName>Client.", className)); } }</code><technical_language>suggestion log(classDefToken, String.format("Async class ''%s'' named <ServiceName>AsyncClient ", className));</technical_language>

Target:
private void checkServiceClientNaming(DetailAST classDefToken) { final String className = classDefToken.findFirstToken(TokenTypes.IDENT).getText(); if (isAsync && !className.endsWith(ASYNC_CLIENT)) { log(classDefToken, String.format("Async class ''%s'' must be named <ServiceName>AsyncClient ", className)); } if (!isAsync && !className.endsWith(CLIENT)) { log(classDefToken, String.format("Sync class %s must be named <ServiceName>Client.", className)); } }
Source:
<code>protected void setDefaultValue( long defaultValue ) throws IOException { <START> if ( entrySize == Integer.BYTES ) <END> { defaultValue |= defaultValue << 32; } try ( PageCursor writeCursor = pagedFile.io( 0, PF_SHARED_WRITE_LOCK | PF_NO_GROW ) ) { writeCursor.next(); int pageSize = pagedFile.pageSize(); fillPageWithDefaultValue( writeCursor, defaultValue, pageSize ); if ( pageId( length - 1 ) > 0 ) { try ( PageCursor cursor = pagedFile.io( 1, PF_NO_GROW | PF_SHARED_WRITE_LOCK ) ) { while ( cursor.next() ) { writeCursor.copyTo( 0, cursor, 0, pageSize ); } } } } }</code><technical_language>strange this check here, this extracted subclass instead</technical_language>

Target:
protected void setDefaultValue( long defaultValue ) throws IOException { try ( PageCursor writeCursor = pagedFile.io( 0, PF_SHARED_WRITE_LOCK | PF_NO_GROW ) ) { writeCursor.next(); int pageSize = pagedFile.pageSize(); fillPageWithDefaultValue( writeCursor, defaultValue, pageSize ); if ( pageId( length - 1 ) > 0 ) { try ( PageCursor cursor = pagedFile.io( 1, PF_NO_GROW | PF_SHARED_WRITE_LOCK ) ) { while ( cursor.next() ) { writeCursor.copyTo( 0, cursor, 0, pageSize ); checkBounds( writeCursor ); } } } } }
Source:
<code>public void findOne() throws Exception { context.turnOffAuthorisationSystem(); BitstreamFormat bitstreamFormat = BitstreamFormatBuilder.createBitstreamFormat(context) .withMimeType("application/octet-stream") .withDescription("Description") .build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/bitstreamformats/" + bitstreamFormat.getID())) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$.description", is(bitstreamFormat.getDescription()))) .andExpect(jsonPath("$.shortDescription", is(bitstreamFormat.getShortDescription()))) .andExpect(jsonPath("$.mimetype", is(bitstreamFormat.getMIMEType()))) .andExpect(jsonPath("$.type", is("bitstreamformat"))) .andExpect(jsonPath("$._links.self.href", startsWith(REST_SERVER_URL))) .andExpect(jsonPath("$._links.self.href", endsWith("/api/core/bitstreamformats/" + bitstreamFormat.getID()))); <START> } <END></code><technical_language>nice if restore previous indentation for existing tests changes introduced</technical_language>

Target:
public void findOne() throws Exception { context.turnOffAuthorisationSystem(); BitstreamFormat bitstreamFormat = BitstreamFormatBuilder.createBitstreamFormat(context) .withMimeType("application/octet-stream") .withDescription("Description") .build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/bitstreamformats/" + bitstreamFormat.getID())) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$", Matchers.is( BitstreamFormatMatcher .matchBitstreamFormat(bitstreamFormat.getID(), bitstreamFormat.getMIMEType(), bitstreamFormat.getDescription()) ))); }