auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static boolean isStringIndexExpression(@NotNull GoIndexOrSliceExpr expr) { GoType type = Optional.of(expr) .map(GoIndexOrSliceExpr::getExpression) .map(e -> e.getGoType(null)) .orElse(null); if (!GoTypeUtil.isString(type)) { return false; } Trinity<GoExpression, GoExpression, GoExpression> indices = expr.getIndices(); return indices.getSecond() == null && indices.getThird() == null && expr.getNode().getChildren(TokenSet.create(GoTypes.COLON)).length == 0; }

Target:
private static boolean isStringIndexExpression(@NotNull GoIndexOrSliceExpr expr) { GoExpression expression = expr.getExpression(); GoType type = expression != null ? expression.getGoType(null) : null; if (!GoTypeUtil.isString(type)) { return false; } Trinity<GoExpression, GoExpression, GoExpression> indices = expr.getIndices(); return indices.getSecond() == null && indices.getThird() == null && expr.getNode().getChildren(TokenSet.create(GoTypes.COLON)).length == 0; }
Source:
public static Error fromJson(JsonNode node) { if (node instanceof ObjectNode) { String e = null; String m = null; JsonNode x; x = ((ObjectNode) node).get("errorCode"); if (x != null) { e = x.asText(); } x = ((ObjectNode) node).get("msg"); if (x != null) { m = x.asText(); } Error ret = new Error(e, m); x = ((ObjectNode) node).get("context"); if (x != null) { StringTokenizer tok = new StringTokenizer(x.asText(), "/"); while (tok.hasMoreTokens()) { ret.pushContext(tok.nextToken()); } } return ret; } return null; }

Target:
public static Error fromJson(JsonNode node) { if (node instanceof ObjectNode) { String e = null; String m = null; String c = null; JsonNode x; x = ((ObjectNode) node).get("context"); if (x != null) { c = x.asText(); } x = ((ObjectNode) node).get("errorCode"); if (x != null) { e = x.asText(); } x = ((ObjectNode) node).get("msg"); if (x != null) { m = x.asText(); } return new Error(c, e, m); } return null; }
Source:
void initTable(ApplicationConstants constants) { getTable().enableColumnResizing(); getTable().addColumn(new BrickStatusColumn(), constants.empty(), "30px"); TextColumnWithTooltip<GlusterBrickEntity> volNameColumn = new TextColumnWithTooltip<GlusterBrickEntity>() { @Override public String getValue(GlusterBrickEntity object) { return object.getVolumeName(); } }; volNameColumn.makeSortable(new Comparator<GlusterBrickEntity>() { @Override public int compare(GlusterBrickEntity o1, GlusterBrickEntity o2) { return o1.getVolumeName().compareTo(o2.getVolumeName()); } }); getTable().addColumn(volNameColumn, constants.volumeName()); TextColumnWithTooltip<GlusterBrickEntity> brickDirColumn = new TextColumnWithTooltip<GlusterBrickEntity>() { @Override public String getValue(GlusterBrickEntity object) { return object.getBrickDirectory(); } }; brickDirColumn.makeSortable(new Comparator<GlusterBrickEntity>() { @Override public int compare(GlusterBrickEntity o1, GlusterBrickEntity o2) { return o1.getBrickDirectory().compareTo(o2.getBrickDirectory()); } }); getTable().addColumn(brickDirColumn, constants.brickDirectoryBricks(), "220px"); }

Target:
void initTable(ApplicationConstants constants) { getTable().enableColumnResizing(); getTable().addColumn(new BrickStatusColumn(), constants.empty(), "30px"); TextColumnWithTooltip<GlusterBrickEntity> volNameColumn = new TextColumnWithTooltip<GlusterBrickEntity>() { @Override public String getValue(GlusterBrickEntity object) { return object.getVolumeName(); } }; volNameColumn.makeSortable(); getTable().addColumn(volNameColumn, constants.volumeName()); TextColumnWithTooltip<GlusterBrickEntity> brickDirColumn = new TextColumnWithTooltip<GlusterBrickEntity>() { @Override public String getValue(GlusterBrickEntity object) { return object.getBrickDirectory(); } }; brickDirColumn.makeSortable(); getTable().addColumn(brickDirColumn, constants.brickDirectoryBricks(), "220px"); }
Source:
public int read(byte b[], int off, int len) throws IOException { if (currentOffset == messageReadSet.sizeInBytes(indexToRead)) { throw new IOException("Reached end of stream of message read set"); } ByteBuffer buf = ByteBuffer.wrap(b); ByteBufferOutputStream bufferStream = new ByteBufferOutputStream(buf); long sizeInBlobReadOptions = messageReadSet.sizeInBytes(indexToRead); long sizeToRead = sizeInBlobReadOptions == -1 ? buf.remaining() : Math.min(buf.remaining(), sizeInBlobReadOptions - currentOffset); long bytesWritten = messageReadSet.writeTo(indexToRead, Channels.newChannel(bufferStream), currentOffset, sizeToRead); currentOffset += bytesWritten; return (int) bytesWritten; }

Target:
public int read(byte b[], int off, int len) throws IOException { if (off < 0 || len < 0 || len > b.length - off) { throw new IndexOutOfBoundsException(); } if (currentOffset == messageReadSet.sizeInBytes(indexToRead)) { throw new IOException("Reached end of stream of message read set"); } ByteBuffer buf = ByteBuffer.wrap(b); ByteBufferOutputStream bufferStream = new ByteBufferOutputStream(buf); long sizeToRead = Math.min(len - off, messageReadSet.sizeInBytes(indexToRead) - currentOffset); long bytesWritten = messageReadSet.writeTo(indexToRead, Channels.newChannel(bufferStream), currentOffset, sizeToRead); currentOffset += bytesWritten; return (int) bytesWritten; }
Source:
public void verifyNoDomainForMemoryWhenDomainHasNoSpaceForClonedDisks() { when(validStorageDomainValidator.hasSpaceForClonedDisks(anyCollectionOf(DiskImage.class))) .thenReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)); verifyNoDomainForMemory(Arrays.asList(validStorageDomain)); }

Target:
public void verifyNoDomainForMemoryWhenDomainHasNoSpaceForClonedDisks() { when(validStorageDomainValidator.hasSpaceForClonedDisks(anyCollectionOf(DiskImage.class))) .thenReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DISK_SPACE_LOW_ON_STORAGE_DOMAIN)); verifyNoDomainForMemory(Collections.singletonList(validStorageDomain)); }
Source:
public void testWorkNonIdempotent() throws InterruptedException { MetricsTracker tracker = new MetricsTracker(); int duration = getDurationMillis() * 2; SleepWork work = new SleepWork(duration); work.setIdempotent(false); assertFalse(work.isIdempotent()); service.schedule(work); assertTrue(service.awaitCompletion(duration + 100, TimeUnit.MILLISECONDS)); tracker.assertDiff(0, 0, 1, 0); service.schedule(work); service.schedule(work); service.schedule(work); assertFalse(service.awaitCompletion(duration / 2, TimeUnit.MILLISECONDS)); assertTrue(service.awaitCompletion(duration * 3, TimeUnit.SECONDS)); tracker.assertDiff(0, 0, 4, 0); }

Target:
public void testWorkNonIdempotent() throws InterruptedException { MetricsTracker tracker = new MetricsTracker(); SleepWork work = new SleepWork(getDurationMillis()); work.setIdempotent(false); assertFalse(work.isIdempotent()); service.schedule(work); assertTrue(service.awaitCompletion(5000, TimeUnit.MILLISECONDS)); tracker.assertDiff(0, 0, 1, 0); service.schedule(work); service.schedule(work); service.schedule(work); assertFalse(service.awaitCompletion(getDurationMillis() / 2, TimeUnit.MILLISECONDS)); assertTrue(service.awaitCompletion(getDurationMillis() * 3, TimeUnit.SECONDS)); tracker.assertDiff(0, 0, 4, 0); }
Source:
public void removeBuddyAfterConnectRejection(UUID idOfRequestingUser, UUID buddyID) { User user = User.getRepository().findOne(idOfRequestingUser); Buddy buddy = getEntityByID(buddyID); if (buddy != null) { user.removeBuddy(buddy); } }

Target:
public void removeBuddyAfterConnectRejection(UUID idOfRequestingUser, UUID buddyID) { User user = User.getRepository().findOne(idOfRequestingUser); Buddy buddy = getEntityByID(buddyID); user.removeBuddy(buddy); }
Source:
protected void categorizeInvalidRows(Context context, Map<String, Pair<Long, List<Object>>> targetPkToSourceValues) { Set<Map.Entry<String, Pair<Long, List<Object>>>> entrySet = targetPkToSourceValues.entrySet(); Iterator<Map.Entry<String, Pair<Long, List<Object>>>> itr = entrySet.iterator(); while(itr.hasNext()) { Map.Entry<String, Pair<Long, List<Object>>> entry = itr.next(); Pair<Long, List<Object>> sourceValues = entry.getValue(); Long sourceTS = sourceValues.getFirst(); if (hasRowExpiredOnSource(sourceTS, ttl)) { context.getCounter(PhoenixScrutinyJobCounters.EXPIRED_ROW_COUNT).increment(1L); itr.remove(); } else if (isRowOlderThanMaxLookback(sourceTS)){ context.getCounter(PhoenixScrutinyJobCounters.BEYOND_MAX_LOOKBACK).increment(1L); } else { context.getCounter(PhoenixScrutinyJobCounters.INVALID_ROW_COUNT) .increment(1L); } } }

Target:
protected void categorizeInvalidRows(Context context, Map<String, Pair<Long, List<Object>>> targetPkToSourceValues) { Set<Map.Entry<String, Pair<Long, List<Object>>>> entrySet = targetPkToSourceValues.entrySet(); Iterator<Map.Entry<String, Pair<Long, List<Object>>>> itr = entrySet.iterator(); while(itr.hasNext()) { Map.Entry<String, Pair<Long, List<Object>>> entry = itr.next(); Pair<Long, List<Object>> sourceValues = entry.getValue(); Long sourceTS = sourceValues.getFirst(); if (hasRowExpiredOnSource(sourceTS, ttl)) { context.getCounter(PhoenixScrutinyJobCounters.EXPIRED_ROW_COUNT).increment(1L); itr.remove(); } else if (isRowOlderThanMaxLookback(sourceTS)) { context.getCounter(PhoenixScrutinyJobCounters.BEYOND_MAX_LOOKBACK_COUNT).increment(1L); } else { context.getCounter(PhoenixScrutinyJobCounters.INVALID_ROW_COUNT) .increment(1L); } } }
Source:
public void checkDeprecatedComponent(Component component) { JvmType type = component.getType(); if (type instanceof JvmAnnotationTarget && DeprecationUtil.isDeprecated((JvmAnnotationTarget) type)) { warning( "The '" + type.getQualifiedName() + "' is deprecated.", component, Mwe2Package.Literals.REFERRABLE__NAME, DEPRECATED_ELEMENT); } }

Target:
public void checkDeprecatedComponent(Component component) { JvmType type = component.getType(); if (type instanceof JvmAnnotationTarget && DeprecationUtil.isDeprecated((JvmAnnotationTarget) type)) { warning( "The '" + type.getQualifiedName() + "' is deprecated.", component, Mwe2Package.Literals.REFERRABLE__TYPE, DEPRECATED_ELEMENT); } }
Source:
public Optional<TokenCredentials> extract(WebContext context) { final Optional<String> header = context.getRequestHeader(this.headerName); if (!header.isPresent()) { return Optional.empty(); } if (!header.get().startsWith(this.prefixHeader)) { throw new CredentialsException("Wrong prefix for header: " + this.headerName); } final String headerWithoutPrefix = header.get().substring(this.prefixHeader.length()); return Optional.of(new TokenCredentials(headerWithoutPrefix)); }

Target:
public Optional<TokenCredentials> extract(WebContext context) { return context.getRequestHeader(this.headerName).map( header -> { if (!header.startsWith(this.prefixHeader)) { throw new CredentialsException("Wrong prefix for header: " + this.headerName); } final String headerWithoutPrefix = header.substring(this.prefixHeader.length()); return new TokenCredentials(headerWithoutPrefix); } ); }
Source:
public static long byteArrayToLong(byte[] b) { byte[] values = b; if (b.length < 8) { values = new byte[8]; int diff = 8 - b.length; for (int i = 0; i < diff; i++) values[i] = 0; for (int i = diff; i < 8; i++) values[i] = b[i - diff]; } return ((values[0] & 0xFF) << 56) | ((values[1] & 0xFF) << 48) | ((values[2] & 0xFF) << 40) | ((values[3] & 0xFF) << 32) | ((values[4] & 0xFF) << 24) | ((values[5] & 0xFF) << 16) | ((values[6] & 0xFF) << 8) | (values[7] & 0xFF); }

Target:
public static long byteArrayToLong(byte[] b) { if (b == null) throw new NullPointerException("Byte array cannot be null."); byte[] values = b; if (b.length < 8) { values = new byte[8]; int diff = 8 - b.length; for (int i = 0; i < diff; i++) values[i] = 0; for (int i = diff; i < 8; i++) values[i] = b[i - diff]; } return ((long)values[0] << 56) + ((long)(values[1] & 0xFF) << 48) + ((long)(values[2] & 0xFF) << 40) + ((long)(values[3] & 0xFF) << 32) + ((long)(values[4] & 0xFF) << 24) + ((values[5] & 0xFF) << 16) + ((values[6] & 0xFF) << 8) + (values[7] & 0xFF); }
Source:
public static Collection<Object[]> data() { KieServicesConfiguration restConfiguration = createKieServicesRestConfiguration(); Collection<Object[]> parameterData = new ArrayList<Object[]>(Arrays.asList(new Object[][] { {MarshallingFormat.JAXB, restConfiguration}, {MarshallingFormat.JSON, createKieServicesRestConfiguration(Collections.singletonMap(KieServerConstants.KIE_CONTENT_TYPE_HEADER, "application/json; fields=not_null"))}, {MarshallingFormat.XSTREAM, restConfiguration} } )); if (TestConfig.getRemotingUrl() != null && !TestConfig.skipJMS()) { KieServicesConfiguration jmsConfiguration = createKieServicesJmsConfiguration(); parameterData.addAll(Arrays.asList(new Object[][] { {MarshallingFormat.JAXB, jmsConfiguration}, {MarshallingFormat.JSON, jmsConfiguration}, {MarshallingFormat.XSTREAM, jmsConfiguration} }) ); } return parameterData; }

Target:
public static Collection<Object[]> data() { KieServicesConfiguration restConfiguration = createKieServicesRestConfiguration(); Collection<Object[]> parameterData = new ArrayList<Object[]>(Arrays.asList(new Object[][] { {MarshallingFormat.JAXB, restConfiguration}, {MarshallingFormat.JSON, restConfiguration}, {MarshallingFormat.XSTREAM, restConfiguration} } )); if (TestConfig.getRemotingUrl() != null && !TestConfig.skipJMS()) { KieServicesConfiguration jmsConfiguration = createKieServicesJmsConfiguration(); parameterData.addAll(Arrays.asList(new Object[][] { {MarshallingFormat.JAXB, jmsConfiguration}, {MarshallingFormat.JSON, jmsConfiguration}, {MarshallingFormat.XSTREAM, jmsConfiguration} }) ); } return parameterData; }
Source:
public void sendsEmail() throws Exception { final Postman postman = Mockito.mock(Postman.class); final MkBase base = new MkBase(); final Alias alias = new EmAlias(base.randomAlias(), postman); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("how are you?"); final ArgumentCaptor<Envelope> captor = ArgumentCaptor.forClass(Envelope.class); Mockito.verify(postman).send(captor.capture()); final Message msg = captor.getValue().unwrap(); MatcherAssert.assertThat(msg.getFrom().length, Matchers.is(1)); MatcherAssert.assertThat(msg.getAllRecipients().length, Matchers.is(1)); MatcherAssert.assertThat(msg.getSubject(), Matchers.startsWith("#1: ")); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); MimeMultipart.class.cast(msg.getContent()).writeTo(baos); MatcherAssert.assertThat( baos.toString(), Matchers.containsString("how are you") ); }

Target:
public void sendsEmail() throws Exception { final Postman postman = Mockito.mock(Postman.class); final MkBase base = new MkBase(); final Alias alias = new EmAlias(base.randomAlias(), postman); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.friends().invite(base.randomAlias().name()); bout.messages().post("how are you?"); final ArgumentCaptor<Envelope> captor = ArgumentCaptor.forClass(Envelope.class); Mockito.verify(postman).send(captor.capture()); final Message msg = captor.getValue().unwrap(); MatcherAssert.assertThat(msg.getFrom().length, Matchers.is(1)); MatcherAssert.assertThat(msg.getAllRecipients().length, Matchers.is(1)); MatcherAssert.assertThat(msg.getSubject(), Matchers.startsWith("#1: ")); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); MimeMultipart.class.cast(msg.getContent()).writeTo(baos); MatcherAssert.assertThat( baos.toString(), Matchers.containsString("how are you") ); }
Source:
public String processOtherSchemeScopes(String swaggerContent) throws APIManagementException { if (!isDefaultGiven(swaggerContent)) { Swagger swagger = getSwagger(swaggerContent); swagger = injectMgwThrottlingExtensionsToDefault(swagger); swagger = processLegacyScopes(swagger); swagger = injectOtherScopesToDefaultScheme(swagger); swagger = injectOtherResourceScopesToDefaultScheme(swagger); return getSwaggerJsonString(swagger); } return swaggerContent; }

Target:
public String processOtherSchemeScopes(String swaggerContent) throws APIManagementException { if (!isDefaultGiven(swaggerContent)) { Swagger swagger = getSwagger(swaggerContent); swagger = processLegacyScopes(swagger); swagger = injectOtherScopesToDefaultScheme(swagger); swagger = injectOtherResourceScopesToDefaultScheme(swagger); return getSwaggerJsonString(swagger); } return swaggerContent; }
Source:
private long internalGetOffset() { if (fIsScaled) { return (long) (fClockOffsetSeconds * getClockScale()) + fClockOffset; } return fClockOffsetSeconds + fClockOffset; }

Target:
private long internalGetOffset() { if (fIsScaled) { return (long) (fClockOffsetNanoSeconds * getClockAntiScale()) + fClockOffset; } return fClockOffsetNanoSeconds + fClockOffset; }
Source:
private static void write(String content, File file, Charset charset) throws IOException { Writer writer = new OutputStreamWriter(new FileOutputStream(file), charset); writer.write(content); writer.close(); }

Target:
private static void write(String content, File file, Charset charset) throws IOException { try (Writer writer = new OutputStreamWriter(new FileOutputStream(file), charset)) { writer.write(content); } }
Source:
private void extractFile(ZipInputStream zin, String fileName, File outdir) { try { OutputStream out = new FileOutputStream(outdir.getAbsolutePath() + File.separator + fileName); byte[] buffer = new byte[8192]; int len; while ((len = zin.read(buffer)) != -1) { out.write(buffer, 0, len); } out.close(); } catch (IOException e) { e.printStackTrace(); } }

Target:
private void extractFile(ZipInputStream zin, String fileName, File outdir) { OutputStream out = null; try { out = new FileOutputStream(outdir.getAbsolutePath() + File.separator + fileName); byte[] buffer = new byte[8192]; int len; while ((len = zin.read(buffer)) != -1) { out.write(buffer, 0, len); } } catch (IOException e) { e.printStackTrace(); } finally { try { if (out != null) { out.close(); } } catch (IOException e) { e.printStackTrace(); } } }
Source:
public void adjust(Mechanism mechanism) { if (mechanism.matches("delay") && mechanism.requireInteger()) { int count = mechanism.getValue().asInt(); if (count < getMin() || count > getMax()) { Debug.echoError("Delay value '" + count + "' is not valid. Must be between " + getMin() + " and " + getMax() + "."); return; } getRepeater().setDelay(count); } }

Target:
public void adjust(Mechanism mechanism) { if (mechanism.matches("delay") && mechanism.requireInteger()) { int delay = mechanism.getValue().asInt(); if (delay < getMin() || delay > getMax()) { Debug.echoError("Delay value '" + delay + "' is not valid. Must be between " + getMin() + " and " + getMax() + "."); return; } getRepeater().setDelay(delay); } }
Source:
public Long getTotalUserCount(){ return getUserCount(null); }

Target:
public Long getTotalUserCount(){ return getUserCount(""); }
Source:
public void onEventMainThread(UploadService.UploadErrorEvent event) { SiteModel site = getSelectedSite(); if (site != null) { if (event.post.getLocalSiteId() == site.getId()) { UploadUtils.onPostUploadedSnackbarHandler(getActivity(), getActivity().findViewById(R.id.coordinator), true, event.post, event.errorMessage, site, mDispatcher); } } }

Target:
public void onEventMainThread(UploadService.UploadErrorEvent event) { SiteModel site = getSelectedSite(); if (site != null && event.post != null) { if (event.post.getLocalSiteId() == site.getId()) { UploadUtils.onPostUploadedSnackbarHandler(getActivity(), getActivity().findViewById(R.id.coordinator), true, event.post, event.errorMessage, site, mDispatcher); } } }
Source:
public static ValidWriteIdList getTableValidWriteIdList(Configuration conf, String fullTableName) { String txnString = conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY); ValidTxnWriteIdList validTxnList = new ValidTxnWriteIdList(txnString); return validTxnList.getTableWriteIdList(fullTableName); }

Target:
public static ValidWriteIdList getTableValidWriteIdList(Configuration conf, String fullTableName) { String txnString = conf.get(ValidTxnWriteIdList.VALID_TABLES_WRITEIDS_KEY); ValidTxnWriteIdList validTxnList = new ValidTxnWriteIdList(txnString); return validTxnList.getTableValidWriteIdList(fullTableName); }
Source:
public void start(ServiceProvider serviceProvider) { timeSource = serviceProvider.getService(TimeSourceService.class); managementRegistry = serviceProvider.getService(ManagementRegistryService.class); configuration = managementRegistry.getConfiguration(); cacheManagerProviderService = serviceProvider.getService(CacheManagerProviderService.class); scheduledExecutorService = serviceProvider.getService(ExecutionService.class).getScheduledExecutor(DefaultCollectorService.class.getSimpleName()); cacheManagerProviderService.getCacheManager().registerListener(this); }

Target:
public synchronized void start(ServiceProvider serviceProvider) { timeSource = serviceProvider.getService(TimeSourceService.class).getTimeSource(); managementRegistry = serviceProvider.getService(ManagementRegistryService.class); configuration = managementRegistry.getConfiguration(); cacheManager = serviceProvider.getService(CacheManagerProviderService.class).getCacheManager(); scheduledExecutorService = serviceProvider.getService(ExecutionService.class).getScheduledExecutor(configuration.getCollectorExecutorAlias()); cacheManager.registerListener(this); }
Source:
public void setGenericPasswordForOptions(String service, String username, String password, Promise promise) { try { if (username == null || username.isEmpty() || password == null || password.isEmpty()) { throw new EmptyParameterException("you passed empty or null username/password"); } CipherStorage currentCipherStorage = getCipherStorageForCurrentAPILevel(); if (currentCipherStorage == null) { throw new CryptoFailedException("Unsupported Android SDK " + Build.VERSION.SDK_INT); } EncryptionResult result = currentCipherStorage.encrypt(service, username, password); prefsStorage.storeEncryptedEntry(service, result); promise.resolve("KeychainModule saved the data"); } catch (EmptyParameterException e) { Log.e(KEYCHAIN_MODULE, e.getMessage()); promise.reject(E_EMPTY_PARAMETERS, e); } catch (CryptoFailedException e) { Log.e(KEYCHAIN_MODULE, e.getMessage()); promise.reject(E_CRYPTO_FAILED, e); } }

Target:
public void setGenericPasswordForOptions(String service, String username, String password, Promise promise) { try { if (username == null || username.isEmpty() || password == null || password.isEmpty()) { throw new EmptyParameterException("you passed empty or null username/password"); } service = getDefaultServiceIfNull(service); CipherStorage currentCipherStorage = getCipherStorageForCurrentAPILevel(); EncryptionResult result = currentCipherStorage.encrypt(service, username, password); prefsStorage.storeEncryptedEntry(service, result); promise.resolve("KeychainModule saved the data"); } catch (EmptyParameterException e) { Log.e(KEYCHAIN_MODULE, e.getMessage()); promise.reject(E_EMPTY_PARAMETERS, e); } catch (CryptoFailedException e) { Log.e(KEYCHAIN_MODULE, e.getMessage()); promise.reject(E_CRYPTO_FAILED, e); } }
Source:
public Map<ObjectId, String> call() throws GitAPIException { try { Map<ObjectId, String> nonCommits = new HashMap<ObjectId, String>(); FIFORevQueue pending = new FIFORevQueue(); for (Ref ref : refs) { addRef(ref, nonCommits, pending); } addPrefixes(nonCommits, pending); int cutoff = minCommitTime() - COMMIT_TIME_SLOP; while (true) { NameRevCommit c = (NameRevCommit) pending.next(); if (c == null) break; if (c.getCommitTime() < cutoff) continue; boolean merge = c.getParentCount() > 1; long cost = c.cost + (merge ? MERGE_COST : 1); for (int i = 0; i < c.getParentCount(); i++) { NameRevCommit p = (NameRevCommit) walk.parseCommit(c.getParent(i)); if (p.tip == null || compare(c.tip, cost, p.tip, p.cost) < 0) { if (merge) { p.tip = c.format().append('^').append(i + 1).toString(); p.distance = 0; } else { p.tip = c.tip; p.distance = c.distance + 1; } p.cost = cost; pending.add(p); } } } Map<ObjectId, String> result = new LinkedHashMap<ObjectId, String>(revs.size()); for (ObjectId id : revs) { RevObject o = walk.parseAny(id); if (o instanceof NameRevCommit) { NameRevCommit c = (NameRevCommit) o; if (c.tip != null) result.put(id, simplify(c.format().toString())); } else { String name = nonCommits.get(id); if (name != null) result.put(id, simplify(name)); } } setCallable(false); walk.release(); return result; } catch (IOException e) { walk.reset(); throw new JGitInternalException(e.getMessage(), e); } }

Target:
public Map<ObjectId, String> call() throws GitAPIException { try { Map<ObjectId, String> nonCommits = new HashMap<ObjectId, String>(); FIFORevQueue pending = new FIFORevQueue(); for (Ref ref : refs) addRef(ref, nonCommits, pending); addPrefixes(nonCommits, pending); int cutoff = minCommitTime() - COMMIT_TIME_SLOP; while (true) { NameRevCommit c = (NameRevCommit) pending.next(); if (c == null) break; if (c.getCommitTime() < cutoff) continue; boolean merge = c.getParentCount() > 1; long cost = c.cost + (merge ? MERGE_COST : 1); for (int i = 0; i < c.getParentCount(); i++) { NameRevCommit p = (NameRevCommit) walk.parseCommit(c.getParent(i)); if (p.tip == null || compare(c.tip, cost, p.tip, p.cost) < 0) { if (merge) { p.tip = c.format().append('^').append(i + 1).toString(); p.distance = 0; } else { p.tip = c.tip; p.distance = c.distance + 1; } p.cost = cost; pending.add(p); } } } Map<ObjectId, String> result = new LinkedHashMap<ObjectId, String>(revs.size()); for (ObjectId id : revs) { RevObject o = walk.parseAny(id); if (o instanceof NameRevCommit) { NameRevCommit c = (NameRevCommit) o; if (c.tip != null) result.put(id, simplify(c.format().toString())); } else { String name = nonCommits.get(id); if (name != null) result.put(id, simplify(name)); } } setCallable(false); walk.release(); return result; } catch (IOException e) { walk.reset(); throw new JGitInternalException(e.getMessage(), e); } }
Source:
private RollingUpdateTaskResult rollingUpdateAwaitRunning(final DeploymentGroup deploymentGroup, final String host) { final ZooKeeperClient client = provider.get("rollingUpdateAwaitRunning"); final Map<JobId, TaskStatus> taskStatuses = getTaskStatuses(client, host); if (!taskStatuses.containsKey(deploymentGroup.getJobId())) { final Deployment deployment = getDeployment(host, deploymentGroup.getJobId()); if (deployment == null) { return RollingUpdateTaskResult.error("job was manually undeployed"); } if (isRolloutTimedOut(deploymentGroup, client)) { return RollingUpdateTaskResult.error("timed out while retrieving job status"); } return RollingUpdateTaskResult.TASK_IN_PROGRESS; } else if (!taskStatuses.get(deploymentGroup.getJobId()).getState() .equals(TaskStatus.State.RUNNING)) { if (isRolloutTimedOut(deploymentGroup, client)) { return RollingUpdateTaskResult.error("timed out waiting for job to reach RUNNING"); } return RollingUpdateTaskResult.TASK_IN_PROGRESS; } else { final Deployment deployment = getDeployment(host, deploymentGroup.getJobId()); if (deployment == null) { return RollingUpdateTaskResult.error("deployment for this job not found in zookeeper"); } else if (!Objects.equals(deployment.getDeploymentGroupName(), deploymentGroup.getName())) { return RollingUpdateTaskResult.error("job was already deployed, either manually or by a " + "different deployment group"); } return RollingUpdateTaskResult.TASK_COMPLETE; } }

Target:
private RollingUpdateTaskResult rollingUpdateAwaitRunning(final DeploymentGroup deploymentGroup, final String host) { final ZooKeeperClient client = provider.get("rollingUpdateAwaitRunning"); final Map<JobId, TaskStatus> taskStatuses = getTaskStatuses(client, host); if (!taskStatuses.containsKey(deploymentGroup.getJobId())) { final Deployment deployment = getDeployment(host, deploymentGroup.getJobId()); if (deployment == null) { return RollingUpdateTaskResult.error( "Job unexpectedly undeployed. Perhaps it was manually undeployed?"); } if (isRolloutTimedOut(deploymentGroup, client)) { return RollingUpdateTaskResult.error("timed out while retrieving job status"); } return RollingUpdateTaskResult.TASK_IN_PROGRESS; } else if (!taskStatuses.get(deploymentGroup.getJobId()).getState() .equals(TaskStatus.State.RUNNING)) { if (isRolloutTimedOut(deploymentGroup, client)) { return RollingUpdateTaskResult.error("timed out waiting for job to reach RUNNING"); } return RollingUpdateTaskResult.TASK_IN_PROGRESS; } else { final Deployment deployment = getDeployment(host, deploymentGroup.getJobId()); if (deployment == null) { return RollingUpdateTaskResult.error( "deployment for this job not found in zookeeper. Perhaps it was manually undeployed?"); } else if (!Objects.equals(deployment.getDeploymentGroupName(), deploymentGroup.getName())) { return RollingUpdateTaskResult.error("job was already deployed, either manually or by a " + "different deployment group"); } return RollingUpdateTaskResult.TASK_COMPLETE; } }
Source:
public U action(TestContext testContext, U testDto, FreeIPAClient client) throws Exception { int retries = 0; U result = null; while (retries >= testDto.getWaitUtil().getMaxRetry()) { try { result = freeIPAAction(testContext, testDto, client); } catch (Exception e) { LOGGER.info("Exception during executing FreeIPA action: ", e); if (e.getMessage().contains("Flows under operation")) { waitTillFlowInOperation(testDto.getWaitUtil()); retries++; } else { throw e; } } } return result; }

Target:
public U action(TestContext testContext, U testDto, FreeIPAClient client) throws Exception { int retries = 0; while (retries <= testDto.getWaitUtil().getMaxRetry()) { try { return freeIPAAction(testContext, testDto, client); } catch (InternalServerErrorException e) { String message = e.getResponse().readEntity(String.class); LOGGER.info("Exception during executing FreeIPA action: ", e); if (message.contains("Flows under operation")) { waitTillFlowInOperation(testDto.getWaitUtil()); retries++; } else { throw e; } } } throw new Exception("Exception during executing FreeIPA action: exceeding maxrety during waiting for flow"); }
Source:
public String getMobileUri() { return getUriForDomain(getSite().authority()).replaceFirst("\\.", ".m."); }

Target:
public String getMobileUri() { return getUriForDomain(getSite().mobileAuthority()); }
Source:
public static Object safeEGet(EObject object, EStructuralFeature feature) { final EClass clazz = object.eClass(); if (clazz.getEPackage() == feature.getEContainingClass().getEPackage()) { return object.eGet(feature, false); } final EStructuralFeature clazzFeature = clazz.getEStructuralFeature(feature.getName()); if (clazzFeature == null && object instanceof AnyType) { for (Entry entry : ((AnyType)object).getAnyAttribute()) { if (entry.getEStructuralFeature().getName().equals(feature.getName())) { return entry.getValue(); } } return feature.getDefaultValue(); } return object.eGet(clazzFeature, false); }

Target:
public static Object safeEGet(EObject object, EStructuralFeature feature) { final EClass clazz = object.eClass(); if (clazz.getEPackage() == feature.getEContainingClass().getEPackage()) { return object.eGet(feature, false); } return object.eGet(clazz.getEStructuralFeature(feature.getName()), false); }
Source:
public void filterBatches() { currentBatches = new ArrayList<>(); List<Batch> batches = new ArrayList<>(); try { batches = ServiceManager.getBatchService().getAll(); } catch (DAOException e) { logger.error(e); } for (Batch batch : batches) { if (ServiceManager.getBatchService().contains(batch, batchfilter)) { currentBatches.add(batch); } } for (Batch batch : this.currentBatches) { ServiceManager.getBatchService().toString(batch); } }

Target:
public void filterBatches() { currentBatches = new ArrayList<>(); List<Batch> batches = new ArrayList<>(); try { batches = ServiceManager.getBatchService().getAll(); } catch (DAOException e) { logger.error(e); } for (Batch batch : batches) { if (ServiceManager.getBatchService().contains(batch, batchfilter)) { currentBatches.add(batch); } } for (Batch batch : this.currentBatches) { ServiceManager.getBatchService().createLabel(batch); } }
Source:
public Set adviseAllServersWithInterest() { return adviseFilter(profile -> { CacheProfile prof = (CacheProfile) profile; return prof.hasCacheServer && prof.filterProfile != null && prof.filterProfile.hasInterest(); }); }

Target:
Set adviseAllServersWithInterest() { return adviseFilter(profile -> { CacheProfile prof = (CacheProfile) profile; return prof.hasCacheServer && prof.filterProfile != null && prof.filterProfile.hasInterest(); }); }
Source:
public void putObject(String bucketName, String objectName, InputStream stream, long size, ServerSideEncryption sse) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException, InsufficientDataException { if ((sse.getType() == ServerSideEncryption.Type.SSE_C) && (!this.baseUrl.isHttps())) { throw new InvalidArgumentException("SSE_C provided keys must be made over a secure connection."); } Map<String, String> headers = new HashMap<>(); sse.marshal(headers); putObject(bucketName, objectName, size, new BufferedInputStream(stream), headers); }

Target:
public void putObject(String bucketName, String objectName, InputStream stream, long size, ServerSideEncryption sse) throws InvalidBucketNameException, NoSuchAlgorithmException, InsufficientDataException, IOException, InvalidKeyException, NoResponseException, XmlPullParserException, ErrorResponseException, InternalException, InvalidArgumentException, InsufficientDataException { if ((sse.getType() == (ServerSideEncryption.Type.SSE_C)) && (!this.baseUrl.isHttps())) { throw new InvalidArgumentException("SSE_C operations must be performed over a secure connection."); } else if ((sse.getType() == (ServerSideEncryption.Type.SSE_KMS)) && (!this.baseUrl.isHttps())) { throw new InvalidArgumentException("SSE_KMS operations must be performed over a secure connection."); } Map<String, String> headers = new HashMap<>(); sse.marshal(headers); putObject(bucketName, objectName, size, new BufferedInputStream(stream), headers); }
Source:
public CompletableFuture<?> add(Object id, Object entity) { Class<?> clazz = introspector.getClass( entity ); PojoTypeWorkExecutor indexWork = this.indexWorkExecutor.get( clazz ); if ( indexWork == null ) { indexWork = createIndexWork( clazz ); indexWorkExecutor.put( clazz, indexWork ); } return indexWork.add( id, entity ); }

Target:
public CompletableFuture<?> add(Object id, Object entity) { Class<?> clazz = introspector.getClass( entity ); PojoTypeDocumentWorkExecutor<?, ?, ?> typeExecutor = this.typeExecutors.get( clazz ); if ( typeExecutor == null ) { typeExecutor = createTypeDocumentExecutor( clazz ); typeExecutors.put( clazz, typeExecutor ); } return typeExecutor.add( id, entity ); }
Source:
public static void checkDestinationType(Destination destination) throws WrongPatternException { String destinationType = destination.getType(); if ( ( !destinationType.equals(Destination.DESTINATIONHOSTTYPE) && (!destinationType.equals(Destination.DESTINATIONEMAILTYPE)) && (!destinationType.equals(Destination.DESTINATIONSEMAILTYPE)) && (!destinationType.equals(Destination.DESTINATIONURLTYPE)) && (!destinationType.equals(Destination.DESTINATIONUSERHOSTTYPE)) && (!destinationType.equals(Destination.DESTINATIONUSERHOSTPORTTYPE)) && (!destinationType.equals(Destination.DESTINATIONSERVICESPECIFICTYPE))) ) { throw new WrongPatternException("Destination type " + destinationType + " is not supported."); } }

Target:
public static void checkDestinationType(Destination destination) throws InternalErrorException, WrongPatternException { if (destination == null) { throw new InternalErrorException("Destination is null."); } String destinationType = destination.getType(); if ((!destinationType.equals(Destination.DESTINATIONHOSTTYPE) && (!destinationType.equals(Destination.DESTINATIONEMAILTYPE)) && (!destinationType.equals(Destination.DESTINATIONSEMAILTYPE)) && (!destinationType.equals(Destination.DESTINATIONURLTYPE)) && (!destinationType.equals(Destination.DESTINATIONUSERHOSTTYPE)) && (!destinationType.equals(Destination.DESTINATIONUSERHOSTPORTTYPE)) && (!destinationType.equals(Destination.DESTINATIONSERVICESPECIFICTYPE)))) { throw new WrongPatternException("Destination type " + destinationType + " is not supported."); } }
Source:
public void close() { try { temporaryOutput.close(); try (InputStream in = Files.newInputStream(temporaryPath); OutputStream conclusiveOutput = new GZIPOutputStream(Files.newOutputStream(conclusivePath, CREATE, APPEND), 16*1024)) { ByteStreams.copy(in, conclusiveOutput); conclusiveOutput.close(); temporaryPath.toFile().delete(); } } catch (IOException ex) { throw Throwables.propagate(ex); } }

Target:
public void close() { try { output.close(); if (realtimeFollow) { try (InputStream in = Files.newInputStream(temporaryPath); OutputStream out = new GZIPOutputStream(Files.newOutputStream(path, CREATE, APPEND), 16*1024)) { ByteStreams.copy(in, out); } } } catch (IOException ex) { throw Throwables.propagate(ex); } finally { if (realtimeFollow) { temporaryPath.toFile().delete(); } } }
Source:
private static void copy(final Reader input, final Writer output) throws IOException { char[] buffer = new char[1 << 12]; for (int n; (n = input.read(buffer)) >= 0;) { output.write(buffer, 0, n); } }

Target:
private static void copy(final Reader input, final Writer output) throws IOException { char[] buffer = new char[4096]; for (int length; (length = input.read(buffer)) >= 0;) { output.write(buffer, 0, length); } }
Source:
protected Control createDialogArea(final Composite parent) { initializeDialogUnits(parent); final Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(GridLayoutFactory.swtDefaults().create()); new Label(composite, SWT.NONE) .setText(UIText.CreateTagDialog_tagMessage); messageText = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL); messageText.setLayoutData(GridDataFactory.fillDefaults().span(2, 1) .grab(true, true).hint(400, 100).create()); messageText.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent arg0) { if (arg0.keyCode == SWT.CR && (arg0.stateMask & SWT.CONTROL) > 0) { Control button = getButton(IDialogConstants.OK_ID); if (null != button && button.isEnabled()) buttonPressed(IDialogConstants.OK_ID); } else if (arg0.keyCode == SWT.TAB && (arg0.stateMask & SWT.SHIFT) == 0) { arg0.doit = false; messageText.traverse(SWT.TRAVERSE_TAB_NEXT); } validateInput(); } }); overwriteButton = new Button(composite, SWT.CHECK); overwriteButton.setText(UIText.CreateTagDialog_overwriteTag); overwriteButton .setToolTipText(UIText.CreateTagDialog_overwriteTagToolTip); overwriteButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (overwriteButton.getSelection()) { Control button = getButton(IDialogConstants.OK_ID); button.setEnabled(true); } else { validateInput(); } } }); createAdvancedSection(composite); if (null != tag) { setTagImpl(); } validateInput(); applyDialogFont(parent); return composite; }

Target:
protected Control createDialogArea(final Composite parent) { initializeDialogUnits(parent); SashForm mainForm = new SashForm(parent, SWT.HORIZONTAL); mainForm.setLayoutData(GridDataFactory.swtDefaults().indent(5, 5).create()); createLeftSection(mainForm); createExistingTagsSection(mainForm); mainForm.setWeights(new int[] {70, 30}); if (null != tag) { setTagImpl(); } validateInput(); applyDialogFont(parent); return mainForm; }
Source:
private boolean isLogDataValid(long address, ILogData logData, boolean throwException) { if (logData == null || logData.getType() == DataType.EMPTY) { throw new RuntimeException("Unexpected return of empty data at address " + address + " on read"); } if (logData.isTrimmed()) { if (throwException) { throw new TrimmedException(Collections.singletonList(address)); } return false; } return true; }

Target:
private boolean isLogDataValid(long address, ILogData logData, boolean throwException) { if (logData == null || logData.getType() == DataType.EMPTY) { throw new RuntimeException("Unexpected return of empty data at address " + address + " on read"); } if (logData.isTrimmed()) { if (throwException) { throw new TrimmedException(address); } return false; } return true; }
Source:
public void testConnectionOnAfterGetConnectionAfterGettingFromDriverWithThrowingSQLException() throws SQLException { try { DriverManager.getConnection("jdbc:p6spy:h2:tcp://dev/null/", "sa", null); } catch (SQLException expected) { } verify(mockedJdbcListener).onAfterGetConnection(connectionInformationWithoutConnection(), any(SQLException.class)); }

Target:
public void testConnectionOnAfterGetConnectionAfterGettingFromDriverWithThrowingSQLException() throws SQLException { try { DriverManager.getConnection("jdbc:p6spy:h2:tcp://dev/null/", "sa", null); Assert.fail("exception should be thrown"); } catch (SQLException expected) { } verify(mockedJdbcListener).onAfterGetConnection(connectionInformationWithoutConnection(), any(SQLException.class)); }
Source:
private static Map<String, String> toMap(final Iterable<RuleFlowGroup> groups) { Map<String, String> result = new HashMap<>(); for (RuleFlowGroup group : groups) { if (result.containsKey(group.getName())) { String project = getProjectFromPath(group.getPathUri()); if (!result.get(group.getName()).contains(project)) { result.put(group.getName(), addProjectToDescription(result.get(group.getName()), project)); } } else { result.put(group.getName(), getGroupDescription(group)); } } return result; }

Target:
private static Map<String, String> toMap(final Iterable<RuleFlowGroup> groups) { Map<String, String> result = new HashMap<>(); for (RuleFlowGroup group : groups) { if (result.containsKey(group.getName())) { updateExistingGroup(result, group); } else { addNewGroup(result, group); } } return result; }
Source:
public void ensureEncrypted() { this.username = StringUtils.stripToNull(username); setPasswordIfNotBlank(password); if (encryptedPassword != null) { goCipher.maybeReEncrypt(encryptedPassword, this::setEncryptedPassword); } }

Target:
public void ensureEncrypted() { this.username = StringUtils.stripToNull(username); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
Source:
public boolean isNull(int field) { return Objects.isNull(value); }

Target:
public boolean isNull(int field) { return value == null; }
Source:
public void setZoomPercentageBy0_5_isHalfCropWidth() throws InterruptedException { mZoomControl.setZoomPercentage(1f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionMaxZoom = getSessionCropRegion(mControlUpdateListener); Rect cropRegionMinZoom = getSensorRect(); mZoomControl.setZoomPercentage(0.5f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionHalfZoom = getSessionCropRegion(mControlUpdateListener); Assert.assertEquals(cropRegionHalfZoom.width(), (cropRegionMinZoom.width() + cropRegionMaxZoom.width()) / 2.0f, 10); }

Target:
public void setZoomPercentageBy0_5_isHalfCropWidth() throws InterruptedException { mZoomControl.setZoomPercentage(1f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionMaxZoom = getSessionCropRegion(mControlUpdateListener); Rect cropRegionMinZoom = getSensorRect(); mZoomControl.setZoomPercentage(0.5f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionHalfZoom = getSessionCropRegion(mControlUpdateListener); Assert.assertEquals(cropRegionHalfZoom.width(), (cropRegionMinZoom.width() + cropRegionMaxZoom.width()) / 2.0f, TOLERANCE); }
Source:
private static DurationValue durationInSecondsAndNanos( Temporal from, Temporal to ) { long seconds; long nanos; boolean negate = false; if ( from.isSupported( OFFSET_SECONDS ) && !to.isSupported( OFFSET_SECONDS ) ) { negate = true; Temporal tmp = from; from = to; to = tmp; } seconds = from.until( to, SECONDS ); int fromNanos = from.isSupported( NANO_OF_SECOND ) ? from.get( NANO_OF_SECOND ) : 0; int toNanos = to.isSupported( NANO_OF_SECOND ) ? to.get( NANO_OF_SECOND ) : 0; nanos = toNanos - fromNanos; if ( seconds > 0 && nanos < 0 ) { nanos = NANOS_PER_SECOND + nanos; } else if ( seconds < 0 && nanos > 0 ) { nanos = nanos - NANOS_PER_SECOND; } if ( negate ) { seconds = -seconds; nanos = -nanos; } return duration( 0, 0, seconds, nanos ); }

Target:
private static DurationValue durationInSecondsAndNanos( Temporal from, Temporal to ) { long seconds; long nanos; boolean negate = false; if ( from.isSupported( OFFSET_SECONDS ) && !to.isSupported( OFFSET_SECONDS ) ) { negate = true; Temporal tmp = from; from = to; to = tmp; } seconds = from.until( to, SECONDS ); int fromNanos = from.isSupported( NANO_OF_SECOND ) ? from.get( NANO_OF_SECOND ) : 0; int toNanos = to.isSupported( NANO_OF_SECOND ) ? to.get( NANO_OF_SECOND ) : 0; nanos = toNanos - fromNanos; boolean specialZeroSecondCase = seconds == 0 && from.get( SECOND_OF_MINUTE ) != to.get( SECOND_OF_MINUTE ); if ( nanos < 0 && ( seconds > 0 || specialZeroSecondCase ) ) { nanos = NANOS_PER_SECOND + nanos; } else if ( nanos > 0 && ( seconds < 0 || specialZeroSecondCase ) ) { nanos = nanos - NANOS_PER_SECOND; } if ( negate ) { seconds = -seconds; nanos = -nanos; } return duration( 0, 0, seconds, nanos ); }
Source:
private KeychainBackend[] getAvailableBackends() { if (!keychain.isPresent()) { return new KeychainBackend[]{}; } if (SystemUtils.IS_OS_LINUX) { EnumSet<KeychainBackend> backends = LinuxSystemKeychainAccess.getAvailableKeychainBackends(); keychainBackendChoiceBox.setValue(LinuxSystemKeychainAccess.getBackendActivated()); return backends.size() > 0 ? backends.toArray(KeychainBackend[]::new) : new KeychainBackend[]{}; } if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) { keychainBackendChoiceBox.setValue(Arrays.stream(KeychainBackend.supportedBackends()).findFirst().orElseThrow(IllegalStateException::new)); return KeychainBackend.supportedBackends(); } return new KeychainBackend[]{}; }

Target:
private KeychainBackend[] getAvailableBackends() { if (!keychain.isPresent()) { return new KeychainBackend[]{}; } if (SystemUtils.IS_OS_LINUX) { EnumSet<KeychainBackend> backends = LinuxSystemKeychainAccess.getAvailableKeychainBackends(); return backends.size() > 0 ? backends.toArray(KeychainBackend[]::new) : new KeychainBackend[]{}; } if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) { return KeychainBackend.supportedBackends(); } return new KeychainBackend[]{}; }
Source:
private static FrameworkLogEntry getLog(IStatus status) { Throwable t = status.getException(); ArrayList<FrameworkLogEntry> childlist = new ArrayList<>(); int stackCode = t instanceof CoreException ? 1 : 0; if (stackCode == 1) { IStatus coreStatus = ((CoreException) t).getStatus(); if (coreStatus != null) { childlist.add(getLog(coreStatus)); } } if (status.isMultiStatus()) { IStatus[] children = status.getChildren(); for (IStatus children1 : children) { childlist.add(getLog(children1)); } } FrameworkLogEntry[] children = (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children); }

Target:
private static FrameworkLogEntry getLog(IStatus status) { Throwable t = status.getException(); ArrayList<FrameworkLogEntry> childlist = new ArrayList<>(); int stackCode = t instanceof CoreException ? 1 : 0; if (stackCode == 1) { IStatus coreStatus = ((CoreException) t).getStatus(); if (coreStatus != null) { childlist.add(getLog(coreStatus)); } } if (status.isMultiStatus()) { IStatus[] children = status.getChildren(); for (IStatus child : children) { childlist.add(getLog(child)); } } FrameworkLogEntry[] children = (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children); }
Source:
public List<HandlerMethodArgumentResolver> getResolvers() { return new ArrayList<>(this.resolvers); }

Target:
public List<HandlerMethodArgumentResolver> getResolvers() { return Collections.unmodifiableList(this.resolvers); }