auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static private String anchorFromVc(final VariantContext vc) { final Genotype genotype = vc.getGenotype(0); if (genotype == null || !genotype.hasExtendedAttribute(VCFConstants.PHASE_SET_KEY) ) { return "Synthetic_"+vc.getContig()+"_"+vc.getStart(); } else { return "PhaseSet_"+vc.getContig()+"_"+genotype.getExtendedAttribute(VCFConstants.PHASE_SET_KEY); } }

Target:
static private String anchorFromVc(final VariantContext vc) { final Genotype genotype = vc.getGenotype(0); if (genotype == null || !genotype.hasExtendedAttribute(VCFConstants.PHASE_SET_KEY)) { return SYNTHETIC_PHASESET_PREFIX + "_" + vc.getContig() + "_" + vc.getStart(); } else { return PHASESET_PREFIX + "_" + vc.getContig() + "_" + genotype.getExtendedAttribute(VCFConstants.PHASE_SET_KEY); } }
Source:
public void dispose() { server.getSecurityRegistry().remove(getCurrentEndpoint()); server.getSecurityRegistry().remove(BAD_ENDPOINT); }

Target:
public void dispose() { super.dispose(); server.getSecurityRegistry().remove(getCurrentEndpoint()); server.getSecurityRegistry().remove(BAD_ENDPOINT); }
Source:
public void pack () { checkWidget(); int width = 0; if (buttonHandle != 0) { GtkRequisition requisition = new GtkRequisition (); if (parent.getHeaderVisible() && GTK.GTK_VERSION >= OS.VERSION (3, 8, 0) && !GTK.gtk_widget_get_visible(buttonHandle)) { GTK.gtk_widget_show(buttonHandle); gtk_widget_get_preferred_size (buttonHandle, requisition); GTK.gtk_widget_hide(buttonHandle); } else { gtk_widget_get_preferred_size (buttonHandle, requisition); } width = requisition.width; } if ((parent.style & SWT.VIRTUAL) != 0) { for (int i=0; i<parent.items.length; i++) { TableItem item = parent.items [i]; Rectangle itemBounds = item.getBounds(); Rectangle tableBounds = parent.getBounds(); boolean isVisible = false; if (parent.getHeaderVisible() && GTK.GTK_VERSION >= OS.VERSION (3, 8, 0) && !GTK.gtk_widget_get_visible(buttonHandle)) { isVisible = true; } if (itemBounds.y + itemBounds.height < tableBounds.height && itemBounds.y > 0) { isVisible = true; } if (item != null && item.cached && isVisible) { width = Math.max (width, parent.calculateWidth (handle, item.handle)); } } } else { long iter = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (GTK.gtk_tree_model_get_iter_first (parent.modelHandle, iter)) { do { width = Math.max (width, parent.calculateWidth (handle, iter)); } while (GTK.gtk_tree_model_iter_next(parent.modelHandle, iter)); } OS.g_free (iter); } setWidthInPixels(width); }

Target:
public void pack () { checkWidget(); int width = 0; if (buttonHandle != 0) { GtkRequisition requisition = new GtkRequisition (); if (parent.getHeaderVisible() && GTK.GTK_VERSION >= OS.VERSION (3, 8, 0) && !GTK.gtk_widget_get_visible(buttonHandle)) { GTK.gtk_widget_show(buttonHandle); gtk_widget_get_preferred_size (buttonHandle, requisition); GTK.gtk_widget_hide(buttonHandle); } else { gtk_widget_get_preferred_size (buttonHandle, requisition); } width = requisition.width; } if ((parent.style & SWT.VIRTUAL) != 0) { boolean calcWidth = false; Rectangle itemBounds = null; int tableHeight = 0; if (parent.isVisible()) { Rectangle tableBounds = parent.getBounds(); tableHeight = tableBounds.height - parent.getHeaderHeight(); } else { calcWidth = true; } for (int i=0; i<parent.items.length; i++) { TableItem item = parent.items [i]; if (itemBounds == null) itemBounds = item.getBounds(); boolean isVisible = false; if (!calcWidth) { int itemTopBound = itemBounds.y + itemBounds.height * i + i; int itemBottomBound = itemTopBound + itemBounds.height; isVisible = (itemTopBound > 0 && itemBottomBound < tableHeight); } if (item != null && item.cached && (isVisible || calcWidth)) { width = Math.max (width, parent.calculateWidth (handle, item.handle)); } } } else { long iter = OS.g_malloc (GTK.GtkTreeIter_sizeof ()); if (GTK.gtk_tree_model_get_iter_first (parent.modelHandle, iter)) { do { width = Math.max (width, parent.calculateWidth (handle, iter)); } while (GTK.gtk_tree_model_iter_next(parent.modelHandle, iter)); } OS.g_free (iter); } setWidthInPixels(width); }
Source:
public SyndFeedInfo remove(URL feedUrl) { try { String url = urlToString(feedUrl); FeedRecord record = feedRecordDataService.findByURL(url); if (record == null) { LOGGER.error("Trying to remove feedRecord for inexistent URL {}", feedUrl); return null; } LOGGER.debug("*** removing from cache *** {}", url); byte[] bytes = (byte[]) feedRecordDataService.getDetachedField(record, FEED_DATA); feedRecordDataService.delete(record); return feedRecordToFeedInfo(record); } catch (IOException | ClassNotFoundException | FeedException ex) { LOGGER.error(ex.getMessage(), ex); return null; } }

Target:
public SyndFeedInfo remove(URL feedUrl) { try { String url = FeedCacheUtils.urlToString(feedUrl); FeedRecord record = feedRecordDataService.findByURL(url); if (record == null) { LOGGER.error("Trying to remove feedRecord for inexistent URL {}", feedUrl); return null; } LOGGER.debug("*** removing from cache *** {}", url); feedRecordDataService.delete(record); return FeedCacheUtils.feedRecordToFeedInfo(record); } catch (IOException | ClassNotFoundException | FeedException ex) { LOGGER.error("Error removing FeedRecord from the databaase {}", ex.getMessage()); return null; } }
Source:
public void update_author_and_assignee_when_scm_is_activated() { createUser("user1", "User 1", "user1@email.com"); projectAnalysis.withProperties("sonar.scm.disabled", "true").run(); List<Issue> issues = searchIssues(); assertThat(issues).isNotEmpty(); for (Issue issue : issues) { assertThat(issue.author()).isEmpty(); } assertThat(search(IssueQuery.create().assigned(true)).list()).isEmpty(); projectAnalysis.run(); issues = searchIssues(); assertThat(issues).isNotEmpty(); for (Issue issue : issues) { if (issue.line() == 10) { assertThat(issue.author()).isEmpty(); } else { assertThat(issue.author()).isNotEmpty(); } } assertThat(search(IssueQuery.create().assignees("user1")).list()).hasSize(1); }

Target:
public void update_author_and_assignee_when_scm_is_activated() { createUser("user1", "User 1", "user1@email.com"); projectAnalysis.withProperties("sonar.scm.disabled", "true").run(); List<Issue> issues = searchIssues(); assertThat(issues).isNotEmpty(); assertThat(issues) .extracting(Issue::line, Issue::author) .containsExactlyInAnyOrder( tuple(1, ""), tuple(2, ""), tuple(3, ""), tuple(4, ""), tuple(5, ""), tuple(6, ""), tuple(7, ""), tuple(8, ""), tuple(9, ""), tuple(10, "")); assertThat(search(IssueQuery.create().assigned(true)).list()).isEmpty(); projectAnalysis.run(); issues = searchIssues(); assertThat(issues).isNotEmpty(); assertThat(issues) .extracting(Issue::line, Issue::author) .containsExactlyInAnyOrder( tuple(1, "user1"), tuple(2, "user2"), tuple(3, "user3name"), tuple(4, "user4name"), tuple(5, "user5@email.com"), tuple(6, "user6@email.com"), tuple(7, "user7scmaccount"), tuple(8, "user8scmaccount"), tuple(9, "user8scmaccount"), tuple(10, "")); assertThat(search(IssueQuery.create().assignees("user1")).list()).hasSize(1); }
Source:
public E remove(int index) { throw new UnsupportedOperationException("No delete in " + this.getClass().getName()); }

Target:
public E remove(int index) { throw new UnsupportedOperationException("No delete(int) in " + this.getClass().getName()); }
Source:
private BundleDescription[] mergeBundles(BundleDescription[] reResolve, BundleDescription[] removed) { if (reResolve == null) return removed; if (reResolve.length == 0) return reResolve; List<BundleDescription> result = new ArrayList<>(reResolve.length + removed.length); for (BundleDescription reResolve1 : reResolve) { result.add(reResolve1); } for (BundleDescription removed1 : removed) { boolean found = false; for (BundleDescription reResolve1 : reResolve) { if (removed1 == reResolve1) { found = true; break; } } if (!found) { result.add(removed1); } } return result.toArray(new BundleDescription[result.size()]); }

Target:
private BundleDescription[] mergeBundles(BundleDescription[] reResolve, BundleDescription[] removed) { if (reResolve == null) return removed; if (reResolve.length == 0) return reResolve; List<BundleDescription> result = new ArrayList<>(reResolve.length + removed.length); for (BundleDescription toRefresh : reResolve) { result.add(toRefresh); } for (BundleDescription removedDescription : removed) { boolean found = false; for (BundleDescription toRefresh : reResolve) { if (removedDescription == toRefresh) { found = true; break; } } if (!found) { result.add(removedDescription); } } return result.toArray(new BundleDescription[result.size()]); }
Source:
public void onInitializationComplete() { GlStateManager.disableTexture2D(); GlStateManager.enableTexture2D(); if (errorToDisplay != null) { GuiScreen errorScreen = errorToDisplay.createGui(); showGuiScreen(errorScreen); } else { logMissingTextureErrors(); if (!badTextureDomains.isEmpty() || !badResources.isEmpty()) { if ((Boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) { if (badTextureDomains.size() != 0) badResources.put("textures", badTextureDomains); showGuiScreen(new GuiResourceError(badResources)); } else FMLLog.log.warn("Skipped ResourceErrorScreen due to deobfusated Environement"); } } }

Target:
public void onInitializationComplete() { GlStateManager.disableTexture2D(); GlStateManager.enableTexture2D(); if (errorToDisplay != null) { GuiScreen errorScreen = errorToDisplay.createGui(); showGuiScreen(errorScreen); } else { logMissingTextureErrors(); if (FMLLaunchHandler.isDeobfuscatedEnvironment()) { badTextureDomains.forEach(domain -> trackBadResource("textures", domain)); if (showResourceErrorScreen) { showGuiScreen(new GuiResourceError(badResources)); } } } }
Source:
private GitModelObject[] getChildrenImpl() { List<GitModelObject> restult = new ArrayList<GitModelObject>(); try { if (gsds.size() == 1) { GitSynchronizeData gsd = gsds.iterator().next(); GitModelRepository repoModel = new GitModelRepository(gsd); return repoModel.getChildren(); } else for (GitSynchronizeData data : gsds) { GitModelRepository repoModel = new GitModelRepository(data); if (repoModel.getChildren().length > 0) restult.add(repoModel); } } catch (IOException e) { Activator.logError(e.getMessage(), e); } disposeOldChildren(); children = restult.toArray(new GitModelObject[restult.size()]); return children; }

Target:
private GitModelObject[] getChildrenImpl() { List<GitModelObject> result = new ArrayList<GitModelObject>(); try { if (gsds.size() == 1) { GitSynchronizeData gsd = gsds.iterator().next(); GitModelRepository repoModel = new GitModelRepository(gsd); return repoModel.getChildren(); } else for (GitSynchronizeData data : gsds) { GitModelRepository repoModel = new GitModelRepository(data); if (repoModel.getChildren().length > 0) result.add(repoModel); } } catch (IOException e) { Activator.logError(e.getMessage(), e); } disposeOldChildren(); children = result.toArray(new GitModelObject[result.size()]); return children; }
Source:
public ZkKeyBuilder(String pathPrefix) { if (Strings.isNullOrEmpty(pathPrefix)) { throw new SamzaException("Zk PathPrefix cannot be null or empty!"); } this.pathPrefix = pathPrefix.trim(); }

Target:
public ZkKeyBuilder(String pathPrefix) { if (pathPrefix != null && !pathPrefix.trim().isEmpty()) { this.pathPrefix = pathPrefix.trim(); } else { throw new IllegalArgumentException("Zk PathPrefix cannot be null or empty!"); } }
Source:
public MethodHandle find() { try { return resolve().asType(type); } catch (NoSuchMethodException | IllegalAccessException e) { throw new Error(e); } }

Target:
public MethodHandle find() { try { return resolve().asType(type); } catch (NoSuchMethodException | IllegalAccessException e) { throw new RuntimeException(e); } }
Source:
public static boolean acceptableAlleleBases(final byte[] bases, final boolean isReferenceAllele) { if ( wouldBeNullAllele(bases) ) return false; if ( wouldBeNoCallAllele(bases) || wouldBeSymbolicAllele(bases) ) return true; for (byte base : bases ) { switch (base) { case 'A': case 'C': case 'G': case 'T': case 'a': case 'c': case 'g': case 't': break; case 'N' : case 'n' : case '*': if (isReferenceAllele) break; else return false; default: return false; } } return true; }

Target:
public static boolean acceptableAlleleBases(final byte[] bases, final boolean isReferenceAllele) { if ( wouldBeNullAllele(bases) ) return false; if ( wouldBeNoCallAllele(bases) || wouldBeSymbolicAllele(bases) ) return true; if ( wouldBeStarAllele(bases) ) { if ( isReferenceAllele ) return false; else return true; } for (byte base : bases ) { switch (base) { case 'A': case 'C': case 'G': case 'T': case 'a': case 'c': case 'g': case 't': case 'N' : case 'n' : break; default: return false; } } return true; }
Source:
private void enableRTPExtension(byte extensionID, RTPExtension rtpExtension) { boolean active = !MediaDirection.INACTIVE.equals(rtpExtension.getDirection()); byte effectiveId = active ? extensionID : -1; String uri = rtpExtension.getURI().toString(); if (RTPExtension.ABS_SEND_TIME_URN.equals(uri)) { if (absSendTimeEngine != null) { absSendTimeEngine.setExtensionID(effectiveId); } RemoteBitrateEstimatorWrapper remoteBitrateEstimatorWrapper = getRemoteBitrateEstimator(); if (remoteBitrateEstimatorWrapper != null) { remoteBitrateEstimatorWrapper .setExtensionID(effectiveId & 0xFFFF); } } else if (RTPExtension.FRAME_MARKING_URN.equals(uri)) { frameMarkingsExtensionId = effectiveId; } else if (RTPExtension.ORIGINAL_HEADER_BLOCK_URN.equals(uri)) { ohbEngine.setExtensionID(effectiveId); } else if (RTPExtension.TRANSPORT_CC_URN.equals(uri)) { transportCCEngine.setExtensionID(effectiveId); } }

Target:
private void enableRTPExtension(byte extensionID, RTPExtension rtpExtension) { boolean active = !MediaDirection.INACTIVE.equals(rtpExtension.getDirection()); int effectiveId = active ? RTPUtils.as16Bits(extensionID) : -1; String uri = rtpExtension.getURI().toString(); if (RTPExtension.ABS_SEND_TIME_URN.equals(uri)) { if (absSendTimeEngine != null) { absSendTimeEngine.setExtensionID(effectiveId); } RemoteBitrateEstimatorWrapper remoteBitrateEstimatorWrapper = getRemoteBitrateEstimator(); if (remoteBitrateEstimatorWrapper != null) { remoteBitrateEstimatorWrapper .setAstExtensionID(effectiveId); } } else if (RTPExtension.FRAME_MARKING_URN.equals(uri)) { frameMarkingsExtensionId = effectiveId; } else if (RTPExtension.ORIGINAL_HEADER_BLOCK_URN.equals(uri)) { ohbEngine.setExtensionID(effectiveId); } else if (RTPExtension.TRANSPORT_CC_URN.equals(uri)) { transportCCEngine.setExtensionID(effectiveId); RemoteBitrateEstimatorWrapper remoteBitrateEstimatorWrapper = getRemoteBitrateEstimator(); if (remoteBitrateEstimatorWrapper != null) { remoteBitrateEstimatorWrapper.setTccExtensionID(effectiveId); } } }
Source:
private ArrayList<Location> getLocationsFromFile(String name) throws Exception { String fileName = getProperty("user.dir"); File file = new File(fileName + "/src/test/fixtures/" + name + ".txt"); String content = FileUtils.readFileToString(file, "UTF-8"); ArrayList<Location> allLocations = new ArrayList<Location>(); for(String locations: content.split("\n")) { String[] latLng = locations.split(","); Location location = new Location("test"); location.setLatitude(Double.valueOf(latLng[0])); location.setLongitude(Double.valueOf(latLng[1])); allLocations.add(location); } return allLocations; }

Target:
private ArrayList<Location> getLocationsFromFile(String name) throws Exception { String fileName = getProperty("user.dir"); File file = new File(fileName + "/src/test/fixtures/" + name + ".txt"); ArrayList<Location> allLocations = new ArrayList<Location>(); for(String locations: Files.readAllLines(file.toPath(), defaultCharset())) { String[] latLng = locations.split(","); Location location = new Location("test"); location.setLatitude(Double.valueOf(latLng[0])); location.setLongitude(Double.valueOf(latLng[1])); allLocations.add(location); } return allLocations; }
Source:
public void testPutInstantAsObject() { Object instant = Instant.now(); JsonObject jsonObject = new JsonObject(); jsonObject.put("instant", instant); }

Target:
public void testPutInstantAsObject() { Object instant = Instant.now(); JsonObject jsonObject = new JsonObject(); jsonObject.put("instant", instant); assertTrue(jsonObject.getValue("instant") instanceof String); }
Source:
public JCAOrderedLastSynchronizationList(Transaction tx, Map<Transaction, JCAOrderedLastSynchronizationList> jcaOrderedLastSynchronizations) { this.tx = tx; this.jcaOrderedLastSynchronizations = jcaOrderedLastSynchronizations; this.jcaOrderedLastSynchronizations.put(tx, this); }

Target:
public JCAOrderedLastSynchronizationList(Transaction tx, Map<Transaction, JCAOrderedLastSynchronizationList> jcaOrderedLastSynchronizations) { this.tx = tx; this.jcaOrderedLastSynchronizations = jcaOrderedLastSynchronizations; }
Source:
public SpongeLoreData(List<Text> lore) { super(LoreData.class); this.lore = lore; registerGettersAndSetters(); }

Target:
public SpongeLoreData(List<Text> lore) { super(LoreData.class); this.lore = Lists.newArrayList(lore); registerGettersAndSetters(); }
Source:
public boolean valid(IConfigurationElement element, IPreferenceNode node) { return PluginChecker.isTIS(); }

Target:
public boolean valid(IConfigurationElement element, IPreferenceNode node) { GlobalServiceRegister serviceRegister = GlobalServiceRegister.getDefault(); return PluginChecker.isTIS() || serviceRegister.isServiceRegistered(IHadoopUiService.class); }
Source:
protected void updateOperatorPlmn() { String imsi = getIMSI(); if (imsi != null) { if (((mMncLength == UNKNOWN) || (mMncLength == 2)) && imsi.length() >= 6) { String mccmncCode = imsi.substring(0, 6); for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { if (mccmnc.equals(mccmncCode)) { mMncLength = 3; log("IMSI: setting1 mMncLength=" + mMncLength); break; } } } if (mMncLength == UNKNOWN) { try { int mcc = Integer.parseInt(imsi.substring(0, 3)); mMncLength = MccTable.smallestDigitsMccForMnc(mcc); log("setting2 mMncLength=" + mMncLength); } catch (NumberFormatException e) { mMncLength = UNKNOWN; loge("Corrupt IMSI! setting3 mMncLength=" + mMncLength); } } if (mMncLength != UNKNOWN && mMncLength != UNINITIALIZED && imsi.length() >= 3 + mMncLength) { log("update mccmnc=" + imsi.substring(0, 3 + mMncLength)); MccTable.updateMccMncConfiguration(mContext, imsi.substring(0, 3 + mMncLength)); } } }

Target:
protected void updateOperatorPlmn() { String imsi = getIMSI(); if (imsi != null) { if (((mMncLength == UNKNOWN) || (mMncLength == 2)) && imsi.length() >= 6) { String mccmncCode = imsi.substring(0, 6); for (String mccmnc : MCCMNC_CODES_HAVING_3DIGITS_MNC) { if (mccmnc.equals(mccmncCode)) { mMncLength = 3; log("IMSI: setting1 mMncLength=" + mMncLength); break; } } } if (mMncLength == UNKNOWN) { try { int mcc = Integer.parseInt(imsi.substring(0, 3)); mMncLength = MccTable.smallestDigitsMccForMnc(mcc); log("setting2 mMncLength=" + mMncLength); } catch (NumberFormatException e) { loge("Corrupt IMSI! setting3 mMncLength=" + mMncLength); } } if (mMncLength != UNKNOWN && mMncLength != UNINITIALIZED && imsi.length() >= 3 + mMncLength) { log("update mccmnc=" + imsi.substring(0, 3 + mMncLength)); MccTable.updateMccMncConfiguration(mContext, imsi.substring(0, 3 + mMncLength)); } } }
Source:
protected void fetch(ResultSet from, int fromIndex) throws SQLException { java.sql.Timestamp timestamp = from.getTimestamp(fromIndex); if (timestamp != null) { value = Instant.ofEpochSecond(timestamp.getTime() / 1000, timestamp.getNanos()); } }

Target:
protected void fetch(ResultSet from, int fromIndex) throws SQLException { java.sql.Timestamp timestamp = from.getTimestamp(fromIndex); if (timestamp != null) { value = timestamp.toInstant(); } }
Source:
public ThriftContext(String namespace, List<String> includes, List<ThriftType> thriftTypes, List<ThriftServiceMetadata> thriftServices, Map<String, String> namespaceMap) { this.namespace = namespace; this.includes = includes; for (ThriftType t: thriftTypes) { switch (t.getProtocolType()) { case STRUCT: this.thriftStructs.add(t.getStructMetadata()); break; case ENUM: this.thriftEnums.add(t.getEnumMetadata()); break; default: throw new IllegalStateException("Unknown protocol type: " + t.getProtocolType()); } } this.thriftServices = thriftServices; for (Map.Entry<String, String> entry : namespaceMap.entrySet()) { customNamespaces.add(String.format("namespace %s %s", entry.getKey(), entry.getValue())); } }

Target:
public ThriftContext(String namespace, List<String> includes, List<ThriftType> thriftTypes, List<ThriftServiceMetadata> thriftServices, Map<String, String> namespaceMap) { this.namespace = namespace; this.includes = includes; for (ThriftType t: thriftTypes) { switch (t.getProtocolType()) { case STRUCT: this.thriftStructs.add(t.getStructMetadata()); break; case ENUM: this.thriftEnums.add(t.getEnumMetadata()); break; default: throw new IllegalStateException("Unknown protocol type: " + t.getProtocolType()); } } this.thriftServices = thriftServices; customNamespaces = namespaceMap; }
Source:
public User cacheExternalUserDetails(String sourceId, UserDetails springUser) { User user = springUser instanceof StrongboxUserDetails ? ((StrongboxUserDetails) springUser).getUser() : new UserData(springUser); String username = user.getUsername(); Optional<UserEntity> optionalUser = Optional.ofNullable(findByUsername(user.getUsername())); try { if (optionalUser.map(User::getSourceId).map(sourceId::equals).filter(Boolean.FALSE::equals).isPresent()) { deleteByUsername(optionalUser.map(u -> user.getUuid()).get()); optionalUser = Optional.empty(); } UserEntity userEntry = optionalUser.orElseGet(() -> new UserEntity(username)); if (!StringUtils.isBlank(user.getPassword())) { userEntry.setPassword(user.getPassword()); } userEntry.setEnabled(user.isEnabled()); userEntry.setRoles(user.getRoles()); userEntry.setSecurityTokenKey(user.getSecurityTokenKey()); userEntry.setLastUpdated(LocalDateTime.now()); userEntry.setSourceId(sourceId); return save(userEntry); } catch (SchemaViolationException e) { throw new UserAlreadyExistsException(String.format("Failed to cache external user from [%s], duplicate [%s] already exists.", sourceId, user.getUsername()), e); } }

Target:
public User cacheExternalUserDetails(String sourceId, UserDetails springUser) { User user = springUser instanceof StrongboxUserDetails ? ((StrongboxUserDetails) springUser).getUser() : new UserData(springUser); String username = user.getUsername(); Optional<UserEntity> optionalUser = Optional.ofNullable(findByUsername(user.getUsername())); try { if (optionalUser.map(User::getSourceId).map(sourceId::equals).filter(Boolean.FALSE::equals).isPresent()) { deleteByUsername(optionalUser.map(u -> user.getUuid()).get()); optionalUser = Optional.empty(); } UserEntity userEntry = optionalUser.orElseGet(() -> new UserEntity(username)); if (!StringUtils.isBlank(user.getPassword())) { userEntry.setPassword(user.getPassword()); } userEntry.setEnabled(user.isEnabled()); userEntry.setRoles(user.getRoles()); userEntry.setSecurityTokenKey(user.getSecurityTokenKey()); userEntry.setLastUpdated(LocalDateTimeInstance.now()); userEntry.setSourceId(sourceId); return userRepository.save(userEntry); } catch (SchemaViolationException e) { throw new UserAlreadyExistsException(String.format("Failed to cache external user from [%s], duplicate [%s] already exists.", sourceId, user.getUsername()), e); } }
Source:
public void testWithGroupDirectFilter() throws Exception { JsonObject params = buildParameterObject("direct", "users"); Map<String, Object> parameters = new HashMap<>(); parameters.put("params", params); LOG.info("params = {}",params.toString()); context.request().setParameterMap(parameters); servlet.doGet(context.request(), context.response()); assertEquals(context.response().getStatus(), 200); String output = context.response().getOutputAsString(); LOG.info(output); CSVParser parser = CSVParser.parse(output, CSVFormat.DEFAULT.withHeader()); assertAllUsersPresent(parser.getRecords(), "alice","bob"); }

Target:
public void testWithGroupDirectFilter() throws Exception { JsonObject params = buildParameterObject("direct", "users"); Map<String, Object> parameters = new HashMap<>(); parameters.put("params", params); context.request().setParameterMap(parameters); servlet.doGet(context.request(), context.response()); assertEquals(context.response().getStatus(), 200); String output = context.response().getOutputAsString(); CSVParser parser = CSVParser.parse(output, CSVFormat.DEFAULT.withHeader()); assertAllUsersPresent(parser.getRecords(), "alice","bob"); }
Source:
public void writeInterval(ByteBuffer buffer, long nodeStart) { HTVarInt.writeLong(buffer, fStart - nodeStart); HTVarInt.writeLong(buffer, fDuration); buffer.putInt(fAttribute); if (fStateValue != null) { @NonNull Object value = fStateValue; if (value instanceof Integer) { buffer.put(TYPE_INTEGER); buffer.putInt((int) value); } else if (value instanceof Long) { buffer.put(TYPE_LONG); buffer.putLong((long) value); } else if (value instanceof Double) { buffer.put(TYPE_DOUBLE); buffer.putDouble((double) value); } else if (value instanceof CustomStateValue) { buffer.put(TYPE_CUSTOM); int size = ((CustomStateValue) value).getSerializedSize(); buffer.putShort((short) size); ISafeByteBufferWriter safeBuffer = SafeByteBufferFactory.wrapWriter(buffer, size); ((CustomStateValue) value).serialize(safeBuffer); } else { String string; if (value instanceof String) { string = (String) value; } else { string = value.toString(); } if (string == null) { throw new IllegalStateException("Type: " + value.getClass() + " is not implemented in the state system"); } buffer.put(TYPE_STRING); byte[] strArray = string.getBytes(CHARSET); buffer.putShort((short) strArray.length); buffer.put(strArray); buffer.put((byte) 0); } } else { buffer.put(TYPE_NULL); } }

Target:
public void writeInterval(ByteBuffer buffer, long nodeStart) { HTVarInt.writeLong(buffer, fStart - nodeStart); HTVarInt.writeLong(buffer, fDuration); buffer.putInt(fAttribute); if (fStateValue != null) { @NonNull Object value = fStateValue; if (value instanceof Integer) { buffer.put(TYPE_INTEGER); buffer.putInt((int) value); } else if (value instanceof Long) { buffer.put(TYPE_LONG); buffer.putLong((long) value); } else if (value instanceof Double) { buffer.put(TYPE_DOUBLE); buffer.putDouble((double) value); } else if (value instanceof CustomStateValue) { buffer.put(TYPE_CUSTOM); int size = ((CustomStateValue) value).getSerializedSize(); buffer.putShort((short) size); ISafeByteBufferWriter safeBuffer = SafeByteBufferFactory.wrapWriter(buffer, size); ((CustomStateValue) value).serialize(safeBuffer); } else { String string = String.valueOf(value); buffer.put(TYPE_STRING); byte[] strArray = string.getBytes(CHARSET); buffer.putShort((short) strArray.length); buffer.put(strArray); buffer.put((byte) 0); } } else { buffer.put(TYPE_NULL); } }
Source:
private JcloudsLocation resolve(String spec) { return (JcloudsLocation) managementContext.getLocationRegistry().resolve("jclouds:"+spec); }

Target:
private JcloudsLocation resolve(String spec) { return (JcloudsLocation) managementContext.getLocationRegistry().resolve(new JcloudsLocationResolver().getPrefix() + ":" + spec); }
Source:
private Set<Path> getTrackerDirCompletedFiles() throws IOException { final Set<Path> completedFiles = new HashSet<>(); if (TrackingPolicy.TRACKER_DIR != trackingPolicy) { return completedFiles; } Path trackerDirPath = Paths.get(trackerDirectory.getPath()); Files.walkFileTree(trackerDirPath, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path candidate, BasicFileAttributes attrs) throws IOException { String fileName = candidate.getFileName().toString(); if (fileName.endsWith(completedSuffix)) { completedFiles.add(candidate.toAbsolutePath()); } return FileVisitResult.CONTINUE; } }); return completedFiles; }

Target:
private Set<Path> getTrackerDirCompletedFiles() throws IOException { final Set<Path> completedFiles = new HashSet<>(); if (TrackingPolicy.TRACKER_DIR != trackingPolicy) { return completedFiles; } Path trackerDirPath = trackerDirectory.toPath(); Files.walkFileTree(trackerDirPath, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path candidate, BasicFileAttributes attrs) throws IOException { String fileName = candidate.getFileName().toString(); if (fileName.endsWith(completedSuffix)) { completedFiles.add(candidate.toAbsolutePath()); } return FileVisitResult.CONTINUE; } }); return completedFiles; }
Source:
public void uploadServiceRecordDocument(MultipartHttpServletRequest request) throws IOException { String recordId = request.getParameter("serviceRecordId"); for (MultipartFile fileItem : getMultipartFiles(request)) { uploadFile(SequencerServiceRecord.class, recordId, fileItem); } }

Target:
public void uploadServiceRecordDocument(MultipartHttpServletRequest request) throws IOException { String recordId = request.getParameter("serviceRecordId"); if (recordId == null) { throw new IOException("Cannot upload file - serviceRecordId parameter missing or null"); } else if (requestManager.getSequencerServiceRecordById(Long.valueOf(recordId)) == null) { throw new IOException("Cannot upload file - service record does not exist"); } for (MultipartFile fileItem : getMultipartFiles(request)) { uploadFile(SequencerServiceRecord.class, recordId, fileItem); } }
Source:
public List<Reminder> getReminders() { RealmResults<Reminder> results = realm.where(Reminder.class) .findAllSorted("alarmTime", Sort.DESCENDING); ArrayList<Reminder> reminders = new ArrayList<>(); for (int i = 0; i < results.size(); i++) { reminders.add(results.get(i)); } return reminders; }

Target:
public List<Reminder> getReminders() { RealmResults<Reminder> results = realm.where(Reminder.class) .findAllSorted("alarmTime", Sort.DESCENDING); List<Reminder> reminders = new ArrayList<>(results.size()); for (int i = 0; i < results.size(); i++) { reminders.add(results.get(i)); } return reminders; }
Source:
private void renderScene() { GameWindow.clearWorld(); GameWindow.clearOverlay(); final Box track = new Box(3, 0.1, 500); track.setMaterial(new PhongMaterial(Color.WHITESMOKE)); GameWindow.addWorld(track); final Group entities = renderEntities(); GameWindow.addWorld(entities); GameWindow.addOverlay(new Text(0, 16, "Score: " + State.getScore())); GameWindow.addOverlay(new Text(0, 32, "Distance: " + State.getTrack().moduloDistance())); GameWindow.addOverlay(new Text(0, 48, "Coins: " + State.getCoins())); }

Target:
private void renderScene() { GameWindow.clearWorld(); GameWindow.clearOverlay(); final Box track = new Box(3, 0.1, 500); track.setMaterial(new PhongMaterial(Color.WHITESMOKE)); GameWindow.addWorld(track); final Group entities = renderEntities(); GameWindow.addWorld(entities); GameWindow.addOverlay(new Text(0, 16, "Score: " + State.getScore())); GameWindow.addOverlay(new Text(0, 32, "Distance: " + State.moduloDistance())); GameWindow.addOverlay(new Text(0, 48, "Coins: " + State.getCoins())); }
Source:
private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { return true; } if (getVm().isNotRunning()) { if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId())) { return false; } } else { if (oldVm.getLeaseStorageDomainId() == null) { VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId()); params.setVdsId(getVm().getRunOnVds()); params.setHotPlugLease(true); return runInternalAction(ActionType.AddVmLease, params).getSucceeded(); } runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())); } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); return true; }

Target:
private boolean updateVmLease() { if (Objects.equals(oldVm.getLeaseStorageDomainId(), newVmStatic.getLeaseStorageDomainId())) { return true; } if (getVm().isNotRunning()) { if (!addVmLease(newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId())) { return false; } } else { if (oldVm.getLeaseStorageDomainId() == null) { VmLeaseParameters params = new VmLeaseParameters(getStoragePoolId(), newVmStatic.getLeaseStorageDomainId(), newVmStatic.getId()); params.setVdsId(getVm().getRunOnVds()); params.setHotPlugLease(true); return runInternalAction(ActionType.AddVmLease, params).getSucceeded(); } boolean hotUnplugSucceeded = false; try { hotUnplugSucceeded = runVdsCommand(VDSCommandType.HotUnplugLease, new LeaseVDSParameters(getVm().getRunOnVds(), oldVm.getId(), oldVm.getLeaseStorageDomainId())).getSucceeded(); } catch (EngineException e) { log.error("Failure in hot unplugging a lease to VM {}, message: {}", oldVm.getId(), e.getMessage()); } if (!hotUnplugSucceeded) { auditLog(this, AuditLogType.HOT_UNPLUG_LEASE_FAILED); } } removeVmLease(oldVm.getLeaseStorageDomainId(), oldVm.getId()); return true; }
Source:
public static Instant expirationFromKeystore(String type, String password, byte[] content) { KeyStore ks; try { ks = KeyStore.getInstance(type); } catch (KeyStoreException e) { throw Throwables.propagate(e); } try { ks.load(new ByteArrayInputStream(content), password.toCharArray()); } catch (IOException | NoSuchAlgorithmException | CertificateException e) { return null; } Instant earliest = null; try { for (String alias : list(ks.aliases())) { Certificate[] chain = ks.getCertificateChain(alias); if (chain == null) { Certificate certificate = ks.getCertificate(alias); if (certificate == null) { continue; } chain = new Certificate[]{certificate}; } for (Certificate cert : chain) { if (cert instanceof X509Certificate) { X509Certificate c = (X509Certificate) cert; if (earliest == null || c.getNotAfter().toInstant().isBefore(earliest)) { earliest = c.getNotAfter().toInstant(); } } } } } catch (KeyStoreException e) { throw Throwables.propagate(e); } return earliest; }

Target:
@Nullable public static Instant expirationFromKeystore(String type, String password, byte[] content) { KeyStore ks; try { ks = KeyStore.getInstance(type); } catch (KeyStoreException e) { throw Throwables.propagate(e); } try { ks.load(new ByteArrayInputStream(content), password.toCharArray()); } catch (IOException | NoSuchAlgorithmException | CertificateException e) { logger.info("Failed to parse keystore", e); return null; } Instant earliest = null; try { for (String alias : list(ks.aliases())) { Certificate[] chain = ks.getCertificateChain(alias); if (chain == null) { Certificate certificate = ks.getCertificate(alias); if (certificate == null) { continue; } chain = new Certificate[]{certificate}; } for (Certificate cert : chain) { if (cert instanceof X509Certificate) { X509Certificate c = (X509Certificate) cert; if (earliest == null || c.getNotAfter().toInstant().isBefore(earliest)) { earliest = c.getNotAfter().toInstant(); } } } } } catch (KeyStoreException e) { throw Throwables.propagate(e); } return earliest; }
Source:
public <U, R> Queue<R> zipWith(Iterable<? extends U> that, BiFunction<? super T, ? super U, ? extends R> mapper) { Objects.requireNonNull(that, "that is null"); Objects.requireNonNull(mapper, "mapper is null"); return ofAll(toList().zipWith((Iterable<U>) that, mapper)); }

Target:
public <U, R> Queue<R> zipWith(Iterable<? extends U> that, BiFunction<? super T, ? super U, ? extends R> mapper) { Objects.requireNonNull(that, "that is null"); Objects.requireNonNull(mapper, "mapper is null"); return ofAll(toList().zipWith(that, mapper)); }
Source:
public void transferItem(final Ds3Client client, final BulkObject ds3Object) throws IOException { int numRetries = 0; for ( ; ; ) { try { putObjectTransferrer.transferItem(client, ds3Object); break; } catch (final Throwable t) { if(ExceptionClassifier.isUnrecoverableException(t) || ++numRetries >= NUM_TIMES_TO_RETRY) { throw t; } } } }

Target:
public void transferItem(final Ds3Client client, final BulkObject ds3Object) throws IOException { int numRetries = 0; while(true) { try { putObjectTransferrer.transferItem(client, ds3Object); break; } catch (final Throwable t) { if (ExceptionClassifier.isUnrecoverableException(t) || ++numRetries >= NUM_TIMES_TO_RETRY) { throw t; } } } }
Source:
public void transferFileDockerDaemon() { GenericContainer container = new GenericContainer( new ImageFromDockerfile() .withDockerfileFromBuilder(builder -> builder.from("alpine:3.3") .copy("bar", "/foo/") .cmd("ls", "-al", "/foo") .build() ).withFileFromFile("bar", new File("src/test/resources/mappable-resource/test-resource.txt"), 0754)) .withStartupCheckStrategy(new OneShotStartupCheckStrategy()); container.start(); String listing = container.getLogs(); assertThat("Listing shows that file is copied.", Arrays.asList(listing.split("\\n")), exactlyNItems(1, allOf(containsString("-rwxr-xr--"), containsString("bar")))); }

Target:
public void transferFileDockerDaemon() { final File theFile = new File("src/test/resources/mappable-resource/test-resource.txt"); try (GenericContainer container = new GenericContainer( new ImageFromDockerfile() .withDockerfileFromBuilder(builder -> builder.from("alpine:3.3") .copy(".", "/foo/") .cmd("ls", "-al", "/foo") .build() ).withFileFromFile("bar1", theFile) .withFileFromFile("./bar2", theFile) .withFileFromFile("../bar3", theFile) .withFileFromFile(".bar4", theFile) .withFileFromFile("..bar5", theFile) .withFileFromFile("xxx/../bar6", theFile) .withFileFromFile("x7/./bar7", theFile) .withFileFromFile("x8/././bar8", theFile) .withFileFromFile("x9/../../bar9", theFile)) .withStartupCheckStrategy(new OneShotStartupCheckStrategy())) { container.start(); final List<String> logLines = Arrays.asList(container.getLogs().split("\\n")); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar1"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar2"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar3"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" .bar4"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" ..bar5"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar6"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" x7"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" x8"))); assertThat("Listing shows that file is copied.", logLines, exactlyOnce(endsWith(" bar9"))); } }
Source:
public boolean handleApiPersistentConnection(HttpMessage msg, HttpInputStream httpIn, HttpOutputStream httpOut, String name, JSONObject params) throws ApiException { throw new ApiException(ApiException.Type.BAD_PCONN, name); }

Target:
public void handleApiPersistentConnection(HttpMessage msg, HttpInputStream httpIn, HttpOutputStream httpOut, String name, JSONObject params) throws ApiException { throw new ApiException(ApiException.Type.BAD_PCONN, name); }
Source:
protected Map[] getVmInfo(List<String> vmsToUpdate) { VDS vds = new VDS(); vds.setId(vdsManager.getVdsId()); return (Map[]) (getResourceManager().runVdsCommand(VDSCommandType.FullList, new FullListVDSCommandParameters(vds, vmsToUpdate)).getReturnValue()); }

Target:
protected Map[] getVmInfo(List<String> vmsToUpdate) { VDS vds = new VDS(); vds.setId(vdsManager.getVdsId()); Map[] result = {}; try { VDSReturnValue vdsReturnValue = getResourceManager().runVdsCommand(VDSCommandType.FullList, new FullListVDSCommandParameters(vds, vmsToUpdate)); if (vdsReturnValue.getSucceeded()) { result = (Map[]) (vdsReturnValue.getReturnValue()); } } catch (Exception e) { } return result; }
Source:
public boolean poll(MessageHandler handler) { Message<?> message = this.source.receive(); if (message == null) { return false; } AcknowledgmentCallback ackCallback = StaticMessageHeaderAccessor .getAcknowledgmentCallback(message); try { if (this.retryTemplate == null && this.errorChannel == null) { setAttributesIfNecessary(message); doHandleMessage(handler, message); } else if (this.retryTemplate == null) { try { setAttributesIfNecessary(message); doHandleMessage(handler, message); } catch (Exception e) { this.messagingTemplate.send(this.errorMessageStrategy.buildErrorMessage(e, null)); return false; } } else { this.retryTemplate.execute(context -> { setAttributesIfNecessary(message); doHandleMessage(handler, message); return null; }, this.recoveryCallback); } AckUtils.autoAck(ackCallback); return true; } catch (Exception e) { AckUtils.autoNack(ackCallback); throw (MessageHandlingException) e; } }

Target:
public boolean poll(MessageHandler handler) { Message<?> message = this.source.receive(); if (message == null) { return false; } AcknowledgmentCallback ackCallback = StaticMessageHeaderAccessor .getAcknowledgmentCallback(message); try { if (this.retryTemplate == null && this.errorChannel == null) { setAttributesIfNecessary(message); doHandleMessage(handler, message); } else if (this.retryTemplate == null) { try { setAttributesIfNecessary(message); doHandleMessage(handler, message); } catch (Exception e) { if (this.errorChannel != null) { this.messagingTemplate.send(this.errorChannel, this.errorMessageStrategy.buildErrorMessage(e, attributesHolder.get())); } else { throw e; } } } else { this.retryTemplate.execute(context -> { setAttributesIfNecessary(message); doHandleMessage(handler, message); return null; }, this.recoveryCallback); } return true; } catch (Exception e) { AckUtils.autoNack(ackCallback); if (e instanceof MessageHandlingException && ((MessageHandlingException) e).getFailedMessage().equals(message)) { throw (MessageHandlingException) e; } throw new MessageHandlingException(message, e); } finally { AckUtils.autoAck(ackCallback); } }
Source:
public void setFooterView(View footer) { mList.addFooterView(footer); mList.invalidate(); }

Target:
public void setFooterView(View footer) { mList.addFooterView(footer, null, false); mList.invalidate(); }
Source:
public Response createFromYaml( String data, @ApiParam(value = "Provide extended validation messages") @DefaultValue("false") @QueryParam("verbose") boolean verbose) throws ServerException, ConflictException, NotFoundException, ValidationException, BadRequestException { WorkspaceConfigImpl workspaceConfig; try { workspaceConfig = devfileManager.validateAndConvert(data, verbose); } catch (DevfileFormatException e) { throw new BadRequestException(e.getMessage()); } catch (JsonProcessingException e) { throw new ServerException(e.getMessage()); } final String namespace = EnvironmentContext.getCurrent().getSubject().getUserName(); WorkspaceImpl workspace = workspaceManager.createWorkspace(findAvailableName(workspaceConfig), namespace, emptyMap()); return Response.status(201) .entity(asDto(workspace).withLinks(linksGenerator.genLinks(workspace, getServiceContext()))) .build(); }

Target:
public Response createFromYaml( String data, @ApiParam(value = "Provide extended validation messages") @DefaultValue("false") @QueryParam("verbose") boolean verbose) throws ServerException, ConflictException, NotFoundException, ValidationException, BadRequestException { WorkspaceImpl workspace; try { Devfile devfile = devfileManager.parse(data, verbose); workspace = devfileManager.createWorkspace(devfile); } catch (DevfileFormatException e) { throw new BadRequestException(e.getMessage()); } catch (JsonProcessingException e) { throw new ServerException(e.getMessage()); } return Response.status(201) .entity(asDto(workspace).withLinks(linksGenerator.genLinks(workspace, getServiceContext()))) .build(); }
Source:
public void run() { try { double value = getSafely(); if (justReset) { synchronized (justReset) { justReset = false; } return; } if (output != null && isEnabled()) { output.pidWrite(value); } } catch (Exception e) { mcException = e; } }

Target:
public void run() { try { double value = getSafely(); synchronized (lock) { if (justReset) { justReset = false; return; } } if (output != null && isEnabled()) { output.pidWrite(value); } } catch (Exception e) { sensorException = e; } }
Source:
public int[] getDefaultJavadocTokens() { return new int[] { JavadocTokenTypes.JAVADOC, }; }

Target:
public int[] getDefaultJavadocTokens() { return getRequiredJavadocTokens(); }
Source:
VertxOptionsImpl(JsonObject json) { this.proxyOperationTimeout = json.getInteger("proxyOperationTimeout", DEFAULT_PROXYOPERATIONTIMEOUT); this.eventLoopPoolSize = json.getInteger("eventLoopPoolSize", DEFAULT_EVENTLOOPPOOLSIZE); this.workerPoolSize = json.getInteger("workerPoolSize", DEFAULT_WORKERPOOLSIZE); this.clustered = json.getBoolean("clustered", DEFAULT_CLUSTERED); this.clusterHost = json.getString("clusterHost", DEFAULT_CLUSTERHOST); this.clusterPort = json.getInteger("clusterPort", DEFAULT_CLUSTERPORT); this.internalBlockingPoolSize = json.getInteger("internalBlockingPoolSize", DEFAULT_INTERNALBLOCKINGPOOLSIZE); this.blockedThreadCheckPeriod = json.getLong("blockedThreadCheckPeriod", DEFAULT_BLOCKEDTHREADCHECKPERIOD); this.maxEventLoopExecuteTime = json.getLong("maxEventLoopExecuteTime", DEFAULT_MAXEVENTLOOPEXECUTETIME); this.maxWorkerExecuteTime = json.getLong("maxWorkerExecuteTime", DEFAULT_MAXWORKEREXECUTETIME); this.haEnabled = json.getBoolean("haEnabled", false); this.quorumSize = json.getInteger("quorumSize", DEFAULT_QUORUMSIZE); this.haGroup = json.getString("haGroup", null); this.metricsEnabled = json.getBoolean("metricsEnabled", DEFAULT_METRICS_ENABLED); this.jmxEnabled = json.getBoolean("jmxEnabled", DEFAULT_METRICS_ENABLED); this.jmxDomain = json.getString("jmxDomain"); }

Target:
VertxOptionsImpl(JsonObject json) { this.proxyOperationTimeout = json.getInteger("proxyOperationTimeout", DEFAULT_PROXYOPERATIONTIMEOUT); this.eventLoopPoolSize = json.getInteger("eventLoopPoolSize", DEFAULT_EVENTLOOPPOOLSIZE); this.workerPoolSize = json.getInteger("workerPoolSize", DEFAULT_WORKERPOOLSIZE); this.clustered = json.getBoolean("clustered", DEFAULT_CLUSTERED); this.clusterHost = json.getString("clusterHost", DEFAULT_CLUSTERHOST); this.clusterPort = json.getInteger("clusterPort", DEFAULT_CLUSTERPORT); this.internalBlockingPoolSize = json.getInteger("internalBlockingPoolSize", DEFAULT_INTERNALBLOCKINGPOOLSIZE); this.blockedThreadCheckPeriod = json.getLong("blockedThreadCheckPeriod", DEFAULT_BLOCKEDTHREADCHECKPERIOD); this.maxEventLoopExecuteTime = json.getLong("maxEventLoopExecuteTime", DEFAULT_MAXEVENTLOOPEXECUTETIME); this.maxWorkerExecuteTime = json.getLong("maxWorkerExecuteTime", DEFAULT_MAXWORKEREXECUTETIME); this.haEnabled = json.getBoolean("haEnabled", false); this.quorumSize = json.getInteger("quorumSize", DEFAULT_QUORUMSIZE); this.haGroup = json.getString("haGroup", null); this.metricsEnabled = json.getBoolean("metricsEnabled", DEFAULT_METRICS_ENABLED); this.jmxEnabled = json.getBoolean("jmxEnabled", DEFAULT_JMX_ENABLED); this.jmxDomain = json.getString("jmxDomain"); }
Source:
public void shouldReturnStatsSections_givenStatsSectionParameter() { List<String> nonStatsProperties = ALL_PROPERTIES; nonStatsProperties.removeAll(STATS_PROPERTIES); String actualResult = jedis.info("stats"); assertThat(actualResult).contains(STATS_PROPERTIES); assertThat(actualResult).doesNotContain(nonStatsProperties); }

Target:
public void shouldReturnStatsSections_givenStatsSectionParameter() { List<String> nonStatsProperties = new ArrayList<>(ALL_PROPERTIES); nonStatsProperties.removeAll(STATS_PROPERTIES); String actualResult = jedis.info("stats"); assertThat(actualResult).contains(STATS_PROPERTIES); assertThat(actualResult).doesNotContain(nonStatsProperties); }
Source:
@Test public void testPrefixList() { this.roundtrip("[] a"); }

Target:
@Test public void testPrefixList() { this.convert("[] a", "[a]"); }
Source:
public Payload payload() { Payload p = new Payload(); p.last_request_metrics = this; return p; }

Target:
public ClientTelemetryPayload payload() { ClientTelemetryPayload p = new ClientTelemetryPayload(); p.lastRequestMetrics = this; return p; }