auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public String getQueryFeature(final int configurationIndex, final double queryRuntime) throws PerfEnforceException { String featureFilePath = Paths.get( onlineLearningPath, "features", String.valueOf(PerfEnforceDriver.configurations.get(configurationIndex))) .toString(); try { BufferedReader featureReader = new BufferedReader(new FileReader(featureFilePath)); String result = featureReader.readLine(); if (queryRuntime != 0) { String[] parts = result.split(","); result = <START> parts[0] <END> + "," + parts[1] + "," + parts[2] + "," + parts[3] + "," + parts[4] + "," + parts[5] + "," + queryRuntime; } featureReader.close(); return result; } catch (Exception e) { throw new PerfEnforceException("Error collecting query feature"); } }</code><technical_language>Joiner save some space</technical_language>

Target:
public String getQueryFeature(final int configurationIndex, final double queryRuntime) throws PerfEnforceException { String featureFilePath = Paths.get( onlineLearningPath, "features", String.valueOf(PerfEnforceDriver.configurations.get(configurationIndex))) .toString(); try (BufferedReader featureReader = new BufferedReader(new FileReader(featureFilePath))) { String result = featureReader.readLine(); if (queryRuntime != 0) { String[] parts = result.split(","); result = Joiner.on(",").join(parts); result += "," + queryRuntime; } return result; } catch (Exception e) { throw new PerfEnforceException("Error collecting query feature"); } }
Source:
<code>public void testTransactionPropagates() throws Exception { Foo foo = db.getJdbi().open().attach(Foo.class); try { foo.insertAndFail(1, "Jeff"); fail("should have raised an exception"); } catch (Exception e){ <START> assertThat(e).isNotNull(); <END> } Something n = foo.createBar().findById(1); assertThat(n).isNull(); }</code><technical_language>Another</technical_language>

Target:
public void testTransactionPropagates() throws Exception { Foo foo = db.getJdbi().open().attach(Foo.class); assertThatExceptionOfType(Exception.class).isThrownBy(() -> foo.insertAndFail(1, "Jeff")); Something n = foo.createBar().findById(1); assertThat(n).isNull(); }
Source:
<code>public static void readInDocFromString(String fName, ByteBufferInputStream bbis, DataInputStream di, ArrayBackedValueStorage abvs, XMLParser parser) throws HyracksDataException { if (!fName.contains("hdfs:/")) { File file = new File(fName); if (file.exists()) { parser.parseDocument(file, abvs); } } else { fName = fName.replaceAll("hdfs:/", ""); HDFSFunctions hdfs = new HDFSFunctions(null, null); FileSystem fs = hdfs.getFileSystem(); if (fs != null) { try { Path xmlDocument = new Path(fName); if (fs.exists(xmlDocument)) { InputStream in = fs.open(xmlDocument).getWrappedStream(); parser.parseHDFSDocument(in, abvs); in.close(); } fs.close(); } catch (IOException e) { throw new HyracksDataException(e); } finally { <START> } <END> } } }</code><technical_language>do empty finally block</technical_language>

Target:
public static void readInDocFromString(String fName, ByteBufferInputStream bbis, DataInputStream di, ArrayBackedValueStorage abvs, XMLParser parser) throws HyracksDataException { if (!fName.contains("hdfs:/")) { File file = new File(fName); if (file.exists()) { parser.parseDocument(file, abvs); } } else { HDFSFunctions hdfs = new HDFSFunctions(null, null); FileSystem fs = hdfs.getFileSystem(); if (fs != null) { try { String fHdfsName = fName.replaceAll("hdfs:/", ""); Path xmlDocument = new Path(fHdfsName); if (fs.exists(xmlDocument)) { InputStream in = fs.open(xmlDocument).getWrappedStream(); parser.parseHDFSDocument(in, abvs); in.close(); } fs.close(); } catch (IOException e) { throw new HyracksDataException(e); } } } }
Source:
<code>public MultiPartEventForwarder() { payloadParamName = Context.getConfig().getString("event.forward.paramMode.payloadParamName", "payload"); <START> additionalParams = Context.getConfig().getString("event.forward.paramMode.additionalParams", ""); <END> }</code><technical_language>empty string null</technical_language>

Target:
public MultiPartEventForwarder() { payloadParamName = Context.getConfig().getString("event.forward.paramMode.payloadParamName", "payload"); additionalParams = Context.getConfig().getString("event.forward.paramMode.additionalParams"); }
Source:
<code>public CsvSchema csvSchema() { CsvSchema.Builder schemaBuilder = new CsvSchema.Builder() ; <START> for (String value : getContent().keySet()) { <END> schemaBuilder.addColumn(value, CsvSchema.ColumnType.STRING); } return schemaBuilder.build(); }</code><technical_language>Hmm, thinking this right. work for /item resource moment, for /records (or /items) resource, need a single schema work for arbitrary records (or items). This means need include fields in schema, fields present in a item. So, for example, if a country end-date, I end-date column in CsvSchema</technical_language>

Target:
public CsvSchema csvSchema() { CsvSchema.Builder schemaBuilder = new CsvSchema.Builder() ; for (String value : getRegister().getFields()) { schemaBuilder.addColumn(value, CsvSchema.ColumnType.STRING); } return schemaBuilder.build(); }
Source:
<code><START> Registration with(MBeanServer server) { <END> this.server = server; return this; }</code><technical_language>protected instead of package protected</technical_language>

Target:
protected Registration with(MBeanServer server) { this.server = server; return this; }
Source:
<code>private List<String> getTeamNames(FeedbackSessionResultsBundle bundle) { List<String> teamNames = new ArrayList<String>(); for (String studentEmail : bundle.emailTeamNameTable.keySet()) { <START> String teamName = bundle.emailTeamNameTable.get(studentEmail); <END> if (!teamNames.contains(teamName)) { teamNames.add(teamName); } } return teamNames; }</code><technical_language>want iterate <code>bundle.emailTeamNameTable.values()</code></technical_language>

Target:
private List<String> getTeamNames(FeedbackSessionResultsBundle bundle) { List<String> teamNames = new ArrayList<String>(); for (Set<String> teamNamesForSection : bundle.sectionTeamNameTable.values()) { teamNames.addAll(teamNamesForSection); } return teamNames; }
Source:
<code>@NonNull public ListCardItemView setSubtitle(@Nullable CharSequence subtitle) { <START> subtitleView.setText(subtitle); <END> return this; }</code><technical_language>this calling base method of TextView.setText() bypassing overridden method in GoneIfEmptyTextView? (it appears in testing.)</technical_language>

Target:
@NonNull public ListCardItemView setSubtitle(@Nullable CharSequence subtitle) { subtitleView.setText((String) subtitle); return this; }
Source:
<code>public void close() throws IOException { writerCheckpointMutex.lock(); try { if ( closed ) { return; } <START> closed = true; <END> writer.close(); pagedFile.close(); } finally { writerCheckpointMutex.unlock(); } }</code><technical_language>do marking index closed closing resource</technical_language>

Target:
public void close() throws IOException { writerCheckpointMutex.lock(); try { if ( closed ) { return; } writer.close(); pagedFile.close(); closed = true; } finally { writerCheckpointMutex.unlock(); } }
Source:
<code>public void changedAttributeHook(PerunSessionImpl session, User user, Attribute attribute) throws InternalErrorException, WrongReferenceAttributeValueException { try { String userNamespace = attribute.getFriendlyNameParameter(); if(userNamespace.equals("lifescience-hostel-persistent-shadow") && attribute.getValue() != null){ ExtSource extSource = session.getPerunBl().getExtSourcesManagerBl().getExtSourceByName(session, extSourceNameLSH); <START> UserExtSource userExtSource = new UserExtSource(extSource, 0, attribute.getValue().toString()); <END> session.getPerunBl().getUsersManagerBl().addUserExtSource(session, user, userExtSource); } } catch (UserExtSourceExistsException ex) { log.warn("LIFESCIENCE HOSTEL IdP external source already exists for the user.", ex); } catch (ExtSourceNotExistsException ex) { throw new InternalErrorException("IdP external source for LIFESCIENCE HOSTEL doesn't exist.", ex); } }</code><technical_language>change type of resulting attribute String ((String)attribute.getValue()) instead of calling toString() object</technical_language>

Target:
public void changedAttributeHook(PerunSessionImpl session, User user, Attribute attribute) throws InternalErrorException, WrongReferenceAttributeValueException { try { String userNamespace = attribute.getFriendlyNameParameter(); if(userNamespace.equals("lifescience-hostel-persistent-shadow") && attribute.getValue() != null){ ExtSource extSource = session.getPerunBl().getExtSourcesManagerBl().getExtSourceByName(session, extSourceNameLSH); UserExtSource userExtSource = new UserExtSource(extSource, 0, ((String)attribute.getValue())); session.getPerunBl().getUsersManagerBl().addUserExtSource(session, user, userExtSource); } } catch (UserExtSourceExistsException ex) { log.warn("LIFESCIENCE HOSTEL IdP external source already exists for the user.", ex); } catch (ExtSourceNotExistsException ex) { throw new InternalErrorException("IdP external source for LIFESCIENCE HOSTEL doesn't exist.", ex); } }
Source:
<code>public static String convertStringToSearchQuery(String input) { if (input == null) { return "%"; } <START> return "%" + input.trim().toUpperCase().replaceAll("[\\s,%]+", " ").replaceAll("_", Matcher.quoteReplacement("\\_")) + "%"; <END> }</code><technical_language>% escaped \\% _ character. is % a character in some searchable fields</technical_language>

Target:
public static String convertStringToSearchQuery(String input) { if (input == null) { return "%"; } return "%" + input.trim().toUpperCase().replaceAll("(\\s|,)+", " ").replaceAll("_", Matcher.quoteReplacement("\\_")).replaceAll("%", Matcher.quoteReplacement("\\%")) + "%"; }
Source:
<code>private Request translateRequest(final ClientRequest clientRequest) { final HttpMethod method = HttpMethod.fromString(clientRequest.getMethod()); if (method == null) { throw new ProcessingException(LocalizationMessages.METHOD_NOT_SUPPORTED(clientRequest.getMethod())); } final URI uri = clientRequest.getUri(); Request request = null; <START> switch (method) { <END> case GET: request = client.newRequest(uri); request.method(method); break; case POST: request = client.newRequest(uri); request.method(method); break; case PUT: request = client.newRequest(uri); request.method(method); break; case DELETE: request = client.newRequest(uri); request.method(method); break; case HEAD: request = client.newRequest(uri); request.method(method); break; case OPTIONS: request = client.newRequest(uri); request.method(method); break; case TRACE: request = client.newRequest(uri); request.method(method); break; case CONNECT: request = client.newRequest(uri); request.method(method); break; case MOVE: request = client.newRequest(uri); request.method(method); break; } request.followRedirects(PropertiesHelper.getValue(clientRequest.getConfiguration().getProperties(), ClientProperties.FOLLOW_REDIRECTS, client.isFollowRedirects())); final Object readTimeout = clientRequest.getConfiguration().getProperties().get(ClientProperties.READ_TIMEOUT); if (readTimeout != null && readTimeout instanceof Integer && (Integer)readTimeout > 0) { request.timeout((Integer) readTimeout, TimeUnit.MILLISECONDS); } writeOutBoundHeaders(clientRequest.getHeaders(), request); return request; }</code><technical_language>This redundant (if idea is restrict allowed methods, lacks a default branch a lot more compact a fall-through)</technical_language>

Target:
private Request translateRequest(final ClientRequest clientRequest) { final HttpMethod method = HttpMethod.fromString(clientRequest.getMethod()); if (method == null) { throw new ProcessingException(LocalizationMessages.METHOD_NOT_SUPPORTED(clientRequest.getMethod())); } final URI uri = clientRequest.getUri(); Request request = client.newRequest(uri); request.method(method); request.followRedirects(clientRequest.resolveProperty(ClientProperties.FOLLOW_REDIRECTS, true)); final Object readTimeout = clientRequest.getConfiguration().getProperties().get(ClientProperties.READ_TIMEOUT); if (readTimeout != null && readTimeout instanceof Integer && (Integer)readTimeout > 0) { request.timeout((Integer) readTimeout, TimeUnit.MILLISECONDS); } writeOutBoundHeaders(clientRequest.getHeaders(), request); return request; }
Source:
<code>public Client resolveArgument(final MethodParameter parameter, final ModelAndViewContainer mavContainer, final NativeWebRequest request, final WebDataBinderFactory binderFactory) throws Exception { final Optional<String> clientId = Optional.ofNullable(request.getUserPrincipal()).map(Principal::getName); if (!featureToggleService.isFeatureEnabled(CHECK_APPLICATION_LEVEL_PERMISSIONS) || clientId.filter(settings.getAdminClientId()::equals).isPresent()) { return Client.PERMIT_ALL; } final Optional<Client> principal = clientId.map(Client.Authorized::new); <START> if (settings.getAuthMode() == SecuritySettings.AuthMode.OFF) { <END> return principal.orElseGet(() -> Client.PERMIT_ALL); } return principal.orElseThrow(() -> new UnauthorizedUserException("Client unauthorized")); }</code><technical_language>want include this condition if return PERMIT_ALL is auth mode is OFF</technical_language>

Target:
public Client resolveArgument(final MethodParameter parameter, final ModelAndViewContainer mavContainer, final NativeWebRequest request, final WebDataBinderFactory binderFactory) throws Exception { final Optional<String> clientId = Optional.ofNullable(request.getUserPrincipal()).map(Principal::getName); if (!featureToggleService.isFeatureEnabled(CHECK_APPLICATION_LEVEL_PERMISSIONS) || clientId.filter(settings.getAdminClientId()::equals).isPresent() || settings.getAuthMode() == OFF) { return Client.PERMIT_ALL; } return clientId.map(Client.Authorized::new) .orElseThrow(() -> new UnauthorizedUserException("Client unauthorized")); }
Source:
<code>protected void executeCommand() { boolean success = true; StorageServerConnections connection = getConnection(); if (!Guid.isNullOrEmpty(getVdsId())) { Pair<Boolean, Integer> result = connectHostToStorage(); boolean isValidConnection = result.getFirst(); if (!isValidConnection) { VdcFault fault = new VdcFault(); fault.setError(VdcBllErrors.forValue(result.getSecond())); getReturnValue().setFault(fault); success = false; } } <START> setSucceeded(success); <END> if (success) { connection.setid(Guid.newGuid().toString()); saveConnection(connection); getReturnValue().setActionReturnValue(getConnection().getid()); setSucceeded(true); } }</code><technical_language>need set twice. set in line of method</technical_language>

Target:
protected void executeCommand() { boolean success = true; StorageServerConnections connection = getConnection(); if (!Guid.isNullOrEmpty(getParameters().getVdsId())) { Pair<Boolean, Integer> result = connectHostToStorage(); boolean isValidConnection = result.getFirst(); if (!isValidConnection) { VdcFault fault = new VdcFault(); fault.setError(VdcBllErrors.forValue(result.getSecond())); getReturnValue().setFault(fault); success = false; } } if (success) { connection.setid(Guid.newGuid().toString()); saveConnection(connection); getReturnValue().setActionReturnValue(getConnection().getid()); } setSucceeded(success); }
Source:
<code>public void fillResponseTextBox(int qnNumber, int responseNumber, String text) { WebElement element = browser.driver.findElement( By.name(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" + qnNumber + "-" + responseNumber)); click(element); element.clear(); <START> element.sendKeys(text); <END> JavascriptExecutor jsExecutor = (JavascriptExecutor) browser.driver; jsExecutor.executeScript("$(arguments[0]).change();", element); }</code><technical_language>previous fillTextBox(...) work</technical_language>

Target:
public void fillResponseTextBox(int qnNumber, int responseNumber, String text) { WebElement element = browser.driver.findElement( By.name(Const.ParamsNames.FEEDBACK_RESPONSE_TEXT + "-" + qnNumber + "-" + responseNumber)); click(element); fillTextBox(element, text); JavascriptExecutor jsExecutor = (JavascriptExecutor) browser.driver; jsExecutor.executeScript("$(arguments[0]).change();", element); }
Source:
<code>public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertMessageEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, ""); <END> assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertMessageEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateMessageEventCatching emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_NO_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertMessageEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, NON_CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>void compute(ProgressMonitor pm) throws IOException { if (pm == null) pm = NullProgressMonitor.INSTANCE; pm.beginTask(JGitText.get().renamesFindingByContent, 2 * srcs.size() * dsts.size()); int mNext = <START> buildMatrix(pm); <END> out = new ArrayList<>(Math.min(mNext, dsts.size())); for (--mNext; mNext >= 0; mNext--) { if (pm.isCancelled()) { throw new CancelledException(JGitText.get().renameCancelled); } long ent = matrix[mNext]; int sIdx = srcFile(ent); int dIdx = dstFile(ent); DiffEntry s = srcs.get(sIdx); DiffEntry d = dsts.get(dIdx); if (d == null) { pm.update(1); continue; } ChangeType type; if (s.changeType == ChangeType.DELETE) { s.changeType = ChangeType.RENAME; type = ChangeType.RENAME; } else { type = ChangeType.COPY; } out.add(DiffEntry.pair(type, s, d, score(ent))); dsts.set(dIdx, null); pm.update(1); } srcs = compactSrcList(srcs); dsts = compactDstList(dsts); pm.endTask(); }</code><technical_language>nested loops buildMatrix check for cancellation throw CanceledException</technical_language>

Target:
void compute(ProgressMonitor pm) throws IOException, CanceledException { if (pm == null) pm = NullProgressMonitor.INSTANCE; pm.beginTask(JGitText.get().renamesFindingByContent, 2 * srcs.size() * dsts.size()); int mNext = buildMatrix(pm); out = new ArrayList<>(Math.min(mNext, dsts.size())); for (--mNext; mNext >= 0; mNext--) { if (pm.isCancelled()) { throw new CanceledException(JGitText.get().renameCancelled); } long ent = matrix[mNext]; int sIdx = srcFile(ent); int dIdx = dstFile(ent); DiffEntry s = srcs.get(sIdx); DiffEntry d = dsts.get(dIdx); if (d == null) { pm.update(1); continue; } ChangeType type; if (s.changeType == ChangeType.DELETE) { s.changeType = ChangeType.RENAME; type = ChangeType.RENAME; } else { type = ChangeType.COPY; } out.add(DiffEntry.pair(type, s, d, score(ent))); dsts.set(dIdx, null); pm.update(1); } srcs = compactSrcList(srcs); dsts = compactDstList(dsts); pm.endTask(); }
Source:
<code>public String renderArticle(HttpServletRequest request, Model model, @SiteParam Site site, RequestedDoiVersion articleId) throws IOException { ArticlePointer articlePointer = articleMetadataFactory.get(site, articleId) .validateVisibility("article") .populate(request, model) .fillAmendments(model) .getArticlePointer(); XmlContent xmlContent = getXmlContent(site, articlePointer); model.addAttribute("articleText", xmlContent.html); model.addAttribute("references", xmlContent.references); <START> model.addAttribute("isArticlePage", true); <END> return site + "/ftl/article/article"; }</code><technical_language>I involve controller code in this fix if it. put html <#assign isArticlePage = true /> top of article.ftl instead? Also, this create inconsistency main article body tab other article pages? currently implemented, I get "Journal Title: Journal Slogan" non-article pages, "Article Title" main body tab, "Journal Title: Article Title" other article pages</technical_language>

Target:
public String renderArticle(HttpServletRequest request, Model model, @SiteParam Site site, RequestedDoiVersion articleId) throws IOException { ArticlePointer articlePointer = articleMetadataFactory.get(site, articleId) .validateVisibility("article") .populate(request, model) .fillAmendments(model) .getArticlePointer(); XmlContent xmlContent = getXmlContent(site, articlePointer); model.addAttribute("articleText", xmlContent.html); model.addAttribute("references", xmlContent.references); return site + "/ftl/article/article"; }
Source:
<code>public UserDevfileImpl getById(String id) throws NotFoundException, ServerException { requireNonNull(id); try { final UserDevfileImpl devfile = managerProvider.get().find(UserDevfileImpl.class, id); if (devfile == null) { throw new NotFoundException(format("Devfile with id '%s' doesn't exist", id)); } <START> return new UserDevfileImpl(devfile); <END> } catch (RuntimeException ex) { throw new ServerException(ex.getLocalizedMessage(), ex); } }</code><technical_language>devfile detached JPA session leaves this method anyway? do need create a copy of it</technical_language>

Target:
public Optional<UserDevfile> getById(String id) throws ServerException { requireNonNull(id); try { final UserDevfileImpl devfile = managerProvider.get().find(UserDevfileImpl.class, id); if (devfile == null) { return Optional.empty(); } return Optional.of(new UserDevfileImpl(devfile)); } catch (RuntimeException ex) { throw new ServerException(ex.getLocalizedMessage(), ex); } }
Source:
<code>public static ConsistencyCheckStrategy getById(byte id) { <START> for (ConsistencyCheckStrategy type : values()) { <END> if (type.id == id) { return type; } } throw new IllegalArgumentException("Could not find a ConsistencyCheckStrategy with an ID:" + id); }</code><technical_language>result of values() cached if getById is a frequent call</technical_language>

Target:
public static ConsistencyCheckStrategy getById(byte id) { for (ConsistencyCheckStrategy type : VALUES) { if (type.id == id) { return type; } } throw new IllegalArgumentException("Could not find a ConsistencyCheckStrategy with an ID:" + id); }
Source:
<code>public void close() { for (TopicPartition tp : assignment) { try { topicPartitionWriters.get(tp).close(); } catch (ConnectException e) { log.error("Error closing writer for {}. Error: {}", tp, e.getMessage()); } finally { topicPartitionWriters.remove(tp); } } <START> assignment.clear(); <END> }</code><technical_language>nan</technical_language>

Target:
public void close() { for (TopicPartition tp : assignment) { try { topicPartitionWriters.get(tp).close(); } catch (ConnectException e) { log.error("Error closing writer for {}. Error: {}", tp, e.getMessage()); } } topicPartitionWriters.clear(); assignment.clear(); }
Source:
<code>public Subscription subscribe(String name) { realm.checkIfValid(); if (realm instanceof DynamicRealm) { throw new IllegalStateException("'subscribe' is not available for queries on Dynamic Realms."); } if (osList != null) { <START> throw new IllegalStateException("Cannot create subscriptions for queries based on a 'RealmList. Subscribe to the object holding the list instead.'"); <END> } if (TextUtils.isEmpty(name)) { throw new IllegalArgumentException("Non-empty 'name' required."); } long rowIndex = nativeSubscribe(realm.getSharedRealm().getNativePtr(), name, query.getNativePtr(), queryDescriptors.getNativePtr()); CheckedRow row = ((Realm) realm).getTable(Subscription.class).getCheckedRow(rowIndex); return realm.get(Subscription.class, null, row); }</code><technical_language>single quotes (')</technical_language>

Target:
public Subscription subscribe(String name) { realm.checkIfValid(); if (realm instanceof DynamicRealm) { throw new IllegalStateException("'subscribe' is not supported for queries on Dynamic Realms."); } if (osList != null) { throw new IllegalStateException("Cannot create subscriptions for queries based on a 'RealmList. Subscribe to the object holding the list instead.'"); } if (TextUtils.isEmpty(name)) { throw new IllegalArgumentException("Non-empty 'name' required."); } long rowIndex = nativeSubscribe(realm.getSharedRealm().getNativePtr(), name, query.getNativePtr(), queryDescriptors.getNativePtr()); CheckedRow row = ((Realm) realm).getTable(Subscription.class).getCheckedRow(rowIndex); return realm.get(Subscription.class, null, row); }
Source:
<code>public boolean equals(Object other) { if (other == null) { return false; } if (this.getClass() != other.getClass()) { return false; } if (this == other) { return true; } <START> if (!address.equals(other.toString())) { return false; } return true; <END> }</code><technical_language>suggestion return Objects.equals(address, other.toString());</technical_language>

Target:
public boolean equals(Object other) { if (other == null) { return false; } if (this.getClass() != other.getClass()) { return false; } if (this == other) { return true; } return Objects.equals(address, other.toString()); }
Source:
<code>public static VirtualFile findVirtualFile(final Module module, IPath path) { VirtualFile moduleRoot = getModuleRoot(module); if (path.isAbsolute()) return null; if (path.segmentCount() == 0) return moduleRoot; VirtualFile virtualFile = moduleRoot.findFileByRelativePath(path.toString()); if (virtualFile != null <START> && ModuleRootManager.getInstance(module).getFileIndex().isInContent(virtualFile)) { <END> return virtualFile; } return null; }</code><technical_language>wrap call want execute a read action. a #705 for some examples</technical_language>

Target:
public static VirtualFile findVirtualFile(final Module module, IPath path) { VirtualFile moduleRoot = getModuleRoot(module); if (path.isAbsolute()) return null; if (path.segmentCount() == 0) return moduleRoot; VirtualFile virtualFile = moduleRoot.findFileByRelativePath(path.toString()); if (virtualFile == null) return null; boolean isOnContent = Filesystem.runReadAction( () -> ModuleRootManager.getInstance(module).getFileIndex().isInContent(virtualFile)); if (isOnContent) return virtualFile; return null; }
Source:
<code><START> public StateManager getStateManager() { <END> return this.stateManager; }</code><technical_language>do need public</technical_language>

Target:
public BookieStateManager getStateManager() { return (BookieStateManager) this.stateManager; }
Source:
<code>public OAuthToken getToken(String oauthProviderName, String userId) throws IOException { <START> if (userId == null || userId.isEmpty()) { <END> return null; } try { UriBuilder ub = UriBuilder.fromUri(apiEndpoint) .path(OAuthAuthenticationService.class) .path(OAuthAuthenticationService.class, "token") .queryParam("oauth_provider", oauthProviderName); Link getTokenLink = DtoFactory.newDto(Link.class).withHref(ub.build().toString()).withMethod("GET"); OAuthToken token = httpJsonRequestFactory.fromLink(getTokenLink) .request() .asDto(OAuthToken.class); if (token == null) { LOG.warn("Token not found for user {}", userId); return null; } return token; } catch (ServerException | UnauthorizedException | ForbiddenException | NotFoundException | ConflictException | BadRequestException e) { LOG.error("Exception on token retrieval, message : {}", e.getLocalizedMessage()); return null; } }</code><technical_language>Strings.isNullOrEmtpty</technical_language>

Target:
public OAuthToken getToken(String oauthProviderName, String userId) throws IOException { if (userId.isEmpty()) { return null; } try { UriBuilder ub = UriBuilder.fromUri(apiEndpoint) .path(OAuthAuthenticationService.class) .path(OAuthAuthenticationService.class, "token") .queryParam("oauth_provider", oauthProviderName); Link getTokenLink = DtoFactory.newDto(Link.class).withHref(ub.build().toString()).withMethod("GET"); OAuthToken token = httpJsonRequestFactory.fromLink(getTokenLink) .request() .asDto(OAuthToken.class); if (token == null) { LOG.warn("Token not found for user {}", userId); return null; } return token; } catch (ServerException | UnauthorizedException | ForbiddenException | NotFoundException | ConflictException | BadRequestException e) { LOG.error("Exception on token retrieval, message : {}", e.getLocalizedMessage()); return null; } }
Source:
<code>private void runFirehoseV2(FirehoseV2 firehose) { try { firehose.start(); } catch (Exception e) { log.error(e, "Failed to start firehoseV2"); return; } log.info("FirehoseV2 started"); final Supplier<Committer> committerSupplier = Committers.supplierFromFirehoseV2(firehose); boolean haveRow = true; while (haveRow) { InputRow inputRow = null; int numRows = 0; try { inputRow = firehose.currRow(); if (inputRow != null) { try { numRows = plumber.add(inputRow, committerSupplier); } catch (IndexSizeExceededException e) { log.info("Index limit exceeded: %s", e.getMessage()); <START> metrics.incrementThrownAway(); <END> continue; } if (numRows < 0) { metrics.incrementThrownAway(); log.debug("Throwing away event[%s]", inputRow); } else { metrics.incrementProcessed(); } } else { log.debug("thrown away null input row, considering unparseable"); metrics.incrementUnparseable(); } } catch (Exception e) { log.makeAlert(e, "Unknown exception, Ignoring and continuing.") .addData("inputRow", inputRow); } try { haveRow = firehose.advance(); } catch (Exception e) { log.debug(e, "exception in firehose.advance(), considering unparseable row"); metrics.incrementUnparseable(); } } }</code><technical_language>advance event is thrown really</technical_language>

Target:
private void runFirehoseV2(FirehoseV2 firehose) { try { firehose.start(); } catch (Exception e) { log.error(e, "Failed to start firehoseV2"); return; } log.info("FirehoseV2 started"); final Supplier<Committer> committerSupplier = Committers.supplierFromFirehoseV2(firehose); boolean haveRow = true; while (haveRow) { InputRow inputRow = null; int numRows = 0; try { inputRow = firehose.currRow(); if (inputRow != null) { numRows = plumber.add(inputRow, committerSupplier); if (numRows < 0) { metrics.incrementThrownAway(); log.debug("Throwing away event[%s]", inputRow); } else { metrics.incrementProcessed(); } } else { log.debug("thrown away null input row, considering unparseable"); metrics.incrementUnparseable(); } } catch (Exception e) { log.makeAlert(e, "Unknown exception, Ignoring and continuing.") .addData("inputRow", inputRow); } try { haveRow = firehose.advance(); } catch (Exception e) { log.debug(e, "exception in firehose.advance(), considering unparseable row"); metrics.incrementUnparseable(); } } }
Source:
<code>public void maintenance() { Guid clusterId = getClusterIdOfSelectedHosts(); if (clusterId == null) { maintenance(false, false, null); } else { AsyncDataProvider.getInstance().getClusterById(new AsyncQuery<>( cluster -> { if (cluster != null) { <START> maintenance(true, cluster.supportsGlusterService(), clusterId); <END> } }), clusterId); } }</code><technical_language>is true, get rid of this variable</technical_language>

Target:
public void maintenance() { Guid clusterId = getClusterIdOfSelectedHosts(); if (clusterId == null) { maintenance(false, null); } else { AsyncDataProvider.getInstance().getClusterById(new AsyncQuery<>( cluster -> { if (cluster != null) { maintenance(cluster.supportsGlusterService(), clusterId); } }), clusterId); } }
Source:
<code>public void learn(long seq, PaxosValue value) { Preconditions.checkArgument(seq == value.getRound(), "seq differs from PaxosValue.round"); try { learn.apply(Maps.immutableEntry(client, value)).get(); } catch (InterruptedException e) { Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(cause); } catch (ExecutionException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); <START> } <END> }</code><technical_language>Whoops, this needs other (the block is for ExecutionException is for InterruptedException)</technical_language>

Target:
public void learn(long seq, PaxosValue value) { Preconditions.checkArgument(seq == value.getRound(), "seq differs from PaxosValue.round"); try { learn.apply(Maps.immutableEntry(client, value)).get(); } catch (ExecutionException e) { Throwable cause = e.getCause(); if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } throw new RuntimeException(cause); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new RuntimeException(e); } }
Source:
<code>public void initialize(JavaProject project, int possibleMatchSize) throws JavaModelException { if (this.nameEnvironment != null && possibleMatchSize != 1) this.nameEnvironment.cleanup(); SearchableEnvironment searchableEnvironment = project.newSearchableNameEnvironment(this.workingCopies); this.nameEnvironment = possibleMatchSize == 1 ? (INameEnvironment) searchableEnvironment : (INameEnvironment) new JavaSearchNameEnvironment(project, this.workingCopies); Map map = project.getOptions(true); map.put(CompilerOptions.OPTION_TaskTags, org.eclipse.jdt.internal.compiler.util.Util.EMPTY_STRING); this.options = new CompilerOptions(map); ProblemReporter problemReporter = new ProblemReporter( DefaultErrorHandlingPolicies.proceedWithAllProblems(), this.options, new DefaultProblemFactory()); this.lookupEnvironment = new LookupEnvironment(this, this.options, problemReporter, this.nameEnvironment); this.lookupEnvironment.mayTolerateMissingType = true; this.parser = MatchLocatorParser.createParser(problemReporter, this); this.basicParser = null; this.nameLookup = searchableEnvironment.nameLookup; this.numberOfMatches = 0; this.matchesToProcess = new PossibleMatch[possibleMatchSize]; if (this.patternLocator instanceof TypeReferenceLocator) { <START> ((TypeReferenceLocator) this.patternLocator).registerListener(this.lookupEnvironment); <END> } }</code><technical_language>TRL implement Listner do this.lookupEnvironment.addResolutionListener((TRL) this.patternLocator)</technical_language>

Target:
public void initialize(JavaProject project, int possibleMatchSize) throws JavaModelException { if (this.nameEnvironment != null && possibleMatchSize != 1) this.nameEnvironment.cleanup(); SearchableEnvironment searchableEnvironment = project.newSearchableNameEnvironment(this.workingCopies); this.nameEnvironment = possibleMatchSize == 1 ? (INameEnvironment) searchableEnvironment : (INameEnvironment) new JavaSearchNameEnvironment(project, this.workingCopies); Map map = project.getOptions(true); map.put(CompilerOptions.OPTION_TaskTags, org.eclipse.jdt.internal.compiler.util.Util.EMPTY_STRING); this.options = new CompilerOptions(map); ProblemReporter problemReporter = new ProblemReporter( DefaultErrorHandlingPolicies.proceedWithAllProblems(), this.options, new DefaultProblemFactory()); this.lookupEnvironment = new LookupEnvironment(this, this.options, problemReporter, this.nameEnvironment); this.lookupEnvironment.mayTolerateMissingType = true; this.parser = MatchLocatorParser.createParser(problemReporter, this); this.basicParser = null; this.nameLookup = searchableEnvironment.nameLookup; this.numberOfMatches = 0; this.matchesToProcess = new PossibleMatch[possibleMatchSize]; if (this.patternLocator instanceof TypeReferenceLocator) { this.lookupEnvironment.addResolutionListener((TypeReferenceLocator) this.patternLocator); } }
Source:
<code>private static String loadSwaggerFile(String pathToArchive) throws IOException { <START> if (checkFileExistence(pathToArchive + APIImportExportConstants.YAML_SWAGGER_DEFINITION_LOCATION)) { <END> if (log.isDebugEnabled()) { log.debug("Found swagger file " + pathToArchive + APIImportExportConstants.YAML_SWAGGER_DEFINITION_LOCATION); } String yamlContent = FileUtils.readFileToString( new File(pathToArchive + APIImportExportConstants.YAML_SWAGGER_DEFINITION_LOCATION)); return CommonUtil.yamlToJson(yamlContent); } else if (checkFileExistence(pathToArchive + APIImportExportConstants.JSON_SWAGGER_DEFINITION_LOCATION)) { if (log.isDebugEnabled()) { log.debug("Found swagger file " + pathToArchive + APIImportExportConstants.JSON_SWAGGER_DEFINITION_LOCATION); } return FileUtils.readFileToString( new File(pathToArchive + APIImportExportConstants.JSON_SWAGGER_DEFINITION_LOCATION)); } throw new IOException("Missing swagger file. Either swagger.json or swagger.yaml should present"); }</code><technical_language>CommonUtil is a public util class calling static methods, follow convention CommonUtil.checkFileExistence</technical_language>

Target:
private static String loadSwaggerFile(String pathToArchive) throws IOException { if (CommonUtil.checkFileExistence(pathToArchive + APIImportExportConstants.YAML_SWAGGER_DEFINITION_LOCATION)) { if (log.isDebugEnabled()) { log.debug("Found swagger file " + pathToArchive + APIImportExportConstants.YAML_SWAGGER_DEFINITION_LOCATION); } String yamlContent = FileUtils.readFileToString( new File(pathToArchive + APIImportExportConstants.YAML_SWAGGER_DEFINITION_LOCATION)); return CommonUtil.yamlToJson(yamlContent); } else if (CommonUtil.checkFileExistence(pathToArchive + APIImportExportConstants.JSON_SWAGGER_DEFINITION_LOCATION)) { if (log.isDebugEnabled()) { log.debug("Found swagger file " + pathToArchive + APIImportExportConstants.JSON_SWAGGER_DEFINITION_LOCATION); } return FileUtils.readFileToString( new File(pathToArchive + APIImportExportConstants.JSON_SWAGGER_DEFINITION_LOCATION)); } throw new IOException("Missing swagger file. Either swagger.json or swagger.yaml should present"); }
Source:
<code>public void readFully(long position, byte[] buffer, int offset, int length) throws IOException { FileReadRequest key = new FileReadRequest(path, position, length); if (!cacheManager.get(hiveFileContext, key, buffer, offset).isPresent()) { inputStream.readFully(position, buffer, offset, length); return; } if (!cacheManager.get(hiveFileContext, key, buffer, offset).get()) { <START> inputStream.readFully(position, buffer, offset, length); <END> cacheManager.put(hiveFileContext.getTable(), key, wrappedBuffer(buffer, offset, length)); return; } if (cacheValidationEnabled) { byte[] validationBuffer = new byte[length]; inputStream.readFully(position, validationBuffer, 0, length); for (int i = 0; i < length; i++) { verify(buffer[offset + i] == validationBuffer[i], "corrupted buffer at position " + i); } } }</code><technical_language>I introduce cache quota here, leave this is. part worry cacheQuota is cache writing methods(put)</technical_language>

Target:
public void readFully(long position, byte[] buffer, int offset, int length) throws IOException { FileReadRequest key = new FileReadRequest(path, position, length); switch (cacheManager.get(key, buffer, offset, cacheQuota)) { case HIT: break; case MISS: inputStream.readFully(position, buffer, offset, length); cacheManager.put(key, wrappedBuffer(buffer, offset, length), cacheQuota); return; case CACHE_QUOTA_EXCEED: inputStream.readFully(position, buffer, offset, length); return; } if (cacheValidationEnabled) { byte[] validationBuffer = new byte[length]; inputStream.readFully(position, validationBuffer, 0, length); for (int i = 0; i < length; i++) { verify(buffer[offset + i] == validationBuffer[i], "corrupted buffer at position " + i); } } }
Source:
<code>private ControllerInboundInvocationHandler injectControllerInboundInvocationHandler(Cache cache) { ControllerInboundInvocationHandler handler = new ControllerInboundInvocationHandler( extractComponent(cache, InboundInvocationHandler.class)); JGroupsTransport t = (JGroupsTransport) extractComponent(cache, Transport.class); CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher(); replaceField(handler, "inboundInvocationHandler", card, CommandAwareRpcDispatcher.class); <START> replaceComponent(cache.getCacheManager(), InboundInvocationHandler.class, handler, true); <END> return handler; }</code><technical_language>lines configure mock, needed CommandAwareRpcDispatcher is a proper component</technical_language>

Target:
private ControllerInboundInvocationHandler injectControllerInboundInvocationHandler(Cache cache) { ControllerInboundInvocationHandler handler = new ControllerInboundInvocationHandler( extractComponent(cache, InboundInvocationHandler.class)); replaceComponent(cache.getCacheManager(), InboundInvocationHandler.class, handler, true); JGroupsTransport t = (JGroupsTransport) extractComponent(cache, Transport.class); CommandAwareRpcDispatcher card = t.getCommandAwareRpcDispatcher(); replaceField(handler, "inboundInvocationHandler", card, CommandAwareRpcDispatcher.class); return handler; }
Source:
<code>private void refreshAbnormalStateResolverMap(ClusterConfig clusterConfig) { if (clusterConfig == null) { logger.debug("Skip refreshing abnormal state resolvers because the ClusterConfig is missing"); return; } Map<String, String> resolverMap = clusterConfig.getAbnormalStateResolverMap(); logger.debug("Start loading the abnormal state resolvers with configuration {}", resolverMap); _abnormalStateResolverMap.keySet().retainAll(resolverMap.keySet()); for (String stateModel : resolverMap.keySet()) { String resolverClassName = resolverMap.get(stateModel); if (resolverClassName == null || resolverClassName.isEmpty()) { continue; } if (!resolverClassName.equals(getAbnormalStateResolver(stateModel).getClass().getName())) { try { AbnormalStateResolver resolver = AbnormalStateResolver.class .cast(HelixUtil.loadClass(getClass(), resolverClassName).newInstance()); _abnormalStateResolverMap.put(stateModel, resolver); } catch (Exception e) { throw new HelixException(String .format("Failed to instantiate the abnormal state resolver %s for state model %s", resolverClassName, stateModel)); } } } <START> logger.debug("Finish loading the abnormal state resolvers {}", _abnormalStateResolverMap); <END> }</code><technical_language>info I ClusterConfig change frequently</technical_language>

Target:
private void refreshAbnormalStateResolverMap(ClusterConfig clusterConfig) { if (clusterConfig == null) { logger.debug("Skip refreshing abnormal state resolvers because the ClusterConfig is missing"); return; } Map<String, String> resolverMap = clusterConfig.getAbnormalStateResolverMap(); logger.info("Start loading the abnormal state resolvers with configuration {}", resolverMap); _abnormalStateResolverMap.keySet().retainAll(resolverMap.keySet()); for (String stateModel : resolverMap.keySet()) { String resolverClassName = resolverMap.get(stateModel); if (resolverClassName == null || resolverClassName.isEmpty()) { continue; } if (!resolverClassName.equals(getAbnormalStateResolver(stateModel).getClass().getName())) { try { AbnormalStateResolver resolver = AbnormalStateResolver.class .cast(HelixUtil.loadClass(getClass(), resolverClassName).newInstance()); _abnormalStateResolverMap.put(stateModel, resolver); } catch (Exception e) { throw new HelixException(String .format("Failed to instantiate the abnormal state resolver %s for state model %s", resolverClassName, stateModel)); } } } logger.info("Finish loading the abnormal state resolvers {}", _abnormalStateResolverMap); }
Source:
<code>public Mono<Secret> getSecret(SecretBase secretBase) { Objects.requireNonNull(secretBase, "The Secret Base parameter cannot be null."); if (secretBase.version() == null) { return getSecret(secretBase.name()); } return getSecretWithResponse(secretBase.name(), secretBase.version()) <START> .flatMap(FluxUtil::toMono); <END> }</code><technical_language>This method call getSecretWithResponse(secretBase).flatMap(FluxUtil::toMono). Try leave duplication a minimum</technical_language>

Target:
public Mono<Secret> getSecret(SecretBase secretBase) { return getSecretWithResponse(secretBase).flatMap(FluxUtil::toMono); }
Source:
<code>private void deleteReferenceSetEntries(int referenceSetID) throws EamDbException{ Connection conn = connect(); PreparedStatement preparedStatement = null; String sql = "DELETE FROM %s WHERE reference_set_id=?"; String fileTableName = EamDbUtil.correlationTypeToReferenceTableName(getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID)); try { preparedStatement = conn.prepareStatement(String.format(sql, fileTableName)); preparedStatement.setInt(1, referenceSetID); preparedStatement.executeUpdate(); } catch (SQLException ex) { <START> throw new EamDbException("Error deleting files from reference set", ex); END> } finally { EamDbUtil.closePreparedStatement(preparedStatement); EamDbUtil.closeConnection(conn); } }</code><technical_language>I debugging if include some identification of reference set experienced error condition in error message. Also, files => entries, for clarity</technical_language>

Target:
private void deleteReferenceSetEntries(int referenceSetID) throws EamDbException{ Connection conn = connect(); PreparedStatement preparedStatement = null; String sql = "DELETE FROM %s WHERE reference_set_id=?"; String fileTableName = EamDbUtil.correlationTypeToReferenceTableName(getCorrelationTypeById(CorrelationAttribute.FILES_TYPE_ID)); try { preparedStatement = conn.prepareStatement(String.format(sql, fileTableName)); preparedStatement.setInt(1, referenceSetID); preparedStatement.executeUpdate(); } catch (SQLException ex) { throw new EamDbException("Error deleting files from reference set " + referenceSetID, ex); } finally { EamDbUtil.closePreparedStatement(preparedStatement); EamDbUtil.closeConnection(conn); } }
Source:
<code>public ValidationResult isBlockSizeAutoDetectionSupported() { StorageType storageType = storageDomainStatic.getStorageType(); List<String> withoutSupportVDSes = getVdsDao().getAllForStoragePool(storagePool.getId()) .stream() .filter(vds -> { if (vds.getSupportedBlockSize() == null) { return true; } if (!vds.getSupportedBlockSize().containsKey(storageType.name())) { return true; } @SuppressWarnings("unchecked") List<Integer> blockSizeForStorage = (List<Integer>) vds.getSupportedBlockSize().get(storageType.name()); return <START> !blockSizeForStorage.contains(0); <END> }) .map(VDS::getName) .collect(Collectors.toList()); if (!withoutSupportVDSes.isEmpty()) { List<String> replacements = Collections.singletonList( ReplacementUtils.createSetVariableString("hosts", withoutSupportVDSes)); return new ValidationResult(EngineMessage.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_4K_UNSUPPORTED, replacements); } return ValidationResult.VALID; }</code><technical_language>instead of 0: StorageBlockSize.BLOCK_AUTO.value()</technical_language>

Target:
public ValidationResult isBlockSizeAutoDetectionSupported() { StorageType storageType = storageDomainStatic.getStorageType(); List<String> withoutSupportVDSes = getVdsDao().getAllForStoragePool(storagePool.getId()) .stream() .filter(vds -> { if (vds.getSupportedBlockSize() == null) { return true; } if (!vds.getSupportedBlockSize().containsKey(storageType.name())) { return true; } @SuppressWarnings("unchecked") List<Integer> blockSizeForStorage = (List<Integer>) vds.getSupportedBlockSize().get(storageType.name()); return !blockSizeForStorage.contains(StorageBlockSize.BLOCK_AUTO.getValue()); }) .map(VDS::getName) .collect(Collectors.toList()); if (!withoutSupportVDSes.isEmpty()) { List<String> replacements = Collections.singletonList( ReplacementUtils.createSetVariableString("hosts", withoutSupportVDSes)); return new ValidationResult(EngineMessage.ERROR_CANNOT_ATTACH_STORAGE_DOMAIN_STORAGE_4K_UNSUPPORTED, replacements); } return ValidationResult.VALID; }
Source:
<code>public void canBeComparedProperly() throws Exception { final Label.Unmodified one = new Label.Unmodified( LabelTest.repo("jef", "jef_repo"), "{\"name\":\"paul\"}"); final Label.Unmodified other = new Label.Unmodified( LabelTest.repo("stan", "stan_repo"), "{\"name\":\"paul\"}"); <START> Assert.assertFalse(one.equals(other)); <END> Assert.assertFalse(one.compareTo(other) == 0); }</code><technical_language>Assert. MatcherAssert hamcrest instead</technical_language>

Target:
public void canBeComparedProperly() throws Exception { final Label.Unmodified one = new Label.Unmodified( LabelTest.repo("jef", "jef_repo"), "{\"name\":\"paul\"}" ); final Label.Unmodified other = new Label.Unmodified( LabelTest.repo("stan", "stan_repo"), "{\"name\":\"paul\"}" ); MatcherAssert.assertThat( one.equals(other), Matchers.is(false) ); MatcherAssert.assertThat( one.compareTo(other), Matchers.not(0) ); }