auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void doManualAck(LinkedList<MessageHeaders> messageHeadersList) { Iterator<MessageHeaders> iterator = messageHeadersList.iterator(); Map<Object, Long> channelsToAck = new HashMap<Object, Long>(); while(iterator.hasNext()) { MessageHeaders messageHeaders = iterator.next(); if (messageHeaders.containsKey(AmqpHeaders.CHANNEL)) { Channel channel = (com.rabbitmq.client.Channel) messageHeaders.get(AmqpHeaders.CHANNEL); Long deliveryTag = (Long) messageHeaders.get(AmqpHeaders.DELIVERY_TAG); channelsToAck.put(channel, deliveryTag); } } for (Map.Entry<Object, Long> entry : channelsToAck.entrySet()) { try { Channel channel = (Channel) entry.getKey(); channel.basicAck(entry.getValue(), true); } catch (IOException e) { logger.error("Exception while manually acknowledging " + e); } } }

Target:
public void doManualAck(LinkedList<MessageHeaders> messageHeadersList) { Iterator<MessageHeaders> iterator = messageHeadersList.iterator(); Map<Object, Long> channelsToAck = new HashMap<Object, Long>(); while(iterator.hasNext()) { MessageHeaders messageHeaders = iterator.next(); if (messageHeaders.containsKey(AmqpHeaders.CHANNEL)) { Channel channel = (com.rabbitmq.client.Channel) messageHeaders.get(AmqpHeaders.CHANNEL); Long deliveryTag = (Long) messageHeaders.get(AmqpHeaders.DELIVERY_TAG); channelsToAck.put(channel, deliveryTag); } } for (Map.Entry<Object, Long> entry : channelsToAck.entrySet()) { try { ((Channel) entry.getKey()).basicAck(entry.getValue(), true); } catch (IOException e) { logger.error("Exception while manually acknowledging " + e); } } }
Source:
public void testArrayRemoveFunctionVarcharFromCharArray() throws Exception { ResultSet rs = conn.createStatement().executeQuery( "SELECT ARRAY_REMOVE(chars,varchar1) FROM " + tableName + " WHERE region_name = 'SF Bay Area'"); assertTrue(rs.next()); assertEquals(conn.createArrayOf("CHAR", new String[] { "a", "c", "ddd", "e", "c" }), rs.getArray(1)); assertFalse(rs.next()); }

Target:
public void testArrayRemoveFunctionVarcharFromCharArray() throws Exception { ResultSet rs = conn.createStatement().executeQuery( "SELECT ARRAY_REMOVE(chars,varchar1) FROM " + tableName + " WHERE region_name = 'SF Bay Area'"); assertTrue(rs.next()); assertEquals(conn.createArrayOf("CHAR", new String[] { "bbbb", "c", "ddd", "e", "c" }), rs.getArray(1)); assertFalse(rs.next()); }
Source:
private Optional<String> addExplicitEquivalence(Content from, Content to) { if (from.getEquivalentTo().contains(LookupRef.from(to))) { return Optional.empty(); } Set<LookupRef> newExplicits = new HashSet<>(from.getEquivalentTo()); newExplicits.add(LookupRef.from(to)); writeExecutor.updateExplicitEquivalence(from, publishers(newExplicits), newExplicits); return Optional.of(encodeId(from.getId())); }

Target:
private Optional<ExplicitEquivalenceResponse.EquivalenceLink> addExplicitEquivalence(Content from, Content to) { if (from.getEquivalentTo().contains(LookupRef.from(to))) { return Optional.empty(); } Set<LookupRef> newExplicits = new HashSet<>(from.getEquivalentTo()); newExplicits.add(LookupRef.from(to)); writeExecutor.updateExplicitEquivalence(from, publishers(newExplicits), newExplicits); return Optional.of( new ExplicitEquivalenceResponse.EquivalenceLink( encodeId(from.getId()), encodeId(to.getId()) )); }
Source:
public Set<Tuple> zRangeByScoreWithScores(byte[] key, Range range, Limit limit) { Assert.notNull(range, "Range cannot be null for ZRANGEBYSCOREWITHSCORES."); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getMin(), JedisConverters.toBytes("-inf")); byte[] max = JedisConverters.boundaryToBytesForZRange(range.getMax(), JedisConverters.toBytes("+inf")); try { if (isPipelined()) { if (limit != null) { pipeline(new JedisResult( pipeline.zrangeByScoreWithScores(key, min, max, limit.getOffset(), limit.getCount()), JedisConverters.tupleSetToTupleSet())); } else { pipeline(new JedisResult(pipeline.zrangeByScoreWithScores(key, min, max), JedisConverters.tupleSetToTupleSet())); } return null; } if (isQueueing()) { if (limit != null) { transaction(new JedisResult(transaction.zrangeByScoreWithScores(key, min, max, limit.getOffset(), limit.getCount()), JedisConverters.tupleSetToTupleSet())); } else { transaction(new JedisResult(transaction.zrangeByScoreWithScores(key, min, max), JedisConverters.tupleSetToTupleSet())); } return null; } if (limit != null) { return JedisConverters.toTupleSet(jedis.zrangeByScoreWithScores(key, min, max, limit.getOffset(), limit.getCount())); } return JedisConverters.toTupleSet(jedis.zrangeByScoreWithScores(key, min, max)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }

Target:
public Set<Tuple> zRangeByScoreWithScores(byte[] key, Range range, Limit limit) { Assert.notNull(range, "Range cannot be null for ZRANGEBYSCOREWITHSCORES."); byte[] min = JedisConverters.boundaryToBytesForZRange(range.getMin(), JedisConverters.NEGATIVE_INFINITY_BYTES); byte[] max = JedisConverters.boundaryToBytesForZRange(range.getMax(), JedisConverters.POSITIVE_INFINITY_BYTES); try { if (isPipelined()) { if (limit != null) { pipeline(new JedisResult( pipeline.zrangeByScoreWithScores(key, min, max, limit.getOffset(), limit.getCount()), JedisConverters.tupleSetToTupleSet())); } else { pipeline(new JedisResult(pipeline.zrangeByScoreWithScores(key, min, max), JedisConverters.tupleSetToTupleSet())); } return null; } if (isQueueing()) { if (limit != null) { transaction(new JedisResult(transaction.zrangeByScoreWithScores(key, min, max, limit.getOffset(), limit.getCount()), JedisConverters.tupleSetToTupleSet())); } else { transaction(new JedisResult(transaction.zrangeByScoreWithScores(key, min, max), JedisConverters.tupleSetToTupleSet())); } return null; } if (limit != null) { return JedisConverters.toTupleSet(jedis.zrangeByScoreWithScores(key, min, max, limit.getOffset(), limit.getCount())); } return JedisConverters.toTupleSet(jedis.zrangeByScoreWithScores(key, min, max)); } catch (Exception ex) { throw convertJedisAccessException(ex); } }
Source:
public BackdropNode(Context context) { backdropProvider = context.get(BackdropProvider.class); renderingConfig = context.get(Config.class).getRendering(); worldProvider = context.get(WorldProvider.class); worldRenderer = context.get(WorldRenderer.class); Camera playerCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThroughNormalized(playerCamera)); initSkysphere(playerCamera.getzFar() < RADIUS ? playerCamera.getzFar() : RADIUS); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); addDesiredStateChange(new BindFBO(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new SetFboWriteMask(true, false, false, READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial(SKY_MATERIAL)); addDesiredStateChange(new DisableDepthWriting()); addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); skyMaterial = getMaterial(SKY_MATERIAL); int textureSlot = 0; addDesiredStateChange(new SetInputTexture(textureSlot++, Assets.getTexture("engine:sky90").get().getId(), SKY_MATERIAL, "texSky90")); addDesiredStateChange(new SetInputTexture(textureSlot, Assets.getTexture("engine:sky180").get().getId(), SKY_MATERIAL, "texSky180")); }

Target:
public BackdropNode(Context context) { backdropProvider = context.get(BackdropProvider.class); worldRenderer = context.get(WorldRenderer.class); SubmersibleCamera activeCamera = worldRenderer.getActiveCamera(); addDesiredStateChange(new LookThroughNormalized(activeCamera)); initSkysphere(activeCamera.getzFar() < RADIUS ? activeCamera.getzFar() : RADIUS); wireframeStateChange = new SetWireframe(true); RenderingDebugConfig renderingDebugConfig = context.get(Config.class).getRendering().getDebug(); new WireframeTrigger(renderingDebugConfig, this); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = context.get(DisplayResolutionDependentFBOs.class); addDesiredStateChange(new BindFbo(READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new SetFboWriteMask(true, false, false, READONLY_GBUFFER, displayResolutionDependentFBOs)); addDesiredStateChange(new EnableMaterial(SKY_MATERIAL)); addDesiredStateChange(new DisableDepthWriting()); addDesiredStateChange(new EnableFaceCulling()); addDesiredStateChange(new SetFacesToCull(GL_FRONT)); skyMaterial = getMaterial(SKY_MATERIAL); int textureSlot = 0; addDesiredStateChange(new SetInputTexture(textureSlot++, "engine:sky90", SKY_MATERIAL, "texSky90")); addDesiredStateChange(new SetInputTexture(textureSlot, "engine:sky180", SKY_MATERIAL, "texSky180")); }
Source:
protected void addResponseHandlers(ChannelPipeline p, Downstream<? super StreamedResponse> downstream) { addHandler(p, "httpResponseHandler", new SimpleChannelInboundHandler<HttpResponse>(false) { private boolean isKeepAlive; @Override protected void channelRead0(ChannelHandlerContext ctx, HttpResponse msg) throws Exception { isKeepAlive = HttpUtil.isKeepAlive(msg); msg.headers().forEach(h -> LOGGER.info(h.getKey() + "=" + h.getValue())); p.channel().config().setAutoRead(false); execution.onComplete(() -> { channelPoolMap.get(baseURI).release(ctx.channel()); if (!subscribedTo.get() && ctx.channel().isOpen()) { if (!isKeepAlive) { ctx.close(); } } }); final Headers headers = new NettyHeadersBackedHeaders(msg.headers()); final Status status = new DefaultStatus(msg.status()); success(downstream, new DefaultStreamedResponse(p, status, headers, isKeepAlive)); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { channelPoolMap.get(baseURI).release(ctx.channel()); if (!isKeepAlive) { LOGGER.error("Closing channel={}", ctx.channel().id().asShortText(), cause); ctx.close(); } error(downstream, cause); } }); }

Target:
protected void addResponseHandlers(ChannelPipeline p, Downstream<? super StreamedResponse> downstream) { addHandler(p, "httpResponseHandler", new SimpleChannelInboundHandler<HttpResponse>(false) { private boolean isKeepAlive; @Override protected void channelRead0(ChannelHandlerContext ctx, HttpResponse msg) throws Exception { isKeepAlive = HttpUtil.isKeepAlive(msg); p.channel().config().setAutoRead(false); execution.onComplete(() -> { channelPoolMap.get(baseURI).release(ctx.channel()); if (!subscribedTo.get() && ctx.channel().isOpen()) { ctx.close(); } }); final Headers headers = new NettyHeadersBackedHeaders(msg.headers()); final Status status = new DefaultStatus(msg.status()); success(downstream, new DefaultStreamedResponse(p, status, headers, isKeepAlive)); } @Override public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws Exception { channelPoolMap.get(baseURI).release(ctx.channel()); ctx.close(); error(downstream, cause); } }); }
Source:
protected void startDebugging(OpenShiftServerBehaviour beh, DebugContext context, IProgressMonitor monitor) { Dialogs.INSTANCE.warn("Node.js 8+ unsupported ", "Debugging is only supported up to Node.js 7. If your Node.js is newer, debugging will not work.\n" + "If using an OpenShift template to create the application, set 'NODEJS_PROPERTY' to '6'", WARN_NEWER_THAN_NODEJS7_UNSUPPORTED); IDebugListener listener = new IDebugListener() { @Override public void onDebugChange(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException { int localPort = startPortForwarding(debuggingContext, monitor); NodeDebugLauncher.launch(beh.getServer(), localPort); } @Override public void onPodRestart(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException { onDebugChange(debuggingContext, monitor); } }; context.setDebugListener(listener); new OpenShiftDebugMode(context).enableDebugging(); }

Target:
protected void startDebugging(OpenShiftServerBehaviour beh, DebugContext context, IProgressMonitor monitor) { Dialogs.INSTANCE.warn("Node.js 8+ unsupported ", "Debugging is only supported up to Node.js 7. If your Node.js is newer, debugging will not work.\n" + "If using an OpenShift template to create the application, set 'NODEJS_PROPERTY' to '7'", WARN_NEWER_THAN_NODEJS7_UNSUPPORTED); IDebugListener listener = new IDebugListener() { @Override public void onDebugChange(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException { int localPort = startPortForwarding(debuggingContext, monitor); NodeDebugLauncher.launch(beh.getServer(), localPort); } @Override public void onPodRestart(DebugContext debuggingContext, IProgressMonitor monitor) throws CoreException { onDebugChange(debuggingContext, monitor); } }; context.setDebugListener(listener); new OpenShiftDebugMode(context).enableDebugging(); }
Source:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { BoxCollaboration collaboration = (BoxCollaboration) mCollaboratorsAdapter.getItem(position); if (collaboration != null) { ArrayList<BoxCollaboration.Role> rolesArr = getRoles(); String collabId = collaboration.getAccessibleBy().getId(); if ((rolesArr == null || rolesArr.size() == 0) && !collabId.equals(mCollaborationsShareVM.getUserId())) { showToast(R.string.box_sharesdk_cannot_get_collaborators); return; } BoxCollaborator collaborator = collaboration.getAccessibleBy(); BoxCollaboration.Role role = collaboration.getRole(); String name = collaborator == null ? getString(R.string.box_sharesdk_another_person) : collaborator.getName(); boolean allowOwner = getItem().getOwnedBy().getId().equals(mCollaborationsShareVM.getUserId()); if (allowOwner){ allowOwner = getItem() instanceof BoxFolder; } mSelectRoleShareVM.setSelectedRole(role); mSelectRoleShareVM.setRoles(rolesArr); mSelectRoleShareVM.setName(name); mSelectRoleShareVM.setAllowRemove(true); mSelectRoleShareVM.setAllowOwnerRole(allowOwner); mSelectRoleShareVM.setCollaboration(collaboration); mCallback.notifySwitchToAccessRoleFragment(); } }

Target:
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { BoxCollaboration collaboration = (BoxCollaboration) mCollaboratorsAdapter.getItem(position); if (collaboration != null) { ArrayList<BoxCollaboration.Role> rolesArr = getRoles(); BoxCollaborator collaborator = collaboration.getAccessibleBy(); String collabId = collaborator == null ? "" : collaborator.getId(); if ((rolesArr == null || rolesArr.size() == 0) && !collabId.equals(mCollaborationsShareVM.getUserId())) { showToast(R.string.box_sharesdk_cannot_get_collaborators); return; } BoxCollaboration.Role role = collaboration.getRole(); String name = collaborator == null ? getString(R.string.box_sharesdk_another_person) : collaborator.getName(); boolean allowOwner = getItem().getOwnedBy().getId().equals(mCollaborationsShareVM.getUserId()); if (allowOwner){ allowOwner = getItem() instanceof BoxFolder; } mSelectRoleShareVM.setSelectedRole(role); mSelectRoleShareVM.setRoles(rolesArr); mSelectRoleShareVM.setName(name); mSelectRoleShareVM.setAllowRemove(true); mSelectRoleShareVM.setAllowOwnerRole(allowOwner); mSelectRoleShareVM.setCollaboration(collaboration); mCallback.notifySwitchToAccessRoleFragment(); } }
Source:
public static void getSpmCandidates(AsyncQuery aQuery, Guid storagePoolId, boolean localFsOnly) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { if (source != null) { ArrayList<VDS> list = Linq.<VDS> cast((ArrayList<IVdcQueryable>) source); return list; } return new ArrayList<VDS>(); } }; Frontend.RunQuery(VdcQueryType.GetSpmCandidates, new GetSpmCandidatesQueryParameters(storagePoolId, localFsOnly), aQuery); }

Target:
public static void getSpmCandidates(AsyncQuery aQuery, Guid storagePoolId, boolean localFsOnly) { aQuery.converterCallback = new IAsyncConverter() { @Override public Object Convert(Object source, AsyncQuery _asyncQuery) { if (source != null) { return source; } return new ArrayList<VDS>(); } }; Frontend.RunQuery(VdcQueryType.GetSpmCandidates, new GetSpmCandidatesQueryParameters(storagePoolId, localFsOnly), aQuery); }
Source:
public void update(VdsDeployConfig cfg) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("cfg_name", cfg.getConfigName()) .addValue("cfg_type", cfg.getConfigType()) .addValue("cfg_value", cfg.getConfigValue()) .addValue("cfg_id", cfg.getConfigId()); getCallsHandler().executeModification("UpdateVdsDeplotConfig", parameterSource); }

Target:
public void update(VdsDeployConfig cfg) { MapSqlParameterSource parameterSource = getCustomMapSqlParameterSource() .addValue("cfg_name", cfg.getConfigName()) .addValue("cfg_type", cfg.getConfigType().toString()) .addValue("cfg_value", cfg.getConfigValue()) .addValue("cfg_id", cfg.getConfigId()); getCallsHandler().executeModification("UpdateVdsDeployConfig", parameterSource); }
Source:
public static String getDefInstallPath () { switch (getCurrentOS()) { case WINDOWS: return "C:\\FTB"; case MACOSX: return System.getProperty("user.home") + "/FTB"; case UNIX: return System.getProperty("user.home") + "/FTB"; default: return System.getProperty("user.home") + System.getProperty("path.separator") + "FTB"; } }

Target:
public static String getDefInstallPath () { switch (getCurrentOS()) { case WINDOWS: String defaultLocation = "C:\\FTB"; File testFile = new File(defaultLocation); if (testFile.canWrite()) { return defaultLocation; } if (testFile.getParentFile().canWrite()) { return defaultLocation; } Logger.logWarn("Can't use default installation location. Using current location of the launcher executable."); case MACOSX: return System.getProperty("user.home") + "/FTB"; case UNIX: return System.getProperty("user.home") + "/FTB"; default: try { CodeSource codeSource = LaunchFrame.class.getProtectionDomain().getCodeSource(); File jarFile; jarFile = new File(codeSource.getLocation().toURI().getPath()); return jarFile.getParentFile().getPath(); } catch (URISyntaxException e) { Logger.logError("Unexcepted error", e); } return System.getProperty("user.home") + System.getProperty("path.separator") + "FTB"; } }
Source:
private VariantContext addGenotypingAnnotations(final Map<String, Object> originalAttributes, final VariantContext newVC) { final Map<String, Object> attrs = new HashMap<>(originalAttributes); attrs.put(GATKVCFConstants.MLE_ALLELE_COUNT_KEY, newVC.getAttribute(GATKVCFConstants.MLE_ALLELE_COUNT_KEY)); attrs.put(GATKVCFConstants.MLE_ALLELE_FREQUENCY_KEY, newVC.getAttribute(GATKVCFConstants.MLE_ALLELE_FREQUENCY_KEY)); if (newVC.hasAttribute(GATKVCFConstants.NUMBER_OF_DISCOVERED_ALLELES_KEY)) attrs.put(GATKVCFConstants.NUMBER_OF_DISCOVERED_ALLELES_KEY, newVC.getAttribute(GATKVCFConstants.NUMBER_OF_DISCOVERED_ALLELES_KEY)); return new VariantContextBuilder(newVC).attributes(attrs).make(); }

Target:
private VariantContext addGenotypingAnnotations(final Map<String, Object> originalAttributes, final VariantContext newVC) { final Map<String, Object> attrs = new LinkedHashMap<>(originalAttributes); attrs.put(GATKVCFConstants.MLE_ALLELE_COUNT_KEY, newVC.getAttribute(GATKVCFConstants.MLE_ALLELE_COUNT_KEY)); attrs.put(GATKVCFConstants.MLE_ALLELE_FREQUENCY_KEY, newVC.getAttribute(GATKVCFConstants.MLE_ALLELE_FREQUENCY_KEY)); if (newVC.hasAttribute(GATKVCFConstants.NUMBER_OF_DISCOVERED_ALLELES_KEY)) { attrs.put(GATKVCFConstants.NUMBER_OF_DISCOVERED_ALLELES_KEY, newVC.getAttribute(GATKVCFConstants.NUMBER_OF_DISCOVERED_ALLELES_KEY)); } return new VariantContextBuilder(newVC).attributes(attrs).make(); }
Source:
public AwsRequestSignature sign() { AwsDates dates = getDates(); String serviceName = Splitter.on(".").split(uri.getHost()).iterator().next(); Map<String, String> canonicalHeaders = getCanonicalHeaders(dates.getOriginalDate()); List<String> sortedHeaders = new ArrayList<>(); for (String k : canonicalHeaders.keySet()) { sortedHeaders.add(k.toLowerCase()); } Collections.sort(sortedHeaders); String canonicalRequestHash = createCanonicalRequestHash(canonicalHeaders, sortedHeaders); String credentialScope = dates.getFormattedDate() + "/" + region + "/" + serviceName + "/" + AWS_REQUEST_TYPE; String stringToSign = createStringToSign(canonicalRequestHash, dates.getAmzDate(), credentialScope); String signature = calculateAwsV4Signature( serviceName, awsSecurityCredentials.getSecretAccessKey(), dates.getFormattedDate(), region, stringToSign); return new AwsRequestSignature.Builder() .setSignature(signature) .setCanonicalHeaders(canonicalHeaders) .setHttpMethod(httpMethod) .setSecurityCredentials(awsSecurityCredentials) .setCredentialScope(credentialScope) .setUrl(uri.toString()) .setDate(dates.getOriginalDate()) .setSortedHeaderNames(sortedHeaders) .setRegion(region) .build(); }

Target:
AwsRequestSignature sign() { String serviceName = Splitter.on(".").split(uri.getHost()).iterator().next(); Map<String, String> canonicalHeaders = getCanonicalHeaders(dates.getOriginalDate()); List<String> sortedHeaderNames = new ArrayList<>(); for (String headerName : canonicalHeaders.keySet()) { sortedHeaderNames.add(headerName.toLowerCase(Locale.US)); } Collections.sort(sortedHeaderNames); String canonicalRequestHash = createCanonicalRequestHash(canonicalHeaders, sortedHeaderNames); String credentialScope = dates.getFormattedDate() + "/" + region + "/" + serviceName + "/" + AWS_REQUEST_TYPE; String stringToSign = createStringToSign(canonicalRequestHash, dates.getXAmzDate(), credentialScope); String signature = calculateAwsV4Signature( serviceName, awsSecurityCredentials.getSecretAccessKey(), dates.getFormattedDate(), region, stringToSign); String authorizationHeader = generateAuthorizationHeader( sortedHeaderNames, awsSecurityCredentials.getAccessKeyId(), credentialScope, signature); return new AwsRequestSignature.Builder() .setSignature(signature) .setCanonicalHeaders(canonicalHeaders) .setHttpMethod(httpMethod) .setSecurityCredentials(awsSecurityCredentials) .setCredentialScope(credentialScope) .setUrl(uri.toString()) .setDate(dates.getOriginalDate()) .setRegion(region) .setAuthorizationHeader(authorizationHeader) .build(); }
Source:
public void openLocationSettings() { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); try { getContext().startActivity(intent); Toast.makeText(getContext(), R.string.set_location_mode_high_accuracy, Toast.LENGTH_LONG).show(); } catch (Exception e) { Toast.makeText(getContext(), R.string.cannot_open_location_settings, Toast.LENGTH_LONG).show(); Timber.e(e); } }

Target:
public void openLocationSettings() { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); PackageManager packageManager = getActivity().getPackageManager(); if (intent.resolveActivity(packageManager)!= null) { startActivity(intent); Toast.makeText(getContext(), R.string.recommend_high_accuracy_mode, Toast.LENGTH_LONG).show(); } else { Toast.makeText(getContext(), R.string.cannot_open_location_settings, Toast.LENGTH_LONG).show(); } }
Source:
public void submit(String eventBody) throws IOException { DatagramSocket socket = new DatagramSocket(); InetAddress address = InetAddress.getByName(this.getHost()); int port = java.lang.Integer.parseInt(this.getName()); byte[] buffer = eventBody.getBytes(); DatagramPacket packet = new DatagramPacket(buffer, buffer.length, address, port); socket.send(packet); socket.close(); }

Target:
public void submit(String eventBody) throws IOException { DatagramSocket socket = new DatagramSocket(); InetAddress address = InetAddress.getByName(this.getHost()); int port = java.lang.Integer.parseInt(this.getName()); byte[] buffer = eventBody.getBytes("UTF8"); DatagramPacket packet = new DatagramPacket(buffer, buffer.length, address, port); socket.send(packet); socket.close(); }
Source:
public PoolPickerResponse getPickersBySearch(@RequestParam("platform") String platform, @RequestParam("query") String query) throws IOException { PlatformType platformType = PlatformType.get(platform); return getPoolPickerWithFilters(100, PaginationFilter.platformType(platformType), PaginationFilter.query(query)); }

Target:
public PoolPickerResponse getPickersBySearch(@RequestParam("platform") String platform, @RequestParam("query") String query) throws IOException { return getPoolPickerWithFilters(100, PaginationFilter.platformType(PlatformType.valueOf(platform)), PaginationFilter.query(query)); }
Source:
private static <T> T createClientToMultipleNodes(Class<T> clazz, List<String> nodeNames, short port) { Collection<String> uris = nodeNames.stream() .map(nodeName -> String.format("http://%s:%s", nodeName, port)) .collect(Collectors.toList()); return AtlasDbHttpClients.createProxyWithFailover( new MetricRegistry(), ImmutableServerListConfig.builder() .addAllServers(uris) .sslConfiguration(SslConfiguration.of(Paths.get("var/security/trustStore.jks"))) .build(), clazz, TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS); }

Target:
private static <T> T createClientToMultipleNodes(Class<T> clazz, List<String> nodeNames, short port) { Collection<String> uris = nodeNames.stream() .map(nodeName -> String.format("http://%s:%s", nodeName, port)) .collect(Collectors.toList()); return AtlasDbHttpClients.createProxyWithFailover( new MetricRegistry(), ImmutableServerListConfig.builder() .addAllServers(uris) .sslConfiguration(SSL_CONFIGURATION) .build(), clazz, TestProxyUtils.AUXILIARY_REMOTING_PARAMETERS); }
Source:
public void stopAndDrainQueueInto(List<Runnable> removedTasks) { stopIfRunning(); synchronized (executeQueueRemoveLock) { clearQueue(executeQueue, removedTasks); } synchronized (scheduleQueue.getModificationLock()) { clearQueue(scheduleQueue, removedTasks); } }

Target:
public void stopAndDrainQueueInto(List<Runnable> removedTasks) { stopIfRunning(); clearQueue(executeQueue, removedTasks); synchronized (scheduleQueue.getModificationLock()) { clearQueue(scheduleQueue, removedTasks); } }
Source:
protected Map<String, List<Object>> extractPersonAttributes(final X509Certificate certificate) { val attributes = new LinkedHashMap<String, List<Object>>(); if (certificate != null) { if (StringUtils.isNotBlank(certificate.getSigAlgOID())) { attributes.put("sigAlgOid", CollectionUtils.wrapList(certificate.getSigAlgOID())); } val subjectDn = certificate.getSubjectDN(); if (subjectDn != null) { attributes.put("subjectDn", CollectionUtils.wrapList(subjectDn.getName())); } val subjectPrincipal = certificate.getSubjectX500Principal(); if (subjectPrincipal != null) { attributes.put("subjectX500Principal", CollectionUtils.wrapList(subjectPrincipal.getName())); } try { val rfc822Email = getRFC822EmailAddress(certificate.getSubjectAlternativeNames()); if (rfc822Email != null) { attributes.put("x509Rfc822Email", CollectionUtils.wrapList(rfc822Email)); } } catch (final CertificateParsingException e) { LOGGER.warn("Error parsing subject alternative names to get rfc822 email {}", e.getMessage()); } } return attributes; }

Target:
protected Map<String, List<Object>> extractPersonAttributes(final X509Certificate certificate) { val attributes = new LinkedHashMap<String, List<Object>>(); if (certificate != null) { if (StringUtils.isNotBlank(certificate.getSigAlgOID())) { attributes.put("sigAlgOid", CollectionUtils.wrapList(certificate.getSigAlgOID())); } val subjectDn = certificate.getSubjectDN(); if (subjectDn != null) { attributes.put("subjectDn", CollectionUtils.wrapList(subjectDn.getName())); } val subjectPrincipal = certificate.getSubjectX500Principal(); if (subjectPrincipal != null) { attributes.put("subjectX500Principal", CollectionUtils.wrapList(subjectPrincipal.getName())); } try { val rfc822Email = getRFC822EmailAddress(certificate.getSubjectAlternativeNames()); if (rfc822Email != null) { attributes.put("x509Rfc822Email", CollectionUtils.wrapList(rfc822Email)); } } catch (final CertificateParsingException e) { LOGGER.warn("Error parsing subject alternative names to get rfc822 email [{}]", e.getMessage()); } } return attributes; }
Source:
@Test public void requestAfterEnqueueFailingThrows() throws IOException, InterruptedException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new ToStringConverterFactory()) .build(); Service service = retrofit.create(Service.class); server.enqueue(new MockResponse()); final AtomicInteger writeCount = new AtomicInteger(); Object a = new Object() { @Override public String toString() { writeCount.incrementAndGet(); throw new RuntimeException("Broken!"); } }; Call<String> call = service.postRequestBody(a); final CountDownLatch latch = new CountDownLatch(1); call.enqueue(new Callback<String>() { @Override public void onResponse(Call<String> call, Response<String> response) { } @Override public void onFailure(Call<String> call, Throwable t) { assertThat(t).isExactlyInstanceOf(RuntimeException.class).hasMessage("Broken!"); assertThat(writeCount.get()).isEqualTo(1); latch.countDown(); } }); assertTrue(latch.await(1, SECONDS)); try { call.request(); } catch (RuntimeException e) { assertThat(e).hasMessage("Broken!"); } assertThat(writeCount.get()).isEqualTo(1); }

Target:
@Test public void requestAfterEnqueueFailingThrows() throws IOException, InterruptedException { Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(new ToStringConverterFactory()) .build(); Service service = retrofit.create(Service.class); server.enqueue(new MockResponse()); final AtomicInteger writeCount = new AtomicInteger(); Object a = new Object() { @Override public String toString() { writeCount.incrementAndGet(); throw new RuntimeException("Broken!"); } }; Call<String> call = service.postRequestBody(a); final CountDownLatch latch = new CountDownLatch(1); call.enqueue(new Callback<String>() { @Override public void onResponse(Call<String> call, Response<String> response) { } @Override public void onFailure(Call<String> call, Throwable t) { assertThat(t).isExactlyInstanceOf(RuntimeException.class).hasMessage("Broken!"); assertThat(writeCount.get()).isEqualTo(1); latch.countDown(); } }); assertTrue(latch.await(1, SECONDS)); try { call.request(); fail(); } catch (RuntimeException e) { assertThat(e).hasMessage("Broken!"); } assertThat(writeCount.get()).isEqualTo(1); }
Source:
private void enableImmutableTables(ConnectionQueryServices queryServices, ArrayList<String> immutableList, long startWaitTime) { long endWaitTime = EnvironmentEdgeManager.currentTimeMillis(); long waitMore = getWaitMoreTime(endWaitTime, startWaitTime); while (waitMore>0 && !isWaitComplete) { LOGGER.info("waiting for more " + waitMore + " ms for client cache " + "to expire for immutable tables"); try { startWaitTime = EnvironmentEdgeManager.currentTimeMillis(); Thread.sleep(waitMore); isWaitComplete = true; } catch (InterruptedException e) { endWaitTime = EnvironmentEdgeManager.currentTimeMillis(); waitMore = getWaitMoreTime(endWaitTime, startWaitTime); LOGGER.warning("Sleep before starting index rebuild is interrupted. " + "Attempting to sleep again! " + e.getMessage()); isWaitComplete = false; } } for (String dataTableFullName: immutableList) { try (Admin admin = queryServices.getAdmin()) { HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); enableTable(admin, dataTableFullName, indexes); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while enabling immutable table " + e); tablesAndIndexes.remove(dataTableFullName); immutableList.remove(dataTableFullName); throw new RuntimeException("Manually enable the following tables " + getSubListString(immutableList, dataTableFullName) + " and run the index rebuild ", e); } } }

Target:
private void enableImmutableTables(ConnectionQueryServices queryServices, ArrayList<String> immutableList, long startWaitTime) { while(true) { long waitMore = getWaitMoreTime(startWaitTime); if (waitMore <= 0) { isWaitComplete = true; break; } try { Thread.sleep(waitMore); isWaitComplete = true; } catch(InterruptedException e) { LOGGER.warning("Sleep before starting index rebuild is interrupted. " + "Attempting to sleep again! " + e.getMessage()); } } for (String dataTableFullName: immutableList) { try (Admin admin = queryServices.getAdmin()) { HashSet<String> indexes = tablesAndIndexes.get(dataTableFullName); enableTable(admin, dataTableFullName, indexes); } catch (IOException | SQLException e) { LOGGER.severe("Something went wrong while enabling immutable table " + e); tablesAndIndexes.remove(dataTableFullName); immutableList.remove(dataTableFullName); throw new RuntimeException("Manually enable the following tables " + getSubListString(immutableList, dataTableFullName) + " and run the index rebuild ", e); } } }
Source:
private synchronized void setVersion() { ClassLoader classLoader = getClass().getClassLoader(); if (classLoader == null) { version.set("dev"); return; } try { Enumeration<URL> resources = classLoader.getResources("META-INF/MANIFEST.MF"); while (resources.hasMoreElements()) { try (InputStream is = resources.nextElement().openStream()) { Manifest manifest = new Manifest(is); boolean minioManifestFound; for (Map.Entry<Object, Object> entry : manifest.getMainAttributes().entrySet()) { String key = entry.getKey().toString(); String value = entry.getValue().toString(); minioManifestFound = key.equals(META_INF_ATTRIB_IMPLEMENTATION_TITLE) && value.equals(META_INF_ATTRIB_IMPLEMENTATION_TITLE_VALUE); if (minioManifestFound) { version.set( manifest.getMainAttributes().getValue(META_INF_ATTRIB_IMPLEMENTATION_VERSION)); return; } } } } } catch (IOException e) { LOGGER.log(Level.SEVERE, "IOException occured", e); version.set("unknown"); return; } version.set("dev"); }

Target:
private synchronized void setVersion() { if (version.get() != null) { return; } version.set("dev"); ClassLoader classLoader = getClass().getClassLoader(); if (classLoader == null) { return; } try { Enumeration<URL> resources = classLoader.getResources("META-INF/MANIFEST.MF"); while (resources.hasMoreElements()) { try (InputStream is = resources.nextElement().openStream()) { Manifest manifest = new Manifest(is); if ("minio".equals(manifest.getMainAttributes().getValue("Implementation-Title"))) { version.set(manifest.getMainAttributes().getValue("Implementation-Version")); return; } } } } catch (IOException e) { LOGGER.log(Level.SEVERE, "IOException occurred", e); version.set("unknown"); } }
Source:
public void mergeAndStore(MavenArtifact artifact, Metadata mergeMetadata) throws IOException, XmlPullParserException, NoSuchAlgorithmException, ProviderImplementationException { RepositoryPath repositoryPath = artifact.getPath(); Repository repository = repositoryPath.getRepository(); ArtifactCoordinates coordinates = RepositoryFiles.readCoordinates(repositoryPath); LayoutProvider layoutProvider = getLayoutProvider(repository, layoutProviderRegistry); if (!layoutProvider.containsArtifact(repository, coordinates)) { throw new IOException("Artifact " + artifact.toString() + " does not exist in repository " + repository + " !"); } RepositoryPath artifactBasePath = repositoryPath.getParent().getParent(); logger.debug("Artifact merge metadata triggered for " + artifact.toString() + "(" + artifactBasePath + "). " + repository.getType()); try { Metadata metadata = readMetadata(artifact); mergeAndStore(artifactBasePath, metadata, mergeMetadata); } catch (FileNotFoundException e) { logger.error(e.getMessage(), e); throw new IOException("Artifact " + artifact.toString() + " doesn't contain any metadata," + " therefore we can't merge the metadata!"); } }

Target:
public void mergeAndStore(MavenArtifact artifact, Metadata mergeMetadata) throws IOException, XmlPullParserException, NoSuchAlgorithmException, ProviderImplementationException { RepositoryPath repositoryPath = artifact.getPath(); Repository repository = repositoryPath.getRepository(); LayoutProvider layoutProvider = getLayoutProvider(repository, layoutProviderRegistry); if (!layoutProvider.containsPath(repositoryPath)) { throw new IOException("Artifact " + artifact.toString() + " does not exist in repository " + repository + " !"); } RepositoryPath artifactBasePath = repositoryPath.getParent().getParent(); logger.debug("Artifact merge metadata triggered for " + artifact.toString() + "(" + artifactBasePath + "). " + repository.getType()); try { Metadata metadata = readMetadata(artifact); mergeAndStore(artifactBasePath, metadata, mergeMetadata); } catch (FileNotFoundException e) { logger.error(e.getMessage(), e); throw new IOException("Artifact " + artifact.toString() + " doesn't contain any metadata," + " therefore we can't merge the metadata!"); } }
Source:
public void testGrabChecksumFromDockerHub() { final ApiClient webClient = getWebClient(USER_2_USERNAME, testingPostgres); ContainersApi toolApi = new ContainersApi(webClient); ContainertagsApi toolTagsApi = new ContainertagsApi(webClient); DockstoreTool tool = createManualDockerHubTool(); tool.setDefaultDockerfilePath("/Dockerfile"); tool.setDefaultCwlPath("/Docstore.cwl"); tool = toolApi.registerManual(tool); tool = addDockerHubTag(tool, toolTagsApi, toolApi); List<Tag> tags = toolApi.getContainer(tool.getId(), null).getWorkflowVersions(); for (Tag tag: tags) { assertNotNull(tag.getImages().get(0).getChecksums().get(0).getType()); assertNotNull(tag.getImages().get(0).getChecksums().get(0).getChecksum()); } String imageID = tags.get(0).getImages().get(0).getImageID(); final long count = testingPostgres.runSelectStatement("select count(*) from image", long.class); testingPostgres.runUpdateStatement("update image set image_id = 'dummyid'"); assertEquals("dummyid", toolApi.getContainer(tool.getId(), null).getWorkflowVersions().get(0).getImages().get(0).getImageID()); toolApi.refresh(tool.getId()); final long count2 = testingPostgres.runSelectStatement("select count(*) from image", long.class); assertEquals(imageID, toolApi.getContainer(tool.getId(), null).getWorkflowVersions().get(0).getImages().get(0).getImageID()); assertEquals(count, count2); }

Target:
public void testGrabChecksumFromDockerHub() { final ApiClient webClient = getWebClient(USER_2_USERNAME, testingPostgres); ContainersApi toolApi = new ContainersApi(webClient); ContainertagsApi toolTagsApi = new ContainertagsApi(webClient); DockstoreTool tool = createManualDockerHubTool(); tool.setDefaultDockerfilePath("/Dockerfile"); tool.setDefaultCwlPath("/Docstore.cwl"); tool = toolApi.registerManual(tool); tool = addDockerHubTag(tool, toolTagsApi, toolApi); List<Tag> tags = toolApi.getContainer(tool.getId(), null).getWorkflowVersions(); for (Tag tag: tags) { String hashType = tag.getImages().get(0).getChecksums().get(0).getType(); String checksum = tag.getImages().get(0).getChecksums().get(0).getChecksum(); assertNotNull(hashType); assertFalse(hashType.isEmpty()); assertNotNull(checksum); assertFalse(checksum.isEmpty()); } String imageID = tags.get(0).getImages().get(0).getImageID(); final long count = testingPostgres.runSelectStatement("select count(*) from image", long.class); testingPostgres.runUpdateStatement("update image set image_id = 'dummyid'"); assertEquals("dummyid", toolApi.getContainer(tool.getId(), null).getWorkflowVersions().get(0).getImages().get(0).getImageID()); toolApi.refresh(tool.getId()); final long count2 = testingPostgres.runSelectStatement("select count(*) from image", long.class); assertEquals(imageID, toolApi.getContainer(tool.getId(), null).getWorkflowVersions().get(0).getImages().get(0).getImageID()); assertEquals(count, count2); }
Source:
public DataSegment uploadDataSegment( DataSegment segment, final int binaryVersion, final long size, final File compressedSegmentData, final File descriptorFile, final Map<String, String> azurePaths ) throws StorageException, IOException, URISyntaxException { azureStorage.uploadBlob(compressedSegmentData, config.getContainer(), azurePaths.get("index"), true); azureStorage.uploadBlob(descriptorFile, config.getContainer(), azurePaths.get("descriptor"), true); final DataSegment outSegment = segment .withSize(size) .withLoadSpec(this.makeLoadSpec(new URI(azurePaths.get("index")))) .withBinaryVersion(binaryVersion); log.info("Deleting file [%s]", compressedSegmentData); compressedSegmentData.delete(); log.info("Deleting file [%s]", descriptorFile); descriptorFile.delete(); return outSegment; }

Target:
public DataSegment uploadDataSegment( DataSegment segment, final int binaryVersion, final long size, final File compressedSegmentData, final File descriptorFile, final Map<String, String> azurePaths ) throws StorageException, IOException, URISyntaxException { azureStorage.uploadBlob(compressedSegmentData, config.getContainer(), azurePaths.get("index")); azureStorage.uploadBlob(descriptorFile, config.getContainer(), azurePaths.get("descriptor")); final DataSegment outSegment = segment .withSize(size) .withLoadSpec(this.makeLoadSpec(new URI(azurePaths.get("index")))) .withBinaryVersion(binaryVersion); log.info("Deleting file [%s]", compressedSegmentData); compressedSegmentData.delete(); log.info("Deleting file [%s]", descriptorFile); descriptorFile.delete(); return outSegment; }
Source:
public Object evaluate(DeferredObject[] arguments) throws HiveException { result.clear(); UserAgent browser = null; Device device = null; OS os = null; try { if (arguments.length > 0 && argumentOIs.length > 0 && argumentOIs[0] != null && arguments[0] != null) { Client c; String pattern = ((StringObjectInspector) argumentOIs[0]) .getPrimitiveJavaObject(arguments[0].get()); c = cachingParser.parse(pattern); if (c != null) { browser = c.userAgent; device = c.device; os = c.os; } } } catch (Exception e) { LOG.error(e.getMessage(),e); } if (browser != null) { result.put("browser_family", replaceNA(browser.family)); result.put("browser_major", replaceNA(browser.major)); } else { result.put("browser_family", NA); result.put("browser_major", NA); } if (device != null) { result.put("device_family", replaceNA(device.family)); } else { result.put("device_family", NA); } if (os != null) { result.put("os_family", replaceNA(os.family)); result.put("os_major", replaceNA(os.major)); result.put("os_minor", replaceNA(os.minor)); } else { result.put("os_family", NA); result.put("os_major", NA); result.put("os_minor", NA); } return result; }

Target:
public Object evaluate(DeferredObject[] arguments) throws HiveException { result.clear(); UserAgent browser = null; Device device = null; OS os = null; try { if (arguments.length > 0 && argumentOI != null && arguments[0] != null) { Client c; String pattern = ((StringObjectInspector) argumentOI) .getPrimitiveJavaObject(arguments[0].get()); c = cachingParser.parse(pattern); if (c != null) { browser = c.userAgent; device = c.device; os = c.os; } } } catch (Exception e) { Log.error(e.getMessage(), e); } if (browser != null) { result.put("browser_family", replaceNA(browser.family)); result.put("browser_major", replaceNA(browser.major)); } else { result.put("browser_family", NA); result.put("browser_major", NA); } if (device != null) { result.put("device_family", replaceNA(device.family)); } else { result.put("device_family", NA); } if (os != null) { result.put("os_family", replaceNA(os.family)); result.put("os_major", replaceNA(os.major)); result.put("os_minor", replaceNA(os.minor)); } else { result.put("os_family", NA); result.put("os_major", NA); result.put("os_minor", NA); } return result; }
Source:
private static boolean shouldFetchLogFileInformation() { if (rootFileAppender != null && isErrorLevelEnable() && rootFileAppender.getImmediateFlush()) { return true; } logger .debug("can't retrieve log file information as there is no single fileAppender with immediateFlust set to true and log level set to ERROR or greater"); return false; }

Target:
private static boolean shouldFetchLogFileInformation() { if (fileAppender != null && isErrorLevelEnable() && fileAppender.getImmediateFlush()) { return true; } logger.warn( "Log information is unavailable. To enable log information log4j/logging should be configured with single FileAppender that has immediateFlush set to true and log level set to ERROR or greater."); return false; }
Source:
private void assertObisCode( final com.alliander.osgp.adapter.ws.schema.smartmetering.common.ObisCodeValues actualObisCode, final ObisCodeValues sourceObisCode) throws AssertionError { assertEquals(sourceObisCode.getA(), actualObisCode.getA()); assertEquals(sourceObisCode.getB(), actualObisCode.getB()); assertEquals(sourceObisCode.getC(), actualObisCode.getC()); assertEquals(sourceObisCode.getD(), actualObisCode.getD()); assertEquals(sourceObisCode.getE(), actualObisCode.getE()); assertEquals(sourceObisCode.getF(), actualObisCode.getF()); }

Target:
private void assertObisCode( final com.alliander.osgp.adapter.ws.schema.smartmetering.common.ObisCodeValues actualObisCode, final ObisCodeValues sourceObisCode) throws AssertionError { assertEquals(MAPPED_FIELD_VALUE_MESSAGE, sourceObisCode.getA(), actualObisCode.getA()); assertEquals(MAPPED_FIELD_VALUE_MESSAGE, sourceObisCode.getB(), actualObisCode.getB()); assertEquals(MAPPED_FIELD_VALUE_MESSAGE, sourceObisCode.getC(), actualObisCode.getC()); assertEquals(MAPPED_FIELD_VALUE_MESSAGE, sourceObisCode.getD(), actualObisCode.getD()); assertEquals(MAPPED_FIELD_VALUE_MESSAGE, sourceObisCode.getE(), actualObisCode.getE()); assertEquals(MAPPED_FIELD_VALUE_MESSAGE, sourceObisCode.getF(), actualObisCode.getF()); }
Source:
public String describe() { return "RabbitIndexWriter\n" + "\t" + RabbitMQConstants.SERVER_HOST + " : Host of RabbitMQ server\n" + "\t" + RabbitMQConstants.SERVER_PORT + " : Port of RabbitMQ server\n" + "\t" + RabbitMQConstants.SERVER_VIRTUAL_HOST + " : Virtualhost name\n" + "\t" + RabbitMQConstants.SERVER_USERNAME + " : Username for authentication\n" + "\t" + RabbitMQConstants.SERVER_PASSWORD + " : Password for authentication\n" + "\t" + RabbitMQConstants.COMMIT_SIZE + " : Buffer size when sending to RabbitMQ (default 250)\n"; }

Target:
public String describe() { StringBuilder sb = new StringBuilder("RabbitIndexWriter\n"); sb.append("\t").append(RabbitMQConstants.SERVER_HOST) .append(" : Host of RabbitMQ server\n"); sb.append("\t").append(RabbitMQConstants.SERVER_PORT) .append(" : Port of RabbitMQ server\n"); sb.append("\t").append(RabbitMQConstants.SERVER_VIRTUAL_HOST) .append(" : Virtualhost name\n"); sb.append("\t").append(RabbitMQConstants.SERVER_USERNAME) .append(" : Username for authentication\n"); sb.append("\t").append(RabbitMQConstants.SERVER_PASSWORD) .append(" : Password for authentication\n"); sb.append("\t").append(RabbitMQConstants.COMMIT_SIZE) .append(" : Buffer size when sending to RabbitMQ (default 250)\n"); return sb.toString(); }
Source:
public static String constructServiceUrl(final HttpServletRequest request, final HttpServletResponse response, final String service, final String serverNames, final String artifactParameterName, final boolean encode) { final Set<String> serviceParameterSet = new HashSet<String>(4); for (final Protocol protocol : Protocol.values()) { serviceParameterSet.add(protocol.getServiceParameterName()); } final String serviceParameterNames = serviceParameterSet.toString() .replaceAll("\\[|\\]", "") .replaceAll("\\s", ""); return constructServiceUrl(request, response, service, serverNames, serviceParameterNames , artifactParameterName, encode); }

Target:
public static String constructServiceUrl(final HttpServletRequest request, final HttpServletResponse response, final String service, final String serverNames, final String artifactParameterName, final boolean encode) { return constructServiceUrl(request, response, service, serverNames, SERVICE_PARAMETER_NAMES , artifactParameterName, encode); }
Source:
public UsageRecordList getUsageRecords(UsageRecordList.Type type) { return this.getUsageRecords(new HashMap<String, String>(), type); }

Target:
public UsageRecordList getUsageRecords(UsageRecordList.Type type) { return this.getUsageRecords(Collections.<String, String>emptyMap(), type); }
Source:
public void openWith(String editor) { select(); new ContextMenu("Open With", "Other...").select(); ; new WaitUntil(new ShellWithTextIsAvailable("Editor Selection")); new DefaultTreeItem(editor).select(); new OkButton().click(); new WaitWhile(new ShellWithTextIsAvailable("Editor Selection")); }

Target:
public void openWith(String editor) { select(); new ContextMenu("Open With", "Other...").select(); Shell shell = new DefaultShell("Editor Selection"); new DefaultTreeItem(editor).select(); new OkButton().click(); new WaitWhile(new ShellIsAvailable(shell)); }