auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String createAccountFileContent( XMPPAccount activeAccount, ArrayList<XMPPAccount> configuredAccounts) { Integer index = configuredAccounts.indexOf(activeAccount); StringBuilder xmlContent = new StringBuilder() .append("<accounts>\n") .append(String.format(" <activeAccountIndex>%d</activeAccountIndex>\n", index)); xmlContent.append(" <configuredAccounts>\n"); for (XMPPAccount acc : configuredAccounts) { xmlContent .append(" <xmppAccount>\n") .append(String.format(" <username>%s</username>\n", acc.getUsername())) .append(String.format(" <password>%s</password>\n", acc.getPassword())) .append(String.format(" <domain>%s</domain>\n", acc.getDomain())) .append(String.format(" <server>%s</server>\n", acc.getServer())) .append(String.format(" <port>%d</port>\n", acc.getPort())) .append(String.format(" <useTLS>%s</useTLS>\n", acc.useTLS())) .append(String.format(" <useSASL>%s</useSASL>\n", acc.useSASL())) .append(" </xmppAccount>\n"); } xmlContent.append(" </configuredAccounts>\n").append("</accounts>"); return xmlContent.toString(); }

Target:
private String createAccountFileContent( XMPPAccount activeAccount, ArrayList<XMPPAccount> configuredAccounts) { int index = configuredAccounts.indexOf(activeAccount); StringBuilder xmlContent = new StringBuilder() .append("<accounts>\n") .append(String.format(" <activeAccountIndex>%d</activeAccountIndex>\n", index)); xmlContent.append(" <configuredAccounts>\n"); for (XMPPAccount acc : configuredAccounts) { xmlContent .append(" <xmppAccount>\n") .append(String.format(" <username>%s</username>\n", acc.getUsername())) .append(String.format(" <password>%s</password>\n", acc.getPassword())) .append(String.format(" <domain>%s</domain>\n", acc.getDomain())) .append(String.format(" <server>%s</server>\n", acc.getServer())) .append(String.format(" <port>%d</port>\n", acc.getPort())) .append(String.format(" <useTLS>%s</useTLS>\n", acc.useTLS())) .append(String.format(" <useSASL>%s</useSASL>\n", acc.useSASL())) .append(" </xmppAccount>\n"); } xmlContent.append(" </configuredAccounts>\n").append("</accounts>"); return xmlContent.toString(); }
Source:
public void retry() { invoke(next()); }

Target:
public void retry() { context.checkThread(); invoke(next()); }
Source:
void processRequest(CorfuMsg msg, ChannelHandlerContext ctx, IServerRouter r) { getHandler().handle(msg, ctx, r); }

Target:
protected void processRequest(CorfuMsg msg, ChannelHandlerContext ctx, IServerRouter r) { getHandler().handle(msg, ctx, r); }
Source:
public String loadZip(LoadZipDetails ldz, Locale locale) throws IOException { String realFileName = ""; String returnFileName = ""; OutputStreamWriter writer = null; HttpURLConnection conn = null; InputStream istream = null; OutputStream ostream = null; try { LOGGER.debug("WFS URL: " + ldz.getWFSUrl()); if (ldz.isDownloadNormalWay()) { System.out.println("Download normal way"); } else { System.out.println("Download plugin way"); } if (ldz.getGetFeatureInfoRequest().isEmpty()) { return null; } LOGGER.debug("WFS URL: " + ldz.getWFSUrl()); LOGGER.debug("-- filtter: " + ldz.getGetFeatureInfoRequest()); final URL url = new URL(ldz.getWFSUrl() + ldz.getGetFeatureInfoRequest()); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.setConnectTimeout(600000); conn.connect(); String filename = UUID.randomUUID().toString(); istream = conn.getInputStream(); String strTempDir = ldz.getTemporaryDirectory(); File dir0 = new File(strTempDir); dir0.mkdirs(); ostream = new FileOutputStream(new File(dir0, filename + ".zip")); final byte[] buffer = new byte[8 * 1024]; while (true) { int len = istream.read(buffer); if (len <= 0) { break; } ostream.write(buffer, 0, len); } if (!isValid(new File(dir0, filename + ".zip"))) { ErrorReportDetails erd = new ErrorReportDetails(); erd.setErrorFileLocation(realFileName); erd.setWfsUrl(ldz.getWFSUrl()); erd.setXmlRequest(ldz.getGetFeatureInfoRequest()); erd.setUserEmail(ldz.getUserEmail()); erd.setLanguage(locale.getLanguage()); sendErrorReportToEmail(erd); } } catch (Exception ex) { LOGGER.error("Error: ", ex); } finally { IOHelper.close(writer); if (conn != null) { conn.disconnect(); } IOHelper.close(istream); IOHelper.close(ostream); } return returnFileName; }

Target:
public String loadZip(LoadZipDetails ldz, Locale locale) throws IOException { String realFileName = null; HttpURLConnection conn = null; try { LOGGER.debug("WFS URL: " + ldz.getWFSUrl()); if (ldz.isDownloadNormalWay()) { LOGGER.debug("Download normal way"); } LOGGER.debug("WFS URL: " + ldz.getWFSUrl()); LOGGER.debug("-- filter: " + ldz.getGetFeatureInfoRequest()); final URL url = new URL(ldz.getWFSUrl() + ldz.getGetFeatureInfoRequest()); conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("GET"); conn.setConnectTimeout(600000); conn.connect(); String filename = UUID.randomUUID().toString(); String strTempDir = ldz.getTemporaryDirectory(); File dir0 = new File(strTempDir); dir0.mkdirs(); try (InputStream istream = conn.getInputStream(); OutputStream ostream = new FileOutputStream(new File(dir0, filename + ".zip"))) { IOHelper.copy(istream, ostream); realFileName = new File(dir0, filename + ".zip").getAbsolutePath(); } } catch (Exception ex) { LOGGER.error("Error: ", ex); } return realFileName; }
Source:
public static ConnectionBuilder connection() { Class<? extends ConnectionBuilder> clazz = null; try { clazz = (Class<ConnectionBuilder>) Class.forName("org.ovirt.engine.sdk4.internal.ConnectionBuilder45"); } catch (ClassNotFoundException|LinkageError ex) { try { clazz = (Class<ConnectionBuilder>) Class.forName("org.ovirt.engine.sdk4.internal.ConnectionBuilder42"); } catch (ClassNotFoundException|LinkageError e) { throw new Error("No connection implementation found", e); } } try { return clazz.newInstance(); } catch (Exception e) { throw new Error("Failed to initialize connection implementation", e); } }

Target:
public static ConnectionBuilder connection() { Class<? extends ConnectionBuilder> clazz = null; try { clazz = (Class<ConnectionBuilder>) Class.forName("org.ovirt.engine.sdk4.internal.ConnectionBuilder45"); } catch (Throwable ex) { try { clazz = (Class<ConnectionBuilder>) Class.forName("org.ovirt.engine.sdk4.internal.ConnectionBuilder42"); } catch (Throwable e) { throw new Error("No connection implementation found", e); } } try { return clazz.newInstance(); } catch (Exception e) { throw new Error("Failed to initialize connection implementation", e); } }
Source:
private void relocateHashAdder(JsonObject hashAdder){ Set<JsonObject> parents = GraphUtilities.getUpstream(hashAdder, graph); if (parents.size() != 1) return; JsonObject parent = parents.iterator().next(); if (GraphUtilities.getDownstream(parent, graph).size() != 1) return; if (jstring(parent, "kind").equals(BVirtualMarker.END_PARALLEL.kind())) { GraphUtilities.removeOperator(hashAdder, graph); GraphUtilities.addBefore(parent, hashAdder, graph); } }

Target:
private void relocateHashAdder(JsonObject hashAdder){ Set<JsonObject> parents = GraphUtilities.getUpstream(hashAdder, graph); if (parents.size() != 1) return; JsonObject parent = parents.iterator().next(); if (GraphUtilities.isKind(parent, BVirtualMarker.END_PARALLEL.kind()) && GraphUtilities.getDownstream(parent, graph).size() == 1) { JsonObject hashAdderCopy = GraphUtilities.copyOperatorNewName( hashAdder, jstring(hashAdder, "name")); GraphUtilities.removeOperator(hashAdder, graph); GraphUtilities.addBefore(parent, hashAdderCopy, graph); } }
Source:
public void windowsOnly() { assumeTrue(File.pathSeparatorChar==';'); }

Target:
public void windowsOnly() { assumeTrue(Functions.isWindows()); }
Source:
private void loadProviders() { ArrayList<ProviderPair> ret = new ArrayList<ProviderPair>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] cf = registry.getConfigurationElementsFor("org.jboss.tools.openshift.core.connection", "registryprovider"); for( int i = 0; i < cf.length; i++ ) { try { IConnectionRegistryProvider p = (IConnectionRegistryProvider) cf[i].createExecutableExtension("class"); String weight = cf[i].getAttribute("weight"); Integer in = Integer.parseInt(weight); if( p != null && in != null) { ret.add(new ProviderPair(p, in.intValue())); } } catch (CoreException e) { OpenShiftCoreActivator.pluginLog().logError("Failure loading registry provider extension", e); } } registryProviders = (ProviderPair[]) ret.toArray(new ProviderPair[ret.size()]); }

Target:
private void loadProviders() { ArrayList<ProviderPair> ret = new ArrayList<ProviderPair>(); IExtensionRegistry registry = Platform.getExtensionRegistry(); IConfigurationElement[] cf = registry.getConfigurationElementsFor("org.jboss.tools.openshift.core.connection", "registryprovider"); for( int i = 0; i < cf.length; i++ ) { try { IConnectionRegistryProvider p = (IConnectionRegistryProvider) cf[i].createExecutableExtension("class"); String weight = cf[i].getAttribute("weight"); Integer in = Integer.parseInt(weight); if( p != null && in != null) { ret.add(new ProviderPair(p, in.intValue())); } } catch (CoreException e) { OpenShiftCoreActivator.pluginLog().logError("Failure loading registry provider extension", e); } } registryProviders = ret.toArray(new ProviderPair[ret.size()]); }
Source:
static void configureHttpProxy() throws MalformedURLException { for (String protocol : new String[] { "http", "https" }) { if (System.getProperty(protocol + ".proxyHost") != null) continue; String s = System.getenv(protocol + "_proxy"); if (s == null && protocol.equals("https")) { s = System.getenv("HTTPS_PROXY"); } if (s == null || s.equals("")) continue; final URL u = new URL( (s.indexOf("://") == -1) ? protocol + "://" + s : s); if (!u.getProtocol().startsWith("http")) throw new MalformedURLException(MessageFormat.format( CLIText.get().invalidHttpProxyOnlyHttpSupported, s)); final String proxyHost = u.getHost(); final int proxyPort = u.getPort(); System.setProperty(protocol + ".proxyHost", proxyHost); if (proxyPort > 0) System.setProperty(protocol + ".proxyPort", String.valueOf(proxyPort)); final String userpass = u.getUserInfo(); if (userpass != null && userpass.contains(":")) { final int c = userpass.indexOf(':'); final String user = userpass.substring(0, c); final String pass = userpass.substring(c + 1); CachedAuthenticator.add( new CachedAuthenticator.CachedAuthentication(proxyHost, proxyPort, user, pass)); } } }

Target:
static void configureHttpProxy() throws MalformedURLException { for (String protocol : new String[] { "http", "https" }) { if (System.getProperty(protocol + ".proxyHost") != null) { continue; } String s = System.getenv(protocol + "_proxy"); if (s == null && protocol.equals("https")) { s = System.getenv("HTTPS_PROXY"); } if (s == null || s.equals("")) { continue; } final URL u = new URL( (s.indexOf("://") == -1) ? protocol + "://" + s : s); if (!u.getProtocol().startsWith("http")) throw new MalformedURLException(MessageFormat.format( CLIText.get().invalidHttpProxyOnlyHttpSupported, s)); final String proxyHost = u.getHost(); final int proxyPort = u.getPort(); System.setProperty(protocol + ".proxyHost", proxyHost); if (proxyPort > 0) System.setProperty(protocol + ".proxyPort", String.valueOf(proxyPort)); final String userpass = u.getUserInfo(); if (userpass != null && userpass.contains(":")) { final int c = userpass.indexOf(':'); final String user = userpass.substring(0, c); final String pass = userpass.substring(c + 1); CachedAuthenticator.add( new CachedAuthenticator.CachedAuthentication(proxyHost, proxyPort, user, pass)); } } }
Source:
public GenericRecord parse(ByteBuffer bytes) { Pair<SUBJECT, ID> subjectAndId = subjectAndIdConverter.getSubjectAndId(bytes); Schema schema = typedRepository.getSchema(subjectAndId.lhs, subjectAndId.rhs); if (schema == null) throw new ParseException("schema lookup failed!!!"); DatumReader<GenericRecord> reader = new GenericDatumReader<GenericRecord>(schema); ByteBufferInputStream inputStream = new ByteBufferInputStream(Collections.singletonList(bytes)); try { return reader.read(null, DecoderFactory.get().binaryDecoder(inputStream, null)); } catch (IOException e) { throw new ParseException(e, "Fail to decode avro message!"); } }

Target:
public GenericRecord parse(ByteBuffer bytes) { Pair<SUBJECT, ID> subjectAndId = subjectAndIdConverter.getSubjectAndId(bytes); Schema schema = typedRepository.getSchema(subjectAndId.lhs, subjectAndId.rhs); if (schema == null) { throw new ParseException(String.format("schema lookup failed! subject=%s, id=%s", subjectAndId.lhs, subjectAndId.rhs)); } DatumReader<GenericRecord> reader = new GenericDatumReader<GenericRecord>(schema); ByteBufferInputStream inputStream = new ByteBufferInputStream(Collections.singletonList(bytes)); try { return reader.read(null, DecoderFactory.get().binaryDecoder(inputStream, null)); } catch (IOException e) { throw new ParseException(e, "Fail to decode avro message!"); } }
Source:
private ListenableFuture<TransportChannel> getOrConnect(@CheckForNull InetSocketAddress address) { checkArgument(address != null); return Futures.transform(resolveSocketAddress(address), new Function<InetSocketAddress, TransportChannel>() { @Override public TransportChannel apply(final InetSocketAddress resolvedAddress) { return connectedChannels.get(resolvedAddress, new Computable<InetSocketAddress, TransportChannel>() { @Override public TransportChannel compute(final InetSocketAddress input) { final Channel channel = createConnectorChannel(); final TransportChannel transportChannel = createConnectorTransportChannel(channel, input); Futures.addCallback(registerChannel(channel), new FutureCallback<Void>() { @Override public void onSuccess(Void void0) { connect(channel, input, transportChannel); } @Override public void onFailure(Throwable throwable) { channel.unsafe().closeForcibly(); transportChannel.close(); } }); return transportChannel; } }); } }); }

Target:
private ListenableFuture<TransportChannel> getOrConnect(@CheckForNull InetSocketAddress address) { checkArgument(address != null); return Futures.transform(resolveSocketAddress(address), new Function<InetSocketAddress, TransportChannel>() { @Override public TransportChannel apply(final InetSocketAddress resolvedAddress) { return connectedChannels.get(resolvedAddress, new Computable<InetSocketAddress, TransportChannel>() { @Override public TransportChannel compute(final InetSocketAddress input) { final Channel channel = createConnectorChannel(); final TransportChannel transportChannel = createConnectorTransportChannel(channel, input); eventLoop.register(channel).addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { if (future.isSuccess()) { LOGGER.info("Registered connector: {}", transportChannel); connect(channel, input, transportChannel); } else { channel.unsafe().closeForcibly(); transportChannel.close(); } } }); return transportChannel; } }); } }); }
Source:
public void testWrongSocket() { bot.view("Package Explorer").show(); bot.menu("File").click(); bot.menu("File").menu("Import...").click(); bot.shell("Import"); SWTBotTree tree = bot.tree(0); tree.expandNode("Git").select("Git Repository"); bot.button("Next >").click(); bot.shell("Import Git Repository"); bot.textWithLabel("URI:").setText("git://www.jgit.org:80/EGIT"); assertSourceParams(null, "www.jgit.org", "/EGIT", "git", "80", true, "", "", false, false); bot.button("Next >").click(); assertEquals(" git://www.jgit.org:80/EGIT: not found.", bot.text(0) .getText()); assertTrue(bot.button("Cancel").isEnabled()); assertTrue(bot.button("< Back").isEnabled()); assertFalse(bot.button("Next >").isEnabled()); assertFalse(bot.button("Finish").isEnabled()); bot.button("Cancel").click(); }

Target:
public void testWrongSocket() { goToImportGitRepository(); bot.textWithLabel("URI:").setText("git://www.jgit.org:80/EGIT"); assertSourceParams(null, "www.jgit.org", "/EGIT", "git", "80", true, "", "", false, false); bot.button("Next >").click(); assertEquals(" git://www.jgit.org:80/EGIT: not found.", bot.text(0) .getText()); assertTrue(bot.button("Cancel").isEnabled()); assertTrue(bot.button("< Back").isEnabled()); assertFalse(bot.button("Next >").isEnabled()); assertFalse(bot.button("Finish").isEnabled()); bot.button("Cancel").click(); }
Source:
public KieServerExtension scenarioSimulationServerExtension() { return new ScenarioSimulationKieServerExtension(); }

Target:
public KieServerExtension scenarioSimulationServerExtension() { return new SpringBootScenarioSimulationKieServerExtension(); }
Source:
public void marshal(final Exchange exchange, final Object graph, final OutputStream stream) throws Exception { String filename; String filepath = exchange.getIn().getHeader(FILE_NAME, String.class); if (filepath == null) { filename = filepath = StringHelper.sanitize(exchange.getIn().getMessageId()); } else { filename = Paths.get(filepath).getFileName().toString(); } ZipOutputStream zos = new ZipOutputStream(stream); zos.putNextEntry(new ZipEntry(filepath)); InputStream is = exchange.getContext().getTypeConverter().mandatoryConvertTo(InputStream.class, exchange, graph); try { IOHelper.copy(is, zos); } finally { IOHelper.close(is, zos); } String newFilename = filename + ".zip"; exchange.getOut().setHeader(FILE_NAME, newFilename); }

Target:
public void marshal(final Exchange exchange, final Object graph, final OutputStream stream) throws Exception { String filename; String filepath = exchange.getIn().getHeader(FILE_NAME, String.class); if (filepath == null) { filename = filepath = StringHelper.sanitize(exchange.getIn().getMessageId()); } else { filename = Paths.get(filepath).getFileName().toString(); } ZipOutputStream zos = new ZipOutputStream(stream); if (preservePathElements) { createZipEntries(zos, filepath); } else { createZipEntries(zos, filename); } InputStream is = exchange.getContext().getTypeConverter().mandatoryConvertTo(InputStream.class, exchange, graph); try { IOHelper.copy(is, zos); } finally { IOHelper.close(is, zos); } String newFilename = filename + ".zip"; exchange.getOut().setHeader(FILE_NAME, newFilename); }
Source:
static int getExifRotation(int orientation) { switch (orientation) { case ORIENTATION_ROTATE_90: case ORIENTATION_TRANSPOSE: return 90; case ORIENTATION_ROTATE_180: case ORIENTATION_FLIP_VERTICAL: return 180; case ORIENTATION_ROTATE_270: case ORIENTATION_TRANSVERSE: return 270; default: return 0; } }

Target:
static int getExifRotation(int orientation) { int rotation; switch (orientation) { case ORIENTATION_ROTATE_90: case ORIENTATION_TRANSPOSE: rotation = 90; break; case ORIENTATION_ROTATE_180: case ORIENTATION_FLIP_VERTICAL: rotation = 180; break; case ORIENTATION_ROTATE_270: case ORIENTATION_TRANSVERSE: rotation = 270; break; default: rotation = 0; } return rotation; }
Source:
public void deleteDraft() { JCUser user = userService.getCurrentUser(); TopicDraft topicDraft = topicDraftDao.getForUser(user); if (topicDraft != null) { topicDraftDao.delete(topicDraft); } }

Target:
public void deleteDraft() { JCUser user = userService.getCurrentUser(); topicDraftDao.deleteByUser(user); }
Source:
private static Type getPrestoType(String elasticsearchType) { switch (elasticsearchType) { case "double": case "float": return DOUBLE; case "integer": return INTEGER; case "long": return BIGINT; case "string": case "text": case "keyword": return VARCHAR; case "boolean": return BOOLEAN; case "binary": return VARBINARY; default: throw new IllegalArgumentException("Not supported Elasticsearch type: " + elasticsearchType); } }

Target:
private static Type getPrestoType(String elasticsearchType) { switch (elasticsearchType) { case "double": case "float": return DOUBLE; case "integer": return INTEGER; case "long": return BIGINT; case "string": case "text": case "keyword": return VARCHAR; case "boolean": return BOOLEAN; case "binary": return VARBINARY; default: throw new IllegalArgumentException("Unsupported type: " + elasticsearchType); } }
Source:
public String getName() { return this.modeName; }

Target:
public String getName() { return this.friendlyName; }
Source:
public static SdtFile getSdtFile(String archiveFilename) { for (String part : new String[] {"HD.sdt", "HD.SDT", "HW.sdt", "HW.SDT"}) { File f = new File(PathUtils.getDKIIFolder() + PathUtils.DKII_SFX_FOLDER + archiveFilename + part); if (f.exists()) { return new SdtFile(f); } } return null; }

Target:
public static SdtFile getSdtFile(String archiveFilename) { for (String part : new String[] {"HD.sdt", "HW.sdt"}) { try { File f = new File(ConversionUtils.getRealFileName(PathUtils.getDKIIFolder(), PathUtils.DKII_SFX_FOLDER + archiveFilename + part)); if (f.exists()) { return new SdtFile(f); } } catch (Exception ex) { } } LOGGER.log(Level.WARNING, "SDT File archive {0} not found", archiveFilename); return null; }
Source:
public AvroUser() { this(AvroUserSchemaLoader.load(), "", 0, "") ; }

Target:
public AvroUser() { this(AvroUserSchemaLoader.load(), "defaultName", 0, "defaultColor") ; }
Source:
public Collection<PluginFQN> parsePlugins(Map<String, String> attributes) throws InfrastructureException { if (attributes == null) { return emptyList(); } String pluginsAttribute = attributes.getOrDefault(Constants.WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, null); String editorAttribute = attributes.getOrDefault(Constants.WORKSPACE_TOOLING_EDITOR_ATTRIBUTE, null); List<PluginFQN> metaFQNs = new ArrayList<>(); if (!isNullOrEmpty(pluginsAttribute)) { String[] plugins = pluginsAttribute.split(" *, *"); if (plugins.length != 0) { metaFQNs.addAll(parsePluginFQNs(plugins)); } } if (!isNullOrEmpty(editorAttribute)) { String[] editor = editorAttribute.split(" *, *"); if (editor.length > 1) { throw new InfrastructureException( "Multiple editors found in workspace config attributes. " + "Only one editor is supported per workspace."); } metaFQNs.addAll(parsePluginFQNs(editor)); } return metaFQNs; }

Target:
public Collection<PluginFQN> parsePlugins(Map<String, String> attributes) throws InfrastructureException { if (attributes == null) { return emptyList(); } String pluginsAttribute = attributes.getOrDefault(Constants.WORKSPACE_TOOLING_PLUGINS_ATTRIBUTE, null); String editorAttribute = attributes.getOrDefault(Constants.WORKSPACE_TOOLING_EDITOR_ATTRIBUTE, null); List<PluginFQN> metaFQNs = new ArrayList<>(); if (!isNullOrEmpty(pluginsAttribute)) { String[] plugins = splitAttribute(pluginsAttribute); if (plugins.length != 0) { metaFQNs.addAll(parsePluginFQNs(plugins)); } } if (!isNullOrEmpty(editorAttribute)) { String[] editor = splitAttribute(editorAttribute); if (editor.length > 1) { throw new InfrastructureException( "Multiple editors found in workspace config attributes. " + "Only one editor is supported per workspace."); } metaFQNs.addAll(parsePluginFQNs(editor)); } return metaFQNs; }
Source:
public void onMatch(RelOptRuleCall call) { final Aggregate aggregate = call.rel(0); if (aggregate.getGroupSets().size() != 1) { return; } List<AggregateCall> newAggCalls = new ArrayList<AggregateCall>(); AggregateFactory f = HiveRelFactories.HIVE_AGGREGATE_FACTORY; VBuilder vb = new VBuilder(aggregate); ProjectFactory projectFactory = HiveRelFactories.HIVE_PROJECT_FACTORY; if (aggregate.getAggCallList().equals(vb.newAggCalls)) { return; } newAggCalls = vb.newAggCalls; RelNode newAgg = aggregate.copy(aggregate.getTraitSet(), aggregate.getInput(), aggregate.getGroupSet(), aggregate.getGroupSets(), newAggCalls); RelNode newProject = projectFactory.createProject(newAgg, vb.newProjects, aggregate.getRowType().getFieldNames()); call.transformTo(newProject); return; }

Target:
public void onMatch(RelOptRuleCall call) { final Aggregate aggregate = call.rel(0); if (aggregate.getGroupSets().size() != 1) { return; } List<AggregateCall> newAggCalls = new ArrayList<AggregateCall>(); VBuilder vb = new VBuilder(aggregate); if (aggregate.getAggCallList().equals(vb.newAggCalls)) { return; } newAggCalls = vb.newAggCalls; RelNode newAgg = aggregate.copy(aggregate.getTraitSet(), aggregate.getInput(), aggregate.getGroupSet(), aggregate.getGroupSets(), newAggCalls); RelNode newProject = projectFactory.createProject(newAgg, vb.newProjects, aggregate.getRowType().getFieldNames()); call.transformTo(newProject); return; }
Source:
public Object fromAvro(Schema schema, Object input) { switch (schema.getType()) { case NULL: if (input == null) { return null; } throw new NonNullValueException(); case UNION: for (Schema sub : schema.getTypes()) { try { return service.fromAvro(sub, BlobProperty.class, input); } catch (NonNullValueException e) { } } throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType()); case RECORD: try { GenericRecord record = (GenericRecord) input; String mimeType = (String) record.get(service.encodeName(Constants.MIME_TYPE)); String encoding = (String) record.get(Constants.ENCODING); byte[] bytes = ((ByteBuffer) record.get(Constants.DATA)).array(); Blob b = Blobs.createBlob(bytes, mimeType, encoding); b.setFilename((String) record.get(Constants.NAME)); b.setDigest((String) record.get(Constants.DIGEST)); return b; } catch (IOException e) { throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType(), e); } default: throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType()); } }

Target:
public Object fromAvro(Schema schema, Object input) { switch (schema.getType()) { case NULL: if (input == null) { return null; } throw new NonNullValueException(); case UNION: for (Schema sub : schema.getTypes()) { try { return service.fromAvro(sub, BlobProperty.class, input); } catch (NonNullValueException e) { } } throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType()); case RECORD: try { GenericRecord record = (GenericRecord) input; String mimeType = (String) record.get(service.encodeName(AvroConstants.MIME_TYPE)); String encoding = (String) record.get(AvroConstants.ENCODING); byte[] bytes = ((ByteBuffer) record.get(AvroConstants.DATA)).array(); Blob b = Blobs.createBlob(bytes, mimeType, encoding); b.setFilename((String) record.get(AvroConstants.CONTENT_NAME)); b.setDigest((String) record.get(AvroConstants.DIGEST)); return b; } catch (IOException e) { throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType(), e); } default: throw new RuntimeServiceException(CANNOT_MAP_FROM + schema.getType()); } }
Source:
private static String extractScriptStackTrace(RhinoException e) { String st = e.getScriptStackTrace(); if (st.equals("")) return null; return st; }

Target:
private static String extractScriptStackTrace(RhinoException e) { String st = e.getScriptStackTrace(); if (st.isEmpty()) return null; return st; }
Source:
protected final void init() { eventBus.init(this); tenantIndex.init(this); }

Target:
protected final void init() { eventBus.registerWith(this); tenantIndex.registerWith(this); }
Source:
private void searchForDefault() { long start = System.currentTimeMillis(); ArrayList<File> roots = new ArrayList<>(); ArrayList<File> folders = new ArrayList<>(); if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) || Environment.MEDIA_MOUNTED_READ_ONLY.equals(Environment.getExternalStorageState())) { Logger.log(LogTypes.SOFT_ASSERT, "Access outside scoped storage in searching zip file"); roots.add(Environment.getExternalStorageDirectory()); } for (String s : FileUtil.getExternalMounts()) { roots.add(new File(s)); } for (File r : roots) { folders.add(r); for (File f : r.listFiles()) { if (f.isDirectory()) { folders.add(f); } } } File bestMatch = null; for (File folder : folders) { for (File f : folder.listFiles()) { String name = f.getName().toLowerCase(); if (name.startsWith("commcare") && name.endsWith(".zip")) { if (bestMatch == null) { bestMatch = f; } else { if (bestMatch.lastModified() < f.lastModified()) { bestMatch = f; } } } } if (bestMatch != null) { break; } if (System.currentTimeMillis() - start > MAX_TIME_TO_TRY) { Log.i(LOG_TAG, "Had to bail on looking for a default file, was taking too long"); break; } } if (bestMatch != null) { editFileLocation.setText(bestMatch.getAbsolutePath()); } }

Target:
private void searchForDefault() { long start = System.currentTimeMillis(); ArrayList<File> roots = new ArrayList<>(); ArrayList<File> folders = new ArrayList<>(); if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) || Environment.MEDIA_MOUNTED_READ_ONLY.equals(Environment.getExternalStorageState())) { roots.add(Environment.getExternalStorageDirectory()); } for (String s : FileUtil.getExternalMounts()) { roots.add(new File(s)); } for (File r : roots) { folders.add(r); for (File f : r.listFiles()) { if (f.isDirectory()) { folders.add(f); } } } File bestMatch = null; for (File folder : folders) { for (File f : folder.listFiles()) { String name = f.getName().toLowerCase(); if (name.startsWith("commcare") && name.endsWith(".zip")) { if (bestMatch == null) { bestMatch = f; } else { if (bestMatch.lastModified() < f.lastModified()) { bestMatch = f; } } } } if (bestMatch != null) { break; } if (System.currentTimeMillis() - start > MAX_TIME_TO_TRY) { Log.i(LOG_TAG, "Had to bail on looking for a default file, was taking too long"); break; } } if (bestMatch != null) { editFileLocation.setText(bestMatch.getAbsolutePath()); } }
Source:
public void handleToken(Token<GcodeTokenId> token, int line) { if (GcodeTokenId.MOVEMENT.equals(token.id())) { if ((StringUtils.equalsIgnoreCase(token.text(), Code.G1.name()) || StringUtils.equalsIgnoreCase(token.text(), Code.G3.name())) && firstMovementToken == null) { firstMovementToken = token; firstMovementLine = line; } } else if (GcodeTokenId.PARAMETER.equals(token.id())) { if (StringUtils.startsWithIgnoreCase(token.text(), "F") && firstFeedRateToken == null) { firstFeedRateToken = token; firstFeedRateLine = line; } } }

Target:
public void handleToken(Token<GcodeTokenId> token, int line) { if (GcodeTokenId.MOVEMENT.equals(token.id())) { if (isMovementCommand(token) && firstMovementToken == null) { firstMovementToken = token; firstMovementLine = line; } } else if (GcodeTokenId.PARAMETER.equals(token.id())) { if (StringUtils.startsWithIgnoreCase(token.text(), "F") && firstFeedRateToken == null) { firstFeedRateToken = token; firstFeedRateLine = line; } } }
Source:
public void testCodeActionsQuickAssist() throws CoreException { MockLanguageServer.reset(); IProject p = TestUtils.createProject(getClass().getSimpleName() + System.currentTimeMillis()); IFile f = TestUtils.createUniqueTestFile(p, "error"); TextEdit tEdit = new TextEdit(new Range(new Position(0, 0), new Position(0, 5)), "fixed"); WorkspaceEdit wEdit = new WorkspaceEdit(Collections.singletonMap(f.getLocationURI().toString(), Collections.singletonList(tEdit))); MockLanguageServer.INSTANCE.setCodeActions(Collections .singletonList(Either.forLeft(new Command( "fixme", "edit", Collections.singletonList(wEdit)) ) )); AbstractTextEditor editor = (AbstractTextEditor)TestUtils.openEditor(f); final Set<Shell> beforeShells = Arrays.stream(editor.getSite().getShell().getDisplay().getShells()).filter(Shell::isVisible).collect(Collectors.toSet()); editor.selectAndReveal(3, 0); TextOperationAction action = (TextOperationAction) editor.getAction(ITextEditorActionConstants.QUICK_ASSIST); action.update(); action.run(); this.completionShell= TestUtils.findNewShell(beforeShells, editor.getSite().getShell().getDisplay()); final Table completionProposalList = TestUtils.findCompletionSelectionControl(completionShell); checkCompletionContent(completionProposalList); editor.close(false); p.delete(true, new NullProgressMonitor()); }

Target:
public void testCodeActionsQuickAssist() throws CoreException { MockLanguageServer.reset(); IProject p = TestUtils.createProject(getClass().getSimpleName() + System.currentTimeMillis()); IFile f = TestUtils.createUniqueTestFile(p, "error"); TextEdit tEdit = new TextEdit(new Range(new Position(0, 0), new Position(0, 5)), "fixed"); WorkspaceEdit wEdit = new WorkspaceEdit(Collections.singletonMap(f.getLocationURI().toString(), Collections.singletonList(tEdit))); MockLanguageServer.INSTANCE.setCodeActions(Collections .singletonList(Either.forLeft(new Command( "fixme", "edit", Collections.singletonList(wEdit)) ) )); AbstractTextEditor editor = (AbstractTextEditor)TestUtils.openEditor(f); final Set<Shell> beforeShells = Arrays.stream(editor.getSite().getShell().getDisplay().getShells()).filter(Shell::isVisible).collect(Collectors.toSet()); editor.selectAndReveal(3, 0); TextOperationAction action = (TextOperationAction) editor.getAction(ITextEditorActionConstants.QUICK_ASSIST); action.update(); action.run(); Shell completionShell= TestUtils.findNewShell(beforeShells, editor.getSite().getShell().getDisplay()); final Table completionProposalList = TestUtils.findCompletionSelectionControl(completionShell); checkCompletionContent(completionProposalList); }
Source:
boolean validateCommitMsg(Job job) { String ignoreCommitMsg = job.getIgnoreCommitMsg(); if(ignoreCommitMsg.isEmpty()){ return true; } else{ CommitRequest commitRequest = new CommitRequest.Builder( repository, refChange.getToHash()).build(); String actualCommitMsg = commitService.getCommit(commitRequest).getMessage(); boolean hasIgnoreMsg = actualCommitMsg != null && actualCommitMsg.toLowerCase().contains(ignoreCommitMsg.toLowerCase()); return !hasIgnoreMsg; } }

Target:
boolean validateCommitMsg(Job job) { String ignoreCommitMsg = job.getIgnoreCommitMsg(); if(ignoreCommitMsg.isEmpty()){ return true; } else{ CommitRequest commitRequest = new CommitRequest.Builder( repository, refChange.getToHash()).build(); String actualCommitMsg = commitService.getCommit(commitRequest).getMessage(); boolean hasIgnoreMsg = actualCommitMsg != null && actualCommitMsg.matches(ignoreCommitMsg); return !hasIgnoreMsg; } }
Source:
private Collection<T> getHierarchyMapperExpandedItems() { HierarchyMapper<T, ?> hierarchyMapper = getHierarchyMapper(); if (!hierarchyMapper.hasExpandedItems()) { return Collections.unmodifiableCollection(Collections.emptySet()); } Collection<T> expandedItems = new HashSet<>(); getHierarchyMapper().fetchRootItems(null) .forEach(root -> expandedItems.addAll(getExpandedItems(root))); return Collections.unmodifiableCollection(expandedItems); }

Target:
private Collection<T> getHierarchyMapperExpandedItems() { HierarchyMapper<T, ?> hierarchyMapper = getHierarchyMapper(); if (!hierarchyMapper.hasExpandedItems()) { return Collections.emptySet(); } Collection<T> expandedItems = new HashSet<>(); getHierarchyMapper().fetchRootItems(null) .forEach(root -> expandedItems.addAll(getExpandedItems(root))); return Collections.unmodifiableCollection(expandedItems); }
Source:
public Response setEndOffsets( Map<Integer, Long> offsets, @QueryParam("resume") @DefaultValue("false") final boolean resume ) throws InterruptedException { if (offsets == null) { return Response.status(Response.Status.BAD_REQUEST) .entity("Request body must contain a map of { partition:endOffset }") .build(); } else if (!endOffsets.keySet().containsAll(offsets.keySet())) { return Response.status(Response.Status.BAD_REQUEST) .entity( String.format( "Request contains partitions not being handled by this task, my partitions: %s", endOffsets.keySet() ) ) .build(); } for (Integer partition : offsets.keySet()) { if (offsets.get(partition).compareTo(nextOffsets.get(partition)) < 0) { return Response.status(Response.Status.BAD_REQUEST) .entity( String.format( "End offset must be >= current offset for partition [%s] (current: %s)", partition, nextOffsets.get(partition) ) ) .build(); } } pauseLock.lockInterruptibly(); try { if (!paused) { return Response.status(Response.Status.BAD_REQUEST) .entity("Task must be paused before changing the end offsets") .build(); } endOffsets.putAll(offsets); log.info("endOffsets changed to %s", endOffsets); } finally { pauseLock.unlock(); } if (resume) { resume(); } return Response.ok(endOffsets).build(); }

Target:
public Response setEndOffsets( Map<Integer, Long> offsets, @QueryParam("resume") @DefaultValue("false") final boolean resume ) throws InterruptedException { if (offsets == null) { return Response.status(Response.Status.BAD_REQUEST) .entity("Request body must contain a map of { partition:endOffset }") .build(); } else if (!endOffsets.keySet().containsAll(offsets.keySet())) { return Response.status(Response.Status.BAD_REQUEST) .entity( String.format( "Request contains partitions not being handled by this task, my partitions: %s", endOffsets.keySet() ) ) .build(); } pauseLock.lockInterruptibly(); try { if (!isPaused()) { return Response.status(Response.Status.BAD_REQUEST) .entity("Task must be paused before changing the end offsets") .build(); } for (Map.Entry<Integer, Long> entry : offsets.entrySet()) { if (entry.getValue().compareTo(nextOffsets.get(entry.getKey())) < 0) { return Response.status(Response.Status.BAD_REQUEST) .entity( String.format( "End offset must be >= current offset for partition [%s] (current: %s)", entry.getKey(), nextOffsets.get(entry.getKey()) ) ) .build(); } } endOffsets.putAll(offsets); log.info("endOffsets changed to %s", endOffsets); } finally { pauseLock.unlock(); } if (resume) { resume(); } return Response.ok(endOffsets).build(); }
Source:
public String computeHmac(byte[] data) { SecretKey hmacKey = deriveKey(32, "hmackey"); try { Mac mac = Mac.getInstance("HmacSHA256"); mac.init(hmacKey); return BaseEncoding.base16().encode(mac.doFinal(data)); } catch (NoSuchAlgorithmException | InvalidKeyException e) { logger.warn("Error computing HMAC: ", e); return ""; } }

Target:
public String computeHmac(byte[] data) { SecretKey hmacKey = deriveKey(32, "hmackey"); try { Mac mac = Mac.getInstance("HmacSHA256"); mac.init(hmacKey); return BaseEncoding.base16().encode(mac.doFinal(data)); } catch (NoSuchAlgorithmException | InvalidKeyException e) { logger.warn("Error computing HMAC: ", e); return null; } }
Source:
public static Long srem(Region<ByteArrayWrapper, RedisSet> region, ByteArrayWrapper key, ArrayList<ByteArrayWrapper> membersToRemove, AtomicBoolean setWasDeleted) { RedisSet redisSet = region.get(key); long numRemoved; if (redisSet == null) { numRemoved = 0; } else { numRemoved = redisSet.doSrem(membersToRemove, region, key, setWasDeleted); } return numRemoved; }

Target:
public static long srem(Region<ByteArrayWrapper, RedisSet> region, ByteArrayWrapper key, ArrayList<ByteArrayWrapper> membersToRemove, AtomicBoolean setWasDeleted) { RedisSet redisSet = region.get(key); long numRemoved; if (redisSet == null) { numRemoved = 0; } else { numRemoved = redisSet.doSrem(membersToRemove, region, key, setWasDeleted); } return numRemoved; }
Source:
public byte[] getCacheKey() { byte[] dimBytes = this.dimension.getBytes(Charsets.UTF_8); byte[] valBytes = this.value.getBytes(Charsets.UTF_8); return ByteBuffer.allocate(2 + dimBytes.length + valBytes.length) .put(CACHE_KEY) .put(dimBytes) .put(STRING_SEPARATOR) .put(valBytes) .array(); }

Target:
public byte[] getCacheKey() { byte[] dimBytes = StringUtils.toUtf8(this.dimension); byte[] valBytes = StringUtils.toUtf8(this.value); return ByteBuffer.allocate(2 + dimBytes.length + valBytes.length) .put(CACHE_KEY) .put(dimBytes) .put(STRING_SEPARATOR) .put(valBytes) .array(); }
Source:
protected int tryAcquireShared(int ignore) { return getState() >= STARTED ? 1 : -1; }

Target:
protected int tryAcquireShared(int ignore) { return getState() > STARTED ? 1 : -1; }
Source:
public void checkSamplefn5NaN(){ final String expression = "fn:arrayNaN(\"x\", 5)"; boolean success = true; StringBuffer sb = new StringBuffer(""); try{ double[] result = performExpression(expression); for (double value: result){ sb.append(value+","); } success = Double.isNaN(result[0]) && Double.isNaN(result[1]) && Double.isNaN(result[2]) && Double.isNaN(result[3]) && Double.isNaN(result[4]) && (result[5] == 5) && (result[6] == 6); } catch (Exception e){ e.printStackTrace(); success = false; } System.out.println("JEXLExpressionEngineEnhancedTest: expression="+expression +"\n result "+sb.toString()); assertTrue(success); }

Target:
public void checkSamplefn5NaN() { final String expression = "fn:arrayNaN(\"x\", 5)"; StringBuffer sb = new StringBuffer(""); try{ double[] result = performExpression(expression); for (double value: result){ sb.append(value+","); } System.out.println("JEXLExpressionEngineEnhancedTest: expression="+expression +"\n result "+sb.toString()); assertEquals(Double.NaN, result[0], DELTA); assertEquals(Double.NaN, result[1], DELTA); assertEquals(Double.NaN, result[2], DELTA); assertEquals(Double.NaN, result[3], DELTA); assertEquals(Double.NaN, result[4], DELTA); assertEquals(5, result[5], DELTA); assertEquals(6, result[6], DELTA); } catch (Exception e){ throw new RuntimeException(e); } }
Source:
public synchronized InetAddress getResolvedDestinationAddress() throws UnknownHostException { this.resolvedDestinationAddress = InetAddress.getByName(this.unresolvedDestinationAddress); return this.resolvedDestinationAddress; }

Target:
public synchronized InetAddress getResolvedDestinationAddress() throws UnknownHostException { if (this.resolvedDestinationAddress != null) { return this.resolvedDestinationAddress; } return InetAddress.getByName(this.unresolvedDestinationAddress); }
Source:
private Map<String, ResourceAssignment> calculateAssignment(ClusterModel clusterModel, RebalanceAlgorithm algorithm) throws HelixRebalanceException { long startTime = System.currentTimeMillis(); LOG.info("Start calculating for an assignment"); OptimalAssignment optimalAssignment = algorithm.calculate(clusterModel); Map<String, ResourceAssignment> newAssignment = optimalAssignment.getOptimalResourceAssignment(); LOG.info("Finish calculating an assignment. Took: ms.", System.currentTimeMillis() - startTime); return newAssignment; }

Target:
private Map<String, ResourceAssignment> calculateAssignment(ClusterModel clusterModel, RebalanceAlgorithm algorithm) throws HelixRebalanceException { long startTime = System.currentTimeMillis(); LOG.info("Start calculating for an assignment with algorithm {}", algorithm.getClass().getSimpleName()); OptimalAssignment optimalAssignment = algorithm.calculate(clusterModel); Map<String, ResourceAssignment> newAssignment = optimalAssignment.getOptimalResourceAssignment(); LOG.info("Finish calculating an assignment with algorithm {}. Took: ms.", algorithm.getClass().getSimpleName(), System.currentTimeMillis() - startTime); return newAssignment; }
Source:
public void dispose() throws Exception { latch.awaitFinished(); if (controller.isConnected()) controller.disconnect(); }

Target:
public void dispose() throws Exception { if (controller.isConnected()) controller.disconnect(); }
Source:
public void enforceRequiredVariables() { VariableScope variableScope = getVariableScope(); for (Variable variable : variableScope.getVariables()) { String name = variable.getName(); if (variableScope.isRequired(name)) { if (name.startsWith(VariableScope.CASE_FILE_PREFIX)) { if (!findCaseData(variable.getName())) { throw new VariableViolationException(getProcessInstance().getId(), name, "Case file item '" + name + "' is required but not set"); } } else if (!variables.containsKey(name)) { throw new VariableViolationException(getProcessInstance().getId(), variable.getName(), "Variable '" + variable.getName() + "' is required but not set"); } } } }

Target:
public void enforceRequiredVariables() { VariableScope variableScope = getVariableScope(); for (Variable variable : variableScope.getVariables()) { String name = variable.getName(); if (variableScope.isRequired(name)) { if (name.startsWith(VariableScope.CASE_FILE_PREFIX)) { if (!findCaseData(name)) { throw new VariableViolationException(getProcessInstance().getId(), name, "Case file item '" + name + "' is required but not set"); } } else if (!variables.containsKey(name)) { throw new VariableViolationException(getProcessInstance().getId(), name, "Variable '" + name + "' is required but not set"); } } } }
Source:
public int hashCode() { int result = taskName != null ? taskName.hashCode() : 0; result = 31 * result + (description != null ? description.hashCode() : 0); result = 31 * result + hashCode; return result; }

Target:
public int hashCode() { int result = taskName != null ? taskName.hashCode() : 0; result = 31 * result + (description != null ? description.hashCode() : 0); result = 31 * result + uniqueId; return result; }
Source:
private static XeSource source(final Doc doc, final String name, final Request req) throws IOException { final Href home = new RqHref.Base(req).href() .path("doc").with("file", name); final Attributes attrs = doc.attributes(); return new XeAppend( "doc", new XeChain( new XeDirectives( new Directives() .add("name").set(name).up() .add("size").set(Long.toString(attrs.size())).up() .add("created") .set(Long.toString(attrs.created().getTime())).up() .add("type").set(attrs.type()).up() .add("name").set(name) ), new XeLink("read", home.path("read")), new XeLink("shortlink", new Href(doc.shortUrl())), new XeLink("delete", home.path("delete")), new XeLink("add-friend", home.path("add-friend")), new XeAppend( "friends", new XeTransform<>( doc.friends().names(), new XeTransform.Func<String>() { @Override public XeSource transform(final String friend) { return TkDocs.source(friend, home); } } ) ) ) ); }

Target:
private static XeSource source(final Doc doc, final String name, final Request req) throws IOException { final Href home = new RqHref.Base(req).href() .path("doc").with("file", name); final Attributes attrs = doc.attributes(); return new XeAppend( "doc", new XeChain( new XeDirectives( new Directives() .add("name").set(name).up() .add("size").set(Long.toString(attrs.size())).up() .add("created") .set(Long.toString(attrs.created().getTime())).up() .add("type").set(attrs.type()).up() .add("name").set(name) ), new XeLink("read", home.path("read")), new XeLink("short", new Href(doc.shortUrl())), new XeLink("delete", home.path("delete")), new XeLink("add-friend", home.path("add-friend")), new XeAppend( "friends", new XeTransform<>( doc.friends().names(), new XeTransform.Func<String>() { @Override public XeSource transform(final String friend) { return TkDocs.source(friend, home); } } ) ) ) ); }
Source:
private void migrate(ItemDAO<Pipeline> dao, Pipeline pipeline, String type) { getStages(pipeline) .stream() .filter(stage -> stage.containsKey("stageTimeoutMs")) .forEach(stage -> stage.put("timeoutMs", stage.get("stageTimeoutMs"))); dao.update(pipeline.getId(), pipeline); log.info("Migrated stage timeouts", type, pipeline.getId()); }

Target:
private void migrate(ItemDAO<Pipeline> dao, Pipeline pipeline, String type) { getStages(pipeline) .stream() .filter(stage -> stage.containsKey("stageTimeoutMs")) .forEach(stage -> stage.put("timeoutMs", stage.remove("stageTimeoutMs"))); dao.update(pipeline.getId(), pipeline); log.info("Migrated stage timeouts", type, pipeline.getId()); }
Source:
public void testShowPopulatedScreenAssets() { when(libraryService.hasAssets(any(WorkspaceProject.class))).thenReturn(true); this.assetsScreen.init(); verify(emptyAssetsScreen, never()).getView(); verify(populatedAssetsScreen, times(1)).getView(); verify(view).setContent(populatedAssetsScreen.getView().getElement()); assertThat(assetsScreen.isEmpty(), CoreMatchers.is(false)); }

Target:
public void testShowPopulatedScreenAssets() { when(libraryService.hasAssets(any(WorkspaceProject.class))).thenReturn(true); this.assetsScreen.init(); verify(emptyAssetsScreen, never()).getView(); verify(populatedAssetsScreen, times(1)).getView(); verify(view).setContent(populatedAssetsScreen.getView().getElement()); assertFalse(assetsScreen.isEmpty()); }