auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void throwsExceptionForNameLength() throws Exception { final String alias = "bill1"; final Aliases aliases = new DyBase().user(new URN("urn:test:840919")).aliases(); aliases.add(alias); final Inbox inbox = aliases.iterate().iterator().next().inbox(); final Bout bout = inbox.bout(inbox.start()); final Attachments attachments = bout.attachments(); final String name = "a"; try { attachments.create(name); <START> } catch (final Attachments.InvalidNameException ex) { <END> MatcherAssert.assertThat( ex.getMessage(), Matchers.equalTo( String.format( "invalid attachment name length \"%s\". %s%s", name, "The length of the attachment name must be ", "between 3-100 characters" ) ) ); } }</code><technical_language>@kujtimiihoxha exception thrown, e.g. adding Assert.fail(...) in try</technical_language>

Target:
public void throwsExceptionForNameLength() throws Exception { final String alias = "bill1"; final Aliases aliases = new DyBase().user(new URN("urn:test:840919")).aliases(); aliases.add(alias); final Inbox inbox = aliases.iterate().iterator().next().inbox(); final Bout bout = inbox.bout(inbox.start()); final Attachments attachments = bout.attachments(); final String name = "a"; try { attachments.create(name); Assert.fail("The character length exeption was not thrown"); } catch (final Attachments.InvalidNameException ex) { MatcherAssert.assertThat( ex.getMessage(), Matchers.equalTo( String.format( "invalid attachment name length \"%s\". %s%s", name, "The length of the attachment name must be ", "between 3-100 characters" ) ) ); } }
Source:
<code>public String getIdentificationString() { <START> return "feedbackResponseId" + "createdAt" + "giverEmail"; <END> }</code><technical_language>This is a string, field name</technical_language>

Target:
public String getIdentificationString() { return feedbackResponseId + "/" + createdAt + ":" + commentGiver; }
Source:
<code>private static int convertAvroLogicialType(LogicalType logicalType) { <START> int sqlType = Types.NULL; <END> if(logicalType == LogicalTypes.timestampMillis()){ sqlType = Types.TIMESTAMP; } else if (logicalType instanceof LogicalTypes.Decimal){ sqlType = Types.DOUBLE; } else if (logicalType == LogicalTypes.date()){ sqlType = Types.DATE; } else if(logicalType == LogicalTypes.uuid()){ sqlType = Types.VARCHAR; } else if(logicalType == LogicalTypes.timestampMicros()){ sqlType = Types.TIMESTAMP; } else if(logicalType == LogicalTypes.timeMillis()){ sqlType = Types.NUMERIC; } else if(logicalType == LogicalTypes.timeMicros()){ sqlType = Types.NUMERIC; } else{ throw new UnsupportedOperationException("Logicial type "+logicalType+" not supported"); } return sqlType; }</code><technical_language>able switch case here? other - **else** is next line? Is in talend formatting</technical_language>

Target:
private int convertAvroLogicialType(LogicalType logicalType) { Integer sqlType = this.config.CONVERT_LOGICALTYPE_TO_SQLTYPE.get(logicalType); if(sqlType != null){ return sqlType; } if (logicalType == LogicalTypes.timestampMillis()) { sqlType = Types.TIMESTAMP; } else if (logicalType instanceof LogicalTypes.Decimal) { sqlType = Types.DOUBLE; } else if (logicalType == LogicalTypes.date()) { sqlType = Types.DATE; } else if (logicalType == LogicalTypes.uuid()) { sqlType = Types.VARCHAR; } else if (logicalType == LogicalTypes.timestampMicros()) { sqlType = Types.TIMESTAMP; } else if (logicalType == LogicalTypes.timeMillis()) { sqlType = Types.NUMERIC; } else if (logicalType == LogicalTypes.timeMicros()) { sqlType = Types.NUMERIC; } else { throw new UnsupportedOperationException("Logicial type " + logicalType + " not supported"); } return sqlType; }
Source:
<code><START> private void testUpdateCourse() throws Exception { <END> ______TS("Invalid time zone"); CourseAttributes c = CourseAttributes .builder("Computing101-getthis", "Basic Computing Getting", ZoneId.of("UTC")) .build(); coursesDb.createEntity(c); String invalidTimeZone = "Invalid Timezone"; try { coursesLogic.updateCourse(c.getId(), c.getName(), invalidTimeZone); signalFailureToDetectException(); } catch (InvalidParametersException e) { String expectedErrorMessage = getPopulatedErrorMessage( FieldValidator.COURSE_TIME_ZONE_ERROR_MESSAGE, invalidTimeZone, FieldValidator.COURSE_TIME_ZONE_FIELD_NAME, FieldValidator.REASON_UNAVAILABLE_AS_CHOICE); assertEquals(expectedErrorMessage, e.getMessage()); } }</code><technical_language>write a typical case too</technical_language>

Target:
private void testUpdateCourse() throws Exception { CourseAttributes c = CourseAttributes .builder("Computing101-getthis", "Basic Computing Getting", ZoneId.of("UTC")) .build(); coursesDb.createEntity(c); ______TS("Typical case"); String newName = "New Course Name"; String validTimeZone = "Asia/Singapore"; coursesLogic.updateCourse(c.getId(), newName, validTimeZone); c.setName(newName); c.setTimeZone(ZoneId.of(validTimeZone)); verifyPresentInDatastore(c); ______TS("Invalid time zone and name"); String emptyName = ""; String invalidTimeZone = "Invalid Timezone"; try { coursesLogic.updateCourse(c.getId(), emptyName, invalidTimeZone); signalFailureToDetectException(); } catch (InvalidParametersException e) { String expectedErrorMessage = getPopulatedEmptyStringErrorMessage( FieldValidator.SIZE_CAPPED_NON_EMPTY_STRING_ERROR_MESSAGE_EMPTY_STRING, FieldValidator.COURSE_NAME_FIELD_NAME, FieldValidator.COURSE_NAME_MAX_LENGTH) + System.lineSeparator() + getPopulatedErrorMessage( FieldValidator.COURSE_TIME_ZONE_ERROR_MESSAGE, invalidTimeZone, FieldValidator.COURSE_TIME_ZONE_FIELD_NAME, FieldValidator.REASON_UNAVAILABLE_AS_CHOICE); assertEquals(expectedErrorMessage, e.getMessage()); verifyPresentInDatastore(c); } }
Source:
<code><START> public int getPid() { <END> ITmfEventField pidContext = this.getContent().getField("context._pid"); if (null != pidContext) { return ((Integer) pidContext.getValue()).intValue(); } ITmfStateSystem ss = getTrace().getStateSystem(CtfKernelTrace.STATE_ID); int retVal = -1; try { int threadNode = ss.getQuarkAbsolute(Attributes.CPUS, String.valueOf(getCPU()), Attributes.CURRENT_THREAD); ITmfStateValue sv = ss.querySingleState(this.getTimestamp().getValue(), threadNode).getStateValue(); retVal = Math.max(0, sv.unboxInt()); } catch (AttributeNotFoundException e) { } catch (TimeRangeException e) { e.printStackTrace(); } catch (StateSystemDisposedException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } return retVal; }</code><technical_language>Is called a thread id in LTTng 2.0? Is number is stored in context._pid</technical_language>

Target:
public int getPid() { ITmfEventField pidContext = this.getContent().getField("context._pid"); if (null != pidContext) { return ((Integer) pidContext.getValue()).intValue(); } ITmfStateSystem ss = getTrace().getStateSystem(CtfKernelTrace.STATE_ID); int retVal = -1; try { int threadNode = ss.getQuarkAbsolute(Attributes.CPUS, String.valueOf(getCPU()), Attributes.CURRENT_THREAD); ITmfStateValue sv = ss.querySingleState(this.getTimestamp().getValue(), threadNode).getStateValue(); retVal = Math.max(0, sv.unboxInt()); } catch (AttributeNotFoundException e) { } catch (TimeRangeException e) { } catch (StateSystemDisposedException e) { e.printStackTrace(); } catch (StateValueTypeException e) { e.printStackTrace(); } return retVal; }
Source:
<code>private void changeServerState(String host, String server, ServerState serverState, boolean serverShouldBeVisible, boolean buttonShouldBeVisible) throws Exception { boolean buttonVisibility = true; boolean serverVisibility = true; FinderNavigation navigation = new FinderNavigation(browser, DomainRuntimeEntryPoint.class, 100) .addAddress(FinderNames.BROWSE_DOMAIN_BY, FinderNames.HOSTS) .addAddress(FinderNames.HOST, host) .addAddress(FinderNames.SERVER, server); try { navigation.selectRow().invoke(serverState.splitButtonOption); Console.withBrowser(browser).openedWindow(ConfirmationWindow.class).confirm().assertClosed(); Console.withBrowser(browser).waitUntilLoaded(); } catch (NoSuchElementException ex) { buttonVisibility = false; } catch (TimeoutException ex) { serverVisibility = false; } assertEquals("Server '" + server + "' of host '" + host + "' visibility was '" + serverVisibility + "' but should be '" + serverShouldBeVisible + "'.", serverShouldBeVisible, serverVisibility); if (serverShouldBeVisible) { assertEquals("Missing " + serverState.splitButtonOption + " option for server '" + server + "' of host '" + host + "'.", buttonShouldBeVisible, buttonVisibility); if (buttonShouldBeVisible) { Address address = ops.getServerAddress(host, server); <START> new ResourceVerifier(address, client, 4000).verifyAttribute("server-state", serverState.attrValue); <END> } } }</code><technical_language>4000 ms? If this is common timeout for multiple cases ResourceVerifier, sense putting some constant</technical_language>

Target:
private void changeServerState(String host, String server, ServerState serverState, boolean serverShouldBeVisible, boolean buttonShouldBeVisible) throws Exception { boolean buttonVisibility = true; boolean serverVisibility = true; FinderNavigation navigation = new FinderNavigation(browser, DomainRuntimeEntryPoint.class, 100) .addAddress(FinderNames.BROWSE_DOMAIN_BY, FinderNames.HOSTS) .addAddress(FinderNames.HOST, host) .addAddress(FinderNames.SERVER, server); try { navigation.selectRow().invoke(serverState.uiOption); Console.withBrowser(browser).openedWindow(ConfirmationWindow.class).confirm().assertClosed(); Console.withBrowser(browser).waitUntilLoaded(); } catch (NoSuchElementException ex) { buttonVisibility = false; } catch (TimeoutException ex) { serverVisibility = false; } assertEquals("Server '" + server + "' of host '" + host + "' visibility was '" + serverVisibility + "' but should be '" + serverShouldBeVisible + "'.", serverShouldBeVisible, serverVisibility); if (serverShouldBeVisible) { assertEquals("Missing " + serverState.uiOption + " option for server '" + server + "' of host '" + host + "'.", buttonShouldBeVisible, buttonVisibility); if (buttonShouldBeVisible) { Address address = ops.getServerAddress(host, server); new ResourceVerifier(address, client, ResourceVerifier.LONG_TIMEOUT) .verifyAttribute(Constants.SERVER_STATE, serverState.dmrAttrValue); } } }
Source:
<code><START> private Object handleJoinPoint(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.bulkhead.Bulkhead bulkhead, String methodName) throws Throwable { <END> BulkheadUtils.isCallPermitted(bulkhead); try { return proceedingJoinPoint.proceed(); } catch (Throwable throwable) { if (logger.isDebugEnabled()) { logger.debug("Invocation of method '" + methodName + "' failed!", throwable); } throw throwable; } finally { bulkhead.onComplete(); } }</code><technical_language>rename handleSyncJoinPoint</technical_language>

Target:
private Object handleJoinPoint(ProceedingJoinPoint proceedingJoinPoint, io.github.resilience4j.bulkhead.Bulkhead bulkhead, String methodName) throws Throwable { if (logger.isDebugEnabled()) { logger.debug("bulkhead method invocation for method {}", methodName); } return bulkhead.executeCheckedSupplier(proceedingJoinPoint::proceed); }
Source:
<code>public Object getUserId() { return eventData.get("user_id"); <START> } <END></code><technical_language>I this formatted consistently methods it</technical_language>

Target:
public String getUserId() { return (String)eventData.get("user_id"); }
Source:
<code>public static Sessions map(org.ovirt.engine.core.common.businessentities.VM vm, Sessions sessions) { if (sessions == null) { sessions = new Sessions(); } mapConsoleSession(vm, sessions); <START> mapGusetSessions(vm, sessions); <END> return sessions; }</code><technical_language>Replace "Guset" "Guest"</technical_language>

Target:
public static Sessions map(org.ovirt.engine.core.common.businessentities.VM vm, Sessions sessions) { if (sessions == null) { sessions = new Sessions(); } mapConsoleSession(vm, sessions); mapGuestSessions(vm, sessions); return sessions; }
Source:
<code>public T setFillGradient(final Type type, final String startColor, final String endColor) { this.fillGradientType = type; this.fillGradientStartColor = startColor; this.fillGradientEndColor = endColor; if (null != getShape()) { final BoundingBox bb = getShape().getBoundingBox(); <START> textViewDecorator.setTextBoundaries(bb); <END> final double width = bb.getWidth(); final double height = bb.getHeight(); updateFillGradient(width, height); } return cast(); }</code><technical_language>need set text bounds setting fill gradient? And.. if this is for good reason, do [here](<LINK_0> potential of public methods sets text bounds</technical_language>

Target:
public T setFillGradient(final Type type, final String startColor, final String endColor) { this.fillGradientType = type; this.fillGradientStartColor = startColor; this.fillGradientEndColor = endColor; if (null != getShape()) { final BoundingBox bb = getShape().getBoundingBox(); final double width = bb.getWidth(); final double height = bb.getHeight(); updateFillGradient(width, height); } return cast(); }
Source:
<code>private static int methodDeclarationLine(ExplodedGraph.Node methodInvocationNode) { <START> return ((MethodInvocationTree) methodInvocationNode.programPoint.syntaxTree()).symbol().declaration().firstToken().line(); <END> }</code><technical_language>please rely simpleName firstToken</technical_language>

Target:
private static int methodDeclarationLine(ExplodedGraph.Node methodInvocationNode) { MethodTree method = (MethodTree) ((MethodInvocationTree) methodInvocationNode.programPoint.syntaxTree()).symbol().declaration(); return method.simpleName().identifierToken().line(); }
Source:
<code>public String toString() { <START> return "Proguard File"; <END> }</code><technical_language>capital g</technical_language>

Target:
public String toString() { return "ProGuard File"; }
Source:
<code>public String toString() { return MoreObjects.toStringHelper(this) .add("_id", _id) .add("_type", _type) <START> .add("_address", _address) <END> .toString(); }</code><technical_language>include underscores in field names</technical_language>

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("id", _id) .add("type", _type) .add("address", _address) .toString(); }
Source:
<code>public static boolean downloadUpdatedBlob(Map<String, Object> conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos) throws TTransportException { ClientBlobStore remoteBlobStore; InputStreamWithMeta in; AtomicOutputStream out; boolean isSuccess = false; LOG.debug("Download blob NimbusInfos {}", nimbusInfos); for (NimbusInfo nimbusInfo : nimbusInfos) { if (isSuccess) { break; } try (NimbusClient client = new NimbusClient(conf, nimbusInfo.getHost(), nimbusInfo.getPort(), null)) { remoteBlobStore = new NimbusBlobStore(); remoteBlobStore.setClient(conf, client); in = remoteBlobStore.getBlob(key); out = blobStore.updateBlob(key, getNimbusSubject()); byte[] buffer = new byte[2048]; int len = 0; while ((len = in.read(buffer)) > 0) { out.write(buffer, 0, len); } if (out != null) { out.close(); } isSuccess = true; } catch(FileNotFoundException fnf) { <START> LOG.warn("FileNotFoundException", fnf); <END> } catch (IOException | AuthorizationException exception) { throw new RuntimeException(exception); } catch (KeyNotFoundException knf) { LOG.info("KeyNotFoundException", knf); } catch (Exception exp) { LOG.error("Exception", exp); } } if (!isSuccess) { LOG.error("Could not update the blob with key: {}", key); } return isSuccess; }</code><technical_language>rethrow fnf</technical_language>

Target:
public static boolean downloadUpdatedBlob(Map<String, Object> conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos) throws TTransportException { ClientBlobStore remoteBlobStore; InputStreamWithMeta in; AtomicOutputStream out; boolean isSuccess = false; LOG.debug("Download blob NimbusInfos {}", nimbusInfos); for (NimbusInfo nimbusInfo : nimbusInfos) { if (isSuccess) { break; } try (NimbusClient client = new NimbusClient(conf, nimbusInfo.getHost(), nimbusInfo.getPort(), null)) { remoteBlobStore = new NimbusBlobStore(); remoteBlobStore.setClient(conf, client); in = remoteBlobStore.getBlob(key); out = blobStore.updateBlob(key, getNimbusSubject()); byte[] buffer = new byte[2048]; int len = 0; while ((len = in.read(buffer)) > 0) { out.write(buffer, 0, len); } if (out != null) { out.close(); } isSuccess = true; } catch(FileNotFoundException fnf) { LOG.warn("Blobstore file for key '{}' does not exist or got deleted before it could be downloaded.", key, fnf); } catch (IOException | AuthorizationException exception) { throw new RuntimeException(exception); } catch (KeyNotFoundException knf) { LOG.info("KeyNotFoundException", knf); } catch (Exception exp) { LOG.error("Exception", exp); } } if (!isSuccess) { LOG.error("Could not update the blob with key: {}", key); } return isSuccess; }
Source:
<code>public void start(Duration monitoringInterval) { sequencerBootstrap(serverContext); detectionTasksScheduler.scheduleAtFixedRate( <START> this::runDetectionTasks, <END> 0, monitoringInterval.toMillis(), TimeUnit.MILLISECONDS ); }</code><technical_language>runSansThrow wrapper before</technical_language>

Target:
public void start(Duration monitoringInterval) { sequencerBootstrap(serverContext); detectionTasksScheduler.scheduleAtFixedRate( () -> LambdaUtils.runSansThrow(this::runDetectionTasks), 0, monitoringInterval.toMillis(), TimeUnit.MILLISECONDS ); }
Source:
<code>private void exerciseVisitor( Function<Object, DbStructureVisitor> visitor ) { visitor.apply( null ).visitLabel( 0, "Person" ); visitor.apply( null ).visitLabel( 1, "Party" ); visitor.apply( null ).visitPropertyKey( 0, "name" ); visitor.apply( null ).visitPropertyKey( 1, "age" ); visitor.apply( null ).visitRelationshipType( 0, "ACCEPTS" ); visitor.apply( null ).visitRelationshipType( 1, "REJECTS" ); visitor.apply( null ).visitIndex( NewIndexDescriptorFactory.forLabel( 0, 1 ), ":Person(age)", 0.5d, 1L ); visitor.apply( null ).visitUniqueIndex( NewIndexDescriptorFactory.forLabel( 0, 0 ), ":Person(name)", 0.5d, 1L ); <START> final int[] propertyKeyIds = new int[]{0}; <END> visitor.apply( null ).visitUniqueConstraint( new UniquenessConstraint( SchemaDescriptorFactory.forLabel( 1, propertyKeyIds ) ), ":Party(name)" ); visitor.apply( null ).visitAllNodesCount( 55 ); visitor.apply( null ).visitNodeCount( 0, "Person", 50 ); visitor.apply( null ).visitNodeCount( 0, "Party", 5 ); visitor.apply( null ).visitRelCount( 0, 1, -1, "MATCH (:Person)-[:REJECTS]->() RETURN count(*)", 5 ); }</code><technical_language>ping</technical_language>

Target:
private void exerciseVisitor( Function<Object, DbStructureVisitor> visitor ) { visitor.apply( null ).visitLabel( 0, "Person" ); visitor.apply( null ).visitLabel( 1, "Party" ); visitor.apply( null ).visitPropertyKey( 0, "name" ); visitor.apply( null ).visitPropertyKey( 1, "age" ); visitor.apply( null ).visitRelationshipType( 0, "ACCEPTS" ); visitor.apply( null ).visitRelationshipType( 1, "REJECTS" ); visitor.apply( null ).visitIndex( NewIndexDescriptorFactory.forLabel( 0, 1 ), ":Person(age)", 0.5d, 1L ); visitor.apply( null ).visitUniqueIndex( NewIndexDescriptorFactory.forLabel( 0, 0 ), ":Person(name)", 0.5d, 1L ); visitor.apply( null ).visitUniqueConstraint( new UniquenessConstraint( SchemaDescriptorFactory.forLabel( 1, 0 ) ), ":Party(name)" ); visitor.apply( null ).visitAllNodesCount( 55 ); visitor.apply( null ).visitNodeCount( 0, "Person", 50 ); visitor.apply( null ).visitNodeCount( 0, "Party", 5 ); visitor.apply( null ).visitRelCount( 0, 1, -1, "MATCH (:Person)-[:REJECTS]->() RETURN count(*)", 5 ); }
Source:
<code>public void addWaypoint(Waypoint waypoint) { waypoints.add(waypoint); <START> System.out.println("ADDED WAYPOINT"); <END> }</code><technical_language>Is this intended here</technical_language>

Target:
public void addWaypoint(Waypoint waypoint) { waypoints.add(waypoint); }
Source:
<code>public String toString() { StringBuilder ret = new StringBuilder("all_nodes: "); for (String s : all_nodes) { <START> ret.append(s + ","); <END> } ret.append(" cluster_nodes: "); for (String s : cluster_nodes) { ret.append(s + ","); } return ret.toString(); }</code><technical_language>if this difference in terms of efficiency temporary strings, java ret.append(s); ret.append(",");</technical_language>

Target:
public String toString() { StringBuilder ret = new StringBuilder("all_nodes: "); for (String s : all_nodes) { ret.append(s + ","); } ret.append(" cluster_nodes: "); for (String s : cluster_nodes) { ret.append(s); ret.append(","); } return ret.toString(); }
Source:
<code>public boolean checkFormIdForImport(String formId, String configName) { LOGGER.info("Checking form with id [config: {}]", formId, configName); try { CommcareForm form = formService.retrieveForm(formId, configName); LOGGER.info("Form with id exists", form.getId()); return true; <START> } catch (NullPointerException e) { <END> LOGGER.info("Form with id doesnot exist", formId); return false; } }</code><technical_language>catching NPE is bad idea, modificate retrieveForm method formService return null if form exist "return form != null'</technical_language>

Target:
public boolean checkFormIdForImport(String formId, String configName) { LOGGER.info("Checking form with id [config: {}]", formId, configName); CommcareForm form = formService.retrieveForm(formId, configName); if (form.getId() != null) { LOGGER.info("Form with id exists", form.getId()); return true; } else { LOGGER.info("Form with id doesnot exist", formId); return false; } }
Source:
<code>public static List<Float> parseFloatList(String option) throws ParseException { String[] f = option.split(","); List<Float> rv = new ArrayList<>(); try { for (int i = 0; i < f.length; i++) { final String element = f[i]; if (element.startsWith("%")) { <START> rv.add(Float.parseFloat(element)); <END> } else { rv.add(Float.parseFloat(element)); } } return rv; } catch (NumberFormatException e) { throw new ParseException("Wrong number syntax"); } }</code><technical_language>branches execute code</technical_language>

Target:
public static List<Float> parseFloatList(String option) throws ParseException { String[] f = option.split(","); List<Float> rv = new ArrayList<>(); try { for (final String element : f) { rv.add(Float.parseFloat(element)); } return rv; } catch (NumberFormatException e) { throw new ParseException("Wrong number syntax"); } }
Source:
<code>public List<String> getPossibleRecipients(FeedbackQuestionAttributes fqa) { FeedbackParticipantType recipientType = fqa.recipientType; List<String> possibleRecipients = null; if (fqa.recipientType == FeedbackParticipantType.SELF) { recipientType = fqa.giverType; } switch(recipientType) { case STUDENTS: case OWN_TEAM_MEMBERS: case OWN_TEAM_MEMBERS_INCLUDING_SELF: possibleRecipients = getSortedListOfStudentEmails(); break; case INSTRUCTORS: possibleRecipients = getSortedListOfInstructorEmails(); break; case TEAMS: case OWN_TEAM: possibleRecipients = getSortedListOfTeams(); break; case NONE: possibleRecipients = new ArrayList<String>(); possibleRecipients.add(Const.USER_NOBODY_TEXT); break; <START> default: <END> break; } return possibleRecipients; }</code><technical_language>If default cases in switch statements expected reached, add a severe log catch missed cases this in future</technical_language>

Target:
public List<String> getPossibleRecipients(FeedbackQuestionAttributes fqa) { FeedbackParticipantType recipientType = fqa.recipientType; List<String> possibleRecipients = null; if (fqa.recipientType == FeedbackParticipantType.SELF) { recipientType = fqa.giverType; } switch(recipientType) { case STUDENTS: case OWN_TEAM_MEMBERS: case OWN_TEAM_MEMBERS_INCLUDING_SELF: possibleRecipients = getSortedListOfStudentEmails(); break; case INSTRUCTORS: possibleRecipients = getSortedListOfInstructorEmails(); break; case TEAMS: case OWN_TEAM: possibleRecipients = getSortedListOfTeams(); break; case NONE: possibleRecipients = new ArrayList<String>(); possibleRecipients.add(Const.USER_NOBODY_TEXT); break; default: log.severe("Invalid recipient type specified"); break; } return possibleRecipients; }
Source:
<code>protected void configureServlets() { getServletContext().addListener(new org.everrest.websockets.WSConnectionTracker()); final Map<String, String> corsFilterParams = new HashMap<>(); corsFilterParams.put("cors.allowed.origins", "*"); corsFilterParams.put("cors.allowed.methods", "GET," + "POST," + "HEAD," + "OPTIONS," + "PUT," + "DELETE"); corsFilterParams.put("cors.allowed.headers", "Content-Type," + "X-Requested-With," + "accept," + "Origin," + "Access-Control-Request-Method," + "Access-Control-Request-Headers"); corsFilterParams.put("cors.support.credentials", "true"); corsFilterParams.put("cors.preflight.maxage", "10"); bind(CorsFilter.class).in(Singleton.class); filter("/*").through(CorsFilter.class, corsFilterParams); filter("/api/*").through(org.eclipse.che.api.local.filters.EnvironmentInitializationFilter.class); <START> serveRegex("/api((?!(/(ws|eventbus)($|/.*)))/.*)").with(GuiceEverrestServlet.class); <END> install(new org.eclipse.che.swagger.deploy.BasicSwaggerConfigurationModule()); }</code><technical_language>^ is needed IMHO</technical_language>

Target:
protected void configureServlets() { getServletContext().addListener(new org.everrest.websockets.WSConnectionTracker()); final Map<String, String> corsFilterParams = new HashMap<>(); corsFilterParams.put("cors.allowed.origins", "*"); corsFilterParams.put("cors.allowed.methods", "GET," + "POST," + "HEAD," + "OPTIONS," + "PUT," + "DELETE"); corsFilterParams.put("cors.allowed.headers", "Content-Type," + "X-Requested-With," + "accept," + "Origin," + "Access-Control-Request-Method," + "Access-Control-Request-Headers"); corsFilterParams.put("cors.support.credentials", "true"); corsFilterParams.put("cors.preflight.maxage", "10"); bind(CorsFilter.class).in(Singleton.class); filter("/*").through(CorsFilter.class, corsFilterParams); filter("/api/*").through(org.eclipse.che.api.local.filters.EnvironmentInitializationFilter.class); serveRegex("^/api((?!(/(ws|eventbus)($|/.*)))/.*)").with(GuiceEverrestServlet.class); install(new org.eclipse.che.swagger.deploy.BasicSwaggerConfigurationModule()); }
Source:
<code>private BAMIndexer createBamIndex(final String pathURI) { try { <START> final String indexFileBase = pathURI.toString().endsWith(BamFileIoUtils.BAM_FILE_EXTENSION) ? <END> pathURI.substring(0, pathURI.lastIndexOf('.')) : pathURI; final Path indexPath = IOUtil.getPath(indexFileBase + BAMIndex.BAMIndexSuffix); if (Files.exists(indexPath)) { if (!Files.isWritable(indexPath)) { throw new SAMException("Not creating BAM index since unable to write index file " + indexPath.toUri()); } } return new BAMIndexer(indexPath, getFileHeader()); } catch (Exception e) { throw new SAMException("Not creating BAM index", e); } }</code><technical_language>This a relic of a previous refactoring, pathUri is a String</technical_language>

Target:
private BAMIndexer createBamIndex(final String pathURI) { try { final String indexFileBase = pathURI.endsWith(BamFileIoUtils.BAM_FILE_EXTENSION) ? pathURI.substring(0, pathURI.lastIndexOf('.')) : pathURI; final Path indexPath = IOUtil.getPath(indexFileBase + BAMIndex.BAMIndexSuffix); if (Files.exists(indexPath)) { if (!Files.isWritable(indexPath)) { throw new SAMException("Not creating BAM index since unable to write index file " + indexPath.toUri()); } } return new BAMIndexer(indexPath, getFileHeader()); } catch (Exception e) { throw new SAMException("Not creating BAM index", e); } }
Source:
<code>private static void wrapCastedConstructorArgs(List<Expression> arguments, AstNodeCache nodeCache) { arguments .stream() .filter(MapExpression.class::isInstance) .map(MapExpression.class::cast) .flatMap(mapArgument -> mapArgument .getMapEntryExpressions() .stream() .filter(SpecialMethodCall::hasCastedConstructorArg) ) <START> .forEach(constructorArgsEntry -> constructorArgsEntry <END> .setValueExpression(new ListExpression( ((ListExpression) constructorArgsEntry.getValueExpression()) .getExpressions() .stream() .map(constructorArg -> { if (constructorArg instanceof CastExpression) { ConstructorCallExpression wrapExpression = new ConstructorCallExpression( nodeCache.PojoWrapper, new ArgumentListExpression( constructorArg, new ClassExpression(constructorArg.getType()))); wrapExpression.setSourcePosition(constructorArg); return wrapExpression; } else { return constructorArg; } }) .collect(toList())))); }</code><technical_language>extract this a separate method</technical_language>

Target:
private static void wrapCastedConstructorArgs(List<Expression> arguments, AstNodeCache nodeCache) { arguments .stream() .filter(MapExpression.class::isInstance) .map(MapExpression.class::cast) .flatMap(SpecialMethodCall::entriesWithCastedConstructorArg) .forEach(constructorArgsEntry -> wrapCastedConstructorArgs(constructorArgsEntry, nodeCache)); }
Source:
<code>public final void canBeRendered() throws Exception { final String text = "Hello, **world**!"; MatcherAssert.assertThat( <START> new MkMarkdown(new MkGithub()).render( <END> Json.createObjectBuilder() .add("text", text) .build() ), Matchers.equalTo(text) ); }</code><technical_language>I a Markdown instance Github.Markdown() method, is in other unit tests for com.jcabi.github.mock package, i.e. new MkGithub().markdown()</technical_language>

Target:
public final void canBeRendered() throws Exception { final String text = "Hello, **world**!"; MatcherAssert.assertThat( new MkGithub().markdown().render( Json.createObjectBuilder() .add("text", text) .build() ), Matchers.equalTo(text) ); }
Source:
<code>private static void loadAllTextures() { getTexture(TEXTURE_PATH + BaseSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + BulletSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + CraterSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + DeepWaterSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + EngineerSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + GenericExplosionSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + GrassSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + MineExplosionSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + MineSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + PillboxSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + RoadSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + RubbleSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + SwampSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + TankSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + TreeSprite.TEXTURE_FILE); getTexture(TEXTURE_PATH + WallSprite.TEXTURE_FILE); <START> getTexture(TEXTURE_PATH + WaterSprite.TEXTURE_FILE); <END> }</code><technical_language>wrong this code, a programmatically grab of textures /res folder explicitly define them. done hard already, reason change it, curious procedure for scraping folder instead</technical_language>

Target:
private static void loadAllTextures() { File textureDirectory = new File(TEXTURE_PATH); for (File file : textureDirectory.listFiles()) { if (file.getName().endsWith("png")) { getTexture(TEXTURE_PATH + file.getName()); } } }
Source:
<code>private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); <START> plugParameters.setVmId(getParameters().getVmId()); <END> VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD); } return plugVmNicReturnValue.getSucceeded(); }</code><technical_language>do this line in create parameters command</technical_language>

Target:
private boolean plugNic() { PlugUnplugVmNicParameters plugParameters = createPlugUnPlugParameters(); VdcReturnValueBase plugVmNicReturnValue = Backend.getInstance().runInternalAction(VdcActionType.PlugUnplugVmNic, plugParameters, ExecutionHandler.createDefaultContexForTasks(getExecutionContext())); if (!plugVmNicReturnValue.getSucceeded()) { getReturnValue().getExecuteFailedMessages().add("Failed hot-plugging nic to VM"); getReturnValue().getCanDoActionMessages().addAll(plugVmNicReturnValue.getCanDoActionMessages()); getReturnValue().getCanDoActionMessages().remove(VdcBllMessages.VAR__ACTION__ADD.toString()); getReturnValue().setCanDoAction(false); } return plugVmNicReturnValue.getSucceeded(); }
Source:
<code>protected Map<String, String> getProperties() { Map<String, String> properties = new HashMap<>(); if (config.getProperties() != null) { properties.putAll(config.getProperties().getProperties()); } if (!Strings.isNullOrEmpty(config.getAggregations())) { properties.remove(Properties.Cube.AGGREGATIONS); properties.putAll(CubeUtils.parseAndGetProperties(Properties.Cube.AGGREGATIONS, config.getAggregations(), ";", ":", new Function<String, String>() { @Override public String apply(String input) { return "dataset.cube.aggregation." + input + ".dimensions"; } })); } if (!Strings.isNullOrEmpty(config.getMeasurements())) { properties.remove(Properties.Cube.MEASUREMENTS); properties.putAll(CubeUtils.parseAndGetProperties(Properties.Cube.MEASUREMENTS, <START> config.getMeasurements(), ",", ":", <END> new Function<String, String>() { @Override public String apply(String input) { return Properties.Cube.MEASUREMENT_PREFIX + input; } })); } properties.put(Properties.BatchReadableWritable.NAME, config.getName()); properties.put(Properties.BatchReadableWritable.TYPE, Cube.class.getName()); return properties; }</code><technical_language>Wondering if ';' delimiter in cases? Bigger change I guess</technical_language>

Target:
protected Map<String, String> getProperties() { Map<String, String> properties = new HashMap<>(); if (config.getProperties() != null) { properties.putAll(config.getProperties().getProperties()); } if (!Strings.isNullOrEmpty(config.getAggregations())) { properties.remove(Properties.Cube.AGGREGATIONS); properties.putAll(CubeUtils.parseAndGetProperties(Properties.Cube.AGGREGATIONS, config.getAggregations(), ";", ":", new Function<String, String>() { @Override public String apply(String input) { return "dataset.cube.aggregation." + input + ".dimensions"; } })); } if (!Strings.isNullOrEmpty(config.getMeasurements())) { properties.remove(Properties.Cube.MEASUREMENTS); properties.putAll(CubeUtils.parseAndGetProperties(Properties.Cube.MEASUREMENTS, config.getMeasurements(), ";", ":", new Function<String, String>() { @Override public String apply(String input) { return Properties.Cube.MEASUREMENT_PREFIX + input; } })); } properties.put(Properties.BatchReadableWritable.NAME, config.getName()); properties.put(Properties.BatchReadableWritable.TYPE, Cube.class.getName()); return properties; }
Source:
<code>private PopupMenuSessionSearch getPopupMenuItemFindRelatedMessages() { if (popupMenuItemFindRelatedMessages == null) { <START> popupMenuItemFindRelatedMessages = new PopupMenuSessionSearch(this); <END> } return popupMenuItemFindRelatedMessages; }</code><technical_language>pass panel instead of extension (assuming search method is dropped)</technical_language>

Target:
private PopupMenuSessionSearch getPopupMenuItemFindRelatedMessages() { if (popupMenuItemFindRelatedMessages == null) { popupMenuItemFindRelatedMessages = new PopupMenuSessionSearch(httpSessionsPanel); } return popupMenuItemFindRelatedMessages; }
Source:
<code>private ValidationResult isNetworkSupportedInClusterWithOvsSwitch() { return ValidationResult .failWith(EngineMessage.ACTION_TYPE_FAILED_ONLY_EXTERNAL_NETWORK_IS_SUPPORTED_IN_OVS_SWITCH_TYPE) <START> .when(isNetworkCompatibleWithClusterSwitchType() && !(getNetwork() == null || isVnicAttachedToExternalNetwork())); <END> }</code><technical_language>if de-morgan of predicate get: iscompat() && getNetwork() != null && !isAttachedtoExternal() isAttachedToExternal() checks for null network abbreviate to: iscompat() && !isAttachedtoExternal() :)</technical_language>

Target:
private ValidationResult isNetworkSupportedInClusterWithOvsSwitch() { return ValidationResult .failWith(EngineMessage.ACTION_TYPE_FAILED_ONLY_EXTERNAL_NETWORK_IS_SUPPORTED_IN_OVS_SWITCH_TYPE) .when(isOvsSwitchTypeOnCluster() && !isVnicEmptyOrAttachedToExternalNetwork()); }
Source:
<code><START> public static void invalidateAllVanityUrlVersions(Contentlet vanityUrl){ <END> try { Identifier identifier = identifierAPI.find(vanityUrl.getIdentifier()); List<Contentlet> contentletVersions = contentletAPI.findAllVersions(identifier,APILocator.systemUser(),false); contentletVersions.stream().forEach( (Contentlet con) -> { try { vanityURLCache.remove(VanityUrlUtil.sanitizeKey(con)); } catch (DotDataException | DotRuntimeException | DotSecurityException e) { Logger.error(VanityUrlServices.class, "Error trying to invalidate Vanity URL identifier:"+vanityUrl.getIdentifier(),e); } }); vanityURLCache.remove(VanityUrlUtil.sanitizeKey(vanityUrl)); } catch (DotDataException | DotRuntimeException | DotSecurityException e) { Logger.error(VanityUrlServices.class, "Error trying to invalidate Vanity URL identifier:"+vanityUrl.getIdentifier(),e); } }</code><technical_language>I methods static. interacting external services (like cache here) static</technical_language>

Target:
public void invalidateAllVanityUrlVersions(Contentlet vanityUrl) { try { Identifier identifier = identifierAPI.find(vanityUrl.getIdentifier()); List<Contentlet> contentletVersions = contentletAPI .findAllVersions(identifier, APILocator.systemUser(), false); contentletVersions.stream() .filter(con -> vanityUrl.getLanguageId() == con.getLanguageId()) .forEach(this::removeFromCache); removeFromCache(vanityUrl); } catch (DotDataException | DotRuntimeException | DotSecurityException e) { Logger.error(VanityUrlServices.class, "Error trying to invalidate Vanity URL identifier:" + vanityUrl.getIdentifier(), e); } }
Source:
<code><START> public boolean onTouchEvent(MotionEvent event) { <END> if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { return false; } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && MotionEventCompat.getSource(event) == InputDevice.SOURCE_MOUSE) { if (onMouseEvent(event, bridge)) { return true; } viewPager.setPagingEnabled(true); } super.onTouchEvent(event); if (gestureDetector != null) { gestureDetector.onTouchEvent(event); } return true; }</code><technical_language>a real Nexus 9 6.0 (MRA58K). I tested real Nexus 5 yet..</technical_language>

Target:
public boolean onTouchEvent(MotionEvent event) { if (event.getAction() == MotionEvent.ACTION_DOWN) { refreshTextFromBuffer(); } if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH && MotionEventCompat.getSource(event) == InputDevice.SOURCE_MOUSE) { if (onMouseEvent(event, bridge)) { return true; } viewPager.setPagingEnabled(true); } else if (gestureDetector != null) { gestureDetector.onTouchEvent(event); } if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) { if (bridge.isSelectingForCopy()) { SelectionArea area = bridge.getSelectionArea(); int row = (int) Math.floor(event.getY() / bridge.charHeight); int col = (int) Math.floor(event.getX() / bridge.charWidth); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: viewPager.setPagingEnabled(false); if (area.isSelectingOrigin()) { area.setRow(row); area.setColumn(col); lastTouchedRow = row; lastTouchedCol = col; bridge.redraw(); } return true; case MotionEvent.ACTION_MOVE: if (row == lastTouchedRow && col == lastTouchedCol) return true; area.finishSelectingOrigin(); area.setRow(row); area.setColumn(col); lastTouchedRow = row; lastTouchedCol = col; bridge.redraw(); return true; case MotionEvent.ACTION_UP: if (area.getLeft() == area.getRight() && area.getTop() == area.getBottom()) { return true; } String copiedText = area.copyFrom(bridge.buffer); clipboard.setText(copiedText); Toast.makeText( context, context.getString(R.string.console_copy_done, copiedText.length()), Toast.LENGTH_LONG).show(); case MotionEvent.ACTION_CANCEL: area.reset(); bridge.setSelectingForCopy(false); bridge.redraw(); viewPager.setPagingEnabled(true); return true; } } return true; } super.onTouchEvent(event); return true; }
Source:
<code><START> public AutocompleteTextareaDOMElementFactory getAutocompleteTextareaFactory() { <END> return new AutocompleteTextareaDOMElementFactory(gridPanel, gridLayer, this, sessionManager, sessionCommandManager, newCellHasNoValueCommand(), newCellHasValueCommand()); }</code><technical_language>please Camel case TextArea</technical_language>

Target:
public AutocompleteTextAreaDOMElementFactory getAutocompleteTextareaFactory() { return new AutocompleteTextAreaDOMElementFactory(gridPanel, gridLayer, this, sessionManager, sessionCommandManager, newCellHasNoValueCommand(), newCellHasValueCommand()); }
Source:
<code>public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BlobId)) { return false; } BlobId blobId = (BlobId) o; <START> if (!version.equals(blobId.version)) { <END> return false; } if (!flag.equals(blobId.flag)) { return false; } if (!datacenterId.equals(blobId.datacenterId)) { return false; } if (!accountId.equals(blobId.accountId)) { return false; } if (!containerId.equals(blobId.containerId)) { return false; } if (!partitionId.equals(blobId.partitionId)) { return false; } return uuid.equals(blobId.uuid); }</code><technical_language>compareTo() equals() consistent other, is here. enforce simplify simply return compareTo(blobId) == 0; line 353 avoiding code duplication</technical_language>

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof BlobId)) { return false; } BlobId blobId = (BlobId) o; return compareTo(blobId) == 0; }
Source:
<code>public static void quickUpdatePageAAD(byte[] pageAAD, short newPageOrdinal) { byte[] pageOrdinalBytes = shortToBytesLE(newPageOrdinal); int length = pageAAD.length; <START> System.arraycopy(pageOrdinalBytes, 0, pageAAD, length-2, 2); <END> }</code><technical_language>Add space 'length - 2'</technical_language>

Target:
public static void quickUpdatePageAAD(byte[] pageAAD, short newPageOrdinal) { byte[] pageOrdinalBytes = shortToBytesLE(newPageOrdinal); System.arraycopy(pageOrdinalBytes, 0, pageAAD, pageAAD.length - 2, 2); }
Source:
<code>public void updateImpl(List<Metric> metrics) { <START> StatsDClient statsd = new NonBlockingStatsDClient(prefix, host, port, new ErrorHandler()); <END> LOGGER.debug("sending data"); for (Metric metric : metrics) { String aspect = namingConvention.getName(metric); if (metric.hasNumberValue()) { statsd.recordGaugeValue(aspect, metric.getNumberValue().longValue()); } else { statsd.recordSetEvent(aspect, metric.getValue().toString()); } statsd.recordExecutionTime(aspect, metric.getTimestamp() / 1000); } statsd.stop(); }</code><technical_language>ErrorHandler a singleton</technical_language>

Target:
public void updateImpl(List<Metric> metrics) { StatsDClient statsd = createClient(); LOGGER.debug("sending data"); for (Metric metric : metrics) { String aspect = namingConvention.getName(metric); if (metric.getConfig().getTags().getTag(DataSourceType.COUNTER.getValue()) != null) { statsd.count(aspect, metric.getNumberValue().longValue()); } else if (metric.hasNumberValue()) { statsd.gauge(aspect, metric.getNumberValue().longValue()); } else { statsd.set(aspect, metric.getValue().toString()); } statsd.time(aspect, metric.getTimestamp() / 1000); } statsd.stop(); }
Source:
<code>public void testOverlap1() throws Exception { TestTransaction tx = new TestTransaction(env); tx.set("bob", BALANCE, "10"); tx.set("joe", BALANCE, "20"); tx.set("jill", BALANCE, "60"); tx.done(); tx = new TestTransaction(env); Assert.assertEquals("10", tx.gets("bob", BALANCE)); Assert.assertEquals("20", tx.gets("joe", BALANCE)); <START> tx.set("bob", BALANCE, "5"); <END> tx.set("joe", BALANCE, "25"); TestTransaction tx2 = new TestTransaction(env); Assert.assertEquals("10", tx2.gets("bob", BALANCE)); Assert.assertEquals("60", tx2.gets("jill", BALANCE)); tx2.set("bob", BALANCE, "5"); tx2.set("jill", BALANCE, "65"); tx2.done(); assertCommitFails(tx); TestTransaction tx3 = new TestTransaction(env); Assert.assertEquals("5", tx3.gets("bob", BALANCE)); Assert.assertEquals("20", tx3.gets("joe", BALANCE)); Assert.assertEquals("65", tx3.gets("jill", BALANCE)); tx3.done(); }</code><technical_language>this increment util</technical_language>

Target:
public void testOverlap1() throws Exception { TestTransaction tx = new TestTransaction(env); tx.set("bob", BALANCE, "10"); tx.set("joe", BALANCE, "20"); tx.set("jill", BALANCE, "60"); tx.done(); tx = new TestTransaction(env); Assert.assertEquals("10", tx.gets("bob", BALANCE)); Assert.assertEquals("20", tx.gets("joe", BALANCE)); TestUtil.increment(tx, "bob", BALANCE, -5); TestUtil.increment(tx, "joe", BALANCE, 5); TestTransaction tx2 = new TestTransaction(env); Assert.assertEquals("10", tx2.gets("bob", BALANCE)); Assert.assertEquals("60", tx2.gets("jill", BALANCE)); TestUtil.increment(tx2, "bob", BALANCE, -5); TestUtil.increment(tx2, "jill", BALANCE, 5); tx2.done(); assertCommitFails(tx); TestTransaction tx3 = new TestTransaction(env); Assert.assertEquals("5", tx3.gets("bob", BALANCE)); Assert.assertEquals("20", tx3.gets("joe", BALANCE)); Assert.assertEquals("65", tx3.gets("jill", BALANCE)); tx3.done(); }
Source:
<code>public void setTracerRegistry(TracerRegistry tracerRegistry) { <START> this.m_tracerRegistry = tracerRegistry; <END> }</code><technical_language>this.m_</technical_language>

Target:
public void setTracerRegistry(TracerRegistry tracerRegistry) { m_tracerRegistry = tracerRegistry; }
Source:
<code>private void validatePropertyNodeXorLiteralPropertyNode() { <START> Validate.isTrue(propertyNode != null ^ literalPropertyNode != null); <END> }</code><technical_language>Include a failure message argument</technical_language>

Target:
private void validatePropertyNodeXorLiteralPropertyNode() { Validate.isTrue( propertyNode != null ^ literalPropertyNode != null, "The property node must be non-null xor the literal property node must be non-null"); }
Source:
<code><START> public void onGetTotalNumberOfPages() { <END> final QueryAllImpl<Category, CategoryQuery> query = QueryAllImpl.of(CategoryQuery.of(), 2); long totalNumberOfPages = query.getTotalNumberOfPages(10); assertThat(totalNumberOfPages).isEqualTo(5); totalNumberOfPages = query.getTotalNumberOfPages(7); assertThat(totalNumberOfPages).isEqualTo(4); }</code><technical_language>corner cases missing, like: - [ ] totalElements = 0 - [ ] totalElements == pageSize - [ ] totalElements == pageSize - 1 - [ ] totalElements == pageSize + 1 - [ ] pageSize == 1</technical_language>

Target:
public void onGetTotalNumberOfPages() { final QueryAllImpl query1 = QueryAllImpl.of(CategoryQuery.of(), 1); assertThat(query1.getTotalNumberOfPages(0)).isEqualTo(0); assertThat(query1.getTotalNumberOfPages(1)).isEqualTo(1); assertThat(query1.getTotalNumberOfPages(2)).isEqualTo(2); assertThat(query1.getTotalNumberOfPages(3)).isEqualTo(3); assertThat(query1.getTotalNumberOfPages(4)).isEqualTo(4); final QueryAllImpl query2 = QueryAllImpl.of(CategoryQuery.of(), 2); assertThat(query2.getTotalNumberOfPages(0)).isEqualTo(0); assertThat(query2.getTotalNumberOfPages(1)).isEqualTo(1); assertThat(query2.getTotalNumberOfPages(2)).isEqualTo(1); assertThat(query2.getTotalNumberOfPages(3)).isEqualTo(2); assertThat(query2.getTotalNumberOfPages(7)).isEqualTo(4); assertThat(query2.getTotalNumberOfPages(9)).isEqualTo(5); assertThat(query2.getTotalNumberOfPages(10)).isEqualTo(5); assertThat(query2.getTotalNumberOfPages(11)).isEqualTo(6); final QueryAllImpl query7 = QueryAllImpl.of(CategoryQuery.of(), 7); assertThat(query7.getTotalNumberOfPages(0)).isEqualTo(0); assertThat(query7.getTotalNumberOfPages(1)).isEqualTo(1); assertThat(query7.getTotalNumberOfPages(6)).isEqualTo(1); assertThat(query7.getTotalNumberOfPages(7)).isEqualTo(1); assertThat(query7.getTotalNumberOfPages(8)).isEqualTo(2); assertThat(query7.getTotalNumberOfPages(9)).isEqualTo(2); assertThat(query7.getTotalNumberOfPages(699)).isEqualTo(100); assertThat(query7.getTotalNumberOfPages(700)).isEqualTo(100); assertThat(query7.getTotalNumberOfPages(701)).isEqualTo(101); assertThat(query7.getTotalNumberOfPages(702)).isEqualTo(101); final QueryAllImpl queryMax = QueryAllImpl.of(CategoryQuery.of(), Integer.MAX_VALUE); assertThat(queryMax.getTotalNumberOfPages(0)).isEqualTo(0); assertThat(queryMax.getTotalNumberOfPages(1)).isEqualTo(1); assertThat(queryMax.getTotalNumberOfPages(Integer.MAX_VALUE - 1)).isEqualTo(1); assertThat(queryMax.getTotalNumberOfPages(Integer.MAX_VALUE)).isEqualTo(1); }