auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void setAccount() throws OrmException, IOException, InvalidSshKeyException, UnloggedFailure { if (!username.matches(Account.USER_NAME_PATTERN)) { throw die("Username '" + username + "'" + " must contain only letters, numbers, _, - or ."); } final Account account; AccountExternalId.Key key = new AccountExternalId.Key(AccountExternalId.SCHEME_USERNAME, username); AccountExternalId accExtId = db.accountExternalIds().get(key); if (accExtId != null) { account = db.accounts().get(accExtId.getAccountId()); } else { throw die("Could not find user : " + username); } Account.Id id = account.getId(); if (newEmail != null) { link(id, newEmail); } if (oldEmail != null) { deleteMail(id, oldEmail); } if (fullName != null && realm.allowsEdit(FieldName.FULL_NAME)) { account.setFullName(fullName); } if (active) { account.setActive(true); } else if (inactive) { account.setActive(false); } final String readAddKey = readSshKey(addSshKey); if (readAddKey != null) { addSshKey(readAddKey, account); } final String readDeleteKey = readSshKey(deleteSshKey); if (readDeleteKey != null) { deleteSshKeys(readDeleteKey, account); } db.accounts().update(Collections.singleton(account)); byIdCache.evict(id); db.close(); }

Target:
private void setAccount() throws OrmException, IOException, UnloggedFailure { final Account account = db.accounts().get(id); if (!addEmails.isEmpty()) { for (String email : addEmails) { link(id, email); } } if (!deleteEmails.isEmpty()) { for (String email : deleteEmails) { deleteMail(id, email); } } if (fullName != null) { if (realm.allowsEdit(FieldName.FULL_NAME)) { account.setFullName(fullName); } else { throw new UnloggedFailure(1, "The realm doesn't allow editing names"); } } if (active) { account.setActive(true); } else if (inactive) { account.setActive(false); } addSshKeys = readSshKey(addSshKeys); if (!addSshKeys.isEmpty()) { for (String sshKey : addSshKeys) { addSshKey(sshKey, account); } } deleteSshKeys = readSshKey(deleteSshKeys); if (!deleteSshKeys.isEmpty()) { for (String sshKey : deleteSshKeys) { deleteSshKey(sshKey, account); } } db.accounts().update(Collections.singleton(account)); byIdCache.evict(id); db.close(); }
Source:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(this.workspacePath); builder.append("|"); builder.append(this.fieldDescriptor); return builder.toString(); }

Target:
public String toString() { StringBuilder builder = new StringBuilder(); builder.append(this.workspacePath); builder.append('|'); builder.append(this.fieldDescriptor); return builder.toString(); }
Source:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { Locale userLocale = (Locale) request.getAttribute(LocaleFilter.LOCALE); if (userLocale == null) { log.warn("Detected Locale is null, setting to default: " + LocaleFilter.DEFAULT_LOCALE); userLocale = LocaleFilter.DEFAULT_LOCALE; } List<BrandingTheme> brandingThemes = brandingManager.getBrandingThemes( request.getServletContext().getInitParameter(APPLICATION_TYPE)); request.setAttribute(THEMES_KEY, brandingThemes); ResourceBundle bundle = ResourceBundle.getBundle(BRANDING_BASE_NAME, userLocale, BrandingResourceBundle.getBrandingControl(BLANK)); Config.set(request, Config.FMT_LOCALIZATION_CONTEXT, new LocalizationContext(bundle, userLocale)); chain.doFilter(request, response); }

Target:
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain) throws IOException, ServletException { Locale userLocale = (Locale) request.getAttribute(LocaleFilter.LOCALE); if (userLocale == null) { log.warn("Detected Locale is null, setting to default: " + LocaleFilter.DEFAULT_LOCALE); userLocale = LocaleFilter.DEFAULT_LOCALE; } List<BrandingTheme> brandingThemes = brandingManager.getBrandingThemes(); request.setAttribute(THEMES_KEY, brandingThemes); request.setAttribute(APPLICATION_TYPE, request.getServletContext().getInitParameter(APPLICATION_TYPE)); ResourceBundle bundle = ResourceBundle.getBundle(BRANDING_BASE_NAME, userLocale, BrandingResourceBundle.getBrandingControl(BLANK)); Config.set(request, Config.FMT_LOCALIZATION_CONTEXT, new LocalizationContext(bundle, userLocale)); chain.doFilter(request, response); }
Source:
public String toString() { return toStringHelper(this) .add("server", server) .add("user", user) .add("clientTags", clientTags) .add("clientInfo", clientInfo) .add("catalog", catalog) .add("schema", schema) .add("traceToken", traceToken.orElse(null)) .add("timeZone", timeZone) .add("locale", locale) .add("properties", properties) .add("transactionId", transactionId) .toString(); }

Target:
public String toString() { return toStringHelper(this) .add("server", server) .add("user", user) .add("clientTags", clientTags) .add("clientInfo", clientInfo) .add("catalog", catalog) .add("schema", schema) .add("traceToken", traceToken.orElse(null)) .add("timeZone", timeZone) .add("locale", locale) .add("properties", properties) .add("transactionId", transactionId) .omitNullValues() .toString(); }
Source:
CallArgsImpl addDefaultArgs(CallArgsImpl callArgsImpl) { if(defaultArgs == null || defaultArgs.size()==0) return callArgsImpl; CallerImpl callerImpl = (com.marklogic.client.dataservices.impl.CallManagerImpl.CallerImpl) caller; List<CallField> newCallFields = new ArrayList<CallField>(); if(callArgsImpl.getCallFields()!=null && callArgsImpl.getCallFields().size()!=0) newCallFields.addAll(callArgsImpl.getCallFields()); newCallFields.addAll(defaultArgs); return new CallArgsImpl(callerImpl.getEndpoint(), newCallFields); }

Target:
CallArgsImpl addDefaultArgs(CallArgsImpl callArgsImpl) { if(defaultArgs == null || defaultArgs.size()==0) return callArgsImpl; CallerImpl callerImpl = (com.marklogic.client.dataservices.impl.CallManagerImpl.CallerImpl) caller; List<CallField> newCallFields = new ArrayList<CallField>(); Set<String> assignedParams = new HashSet<String>(); if(callArgsImpl.getCallFields()!=null && callArgsImpl.getCallFields().size()!=0) { newCallFields.addAll(callArgsImpl.getCallFields()); assignedParams.addAll(callArgsImpl.getAssignedParams()); } for(CallField i: defaultArgs) { if(!assignedParams.contains(i.getParamName())) { assignedParams.add(i.getParamName()); newCallFields.add(i); } } return new CallArgsImpl(callerImpl.getEndpoint(), newCallFields); }
Source:
public List<ASTAnyTypeBodyDeclaration> getDeclarations() { return findChildrenOfType(ASTAnnotationTypeBody.class) .get(0).findChildrenOfType(ASTAnyTypeBodyDeclaration.class); }

Target:
public List<ASTAnyTypeBodyDeclaration> getDeclarations() { return getFirstChildOfType(ASTAnnotationTypeBody.class) .findChildrenOfType(ASTAnyTypeBodyDeclaration.class); }
Source:
private void removeDoneFiles(List<String> dataFileNames) { for (String dataFileName : dataFileNames) { File doneFile = new File(StringUtils.substringBeforeLast(dataFileName, ".") + ".done"); if (doneFile.exists()) { doneFile.delete(); } } }

Target:
private void removeDoneFiles(List<String> dataFileNames) { fileStorageService.removeDoneFiles(dataFileNames); }
Source:
public IdentityClientOptions() { Configuration configuration = Configuration.getGlobalConfiguration().clone(); authorityHost = configuration.contains(configuration.PROPERTY_AZURE_AUTHORITY_HOST) ? configuration.get(configuration.PROPERTY_AZURE_AUTHORITY_HOST) : DEFAULT_AUTHORITY_HOST; maxRetry = MAX_RETRY_DEFAULT_LIMIT; retryTimeout = i -> Duration.ofSeconds((long) Math.pow(2, i.getSeconds() - 1)); }

Target:
public IdentityClientOptions() { Configuration configuration = Configuration.getGlobalConfiguration(); authorityHost = configuration.get(Configuration.PROPERTY_AZURE_AUTHORITY_HOST, KnownAuthorityHosts.AZURE_CLOUD); maxRetry = MAX_RETRY_DEFAULT_LIMIT; retryTimeout = i -> Duration.ofSeconds((long) Math.pow(2, i.getSeconds() - 1)); }
Source:
public Optional<String> checkValue(String value) { if (StringUtil.isBlank(value)) { return Optional.empty(); } if (value.equals(FIRST_EDITION)) { return Optional.of(Localization.lang("edition of book reported as just 1")); } if (bibDatabaseContextEdition.isBiblatexMode() && !ONLY_NUMERALS_OR_LITERALS.test(value.trim())) { return Optional.of(Localization.lang("should contain an integer or a literal")); } if (!bibDatabaseContextEdition.isBiblatexMode()) { if(!isFirstCharDigit(value)) if (!allowIntegerEdition) { if (!FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } } else { if (!ONLY_NUMERALS.test(value.trim()) && !FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } } } return Optional.empty(); }

Target:
public Optional<String> checkValue(String value) { if (StringUtil.isBlank(value)) { return Optional.empty(); } if (value.equals(FIRST_EDITION)) { return Optional.of(Localization.lang("edition of book reported as just 1")); } if (bibDatabaseContextEdition.isBiblatexMode() && !ONLY_NUMERALS_OR_LITERALS.test(value.trim())) { return Optional.of(Localization.lang("should contain an integer or a literal")); } if (!bibDatabaseContextEdition.isBiblatexMode()) { if (!isFirstCharDigit(value) && (!allowIntegerEdition) && !FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } else { if (!ONLY_NUMERALS.test(value.trim()) && !FIRST_LETTER_CAPITALIZED.test(value.trim())) { return Optional.of(Localization.lang("should have the first letter capitalized")); } } } return Optional.empty(); }
Source:
public double[] getMzValues() { double[] mzValues = null; Integer numOfDataPoints = this.numOfDataPoints; if (getMzBinaryDataInfo().getArrayLength() != numOfDataPoints) { logger.warn( "m/z binary data array contains a different array length from the default array length of the scan (#" + getScanNumber() + ")"); } Integer precision; EnumSet<MzMLBinaryDataInfo.MzMLCompressionType> compressions = EnumSet.noneOf(MzMLBinaryDataInfo.MzMLCompressionType.class); try { switch (getMzBinaryDataInfo().getBitLength()) { case THIRTY_TWO_BIT_FLOAT: case THIRTY_TWO_BIT_INTEGER: precision = 32; break; case SIXTY_FOUR_BIT_FLOAT: case SIXTY_FOUR_BIT_INTEGER: precision = 64; break; default: precision = null; } compressions.add(getMzBinaryDataInfo().getCompressionType()); InputStream encodedIs = new ByteBufferInputStreamAdapter(mappedByteBufferInputStream, getMzBinaryDataInfo().getPosition(), getMzBinaryDataInfo().getEncodedLength()); InputStream decodedIs = Base64.getDecoder().wrap(encodedIs); byte[] decodedData = IOUtils.toByteArray(decodedIs); mzValues = MzMLMZPeaksDecoder .decode(decodedData, decodedData.length, precision, numOfDataPoints, compressions) .getDecodedArray(); } catch (Exception e) { throw (new MSDKRuntimeException(e)); } return mzValues; }

Target:
public double[] getMzValues() { double[] mzValues = null; if (getMzBinaryDataInfo().getArrayLength() != numOfDataPoints) { logger.warn( "m/z binary data array contains a different array length from the default array length of the scan (#" + getScanNumber() + ")"); } Integer precision; EnumSet<MzMLBinaryDataInfo.MzMLCompressionType> compressions = EnumSet.noneOf(MzMLBinaryDataInfo.MzMLCompressionType.class); try { switch (getMzBinaryDataInfo().getBitLength()) { case THIRTY_TWO_BIT_FLOAT: case THIRTY_TWO_BIT_INTEGER: precision = 32; break; case SIXTY_FOUR_BIT_FLOAT: case SIXTY_FOUR_BIT_INTEGER: precision = 64; break; default: precision = null; } compressions.add(getMzBinaryDataInfo().getCompressionType()); InputStream encodedIs = new ByteBufferInputStreamAdapter(mappedByteBufferInputStream, getMzBinaryDataInfo().getPosition(), getMzBinaryDataInfo().getEncodedLength()); InputStream decodedIs = Base64.getDecoder().wrap(encodedIs); byte[] decodedData = IOUtils.toByteArray(decodedIs); mzValues = MzMLMZPeaksDecoder .decode(decodedData, decodedData.length, precision, numOfDataPoints, compressions) .getDecodedArray(); } catch (Exception e) { throw (new MSDKRuntimeException(e)); } return mzValues; }
Source:
protected IFile createBookmarksFile(IFolder bookmarksFolder, String editorInputType, IProgressMonitor monitor) throws CoreException, OperationCanceledException { IFile file = getBookmarksFile(); if (!file.exists()) { final IFile bookmarksFile = bookmarksFolder.getFile(BOOKMARKS_HIDDEN_FILE); if (!bookmarksFile.exists()) { final InputStream source = new ByteArrayInputStream(new byte[0]); bookmarksFile.create(source, IResource.FORCE | IResource.HIDDEN, monitor); } file.createLink(bookmarksFile.getLocation(), IResource.REPLACE | IResource.HIDDEN, monitor); file.setPersistentProperty(TmfCommonConstants.TRACETYPE, editorInputType); } return file; }

Target:
protected IFile createBookmarksFile(IFolder bookmarksFolder, String editorInputType, IProgressMonitor monitor) throws CoreException, OperationCanceledException { SubMonitor subMonitor = SubMonitor.convert(monitor, 2); IFile file = getBookmarksFile(); if (!file.exists()) { final IFile bookmarksFile = bookmarksFolder.getFile(BOOKMARKS_HIDDEN_FILE); if (!bookmarksFile.exists()) { final InputStream source = new ByteArrayInputStream(new byte[0]); bookmarksFile.create(source, IResource.FORCE | IResource.HIDDEN, subMonitor.split(1)); } file.createLink(bookmarksFile.getLocation(), IResource.REPLACE | IResource.HIDDEN, subMonitor.split(1)); file.setPersistentProperty(TmfCommonConstants.TRACETYPE, editorInputType); } return file; }
Source:
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException { Collection<Player> targets; if (args.length > 0) { targets = new ArrayList<>(); for (int i = 0; args.length > i; i++) { targets.add(getPlayer(server, sender, args, i).getBase()); } } else { targets = ess.getOnlinePlayers(); } ess.getTNTListener().enable(); for (Player player : targets) { if (player == null) { continue; } player.sendMessage(tl("nuke")); final Location loc = player.getLocation(); final World world = loc.getWorld(); for (int x = -10; x <= 10; x += 5) { for (int z = -10; z <= 10; z += 5) { world.spawn(new Location(world, loc.getBlockX() + x, world.getHighestBlockYAt(loc) + 64, loc.getBlockZ() + z), TNTPrimed.class); } } } }

Target:
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws NoSuchFieldException, NotEnoughArgumentsException { Collection<Player> targets; if (args.length > 0) { targets = new ArrayList<>(); for (int i = 0; i < args.length; ++i) { targets.add(getPlayer(server, sender, args, i).getBase()); } } else { targets = ess.getOnlinePlayers(); } ess.getTNTListener().enable(); for (Player player : targets) { if (player == null) { continue; } player.sendMessage(tl("nuke")); final Location loc = player.getLocation(); final World world = loc.getWorld(); for (int x = -10; x <= 10; x += 5) { for (int z = -10; z <= 10; z += 5) { world.spawn(new Location(world, loc.getBlockX() + x, world.getHighestBlockYAt(loc) + 64, loc.getBlockZ() + z), TNTPrimed.class); } } } }
Source:
public void returnsCorrectInputWithByteArray() throws Exception { final byte[] bytes = new Utf8String("ByteArray returnsCorrectInput!").asBytes(); MatcherAssert.assertThat( "ByteArray doesn't provide correct bytes", new BytesOf(new Body.ByteArray(bytes)).asBytes(), new IsEqual<>(bytes) ); }

Target:
public void returnsCorrectInputWithByteArray() throws Exception { final byte[] bytes = new Utf8String("ByteArray returnsCorrectInput!").asBytes(); MatcherAssert.assertThat( "Body content of Body.ByteArray doesn't provide the correct bytes", new BytesOf(new Body.ByteArray(bytes)).asBytes(), new IsEqual<>(bytes) ); }
Source:
public synchronized void addUserTuneListener(UserTuneListener listener) { userTuneListeners.add(listener); }

Target:
public void addUserTuneListener(UserTuneListener listener) { synchronized (userTuneListeners) { userTuneListeners.add(listener); } }
Source:
public boolean canHandleSelection(Object selection) { if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; Object element = structuredSelection.getFirstElement(); if (element instanceof SpecHierarchyImpl) { return true; } } return false; }

Target:
public boolean canHandleSelection(Object selection) { if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; if (!(structuredSelection.getFirstElement() == null)) { Object element = structuredSelection.getFirstElement(); if (element instanceof SpecHierarchyImpl) { return true; } } } return false; }
Source:
public synchronized void commit() throws IOException { if (logStream != null) { logStream.flush(); } for (FileOutputStream log : streamsToFlush) { log.flush(); if (forceSync) { long startSyncNS = System.nanoTime(); FileChannel channel = log.getChannel(); channel.force(false); syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS); if (syncElapsedMS > fsyncWarningThresholdMS) { if(serverStats != null) { serverStats.incrementFsyncThresholdExceedCount(); } LOG.warn("fsync-ing the write ahead log in " + Thread.currentThread().getName() + " took " + syncElapsedMS + "ms which will adversely effect operation latency. " + "File size is " + channel.size() + " bytes and " + FSYNC_WARNING_THRESHOLD_MS_PROPERTY + " is " + fsyncWarningThresholdMS + ". " + "See the ZooKeeper troubleshooting guide"); } } } while (streamsToFlush.size() > 1) { streamsToFlush.removeFirst().close(); } }

Target:
public synchronized void commit() throws IOException { if (logStream != null) { logStream.flush(); } for (FileOutputStream log : streamsToFlush) { log.flush(); if (forceSync) { long startSyncNS = System.nanoTime(); FileChannel channel = log.getChannel(); channel.force(false); syncElapsedMS = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startSyncNS); if (syncElapsedMS > fsyncWarningThresholdMS) { if(serverStats != null) { serverStats.incrementFsyncThresholdExceedCount(); } LOG.warn("fsync-ing the write ahead log in " + Thread.currentThread().getName() + " took " + syncElapsedMS + "ms which will adversely effect operation latency. " + "File size is " + channel.size() + " bytes. " + "See the ZooKeeper troubleshooting guide"); } } } while (streamsToFlush.size() > 1) { streamsToFlush.removeFirst().close(); } }
Source:
protected JsonMessageHandlerForRequestProcessor jsonMessageHandlerForRequestProcessor(String pluginVersion) { throw new UnsupportedOperationException("Fetch PluginSettings is not supported by Authorization Endpoint."); }

Target:
protected JsonMessageHandlerForRequestProcessor jsonMessageHandlerForRequestProcessor(String pluginVersion) { throw new UnsupportedOperationException("Fetch PluginSettings is not supported by Task Endpoint."); }
Source:
private String getConnectionSettingsDetectionScriptName() { final String osName = System.getProperty("os.name"); if (osName.toLowerCase().startsWith("win")) { return "script.bat"; } else if (osName.toLowerCase().startsWith("mac") || osName.toLowerCase().contains("nix")) { return "script.sh"; } else { return null; } }

Target:
private String getConnectionSettingsDetectionScriptName() { final String osName = System.getProperty("os.name"); if (osName.toLowerCase().startsWith("win")) { return "script.bat"; } else if (osName.toLowerCase().startsWith("mac") || osName.toLowerCase().contains("linux") || osName.toLowerCase().contains("nix")) { return "script.sh"; } else { return null; } }
Source:
private static final String escapeWhitespace(String value) { return value.replaceAll("[\n\r\t]", " "); }

Target:
private static final String escapeWhitespace(String value) { final StringBuilder escaped = new StringBuilder(value); final int length = escaped.length(); for (int i = 0; i < length; i++) { char c = escaped.charAt(i); if (c != ' ' && Character.isWhitespace(c)) escaped.setCharAt(i, ' '); } return escaped.toString(); }
Source:
public InputStream getInputStream() { try { return channel.getInputStream(); } catch (IOException e) { e.printStackTrace(); return null; } }

Target:
public InputStream getInputStream() { try { return channel.getInputStream(); } catch (IOException e) { Activator.log(e); return null; } }
Source:
public static String toString(Node node, int indent, Map<String, String> namespaces, Optional<String> optionalCharset) { String charset = optionalCharset.orElse(StandardCharsets.UTF_8.toString()); try { Transformer transformer = TransformerFactory.newInstance().newTransformer(); if (indent > -1) { transformer.setOutputProperty(OutputKeys.INDENT, TRANSFORMER_INDENT_TRUE); transformer.setOutputProperty(TRANSFORMER_INDENT_VALUE, Integer.toString(indent)); } transformer.setOutputProperty(OutputKeys.ENCODING, charset); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); transformer.transform(new DOMSource(toDocument(node, namespaces)), new StreamResult(buffer)); return new String(buffer.toByteArray(), charset); } catch (TransformerException | UnsupportedEncodingException e) { String message = e.getMessage(); throw new RuntimeException(message != null ? message : e.getClass().getSimpleName(), e); } }

Target:
public static String toString(Node node, int indent, Map<String, String> namespaces, Optional<String> optionalCharset) { String charset = optionalCharset.orElse(StandardCharsets.UTF_8.toString()); try { try (ByteArrayOutputStream buffer = new ByteArrayOutputStream()) { toStream(node, buffer, indent, namespaces, optionalCharset); return new String(buffer.toByteArray(), charset); } } catch (IOException e) { String message = e.getMessage(); throw new IllegalArgumentException(message != null ? message : e.getClass().getSimpleName(), e); } }
Source:
public void testImportPMML2() throws IOException { try (Reader defsReader = getReader("pmml/KiePMMLTree.dmn", DMNRuntimeTest.class);) { final Definitions defs = getDefinitions(defsReader, "<LINK_0>", "TestTreeDMN"); ValidatorImportReaderResolver resolver = (ns, name, i) -> { if (ns.equals(defs.getNamespace()) && name.equals(defs.getName()) && i.equals(defs.getImport().get(0).getLocationURI())) { return getReader("pmml/test_tree.pmml", DMNRuntimeTest.class); } else { return null; } }; final List<DMNMessage> messages = validator.validateUsing(Validation.VALIDATE_MODEL, Validation.VALIDATE_COMPILATION) .usingImports(resolver) .theseModels(defs); assertThat(ValidatorUtil.formatMessages(messages), messages.size(), is(0)); } }

Target:
public void testImportPMML2() throws IOException { try (Reader defsReader = getReader("KiePMMLScoreCard_wInputType.dmn", DMNRuntimePMMLTest.class);) { final Definitions defs = getDefinitions(defsReader, "<LINK_1>", "KiePMMLScoreCard"); ValidatorImportReaderResolver resolver = (ns, name, i) -> { if (ns.equals(defs.getNamespace()) && name.equals(defs.getName()) && i.equals(defs.getImport().get(0).getLocationURI())) { return getReader("test_scorecard.pmml", DMNRuntimePMMLTest.class); } else { return null; } }; final List<DMNMessage> messages = validator.validateUsing(Validation.VALIDATE_MODEL, Validation.VALIDATE_COMPILATION) .usingImports(resolver) .theseModels(defs); assertThat(ValidatorUtil.formatMessages(messages), messages.size(), is(0)); } }
Source:
protected boolean canDoAction() { if (!(!Guid.Empty.equals(getVds().getstorage_pool_id()) && DbFacade.getInstance().getVdsSpmIdMapDao().get(getVdsId()) == null)) { return false; } vds_spm_id_mapList = DbFacade.getInstance().getVdsSpmIdMapDao().getAll( getVds().getstorage_pool_id()); if (vds_spm_id_mapList.size() >= Config.<Integer> GetValue(ConfigValues.MaxNumberOfHostsInStoragePool)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_EXCEEDED_MAXIMUM_NUMBER_OF_HOSTS_IN_DATA_CENTER); return false; } return true; }

Target:
protected boolean canDoAction() { if (!(!Guid.Empty.equals(getVds().getstorage_pool_id()) && DbFacade.getInstance().getVdsSpmIdMapDao().get(getVdsId()) == null)) { return false; } vds_spm_id_mapList = DbFacade.getInstance().getVdsSpmIdMapDao().getAll( getVds().getstorage_pool_id()); if (vds_spm_id_mapList.size() >= Config.<Integer> GetValue(ConfigValues.MaxNumberOfHostsInStoragePool)) { VdcFault fault = new VdcFault(); fault.setMessage("The maximum number of Hosts allowed in the Data Center has been reached"); getReturnValue().setFault(fault); return false; } return true; }
Source:
public void testMultiAdjacentPartitionedParallelChildren() throws Exception { checkUdpSupported(); List<String> stringList = getListOfUniqueStrings(800); String stringArray[] = new String[800]; stringArray = stringList.toArray(stringArray); Topology topology = newTopology("testAdj"); TStream<String> out0 = topology.strings(stringArray).parallel(of(3), (String s) -> s.hashCode() % 20); out0 = out0.transform(randomStringProducer("region1")).endParallel(); TStream<String> out2 = out0.parallel(of(5), (String s) -> s.hashCode() % 30); out2 = out2.transform(randomStringProducer("region2")).endParallel(); TStream<String> out3 = out0.parallel(of(2), (String s) -> s.hashCode() % 40); out3 = out3.transform(randomStringProducer("region3")).endParallel(); TStream<String> numRegions2 = out2.flatMap(uniqueStringCounter(800, "region")); TStream<String> numRegions3 = out3.flatMap(uniqueStringCounter(800, "region")); Tester tester = topology.getTester(); Condition<List<String>> assertFinished2 = tester.stringContentsUnordered(numRegions2, "3", "5"); Condition<List<String>> assertFinished3 = tester.stringContentsUnordered(numRegions3, "3", "2"); Condition<Long> expectedCount2 = tester.tupleCount(out2, 800); Condition<Long> expectedCount3 = tester.tupleCount(out3, 800); complete(tester, allConditions(assertFinished2, expectedCount2, assertFinished3, expectedCount3), 60, TimeUnit.SECONDS); assertTrue(expectedCount2.valid()); assertTrue(expectedCount3.valid()); assertTrue(assertFinished2.valid()); assertTrue(assertFinished3.valid()); }

Target:
public void testMultiAdjacentPartitionedParallelChildren() throws Exception { checkUdpSupported(); List<String> stringList = getListOfUniqueStrings(800); String stringArray[] = new String[800]; stringArray = stringList.toArray(stringArray); Topology topology = newTopology(); TStream<String> out1 = topology.strings(stringArray) .parallel(of(3), String::hashCode); out1 = out1.map(randomStringProducer("region1")).endParallel(); TStream<String> out2 = out1.parallel(of(5), String::hashCode); out2 = out2.filter(new ChannelFilter()) .map(randomStringProducer("region2")).endParallel(); TStream<String> out3 = out1.parallel(of(2), String::hashCode); out3 = out3.filter(new ChannelFilter()) .map(randomStringProducer("region3")).endParallel(); TStream<String> numRegions2 = out2.flatMap(uniqueStringCounter(800, "region")); TStream<String> numRegions3 = out3.flatMap(uniqueStringCounter(800, "region")); Tester tester = topology.getTester(); Condition<List<String>> assertFinished2 = tester.stringContentsUnordered(numRegions2, "3", "5"); Condition<List<String>> assertFinished3 = tester.stringContentsUnordered(numRegions3, "3", "2"); Condition<Long> expectedCount2 = tester.tupleCount(out2, 800); Condition<Long> expectedCount3 = tester.tupleCount(out3, 800); complete(tester, allConditions(assertFinished2, expectedCount2, assertFinished3, expectedCount3), 60, TimeUnit.SECONDS); assertTrue(expectedCount2.valid()); assertTrue(expectedCount3.valid()); assertTrue(assertFinished2.valid()); assertTrue(assertFinished3.valid()); }
Source:
public void setup() { when(fallbackIntSupplier.getAsInt()).thenReturn(FALLBACK_INT); when(experimentalIntSupplier.getAsInt()).thenReturn(EXPERIMENTAL_INT); when(clock.instant()).thenReturn(Instant.ofEpochSecond(0)); }

Target:
public void setup() { returnValueOnExperiment(); setTimeTo(Instant.ofEpochSecond(0)); }
Source:
public synchronized void backupCheck() { if (!active) { try { log.info("Backup check started."); active = true; doBackupCheck(); log.info("Backup check completed."); } finally { active = false; } } }

Target:
public void backupCheck() { Lock lock = new ReentrantLock(); if (lock.tryLock()) { try { log.info("Backup check started."); doBackupCheck(); log.info("Backup check completed."); } finally { lock.unlock(); } } }
Source:
public void apply() { try { final long waitEndTime = ticker.read(); final long waitTime = waitEndTime - timestamp; pullWaitStats[threadId].put(waitTime); requestWaitStats[threadId].put(waitTime); final Pair<HashedKey<K>, V> kvPair = memoryStore.get(hashedKey); final V value; if (kvPair == null) { final V initValue = parameterUpdater.initValue(hashedKey.getKey()); final Pair<HashedKey<K>, Boolean> result = memoryStore.put(hashedKey, initValue); final boolean isSuccess = result.getSecond(); if (!isSuccess) { throw new RuntimeException("The data does not exist. Tried to put the initial value, but has failed"); } value = initValue; } else { value = kvPair.getSecond(); } final long serverProcessingTime = ticker.read() - timestamp; sender.sendPullReplyMsg(srcId, hashedKey.getKey(), value, serverProcessingTime); final long processEndTime = ticker.read(); final long totalProcessingTime = processEndTime - waitEndTime; pullStats[threadId].put(totalProcessingTime); requestStats[threadId].put(totalProcessingTime); } catch (final Exception e) { LOG.log(Level.WARNING, "Exception occurred", e); } }

Target:
public void apply() { try { final long waitEndTime = ticker.read(); final long waitTime = waitEndTime - timestamp; pullWaitStats[threadId].put(waitTime); requestWaitStats[threadId].put(waitTime); final Pair<HashedKey<K>, V> kvPair = memoryStore.get(hashedKey); final V value; if (kvPair == null) { final V initValue = parameterUpdater.initValue(hashedKey.getKey()); final Pair<HashedKey<K>, Boolean> result = memoryStore.put(hashedKey, initValue); final boolean isSuccess = result.getSecond(); if (!isSuccess) { throw new RuntimeException("The data does not exist. Tried to put the initial value, but has failed"); } value = initValue; } else { value = kvPair.getSecond(); } final long elapsedTimeInServer = ticker.read() - timestamp; sender.sendPullReplyMsg(srcId, hashedKey.getKey(), value, elapsedTimeInServer); final long processEndTime = ticker.read(); final long actualProcessingTime = processEndTime - waitEndTime; pullStats[threadId].put(actualProcessingTime); requestStats[threadId].put(actualProcessingTime); } catch (final Exception e) { LOG.log(Level.WARNING, "Exception occurred", e); } }
Source:
private static void refreshBorderedStyle(final StyledFigure styledFigure, final BorderedStyle borderedStyle) { if (borderedStyle.getBorderSize().intValue() == 0) { styledFigure.setBorder(null); } else { LineBorder lineBorder = null; if (styledFigure.getBorder() instanceof LineBorder) { lineBorder = (LineBorder) styledFigure.getBorder(); } else { lineBorder = new LineBorder(); styledFigure.setBorder(lineBorder); } if (styledFigure instanceof Shape) { ((Shape) styledFigure).setLineWidth(0); } int borderSize = 0; if (borderedStyle.getBorderSize() != null) { borderSize = borderedStyle.getBorderSize().intValue(); } lineBorder.setWidth(borderSize); if (borderedStyle.getBorderColor() != null) { lineBorder.setColor(VisualBindingManager.getDefault().getColorFromRGBValues(borderedStyle.getBorderColor())); } if (borderedStyle.getBorderSize() != null && borderSize == 0) { styledFigure.setBorder(null); } } }

Target:
private static void refreshBorderedStyle(final StyledFigure styledFigure, final BorderedStyle borderedStyle) { if (borderedStyle.getBorderSize().intValue() == 0) { styledFigure.setBorder(null); } else { LineBorder lineBorder = null; if (styledFigure.getBorder() instanceof LineBorder) { lineBorder = (LineBorder) styledFigure.getBorder(); } else { lineBorder = new LineBorder(); styledFigure.setBorder(lineBorder); } if (styledFigure instanceof Shape) { ((Shape) styledFigure).setLineWidth(0); } int borderSize = 0; if (borderedStyle.getBorderSize() != null) { borderSize = borderedStyle.getBorderSize().intValue(); } lineBorder.setWidth(borderSize); if (borderedStyle.getBorderColor() != null) { lineBorder.setColor(VisualBindingManager.getDefault().getColorFromRGBValues(borderedStyle.getBorderColor())); } if (borderSize == 0) { styledFigure.setBorder(null); } } }
Source:
public StreamGroupInfo(Map<String, Object> map) { if (map!= null && map.size()>0) { groupInfo = map; name = (String) map.get(NAME); consumers = (long) map.get(CONSUMERS); pending = (long) map.get(PENDING); lastDeliveredId = (String) map.get(LAST_DELIVERED); } else throw new IllegalArgumentException(); }

Target:
public StreamGroupInfo(Map<String, Object> map) { groupInfo = map; name = (String) map.get(NAME); consumers = (long) map.get(CONSUMERS); pending = (long) map.get(PENDING); lastDeliveredId = (StreamEntryID) map.get(LAST_DELIVERED); }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((entityId == null) ? 0 : entityId.hashCode()); result = prime * result + ((entityType == null) ? 0 : entityType.hashCode()); result = prime * result + ((jobId == null) ? 0 : jobId.hashCode()); return result; }

Target:
public int hashCode() { return Objects.hash(entityId, jobId); }
Source:
protected void processRenamedDirectories(Runnable counter) { oma.select(SQLDirectory.class).eq(SQLDirectory.RENAMED, true).limit(256).iterateAll(dir -> { try { propagateRename(dir); oma.updateStatement(SQLDirectory.class) .set(SQLDirectory.RENAMED, false) .where(SQLDirectory.PARENT, dir.getId()) .executeUpdate(); } catch (Exception e) { handleDirectoryDeletionException(dir, e); } counter.run(); }); }

Target:
protected void processRenamedDirectories(Runnable counter) { oma.select(SQLDirectory.class).eq(SQLDirectory.RENAMED, true).limit(CURSOR_LIMIT).iterateAll(dir -> { try { propagateRename(dir); oma.updateStatement(SQLDirectory.class) .set(SQLDirectory.RENAMED, false) .where(SQLDirectory.ID, dir.getId()) .executeUpdate(); } catch (Exception e) { handleDirectoryDeletionException(dir, e); } counter.run(); }); }
Source:
public NotificationFilter getFilter() { return NotificationFilter.createEventTypeFilter(Notification.SET).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)) .and(NotificationFilter.createNotifierTypeFilter(EObject.class).and(NotificationFilter.NOT_TOUCH)); }

Target:
public NotificationFilter getFilter() { return NotificationFilter.NOT_TOUCH.and(NotificationFilter.createEventTypeFilter(Notification.SET)).or(NotificationFilter.createEventTypeFilter(Notification.UNSET)) .and(NotificationFilter.createNotifierTypeFilter(EObject.class)); }
Source:
LocalBufferPool( NetworkBufferPool networkBufferPool, int numberOfRequiredMemorySegments, int maxNumberOfMemorySegments, int numberOfSubpartitions, int maxBuffersPerChannel) { checkArgument(numberOfRequiredMemorySegments > 0, "Required number of memory segments (%s) should be larger than 0.", numberOfRequiredMemorySegments); checkArgument(maxNumberOfMemorySegments >= numberOfRequiredMemorySegments, "Maximum number of memory segments (%s) should not be smaller than minimum (%s).", maxNumberOfMemorySegments, numberOfRequiredMemorySegments); LOG.debug("Using a local buffer pool with {}-{} buffers", numberOfRequiredMemorySegments, maxNumberOfMemorySegments); this.networkBufferPool = networkBufferPool; this.numberOfRequiredMemorySegments = numberOfRequiredMemorySegments; this.currentPoolSize = numberOfRequiredMemorySegments; this.maxNumberOfMemorySegments = maxNumberOfMemorySegments; if (numberOfSubpartitions > 0) { checkArgument(maxBuffersPerChannel > 0, "Maximum number of buffers for each channel (%s) should be larger than 0.", maxBuffersPerChannel); } this.subpartitionBuffersCount = new int[numberOfSubpartitions]; subpartitionBufferRecyclers = new BufferRecycler[numberOfSubpartitions]; for (int i = 0; i < subpartitionBufferRecyclers.length; i++) { subpartitionBufferRecyclers[i] = new SubpartitionBufferRecycler(i, this); } this.maxBuffersPerChannel = maxBuffersPerChannel; if (checkAvailability()) { availabilityHelper.resetAvailable(); } assert hasConsistentAvailability(); }

Target:
LocalBufferPool( NetworkBufferPool networkBufferPool, int numberOfRequiredMemorySegments, int maxNumberOfMemorySegments, int numberOfSubpartitions, int maxBuffersPerChannel) { checkArgument(numberOfRequiredMemorySegments > 0, "Required number of memory segments (%s) should be larger than 0.", numberOfRequiredMemorySegments); checkArgument(maxNumberOfMemorySegments >= numberOfRequiredMemorySegments, "Maximum number of memory segments (%s) should not be smaller than minimum (%s).", maxNumberOfMemorySegments, numberOfRequiredMemorySegments); LOG.debug("Using a local buffer pool with {}-{} buffers", numberOfRequiredMemorySegments, maxNumberOfMemorySegments); this.networkBufferPool = networkBufferPool; this.numberOfRequiredMemorySegments = numberOfRequiredMemorySegments; this.currentPoolSize = numberOfRequiredMemorySegments; this.maxNumberOfMemorySegments = maxNumberOfMemorySegments; if (numberOfSubpartitions > 0) { checkArgument(maxBuffersPerChannel > 0, "Maximum number of buffers for each channel (%s) should be larger than 0.", maxBuffersPerChannel); } this.subpartitionBuffersCount = new int[numberOfSubpartitions]; subpartitionBufferRecyclers = new BufferRecycler[numberOfSubpartitions]; for (int i = 0; i < subpartitionBufferRecyclers.length; i++) { subpartitionBufferRecyclers[i] = new SubpartitionBufferRecycler(i, this); } this.maxBuffersPerChannel = maxBuffersPerChannel; synchronized (this.availableMemorySegments) { if (checkAvailability()) { availabilityHelper.resetAvailable(); } checkConsistentAvailability(); } }
Source:
public Map<String, Integer> dumpStats() { Map<String, Integer> ret = new HashMap<String, Integer>(stats); ret.put("numTuples", numTuples()); ret.put("numKeys", keyHashCodesToIndices.size()); return ret; }

Target:
public Map<String, Integer> dumpStats() { Map<String, Integer> ret = new HashMap<String, Integer>(stats); ret.put("numTuples", numTuples()); ret.put("numHashCodes", keyHashCodesToIndices.size()); return ret; }
Source:
public static ClassName get(TypeElement element) { checkNotNull(element, "element == null"); String simpleName = element.getSimpleName().toString(); Element enclosingElement = element.getEnclosingElement(); if (enclosingElement instanceof PackageElement) { Name packageName = ((PackageElement) enclosingElement).getQualifiedName(); return new ClassName(packageName.toString(), null, simpleName); } else if (enclosingElement instanceof TypeElement) { ClassName enclosingClass = get((TypeElement) enclosingElement); return enclosingClass.nestedClass(simpleName); } else if (element.asType() instanceof ErrorType) { return get("", simpleName); } throw new IllegalArgumentException("unexpected type nesting: " + element); }

Target:
public static ClassName get(TypeElement element) { checkNotNull(element, "element == null"); String simpleName = element.getSimpleName().toString(); return element.getEnclosingElement().accept(new SimpleElementVisitor8<ClassName, Void>() { @Override public ClassName visitPackage(PackageElement packageElement, Void p) { return new ClassName(packageElement.getQualifiedName().toString(), null, simpleName); } @Override public ClassName visitType(TypeElement enclosingClass, Void p) { return ClassName.get(enclosingClass).nestedClass(simpleName); } @Override public ClassName visitUnknown(Element unknown, Void p) { return get("", simpleName); } @Override public ClassName defaultAction(Element enclosingElement, Void p) { throw new IllegalArgumentException("Unexpected type nesting: " + element); } }, null); }
Source:
public byte[] findScreenshot(Throwable t) { byte[] result = null; if (t != null) { if (t instanceof ScreenshotException) { String encodedScreenshot = ((ScreenshotException)t).getBase64EncodedScreenshot(); result = new Base64().decode(encodedScreenshot); } else { result = findScreenshot(t.getCause()); } } return result; }

Target:
public byte[] findScreenshot(Throwable t) { byte[] result = null; if (t != null) { if (t instanceof ScreenshotException) { String encodedScreenshot = ((ScreenshotException)t).getBase64EncodedScreenshot(); result = Base64.getDecoder().decode(encodedScreenshot); } else { result = findScreenshot(t.getCause()); } } return result; }
Source:
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); EditText edit = (EditText) view.findViewById(R.id.edit); edit.setFocusable(true); edit.requestFocus(); ExternalProviderAuthBinding binding = ExternalProviderAuthBinding.bind(view); binding.setViewModel(viewModel); final BookingClientComponent bookingClientComponent = DaggerBookingClientComponent.builder() .bookingClientModule(new BookingClientModule(getActivity())) .build(); viewModel.handleArgs(getArguments()); binding.webView.getSettings().setJavaScriptEnabled(true); binding.webView.getSettings().setLoadWithOverviewMode(true); binding.webView.getSettings().setUseWideViewPort(true); binding.webView.setWebViewClient(viewModel.webViewClient( bookingClientComponent.getOAuth2CallbackHandler() )); viewModel.intentObservable() .observeOn(AndroidSchedulers.mainThread()) .takeUntil(lifecycle().onDestroy()) .subscribe(new Action1<Intent>() { @Override public void call(Intent intent) { getActivity().setResult(Activity.RESULT_OK, intent); getActivity().finish(); } }, new Action1<Throwable>() { @Override public void call(Throwable throwable) { Toast.makeText(getActivity(), throwable.getMessage(), Toast.LENGTH_LONG).show(); getActivity().setResult(Activity.RESULT_CANCELED); getActivity().finish(); LogUtils.LOGE(TAG_EXTERNAL_AUTH, "Error on external provider auth", throwable); } }); }

Target:
@Override public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); ExternalProviderAuthBinding binding = ExternalProviderAuthBinding.bind(view); binding.setViewModel(viewModel); binding.edit.setFocusable(true); binding.edit.requestFocus(); final BookingClientComponent bookingClientComponent = DaggerBookingClientComponent.builder() .bookingClientModule(new BookingClientModule(getActivity())) .build(); viewModel.handleArgs(getArguments()); binding.webView.getSettings().setJavaScriptEnabled(true); binding.webView.getSettings().setLoadWithOverviewMode(true); binding.webView.getSettings().setUseWideViewPort(true); binding.webView.setWebViewClient(viewModel.webViewClient( bookingClientComponent.getOAuth2CallbackHandler() )); viewModel.intentObservable() .observeOn(AndroidSchedulers.mainThread()) .takeUntil(lifecycle().onDestroy()) .subscribe(new Action1<Intent>() { @Override public void call(Intent intent) { getActivity().setResult(Activity.RESULT_OK, intent); getActivity().finish(); } }, new Action1<Throwable>() { @Override public void call(Throwable throwable) { Toast.makeText(getActivity(), throwable.getMessage(), Toast.LENGTH_LONG).show(); getActivity().setResult(Activity.RESULT_CANCELED); getActivity().finish(); LogUtils.LOGE(TAG_EXTERNAL_AUTH, "Error on external provider auth", throwable); } }); }
Source:
public void dispose() { phone.mCM.unregisterForAvailable(this); phone.mCM.unregisterForOffOrNotAvailable(this); ((GSMPhone) phone).mSIMRecords.unregisterForRecordsLoaded(this); phone.mCM.unregisterForDataStateChanged(this); ((GSMPhone) phone).mCT.unregisterForVoiceCallEnded(this); ((GSMPhone) phone).mCT.unregisterForVoiceCallStarted(this); ((GSMPhone) phone).mSST.unregisterForGprsAttached(this); ((GSMPhone) phone).mSST.unregisterForGprsDetached(this); ((GSMPhone) phone).mSST.unregisterForRoamingOn(this); ((GSMPhone) phone).mSST.unregisterForRoamingOff(this); this.removeCallbacksAndMessages(null); phone.getContext().unregisterReceiver(this.alarmReceiver); phone.getContext().unregisterReceiver(this.screenOnOffReceiver); phone.getContext().getContentResolver().unregisterContentObserver(this.apnObserver); if(this.allApns != null) { this.allApns.removeAll(this.allApns); } destroyAllPdpList(); this.allApns = null; this.netstat = null; this.filter = null; this.filterS = null; this.screenOnOffReceiver = null; this.mDataConnectionTracker = null; this.mResolver = null; this.apnObserver = null; this.pdpList = null; this.dataEnabled = null; this.phone = null; }

Target:
public void dispose() { phone.mCM.unregisterForAvailable(this); phone.mCM.unregisterForOffOrNotAvailable(this); ((GSMPhone) phone).mSIMRecords.unregisterForRecordsLoaded(this); phone.mCM.unregisterForDataStateChanged(this); ((GSMPhone) phone).mCT.unregisterForVoiceCallEnded(this); ((GSMPhone) phone).mCT.unregisterForVoiceCallStarted(this); ((GSMPhone) phone).mSST.unregisterForGprsAttached(this); ((GSMPhone) phone).mSST.unregisterForGprsDetached(this); ((GSMPhone) phone).mSST.unregisterForRoamingOn(this); ((GSMPhone) phone).mSST.unregisterForRoamingOff(this); phone.getContext().unregisterReceiver(this.alarmReceiver); phone.getContext().unregisterReceiver(this.screenOnOffReceiver); phone.getContext().getContentResolver().unregisterContentObserver(this.apnObserver); destroyAllPdpList(); }
Source:
public String toString() { return new ToStringBuilder(this).append("id", getId()) .append("author", getAuthor()) .append("text", getText()) .toString(); }

Target:
public String toString() { return new ToStringBuilder(this).append("id", getId()).toString(); }
Source:
public int read(byte[] bytes, int off, int len) { if (len <= 0) { return 0; } if (current == null) { return -1; } int bytesRead = 0; while (bytesRead < len) { if (current.remaining() > 0) { int bytesToRead = Math.min(len - bytesRead, current.remaining()); current.get(bytes, off + bytesRead, bytesToRead); bytesRead += bytesToRead; this.position += bytesToRead; } else if (!nextBuffer()) { return bytesRead > 0 ? bytesRead : -1; } } return bytesRead; }

Target:
public int read(byte[] bytes, int off, int len) { if (len <= 0) { if (len < 0) { throw new IndexOutOfBoundsException("Read length must be greater than 0: " + len); } return 0; } if (current == null) { return -1; } int bytesRead = 0; while (bytesRead < len) { if (current.remaining() > 0) { int bytesToRead = Math.min(len - bytesRead, current.remaining()); current.get(bytes, off + bytesRead, bytesToRead); bytesRead += bytesToRead; this.position += bytesToRead; } else if (!nextBuffer()) { return bytesRead > 0 ? bytesRead : -1; } } return bytesRead; }
Source:
public List<InterpreterCompletion> completion(String buf, int cursor) { return null; }

Target:
public List<InterpreterCompletion> completion(String buf, int cursor) { return Collections.emptyList(); }
Source:
private ApplyPatchTask getTask(String arcPath, String scmType, String scmPath) throws Exception { final ApplyPatchTask task = new ApplyPatchTask( TestUtils.getDefaultLogger(), TestUtils.createLauncherFactory(j), TestUtils.TEST_SHA, TestUtils.TEST_DIFFERENTIAL_ID, TestUtils.TEST_CONDUIT_URL, TestUtils.TEST_CONDUIT_TOKEN, arcPath, false, false, false, false, scmType ); switch (scmType) { case "git": task.setGitPath(scmPath); break; case "hg": task.setHgPath(scmPath); break; case "svn": default: break; } return task; }

Target:
private ApplyPatchTask getTask(String arcPath, String scmType, String scmPath) throws Exception { final ApplyPatchTask task = new ApplyPatchTask( TestUtils.getDefaultLogger(), TestUtils.createLauncherFactory(j), TestUtils.TEST_SHA, TestUtils.TEST_DIFFERENTIAL_ID, TestUtils.TEST_CONDUIT_URL, TestUtils.TEST_CONDUIT_TOKEN, arcPath, false, false, false, false, scmType ); setScmPath.accept(task, scmPath); return task; }