auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void generateNewPassword(U userAccount) { assertNotNew(userAccount); if (!userAccount.getUserAccountData().isPasswordGenerationPossible()) { throw Exceptions.createHandled() .withNLSKey("UserAccountConroller.cannotGeneratePasswordForOwnUser") .handle(); } userAccount.getUserAccountData().getLogin().forceGenerationOfPassword(); userAccount.getMapper().update(userAccount); auditLog.neutral("AuditLog.passwordGenerated") .causedByCurrentUser() .forUser(userAccount.getUniqueName(), userAccount.getUserAccountData().getLogin().getUsername()) .forTenant(String.valueOf(userAccount.getTenant().getId()), <START> userAccount.getTenant().fetchValue().getTenantData().getName()) <END> .log(); }</code><technical_language>cache</technical_language>

Target:
private void generateNewPassword(U userAccount) { assertNotNew(userAccount); if (!userAccount.getUserAccountData().isPasswordGenerationPossible()) { throw Exceptions.createHandled() .withNLSKey("UserAccountConroller.cannotGeneratePasswordForOwnUser") .handle(); } userAccount.getUserAccountData().getLogin().forceGenerationOfPassword(); userAccount.getMapper().update(userAccount); auditLog.neutral("AuditLog.passwordGenerated") .causedByCurrentUser() .forUser(userAccount.getUniqueName(), userAccount.getUserAccountData().getLogin().getUsername()) .forTenant(String.valueOf(userAccount.getTenant().getId()), matchingTenants.fetchCachedRequiredTenant(userAccount.getTenant()).getTenantData().getName()) .log(); }
Source:
<code>public void update(int delta) throws SlickException { collisionHandler.checkCollision(Model.getCurrentRoom().getBubbles()); for (Player player : Model.getPlayers()) { if (!collisionHandler.checkCollision(player)) { player.setFalling(true); } <START> if (!anyLive()) { <END> notifyObserver(); loseLife(player); } collisionHandler.checkCollision(player.getRopes()); } if (this.getTimers().getLevelTimeLeft() <= 0) { fireEvent(new ControllerEvent(this, ControllerEvent.OUTOFTIME, "Out of time")); notifyObserver(); for (Player p : Model.getPlayers()) { loseLife(p); } } ArrayList<PowerUp> powers = Model.getShortPower(); if (powers.size() > 0) { for (PowerUp power : powers) { if (collisionHandler.checkCollision(power)) { if (timeLeft >= getTimers().getLevelTimeLeft() + 30000) { Model.deleteShortPower(power); } } power.move(); if (!collisionHandler.checkCollision(power)) { timeLeft = getTimers().getLevelTimeLeft(); } } } for (Player p : Model.getPlayers()) { p.move(); } notifyObserver(); processInput(delta); updateRopes(); updateBubble(); }</code><technical_language>spelling: anyLife()</technical_language>

Target:
public void update(int delta) throws SlickException { collisionHandler.checkCollision(Model.getCurrentRoom().getBubbles()); for (Player player : Model.getPlayers()) { if (!collisionHandler.checkCollision(player)) { player.setFalling(true); } if (!anyLife()) { notifyObserver(); loseLife(player); } collisionHandler.checkCollision(player.getRopes()); } if (this.getTimers().getLevelTimeLeft() <= 0) { fireEvent(new ControllerEvent(this, ControllerEvent.OUTOFTIME, "Out of time")); notifyObserver(); for (Player p : Model.getPlayers()) { loseLife(p); } } List<PowerUp> powers = Model.getShortPower(); if (powers.size() > 0) { for (PowerUp power : powers) { if (collisionHandler.checkCollision(power)) { if (timeLeft >= getTimers().getLevelTimeLeft() + 30000) { Model.deleteShortPower(power); } } power.move(); if (!collisionHandler.checkCollision(power)) { timeLeft = getTimers().getLevelTimeLeft(); } } } for (Player p : Model.getPlayers()) { p.move(); } notifyObserver(); processInput(delta); updateRopes(); updateBubble(); }
Source:
<code>private static String propertiesAsString(Properties properties) { StringBuilder props = new StringBuilder(); boolean apos = false; for(Object obj : properties.keySet()) { <START> String value = (String) properties.get(obj); <END> if(apos) { props.append("'"); } props.append((String) obj + ">" + value); apos = true; } return props.toString(); }</code><technical_language>properties.get(obj).toString() safer in theory, Properties hold Strings</technical_language>

Target:
private static String propertiesAsString(Properties properties) { StringBuilder props = new StringBuilder(); boolean apos = false; for(Object obj : properties.keySet()) { String value = properties.get(obj).toString(); if(apos) { props.append("<'>"); } props.append(obj.toString() + "<>" + value); apos = true; } return props.toString(); }
Source:
<code>public RemoteViews getViewAt(int position) { final RemoteViews remoteView = new RemoteViews( context.getPackageName(), R.layout.bookmarks_widget_list_row); ItemList item = listItemList.get(position); <START> remoteView.setTextViewText(R.id.Suratitle, item.sura + ""); <END> remoteView.setTextViewText(R.id.Surametadata, context.getResources().getText(R.string.quran_page) + " " + item.page); remoteView.setImageViewResource(R.id.WidgetFavIcon, R.drawable.ic_favorite); Bundle extras = new Bundle(); extras.putInt("page", item.page); Intent fillInIntent = new Intent(); fillInIntent.putExtras(extras); remoteView.setOnClickFillInIntent(R.id.widget_item, fillInIntent); return remoteView; }</code><technical_language>R.id.sura_title rename in xml</technical_language>

Target:
public RemoteViews getViewAt(int position) { final RemoteViews remoteView = new RemoteViews( context.getPackageName(), R.layout.bookmarks_widget_list_row); SuraPageItem item = suraPageItemList.get(position); remoteView.setTextViewText(R.id.sura_title, item.sura + ""); remoteView.setTextViewText(R.id.sura_meta_data, context.getResources().getText(R.string.quran_page) + " " + item.page); remoteView.setImageViewResource(R.id.widget_favorite_icon, R.drawable.ic_favorite); Bundle extras = new Bundle(); extras.putInt("page", item.page); Intent fillInIntent = new Intent(); fillInIntent.putExtras(extras); remoteView.setOnClickFillInIntent(R.id.widget_item, fillInIntent); return remoteView; }
Source:
<code><START> public ResponseEntity<?> get(@PathVariable final String name, final NativeWebRequest request) { <END> final EventType eventType = eventTypeService.get(name); return status(HttpStatus.OK).body(eventType); }</code><technical_language>declare throws please</technical_language>

Target:
public ResponseEntity<?> get(@PathVariable final String name, final NativeWebRequest request) throws NoSuchEventTypeException, InternalNakadiException{ final EventType eventType = eventTypeService.get(name); return status(HttpStatus.OK).body(eventType); }
Source:
<code>public void setUp() { <START> refToRelease = new LinkedList<ReferenceCounted>(); <END> request = new DefaultFullBinaryMemcacheRequest( Unpooled.copiedBuffer("key", CharsetUtil.UTF_8), Unpooled.wrappedBuffer(new byte[]{1, 3, 4, 9}), Unpooled.copiedBuffer("some value", CharsetUtil.UTF_8)); request.setReserved((short) 534); request.setMagic((byte) 0x03); request.setOpcode((byte) 0x02); request.setKeyLength((short) 32); request.setExtrasLength((byte) 34); request.setDataType((byte) 43); request.setTotalBodyLength(345); request.setOpaque(3); request.setCas(345345L); refToRelease.add(request); }</code><technical_language>honestly I a lot cleaner if release stuff in tests itself</technical_language>

Target:
public void setUp() { request = new DefaultFullBinaryMemcacheRequest( Unpooled.copiedBuffer("key", CharsetUtil.UTF_8), Unpooled.wrappedBuffer(new byte[]{1, 3, 4, 9}), Unpooled.copiedBuffer("some value", CharsetUtil.UTF_8)); request.setReserved((short) 534); request.setMagic((byte) 0x03); request.setOpcode((byte) 0x02); request.setKeyLength((short) 32); request.setExtrasLength((byte) 34); request.setDataType((byte) 43); request.setTotalBodyLength(345); request.setOpaque(3); request.setCas(345345L); }
Source:
<code>public Component getTableCellRendererComponent(JTable table, Object obj, boolean isSelected, boolean hasFocus, int row, int column) { if (obj instanceof EditedStyleItem) { final EditedStyleItem item = (EditedStyleItem) obj; ResourceValue resValue; if <START> (item.isAttr()) <END> { resValue = myConfiguration.getResourceResolver().findResValue(item.getValue(), false); if (resValue == null) { LOG.error("Unable to resolve " + item.getValue()); } } else { resValue = item.getItemResourceValue(); } final Color color = ResourceHelper.resolveColor(myConfiguration.getResourceResolver(), resValue); myComponent.configure(item, color); myComponent.setBorder(isSelected ? mySelectedBorder : myUnselectedBorder); } else { LOG.error(String.format("Object passed to ColorRendererEditor has class %1$s instead of ItemResourceValueWrapper", obj.getClass().getName())); } return myComponent; }</code><technical_language>this here? resolveColor do this? this code is in 2 other places extra bits (ColorEditor, DrawableComponent)</technical_language>

Target:
public Component getTableCellRendererComponent(JTable table, Object obj, boolean isSelected, boolean hasFocus, int row, int column) { if (obj instanceof EditedStyleItem) { final EditedStyleItem item = (EditedStyleItem) obj; final Color color = ResourceHelper.resolveColor(myConfiguration.getResourceResolver(), item.getItemResourceValue()); myComponent.configure(item, color); myComponent.setBorder(isSelected ? mySelectedBorder : myUnselectedBorder); } else { LOG.error(String.format("Object passed to ColorRendererEditor has class %1$s instead of ItemResourceValueWrapper", obj.getClass().getName())); } return myComponent; }
Source:
<code>public FluxSender adapt(MessageChannel bindingTarget, MethodParameter parameter) { DisposableFluxSender disposableFluxSender = new DisposableFluxSender(); FluxSender fluxSender = resultPublisher -> { MonoProcessor<Void> sendResult = MonoProcessor.create(); disposableFluxSender.setDisposable(resultPublisher .doOnError(e -> this.log.error("Error during processing: ", e)) .retry() .subscribe( result -> bindingTarget.send(result instanceof Message<?> ? (Message<?>) result : MessageBuilder.withPayload(result).build()), sendResult::onError, sendResult::onComplete)); return sendResult; }; <START> disposableFluxSender.setWrappedFluxSender(fluxSender); <END> return disposableFluxSender; }</code><technical_language>This logic confusing. DisposableFluxSender (or some other name) implement Disposable se only: return new FluxSenderImpl(result -> bindingTarget.send(result instanceof Message<?> ? (Message<?>) result : MessageBuilder.withPayload(result).build())) rest hidden in impl. leverage like: .doOnSubscribe(subscription -> this.subscription = subscription) subscription cancel() called dispose() of FluxSenderImpl. point is reason lambda for FluxSender provide confusing API setDisposable() setWrappedFluxSender() object</technical_language>

Target:
public FluxSender adapt(MessageChannel bindingTarget, MethodParameter parameter) { return new DefaultFluxSender(result -> bindingTarget.send(result instanceof Message<?> ? (Message<?>) result : MessageBuilder.withPayload(result).build())); }
Source:
<code>private BigInteger postJob(CloseableHttpClient httpClient, JSONObject credentials, File bundle, JSONObject submitConfig) throws ClientProtocolException, IOException { String url = getSubmitURL(credentials, bundle); HttpPost postJobWithConfig = new HttpPost(url); postJobWithConfig.addHeader("accept", ContentType.APPLICATION_JSON.getMimeType()); <START> postJobWithConfig.addHeader("Authorization", getAPIKey(credentials.get("userid").toString(), <END> credentials.get("password").toString())); FileBody bundleBody = new FileBody(bundle, ContentType.APPLICATION_OCTET_STREAM); StringBody configBody = new StringBody(submitConfig.serialize(), ContentType.APPLICATION_JSON); HttpEntity reqEntity = MultipartEntityBuilder.create() .addPart("bin", bundleBody).addPart("json", configBody) .build(); postJobWithConfig.setEntity(reqEntity); JSONObject jsonResponse = getJsonResponse(httpClient, postJobWithConfig); Topology.STREAMS_LOGGER.info("Streaming Analytics Service submit job response:" + jsonResponse.serialize()); Object jobId = jsonResponse.get("jobId"); if (jobId == null) return BigInteger.valueOf(-1); return new BigInteger(jobId.toString()); }</code><technical_language>a constant for "Authorization"</technical_language>

Target:
private BigInteger postJob(CloseableHttpClient httpClient, JSONObject credentials, File bundle, JSONObject submitConfig) throws ClientProtocolException, IOException { String url = getSubmitURL(credentials, bundle); HttpPost postJobWithConfig = new HttpPost(url); postJobWithConfig.addHeader("accept", ContentType.APPLICATION_JSON.getMimeType()); postJobWithConfig.addHeader(AUTH.WWW_AUTH_RESP, getAPIKey(credentials.get("userid").toString(), credentials.get("password").toString())); FileBody bundleBody = new FileBody(bundle, ContentType.APPLICATION_OCTET_STREAM); StringBody configBody = new StringBody(submitConfig.serialize(), ContentType.APPLICATION_JSON); HttpEntity reqEntity = MultipartEntityBuilder.create() .addPart("bin", bundleBody).addPart("json", configBody) .build(); postJobWithConfig.setEntity(reqEntity); JSONObject jsonResponse = getJsonResponse(httpClient, postJobWithConfig); Topology.STREAMS_LOGGER.info("Streaming Analytics Service submit job response:" + jsonResponse.serialize()); Object jobId = jsonResponse.get("jobId"); if (jobId == null) return BigInteger.valueOf(-1); return new BigInteger(jobId.toString()); }
Source:
<code>private void handleConsumed(ConsumerRecord record) { Span span = startAndFinishConsumerSpan(record); tracing.propagation().keys().forEach(key -> record.headers().remove(key)); <START> tracing.propagation().injector(injector) <END> .inject(span.context(), record); }</code><technical_language>save some overhead declaring injector a field reusing it. injector = tracing.propagation().injector(injector)</technical_language>

Target:
private void handleConsumed(ConsumerRecord record) { Span span = startAndFinishConsumerSpan(record); tracing.propagation().keys().forEach(key -> record.headers().remove(key)); injector.inject(span.context(), record); }
Source:
<code>private void sortSymbols(List<TypedVar> symbols) { <START> Collections.sort(symbols, new Comparator<TypedVar>() { <END> @Override public int compare(TypedVar o1, TypedVar o2) { return o1.getName().compareTo(o2.getName()); } }); }</code><technical_language>a Guava's Ordering utility</technical_language>

Target:
private void sortSymbols(List<TypedVar> symbols) { Collections.sort(symbols, Ordering.natural().onResultOf(new Function<TypedVar, Comparable>() { @Nullable @Override public Comparable apply(@Nullable TypedVar input) { if (input == null) return null; return input.getName(); } })); }
Source:
<code>public ReferenceCountingResourceHolder.Releaser increment() { synchronized (lock) { if (refcount <= 0) { throw new ISE("Already closed!"); } refcount++; <START> final AtomicBoolean didRelease = new AtomicBoolean(); <END> return new Releaser() { @Override public void release() { if (didRelease.compareAndSet(false, true)) { decrement(); } else { log.warn("WTF?! release called but we are already released!"); } } @Override protected void finalize() throws Throwable { if (didRelease.compareAndSet(false, true)) { log.warn("Not released! Object was[%s], releasing on finalize of releaser.", object); decrement(); } } }; } }</code><technical_language>didRelease flag moved Releaser object</technical_language>

Target:
public Releaser increment() { synchronized (lock) { if (refcount <= 0) { throw new ISE("Already closed!"); } refcount++; return new Releaser() { final AtomicBoolean didRelease = new AtomicBoolean(); @Override public void close() { if (didRelease.compareAndSet(false, true)) { decrement(); } else { log.warn("WTF?! release called but we are already released!"); } } @Override protected void finalize() throws Throwable { if (didRelease.compareAndSet(false, true)) { log.warn("Not released! Object was[%s], releasing on finalize of releaser.", object); decrement(); } } }; } }
Source:
<code>public String toString() { if (_partitions.size() > 0) { try { List<Integer> partitionList = _partitionsV2.stream().map(Integer::parseInt).collect(Collectors.toList()); <START> return String.format("%s(%s), partitionsV2=%s, partitions=%s, dependencies=%s", getDatastreamTaskName(), <END> _connectorType, LogUtils.logNumberArrayInRange(partitionList), LogUtils.logNumberArrayInRange(_partitions), _dependencies); } catch (NumberFormatException e) { LOG.error(e.getMessage()); return String.format("%s(%s), partitionsV2=%s, partitions=%s, dependencies=%s", getDatastreamTaskName(), _connectorType, String.join(",", _partitionsV2), LogUtils.logNumberArrayInRange(_partitions), _dependencies); } } return String.format("%s(%s), partitionsV2=%s, partitions=%s, dependencies=%s", getDatastreamTaskName(), _connectorType, String.join(",", _partitionsV2), LogUtils.logNumberArrayInRange(_partitions), _dependencies); }</code><technical_language>format string is in 3 places now. Create a local variable/member constant FORMAT_STRING</technical_language>

Target:
public String toString() { String partitionsV2FormatLog = String.join(",", _partitionsV2); if (_partitions.size() > 0) { try { List<Integer> partitionList = _partitionsV2.stream().map(Integer::parseInt).collect(Collectors.toList()); partitionsV2FormatLog = LogUtils.logNumberArrayInRange(partitionList); } catch (NumberFormatException e) { LOG.error(e.getMessage()); } } return String.format("%s(%s), partitionsV2=%s, partitions=%s, dependencies=%s", getDatastreamTaskName(), _connectorType, partitionsV2FormatLog, LogUtils.logNumberArrayInRange(_partitions), _dependencies); }
Source:
<code>private Map<String, String> readAccountMetadataFromBlobID(String blobID) { long startTimeMs = System.currentTimeMillis(); Future<GetBlobResult> resultF = accountService.router.get().getBlob(blobID, new GetBlobOptionsBuilder().build()); try { GetBlobResult result = resultF.get(); <START> accountService.accountServiceMetrics.accountFetchFromAmbryTimeInMs.update( <END> System.currentTimeMillis() - startTimeMs); int blobSize = (int) result.getBlobInfo().getBlobProperties().getBlobSize(); InputStream input = new ReadableStreamChannelInputStream(result.getBlobDataChannel()); byte[] bytes = Utils.readBytesFromStream(input, blobSize); JSONObject object = new JSONObject(new String(bytes, Charsets.UTF_8)); Map<String, String> map = new HashMap<>(); object.keySet().stream().forEach(key -> map.put(key, object.getString(key))); return map; } catch (Exception e) { logger.debug("Failed to read account metadata from blob id={}", blobID, e); accountService.accountServiceMetrics.accountFetchFromAmbryServerErrorCount.inc(); } return null; }</code><technical_language>places update metrics, please a saved instance of accountServiceMetrics get accountService</technical_language>

Target:
private Map<String, String> readAccountMetadataFromBlobID(String blobID) { long startTimeMs = System.currentTimeMillis(); Future<GetBlobResult> resultF = router.get().getBlob(blobID, new GetBlobOptionsBuilder().build()); try { GetBlobResult result = resultF.get(); accountServiceMetrics.accountFetchFromAmbryTimeInMs.update(System.currentTimeMillis() - startTimeMs); int blobSize = (int) result.getBlobInfo().getBlobProperties().getBlobSize(); InputStream input = new ReadableStreamChannelInputStream(result.getBlobDataChannel()); byte[] bytes = Utils.readBytesFromStream(input, blobSize); JSONObject object = new JSONObject(new String(bytes, Charsets.UTF_8)); Map<String, String> map = new HashMap<>(); object.keySet().stream().forEach(key -> map.put(key, object.getString(key))); return map; } catch (Exception e) { logger.error("Failed to read account metadata from blob id={}", blobID, e); accountServiceMetrics.accountFetchFromAmbryServerErrorCount.inc(); } return null; }
Source:
<code>public void addExtentSummary(ExtentSummary product) throws Exception { if (!product.isValid()) { LOGGER.log(Level.FINE,"[" + getName() + "] product " + product.getId() + " has no extent information; won't add to extent table"); return; } Connection connection = connect(); PreparedStatement addProduct = connection.prepareStatement( "INSERT INTO " + EXTENT_TABLE + "(" + EXTENT_INDEX_ID + "," + EXTENT_START_TIME + "," + EXTENT_END_TIME + "," + EXTENT_MIN_LAT + "," + EXTENT_MAX_LAT + "," + EXTENT_MIN_LONG + "," + EXTENT_MAX_LONG + ") VALUES (?, ?, ?, ?, ?, ?, ?)" ); <START> addProduct.setLong(1, product.getId()); <END> if (product.getStartTime() != null) { addProduct.setLong(2, product.getStartTime().getTime()); } else { addProduct.setNull(2,Types.BIGINT); } if (product.getEndTime() != null) { addProduct.setLong(3, product.getEndTime().getTime()); } else { addProduct.setNull(3,Types.BIGINT); } if (product.getMinLatitude() != null) { addProduct.setDouble(4, product.getMinLatitude()); } else { addProduct.setNull(4,Types.DECIMAL); } if (product.getMaxLatitude() != null) { addProduct.setDouble(5, product.getMaxLatitude()); } else { addProduct.setNull(5, Types.DECIMAL); } if (product.getMinLongitude() != null) { addProduct.setDouble(6, product.getMinLongitude()); } else { addProduct.setNull(6,Types.DECIMAL); } if (product.getMaxLongitude() != null) { addProduct.setDouble(7, product.getMaxLongitude()); } else { addProduct.setNull(7,Types.DECIMAL); } addProduct.executeUpdate(); addProduct.clearParameters(); addProduct.close(); }</code><technical_language>I this getIndexId()</technical_language>

Target:
public void addExtentSummary(ExtentSummary product) throws Exception { if (!product.isValid()) { LOGGER.log(Level.FINE,"[" + getName() + "] product " + product.getIndexId() + " has no extent information; won't add to extent table"); return; } Connection connection = connect(); String sql = "INSERT INTO " + EXTENT_TABLE + "(" + EXTENT_INDEX_ID + "," + EXTENT_START_TIME + "," + EXTENT_END_TIME + "," + EXTENT_MIN_LAT + "," + EXTENT_MAX_LAT + "," + EXTENT_MIN_LONG + "," + EXTENT_MAX_LONG + ") VALUES (?, ?, ?, ?, ?, ?, ?)"; try (PreparedStatement addProduct = connection.prepareStatement(sql)) { addProduct.setLong(1, product.getIndexId()); if (product.getStartTime() != null) { addProduct.setLong(2, product.getStartTime().getTime()); } else { addProduct.setNull(2, Types.BIGINT); } if (product.getEndTime() != null) { addProduct.setLong(3, product.getEndTime().getTime()); } else { addProduct.setNull(3, Types.BIGINT); } if (product.getMinLatitude() != null) { addProduct.setBigDecimal(4, product.getMinLatitude()); } else { addProduct.setNull(4, Types.DECIMAL); } if (product.getMaxLatitude() != null) { addProduct.setBigDecimal(5, product.getMaxLatitude()); } else { addProduct.setNull(5, Types.DECIMAL); } if (product.getMinLongitude() != null) { addProduct.setBigDecimal(6, product.getMinLongitude()); } else { addProduct.setNull(6, Types.DECIMAL); } if (product.getMaxLongitude() != null) { addProduct.setBigDecimal(7, product.getMaxLongitude()); } else { addProduct.setNull(7, Types.DECIMAL); } addProduct.executeUpdate(); addProduct.clearParameters(); } }
Source:
<code>public void testFindSubscription() throws Throwable { Subscription subscription = subscriptionFactory.createCreditCardSubscription(defaultPlanWithTrialDays.getId(), defaultCard.getId(), defaultCustomer); subscription.save(); Subscription foundSubscription = new Subscription().find(subscription.getId()); Assert.assertEquals(subscription.getId(), foundSubscription.getId()); Assert.assertEquals(subscription.getPostbackUrl(), foundSubscription.getPostbackUrl()); Assert.assertEquals(subscription.getCharges(), foundSubscription.getCharges()); Assert.assertEquals(subscription.getCreatedAt(), foundSubscription.getCreatedAt()); Assert.assertEquals(subscription.getCurrentPeriodEnd(), foundSubscription.getCurrentPeriodEnd()); Assert.assertEquals(subscription.getCurrentPeriodStart(), foundSubscription.getCurrentPeriodStart()); Assert.assertEquals(subscription.getCurrentTransaction(), foundSubscription.getCurrentTransaction()); Assert.assertEquals(subscription.getCustomer().getId(), foundSubscription.getCustomer().getId()); Assert.assertEquals(subscription.getMetadata(), foundSubscription.getMetadata()); Assert.assertEquals(PaymentMethod.CREDIT_CARD, foundSubscription.getPaymentMethod()); Assert.assertEquals(subscription.getPlan().getId(), foundSubscription.getPlan().getId()); Assert.assertEquals(subscription.getStatus(), foundSubscription.getStatus()); <START> Assert.assertEquals(1, subscription.getMetadata().size()); <END> }</code><technical_language>metadata asserting metadata setted</technical_language>

Target:
public void testFindSubscription() throws Throwable { Subscription subscription = subscriptionFactory.createCreditCardSubscription(defaultPlanWithTrialDays.getId(), defaultCard.getId(), defaultCustomer); subscription.save(); Subscription foundSubscription = new Subscription().find(subscription.getId()); Assert.assertEquals(subscription.getId(), foundSubscription.getId()); Assert.assertEquals(subscription.getPostbackUrl(), foundSubscription.getPostbackUrl()); Assert.assertEquals(subscription.getCharges(), foundSubscription.getCharges()); Assert.assertEquals(subscription.getCreatedAt(), foundSubscription.getCreatedAt()); Assert.assertEquals(subscription.getCurrentPeriodEnd(), foundSubscription.getCurrentPeriodEnd()); Assert.assertEquals(subscription.getCurrentPeriodStart(), foundSubscription.getCurrentPeriodStart()); Assert.assertEquals(subscription.getCurrentTransaction(), foundSubscription.getCurrentTransaction()); Assert.assertEquals(subscription.getCustomer().getId(), foundSubscription.getCustomer().getId()); Assert.assertEquals(PaymentMethod.CREDIT_CARD, foundSubscription.getPaymentMethod()); Assert.assertEquals(subscription.getPlan().getId(), foundSubscription.getPlan().getId()); Assert.assertEquals(subscription.getStatus(), foundSubscription.getStatus()); Assert.assertEquals("some_metadata",foundSubscription.getMetadata().keySet().iterator().next()); Assert.assertEquals("123456",foundSubscription.getMetadata().values().iterator().next()); }
Source:
<code>public IPartHost getOrCreateHost( EntityPlayer player, int side, TileEntity te ) { World w = te.getWorldObj(); int x = te.xCoord; int y = te.yCoord; int z = te.zCoord; <START> if ( te instanceof IMultipartTile && this.canConvertTiles && player.getHeldItem().getItem() instanceof IPartItem ) <END> { Block blk = AEApi.instance().blocks().blockMultiPart.block(); ItemStack what = AEApi.instance().blocks().blockMultiPart.stack( 1 ); try { this.mergeIntoMicroblockContainer.invoke( null, what, player, w, x, y, z, side, blk, 0 ); } catch ( Throwable e ) { this.canConvertTiles = false; return null; } } TileEntity tx = w.getTileEntity( x, y, z ); if ( tx instanceof IPartHost ) return ( IPartHost ) tx; return null; }</code><technical_language>held item null</technical_language>

Target:
public IPartHost getOrCreateHost( EntityPlayer player, int side, TileEntity te ) { final World w = te.getWorldObj(); final int x = te.xCoord; final int y = te.yCoord; final int z = te.zCoord; final boolean isPartItem = player != null && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IPartItem; if ( te instanceof IMultipartTile && this.canConvertTiles && isPartItem ) { final Block blk = AEApi.instance().blocks().blockMultiPart.block(); final ItemStack what = AEApi.instance().blocks().blockMultiPart.stack( 1 ); try { this.mergeIntoMicroblockContainer.invoke( null, what, player, w, x, y, z, side, blk, 0 ); } catch ( Throwable e ) { this.canConvertTiles = false; return null; } } final TileEntity tx = w.getTileEntity( x, y, z ); if ( tx instanceof IPartHost ) return ( IPartHost ) tx; return null; }
Source:
<code>public String getPodPhase() { Pod pod = client.pods().inNamespace(namespace).withName(podName).get(); if (pod != null) { return pod.getStatus().getPhase(); } <START> return "Unkown"; <END> }</code><technical_language>typo</technical_language>

Target:
public String getPodPhase() { Pod pod = client.pods().inNamespace(namespace).withName(podName).get(); if (pod != null) { return pod.getStatus().getPhase(); } return "Unknown"; }
Source:
<code>public void testIncreaseStoragePoolMasterVersion() { <START> int result = dao.increaseStoragePoolMasterVersion(existingPool.getId()); <END> assertEquals(result, existingPool.getmaster_domain_version() + 1); }</code><technical_language>add a get DB here, updated there</technical_language>

Target:
public void testIncreaseStoragePoolMasterVersion() { int result = dao.increaseStoragePoolMasterVersion(existingPool.getId()); storage_pool dbPool = dao.get(existingPool.getId()); assertEquals(result, existingPool.getmaster_domain_version() + 1); assertEquals(result, dbPool.getmaster_domain_version()); }
Source:
<code>public <T> Iterable<T> map(Class<T> type, Response<RowModel> response) { Collection<T> result = new ArrayList<>(); RowModel model; while ((model = response.next()) != null) { if (model.variables().length > 1) { throw new RuntimeException( "Scalar response queries must only return one column. Make sure your cypher query only returns one item."); } for (int i = 0; i < model.variables().length; i++) { <START> final Object o = model.getValues()[0]; <END> T value = Optional.ofNullable(ConvertibleTypes.REGISTRY.get(type.getCanonicalName())) .map(ac -> (AttributeConverter<T, Object>)(type.isArray() ? ac.forArray : ac.forScalar)) .map(c -> c.toEntityAttribute(o)) .orElse((T)Utils.coerceTypes(type, o)); result.add((T) value); } } return result; }</code><technical_language>Extract this block a method. loop things: convert if adding list. levels of abstraction</technical_language>

Target:
public <T> Iterable<T> map(Class<T> type, Response<RowModel> response) { Collection<T> result = new ArrayList<>(); RowModel model; while ((model = response.next()) != null) { result.add(extractColumnValue(type, model)); } return result; }
Source:
<code>public ValueMatcher makeRowOffsetMatcher(final ImmutableBitmap rowBitmap) { final IntIterator iter = descending ? BitmapOffset.getReverseBitmapOffsetIterator(rowBitmap) : rowBitmap.iterator(); if(!iter.hasNext()) { <START> return new ValueMatcher() <END> { @Override public boolean matches() { return false; } }; } if (descending) { return new ValueMatcher() { int iterOffset = Integer.MAX_VALUE; @Override public boolean matches() { int currentOffset = holder.get().getOffset(); if (iterOffset == currentOffset) { return true; } if (iterOffset < currentOffset) { return false; } while (iter.hasNext()) { iterOffset = iter.next(); if (iterOffset == currentOffset) { return true; } else if (iterOffset < currentOffset) { return false; } } return false; } }; } else { return new ValueMatcher() { int iterOffset = -1; @Override public boolean matches() { int currentOffset = holder.get().getOffset(); if (iterOffset == currentOffset) { return true; } if (iterOffset > currentOffset) { return false; } while (iter.hasNext()) { iterOffset = iter.next(); if (iterOffset == currentOffset) { return true; } else if (iterOffset > currentOffset) { return false; } } return false; } }; } }</code><technical_language>BooleanValueMatcher(false)</technical_language>

Target:
public ValueMatcher makeRowOffsetMatcher(final ImmutableBitmap rowBitmap) { final IntIterator iter = descending ? BitmapOffset.getReverseBitmapOffsetIterator(rowBitmap) : rowBitmap.iterator(); if(!iter.hasNext()) { return new BooleanValueMatcher(false); } if (descending) { return new ValueMatcher() { int iterOffset = Integer.MAX_VALUE; @Override public boolean matches() { int currentOffset = holder.get().getOffset(); while (iterOffset > currentOffset && iter.hasNext()) { iterOffset = iter.next(); } return iterOffset == currentOffset; } }; } else { return new ValueMatcher() { int iterOffset = -1; @Override public boolean matches() { int currentOffset = holder.get().getOffset(); while (iterOffset < currentOffset && iter.hasNext()) { iterOffset = iter.next(); } return iterOffset == currentOffset; } }; } }
Source:
<code>public void setInstant(Instant instant) { <START> assert instant != null : "instant may not be null"; <END> this.instant = instant; }</code><technical_language>here. I new commit (except for merge master) in GH interface</technical_language>

Target:
public void setInstant(Instant instant) { this.instant = Objects.requireNonNull(instant,"instant may not be null"); }
Source:
<code>public void testJsonFunction() throws JsonProcessingException { String jsonString = "{" + " \"id\": \"7044885078\"," + " \"type\": \"CreateEvent\"," + " \"actor\": {" + " \"id\": 33500718," + " \"login\": \"dipper-github-icn-bom-cdg\"," + " \"display_login\": \"dipper-github-icn-bom-cdg\"," + " \"gravatar_id\": \"\"," + " \"url\": \"<LINK_1>\"," + " \"avatar_url\": \"<LINK_0>\"" + " }," + " \"repo\": {" + " \"id\": 112368043," + " \"name\": \"dipper-github-icn-bom-cdg/test-ruby-sample\"," + " \"url\": \"<LINK_2>\"" + " }," + " \"payload\": {" + " \"ref\": \"canary-test-7f3af0db-3ffa-4259-894f-950d2c76594b\"," + " \"ref_type\": \"branch\"," + " \"master_branch\": \"master\"," + " \"description\": null," + " \"pusher_type\": \"user\"" + " }," + " \"public\": true," + " \"created_at\": \"2018-01-01T11:12:53Z\"" + "}"; assertEquals(JsonFunctions.jsonPathString(jsonString, "$.actor.id"), "33500718"); <START> assertEquals(JsonFunctions.jsonPathLong(jsonString, "$.actor.id"), Long.valueOf(33500718L)); <END> assertEquals(JsonFunctions.jsonPathDouble(jsonString, "$.actor.id"), 33500718.0); }</code><technical_language>suggestion assertEquals(JsonFunctions.jsonPathLong(jsonString, "$.actor.id"), 33500718L);</technical_language>

Target:
public void testJsonFunction() throws JsonProcessingException { String jsonString = "{" + " \"id\": \"7044885078\"," + " \"type\": \"CreateEvent\"," + " \"actor\": {" + " \"id\": 33500718," + " \"login\": \"dipper-github-icn-bom-cdg\"," + " \"display_login\": \"dipper-github-icn-bom-cdg\"," + " \"gravatar_id\": \"\"," + " \"url\": \"<LINK_1>\"," + " \"avatar_url\": \"<LINK_0>\"" + " }," + " \"repo\": {" + " \"id\": 112368043," + " \"name\": \"dipper-github-icn-bom-cdg/test-ruby-sample\"," + " \"url\": \"<LINK_2>\"" + " }," + " \"payload\": {" + " \"ref\": \"canary-test-7f3af0db-3ffa-4259-894f-950d2c76594b\"," + " \"ref_type\": \"branch\"," + " \"master_branch\": \"master\"," + " \"description\": null," + " \"pusher_type\": \"user\"" + " }," + " \"public\": true," + " \"created_at\": \"2018-01-01T11:12:53Z\"" + "}"; assertEquals(JsonFunctions.jsonPathString(jsonString, "$.actor.id"), "33500718"); assertEquals(JsonFunctions.jsonPathLong(jsonString, "$.actor.id"), 33500718L); assertEquals(JsonFunctions.jsonPathDouble(jsonString, "$.actor.id"), 33500718.0); }
Source:
<code>public GlowLightningStrike(Random random, Location location, boolean effect) { super(location); this.effect = effect; <START> this.ticksToLive = random.nextInt(3) + 1; <END> this.random = random; }</code><technical_language>for verification this is correct change. I find information this number is supposed</technical_language>

Target:
public GlowLightningStrike(Random random, Location location, boolean effect) { super(location); this.effect = effect; this.ticksToLive = 30; this.random = random; }
Source:
<code><START> private boolean isCommit(String sql) { <END> return "COMMIT".equals(sql); }</code><technical_language>static</technical_language>

Target:
private static boolean isCommit(String sql) { return "COMMIT".equals(sql); }
Source:
<code>private boolean loadPropertiesFromFile(final String file) { if (CommonUtils.isEmpty(file)) { return false; } <START> if(file.startsWith(CLASSPATH_PREFIX)){ <END> String classpathFile = file.substring(CLASSPATH_PREFIX.length()); try { properties.load(this.getClass().getClassLoader().getResourceAsStream(classpathFile)); return true; } catch (IOException e) { LOGGER.warn("Unable to load properties for file {}", file, e); return false; } } FileInputStream fis = null; try { fis = new FileInputStream(file); this.properties.load(fis); return true; } catch (final IOException e) { LOGGER.warn("Unable to load properties for file {}", file, e); return false; } finally { CommonUtils.closeQuietly(fis); } }</code><technical_language>Indentation correct here</technical_language>

Target:
private boolean loadPropertiesFromFile(final String file) { if (CommonUtils.isEmpty(file)) { return false; } String filteredFile = filterFileName(file); if (filteredFile.startsWith(CLASSPATH_PREFIX)) { String classpathFile = filteredFile.substring(CLASSPATH_PREFIX.length()); try { properties.load(this.getClass().getClassLoader().getResourceAsStream(classpathFile)); return true; } catch (IOException e) { LOGGER.warn("Unable to load properties for file {}", filteredFile, e); return false; } } else { FileInputStream fis = null; try { fis = new FileInputStream(filteredFile); this.properties.load(fis); return true; } catch (final IOException e) { LOGGER.warn("Unable to load properties for file {}", filteredFile, e); return false; } finally { CommonUtils.closeQuietly(fis); } } }
Source:
<code>private String[] addStudentAuthenticationInfo(String[] params) { StudentAttributes unregStudent = StudentsLogic.inst().getStudentForEmail("idOfTypicalCourse1", "student6InCourse1@gmail.tmt"); <START> List<String> list = new ArrayList<String>(); <END> list.add(Const.ParamsNames.REGKEY); list.add(StringHelper.encrypt(unregStudent.key)); list.add(Const.ParamsNames.STUDENT_EMAIL); list.add(unregStudent.email); for (String s : params) { list.add(s); } return list.toArray(new String[list.size()]); }</code><technical_language>Revert this line</technical_language>

Target:
private String[] addStudentAuthenticationInfo(String[] params) { StudentAttributes unregStudent = StudentsLogic.inst().getStudentForEmail("idOfTypicalCourse1", "student6InCourse1@gmail.tmt"); List<String> list = new ArrayList<>(); list.add(Const.ParamsNames.REGKEY); list.add(StringHelper.encrypt(unregStudent.key)); list.add(Const.ParamsNames.STUDENT_EMAIL); list.add(unregStudent.email); for (String s : params) { list.add(s); } return list.toArray(new String[list.size()]); }
Source:
<code>private void replaceAntiCsrfTokenValueIfRequired(HttpMessage requestMessage, HttpMessage loginMsgWithFreshAcsrfToken) throws IOException { if(extAntiCsrf == null) { extAntiCsrf = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAntiCSRF.class); } List<AntiCsrfToken> antiCsrfTokensOfFirstLoginMsg = null; if(extAntiCsrf != null) { antiCsrfTokensOfFirstLoginMsg = extAntiCsrf.getTokens(requestMessage); } AntiCsrfToken antiCsrfTokenOfFirstLoginMsg = null; if(antiCsrfTokensOfFirstLoginMsg != null && antiCsrfTokensOfFirstLoginMsg.size() > 0) { antiCsrfTokenOfFirstLoginMsg = antiCsrfTokensOfFirstLoginMsg.get(0); } if (antiCsrfTokenOfFirstLoginMsg != null) { <START> String regeneratedAntiCsrfTokenValue = extAntiCsrf.getTokenValue(loginMsgWithFreshAcsrfToken, antiCsrfTokenOfFirstLoginMsg.getName()); <END> String requestBody = requestMessage.getRequestBody().toString(); if (regeneratedAntiCsrfTokenValue != null) { requestBody = requestBody.replace( antiCsrfTokenOfFirstLoginMsg.getValue(), paramEncoder.apply(regeneratedAntiCsrfTokenValue)); requestMessage.getRequestBody().setBody(requestBody); } } }</code><technical_language>need rework this method (replaceAntiCsrfTokenValueIfRequired) ensure able extract tokens if previously registered (i.e. ExtensionAntiCSRF.getTokensFromResponse loginMsgWithFreshAcsrfToken, instead of getTokens getTokenValue)</technical_language>

Target:
private void replaceAntiCsrfTokenValueIfRequired(HttpMessage requestMessage, HttpMessage loginMsgWithFreshAcsrfToken) { if(extAntiCsrf == null) { extAntiCsrf = Control.getSingleton().getExtensionLoader().getExtension(ExtensionAntiCSRF.class); } List<AntiCsrfToken> freshAcsrfTokens = null; if(extAntiCsrf != null) { freshAcsrfTokens = extAntiCsrf.getTokensFromResponse(loginMsgWithFreshAcsrfToken); } else { LOGGER.debug("ExtensionAntiCSRF is not available, skipping ACSRF replacing task"); return; } if(freshAcsrfTokens == null || freshAcsrfTokens.size() == 0) { if(LOGGER.isDebugEnabled()) { LOGGER.debug("No ACSRF token found in the response of " + loginMsgWithFreshAcsrfToken.getRequestHeader()); } return; } if(LOGGER.isDebugEnabled()) { LOGGER.debug("The login page has " + freshAcsrfTokens.size() + " ACSRF token(s)"); } String postRequestBody = requestMessage.getRequestBody().toString(); Map<String, String> parameters = extractParametersFromPostData(postRequestBody); if(parameters != null) { String oldAcsrfTokenValue = null; String replacedPostData = null; for (AntiCsrfToken antiCsrfToken : freshAcsrfTokens) { oldAcsrfTokenValue = parameters.get(antiCsrfToken.getName()); replacedPostData = postRequestBody.replace(oldAcsrfTokenValue, antiCsrfToken.getValue()); if(LOGGER.isDebugEnabled()) { LOGGER.debug("replaced " + oldAcsrfTokenValue + " old ACSRF token value with " + antiCsrfToken.getValue()); } } requestMessage.getRequestBody().setBody(replacedPostData); } else { LOGGER.debug("ACSRF token found but could not replace old value with fresh value"); } }
Source:
<code>public Properties lookupProperties(String key) { if (log.isDebugEnabled()) { log.debug("==> Repository fetch of resource with key : " + key); } key = appendPropertyFile(key); String resolvedRegKeyPath = resolveRegistryPath(key); URLConnection urlConnection; URL url = null; try { url = new URL(resolvedRegKeyPath); } catch (MalformedURLException e) { handleException("Invalid path '" + resolvedRegKeyPath + "' for URL", e); <START> } <END> if (url == null) { handleException("Unable to create URL for target resource : " + key); } if ("file".equals(url.getProtocol())) { try { url.openStream(); } catch (FileNotFoundException e) { return null; } catch (IOException e) { if (log.isDebugEnabled()) { log.debug("Error occurred while accessing registry resource: " + key, e); } return null; } } try { urlConnection = url.openConnection(); urlConnection.connect(); } catch (IOException e) { return null; } InputStream input = null; try { input = urlConnection.getInputStream(); } catch (IOException e) { handleException("Error when getting a stream from the URL", e); } if (input == null) { return null; } Properties result = new Properties(); try { result.load(input); } catch (IOException e) { log.error("Error in loading properties"); } finally { try { input.close(); } catch (IOException e) { log.error("Error in closing the input stream.", e); } } return result; }</code><technical_language>a try catch block here? throw exception wrap method a try catch block? WDYT</technical_language>

Target:
public Properties lookupProperties(String key) { if (log.isDebugEnabled()) { log.debug("==> Repository fetch of resource with key : " + key); } String resolvedRegKeyPath = resolveRegistryPath(key); URLConnection urlConnection; Properties result = new Properties(); try { resolvedRegKeyPath = getPropertyFilePath(resolvedRegKeyPath); URL url = new URL(resolvedRegKeyPath); if ("file".equals(url.getProtocol())) { url.openStream(); } urlConnection = url.openConnection(); urlConnection.connect(); try (InputStream input = urlConnection.getInputStream()) { if (input == null) { return null; } result.load(input); } } catch (MalformedURLException e) { handleException("Invalid path '" + resolvedRegKeyPath + "' for URL", e); } catch (IOException e) { log.error("Error in loading properties", e); return null; } return result; }
Source:
<code>public final String toString() { <START> return String.format("[OptionDescriptor %s, %d, %d, %s ]", <END> this.name, this.id, this.flags, this.description); }</code><technical_language>@ham1 , please refrain String#format? Technically speaking, regexps scene, string+string simpler in this case</technical_language>

Target:
public final String toString() { return "[OptionDescriptor " + name + ", " + id + ", " + flags + ", " + description + "]"; }
Source:
<code>private static ImmutableWorkerInfo selectFromEligibleWorkers(final Map<String, ImmutableWorkerInfo> eligibleWorkers) { <START> TreeSet<ImmutableWorkerInfo> sortedWorkers = Sets.newTreeSet( <END> Comparator.comparing(ImmutableWorkerInfo::getCurrCapacityUsed).reversed() ); sortedWorkers.addAll(eligibleWorkers.values()); return Iterables.getFirst(sortedWorkers, null); }</code><technical_language>this TreeSet is needed? simply find worker of max capacity</technical_language>

Target:
private static ImmutableWorkerInfo selectFromEligibleWorkers(final Map<String, ImmutableWorkerInfo> eligibleWorkers) { return eligibleWorkers.values().stream().max( Comparator.comparing(ImmutableWorkerInfo::getCurrCapacityUsed) ).orElse(null); }
Source:
<code>public void openAddInputWizardDialog() { final AddInputContractFromDataWizardDialog dialog = new AddInputContractFromDataWizardDialog(Display.getCurrent().getActiveShell(), new ContractInputGenerationWizard( (ContractContainer) selectionProvider.getAdapter(EObject.class), getEditingDomain(), repositoryAccessor, fieldToContractInputMappingOperationBuilder, fieldToContractInputMappingExpressionBuilder, BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore(), <START> sharedImages, new ContractInputGenerationInfoDialog()), <END> this, true); dialog.open(); }</code><technical_language>I understand passing Dialog in parameter. explain please</technical_language>

Target:
public void openAddInputWizardDialog() { final AddInputContractFromDataWizardDialog dialog = new AddInputContractFromDataWizardDialog(Display.getCurrent().getActiveShell(), new ContractInputGenerationWizard( (ContractContainer) selectionProvider.getAdapter(EObject.class), getEditingDomain(), repositoryAccessor, fieldToContractInputMappingOperationBuilder, fieldToContractInputMappingExpressionBuilder, BonitaStudioPreferencesPlugin.getDefault().getPreferenceStore(), sharedImages, new ContractInputGenerationInfoDialogFactory()), this, true); dialog.open(); }
Source:
<code><START> public void resetRoute(String id) throws Exception { <END> camelContext.getManagedCamelContext().reset(true); }</code><technical_language>This reset routes. need get managed route id, call reset guy</technical_language>

Target:
public void resetRoute(String id) throws Exception { ManagedRouteMBean resetRoute = camelContext.getManagedRoute(id, ManagedRouteMBean.class); resetRoute.reset(); }
Source:
<code>public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { String editPrefLabel = ""; switch(key) { case SUPERUSER_ENABLED: <START> editPrefLabel = GoogleAnalyticsFields.LABEL_DEV_MODE; <END> break; case ACTION_BAR_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_ACTION_BAR; break; case GRID_MENUS_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_GRID_MENUS; break; case NAV_UI_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_NAV_UI; break; case LIST_REFRESH_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_ENTITY_LIST_REFRESH; break; case NEWEST_APP_VERSION_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_NEWEST_APP_VERSION; break; case ENABLE_AUTO_LOGIN: editPrefLabel = GoogleAnalyticsFields.LABEL_AUTO_LOGIN; if (!isAutoLoginEnabled()) { DevSessionRestorer.clearPassword(sharedPreferences); } break; case ENABLE_SAVE_SESSION: editPrefLabel = GoogleAnalyticsFields.LABEL_SESSION_SAVING; if (!isSessionSavingEnabled()) { DevSessionRestorer.clearSession(); } break; case CSS_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_CSS; break; case MARKDOWN_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_MARKDOWN; break; case ALTERNATE_QUESTION_LAYOUT_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_IMAGE_ABOVE_TEXT; break; case FIRE_TRIGGERS_ON_SAVE: editPrefLabel = GoogleAnalyticsFields.LABEL_TRIGGERS_ON_SAVE; break; case HOME_REPORT_ENABLED: editPrefLabel = GoogleAnalyticsFields.LABEL_REPORT_BUTTON_ENABLED; break; } if (!"".equals(editPrefLabel)) { GoogleAnalyticsUtils.reportEditPref(GoogleAnalyticsFields.CATEGORY_DEV_PREFS, editPrefLabel, getEditPrefValue(key)); } }</code><technical_language>confused, build a big table of able create this table, right? I manually code in again</technical_language>

Target:
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { GoogleAnalyticsUtils.reportEditPref(GoogleAnalyticsFields.CATEGORY_DEV_PREFS, getEditPrefLabel(key), getEditPrefValue(key)); switch(key) { case ENABLE_AUTO_LOGIN: if (!isAutoLoginEnabled()) { DevSessionRestorer.clearPassword(sharedPreferences); } break; case ENABLE_SAVE_SESSION: if (!isSessionSavingEnabled()) { DevSessionRestorer.clearSession(); } break; } }