auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void logInvalidFileNameFormat(String cur) { LOGGER.warn("Invalid file name format for mount-table version file: " + cur + ". The valid file name format is " <START> + "mount-table-name.<versionNumber>.xml"); <END> }</code><technical_language>more precisely, versionNumber is a monotonically increasing integer</technical_language>

Target:
private void logInvalidFileNameFormat(String cur) { LOGGER.warn("Invalid file name format for mount-table version file: {}. " + "The valid file name format is mount-table-name.<versionNumber>.xml", cur); }
Source:
<code>public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options) { String uploadId = UUID.randomUUID().toString(); <START> Blob blob = blobBuilder(MULTIPART_PREFIX + uploadId + "-" + blobMetadata.getName() + "-0").payload(ByteSource.empty()).build(); <END> putBlob(container, blob); return MultipartUpload.create(container, blobMetadata.getName(), uploadId, blobMetadata, options); }</code><technical_language>0 confusing. -stub maybe</technical_language>

Target:
public MultipartUpload initiateMultipartUpload(String container, BlobMetadata blobMetadata, PutOptions options) { String uploadId = UUID.randomUUID().toString(); Blob blob = blobBuilder(MULTIPART_PREFIX + uploadId + "-" + blobMetadata.getName() + "-stub").payload(ByteSource.empty()).build(); putBlob(container, blob); return MultipartUpload.create(container, blobMetadata.getName(), uploadId, blobMetadata, options); }
Source:
<code>public void increaseCapacity() { int created = 1; boolean create = true; while (create && !pool.isFull()) { if (pool.isShutdown()) { return; } int currentSize = listeners.size(); create = pool.getCapacity().getIncrementer() .shouldCreate(currentSize, pool.getConfiguration().getMaxSize(), created); if (create) { try { ConnectionListener cl = pool.createConnectionListener(credential, this); if (Tracer.isEnabled()) <START> Tracer.createConnectionListener(pool.getType(), this, cl, cl.getManagedConnection(), false, false, <END> true, Tracer.isRecordCallstacks() ? new Throwable("CALLSTACK") : null); boolean added = false; if (listeners.size() < pool.getConfiguration().getMaxSize()) { listeners.add(cl); created++; added = true; } if (!added) { if (Tracer.isEnabled()) Tracer.destroyConnectionListener(pool.getType(), this, cl, false, false, true, false, false, false, true, Tracer.isRecordCallstacks() ? new Throwable("CALLSTACK") : null); pool.destroyConnectionListener(cl); return; } } catch (ResourceException re) { return; } } } }</code><technical_language>is getId() of pool -- other Tracer invocations</technical_language>

Target:
public void increaseCapacity() { if (!credential.equals(pool.getPrefillCredential())) return; int created = 1; boolean create = true; while (create && !pool.isFull()) { if (pool.isShutdown()) { return; } int currentSize = listeners.size(); create = pool.getCapacity().getIncrementer() .shouldCreate(currentSize, pool.getConfiguration().getMaxSize(), created); if (create) { try { ConnectionListener cl = pool.createConnectionListener(credential, this); if (Tracer.isEnabled()) Tracer.createConnectionListener(pool.getConfiguration().getId(), this, cl, cl.getManagedConnection(), false, false, true, Tracer.isRecordCallstacks() ? new Throwable("CALLSTACK") : null); boolean added = false; if (listeners.size() < pool.getConfiguration().getMaxSize()) { listeners.add(cl); created++; added = true; } if (!added) { if (Tracer.isEnabled()) Tracer.destroyConnectionListener(pool.getConfiguration().getId(), this, cl, false, false, true, false, false, false, true, Tracer.isRecordCallstacks() ? new Throwable("CALLSTACK") : null); pool.destroyConnectionListener(cl); return; } } catch (ResourceException re) { return; } } } }
Source:
<code>public Query build() { String entityName = entityClass.getCanonicalName(); String entityAlias = FilterPredicate.getTypeAlias(entityClass); Query query; if (filterExpression.isPresent()) { PredicateExtractionVisitor extractor = new PredicateExtractionVisitor(); Collection<FilterPredicate> predicates = filterExpression.get().accept(extractor); String filterClause = new HQLFilterOperation().apply(filterExpression.get(), true); String joinClause = getJoinClauseFromFilters(filterExpression.get()); query = session.createQuery( SELECT + entityAlias + FROM + entityName + AS + entityAlias + SPACE + joinClause + SPACE + filterClause + SPACE <START> + getSortClause(sorting, entityClass, true) <END> ); supplyFilterQueryParameters(query, predicates); } else { query = session.createQuery(SELECT + entityAlias + FROM + entityName + AS + entityAlias + SPACE + getSortClause(sorting, entityClass, true)); } addPaginationToQuery(query); return query; }</code><technical_language>problem true/false parameters, check doc method this means. is new this PR</technical_language>

Target:
public Query build() { String entityName = entityClass.getCanonicalName(); String entityAlias = FilterPredicate.getTypeAlias(entityClass); Query query; if (filterExpression.isPresent()) { PredicateExtractionVisitor extractor = new PredicateExtractionVisitor(); Collection<FilterPredicate> predicates = filterExpression.get().accept(extractor); String filterClause = new HQLFilterOperation().apply(filterExpression.get(), true); String joinClause = getJoinClauseFromFilters(filterExpression.get()); query = session.createQuery( SELECT + entityAlias + FROM + entityName + AS + entityAlias + SPACE + joinClause + SPACE + filterClause + SPACE + getSortClause(sorting, entityClass, USE_ALIAS) ); supplyFilterQueryParameters(query, predicates); } else { query = session.createQuery(SELECT + entityAlias + FROM + entityName + AS + entityAlias + SPACE + getSortClause(sorting, entityClass, USE_ALIAS)); } addPaginationToQuery(query); return query; }
Source:
<code>public boolean tryLock(Set<T> ids) throws InterruptedException { synchronized (locked) { List<T> orderedIds = ordering.sortedCopy(ids); <START> idsLocked.update(ids.size()); <END> for (T id : orderedIds) { if (!tryLock(id)) { unlockTill(orderedIds, id); return false; } } return true; } }</code><technical_language>This happen synchronized block. is a performance cost running a synchronized (mutual exclusion) block thread run code in a time good practice is run need synchronized in it</technical_language>

Target:
public boolean tryLock(Set<T> ids) throws InterruptedException { threadsLocked.inc(); try { idsLocked.update(ids.size()); List<T> orderedIds = ordering.sortedCopy(ids); for (T id : orderedIds) { if(!tryLockInternal(id)) { unlockTill(orderedIds, id); return false; } } return true; } finally { threadsLocked.dec(); } }
Source:
<code>String getParcelableCode(Context context, String className, String classToExtend, Map<String, ExecutableElement> properties) { validateProperties(context.processingEnvironment(), properties); Map<String, TypeName> types = convertPropertiesToTypes(properties); FieldSpec classLoader = FieldSpec .builder(ClassName.get(ClassLoader.class), "CL", Modifier.PRIVATE, Modifier.FINAL, Modifier.STATIC) <START> .initializer("$N.class.getClassLoader()", className) <END> .build(); MethodSpec constructor = generateConstructor(types); MethodSpec parcelConstructor = generateParcelConstructor(types, classLoader); MethodSpec writeToParcel = generateWriteToParcel(types); MethodSpec describeContents = generateDescribeContents(); FieldSpec creator = generateCreator(className, classLoader); TypeSpec subclass = TypeSpec.classBuilder(className) .addModifiers(Modifier.FINAL) .superclass(TypeVariableName.get(classToExtend)) .addMethod(constructor) .addField(classLoader) .addField(creator) .addMethod(writeToParcel) .addMethod(describeContents) .addMethod(parcelConstructor) .build(); JavaFile javaFile = JavaFile.builder(context.packageName(), subclass).build(); return javaFile.toString(); }</code><technical_language>Unrelated: I want $T in case a name clash of classes</technical_language>

Target:
String getParcelableCode(Context context, String className, String classToExtend, Map<String, ExecutableElement> properties) { validateProperties(context.processingEnvironment(), properties); Map<String, TypeName> types = convertPropertiesToTypes(properties); FieldSpec classLoader = FieldSpec .builder(ClassName.get(ClassLoader.class), "CL", Modifier.PRIVATE, Modifier.FINAL, Modifier.STATIC) .initializer("$T.class.getClassLoader()", className) .build(); MethodSpec constructor = generateConstructor(types); MethodSpec parcelConstructor = generateParcelConstructor(types, classLoader); MethodSpec writeToParcel = generateWriteToParcel(types); MethodSpec describeContents = generateDescribeContents(); FieldSpec creator = generateCreator(className, classLoader); TypeSpec subclass = TypeSpec.classBuilder(className) .addModifiers(Modifier.FINAL) .superclass(TypeVariableName.get(classToExtend)) .addMethod(constructor) .addField(classLoader) .addField(creator) .addMethod(writeToParcel) .addMethod(describeContents) .addMethod(parcelConstructor) .build(); JavaFile javaFile = JavaFile.builder(context.packageName(), subclass).build(); return javaFile.toString(); }
Source:
<code>protected void verify_internal_effects() { assertThat(iterablesBefore).isNotSameAs(getIterables(assertions)); <START> assertThat(getIterables(assertions).getComparisonStrategy() instanceof ComparatorBasedComparisonStrategy).isTrue(); <END> assertThat(getObjects(assertions).getComparisonStrategy() instanceof IterableElementComparisonStrategy).isTrue(); }</code><technical_language>a more specific assertion: assertThat(getIterables(assertions).getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class);</technical_language>

Target:
protected void verify_internal_effects() { assertThat(iterablesBefore).isNotSameAs(getIterables(assertions)); assertThat(getIterables(assertions).getComparisonStrategy()).isInstanceOf(ComparatorBasedComparisonStrategy.class); assertThat(getObjects(assertions).getComparisonStrategy()).isInstanceOf(IterableElementComparisonStrategy.class); }
Source:
<code>public void setServerName(String serverName) { if (serverName == null || serverName.equals("")) { this.serverNames = new String[] {"localhost"}; } else { this.serverNames = new String[] {serverName}; <START> } <END> }</code><technical_language>allocate a new array? created array; set array element</technical_language>

Target:
public void setServerName(String serverName) { this.setServerNames(new String[] { serverName }); }
Source:
<code>private void handlePathRequest(SlingHttpServletRequest request, SlingHttpServletResponse response, DumplibsParams p) throws IOException { HtmlLibrary lib = libraryManager.getLibrary(p.getType(), p.getPath()); try { <START> JSONObject libJSON = htmlLibraryToJSON(lib); END> response.setContentType(CONTENT_TYPE_JSON); response.getWriter().print(libJSON.toString()); } catch (JSONException e) { log.error("JSON Exception while building ClientLib JSON for clientlib path:" + p.getPath(), e.getMessage()); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } }</code><technical_language>Sling JSON is deprecated :( .. moving GSON (which is provided AEM) Sling Model Exporter + Jackson .. i assume this easier switch GSON SME</technical_language>

Target:
private void handlePathRequest(SlingHttpServletRequest request, SlingHttpServletResponse response, DumplibsParams p) throws IOException { HtmlLibrary lib = libraryManager.getLibrary(p.getType(), p.getPath()); response.setContentType(CONTENT_TYPE_JSON); JsonObject jsonObject = lib == null ? new JsonObject() : (JsonObject) htmlLibraryToJSON(lib); response.getWriter().print(jsonObject.toString()); }
Source:
<code><START> void setOnTop() { <END> System.out.println("set on top!!"); setAlwaysOnTop(false); repaint(); setAlwaysOnTop(true); repaint(); }</code><technical_language>is this necessay? is called 20ms! is sufficient set top once</technical_language>

Target:
void setOnTop() { setAlwaysOnTop(false); repaint(); setAlwaysOnTop(true); repaint(); }
Source:
<code>protected String getSubnetBadFormatMessage() { return isPrefixSupported ? ConstantsManager.getInstance() .getConstants() .thisFieldMustContainSubnetFormatAsNetmaskOrPrefixMsg() : ConstantsManager.getInstance() .getConstants() <START> .thisFieldMustContainSubnetFormatAsNetmaskOrPrefixFreeMsg(); <END> }</code><technical_language>"PrefixFree", "thisFieldMustContainSubnetFormatAsNetmask"</technical_language>

Target:
protected String getSubnetBadFormatMessage() { return isPrefixSupported ? ConstantsManager.getInstance() .getConstants() .thisFieldMustContainValidMask() : ConstantsManager.getInstance() .getConstants() .thisFieldMustContainValidNetmask(); }
Source:
<code>public void deleteOne() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, child1).withName("Collection 1").build(); Item publicItem1 = ItemBuilder.createItem(context, col1) .withTitle("Test") .withIssueDate("2010-10-17") .withAuthor("Smith, Donald") .withSubject("ExtraEntry") .build(); String bitstreamContent = "ThisIsSomeDummyText"; Bitstream bitstream = null; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { bitstream = BitstreamBuilder. createBitstream(context, publicItem1, is) .withName("Bitstream") .withDescription("Description") .withMimeType("text/plain") .build(); } <START> getClient().perform(get("/api/core/bitstreams/" + bitstream.getID())) <END> .andExpect(status().is2xxSuccessful()); getClient().perform(delete("/api/core/bitstreams/" + bitstream.getID())) .andExpect(status().is2xxSuccessful()); getClient().perform(get("/api/core/bitstreams/" + bitstream.getID())) .andExpect(status().isNotFound()); }</code><technical_language>This is necessary creation is done API REST API</technical_language>

Target:
public void deleteOne() throws Exception { context.turnOffAuthorisationSystem(); parentCommunity = CommunityBuilder.createCommunity(context) .withName("Parent Community") .build(); Community child1 = CommunityBuilder.createSubCommunity(context, parentCommunity) .withName("Sub Community") .build(); Collection col1 = CollectionBuilder.createCollection(context, child1).withName("Collection 1").build(); Item publicItem1 = ItemBuilder.createItem(context, col1) .withTitle("Test") .withIssueDate("2010-10-17") .withAuthor("Smith, Donald") .withSubject("ExtraEntry") .build(); String bitstreamContent = "ThisIsSomeDummyText"; Bitstream bitstream = null; try (InputStream is = IOUtils.toInputStream(bitstreamContent, CharEncoding.UTF_8)) { bitstream = BitstreamBuilder. createBitstream(context, publicItem1, is) .withName("Bitstream") .withDescription("Description") .withMimeType("text/plain") .build(); } makeUserAdmin(); String token = getAuthToken(eperson.getEmail(), password); getClient(token).perform(delete("/api/core/bitstreams/" + bitstream.getID())) .andExpect(status().is(204)); getClient().perform(get("/api/core/bitstreams/" + bitstream.getID())) .andExpect(status().isNotFound()); }
Source:
<code>Map<Sprite, List<V>> cloneForScene(Scene scene, Map<K, List<V>> dataMap) { Map<Sprite, List<V>> clonedList = new HashMap<>(); for (Map.Entry<K, List<V>> entry : dataMap.entrySet()) { List<V> newList = new ArrayList<>(); for (V data : entry.getValue()) { newList.add(newInstance(getDataName(data))); } <START> if (entry.getKey() == null) { <END> continue; } String keyName = getKeyName(entry.getKey()); Sprite clonedInstance = scene.getSpriteBySpriteName(keyName); clonedList.put(clonedInstance, newList); } return clonedList; }</code><technical_language>this happen? checking cloning list</technical_language>

Target:
Map<Sprite, List<V>> cloneForScene(Scene scene, Map<K, List<V>> dataMap) { Map<Sprite, List<V>> clonedMap = new HashMap<>(); for (Map.Entry<K, List<V>> entry : dataMap.entrySet()) { List<V> newList = new ArrayList<>(); for (V data : entry.getValue()) { newList.add(newInstance(getDataName(data))); } String keyName = getKeyName(entry.getKey()); Sprite clonedInstanceOnStage = scene.getSpriteBySpriteName(keyName); clonedMap.put(clonedInstanceOnStage, newList); } return clonedMap; }
Source:
<code><START> public boolean isEosEnabled() { <END> return StreamsConfig.EXACTLY_ONCE.equals(config.getString(StreamsConfig.PROCESSING_GUARANTEE_CONFIG)); }</code><technical_language>q: benefit of checking config flag time time initialization</technical_language>

Target:
public boolean isEosEnabled() { return eosEnabled; }
Source:
<code>public void testSelectiveRequestAggregation() { HttpObjectAggregator myPostAggregator = new HttpObjectAggregator(1024 * 1024) { @Override protected boolean isStartMessage(HttpObject msg) throws Exception { if (msg instanceof HttpRequest) { HttpRequest request = (HttpRequest) msg; HttpMethod method = request.method(); if (method.equals(HttpMethod.POST)) { return true; } } return false; } }; EmbeddedChannel channel = new EmbeddedChannel(myPostAggregator); HttpRequest request1 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/"); HttpContent content1 = new DefaultHttpContent(Unpooled.copiedBuffer("Hello, World!", CharsetUtil.UTF_8)); request1.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN); <START> channel.writeInbound(request1, content1, LastHttpContent.EMPTY_LAST_CONTENT); <END> Object msg1 = channel.readInbound(); assertTrue(msg1 instanceof FullHttpRequest); HttpRequest request2 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.PUT, "/"); HttpContent content2 = new DefaultHttpContent(Unpooled.copiedBuffer("Hello, World!", CharsetUtil.UTF_8)); request2.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN); channel.writeInbound(request2, content2, LastHttpContent.EMPTY_LAST_CONTENT); assertSame(request2, channel.readInbound()); assertSame(content2, channel.readInbound()); assertSame(LastHttpContent.EMPTY_LAST_CONTENT, channel.readInbound()); }</code><technical_language>assert return</technical_language>

Target:
public void testSelectiveRequestAggregation() { HttpObjectAggregator myPostAggregator = new HttpObjectAggregator(1024 * 1024) { @Override protected boolean isStartMessage(HttpObject msg) throws Exception { if (msg instanceof HttpRequest) { HttpRequest request = (HttpRequest) msg; HttpMethod method = request.method(); if (method.equals(HttpMethod.POST)) { return true; } } return false; } }; EmbeddedChannel channel = new EmbeddedChannel(myPostAggregator); try { HttpRequest request1 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.POST, "/"); HttpContent content1 = new DefaultHttpContent(Unpooled.copiedBuffer("Hello, World!", CharsetUtil.UTF_8)); request1.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN); assertTrue(channel.writeInbound(request1, content1, LastHttpContent.EMPTY_LAST_CONTENT)); Object msg1 = channel.readInbound(); try { assertTrue(msg1 instanceof FullHttpRequest); } finally { ReferenceCountUtil.release(msg1); } HttpRequest request2 = new DefaultHttpRequest(HttpVersion.HTTP_1_1, HttpMethod.PUT, "/"); HttpContent content2 = new DefaultHttpContent(Unpooled.copiedBuffer("Hello, World!", CharsetUtil.UTF_8)); request2.headers().set(HttpHeaderNames.CONTENT_TYPE, HttpHeaderValues.TEXT_PLAIN); try { assertTrue(channel.writeInbound(request2, content2, LastHttpContent.EMPTY_LAST_CONTENT)); assertSame(request2, channel.readInbound()); assertSame(content2, channel.readInbound()); assertSame(LastHttpContent.EMPTY_LAST_CONTENT, channel.readInbound()); } finally { ReferenceCountUtil.release(request2); ReferenceCountUtil.release(content2); } assertFalse(channel.finish()); } finally { channel.close(); } }
Source:
<code>public void addToDate_shouldAddSecondsWhenUnitIsSeconds() throws ParseException { Duration duration = new Duration(30, Duration.SNOMED_CT_SECONDS_CODE); Date autoExpireDate = duration.addToDate(createDateTime("2014-07-01 10-00-00"), null); <START> assertEquals(createDateTime("2014-07-01 10-00-29.999"), autoExpireDate); <END> }</code><technical_language>Convention is : separator hour:minute:second. :-)</technical_language>

Target:
public void addToDate_shouldAddSecondsWhenUnitIsSeconds() throws ParseException { Duration duration = new Duration(30, Duration.SNOMED_CT_SECONDS_CODE); Date autoExpireDate = duration.addToDate(createDateTime("2014-07-01 10:00:00"), null); assertEquals(createDateTime("2014-07-01 10:00:30"), autoExpireDate); }
Source:
<code>public Long getMegaByteMillis() { if (jobHistoryListener == null ) { LOG.error("Cannot call getMegaByteMillis before parsing the history file!"); return Constants.NOTFOUND_VALUE; } <START> Long mapSlotMillis = jobHistoryListener.getJobDetails().getMapSlotMillis(); <END> Long reduceSlotMillis = jobHistoryListener.getJobDetails().getReduceSlotMillis(); if (jobConf == null) { throw new ProcessingException("JobConf is null, cannot calculate megabytemillis"); } Long xmx75 = getXmxValue(jobConf.get(Constants.JAVA_CHILD_OPTS_CONF_KEY)); if (xmx75 == 0L) { xmx75 = Constants.DEFAULT_XMX_SETTING; LOG.info("Xmx value is 0, now presuming default Xmx size " + Constants.DEFAULT_XMX_SETTING); } Long xmxTotal = getXmxTotal(xmx75); LOG.trace("\n Xmx " + xmxTotal + ": " + mapSlotMillis + " \n " + ": " + reduceSlotMillis + " \n "); Long mbMillis = xmxTotal * mapSlotMillis + xmxTotal * reduceSlotMillis; return mbMillis; }</code><technical_language>Long -> long</technical_language>

Target:
public Long getMegaByteMillis() { if (jobHistoryListener == null ) { LOG.error("Cannot call getMegaByteMillis before parsing the history file!"); return Constants.NOTFOUND_VALUE; } long mapSlotMillis = jobHistoryListener.getJobDetails().getMapSlotMillis(); long reduceSlotMillis = jobHistoryListener.getJobDetails().getReduceSlotMillis(); if (jobConf == null) { throw new ProcessingException("JobConf is null, cannot calculate megabytemillis"); } long xmx75 = getXmxValue(jobConf.get(Constants.JAVA_CHILD_OPTS_CONF_KEY)); if (xmx75 == 0L) { xmx75 = Constants.DEFAULT_XMX_SETTING; LOG.info("Xmx value is 0, now presuming default Xmx size " + Constants.DEFAULT_XMX_SETTING); } long xmxTotal = getXmxTotal(xmx75); LOG.trace("\n Xmx " + xmxTotal + ": " + mapSlotMillis + " \n " + ": " + reduceSlotMillis + " \n "); Long mbMillis = xmxTotal * mapSlotMillis + xmxTotal * reduceSlotMillis; return mbMillis; }
Source:
<code>public boolean tick() { profiler.startSection("providerTick"); long i = System.currentTimeMillis(); int randomTickSpeed = this.world.getGameRules().getInt("randomTickSpeed"); boolean doMobSpawning = this.world.getGameRules().getBoolean("doMobSpawning"); boolean isRaining = this.world.isRaining(); boolean isThundering = this.world.isThundering(); Random rand = this.world.rand; PlayerCubeMap playerCubeMap = ((PlayerCubeMap) this.world.getPlayerChunkMap()); Iterator<Cube> watchersIterator = playerCubeMap.getCubeIterator(); while (watchersIterator.hasNext()) { Cube cube = watchersIterator.next(); cube.tickCubeServer(() -> System.currentTimeMillis() - i > 40, rand); this.profiler.startSection("thunder"); <START> if (this.world.provider.canDoLightning((Chunk) cube.getColumn()) && isRaining && isThundering && rand.nextInt(100000) == 0) <END> cube.updateThunder(this.world, rand, doMobSpawning); this.profiler.endStartSection("iceandsnow"); if (this.world.provider.canDoRainSnowIce((Chunk) cube.getColumn()) && rand.nextInt(16) == 0) cube.updateRainSnowIce(this.world, this, rand, isRaining); this.profiler.endStartSection("randomTick"); int randomTickCounter = randomTickSpeed; while (randomTickCounter-- > 0) cube.randomTick(this.world, rand); this.profiler.endSection(); } profiler.endSection(); return false; }</code><technical_language>of this, more efficient iterate columns, do column checks iterate ove rall cubes in column. Especially modded WorldProviders allowed, arbitrary logic in methods. easy checks (isRaining isThundering randint). I this is vanilla does, this improvement is essentially free here</technical_language>

Target:
public boolean tick() { profiler.startSection("providerTick"); long i = System.currentTimeMillis(); int randomTickSpeed = this.world.getGameRules().getInt("randomTickSpeed"); Random rand = this.world.rand; PlayerCubeMap playerCubeMap = ((PlayerCubeMap) this.world.getPlayerChunkMap()); Iterator<Cube> watchersIterator = playerCubeMap.getCubeIterator(); while (watchersIterator.hasNext()) { Cube cube = watchersIterator.next(); cube.tickCubeServer(() -> System.currentTimeMillis() - i > 40, rand); if (!doRandomBlockTicksHere) continue; int randomTickCounter = randomTickSpeed; while (randomTickCounter-- > 0) cube.randomTick(this.world, rand); } profiler.endSection(); return false; }
Source:
<code>public double getMaxSpeed(RoadClass roadClass, TransportationMode transport, double currentMaxSpeed) { if (currentMaxSpeed > 0 || transport != TransportationMode.MOTOR_VEHICLE) { return currentMaxSpeed; } switch (roadClass) { case MOTORWAY: case TRUNK: <START> return Integer.MAX_VALUE; <END> case PRIMARY: return 100; case SECONDARY: return 100; case TERTIARY: return 100; case UNCLASSIFIED: return 100; case RESIDENTIAL: return 100; case LIVING_STREET: return 4; default: return -1; } }</code><technical_language>compatible MaxSpeed EncodedValue return MaxSpeed.UNLIMITED_SIGN_SPEED</technical_language>

Target:
public double getMaxSpeed(RoadClass roadClass, TransportationMode transport, double currentMaxSpeed) { if (currentMaxSpeed > 0 || transport != TransportationMode.MOTOR_VEHICLE) { return currentMaxSpeed; } switch (roadClass) { case MOTORWAY: case TRUNK: return MaxSpeed.UNLIMITED_SIGN_SPEED; case PRIMARY: return 100; case SECONDARY: return 100; case TERTIARY: return 100; case UNCLASSIFIED: return 100; case RESIDENTIAL: return 100; case LIVING_STREET: return 4; default: return -1; } }
Source:
<code>public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mAllergenDao = Utils.getAppDaoSession(getActivity()).getAllergenDao(); mAllergensFromDao = mAllergenDao.loadAll(); api = new OpenFoodAPIClient(getActivity()); mView = view; mSettings = getActivity().getSharedPreferences("prefs", 0); boolean firstRunAlert = mSettings.getBoolean("firstRunAlert", true); if (firstRunAlert) { new MaterialDialog.Builder(getContext()) .title(R.string.alert_dialog_warning_title) .content(R.string.warning_alert_data) .positiveText(R.string.ok_button) .show(); SharedPreferences.Editor editor = mSettings.edit(); editor.putBoolean("firstRunAlert", false); editor.apply(); } mRvAllergens = (RecyclerView) view.findViewById(R.id.alergens_recycle); mAllergensEnabled = mAllergenDao.queryBuilder().where(AllergenDao.Properties.Enable.eq("true")).list(); mAdapter = new AllergensAdapter(sortedAllergensList(), getActivity()); <START> Log.e("mAllergensEnabled: ", mAllergensEnabled.toString()); <END> Log.e("mAllergensFromDao: ", mAllergensFromDao.toString()); mRvAllergens.setAdapter(mAdapter); mRvAllergens.setLayoutManager(new LinearLayoutManager(view.getContext())); mRvAllergens.setHasFixedSize(true); }</code><technical_language>This a debug error log entry</technical_language>

Target:
public void onViewCreated(final View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); mAllergenDao = Utils.getAppDaoSession(getActivity()).getAllergenDao(); mAllergensFromDao = mAllergenDao.loadAll(); api = new OpenFoodAPIClient(getActivity()); mView = view; mSettings = getActivity().getSharedPreferences("prefs", 0); boolean firstRunAlert = mSettings.getBoolean("firstRunAlert", true); if (firstRunAlert) { new MaterialDialog.Builder(getContext()) .title(R.string.alert_dialog_warning_title) .content(R.string.warning_alert_data) .positiveText(R.string.ok_button) .show(); SharedPreferences.Editor editor = mSettings.edit(); editor.putBoolean("firstRunAlert", false); editor.apply(); } mRvAllergens = (RecyclerView) view.findViewById(R.id.alergens_recycle); mAllergensEnabled = mAllergenDao.queryBuilder().where(AllergenDao.Properties.Enable.eq("true")).list(); mAdapter = new AllergensAdapter(sortedAllergensList(), getActivity()); mRvAllergens.setAdapter(mAdapter); mRvAllergens.setLayoutManager(new LinearLayoutManager(view.getContext())); mRvAllergens.setHasFixedSize(true); }
Source:
<code>private void fixArray() { <START> AtomicIntegerArray s = this.data; AtomicIntegerArray d = this.data = new AtomicIntegerArray(PAGE_SIZE * ( <END> worldHeight = Bukkit.getWorld(worldUid).getMaxHeight() )); int end = Math.max(s.length(), d.length()); while (end-- > 0) { d.set(end, s.get(end)); } }</code><technical_language>Please avoid letter variables, try follow Java Code Conventions</technical_language>

Target:
private void fixArray() { AtomicIntegerArray old = this.data; AtomicIntegerArray current = this.data = new AtomicIntegerArray(PAGE_SIZE * ( worldHeight = Bukkit.getWorld(worldUid).getMaxHeight() )); int end = Math.min(current.length(), old.length()); while (end-- > 0) { current.set(end, old.get(end)); } }
Source:
<code>private Long sizeInternal() { <START> return cache.values().stream().mapToLong(value -> value.size()).sum(); <END> }</code><technical_language>This run in parallel; parallelStream</technical_language>

Target:
private Long sizeInternal() { return cache.values().parallelStream().mapToLong(value -> value.size()).sum(); }
Source:
<code>public String enqueueSynchronizeTimeRequest(@Identification final String organisationIdentification, @Identification final String deviceIdentification, @Identification final SynchronizeTimeReadsRequest requestData) throws FunctionalException { LOGGER.debug("enqueueSynchronizeTimeReadsRequest called with organisation and device {}", organisationIdentification, deviceIdentification); final String correlationUid = this.correlationIdProviderService.getCorrelationId(organisationIdentification, deviceIdentification); final SmartMeteringRequestMessage message = new SmartMeteringRequestMessage( <START> SmartMeteringRequestMessageType.REQUEST_PERIODIC_METER_DATA, correlationUid, organisationIdentification, <END> deviceIdentification, requestData); this.smartMeteringRequestMessageSender.send(message); return correlationUid; }</code><technical_language>this REQUEST_SYNCHRONIZE_TIME</technical_language>

Target:
public String enqueueSynchronizeTimeRequest(@Identification final String organisationIdentification, @Identification final String deviceIdentification, @Identification final SynchronizeTimeReadsRequest requestData) throws FunctionalException { LOGGER.debug("enqueueSynchronizeTimeReadsRequest called with organisation and device {}", organisationIdentification, deviceIdentification); final String correlationUid = this.correlationIdProviderService.getCorrelationId(organisationIdentification, deviceIdentification); final SmartMeteringRequestMessage message = new SmartMeteringRequestMessage( SmartMeteringRequestMessageType.REQUEST_SYNCHRONIZE_TIME, correlationUid, organisationIdentification, deviceIdentification, requestData); this.smartMeteringRequestMessageSender.send(message); return correlationUid; }
Source:
<code>private Object createHelper() { preValidate(); Object key = KEY_FACTORY.newInstance((superclass != null) ? superclass.getName() : null, ReflectUtils.getNames(interfaces), filter == ALL_ZERO ? null : new WeakCacheKey<CallbackFilter>(filter), callbackTypes, useFactory, interceptDuringConstruction, serialVersionUID); this.currentKey = key; <START> return super.create(key); <END> }</code><technical_language>Please revert this policy: > Please refrain modifying classes org.springframework.asm, org.springframework.cglib, org.springframework.objenesis. include repackaged forks of third-party libraries ASM, CGLIB, Objenesis. refactoring classes place upstream in originating repository. Spring Framework pick changes syncing official updates of forked third-party libraries</technical_language>

Target:
private Object createHelper() { preValidate(); Object key = KEY_FACTORY.newInstance((superclass != null) ? superclass.getName() : null, ReflectUtils.getNames(interfaces), filter == ALL_ZERO ? null : new WeakCacheKey<CallbackFilter>(filter), callbackTypes, useFactory, interceptDuringConstruction, serialVersionUID); this.currentKey = key; Object result = super.create(key); return result; }
Source:
<code><START> protected void setScrollBar( final GuiScrollbar myScrollBar ) <END> { this.myScrollBar = myScrollBar; }</code><technical_language>erm I meant this</technical_language>

Target:
protected void setScrollBar( final GuiScrollbar myScrollBar ) { this.scrollBar = myScrollBar; }
Source:
<code>public void simpleMultiKeyTest() { InMemSpillableStateStore store = new InMemSpillableStateStore(); <START> useSharedBuffer = false; <END> simpleMultiKeyTestHelper(store); store = new InMemSpillableStateStore(); useSharedBuffer = true; simpleMultiKeyTestHelper(store); }</code><technical_language>parameterized test (see org.junit.runners.Parameterized, WindowedOperatorTest for example of it)</technical_language>

Target:
public void simpleMultiKeyTest() { InMemSpillableStateStore store = new InMemSpillableStateStore(); simpleMultiKeyTestHelper(store); }
Source:
<code>public void testCache() throws Exception { mockStatic(FileSystem.class); Configuration conf = new Configuration(); <START> JobPath jobPath = new JobPath("foo", "bar", "/baz"); <END> FileSystem mockFileSystem = mock(FileSystem.class); when(FileSystem.get(eq(jobPath.toUri()), any())).thenReturn(mockFileSystem); assertEquals(mockFileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(1)); FileSystem.get(eq(jobPath.toUri()), any()); assertEquals(mockFileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(1)); FileSystem.get(eq(jobPath.toUri()), any()); conf.set(PropertyKey.USER_FILE_READ_TYPE_DEFAULT.toString(), ReadType.NO_CACHE.toString()); assertEquals(mockFileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(2)); FileSystem.get(eq(jobPath.toUri()), any()); conf.set("foo", "bar"); assertEquals(mockFileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(2)); FileSystem.get(eq(jobPath.toUri()), any()); }</code><technical_language>this test works. some verification JobPath scheme auth conf get client back, also, when, scheme, and/or auth, and/or conf is different, get a client back? test if a non-inspected conf is changed, returns a cached client</technical_language>

Target:
public void testCache() throws Exception { mockStatic(FileSystem.class); Configuration conf = new Configuration(); JobPath jobPath = new JobPath("foo", "bar", "/baz"); when(FileSystem.get(any(), any())).thenAnswer((p) -> mock(FileSystem.class)); FileSystem fileSystem = jobPath.getFileSystem(conf); verifyStatic(times(1)); FileSystem.get(any(), any()); assertEquals(fileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(1)); FileSystem.get(any(), any()); conf.set(PropertyKey.USER_FILE_READ_TYPE_DEFAULT.toString(), ReadType.NO_CACHE.toString()); FileSystem newFileSystem = jobPath.getFileSystem(conf); assertNotEquals(fileSystem, newFileSystem); verifyStatic(times(2)); FileSystem.get(any(), any()); conf.set("foo", "bar"); assertEquals(newFileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(2)); FileSystem.get(any(), any()); jobPath = new JobPath("foo", "bar", "/bar"); assertEquals(newFileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(2)); FileSystem.get(any(), any()); jobPath = new JobPath("foo", "baz", "/bar"); assertNotEquals(newFileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(3)); FileSystem.get(any(), any()); jobPath = new JobPath("bar", "bar", "/bar"); assertNotEquals(newFileSystem, jobPath.getFileSystem(conf)); verifyStatic(times(4)); FileSystem.get(any(), any()); }
Source:
<code>public static String EvtGetExtendedStatus() { int errorCode; IntByReference buffUsed = new IntByReference(); errorCode = Wevtapi.INSTANCE.EvtGetExtendedStatus(0, null, buffUsed); if (errorCode != WinError.ERROR_SUCCESS && errorCode != WinError.ERROR_INSUFFICIENT_BUFFER) { throw new Win32Exception(errorCode); } if (buffUsed.getValue() == 0) { return ""; } Memory mem = new Memory(buffUsed.getValue() * 2); errorCode = Wevtapi.INSTANCE.EvtGetExtendedStatus((int) mem.size(), mem, buffUsed); if (errorCode != WinError.ERROR_SUCCESS) { throw new Win32Exception(errorCode); } <START> return mem.getWideString(0); <END> }</code><technical_language>Please Wevtapi line 90 for reference - this work: java char[] mem = new char[buffUsed.getValue()]; errorCode = Wevtapi.INSTANCE.EvtGetExtendedStatus(mem.length, mem, buffUsed); if (errorCode != WinError.ERROR_SUCCESS) { throw new Win32Exception(errorCode); } return Native.toString(mem);</technical_language>

Target:
public static String EvtGetExtendedStatus() { int errorCode; IntByReference buffUsed = new IntByReference(); errorCode = Wevtapi.INSTANCE.EvtGetExtendedStatus(0, null, buffUsed); if (errorCode != WinError.ERROR_SUCCESS && errorCode != WinError.ERROR_INSUFFICIENT_BUFFER) { throw new Win32Exception(errorCode); } if (buffUsed.getValue() == 0) { return ""; } char[] mem = new char[buffUsed.getValue()]; errorCode = Wevtapi.INSTANCE.EvtGetExtendedStatus(mem.length, mem, buffUsed); if (errorCode != WinError.ERROR_SUCCESS) { throw new Win32Exception(errorCode); } return Native.toString(mem); }
Source:
<code>private void checkEventsMappedToWsSchema(final List<Event> originalEvents, final List<com.alliander.osgp.adapter.ws.schema.smartmetering.management.Event> mappedEvents) { assertEquals("number of events", originalEvents.size(), mappedEvents.size()); for (int i = 0; i < originalEvents.size(); i++) { final Event originalEvent = originalEvents.get(i); final com.alliander.osgp.adapter.ws.schema.smartmetering.management.Event mappedEvent = mappedEvents.get(i); <START> assertEquals("eventCode with mapping of " + originalEvent, originalEvent.getEventCode().intValue(), <END> EventType.valueOf(mappedEvent.getEventType().name()).getValue()); assertEquals("eventCounter with mapping of " + originalEvent, originalEvent.getEventCounter(), mappedEvent.getEventCounter()); assertEquals("timestamp with mapping of " + originalEvent, originalEvent.getTimestamp().toString(), new DateTime(mappedEvent.getTimestamp().toGregorianCalendar()).toString()); } }</code><technical_language>create a constant of "eventCode mapping of ". multiple times</technical_language>

Target:
private void checkEventsMappedToWsSchema(final List<Event> originalEvents, final List<com.alliander.osgp.adapter.ws.schema.smartmetering.management.Event> mappedEvents) { assertEquals(NUMBER_OF_EVENTS, originalEvents.size(), mappedEvents.size()); for (int i = 0; i < originalEvents.size(); i++) { final Event originalEvent = originalEvents.get(i); final com.alliander.osgp.adapter.ws.schema.smartmetering.management.Event mappedEvent = mappedEvents.get(i); assertEquals(EVENT_CODE_WITH_MAPPING_OF + originalEvent, originalEvent.getEventCode().intValue(), EventType.valueOf(mappedEvent.getEventType().name()).getValue()); assertEquals(EVENT_COUNTER_WITH_MAPPING_OF + originalEvent, originalEvent.getEventCounter(), mappedEvent.getEventCounter()); assertEquals(TIMESTAMP_WITH_MAPPING_OF + originalEvent, originalEvent.getTimestamp().toString(), new DateTime(mappedEvent.getTimestamp().toGregorianCalendar()).toString()); } }
Source:
<code>public void disableReadWriteConflict(TableReference tableRef) { conflictHandlers.compute(tableRef, (tableReference, nullableCurrentValue) -> { ConflictHandler conflictHandler = delegate.get(tableReference); Preconditions.checkNotNull(conflictHandler, "Conflict handler cannot be null when overwriting"); Optional<ConflictHandler> newValue = Optional.of( getDisabledReadWriteConflictHandler(conflictHandler)); Preconditions.checkState(nullableCurrentValue == null || nullableCurrentValue.equals(newValue), <START> "Cannot overwrite conflict behaviour after transaction already started"); <END> return newValue; }); }</code><technical_language>'after table used?' - override want, provided table read</technical_language>

Target:
public void disableReadWriteConflict(TableReference tableRef) { conflictHandlers.compute(tableRef, (tableReference, nullableCurrentValue) -> { ConflictHandler conflictHandler = delegate.get(tableReference); Preconditions.checkNotNull(conflictHandler, "Conflict handler cannot be null when overwriting"); Optional<ConflictHandler> newValue = Optional.of( getDisabledReadWriteConflictHandler(conflictHandler)); Preconditions.checkState(nullableCurrentValue == null || nullableCurrentValue.equals(newValue), "Cannot overwrite conflict behaviour after the table has already been used"); return newValue; }); }
Source:
<code><START> public boolean inputsAreConnected() { <END> for (int i = 0; i < getInputs().length; i++) { if (!inputIsConnected(i)) { return false; } } return true; }</code><technical_language>Met List: @Override public boolean inputsAreConnected() { return inputs.stream().allMatch(ConnectionAnchor::isFullyConnected); }</technical_language>

Target:
public boolean inputsAreConnected() { return inputs.stream().allMatch(ConnectionAnchor::isConnected); }
Source:
<code>private void checkDownNodesAndReacquireNodesIfNeeded() { int numberOfNodesToDeploy = 0; <START> for (Node downNode : this.nodeSource.getDownNodes()) { <END> String nodeUrl = downNode.getNodeInformation().getURL(); logger.info("Removing down node " + nodeUrl); BooleanWrapper removed = this.nodeSource.getRMCore().removeNode(nodeUrl, true); if (removed.getBooleanValue()) { logger.info("Down node removed " + nodeUrl); numberOfNodesToDeploy++; } } for (RMDeployingNode lostNode : this.nodeSource.getDeployingAndLostNodes()) { if (!lostNode.isLost()) { continue; } String nodeUrl = lostNode.getNodeURL(); logger.info("Removing lost node " + nodeUrl); BooleanWrapper removed = this.nodeSource.getRMCore().removeNode(nodeUrl, true); if (removed.getBooleanValue()) { logger.info("Lost node removed " + nodeUrl); numberOfNodesToDeploy++; } } if (numberOfNodesToDeploy > 0) { logger.info("Acquiring " + numberOfNodesToDeploy + " nodes"); acquireNodes(numberOfNodesToDeploy); } }</code><technical_language>clean a bit this code? smells refactorable removing duplications (not this word exists)</technical_language>

Target:
private void checkDownNodesAndReacquireNodesIfNeeded() { long numberOfNodesToDeploy = this.nodeSource.getDownNodes() .stream() .map(node -> node.getNodeInformation().getURL()) .peek(nodeUrl -> logger.info("Removing down node " + nodeUrl)) .map(nodeUrl -> this.nodeSource.getRMCore().removeNode(nodeUrl, true)) .filter(BooleanWrapper::getBooleanValue) .peek(x -> logger.info("Down node removed")) .count(); numberOfNodesToDeploy += this.nodeSource.getDeployingAndLostNodes() .stream() .filter(RMDeployingNode::isLost) .map(RMDeployingNode::getNodeURL) .peek(nodeUrl -> logger.info("Removing lost node " + nodeUrl)) .map(nodeUrl -> this.nodeSource.getRMCore().removeNode(nodeUrl, true)) .filter(BooleanWrapper::getBooleanValue) .peek(x -> logger.info("Lost node removed")) .count(); if (numberOfNodesToDeploy > 0) { logger.info("Acquiring " + numberOfNodesToDeploy + " nodes"); acquireNodes((int) numberOfNodesToDeploy); } }
Source:
<code>private HashMap<UUID, ClusteredTopDocs> broadcastQuery(ClusteredQueryCommand command) { ClusteredQueryInvoker invoker = new ClusteredQueryInvoker(cache, asyncExecutor); HashMap<UUID, ClusteredTopDocs> topDocsResponses = new HashMap<>(); int resultSize = 0; List<QueryResponse> responses = invoker.broadcast(command); for (QueryResponse queryResponse : responses) { <START> if (queryResponse.getResultSize() > 0) { <END> ClusteredTopDocs topDocs = new ClusteredTopDocs(queryResponse.getTopDocs(), queryResponse.getNodeUUID()); resultSize += queryResponse.getResultSize(); topDocs.setNodeAddress(queryResponse.getAddress()); topDocsResponses.put(queryResponse.getNodeUUID(), topDocs); } } this.resultSize = resultSize; return topDocsResponses; }</code><technical_language>I add isEmpty() method instead of comparing size</technical_language>

Target:
private HashMap<UUID, ClusteredTopDocs> broadcastQuery(ClusteredQueryCommand command) { ClusteredQueryInvoker invoker = new ClusteredQueryInvoker(cache, asyncExecutor); HashMap<UUID, ClusteredTopDocs> topDocsResponses = new HashMap<>(); int resultSize = 0; List<QueryResponse> responses = invoker.broadcast(command); for (QueryResponse queryResponse : responses) { if (queryResponse.nonEmpty()) { topDocsResponses.put(queryResponse.getNodeUUID(), queryResponse.toClusteredTopDocs()); resultSize += queryResponse.getResultSize(); } } this.resultSize = resultSize; return topDocsResponses; }
Source:
<code>public ResponseEntity<?> renewForgotPassword(@RequestBody RenewForgotPasswordDTO renewForgotPassDTO) { String code = renewForgotPassDTO.getCode(); String newPassword = renewForgotPassDTO.getNp(); if (code == null || code.isEmpty()) { throw new BadRequestException("Invalid request!"); } else if (newPassword == null || newPassword.isEmpty()) { throw new BadRequestException("Invalid request!"); } else if (newPassword.length() < 8) { throw new BadRequestException("Password should have at least 8 characters!"); } ForgotPassword forgotPassword = forgotPasswordDao.findByCode(code); if (forgotPassword == null) { throw new BadRequestException("Invalid renew attempt!"); } AppUser appUser = forgotPassword.getUser(); if (appUser == null) { throw new BadRequestException("Invalid user!"); } String newPasswordEncrypted = passwordEncrypt.encryptPassword(newPassword); appUser.setPassword(newPasswordEncrypted); appUser.setForgotPassword(null); appUserDao.saveAndFlush(appUser); <START> forgotPasswordDao.delete(forgotPassword.getId()); <END> return new ResponseEntity<>(HttpStatus.OK); }</code><technical_language>fixed orphanRemoval = true AppUser entity</technical_language>

Target:
public ResponseEntity<?> renewForgotPassword(@RequestBody RenewForgotPasswordDTO renewForgotPassDTO) { String code = renewForgotPassDTO.getCode(); String newPassword = renewForgotPassDTO.getNp(); if (code == null || code.isEmpty()) { throw new BadRequestException("Invalid request!"); } else if (newPassword == null || newPassword.isEmpty()) { throw new BadRequestException("Invalid request!"); } else if (newPassword.length() < 8) { throw new BadRequestException("Password should have at least 8 characters!"); } ForgotPassword forgotPassword = forgotPasswordDao.findByCode(code); if (forgotPassword == null) { throw new BadRequestException("Invalid renew attempt!"); } AppUser appUser = forgotPassword.getUser(); if (appUser == null) { throw new BadRequestException("Invalid user!"); } String newPasswordEncrypted = passwordEncrypt.encryptPassword(newPassword); appUser.setPassword(newPasswordEncrypted); appUser.setForgotPassword(null); appUserDao.saveAndFlush(appUser); return new ResponseEntity<>(HttpStatus.OK); }
Source:
<code>public String next() throws IOException { if (iseof) return null; for (; ;) { if (curr_off == 0 || !less64(curr_off, off[i].v)) { if (i == off.length - 1) break; if (i >= 0) assert (curr_off == off[i].v); if (i < 0 || off[i].v != off[i + 1].u) { mFp.seek(off[i + 1].u); curr_off = mFp.getFilePointer(); } ++i; } String s; <START> if ((s = readLine(mFp,TabixReader.this.longestLineLength)) != null) { <END> TabixReader.this.longestLineLength = Math.max(s.length(), TabixReader.this.longestLineLength); TIntv intv; curr_off = mFp.getFilePointer(); if (s.isEmpty() || s.charAt(0) == mMeta) continue; intv = getIntv(s); if (intv.tid != tid || intv.beg >= end) break; else if (intv.end > beg && intv.beg < end) return s; } else break; } iseof = true; return null; }</code><technical_language>space</technical_language>

Target:
public String next() throws IOException { if (iseof) return null; for (; ;) { if (curr_off == 0 || !less64(curr_off, off[i].v)) { if (i == off.length - 1) break; if (i >= 0) assert (curr_off == off[i].v); if (i < 0 || off[i].v != off[i + 1].u) { mFp.seek(off[i + 1].u); curr_off = mFp.getFilePointer(); } ++i; } String s; if ((s = readLine(mFp, DEFAULT_BUFFER_SIZE)) != null) { TIntv intv; curr_off = mFp.getFilePointer(); if (s.isEmpty() || s.charAt(0) == mMeta) continue; intv = getIntv(s); if (intv.tid != tid || intv.beg >= end) break; else if (intv.end > beg && intv.beg < end) return s; } else break; } iseof = true; return null; }