auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public BoxFolder onSend() throws BoxException { BoxRequestsFolder.GetFolderInfo folderInfoReq = new BoxRequestsFolder.GetFolderInfo(mFolderId, mRequestUrlString, mSession) { @Override protected void onSendCompleted(BoxResponse<BoxFolder> response) throws BoxException { } }.setFields(BoxFolder.ALL_FIELDS).setLimit(1000); BoxFolder folder = folderInfoReq.send(); BoxRequestBatch batchRequest = new BoxRequestBatch().setExecutor(SdkUtils.createDefaultThreadPoolExecutor(10, 10, 3600, TimeUnit.SECONDS)); BoxListItems boxListItems = folder.getItemCollection(); int offset = boxListItems.offset().intValue(); int limit = boxListItems.limit().intValue(); while (offset + limit < boxListItems.fullSize()) { offset += limit; limit = 1000; <START> BoxRequestsFolder.GetFolderItems folderItemsReq = new BoxRequestsFolder.GetFolderItems(mFolderId, mRequestUrlString + "/items", mSession) { <END> @Override protected void onSendCompleted(BoxResponse<BoxListItems> response) throws BoxException { } }.setFields(BoxFolder.ALL_FIELDS) .setOffset(offset) .setLimit(limit); batchRequest.addRequest(folderItemsReq); } BoxResponseBatch batchResponse = batchRequest.send(); for (BoxResponse response : batchResponse.getResponses()) { if (response.isSuccess()) { folder.getItemCollection().addAll((BoxListItems) response.getResult()); } else { throw (BoxException) response.getException(); } } return folder; }</code><technical_language>Is a static string use</technical_language>

Target:
public BoxFolder onSend() throws BoxException { String fields = mQueryMap.get(QUERY_FIELDS); BoxRequestsFolder.GetFolderInfo folderInfoReq = new BoxRequestsFolder.GetFolderInfo(mFolderId, mRequestUrlString, mSession) { @Override protected void onSendCompleted(BoxResponse<BoxFolder> response) throws BoxException { } }.setFields(fields).setLimit(LIMIT); BoxFolder folder = folderInfoReq.send(); BoxRequestBatch batchRequest = new BoxRequestBatch().setExecutor(SdkUtils.createDefaultThreadPoolExecutor(10, 10, 3600, TimeUnit.SECONDS)); BoxIteratorItems BoxIteratorItems = folder.getItemCollection(); int offset = BoxIteratorItems.offset().intValue(); int limit = BoxIteratorItems.limit().intValue(); while (offset + limit < BoxIteratorItems.fullSize()) { offset += limit; limit = LIMIT; BoxRequestsFolder.GetFolderItems folderItemsReq = new BoxRequestsFolder.GetFolderItems(mFolderId, mItemsUrl, mSession) { @Override protected void onSendCompleted(BoxResponse<BoxIteratorItems> response) throws BoxException { } }.setFields(fields) .setOffset(offset) .setLimit(limit); batchRequest.addRequest(folderItemsReq); } BoxResponseBatch batchResponse = batchRequest.send(); JsonObject folderJson = folder.toJsonObject(); JsonArray collection = folderJson.get(BoxFolder.FIELD_ITEM_COLLECTION).asObject() .get(BoxIterator.FIELD_ENTRIES).asArray(); for (BoxResponse response : batchResponse.getResponses()) { if (response.isSuccess()) { for (BoxItem item : (BoxIteratorItems)response.getResult()) { collection.add(item.toJsonObject()); } } else { throw (BoxException) response.getException(); } } return new BoxFolder(folderJson); }
Source:
<code><START> public static String toString(Document document) throws TransformerException { <END> TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); StringWriter writer = new StringWriter(); transformer.transform(new DOMSource(document), new StreamResult(writer)); return writer.getBuffer().toString(); }</code><technical_language>need public is protected enough</technical_language>

Target:
protected static String toString(Document document) throws TransformerException { TransformerFactory tf = TransformerFactory.newInstance(); Transformer transformer = tf.newTransformer(); transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes"); StringWriter writer = new StringWriter(); transformer.transform(new DOMSource(document), new StreamResult(writer)); return writer.getBuffer().toString(); }
Source:
<code>static SonarComponents sonarComponents(File file) { <START> SensorContextTester context = SensorContextTester.create(new File("")).setRuntime(SonarRuntimeImpl.forSonarLint(Version.create(6, 7))); <END> context.setSettings(new MapSettings().setProperty("sonar.java.failOnException", true)); SonarComponents sonarComponents = new SonarComponents(null, context.fileSystem(), null, null, null) { @Override public boolean reportAnalysisError(RecognitionException re, File file) { return false; } }; sonarComponents.setSensorContext(context); context.fileSystem().add(new TestInputFileBuilder("", file.getPath()).setCharset(StandardCharsets.UTF_8).build()); return sonarComponents; }</code><technical_language>SonarRuntimeImpl.forSonarLint(Version.create(6, 7) ? I mind testing this, shoudn't test for SonarQube version 7.6</technical_language>

Target:
static SonarComponents sonarComponents(File file) throws IOException { File moduleBaseDir = new File(""); SensorContextTester context = SensorContextTester.create(moduleBaseDir); context.fileSystem().setWorkDir(moduleBaseDir.toPath()); SonarComponents sonarComponents = new SonarComponents(null, context.fileSystem(), null, null, null); sonarComponents.setSensorContext(context); DefaultInputFile inputFile = new TestInputFileBuilder("", moduleBaseDir, file).setCharset(StandardCharsets.UTF_8) .setContents(new String(Files.readAllBytes(file.toPath()))).build(); context.fileSystem().add(inputFile); return sonarComponents; }
Source:
<code>public ModelMetaData metaData() { <START> return null ; END> }</code><technical_language>is this returning null</technical_language>

Target:
public ModelMetaData metaData() { return new ModelMetaData(new int[][] {inputShape}, 1, ZooType.CNN); }
Source:
<code>public WorkflowTask findTaskByContentlet(final Contentlet contentlet) throws DotDataException { if (!UtilMethods.isSet(contentlet.getIdentifier()) || cache.is404(contentlet)) { <START> return null; <END> } WorkflowTask task = cache.getTask(contentlet); if (task == null) { final DotConnect db = new DotConnect(); db.setSQL(WorkflowSQL.SELECT_TASK); db.addParam(contentlet.getIdentifier()); db.addParam(contentlet.getLanguageId()); List<WorkflowTask> foundTasks = this .convertListToObjects(db.loadObjectResults(), WorkflowTask.class); if (null != foundTasks && !foundTasks.isEmpty()) { task = foundTasks.get(0); } if (null != task && null != task.getId()) { cache.addTask(contentlet, task); } else { cache.add404Task(contentlet); } } return task; }</code><technical_language>I prefer return a workflowtask is initially init null, if validation pass, do process return workflowtask null</technical_language>

Target:
public WorkflowTask findTaskByContentlet(final Contentlet contentlet) throws DotDataException { WorkflowTask task = null; if (!UtilMethods.isSet(contentlet.getIdentifier()) || cache.is404(contentlet)) { return task; } task = cache.getTask(contentlet); if (task == null) { final DotConnect db = new DotConnect(); db.setSQL(WorkflowSQL.SELECT_TASK); db.addParam(contentlet.getIdentifier()); db.addParam(contentlet.getLanguageId()); List<WorkflowTask> foundTasks = this .convertListToObjects(db.loadObjectResults(), WorkflowTask.class); if (null != foundTasks && !foundTasks.isEmpty()) { task = foundTasks.get(0); } if (null != task && null != task.getId()) { cache.addTask(contentlet, task); } else { cache.add404Task(contentlet); } } return task; }
Source:
<code>public static void clear() { MDC.remove(SITE_NAME_MDC_KEY); SiteContext current = threadLocal.get(); <START> logger.debug("Releasing read lock for context {}", current); <END> current.accessLock.unlock(); threadLocal.remove(); }</code><technical_language>forgot mention change read access</technical_language>

Target:
public static void clear() { MDC.remove(SITE_NAME_MDC_KEY); SiteContext current = threadLocal.get(); logger.debug("Releasing access lock for context {}", current); current.accessLock.unlock(); threadLocal.remove(); }
Source:
<code>protected void activate(final BundleContext bundleContext) { productInfo = productInfoProvider.getProductInfo(); final Dictionary<String, Object> properties = new Hashtable<>(); String distribution; String version = productInfo.getShortVersion(); if (Distribution.CLOUD_READY.equals(getDistribution())) { distribution = Distribution.CLOUD_READY.getValue(); } else { distribution = Distribution.CLASSIC.getValue(); log.debug("Registering [ ] as an OSGi Service so it be be used to enable/disable other OSGi Components", this.getClass().getSimpleName()); } properties.put(PN_DISTRIBUTION, distribution); properties.put(PN_VERSION, version); serviceRegistration = bundleContext.registerService(RequireAem.class.getName(), this, properties); <START> log.error("Registering [ RequireAem.class ] as an OSGi Service with OSGi properties [ distribution = {}, version = ] so it be be used to enable/disable other OSGi Components", <END> properties.get(PN_DISTRIBUTION), properties.get(PN_VERSION)); }</code><technical_language>error()? info() suffice here</technical_language>

Target:
protected void activate(final BundleContext bundleContext) { productInfo = productInfoProvider.getProductInfo(); final Dictionary<String, Object> properties = new Hashtable<>(); String distribution; String version = productInfo.getShortVersion(); if (Distribution.CLOUD_READY.equals(getDistribution())) { distribution = Distribution.CLOUD_READY.getValue(); } else { distribution = Distribution.CLASSIC.getValue(); } properties.put(PN_DISTRIBUTION, distribution); properties.put(PN_VERSION, version); serviceRegistration = bundleContext.registerService(RequireAem.class.getName(), this, properties); log.info("Registering [ RequireAem.class ] as an OSGi Service with OSGi properties [ distribution = {}, version = ] so it be be used to enable/disable other OSGi Components", properties.get(PN_DISTRIBUTION), properties.get(PN_VERSION)); }
Source:
<code>public void apply(PacketContext pktCtx, RuleResult res, UUID ownerId) { if (!pktCtx.tracingEnabled(requestId)) { <START> pktCtx.setTracingEnabled(requestId); <END> throw TraceRequiredException.instance(); } }</code><technical_language>s/setTrancingEnabled/enableTracing</technical_language>

Target:
public void apply(PacketContext pktCtx, RuleResult res, UUID ownerId) { if (!pktCtx.tracingEnabled(requestId)) { pktCtx.enableTracing(requestId); throw TraceRequiredException.instance(); } }
Source:
<code>protected void doPublish(final ExtLogRecord record) { record.copyAll(); synchronized (buffer) { if (isLoggable(record)) { if (buffer.size() == limit) { buffer.removeFirst(); } buffer.addLast(record); } for (Handler handler : getHandlers()) { <START> if (handler.isLoggable(record)) { <END> handler.publish(record); } } } }</code><technical_language>this duplicate existing check</technical_language>

Target:
protected void doPublish(final ExtLogRecord record) { record.copyAll(); synchronized (buffer) { if (isLoggable(record)) { if (buffer.size() == limit) { buffer.removeFirst(); } buffer.addLast(record); } for (Handler handler : getHandlers()) { handler.publish(record); } } }
Source:
<code>public void run() { logger.info("Starting."); try { while (!shutdownRequested) { try { executor.waitUntilQueueSizeLowerThanThreshold(executorRecovery.getMaxWaitUntil()); if (!shutdownRequested) { executorRecovery.tick(); if (stateProcessorFactory.getPotentiallyStuckProcessors() == executor.getThreadCount()) { <START> logger.warn("All state processor threads are potentially stuck."); <END> } dispatch(getNextInstanceIds()); } } catch (PollingRaceConditionException pex) { logger.info(pex.getMessage()); sleep(true); } catch (@SuppressWarnings("unused") InterruptedException dropThrough) { } catch (Exception e) { logger.error("Exception in executing dispatcher - retrying after sleep period (" + e.getMessage() + ")", e); sleep(false); } } } finally { shutdownPool(); logger.info("Shutdown finished."); shutdownDone.countDown(); } }</code><technical_language>get stuck, do need logging polling interval? this <LINK_0></technical_language>

Target:
public void run() { logger.info("Starting."); try { while (!shutdownRequested) { try { executor.waitUntilQueueSizeLowerThanThreshold(executorRecovery.getMaxWaitUntil()); if (!shutdownRequested) { executorRecovery.tick(); int potentiallyStuckProcessors = stateProcessorFactory.getPotentiallyStuckProcessors(); if (potentiallyStuckProcessors > 0) { periodicLogger.warn("{} of state processor threads are potentially stuck (processing longer than seconds)", potentiallyStuckProcessors, executor.getThreadCount(), stuckThreadThresholdSeconds); } dispatch(getNextInstanceIds()); } } catch (PollingRaceConditionException pex) { logger.info(pex.getMessage()); sleep(true); } catch (@SuppressWarnings("unused") InterruptedException dropThrough) { } catch (Exception e) { logger.error("Exception in executing dispatcher - retrying after sleep period (" + e.getMessage() + ")", e); sleep(false); } } } finally { shutdownPool(); executorRecovery.markShutdown(); logger.info("Shutdown finished."); shutdownDone.countDown(); } }
Source:
<code>private int idx(long val) { int hashCode = Long.hashCode(val); <START> hashCode ^= (hashCode >>> 20) ^ (hashCode >>> 12); <END> return (hashCode ^ (hashCode >>> 7) ^ (hashCode >>> 4)) & (cache.length - 1); }</code><technical_language>get hashing strategy it</technical_language>

Target:
private int idx(long val) { return hashFunction.hash(val) & (cache.length - 1); }
Source:
<code>protected List<MondrianCatalog> getCatalogs( IPentahoSession pentahoSession ) { Map<String, MondrianCatalog> catalogsMap = (Map<String, MondrianCatalog>) PentahoSystem.getCacheManager( pentahoSession ).getFromRegionCache( MONDRIAN_CATALOG_CACHE_REGION, getLocale().toString() ); List<MondrianCatalog> catalogs = new ArrayList<MondrianCatalog>(); if ( catalogsMap == null ) { return catalogs; } <START> synchronized ( catalogsMap ) { <END> for ( Object o : catalogsMap.values() ) { if ( o instanceof MondrianCatalog ) { catalogs.add( (MondrianCatalog) o ); } } } Collections.sort( catalogs, new Comparator<MondrianCatalog>() { @Override public int compare( MondrianCatalog o1, MondrianCatalog o2 ) { return o1.getName().compareTo( o2.getName() ); } } ); SetUniqueList uniqueCatalogs = SetUniqueList.decorate( catalogs ); return uniqueCatalogs; }</code><technical_language>Instead of synchronizing map, suggest changing HashMap a ConcurrentHashMap</technical_language>

Target:
protected List<MondrianCatalog> getCatalogs( IPentahoSession pentahoSession ) { Map<String, MondrianCatalog> catalogsMap = (Map<String, MondrianCatalog>) PentahoSystem.getCacheManager( pentahoSession ).getFromRegionCache( MONDRIAN_CATALOG_CACHE_REGION, getLocale().toString() ); List<MondrianCatalog> catalogs = new ArrayList<MondrianCatalog>(); for ( Object o : catalogsMap.values() ) { if ( o instanceof MondrianCatalog ) { catalogs.add( (MondrianCatalog) o ); } } Collections.sort( catalogs, new Comparator<MondrianCatalog>() { @Override public int compare( MondrianCatalog o1, MondrianCatalog o2 ) { return o1.getName().compareTo( o2.getName() ); } } ); SetUniqueList uniqueCatalogs = SetUniqueList.decorate( catalogs ); return uniqueCatalogs; }
Source:
<code>public void testCacheUsesCacheManagerClassLoaderForDefaultURI() { CachingProvider cachingProvider = Caching.getCachingProvider(); LimitedClassLoader limitedClassLoader = new LimitedClassLoader(cachingProvider.getDefaultClassLoader()); CacheManager cacheManager = cachingProvider.getCacheManager(cachingProvider.getDefaultURI(), limitedClassLoader); MutableConfiguration<Object, Object> configuration = new MutableConfiguration<Object, Object>(); Cache<Object, Object> cache = cacheManager.createCache("test", configuration); cache.put(1L, new Customer(1L)); try { cache.get(1L); <START> fail("Expected ClassNotFoundException"); <END> } catch (AssertionError e) { assertThat(e.getMessage(), is("No com.pany here")); } }</code><technical_language>Expected AssertionError, no??</technical_language>

Target:
public void testCacheUsesCacheManagerClassLoaderForDefaultURI() { CachingProvider cachingProvider = Caching.getCachingProvider(); LimitedClassLoader limitedClassLoader = new LimitedClassLoader(cachingProvider.getDefaultClassLoader()); CacheManager cacheManager = cachingProvider.getCacheManager(cachingProvider.getDefaultURI(), limitedClassLoader); MutableConfiguration<Object, Object> configuration = new MutableConfiguration<Object, Object>(); Cache<Object, Object> cache = cacheManager.createCache("test", configuration); cache.put(1L, new Customer(1L)); try { cache.get(1L); fail("Expected AssertionError"); } catch (AssertionError e) { assertThat(e.getMessage(), is("No com.pany here")); } }
Source:
<code>public Map<String, ObjectReplicationPolicy> getObjectReplicationSourcePolicies() { Map<String, ObjectReplicationPolicy> objectReplicationSourcePolicies = new HashMap<>(); this.objectReplicationDestinationPolicyId = this.objectReplicationRuleStatus.getOrDefault("policy-id", null); if (objectReplicationDestinationPolicyId == null) { for (String str : this.objectReplicationRuleStatus.keySet()) { String[] split = str.split("_"); String policyId = split[0]; String ruleId = split[1]; if (objectReplicationSourcePolicies.containsKey(policyId)) { objectReplicationSourcePolicies.get(policyId) .putRuleAndStatus(ruleId, this.objectReplicationRuleStatus.get(str)); } else { ObjectReplicationPolicy policy = new ObjectReplicationPolicy(policyId); policy.putRuleAndStatus(ruleId, objectReplicationRuleStatus.get(str)); objectReplicationSourcePolicies.put(policyId, policy); } } } <START> return objectReplicationSourcePolicies; } <END></code><technical_language>add a new line end in swagger README</technical_language>

Target:
public Map<String, ObjectReplicationPolicy> getObjectReplicationSourcePolicies() { return this.objectReplicationSourcePolicies; }
Source:
<code>public void testLeaderInformationChangedAndShouldBeCorrected() throws Exception { final TestingLeaderElectionDriver.TestingLeaderElectionDriverFactory testingLeaderElectionDriverFactory = new TestingLeaderElectionDriver.TestingLeaderElectionDriverFactory(); final DefaultLeaderElectionService leaderElectionService = new DefaultLeaderElectionService( testingLeaderElectionDriverFactory); final TestingContender testingContender = new TestingContender(TEST_URL, leaderElectionService); leaderElectionService.start(testingContender); final TestingLeaderElectionDriver testingLeaderElectionDriver = testingLeaderElectionDriverFactory.getCurrentLeaderDriver(); assertThat(testingLeaderElectionDriver, is(notNullValue())); testingLeaderElectionDriver.isLeader(); testingContender.waitForLeader(timeout); testingLeaderElectionDriver.leaderInformationChanged(LeaderInformation.empty()); assertThat(testingLeaderElectionDriver.getLeaderInformation().getLeaderAddress(), is(TEST_URL)); <START> testingLeaderElectionDriver.leaderInformationChanged( <END> new LeaderInformation(UUID.randomUUID(), "faulty-address")); assertThat(testingLeaderElectionDriver.getLeaderInformation().getLeaderAddress(), is(TEST_URL)); leaderElectionService.stop(); }</code><technical_language>check leader session id stays same</technical_language>

Target:
public void testLeaderInformationChangedAndShouldBeCorrected() throws Exception { new Context() {{ runTest(() -> { testingLeaderElectionDriver.isLeader(); final LeaderInformation expectedLeader = LeaderInformation.known( leaderElectionService.getLeaderSessionID(), TEST_URL); testingLeaderElectionDriver.leaderInformationChanged(LeaderInformation.empty()); assertThat(testingLeaderElectionDriver.getLeaderInformation(), is(expectedLeader)); testingLeaderElectionDriver.leaderInformationChanged( LeaderInformation.known(UUID.randomUUID(), "faulty-address")); assertThat(testingLeaderElectionDriver.getLeaderInformation(), is(expectedLeader)); }); }}; }
Source:
<code>public FileBasedConfig openSystemConfig(Config parent, FS fs) { <START> FileBasedConfig c = createSystemConfig(parent, fs); systemConfig.set(c); <END> return c; }</code><technical_language>if compare - is point in keeping AtomicReference. Volatile ensure new config propagated threads</technical_language>

Target:
public FileBasedConfig openSystemConfig(Config parent, FS fs) { File configFile = fs.getGitSystemConfig(); if (configFile == null) { return new FileBasedConfig(null, fs) { @Override public void load() { } @Override public boolean isOutdated() { return false; } }; } return new FileBasedConfig(parent, configFile, fs); }
Source:
<code>public BlockType deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { String value = json.getAsString(); try { <START> return BlockType.valueOf(value.toUpperCase()); <END> }catch (Exception ex){ logger.error(ex); return BlockType.OTHERS; } }</code><technical_language>This needs upper case in english locale specifically. break in, for example, Turkish. "i".toUpperCase() is ""</technical_language>

Target:
public BlockType deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { String value = json.getAsString(); try { return BlockType.valueOf(value.toUpperCase(Locale.US)); }catch (Exception ex){ logger.error(ex); return BlockType.OTHERS; } }
Source:
<code>private String getIdentifierConceptId(final DataType dataType) { <START> return checkNotNull(SnomedRefSetUtil.DATATYPE_TO_REFSET_MAP.get(dataType), "Error while getting identifier concept ID for concrete data type reference set. Type: " + dataType); <END> }</code><technical_language>Please "concrete domain" in error message. talk "datatype properties" "concrete domains" "concrete datatypes."</technical_language>

Target:
private String getIdentifierConceptId(final DataType dataType) { return checkNotNull(SnomedRefSetUtil.DATATYPE_TO_REFSET_MAP.get(dataType), "Error while getting identifier concept ID for concrete domain reference set. Type: " + dataType); }
Source:
<code>public int getNLTMMessageType(byte[] decodedNLTMMessage) throws IdentityOAuth2Exception { int messageType; <START> if (decodedNLTMMessage.length > 8) { <END> messageType = decodedNLTMMessage[8]; } else { throw new IdentityOAuth2Exception( "Cannot extract message type from NLTM Token. Decoded token length is less than 8."); } if (messageType < 1 || messageType > 3) { throw new IdentityOAuth2Exception( "Invalid NLTM message type:" + messageType + ". Should be one of 1,2 or 3."); } return messageType; }</code><technical_language>constants magic numbers</technical_language>

Target:
public int getNLTMMessageType(byte[] decodedNLTMMessage) throws IdentityOAuth2Exception { int messageType; if (decodedNLTMMessage.length > MESSAGE_TYPE_BYTE_INDEX) { messageType = decodedNLTMMessage[MESSAGE_TYPE_BYTE_INDEX]; } else { throw new IdentityOAuth2Exception( "Cannot extract message type from NLTM Token. Decoded token length is less than 8."); } if (messageType < NTLM_TYPE_1_TOKEN || messageType > NTLM_TYPE_3_TOKEN) { throw new IdentityOAuth2Exception( "Invalid NLTM message type:" + messageType + ". Should be one of 1,2 or 3."); } return messageType; }
Source:
<code>public void loadLists() { try { if (!Files.exists(blacklistPath)) { Files.createFile(blacklistPath); } if (!Files.exists(whitelistPath)) { Files.createFile(whitelistPath); } blacklistedIDs = gson.fromJson(Files.newBufferedReader(blacklistPath), Set.class); whitelistedIDs = gson.fromJson(Files.newBufferedReader(whitelistPath), Set.class); } catch (IOException e) { logger.error("Whitelist or blacklist files not found:"); <START> e.printStackTrace(); <END> } }</code><technical_language>e.printStackTrace a logger available. (same reasons System.*.println). combine items logged in this case logger.error("Whitelist blacklist files found:", e); logger.error(e) log exception, rare log exception including a reason</technical_language>

Target:
private void loadLists() { try { if (createFiles()) { blacklistedIDs = gson.fromJson(Files.newBufferedReader(blacklistPath), Set.class); whitelistedIDs = gson.fromJson(Files.newBufferedReader(whitelistPath), Set.class); if (blacklistedIDs == null) { blacklistedIDs = new HashSet<>(); } if (whitelistedIDs == null) { whitelistedIDs = new HashSet<>(); } } } catch (IOException e) { logger.error("Whitelist or blacklist files not found:", e); } }
Source:
<code>private void checkPermission(Session session) throws ZebedeeException { try { if (session == null || !zebedeeCmsService.getPermissions().canEdit(session.getEmail())) { throw new UnauthorizedException("You are not authorised to create collections."); } } catch (IOException io) { <START> error().data("user", session).logAndThrow (io, "Unexpected error while trying to access permissions"); <END> } }</code><technical_language>session.getEmail()</technical_language>

Target:
private void checkPermission(Session session) throws ZebedeeException { try { if (session == null || !zebedeeCmsService.getPermissions().canEdit(session.getEmail())) { throw new UnauthorizedException("You are not authorised to create collections."); } } catch (IOException io) { error().data("user", session.getEmail()).logException(io, CHECK_PERMISSIONS_ERROR); throw new UnexpectedErrorException(CHECK_PERMISSIONS_ERROR, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }
Source:
<code>public Object fromBody(ResponseBody body, Type type) throws IOException { InputStream is = body.byteStream(); try { <START> return LoganSquare.parse(is, (Class) type); <END> } finally { try { is.close(); } catch (IOException ignored) { } } }</code><technical_language>type a Class. If API method returns List<User> this a ParamterizedType a Class</technical_language>

Target:
public Object fromBody(ResponseBody body, Type type) throws IOException { InputStream is = body.byteStream(); try { if (ParameterizedType.class.isAssignableFrom(type.getClass())) { ParameterizedType parameterizedType = (ParameterizedType) type; return LoganSquare.parseList(is, (Class) parameterizedType.getActualTypeArguments()[0]); } else { return LoganSquare.parse(is, (Class) type); } } catch (Exception e) { throw new RuntimeException(e); } finally { try { is.close(); } catch (IOException ignored) { } } }
Source:
<code>protected void writeEntityBody(Annotation entity, JsonGenerator jg) throws IOException { jg.writeStringField(COMMENT_AUTHOR_FIELD, entity.getAuthor()); jg.writeStringField(COMMENT_TEXT_FIELD, entity.getText()); jg.writeStringField(COMMENT_DOCUMENT_ID_FIELD, entity.getDocumentId()); String creationDate = entity.getCreationDate() != null ? entity.getCreationDate().toString() : null; jg.writeStringField(COMMENT_CREATION_DATE_FIELD, creationDate); String modificationDate = entity.getModificationDate() != null ? entity.getModificationDate().toString() : null; jg.writeStringField(COMMENT_MODIFICATION_DATE_FIELD, modificationDate); jg.writeStringField(ANNOTATION_ID, entity.getId()); jg.writeStringField(ANNOTATION_XPATH, entity.getXpath()); <START> jg.writeStringField(ANNOTATION_ENTITY_ID, ((ExternalEntity) entity).getEntityId()); <END> jg.writeStringField(ANNOTATION_ORIGIN, ((ExternalEntity) entity).getOrigin()); jg.writeStringField(ANNOTATION_ENTITY, ((ExternalEntity) entity).getEntity()); }</code><technical_language>if Annotation is a AnnotationImpl, write null values (if case)</technical_language>

Target:
protected void writeEntityBody(Annotation entity, JsonGenerator jg) throws IOException { jg.writeStringField(COMMENT_AUTHOR_FIELD, entity.getAuthor()); jg.writeStringField(COMMENT_TEXT_FIELD, entity.getText()); jg.writeStringField(COMMENT_DOCUMENT_ID_FIELD, entity.getDocumentId()); String creationDate = entity.getCreationDate() != null ? entity.getCreationDate().toString() : null; jg.writeStringField(COMMENT_CREATION_DATE_FIELD, creationDate); String modificationDate = entity.getModificationDate() != null ? entity.getModificationDate().toString() : null; jg.writeStringField(COMMENT_MODIFICATION_DATE_FIELD, modificationDate); jg.writeStringField(ANNOTATION_ID, entity.getId()); jg.writeStringField(ANNOTATION_XPATH, entity.getXpath()); if (entity instanceof ExternalEntity) { jg.writeStringField(EXTERNAL_ENTITY_ID, ((ExternalEntity) entity).getEntityId()); jg.writeStringField(EXTERNAL_ENTITY_ORIGIN, ((ExternalEntity) entity).getOrigin()); jg.writeStringField(EXTERNAL_ENTITY, ((ExternalEntity) entity).getEntity()); } }
Source:
<code>boolean diffQuery() throws Exception { Long start = EnvironmentEdgeManager.currentTimeMillis(); Date startDate = Calendar.getInstance().getTime(); String newCSV = queryVerifier.exportCSV(query); boolean verifyResult = queryVerifier.doDiff(query, newCSV); String explainPlan = pUtil.getExplainPlan(query); getThreadTime().getRunTimesInMs().add(new RunTime( verifyResult == true ? PherfConstants.DIFF_PASS : PherfConstants.DIFF_FAIL, explainPlan, startDate, -1L, <START> (int) (EnvironmentEdgeManager.currentTimeMillis() - start), (EnvironmentEdgeManager.currentTimeMillis() - start) >= executionDurationInMs)); <END> return ((EnvironmentEdgeManager.currentTimeMillis() - start) >= executionDurationInMs); }</code><technical_language>long? casting int</technical_language>

Target:
private void diffQuery() throws Exception { Long start = EnvironmentEdgeManager.currentTimeMillis(); Date startDate = Calendar.getInstance().getTime(); String newCSV = queryVerifier.exportCSV(query); boolean verifyResult = queryVerifier.doDiff(query, newCSV); String explainPlan = pUtil.getExplainPlan(query); long elapsedTime = EnvironmentEdgeManager.currentTimeMillis() - start; getThreadTime().getRunTimesInMs().add(new RunTime( verifyResult == true ? PherfConstants.DIFF_PASS : PherfConstants.DIFF_FAIL, explainPlan, startDate, -1L, elapsedTime, !(elapsedTime >= executionDurationInMs))); }
Source:
<code>public @Nullable Converter<ResponseBody, ?> responseBodyConverter( Type type, Annotation[] annotations, Retrofit retrofit) { if (type instanceof Class && ((Class<?>) type).isAnnotationPresent(XmlRootElement.class)) { switch (convertingMediaType) { case XML: <START> return new JaxbXmlResponseConverter<>(contextForType((Class<?>) type), unmarshalProps, (Class<?>) type); <END> case JSON: return new JaxbJsonResponseConverter<>(contextForType((Class<?>) type), unmarshalProps, (Class<?>) type); default: throw new IllegalArgumentException("Unsupported content type: " + convertingMediaType); } } return null; }</code><technical_language>extract contextForType(..) code switch</technical_language>

Target:
public @Nullable Converter<ResponseBody, ?> responseBodyConverter( Type type, Annotation[] annotations, Retrofit retrofit) { JAXBContext context = contextForType((Class<?>) type); if (contentType.equals(XML)) { if (((Class<?>) type).isAnnotationPresent(XmlRootElement.class)) { return new JaxbXmlResponseConverter<>(context, (Class<?>) type); } } else { return new JaxbGenericResponseConverter<>(context, (Class<?>) type); } return null; }
Source:
<code><START> public ImageIcon getImageIcon(int size) { <END> Image image = getImage(size); return (image == null) ? null : new ImageIcon(image); }</code><technical_language>suggestion public @Nullable ImageIcon getImageIcon(int size) {</technical_language>

Target:
public @Nullable ImageIcon getImageIcon(int size) { Image image = getImage(size); return (image == null) ? null : new ImageIcon(image); }
Source:
<code>private Stream<Constraint> addFlowFromLearnedConstraints(ExplodedGraph.Node currentNode) { ExplodedGraph.Node parent = currentNode.parent(); if (parent == null) { return Stream.empty(); } return currentNode.learnedConstraints() <START> .filter(lc -> lc.symbolicValue().equals(symbolicValue) && (lc.constraint == null || domains.stream().anyMatch(d -> d.isAssignableFrom(lc.constraint.getClass())))) <END> .map(LearnedConstraint::constraint) .peek(lc -> learnedConstraintFlow(lc, currentNode, parent).forEach(flow::add)); }</code><technical_language>I domains.stream().anyMatch(d -> d.isAssignableFrom(lc.constraint.getClass()))) deserve a dedicated method. easy hard understand does, a named method more explicit. I direct access field method call. coherent approach, field sv constraint visible here, I change lc.symbolicValue() lc.sv</technical_language>

Target:
private Stream<Constraint> addFlowFromLearnedConstraints(ExplodedGraph.Node currentNode) { ExplodedGraph.Node parent = currentNode.parent(); if (parent == null) { return Stream.empty(); } return currentNode.learnedConstraints() .filter(lc -> lc.symbolicValue().equals(symbolicValue)) .filter(this::learnedConstraintForDomains) .map(LearnedConstraint::constraint) .peek(lc -> learnedConstraintFlow(lc, currentNode, parent).forEach(flow::add)); }
Source:
<code><START> EventStore(Executor streamExecutor, StorageFactory storageFactory, @Nullable Logger logger) { <END> super(); final ERepository eventRepository = new ERepository(); eventRepository.initStorage(storageFactory); this.storage = eventRepository; this.streamExecutor = streamExecutor; this.logger = logger; }</code><technical_language>I understand need this class. is a builder, provides features</technical_language>

Target:
private EventStore(Executor streamExecutor, StorageFactory storageFactory, @Nullable Logger logger) { super(); final ERepository eventRepository = new ERepository(); eventRepository.initStorage(storageFactory); this.storage = eventRepository; this.streamExecutor = streamExecutor; this.logger = logger; }
Source:
<code><START> public static void reEncryptAllFiles(SQLiteDatabase db, String oldKey, String newKey) { <END> final StringBuilder path = new StringBuilder(db.getPath()).append(EXTERNAL_BLOBS_SUFFIX); final File dir = new File(path.toString()); if (dir.exists()) { final File[] tables = dir.listFiles(); if (tables != null) { for (final File table : tables) { final File[] blobs = table.listFiles(); if (blobs != null) { for (final File blob : blobs) { final StringBuilder json = new StringBuilder(); String result; try { final BufferedReader br = new BufferedReader(new FileReader(blob)); String line; while ((line = br.readLine()) != null) { json.append(line).append('\n'); } br.close(); result = Encryptor.legacyDecrypt(json.toString(), oldKey); blob.delete(); final FileOutputStream outputStream = new FileOutputStream(blob, false); outputStream.write(Encryptor.encrypt(result, newKey).getBytes()); outputStream.close(); } catch (IOException ex) { SmartStoreLogger.e(TAG, "Exception occurred while rekeying external files", ex); } } } } } } }</code><technical_language>if this method is called change key (both new encryption scheme)? Instead of calling Encryptor.legacyDecrypt line 519, decide based key length that</technical_language>

Target:
public static synchronized void reEncryptAllFiles(SQLiteDatabase db, String oldKey, String newKey) { final File dir = new File(db.getPath() + EXTERNAL_BLOBS_SUFFIX); if (dir.exists()) { final File[] tables = dir.listFiles(); if (tables != null) { for (final File table : tables) { final File[] blobs = table.listFiles(); if (blobs != null) { for (final File blob : blobs) { final StringBuilder json = new StringBuilder(); String result; try { final BufferedReader br = new BufferedReader(new FileReader(blob)); String line; while ((line = br.readLine()) != null) { json.append(line).append('\n'); } br.close(); if (oldKey.getBytes().length == 24) { result = Encryptor.legacyDecrypt(json.toString(), oldKey); } else { result = Encryptor.decrypt(json.toString(), oldKey); } blob.delete(); final FileOutputStream outputStream = new FileOutputStream(blob, false); outputStream.write(Encryptor.encrypt(result, newKey).getBytes()); outputStream.close(); } catch (IOException ex) { SmartStoreLogger.e(TAG, "Exception occurred while rekeying external files", ex); } } } } } } }
Source:
<code>public void dataCenterWithClusterSelectedItemChanged() { DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster == null) { return; } StoragePool dataCenter = dataCenterWithCluster.getDataCenter(); if (dataCenter == null) { return; } if (dataCenter.getQuotaEnforcementType() != QuotaEnforcementTypeEnum.DISABLED) { getModel().getQuota().setIsAvailable(true); } else { getModel().getQuota().setIsAvailable(false); } getModel().getIsRngEnabled().setIsChangeable(true); setRngAvailability(); <START> getModel().getEmulatedMachine().setIsAvailable(dataCenterWithCluster.getCluster().getCompatibilityVersion().greaterOrEquals(Version.v4_2)); <END> postDataCenterWithClusterSelectedItemChanged(); }</code><technical_language>ideally version this feature is supported configurable similar e.g. VmLeasesSupported (meaning in vdc_options in ConfigurationValues - hide fields disable a msg guide user changed. is done like: getModel().getEmulatedMachine().updateChangeability(ConfigurationValues.MoreEmulatedMachinesSupported, dataCenterWithCluster.getCluster().getCompatibilityVersion());</technical_language>

Target:
public void dataCenterWithClusterSelectedItemChanged() { DataCenterWithCluster dataCenterWithCluster = getModel().getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster == null) { return; } StoragePool dataCenter = dataCenterWithCluster.getDataCenter(); if (dataCenter == null) { return; } if (dataCenter.getQuotaEnforcementType() != QuotaEnforcementTypeEnum.DISABLED) { getModel().getQuota().setIsAvailable(true); } else { getModel().getQuota().setIsAvailable(false); } getModel().getIsRngEnabled().setIsChangeable(true); setRngAvailability(); getModel().getEmulatedMachine().updateChangeability(ConfigurationValues.Q35EmulatedMachineSupported, dataCenterWithCluster.getCluster().getCompatibilityVersion()); updateEmulatedMachines(); postDataCenterWithClusterSelectedItemChanged(); }
Source:
<code>public static Chain decode(byte[] payload) { final List<Element> elements = new ArrayList<Element>(); if (payload.length != 0) { ByteBuffer buffer = ByteBuffer.wrap(payload); boolean isSequenced = buffer.get() == 1; if (isSequenced) { while (buffer.hasRemaining()) { final long sequence = buffer.getLong(); int payloadSize = buffer.getInt(); buffer.limit(buffer.position() + payloadSize); final ByteBuffer elementPayload = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); elements.add(new SequencedElement() { @Override public long getSequenceNumber() { return sequence; } @Override public ByteBuffer getPayload() { return elementPayload.duplicate(); } }); } } else { while (buffer.hasRemaining()) { int payloadSize = buffer.getInt(); buffer.limit(buffer.position() + payloadSize); final ByteBuffer elementPayload = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); elements.add(new Element() { @Override public ByteBuffer getPayload() { return elementPayload.duplicate(); } }); } } } <START> return new Chain() { <END> final List<Element> elementList = Collections.unmodifiableList(elements); @Override public Iterator<Element> reverseIterator() { return Util.reverseIterator(elementList); } @Override public boolean isEmpty() { return elementList.isEmpty(); } @Override public Iterator<Element> iterator() { return elementList.iterator(); } }; }</code><technical_language>time I inline immutable on-heap Chain implementation (in builder too?), please consider extracting external class re-use it</technical_language>

Target:
public static Chain decode(byte[] payload) { final List<Element> elements = new ArrayList<Element>(); if (payload.length != 0) { ByteBuffer buffer = ByteBuffer.wrap(payload); boolean isSequenced = buffer.get() == 1; if (isSequenced) { while (buffer.hasRemaining()) { long sequence = buffer.getLong(); int payloadSize = buffer.getInt(); buffer.limit(buffer.position() + payloadSize); ByteBuffer elementPayload = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); elements.add(getElement(sequence, elementPayload)); } } else { while (buffer.hasRemaining()) { int payloadSize = buffer.getInt(); buffer.limit(buffer.position() + payloadSize); ByteBuffer elementPayload = buffer.slice(); buffer.position(buffer.limit()); buffer.limit(buffer.capacity()); elements.add(getElement(elementPayload)); } } } return getChain(elements); }
Source:
<code>public T getRecordForValues(String[] rawFieldNames, Object[] values) throws NoSuchElementException, InvalidIndexException { Pair<String, String[]> whereClause = helper.createWhere(rawFieldNames, values, em, t); Cursor c = helper.getHandle().query(table, new String[]{DatabaseHelper.ID_COL, DatabaseHelper.DATA_COL}, whereClause.first, whereClause.second, null, null, null); if (c.getCount() == 0) { throw new NoSuchElementException("No element in table " + table + " with names " + rawFieldNames + " and values " + values.toString()); } if (c.getCount() > 1) { throw new InvalidIndexException("Invalid unique column set" + rawFieldNames + ". Multiple records found with value " + values.toString(), rawFieldNames.toString()); } c.moveToFirst(); byte[] data = c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL)); int dbId = c.getInt(c.getColumnIndexOrThrow(DatabaseHelper.ID_COL)); c.close(); <START> return newObject(data, dbId); <END> }</code><technical_language>prefer move newObject code in form this class change this class functions in general. This a snapshot of a procedural generation/translation process sketch for changes process time, cleaner for code represent legacy object do</technical_language>

Target:
public T getRecordForValues(String[] rawFieldNames, Object[] values) throws NoSuchElementException, InvalidIndexException { Pair<String, String[]> whereClause = helper.createWhere(rawFieldNames, values, em, t); Cursor c = helper.getHandle().query(table, new String[]{DatabaseHelper.ID_COL, DatabaseHelper.DATA_COL}, whereClause.first, whereClause.second, null, null, null); if (c.getCount() == 0) { throw new NoSuchElementException("No element in table " + table + " with names " + rawFieldNames + " and values " + values.toString()); } if (c.getCount() > 1) { throw new InvalidIndexException("Invalid unique column set" + rawFieldNames + ". Multiple records found with value " + values.toString(), rawFieldNames.toString()); } c.moveToFirst(); byte[] data = c.getBlob(c.getColumnIndexOrThrow(DatabaseHelper.DATA_COL)); c.close(); return newObject(data); }
Source:
<code>public Matrix outerProduct(Vector vector, Factory factory) { if (vector == null) { throw new IllegalArgumentException("Vector can't be null."); } <START> if (factory == null) { <END> throw new IllegalArgumentException("Factory can't be null."); } if (length != vector.length()) { throw new IllegalArgumentException("Wrong vector length: " + vector.length()); } Matrix result = factory.createSquareMatrix(length); for (int i = 0; i < length; i++) { for (int j = 0; j < length; j++) { result.set(i, j, get(i) * vector.get(j)); } } return result; }</code><technical_language>call ensureFactoryIsNotNull(factory) instead, please. statement in method</technical_language>

Target:
public Matrix outerProduct(Vector vector, Factory factory) { ensureFactoryIsNotNull(factory); if (vector == null) { throw new IllegalArgumentException("Vector can't be null."); } int otherLength = vector.length(); Matrix result = factory.createMatrix(length, otherLength); for (int i = 0; i < length; i++) { for (int j = 0; j < otherLength; j++) { result.set(i, j, get(i) * vector.get(j)); } } return result; }
Source:
<code>public Mono<Void> handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); <START> Assert.notNull(message.getPayload(), "Message payload must not be null"); END> if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } org.springframework.integration.support.management.MetricsContext start = null; SampleFacade sample = null; if (this.countsEnabled && this.metricsCaptor != null) { sample = this.metricsCaptor.start(); } try { if (this.shouldTrack) { message = MessageHistory.write(message, this, getMessageBuilderFactory()); } return handleMessageInternal(message); } catch (Exception e) { if (sample != null) { sample.stop(buildSendTimer(false, e.getClass().getSimpleName())); } if (this.countsEnabled) { this.handlerMetrics.afterHandle(start, false); } throw IntegrationUtils.wrapInHandlingExceptionIfNecessary(message, () -> "error occurred in message handler [" + this + "]", e); } }</code><technical_language>This is impossible: is Message impl payload is null. I this assert is redundant</technical_language>

Target:
public Mono<Void> handleMessage(Message<?> message) { Assert.notNull(message, "Message must not be null"); if (this.loggingEnabled && this.logger.isDebugEnabled()) { this.logger.debug(this + " received message: " + message); } if (this.shouldTrack) { message = MessageHistory.write(message, this, getMessageBuilderFactory()); } final Message<?> msg = message; return handleMessageInternal(msg) .doOnError(e -> this.logger.error( "An error occurred in message handler [" + this + "] on message [" + msg + "]", e)); }
Source:
<code><START> public void setParent(Segment<?> parent) { <END> this.parent = parent; }</code><technical_language>this need public</technical_language>

Target:
void setParent(Segment<?> parent) { this.parent = parent; }
Source:
<code>public List<SourceFile> downloadDescriptors(String entry, String descriptor, File tempDir) { String[] parts = entry.split(":"); String path = parts[0]; String version = (parts.length > 1) ? parts[1] : "master"; Workflow workflow = getDockstoreWorkflow(path); List<SourceFile> result = new ArrayList<>(); if (workflow != null) { try { List<SourceFile> files; if (descriptor.toLowerCase().equals("cwl")) { files = workflowsApi.secondaryCwl(workflow.getId(), version); <START> } else if (descriptor.toLowerCase().equals("wdl")) { <END> files = workflowsApi.secondaryWdl(workflow.getId(), version); } else { throw new UnsupportedOperationException("other languages not supported yet"); } writeSourceFilesToDisk(tempDir, result, files); } catch (ApiException e) { exceptionMessage(e, "Error getting file(s) from server", Client.API_ERROR); } catch (IOException e) { exceptionMessage(e, "Error writing to File", Client.IO_ERROR); } } return result; }</code><technical_language>WDL_STRING CWL_STRING</technical_language>

Target:
public List<SourceFile> downloadDescriptors(String entry, String descriptor, File tempDir) { String[] parts = entry.split(":"); String path = parts[0]; String version = (parts.length > 1) ? parts[1] : "master"; Workflow workflow = getDockstoreWorkflow(path); List<SourceFile> result = new ArrayList<>(); if (workflow != null) { try { List<SourceFile> files; if (descriptor.toLowerCase().equals(CWL_STRING)) { files = workflowsApi.secondaryCwl(workflow.getId(), version); } else if (descriptor.toLowerCase().equals(WDL_STRING)) { files = workflowsApi.secondaryWdl(workflow.getId(), version); } else { throw new UnsupportedOperationException("other languages not supported yet"); } writeSourceFilesToDisk(tempDir, result, files); } catch (ApiException e) { exceptionMessage(e, "Error getting file(s) from server", Client.API_ERROR); } catch (IOException e) { exceptionMessage(e, "Error writing to File", Client.IO_ERROR); } } return result; }
Source:
<code>public void verifyCIDRValue() { final IpValue ipValue = new IpValue("10.0.0.5,192.168.0.0/24"); for (IPAddress ipAddress : new IPAddressRange("192.168.0.0", "192.168.0.255")) { assertThat(ipValue.isInRange(ipAddress.toUserString()), is(true)); } <START> assertThat(ipValue.isInRange("10.0.0.5"), is(false)); <END> }</code><technical_language>this true? is of ipValue declaration</technical_language>

Target:
public void verifyCIDRValue() { final IpValue ipValue = new IpValue("10.0.0.5,192.168.0.0/24"); for (IPAddress ipAddress : new IPAddressRange("192.168.0.0", "192.168.0.255")) { assertThat(ipValue.isInRange(ipAddress.toUserString()), is(true)); } assertThat(ipValue.isInRange("192.168.1.0"), is(false)); assertThat(ipValue.isInRange("192.168.2.0"), is(false)); assertThat(ipValue.isInRange("10.0.0.0"), is(false)); assertThat(ipValue.isInRange("10.0.0.1"), is(false)); assertThat(ipValue.isInRange("10.0.0.2"), is(false)); assertThat(ipValue.isInRange("10.0.0.3"), is(false)); assertThat(ipValue.isInRange("10.0.0.4"), is(false)); assertThat(ipValue.isInRange("10.0.0.5"), is(true)); assertThat(ipValue.isInRange("10.0.0.7"), is(false)); assertThat(ipValue.isInRange("10.0.0.8"), is(false)); assertThat(ipValue.isInRange("10.0.0.9"), is(false)); assertThat(ipValue.isInRange("10.0.0.10"), is(false)); }